# FTGM: Fast Transformer-Based Global Matching for Particle Image Velocimetry
## 4 Experiments
### Qualitative Evaluations  
We present the visualization of the estimated flow to clearly illustrate the improved performance of FTGM. For images larger than input size 256 \(\times\) 256 pixels, we divide the images into patches of 256 \(\times\) 256 pixels with a shift of 32 pixels. To cover all valid pixels, we use the reflect method for necessary edge padding during the patching process. After all patches have been predicted, they are unfolded back into the input image resolution. Figure 3 presents several test cases from PIV Dataset I along with corresponding flow estimations of FTGM and RAFT256-PIV. In the cylinder case, it is observed that RAFT256-PIV has a stronger capability for capturing the edge details of flow-field structures compared to our method. However, in test samples such as SQG, JHTDB, and DNS turbulence, our method demonstrates smaller prediction errors, with this contrast being significant. We also validate PIV algorithms using actual vortex pair images, with a size of 512 \(\times\) 480 pixels. Figure 4 presents the estimated flows from different methods, where the background color indicates the magnitude of the flow field and the arrows represent the direction of velocity. It is evident that the listed algorithms are capable of accurately measuring both the magnitude and structure of the flow field. Figure 4 displays the result from PIVLab using an ensemble multipass FFT window deformation method [32] followed by bicubic interpolation to restore the original image resolution, which serves as the reference benchmark. The FTGM method exhibits anomalous value blocks locally, primarily due to low particle density in those areas, which prevents accurate estimation results. The RAFT256-PIV estimated flow demonstrates a certain global smoothing effect, which leads to irregularities in the nozzle edge structures. However, the estimated flow magnitude of RAFT256-PIV in the center of the vortex pair is lower than that estimated by traditional algorithms. Figure 5 presents the Karman vortex street test image, sourced from PIVLab, with a size of 1024 \(\times\) 765 pixels, and illustrates the comparative visualization of estimated flows from the RAFT256-PIV and FTGM methods. The reference results were obtained using the ensemble multipass FFT window deformation method in PIVLab and subsequently upsampled using bicubic interpolation. The flow estimated by the FTGM exhibits fully defined and clear structures. The absence of structure in the lower right corner of the flow field is primarily due to insufficient information at that location in the original image, which prevents accurate estimation. The flow estimated by RAFT256-PIV has numerous high estimates in the edge of the image and generates excessive details in the obstacle area, leading to an inability to discern the local structures of the flow field. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Methods** & **Backstep** & **Cylinder** & **DNS Turbulence** & **JHTDB** & **SQG** & **High-Displacement** \\ \hline RAFT256-PIV [26] & 5.7 & 6.51 & 19.9 & 25.4 & 30.3 & 35.41 \\ \hline FTGM-PIV & 1.55 & 3.54 & 13.7 & 11.6 & 20.63 & 34.39 \\ FTGM-PIV-Ref & **1.40*** & **2.81** & **8.58** & **7.04** & **12.47** & **19.32** \\ \hline \hline \end{tabular}  
* All methods listed are trained and tested based on PIV Dataset II. The error unit is set to pixels per 100 pixels for easier comparison. The best results are highlighted in bold. For these metrics, lower is better.  
\end{table} 
Table 3: Average endpoint error for all test cases of PIV Dataset III. Figure 3: Visual comparisons of PIV Dataset I test set. For each test case, we provided the ground truth and RAFT256-PIV and FTGM-PIV estimated flow and displayed the average endpoint error (AEE) distribution plot for each estimated flow. For ease of comparison, the AEE is set to 100 pixels per unit. On the cylinder case, our method is close to RAFT256-PIV, and on the other test cases, our method outperforms the RAFT256-PIV model, with this comparison being significant.