Automated defect classification