LeafSentry AI
Live in productionA bean-leaf disease triage service that would rather abstain than guess: image-quality gating, selective prediction, and a monitored public API.
Try the live modelThe problem
Field photos of leaves are messy: blur, glare, wrong subject, bad framing. A classifier that always returns an answer turns bad inputs into confident nonsense, which is exactly what a triage tool must not do.
How it works
- Quality gate before inference: every upload is checked for format, dimensions, and pixel statistics; failing images are rejected with specific findings instead of a wrong label.
- Selective prediction with calibrated abstention: the service reports confidence, probability margin, and normalized entropy, and returns an explicit abstained decision when the evidence is too weak to triage.
- Pinned model revision: inference runs against one pinned HuggingFace revision, so predictions stay reproducible across deploys.
- Operated as a real service: FastAPI behind nginx, Dockerized, with live/ready health endpoints and a reproducible evaluation report.
Results
- Model accuracy
- 96.875% top-1
- Warm inference
- <1s
- License
- Apache-2.0
on 128 pinned upstream test images, model-level evidence from the published benchmark report
measured end-to-end against the live public API
open source, benchmark report reproducible from the repo
Architecture
- FastAPI service exposing POST /v1/predictions (multipart) and /health/live, /health/ready
- Quality gate producing per-image findings and pixel metrics on every request
- Selective-prediction layer exposing confidence, margin, and normalized entropy per class
- Dockerized deployment behind nginx with health-checked readiness (weights load lazily on first inference)