## 2 Materials and Methods
### Optical Flow Detection and Regression Modeling
#### 2.2.2 Dynamic Screening of Median Value  
To accommodate optical flow acquisition for each flow state, a dynamic threshold corner screening method is necessary. By examining the collected optical flow reference parameters and utilizing the median value of the dynamic screening method, corner screening can automatically adjust to the optical flow acquisition of videos with varying flow rates and regimes. The following comparative experiments demonstrate that the collected optical flow data can furnish dependable gas-liquid two-phase flow information for the learning model. The flow of the median screening method is depicted in Figure 6.  
Figure 4: Distribution of the optical flow characteristics.  
Figure 5: Comparison map of a dynamic threshold corner screening method.  
Experiments were conducted using a \(5\times 5\) window to assess the utilization of the median value sifting method for optical flow acquisition on the aforementioned 30 frames of video. Additionally, the results are illustrated in Figure 7.  
In Figure 7, the values in the legend with'represent the values obtained by using the median screening method, while those without' denote the values obtained without employing the median screening method. The median value obtained using the median screening method closely aligns with its average angular displacement, and its RMS remains consistently stable. This is particularly pronounced with regard to the vertical RMS value. Moreover, there is a strong correlation between the RMS value and the median value. Conversely, the difference between the median value and the root mean square obtained without the median screening method is more pronounced, indicating that a majority of the optical flow acquisition values are smaller, resulting in a more dispersed distribution and an increased presence of interfering angular points. Comparing the values obtained under different window sizes without median screening reveals that, after employing  
Figure 6: Flowchart of the median value screening.  
Figure 7: Optical flow characteristics of the median value using the sieving method.  
median screening, the median and RMS values exhibit greater similarity, especially in smaller windows, demonstrating that the optical flow calculation is more reasonable. The median value screening effectively filters out interfering corners, thereby enhancing the stability of the optical flow extraction and flow correlation. As a result, this approach contributes to enhanced stability in subsequent feature extraction and the accuracy of machine learning calculations.  
The results of corner point distribution after using and not using dynamic screening via the median method are shown in Figure 8.  
Figure 8 illustrates the corner points obtained with and without the dynamic screening of the median method. Figure 8a shows corner points obtained without dynamic screening of the median method, while Figure 8b displays the corner points obtained with this method applied. The images reveal that, due to the density disparity between the gas and liquid phases, the light source experiences reflection at the interface, generating regions with notable grayscale changes. These corner points predominantly manifest at the interface between the gas and liquid phases, with their grayscale variations directly indicating the flow state of the two phases. Furthermore, there exists a specific correlation between the distribution of corner points and the reflection pattern of the light source. Through comparative analysis, it was observed that the corner point screening algorithm demonstrates a robust anti-interference capability. It effectively eliminates most corner points in the interference areas while also filtering out some random erroneous corner points in the flow region, thereby ensuring data accuracy and reliability.