A method for identifying and counting bubbles in multiphase flow based on improved YOLOv8

By improving the YOLOv8 network model, BiFPN, GSConv, VoVGSCSPC and PConv modules were introduced, and counting modules were added, which solved the problems of poor bubble detection robustness and high computing resource consumption in the prior art, and achieved high-precision and low-computation bubble recognition and counting effects.

CN119274043BActive Publication Date: 2025-02-28GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411794659.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-02-28
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The prior art has problems such as poor robustness, high computing resource consumption and difficult to meet the real-time requirements in bubble detection of gas-liquid two-phase flows and gas-liquid solid three-phase flows.

Method used

The YOLOv8 network model is improved, and by introducing weighted bidirectional feature pyramid network BiFPN, GSConv module, VoVGSCSPC module and PConv module, the model's parameter quantity and calculation complexity are reduced, while the counting module is added to realize bubble identification and counting.

Benefits of technology

High-precision bubble detection is achieved, with the bubble detection accuracy reaching 0.981, the model parameter quantity and calculation quantity are reduced, and the inference speed is improved, which is suitable for automated detection of multiphase flow bubbles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying and counting multiphase flow bubbles based on improved YOLOv8, comprising the following steps: obtaining a multiphase flow bubble image data set; dividing the multiphase flow bubble image data set into a training set and a verification set; improving YOLOv8 to obtain an improved YOLOv8 network model, and adding a counting module in the improved YOLOv8 network model to obtain a multiphase flow bubble identification and counting model based on improved YOLOv8; training through the training set to obtain an optimal bubble identification and counting model; performing performance evaluation on the optimal bubble identification and counting model through the verification set, and when the performance evaluation passes, identifying and counting multiphase flow bubbles through the optimal bubble identification and counting model. The present invention can achieve a bubble detection effect with high calculation accuracy and high speed while greatly reducing the amount of model parameters and the amount of calculation, and is more convenient for equipment deployment and application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of multiphase flow bubble detection, and in particular relates to a multiphase flow bubble recognition and counting method based on improved YOLOv8. Background Art

[0002] Multiphase flow technology is widely used in various industrial fields such as chemical industry, energy, aerospace, petroleum, metallurgy, etc. The dynamic behavior of bubbles in gas-liquid two-phase flow and gas-liquid-solid three-phase flow affects the contact area between phases and the mass and heat transfer efficiency between phases, thereby affecting the reaction rate. Therefore, the accurate detection of bubble flow parameters helps to deeply understand the flow conditions of multiphase flow, which has important theoretical significance and practical value for establishing multiphase flow theory and guiding the design and scale-up of reactors.

[0003] Bubble detection methods can be divided into invasive and non-invasive methods. Both invasive and non-invasive methods include signal analysis of the collected data and visualization through image processing. They have the defects of low detection efficiency and large errors, and have certain requirements on the professionalism of the detection personnel. It is difficult to achieve real-time measurement and visualization of multiphase flow dynamic parameters. Deep learning can be used efficiently for image processing and has developed rapidly in recent years. At present, target detection algorithms based on deep learning have been used for bubble image detection in the field of gas-liquid two-phase flow. Representative ones include single-stage target detection technology: YOLO; dual-stage target detection technology: Faster RCNN. Existing target detection algorithms have problems such as poor robustness, high consumption of computing resources, and difficulty in meeting real-time requirements in actual bubble detection applications. Therefore, improving the accuracy and efficiency of bubble recognition and lightweighting the algorithm have become key issues to be solved. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a method for identifying and counting multiphase flow bubbles based on improved YOLOv8 to solve the problems existing in the above-mentioned prior art.

[0005] To achieve the above object, the present invention provides a method for identifying and counting multiphase flow bubbles based on improved YOLOv8, comprising the following steps:

[0006] Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset includes a gas-liquid two-phase flow bubble image and a gas-liquid-solid three-phase flow bubble image;

[0007] Dividing the multiphase flow bubble image dataset into a training set and a validation set;

