In short
When 1 part in 30 is defective, a model that calls every part good scores 96.7% accuracy and catches no defect at all.
On synthetic washer images, a trained model scored lower , 96.0%, yet caught 4 of 10 corroded washers. Accuracy ranks the useless model first.
Count defects caught and good parts flagged instead, and set the decision threshold from what a missed defect costs. The same model then caught 6 to 9 of 10, while flagging 27 to 42 of 290 good washers instead of 6.
The problem
A classifier sorts each image into a class, here good or corroded . The usual score is accuracy : the share of images it sorts correctly.
In inspection, defects are rare. If 1 part in 30 is defective, 29 of every 30 images are good ones. Accuracy then mostly measures how well the model recognizes good parts. A model can score high while it lets almost every defect through.
Two numbers tell you what you need to know:
Defects caught: of all defective parts, how many the model flags.…