A method and related device for identifying flow patterns of gas-liquid two-phase flow based on ensemble learning

By combining decision trees, KNN, and CNN with an ensemble learning method, the sample sampling probability is dynamically adjusted and an integrated model is constructed, which solves the contradiction between speed and accuracy in gas-liquid two-phase flow identification and achieves fast and accurate flow pattern identification.

CN120510454BActive Publication Date: 2025-10-21NUCLEAR POWER INSTITUTE OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510998148.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-10-21
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

Existing flow pattern identification methods cannot take into account both identification accuracy and identification speed, and have poor robustness, making it difficult to meet the needs of rapid prediction of vapor fraction.

Method used

An ensemble learning-based method is adopted to combine the traditional machine learning methods decision tree, KNN and CNN, and feature information is combined to recognize gas-liquid two-phase flow images. By dynamically adjusting the sample sampling probability and integrating multiple basis learners, an integrated model is constructed to improve the recognition speed and accuracy.

Benefits of technology

It achieves a balance between speed and accuracy in the identification of gas-liquid two-phase flow, has better recognition robustness and generalization ability, and can quickly and accurately identify two-phase flow images in industrial systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120510454B_ABST
    Figure CN120510454B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on ensemble learning's vapor-liquid two-phase flow flow pattern identification method and related equipment, it is relevant to flow field identification technical field, it solves the problem that existing flow pattern identification method cannot consider identification precision and identification speed, and robustness is poorer, its technical scheme main point is: including: obtaining the vapor-liquid two-phase flow image of different flow pattern, vapor-liquid two-phase flow image is preprocessed;Feature information and corresponding label information are extracted based on the vapor-liquid two-phase flow image after preprocessing as sample data;Based on sample data division training set and test set, based on training set trains multiple types of multiple base learning ware;Based on the base learning ware of training completion, integrated model is constructed, and integrated model identifies flow pattern according to voting method;The advantages of single machine learning algorithm are concentrated, so that machine learning algorithm can consider speed and identification precision simultaneously when identifying vapor-liquid two-phase flow, with better identification robustness and generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flow field recognition, and more particularly to a vapor-liquid two-phase flow pattern recognition method based on ensemble learning and related equipment. Background Art

[0002] Measuring vapor fraction is a major challenge in nuclear reactor thermal-hydraulic two-phase flow measurements. Different flow patterns correspond to different vapor fraction ranges, and two-phase flow measurements require a vast number of images, ranging from thousands to hundreds of thousands. Analyzing each image is labor-intensive and time-consuming, making it difficult to meet the demands of rapid prediction.

[0003] Rapid and accurate flow pattern identification based on artificial intelligence algorithms facilitates rapid prediction of vapor fraction. Traditional machine learning methods, such as decision trees and support vector machines, struggle to simultaneously address the conflict between accuracy and speed. Some researchers have used deep learning methods, but these are time-consuming, and using a single learner can result in unstable results and poor robustness.

[0004] Therefore, the present application provides a gas-liquid two-phase flow pattern identification method and related equipment based on ensemble learning to solve the above problems. Summary of the Invention

[0005] The purpose of this application is to provide a gas-liquid two-phase flow pattern recognition method and related equipment based on ensemble learning to solve the problem that existing flow pattern recognition methods cannot take into account both recognition accuracy and recognition speed, and have poor robustness; this application is based on the idea of ​​ensemble learning, combining traditional machine learning methods decision tree, KNN and CNN, and at the same time combining feature information to obtain bubble information in the image; the advantages of a single machine learning algorithm can be concentrated, so that the machine learning algorithm can take into account both speed and recognition accuracy when identifying gas-liquid two-phase flow, and has better recognition robustness and generalization ability.

[0006] The first aspect of the present application provides a method for identifying flow patterns of vapor-liquid two-phase flow based on ensemble learning, comprising: S1, obtaining vapor-liquid two-phase flow images of different flow patterns, and preprocessing the vapor-liquid two-phase flow images; S2, extracting feature information and corresponding label information as sample data based on the preprocessed vapor-liquid two-phase flow images; S3, dividing the training set and the test set based on the sample data, and training multiple base learners of various types based on the training set, wherein the sampling probability of the sample is calculated based on the historical prediction error of the sample in each round of training, and samples are extracted from the training set according to the sampling probability of the sample to form a sub-training set, and the base learners are trained based on the sub-training set; S4, constructing an ensemble model based on the trained base learners, and the ensemble model identifies the flow pattern according to the voting method.

