Inspiration Global food security is under constant threat from climate change and evolving crop diseases, which cause an average of 20-40% loss in global grain yields annually. While large-scale industrial farms have access to expensive agronomists and high-tech sensors, small-holder farmers—who produce a third of the world’s food—are often left behind. We were inspired to bridge this "digital divide" by putting a world-class agricultural expert in every farmer's pocket using the power of Generative AI and Computer Vision.
What it does AgriSense is an all-in-one AI-powered farming companion. It provides three core pillars of support: Visual Diagnosis: Farmers can upload a photo of a distressed plant, and our specialized Computer Vision model identifies the disease, pest, or nutrient deficiency. AI Advisory Agent: A conversational interface (LLM) that provides step-by-step treatment plans, organic and chemical recommendations, and planting advice tailored to the specific crop and region. Environmental Intelligence: The agent integrates real-time weather data to warn farmers of upcoming risks (like frost or heavy rain) and suggests the optimal time for irrigation or fertilization.
How I built it The platform is built on a modern, scalable AI stack: Frontend: Developed with Next.js 14 and Tailwind CSS to ensure a mobile-first, responsive experience that works even on low-end smartphones. Backend: A high-performance FastAPI (Python) server handles the logic and bridges the AI models. Brain (LLM): We utilized Google Gemini 1.5 Pro (or Mistral-7B) to power the advisory agent, using specialized "System Prompting" to ensure the advice is scientifically accurate. Vision Engine: We implemented a Convolutional Neural Network (CNN)—specifically a fine-tuned ResNet-50 model—trained on the PlantVillage dataset to classify 38 different types of plant diseases. Real-time Data: Integration with the Open-Meteo API for hyperlocal weather forecasting without the need for API keys, keeping the system lightweight.
Deployment: The frontend is hosted on Vercel, while the backend is containerized using Docker and deployed on Render.
Challenges I ran into Dataset Noise: Initial models struggled with images taken in "real-world" conditions (varying shadows, muddy backgrounds). We had to implement advanced image preprocessing using OpenCV to normalize lighting and focus on the leaf structure. Hallucination Control: Early versions of the AI sometimes recommended incorrect chemical dosages. We solved this by implementing RAG (Retrieval-Augmented Generation), forcing the AI to cross-reference a trusted database of agricultural handbooks before answering. Latency: Running deep learning models can be slow. We optimized the inference time by converting our models to ONNX format, significantly reducing the "wait time" for a farmer in the field. Accomplishments that I'm proud of High Accuracy: Successfully achieved a 94% validation accuracy in identifying common diseases like Late Blight in potatoes and Tomato Yellow Leaf Curl Virus. Accessibility: Created a UI that is highly visual and intuitive, minimizing the need for heavy typing, which is crucial for users in rural settings. Seamless Integration: Successfully combined "Hard Science" (CNN image classification) with "Natural Language" (LLM advice) into one fluid user journey.
What I learned The Power of Fine-Tuning: I learned how much a general-purpose AI can be improved by giving it a specific "persona" and access to niche domain knowledge. Edge Computing Needs: I realized that for many farmers, "Cloud-only" is a dealbreaker. This project taught me the importance of model compression for future offline use. Agricultural Complexity: I gained a deep appreciation for the complexity of agronomy—learning that a "spot on a leaf" could mean ten different things depending on the soil pH and humidity.
What's next for AgriSense – AI Farming Advisory Agent Offline Mode: Developing a "Lite" version of the vision model that runs locally on the device via TensorFlow Lite for areas with no internet. Voice Interface: Implementing multi-language voice-to-text features so farmers can speak to the agent in their native dialects (e.g., Hindi, Swahili, Spanish). IoT Soil Integration: Connecting with low-cost $10 ESP32 soil moisture sensors to provide real-time irrigation alerts directly to the dashboard. Marketplace Linkage: Connecting diagnosed problems directly to local suppliers where farmers can buy the necessary organic treatments at the best price.
Built With
- css
- fastapi
- javascript.
- llm
- machhinelearning
- next.js
- python)
- react
- typescript
Log in or sign up for Devpost to join the conversation.