Model overfitting in defect detection