A deep learning image classifier that identifies whether an elephant in a photo is African or Asian, built with transfer learning (MobileNetV2) and deployed as an interactive Streamlit web app.
# 🐘 Elephant Classifier — African vs Asian
A deep learning image classifier that identifies whether an elephant in a photo is **African** or **Asian**, built with transfer learning (MobileNetV2) and deployed as an interactive **Streamlit** web app.
---
## 📋 Table of Contents
- Overview
- Demo
- Dataset
- Modeling Approach
- Results
- Project Structure
- Installation
- Usage
- Tech Stack
- Key Learnings
- Limitations
- Future Improvements
- License
---
## 🎯 Overview
**Problem Statement:** Build an image classification model that distinguishes between African and Asian elephants — two species with visually distinct features (ear size and shape, tusks, back profile, and body size) — and package it into a usable app for image-based prediction.
**Approach:** Rather than training a convolutional neural network from scratch, the project uses **transfer learning** with a MobileNetV2 backbone pretrained on ImageNet, fine-tuned with a custom classification head and optimized via automated hyperparameter search.
---
## 🎥 Demo
Upload any elephant image and the app returns a prediction with a confidence score.
| African Elephant | Asian Elephant |
|---|---|
| **Prediction: African** — Confidence: 79.72% | **Prediction: Asian** — Confidence: 53.82% |
*(See `/screenshots` for full app captures — landing page, upload flow, and prediction results.)*
---
## 🗂 Dataset
- **Classes:** `African` (label 0), `Asian` (label 1)
- **Training set:** 840 images across both classes
- **Validation/test set:** 188 images across both classes
- **Input size:** 224×224 RGB (299×299 for the Xception experiment)
- **Augmentation (training only):** rescaling (1/255), rotation (±20°), zoom (±20%), horizontal flip
> Dataset directory structure follows Keras' `flow_from_directory` convention:
> ```
> data/
> ├── train/
> │ ├── African/
> │ └── Asian/
> └── test/
> ├── African/
> └── Asian/
> ```
---
## 🛠 Modeling Approach
Several architectures were evaluated before selecting …