Agriculture is the backbone of food security, yet millions of farmers—especially in developing regions like Nigeria—struggle with unpredictable weather, crop diseases, and limited access to expert advice. I built FarmConsultAI to tackle these critical challenges by putting the power of AI directly into the hands of farmers.
🔗 Live Demo: farmconsultai.streamlit.app
FarmConsultAI is an intelligent, AI-powered web application designed to help farmers, agropreneurs, and agri-investors make smarter, data-driven decisions. It integrates machine learning, computer vision, and generative AI to provide a holistic farm advisory service.
- 📈 Crop Yield Prediction: A Random Forest Regressor model predicts crop yield in tons/hectare based on soil type, weather conditions, and Nitrogen level.
- 🌿 Crop Disease Diagnosis: An EfficientNet-B3 computer vision model detects and classifies diseases from uploaded crop leaf images with high accuracy.
- 💬 AI-Powered Advice: Google's Gemini provides actionable recommendations and conversational follow-ups, explaining complex insights in simple, local-friendly language.
- 🖥️ Interactive Web App: A user-friendly interface built with Streamlit makes these powerful tools accessible on any device with an internet connection.
This project combines multiple AI disciplines into a seamless user experience.
- Frontend:
Streamlit - Yield Prediction:
Scikit-learn,Pandas,NumPy - Disease Diagnosis:
PyTorch,TIMM (PyTorch Image Models) - Generative AI & Chat:
Google Generative AI (Gemini) - Deployment:
Streamlit Community Cloud
The application follows a simple, effective architecture:
- The Streamlit UI captures user inputs (form data for yield, images for diseases).
- The inputs are processed and fed into the appropriate backend model (Random Forest or EfficientNet-B3).
- The model's prediction is passed to the Gemini API along with a structured prompt.
- Gemini generates a detailed, easy-to-understand explanation and actionable advice.
- The final output and conversational chat interface are rendered back to the user in the Streamlit app.
To run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/abdulmumeen-abdullahi/FarmConsultAI.git cd FarmConsultAI - Install the required dependencies:
pip install -r requirements.txt
- Set up your API keys:
Create a
.streamlit/secrets.tomlfile and add your Gemini API key:GEMINI_API_KEY = "YOUR_API_KEY_HERE"
- Run the Streamlit app:
streamlit run streamlit_app.py
FarmConsultAI directly addresses several UN Sustainable Development Goals (SDGs):
- SDG 1 (No Poverty): By improving farm productivity and reducing crop losses.
- SDG 2 (Zero Hunger): Helping farmers grow more and waste less to feed communities.
- SDG 13 (Climate Action): Promoting climate-smart agriculture through informed decision-making.
In Nigeria, where farmers often lack access to timely agronomic expertise, this app bridges a critical knowledge gap. It democratizes access to AI-driven insights that were once out of reach, empowering a new generation of farmers.
- Live Demo: https://farmconsultai.streamlit.app
- Crop Yield Prediction Sub-Repo: Link to GitHub Repository
- Crop Disease Detection Sub-Repo: Link to GitHub Repository



