# River Surface Space-Time Image Velocimetry Based on Dual-Channel Residual Network
## 3 Model Training and Fusion Coefficient Determination  
### Dataset Construction  
The dataset plays a key role in the training of the model. The quality of the dataset often directly affects the final performance of the model. Given the lack of STI datasets with a wide range and high-precision texture, the video flow measurement system built in the hydrological station collects STIs under different illumination and water flow meteorological conditions and constructs the Panzhihua hydrological station dataset. Panzhihua hydrological station is located in Panzhihua City, Sichuan Province. It is an important national hydrological station, equipped with a hydrological cableway and comprehensive flow measurement facilities. The riverbed is characterized by a large amount of gravel,  
Figure 8: Results of traditional Sobel and adaptive threshold Sobel. (The left, middle, and right figures are original STIs, the traditional Sobel effect, and the adaptive threshold Sobel effect. )which is typical of a mountain riverbed. Unlike the gentle silt-laden rivers of the plains, the water here flows turbulently, crashing against rough rocks and forming waves and swirling patterns. These natural flow tracers provide ideal conditions for image-based flow measurement. The flow measurement section is shown in Figure 8(a). The video flow measurement system is installed on the side slope of the station on the right bank of the river, as shown in Figure 8(b). The corresponding starting distance is 2.9 m, the elevation is 1007.8 m, and the pitch angle is 19.8\({}^{\circ}\). The above calibration parameters are used for the calibration of the river surface flow field without image control. The section monitored by the hydrological station is a relatively stable \"U\"-shaped profile, with both banks composed of boulders, as shown in Figure 8(c). No dams exist downstream of the station. The cross-section shows good control, maintaining a stable stage-discharge single curve for decades. The surface velocity demonstrates a consistent correlation with the sectional discharge. Data were collected over one year (July 2020 to August 2021) through the online video flow measurement system. The length of the testing line was set to 750 pixels; the duration of the video was 30 s, 25 frames per second; and the size of the synthesized STI was \(750*750\) pixels. To make the Panzhihua station dataset cover the various scenarios of real rivers, the dataset was constructed by selecting STIs of five common scenarios, including normal, vortex, flare, obstacles, and rain, as shown in Figure 10. A total of 150 STIs in normal scenarios were selected, of which 100 were used to construct the training set and 50 were used for the test set. In the other four scenarios, 70 STIs were selected, of which 50 were used to construct the training set and the rest were used for the test set. Because the STIs of the normal scenario appear frequently in the actual measurement, the STIs of this scenario account for a large proportion of the dataset. The process of MOT labeling (Figure 11) is as follows: Firstly, a two-dimensional discrete Fourier transform is applied to convert the STI into the frequency domain, where texture related to river tracers manifests as inclined energy concentration lines in the magnitude spectrum. Then, a line segment parallel to the effective energy line is artificially set in the magnitude spectrum. The  
Figure 9: Section view and system setup of Panzhihua hydrological station. slope is calculated according to the coordinates \((x_{1},y_{1})\) and \((x_{2},y_{2})\) of the two endpoints of the line segment. The main orientation \(\theta_{m}\) of the spectrum is obtained:  
\[\theta_{m}=\arctan((y_{2}-y_{1})/(x_{2}-x_{1}))+90^{\circ} \tag{9}\]  
Finally, the MOT is obtained according to the orthogonal relationship between the MOT and \(\theta_{m}\). To obtain a dataset with the MOTs showing a wide range of textures, the dataset is expanded by data enhancement.