Machine Vision & Industrial Inspection AI calculator
Defect Classification Accuracy Calculator
Defect Classification Accuracy measures how often a machine-vision system assigns each defect to the correct category, not just whether it flags a part as bad. Quality engineers use it because routing decisions, scrap-versus-rework calls, and root-cause analytics all depend on the defect type being right, not only present. A system can detect 100% of defects yet mislabel scratches as dents and send parts to the wrong disposition. This calculator divides correctly classified defects by the total in a labeled validation sample and reports the gap to the accuracy your quality plan requires.
What this calculator does
- Calculate the accuracy with which an AI inspection model or vision system correctly identifies the type of defect detected, by comparing correctly classified defects against the total number of defects in the validation sample.
- Use it when validating an AI defect classification system and you need to confirm that the model correctly labels defect types (scratch, crack, void, contamination) at the accuracy level required by your quality plan.
- It computes the percentage of defects placed in the correct class and the point gap to your required classification accuracy.
Formula used
- Defect classification accuracy = correctly classified / total defects x 100
- Gap to accuracy target = required accuracy - current classification accuracy
Inputs explained
- Defects correctly assigned to the right defect class:
- Total defects in the classification validation sample:
- Required classification accuracy per quality plan:
How to use the result
- Use it during model validation, after adding or merging defect classes, or whenever misrouted dispositions or noisy Pareto charts suggest classification problems.
- A single overall accuracy can mask one weak class; a confusion matrix is needed to see which defect types are being mixed up.
Common questions
- How do you calculate defect classification accuracy? Divide correctly classified defects by the total defects in the validation sample and multiply by 100. With 186 of 200 correctly classified, accuracy is 93%.
- What is a good defect classification accuracy? Most production AOI deployments target 95% or higher on a balanced validation set. At 93% against a 95% requirement, the example sits 2 points short and would not yet pass.
- Defect detection vs defect classification, what's the difference? Detection asks whether a defect is present at all; classification asks which type it is. You can have high detection and poor classification, which is exactly what this calculator isolates.
- Why does my classification accuracy look fine but routing is wrong? Overall accuracy averages across classes. If one high-volume or critical class is frequently confused with another, the aggregate can stay high while routing for that class fails. Check the confusion matrix.
- How big should the validation sample be? Large enough that each defect class has enough examples to estimate accuracy stably, typically dozens per class. A 200-defect sample is reasonable for a few classes but thin if you have many rare ones.
Last reviewed 2026-05-12.