Skip to content

AkashMs24/FarmVoice-AI

Repository files navigation

FarmVoice AI — Explainable Crop Advisory for Indian Farmers

140 million smallholder farmers. Most don't know their soil's NPK values.
They know: "My soil is black. I get heavy rain. It gets very hot."
FarmVoice AI understands exactly that.

Live App Accuracy XAI Python


The real problem

Existing AI tools require structured inputs — N, P, K values, exact pH, precise rainfall numbers. Farmers think in natural language, not spreadsheets.

But there's a deeper issue: even when AI recommends a crop, farmers won't follow it unless they understand why.

FarmVoice AI solves both.


How it works

  1. Farmer describes their land in plain English, Hindi, or Kannada transliteration
  2. NLP parser maps the description to soil and climate parameters
  3. Random Forest model predicts the best crop (89.1% accuracy, 22 crops)
  4. SHAP explains the decision in plain English — not just what, but why

Traditional AI: "Grow Rice." — Farmer doesn't trust it.

FarmVoice AI: "Grow Rice because your high rainfall (250mm) strongly supports it, your temperature (30°C) is ideal, and your soil pH (7.8) is suitable." — Farmer understands and acts on it.


Example inputs

"My soil is black and fertile, I get heavy monsoon rain, very hot temperature" → Recommends: Rice (with SHAP waterfall explanation) "Red sandy soil, less rainfall, moderate temperature, hill area" → Recommends: Wheat (with SHAP waterfall explanation) "Coastal area, very humid, heavy rain, black soil" → Recommends: Coconut (with SHAP waterfall explanation)


Model

Detail Value
Algorithm Random Forest (200 estimators)
Accuracy 89.1% on held-out test set
Features N, P, K, Temperature, Humidity, pH, Rainfall
Crops 22 Indian crops
Explainability SHAP TreeExplainer + waterfall charts

Stack

Python Streamlit scikit-learn SHAP Pandas NumPy Matplotlib


Run locally

git clone https://github.com/AkashMs24/FarmVoice-AI.git
cd FarmVoice-AI
pip install -r requirements.txt
streamlit run app.py

Project structure

FarmVoice-AI/ ├── app.py # Main Streamlit application ├── model.pkl # Trained Random Forest model ├── label_encoder.pkl # Label encoder for crop names ├── crop_data.csv # Training dataset (22 crops) ├── train_model.py # Model training script └── requirements.txt # Dependencies


Related projects


Built by Akash M S · Presidency University, Bengaluru
LinkedIn · GitHub · ms29akash@gmail.com

About

Explainable AI-powered crop advisory system using NLP + ML that converts natural language into accurate, transparent crop recommendations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages