Back to portfolio

🌱

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

Agri AI combines classical machine learning with deep computer vision to cover the full crop lifecycle. Farmers enter soil and weather values or point a camera at a leaf, and the platform returns an actionable recommendation with reasoning in plain language.

Problem Statement

Small-holder farmers make high-stakes decisions — what to plant, what to spray, how much fertilizer — with almost no data support. Existing advisory tools are fragmented, text-heavy and rarely handle images or local context.

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

  1. 01Farmer signs in (bcrypt + session auth)
  2. 02Inputs soil NPK, temperature, humidity, pH and rainfall — or captures an image
  3. 03Router selects the tabular ensemble or the vision model
  4. 04Prediction passes multi-layer validation to reject low-confidence outputs
  5. 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

XGBoost + RF EnsembleMobileNetV2DenseNet121Federated LearningOpenCVOllama (Mistral)MongoDBPython

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