[0007] In a possible implementation, the preprocessing includes: clipping, grayscale, and binarization.

[0008] In one possible embodiment, feature information and corresponding label information are extracted as sample data based on the preprocessed gas-liquid two-phase flow image; the method includes: calculating a grayscale histogram based on the preprocessed gas-liquid two-phase flow image; obtaining a probability distribution of each grayscale level based on the grayscale histogram; extracting the mean, standard deviation, smoothness, third-order moment, consistency and average entropy as feature information based on the probability distribution of each grayscale level; and forming a feature vector based on the feature information as input to a subsequent basis learner for flow type recognition of the two-phase flow image.

[0009] In one possible implementation, the sampling probability of a sample is calculated based on the historical prediction error of the sample during each round of training; this includes: calculating the weighted sum of the historical prediction errors of the sample as the cumulative error of the sample; and calculating the proportion of the cumulative error of the sample in the cumulative errors of all samples to obtain the sampling probability of the sample in this round.

[0010] In a possible implementation, the sampling probability of samples in this round is:

[0011] ;

[0012] in, For the Round Sample The sampling probability of is the smoothing factor, which increases as the model performance decreases; For samples forward Cumulative error of rounds; For samples forward Cumulative error of rounds; is the number of samples in the sub-training set; Is the numerical range integer variable; is the attenuation factor; For the A base learner pairs of samples The prediction error of Be The base learner misclassifies, then the prediction error ,otherwise .

[0013] In a possible implementation, there are at least three types of base learners.

[0014] In a possible implementation, types of base learners include: CNN, KNN, and decision tree.

[0015] In one possible implementation, training a base learner based on a sub-training set includes: n samples are randomly selected from the sub-training set m The samples are input into m CNN is trained to obtain m CNN-based learners; randomly selected from the remaining samples of the sub-training set k The samples are input into k KNN is trained and we get k KNN base learners; randomly selected from the remaining samples of the sub-training set nmk The samples are input into nmk Decision trees are trained to obtain nmk A decision tree based learner.

[0016] In one possible implementation, CNN is trained using a cross-entropy loss function.

[0017] In one possible implementation, KNN is trained using a K-fold cross-validation method.

[0018] In one possible implementation, the Gini index is used as an impurity indicator during decision tree training, and a learning curve and grid search are combined to determine pruning parameters of the decision tree.

[0019] The second aspect of the present application provides a computer device comprising: one or more processors; a memory for storing program code executable by the processor; wherein the processor is configured to execute the program code to implement the above-mentioned method for identifying flow patterns of vapor-liquid two-phase flow based on ensemble learning.

[0020] A third aspect of the present application provides a computer storage medium storing a computer program. When the computer program is executed by a computer device, the computer device executes the above-mentioned method for identifying the flow pattern of a vapor-liquid two-phase flow based on ensemble learning.

[0021] A fourth aspect of the present application provides a computer program product, which, when executed on a computer device, enables the computer device to execute the above-mentioned method for identifying flow patterns of vapor-liquid two-phase flow based on ensemble learning.

[0022] Compared with the prior art, the present application has the following beneficial effects: First, the traditional bagging ensemble learning algorithm is improved, and the advantages of different types of base learners are concentrated, so that the machine learning algorithm can take into account both speed and recognition accuracy when identifying the flow pattern of gas-liquid two-phase flow, and has better recognition robustness and generalization ability, and can perform flow pattern recognition on two-phase flow images obtained in industrial systems and equipment; Second, feature information is extracted from the gas-liquid two-phase flow image as training sample data. The feature information includes mean, standard deviation, smoothness, third-order moment, consistency and average entropy, which can fully reflect the texture, details, uniformity and other characteristics of the image, which is conducive to identifying bubbles in the image and distinguishing gas-liquid two-phase flow images of different flow types; Third, the sample sampling probability of each training round is dynamically adjusted based on the historical prediction error, thereby enhancing the model's learning ability for unbalanced data, while maintaining the parallel training characteristics of bagging, and improving the accuracy and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0024] Figure 1 A flow chart of a method for identifying a vapor-liquid two-phase flow pattern based on ensemble learning provided in an embodiment of the present application;

