Introduction
I developed Cotton Plant Disease Classification using Convolution Neural Network (Deep Learning). As Farmer, I know Farmer can’t solve Farm’s complex and even small problems due to lack of education. So as Artificial Intelligence enthusiastic I decided to solve this problem using the popular technology like Artificial Intelligence.
I just start to collect lots of images of cotton crop plants from different farm. For collecting the cotton crop plant, i need a expert in this domain. So i took a help of farmer to collect the data of cotton crop plants.
Then I decide which algorithm is best to solve this problem and I select as usual you know the “Convolution Neural Network (CNN)” . I create my own CNN architecture and it works well on the training and as well as testing dataset.
It gave me more than 98% accuracy on training dataset and validation dataset.
In Cotton Disease Dataset, There are 3 folders:
1. train
2. validation
3. test
![]() |
| Fig 1.2 |
1. disease cotton leaf
2. disease cotton plant
3. fresh cotton leaf
4. fresh cotton plant
![]() |
| Fig 1.3 |
Let's start :-
I have implemented a Cotton Plant Disease classifier model with the help of following steps like :
- Define project objectives
- Data Augmentation : The performance of Deep Learning Neural Networks improves with the amount of data available. Data augmentation is a technique to artificially generate new training data from existing training data to increase the performance of the model.
- Define a Convolution Neural Network Architecture
- Train the model
- Save the model
- Load the model
- Test the model
- Deploy the model on the localhost
I have deployed model on the localhost with the help of the python framework (Flask). Flask provides us some tools to make a web application.
I have implemented Cotton Plant Disease classifier model on jupiter notebook because gpu is available in Laptop. My suggestion is for you guys that if you have a GPU laptop then you can train model on your local machine or if you don't have the GPU laptop then you can run this on Google Colab which provides you a GPU facility to train your model fast, So by using GPU, training is much faster than your local system.
I implemented this model on my jupyter notebook by using the following steps which are already mentioned above.
First of all i trained a Cotton Plant Disease model with the help of my training and validation dataset and then test a model with the help of given few test images that model is classify image correctly or not and then deploy this model on the web application using the python framework Flask which provides a simple web development tool.
1. This is the one short screenshot of training my model.
![]() |
| Fig 1.4 |
2. You can see below the screenshot of our project.
![]() |
| Fig 1.5 |
![]() |
| Fig 1.6 |
![]() |
| Fig 1.7 |
![]() |
| Fig 1.8 |
3. Now it's time for test the model. I have uploaded a cotton disease plant image on our application by using the file upload button(Choose button). Now Let's click on the Predict button to see the result.
![]() |
| Fig 1.9 |
![]() |
| Fig 2.0 |
![]() |
| Fig 2.1 |
- Go to my GitHub and download code: Cotton Plant Disease Classification
- Download Dataset: Click here to download Dataset
- After download the project and dataset, just extract the project folder where you will Get two folders static and templates , one python file, one Jupyter notebook file
- and some screenshots of the project.
- Go into the folder.
- Open the command prompt and go to the project folder with cd command.
- Write (python app.py) in your command prompt.
- You will get a link like this (https://127.0.0.1:5000/).
- Copy this link and Paste in the Chrome browser or any browser.
- Now you can use the model and classify that which cotton leaf or plant is diseased or healthy.
You will use the project with the pretrained model (predicted_cotton_disease_model.h5). If you want to train your own model or learn to train So just run (cotton-disease.ipynb) this file to train your own model.
Video Tutorial
Thank You!!!!!!!!










