Skip to content
LexDataLexData
PlatformIndustriesCustomers
DocsThe Field GuideBlogWhy models drift
AboutCareersSecurityContact
Log inStart now
← All posts

Industries · 7 min read

Contact lens defect inspection with pass, review and fail as three answers

A dark-field camera turns a crack in a clear lens into a bright line. The lens the model cannot decide goes to a person, and that middle bucket is the product.

Summary

This post puts a dark-field camera over a contact lens line, where cracks and bubbles in a transparent lens show as bright features on black, and sets up three answers instead of two, with the uncertain lens sent to a person rather than forced to pass or fail. It concludes that the review bucket is what makes the line's accuracy hold, and that a batch which moves the defect rate is a threshold change before it is a model change. It is for quality and process engineers on optical and medical lines.

Rob Hickey · Chief AI Officer · Sep 25, 2026

Bottling line with bottles queued under a fill head, generated scene with detections from our model

A contact lens in its cup of saline is very nearly invisible, which is the point of it and the problem for anyone inspecting it. Under ordinary light the inspector at the end of line 2 sees the cup, the meniscus, and a faint ring where the lens edge is. A crack across the lens, a bubble in the polymer, a tear at the edge from the mould, are fainter still. The inspector tilts the cup against a dark background, catches the light at the right angle, and for a moment the crack flashes.

A dark-field camera does that flash on every lens, every time.

Dark-field light turns a crack into a bright line on black

Dark-field lighting sends light across the lens at a low angle, so the camera sees nothing from a clean lens, because a clean lens bends the light away from the sensor. A defect scatters it. A crack becomes a bright line on a black field, a bubble a bright ring, a tear at the edge a bright notch in the faint circle of the lens boundary. The camera is not looking for a lens; it is looking for the light a defect throws.

That changes what the labeler is asked to do. The classes are the defects the line already names, crack, bubble, edge tear, inclusion, and each is a bright feature on black. The frames come from the line camera at its mount over the cup, under the line's own dark-field ring, with the saline meniscus in every one. You type the classes once, Lexi proposes a box on every bright feature in every frame, and a person checks the proposals before anything trains.

The meniscus is the labeler's main trap. The saline surface catches the ring light at the cup wall and throws a bright arc that a first-week labeler boxes as an edge tear. The rule, written before labeling starts, is that the arc at the cup wall is never a defect, and the QA pass on every label holds every labeler to it.

Object detection finds the feature and the threshold decides the bucket

Object detection gives each bright feature a box, a class and a number that ranks it against the others. The confidence lesson says what that number is and is not: a ranking signal, useful for ordering this detection against that one, and a poor probability. The line does not need a probability. It needs a decision per lens, and the decision comes from two thresholds set by the quality engineer rather than from the model.

Below the lower threshold, a feature is noise and the lens passes. Above the upper threshold, the feature is a defect and the lens fails. Between them is the band, and a lens with any feature in the band goes to a person. The two thresholds are the plant's operating point, chosen from what a false reject costs against what a shipped crack costs, and on a medical line the second cost is so much larger that the band on line 2 sits low and wide.

The surface defect detection use case describes why the good lenses make this hard: they outnumber the bad by so much that the training set is unbalanced by construction. Frames with defects are kept at a far higher share than they occur so the model has seen enough cracks to draw one.

The lens the model cannot decide goes to a person with the frame

The middle bucket is the product. A two-answer gate forces the model to call every lens, including the ones it has weak evidence for, and the weak calls are where a shipped defect comes from. Three answers let the model say "not sure" and let a person say the rest.

What the person gets is the frame, the bright feature boxed, and the class the model proposed. The inspector looks at it the way they looked at the tilted cup, decides, and moves on. The inspector's verdict becomes a label, and this is where the line's accuracy comes from.

