This repository contains Jupyter notebooks demonstrating image classification using pretrained deep learning models in PyTorch. The main example uses GoogleNet for classifying bean leaf lesions, leveraging transfer learning for improved accuracy and efficiency.
Ex_3_Image_Classification_Pretrained.ipynb
: Example notebook for image classification using pretrained models.Pre_trained_Models_Image_Classification.ipynb
: Additional notebook exploring various pretrained models for image classification tasks.
- Uses PyTorch and torchvision's pretrained GoogleNet model
- Demonstrates transfer learning and fine-tuning
- Step-by-step code explanations
- Custom dataset: Bean Leaf Lesions Classification (from Kaggle)
- Data loading, preprocessing, training, and evaluation
- Clone this repository:
git clone https://github.com/laavanjan/Image_classification_with_pretrained_model.git
- Download the dataset from Kaggle (Bean Leaf Lesions Classification):
- The notebook uses
opendatasets
to download automatically, but you may need to set up your Kaggle API credentials.
- The notebook uses
- Install the required Python packages (see below).
- Open the notebooks in Jupyter and follow the instructions.
- Python 3.7+
- Jupyter Notebook
- PyTorch
- torchvision
- opendatasets
- pandas, numpy, matplotlib, scikit-learn, pillow
Install dependencies with:
pip install torch torchvision opendatasets pandas numpy matplotlib scikit-learn pillow
Open the Pre_trained_Models_Image_Classification.ipynb
notebook and run the cells to see image classification in action. You can modify the code to use your own datasets or experiment with different models.
This project is licensed under the MIT License.