This project is a comprehensive guide to building a Convolutional Neural Network (CNN) for classifying images of rice leaf diseases. The project is divided into several sections, each focusing on a specific part of the machine-learning workflow.
-
Installing dependencies and Importing Relevant Libraries: This section installs the necessary Python libraries and imports the relevant modules for the project.
-
Function to Load Images: This section defines a function to load images from a specified folder and uses this function to load images of different types of rice leaf diseases.
-
Preprocessing Images and Labels: This section creates dictionaries to store the images and their corresponding labels, and then preprocesses the images and labels for machine learning.
-
Splitting the Dataset and Scaling the Images: This section splits the dataset into training and testing sets and scales the pixel values of the images to be between 0 and 1.
-
Building and Training the Model: This section defines the architecture of the CNN model, compiles it and trains it on the scaled training data.
-
Evaluating the Model and Making Predictions: This section evaluates the model's performance on the test dataset, makes predictions on the test dataset, and prints the predictions.
-
Data Augmentation: This section introduces data augmentation techniques to increase the diversity of the training data, which can help improve the model's performance.
-
Displaying an Image Before and After Data Augmentation: This section displays an image before and after applying the data augmentation, allowing you to compare the original and augmented images visually.
-
Building and Training the Model with Data Augmentation: This section defines a new CNN model that includes the data augmentation layer, compiles it, and trains it on the scaled training data.
-
Evaluating the Model and Making Predictions After Data Augmentation: This section evaluates the new model's performance on the test dataset, makes predictions on the test dataset, and prints the predictions.
Overall, this project provides a detailed walkthrough of the process of building, training, and evaluating a CNN for image classification, with a focus on practical techniques such as data preprocessing, data augmentation, and model evaluation. It serves as a valuable resource for anyone interested in deep learning and its applications in image recognition.
This is my contribution