{"id":25855464,"url":"https://github.com/dbriane208/leafguard-model","last_synced_at":"2026-05-05T04:31:21.562Z","repository":{"id":279204115,"uuid":"927651231","full_name":"Dbriane208/LeafGuard-Model","owner":"Dbriane208","description":"LeafGuard, a plant Classification model, is a deep learning model designed for plant disease classification. The model is trained to identify various plant diseases based on images of leaves. It utilizes a Convolutional Neural Network (CNN) architecture to process and classify plant images into predefined categories.","archived":false,"fork":false,"pushed_at":"2025-02-24T10:49:20.000Z","size":2691,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T11:30:36.833Z","etag":null,"topics":["cnn-classification","cnn-model","deep-learning","keras","neural-networks","python","tensorflow"],"latest_commit_sha":null,"homepage":"","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/Dbriane208.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":"2025-02-05T10:09:37.000Z","updated_at":"2025-02-24T10:49:23.000Z","dependencies_parsed_at":"2025-02-24T11:40:40.104Z","dependency_job_id":null,"html_url":"https://github.com/Dbriane208/LeafGuard-Model","commit_stats":null,"previous_names":["dbriane208/leafguard-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbriane208%2FLeafGuard-Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbriane208%2FLeafGuard-Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbriane208%2FLeafGuard-Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dbriane208%2FLeafGuard-Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dbriane208","download_url":"https://codeload.github.com/Dbriane208/LeafGuard-Model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241396777,"owners_count":19956408,"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":["cnn-classification","cnn-model","deep-learning","keras","neural-networks","python","tensorflow"],"created_at":"2025-03-01T17:18:24.244Z","updated_at":"2025-10-07T17:13:28.979Z","avatar_url":"https://github.com/Dbriane208.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌿 LeafGuard Model\n\nLeafGuard is an AI-powered apple plant classification system designed to identify plant diseases from leaf images. Utilizing deep learning, the model provides accurate classifications and suggested remedies to help farmers and plant enthusiasts maintain plant health. The model supports three apple plant diseases that is Apple Scab, Apple Cedar Rust and Apple Black Rot.\n\n---\n\n## 🚀 Key Features\n- 📷 **Image Classification**: Identifies plant diseases by analyzing leaf images, providing real-time insights into plant health.\n- 🤖 **AI-Driven Symptom Analysis**: Uses artificial intelligence to recognize symptoms and suggest possible disease prevention methods.\n- 📊 **Data-Driven Predictions**: Trained on a large dataset of plant images to accurately identify diseases such as blight, rust, and mildew.\n- 🎯 **Model Training \u0026 Evaluation**: The CNN model, based on **ResNet50**, is trained and evaluated using metrics like accuracy, precision, and recall.\n- 🖥 **FastAPI-Based Backend**: A robust API service for model inference and integration with applications.\n\n---\n\n## 🛠️ Technologies Used\n- **TensorFlow/Keras**: For deep learning model development and training.\n- **FastAPI**: For deploying the model as a high-performance web service.\n- **Pandas/NumPy**: For data preprocessing and handling.\n- **Gemini**: For identifying the plant symptoms and providing preventive measures.\n\n\n---\n\n## ⚙️ How It Works\n1. **Data Collection**: A curated dataset containing images of diseased and healthy leaves is used for training.\n2. **Model Training**: A **ResNet50-based** CNN is trained to distinguish between different plant diseases.\n3. **API Deployment**: The trained model is served using **FastAPI**, allowing applications to send images and receive disease predictions.\n4. **Gemini Response Format**: The API returns JSON responses with classification results, confidence scores, and recommended actions.\n\n---\n\n## 🔧 API Setup \u0026 Usage\n### Prerequisites\n- Python 3.8+\n- TensorFlow/Keras installed\n- FastAPI and dependencies installed\n- Google Gemini\n\n### Clone the Repository\n```sh\ngit clone https://github.com/Dbriane208/LeafGuard-Model.git\ncd LeafGuard-Model\n```\n\n### Install Dependencies\n```sh\npip install -r requirements.txt\n```\n\n### Run the API Server\n```sh\nuvicorn main:app --host 0.0.0.0 --port 8000\n```\n\n### Sample API Request\nSend a **POST** request to `/predict` with an image file:\n```sh\ncurl -X 'POST' \\\n  'http://localhost:8000/predict' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: multipart/form-data' \\\n  -F 'file=@leaf.jpg'\n```\n\n### Example API Response\n\nThis is the actual sample of the Postman API Response. The FastAPI endpoint is hosted in [Render.com](https://render.com/)\n\n\u003cdiv style=\"display:flex;\"\u003e\n    \u003cimg src=\"https://github.com/Dbriane208/LeafGuard/blob/main/leafguard/assets/screenshots/api.png\" alt=\"api\" /\u003e\n\u003c/div\u003e\n\n```json\n{\n  \"predicted_class\": \"Leaf Blight\",\n  \"confidence\": 0.9999,\n  \"symptoms\": \"Brown spots with yellow halos\",\n  \"measures\": \"Use fungicides and remove affected leaves\"\n}\n```\n\n---\n\n## 📄 License\nThis project is licensed under the **MIT License**.\n\n---\n\n## 🤝 Contributing\nWe welcome contributions! To contribute:\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-name`).\n3. Make your changes and commit (`git commit -m 'Add new feature'`).\n4. Push to the branch (`git push origin feature-name`).\n5. Open a Pull Request.\n\n---\n\n## 📩 Contact\nFor inquiries, reach out via email:\n📧 **db9755949@gmail.com**\n\nOr connect on LinkedIn: [Daniel Brian Gatuhu](https://www.linkedin.com/in/daniel-brian-gatuhu/)\n\n---\n\n⭐ If you like this project, don't forget to give it a star on GitHub! ⭐\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbriane208%2Fleafguard-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbriane208%2Fleafguard-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbriane208%2Fleafguard-model/lists"}