An offline-first Android app that detects coffee, cacao and banana diseases from a phone photo, built for farms in Costa Rica where the signal drops.
- Type
- Android app with on-device machine learning
- Status
- In development
- Built with
- React Native · Expo · TypeScript · TensorFlow Lite · Python · FastAPI · Firebase · SQLite · Gemini






- Fig. 02.1a
Diagnosis without signal
Each crop has its own MobileNetV3 model running on the phone with TensorFlow Lite. Scans, farms and plots stay in SQLite, so nothing depends on a connection.
- Fig. 02.1b
Trained on real field photos
Public datasets from coffee, cacao and banana plots, deduplicated by perceptual hash and split by plant so no leaf leaks between training and test.
- Fig. 02.1c
It shows where it looks
Grad-CAM heatmaps show which part of the leaf drove each prediction, and every experiment, including the failed ones, is documented.
Fig. 02.1d — Exploded view
What sits under the screen
- 01
InterfaceReact Native · Expo
A photo, a diagnosis, and what to do next. Works with no signal.
- 02
APIFastAPI · Firebase Auth
When signal comes back, pending scans sync in one request.
- 03
DataSQLite on the phone
Every scan is saved locally first, with its sync status.
- 04
ModelTensorFlow Lite
Diagnosis happens on the device, not on a server.
Scroll to take it apart
What it recognizes
Three crops, one model each, twelve classes. Scores are on held-out test photos.
Coffee
Leaf, underside- Healthy
- Leaf rust
- Leaf miner
- Cercospora
- Brown leaf spot
- Red spider mite
- 81.1%
- accuracy
- 0.72
- macro-F1
Cacao
Pod- Healthy
- Frosty pod rot
- Black pod
- 91.7%
- accuracy
- 0.85
- macro-F1
Banana
Leaf- Healthy
- Black Sigatoka
- Fusarium wilt
- 97.5%
- accuracy
- 0.97
- macro-F1
When the model is not sure enough, it asks for a new photo instead of guessing.
Coffee is still under its 0.80 target: two of its classes have about twenty test leaves, so one leaf moves the score by several points. Every run, including the failed ones, is documented.
Measured
- 0.97
- banana test Macro-F1
- 6 MB
- per model, float16
- 3
- crops, one model each













