What is the best approach for detecting the defect?
It is a possible way, but this class of problems falls under outlier detection in machine learning.
The defining feature is that one can only train for usual events not rare events, there are few or even no data at all, so a different approach needs to be taken.
Since usual neural network training requires adequate samples from each class, a workaround is needed. For example autoencoder networks are an option for outlier detection