Multi-phase flow bubble tracking and speed measuring and calculating method based on improved YOLO11
By improving the YOLO11 network model, the accuracy and real-time issues of multiphase flow bubble detection and tracking are solved, and the automatic identification and velocity measurement of bubbles are realized. It is suitable for multiphase flow systems in chemical, energy and other fields.
Patent Information
- Application Number
- CN202511094002.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-08-06
AI Technical Summary
Existing technologies for bubble detection and tracking in multiphase flow systems suffer from insufficient accuracy and poor real-time performance, making it impossible to track bubble trajectories and obtain dynamic parameters. Furthermore, the detection method cannot integrate a graphical interface with real-time calculations, making it difficult to meet the needs of rapid measurement and analysis in industrial sites.
An improved YOLO11 network model is adopted. By replacing PAFPN with BiFPN, the Conv module with MobileNetV4-ConvSmall, the C2PSA module with C2PSA_SEAM, and the downsampling with SCDown, combined with a graphical user interface system, automatic bubble recognition, segmentation and speed measurement are achieved.
The bubble detection accuracy is improved, the automatic detection of multiphase flow bubbles is realized, the manual operation is reduced, the model is lightweight and easy to apply, and the characteristic parameters such as bubble number, position, velocity, and area can be obtained in real time.
Smart Images

