Anomaly detection tells you "this spot differs from normal." To improve a process, though, you need "this is a dent, it is at the upper right, and there were this many today." Sorting and counting defect types is the job of object detection.
Output: Box, Class, Confidence
- Box (bounding box) — The position and size of the rectangle around the defect.
- Class — The defect type. It is a name set at training time (scratch, dent, missing, etc.).
- Confidence — A value from 0 to 1 for how sure the model is of its call.
IoU and NMS
A model often outputs several slightly different boxes for the same defect. NMS (Non-Maximum Suppression) keeps the box with the highest confidence and deletes the other boxes that overlap it a lot (IoU at or above the limit). The Multi-Inspector modeN_iou setting is this limit. Lowering the value can merge two defects that sit close together into one. Raising it can count the same defect twice.
IoU is also used in evaluation. The IoU of the model's box and the ground-truth box must be at or above a limit (often 0.5) to count as "found correctly."
Per-Class Thresholds
Not all defects carry the same weight. A crack that affects function must be caught on slight suspicion, while a small cosmetic stain may be caught only when the model is sure. Multi-Inspector EB v2.3 uses a different confidence threshold for each class. It also keeps detections below the threshold on screen, with a thin box and a (<thr) mark, so the operator can see borderline cases. All detections are recorded in the YOLO_Detections field of the CSV.
YOLO and RT-DETR
- YOLO — Looks at the image only once and predicts all boxes at the same time. It is fast and light, so it is widely used for field inference. fineAi uses the Ultralytics YOLO family (v8, v11, etc.).
- RT-DETR — A real-time detection model based on a transformer. It outputs boxes directly without NMS, which can help with overlapping objects.
fineAi OD Workbench trains 28 models of the YOLO and RT-DETR families on the same data and compares accuracy and speed side by side. Small models are fast and large models are accurate, so pick the most accurate model that fits within the line takt time.
Data and Labeling
Object detection is supervised learning, so labels decide quality.
- Draw boxes tight to the defect, by one common standard. If each person draws boxes differently, the model wavers too.
- Write down the class names and the borderline cases (is a small scratch a scratch or ignored?) in a document, then label.
- Also mix in normal images with no defects. This reduces false rejects (overkill: good parts flagged as defective).
- Save labels in a standard format such as COCO so you can move them between tools.
When You Need a Shape, Not a Box
A long, curved defect such as a weld bead or a crack leaves a lot of empty space in a box. For these, use a segmentation model, which paints the region pixel by pixel. RoboVision weld inspection finds the defect region by segmentation, then measures quantitative values such as length and depth and judges them by the ISO 5817 level rules.
Using It with Anomaly Detection
| Anomaly detection | Object detection | |
|---|---|---|
| Training data | Normal only | Defects + labels |
| Defects never seen before | ✓ Catches them | May miss them |
| Defect name | Not given | ✓ Given |
| Defect statistics and root-cause analysis | Difficult | ✓ Easy |
A natural order is to start a line with anomaly detection, then add object detection by labeling the NG images that pile up during operation. Multi-Inspector runs both modes on one part at the same time.