# Shadow Hunter: Low-Illumination Object-Detection Algorithm
## 3 Low-Illumination Object Detection
### Low-Level Feature Attention  
In low-illumination images, most objects are typically obscured within dark backgrounds, posing challenges for the detection network to accurately identify target regions and categories. Additionally, the extracted feature information from these images is typically sparse. Although image-enhancement techniques can enhance the visibility of features, they may also introduce unnecessary and misleading background features, which can negatively impact the overall detection performance. To address this issue and prioritize relevant feature information of the target region, this paper proposes an LFA. The feature maps undergo separate convolution layers with kernel sizes of \(3\times 3\) and \(5\times 5\), respectively. This variation in kernel sizes allows the feature map to capture a range of perceptual fields within the same layer, promoting the extraction of deeper image features. To prevent interference between features extracted from different convolutional kernel sizes, we opt to perform a concatenation operation on the input features rather than adding them together. This approach ensures that the distinct information from each kernel size is preserved without causing unwanted blending or distortion. The fused features are \(F\in\mathbb{R}^{H\times W\times 2C}\). After that, the features map is rescaled by using global average pooling in the dimension of the channel to encode the information features in the spatial dimension, and each two-dimensional feature channel is encoded as a parameter to express the global information of the feature channel. After global averaging pooling, the feature vector \(U\in\mathbb{R}^{1\times 1\times 2C}\) has the same feature dimension as the fused features. The following formula is followed. \[U=\frac{1}{H*W}\sum_{i=1}^{H}\sum_{j=1}^{W}F(i,j) \tag{1}\]  
Figure 2: The whole pipeline for low-illumination object detection. The overall architecture of the framework is similar to YOLOv5s. The difference between CSP1-X and CSP2-X is that the latter does not use Short-Cut. The role of SPPF is to perform multi-scale feature fusion, integrating the representations of the same feature map at different scales. We have incorporated LFA into the backbone network and replaced the original network structure’s neck and head with FFN and CSDH. In the formula above, \(H\) and \(W\) represent the dimensions of the features, while \(i\) and \(j\) represent the spatial positions of the features. In order to make the feature channels correlated with each other, the feature vector \(U\) is transformed into \(\hat{U}\in\mathbb{R}^{1\times 1\times 2C/r}\) after a \(1\times 1\) convolution layer, where \(r\) is the scaling factor, in order to reduce the vector dimension and reduce the computational effort. Since it is a two-channel entry, we also need to branch through two fully connected layers to obtain two weight vectors. These weight vectors can be calculated using the following formulas:  
\[F_{s}=\sigma(W_{s}\hat{U}) \tag{2}\]  
\[F_{l}=\sigma(W_{l}\hat{U}) \tag{3}\]  
In the formula, \(F_{s}\) denotes the weight vectors obtained from two channels of \(3\times~{}3\) convolutional layers, and \(F_{l}\) denotes the weight vectors obtained from two channels of \(5\times~{}5\) convolutional layers, where \(W_{s}\) and \(W_{l}\) are the fully connected layer's parameters of the two corresponding branches to generate the weight vectors of the corresponding input features. \(\sigma\) denotes the \(Softmax\) operation to let the network know where to focus more in a low-illumination image. Following the generation of two-feature weight vectors, the element-wise product operation is performed between \(F_{1}\) and \(F_{2}\). This operation enhances the network's focus on channels that contain relevant target feature information, thereby improving the expressive capability of low-level feature fusion.