## 3 Methodology
### MSWT-DN Structure
#### 3.2.2 Multi-Scale Wavelet Transform  
An application of the wavelet transform to an image is demonstrated in Figure 3. According to Figure 3, the rain trace map of the input model is first processed by horizontal filtering, and convexity is carried out on the rain trace map using passively smoothing and elevated throw detail filters to extract the small-amount element, L, and the powerful element, H, of the map. Then, the filtering is then conducted in the vertical direction to yield four components. These include the low-frequency component (LL), which contains the original small amount data located within the picture; the powerful element component obtained through downward recursive filtering (HL), which contains the powerful element information of the downward filtering and the small amount element information of the vertical filtering; the powerful element component obtained through vertical recursive filtering (LH), which contains the small amount element of the horizontal filtering and the powerful element information of the vertical filtering; and the diagonal high-frequency component (HH), which contains diagonal powerful element information. Due to the downward or parallel directionality of rain streaks, vertical splashes of rainwater are primarily concentrated in the vertical powerful element components HL and HH, while the horizontal architectural details of the picture are more prominently reflected in the horizontal low-frequency components LL and LH.  
In this paper, synthetic and real rainy image data are input into MSWT-DN. The rainy images are first processed by the RSENet to generate an approximate rain streak map, and then the images are subjected to wavelet transform to obtain four different frequency domain components: \(R_{LL}\), \(R_{LH}\), \(R_{HL}\) and \(R_{HH}\). Since rain streaks typically have a vertical or diagonal directionality, they are mainly concentrated in the \(R_{HL}\) and \(R_{HH}\) components, while the horizontal structural details of the image are more represented in the horizontal elements with little variation, \(R_{LL}\) and \(R_{LH}\). For the \(X_{HL}\) and \(X_{HH}\) elements, we propose an improved multi-scale attention residual module (IMARM) and a U-shaped deraining network architecture (U-Former) to focus on learning the information in these two components. IMARM is employed to gather shallow characteristics from the \(R_{HL}\) and \(R_{HH}\) components, perform feature fusion, and reconstruct them to create the fused feature representation. Then, the fused feature representation is concatenated with the approximate rain streak features obtained from RSENet and input into the U-Former deraining subnetwork, which outputs the derained elements \(R^{\prime}_{HL}\) and \(R^{\prime}_{HH}\) for both synthetic and real datasets. For the horizontal elements with little variation, \(R_{LL}\) and \(R_{LH}\), which contain fewer rain streak features, these components are input into the proposed residual detail restoration network (DRANet), which integrates spatial and channel attention to restore the image's background details. Moreover, we present a loss function, L1, for different branches corresponding to the components, which computes the L1 loss between the network's four derained components and the corresponding distinct picture components, obtaining the difference between the predicted and true values. Finally, an inverse wavelet transform is employed to fuse the four derained components, resulting in the final rain-free image.  
Figure 3: Wavelet transform process.