We will be undergoing planned maintenance on January 16th, 2026 at 1:00pm UTC. Please make sure to save your work.

Inspiration

It all started with a simple question: “What if farmers could diagnose crop diseases as easily as taking a selfie?” Across Africa and beyond, smallholder farmers lose up to 40% of their yield each season due to preventable plant diseases. That loss translates to hunger, poverty, and broken dreams, all problems directly tied to SDG 1 (No Poverty) and SDG 2 (Zero Hunger). We wanted to change that narrative, to turn smartphones into pocket-sized plant doctors using AI.

What it does

Leaf Labs is an AI-powered plant disease detection web app that helps farmers identify crop infections instantly. Users simply snap or upload a leaf photo, and our model analyzes it in real time, using a fine-tuned MobileNet model running through ONNX Runtime Web. If the model’s confidence P(c∣x)<0.75, our fallback Gemini Vision API steps in to ensure accuracy, applying a multi-layer validation pipeline: "Final Prediction"=arg⁡(max⁡)┬c (α⋅P_"ONNX" (c∣x)+(1-α)⋅P_"Gemini" (c∣x))

Each result includes disease confidence, treatment advice, and links to verified agricultural resources, empowering farmers with knowledge, not just detection.

How we built it

We used: Next.js 14, Tailwind CSS, shadcn/ui, ONNX Runtime Web (WASM inference), Gemini Vision API, Supabase (Auth, Postgres, Storage, Edge Functions), Vercel, Deno Deploy, PostgreSQL, and Zustand. Our model was trained on an optimized subset of the PlantVillage dataset using Python and TensorFlow, exported to ONNX, and integrated seamlessly for browser-side inference.

Challenges we ran into

Compressing a large AI model into a WASM-friendly ONNX format without losing accuracy. Handling inconsistent lighting and poor camera quality from real farms. Balancing inference speed with accuracy across devices. Integrating Gemini Vision gracefully as a fallback when ONNX confidence was low. Making the UI friendly, multilingual, and offline-first for rural communities.

Accomplishments that we're proud of

Leaf Labs empowers farmers to protect crops, improve yields, and increase income, one scan at a time. It bridges the gap between AI innovation and food security, helping communities move from surviving to thriving. "Healthier Crops"⇒"Higher Yields"⇒"Less Poverty + Zero Hunger". The predictive accuracy >80%, which is high is one of our proudest achievements.

What we learned

AI can be lightweight and still powerful, especially when optimized for browsers. Edge computing and ONNX enable resource-constrained innovation for rural areas. Simplicity wins: farmers prefer instant, visual feedback over complex reports. We also discovered that sustainability is not just about tech, it’s about empathy, accessibility, and trust.

What's next for Leaf Labs

Expansion and scalability, improvements and version updates.

Leaf Labs - Engineering the Future of Food Security. Today.

Built With

Share this project:

Updates