[0008] An improved YOLOv8 network model is obtained by improving YOLOv8, and a counting module is added to the improved YOLOv8 network model to obtain a multiphase flow bubble recognition and counting model based on the improved YOLOv8;

[0009] Inputting the training set into the multiphase flow bubble recognition and counting model for training to obtain an optimal bubble recognition and counting model;

[0010] The performance of the optimal bubble recognition and counting model is evaluated through the verification set, and when the performance evaluation is passed, the multiphase flow bubbles are recognized and counted through the optimal bubble recognition and counting model.

[0011] Preferably, the method for improving YOLOv8 includes:

[0012] Replace the PAFPN network of YOLOv8 with the BiFPN network to obtain the feature fusion module;

[0013] Replace the Conv module in the YOLOv8 feature extraction and fusion network with the GSConv module;

[0014] Replace the C2f module in the YOLOv8 feature extraction and fusion network with the VoVGSCSPC module;

[0015] The PConv module is introduced into the detection network of YOLOv8 to obtain an improved detection head module.

[0016] Preferably, the structure of 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 be directly connected to B2.

[0017] Preferably, the working method of the GSConv module includes: performing an ordinary Conv downsampling on the input image information, using DWConv deep convolution to enhance the image information after downsampling, concatenating the image information obtained by ordinary Conv downsampling with the image information enhanced by DWConv deep convolution in a Concat manner, and performing a shuffle operation on the spliced ​​image information.

[0018] Preferably, the working method of the VoVGSCSPC module includes: the input image information is subjected to Conv and GSBottlneckC operations respectively in sequence through the Conv module and the GSBottlneckC module, and at the same time, the input image information is subjected to a parallel Conv operation, and then the two parts of the output image information are spliced ​​in a Concat manner, and finally a Conv operation is performed; wherein the GSBottlneckC module includes two GSConv modules and one parallel DWConv module.

[0019] Preferably, the working method of the PConv module includes: applying a Conv to part A of the input channel to extract spatial features, and retaining the remaining channel part B; then applying a convolution operation to part A, and then concatenating the result of the convolution operation with the part of the channel B that has not been convolved to obtain the final output.

[0020] Preferably, the method for acquiring a multiphase flow bubble image dataset comprises:

[0021] Use IPE-multiphase flow measuring instrument to capture gas-liquid-solid three-phase flow bubble images and use bubble generation adversarial network BubGAN to synthesize gas-liquid two-phase flow bubble images;

[0022] The bubbles in the three-phase flow bubble image and the two-phase flow bubble image are framed with rectangular frames and the category names of the bubbles are labeled. The annotation files corresponding to the images generated after annotation are converted into txt files in YOLO format.

[0023] Preferably, the method for obtaining the optimal bubble recognition and counting model comprises:

[0024] The training set is input into the multiphase flow bubble recognition and counting model for forward propagation training, and the multiphase flow bubble recognition and counting model is updated and optimized by using a back propagation algorithm; and the improved YOLOv8 network model is iteratively trained multiple times by using a cross entropy loss function and an SGD optimizer until the multiphase flow bubble recognition and counting model converges to obtain an optimal bubble recognition and counting model.

[0025] Preferably, the performance evaluation indicators include the accuracy of bubble recognition, the amount of calculation of the model and the size of the parameters.

[0026] Preferably, the counting method comprises: assigning a unique serial number to the bubble when the bubble is identified, and counting according to the unique serial number.

[0027] Compared with the prior art, the present invention has the following advantages and technical effects:

[0028] The present invention provides a method for identifying and counting multiphase flow bubbles based on improved YOLOv8. In the improved YOLOv8 network model, by introducing a weighted bidirectional feature pyramid network BiFPN, high-level feature fusion is achieved while the model is more lightweight; the YOLOv8 network model is improved by combining the GSConv module and the VoVGSCSPC module, reducing the number of model parameters and computational complexity; the PConv convolution module is introduced to more effectively extract spatial features by reducing redundant calculations and memory accesses at the same time; the improved YOLOv8 network model is trained, and multiphase flow bubbles are identified and counted through the trained network model.

[0029] The improved model has a bubble detection accuracy of 0.981, a model parameter of 0.987M, a model calculation of 2.1G, a model inference speed of 148FPS, and a model weight of 2.23MB. Compared with the existing methods, the improved model has high bubble detection accuracy, a lighter model, and is easier to apply. It realizes the automated detection of multiphase flow bubbles and reduces the need for manual operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0031] Figure 1 It is a schematic diagram of the structure of the optimal bubble recognition and counting model according to an embodiment of the present invention;

[0032] Figure 2 A schematic diagram of the structure of a PAFPN network according to an embodiment of the present invention;

[0033] Figure 3 A schematic diagram of the structure of a BiFPN network according to an embodiment of the present invention;

[0034] Figure 4 Schematic diagram of the structure of the GSConv module of an embodiment of the present invention;

[0035] Figure 5 Schematic diagram of the structure of the VoVGSCSPC module of an embodiment of the present invention;

[0036] Figure 6 Schematic diagram of the structure of the PConv module of an embodiment of the present invention;

[0037] Figure 7 1 is an output diagram of bubble recognition and counting results of an embodiment of the present invention, wherein (a) is a bubble image recognition result of a gas-liquid-solid three-phase flow, and (b) is a bubble image recognition result of a gas-liquid two-phase flow. DETAILED DESCRIPTION

[0038] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present 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.

[0039] 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.

[0040] Embodiment 1

[0041] This embodiment provides a method for identifying and counting multiphase flow bubbles based on improved YOLOv8, including the following steps:

[0042] Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset includes a gas-liquid two-phase flow bubble image and a gas-liquid-solid three-phase flow bubble image;

[0043] Dividing the multiphase flow bubble image dataset into a training set and a validation set;

[0044] An improved YOLOv8 network model is obtained by improving YOLOv8, and a counting module is added to the improved YOLOv8 network model to obtain a multiphase flow bubble recognition and counting model based on the improved YOLOv8;

[0045] Inputting the training set into the multiphase flow bubble recognition and counting model for training to obtain an optimal bubble recognition and counting model;

[0046] The performance of the optimal bubble recognition and counting model is evaluated through the verification set, and when the performance evaluation is passed, the multiphase flow bubbles are recognized and counted through the optimal bubble recognition and counting model.

[0047] The specific implementation methods are as follows:

[0048] S1. Acquire a multiphase flow bubble image dataset: including gas-liquid two-phase flow bubble images and gas-liquid-solid three-phase flow bubble images.

[0049] Specifically, step S1 includes S11-S12:

[0050] S11. In this embodiment, an IPE-multiphase flow measuring instrument is used to collect gas-liquid-solid three-phase flow bubble images, and the BubGAN algorithm is used to synthesize gas-liquid two-phase flow bubble images to form a multiphase flow bubble image data set; there are 3300 gas-liquid-solid three-phase flow bubble images with an image resolution of 1264×1016, and there are 40 gas-liquid two-phase flow bubble images with an image resolution of 600×1200.

[0051] S12. In this embodiment, the X-AnyLabeling open source tool is used to mark each bubble image. The bubbles in the image are framed with a rectangular frame, and then the category name of the bubble is labeled. The annotation file corresponding to the image generated after annotation is converted into a txt file in YOLO format.

[0052] 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.

[0053] In this embodiment, the data set described in S11 is randomly divided into a training set and a validation set in a ratio of 4:1. The training set will be used to train the model, and the validation set will be used to evaluate the accuracy of the model.

[0054] Optionally, perform data augmentation on the training set data using the Mosaic data augmentation strategy to increase data diversity and enhance the generalization ability of the model;

[0055] Optionally, the annotated data set can be divided into a training set, a validation set, and a test set in a ratio of 8:1:1 or 7:2:1 to test the trained model; the data in the test set can be used to detect the difference between the prediction results of the trained model for unknown data and the true labels, thereby visually evaluating the practical application value of the model.

[0056] S3. Improve the YOLOv8 network to obtain an improved YOLOv8 network model, as follows:

