## 3 Proposed Method  
### False Alarm in Unsupervised Anomaly Detection  
Unsupervised anomaly detection falls into the OOD domain as detectors learn from the anomaly-free training dataset.  
Given an anomaly-free training dataset with \(D\) images: \(\chi=\{x_{0},x_{1},\ldots,x_{D}\}\)\(,x_{i}\in R^{\mathrm{H\times W}}\), the UAD model aims to train a neural network-enabled anomaly score learning function \(S:\chi\to K\) that differentiates the anomalies from normal ones. The separation unit is an image, object, or pixel, depending on the granularity of the specific visual task. To investigate the cause of false alarms in OOD defect segmentation tasks, we may have a further statistical analysis of the pixel-wise transformed outputs \(S(\chi)\), which are prediction scores on anomaly maps \(K\), and finally turn into segmentation mask via binary threshold \(\tau\). Generally, the score falls in \([0,1]\) while a higher value indicates a higher likelihood of belonging to a defect.  
The density probability distributions of prediction scores estimated by the OOD segmentation model in each phase are illustrated in Figure 2. During the training phase, depicted in Figure 2a, the model learns the feature distribution of anomaly-free images and trains its parameters to map the original images to the prediction score distribution corresponding to \(P_{\mathrm{K1}}\). In principle, the mapped anomaly score should be lower than the default threshold, indicating a negative attribute. Figure 2b,c illustrate the segmentation process in ideal and real-world industrial anomaly detection scenarios, respectively. In an ideal scenario, the segmentation model should be capable of mapping normal pixels in the image to prediction scores \(P_{\mathrm{K1}}\) lower than the decision threshold \(\tau\), forming negative predictions. At the same time, it should map pixels corresponding to anomalies or faults to anomaly scores higher than the decision threshold, forming positive predictions \(P_{\mathrm{K2}}\), as shown in Figure 2b, representing a perfect segmentation situation.  
The discriminative ability of unsupervised models is challenged as the absence of defects from the training dataset, especially dealing with complex anomaly detection scenarios. In practical applications, anomaly-free images involve various adverse factors causing appearance differences, including lighting conditions, clutter background, product batch, slight in-service aging, and staff stamps. Therefore, the discrimination abilities of unsupervised detectors are usually incompatible with the complex classification boundary between defect and normal. The model may not accurately predict anomalous pixels on the image. Prediction scores for normal and defect pixels intersect, as shown in Figure 2c. When two distributions intersect, the resulting performance will have deficiencies no matter where the threshold \(\tau\) locates. The binarization of the prediction score using \(\tau\) results in the formation of false positives, represented by the portion of \(P_{\mathrm{K2}}\) above the threshold \(\tau\), which corresponds to false alarms in industrial anomaly detection.  
Simply increasing \(\tau\) to avoid the intersection with \(P_{K1}\) may eliminate false alarms while causing positive defects to be ignored. Therefore, the false alarm problem comes from the inadequate discrimination ability to differentiate \(P_{K1}\) and \(P_{K2}\). The performance can hardly optimize through existing parameter modification since there is no additional information on defects. To this end, we provide a post-processing optimization approach to incorporate fuzzy domain knowledge of defects to eliminate false alarms at the pixel level.