[0025] Figure 2 A structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] Hereinafter, the terms "include" or "may include" as used in various embodiments of the present application indicate the presence of the claimed function, operation, or element, and do not limit the addition of one or more functions, operations, or elements. In addition, as used in various embodiments of the present application, the terms "include", "have" and their cognates are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing or the possibility of adding one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing.

[0027] The terms used in the various embodiments of the present application are only used for the purpose of describing specific embodiments and are not intended to limit the various embodiments of the present application. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise specified, all terms used herein (including technical terms and scientific terms) have the same meaning as those commonly understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in the various embodiments of the present application.

[0028] In order to make the objectives, technical solutions and advantages of this application more clear, the present application is further described in detail below in conjunction with examples and drawings. The schematic implementation methods of this application and their descriptions are only used to explain this application and are not intended to limit this application.

[0029] First, some of the terms involved in this application are explained so that those skilled in the art can fully understand the technical solutions of this application.

[0030] Vapor-liquid two-phase flow refers to the phenomenon in which gas and liquid flow simultaneously in a pipe or other flow channel. The flow characteristics of vapor-liquid two-phase flow can be described by a variety of flow types, including bubbly flow, plug flow, mixed flow, annular flow, etc. Bubble flow: The vapor phase is dispersed in the continuous liquid phase in the form of small bubbles. The bubble diameter is usually less than 1 mm and the shape is approximately spherical. Plug flow: Small bubbles aggregate into large bubbles, which are similar in shape to a bullet, with a diameter close to the inner diameter of the pipe, occupying most of the pipe cross-section. Mixed flow: The vapor and liquid phases mix more violently, the flow is unstable, and the vapor-liquid interface fluctuates greatly. Annular flow: The vapor phase forms a continuous vapor column in the center of the pipe, and the liquid phase forms an annular liquid film along the pipe wall.

[0031] Bagging (Bootstrap Aggregating) is an ensemble learning method that generates multiple training subsets through bootstrap sampling and independently trains multiple base learners on these subsets. Ultimately, the prediction results of these base learners are aggregated (such as voting in classification tasks or averaging in regression tasks) to improve the stability and accuracy of the model.

[0032] A CNN (Convolutional Neural Network) is a deep learning model primarily used to process grid-structured data, such as images, videos, and speech signals. It automatically extracts hierarchical features from data through a combination of convolutional, pooling, and fully connected layers.

[0033] KNN (K-Nearest Neighbors) is an instance-based learning algorithm used for classification and regression tasks. Its core idea is to find the K closest samples (neighbors) by calculating the distance between a new sample and all samples in the training set, and then predict the label of the new sample based on the information of these neighbors.

[0034] A decision tree is a supervised learning algorithm based on a tree structure, used for classification and regression tasks. It uses a series of decision rules to classify data into different categories or predict target values. Decision trees recursively select the best features and divide them into subsets, ultimately building a tree-like model.

[0035] See Figure 1 As shown, Figure 1 A flowchart of a method for identifying flow patterns of vapor-liquid two-phase flow based on ensemble learning is provided in an embodiment of the present application. The method comprises: S1, acquiring vapor-liquid two-phase flow images of different flow patterns and preprocessing the vapor-liquid two-phase flow images; S2, extracting feature information and corresponding label information as sample data based on the preprocessed vapor-liquid two-phase flow images; S3, dividing the sample data into a training set and a test set, and training multiple base learners of various types based on the training set, wherein, in each round of training, the sampling probability of the sample is calculated based on the historical prediction error of the sample, and samples are extracted from the training set according to the sampling probability to form a sub-training set, and the base learners are trained based on the sub-training set; S4, constructing an ensemble model based on the trained base learners, and the ensemble model identifies the flow pattern using a voting method.

