Cohen's kappa against agronomist consensus
median on a 2019 mid-range Android device
quantised, down from 94 MB
across two growing seasons
FieldSight lets an agricultural extension officer photograph a diseased leaf and receive a severity grade in under a second, on a phone, without a network connection.
The grade feeds a treatment recommendation and syncs to a regional dashboard when the device next finds signal. The dashboard is what makes it useful at scale: it turns individual field visits into a map of where an outbreak is actually spreading.
Disease severity assessment in the field is done by eye, against a printed reference chart. It is slow, it varies between assessors, and it varies for the same assessor across a long day.
The agronomists we worked with were explicit that they did not want a diagnosis system. They wanted a consistency system — something that graded the same leaf the same way every time, so that trends across a region meant something.
Published crop disease models report accuracy in the high nineties. Almost all of that work is evaluated on datasets photographed under controlled conditions: even lighting, plain background, leaf detached and flattened.
Field photographs are none of those things. Harsh direct sun, deep shade, motion blur, soil and other foliage in frame, the leaf still attached and curled, and a camera held at whatever angle the officer could manage while crouching.
Our first model scored 96% on the public benchmark and 61% on 900 photographs we collected ourselves. That gap was the entire project.
I owned the model: data collection protocol, augmentation strategy, architecture selection, quantisation, and the on-device runtime integration. I also built the labelling tool the agronomists used to produce consensus grades.
My teammate built the Android application and the sync layer. The agronomists defined the severity scale and did the labelling.
We stopped trying to fix the model and spent six weeks collecting field photographs instead — 4,200 images across two seasons, three regions, and deliberately varied conditions. Officers were asked to photograph normally rather than carefully, which is the only way to get a representative distribution.
Each image was graded independently by three agronomists. Where they disagreed by more than one grade, the image went to a review session. This produced a label set with a known, measurable ceiling — inter-rater kappa among the humans was 0.88, which is the realistic upper bound for any model.
Rather than generic augmentation, we built a pipeline targeting the specific distortions we observed: simulated harsh directional light, realistic motion blur, background compositing with soil and foliage crops, and severe perspective warping.
Severity grades are ordered. Treating them as independent classes throws that away and makes a five-grade error as cheap as a one-grade error. We switched to an ordinal regression head with a cumulative-link loss, which improved kappa by 0.07 on its own.
The shipped model is an EfficientNet-B0 backbone with an ordinal regression head, trained on the combined public and field datasets with field images weighted three to one.
Before the classifier runs, a small quality gate scores the photograph for blur, exposure, and whether a leaf is plausibly in frame. Images that fail get immediate on-screen feedback — too blurry, hold steadier — rather than a confident grade on an unusable input. Officers reported this as the feature that made them trust the rest of it.
The model is quantised to int8 and exported to TensorFlow Lite, running through the Android NNAPI delegate where available and falling back to CPU where not. Predictions, the source image, GPS, and timestamp are written to a local SQLite queue and synced opportunistically.
The benchmark gap. Accepting that a published 96% meant nothing for our deployment was the hardest early decision, because it meant discarding a working model and spending six weeks collecting data.
Quantisation cost. Naive post-training quantisation dropped kappa from 0.86 to 0.71. Quantisation-aware fine-tuning for a further 15 epochs recovered it to 0.84 at the target size.
Class imbalance at the extremes. Severe infestations are rare, and they are the grades that matter operationally. Oversampling helped a little; targeted collection during an actual outbreak helped considerably more.
Hardware variance. NNAPI implementations differ enough between vendors that identical input produced different output on two devices. We pinned to CPU inference on the affected chipsets and accepted the latency.
The quality gate rejects about 9% of captures, and the retake rate after a rejection is high — officers do retake the photograph rather than abandoning the assessment.
The regional dashboard has produced the outcome the agronomists wanted: consistent grading across assessors means the severity map reflects the disease rather than who happened to be holding the phone.
I would collect field data in week one. The six weeks we spent improving a model against the wrong distribution were not a total loss — the infrastructure carried over — but the direction was wrong and the data would have told us immediately.
I would also budget for quantisation from the start rather than treating it as a deployment step. Choosing an architecture that quantises gracefully is a training-time decision, and we made it late.
Awards and results connected to this project.
Papers that came out of, or fed into, this work.
There is always more detail than a write-up can carry — architecture trade-offs, what the evaluation missed, the decisions that were closer than they look. Ask.
