Patent attributes
Embodiments of this application provide a defect detection method and apparatus. The method includes: obtaining an image for inspection; performing anomaly detection on the image for inspection to obtain an anomaly region image corresponding to the image for inspection; and performing defect classification on the anomaly region image to obtain defect detection information of the image for inspection. The defect detection method of the embodiments of this application is divided into two steps of anomaly detection and defect classification. Anomaly detection is performed on the image for inspection first, and then defect classification needs to be performed only on an anomaly region, reducing the workload of defect classification, thereby improving the efficiency of defect detection.