Skip to content

DeXtAr47-oss/Leaf-disease-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaf-disease-classification

This repository contains a deep learning-based image classification project to detect and classify leaf diseases in potato and tomato plants using Convolutional Neural Networks (CNNs) built with PyTorch.

📌 Problem Statement

Agriculture plays a vital role in sustaining the global economy and food supply. However, the productivity of crops is significantly impacted by plant diseases, many of which manifest visibly on the leaves. Manual identification of leaf diseases is time-consuming, labor-intensive, and often inaccurate, especially in large-scale farming.

The objective of this project is to develop an automated system for classifying plant leaf diseases using deep learning techniques. The system will be trained on a dataset containing images of healthy and diseased leaves, specially of potato and tomato plants, with multiple classes of diseases. By leveraging Convolutional Neural Networks (CNNs), the model will learn to accurately distinguish between various disease types and healthy leaves.

This solution aims to assist farmers and agricultural experts by providing a fast, scalable, and accurate method to diagnose tomato and potato plant diseases early, thereby improving crop management, reducing losses, and increasing yield.

🎯 Goal

  • Preprocess and augment image data to enhance model robustness.
  • Train a CNN to classify leaf images into appropriate disease categories.
  • Evaluate the model using metrics such as accuracy, precision and recall.

🖼️ Dataset

The datset that I have used for the project is taken from the Kaggle website (https://www.kaggle.com/datasets/arjuntejaswi/plant-village/data) Well kaggle is a famous website known for organizing many data science competition and for delivering dataset.

🔍 Exploratory Data Analysis (EDA)

📌 Dataset overview and class distribution

This dataset consist of 15 different types of leafs, the total size of the dataset is 20605 outof which 2475 are of pepper bell leafs, 2152 are of potato leafs and 15978 images are of tomato leafs.

  • Pepper__bell___Bacterial_spot -> 997 images.

  • Pepper__bell___healthy -> 1478 images.

  • Potato___Early_blight -> 1000 images.

  • Potato___healthy -> 152 images.

  • Potato___Late_blight -> 1000 images.

  • Tomato_Bacterial_spot -> 2127 images.

  • Tomato_Early_blight -> 1000 images.

  • Tomato_healthy -> 1591 images.

  • Tomato_Late_blight -> 1909 images.

  • Tomato_Leaf_Mold -> 952 images.

  • Tomato_Septoria_leaf_spot -> 1771 images.

  • Tomato_Spider_mites_Two_spotted_spider_mite -> 1676 images.

  • Tomato__Target_Spot -> 1404 images.

  • Tomato__Tomato_mosaic_virus -> 373 images.

  • Tomato__Tomato_YellowLeaf__Curl_Virus -> 3202 images.

Class distribution

As of the above image we can see the distribution of the class in the dataset there are total of 15 classes in the data where we can see that some class have no. of images like Tomato_YellowLeaf_Curl_Virus has approx 2500 images in the data whereas Potato_healthy, Tomato_Leaf_Mold, and Tomato_mosaic_virus have relatively fewer samples. Overall we can say that the data is quiet balanced as of the classes like Tomato_Bacterial_spot, Tomato_Late_blight, and Tomato_Septoria_leaf_spot are relatively well-represented (similar heights).

Pixel distribution

As of the above image we can understand that the green channel frequency is much more than the red and blue ones, also the blue channel have significant peak near zero indicating more no. of dark blue pixels but in the mid-range near 160pixels we can see that the green channel have higher frequency than the others also all channels taper off gradually beyond 160, indicating fewer high-intensity (bright) pixels, especially in the red and green channels.

Mean and standard deviation of the pixel values

  • Mean per channel (BGR): [0.41131156 0.47504014 0.45880439]
  • Std per channel (BGR): [0.19125798 0.15119882 0.17416257]
  • Shape: height: 256, width: 256, channels: 3

📈 Model Performance based on Accuracy Scores

Model Accuracy Loss Precision Recall
Custom 100 0.00 1.00 1.00

Conclusion

As we can see that my custom cnn_model can accurately classify the images so I haven't used any IMAGENET models to classfiy the images, as of more detail on the cnn architecture i have provided the python notebook.

About

This repository contains a deep learning-based image classification project to detect and classify leaf diseases in potato and tomato plants using Convolutional Neural Networks (CNNs) built with PyTorch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors