Particle image velocity measurement method with introduction of SimAM module and unsupervised loss
By introducing the SimAM module and the UnRes2RAFT model with an unsupervised loss function, the problems of low accuracy and high annotation cost of the traditional PIV method in complex flow fields are solved, and high-precision optical flow estimation under unsupervised conditions is achieved, which is applicable to a variety of complex flow field environments.
Patent Information
- Application Number
- CN202510841366.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-31
AI Technical Summary
Existing deep learning-based particle image velocimetry methods suffer from low accuracy and poor robustness under conditions of large displacement, small-scale structures, strong shear zones, and complex boundaries. Furthermore, model training requires a large number of manually labeled displacement tags, which is costly and makes them difficult to apply to real-world complex flow field environments.
An UnRes2RAFT model is constructed, and the SimAM module and unsupervised loss function are introduced. Optical flow estimation is performed through a feature extraction network, a full pair correlation layer, a context encoder, and a convolutional gated recurrent unit. The model is trained using photometric consistency, forward and backward consistency, and second-order smoothness loss functions to achieve multi-scale modeling and unsupervised learning.
Without real labels, the UnRes2RAFT model achieves stable and high-accuracy velocity field prediction in complex flow fields, significantly outperforming existing methods. It has stronger generalization and structural modeling capabilities and is applicable to a variety of complex flow field conditions.
Smart Images

