This project focuses on developing a deep learning-based image classification model to identify plant diseases in farm crops. The model utilizes a Convolutional Neural Network (CNN) trained on a dataset of plant images with various diseases. The goal is to enable early disease detection, reduce crop loss, and promote sustainable agricultural practices through automation.
The dataset consists of images of healthy and diseased plants, including crops like tomatoes, potatoes, and peppers. Images are labeled with specific disease identifiers (e.g., Tomato_Late_blight, Potato_Early_blight) and organized into directories by class. The dataset includes variations in lighting, background, and plant growth stages to enhance model robustness.
Dataset Source: Kaggle - Plant Disease Dataset
The CNN model is designed with the following layers:
- Convolutional Layers: Extract features from input images.
- Max-Pooling Layers: Reduce spatial dimensions and retain important features.
- Fully Connected Layers: Combine features for classification.
- SoftMax Output Layer: Produces probability distributions over disease classes.
- TensorFlow: Used for building and training the CNN.
- Scikit-learn: Employed for dataset splitting and evaluation.
- Matplotlib: Utilized for visualizing results and dataset characteristics.
- Dataset Preparation: Load and preprocess images, resize to 128x128 pixels, and assign labels.
- Exploratory Analysis: Visualize sample images and analyze class distribution to address imbalances.
- Model Training: Train the CNN using 80% of the dataset for training and 20% for testing.
- Evaluation: Assess model performance using accuracy, precision, recall, and F1-score.
load_images_from_folder(): Loads and preprocesses images.train_test_split(): Splits the dataset into training and testing sets.- CNN model built using TensorFlow's Sequential API.
- Accuracy: Achieved 100% accuracy on both training and test sets.
- Classification Metrics: Precision, recall, and F1-score of 1.0 for all classes.
- Visualizations: Training/validation accuracy and loss curves demonstrate effective learning and generalization.
The developed CNN model successfully classifies plant diseases with high accuracy, demonstrating its potential for real-world agricultural applications. Early disease detection can significantly reduce crop loss and improve farming efficiency. Future work may include expanding the dataset and deploying the model in mobile applications for field use.