This project is a web application designed to assist in identifying and managing maize leaf diseases through AI-driven predictions. The application is dockerized for easy deployment and provides the following features:
-
Disease Prediction
- Users can upload maize leaf images, and the system predicts the disease affecting the leaf using a pre-trained machine learning model.
-
Model Retraining
- Users can upload bulk data (ZIP files of categorized images) to retrain the existing model with their dataset. This ensures the model adapts to new data and remains accurate.
-
Data Visualizations
- A dedicated page displays various interactive visualizations based on the dataset, with key insights and interpretations.
-
Model Download
- Users can download the retrained model for their use.
-
Evaluation Metrics
- Detailed metrics for both prediction and retraining processes are displayed.
-
Performance Testing
- A flood request simulation was conducted using Locust software to evaluate system performance under heavy load.
The application is built using HTML, CSS, and JavaScript for the frontend, while the backend is developed with FastAPI. The machine learning pipeline was designed from scratch, including scaling and monitoring on a cloud platform.
Watch a detailed demonstration of the project in action:
YouTube Demo
Access the live application here:
Application URL
Access the live API Endpoint here:
Endpoint URL
git clone https://github.com/yourusername/maize-disease-detection.git
cd maize-disease-detectionEnsure you have Docker installed. Build and run the Docker container:
# Build the Docker image
docker build -t maize-disease-detection .
# Run the container
docker run -p 8000:8000 maize-disease-detectionThe application will be accessible at http://127.0.0.1:8000.
If you prefer to run the application locally without Docker:
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtuvicorn main:app --reloadAccess the application at http://127.0.0.1:8000.
- Endpoint:
/predict - Input: Single image upload.
- Output: Predicted disease class and confidence score.
- Endpoint:
/retrain/upload - Input: ZIP file of categorized images.
- Output:
- Retrained model download link.
- Evaluation metrics (loss, accuracy).
- Page URL:
/visualizations - Features: Interactive plots highlighting dataset insights, such as:
- Distribution of disease classes.
- Feature correlations.
- Trends in image quality or class balance.
- Endpoint:
/retrain/download-model
The application’s performance was evaluated under heavy load using Locust software. Results include:
- Average response time: X seconds
- Peak concurrent users: Y users
Detailed results are available:
- CSV File: Flood Simulation Results
- Visualizations:

| Metric | Value |
|---|---|
| Predicted Class | Blight |
| Confidence Score | 58.4% |
| Metric | Value |
|---|---|
| Loss | 0.56 |
| Accuracy | 83% |
Contributions are welcome! Feel free to open issues or submit pull requests for improvements and new features.
This project is licensed under the MIT License. See the LICENSE file for details.
Let me know if further modifications are needed! 🚀