## 3 Method
### Multi-Scale Feature Fusion Model  
First, bilinear interpolation is used to up-sample the feature maps with sizes smaller than 38 \(\times\) 38. Conv1 \(\times\) 1 is then applied to every feature map to reduce the feature dimension. Afterward, batch normalization (BN) and shallow layers (ReLU) are utilized to accelerate the learning speed of the model and alleviate gradient vanishing. The three feature maps are concatenated with the same size in the spatial dimension, and SAU blocks are applied to guide the model to focus on objects in complex backgrounds.  
Figure 2: The MFFCESSC-SSD framework based on the SSD (highlighted in green). MFF aims to utilize information from different feature maps and suppress the impact of background noise by using AU blocks; CESSC replaces the detection head in each FPN layer by using a mask feature \(H_{i}\) and a global feature \(G_{i}\). The mask ratio of \(H_{i}\) is a spatial sparse mask generated from the feature statistics for each layer.  
In SAU blocks, the given feature map is \(\mathbf{F}_{i}\in\mathbf{R}^{H\times W\times C_{K}}\) from the \(i\)-th layer of the FPN, where \(C_{K}\), \(H\), and \(W\) refer to the channel size, height, and width of the source feature maps, respectively. \(\mathbf{F}_{i}\) is transformed into queries \(\mathbf{Q}=\mathbf{F}_{i}\mathbf{W}_{q}\), keys \(\mathbf{K}=\mathbf{F}_{i}\mathbf{W}_{k}\), and values \(\mathbf{V}=\mathbf{F}_{i}\mathbf{W}_{v}\) by embedding the matrices \((\mathbf{W}_{q},\mathbf{W}_{k},\mathbf{W}_{v})\). Each embedding matrix is generated by conv\(1\times 1\). Notably, the key is encoded using a k \(\times\) k kernel so that the local contextual information between neighbors can be obtained by Equation (1).  
\[\mathbf{R}=\mathbf{K}*\mathbf{Q} \tag{1}\]  
The global weighted feature mapping matrix is computed by applying convolutions and the Softmax function to local contextual information, and the formula is expressed as Equation (2).  
\[\mathbf{A}_{i,j}=\frac{e^{\mathbf{R}_{i,j}}}{\sum_{j=1}^{H\times W}\mathbf{R} _{i,j}},i,j=1,2,3\ldots H\times W \tag{2}\]  
where \(\mathbf{A}_{i,j}\) represents the elements of the \(i\)-th row and \(j\)-th column, all of which make up the global weighted feature matrix \(\mathbf{A}\).  
\(\mathbf{V}\) is subjected to matrix multiplication with matrix \(\mathbf{A}\) to obtain a weighted summation across all positions within the same feature map. Subsequently, the resultant matrix multiplication is added to the original series of features to produce the output \(\mathbf{F}^{\prime}\) of the SAUs, as described in Equation (3).  
\[\mathbf{F}^{\prime}=\mathbf{F}+\mathbf{A}\mathbf{V}^{T} \tag{3}\]  
The features \(\mathbf{F}^{\prime}\) extracted from all SAUs undergo a feature fusion process (as shown in Equation (4)). To address the issue of exponential growth in magnitude, a non-parametric averaging operation is employed, which facilitates the derivation of the final fused feature layer.  
\[\mathbf{X}_{i}=\frac{f_{i}^{1\times 1}\mathbf{F}_{i}^{\prime}+f_{i+1}^{1\times 1 }\mathbf{F}_{i+1}^{\prime}+f_{i+2}^{1\times 1}\mathbf{F}_{i+2}^{\prime}}{3},i \in n-1 \tag{4}\]  
where the \(i\)-th layer is comparatively shallower than the \(i+1\)-th layer and the \(i+2\)-th layer, and the \(f_{i}^{1\times 1}\) is employed to decrease the number of channels.  
The key is encoded using a k \(\times\) k kernel to address the issue of limited receptive fields in convolutional operations, effectively capturing local contextual information. Concurrently, the self-attention mechanism within each SAU retains the capacity to acquire global contextual information, a characteristic of traditional self-attention, thereby enhancing visual representation. Meanwhile, this study integrates the output of the SAUs into the sparse convolution operation (\(\mathbf{F}^{\prime}=\mathbf{G}_{i}\)) to mitigate the lack of contextual information associated with convolving only the foreground of a UAV image.