# Application of Enhanced YOLOX for Debris Flow Detection in Remote Sensing Images
## 3 Data and Methodology
### Methodology
#### 3.2.2 Enhancing Architectures with Integrated Attention Mechanisms  
Attention mechanisms allow models to selectively concentrate on pertinent information, acting as a resource allocation strategy that effectively addresses information overload. Standard convolutional layers are unable to model inter-channel correlations, resulting in a uniform treatment of channels and thus a subdued representation of crucial information. In remote sensing imagery applications, challenges such as small targets, partial occlusions, and complex backgrounds are common; the incorporation of attention mechanisms can, to some extent, enhance model performance [22; 23; 24]. This research has undertaken an optimization of the YOLOX-Nano network. Following the model's lightweight transformation, the reallocation of channel weights has rendered important channels more prominent, ensuring the retention of critical target space and feature information. Within the YOLOX-Nano network, distinct attention mechanisms were implemented in the _Focus_, \(SPP\), and \(PAFPN\) modules, tailored to the specific functions of each module. The squeeze-and-excitation attention (\(SE\)), for example, employs global pooling to derive a \(1\times 1\times\text{C}\) dimension (\(C\) being the number of channels), using two fully connected layers and an activation function for non-linear processing. This approach is effective for managing intricate inter-channel correlations, yielding a \(1\times 1\times C\) channel weight that aligns with feature map layers. Utilizing global pooling, \(SE\) compresses overall information into channel weights, thereby effectively discerning the relative importance of various channels, as illustrated in Figure 4.  
Figure 3: The network architecture diagram of YOLOX-Nano. The channel attention (\(CA\)) [25] conducts pooling and convolution operations along the width and height dimensions of feature map layers, resulting in the generation of feature encodings and their aggregation across two channel dimensions. In contrast to squeeze-and-excitation (\(SE\)), which primarily redistributes channel weights, \(CA\) is capable of capturing long-range dependencies in one spatial direction while preserving precise location information in another. This enables the model to locate and recognize target areas with greater accuracy, thereby significantly enhancing the network's ability to retain information. The computational workflow of \(CA\) is illustrated in Figure 4.  
The convolutional block attention module (\(CBAM\)) [26] initiates with channel attention, conducting global average pooling and max pooling on each feature layer, subsequently processed through shared fully connected layers and applying the sigmoid activation function to derive channel-specific weighted values. The acquired weights are then multiplied with the original feature layers, resulting in an augmented feature map. Spatial attention ensues, applying max and average operations on the channel-attention-processed feature layers, modulating the number of channels via a convolutional kernel, and determining the weight of each feature point through the sigmoid activation function, as illustrated in Figure 5. Ultimately, these weights are applied to the original feature layers, yielding an optimized  
positional information within the expanded channels, thereby further augmenting the Focus network's capability to retain features, as depicted in Figure 6.  
In neural network models, the deeper feature layers encapsulate richer semantic information, transforming positional information into highly abstracted semantic content. To expand the receptive field, YOLOX-Nano incorporates the \(SPP\) (spatial pyramid pooling) module within its deeper network layers. Given that the deeper network channels predominantly store abstract semantic information, each channel functions as an independent repository for this data.