The invention relates to a defect detection method applied to a motor coil based on a
cascade expansion FCN network, and the method comprises the following steps: 1), collecting a
sample image, i.e.,a big image, of a target region needing defect detection; 2) traversing all the sample images, and marking the defect position of each image; 3) performing sliding
image segmentation on the large image by adopting a window sliding method, and segmenting the marked large image into small images with fixed sizes for training; 4) performing data enhancement on the small graph
cut from the sliding window, and expanding the
cut small graph; 5) applying the expanded small graph to the training of a
network model, evaluating the defect detection effect, and adjusting parameters; and 6) obtaining a feature map output by the last layer of the
network model, i.e., a segmentation position of the defect, i.e., a final output result. According to the method, the trained model can be added to an industrial production
machine, whether the product has the defect or not can be automatically recognized, the defective product can be automatically shunted, the detection efficiency can be improved, and thelabor cost can be reduced.