[0036] Specifically, based on experiments or simulations, vapor-liquid two-phase flow images of different flow patterns are obtained (for example, images of bubbly flow, plug flow, mixed flow, and annular flow patterns are obtained based on nuclear reactor thermal-hydraulic visualization experiments). These images are then preprocessed to obtain images with a unified format that facilitates feature extraction. Feature information is extracted from the preprocessed images, and sample data is generated based on the feature information and the corresponding flow pattern. A training set T and a test set are constructed based on a large amount of sample data. Samples are extracted from the training set T to form a sub-training set Tb based on dynamic sampling probabilities. B base learners hb are trained based on the sub-training set Tb. There are multiple types of base learners, and each type contains multiple base learners. The trained B base learners hb are added to an ensemble model H, resulting in H = {h1, h2, …hB}. The ensemble model H uses the base learners h1, h2, …hB to vote and identify the flow pattern of the image (the flow pattern can be used in subsequent processes such as gas fraction measurement).

[0037] The improvement of this application lies in improving the traditional bagging ensemble learning algorithm, selecting different types of base learners for integration, integrating the advantages of multiple base learners, realizing parallel training of base learners, improving the recognition speed and recognition accuracy of the model, making the model have better recognition robustness and generalization ability, and having broad application prospects in the field of multiphase flow industrial applications; setting a sample sampling method based on historical prediction errors, conducting targeted training on the base learners, enhancing the model's learning ability for unbalanced data, while maintaining the parallel training characteristics of bagging, and improving the accuracy and robustness of the model.

[0038] Step S1 is to obtain gas-liquid two-phase flow images of different flow patterns and pre-process the gas-liquid two-phase flow images. As a possible implementation, the pre-processing includes: cropping, grayscale conversion, and binarization.

[0039] Specifically, the vapor-liquid two-phase flow image is cropped. The area to be cropped is determined based on the image's coordinate information. The pixel data within this area is extracted, and irrelevant parts of the image are removed while retaining the target area of ​​interest, thereby reducing the amount of data required for subsequent processing. The cropped vapor-liquid two-phase flow image is then grayscaled and binarized. An appropriate threshold is selected to set each pixel in the grayscale image to white or black, further removing noise interference and highlighting the target area. It should be noted that the binarized vapor-liquid two-phase flow image can be modified to a uniform pixel size and saved in matrix form, directly serving as the input to the base learner for subsequent model training.

[0040] Step S2 is to extract feature information and corresponding label information as sample data based on the preprocessed vapor-liquid two-phase flow image. As a possible implementation method, the feature information and corresponding label information are extracted as sample data based on the preprocessed vapor-liquid two-phase flow image; the method includes: calculating a grayscale histogram based on the preprocessed vapor-liquid two-phase flow image; obtaining a probability distribution of each grayscale level based on the grayscale histogram; extracting the mean m, standard deviation σ, smoothness R, third-order moment μ3, consistency U, and average entropy e as feature information based on the probability distribution of each grayscale level; and forming a feature vector based on the feature information as input to a subsequent basis learner for flow pattern recognition of the two-phase flow image.

[0041] Specifically, the mean m represents the average brightness of the image grayscale value, which can be used to distinguish images under different brightness conditions and identify whether the image is affected by lighting; the standard deviation σ reflects the discrete degree of the image grayscale value, that is, the contrast of the image, which can be used to distinguish images with different texture complexity; the smoothness R measures the smoothness of the image. Images with high smoothness usually have fewer texture details, while images with low smoothness usually contain rich texture information; the third-order moment μ reflects the skewness of the image grayscale distribution, that is, the symmetry of the image, which can be used to identify whether there are asymmetric textures or structural features in the image. For example, the third-order moment in two-phase flow images is used to distinguish the uneven distribution of gas and liquid; the consistency U is used to measure the uniformity of the texture in the image. Images with high consistency usually have more regular textures, while images with low consistency may contain complex texture changes; the average entropy e is an indicator to measure the amount of image information. A higher entropy value usually indicates that the image contains rich textures and details, while a lower entropy value indicates that the image is more uniform. It can be used for image classification and texture analysis to help distinguish gas-liquid two-phase flow images of different flow types.

