-
-
Home screen: take or upload a rice-leaf photo, or try a sample. Bangla-first, with an English toggle and the AIgnite sticker.
-
Result: likely disease in Bangla and English, an AI-voice "Listen" button, plain symptoms and a link to official advice.
-
After the result: set a follow-up reminder, save the scan to history, or call the 16123 agricultural helpline (call charges may apply).
-
When the model isn’t confident, it says “Not Sure” and sends the farmer to the agriculture officer or 16123 instead of guessing.
-
Voice-first farming copilot: ask by voice or text in Bangla or Banglish, with ready-made questions for common problems.
-
Scan history on the device, so a farmer can follow a field’s progress over time.
-
Reminders and a task list for field follow-ups, such as re-checking an affected plant.
-
Weather tab: current conditions and a seven-day forecast, with disease-risk guidance.
-
Model Accuracy & Transparency: internal results, per-class precision, recall and F1, and performance on other districts.
-
External validation on photos from districts the model never saw, with sample sizes and DOIs.
-
Another test set, plus the confusion matrix and reliability curve, so anyone can inspect the model.
-
Honest limitations: weaker classes, a district where it performs poorly, and the model release decision, all stated in the app.
-
Before analysis, the farmer can crop to the affected part of the leaf, zoom, and choose to check just that area or the full photo.
-
This-week action plan: practical next steps with official sources, a follow-up reminder, and no pesticide doses.
-
About page: what the app is and is not, and the privacy promise. The photo is analyzed on the phone and never sent to a server.
Inspiration
Rice is Bangladesh's most important crop, yet a farmer who notices spots, discoloration or unusual patterns on a leaf often has to decide immediately, with nobody reliable to ask. A wrong guess can mean a misunderstood disease, money spent on an unsuitable treatment, and a crop that stays at risk.
I wanted to build something a Bangla-speaking farmer could use on an ordinary phone, without creating an account or sending a private crop photo to a server, and where weak internet would not stop the app from working. AgroLeaf AI started from that goal: turn one rice-leaf photo into a careful preliminary screening, an explanation the farmer can understand, and a safer next step.
AgroLeaf AI is my solo build for the Ostad Presents YUNet AIgnite Buildathon 2026. I built it alone, using AI coding assistants for implementation help; the design decisions, data, evaluation and deployment are mine.
What it does
AgroLeaf AI is a Bangla-first, mobile-friendly rice farming copilot. It gives preliminary screening and decision support. It is not a replacement for an agricultural expert or a laboratory diagnosis.
The core flow takes three steps: take or upload a rice-leaf photo, let the AI check it, and read or listen to the result.
- On-device AI screening. The model runs inside the browser, so the photo is never uploaded for inference.
- Calibrated confidence and an honest "Not Sure". When the evidence is weak, the app abstains instead of forcing an answer. It then suggests retaking the photo or contacting an expert.
- Understandable results. Each result shows the likely condition, visible symptoms and practical next steps in Bangla, with an English toggle.
- Bangla voice guidance. Results can be played aloud for farmers who find reading difficult. The audio is pre-recorded, so it works on any phone.
- Safety-first guidance. The app never generates pesticide doses. It points to official guidance and offers a one-tap hand-off to the 16123 agricultural helpline.
- Voice-first farming copilot. Farmers can ask by voice or text and get guidance from official agricultural sources, cultivation planning and reminders.
- Local history and reminders. Scan history, cultivation plans and reminders are stored on the device.
- Weather and disease risk. A seven-day forecast with weather-based disease-risk guidance.
- Transparency page. A public Accuracy page shows model performance, class-level results, sample sizes and known limitations.
Image inference needs no connection. Some optional features, such as the weather forecast and place search, do. After the app assets have been cached during an online visit, repeat use works offline.
How I built it
Frontend. The app is built with React, Vite, Tailwind CSS and JavaScript as a responsive Progressive Web App. It is Bangla-first, has an English toggle, and works on both small phones and desktop browsers.
AI model. The active classifier is an EfficientNet-B0 model trained with PyTorch on Kaggle GPUs and exported to ONNX. It takes a 320 × 320 input and has eight outputs: Healthy, Blast, Brown Spot, Leaf Smut, Tungro, Sheath Blight, Other Rice and Not Rice. It runs in the browser through ONNX Runtime Web (WebAssembly). Preprocessing corrects image orientation, resizes the shorter side to 366 px, centre-crops to 320 px and applies the same normalization used in training. An automated parity check confirms the browser preprocessing matches the training pipeline.
Calibration and abstention. Confidence uses temperature scaling (T = 0.66) with a general decision threshold of 0.30 and a stricter threshold of 0.90 before the app will say "Healthy". Wrongly telling a farmer to do nothing is the most harmful mistake, so the "Healthy" bar is deliberately higher. When confidence is low, the app abstains.
Training data. The model was trained on the RiceLeafDiseaseBD v3 dataset (CC BY 4.0) and expanded with additional field photos. The dataset is credited in the repo and on the Accuracy page.
Offline and storage. IndexedDB stores scan history, plans and reminders locally. A Service Worker with Workbox caches the app and model after the first load.
Audio. There are 132 pre-recorded Bangla clips: 10 for disease results and 122 for copilot answers.
Hosting. The app runs on Cloudflare Pages, with a small Cloudflare Pages Function that handles place-name lookups for the weather feature. There are no user accounts and no analytics that capture photos.
Quality assurance. I wrote 509 automated tests across 67 test files (unit, component and integration), plus a multi-viewport smoke test and a release check, and I ran a full implementation audit across 68 requirements.
Challenges I ran into
Building a safe uncertainty pathway. A forced prediction can be harmful when a photo is unclear or outside the model's reliable domain. I implemented calibrated confidence and a "Not Sure" path that recommends another photo or expert help.
Avoiding misleading performance claims. Internal test scores do not represent real field conditions. I added an Accuracy and Transparency page that shows internal results, results from other districts, class-level performance and known limitations in plain language. External performance was lower than internal performance, and I chose to show that rather than hide it.
Protecting farmer privacy. Uploading crop photos would create privacy and connectivity problems. I moved the entire inference path into the browser, so the photo never leaves the device.
Supporting low-connectivity use. The model and audio files are much larger than a normal static page. A PWA, Service Worker caching and local IndexedDB storage let the core experience keep working once the assets are cached.
Making technical information accessible. Disease information is hard to use when it is only in English or in scientific language. I designed a Bangla-first interface, added voice playback and kept the main flow to three steps.
Keeping the claims honest as the project changed. The project went through several model versions. In the final hours I audited the live app and the repo and removed claims the deployed app could not support. Features I had built but switched off to keep the phone interface simple, such as the heatmap, severity grading and community alerts, are not described as live.
Choosing a model release honestly. The final model, v10, narrowly missed two of my own release conditions, one on Aman macro-F1 and one on Sylhet answer rate. I released it by deliberate decision and recorded the reasons in the repo, instead of quietly relaxing the criteria.
Accomplishments that I am proud of
- Built and deployed a working mobile-first AI application as a solo participant.
- Private on-device rice-leaf inference with no photo upload.
- Calibrated confidence with a safer "Not Sure" fallback.
- Bangla and English interfaces with 132 pre-recorded Bangla voice clips.
- A dedicated Model Accuracy and Transparency page, instead of a single headline number. It reports macro-F1 across separate test sets (Aman 0.896, DIU-B 0.784, Sylhet 0.570), with sample sizes and limitations.
- A voice-first farming copilot with cultivation planning.
- Local scan history, plans and smart reminders.
- Safety by design: no AI-generated pesticide doses, and a clear path to the 16123 helpline.
- 509 passing automated tests plus multi-viewport smoke tests.
What I learned
Uncertainty is a product feature. For a farmer-facing AI tool, saying "Not Sure" can be safer and more useful than a confident but unreliable answer.
Evaluation has to go beyond one accuracy score. Calibration, coverage, performance in other districts, per-class results and domain limits all decide whether an AI output can be trusted.
Privacy and accessibility are architecture decisions. On-device inference, Bangla-first content, voice guidance, large clear buttons and a simple photo flow shaped the project from day one rather than being added at the end.
A useful agricultural AI product is more than a classifier. The result has to lead somewhere: understandable guidance, reminders, planning support and a clear path to a human expert.
What's next for AgroLeaf AI
- Test the camera workflow on more physical Android and iOS devices.
- Collect evaluation data from more districts, seasons and real field conditions.
- Run field validation with agricultural officers and rice farmers.
- Strengthen rejection of non-rice and poor-quality images.
- Re-enable the explainable heatmap and disease-severity views, tuned for small phones.
- Switch on privacy-aware community outbreak alerts once the database is connected in production.
- Expand verified knowledge sources from BRRI, BARC, BAMIS and the Department of Agricultural Extension.
- Improve understanding of Banglish and regional voice queries.
- Explore privacy-preserving model improvement and federated learning.
- Integrate verified national agricultural advisories when an official API becomes available.
AgroLeaf AI is a decision-support and preliminary screening tool. It does not replace professional agricultural diagnosis, laboratory testing or official advice.
Built With
- bangla
- cloudflared1
- cloudflarepages
- cloudflareworkers
- computervision
- efficientnet
- github
- indexeddb
- javascript
- kaggle
- machine-learning
- onnx
- onnxruntime
- puppeteer
- pwa
- pytorch
- react
- responsibleai
- responsivedesign
- tailwind
- vite
- vitest
- webassembly
- webspeechapi
- workbox