Turning a Threshold Into a Measurement
How a 0.4 cutoff became 0.15 without anyone guessing
Photography AI·Advanced·9 min read · July 16, 2026
A threshold sized for one reference point per color doesn't automatically transfer to four to eight reference points per color, and the honest way to find out how much it doesn't transfer is to measure it, not guess at a safer-sounding replacement.
The methodology was deliberately unglamorous: a permanent, reusable script reads real published-photo palettes through the existing gallery query function — no new database access surface — and combines that with two ground-truth sets. Nine hand-curated true-positive cases, drawn from the original failing examples plus three specific regression targets named for this phase (black↔charcoal, blue↔steel-blue, orange↔burnt-orange). And, as the false-positive ground truth, every one of the 4,982 cross-family member pairs across the full 136-family matrix — because any two different families whose representatives sit close together is, by construction, a case where searching one color could surface a photo that actually belongs to a different one. A threshold sweep across ten values, refined with a finer pass once the coarse sweep showed no benefit above 0.15, measured true positives, false negatives, cross-family false-positive rate, and family-confusion rate at each candidate value.
The results made the decision almost mechanical, once they existed. The old threshold, 0.4, preserved all nine true positives — and so did every value the sweep tested down to 0.12, the smallest tested value that still cleared every true positive. That's the important part: from 0.12 up through 0.4, every increment bought exactly zero additional true-positive coverage, while strictly increasing cross-family false positives, from 12.3% at 0.15 up to 71.6% at the old value. Blue's hardest true positive — a muted slate-blue match, reached through the Steel Blue representative — needed 0.1175 of that room; 0.12 was the smallest grid point the sweep tested that still cleared it, which is why the calibration record names 0.12, specifically, as the binding constraint. The value chosen was 0.15, not the swept minimum of 0.12: roughly 28% of real margin above the binding constraint, enough headroom that a slightly different real-world example wouldn't sit right on the edge, while still cutting cross-family confusion from 96.3% of family pairs down to 52.2%, and raw cross-family false positives from 71.6% down to 12.3%. The secondary threshold in the same matcher was rescaled proportionally rather than left alone, preserving the original ratio between it and the primary threshold — otherwise "strong" would have silently started absorbing matches that should only have counted as "weak" once the primary threshold shrank past it.
The same sweep also produced one specific, evidence-backed removal: one family representative had zero wins among the nine true-positive cases, its one real production match was against a light gray that no person would call blue, and it was independently identified as blue's single largest source of cross-family bleed against ten other families. Removing it cost nothing measurable and reduced measurable harm — exactly the kind of change a "measure, don't assume" discipline is supposed to produce, and the only kind this phase's own stated scope permitted.
What the sweep did not produce is a tidy, fully-closed result, and that's worth stating plainly rather than glossing over. Two of the three original guardrail pairs — blue against red, and green against magenta — came back safely separated at the new threshold, at the full-family level, not just at the old single-anchor level. The third did not: the closest pair between blue's and cyan's families, Sky Blue and Medium Turquoise, sits at 0.0725 — inside any threshold that also has to clear blue's own 0.1175 true-positive floor. This was tested exhaustively, not assumed away: removing blue's largest offender only moved the closest conflicting pair to this exact pairing, and removing Sky Blue itself was considered and rejected, because it's a real, production-confirmed representative color that would cost real coverage to satisfy one guardrail. Pale blue and pale cyan genuinely sit close together in OKLab space. No single global threshold compatible with real photographic blue coverage separates them. That's reported as a real, irreducible finding — not a compromise quietly relabeled as a fix.
One more thing the sweep surfaced and explicitly declined to act on: achromatic families sit measurably closer to their nearest neighbor than saturated families do to theirs — white's nearest neighbor, beige, is 0.0139 away; black's nearest, navy, is 0.1143 away, roughly eight times further, despite both being achromatic. That's real evidence that per-family thresholds could be justified. It wasn't implemented in this phase, because a single recalibrated global threshold had already achieved everything this phase set out to achieve, and adding a second axis of tunable configuration for a gain that hadn't yet been shown necessary would have been complexity purchased on credit. That decision, and a few others like it across this system, gets its own full treatment later — for now, the point is only that the evidence for it exists and was written down, not that it was acted on.
The transferable lesson is about what "calibration" is actually supposed to mean: a threshold is a measurement, derived from a sweep against real ground truth with a defensible stopping rule, or it's a guess wearing a decimal point. The two are not the same activity even when they produce numbers that look similar on the page. A measured threshold comes with a binding constraint you can name, a margin you can justify, and — critically — an honest account of what it still doesn't fix. A guessed threshold comes with neither, and the difference only becomes visible the first time someone asks why the number is what it is.
Even a well-documented sweep, though, is still just a report — a markdown file a human reads once and then manually transcribes into a source file, by hand, hoping they copied the right digits. Nothing about the sweep itself makes that transcription reviewable, reproducible, or distinguishable from a live setting once it's been typed in. Producing the right number was necessary. It wasn't the same problem as making that number into something a team could actually trust.