This project focuses on classifying fish images into multiple categories using deep learning models. The workflow involves:
- Training a custom CNN model from scratch.
- Leveraging transfer learning with multiple state-of-the-art pre-trained models.
- Evaluating performance and selecting the best model.
- Saving trained models for future inference.
- Deploying the best model (MobileNet) using Streamlit to create an interactive web app for predictions from user-uploaded images.
- Type: Image dataset containing multiple fish species.
- Classes:
- fish sea_food shrimp
- fish sea_food striped_red_mullet
- fish sea_food sea_bass
- animal fish bass
- fish sea_food black_sea_sprat
- fish sea_food red_mullet
- fish sea_food gilt_head_bream
- fish sea_food red_sea_bream
- animal fish : 1096
- fish sea_food trout
- fish sea_food hourse_mackerel
- Image Size: Resized to a fixed dimension (224x224) before training.
- Source: Labmentix
| Model | Type | Notes |
|---|---|---|
| Custom CNN | From scratch | Baseline deep learning model. |
| ResNet50 | Transfer Learning | Fine-tuned on fish dataset. |
| VGG16 | Transfer Learning | Fine-tuned on fish dataset. |
| MobileNet | Transfer Learning | Achieved best accuracy (≈99%). |
| EfficientNetB0 | Transfer Learning | Balanced performance and speed. |
| InceptionV3 | Transfer Learning | High accuracy and robustness. |
Note: MobileNet was selected for deployment due to its lightweight architecture, high accuracy, and fast inference speed.
- Programming Language: Python
- Deep Learning: TensorFlow / Keras
- Data Handling: NumPy, Pandas
- Image Processing: OpenCV, Pillow
- Visualization: Matplotlib, Seaborn
- Web Deployment: Streamlit
- Model Deployment File:
.h5format
git clone https://github.com/yourusername/fish-classification.git
cd fish-classificationpip install -r requirements.txt- Place the dataset in the
data/folder. - Update the dataset path in the training script.
python train.pystreamlit run app.py✅ Upload an image of a fish.
✅ Model predicts fish species with confidence scores.
✅ Confidence scores are shown as a bar graph.
✅ Mobile-friendly interface.

📦 fish-classification
│── app.py # Streamlit app script
│── Multiclass-Fish-Image-classification.ipynb # Model training script
│── best_mobilenet_model.h5 # Saved best model as .h5 file
│── requirements.txt # Python dependencies
│── runtime.txt # Runtime environment
│── README.md # Project documentation
│── data/ # Dataset folder
- The best MobileNet model (
best_mobilenet_model.h5) was deployed using Streamlit. - The app is hosted and accessible via: Streamlit Cloud
- Click here to view the app
- Expand dataset for more species.
- Improve generalization with data augmentation.
- Deploy a multi-model comparison app.
- Optimize for mobile devices.