## 3 Material and Methods
### The Recommended Method  
The DRSN is an optimized version of the deep residual network [23]. This network can eliminate unnecessary noise [23]. The DRN is made up of three parts: the residual network, the attention mechanism, and the soft threshold function. Paying attention to unimportant features via the DRSN network's attention mechanism and setting it to zero via the soft threshold function; in other words, the attention mechanism aims to pay attention to and retain important features via features. As a result, it enhances deep neural networks' ability to extract useful features from noisy signals. The attention mechanism employs feature weighting to assign different weight values to each feature channel, resulting in a degree of sample noise reduction. The noise content of different regions in the same feature channel, on the other hand, varies. The attention mechanism's limitation is that it cannot capture position information and feature weighting alone cannot meet the need for sample noise reduction. Unlike previous studies, this one introduced a new residual shrinkage network, Log-DRSN. The network's computational power and success rate have both increased because of the Log-DRSN. We enhance the attention mechanism to work more precisely and effectively, optimizing the training process of the model and ultimately yielding improved results. In  
Figure 2: A residual module. contrast to the classical approach, our proposed model utilizes a logarithmic function in attention weights and attention output. This choice contributes to increased numerical stability by mitigating large differences between numbers. Unlike classical DRSN, it aids in expressing relative measures between features more accurately and better articulates errors in model predictions. The application of a logarithmic function to attention weights facilitates focused attention on a particular topic, especially when selecting from multiple attention topics in our model. Another advantage of the Log-DRSN model is that, since a gradient-based optimizer is employed, the optimization algorithm proves to be more effective with the logarithmic function, delivering high performance. An additional consideration is that the Softmax function, when operating in large numbers, may introduce numerical stability issues, particularly in scenarios where calculating the probabilities of major and minor events is challenging. Using logarithmic functions helps stabilize calculations, reducing such problems and simplifying computations by converting the product of the logarithmic function and cross-entropy loss probabilities into addition. This streamlines the model optimization and learning processes. With incorporating new logarithmic function soft-thresholding and deep attention modules in Log-DRSN, the features the model needs to learn are suppressed. Unlike the classical approach, Log-DRSN demonstrates the ability to generalize using fewer parameters and exhibits faster learning. This leads to increased model accuracy and a reduction in over-fitting. Figure 3 illustrates the overall architecture of Log-DRSN, highlighting the flow of data through the initial convolutional layer, residual blocks with soft-thresholding, and the attention mechanisms. This schematic provides a clear visual summary of how the model integrates residual learning, adaptive feature suppression, and enhanced attention to improve fabric defect detection performance. Operationally, the Log-DRSN model processes input images through a sequence of well-defined stages designed to enhance robustness and interpretability in noisy fabric defect detection scenarios. First, the raw input image is passed through an initial convolutional layer to extract low-level features. These are subsequently processed by a series of residual blocks that constitute the core of architecture. Each residual block contains two paths: a convolutional transformation path and an identity shortcut path, which collectively allow deeper training by mitigating gradient vanishing.