Farmers who grow potatoes are facing lot of economical losses every year because of various disease that can happen to a potato plant.
There are two common disease:
-
Early Blight and Late Blight.
-
Early Blight: It is caused by a fungus and Late Blight is caused by a specific micro-organism and if a farmer can detect these disease early and apply appropriate treatment then it can save lot of waste and prevent the economic losses.
The treatment for Late Blight and Early Blight are little different, so it is important that you accurately identify what kind of disease is there in that potato plant.
To build a mobile application and web page , which we can give it to farmers and farmers, all they need to do is go their farm and just take a picture of the plant and the application will tell them whether the potato plant is healthy or it has one of these disease and behind the scene application will be using deep learning and Convolutional Neural Network.
Potato_Disease_Classification_Demo.mp4
- Python 3.7 and more
- Important Libraries: tensorflow, sklearn, pandas, numpy, matplotlib & seaborn
- Front-end: HTML, CSS
- Back-end: Flask framework
- IDE: Jupyter Notebook, Pycharm & VSCode
- Deployment: Heroku, AWS
Code is written in Python 3.9.4. If you don't have python installed on your system, click here https://www.python.org/downloads/ to install.
- Create virtual environment - conda create -n myenv python=3.9.4
- Activate the environment - conda activate myenv
- Install the packages - pip install -r requirements.txt
- Run the app - python run app.py
We need to collect images of a healthy potato plant leaf and the potato plant leaf which has Early Blight or Late Blight disease.
Here we have used Data of Poatato Disease available in Kaggle.
Dataset credits: https://www.kaggle.com/arjuntejaswi/plant-village
Here we have used tf data set and Data Augmentation. Data Augmentation because we were not having enough diverse set of images. So we did rotation, fliping and adjusted contrast to create more training samples.
- Image Classification Model using CNN.
- Used Maxpooling2D and Flatten layers to create CNN.
- Activation Function used are: RELU and SOFTMAX.
- Model performance evaluated based on accuracy and loss.
- On test data we get approximately 100% accuracy.
- Model saved on local desk.
The final model is deployed on Heroku using Flask framework.
-
User Interface is a very simple one, with single page asking for image to be classified.
-
After selecting image for classification, we just need to click predict button.
Upendra Kumar: https://www.linkedin.com/in/imupendra/
Hello Reader if you find any bug please consider raising issue I will address them asap.