{"id":21031381,"url":"https://github.com/ahmashraf1/plant_model","last_synced_at":"2025-03-13T19:41:33.453Z","repository":{"id":245551046,"uuid":"796634900","full_name":"AhmAshraf1/plant_model","owner":"AhmAshraf1","description":"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.","archived":false,"fork":false,"pushed_at":"2024-07-16T08:21:39.000Z","size":188401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T15:22:48.164Z","etag":null,"topics":["computer-vision","deep-learning","image-classification","streamlit","tensoflow","tensorflow","tensorflow-lite"],"latest_commit_sha":null,"homepage":"https://plant-leaf-disease-detection.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AhmAshraf1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T10:36:46.000Z","updated_at":"2024-08-08T12:02:37.000Z","dependencies_parsed_at":"2024-11-19T12:49:42.514Z","dependency_job_id":null,"html_url":"https://github.com/AhmAshraf1/plant_model","commit_stats":null,"previous_names":["ahmashraf1/plant_model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmAshraf1%2Fplant_model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmAshraf1%2Fplant_model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmAshraf1%2Fplant_model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmAshraf1%2Fplant_model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AhmAshraf1","download_url":"https://codeload.github.com/AhmAshraf1/plant_model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243471524,"owners_count":20296135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","image-classification","streamlit","tensoflow","tensorflow","tensorflow-lite"],"created_at":"2024-11-19T12:27:53.956Z","updated_at":"2025-03-13T19:41:33.429Z","avatar_url":"https://github.com/AhmAshraf1.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plant Disease Detection\nA deep learning model for classifying plant diseases using leaves images. The model classifies the images into three categories: Healthy, Powdery and Rust.\n\n## Table of contents\n- [Overview](#overview)\n- [Files](#files)\n- [Dataset Collection](#dataset-collection)\n- [Requirements](#requirements)\n- [Training \u0026 Data Augmentation](#training--data-augmentation)\n- [Evaluation and Callbacks](#evaluation-and-callbacks)\n- [Streamlit Web App](#streamlit-web-app)\n- [Project Demo Video](#project-demo-video)\n- [Usage](#usage)\n- [Results](#results)\n\n\n## Overview\nUsing 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.\n\n## Files\n- **app** folder contains two files:\n  - **app.py**: the main file for streamlit application to run the web app\n  - **utils.py**: utilities functions to help in image processing, load model and prediciton\n- **app-images** contains images for the application\n- **model** contains different files:\n  - model with .tflite versions\n  - model with .h5 versions\n- **Notebook** contains the notebook where training and testing processes done\n- **test-images** contains some images to test the model\n- **requirements.txt**: contains all needed dependencies\n\n## Dataset Collection\n- Our final Dataset consisted and collected from 3 different datasets.\n- The latest version of dataset contains three categories: Healthy, Powdery and Rust.\n- The first version, each class was about 400 images.\n- The second version we used [PlantDoc Dataset](https://github.com/pratikkayal/PlantDoc-Dataset) , for the full research paper refer [Arxiv](https://arxiv.org/abs/1911.10317) and cleaned the data from noisy (unwanted) images. This allowed us to increase the images to be about 650 images per each class.\n- The third, latest, version we used a dataset from Hugging Face website called [Plant Disease Recognition](https://huggingface.co/datasets/NouRed/plant-disease-recognition) which helped to increase the dataset to about 1000 images in each class.\n\n## Requirements\n- NumPy\n- Pillow\n- Streamlit\n- Tensorflow\n- Matplotlib\n\n## Training \u0026 Data Augmentation\n- Loaded the dataset into train, validation and test datasets.\n- Applied different data augmentation techniques as Sequential Keras Model:\n  - RandomFlip.\n  - RandomRotation.\n  - RandomBrightness.\n  - RandomContrast.\n  - RandomZoom.\n- Preprocessing images using `preprocess_input` to normalize values.\n\n## Evaluation and Callbacks\n- The evaluation metrics are accuracy and loss.\n- 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.\n\n## Streamlit Web App\nA streamlit web application to deploy the model and make project more easily to be used by user.\nyou can access the web app from below.\n\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_red.svg)](https://plant-leaf-disease-detection.streamlit.app/)\n\n- The Web app asks you to upload the image tp be classified, then it shows the uploaded image.\n- 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.\n## Project Demo Video\n**SOON**\n\n## Usage\n#### 1- Clone the repository:\n```bash\ngit clone https://github.com/AhmAshraf1/plant_model.git\ncd plant_model\n```\n\n#### 2- Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n### 3- Run Streamlit App:\n```bash\nstreamlit run /app/app.py\n```\n\n## Results\nThe 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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmashraf1%2Fplant_model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmashraf1%2Fplant_model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmashraf1%2Fplant_model/lists"}