[0057] By introducing the weighted bidirectional feature pyramid network BiFPN, combining the GSConv module and the VOVGSCSPC module, and introducing the PConv convolution module to improve the YOLOv8 network model, the improved network model can achieve high bubble recognition accuracy and fast speed while greatly reducing the number of parameters and calculations. The specific structure of the improved YOLOv8 network model is as follows Figure 1 As shown. The BiFPN network replaces the original YOLOv8 path aggregation feature fusion network PAFPN to obtain the target feature fusion network; the GSConv module replaces the Conv module in the original YOLOv8 feature extraction and fusion network; the VoVGSCSPC module replaces the C2f module in the original YOLOv8 feature extraction and fusion network; the PConv module is introduced into the YOLOv8 detection network to obtain an improved detection head module.

[0058] In this embodiment, the function of the feature extraction module is to extract the features of the input image, and the quality of feature extraction affects the accuracy of subsequent network detection. The introduction of the weighted bidirectional feature pyramid network BiFPN can achieve high-level feature fusion and model lightweight. The role of convolution is to extract features from image information and fuse feature maps of different scales. Here, the GSConv module is used to replace the Conv module in the original YOLOv8 feature extraction and fusion network. The learning capabilities of the two modules are similar in the detection stage, and the former consumes less computing resources. Here, the VoVGSCSPC module is used to replace the C2f module in the original YOLOv8 feature extraction and fusion network, which reduces the complexity of calculation and network structure, but maintains sufficient accuracy. The function of the network detection head module is to predict the target area and category based on the features extracted by the network. Here, the PConv convolution module is used to replace the Conv module in the detection head of the original YOLOv8, while reducing computational redundancy and memory access, which can improve the overall performance of the detection network. The structure of the improved YOLOv8 network model is as follows: Figure 1 As shown in the figure, the input image first passes through a layer of GSConv convolution module, then connects four groups of GSConv+VoVGSCSPC structures and finally connects to the SPPF module to form a feature extraction module; after the SPPF module, the feature map passes through a GSConv module and an Upsample module in turn, and then is added by the Fusion module to the feature map branch of the same size after the VoVGSCSPC module in the feature extraction module, and then multi-scale feature fusion is performed through the VovGSCSPC module to form a feature fusion module; the different feature map sizes in the feature fusion module are detected by the detection head module. The detection head module is a decoupled two-branch including detection box output and category prediction. After passing through a layer of PConv module, the two branches are respectively passed through the Conv2d module and Bbox Loss and Cls Loss for detection box output and category prediction.

[0059] Specifically, step S3 includes S31-S34:

[0060] S31. 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 with B2.

[0061] 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 YOLOv8 network model respectively, and also fuses the underlying B2 feature map to achieve high-level feature fusion and model lightweight.

[0062] S32, the GSConv module includes: the input image information is first down-sampled by an ordinary Conv, and then the DWConv deep convolution is used to enhance the image information after the down-sampling, and the image information obtained by the ordinary Conv down-sampling is further concatenated with the image information enhanced by the DWConv deep convolution in a Concat manner, and finally a shuffle operation is performed.

[0063] like Figure 4 As shown, in this embodiment, in order to speed up the prediction calculation in the convolutional neural network, the input image always needs to undergo a similar conversion process in the backbone network: the spatial information is gradually transferred to the channel. Each spatial (width and height) compression and channel expansion of the feature map will result in partial loss of semantic information. The channel-dense convolution calculation retains the hidden connections between each channel to the greatest extent, but the channel-sparse convolution completely cuts off these connections. GSConv retains these connections as much as possible while having a lower time complexity (FLOPs). The computational complexity of standard convolution SC, depth-separable convolution DSC, and GSConv convolution can be expressed as follows:

[0064] ;

[0065] ;

[0066] ;

