AI-Powered Plant Disease Detection Android Application
Helping farmers diagnose crop diseases using Deep Learning, Computer Vision, and FastAPI.
⭐ AI Disease Detection
📷 Camera & Gallery Support
🧠 Custom EfficientNetB3 Model
🌦 Weather Information
🌱 Crop Library
⚡ FastAPI Inference Engine
KrishiSheba is an AI-powered Android application designed to assist farmers, students, and agricultural enthusiasts in identifying plant diseases through deep learning. By combining modern Android development with a custom-trained computer vision model, the application delivers fast and intelligent disease diagnosis directly from leaf images.
Users can capture a photo using their device's camera or upload an existing leaf image. The image is sent to a FastAPI backend for inference, where a custom-trained EfficientNetB3 model analyses it and returns the predicted disease along with its confidence score. Beyond simple classification, KrishiSheba provides comprehensive agricultural guidance, including disease causes, symptoms, treatment recommendations, and preventive measures to support informed decision-making.
In addition to AI-powered disease detection, the application integrates weather information and a crop library, making it a practical companion for everyday agricultural use. The project demonstrates the integration of Android, FastAPI, and TensorFlow into a complete end-to-end AI solution, showcasing mobile development, backend engineering, RESTful API design, and deep learning within a single application.
KrishiSheba is more than an image classifier—it's a full-stack AI-powered agricultural assistant that bridges mobile technology and machine learning to make plant disease diagnosis more accessible.
- 🤖 Custom AI Model trained on the PlantVillage dataset using EfficientNetB3.
- 📱 Native Android Application built with Java, XML, Material Design, and RecyclerView.
- ⚡ FastAPI Backend serving real-time AI predictions through REST APIs.
- 🌦 Integrated Weather Module to provide contextual farming information.
- 🌿 Crop Knowledge Base for exploring crop information within the app.
- 🩺 Actionable Disease Guidance including causes, symptoms, treatment, and prevention.
- 🧩 Modular Full-Stack Architecture designed with clear separation between mobile, backend, and AI components.
Experience KrishiSheba in action through the application demo and interface previews below.
app-demo.mp4
AI-powered disease detection workflow from image selection to intelligent recommendations.
|
Identify plant diseases from leaf images using a custom-trained EfficientNetB3 deep learning model served through a FastAPI backend. |
Display the predicted disease along with a confidence score, helping users better interpret AI-generated results. |
|
Receive detailed agricultural guidance including disease causes, symptoms, treatment methods, and prevention strategies. |
Capture a live leaf image or select one from the device gallery for seamless disease analysis. |
|
Access real-time weather information to support better farming decisions and crop management. |
Explore a built-in crop knowledge base containing useful agricultural information and references. |
|
Secure login and registration system for managing user access and future personalised features. |
Powered by a FastAPI backend that performs AI inference and returns structured JSON responses with prediction details and recommendations. |
|
Built entirely with Java, XML, Material Design, RecyclerView, Retrofit, and SQLite for a responsive native experience. |
The application uses a custom-trained EfficientNetB3 model trained on the PlantVillage dataset with 38 disease classes. |
| Category | Details |
|---|---|
| 📱 Platform | Android |
| 🧠 AI Model | EfficientNetB3 |
| 🌿 Dataset | PlantVillage |
| 📂 Disease Classes | 38 |
| 🔌 Backend | FastAPI |
| 📡 API Format | REST / JSON |
| 💾 Local Database | SQLite |
| 🌦 Weather API | Open-Meteo |
| 📷 Image Input | Camera & Gallery |
| ⚙️ Programming Language | Java & Python |
KrishiSheba follows a modular client-server architecture that separates the mobile application, backend services, and AI inference engine. This design keeps the Android application lightweight while allowing the machine learning model to run independently on the backend.
- The user captures or uploads a leaf image using the Android application.
- The Android client sends the image to the FastAPI backend through the
/predictREST endpoint. - The backend preprocesses the image and performs inference using the custom-trained EfficientNetB3 model.
- The prediction engine identifies the most likely disease and calculates the confidence score.
- The backend enriches the prediction with agricultural guidance, including causes, symptoms, treatment options, and prevention measures.
- A structured JSON response is returned to the Android application, where the results are displayed through an intuitive user interface.
- 📱 Native Android client built with Java and XML
- 🔗 RESTful communication using Retrofit
- ⚡ FastAPI backend for AI inference
- 🧠 Custom EfficientNetB3 deep learning model
- 📦 JSON-based API responses
- 🗂️ Modular separation of mobile, backend, and AI components
KrishiSheba is powered by a custom-trained EfficientNetB3 deep learning model developed using TensorFlow and Keras. Instead of relying on a third-party prediction service, the model was trained on the PlantVillage dataset to recognise multiple plant diseases across different crops.
The trained model is deployed through a FastAPI backend, enabling real-time inference for the Android application. Each prediction is accompanied by a confidence score and enriched with disease-specific recommendations, providing users with practical agricultural guidance rather than a simple classification result.
- Collect plant leaf images from the PlantVillage dataset.
- Resize all images to 224 × 224 × 3.
- Apply preprocessing and data augmentation.
- Train the EfficientNetB3 model using transfer learning.
- Fine-tune the network to improve classification performance.
- Export the trained model in
.h5format. - Load the model into the FastAPI backend.
- Perform real-time inference for incoming Android requests.
| Parameter | Value |
|---|---|
| Architecture | EfficientNetB3 |
| Framework | TensorFlow 2.11 |
| Keras Version | 2.11 |
| Dataset | PlantVillage |
| Input Size | 224 × 224 × 3 |
| Output Classes | 38 |
| Task | Multi-class Image Classification |
| Backend | FastAPI |
| Model Format | .h5 |
Leaf Image
│
▼
Image Preprocessing
│
▼
EfficientNetB3 Model
│
▼
Disease Prediction
│
▼
Confidence Score
│
▼
Recommendation Engine
│
▼
JSON Response
│
▼
Android Application
KrishiSheba's disease detection model was trained using the PlantVillage dataset, one of the most widely used benchmark datasets for plant disease classification. The dataset contains thousands of annotated leaf images covering multiple crops and diseases, making it well suited for supervised deep learning tasks.
The images were preprocessed and resized to 224 × 224 × 3 before training the EfficientNetB3 model. Data augmentation techniques were applied to improve model generalisation and reduce overfitting.
| Attribute | Value |
|---|---|
| Dataset | PlantVillage |
| Total Classes | 38 |
| Image Size | 224 × 224 × 3 |
| Task | Multi-class Image Classification |
| Framework | TensorFlow / Keras |
- 📂 Dataset collection
- 🖼️ Image resizing
- 🎨 Normalisation
- 🔄 Data augmentation
- 📊 Training / Validation / Test split
- 🧠 Model training
The EfficientNetB3 model was trained using TensorFlow and Keras on PlantVillage dataset, which contains annotated leaf images representing healthy and diseased crops across multiple plant species.
Representative leaf samples from the PlantVillage dataset used during model training.
The training process monitored both training and validation performance to ensure good generalisation while reducing the risk of overfitting. The final model was exported in .h5 format and integrated into the FastAPI backend for real-time inference.
| Metric | Result |
|---|---|
| Model Architecture | EfficientNetB3 |
| Dataset | PlantVillage |
| Number of Classes | 38 |
| Input Resolution | 224 × 224 × 3 |
| Framework | TensorFlow 2.11 + Keras 2.11 |
| Training Accuracy | 99.99% |
| Validation Accuracy | 99.82% |
| Test Accuracy | 99.89% |
Note: These metrics were obtained using the PlantVillage benchmark dataset under the training and evaluation configuration described above. Real-world performance may vary depending on image quality, lighting conditions, camera characteristics, and environmental factors.
Training and validation metrics recorded during model training.
- 🧠 Transfer learning using EfficientNetB3
- 🔄 Fine-tuning for improved classification performance
- 🖼️ Image preprocessing with 224 × 224 RGB inputs
- 🎨 Data augmentation to improve model generalisation
- 📊 Validation monitoring throughout training
- 💾 Best-performing model exported for deployment
PlantVillage Dataset
│
▼
Model Training
│
▼
Model Evaluation
│
▼
Best Model (.h5)
│
▼
FastAPI Backend
│
▼
Android Application
The custom-trained EfficientNetB3 model is trained on the PlantVillage dataset and can accurately classify 38 plant disease classes across 13 crop categories.
| Metric | Value |
|---|---|
| 🌿 Supported Crops | 13 |
| 🦠 Disease Classes | 38 |
| 🤖 Deep Learning Model | EfficientNetB3 |
| 📚 Training Dataset | PlantVillage |
| Crop | Classes | Supported Disease Categories |
|---|---|---|
| 🍎 Apple | 4 | Apple Scab, Black Rot, Cedar Apple Rust, Healthy |
| 🫐 Blueberry | 1 | Healthy |
| 🍒 Cherry | 2 | Powdery Mildew, Healthy |
| 🌽 Corn (Maize) | 4 | Cercospora Leaf Spot (Gray Leaf Spot), Common Rust, Northern Leaf Blight, Healthy |
| 🍇 Grape | 4 | Black Rot, Esca (Black Measles), Leaf Blight (Isariopsis Leaf Spot), Healthy |
| 🍊 Orange | 1 | Huanglongbing (Citrus Greening) |
| 🍑 Peach | 2 | Bacterial Spot, Healthy |
| 🫑 Bell Pepper | 2 | Bacterial Spot, Healthy |
| 🥔 Potato | 3 | Early Blight, Late Blight, Healthy |
| 🍓 Raspberry | 1 | Healthy |
| 🌱 Soybean | 1 | Healthy |
| 🥒 Squash | 1 | Powdery Mildew |
| 🍅 Tomato | 10 | Bacterial Spot, Early Blight, Late Blight, Leaf Mold, Septoria Leaf Spot, Spider Mites (Two-spotted Spider Mite), Target Spot, Tomato Mosaic Virus, Tomato Yellow Leaf Curl Virus, Healthy |
Total Coverage: 🌿 13 Crops • 🦠 38 Disease Classes • 🤖 EfficientNetB3 • 📚 PlantVillage Dataset
| Layer | Technologies |
|---|---|
| 📱 Android | Java, XML, Material Design, RecyclerView, Retrofit, SQLite |
| ⚙️ Backend | FastAPI, Python, TensorFlow, NumPy |
| 🧠 AI / ML | EfficientNetB3, TensorFlow 2.11, Keras 2.11 |
| 🌿 Dataset | PlantVillage |
| 🔗 API | RESTful JSON |
| 🛠️ Tools | Android Studio, VS Code, Kaggle, Git, GitHub |
Performs plant disease prediction using the trained EfficientNetB3 model.
| Parameter | Type | Description |
|---|---|---|
file |
Image | Leaf image for disease analysis |
{
"label": "Tomato___Late_blight",
"confidence": 0.998,
"recommendation": {
"cause": "...",
"symptoms": "...",
"treatment": [],
"prevention": []
}
}krishisheba-android/ ├── README.md ├── assets/ ├── KrishiSheba/ └── krishisheba-ai/
git clone https://github.com/akibuddin111/krishisheba-android.git- Open the KrishiSheba project in Android Studio.
- Configure the backend API URL if necessary.
- Build and run the application on an emulator or Android device.
Navigate to the backend directory:
cd krishisheba-aiCreate a virtual environment:
python -m venv venvActivate the virtual environment:
Windows
venv\Scripts\activateLinux / macOS
source venv/bin/activateInstall the required dependencies:
pip install -r requirements.txtThe trained EfficientNetB3 model is distributed separately because it exceeds GitHub's repository file size limit.
📥 Download the latest model from:
https://github.com/akibuddin111/krishisheba-android/releases/latest
Place the downloaded file here:
krishisheba-ai/
└── models/
└── plant_disease_model.h5
uvicorn app:app --reloadThe FastAPI server will automatically load the model during startup.
|
Full-Stack Developer | AI Enthusiast | Agriculture Graduate Passionate about building intelligent software solutions that combine Artificial Intelligence, Mobile Development, and Backend Engineering to solve real-world problems. KrishiSheba represents my passion for applying modern software engineering and machine learning to agriculture, transforming research into practical technology that can benefit farmers and agricultural communities.
|
⭐ If you found this project interesting, consider giving it a star.
Contributions, suggestions, and feedback are always welcome!
This project is licensed under the MIT License. See the LICENSE file for details.













