This repository contains the implementation of a plant disease classification model using PyTorch. The model is based on a fine-tuned ResNet-18 architecture for image classification tasks of the plantvillage dataset.
- Introduction
- Dataset
- Installation
- Usage
- Training
- Evaluation
- Results
- Model Saving
- Customization
- Contributing
- License
The goal of this project is to classify plant diseases based on images. The model is implemented in PyTorch and utilizes data augmentation and a pre-trained ResNet-18 model for improved accuracy.
The dataset used for this project is available here. It consists of images of plants affected by various diseases. The dataset is organized into different classes based on the type of disease.The dataset is available for download at kaggle, dataset name Plantvillage dataset
To install and run this pytorch model follow the following steps.
1.) open the notebook on google colab. 2.)
-
Ensure the dataset is downloaded and organized in the specified structure.
-
Modify the
config cell
to set the dataset path and other configurations. -
Run the training script on the training cell:
-
Evaluate the model on the evaluation cell
The model is trained using a fine-tuned ResNet-18 architecture. Data augmentation techniques are applied to enhance the model's robustness. The training script (train cell
) contains the main training loop.
The model is evaluated on a separate test set to measure its accuracy and performance. The evaluation script cell (evaluate cell
) computes the accuracy and validation loss.
The trained model achieves an accuracy of approximately 51% on the test set. Further details can be found in the Results
section of the code.
The trained model is saved using torch.save
and can be loaded for future use. The saved model file (fine_tuned_resnet18.pth
) contains the model's state dictionary.
Feel free to customize the code, experiment with hyperparameters, or try different pre-trained models for improved performance. You can also contribute by adding new features or enhancing existing ones.
Contributions are welcome, i humbly request for a collaboration on this notebook for an improvement on the accuracy! Feel free to open issues, submit pull requests, or provide feedback.
This project is licensed under the MIT_license.