[0067] in, represents the computational complexity of the standard convolution SC, represents the computational complexity of depthwise separable convolution DSC, represents the computational complexity of GSConv convolution, W and H are the width and height of the output feature map. K1×K2 is the size of the convolution kernel; C1 is the number of channels of each convolution kernel, which is also the number of channels of the input feature map, and C2 is the number of channels of the output feature map. The complexity of GSConv is about half of that of SC, but its learning ability is similar. Using the GSConv module can effectively reduce the complexity of the model network.

[0068] S33, the VoVGSCSPC module includes: the input image information is subjected to Conv and GSBottlneckC operations in sequence, and the input image information is subjected to a parallel Conv operation, and then the two parts of the output image information are spliced ​​in a Concat manner, and finally a Conv operation is performed; wherein the GSBottlneckC module includes two GSConv modules and one parallel DWConv module.

[0069] In this embodiment, Figure 5As shown in the figure, the input image information first passes through a convolution Conv module with a convolution kernel of 1×1, a step size of 1, and no padding, and then passes through the GSBottlneckC module and the image information input by another parallel branch passes through a convolution Conv module with a convolution kernel of 1×1, a step size of 1, and no padding, and then is concatenated in a Concat manner, and finally passes through a convolution Conv module with a convolution kernel of 1×1, a step size of 1, and no padding.

[0070] S34, the PConv module includes: applying a Conv to the A part of the input channel to extract spatial features, and retaining the remaining channel B part; then applying a convolution operation to the A part, and then splicing the convolution result with the channel B part that has not been convolved to obtain the final output.

[0071] In this embodiment, Figure 6 As shown in Figure 1, the convolution operation is applied to the first part, and then the convolution result is concatenated with the part of the channel that has not been convolved to obtain the final output. The computational complexity of the PConv convolution module can be expressed as follows:

[0072] ;

[0073] in, represents the computational complexity of the PConv convolution module, W, H are the width and height of the output feature map. K1×K2 is the size of the convolution kernel; C p is the number of channels of each convolution kernel, and also the number of channels of the input and output feature maps. p When / C=1 / 4, the computational complexity of PConv is only 1 / 16 of that of ordinary convolution. By using the PConv convolution module to replace the two convolutions of each branch of the detection head of the original YOLOv8 network model with a convolution kernel size of 3×3, a PConv convolution module with a convolution kernel size of 3×3, a stride and padding of 1, only 1 / 4 of the number of input channels is convolved, improving the overall performance of the detection head module and the model network.

[0074] S4. Add a counting module to the improved YOLOv8 network model in step S3 to build a multiphase flow bubble recognition and counting model based on the improved YOLOv8.

[0075] Specifically, after the multiphase flow bubble image is detected based on the multiphase flow bubble recognition and counting model of the improved YOLOv8, each bubble recognized by the model in each bubble image is assigned a unique serial number for calculating the number of bubbles.

[0076] S5, input the training set in step S1 into step S3 to train the multiphase flow bubble recognition and counting model based on the improved YOLOv8, and obtain the trained optimal weight file, thereby obtaining the optimal bubble recognition and counting model, which is as follows:

[0077] In this embodiment, the experiment is carried out in the hardware and software environment of the CPU being Intel(R) Core(TM) i7-13700K CPU @3.40 ​​GHz, the GPU being RTX4090 (24GB), CUDA12.1, python3.11, and windows11 operating system. The training set described in step S12 is input into the improved network model for forward propagation training, and the improved network model is updated and optimized by the back propagation algorithm; and the improved network model is iteratively trained for multiple times by the cross entropy loss function and the SGD optimizer until the improved network model converges to obtain the trained optimal weight file. All the improved methods based on step S2 can be applied to any model size of YOLOv8. In the embodiment of the present invention, YOLOv8n is used as the training model, the initial learning rate is set to 0.01, the batch size is set to 32, the number of iterations is 150, and the IOU threshold is 0.7. The optimal network model weight file is obtained through multiple rounds of iterative training, thereby obtaining the optimal bubble recognition and counting model.

[0078] S6. Input the verification set described in step S1 into the optimal bubble recognition and counting model trained in step S5 to evaluate the performance of the model.

[0079] Specifically, step S6 includes:

