# HarmoDehazeDiffusion: Multi-Scale Spatial Fusion Network for Dense Haze Removal
## 3 The Method
### Spatial Feature Fusion  
Deep feature representations, typically extracted using deep layers of neural networks, contain rich semantic information, which enables them to effectively identify the overall illumination conditions in an image. However, due to the high abstraction and low resolution of feature maps, the boundary information for deep features is often not well preserved. In contrast, more detailed information is retained for shallow features and can accurately capture the edges and texture features of objects. Nevertheless, their limited receptive fields and inclusion of a large amount of irrelevant background information pose challenges. Therefore, a common strategy is to integrate feature information from different depths to fuse the overall information on illumination and texture details. However, simple fusion methods often fail to effectively distinguish between the two, leading to issues such as blurred boundaries or background interference. To address the aforementioned issues, our spatial feature fusion module employs a cross-depth attention mechanism, leveraging deep feature representations to guide low-level feature representations for joint context modeling and perception. Specifically, the module first performs global context encoding on the deep feature representations to extract their semantic information and generates spatial weight maps through an attention mechanism. These weight maps are then multiplied pixel-wise with the low-level feature representations. In this way, the module significantly combines the overall illumination characteristics of the deep features with the detailed texture features of the shallow layers, thereby enhancing the accuracy of the texture and spatial representation. Experiments show that after introducing this module, the performance of the dehazing model in complex scenes is significantly improved, particularly in terms of the clarity of boundaries and the overall consistency of illumination. As shown in Figure 2, our proposed spatial feature fusion can be divided into two key stages: (1) the branch feature extraction stage and (2) the high-level and low-level information attention fusion stage. In the first stage, considering the significant differences between the low-level features \(F_{l}\) and high-level features \(F_{h}\) in terms of the semantic information and spatial details, we adopt a branch feature extraction strategy. Specifically, for the low-level features \(F_{l}\), which contain rich spatial details and edge information, we design a low-level branch convolutional structure: first, we use convolutional kernels with sizes of 3 and 5 to extract the features from the image, then align these two feature maps to obtain the fused low-level local features, and finally perform feature reorganization and dimensionality reduction using \(1\times 1\) convolutions. These combined features effectively preserve the key information on the details of the image. For the high-level features \(F_{h}\), which already possess strong semantic expression capabilities, our method only uses \(1\times 1\) convolutional layers for the feature transformation to enhance their semantic information while maintaining the level of feature abstraction. Through this differentiated processing approach, the shunt processing in the first stage can be represented as follows:  
\[ \begin{split} F_{L}&=\text{Conv}_{1\times 1}(\text{Conv}_{3 \times 3}(\text{GA}(F_{l}))+\text{Conv}_{5\times 5}(\text{GA}(F_{l}))),\\ F_{H}&=\text{Conv}_{1\times 1}(\text{Conv}_{1\times 1 }(\text{LA}(F_{h})))\end{split}  \tag{4}\]  
In the second stage, we propose an innovative nonlinear fusion strategy aiming to achieve deep interactions and complementarity in the information between the low-level features \(F_{L}\) and high-level features \(F_{H}\).