## 4 Experimental Design and Data Collection
### Video Data Segmentation and Data Enhancement Based on Sliding Windows  
To maintain a consistent number of videos across various frame rates, this study employs a sliding window algorithm for video data segmentation, as illustrated in Figure 8. A dataset of 3750 frames can produce 750 videos of 10 frames each (). Without the sliding window, the dataset would only yield 250 videos of 15 frames each (), reducing the video count by half, which hinders algorithm performance assessment. Consequently, a sliding window with a 5-frame step size is applied to create a dataset with 10-frame segments, resulting in 749 video segments ().  
In this experiment, the window size is set as a hyperparameter of the model expression, with a value range of 5 frames, 10 frames, 25 frames, and 50 frames. The step size is 5 frames, and the schematic diagram of the data after segmentation is shown in Figure 9. The initial window is set to 5 frames (about 0.2 s, the video has a frame rate of 30 fps) to capture the minimum effective time unit of the transient response during the leakage process. The step size is set to 5 frames to reduce redundant calculations while retaining time continuity,  
Figure 7: Quality comparison before and after super-resolution reconstruction (distance: 1 m; rate: 2.5 L/min).  
thereby achieving the optimal trade-off between efficiency and accuracy. When switching the leakage flow rate, it is necessary to remove the first and last 15 s of each video in order to improve the imaging accuracy of the picture.  
Six videos are shot for the six experimental levels set, and each video contained 3750 video frames after processing. To improve the training effect, enhance the robustness of the model, and achieve the purpose of expanding the dataset, data enhancement operations are required. Unlike traditional image detection, video detection needs to consider the relationship between different video frames, so different data enhancement methods need to be carried out in stages. After all videos are super-resolution reconstructed, each video is rotated 45 degrees as a prerequisite for later video enhancement. Similarly, the video after super-resolution reconstruction is mirrored, which includes horizontal mirroring and vertical mirroring. The super-resolution reconstructed video, the rotated video, and the mirrored video are used as three types of data sources for frame extraction, and the extracted video frames are subjected to another data enhancement operations, such as changing brightness, adding Gaussian noise, and adding color block occlusion. Unlike the low-definition noise that comes with the original data, Gaussian noise is a noise pixel point that conforms to the Gaussian distribution and does not interfere with the high-precision reproduction of the edge and contour of the target by super-resolution reconstruction. It is worth noting that only the square black blocks are added to the image for image occlusion. The black triangles and white triangles in the figure are the system graphics when the monitoring instrument is calibrated. Therefore, the triangular blocks exist in the original image data, but they are not objects added by data enhancement. Figure 10 shows the effect of data enhancement.  
Finally, a total of 53,676 video frames are obtained, with the ratio of training set, validation set, and test set being 7:2:1, respectively. In addition, Table 2 shows the amount of data on the different leakage rate levels contained in different video frames after sliding window processing. From the table content, there are more than 2000 video frames corresponding to each leakage rate. At the same time, the data are enhanced to make the training more challenging. The use of a large amount of data for the training helps to enhance the robustness of the model and improve the training effect.  
Figure 8: Demonstration of the video data segmentation principle based on a sliding window.  
Figure 9: Schematic diagram of continuous sliding window data after segmentation.