# Two-Stage Robust Lossless DWI Watermarking Based on Transformer Networks in the Wavelet Domain
## 3 Proposed Method
### Watermark Embedding Network  
The above robust watermarking algorithms based on deep learning perform watermark embedding in the spatial domain. However, since DWI images contain rich texture and greyscale information, to preserve their texture details and fibre direction, a two-dimensional discrete wavelet transform (DWT) is adopted to decompose the DWI image into its corresponding frequency components. It performs watermark embedding in the low-frequency part of the DWI image in the wavelet domain. Discrete wavelet transform can decompose the cover image into different spatial and temporal scales and obtain its corresponding frequency components, effectively performing various image processing tasks. Nowadays, discrete wavelet transform is widely used in various computer vision tasks in deep learning research, such as super-resolution reconstruction, style transfer, and quality enhancement. Unlike the literature that directly passes all wavelet frequency information in the image to convolutional layers, the algorithm proposed in this section independently designs network branches for each group of frequency information. It combines the features of other branches to achieve a better reconstruction performance. The watermark embedding network proposed is shown in Figure 4. The input DWI image is subjected to a two-level discrete wavelet transform to obtain its corresponding wavelet frequency information. The frequency information in the horizontal direction (\(LH_{1}\)), vertical direction (\(HL_{1}\)), and diagonal direction (\(HH_{1}\)) obtained from the first-level wavelet decomposition are combined to represent \(F_{1}\). Similarly, the frequency information in the  
Figure 3: A two-stage robust lossless watermarking architecture based on deep learning. horizontal direction (\(LH_{2}\)), vertical direction (\(HL_{2}\)), and diagonal direction (\(HH_{2}\)) obtained from the second-level wavelet decomposition are combined to represent \(F_{2}\), and the low-frequency part of the second-level wavelet decomposition is represented as \(LL_{2}\). To avoid damaging the texture details and fibre direction of the DWI image, the information in the three frequency bands of \(F_{1}\), \(F_{2}\), and \(LL_{2}\) is separately input into three network branches for reconstruction. Firstly, watermark embedding is performed on the low-frequency information \(LL_{2}\) of the image. To enhance the robustness of watermark extraction, the method of multiple redundant embedding was adopted to embed the watermark information and obtain the reconstructed low-frequency information \(LL_{2e}\). As shown in Figure 5.  
Secondly, to transmit the embedded watermark information from the low-frequency information \(LL_{2e}\) to the high-frequency information, we proposed a low-high-frequency attention (LHFA) block based on frequency information enhancement shown in Figure 6. The low-frequency information \(LL_{2}\) in the second-level wavelet decomposition contains global information and important low-frequency components, which are the smooth parts of the cover image. The high-frequency information contains details and local information. By using \(LL_{2}\) and the reconstructed low-frequency information \(LL_{2e}\) as \(Q\) and \(K\), respectively, the model can focus more on the important low-frequency components, thereby enhancing the global information and stability of the image. Meanwhile, the content of the high-frequency part \(F_{2}\) is used as \(V\), which can transmit details and local information to the reconstructed frequency band, thereby improving the accuracy and detail expression ability of the image. The frequency information after the LHFA block is subjected to the Transformer block and convolution and then added to the original frequency band \(F_{2}\) content to obtain the reconstructed frequency band \(F_{2e}\), completing the transfer of watermark information from low- to high-frequency bands and improving the reconstruction effect and robustness.