A collection of convolutional neural network (CNN) models for classifying images of various animal categories. The project supports:
- Marine Species (20 classes)
- Reptiles & Amphibians (10 classes)
- Birds (15 classes)
- Wild Mammals (21 classes)
- Category-Agnostic model for unknown images
All category-specific classifiers are built with TensorFlow and deployed via a Django web application.
- High-Accuracy Classification – Marine, reptile/amphibian, bird & wild-mammal models exceed 90% accuracy on held-out test sets.
- Category-Agnostic Fallback – A standalone CNN that guesses the correct animal category when the type is unknown.
- Web Interface – Image upload & real-time prediction via Django.
- Modular Design – Separate models & endpoints for each category.
| Category | Base CNN | Description |
|---|---|---|
| Marine Species (20) | ResNet-101 | Pretrained on ImageNet, fine-tuned on marine dataset |
| Reptiles & Amphibians (10) | ResNet-101 | Same backbone, different class head |
| Wild Mammals (15) | ResNet-101 | Same backbone, different class head |
| Birds (15) | MobileNetV2 | Lightweight model optimized for bird images |
| Category-Agnostic | Custom CNN | Built from scratch to recognize any animal category |
-
Marine Species (20): – Examples: dolphin, shark, sea turtle, clownfish, manta ray… – Dataset used: Marine Animal Dataset
-
Reptiles & Amphibians (10): – Examples: crocodile, gecko, frog, salamander, iguana… – Dataset used: Reptile & Amphibian Dataset
-
Birds (15): – Examples: sparrow, eagle, parrot, penguin, flamingo… – Dataset used: Bird Species Dataset
-
Wild Mammals (21): – Examples: lion, tiger, elephant, bear, giraffe… – Dataset used: Wild Mammals Dataset
-
Clone the repository
git clone https://github.com/yourusername/animals-image-classification.git cd animals-image-classification -
Create & activate a virtual environment
python3 -m venv venv source venv/bin/activate -
Install Python dependencies
pip install -r requirements.txt
-
Apply migrations & collect static files
python manage.py migrate python manage.py collectstatic
-
Train a model : Execute the Jupyter Notebooks located in the notebook directory to get the models
-
Start the Django development server
python manage.py runserver
Open
http://localhost:8000/in your browser. -
Upload & classify an image
- Select the appropriate category or choose “Click here”
- View predicted label
.
├── notebook/ # Jupyter notebooks for building and training models
├── interface/ # Django project settings and configuration
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ └── asgi.py # Standard Django project files
├── page/ # Django app for classification UI and logic
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── models.py
│ ├── predict.py # Model inference logic
│ ├── tests.py
│ ├── urls.py
│ ├── views.py
│ └── static/ # Static assets (CSS, JS, images)
├── templates/ # HTML templates for each category and index
│ ├── index.html
│ ├── marine.html
│ ├── reptiles.html
│ ├── birds.html
│ ├── wild.html
│ └── unknown.html
├── requirements.txt # Python dependencies
└── README.md # Project overview and instructions
Below are sample screenshots of the web interface in action:
