m3redithw / Potato-Disease-Image-Classification

Using deep learning to predict the type of potato plant's diseases to help prevent economic loss in agriculture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potato Disease Classification

Python Pandas NumPy Matplotlib TensorFlow Keras

by Meredith Wang

Sep 2022

Project Description

Farmers who grow potatoes are facing drastic economic losses every year due to the various disease that can happen to a potato plant. There are two common diseases, which are known as Early Blight, Late Blight. Early blight is caused by a fungus and late blight is caused by a specific microorganism. If a farmer can detect the cause of the disease in an early stage and apply appropriate treatment, it can save waste and prevent economic loss tremendously.

AtliQ Agriculture is an AI company that focus on solving problems in agriculture domain. The company has takne this project and decided to build a mobile application which they can give it to farmers. For farmers, all they need to do is to take a photo of the plant and the mobile application will tell them whether the plans is healthy or it has one of the diseases.

app.mov

Project Goal

Our goal is to buld the model that supports the "behind the scene" of the mobile application, which uses deep learning and conbolutional neural network.

early_and_late

Process

1️⃣ Data Acquisition

A team of annotators who work closely with the farmers to collect the images from the fields and annotate the image either it's a healhy potato leaf or if it has any diseases using domain knowledge. The team collected 2152 potato-leaf images in total.

2️⃣ Data Preparation

  • tf dataset

  • Resize & Scale

  • Data augmentation

Data Splitting
  • Create function get_dataset_partitions_tf() to split data into train, validate, test

  • Test prepare function

  • Check the size of each dataset

    len(train), len(validate), len(test)
  • Call the function, and cache e the 3 data samples

    train = train.cache().shuffle(1000).prefetch(buffer_size = tf.data.AUTOTUNE)
    validate = validate.cache().shuffle(1000).prefetch(buffer_size = tf.data.AUTOTUNE)
    test = test.cache().shuffle(1000).prefetch(buffer_size = tf.data.AUTOTUNE)

3️⃣ Modeling

  • Define neural network architecture

  • Build model on training dataset and evaluate on train and validate

  • Use optimizer to compile

  • Fit model on test dataset on evaluate model based on accuracy

  • Plot accuracy and loss function of train and validate datasets from all 50 epochs.

  • Make prediction on test dataset and save model

  • Ajdust neural network architecture and optimizer, using steps above to generate and save new mdoel

  • Deploy the top performing model

Conclusion

The neurol network model has an accuracy of 99% on test dataset, and it's expected to perform with the equivalent accuracy level on future onseen data.

predictions

About

Using deep learning to predict the type of potato plant's diseases to help prevent economic loss in agriculture


Languages

Language:Jupyter Notebook 98.6%Language:PureBasic 1.4%Language:Python 0.0%