🌱
Agri AI
AI-Driven Precision Agriculture Platform
An AI-powered smart agriculture platform giving farmers crop recommendation, fertilizer guidance, pesticide identification, plant disease detection and yield prediction through one interface with real-time camera support.
Overview
Problem Statement
Architecture
- ›React web client with real-time camera capture
- ›Python inference service exposing model endpoints
- ›Ensemble tabular models (XGBoost + Random Forest) for crop, fertilizer and yield
- ›CNN vision models (MobileNetV2 for pests, DenseNet121 for leaf disease)
- ›Ollama (Mistral) fallback layer for natural-language reasoning
- ›MongoDB for users, sessions and prediction history
Workflow
- 01Farmer signs in (bcrypt + session auth)
- 02Inputs soil NPK, temperature, humidity, pH and rainfall — or captures an image
- 03Router selects the tabular ensemble or the vision model
- 04Prediction passes multi-layer validation to reject low-confidence outputs
- 05LLM layer converts the prediction into guidance, dosage and precautions
Features
- ✦Crop recommendation from NPK, temperature, humidity, pH and rainfall with reasoning
- ✦Fertilizer guidance via stacked ensemble ML with Ollama AI fallback (rates, precautions)
- ✦Pesticide / pest detection with MobileNetV2 from camera or upload, including dosage
- ✦Plant disease detection with DenseNet121 leaf analysis and multi-layer validation
- ✦Yield prediction with XGBoost trained using federated learning
- ✦Secure authentication with bcrypt and sessions stored in MongoDB
Technology Stack
Challenges & Solutions
Leaf images from phone cameras vary wildly in light and framing.
SOLUTION · Added OpenCV pre-processing plus a multi-layer validation gate that rejects out-of-distribution frames before inference.
Farm data is private and distributed across regions.
SOLUTION · Trained the yield model with federated learning so regional data never leaves its source.
Raw class labels are meaningless to a farmer.
SOLUTION · Layered an LLM on top of every prediction to produce dosage, timing and precaution guidance in plain language.
Results
- →Five distinct AI capabilities unified behind one interface
- →High-confidence disease detection with a validation gate that suppresses false positives
- →Recommendations delivered with reasoning rather than bare class labels
Explore more work