[0042] For example, based on W preprocessed vapor-liquid two-phase flow images, six features are extracted from the grayscale histogram. Flow pattern labels are generated based on manually identified flow patterns, with 1, 2, 3, and 4 representing different flow patterns. For example, 1 represents bubbly flow, 2 represents plug flow, 3 represents mixed flow, and 4 represents annular flow. Sample data is generated based on the six features and one flow pattern label from the W vapor-liquid two-phase flow images for subsequent model training.

[0043] Step S3 is to divide the training set and the test set based on the sample data, and train multiple base learners of various types based on the training set. In each round of training, the sampling probability of the sample is calculated based on the historical prediction error of the sample, and samples are extracted from the training set according to the sampling probability of the sample to form a sub-training set, and the base learner is trained based on the sub-training set.

[0044] Specifically, the sample data is randomly divided into a training set and a test set in proportion. For example, 70% of the W samples are randomly selected as the training set and 30% as the test set. Multiple base learners are trained based on the training set, and the performance of the integrated model composed of multiple base learners is evaluated based on the test set. Among them, in order to solve the problem that traditional sampling has equal probability for all samples and is difficult to handle the imbalance of sample types. This application proposes to enhance the model's learning ability for unbalanced data by dynamically adjusting the sampling probability of samples. Specifically, a dynamic weight mechanism is introduced to dynamically adjust the sampling probability of each sample in each training round through historical prediction errors, while maintaining the characteristics of bagging parallel training.

[0045] As a possible implementation method, the sampling probability of the sample is calculated based on the historical prediction error of the sample in each round of training; including: calculating the weighted sum of the historical prediction errors of the sample as the cumulative error of the sample; calculating the proportion of the cumulative error of the sample in the cumulative errors of all samples to obtain the sampling probability of the sample in this round.

[0046] Furthermore, the sampling probability of this round of samples is:

[0047] ;

[0048] in, For the Round Sample The sampling probability of is the smoothing factor, which increases as the model performance decreases; For samples forward Cumulative error of rounds; For samples forward Cumulative error of rounds; is the number of samples in the sub-training set; Is the numerical range integer variable; is the attenuation factor; For the A base learner pairs of samples The prediction error of Be The base learner misclassifies, then the prediction error ,otherwise .

[0049] Specifically, a dynamic weight mechanism is introduced in the process of extracting samples from the training set to form a sub-training set. The sampling probability is dynamically adjusted through historical prediction errors, which can solve the problem that traditional equal-probability sampling is difficult to handle unbalanced sample categories.

[0050] First initialize: let the cumulative error of all samples is zero, the initial sampling probability , is the number of samples in the sub-training set, i.e., equal probability sampling;

[0051] Calculate sample error: If the sample Be The base learner misclassifies, then the prediction error ,otherwise ;

[0052] Update cumulative error: sample The cumulative error is the weighted sum of historical forecast errors:

[0053] ;

[0054] Where, is the attenuation factor, which controls the weight of historical errors;

[0055] Update sampling probability: adjust the sampling probability of this round according to the accumulated error , making it difficult to classify samples (high ) get higher weight;

[0056] ;

[0057] Where, It is a smoothing factor. To avoid numerical instability, its value needs to be adjusted according to the overall performance of the model. When the model performance decreases, it is increased. To reduce the volatility of sampling probability.

[0058] As a possible implementation, there are at least three types of base learners.

[0059] Furthermore, the types of base learners include: CNN, KNN and decision tree.

[0060] Specifically, unlike traditional bagging algorithms that use a single type of base learner, this application utilizes at least three base learners. These include CNN, KNN, and decision trees, or logistic regression, decision trees, and CNN. By integrating the differences in learning algorithms across these different base learners, the model's predictions are more diverse, thereby improving the accuracy of the model's predictions.

[0061] Further, the base learner is trained based on the sub-training set; including: n samples are randomly selected from the sub-training set m The samples are input into m CNN is trained to obtain m CNN-based learners; randomly selected from the remaining samples of the sub-training set k The samples are input into k KNN is trained and we get k KNN base learners; randomly selected from the remaining samples of the sub-training set nmk The samples are input into nmk Decision trees are trained to obtain nmk A decision tree based learner.