[0080] The verification 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 amount of calculation of the model, and the size of the parameters.

[0081] In this embodiment, the performance evaluation indicators include performing 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 calculation amount (FLOPs), model inference speed (FPS), and model size (Model size).

[0082] The definition of accuracy is: ;

[0083] Recall is defined as: ;

[0084] The average accuracy is defined as: ;

[0085] The definition of model parameters is: ;

[0086] The model calculation amount is defined as: ;

[0087] The model inference speed is defined as the number of image frames processed by the model in one second.

[0088] In the above formula, TP is a true positive, that is, a positive sample is correctly identified as a positive sample; FN is a false negative, that is, a positive sample is mistakenly identified as a negative sample; TN is a true negative, that is, a negative sample is correctly identified as a negative sample; FP is a false positive, that is, a negative sample is mistakenly identified as a positive sample. in Indicates the number of channels of each convolution kernel, which is also the number of channels of the input feature map; c out It represents the number of channels of the output feature map; K is the size of the convolution kernel; W and H are the width and height of the output feature map.

[0089] In order to test the performance improvement of the method of the embodiment of the present invention on the recognition and counting of multiphase flow bubbles, the corresponding related indicators are calculated for the existing detection model and the YOLOv8 network model improved by the embodiment of the present invention. The comparison results of the related indicators between the prior art and the method of the embodiment of the present invention are shown in Table 1.

[0090] Table 1

[0091] method AP@0.5 Parameters(M) FLOPs(G) FPS Weight size(MB) Faster-RCNN 0.855 41.348 79.351 85 316 YOLOv7-tiny 0.970 6.008 13 200 11.7 YOLOv8n 0.983 3.006 8.1 249 5.97 Improving the YOLOv8 model 0.981 0.987 2.1 148 2.23

[0092] As can be seen from Table 1, the improved YOLOv8 model has higher bubble recognition accuracy than the Faster-RCNN algorithm, and has similar accuracy to other YOLO algorithms, and can detect and locate bubbles more accurately; the improved YOLOv8 model has the least number of parameters, calculation amount, and model size, fast detection speed, and is more convenient for device deployment and application. The method of the embodiment of the present invention is more feasible and superior than the prior art.

[0093] S7. Use the multiphase flow bubble recognition and counting model based on improved YOLOv8 trained in step S5 for the recognition and counting of multiphase flow bubbles.

[0094] In this embodiment, the image to be detected is input into the trained model, the corresponding bubble detection result is output and the number of bubbles is counted. The bubble recognition and counting results are as follows: Figure 7 shown. Figure 7 (a) is the bubble recognition result of the gas-liquid-solid three-phase flow collected by the IPE-multiphase flow measuring instrument. Figure 7(b) in the figure is the bubble recognition result of gas-liquid two-phase flow synthesized by BubGAN algorithm. Figure 7 It can be seen from (a) that the improved network model accurately identifies the bubbles in the image. Even in complex scenes where the bubbles are blurred, blocked, or incomplete, the network model can accurately identify and count the bubbles. Figure 7 As can be seen from (b) in the figure, the improved model can also accurately identify bubbles in the synthetic gas-liquid two-phase flow bubble image, and the robustness of the model is enhanced.

[0095] As can be seen from the above examples, the present invention discloses a multiphase flow bubble recognition and counting method based on improved YOLOv8, including: obtaining a multiphase flow bubble image data set; replacing the original PAFPN network with a BiFPN network for deep feature fusion, replacing the original Conv and C2f modules with GSConv modules and VoVGSCSPC modules respectively, and improving the YOLOv8 detection head module with a PConv module; adding a counting module in the algorithm so that it can automatically count bubbles while recognizing them; inputting the training set into the improved network for training, inputting the verification set into the training network for performance evaluation, inputting the bubble image to be detected into the trained model, outputting the corresponding multiphase flow bubble detection results and counting the number of bubbles. The present invention achieves a bubble detection effect with high calculation accuracy and high speed while greatly reducing the number of parameters and calculations.

