## 3 Methodology
### Rain Streak Extraction Network (RSENet)  
In single-image deraining tasks, an ideal situation would be if the true rain streak map could be acquired. Taking the wet picture and deleting the corresponding rain streaks, the rain-free image could be directly obtained. However, this situation only occurs under ideal conditions. If we can obtain an approximate rain streak map, we can also use the subtraction method to significantly reduce the rain streaks in the wet picture, thus reducing the difficulty of subsequent tasks.  
Currently, most datasets do not contain rain streak data. [PERSON] et al. (2019) proposed a method for obtaining an approximate rain streak, as shown in Equation (1).  
\[R_{i,j}^{\max}=\max R_{i,j,c}^{diff},c\in RGB \tag{1}\]  
where \(i\) and \(j\) represent pixel indices, \(c\) represents different channels, \(R^{diff}\) denotes the distinction between the picture of the rain and the corresponding picture without rain, and \(R^{max}\) is the acquired approximate rain streak map, which is a grayscale image.  
During the training process in this paper, RSENet optimizes the network parameters by comparing the differences between the generated approximate rain trace map A and the real rain trace map. Specifically, the goal of RSENet is to make the generated approximaterain trace map as close as possible to the real rain trace map by minimizing the loss function. The formula is derived as follows:  
\[L=\sum_{i,j}\left(I_{rainy}(i,j)-I_{clean}(i,j)-I_{rain}^{approx}(i,j)\right)^{2} \tag{2}\]  
where \(L\) is the mean square error loss; \(I_{rainy}(i,j)\) is the value of pixel location \((i,j)\) in the image with rain; \(I_{clean}(i,j)\) is the value of pixel location \((i,j)\) in the image without rain; and \(I_{rain}^{approx}(i,j)\) is the value of pixel location \((i,j)\) in the approximate rain trace image generated by RSENet.  
In practice, the approximate rain trace map generated by RSENet can be used to remove rain traces from an image.  
\[I_{clean}^{approx}=I_{rainy}-I_{rain}^{approx} \tag{3}\]  
In the above equation, assuming that we have a rainy image \(I_{rainy}\), the rain-free image \(I_{clean}^{approx}\) can be obtained by subtracting the generated approximate rain trace map \(I_{rain}^{approx}\) from the rainy image.  
This process is based on the assumption of \"ideal rain removal\": if the real rain map is known, the rain map can be subtracted directly from the rain image to obtain the removed image. By generating an approximate rain map, the rain removal operation can be approximated without the real rain map. Although the rain removal effect of this method is not as perfect as in the ideal case, it can significantly reduce the rain traces in the image and reduce the difficulty of the subsequent tasks.  
The rain streak extraction network (RSENet) suggested in this study includes several consecutive channel and spatial attention blocks (CSAB) and skip connections, as shown in Figure 4. The CSAB module is based on the residual network [21], but in contrast to the residual network in [21]. Moreover, using two convolutional layers and ReLU functions, we also add both spatial and channel attention mechanisms (CAM and SAM) to better capture deep features from the image. This approach uses residual network skip connections to address problems such as vanishing gradients or exploding gradients caused by deep network layers. Lastly, the advantages of the suggested approach are shown by means of experimental data.