Skip to content

Deploying a Cotton Plant Disease Classification Flask application Using DenseNet121

Notifications You must be signed in to change notification settings

Sakshi053/Cotton-Plant-Disease-Classification-Web-Application

Repository files navigation

Cotton Plant Disease Classification Web Application 🌿

This repository is about an end to end implementation of deep learning cotton plant disease classification web application using flask.

Dataset

The dataset is downloaded from Kaggle. and total size is 152 MB. The dataset contains 3 folders with 1951 train images, 106 test images and 253 validation images. Each folder is divided into four classes: diseased cotton plant (Fusarium Wilt), diseased cotton leaf (Leaf Curl Disease), fresh cotton plant (Healthy Plant) and fresh cotton leaf (Healthy Leaf). Each image has a size of 694x694 pixels in JPG format. Here are the sample images of the dataset...

DenseNet Model

Pretrained DenseNet121 model on ImageNet dataset is used. With the help of transfer learning, the last 8 layers of the model are tuned to solve the problem. The model is trained for 20 epoches and the accuracy is 97% on test data.

Training Accuracy and Loss

Confusion Matrix

Demo

Usage

Cmds to run file

  • Installing dependencies
pip install -r requirements.txt
  • Model Training
densenet121cottondisease.ipynb
  • Inference

Model weight available at - DenseNet121.h5 and store inside /model folder.

To run Flask, use:

python app.py

Docker cmds

To build docker image, run:

docker build -t cotton .

Run docker image, using:

docker run --name cotton-app cotton

Stop docker, using:

docker stop cotton-app

Credits

Thanks to my teammates Myat Myint Zu Thin and Prachi Gupta