{"id":20668618,"url":"https://github.com/anshkgoyal/plant-disease-classification","last_synced_at":"2026-04-17T14:32:02.874Z","repository":{"id":263116385,"uuid":"866161511","full_name":"AnshKGoyal/Plant-Disease-Classification","owner":"AnshKGoyal","description":"The Plant Disease Classification project uses the NasNetMobile deep learning model to classify plant conditions into five categories: fungus, healthy, virus, pests , and bacteria . With a FastAPI backend, SQL Server database, and Streamlit frontend, it enables users to upload images and get quick, accurate disease predictions.","archived":false,"fork":false,"pushed_at":"2024-11-16T09:16:37.000Z","size":1917,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T15:18:38.988Z","etag":null,"topics":["deep-learning","fastapi-sqlalchemy","image-classification","keras-tensorflow","nasnetmobile","sql-server","streamlit-web"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnshKGoyal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-01T18:47:47.000Z","updated_at":"2024-11-16T09:16:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe14fdc3-f5a7-4922-bae6-027354dbbed9","html_url":"https://github.com/AnshKGoyal/Plant-Disease-Classification","commit_stats":null,"previous_names":["anshkgoyal/plant-disease-classification"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshKGoyal%2FPlant-Disease-Classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshKGoyal%2FPlant-Disease-Classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshKGoyal%2FPlant-Disease-Classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshKGoyal%2FPlant-Disease-Classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnshKGoyal","download_url":"https://codeload.github.com/AnshKGoyal/Plant-Disease-Classification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242873755,"owners_count":20199294,"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":["deep-learning","fastapi-sqlalchemy","image-classification","keras-tensorflow","nasnetmobile","sql-server","streamlit-web"],"created_at":"2024-11-16T20:09:59.862Z","updated_at":"2026-04-17T14:32:02.831Z","avatar_url":"https://github.com/AnshKGoyal.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plant Disease Classification\n\nThis project is an automated system for plant disease classification using machine learning techniques. It aims to assist farmers, agricultural researchers, and enthusiasts in quickly and accurately diagnosing plant health issues through image analysis.\n\nThe application consists of a backend built with FastAPI, a database managed with SQL Server, and a frontend powered by Streamlit. The project leverages a pre-trained deep learning model to identify diseases from plant images.\n\n\n## Features\n\n- User registration and authentication\n- Image upload and processing\n- Automated disease classification using a deep learning model\n- Community interaction through a comment system\n- User activity logging\n- Detailed prediction results with confidence scores\n\n## Project Structure\n\n```scss\nplant_disease_classification/\n├── backend/\n│   ├── main.py                        # FastAPI main application\n│   ├── models.py                      # SQLAlchemy models\n│   ├── database.py                    # Database connection setup\n│   ├── schemas.py                     # Pydantic schemas for data validation\n│   ├── app.py                         # Streamlit frontend\n│   ├── ml_model.py                    # Model loading and inference\n│   └── uploads/                       # Directory to store uploaded images\n├── model/\t\t\t       \n│   ├── label_encoder.joblib           # Label encoder for disease labels\n│   ├── resnet_50_95.h5                # Pre-trained model\n│   ├── NasNetMobile.h5                # Pre-trained model\n│   ├── NasNetMobile.keras             # Pre-trained model\n├── example_images/                    # Example images for testing\n├── plant-disease-classification.ipynb # Jupyter notebook for training               \n├── requirements.txt                   # Dependencies for the project\n└── README.md                          # Project documentation\n\n```\n**Note**: In case GitHub's LFS bandwidth limit is reached, you can also download the models using this [Google Drive link](https://drive.google.com/drive/folders/1sQCoF_Q6XmXKS3-YXhH8ZNv047P4L3By?usp=sharing).\n\n### Additional Resources\nFor a more detailed overview of the project, please refer to the [Project Overview](https://github.com/AnshKGoyal/Plant-Disease-Classification/blob/main/Plant%20Disease%20Classification%20Web%20Application%20Overview.md).\n\nIt also contains visual diagrams like Data Flow Diagram and Entity Relationship Diagram to support understanding.\n\n## Demo Video\n\nTo see the Plant Disease Classification Web app in action, check out this demo video:\n\n\nhttps://github.com/user-attachments/assets/4887ef70-9f47-4199-9f16-909a0df7fa41\n\n\n\n## Installation\n\n### Prerequisites\n\n- [SQL Server 2022 Developer Edition](https://www.microsoft.com/en-in/sql-server/sql-server-downloads)\n- [SQL Server Management Studio (SSMS)](https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver16)\n- Python 3.x\n\n\n### Setup\n\n1. Clone or Download the Repository and open the project directory in your editor (VS Code)\n\n2. Create a virtual environment and activate it:\n```\npython -m venv venv\nsource venv/bin/activate  # On Windows, use `.\\venv\\Scripts\\activate`\n```\n\n3. Install the required dependencies:\n```\npython -m pip install -r requirements.txt\n```\n**Note**: If the bandwidth limit for GitHub LFS is exceeded and you cannot download the models, you can also use this [Google Drive link](https://drive.google.com/drive/folders/1sQCoF_Q6XmXKS3-YXhH8ZNv047P4L3By?usp=sharing) to download the models.\n\n4. Update the `SERVER` and `DATABASE` variables in `backend/database.py` with your SQL Server details.\n```\nSERVER = 'your_server_name'\nDATABASE = 'plant_disease'\n```\n \n Ensure that the required tables are created by running the FastAPI app, which will automatically generate the tables in the database.\n\n5. Start the FastAPI backend:\n```\ncd backend\nuvicorn main:app --reload\n```\n\n6. Start the Streamlit frontend:\n```\ncd backend\nstreamlit run app.py\n```\nThe frontend will be accessible at `http://localhost:8501`.\n\n## Training the Model\n\nThe pre-trained models are included in the `models/` directory, so no additional download is necessary. However, if you want to retrain the model, you can either use the public Kaggle notebook or download the same notebook from GitHub.\n\nThis project uses the [Plant Pathogens dataset](https://www.kaggle.com/datasets/sujallimje/plant-pathogens) , which is already linked in the Kaggle notebook but can also be downloaded for local use from GitHub. (Note: This Dataset is licensed under CC BY-NC-SA 4.0,  so The model trained using this dataset cannot be used for commercial purposes.)\n\n\n## Steps to Train the Model:\n\n1. **Option 1: Use Kaggle's Public Notebook** :\n    - Directly Fork the [Plant Disease Classification Notebook](https://www.kaggle.com/code/anshkgoyal/plant-disease-classification) on Kaggle. This allows you to create your own copy of the notebook, ready to run and customize.\n    - The dataset is pre-linked in the notebook, and you can use Kaggle's free GPU/TPU resources for training.\n    \n2. **Option 2: Use the GitHub Notebook** :\n    - Download the `plant-disease-classification.ipynb` notebook from the GitHub repository and run it locally.\n    - Install the necessary dependencies and ensure the dataset is properly downloaded and loaded.\n    \n    **Important Note**: The notebook in this GitHub repository is the same as the one uploaded on Kaggle. If you're running it locally, please be aware that:\n    - You may need to manually install required libraries.\n    - Some import statements might need adjustments due to differences between the Kaggle environment and your local setup.\n    - While the notebook was originally run using TPU on Kaggle, the code is GPU-agnostic and can be run on different hardware setups with appropriate modifications.\n    \n3. **Training the Model** : \n    - Customize the model's hyperparameters (e.g., learning rate, batch size) in either environment.\n    - Monitor the performance metrics (loss, accuracy) during training to ensure the model is learning effectively.\n    - If using Kaggle, utilize the GPU/TPU to speed up training, especially for large datasets.\n    \n4. **Saving and Downloading Models** :\n    - After training, save your model using `torch.save()` or `model.save()`, depending on the framework.\n    - For Kaggle users, download the trained model files for local use. For GitHub users, simply save the model in your local directory.\n\nBy following these steps, you can train the model either on Kaggle or locally using the provided notebook. Remember to adjust your environment and code as necessary when running locally.\n\n\n\n## Licensing Information\n\n- The **code** in this repository is licensed under [Apache 2.0](https://github.com/AnshKGoyal/Plant-Disease-Classification/blob/main/LICENSE).\n- The models and files found in the `model/` folder is licensed under [CC BY-NC-SA 4.0](https://github.com/AnshKGoyal/Plant-Disease-Classification/blob/main/model/LICENSE).\n\t- The **trained model** is derived from a dataset licensed under [CC BY-NC-SA 4.0](https://github.com/AnshKGoyal/Plant-Disease-Classification/blob/main/model/LICENSE) and is therefore licensed under the same terms. This model cannot be used for commercial purposes.\n  - Official Website of CC BY-NC-SA 4.0 license is https://creativecommons.org/licenses/by-nc-sa/4.0/\n\n## Contributing\n---\nContributions to this project are welcome. Please fork the repository and submit a pull request with your changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanshkgoyal%2Fplant-disease-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanshkgoyal%2Fplant-disease-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanshkgoyal%2Fplant-disease-classification/lists"}