[0096] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for identifying and counting multiphase flow bubbles based on improved YOLOv8, characterized in that: The following steps are involved: Acquire a multiphase flow bubble image dataset, wherein the multiphase flow bubble image dataset includes a gas-liquid two-phase flow bubble image and a gas-liquid-solid three-phase flow bubble image; Dividing the multiphase flow bubble image dataset into a training set and a validation set; An improved YOLOv8 network model is obtained by improving YOLOv8, and a counting module is added to the improved YOLOv8 network model to obtain a multiphase flow bubble recognition and counting model based on the improved YOLOv8; The method for improving YOLOv8 includes: Replace the PAFPN network of YOLOv8 with the BiFPN network to obtain the feature fusion module; Replace the Conv module in the YOLOv8 feature extraction and fusion network with the GSConv module; Replace the C2f module in the YOLOv8 feature extraction and fusion network with the VoVGSCSPC module; The PConv module is introduced into the detection network of YOLOv8 to obtain an improved detection head module; The structure of 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 be directly connected to B2; The working method of the GSConv module includes: performing a downsampling of the input image information by a common Conv, using DWConv deep convolution to enhance the image information after downsampling, concatenating the image information obtained by the common Conv downsampling with the image information enhanced by the DWConv deep convolution in a Concat manner, and performing a shuffle operation on the concatenated image information; The working method of the VoVGSCSPC module includes: the input image information is sequentially subjected to Conv and GSBottlneckC operations through the Conv module and the GSBottlneckC module, and a parallel Conv operation is performed on the input image information at the same time, and then the two parts of the output image information are spliced ​​in a Concat manner, and finally a Conv operation is performed; wherein the GSBottlneckC module includes two GSConv modules and a parallel DWConv module; The working method of the PConv module includes: applying a Conv to the A part of the input channel to extract spatial features, and retaining the remaining channel B part; then applying a convolution operation to the A part, and then splicing the result obtained by the convolution operation with the channel B part that has not been convolved to obtain the final output; Inputting the training set into the multiphase flow bubble recognition and counting model for training to obtain an optimal bubble recognition and counting model; The performance of the optimal bubble recognition and counting model is evaluated through the verification set, and when the performance evaluation is passed, the multiphase flow bubbles are recognized and counted through the optimal bubble recognition and counting model.

2. The method for identifying and counting multiphase flow bubbles based on improved YOLOv8 according to claim 1, characterized in that: The method for obtaining a multiphase flow bubble image data set comprises: Use IPE-multiphase flow measuring instrument to capture gas-liquid-solid three-phase flow bubble images and use bubble generation adversarial network BubGAN to synthesize gas-liquid two-phase flow bubble images; The bubbles in the three-phase flow bubble image and the two-phase flow bubble image are framed with rectangular frames and the category names of the bubbles are labeled. The annotation files corresponding to the images generated after annotation are converted into txt files in YOLO format.

3. The method for identifying and counting multiphase flow bubbles based on improved YOLOv8 according to claim 1, characterized in that: The method for obtaining the optimal bubble recognition and counting model comprises: The training set is input into the multiphase flow bubble recognition and counting model for forward propagation training, and the multiphase flow bubble recognition and counting model is updated and optimized by using a back propagation algorithm; and the improved YOLOv8 network model is iteratively trained multiple times by using a cross entropy loss function and an SGD optimizer until the multiphase flow bubble recognition and counting model converges to obtain an optimal bubble recognition and counting model.

4. The method for identifying and counting multiphase flow bubbles based on improved YOLOv8 according to claim 1, characterized in that: The performance evaluation indicators include the accuracy of bubble recognition, the amount of calculation of the model and the size of the parameters.

5. The method for identifying and counting multiphase flow bubbles based on improved YOLOv8 according to claim 1, characterized in that: The counting method includes: assigning a unique serial number to the bubble when the bubble is identified, and counting according to the unique serial number.

Citation Information

Patent Citations

  • Two-phase flow pattern feature extraction method

    CN109858501A

  • Wood board defect online detection method based on yov8 binocular vision

    CN119067920A