LexData takes the lens model through its whole life. You type what to look for, Lexi puts a box on every frame, and a person checks each label before anything trains on it. The model then watches the line camera, in the cloud, on your servers, or on a runner beside the recorder. Frames it is unsure of come back to a person, the corrections retrain it, and the new version replaces the old one with no downtime.

On a lens line the doubted frames are almost all from the band, so each version is trained on exactly the lenses the last one found hardest. In our manufacturing work the inspection models hold 99%+ accuracy maintained in production, and on a lens line that figure is held by the review bucket, since the lenses the model was sure about were never the risk.

An aside from the line. The inspector still keeps the black card and the torch in a drawer, and on the lenses that come back for review the card comes out. A cup tilted by hand against black is still the fastest way to settle whether a bright line is a crack or a scratch on the cup.

A batch that moves the defect rate is a threshold change first

A new polymer lot arrives in the spring and the bubble rate doubles while the crack rate holds. The lenses look the same and the classes mean the same, but how often bubbles occur has moved, and every threshold that was tuned around the old rate is now wrong. The band that sent one lens in a hundred to review sends one in ten, and the inspector who used to clear the queue by lunch is behind by mid-morning.

The drift catalog calls this the defect rate changed, and the important thing is what has not happened: the model has not degraded, and retraining it on the same classes will not shrink the queue. The signal is in the review queue itself. A jump in doubted lenses with no jump in corrections means the thresholds are wrong for the new lot and the model is still right. A jump in corrections means the model is seeing something it was not taught, and that is the case for retraining. Reading the two apart is the quality engineer's job, weekly, for the life of the line.

The reject is a rule written as a sentence, with a severity and a cooldown, approved before it goes live. A lens failed for a crack on line 2, routine, to the line's log and to the process engineer in Slack at the end of each shift with the frames attached. A bubble rate that climbs across a shift is the same rule with a count in it, and it is the message that tells the engineer to look at the lot before the lot is used up.

The thresholds belong to the quality engineer, and so does the queue

My own view, which is not universally held on the model side, is that the two thresholds should be owned by the quality engineer outright and changed by nobody else, including by anyone retraining the model. A new version that ships with its own thresholds baked in has quietly moved the plant's operating point, and the engineer finds out from the queue on Monday.

The same goes for the queue. A review bucket nobody clears is a fail bucket with extra steps, and on a medical line the honest sizing is that the band is set as wide as the inspectors can clear in a shift and no wider. Widen it when a new lot lands and the queue grows, narrow it when the next version has learned the lot. How the labels get checked before training is in the labeling doc.

See it on your own footage.

Start with your footage

More in Industries

Industries · 7 min read

Counting the screws in a kit with object detection over the bench

A camera over the kitting bench counts every screw and bottle one box at a time. Exact for kits, a band for cases, and a half-hidden item is a written rule.

Rajiya Sultana · Sep 25, 2026

Industries · 7 min read

Automated water meter reading with a camera in the vault

Ten digit classes in a fixed row turn a truck roll into a frame. A rolling digit and condensation on the glass are the frames that come back to a person.

Stephen Biswas · Sep 25, 2026

Industries · 7 min read

Body-in-white inspection with a station camera on unpainted steel

Dents on a bare body shell hide in the reflections. Masks give the extent, a second pass decides reportable, and a tightened tolerance is a spec change.

Finn Ellingwood · Sep 25, 2026

LexData
LexData

Product

  • Platform
  • Industries
  • Use cases

Resources

  • Docs
  • The Field Guide
  • Blog
  • Why models drift

Industries

  • Energy & utilities
  • Oil & gas
  • Agriculture
  • Manufacturing
  • Insurance
  • Retail
  • Robotics

Company

  • About
  • Customers
  • Careers
  • Contact

Trust

  • Security
  • Privacy
  • Terms

Stay updated

What we learn running vision models in production.

See everything.
Miss nothing.

Stay updated

What we learn running vision models in production.

Terms of use & Privacy policy

© 2026 LexData Labs · All rights reserved