7 min read · AI for business · AI technology and models

A vendor offers three kinds of part inspection systems. The first says whether the image passes or fails. The second draws a box where the problem is. The third colors every pixel along the shape of the defect. Which one should you choose? The answer depends on what the downstream system needs from the image.
If you have not read the overview of machine vision yet, start with the article What Is Machine Vision. This article covers only the types of output a vision model produces.
Three questions for three tasks: what is it, where is it, and how far does it extend
- Classification: answers "what is this image?" The result is one label per image, with a confidence score.
- Detection: answers "what is there and where?" The result is a rectangular box per object, with a label and a confidence score.
- Segmentation: answers "where is the actual boundary?" The result is a mask or outline for each object, with a label and a score.
The Ultralytics documentation (the YOLO library) consistently describes it this way: classification gives one label and one score for the whole image, so it fits when you only need to know which category the image belongs to. Detection gives a box, a label and a score per object. Instance segmentation gives the true shape of each object, separated from the background.
One part photo, three different results
Picture a photo of a tray with 3 bolts, one of which has a damaged thread. The three approaches give different results:
- Classification: you get the label "this tray contains a defect." It is only yes or no, and you do not know which bolt.
- Detection: you get a box around the second bolt with the label "damaged thread." You can use it to tell a robot arm to pick that bolt out.
- Segmentation: you get a mask covering only the damaged area of the thread. You can measure the defect area in pixels and compare it with a threshold.
So each type suits a different downstream system. If the line only needs to reject the whole tray, classification is enough. If you need to send a position to a robot, you need detection. If the quality rule is based on the size or area of the defect, you need segmentation, or a separate measurement step.
Comparing the labeling effort and the metrics
The more detailed the output, the more detailed the labeling people must do. The first type labels the whole image. The second needs boxes drawn. The third needs polygons drawn or areas painted. The Ultralytics documentation states that segmentation data uses a specific label format and requires outlines to be created, which takes more human time than simply answering whether the image is a yes or a no.
- Classification: mainly uses accuracy, precision and recall (see also the article False Accept and False Reject).
- Detection: also looks at precision and recall, but adds IoU (the overlap between the box the system draws and the box a person drew, with a value from 0 to 1) and mAP (the average of the results per object class), as Ultralytics explains.
- Segmentation: uses a similar overlap idea, but measured on shapes instead of boxes.
One caution: scores from different metrics cannot be compared directly, and even the same metric depends on the threshold you set. Ultralytics states that precision, recall and mAP all depend on the IoU threshold used to decide whether a detection is correct. A stricter threshold gives a lower score.
A hypothetical example: a person draws the correct box around a defective bolt as a 100 x 100 pixel square, an area of 10,000 square pixels. The system draws a 100 x 80 pixel box that lies entirely inside the person's box. The overlap is 100 x 80 = 8,000 square pixels, and the combined area of the two boxes equals the person's box, 10,000 square pixels. This gives IoU = 8,000 / 10,000 = 0.8. If the IoU threshold is set at 0.5, this counts as a correct detection. If it is set at 0.95, it counts as wrong. Same part, same system, different scores because of different thresholds. These numbers are hypothetical so you can check the arithmetic. They are not results from a real system.
Choose based on what the downstream system needs
- Write down what the next step after the inspection must do, such as rejecting, picking a part, measuring a size or keeping a record.
- If you only need pass or fail per image or per part, start with classification.
- If you need to know how many locations there are, or need to pass a location on, use detection.
- If the quality rule depends on the area or shape of the defect, use segmentation.
- Start with the simplest type that answers the problem, then move up when test results say it is not enough.
Checklist before choosing a model
- Identify the output the downstream system uses: a label, a box or an area.
- Prepare real images from your line, with both good parts and several kinds of defective parts.
- Estimate the QC time needed to label each type.
- Ask the vendor which metric they will report, and at what threshold.
- Ask them to test with your images, not the vendor's sample images.
Advantages and limitations
The advantage of choosing the type that matches the task is that you get an output the downstream system can actually use, and you do not label in more detail than necessary.
The limitation is that a more detailed mask is not better for every task, because it takes more labeling effort and more computing resources. Scores from different metrics cannot be compared directly, and all three types can still fail when the image is blurred, has glare, or the part differs from what the model was trained on.
Talk to BT San before choosing a model
Before choosing a model, write down the inspection result the next system needs, such as pass or fail, a position, or the size of a defect. Prepare sample images of good and defective parts that contain no confidential information, then talk to the BT San team to see which type your job should use.
References
- Ultralytics docs: Image Classification (accessed 2026-11-20)
- Ultralytics docs: Object Detection (accessed 2026-11-20)
- Ultralytics docs: Instance Segmentation (accessed 2026-11-20)
- Ultralytics docs: YOLO Performance Metrics (accessed 2026-11-20)




