Diagnostics & ImagingField engagement

Finding the bands is the easy part. Getting the same number from the same strip photographed five times is the product.

Diagnosis and architecture lead.
The approach, in four words
reproducibility is the productlinearise before measuringpin the methodflag when precision will not support a call
01Lineariseundo the camera
›
02Normalisein-frame reference
›
03Backgroundmethod pinned
›
04Precisionmeasured over repeats
›
05Call or flagonly if supported
a threshold narrower than the measured spread is a coin toss with a number attached
What was at stake

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.

How this works

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.

Linearise
reverse the camera's tone curve
Reference normalise
a known target in the same frame cancels lighting
Background method pinned
one method, chosen and written down
Precision check
same strip, many photographs, measure the spread
Call or flag
a call only where precision supports it
Detection happens before all of this, and it is the easy part.
FigureThe order in which a strip photograph becomes a defensible result. Each of the first three steps removes something that is not the sample. The precision check then decides whether the remaining number can carry a call at all.
The constraint

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.

Where it usually breaks

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.

01

Measuring the camera

Values are taken before the tone curve is reversed, so differences in band strength are compressed unevenly and depend on which device took the photograph.

02

Lighting read as signal

No reference in the frame, so a darker room produces weaker readings that look identical to weaker samples.

03

The default method

The background method is whatever a library chose. An upgrade or a second implementation quietly changes every corrected value.

04

A threshold finer than the instrument

The cut-off is set without knowing the repeat spread, so samples near it change their result between photographs.

05

No inconclusive state

The output can only say positive or negative, so a sample the instrument cannot resolve is forced into one of them.

Tone curve not reversed
the camera's compression is in the number
No in-frame reference
lighting drift reads as band strength
Background method unpinned
methods disagree on identical images
Threshold set before precision
the cut-off is finer than the spread
The failure point
Same strip, different result
two photographs, no warning in either
Every individual result looks confident.
The disagreement only exists across photographs.
Reproducibility cannot be checked on one image. It needs the same strip, photographed again.
FigureWhy two photographs of one strip can disagree. Each source of variation is small and invisible within a single image. Together they move the corrected value enough to cross a threshold, and the output gives no sign that anything changed.
The fork

The reflex, and the fix.

Road not taken

Build the detector and ship the export

Pull

Detection is the visible work, it demonstrates well, and the export is what was asked for.

Why not

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.

Road taken

Prove the number before building on it

Accepted

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.

Bought

A defined corrected intensity, its precision measured, and a decision on whether a threshold is defensible at that precision.

Decision

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.

How it was built
01Linearise
›
02Reference normalise
›
03Background method pinned
›
04Precision check
›
05Call or flag
01

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.

02

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.

03

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.

04

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.

05

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.

Inside the key decisions

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.

Call or flagthe only part a user sees
Thresholddesigned after precision is known
Measured precisionspread across repeat captures of one strip
Pinned background methodone named method, written into the definition
In-frame referencelighting cancels against a known target
Linearised valuesthe camera's tone curve removed
The specification described the top layer. The risk was in everything beneath it.
FigureWhat a call actually rests on. Each layer is only meaningful if the one beneath it is stable, which is why the work began at the bottom. A threshold sitting on an undefined number has nothing under it.
How it was measured

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.

Spread across repeated captures of one stripAgreement across devices and lightingSensitivity to the background methodShare of samples flagged rather than called
The gate
Is this value further from the cut-off than the measured repeat spread?
Make the call
the result would be the same on a second photograph
Flag as inconclusive
a correct output, not a failure
A new camera, light or cassette needs its own precision measurement before this rule applies to it.
FigureThe rule that decides whether a sample gets a result. Precision is measured first, on repeat photographs of the same strip. A sample whose value sits closer to the cut-off than that spread can reach is reported as inconclusive, because a call there would depend on which photograph was taken.
figures

No measured figures are published for this engagement. Outcomes are described qualitatively.

What it produces
Without this discipline

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.

This system

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.

reproducibility is the productlinearise before measuringpin the methodflag when precision will not support a call
The operating envelope

What it owns, and what it hands to a person.

Handled with confidence
Captures from the measured setups
Lighting drift controlled by an in-frame reference
Flagged for review
Samples whose precision will not support a call
A capture setup not yet characterised
Out of scope by design
Clinical interpretation of a result
Setups with no in-frame reference available
The honest limit

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.

What it generalizes to

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.

What to take from this

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.

How we engage

You have a system like this one.
Tell us where it stands.

Whether it is failing, not yet built, or about to meet a scale it has never seen, we can tell you what we see.

Start a conversation
mostafa@opulion.dev · Response within 24 hours · By inquiry