# Application of Enhanced YOLOX for Debris Flow Detection in Remote Sensing Images
## 3 Data and Methodology
### Methodology
#### 3.2.4 Data Augmentation  
The Mosaic augmentation technique involves using four images, subjected to operations like scaling, translation, flipping, and color domain transformations, subsequently stitched together. Each image contains corresponding bounding boxes, and post-stitching, a composite image showcasing the bounding boxes from all four images, is created. This significantly diversifies the environments where the targets are present. The implementation process is depicted in Figure 9. Figure 9 illustrates the four images before transformation, while Figure 9 displays the effect post-transformation and stitching. It is evident that the composite image offers a more enriched background compared to the original four images, with the locations of targets exhibiting greater diversity. Consequently, this technique substantially expands the original dataset, augments the model's target detection precision, and bolsters detection robustness, thus enhancing the overall performance of the model in various detection scenarios.  
Mixup is a data augmentation strategy that involves class mixing. This technique randomly selects two samples from each training batch, each comprising an image and its associated label. The images and labels from these samples undergo linear interpolation based on a predefined ratio \(\lambda\). A weighted summation of the images is calculated, and the labels are similarly mixed according to this ratio. This method effectively enhances the diversity and richness of the training data, aiding in the development of more robust and accurate models. The formula for \(Mixup\) is as follows:  
\[Image_{mixed}=\lambda\times Image_{1}+(1-\lambda)\times Image_{2} \tag{8}\]  
\[Label_{mixed}=\lambda\times Label_{1}+(1-\lambda)\times Label_{2} \tag{9}\]  
\[\lambda e[0,\ 1] \tag{10}\]  
Using mudslide remote sensing images as an example, in the training phase, an initial sample image is loaded, depicted in Figure 10. Subsequently, a second sample image is randomly selected, illustrated in Figure 10. These images are then combined through a weighted fusion process, culminating in a composite image, as exhibited in Figure 10. This method effectively synthesizes diverse visual data, enriching the dataset and enhancing the model's ability to generalize from complex remote sensing imagery.  
Figure 9: Mosaic image processing. (**a**) The original image before the Mosaic; (**b**) The image after Mosaic.  
In this research, the data augmentation strategy for RS-YOLOX-Nano model training was enhanced by integrating Mosaic, complemented by \(Mixup\) as an additional reinforcement technique. For each training batch, 50% of the samples are randomly chosen for Mosaic data augmentation, followed by further \(Mixup\) processing of 50% of the Mosaic-enhanced images. This approach amplifies the randomness and diversity of the data augmentation, supplying the model with an array of varied and enriched image samples. Utilizing these samples for training significantly bolsters the model's robustness and generalization capacity. These improvements endow the RS-YOLOX-Nano model with greater adaptability, enabling it to more effectively handle target detection tasks across diverse scenarios.