Skip to content

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

License

Notifications You must be signed in to change notification settings

laavanjan/pytorch-transfer-learning-image-classification

Repository files navigation

Image Classification with Pretrained Models

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.

Contents

  • 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.

Features

  • 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

Getting Started

  1. Clone this repository:
    git clone https://github.com/laavanjan/Image_classification_with_pretrained_model.git
  2. 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.
  3. Install the required Python packages (see below).
  4. Open the notebooks in Jupyter and follow the instructions.

Requirements

  • 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

Usage

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.

License

This project is licensed under the MIT License.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published