Skip to content

KushangShah/Animal-Classification-Detection

Repository files navigation

Unified Mentor Private Limited
Unified Mentor Private Limited



Typing SVG

Typing SVG



## Table of Contant
  • About this Project.

  • What DataSet cointains?

  • Main library to be used.

  • Visualizations/Chart.

  • Conclusion.

  • Acknowledgment.



About this project

Build a system that can identify the animal in a given image. Explore the data set and identify an appropriate solution.

This project includes:

  • Dataset exploration
  • Image preprocessing
  • Transfer Learning with MobileNetV2
  • Model evaluation
  • Prediction on new images

What the Dataset Contains

Images of domesticated and non domesticated animals are as follow

Location of Images is like this

dataset/ │ ├── Bear/*.jpg ├── Bird/*.jpg ├── Cat/*.jpg ├── Cow/*.jpg ├── Deer/*.jpg ├── Dog/*.jpg ├── Dolphin/*.jpg ├── Elephant/*.jpg ├── Giraffe/*.jpg ├── Horse/*.jpg ├── Kangaroo/*.jpg ├── Lion/*.jpg ├── Panda/*.jpg ├── Tiger/*.jpg └── Zebra/*.jpg 




Main Libraries Used

sys – for understanding venv and version.

json – for saving report of history of models evaluation.

NumPy – For efficient numerical computations, array operations, and mathematical functions.

Matplotlib & Seaborn – For creating visualizations such as histograms, heatmaps, and correlation plots to explore data patterns and relationships.

scikit-learn (sklearn) – The main machine learning library used for:

  • 🎯 Model evaluation (confusion_matrix, Classification_report)
tensorflow – The main machine learning library used for:
  • 🎯 importing images (image_dataset_from_directory)
  • 🎯 Creating model (layers, keras)
  • 🎯 Loading saved model (load_model)




Insights & Visualizations/Chart.

Classification report

 precision recall f1-score support Bear 0.91 0.87 0.89 23 Bird 1.00 0.90 0.95 21 Cat 0.89 0.96 0.92 25 Cow 0.87 0.92 0.89 36 Deer 1.00 0.82 0.90 34 Dog 1.00 0.78 0.88 18 Dolphin 0.92 0.96 0.94 24 Elephant 1.00 0.84 0.91 25 Giraffe 1.00 0.93 0.96 27 Horse 0.79 0.96 0.87 27 Kangaroo 0.76 0.92 0.83 24 Lion 0.97 0.90 0.93 31 Panda 0.85 0.96 0.90 23 Tiger 0.95 1.00 0.98 21 Zebra 0.97 1.00 0.98 29 accuracy 0.91 388 macro avg 0.92 0.91 0.92 388 weighted avg 0.92 0.91 0.92 388 

Model Summary

The model is built using Transfer Learning with MobileNetV2 as the feature extractor.

Only the top layers are trainable, making the model lightweight, fast, and accurate.

Model: "sequential_1" --------------------------------------------------------------- Layer (type) | Output Shape | Param # --------------------------------------------------------------- rescaling_1 (Rescaling) | (None, 224, 224, 3)| 0 mobilenetv2_1.00_224 (Functional) | (None, 7, 7, 1280) | 2,257,984 global_average_pooling2d_1 | (None, 1280) | 0 dense_2 (Dense) | (None, 120) | 153,720 dropout_1 (Dropout) | (None, 120) | 0 dense_3 (Dense) | (None, 15) | 1,815 --------------------------------------------------------------- Total params: 2,724,591 Trainable params: 155,535 Non-trainable params: 2,257,984 

Insights Visualization 1 Insights Visualization 2



Conclusion

This project demonstrates how Transfer Learning greatly simplifies image classification tasks.

With a small dataset, the MobileNetV2 model can still achieve strong accuracy and generalize well.

Results

  • Training Accuracy: 1.0%
  • Validation Accuracy: 91.4%

Overall the model is performing very well.




Acknowledgments:

This project is dedicated to applying machine learning techniques to understand and detect Animal Classification. Sincere thanks to Unified Mentor Private Limited for providing the opportunity and platform to carry out this work. Appreciation is also extended to the open-source community for developing the powerful tools and libraries that made this project possible.

Created with 🧠 by Kushang Shah

kushang

About

Project 10: Animal Classification Detection | from Unified Mentor Pro. Limited

Topics

Resources

License

Stars

Watchers

Forks