## 2 The Proposed Theory
### Classification Network Structure Design
#### 2.3.2 The Proposed Self-Adaptive Residual Shrinkage Network (SARSN)
In the SE loop, the excitation maps the parameter \(t\) to a set of channel weights, which can be regarded as a channel self-attention  
Figure 6: Schematic diagram of the SARSN backbone network. function in essence. The SE-Net structure includes three parts: the squeeze operation, excitation operation, and reweight operation. 2. Self-adaptive directional derivative threshold  
A soft threshold [22] can eliminate noise interference in vibration signals in industrial fault diagnosis [26], and the soft threshold function can decompose input signals and filter signals within threshold \(\tau\). This method ignores parts with absolute values less than \(\tau\) and shrinks parts with absolute values greater than \(\tau\). The soft threshold function is shown in Formula (8):  
\[y=\left\{ \begin{array}{l}x-\tau,\ x>\tau\\ 0,\ -\tau\leq x\leq\tau\\ x+\tau,\ x<-\tau\end{array} \right. \tag{8}\]  
where \(x\), \(y\) and \(\tau\) represent the input, output, and threshold, respectively. In addition, the gradient values of the soft threshold function output after derivation of the input are 0 and 1. This method can effectively avoid the phenomenon of gradient disappearance and gradient explosion. The partial derivative calculation is shown in Formula (9)  
\[\frac{\partial y}{\partial x}=\left\{ \begin{array}{l}1,\ x>\tau\\ 0,\ -\tau\leq x\leq\tau\\ 1,\ x<-\tau\end{array} \right. \tag{9}\]  
In the field of image classification, different types of noise, such as Gaussian white noise and salt and pepper noise, will also be introduced in the process of industrial scene image acquisition and transmission. When the soft threshold function processes pixel information, it also retains the features outside the threshold interval, in which noise interferes with the image quality. This leads to the reduction of classification accuracy in some fine-grained feature image classification tasks [27]. Therefore, this paper proposes a self-adaptive directional derivative threshold (SADDT) to optimize the deficiency of the soft threshold in fine-grained image classification. SADDT deduces the derivative value of image feature information in the appropriate direction through the channel attention mechanism. Like the optimal gradient in the gradient descent algorithms, SARSN can learn helpful information in the threshold interval instead of keeping all the information in the threshold interval. The SADDT function is shown in Formula (10)  
\[y=\left\{ \begin{array}{l}\delta x-\tau,\ x>\tau\\ 0,\ -\tau\leq x\leq\tau\\ \delta x+\tau,\ x<-\tau\end{array} \right. \tag{10}\]  
where \(\delta\) is the directional derivative value, because the noise situation in different image samples is quite different and an appropriate threshold should be chosen for each sample according to the situation. Therefore, this paper takes the output product of the squeeze operation and excitation operation as a new threshold, and adjusts an appropriate threshold as shown in Formula (11)  
\[P_{\mathrm{s}}=\underset{u,p}{Mean}(|sigmoid(\widetilde{x}_{u,p,s})|)\cdot R _{s}. \tag{11}\]  
where \(\widetilde{x}\in\mathbb{R}^{W\times H\times C}\) and \(R\in\mathbb{R}^{C}\) represent the outputs of the rescale operation and squeeze operation, respectively. \(P\in R^{C}\) indicates the threshold corresponding to each channel in the feature map. 3. Self-adaptive loss function  
At present, most loss functions basically do not consider the differences between classes when dealing with multiclassification tasks, which makes the resampling process of imbalanced sample datasets difficult [28] and data with a small sample size will be overfitted. To improve the accuracy of unbalanced samples, all samples can be clustered into most categories. In this paper, an adaptive update classification loss method based on accuracy and geometric mean (_GMean_) [29] is proposed. This method achieves the effect of interclass balance by treating each category separately, and _GMean_ is the geometric average of recall and specificity.