[0062] Specifically, the parameters of the convolutional neural network are set, including the height CH of the convolution kernel, the width CW of the convolution kernel, the depth CD of the convolution kernel, the stride Strides of the convolution kernel, and the pooling width S of the pooling layer. n Randomly select from the sample m samples T(1), T(2)…T( m ), and then m The samples are input into CNN for training, and the training results are m Different CNN base learners. Randomly sample from the remaining samples of the sub-training set k Samples T ( m +1), T ( m +2)…T( m + k ),Will k The samples are input into KNN for training and the obtained k Different KNN base learners are randomly selected from the remaining samples of the sub-training set. nmk Samples T ( m + k +1), T ( m + k +2)…T( n ),Will nmk The samples are input into the decision tree for training and the nmk different decision tree based learners.

[0063] Furthermore, CNN is trained using the cross entropy loss function, where the K value can be 5-7.

[0064] Furthermore, KNN is trained using K-fold cross validation method.

[0065] Furthermore, during decision tree training, the Gini index is used as an impurity indicator, and the pruning parameters of the decision tree are determined by combining learning curves and grid search. The pruning parameters include the maximum depth of the decision tree and the minimum leaf node after pruning.

[0066] Step S4 is to build an integrated model based on the trained base learner, and the integrated model identifies the flow type according to the voting method. n Different types of base learners hb are added to the ensemble model H to form a strong learner. The ensemble model H={h1, h2,…hB} votes according to the voting method, that is, n Among the prediction results of the base learners for the samples, the category with the largest number is the final image flow type.

[0067] It can be understood that the gas-liquid two-phase flow pattern recognition method based on ensemble learning provided in this application, first, improves the traditional bagging ensemble learning algorithm, concentrates the advantages of different types of base learners, so that the machine learning algorithm can take into account both speed and recognition accuracy when identifying the gas-liquid two-phase flow pattern, has better recognition robustness and generalization ability, and can perform flow pattern recognition on two-phase flow images obtained in industrial systems and equipment; second, extracts feature information from the gas-liquid two-phase flow image as training sample data, and the feature information includes mean m, standard deviation σ, smoothness R, third-order moment μ3, consistency U and average entropy e, which can fully reflect the texture, details, uniformity and other characteristics of the image, which is conducive to identifying bubbles in the image and distinguishing gas-liquid two-phase flow images of different flow patterns; third, dynamically adjusts the sample sampling probability of each training round based on historical prediction error, enhances the model's learning ability for unbalanced data, and maintains the parallel training characteristics of bagging, thereby improving the accuracy and robustness of the model.

[0068] See Figure 2 As shown, Figure 2 The computer device provided in the embodiment of the present application includes: one or more processors; a memory for storing program codes executable by the processors; wherein the processors are configured to execute the program codes to implement the following Figure 1 The steam-liquid two-phase flow pattern identification method based on ensemble learning is shown.

[0069] Computer device 200 may vary significantly due to configuration or performance differences. It may include one or more central processing units (CPUs) 222 (e.g., one or more processors), memory 232, and one or more storage media 230 (e.g., one or more mass storage devices) storing application programs 242 or data 244. Memory 232 and storage media 230 may be either transient or persistent storage. Programs stored in storage media 230 may include one or more modules (not shown), each of which may include a series of instructions operating on the computer device. Furthermore, CPU 222 may be configured to communicate with storage media 230, executing the series of instructions stored in storage media 230 on computer device 200.

[0070] The computer device 200 may also include one or more power supplies 226, one or more wired or wireless network interfaces 250, one or more input data interfaces 258, one or more operating systems 241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0071] In the embodiment of the present application, the central processing unit 222 can be used to execute the following Figure 1 The steam-liquid two-phase flow pattern identification method based on ensemble learning is shown.

[0072] The embodiment of the present application also provides a computer storage medium, which stores a computer program. When the computer program is executed by a computer device, the computer device executes the following Figure 1 The steam-liquid two-phase flow pattern identification method based on ensemble learning is shown.

