GithubHelp home page GithubHelp logo

ahmashraf1 / plant_model Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 183.99 MB

Computer Vision Project using Tensorflow to classify different diseases that appears on the plants' leaves into five categories; Healthy, Powdery, Rust, Slug and Spot with a web app to be used easily.

Home Page: https://plant-leaf-disease-detection.streamlit.app/

Python 0.02% Jupyter Notebook 99.98%
computer-vision deep-learning image-classification streamlit tensoflow tensorflow tensorflow-lite

plant_model's Introduction

Plant Disease Detection

A deep learning model for classifying plant diseases using leaves images. The model classifies the images into three categories: Healthy, Powdery and Rust.

Table of contents

Overview

Using a pre-trained model, MobileNetV3Large, with Transfer Learning in tensorflow and tensorflow-lite to classify leaves images into the three categories.Then, applied fine-tuning with the model on the dataset.

Files

  • app folder contains two files:
    • app.py: the main file for streamlit application to run the web app
    • utils.py: utilities functions to help in image processing, load model and prediciton
  • app-images contains images for the application
  • model contains different files:
    • model with .tflite versions
    • model with .h5 versions
  • Notebook contains the notebook where training and testing processes done
  • test-images contains some images to test the model
  • requirements.txt: contains all needed dependencies

Dataset Collection

  • Our final Dataset consisted and collected from 3 different datasets.
  • The latest version of dataset contains three categories: Healthy, Powdery and Rust.
  • The first version, each class was about 400 images.
  • The second version we used PlantDoc Dataset , for the full research paper refer Arxiv and cleaned the data from noisy (unwanted) images. This allowed us to increase the images to be about 650 images per each class.
  • The third, latest, version we used a dataset from Hugging Face website called Plant Disease Recognition which helped to increase the dataset to about 1000 images in each class.

Requirements

  • NumPy
  • Pillow
  • Streamlit
  • Tensorflow
  • Matplotlib

Training & Data Augmentation

  • Loaded the dataset into train, validation and test datasets.
  • Applied different data augmentation techniques as Sequential Keras Model:
    • RandomFlip.
    • RandomRotation.
    • RandomBrightness.
    • RandomContrast.
    • RandomZoom.
  • Preprocessing images using preprocess_input to normalize values.

Evaluation and Callbacks

  • The evaluation metrics are accuracy and loss.
  • We used Callbacks like Early Stopping to stop training when monitored metric, validation loss has stopped improving to avoid model overfitting and ReduceLROnPlateau to reduce the base learning rate we used.

Streamlit Web App

A streamlit web application to deploy the model and make project more easily to be used by user. you can access the web app from below.

Streamlit App

  • The Web app asks you to upload the image tp be classified, then it shows the uploaded image.
  • After you push Classify button, it shows the predicted class of the image with the confidence of belonging to that class and the inference time the model taken to predict in ms.

Project Demo Video

SOON

Usage

1- Clone the repository:

git clone https://github.com/AhmAshraf1/plant_model.git
cd plant_model

2- Install dependencies:

pip install -r requirements.txt

3- Run Streamlit App:

streamlit run /app/app.py

Results

The model achieves an accuracy of 90.5% on the validation set and 91.5% on the test set. Training and Validation loss and accuracy plots are provided in the Notebook to visualize the model's performance after transfer learning and fine-tuning. Confusion Matrix and Classification Report are also provided in the notebook to show the classification performance on the test set.

plant_model's People

Contributors

ahmashraf1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.