A product that reads test strips from photographs and turns the strength of each band into a result. The specification listed three things: detect the bands, correct their intensity, export the result. Corrected intensity appeared in it as a term and was defined nowhere. That gap was where the risk sat, because everything downstream of it, every positive and every negative, is a threshold applied to that one number.
A photograph becomes a measurement only after three things are taken out of it.
A test strip works by capturing a target substance along a line, so that more of the target makes a stronger band. Read by eye, a strip gives a yes or a no. Read by a camera, it promises more: a number for how strong the band is, which can be compared with a cut-off, tracked over time or compared between samples. That promise depends entirely on the pixel values meaning something stable.
Three things sit between a pixel value and the strength of the band. The first is the camera's tone curve. A sensor responds roughly in proportion to light, but the camera then compresses the result so the photograph looks right to the eye, which means a band twice as strong does not produce a pixel value twice as large. The second is illumination. The same strip under a different lamp, or at a slightly different angle, gives different values everywhere. The third is the background. The band sits on a membrane with its own tint and texture, and band strength is measured as a difference from it. There are several reasonable ways to estimate that background, and they do not agree.
Each has a standard remedy. Reverse the tone curve so values are proportional again. Put a known reference in every photograph and express the band relative to it, so lighting cancels out. Choose one background method and fix it in writing. What remains is a number whose variation comes mostly from the sample. How much variation remains is something you measure directly, by photographing one strip many times. That spread is the precision, and it decides how fine a distinction the product can honestly make.
Detection was never the hard part. The hard property was getting the same corrected value from the same strip across different photographs, devices and lighting. Two facts made that difficult. A camera's response is nonlinear, so a raw pixel value is not proportional to how much signal is in the band. And two standard background-subtraction methods give different corrected values on the same image. Until the number held still, a positive or negative call made from it could not be defended.
Measurement products fail between photographs, while every single photograph looks fine.
An imaging pipeline is usually checked one image at a time. The bands are found, the numbers look plausible, the export is tidy. None of that tests the property the product actually sells, which is that the same sample gives the same answer the next time. That property only shows up when the same strip is photographed twice, and in most development work it never is.
The second pattern is that thresholds get designed before precision is known. Someone picks a cut-off from a handful of known positives and negatives, and it looks clean. Samples near the cut-off then flip between positive and negative depending on which photograph was taken, and the flip is invisible because each individual result looks confident.
The reflex, and the fix.
Build the detector and ship the export
Detection is the visible work, it demonstrates well, and the export is what was asked for.
A call made from an unstable number is unstable, and no single image shows it. The pipeline looks correct on every screen, and the results do not reproduce when the strip is photographed again.
Prove the number before building on it
A fixed-price reproducibility audit ahead of any full build, with deterministic processing set as a constraint of the engagement and no learned model in the measurement path.
A defined corrected intensity, its precision measured, and a decision on whether a threshold is defensible at that precision.
Define the number and measure it first. The product is a threshold applied to it, and a threshold is only as good as the number underneath.
Undo the camera response first
Cameras compress brightness on purpose so that photographs look natural to people. Until that compression is reversed, pixel values are not proportional to the signal in the band, and any measurement taken before this step measures the camera as much as the sample.
Normalise against something in the frame
A known reference captured in the same photograph absorbs lighting changes between captures. Without it, a dimmer room looks exactly like a weaker band.
Pin the background method
Standard background-subtraction methods disagree with each other on identical images. Which one is used has to be a written decision, never whatever a library happens to default to.
Measure precision before setting a threshold
Photograph the same strip repeatedly and measure how far the corrected value moves. If it wanders more between repeat photographs than the margin a threshold needs to resolve, that threshold is a coin toss with a number attached.
Flag when precision will not support a call
Inconclusive is a correct output. A call made from a value too imprecise to support it is a wrong answer that happens to carry a number.
What each choice cost, and what it bought.
AAuditing before building
The engagement opened with a fixed-price reproducibility audit, before any full build was scoped. It delays the visible product, and it can end with an answer nobody wanted, that the number is not yet stable enough to threshold. That is exactly why it comes first. A full build on an undefined number produces a polished pipeline whose results do not repeat, and finding that out after launch costs far more than an audit.
BDeterministic processing in the measurement path
The measurement was set as deterministic processing, with no learned model producing the corrected value. That gives up whatever a model might add in difficult images. It buys a value where the same input always produces the same output, every step can be inspected, and the sources of variation can be measured one by one. A model in that position would contribute variation of its own and make it much harder to say where any disagreement came from.
CDefining corrected intensity in writing
The specification used the term without defining it, so the definition became a deliverable: linearised, normalised against the in-frame reference, with one named background method. That closes off a library update or a second implementation silently changing every result. It also gives anyone validating the product something concrete to validate.
DLetting precision set the threshold
No cut-off was designed until the spread across repeat photographs was known, and samples whose value falls within that spread of the cut-off are flagged. Some samples therefore get no call. The alternative gives every sample a call, including the ones the instrument cannot resolve, and those are the calls most likely to be wrong.
A single headline number hides where a system fails. This work was scored on the dimensions that actually decide whether it holds in production, measured on real, held-out cases rather than the demo path.
No measured figures are published for this engagement. Outcomes are described qualitatively.
A detector that finds every band, an undefined corrected intensity, and results that differ between two photographs of the same strip with nothing in the output to say so.
A defined, linearised measurement, normalised against a reference in the frame, with the background method pinned, precision measured across repeat captures, and calls made only where that precision supports them. Everything else is flagged.
What it owns, and what it hands to a person.
The audit establishes precision on the capture setups it was measured against. A different camera, a different light or a different cassette has its own precision and needs its own measurement. Deterministic processing was a constraint on this engagement and is not offered as a universal claim about the problem.
Any measurement product where a decision is a threshold on a derived value. Define the value, remove the instrument's own nonlinearity, pin every method choice, and measure repeatability before anybody designs a threshold.
Camera pixel values are not proportional to light until the tone curve is reversed, so any measurement taken before that step depends on the device.
Put a known reference in every photograph. Without one, a change in lighting is indistinguishable from a change in the sample.
When standard methods disagree on the same input, pick one and write it into the definition of the number. A library default is not a decision.
Measure repeatability by photographing the same sample many times, and design any threshold only after you know that spread.
Give the product an inconclusive state. A forced call on a sample the instrument cannot resolve is the call most likely to be wrong.