# Industrial Image Anomaly Detection via Self-Supervised Learning with Feature Enhancement Assistance
## 1 Introduction  
Anomaly detection [1] aims to accurately identify instances of anomalous or defective patterns that deviate significantly from those prevalent in regular instances, thereby ensuring data quality and analysis accuracy. Due to its wide range of application scenarios, including medical image analysis [2], industrial defect detection [3], video surveillance [4], etc., anomaly detection has been extensively studied. One of the important branches is industrial defect detection. Industrial image processing encounters unique complexities, among which the acquisition of anomaly images is particularly challenging. This difficulty arises not only due to their rarity and the complexity of labeling but also because of the uncertainty and diversity of the anomalies themselves. Defects can appear as extremely subtle surface imperfections like scratches, or serious structural issues such as missing parts. These factors collectively contribute to the challenge of accurately detecting and analyzing anomaly images in industrial environments. To address the above issues, researchers generally prefer to model this problem in the framework of unsupervised learning. This approach aims to efficiently and accurately identify and analyze anomalous images despite the lack of prior knowledge, i.e., using only normal samples for training. Recently, some embedded methods [5; 6; 7] have demonstrated excellent performance in anomaly detection and location. These methods utilize a network pre-trained on ImageNet to extract features from normal samples for learning the normal paradigm of thedata. During inference, they calculate anomaly scores based on the distance between test samples and normal samples. However, unlike the diverse, abstract, and complex semantic information typically handled by target detection in natural scene images, anomalies in industrial images tend to be highly irregular. This irregularity poses a significant domain bias between industrial images and natural scenes, presenting a major challenge that impedes the further development of embedding-based methods in the field of industrial anomaly detection. On the other hand, in order to reduce the dependence on data labeling and to address the challenge of missing anomaly images, some methods [8; 9; 10] employ a self-supervised learning framework. These methods enhance the distributional properties of data by means of data enhancement (e.g., rotation, contrast, brightness, etc.). CutPast [10], for instance, artificially generates pseudo-anomaly images by means of cut-and-paste to enable the model to learn the ability to distinguish between normal and anomalous images. In this way, the anomaly detection problem is cleverly transformed into a binary classification task as the training target of the model thus effectively overcoming the difficulty of the scarcity of anomaly samples. However, the anomalies generated by CutPast have limited coverage and cannot comprehensively describe real-world defects. To overcome the aforementioned two problems, we propose a self-supervised learning method of Feature Enhancement Patch Distribution Modeling (FEPDM), a framework for anomaly detection and location based on feature enhancement and self-supervised learning which introduces a novel data enhancement technique by generating pseudo-anomaly images using Perlin noise [11] combined with anomalous source images. It also incorporates a self-supervised proxy task, which aims to train the model to discriminatively distinguish between normal images and anomalous images. Perlin noise is capable of generating anomalous blocks with varying sizes, shapes, and natural textures, significantly enriching the diversity of anomalies. In addition, in our scheme of model training, we utilize a pre-trained network to extract multi-scale features and train at the feature level to eliminate inter-domain bias and reduce the number of model training parameters instead of training the entire network.