Figure CN120599447A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of multiphase flow bubble detection and tracking, and in particular relates to a multiphase flow bubble tracking and velocity measurement method based on improved YOLO11. Background Art
[0002] With the widespread application of multiphase flow systems in chemical, energy, metallurgical, and other fields, bubbles, as key interphase structures in gas-liquid or gas-liquid-solid systems, have a significant impact on the mass and heat transfer efficiency and operational stability of reactors due to their morphology, velocity, and motion trajectory. Traditional bubble detection methods are limited by their accuracy and real-time performance, especially in tracking bubble motion and obtaining its velocity parameters.
[0003] Traditional methods mainly rely on manual observation combined with basic image processing technology: operators need to capture the bubble movement sequence through high-speed camera equipment, then mark the position frame by frame and manually calculate the size and displacement. The processing of a single experimental data takes up to several hours and is prone to subjective errors.
[0004] More critically, the existing technology system suffers from functional fragmentation: detection, tracking, and physical parameter calculation modules are independent of each other. The conversion of pixel coordinates to physical quantities relies on manual calibration, and velocity and area data require secondary processing. This makes it impossible to obtain key parameters such as bubble equivalent diameter distribution and rise velocity spectrum in real time during experiments. These technical bottlenecks hinder the development of application scenarios such as gas-liquid reactor optimization and microfluidic chip design. There is a lack of an integrated solution that combines high-precision segmentation, stable tracking, and real-time physical parameter calculation.
[0005] To this end, an existing patent (patent number CN119274043A) proposes a bubble detection and counting method based on an improved YOLOv8. By improving the target detection network, this method achieves a relatively lightweight bubble recognition model, which improves the detection accuracy and speed in static images to a certain extent. However, this method still has the following shortcomings: First, it only supports static bubble detection and counting, and cannot track bubble trajectories or obtain dynamic parameters such as their movement speed. Second, it only uses a rectangular frame method for detection, which does not achieve accurate mask-level segmentation and is difficult to handle complex scenes with overlapping bubbles or blurred edges. Third, it does not integrate a graphical interface and real-time computing capabilities, making it difficult to directly apply to the rapid measurement and analysis needs of industrial sites.
[0006] In response to the above shortcomings, this application proposes a multiphase flow bubble tracking and velocity measurement method based on improved YOLO11. Summary of the Invention
[0007] The present invention proposes a multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 to solve the problems existing in the above-mentioned prior art.
[0008] To achieve the above objectives, the present invention provides a multiphase flow bubble tracking and velocity measurement method based on an improved YOLO11, comprising the following steps:
[0009] Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset includes a gas-liquid-solid three-phase flow bubble image;
[0010] Dividing the multiphase flow bubble image dataset into a training set and a validation set;
[0011] YOLO11 is improved to obtain an improved YOLO11 network model, and a multiphase flow bubble segmentation model based on the improved YOLO11 is obtained;
[0012] Inputting the training set into the multiphase flow bubble segmentation model for training to obtain an optimal segmentation model;
[0013] The performance of the model is evaluated using a validation set. Once the accuracy requirements are met, the optimal segmentation model is used to perform bubble segmentation, tracking, and velocity measurement on actual images.
[0014] Optionally, the improvement of YOLO11 includes:
[0015] Replace the PAFPN network of YOLO11 with a bidirectional feature pyramid network and reconstruct the feature fusion network;
[0016] Replace the standard Conv module in the YOLO11 feature extraction network with the MobileNetV4-ConvSmall lightweight convolution module;
[0017] The C2PSA module in the YOLO11 feature extraction network is replaced by the C2PSA_SEAM fusion attention module, which integrates the spatial and channel dual attention mechanisms.
[0018] The SCDown spatial compression downsampling module is introduced into the feature pyramid downsampling path to replace the standard convolution downsampling operation.
[0019] Optionally, the working method of the MobileNetV4-ConvSmall module includes: performing a normal convolution and a downsampling operation with a step size of 2 on the input image information, extracting preliminary features, and then applying the Depthwise convolution of MobileNetV4-ConvSmall to enhance feature extraction; concat the original downsampling result and the depth convolution enhancement result according to the channel dimension; and performing a Channel Shuffle operation on the spliced features.
[0020] Optionally, the working method of the C2PSA_SEAM module includes: performing channel segmentation on the input high-dimensional feature map and dividing it into multiple branch paths; in each branch, using convolution operations of different scales to extract multi-scale semantic information; introducing a separable attention module in some branches to jointly model the spatial area and channel weights; concat splicing the processing results of multiple paths and fusing them into an enhanced feature map; finally, adjusting the channel dimension through point-by-point convolution, and outputting a feature map that includes global perception capabilities and fine-grained response.
[0021] Optionally, the working method of the SCDown module includes: first adjusting the channel dimension of the input feature map by point-by-point convolution to decouple spatial and channel information; performing depth convolution on the adjusted feature map to achieve downsampling operation in the spatial dimension; combining point-by-point convolution with depth-by-depth convolution to perform downsampling while performing spatial-channel decoupling.
[0022] Optionally, the method for obtaining a multiphase flow bubble image dataset includes:
[0023] Use IPE-multiphase flow measuring instrument to capture gas-liquid-solid three-phase flow bubble images;
[0024] The edges of the bubbles in the three-phase flow bubble image are drawn using a polygon tool, and the bubble category names are labeled. The annotation file corresponding to the generated image is converted into a txt file in YOLO format.
[0025] Optionally, the method is implemented through a graphical user interface system, which includes a model loading module, an image import module, a parameter configuration module, a result visualization module and a data export module; the optimal model is loaded through the model loading module; the image sequence to be processed is imported through the image import module; the conversion ratio between pixels and physical dimensions, the inter-frame time step, the detection confidence, the edge threshold and the trajectory length parameters are set through the parameter configuration module; the bubble segmentation and tracking progress are viewed through the result visualization module; and the recognition result export path is set through the data export module.
[0026] Optionally, the result visualization module includes: performing target detection and instance segmentation on each frame of the image, and outputting detection results including masks, bounding boxes, numbers and confidence levels; associating bubbles between frames through a multi-target tracking algorithm to generate uniquely numbered bubble trajectories; calculating the instantaneous speed and average speed of the bubbles based on the changes in bubble positions in consecutive frames and the set proportional coefficient and time interval; calculating the area and equivalent diameter of each bubble based on the mask area; exporting the image sequence with detection information as a visual video result, and exporting the frame-level analysis parameters of each bubble as a CSV format data file.
[0027] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method.
[0028] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method when executed by a processor.
[0029] Compared with the prior art, the present invention has the following advantages and technical effects:
[0030] This paper provides a method for tracking and velocity estimation of multiphase flow bubbles based on an improved YOLO11 algorithm. The improved network model uses a lightweight backbone network module, MobileNetV4-ConvSmall, to reduce the model's computational complexity and parameter count. The weighted bidirectional feature fusion module, BiFPN, enables efficient information interaction and enhancement between feature maps of different scales, improving the model's ability to detect bubbles of varying sizes. The C2PSA_SEAM module integrates cross-path convolution with a coordinate attention mechanism within high-order semantic features, further enhancing the model's ability to perceive bubble boundaries and morphology. The spatial-channel decoupled downsampling module, SCDown, replaces traditional standard convolutional downsampling, reducing FLOPs and memory access overhead while preserving critical spatial information.
[0031] The improved YOLO11 network model was trained on a dataset of mask-annotated multiphase flow bubble images. The trained segmentation model was then used to perform frame-by-frame recognition and mask extraction on the image sequence. The embedded BoT-SORT multi-target tracking algorithm was used to consistently number the bubbles and calculate their velocity based on the displacement between consecutive frames. Finally, characteristic parameters such as the number, position, velocity, area, and equivalent diameter of the bubbles were output, enabling automatic recognition, segmentation, and velocity measurement of multiphase flow bubbles.
[0032] Compared with existing methods, the improved model has high bubble detection accuracy, is lighter and easier to apply, realizes the automated detection of multiphase flow bubbles, and reduces the need for manual operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0034] Figure 1 Schematic diagram of the optimal bubble segmentation model structure according to an embodiment of the present invention;
[0035] Figure 2Schematic diagram of the structure of a PAFPN network according to an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of the structure of the BiFPN network according to an embodiment of the present invention;
[0037] Figure 4 Schematic diagram of the structure of the SEAM fusion attention module according to an embodiment of the present invention;
[0038] Figure 5 Schematic diagram of the structure of the SCDown spatial compression downsampling module according to an embodiment of the present invention;
[0039] Figure 6 This is a core workflow diagram of a multiphase flow bubble identification and velocity measurement system based on a graphical user interface according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0041] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] like Figure 1 As shown, this embodiment provides a multiphase flow bubble tracking and velocity measurement method based on improved YOLO11, including the following steps:
[0043] Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset includes a gas-liquid-solid three-phase flow bubble image;
[0044] Dividing the multiphase flow bubble image dataset into a training set and a validation set;
[0045] YOLO11 is improved to obtain an improved YOLO11 network model, and a multiphase flow bubble segmentation model based on the improved YOLO11 is obtained;
[0046] Inputting the training set into the multiphase flow bubble segmentation model for training to obtain an optimal segmentation model;
[0047] The performance of the model is evaluated using a validation set. Once the accuracy requirements are met, the optimal segmentation model is used to perform bubble segmentation, tracking, and velocity measurement on actual images.
[0048] The specific implementation methods are as follows:
[0049] S1. Obtain a multiphase flow bubble image dataset.
[0050] Specifically, step S1 includes S11-S12:
[0051] S11. In this embodiment, an IPE-multiphase flow measuring instrument is used to collect gas-liquid-solid three-phase flow bubble images to form a multiphase flow bubble image dataset; there are 5,000 gas-liquid-solid three-phase flow bubble images, and the image resolution is 632×508.
[0052] S12. In this embodiment, the X-AnyLabeling open source tool is used to label each bubble image. The edges of the bubbles in the bubble image are depicted with a polygon tool, and then the category name of the bubble is marked. The annotation file corresponding to the image generated after annotation is converted into a txt file in YOLO format.
[0053] S2. The multiphase flow bubble image dataset obtained in step S1 is randomly divided into a training set and a validation set according to a certain ratio.
[0054] In this embodiment, the dataset in S1 is randomly divided into a training set and a validation set in a ratio of 7:3. The training set is used to train the model, the validation set is used to evaluate the model performance to adjust the hyperparameters, and the test set is used to finally evaluate the model performance.
[0055] Optionally, the training set data is augmented using the Mosaic data augmentation strategy to increase data diversity and enhance the generalization ability of the model.
[0056] S3. Improve the YOLO11 network to obtain an improved YOLO11 network model, as follows:
[0057] The improved solution reduces the model size, parameters and computational complexity while maintaining real-time performance through the collaborative improvement of lightweight Backbone (MobileNetV4-ConvSmall) + enhanced feature pyramid (BiFPN+SCDown) + multi-scale attention (C2PSA_SEAM). The specific structure of the improved YOLO11 network model is as follows: Figure 1 As shown in the figure, the original YOLO11 PAFPN network is replaced with a bidirectional feature pyramid network (BiFPN), and the feature fusion network is reconstructed. The standard Conv module in the original YOLO11 feature extraction network is replaced with a MobileNetV4-ConvSmall lightweight convolution module. The C2PSA module in the original feature fusion network is replaced with a C2PSA_SEAM fusion attention module, integrating spatial and channel dual attention mechanisms. The SCDown spatial compression downsampling module is introduced in the feature pyramid downsampling path to replace the standard convolution downsampling operation.
[0058] In this embodiment, the feature extraction module extracts deep and shallow semantic information from the input image. The efficiency and expressiveness of feature extraction directly impact the accuracy and speed of downstream detection and segmentation. The standard convolutional (Standard Conv) module in the original YOLO11 feature extraction network is replaced with the lightweight MobileNetV4-ConvSmall module. This module utilizes a stacked inverted bottleneck structure and depthwise separable convolution (DWConv) to compress model parameters using a width compression factor, supplemented by lightweight channel attention to enhance the expressiveness of intermediate features. Compared to the standard convolutional architecture in the original YOLO11, this module significantly reduces computational overhead and memory access frequency while maintaining representational power. Next, the C2PSA module used for high-level semantic enhancement in the original YOLO11 is replaced with the C2PSA_SEAM module. Building on the original cross-path fusion architecture, C2PSA_SEAM introduces a joint modeling mechanism of spatial attention and channel attention, enabling more precise enhancement of bubble edges and weakly featured objects. The function of the feature fusion module is to integrate and enhance feature maps of different scales so that the model has the ability to detect both small and large targets. The PAFPN structure used in the original YOLO11 is replaced with the weighted bidirectional feature pyramid structure BiFPN. BiFPN fuses the upsampling and downsampling paths, optimizes information transfer between multiple scales, reduces feature redundancy, and can achieve more efficient high-level semantic aggregation with a lower number of parameters, which helps to extract fine boundaries of complex bubble areas in segmentation tasks. The downsampling operation in the feature pyramid structure was originally implemented using standard convolution, which has a large amount of calculation and is prone to losing edge information. In this embodiment, the standard downsampling structure in the original YOLO11 is replaced with the SCDown module. The SCDown module first uses point-by-point convolution to compress the channel dimension, and then uses depthwise convolution to downsample the spatial dimension, while reducing FLOPs while retaining position information to the maximum extent, and enhancing the model's adaptability to changes in spatial structure.
[0059] Specifically, step S3 includes S31-S34:
[0060] S31. The working method of the MobileNetV4-ConvSmall module includes: performing a normal convolution (Conv) and a downsampling operation with a step size of 2 on the input image information, extracting preliminary features, and then applying the Depthwise convolution (DWConv) unique to MobileNetV4-ConvSmall to enhance feature extraction; concatenating the original downsampling result and the depth convolution enhancement result according to the channel dimension; and performing a Channel Shuffle operation on the spliced features.
[0061] S32. The BiFPN network includes: when the original input node and the output node are in the same layer, an additional edge is added directly from the original input node to the output node; at the same time, the shallow feature extraction graph is fused, and a node N3 is added on the right side of the P3 node to directly connect to B2.
[0062] In this embodiment, Figure 2 、 Figure 3 As shown in the figure, the improved BiFPN network fuses the B4 and N4 nodes and the B3 and N3 nodes in the original YOLOv11 network model respectively, and also fuses the underlying B2 feature map to achieve high-level feature fusion and model lightweighting.
[0063] S33. The working method of the C2PSA_SEAM module includes: performing channel segmentation on the input high-dimensional feature map and dividing it into multiple branch paths; in each branch, using convolution operations of different scales to extract multi-scale semantic information; introducing SEAM (separable attention module) in some branches to jointly model the spatial area and channel weights; concat splicing the results of multiple path processing and fusing them into an enhanced feature map; finally, adjusting the channel dimension through point-by-point convolution, and outputting a feature map that includes global perception capabilities and fine-grained response.
[0064] like Figure 4 As shown in the figure, the left side shows the overall architecture of SEAM, which includes three CSMM (Channel and Spatial Mixed) modules of different sizes (patch-6, patch-7, and patch-8). The outputs of these modules are average pooled, then subjected to a channel expansion (Channel exp) operation, and finally multiplied to provide an enhanced feature representation. The right side shows the detailed structure of the CSMM module, which utilizes multi-scale features through patches of different sizes and uses depthwise separable convolution to learn the correlation between spatial dimensions and channels. The module includes the following elements:
[0065] (a) Patch Embedding: embeds the input patch; (b) GELU: Gaussian ErrorLinear Unit, an activation function; (c) BatchNorm: batch normalization, used to accelerate the training process and improve performance; (d) Depthwise Convolution: depth-separable convolution, convolution operation is performed on each input channel separately; (e) Pointwise Convolution: point-by-point convolution, which uses a 1x1 convolution kernel to fuse the features of depth-separable convolution.
[0066] This module design aims to enhance the network's attention and ability to capture occluded facial features by carefully processing spatial dimensions and channels. By combining multi-scale features and depth-wise separable convolutions, CSMM improves the accuracy of feature extraction while maintaining computational efficiency.
[0067] S34. The working method of the SCDown module includes: first, adjusting the channel dimension of the input feature map by pointwise convolution (Pointwise Conv), thereby decoupling the spatial and channel information; performing depthwise convolution (Depthwise Convolution) on the adjusted feature map to achieve downsampling operation of the spatial dimension; combining the above operations to complete space-channel decoupling and simultaneous downsampling.
[0068] like Figure 5 As shown in the figure, the SCDown module first uses a 1×1 pointwise convolution to adjust the channel dimension of the input feature map, thereby decoupling spatial and channel information and reducing the channel dimension before downsampling. Next, a 3×3 depthwise convolution is performed on the adjusted feature map to achieve spatial downsampling. Combining these operations, we achieve spatial-channel decoupled downsampling (Spatial-Channel Decoupled Downsampling), which replaces traditional standard convolutional downsampling, improving feature retention and reducing FLOPs.
[0069] Compared with standard convolution downsampling, the SCDown module effectively reduces the amount of computation through the two-step operation of "point-by-point convolution + depth-wise convolution". The number of parameters is:
[0070] ;
[0071] ;
[0072] Total parameters: ;
[0073] The amount of calculation is:
[0074] ;
[0075] ;
[0076] Total computational effort: .
[0077] S4. Input the training set described in step S1 into the multiphase flow bubble segmentation model based on the improved YOLO11 in step S3 for training to obtain a trained optimal weight file, thereby obtaining an optimal bubble segmentation model, which is specifically as follows:
[0078] In this embodiment, the experiment was conducted in a hardware and software environment with an Intel(R) Core(TM) i7-13700K CPU @3.40 GHz, an NVIDIA GeForce RTX 4090 (24GB) GPU, 32GB of RAM, CUDA 12.1, Python 3.10.14, and a Windows 11 operating system. In step S12, the training set is input into the multiphase flow bubble segmentation model for forward propagation, and the loss between the predicted results and the true labels is calculated. The model parameters are gradient-calculated and weights are updated based on a backpropagation algorithm. The cross-entropy loss function is used as the optimization objective, and the model is iteratively trained for multiple rounds using a stochastic gradient descent (SGD) optimizer. When the training error of the model converges or reaches a preset performance indicator, the model is determined to be the optimal bubble segmentation model.
[0079] All improved methods based on step S2 can be applied to any model size of YOLO11. In the embodiment of the present invention, YOLO11s is used as the training model, the initial learning rate is set to 0.01, the batch size is set to 16, and the number of iterations is 150. The optimal network model weight file is obtained through multiple rounds of iterative training, thereby obtaining the optimal bubble segmentation model.
[0080] S5. Input the validation set described in step S1 into the optimal bubble segmentation model trained in step S4 to evaluate the performance of the model.
[0081] Specifically, step S5 includes:
[0082] The validation set is input into the trained improved network model and the performance of the model is evaluated according to the trained optimal weight file to obtain indicators such as the accuracy of the model in bubble recognition, the calculation amount of the model, and the size of the parameters.
[0083] In this embodiment, the performance evaluation indicators include performing a performance evaluation on the tested target network model through preset performance evaluation indicators, wherein the performance evaluation indicators include accuracy P (Precision), recall R (Recall), average accuracy AP (Average Precision), model parameters (Parameters), model computation amount (FLOPs), and model size (Model size).
[0084] Precision is defined as: ;
[0085] Recall is defined as: ;
[0086] The average accuracy is defined as: ;
[0087] The definition of model parameters is: ;
[0088] The definition of model computation is: ;
[0089] Model inference speed is defined as the number of image frames processed by the model in one second.
[0090] In the above formula, TP is true positive, that is, positive samples are correctly identified as positive samples; FN is false negative, that is, positive samples are mistakenly identified as negative samples; TN is true negative, that is, negative samples are correctly identified as negative samples; FP is false positive, that is, negative samples are mistakenly identified as positive samples. in Indicates the number of channels of each convolution kernel, which is also the number of channels of the input feature map; c out Represents the number of channels of the output feature map; K is the size of the convolution kernel; W, H are the width and height of the output feature map.
[0091] In order to test the performance improvement of the method of the embodiment of the present invention for the segmentation of multiphase flow bubbles, the corresponding relevant indicators are calculated for the existing detection model and the improved network model of the embodiment of the present invention. The comparison results of the relevant indicators between the existing technology and the method of the embodiment of the present invention are shown in Table 1.
[0092] Table 1
[0093] method AP@0.5 Parameters(M) FLOPs(G) Weight size(MB) Faster-RCNN 0.855 41.348 79.4 316 YOLOv8s 0.970 11.79 42.7 22.7 YOLO11s 0.974 10.01 35.6 19.5 Improve the YOLO11 model 0.970 6.26 27.5 12.4
[0094] As shown in Table 1, the improved YOLO11 model achieves higher bubble recognition accuracy than the Faster-RCNN algorithm, while maintaining similar accuracy to other YOLO algorithms, enabling more accurate bubble detection and location. The improved YOLO11 model minimizes the number of parameters, computational complexity, and model size, making it easier to deploy and apply on devices. The method presented in this embodiment is more feasible and superior than existing technologies.
[0095] S6. The multiphase flow bubble segmentation model based on the improved YOLO11 trained in step S5 is used for the segmentation, tracking and velocity measurement of multiphase flow bubbles.
[0096] In this embodiment, a system for implementing a multiphase flow bubble identification and velocity measurement method based on a graphical user interface is provided. The workflow is as follows: Figure 6As shown in the figure, combined with the trained improved YOLO11 model, it realizes automatic recognition, instance segmentation, tracking, and motion parameter calculation of bubbles in image sequences. This system includes a model and image input module, a parameter configuration module, a segmentation detection and tracking module, a bubble activation and exit judgment mechanism, a bubble velocity calculation module, a mask area and equivalent diameter calculation module, and a visualization and export module.
[0097] Specifically, step S6 includes S61-S67:
[0098] S61. The working method of the model and image input module includes: the user imports the optimal bubble segmentation model after training and optimization through the model loading module in the GUI system, and the model is an instance segmentation model obtained by training based on the improved YOLO11 network; through the image input module, a group of image frame sequences named in chronological order are imported, and the images should be frame-by-frame image data collected by multiphase flow experiments or industrial visualization systems.
[0099] S62. The working method of the parameter configuration module includes: a user setting the following key parameters through the interface: pixel-to-physical size ratio (scale), in millimeters / pixel, used to convert pixel coordinates to actual physical displacement; time step (Δt), representing the sampling interval between image frames, in seconds; detection confidence threshold (confidence), used to filter low-confidence detection results; maximum trajectory length (max_len), used to limit the tracking path cache; edge exit delay frame number (exit_delay), used to control the buffer determination when the target leaves the screen.
[0100] S63. The segmentation detection and tracking module operates by calling the model.track() method based on the Ultralytics YOLO framework to perform segmentation detection on each frame and using the BoT-SORT tracking algorithm to consistently associate bubble targets across frames. Outputs include: instance mask; bounding box (bbox); target ID (track_id); category and confidence score. The mask area is used for subsequent area and diameter calculations; the target ID is used for tracking path management.
[0101] S64. The working method of the bubble activation and exit judgment mechanism includes: the system determines whether the bubble enters the central area of the field of view by setting the image edge safety boundary: if the center of the bubble enters the safety area, it is activated as a "valid target" and begins to record the trajectory; if the center of the bubble is located in the edge buffer for multiple consecutive frames, exceeding the exit delay frame number, the system considers that the bubble has exited the screen and no longer records the speed and position.
[0102] S65. The working method of the bubble velocity calculation module includes: during the trajectory update process of each target bubble, the system calculates the physical displacement between the current frame and the previous frame, and calculates the velocity based on the time step. The specific formula is as follows:
[0103] Spatial displacement calculation:
[0104] Assume that the coordinates of the bubble center of the t-th frame and the t-1-th frame are (x t ,y t ) and (x t-1 ,y t-1 ), the pixel-millimeter conversion factor is s (mm / pixel), then the displacement is:
[0105] ;
[0106] Instantaneous speed calculation:
[0107] Assuming the time interval is Δt, the instantaneous speed is:
[0108] (Unit: mm / s).
[0109] The system saves the speed values within a certain window length and calculates the sliding average speed.
[0110] S66. The working method of the mask area and equivalent diameter calculation module includes: using the segmentation mask output by the model, the system can calculate the pixel area of each bubble in the image, convert it into physical area, and estimate the equivalent diameter. The specific formula is as follows:
[0111] Area calculation formula:
[0112] Assume the number of pixels in the mask is , the pixel area corresponds to the ratio s 2 (mm² / px²), then:
[0113] (Unit: mm²).
[0114] Equivalent diameter estimation:
[0115] Considering the bubble as approximately circular, the equivalent diameter is:
[0116] (Unit: mm).
[0117] S67. The working method of the visualization and export module includes:
[0118] When processing each frame of the image, the system superimposes the detection bounding box, mask outline, target number, speed value and trajectory line on the original image and displays it in real time through the GUI.
[0119] At the same time, the system writes all frame image processing results into a video file (.mp4) and exports the structured data into a .csv table. The table content includes: frame number; bubble ID; center coordinates (x, y); area (mm²); equivalent diameter (mm); instantaneous speed (mm / s); and average speed (mm / s).
[0120] It can be seen from the above embodiments that the present invention discloses a method for multiphase flow bubble recognition, segmentation and velocity measurement based on improved YOLO11, comprising: obtaining a multiphase flow bubble image dataset and dividing it into a training set, a validation set and a prediction set; replacing the PAFPN structure in the original YOLO11 with a weighted bidirectional feature pyramid network (BiFPN) to achieve efficient multi-scale feature fusion, replacing the original Conv module with a lightweight convolution module MobileNetV4-ConvSmall to reduce the amount of model calculation, replacing the original C2PSA module with a C2PSA_SEAM module that integrates spatial and channel attention mechanisms to enhance feature representation capabilities, and replacing the standard downsampling convolution with an SCDown module to improve the efficiency of spatial information retention; the improved YOLO11 The network is trained, and the model parameters are optimized by back-propagation using the cross-entropy loss function and the SGD optimizer to obtain the optimal bubble segmentation model through training. At the system level, the present invention combines the graphical user interface platform to load the trained .pt model into the GUI system, integrating model calling, image input, parameter configuration, real-time visualization, video output and data export modules. Based on the detection of bubble masks, the system has a built-in multi-target tracking mechanism to track the position changes of bubbles between frames, and automatically calculates the instantaneous velocity and average velocity of bubbles based on the pixel-physical ratio and time step, and estimates the equivalent diameter in combination with the mask area. Finally, the recognition results are output in the form of visual images and structured CSV tables, realizing automatic recognition, continuous tracking, precise segmentation and motion measurement of multiphase flow bubbles.
[0121] While maintaining high detection accuracy, the present invention significantly reduces the number of model parameters and calculation complexity, achieving the goals of strong real-time performance, high measurement accuracy and wide adaptability.
[0122] The above are merely preferred embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A multiphase flow bubble tracking and velocity estimation method based on improved YOLO11, characterized in that: The following steps are involved: Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset is a gas-liquid-solid three-phase flow bubble image; Dividing the multiphase flow bubble image dataset into a training set and a validation set; YOLO11 is improved to obtain an improved YOLO11 network model, and a multiphase flow bubble segmentation model based on the improved YOLO11 is obtained; Inputting the training set into the multiphase flow bubble segmentation model for training to obtain an optimal segmentation model; The performance of the model is evaluated using a validation set. Once the accuracy requirements are met, the optimal segmentation model is used to perform bubble segmentation, tracking, and velocity measurement on actual images.
2. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 1 is characterized in that: The improvements to YOLO11 include: Replace the PAFPN network of YOLO11 with a bidirectional feature pyramid network and reconstruct the feature fusion network; Replace the standard Conv module in the YOLO11 feature extraction network with the MobileNetV4-ConvSmall lightweight convolution module; The C2PSA module in the YOLO11 feature extraction network is replaced by the C2PSA_SEAM fusion attention module, which integrates the spatial and channel dual attention mechanisms. The SCDown spatial compression downsampling module is introduced into the feature pyramid downsampling path to replace the standard convolution downsampling operation.
3. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 2 is characterized in that: The working method of the MobileNetV4-ConvSmall module includes: performing a normal convolution and a downsampling operation with a stride of 2 on the input image information, extracting preliminary features, and then applying the Depthwise convolution of MobileNetV4-ConvSmall to enhance feature extraction; concatenating the original downsampling result and the depth convolution enhancement result according to the channel dimension; and performing a Channel Shuffle operation on the spliced features.
4. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 2 is characterized in that: The working method of the C2PSA_SEAM module includes: channel segmentation of the input high-dimensional feature map into multiple branch paths; in each branch, using convolution operations of different scales to extract multi-scale semantic information; introducing a separable attention module in some branches to jointly model the spatial area and channel weights; concatenating the results of multiple path processing to fuse them into an enhanced feature map; finally, adjusting the channel dimension through point-by-point convolution, and outputting a feature map that contains global perception capabilities and fine-grained response.
5. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 2 is characterized in that: The working method of the SCDown spatial compression downsampling module includes: first, for the input feature map, using point-by-point convolution to adjust the channel dimension, thereby decoupling spatial and channel information; performing depth-wise convolution on the adjusted feature map to achieve downsampling operation in the spatial dimension; combining point-by-point convolution with depth-wise convolution to perform space-channel decoupling and simultaneous downsampling.
6. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 1 is characterized in that: The method for obtaining a multiphase flow bubble image dataset comprises: Use IPE-multiphase flow measuring instrument to capture gas-liquid-solid three-phase flow bubble images; The edges of the bubbles in the three-phase flow bubble image are drawn using a polygon tool, and the bubble category names are labeled. The annotation file corresponding to the generated image is converted into a txt file in YOLO format.
7. The multiphase flow bubble tracking and velocity measurement method based on improved YOLO11 according to claim 1 is characterized in that: The method is implemented through a graphical user interface system, which includes a model loading module, an image import module, a parameter configuration module, a result visualization module and a data export module; the optimal model is loaded through the model loading module; the image sequence to be processed is imported through the image import module; the pixel-to-physical size conversion ratio, inter-frame time step, detection confidence, edge threshold and trajectory length parameters are set through the parameter configuration module; the bubble segmentation and tracking progress are viewed through the result visualization module; and the recognition result export path is set through the data export module.
8. The multiphase flow bubble tracking and velocity estimation method based on improved YOLO11 according to claim 7 is characterized in that: The result visualization module includes: performing target detection and instance segmentation on each frame of the image, and outputting detection results including masks, bounding boxes, numbers, and confidence levels; correlating bubbles between frames using a multi-target tracking algorithm to generate uniquely numbered bubble trajectories; calculating the instantaneous and average speeds of the bubbles based on the changes in bubble positions in consecutive frames and the set proportional coefficient and time interval; calculating the area and equivalent diameter of each bubble based on the mask area; exporting the image sequence with detection information as a visual video result, and exporting the frame-level analysis parameters of each bubble as a CSV format data file.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Water surface target detection algorithm based on improved YOLO V5
CN116912694A
Method for identifying and counting multiphase flow bubbles based on improved YOLOv8
CN119274043A
Cited By
Bubble detection, tracking and parameter quantification method and device based on improved YOLOv8
CN121884078A