Manufacturing & Industrial Vision// definition

The anomaly score is a ranking; the threshold is a business decision

In short

An anomaly score is an ordering: it ranks parts by how far each departs from what the model was shown as normal. It is not a probability, not a defect size, and not comparable across models. The threshold is where that ordering is cut, and choosing it trades escapes against overkill — a quality decision needing an owner, a change log and review triggers.

Key takeaways

  • The score ranks by strangeness, not by severity. A 1 mm critical void can score below a harmless water spot.
  • A score is not portable. After any retrain the scale is rewritten, so an old threshold value silently becomes a different policy.
  • Derive the cut from a freshly scored sample of known parts, and record the sample it came from alongside the number.
  • Treat the threshold as configuration with an owner, a change log and review triggers: retrain, new material lot, lighting service, new variant.

An anomaly score is an ordering. It says this part looks further from normal than that one, and nothing more. It has no physical units, it is not a probability, it does not encode how large or serious the defect is, and it cannot be compared across models or builds. The threshold is where somebody cuts that ordering into accept and reject.

So the number on screen — 0.62, say — is meaningless alone. It means something only against the distribution this model produced, on this variant, under this lighting. Move any of those and the same 0.62 is a different decision.

Four things a score is routinely mistaken for

  • A probability. 0.90 does not mean a 90% chance of a defect. Most scoring functions are unnormalised distances, and those squashed into 0–1 are squashed for display.
  • A defect size. A 2 mm scratch and a 15 mm faint stain can land within 0.01 of each other; the score measures deviation, not extent.
  • A severity. The ordering does not know your dispositions, so a critical void can rank below a cosmetic mark that is merely more unusual.
  • A portable number. Retraining or a different normalisation rewrites the scale, and the old cut is no longer the old policy.

The ordering, made concrete

Below is an hour of borderline parts from a coated-bracket cell, ranked, with the cut at 0.60. Read the rightmost column before anything else.

RankScoreWhat the part actually hadVerdict at a 0.60 cut
10.91Gouge through the coating, 6 mmRejected — correct
20.78Run on the lower edge, 0.4 mm proudRejected — correct
30.66Water spot from the wash lineRejected — overkill
40.64Handling scratch, 7 mm, hidden faceRejected — overkill by disposition
50.61Coating void, 0.8 mm — a critical classRejected — correct, and the closest call
60.58Orange peel across the show facePassed — an escape at this cut
Borderline parts ranked by anomaly score, with what each one turned out to be

Raising the cut to 0.70 removes both overkills. It also loses rank 5, a critical coating void, because the score does not rank by severity. That row is the whole argument: no threshold protects a critical class without also being loose enough to admit whatever cosmetic oddity scores higher. The trade is between counted consequences, and they are counted in good parts pulled off the belt per shift.

The threshold is configuration, not a slider

  1. Score a fresh sample of known parts, drawn from current production rather than the original training pull.
  2. Build the curve. For each candidate cut, count overkill and escapes per class, in parts per shift rather than rates.
  3. Quality picks the cut against the class dispositions. Engineering advises on what the ordering can separate; it does not choose.
  4. Record it: value, the scored sample, the model build, the variants it applies to, the approver, the effective date.
  5. Set the review triggers — retrain, material lot change, optics service, a new variant — plus a scheduled re-check independent of all of them.

If a threshold can be changed by someone with a mouse and no record, then the accept criterion for the product is whatever that person believed on a Tuesday afternoon.

When the distribution moves under a fixed cut

A stable threshold does not mean a stable decision: the score distribution can move while the model stays byte-identical. A rejection rate that climbs after dark is the classic instance, and it is a lighting-geometry fault rather than a model fault — the confirming check is in the model finds the scratch on day shift and misses it after dark. The same problem shows up in space rather than time when a second site goes live, which is why a threshold is a per-cell setting: see plant one live, then plant two.

Two boundaries are worth stating. A check with physical units — a dimension, a presence, a code read — needs a tolerance rather than a threshold and belongs with classical tools, as argued in the measurement your caliper agrees with. And a supervised classifier emits per-class confidences rather than this kind of score, governed differently — the choice is in when you have forty defect images, and when you have four thousand.

Governing a live numeric setting with an owner, a log and a trigger list is ordinary discipline for any unattended system — the pattern in AI in logistics operations, and built into how we scope automation work. The surrounding decisions sit under visual inspection and defect detection and the wider industrial vision practice.

Frequently asked questions

Short answers to the follow-ups this page tends to raise.

Is an anomaly score the same as a confidence score?

No. A confidence score comes from a classifier trained on labelled classes and says how sure it is the part belongs to one of them. An anomaly score comes from a model of normality and says how far the part sits from it, with no class in mind. A threshold derived for one cannot be reused for the other.

What is a good starting threshold for anomaly detection on a line?

There is no default worth copying, because the scale is specific to the build. Derive it: score a sample of known conforming and known defective parts, plot overkill and escapes at each candidate cut, and take the point where per-class counts are acceptable to quality. A number from a vendor demo describes their distribution, not yours.

How often should the threshold be reviewed?

On every trigger, plus a scheduled review that runs whether or not one fired. The triggers: a retrain or model swap, a change of material lot or supplier, any service to the lighting or optics, a new part variant. The scheduled review exists because slow drift — ageing lamps, tooling wear — produces no event to react to.

Can one threshold cover several part variants?

Only if you have shown the variants produce the same score distribution, which is uncommon. Colour, finish, geometry and a different supplier's raw material each shift the distribution enough to move the effective operating point. The safe default is one threshold per variant per cell, each derived from its own scored sample.

  • anomaly detection
  • thresholds
  • inspection governance
  • model operations
// shipped work

The work behind this page

Builds from our portfolio that this page draws on.

Working on something in this space?

Tell us where you are in a sentence or two. We'll tell you honestly whether we're the right team, and what a sensible first slice of the work looks like.

Start the conversation