A Deep Learning-Based Method for Image-Based Velocimetry of Cavitation Flow Synchrotron Radiation Particles
By employing a deep learning-based approach, utilizing synchrotron X-ray imaging technology and an improved YOLOv5 target detection model, the challenge of detecting tracer particles in cavitation flow fields was solved, achieving efficient and accurate cavitation flow field measurement.
Patent Information
- Application Number
- CN202510178035.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-02-18
AI Technical Summary
Traditional laser PIV technology cannot accurately measure the flow field information in the cavitation core region, and traditional target detection algorithms have difficulty accurately identifying and detecting overlapping small-scale tracer particles in complex backgrounds.
An improved YOLOv5 target detection model was built using a deep learning-based approach and synchrotron X-ray imaging technology. The model was trained using a CBAM attention mechanism and a diffusion model, and the model was trained on a simulation dataset to achieve accurate localization of tracer particles and calculation of their velocity fields.
It improves the detection accuracy and efficiency of tracer particles in cavitation flow fields, can accurately identify overlapping particles in complex backgrounds, and generate high-quality cavitation velocity field data.
Smart Images

Figure CN120014245B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of gas-liquid two-phase flow measurement technology, and specifically relates to a deep learning-based method for synchrotron radiation particle image velocimetry in cavitation flow. Background Technology
[0002] Particle image velocimetry (PIV) is a primary method for measuring velocity fields in single-phase flow by recording and analyzing the motion of tracer particles in a fluid. However, in cavitation flow, the strong scattering and reflection of laser light by the vapor-liquid mixture can mask the relatively weak scattered light from surrounding tracer particles, thus affecting particle imaging quality. This overexposure of cavitation structures can be used to avoid the impact on PIV measurement accuracy using fluorescent particles. However, in the cavitation core region, numerous cavitation bubbles exist between the laser sheet and the camera, completely blocking the light emitted from the fluorescent particles. Therefore, traditional laser PIV technology cannot accurately measure the flow field information in opaque cavitation core regions.
[0003] Compared to traditional laser technology, synchrotron X-rays, with their high frequency, extremely short pulses, high brightness, high collimation, and good coherence, have driven the development of fast X-ray phase-contrast imaging (PVI). This technology successfully solves the problem of visualizing tracer particles in the cavitation core region using ordinary optical PVI methods. However, due to the imaging principle of synchrotron X-rays, the signal-to-noise ratio between tracer particles and the liquid background is low, and the presence of cavitation bubbles poses a challenge to the particle image matching process. Traditional PVI cross-correlation algorithms cannot be directly applied to velocity field calculations. To obtain the velocity field in X-ray particle images, the primary task is to accurately detect and extract tracer particles from the image. However, limited by the line-of-sight imaging method, cavitation X-ray images often exhibit a large number of tracer particles overlapping with bubbles and themselves, significantly increasing the complexity of particle detection. Traditional target detection algorithms rely on manually designed features, resulting in poor adaptability, low efficiency, and limited accuracy, making it difficult to cope with complex scenes and real-time requirements. How to accurately identify and detect overlapping small-scale circular tracer particles in complex backgrounds has become an urgent problem to be solved. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a deep learning-based method for cavitation flow synchrotron radiation particle image velocimetry.
[0005] The present invention achieves the above-mentioned technical objectives through the following technical means.
[0006] A deep learning-based image velocimetry method for cavitation flow synchrotron radiation particles includes:
[0007] Using synchrotron radiation pulsed X-ray rapid imaging technology, high spatiotemporal resolution cavitation X-ray images containing tracer particles were captured.
[0008] A neural network structure for the YOLOv5 object detection model was constructed, and a small object detection module and a CBAM attention mechanism module were added to obtain the improved YOLOv5 object detection model.
[0009] The cavitation X-ray image was preprocessed using a diffusion model, and the preprocessed image was divided into four equal parts.
[0010] The improved YOLOv5 object detection model was trained using the dataset;
[0011] The trained YOLOv5 target detection model is used to predict the tracer particles in the segmented cavitation X-ray image, extract the gray values inside the particles, and generate cavitation tracer particle images.
[0012] The instantaneous velocity vector field of the cavitation flow field is calculated by applying a cross-correlation analysis algorithm to the generated cavitation tracer particle images.
[0013] Furthermore, the tracer particles are on the order of 10 μm.
[0014] Furthermore, the YOLOv5 object detection model includes a backbone network, a multi-scale feature fusion module, and a detection head; the backbone network is composed of convolutional layers and extracts high-level semantic features from the input image; the multi-scale feature fusion module performs upsampling, downsampling, and feature fusion operations on feature maps at different levels in the backbone network; and the detection head processes the fused feature maps.
[0015] Furthermore, the formation process of the small target detection module is as follows: by upsampling the feature maps of each level in the backbone network to expand the feature map size, and then fusing the expanded feature map with the feature map of the corresponding level, and then connecting it to the YOLOv5 target detection model network through downsampling.
[0016] Furthermore, the CBAM attention mechanism module is a module that integrates the channel attention map M in the YOLOv5 object detection model. c Spatial attention map M s Attention map obtained by element-wise multiplication.
[0017] Furthermore, the diffusion model learns the deep features of cavitation X-ray images, distinguishes between the background and the target object, removes noise and enhances the target contour, and increases the image resolution.
[0018] Furthermore, the dataset is an artificially generated dataset of simulated cavitation particle images that has similar characteristics to cavitation X-ray images.
[0019] Furthermore, the training process of the improved YOLOv5 object detection model is as follows:
[0020] First, define the range of values for the hyperparameters, including the learning rate, batch size, and anchor box aspect ratio;
[0021] Secondly, select evaluation metrics, use the intersection-union ratio (IOU) between the predicted bounding box and the actual bounding box to judge the detection results, and calculate the accuracy p and recall r given the IOU threshold;
[0022] Finally, Bayesian optimization is used to obtain the optimal combination of hyperparameters, and the model parameters are trained using the dataset to obtain a model for predicting tracer particles.
[0023] Furthermore, the cavitation tracer particle image pair consists of two consecutive frames of cavitation tracer particle images.
[0024] Furthermore, the cross-correlation analysis algorithm is a 4-channel diagnostic algorithm with window offset, and the size of the diagnostic window is gradually reduced in each channel.
[0025] The beneficial effects of this invention are:
[0026] (1) The method of the present invention uses high-energy synchrotron radiation X-rays for imaging, which can overcome the limitation of traditional laser PIV technology in that the tracer particles are blocked in the cavitation region.
[0027] (2) The method of the present invention uses artificially generated simulated cavitation particle images with particle position parameter labels as the dataset for model training, which can reduce the cost required for manually labeling experimental images.
[0028] (3) The deep learning-based target detection algorithm in the method of the present invention solves the detection problems such as a large number of tracer particles, small size, large overlap between particles and some particles being blocked by bubbles. The trained tracer particle target detection model can accurately identify particle position, calculate displacement and generate cavitation velocity field data, thereby greatly improving the analysis efficiency. It is particularly suitable for experimental environments that require processing a large amount of data. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the implementation steps of the present invention;
[0030] Figure 2(a) is the first frame of the X-ray image pair of the cavitation flow field taken by the synchrotron radiation experiment described in the embodiment;
[0031] Figure 2(b) is the second frame of the X-ray image pair of the cavitation flow field taken by the synchrotron radiation experiment described in the embodiment;
[0032] Figure 3 This is a schematic diagram of the network structure of the target detection model used in the embodiment;
[0033] Figure 4The image provided is an example of the dataset generated in this embodiment;
[0034] Figure 5(a) shows the results of particle position detection in the embodiment;
[0035] Figure 5(b) shows the cavitation tracer particle image generated based on particle position detection in the embodiment;
[0036] Figure 6 The instantaneous velocity vector field of cavitation calculated in the example is shown. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but the scope of protection of the present invention is not limited thereto.
[0038] Example: This invention provides a deep learning-based method for cavitation flow synchrotron radiation particle image velocimetry. Figure 1 The flowchart of the present invention includes the following steps:
[0039] Step 1: Tracer particles on the order of 10 μm were added to the cavitation water tunnel, stirred thoroughly, and parameters such as flow rate and pressure were adjusted to induce typical cavitation phenomena in the throat region of the Venturi-type experimental section of the water tunnel. The cavitation flow was imaged and measured using third-generation high-energy synchrotron radiation pulsed X-rays, and high spatiotemporal resolution cavitation X-ray images containing the tracer particles were captured using a high-speed camera. Figures 2(a) and 2(b) show two consecutive frames of cavitation X-ray images captured by the synchrotron radiation experiment, with a time interval Δt = 3.68 μs between the two images. The resolution of the cavitation X-ray images was 704 × 688 pixels, where 1 pixel corresponds to 2 μm.
[0040] In the cavitation X-ray image, the tracer particles appear as regular circles with a diameter between 4 and 13 pixels, while circles or irregular outlines with deviated sizes are identified as cavitation bubbles. The tracer particles in the cavitation X-ray image are characterized by a large number of small particles, significant overlap between particles, and some particles being obscured by cavitation bubbles.
[0041] Step 2: Build the YOLOv5 object detection model network structure within the PyTorch deep learning framework. The YOLOv5 object detection model consists of a backbone network, a multi-scale feature fusion module (Neck), and a detection head. The backbone network comprises a series of convolutional layers used to extract high-level semantic features from the input image. The multi-scale feature fusion module performs upsampling, downsampling, and feature fusion operations on feature maps at different levels in the backbone network to obtain multi-scale feature information. The detection head processes the fused feature map to predict the target's category, location information, and confidence score.
[0042] In this embodiment, the YOLOv5 target detection model is improved based on the characteristics of tracer particles in the cavitation X-ray image described in step one. Specifically, a small target detection module and a CBAM attention mechanism module are added to the original model. The network structure of the improved model is as follows: Figure 3 As shown.
[0043] The small target detection module is specifically designed for small target detection. It works by upsampling the feature maps at each level of the backbone network to enlarge the feature map size, fusing the enlarged feature maps with the feature maps of the corresponding levels, and then downsampling and connecting them to the YOLOv5 target detection model network. This module can further improve the detection accuracy of small targets.
[0044] The CBAM attention mechanism module is derived by using the channel attention map M in the YOLOv5 object detection model. c Spatial attention map M s The attention map is obtained through element-wise multiplication. The CBAM attention mechanism module, introduced into the downsampling stage of feature extraction, effectively suppresses background noise and interference from objects unrelated to the target, helping the model to more accurately focus on key features. The CBAM attention mechanism module is also added before each detection head layer, enhancing the expressive power of target-related features and reducing subsequent computational complexity.
[0045] Step 3: Super-resolution preprocessing is performed on the cavitation X-ray image using a diffusion model. This diffusion model does not simply interpolate and enlarge the cavitation X-ray image; instead, it learns deep image features to effectively distinguish the background from the target object, remove noise, enhance target contours, and increase image resolution. This step improves target recognition and thus enhances the accuracy of target detection. In this embodiment, the resolution of the cavitation X-ray image is doubled to 1408×1376 pixels. The super-resolution preprocessed image is divided into four equal parts to reduce the number of targets to be detected in a single image.
[0046] Step 4: Artificially generate a dataset of simulated cavitation particle images with similar characteristics to cavitation X-ray images, along with corresponding particle position parameter labels, for neural network training. The generation process for each data item in the dataset is as follows: Manually select some tracer particle samples from the experimental images after super-resolution preprocessing in Step 3 to construct a baseline particle library; generate a complex background image similar to the experimental images using the CV2 library; randomly select particle samples from the baseline particle library, copy them to random positions in the background image, and record the position parameters as labels; scale the particle samples before copying to ensure that the particle size exhibits a normal distribution within a predetermined range; the final simulated cavitation particle image is shown below. Figure 4As shown. In this embodiment, the constructed dataset contains 5000 images and corresponding labels, which are divided into training set, validation set and test set in a ratio of 5:3:2.
[0047] Step 5: Train the improved YOLOv5 object detection model parameters using the dataset generated in Step 4. The specific steps are as follows:
[0048] (5.1) Define the range of values for hyperparameters such as learning rate, batch size, and anchor box aspect ratio;
[0049] (5.2) Select an evaluation metric, using the intersection-union ratio (IOU) between the predicted bounding box and the actual bounding box to determine the correctness of the detection result. The calculation formula is as follows:
[0050] IOU=(Intersection Area) / (Union Area)
[0051] Wherein, Intersection Area represents the area of the overlap between the predicted bounding box and the ground truth bounding box, and Union Area represents the total area covered by the predicted bounding box and the ground truth bounding box. In this embodiment, the intersection-union ratio (IU) threshold is set to 0.5, and the accuracy (p) and recall (r) are calculated using the following formulas:
[0052]
[0053] Among them, T P F represents the number of correctly detected positive samples. N F represents the number of positive samples that were incorrectly predicted as negative samples. P This indicates the number of negative samples that were incorrectly predicted as positive samples.
[0054] (5.3) The optimal hyperparameter combination is obtained by Bayesian optimization. The model is trained using the simulated cavitation particle image dataset generated in step four to obtain the parameters, thereby obtaining a model that can be used for tracer particle prediction.
[0055] Step 6: Use the YOLOv5 target detection model trained in Step 5 to predict the tracer particles in the cavitation X-ray image segmented in Step 3, as shown in Figure 5(a). Save the internal grayscale values of the tracer particles within the prediction box in the cavitation X-ray image, remove the background, and merge the four equal parts of the image to obtain a complete cavitation tracer particle image with a pure black background, as shown in Figure 5(b).
[0056] Step 7: Apply a cross-correlation analysis algorithm to the two consecutive cavitation tracer particle images obtained in Step 6 to calculate the transient velocity vector field of the cavitation flow field. In this embodiment, the cross-correlation analysis algorithm is a 4-channel diagnostic algorithm with window offset, and the size of the diagnostic window is gradually reduced in each channel. During the diagnostic process, the maximum window size is set to 80×70 pixels to limit the number of particles lost within the window; the minimum window size is 50×40 pixels to ensure that the number of matched particle pairs within the window is greater than 4. The calculated transient velocity vector field of cavitation is as follows: Figure 6 As shown.
[0057] The embodiments described above are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Any obvious improvements, substitutions or modifications that can be made by those skilled in the art without departing from the essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A deep learning-based method for cavitation flow synchrotron radiation particle image velocimetry, characterized in that: Using synchrotron radiation pulsed X-ray rapid imaging technology, high spatiotemporal resolution cavitation X-ray images containing tracer particles were captured. A neural network structure for the YOLOv5 object detection model was constructed, and a small object detection module and a CBAM attention mechanism module were added to obtain the improved YOLOv5 object detection model. The cavitation X-ray image was preprocessed using a diffusion model, and the preprocessed image was divided into four equal parts. The improved YOLOv5 object detection model was trained using the dataset; The trained YOLOv5 target detection model is used to predict the tracer particles in the segmented cavitation X-ray image, extract the gray values inside the particles, and generate cavitation tracer particle images. The instantaneous velocity vector field of the cavitation flow field is calculated by applying a cross-correlation analysis algorithm to the generated cavitation tracer particle images.
2. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The tracer particles are on the order of 10 μm.
3. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The YOLOv5 object detection model includes a backbone network, a multi-scale feature fusion module, and a detection head. The backbone network consists of convolutional layers and extracts high-level semantic features from the input image. The multi-scale feature fusion module performs upsampling, downsampling, and feature fusion operations on feature maps at different levels in the backbone network. The detection head processes the fused feature maps.
4. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 3, characterized in that, The formation process of the small target detection module is as follows: the feature map size is enlarged by upsampling the feature map of each level in the backbone network, and the enlarged feature map is fused with the feature map of the corresponding level. Then, it is connected to the YOLOv5 target detection model network by downsampling.
5. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 3, characterized in that, The CBAM attention mechanism module is the channel attention map M in the YOLOv5 object detection model. c Spatial attention map M s Attention map obtained by element-wise multiplication.
6. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The diffusion model learns the deep features of cavitation X-ray images, distinguishes between background and target objects, removes noise and enhances target contours, and increases image resolution.
7. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The dataset is an artificially generated dataset of simulated cavitation particle images that has similar characteristics to cavitation X-ray images.
8. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 7, characterized in that, The training process of the improved YOLOv5 object detection model is as follows: First, define the range of values for the hyperparameters, including the learning rate, batch size, and anchor box aspect ratio; Secondly, select evaluation metrics, use the intersection-union ratio (IOU) between the predicted bounding box and the actual bounding box to judge the detection results, and calculate the accuracy p and recall r given the IOU threshold; Finally, Bayesian optimization is used to obtain the optimal combination of hyperparameters, and the model parameters are trained using the dataset to obtain a model for predicting tracer particles.
9. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The cavitation tracer particle image pair consists of two consecutive frames of cavitation tracer particle images.
10. The deep learning-based cavitation flow synchrotron radiation particle image velocimetry method according to claim 1, characterized in that, The cross-correlation analysis algorithm is a 4-channel diagnostic algorithm with window offset, and the size of the diagnostic window is gradually reduced in each channel.
Citation Information
Patent Citations
Particle image velocity measurement method and device based on deep learning
CN113139989A
Infrared weak and small target detection method based on infrared small sample amplification and YOLOv5
CN115861599A