Research on industrial defect detection and localization method based on small-sized objects
In response to the challenge that industrial images contain excessively small defects, where anomalous images with subtle imperfections are prone to false detection or missed detection, especially when background content dominates and anomalous training samples are scarce, this paper proposes a method for industrial defect detection and localization based on small-sized objects. The proposed method comprises three stages: data preprocessing, training, and testing. In the data preprocessing stage, to more effectively extract informative regions, we employ a YOLOv11-guided object detector to crop regions of interest, eliminating redundant background information and reducing false positives. Additionally, to balance normal and anomalous data, we design a noise module that applies feature-space Gaussian perturbations to generate synthetic anomaly samples, enabling the model to better learn discriminative features. In the training stage, we freeze a WideResNet-50-2 backbone as a feature extractor, extract layer-2 and layer-3 patch embeddings, align and aggregate them, and train a lightweight discriminator with an H-Swish activation function and a margin loss. The H-Swish activation alleviates gradient explosion and vanishing, thereby improving representational capacity and training efficiency. In the testing stage, the discriminator classifies input images and produces pixel-wise anomaly scores for localization. We evaluate the proposed method on the detector-preprocessed MVTec AD dataset (all 15 classes) under a fixed schedule and single seed. Our method achieves 99.67% image AUROC, 99.63% image AUPR, 97.75% pixel AUROC and 58.61% pixel AUPR, substantially outperforming the SimpleNet baseline. On the VisA dataset (all 12 categories), our method attains 95.53% image AUROC, 96.98% image AUPR, 97.04% pixel AUROC, and 39.87% pixel AUPR. A controlled computational study shows that the downstream anomaly stage has 72.821 million parameters, 48.083 GFLOPs, and runs at 9.841 ms/image, comparable to the supplied SimpleNet baseline. Furthermore, same-checkpoint activation analysis reveals that H-Swish reduces the zero-gradient ratio from 75.193% to 53.611% and the zero-activation ratio from 50.293% to 0.902%, confirming its effectiveness at the discriminator level. Experimental results demonstrate that our method can effectively focus on important features of small targets while suppressing noise, leading to improved detection and localization accuracy. The achieved image-level AUROC of 99.67% (MVTec AD) shows significant performance improvement over related approaches in binary classification tasks.