## 2 Proposed Method
### Model
#### 2.1.2 Introducing the Score-Guided Regularization Strategy to Expand Anomaly Score Differences  
Specifically, the score-guided regularization strategy [23] extracts valuable information from ostensibly undamaged and damaged samples, with more miniature scores for undamaged samples and higher scores for damaged samples. Making full use of apparent data enhances representation learners' optimization, leading undamaged and damaged samples in different directions. Furthermore, the score-guided network directly learns discriminative metrics. It has more robust capabilities because it provides anomaly scores end-to-end rather than relying on pre-defined distance metrics or reconstruction errors. Figure 5 depicts the score-guided network structure of this article. The function \(F(\cdot)\) is a pre-defined d function used to learn the data's features. In this model, the pre-defined d function refers to the auto-encoder, \(X\) represents the training data, and \(F(X)\) represents the abstract representations of \(X\). The score-guided network in this paper only contains two linear layers \(L_{1}\) and \(L_{2}\), which are used to convert the learned latent features into scores \(s\). \(w_{s1},\ w_{s2}\) and \(b_{s1},\ b_{s2}\) are the weight matrix and bias of the two linear layers, respectively.  
Figure 4: The structure of the auto-encoder in this paper.  
Figure 5: The score-guided network structure of this paper.  
The loss function of the score-guided network is defined as follows:  
\[L_{SE}(\cdot,s)=\left\{\begin{array}{c}\lambda_{n}*|s-\mu_{0}|,F(\cdot)<\varepsilon \\ \lambda_{a}*\max(0,a-s),\;F(\cdot)\geq\varepsilon\end{array}\right. \tag{6}\]  
where \(\varepsilon\) is the threshold, after processing by the pre-defined d function \(F(\cdot)\), if it is lower than \(\varepsilon\), we consider the current sample to be an apparent undamaged sample; otherwise, we consider the current sample to be a suspicious damaged sample. Parameter \(a\) determines the guiding position of an anomaly score; \(\lambda_{n}\) and \(\lambda_{a}\) are used as weight parameters to adjust the guiding effect of the anomaly score. We set a very small positive value \(\mu_{0}\) approaching 0 to be the target anomaly scores for the apparent undamaged data, due to that the zero scores will force most weights of the score-guided network to be 0.  
Since \(F(\cdot)\) refers to the auto-encoder in this paper, we can take the reconstruction error of the auto-encoder as a self-supervised signal. We take the loss function of the auto-encoder (Equation (3)) as \(F(\cdot)\). Therefore, the above loss function expression can be written as:  
\[L_{SE}(X_{i},\hat{X}_{i},s)=\left\{\begin{array}{c}\lambda_{n}*|s-\mu_{0}|, \|X_{i}-\hat{X}_{i}\|_{2}<\varepsilon\\ \lambda_{a}*\max(0,a-s),\|X_{i}-\hat{X}_{i}\|_{2}\geq\varepsilon\end{array}\right. \tag{7}\]  
From another perspective, the regularization function can be rewritten as follows:  
\[L_{SE}=\lambda_{n}*L_{normal}+\lambda_{a}*L_{abnormal} \tag{8}\]  
\(L_{normal}\) is the undamaged data part, and \(L_{abnormal}\) is the suspected damaged part.  
It's worth mentioning that a large \(a\), intuitively, can better enlarge the score gap between the undamaged and damaged data. However, a too large \(a\) will only lengthen the distribution of scores, and the performance improvement will stabilize with the increase of \(a\). As the score-guided network learns the anomaly score and \(a\) determines the effect together with \(\lambda_{a}\), the actual impact of \(a\) is small, not requiring adjustment; therefore, we set \(a=6\) in all experiments.