This project aims to classify images of various wildlife species using a deep learning model. The model leverages TensorFlow and Keras to build and train a custom image classifier based on the MobileNetV2 architecture.
- Data Augmentation: Applied to improve model generalization.
- Pre-trained Model: Uses MobileNetV2 as a feature extractor.
- Training & Validation: Includes scripts for training and evaluating the model.
- Model Saving & Loading: Save and reload the model for future use.
- TensorFlow.js Conversion: Convert the model to TensorFlow.js for use in web applications.
- Clone the Repository:
git clone https://github.com/Vidit-Kushwaha/Wildlife-Species-Classification-Model.git
cd wildlife-species-classification
- Google Colab Setup:
If using Google Colab, mount your Google Drive and install TensorFlow Hub:
from google.colab import drive
drive.mount('/content/drive')
!pip install tensorflow_hub
- Prepare Your Data:
Place your images in a directory structure like this:
Copy code
data/
train/
class1/
img1.jpg
img2.jpg
class2/
img1.jpg
img2.jpg
val/
class1/
img1.jpg
img2.jpg
class2/
img1.jpg
img2.jpg
- Run Training:
Open the Jupyter notebook or Python script and execute the cells to train the model. The script includes data augmentation, model training, and evaluation.
- Evaluate and Save the Model:
After training, the model’s performance will be evaluated, and the model will be saved as wildlife_classifier.h5.
- Convert to TensorFlow.js:
To use the model in a web application, convert it using TensorFlow.js:
Copy code
pip install tensorflowjs
tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model --weight_shard_size_bytes=4194304 path/to/saved_model tfjsmodel/
- Example To run inference on a new image, use the provided code snippets or functions in the Jupyter notebook.
Feel free to fork the repository and submit pull requests for improvements. Please follow the standard GitHub workflow for contributions.
This project is licensed under the MIT License. See the LICENSE file for details.
TensorFlow and Keras for providing robust tools for deep learning. TensorFlow Hub for pre-trained models. Google Colab for providing an accessible platform for training and experimentation.