# Dark-YOLO: A Low-Light Object Detection Algorithm Integrating Multiple Attention Mechanisms
## 2 Method
### Dimension Reciprocal Attention Module (D-RAMiT)  
In low-light environments, the local feature information in images is often sparse, and non-uniform illumination can lead to overexposure or underexposure in some regions, further complicating the extraction of local features. As a result, global contextual information becomes critically important. To address this, we introduce the Dimension Reciprocal Attention Module (D-RAMiT) to enhance the model's ability to capture both global information, such as the overall layout of the image and the relative positioning of objects, as well as local details. D-RAMiT achieves this by establishing long-range pixel-level relationships, enabling the model to perceive the complete layout of the image and the relative positions of different regions. Meanwhile, D-RAMiT enables joint backpropagation of registration errors and detection losses by deeply embedding a reversible attention mechanism into the gradient propagation path of YOLOv8's neck network, thereby significantly enhancing the capability to capture global contextual information in images. In dim scenes, local features are sparse and ambiguous. The Spatial Self-Attention (SPSA) of D-RAMiT restores fine-grained details, while the Channel Self-Attention (CHSA) models inter-channel dependencies. This allows the model to infer object identities from limited local cues by leveraging global scene statistics. This global information helps the model better understand the image content and compensates, to some extent, for the deficiencies in local detail features [41]. The architecture of the Dimension Reciprocal Attention mechanism is illustrated in Figure 6.  
D-RAMiT achieves this through the parallel operation of Spatial Self-Attention (SPSA) and Channel Self-Attention (CHSA) mechanisms. The SPSA mechanism helps capture fine-grained local information within the image, whereas the CHSA mechanism utilizes all pixels along the channel dimension to establish global dependencies. D-RAMiT's bidirectional reciprocal mechanism allows the attention outcome in one direction to assist the attention process in the other direction, thereby enabling the model to capture both  
Figure 5: Structure diagram of the PSM model. Partial convolution is performed only on valid pixels within the receptive field. During the operation, normalization is applied based on the number of valid pixels to maintain the value range of the convolution output.  
local and global dependencies within the image more effectively. The D-RAMiT structure is mathematically represented in Equation (11).  
\[Attention=MobiVari(Concat[SPSA,CHSA]) \tag{11}\]  
In Equation (11), MobiVari refers to a variant of MobileNet V2. Specifically, MobiVari replaces the ReLU6 activation function in MobileNet V2 with the LeakyReLU activation function. Moreover, the residual connection of MobileNet V2 is modified. When the number of channels generated by PWConv (pointwise convolution) differs from the input channel number, the residual connection of PWConv is omitted. Additionally, the first convolution in MobileNet V2 is replaced by a group convolution to reduce the number of parameters and computational costs. The structure of MobiVari is depicted in Figure 7.  
Figure 6: Structure diagram of D-RAMiT model. The D-RAMiT module first splits the input features through the Head Split operation, and then computes attention along two dimensions using Spatial Self-Attention (SPSA) and Channel Self-Attention (CHSA), respectively. Next, the MobiVari module is applied for feature transformation, enhancing feature representation. Following this, Layer Normalization (LayerNorm) is performed. The features are further processed through a Feed-Forward Network (FFN), followed by another LayerNorm step. Finally, a skip connection is employed to merge the features.