## 3 Methodology
### Multi-Scale Linear Spatial Attention Module
\begin{split}\text{O}_{\text{i}}&=\frac{\sum_{ \text{j}=1}^{\text{N}}\left(\text{ReLu}(\text{Q}_{\text{j}})\cdot\text{ReLu}( \text{K}_{\text{i}})^{\text{T}}\right)\cdot\text{V}_{\text{j}}}{\text{ReLu}( \text{Q}_{\text{j}})\cdot\sum_{\text{j}=1}^{\text{N}}\text{ReLu}(\text{K}_{ \text{j}})^{\text{T}}}\\ &=\frac{\sum_{\text{j}=1}^{\text{N}}\text{ReLu}(\text{Q}_{\text{ j}})\cdot\left(\text{ReLu}(\text{K}_{\text{j}})^{\text{T}}\right)\cdot\text{V}_{ \text{j}}}{\text{ReLu}(\text{Q}_{\text{j}})\cdot\sum_{\text{j}=1}^{\text{N}} \text{ReLu}(\text{K}_{\text{j}})^{\text{T}}}\\ &=\frac{\text{ReLu}(\text{Q}_{\text{j}})\cdot\left(\sum_{\text{j}= 1}^{\text{N}}\left(\text{ReLu}(\text{K}_{\text{j}})^{\text{T}}\right)\cdot \text{V}_{\text{j}}\right)}{\text{ReLu}(\text{Q}_{\text{j}})\cdot\sum_{\text{j }=1}^{\text{N}}\text{ReLu}(\text{K}_{\text{j}})^{\text{T}}}\end{split}  \tag{8}\]  
As shown in Equation (8), the expressions \(\sum_{\text{j}=1}^{\text{N}}\left(\text{ReLu}(\text{K}_{\text{j}})^{\text{T}} \right)\cdot\text{V}_{\text{j}}\in\mathbb{R}^{\text{d}\times\text{d}}\) and \(\left(\sum_{\text{j}=1}^{\text{N}}\text{ReLu}(\text{K}_{\text{j}})^{\text{T}} \in\mathbb{R}^{\text{d}\times\text{1}}\) only require computation once. These values can then be reused for each query, resulting in a computational cost of O(n) and memory usage of O(n). Although the ReLU linear attention network outperforms the softmax attention network in computational complexity and hardware latency, it tends to produce diffused attention maps, which compromise its efficiency in capturing local information. We incorporate a spatial information module to enhance the ReLU linear attention network, embedding spatial information into Q to better capture local details. In this work, we use a spatial information extraction network to process the features F\({}^{\prime}\) after linear transformation. First, F\({}^{\prime}\) is passed through a channel-based global max pooling (GMP) and global average pooling (GAP) to obtain two feature maps of size \(\left\{H\times\text{W}\times 1\right\}\). These two feature maps are then concatenated along the channel axis and used as the input to a convolution operation f. After the convolution reduces the number of channels, the resulting features are passed through a sigmoid function to obtain features that carry spatial information. Finally, the spatial information features are multiplied element-wise by F\({}^{\prime}\), enabling the features to incorporate spatial information. This helps ensure that the target can still be correctly detected even when parts of its features are missing. The specific formulation of the spatial information features is shown in Equation (9). \[ \begin{split}\text{S}(\text{F})&=\delta\big{(} \text{f}\big{(}\big{[}\text{GMP}\big{(}\text{F}^{\prime}\big{)},\text{GAP} \big{(}\text{F}^{\prime}\big{)}\big{]}\big{)}\\ \text{GMP}(\text{F})&=\text{MaxPool}(\text{F})\\ \text{GAP}(\text{F})&=\text{AvgPool}(\text{F})\end{split}  \tag{9}\]  
By incorporating spatial information, the model enhances its ability to capture local features more effectively, thus improving accuracy in tasks that require precise localization. Through the effective integration of multi-scale linear attention and spatial positional information, the feature learning network can comprehensively extract salient pedestrian features, thereby mitigating the adverse effects of information loss caused by pedestrian occlusion in dense scenes.