Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/subhangisati/classification-of-venomous-and-non-venomous-snakes
This repository consists of classification of snakes species. It shows the whole progress and model used to achieve final accuracy. The model used are CNN(Convolutional Neural Network), MobileNetV2 and VGGNet. The final accuracy was achieved using transfer learning with model MobileNetV2
https://github.com/subhangisati/classification-of-venomous-and-non-venomous-snakes
binary-image-classification classification cnn-classification cnn-keras computer-vision convolutional-neural-network cv2 data-science deep-neural-networks keras-tensorflow matplotlib mobilenetv2 neural-network numpy-library pandas-dataframe tensorflow transfer-learning
Last synced: 8 days ago
JSON representation
This repository consists of classification of snakes species. It shows the whole progress and model used to achieve final accuracy. The model used are CNN(Convolutional Neural Network), MobileNetV2 and VGGNet. The final accuracy was achieved using transfer learning with model MobileNetV2
- Host: GitHub
- URL: https://github.com/subhangisati/classification-of-venomous-and-non-venomous-snakes
- Owner: SubhangiSati
- Created: 2024-02-02T09:17:08.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T17:34:47.000Z (4 months ago)
- Last Synced: 2024-07-05T23:00:38.262Z (4 months ago)
- Topics: binary-image-classification, classification, cnn-classification, cnn-keras, computer-vision, convolutional-neural-network, cv2, data-science, deep-neural-networks, keras-tensorflow, matplotlib, mobilenetv2, neural-network, numpy-library, pandas-dataframe, tensorflow, transfer-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 816 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Snake Classification (venomous/ non-venomous) using Transfer Learning with MobileNetV2
## Overview
This code implements a snake venom classification model using transfer learning with the MobileNetV2 architecture. The model is trained on a dataset of snake images categorized into venomous and non-venomous classes. It evaluates the model's performance, predicts the class for a sample image, and provides a confusion matrix and classification report.
## Prerequisites
- Python 3.x
- TensorFlow 2.x
- Matplotlib
- Seaborn
- Scikit-learn## Installation
Ensure you have the required dependencies installed using:
```bash
pip install tensorflow matplotlib seaborn scikit-learn
```## Usage
1. Download the snake venom dataset and organize it into train and test directories.
2. Update the `train_dir` and `test_dir` variables with the correct paths to your train and test datasets.
3. Optionally, set the `image_path` variable to the path of a specific image for prediction.
4. Run the script to train the model, evaluate its performance, and make predictions.
```bash
python snake_venom_classification.py
```## Code Structure
- **Dataset Loading:**
- The dataset is loaded and preprocessed using image augmentation for training.- **Model Creation:**
- MobileNetV2 is employed as the base model with additional custom top layers for classification.
- The model is compiled with categorical cross-entropy loss and the Adam optimizer.- **Training:**
- The model is trained for a specified number of epochs.- **Evaluation:**
- The model's accuracy is evaluated on the test set, and an accuracy graph is plotted.- **Prediction:**
- A sample image is loaded, preprocessed, and the model predicts its class.- **Confusion Matrix:**
- A confusion matrix and classification report are generated for evaluating model performance.## Hyperparameters
- `img_width` and `img_height`: Input image dimensions (224x224).
- `batch_size`: Batch size for training and testing (32).
- `num_classes`: Number of snake venom classes (2 - venomous and non-venomous).
- `epochs`: Number of training epochs (10).## Customization
- Adjust the hyperparameters to suit your specific dataset and computing resources.
- Modify the model architecture, learning rate, or image augmentation parameters as needed.## License
This code is licensed under the [MIT License](LICENSE).