CNN architecture for defect detection