top of page

Plant Leaf Image Classification and Diseases Identification Using Image Segmentation

Overview:

This project addresses the critical issue of food insecurity caused by plant diseases, which are responsible for significant crop yield losses globally. Leveraging state-of-the-art deep learning techniques, this project aims to automate the early detection and classification of plant diseases. By combining advanced image segmentation methods with convolutional neural networks (CNNs), the project achieves high accuracy in identifying various plant diseases, offering a scalable solution for agricultural health monitoring.

CV.png

OpenCV image processing results

​​​Key Features:

  • Comprehensive Image Segmentation Using U-Net and MobileNetV2: The project utilizes the U-Net architecture for precise segmentation of plant leaves from their backgrounds. This segmentation is crucial for isolating relevant features before classification. To enhance efficiency, MobileNetV2 is integrated as a backbone within the U-Net model, significantly reducing computational requirements while maintaining high accuracy. This combination proved particularly effective for binary segmentation tasks, especially in processing tomato plant datasets.

  • High-Accuracy Classification with Convolutional Neural Networks: A custom CNN was developed to classify segmented images into 38 distinct categories representing 14 plant species and 26 diseases. The CNN was meticulously trained using the Plant Village dataset, a comprehensive collection of over 45,000 images. The model was evaluated using various metrics, achieving a peak validation accuracy of 96.81% when augmented colorful images were used.

  • Strategic Data Augmentation to Counter Imbalanced Classes: Recognizing the imbalance in the dataset, with some disease categories being underrepresented, the project applied advanced data augmentation techniques. This included rotation, scaling, and translation of images, effectively increasing the diversity of training data and leading to more robust model performance. The augmented dataset played a pivotal role in achieving a train accuracy of 98.31% and a validation accuracy of 96.81%.

  • Extensive Model Evaluation and Fine-Tuning: The models were rigorously tested and fine-tuned using a range of hyperparameters. Key performance metrics such as accuracy, precision, recall, and confusion matrices were computed to assess the models’ effectiveness. For instance, the CNN trained on segmented grayscale images achieved a validation accuracy of 93.45%, while the model trained on full-color images reached 94.89%. These results highlight the importance of color information in enhancing classification performance.​

Architec.png

Architecture of original U-Net

Improved Architecture.png

Architecture of CNN classification structure

Project Components:

  1. Dataset Preparation and Preprocessing: The project involved extensive preprocessing, including normalization and binary segmentation of images. The dataset preparation script was designed to handle large volumes of data, ensuring that images were correctly scaled, labeled, and ready for model training.

  2. Advanced Image Segmentation Techniques: Utilizing U-Net for image segmentation, the project focused on enhancing the clarity and feature extraction of plant images. MobileNetV2 was integrated to optimize this process, especially for deployment on mobile or resource-constrained devices.

  3. Convolutional Neural Network (CNN) Architecture: A deep CNN was architected to classify segmented images into their respective disease categories. The architecture was designed with multiple convolutional layers, pooling layers, and fully connected layers, enabling the model to learn complex patterns and features from the input images.

  4. Exploratory Data Analysis and Visualization: A Jupyter notebook was used to conduct exploratory data analysis, visualize the dataset, and compare the effectiveness of different segmentation techniques. This step was crucial in understanding the dataset and guiding the design of the model architecture.

  5. Hyperparameter Optimization: Through careful tuning of hyperparameters such as batch size, learning rate, and epochs, the project achieved optimal model performance. The final models were able to balance accuracy and computational efficiency, making them suitable for practical applications in agricultural monitoring.

Technologies Used:

  • Programming Languages: Python

  • Frameworks: PyTorch, TensorFlow, Keras

  • Libraries: OpenCV, NumPy, Pandas, Matplotlib, Scikit-learn

  • Tools: Google Colab, Google Drive

Results:

  • U-Net with MobileNetV2: Achieved a validation accuracy of 93.45% on segmented grayscale images and 96.81% on augmented colorful images.

  • CNN Classification: Achieved a train accuracy of 98.31% and a validation accuracy of 96.81% on the final model, demonstrating robust performance across all disease categories.

  • Data Augmentation Impact: Improved the model’s ability to generalize by balancing the dataset, which was critical in achieving high accuracy across underrepresented classes.

The integration of MobileNetV2 with U-Net not only optimized the segmentation process but also enabled the model to be deployed on mobile devices, making it a practical solution for real-time plant disease monitoring.

Please feel free to go through the project report and check the GitHub link to see details.

+1 5087627224

Aldie, Virginia

Lets connect!

Thanks for submitting!

bottom of page