CropCare AI
AI-powered platform for real-time crop disease detection and personalized treatment guidance.
Created on 27th April 2025
•
CropCare AI
AI-powered platform for real-time crop disease detection and personalized treatment guidance.
The problem CropCare AI solves
🌾 The Problem It Solves
Farmers often struggle with:
- Identifying crop diseases early enough to prevent major losses
- Accessing quick, reliable, and actionable treatment information
- Tracking disease recurrence patterns over time
Manually diagnosing diseases is time-consuming, expensive, and often inaccurate without expert help.
🚀 How Our App Helps
-
Instant Disease Prediction:
Farmers can simply click a photo of the crop, and the app predicts the disease within seconds using AI. -
Immediate Treatment Guidance:
After the prediction, the app fetches and displays simple, actionable treatment steps, helping farmers react faster and minimize damage. -
Personalized History Dashboard:
Farmers can view their past predictions, track recurring issues, and monitor the health of their fields over time. -
Offline Support with Memory Storage:
Even if database insertion fails temporarily, predictions are safely stored locally, ensuring no disruption.
✅ This makes disease management easier, faster, and smarter — helping farmers protect their crops and maximize their yields efficiently.
Challenges we ran into
🛠️ Challenges We Ran Into
1. Supabase Row-Level Security (RLS) Restrictions
While trying to insert prediction data into the Supabase database, we encountered an error:
new row violates row-level security policy for table "predictions".
This was caused because the database had strict RLS policies enabled, which initially blocked our inserts.
Solution:
We handled this by temporarily storing predictions in memory as a fallback. Later, we adjusted the Supabase RLS policies to allow authorized users to insert records securely.
2. HuggingFace API Integration for Treatment Info
Fetching real-time treatment data from HuggingFace models wasn't straightforward. Most models were not fine-tuned for agricultural diseases.
Solution:
We carefully selected lightweight, general-purpose NLP models and fine-tuned our prompts to extract meaningful treatment advice in simple text.
3. Managing Asynchronous Data Fetching
Since the predictions, treatment suggestions, and history fetching all happened at different times, managing asynchronous behavior on the Next.js frontend led to issues like partial loading and flickering UI.
Solution:
We used loading spinners, fallback states, and optimized useEffect hooks to manage API call timing properly and ensure a smoother user experience.
4. Clarifai API Model Limitations
The pre-trained Clarifai model occasionally gave close but incorrect predictions on uncommon diseases.
Solution:
We added a confidence threshold (e.g., predictions below 80% confidence would trigger a "Need manual verification" alert) to maintain the accuracy and reliability of results.
Tracks Applied (1)
Groq track
Groq