Figure CN120876534A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of particle image velocimetry technology, specifically relating to a particle image velocimetry method that incorporates a SimAM module and unsupervised loss. Background Technology
[0002] Particle image velocimetry (PIV) is a non-contact, rapid visualization method for acquiring instantaneous velocity distributions in a flow field, widely used in experimental fluid mechanics research. By analyzing the positions of tracer particles in an image at different times, instantaneous two-dimensional or even three-dimensional velocity fields in the time domain can be obtained. Proposed in the 1980s, the PIV method has evolved from traditional film-based recording to PIV-related optobiomechanics, and further to the development of digital image processing and related analysis techniques, becoming one of the most widely used measurement methods in experimental fluid mechanics.
[0003] Traditional PIV systems typically consist of a dual-pulse laser source, particle tracers, a CCD or CMOS camera, and an image processing system. The main workflow includes particle seeding, laser illumination, image acquisition and spacing control, image registration, and cross-correlation. With the rapid development of digital imaging and computing power, especially the widespread application of high-frame-rate cameras and high-power lasers, as well as advancements in image processing algorithms, PIV technology has seen continuous improvements in spatial resolution, temporal resolution, and throughput. However, traditional PIV algorithms based on cross-correlation still suffer from low accuracy, low spatial resolution, and poor robustness under conditions of large displacements, small-scale structures, strong shearing regions, and complex boundaries.
[0004] With the development of deep learning-based optical flow estimation models, PIV methods based on deep neural networks have become a new research direction. These methods primarily rely on traditional PIV data or simulated flow field data, training the neural network to directly learn the mapping between particle displacements. This significantly improves the accuracy and robustness of velocity field prediction. Compared to traditional methods, they offer faster processing times and better handle challenges such as complex lighting conditions, low-density objects, and abrupt flow changes, providing a new approach for achieving automated, real-time, and high-precision flow field measurements in the future.
[0005] Although the aforementioned deep learning-based PIV methods have achieved excellent results on various datasets, they face two key challenges: First, most methods use conventional convolutional architectures, which are limited by small receptive fields, insufficient local phenotypic modeling capabilities, and difficulty in modeling multi-scale flow field structures, resulting in poor generalization ability and making them difficult to apply to complex real-world flow field environments. Second, model training requires a large number of manually labeled displacement labels, but in real-world experimental environments, obtaining large-scale, high-precision displacement labels is extremely costly, hindering the application of practical algorithms.
[0006] Particle image velocimetry (PIV) is a non-contact, high-speed, full-field visualization measurement technique. It obtains the velocity distribution of the entire flow field within the test area by analyzing instantaneous flow images, thus reflecting the true flow field information. PIV technology has a wide measurement range, applicable to the measurement of average velocity in steady-state flow fields, instantaneous velocity fluctuations in unsteady-state flow fields, single-phase flow, multiphase flow, liquid-liquid systems, and gas-gas systems. Its basic principle is to introduce tracer particles with a density similar to the fluid into the fluid, enabling them to accurately follow the fluid's motion. A laser controller emits pulsed laser light of a certain intensity, which is formed into a light sheet by optical elements and illuminates the plane to be measured in the flow field. After the tracer particles dispersed in the flow field are illuminated, their scattered light is captured by a CCD camera after two exposures. Subsequently, the images are analyzed and correlation calculations are performed using PIV software to obtain the velocity information of the entire flow field.
[0007] Cross-correlation and optical flow are two mainstream traditional methods in PIV (Pulse-Induced Dynamics) techniques. Cross-correlation estimates the fluid displacement field by finding the maximum correlation between local windows in consecutive image pairs. For example, the Window Iterative Deformation and Multigrid (WIDIM) method is a representative example. However, this method typically generates sparse velocity fields, often failing to capture fine flow structures in complex flow fields. Optical flow is represented by the variational optical flow method proposed by Horn and Schunk, which calculates the flow field by solving partial differential equations. This method can generate denser velocity fields, but the computation is more complex and prone to errors in high-gradient regions. The variational optical flow form can be easily combined with prior physical knowledge to adapt to specific problems, thus attracting many experimental fluid mechanics researchers to apply and improve it.
[0008] Complementing the PIV experimental method are a series of traditional modeling tools and numerical techniques for simulation, prediction, and optimization, which play an important role in fluid mechanics research. Many advanced turbulence modeling methods have been proposed in recent years, such as Direct Numerical Simulation (DNS), Large Eddy Simulation (LES), and Reynolds-averaged Navier-Stokes (RANS) models, including K-ω and K-ε models, for studying fluid dynamics and turbulent phenomena. DNS can resolve all turbulence scales with high accuracy, but its computational cost is extremely high, limiting its application to relatively simple flow problems. Summary of the Invention
[0009] This invention focuses on researching high-performance optical flow network structures and unsupervised learning PIV methods for PIV tasks. This research is significant for achieving intelligent, high-precision, and highly robust PIV, and also helps expand the application scope of deep learning in the fluid field, improve the ability to perceive flow fields, and deepen the understanding of flow fields. From a methodological perspective, this research provides exploration and support for constructing a PIV framework with "label-free training + multi-scale modeling" capabilities, laying the foundation for its application under more complex flow field conditions.
[0010] This invention provides a particle image velocimetry method incorporating a SimAM module and unsupervised loss, comprising the following steps:
[0011] An UnRes2RAFT model is constructed. The input to the UnRes2RAFT model is two ordered frames of images containing moving particles, denoted as X1 and X2, respectively. The UnRes2RAFT model includes two feature extraction networks, a full pair correlation layer, a context encoder, and a convolutional gated recurrent unit (Conv-GRU). The feature extraction network includes a feature encoder, unRes2Encoder.
[0012] The two feature extraction networks described above are used to extract the image features of two adjacent particle images respectively. The image features of the two particle images are then input into the full pair correlation layer for multi-scale pyramid stacking processing.
[0013] The context encoder extracts the context features of X1 or X2; the context features and the output obtained by multi-scale pyramid stacking are input into the Convolutional Gated Recurrent Unit (Conv-GRU) module to recursively update the optical flow estimate and obtain the optical flow estimate from X1 to X2; based on one of the two frames, an image warping operation is performed on the optical flow estimate to transform the optical flow estimate to the source frame space to construct a pseudo-reconstructed image;
[0014] The feature encoder unRes2Encoder sequentially includes: convolutional layer 1, RA-Bottle2neck module, RC-Bottle2neck module, RA-Bottle2neck module, RC-Bottle2neck module, RA-Bottle2neck module, and so on.
[0015] Block, RC-Bottle2neck module, convolutional layer 2;
[0016] The RA-Bottle2neck module is a bottleneck structure based on the Bottle2neck architecture with residual learning. It is used for downsampling to preserve multi-scale information. Multi-scale feature processing is introduced in each residual block, dividing the input feature map of the feature extraction network into s subsets, as shown in the following formula. Each subset undergoes convolution operation independently to extract features at several scales, thereby increasing the diversity of the feature space.
[0017]
[0018] For the first subset x i Without performing convolution operations, the original input is directly retained as the output y. i The second subset x2 is processed by a standard 3×3 convolution operation K2(x2) to obtain the output y2. Starting from the third subset x3, the convolution operation not only depends on the input x3, but also combines the output y2 of the previous set, i.e., K3(x3+y2), thus fusing information from different scales layer by layer. The layer-by-layer accumulation and recursive feature extraction method continues until the last subset x2. s The processing is complete;
[0019] The RC-Bottle2neck module is a bottleneck structure based on the Bottle2neck architecture with a global attention mechanism to maintain resolution. The RC-Bottle2neck module adds a SimAM attention mechanism to the RA-Bottle2neck module, which is added after the last layer of the RA-Bottle2neck module.
[0020] Preferably, the particle image velocimetry method incorporating a SimAM module and unsupervised loss further includes the following steps:
[0021] Two adjacent particle images are taken as X1 and X2. X1 and X2 are input into the UnRes2RAFT model in the order of X1 first and X2 last to obtain the optical flow estimate from X1 to X2.
[0022] Based on X1, an image warping operation is performed on the optical flow estimation from X1 to X2 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X2'.
[0023] Input X1 and X2 into the UnRes2RAFT model in the order of X2 first and X1 last to obtain the optical flow estimate from X2 to X1;
[0024] Based on X2, an image warping operation is performed on the optical flow estimation from X2 to X1 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X1'.
[0025] Calculate the photometric consistency loss between X1' and X1, and the photometric consistency loss between X2' and X2;
[0026] Two adjacent particle images are taken as X1 and X2. X1 and X2 are input into the UnRes2RAFT model in the order of X1 first and X2 last to obtain the optical flow estimate from X1 to X2.
[0027] Based on X1, an image warping operation is performed on the optical flow estimates from X1 to X2 to transform the optical flow estimates to the source frame space, thereby constructing a pseudo-reconstructed image X2'. Then, based on the position D1 of any pixel in X1, an image warping operation is performed on the optical flow estimates from X1 to X2 to obtain the position D2 of point X after it has moved according to the optical flow estimates.
[0028] Input X1 and X2 into the UnRes2RAFT model in the order of X2 first and X1 last to obtain the optical flow estimate from X2 to X1;
[0029] Based on X2, an image warping operation is performed on the optical flow estimation from X2 to X1 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X1'.
[0030] Then, based on position D2, estimate the position D1' after the motion according to the optical flow;
[0031] Calculate the consistency loss between D1 and D1';
[0032] Calculate the photometric consistency loss between X1' and X1, and the photometric consistency loss between X2' and X2.
[0033] The UnRes2RAFT model is trained by constructing a total loss based on the aforementioned consistency loss and photometric consistency loss.
[0034] Preferably, the particle image velocimetry method incorporating a SimAM module and unsupervised loss further includes the following steps:
[0035] The photometric consistency loss is constructed based on structural similarity SSIM loss, Census loss, and Charbonnier loss.
[0036] Preferably, the total loss further includes an optical flow smoothness loss constructed using a second-order regularization term based on the image gradient.
[0037] Preferably, a layer-by-layer loss accumulation mechanism is introduced in each iteration of the training, and the loss is weighted and integrated in an exponentially decaying manner to form the following total loss:
[0038]
[0039] in, Let represent the photometric consistency loss, forward and backward consistency loss, and smoothness loss terms for the i-th iteration, respectively, and γ be the decay weighting coefficient.
[0040] Preferably, the AdamW optimizer is used during the training process, with the initial learning rate set to 0.0001, the batch size set to 4, and the total number of training iterations to 500.
[0041] Preferably, the optical flow smoothness loss is expressed as follows:
[0042] The predicted forward optical flow is F f =(μ f ,v f ) T ,
[0043]
[0044] in, The second-order gradient operator for optical flow, i.e., the second derivative of optical flow in the horizontal and vertical directions, is represented by ρ(·), which is still a robust regression function.
[0045] Preferably, the particle image velocimetry method that incorporates the SimAM module and unsupervised loss further includes: training the UnRes2RAFT model using the PIV-Dataset dataset, and inputting two frames of images with particles into the trained UnRes2RAFT model for particle image velocimetry.
[0046] This invention has the following advantages:
[0047] This invention introduces the SimAM attention mechanism and unsupervised loss function design into the original Res2RAFT model, constructing an unsupervised extended model, UnRes2RAFT, with stronger generalization and structural modeling capabilities. In terms of feature extraction, by proposing the RC-Bottle2neck module to replace the original RB-Bottle2neck structure, the encoder possesses more fine-grained saliency modeling capabilities without introducing additional parameters.
[0048] Subsequently, this invention details a combination of unsupervised loss functions comprising photometric consistency, forward and backward consistency, and second-order smoothness, and quantitatively evaluates the model performance on several typical flow fields. Experimental results show that UnRes2RAFT achieves stable and high-accuracy velocity field prediction in multiple complex flow fields without relying on real labels, especially in typical scenarios such as Cylinder, Backstep, DNS Turbulence, and SQG, significantly outperforming the existing unsupervised method UnLiteFlowNet-PIV. Furthermore, it exhibits competitive accuracy compared to some supervised models, further validating the effectiveness and practicality of this model in label-free learning tasks.
[0049] Through the design and experimental analysis of the invention, it can be seen that UnRes2RAFT provides a new approach for achieving efficient, accurate, and label-free data-driven learning in PIV tasks, and provides an important theoretical foundation and technical reference for the subsequent construction of automated PIV measurement systems for real experimental environments. Attached Figure Description
[0050] Figure 1 A comparison of attention mechanism structures across different dimensions;
[0051] Figure 2 The model structure of unRes2Encoder, the feature encoder in the feature extraction network;
[0052] Figure 3 The structure is RC-Bottle2neck.
[0053] Figure 4 The UnRes2RAFT model structure is used.
[0054] Figure 5 The prediction accuracy (AEE) of the UnRes2RAFT model in different flow fields;
[0055] Figure 6 The performance of the UnRes2RAFT model in Backstep and Cylinder flow fields at different Reynolds numbers;
[0056] Figure 7 The results of UnRes2RAFT's backstep flow field prediction at a Reynolds number of 800;
[0057] Figure 8 The results of UnRes2RAFT's backstep flow field prediction at a Reynolds number of 1000 are shown.
[0058] Figure 9 The results of UnRes2RAFT flow field prediction at a Reynolds number of 1200 in Backstep are shown.
[0059] Figure 10 The results of UnRes2RAFT's backstep flow field prediction at a Reynolds number of 1500 are shown.
[0060] Figure 11 The results of UnRes2RAFT flow field predictions in Cylinder at a Reynolds number of 40 are shown.
[0061] Figure 12 The results of UnRes2RAFT flow field prediction at a Reynolds number of 150 are shown.
[0062] Figure 13 The results of UnRes2RAFT flow field predictions at a Reynolds number of 200 in the Cylinder flow field;
[0063] Figure 14 The results of UnRes2RAFT flow field predictions at a Reynolds number of 300 in Cylinder are shown.
[0064] Figure 15 The results of UnRes2RAFT flow field prediction at a Reynolds number of 400 in Cylinder are shown.
[0065] Figure 16 A comparative study of the prediction accuracy of UnRes2RAFT and traditional methods (AEE);
[0066] Figure 17 This study compares and contrasts deep learning methods across different flow field types (including the UnRes2RAFT model). Detailed Implementation
[0067] The particle image velocimetry method incorporating the SimAM module and unsupervised loss includes the following steps:
[0068] Step 1: Prepare the dataset and perform preprocessing
[0069] For the training dataset, the UnRes2RAFT model was trained using five typical flow fields from the PIV-Dataset dataset: Backstep, Cylinder, DNS Turbulence, SQG, and JHTDB Channel. This training dataset is consistent with that of Res2RAFT. The particle image size was 256×256. The AdamW optimizer was used during training, with an initial learning rate of 0.0001, a batch size of 4, and a total of 500 training iterations. The experiments used two NVIDIA RTX 4090 graphics cards for parallel training to ensure the model could complete unsupervised optimization within a reasonable timeframe.
[0070] Step 2: Design of Unsupervised Loss Function
[0071] (2.1) Loss of photometric uniformity
[0072] In unsupervised learning, due to the lack of real velocity label information, the photometric consistency assumption becomes the core principle for establishing supervisory signals. This assumption states that if the predicted optical flow is accurate, then the pixels in the first frame image I1 will be within the range of the optical flow field F when applied. f After the transformation, the second frame image I2 should be able to be accurately reconstructed, and vice versa. Based on this assumption, the model can guide the network for unsupervised training using image reconstruction errors.
[0073] To improve the robustness and accuracy of reconstruction, this paper employs various forms of photometric loss functions and combines them into a composite photometric consistency loss. First, the structural similarity index (SSIM) is used to measure the consistency of image patch structures, defined as follows:
[0074]
[0075] Where I represents the original image frame (e.g., I2), This represents an image reconstructed from another frame (e.g., I1) through optical flow field sampling. For simplicity, the loss is uniformly denoted as... SSIM is typically computed on 3×3 image patches, which can effectively enhance the model's ability to preserve details such as local structures and edges, and improve the model's robustness to changes in illumination and noise interference.
[0076] Secondly, Census loss is introduced to measure the relative order relationship between pixels. Formally, it performs hash encoding and consistency matching on local image patches, exhibiting strong robustness to nonparametric features. Census loss can be approximated by constructing the Hamming distance between image patches.
[0077] Finally, the Charbonnier loss function is used to regress the pixel-level error, defined as:
[0078]
[0079] Where ∈ is a small constant (usually taken as ∈ = 10). -3 This is to avoid gradient discontinuities.
[0080] In summary, this paper combines the above three types of photometric consistency errors into a total photometric loss function:
[0081] L photo =λ1L SSIM +λ2L census +λ3L Charb
[0082] Here, λ1, λ1, λ1 are weighting coefficients used to balance the relative importance of the three losses. During training, photometric losses from both forward and reverse optical flow are applied simultaneously to enhance the symmetry and consistency of the prediction results.
[0083] (2.2) Forward and backward consistency loss
[0084] In unsupervised optical flow estimation tasks, besides relying on image reconstruction errors, the bidirectional consistency between forward and backward optical flow is also an important criterion for evaluating the reasonableness of predictions. Specifically, if the forward optical flow from the first frame I1 to the second frame I2 is F... f =(μ f ,v f ) T The reverse optical flow from I2 to I1 is F. b =(μ b ,v b ) T Then the following bidirectional consistency relationship should be satisfied:
[0085] F f (X)+F b (X+F f (X))≈0
[0086] This relationship indicates that if a light source starts from pixel X, travels to the target position via forward optical flow, and then returns via reverse optical flow, it should return to its original position. Therefore, positions deviating from this loop closure consistency relationship can be considered as indicators of prediction error.
[0087] Based on this, we define the forward and backward consistency loss as:
[0088]
[0089] Where Ω represents all pixel locations on the image, and ρ(·) is a robust regression function (e.g., the Charbonnier function) used to mitigate the impact of abnormal motion on the error.
[0090] Forward and backward consistency loss plays a significant regularization role during training. It not only alleviates the ambiguity of image reconstruction errors in areas with missing textures, but also improves the model's ability to perceive occluded areas. Especially in boundary regions, turbulent transition regions, and high gradient regions, incorporating consistency loss helps capture smoother and more structurally sound velocity fields.
[0091] (2.3) Second-order smoothness regularization term In optical flow estimation, to improve the spatial continuity of the prediction results and alleviate prediction uncertainties in regions lacking background texture, it is usually necessary to impose smoothness constraints on the predicted optical flow field. Traditional methods often use the first-order optical flow gradient as a regularization term. However, under complex flow fields, first-order constraints can easily lead to blurred boundaries or excessive smoothing, making it difficult to accurately preserve local variations. Therefore, a more stable and robust second-order smoothness regularization term is adopted to improve the overall structural rationality and physical continuity of the predicted optical flow field.
[0093] Let the predicted forward optical flow be F. f =(μ f ,v f ) T We introduce the following second-order smoothness regularization term:
[0094]
[0095] in, The second-order gradient operator with respect to the optical flow is ρ(·), which is the second derivative of the optical flow in the horizontal and vertical directions. ρ(·) is still a robust regression function used to reduce the interference of edges and outliers on the loss.
[0096] Compared to the first-order gradient, the second-order gradient is more robust to interference when dealing with regions with sparse textures and drastic changes in particle density. It can more effectively suppress local anomalous disturbances and enhance the coherence of the global flow field structure. In addition, the second-order regularization term can prevent excessive smoothing operations from erasing the true boundary structure, thus achieving structural harmony of the overall flow field while preserving local details.
[0097] (2.4) Final loss function combination form
[0098] To fully leverage the constraining effects of various unsupervised losses, this paper integrates photometric consistency loss, forward and backward consistency loss, and second-order smoothness regularization into a multi-objective optimization framework, and uniformly introduces them into the training process of the UnRes2RAFT model through a weighted strategy. The final unsupervised overall loss function is defined as follows:
[0099] L unsup =λ p ·L photo +λ c ·L consistency +λ s ·L smooth
[0100] Among them, L photo This represents photometric uniformity loss, including a combination of SSIM loss, Census loss, and Charbonnier loss; L consistency L represents the forward and backward consistency loss; smooth This represents the second-order smoothness regularization term. The coefficient λ p , λ c , λ s These are the weight hyperparameters for the three loss terms, used to adjust the contribution of each constraint during the training process.
[0101] The introduction of this joint optimization framework enables the model to maintain consistency in predicted optical flow, boundary clarity, and preservation of local details even under unsupervised training conditions, giving full play to the synergistic effect of various loss functions and providing a solid optimization foundation for subsequent high-precision optical flow estimation.
[0102] Step 3: SimAM Attention Mechanism
[0103] SimAM's attention mechanism proposes a parameter-free, full 3D attention strategy that can directly generate independent weights for feature points at each channel and spatial location, thereby enabling more fine-grained mining of information differences within feature maps. This mechanism is inspired by the neuroscience theory of "spatial suppression," which states that in the visual cortex, neurons have a suppressive effect on the activity of surrounding neurons, manifesting as assigning higher attention to neurons with significant feature responses.
[0104] Specifically, SimAM evaluates the importance of each neuron by minimizing the following energy function:
[0105]
[0106] Where t represents the response value of the target neuron, μ and σ are the mean and variance of all neurons in the same channel except for t, and λ is the adjustment parameter. SimAM posits that if a neuron exhibits significant differentiation from its surrounding neurons, i.e., (t-μ) 2 The larger the value, the greater its importance should be.
[0107] Based on this definition, SimAM ultimately calculates the importance of each neuron as the reciprocal of its energy function:
[0108]
[0109] To limit excessively large attention values and enhance numerical stability, SimAM introduces the sigmoid function for normalization and multiplies it with the original features to achieve enhancement.
[0110]
[0111] Another significant advantage of SimAM is that it does not require the introduction of any additional parameters, thus resulting in extremely high computational efficiency, making it suitable for lightweight network architectures. In multiple experimental tasks (such as CIFAR and ImageNet classification, COCO detection, etc.), SimAM achieved performance comparable to or even better than traditional attention modules (such as SE, CBAM, etc.) without increasing model complexity.
[0112] Figure 1 The weighting principles of three typical attention mechanisms are demonstrated. Among them... Figure 1 (a) in the figure is a channel-wise attention mechanism. After inputting the feature map, the method first compresses the spatial dimension through global average pooling (GAP) to obtain the channel statistics, and then uses a fully connected layer and activation function to generate a weight vector. The weight vector is multiplied to achieve channel-level feature selection.
[0113] Figure 1 (b) in the figure is the spatial-wise attention mechanism. After inputting the feature map, the spatial feature map is obtained by aggregating the channel dimensions (such as average or max pooling). Then, a spatial weight matrix is generated by using convolutional layers and sigmoid. The feature weighting generates a weight map corresponding to the spatial location, which is shared among all channels to enhance or suppress the response of different regions.
[0114] Figure 1(c) in the figure represents the three-dimensional attention mechanism (Full 3-D weights for attention) proposed by SimAM. This mechanism directly generates weight tensors through 3D convolution or branch networks, and multiplies the weights element by element with the input feature map to assign independent weights to each channel at each spatial location in the feature map, thereby achieving fine neuron-level attention modeling and having stronger representation capabilities and structural flexibility.
[0115] Compared to the previous two, SimAM can achieve attention modeling at the three-dimensional granularity without introducing explicit parameters or complex structures. This design allows the model to directly adjust the response intensity using the saliency information of the neurons themselves without explicit channel pooling or spatial weighting, thereby significantly improving the expressive accuracy and local response capability of the attention mechanism while maintaining the lightweight structure.
[0116] In unsupervised PIV tasks, due to the lack of explicit labels, model training relies entirely on the implicit consistency loss between image pairs. Therefore, accurately extracting key flow patterns from noisy features becomes a core challenge in unsupervised modeling. SimAM's neuron-level attention mechanism adaptively emphasizes significantly different and dynamically prominent parts in local regions, improving the ability to perceive subtle flow structures in complex flow fields. This helps improve the stability and prediction accuracy of feature extraction under unsupervised conditions.
[0117] In summary, SimAM provides an efficient, parameter-free, and refined attention mechanism for the UnRes2RAFT model in this study, which is particularly suitable for improving feature representation and context modeling capabilities in unsupervised learning.
[0118] Step 4: Overall Architecture of unRes2Encoder (4.1) Overall Architecture of Res2Encoder
[0119] Res2Encoder is a multi-scale feature encoder we designed for unRes2Encoder. In Res2Encoder, this study designed two key modules: RA-Bottle2neck and RB-Bottle2neck. These two modules together construct Res2Encoder, performing multi-scale feature representation and fusion during feature encoding. This design allows the model to fully utilize features at different scales when processing particle image velocimetry tasks, thus addressing complex motion patterns in different flow field environments.
[0120] In Res2Encoder, the network architecture mainly consists of three layers. First, the network input passes through 7×7 convolutional layers to obtain an initial 64-channel feature map. Then, it passes through three RA-Bottle2Neck and RB-Bottle2Neck modules, and finally, a 1×1 convolution to obtain a 128-channel output feature map. This hierarchical structure uses the RA-Bottle2neck module for downsampling, while the RB-Bottle2neck module is responsible for preserving resolution and introducing a global attention mechanism, resulting in the gradual refinement and enhancement of features.
[0121] (4.2) RA-Bottle2neck Module Design
[0122] In RA-Bottle2Neck, the scale is set to 4 and the baseWidth to 26. The input features are divided into different scales, x1 to x4 in our experiments, and parallel convolution operations are performed on these scales. The outputs of each scale are convolved separately and then fused to form the output features, namely y1 to y4. These features are then aggregated into the main branch. RA-Bottle2Neck reduces the resolution of the input feature map by setting stride=2, while still preserving multi-scale information during downsampling. The core function of this multi-scale convolutional structure is that different convolutional scales can enhance the model's ability to represent features at different scales. This allows the model to capture sufficient local and global information even with reduced resolution.
[0123] Unlike typical residual connections, the RA-Bottle2neck module introduces finer-grained feature segmentation and processing methods. This multi-scale processing allows the model to maximize its ability to capture information at various scales in the input image while maintaining computational efficiency. This is particularly important for particle images, as the flow information often exhibits multiple scale variations, requiring the model to possess strong multi-scale feature extraction capabilities to more accurately predict the flow field.
[0124] (4.3) Overall Architecture of unRes2Encoder
[0125] To better adapt the network structure to the feature modeling requirements of unsupervised training scenarios, this paper designs a novel unRes2Encoder module, which uses an alternating stacked structure of RA-Bottle2neck and RC-Bottle2neck to achieve fine-grained multi-scale modeling and context modeling capabilities.
[0126] The RC-Bottle2neck module effectively reduces model complexity by adding a SimAM module after the last layer of the RA-Bottle2neck module, while maintaining overall structural consistency. This avoids the decline in global attention generalization ability caused by the lack of supervision signals. The SimAM module has the advantages of being parameter-free and requiring no training, making it more suitable for saliency modeling and response enhancement of key regional features in unsupervised learning tasks.
[0127] like Figure 2 As shown, in the overall encoder structure, unRes2Encoder first uses a standard 7×7 convolutional layer to extract basic features, then alternately stacks six layers of RA-Bottle2neck and RC-Bottle2neck modules to fuse multi-scale and contextual semantic information. Finally, a 1×1 convolutional layer unifies the channel dimension, outputting encoded features with a dimension of 128. This structure maintains multi-scale modeling capabilities while improving feature stability and expressive power under unsupervised training.
[0128] (4.4) RC-Bottle2neck Module Design
[0129] The RC-Bottle2neck module is a dedicated module designed for unsupervised scenarios, aiming to better adapt to the needs of lightweight, stable, and feature response capabilities in unsupervised learning scenarios. Its structure is an improvement on RB-Bottle2neck, retaining the basic form of multi-scale grouped convolution, but replacing the original GAM module with the SimAM module in the attention mechanism, thus constructing a feature extraction module more suitable for unlabeled conditions.
[0130] Compared to GAM, which relies on MLP-based learning channels and spatial attention, SimAM uses an energy function to achieve unified modeling of each spatial location and channel dimension. It accurately measures neuron saliency without introducing additional parameters, making it more suitable for unlabeled feature selection tasks. In unsupervised scenarios, models cannot be explicitly constrained by real labels and must rely on pixel consistency between input images and spontaneous alignment of the flow field structure for training. This places higher demands on the adaptability and stability of the attention mechanism. SimAM effectively highlights key regions such as boundary layers and local perturbations in complex flow fields, enhancing its response to weak flow structures. While improving model robustness, it reduces the structural complexity of the attention mechanism, helping to enhance feature perception and prediction performance under unsupervised conditions while maintaining efficiency. Therefore, it is more suitable as the core attention module in RC-Bottle2neck.
[0131] like Figure 3As shown, in the actual design, RC-Bottle2neck first divides the input features into multiple sub-feature groups, which are then processed by convolution and activation before feature fusion. While maintaining multi-scale modeling capabilities, the fusion result is input into the SimAM module to obtain the final enhanced output features. The introduction of SimAM not only reduces the network training parameters but also improves the network's ability to focus on important regions, especially showing stronger response effects in regions such as flow boundaries.
[0132] The introduction of the RC-Bottle2neck module enables unRes2Encoder to have stronger unsupervised feature modeling capabilities and effectively avoids the problem of relying on explicit label guidance in unsupervised training, providing structural guarantees for the deployment and generalization of UnRes2RAFT under real unlabeled conditions.
[0133] Step 5: UnRes2RAFT Network Structure and Training Process
[0134] This section introduces the overall design logic and training process of the UnRes2RAFT network structure within an unsupervised learning framework. It introduces SimAM, an attention mechanism more suitable for unsupervised learning, adjusts the loss function design, and employs bidirectional optical flow prediction and unsupervised training strategies to achieve high-precision particle image velocimetry estimation even in the absence of real labels.
[0135] For the overall framework of UnRes2RAFT, please refer to... Figure 4 As shown, the network mainly consists of five key modules: a shared feature encoder unRes2Encoder extracts pixel features from two frames of particle images; a 4D correlation volume between all pixels is constructed as a full-pair correlation layer; the correlation volume is processed by multi-scale pyramid stacking; context encoders (FeatureEncoder and ContextEncoder) are used to extract context feature information of the first frame image; the context features and the correlation volume are input into the Convolutional Gated Recurrent Unit (Conv-GRU) module to recursively update the optical flow estimation, and finally output the optical flow prediction result of the current frame.
[0136] UnRes2RAFT's feature encoder module adopts a reconstructed unRes2Encoder structure. Through the RC-Bottle2neck module, which is suitable for unsupervised tasks, it improves feature response and context awareness without adding extra parameters, making it more suitable for optical flow estimation tasks in unlabeled scenarios.
[0137] In terms of the training process, UnRes2RAFT employs a bidirectional optical flow estimation mechanism that is symmetrical in both directions, predicting the forward optical flow from the first frame to the second frame and the backward optical flow from the second frame to the first frame, respectively. The two branches share a feature extractor and a context network, and are updated iteratively multiple times using a GRU recursive update module. After outputting the optical flow, the network utilizes an image warping operation to transform the target frame to the source frame space according to the predicted optical flow, thus constructing a pseudo-reconstructed image. The warping operation effectively aligns pixel positions, building pixel-level supervision signals for unsupervised learning.
[0138] During training, UnRes2RAFT constructed three types of unsupervised loss functions and applied them to the forward and backward branches respectively, which were then summed as the total loss: (1) Photometric consistency loss, which measures the pixel reconstruction error between the original image and the distorted image, and is constructed using a combination of robust metrics such as SSIM, Census, and Charbonnier; (2) Forward and backward consistency loss, which enhances the constraint on symmetrical motion structures by comparing the forward and backward optical flow results, thereby improving the geometric consistency of the prediction; (3) Optical flow smoothness loss, which uses a second-order regularization term based on the image gradient to guide the model to generate more continuous and smooth optical flow predictions in sparse texture regions. This loss design combines factors such as brightness information, spatial structure, and motion consistency, enabling the model to accurately model complex flow patterns in particle images under unsupervised conditions, and possessing strong structure preservation and generalization capabilities.
[0139] To balance prediction accuracy and training stability across different scales, this paper further introduces a layer-by-layer loss accumulation mechanism in each iteration, and integrates the results in an exponentially decaying weighted manner to form the final training objective function. In each recursive iteration, the network continuously updates the optical flow estimate based on the previous prediction result and feature information. The intermediate prediction results generated in each iteration are used to calculate the loss function, and participate in the total loss calculation in an exponentially decaying manner. The final training objective function is defined as follows:
[0140]
[0141] in, These represent the photometric consistency loss, forward and backward consistency loss, and smoothness loss terms for the i-th iteration, respectively, with γ being the decay weight coefficient, which is set to 0.8 by default.
[0142] The design concept of this training strategy stems from the strong generalization ability and temporal modeling advantages of the original RAFT model structure. Under the unsupervised framework, through the combination of structural reconstruction and loss function, UnRes2RAFT can learn fine and stable optical flow prediction results without relying on real labels, providing an efficient and accurate particle image velocimetry solution for label-free scenarios in practical engineering and experiments.
[0143] Step 6: Analysis of Algorithm Prediction Results
[0144] (6.1) Analysis of prediction results for various flow field categories
[0145] Comparison of prediction accuracy of UnRes2RAFT model in different flow fields, as follows: Figure 5 As shown, the UnRes2RAFT model exhibits relatively stable prediction performance across different types of flow fields, but there are still some differences in its performance across various flow fields. Specifically, in the Cylinder and Backstep laminar flow scenarios, which are relatively structurally clear and have well-defined boundaries, the AEE values of UnRes2RAFT are 6.7493 and 7.6527, respectively, with the overall error level controlled within a low range. This indicates that the model has good adaptability and learning ability for relatively regular boundary conditions and simple motion patterns. This is consistent with the trend of the Res2RAFT model under supervised conditions, reflecting the effective capture of local texture details by multi-scale feature modeling in the encoder structure and the SimAM attention mechanism.
[0146] (6.2) Analysis of prediction results at different Reynolds numbers
[0147] exist Figure 6 The bar chart shows a comparative analysis of the prediction accuracy of the UnRes2RAFT model under different Reynolds numbers in two typical flow fields: Backstep and Cylinder. The results demonstrate that the model exhibits significant differences under different Reynolds numbers, revealing its adaptability and generalization characteristics to variations in flow field complexity.
[0148] Firstly, in the backstep flow field, the mean endpoint error (AEE) of UnRes2RAFT shows a significant upward trend with increasing Reynolds number. Specifically, under the Re800 condition, the model's AEE is 5.81, the lowest in this series, indicating that the model can capture the main vortex structure and recirculation flow characteristics well under this condition. However, when the Reynolds number increases to Re1000, Re1200, and Re1500, the AEE values rise to 8.08, 7.33, and 7.71, respectively, resulting in a certain degree of decrease in overall accuracy. In particular, the error increases by approximately 39% compared to Re800 at Re1000. This trend suggests that with increasing Reynolds number, the vortex structure density in the backstep flow field increases, boundary layer separation intensifies, and the interaction between recirculation and shear layer becomes more complex, thus increasing the difficulty of modeling detailed flow structures.
[0149] It is worth noting that although the model accuracy decreases at high Reynolds numbers, UnRes2RAFT still maintains relatively stable prediction performance, achieving an AEE value of 7.71 even under the most complex Re1500 flow field. The fluctuation range is controlled within a reasonable range, demonstrating good robustness and generalization ability. This indicates that the proposed network can stably extract key feature information and generate reasonable displacement field prediction results under different scales and degrees of flow field disturbance.
[0150] In contrast, in the Cylinder flow field, the AEE values of the UnRes2RAFT model show relatively small fluctuations across various Reynolds number conditions. As shown in the figure, the prediction error of the model under Re40 to Re400 conditions ranges from 6.41 to 7.48, with a maximum fluctuation of no more than 1.07 and a variation of less than 15%. The lowest AEE value is observed at Re150, at only 6.41, demonstrating very stable prediction performance. This indicates that for relatively regular, well-defined flow fields around a cylinder, even with changes in the wake region and shear layer caused by increasing the Reynolds number, UnRes2RAFT can still accurately capture the main flow pattern, demonstrating a high level of modeling capability for vortex shedding periodic structures.
[0151] Figures 7 to 15This presentation showcases the prediction results of the UnRes2RAFT model for Backstep and Cylinder flow fields under different Reynolds numbers. Each set of figures consists of three parts: the left figure is the Ground Truth Flow plot, representing the velocity vectors in the real flow field, with the arrows indicating the flow direction and length reflecting the velocity magnitude; the middle figure is the Predicted Flow plot, where a color distribution closer to the left figure indicates higher prediction accuracy; and the right figure is the Total Error EPE plot, showing the spatial distribution of the prediction error, where a color closer to white indicates a smaller error, while a darker blue indicates a larger error, reflecting the model's ability to capture complex vortex structures in this region. These figures provide a more intuitive observation of the UnRes2RAFT model's performance under different flow conditions.
[0152] Analysis of comprehensive experimental data shows that UnRes2RAFT exhibits high accuracy and robustness for typical flow fields under low to medium Reynolds number conditions, such as the Re800 Backstep and Re150 Cylinder. While the model's accuracy decreases slightly as the Reynolds number increases and the flow field complexity intensifies, it remains within a reasonable range. This result demonstrates that the UnRes2RAFT model possesses strong multi-scale modeling capabilities and robustness, adapting to local disturbances and structural changes arising from varying flow field complexities, and maintaining stable and reliable prediction performance across different Reynolds number scenarios. This characteristic has significant practical implications for achieving end-to-end unsupervised flow field prediction in real-world engineering or experimental environments.
[0153] Step 7: Comparison with other algorithms
[0154] (7.1) Comparative experiment with other PIV methods
[0155] To further validate the performance of the proposed unsupervised optical flow estimation model, UnRes2RAFT, in velocimetry flow fields based on different types of particle images, this paper selects five typical flow fields—Cylinder, Backstep, DNS-Turbulence, JHTDBChannel, and SQG—as experimental datasets, covering various complex flow structures such as laminar flow, backflow, turbulent flow, and quasi-geostrophic flow. In terms of evaluation metrics, the average endpoint error is used as the primary accuracy metric, measuring the Euclidean distance between the predicted optical flow and the actual displacement field; a smaller value indicates higher prediction accuracy.
[0156] To ensure the comprehensiveness and fairness of the evaluation, the experiment selected two classic traditional algorithms, WIDIM and HS optical flow, and seven mainstream deep learning methods in recent years, including PIV-NetS, LiteFlowNet, and RAFT, for comparison, covering various optical flow estimation paradigms from image registration-based to end-to-end learning. Furthermore, to demonstrate the comparison effect between unsupervised methods, this paper specifically includes the currently mainstream unsupervised learning method UnLiteFlowNet-PIV as an unsupervised baseline model to comprehensively evaluate the actual performance of UnRes2RAFT under unlabeled training conditions.
[0157] Table 1 summarizes the AEE test results of the above methods in five typical flow fields. It shows the performance differences of different methods under complex flow structures and provides a basis for subsequent analysis of model accuracy and generalization ability.
[0158] Table 1 Comparison of prediction accuracy between UnRes2RAFT and various other models in five typical flow fields.
[0159]
[0160]
[0161] (7.2) Comparison with traditional methods
[0162] like Figure 16 As shown, the proposed UnRes2RAFT unsupervised deep optical flow model exhibits certain performance advantages in several typical flow fields. Compared with traditional methods WIDIM and HS optical-flow, UnRes2RAFT achieves better results in both Cylinder and DNS Turbulence flow fields. Specifically, in the Cylinder flow field, UnRes2RAFT's AEE is 6.7493, which is approximately 19.3% and 4.1% lower than WIDIM's 8.3642 and HS's 7.0354, respectively. In the DNS Turbulence scenario, UnRes2RAFT's AEE is 11.7521, which is approximately 58.1% and 5.8% lower than WIDIM's 30.4235 and HS's 13.5321, respectively. This result demonstrates that the model possesses stronger motion feature modeling and displacement field fitting capabilities when dealing with complex structures such as vortices and strongly nonlinear perturbations.
[0163] In other flow fields such as Backstep, JHTDB Channel, and SQG, UnRes2RAFT's accuracy has not yet surpassed traditional methods across the board, performing slightly worse, but overall it remains within an acceptable range. Especially in the SQG category, although the AEE is slightly higher than the HS method (17.3462 vs. 15.7236), it can approach the level of traditional optical flow methods under unsupervised conditions, demonstrating the model's strong generalization ability.
[0164] In summary, UnRes2RAFT can achieve or even surpass the prediction accuracy of traditional methods in some complex flow fields without the need for supervision from real velocity fields. It has certain advantages, especially in dealing with structures such as vortex shedding and unsteady disturbances, demonstrating the feasibility and application potential of unsupervised deep models in scenarios lacking annotations.
[0165] (7.3) Comparison with deep learning methods
[0166] like Figure 17 As shown, UnRes2RAFT demonstrates excellent overall performance in comparison with various mainstream deep learning methods. Despite employing an unsupervised training strategy, its prediction accuracy in several typical flow fields remains comparable to supervised learning methods, and even outperforms them in some flow fields, fully validating the effectiveness and robustness of this method.
[0167] In the Cylinder flow field, although UnRes2RAFT's AEE of 6.7493 is slightly higher than that of the supervised models RAFT (2.5124) and Res2RAFT (2.0758), it is significantly better than deep learning-based supervised methods such as PIV-NetS (7.2479) and PIV-DCNN (7.9035), indicating that the model has robust basic estimation capabilities even in laminar flow scenarios with simple structures and clear boundaries. In the Backstep scenario, UnRes2RAFT's error is 7.6527, which is lower than that of Res2RAFT (2.6437) and RAFT (2.7836), but still better than some supervised methods such as LiteFlowNet (8.4238) and PIV-NetS (5.9765), reflecting the model's strong adaptability in flow separation and reattachment structure recognition.
[0168] In the more challenging DNS turbulence scenario, UnRes2RAFT achieves an AEE of 12.7521, significantly lower than supervised methods such as LiteFlowNet (19.7326), PIV-DCNN (33.5970), and PIV-FlowNetS-en (28.2207), but only slightly higher than RAFT (11.5523). This demonstrates that the proposed method has excellent modeling capabilities in turbulent flows with rich small-scale structures and complex energy distributions. For SQG flow fields, UnRes2RAFT has an error of 17.3462, outperforming most traditional and deep learning methods, exhibiting strong robustness in high-noise environments. In the most complex JHTDB Channel flow field, although UnRes2RAFT's AEE is 22.5018, slightly higher than Res2RAFT (20.4356), it is still better than various supervised methods such as PIV-DCNN (31.8943) and PIV-NetS (15.6324), showing a certain feature generalization ability and stability.
[0169] Compared to existing unsupervised learning methods, UnRes2RAFT demonstrates significant performance advantages in several typical flow fields. Using the current mainstream unsupervised model UnLiteFlowNet-PIV as a reference, in the Cylinder field, UnRes2RAFT's average endpoint error is 6.7493, a reduction of approximately 15.25% compared to UnLiteFlowNet-PIV's 7.9648. Even in flow fields with simple structures, it still demonstrates the stability of its feature extraction and optical flow regression. In the Backstep flow field, UnRes2RAFT's error is 7.6527, significantly better than UnLiteFlowNet-PIV's 10.2679, representing a reduction of 25.45%. This indicates that the model possesses stronger sensitivity and recognition capabilities under complex boundary conditions such as flow separation and reattachment structures.
[0170] In the more complex DNS Turbulence flow field, UnRes2RAFT achieves an AEE of 12.7521, a 6.6% reduction compared to UnLiteFlowNet-PIV's 13.6482, further demonstrating its ability to effectively model small-scale energy structures and complex vorticity field characteristics even under unlabeled supervision. In the SQG scenario with strong noise and high nonlinearity, UnRes2RAFT's error is 17.3462, outperforming UnLiteFlowNet-PIV's 19.7285, representing a 12.09% reduction. Although UnRes2RAFT exhibits a higher error in the JHTDB Channel flow field, overall, it consistently outperforms mainstream unsupervised methods in four out of five typical flow field tasks.
[0171] It is important to note that UnRes2RAFT does not rely on any real velocity field labels. Essentially, it learns high-quality optical flow estimation results through the synergistic effect of an unsupervised loss function and structural design. Compared to existing unsupervised models, such as the mainstream UnLiteFlowNet-PIV model, UnRes2RAFT achieves an overall accuracy improvement of over 10% in several key flow fields, demonstrating better performance under label-free training conditions. This validates the research value of unsupervised PIV models.
Claims
1. A particle image velocimetry method incorporating a SimAM module and unsupervised loss, characterized in that, Includes the following steps: An UnRes2RAFT model is constructed. The input to the UnRes2RAFT model is two ordered frames of images containing moving particles, denoted as X1 and X2, respectively. The UnRes2RAFT model includes two feature extraction networks, a full pair correlation layer, a context encoder, and a convolutional gated recurrent unit (Conv-GRU). The feature extraction network includes a feature encoder, unRes2Encoder. The two feature extraction networks described above are used to extract the image features of two adjacent particle images respectively. The image features of the two particle images are then input into the pairwise correlation layer for multi-scale pyramid stacking processing. The context encoder extracts the context features of X1 or X2; the context features and the output obtained by multi-scale pyramid stacking are input into the Convolutional Gated Recurrent Unit (Conv-GRU) module to recursively update the optical flow estimate, thus obtaining the optical flow estimate from X1 to X2; based on one of the two images, an image warping operation is performed on the optical flow estimate to transform the optical flow estimate to the source frame space, so as to construct a pseudo-reconstructed image; The feature encoder unRes2Encoder includes, in sequence: convolutional layer one, RA-Bottle2neck module, ... RC-Bottle2neck module, RA-Bottle2neck module, RC-Bottle2neck module, RA-Bottle2neck Module, RC-Bottle2neck module, convolutional layer 2; The RA-Bottle2neck module is a bottleneck structure based on Bottle2neck architecture with residual learning. The structure is used for downsampling to preserve multi-scale information, and multi-scale feature processing is introduced into each residual block. The input feature map of the feature extraction network is divided into s subsets, as shown in the following formula, where each subset is unique. Convolution operations are performed to extract features at several scales, thereby increasing the diversity of the feature space: For the first subset x i Without performing convolution operations, the original input is directly retained as the output y. i ;second The subset x2 is processed by a standard 3×3 convolution operation K2(x2) to obtain the output y2; From the third child Starting with set x3, the convolution operation not only depends on this set of inputs x3, but also combines the output y2 of the previous set, i.e., K3(x3+y2), thus fusing information from different scales layer by layer; layer-by-layer accumulation and recursive feature extraction methods The equation continues until the last subset x is reached. s The processing is complete; The RC-Bottle2neck module is a bottleneck structure based on the Bottle2neck architecture with a global attention mechanism to maintain resolution. The RC-Bottle2neck module adds a SimAM attention mechanism to the RA-Bottle2neck module, which is added after the last layer of the RA-Bottle2neck module.
2. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 1, characterized in that, It also includes the following steps: Two adjacent particle images are taken as X1 and X2. X1 and X2 are input into the UnRes2RAFT model in the order of X1 first and X2 last to obtain the optical flow estimate from X1 to X2. Based on X1, an image warping operation is performed on the optical flow estimation from X1 to X2 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X2'. Input X1 and X2 into the UnRes2RAFT model in the order of X2 first and X1 last to obtain the optical flow estimate from X2 to X1; Based on X2, an image warping operation is performed on the optical flow estimation from X2 to X1 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X1'. Calculate the photometric consistency loss between X1' and X1, and the photometric consistency loss between X2' and X2; Two adjacent particle images are taken as X1 and X2. X1 and X2 are input into the UnRes2RAFT model in the order of X1 first and X2 last to obtain the optical flow estimate from X1 to X2. Based on X1, an image warping operation is performed on the optical flow estimates from X1 to X2 to transform the optical flow estimates to the source frame space, thereby constructing a pseudo-reconstructed image X2'. Then, based on the position D1 of any pixel in X1, an image warping operation is performed on the optical flow estimates from X1 to X2 to obtain the position D2 of point X after it has moved according to the optical flow estimates. Input X1 and X2 into the UnRes2RAFT model in the order of X2 first and X1 last to obtain the optical flow estimate from X2 to X1; Based on X2, an image warping operation is performed on the optical flow estimation from X2 to X1 to transform the optical flow estimation to the source frame space in order to construct the pseudo-reconstructed image X1'. Then, based on position D2, estimate the position D1' after the motion according to the optical flow; Calculate the consistency loss between D1 and D1'; Calculate the photometric consistency loss between X1' and X1, and the photometric consistency loss between X2' and X2; The UnRes2RAFT model is trained by constructing a total loss based on the aforementioned consistency loss and photometric consistency loss.
3. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 2, characterized in that, It also includes the following steps: The photometric consistency loss is constructed based on structural similarity SSIM loss, Census loss, and Charbonnier loss.
4. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 2, characterized in that, The total loss also includes optical flow smoothness loss constructed using a second-order regularization term based on image gradients.
5. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 3, characterized in that, In each iteration of the training, a layer-by-layer loss accumulation mechanism is introduced, and the loss is weighted and integrated in an exponentially decaying manner to form the following total loss: in, Let represent the photometric consistency loss, forward and backward consistency loss, and smoothness loss terms for the i-th iteration, respectively, and γ be the decay weighting coefficient.
6. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 3, characterized in that, The training process uses the AdamW optimizer, with an initial learning rate of 0.0001, a batch size of 4, and a total of 500 training iterations.
7. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 4, characterized in that, The optical flow smoothness loss is expressed as follows: The predicted forward optical flow is F f =(μ f ,v f ) T , in, The second-order gradient operator for optical flow, i.e., the second derivative of optical flow in the horizontal and vertical directions, is represented by ρ(·), which is still a robust regression function.
8. The particle image velocimetry method incorporating a SimAM module and unsupervised loss as described in claim 1, characterized in that, Also includes: The UnRes2RAFT model was trained using the PIV-Dataset dataset, and two frames of images with particles were input into the trained UnRes2RAFT model for particle image velocimetry.