Field-condition CV
Why the camera in the mud needs to refuse a shot.
The mobile capture stage of Hide Nothing, our cattle-claim biometric pipeline, rejects more frames than it accepts. That is the feature, not a bug. Model accuracy in the lab is not the bottleneck for a CV system that has to work in a wet field, in low light, with a rancher holding the phone at whatever angle their hand defaults to. The bottleneck is input quality.
The fastest way to ruin a production embedding store is to populate it with one bad photo per policy that the matcher will later try to match against. So before any image leaves the device, a quality gate runs.
§01What the gate checks
Five checks run in parallel on the captured frame. All must pass; one fail kills the upload and triggers a reshoot.
- Exposure within the workable range for the encoder
- Focus, measured by Laplacian variance over the cow's head ROI
- Motion blur, sampled across the frame
- Subject framing: the muzzle has to be inside a sensible box at minimum-acceptable pixel size
- EXIF integrity: the photo was not pre-shot somewhere else and sideloaded into the app
If any check fails, the gate does not upload. It shows the rancher a reshoot prompt. The prompt does not say “your photo is bad.” It says “the muzzle is not sharp enough; please hold steady and try again.” Different message. The first costs you the relationship.
§02Why on-device matters
The naive build is: upload first, run the gate in the cloud, reject server-side. We tried it. It fails for three reasons.
- Latency. The rancher is standing in a field; the upload takes forty seconds on a 2G link; if the photo is no good, the round-trip is over a minute before they know.
- Offline. Field uploads cannot depend on the link being up. Most rural enrollment days have intermittent connectivity at best.
- Poison. If a bad photo reaches the embedding store before being filtered, you have polluted the cosine-match for every future claim against that policy. The cost of one bad embedding is permanent until you re-enroll.
So the gate runs on the phone, before the upload queue. ONNX Runtime, the same encoders that run server-side, quantized down to fit. The phone does the rejection. The cloud only sees clean frames.
§03The reshoot UX
The first version of the gate just showed a red error. Adoption tanked. We rebuilt it. The new version:
- Shows a live overlay (green when framing is right, red when it is not)
- Says exactly what is wrong, in the rancher's language
- Caches rejected photos locally so we can study the failure modes later
§04What the field told us
After six months of deployment, rejection rates by failure mode looked like this:
- Motion blur: 31% of rejections
- Low light: 24%
- Subject framing: 22%
- Focus: 18%
- Other: 5%
Motion blur dominated, which surprised us. The lab assumption was that low light would be the killer. In production, ranchers are quick-handed and the cow is moving.
§05The principle generalizes
The Hide Nothing gate is specific to cattle muzzles. The pattern is not. Any CV system that operates in conditions the developers do not control needs an honest reject mode. Without one, the model accuracy you measured on the test set is fiction the moment it ships.
The right question for any production CV system is not “what is the model's recall on clean data?” It is “what does the system do when the data is bad?” If the answer is “it returns a confident wrong answer,” you have not shipped a CV system. You have shipped a liability.