https://github.com/dbriane208/leafguard-model
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.
https://github.com/dbriane208/leafguard-model
cnn-classification cnn-model deep-learning keras neural-networks python tensorflow
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/dbriane208/leafguard-model
- Owner: Dbriane208
- Created: 2025-02-05T10:09:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-24T10:49:20.000Z (over 1 year ago)
- Last Synced: 2025-02-24T11:30:36.833Z (over 1 year ago)
- Topics: cnn-classification, cnn-model, deep-learning, keras, neural-networks, python, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 2.57 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌿 LeafGuard Model
LeafGuard 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.
---
## 🚀 Key Features
- 📷 **Image Classification**: Identifies plant diseases by analyzing leaf images, providing real-time insights into plant health.
- 🤖 **AI-Driven Symptom Analysis**: Uses artificial intelligence to recognize symptoms and suggest possible disease prevention methods.
- 📊 **Data-Driven Predictions**: Trained on a large dataset of plant images to accurately identify diseases such as blight, rust, and mildew.
- 🎯 **Model Training & Evaluation**: The CNN model, based on **ResNet50**, is trained and evaluated using metrics like accuracy, precision, and recall.
- 🖥 **FastAPI-Based Backend**: A robust API service for model inference and integration with applications.
---
## 🛠️ Technologies Used
- **TensorFlow/Keras**: For deep learning model development and training.
- **FastAPI**: For deploying the model as a high-performance web service.
- **Pandas/NumPy**: For data preprocessing and handling.
- **Gemini**: For identifying the plant symptoms and providing preventive measures.
---
## ⚙️ How It Works
1. **Data Collection**: A curated dataset containing images of diseased and healthy leaves is used for training.
2. **Model Training**: A **ResNet50-based** CNN is trained to distinguish between different plant diseases.
3. **API Deployment**: The trained model is served using **FastAPI**, allowing applications to send images and receive disease predictions.
4. **Gemini Response Format**: The API returns JSON responses with classification results, confidence scores, and recommended actions.
---
## 🔧 API Setup & Usage
### Prerequisites
- Python 3.8+
- TensorFlow/Keras installed
- FastAPI and dependencies installed
- Google Gemini
### Clone the Repository
```sh
git clone https://github.com/Dbriane208/LeafGuard-Model.git
cd LeafGuard-Model
```
### Install Dependencies
```sh
pip install -r requirements.txt
```
### Run the API Server
```sh
uvicorn main:app --host 0.0.0.0 --port 8000
```
### Sample API Request
Send a **POST** request to `/predict` with an image file:
```sh
curl -X 'POST' \
'http://localhost:8000/predict' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@leaf.jpg'
```
### Example API Response
This is the actual sample of the Postman API Response. The FastAPI endpoint is hosted in [Render.com](https://render.com/)
```json
{
"predicted_class": "Leaf Blight",
"confidence": 0.9999,
"symptoms": "Brown spots with yellow halos",
"measures": "Use fungicides and remove affected leaves"
}
```
---
## 📄 License
This project is licensed under the **MIT License**.
---
## 🤝 Contributing
We welcome contributions! To contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Make your changes and commit (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-name`).
5. Open a Pull Request.
---
## 📩 Contact
For inquiries, reach out via email:
📧 **db9755949@gmail.com**
Or connect on LinkedIn: [Daniel Brian Gatuhu](https://www.linkedin.com/in/daniel-brian-gatuhu/)
---
⭐ If you like this project, don't forget to give it a star on GitHub! ⭐