[0073] The embodiment of the present application also provides a computer program product, which, when executed on a computer device, enables the computer device to execute the following Figure 1 The steam-liquid two-phase flow pattern identification method based on ensemble learning is shown.

[0074] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for identifying flow patterns of vapor-liquid two-phase flow based on ensemble learning, characterized in that: include: S1. Acquire vapor-liquid two-phase flow images of different flow patterns and preprocess the vapor-liquid two-phase flow images; S2. Extracting feature information and corresponding label information based on the preprocessed vapor-liquid two-phase flow image as sample data; S3. Dividing the sample data into a training set and a test set, and training multiple base learners of various types based on the training set, wherein in each round of training, a sampling probability of the sample is calculated based on the historical prediction error of the sample, and samples are extracted from the training set according to the sampling probability of the sample to form a sub-training set, and the base learners are trained based on the sub-training set; S4. Building an integrated model based on the trained base learners, wherein the integrated model identifies flow types according to a voting method; The sampling probability of the sample is calculated based on the historical prediction error of the sample in each round of training. This includes: calculating the weighted sum of the historical prediction errors of the sample as the cumulative error of the sample; calculating the proportion of the cumulative error of the sample in the cumulative errors of all samples to obtain the sampling probability of the sample in this round. The sampling probability of the sample in this round is: in, is the sample x in the t+1th round i The sampling probability of ; ε is the smoothing factor, which increases as the model performance decreases; For sample x i The cumulative error of the first t rounds; For sample x j The cumulative error of the first t rounds; n is the number of samples in the sub-training set; k is an integer variable with a value range of 1-t; γ∈(0,1] is the decay factor; is the kth base learner for sample x i The prediction error of the sample x i is misclassified by the kth base learner, then the prediction error otherwise 2. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 1, characterized in that: The preprocessing includes: clipping, grayscale and binarization.

3. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 1, characterized in that: Extracting feature information and corresponding label information based on the preprocessed vapor-liquid two-phase flow image as sample data; comprising: Calculating a grayscale histogram based on the preprocessed vapor-liquid two-phase flow image; Obtaining a probability distribution of each gray level based on the gray level histogram; Based on the probability distribution of each gray level, the mean, standard deviation, smoothness, third-order moment, consistency and average entropy are extracted as feature information; The feature vector is composed based on the feature information and used as the input of the subsequent basis learner for flow pattern recognition of two-phase flow images.

4. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 1, characterized in that: The base learners include at least three types.

5. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 4, characterized in that: The types of base learners include: CNN, KNN and decision tree.

6. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 5, characterized in that: Training a base learner based on the sub-training set; comprising: Randomly extract m samples from the sub-training set of n samples and input them into m CNNs for training, thus obtaining m CNN base learners. Randomly select k samples from the remaining samples of the sub-training set and input them into k KNNs for training to obtain k KNN base learners; Randomly select nmk samples from the remaining samples of the sub-training set and input them into nmk decision trees for training, and obtain nmk decision tree base learners.

7. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 5, characterized in that: CNN is trained using the cross entropy loss function.

8. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 5, characterized in that: KNN uses K-fold cross-validation method for training.

9. The method for identifying vapor-liquid two-phase flow patterns based on ensemble learning according to claim 5, characterized in that: When training a decision tree, the Gini index is used as an impurity indicator, and the pruning parameters of the decision tree are determined by combining learning curves and grid search.

10. A computer device, characterized in that: include: one or more processors; a memory for storing program code executable by the processor; The processor is configured to execute the program code to implement the vapor-liquid two-phase flow pattern identification method based on ensemble learning as described in any one of claims 1 to 9.

11. A computer storage medium, characterized in that The computer storage medium stores a computer program, and when the computer program is executed by a computer device, the computer device executes the gas-liquid two-phase flow pattern identification method based on ensemble learning as described in any one of claims 1 to 9.

12. A computer program product, characterized in that When the computer program product is run on a computer device, the computer device is enabled to execute the vapor-liquid two-phase flow pattern identification method based on ensemble learning according to any one of claims 1 to 9.