Rectangular channel two-phase flow pattern identification method, device and equipment, storage medium and product
By extracting the grayscale feature information of the rectangular channel fluid and combining the integrated learning model of the K nearest neighbor algorithm and the convolutional neural network, the two-phase flow model of the rectangular channel is identified, solving the problem of insufficient recognition accuracy in the existing technology and improving the prediction accuracy and processing capability.
Patent Information
- Application Number
- CN202411670946.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the identification method of the two-phase flow heat transfer process of the rectangular channel relies on human judgment, is highly subjective, cannot provide high-precision prediction, and is difficult to meet the needs of high-precision identification.
By obtaining the visual image of the rectangular channel fluid, extracting grayscale feature information, and inputting it into the preset integrated learning model, including multiple classifiers of K nearest neighbor algorithm and convolutional neural network for classification, and counting the predictions of each classifier As a result, the flow type category is determined.
The prediction accuracy of two-phase flow type recognition in rectangular channels is improved, and a large amount of data can be effectively processed under different operating conditions, reducing the model's sensitivity to a single misprediction and enhancing the recognition accuracy.
Smart Images

Figure CN119206689A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of nuclear power systems, and in particular to a method, device, equipment, storage medium and product for identifying two-phase flow patterns in rectangular channels. Background Art
[0002] As an emerging energy technology, nuclear energy and nuclear power systems are becoming increasingly important with the development of technology. In nuclear power systems, rectangular channel two-phase flow heat transfer is a key heat transfer process. Accurately obtaining the specific conditions of the rectangular channel vapor-liquid two-phase flow heat transfer process is crucial to the safe operation of the system.
[0003] In the existing technology, visualizing experimental data is an important method to obtain the flow conditions of gas-liquid two-phase. Currently, there are flow pattern diagrams and other methods for obtaining visual data information of gas-liquid two-phase. However, traditional methods rely on human judgment, which is highly subjective and empirical. They cannot provide sufficiently high prediction accuracy and are difficult to meet the needs of high-precision identification. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment, storage medium and product for identifying two-phase flow patterns in a rectangular channel, which can enhance the prediction accuracy of the model under different working conditions.
[0005] In a first aspect, the present application provides a method for identifying two-phase flow patterns in a rectangular channel, comprising: Obtain visualization of the flow in a rectangular channel of a heat exchange system; Extracting grayscale features in the visualized image to obtain corresponding grayscale feature information; Inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, respectively performing classification by each classifier in the preset ensemble learning model, and determining a two-phase flow pattern prediction category corresponding to each classifier, wherein the types of the plurality of classifiers include a K nearest neighbor algorithm and a convolutional neural network; Counting the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model, and determining the two-phase flow pattern prediction category with the largest number in the statistical results; The two-phase flow pattern prediction category with the largest number is used as the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system.
[0006] In some possible implementations, the grayscale feature information includes grayscale value variance, grayscale value smoothness, grayscale value energy, and grayscale value entropy, and the step of extracting the grayscale features in the visualized image to obtain the corresponding grayscale feature information includes: Gray-scaling the visualized image; Counting the grayscale value of each pixel in the grayscale visualized image; Calculate the average value of the grayscale value of each pixel to obtain a grayscale value mean; Calculating the variance of the grayscale value of each pixel according to the grayscale value mean to obtain the grayscale value variance; Calculate the transformation speed of the gray value transformation of each pixel according to the gray value variance to obtain the gray value smoothness; Determining the gray value energy according to the distribution uniformity of the gray value of each pixel; The negative expected value of the probability distribution logarithm of the gray value of each pixel is calculated to obtain the gray value entropy.
[0007] In some possible implementations, calculating the transformation speed of the grayscale value transformation of each pixel according to the grayscale value variance to obtain the grayscale value smoothness includes: The transformation speed of each pixel gray value transformation is calculated by the following formula to obtain the gray value smoothness:
[0008] in, is the gray value smoothness, is the gray value variance.
[0009] In some possible implementations, before inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, performing classification by each classifier in the preset ensemble learning model, and determining the two-phase flow pattern prediction category corresponding to each classifier, the method further includes: Acquire an initial training sample set; the training sample set includes a plurality of training samples, each of which includes a rectangular channel fluid image sample and a grayscale feature information sample, as well as a corresponding category label; For each classifier in the initial ensemble learning model, perform the following steps: Randomly extract multiple training samples from the initial training sample set to form a training sample set corresponding to the classifier; For each training sample in the training sample set, perform the following steps respectively: Based on the rectangular channel fluid image samples and the grayscale feature information samples, classification is performed by a classifier to obtain a two-phase flow pattern prediction result; Determining a loss function value of a classifier according to a difference between the two-phase flow pattern prediction result and a corresponding category label; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned, and the two-phase flow pattern prediction result is obtained by classification through the classifier; When the loss function values of each of the classifiers meet the preset training stop condition, the training is stopped to obtain the trained integrated learning model.
[0010] In some possible implementations, when the classifier is a K-nearest neighbor algorithm, the classification based on the rectangular channel fluid image sample and the grayscale feature information sample is performed by the classifier to obtain a two-phase flow pattern prediction result, including: Using the grayscale feature information sample as the input of the K nearest neighbor algorithm to obtain a two-phase flow pattern prediction result; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned, and the two-phase flow pattern prediction result is obtained by classification through the classifier, including: When the loss function value of the classifier does not meet the preset training stop condition, adjusting the K value of the K nearest neighbor algorithm, returning the gray feature information as the input of the K nearest neighbor algorithm, and obtaining the two-phase flow pattern prediction result; In some possible implementations, when the classifier is a convolutional neural network, the classification based on the rectangular channel fluid image sample and the grayscale feature information sample is performed by the classifier to obtain a two-phase flow pattern prediction result, including: Using the rectangular channel fluid image sample as an input of a convolutional neural network to obtain a two-phase flow pattern prediction result; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned, and the two-phase flow pattern prediction result is obtained by classification through the classifier, including: When the loss function value of the classifier does not meet the preset training stop condition, the model parameters in the convolutional neural network are adjusted, and the rectangular channel fluid image sample is returned as the input of the convolutional neural network to obtain the two-phase flow pattern prediction result.
[0011] In some possible implementations, the inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, performing classification by each classifier in the preset ensemble learning model, and determining the two-phase flow pattern prediction category corresponding to each classifier includes: Inputting the visualized image and the grayscale feature information into multiple classifiers of a preset ensemble learning model; In the case where the classifier is a K-nearest neighbor algorithm, classification is performed using the K-nearest neighbor algorithm according to the grayscale feature information to determine a two-phase flow pattern prediction category corresponding to the classifier; In the case where the classifier is a convolutional neural network, the visualization image is input into the convolutional neural network, and the two-phase flow pattern prediction category corresponding to the classifier is determined according to the classification identifier output by the convolutional neural network.
[0012] In a second aspect, the present application provides a two-phase flow pattern identification device for a rectangular channel, the device comprising: An acquisition module, used for acquiring a visualization image of a fluid in a rectangular channel of a heat exchange system; An extraction module, used to extract grayscale features in the visual image to obtain corresponding grayscale feature information; A classification module, used for inputting the visualization image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, performing classification by each classifier in the preset ensemble learning model, and determining a two-phase flow pattern prediction category corresponding to each classifier, wherein the types of the plurality of classifiers include a K-nearest neighbor algorithm and a convolutional neural network; A statistical module, used to count the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model, and determine the two-phase flow pattern prediction category with the largest number in the statistical results; The determination module is used to use the two-phase flow type prediction category with the largest number as the classification category of the two-phase flow type of the fluid in the rectangular channel of the nuclear power system.
[0013] In a third aspect, the present application provides a rectangular channel two-phase flow pattern identification device, the device comprising: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the rectangular channel two-phase flow pattern identification method as described above.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the rectangular channel two-phase flow pattern identification method as described above.
[0015] In a fifth aspect, the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the rectangular channel two-phase flow pattern identification method described above.
[0016] The rectangular channel two-phase flow pattern identification method, device, equipment, storage medium and product provided in the embodiments of the present application, after obtaining a visual image of the fluid in the rectangular channel of the nuclear power system, feature extraction is performed on the visual image to obtain corresponding grayscale feature information, and then the visual image and the grayscale feature information are input into a preset integrated learning model, and processed by each K nearest neighbor algorithm or convolutional neural network classifier in the preset integrated learning model to obtain the two-phase flow pattern prediction category corresponding to different classifiers, and finally based on a preset combination strategy, according to the two-phase flow pattern prediction category corresponding to each classifier in the preset integrated learning model, the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system is determined, and the integrated learning method is used to effectively combine the advantages of the K nearest neighbor algorithm and the convolutional neural network, so that the system can process a large amount of data in a short time, and by combining the results of multiple classifiers, the sensitivity of the model to a single wrong prediction is reduced, and the prediction accuracy of the model under different working conditions is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present application can be better understood from the following description of the specific embodiments of the present application in conjunction with the accompanying drawings, in which: Other features, objects and advantages of the present application will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in which the same or similar reference numerals represent the same or similar features.
[0018] Figure 1 This is a flow chart of a method for identifying two-phase flow patterns in a rectangular channel provided by an embodiment of the present application; Figure 2 This is a flow chart of a rectangular channel two-phase flow pattern recognition model training process provided by an embodiment of the present application; Figure 3 is a schematic flow chart of a two-phase flow pattern identification method for a rectangular channel provided by another embodiment of the present application; Figure 4 It is a structural schematic diagram of a two-phase flow pattern identification device for a rectangular channel provided by an embodiment of the present application; Figure 5 It is a schematic diagram of the hardware structure of the rectangular channel two-phase flow pattern identification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0020] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0021] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and product for identifying two-phase flow patterns in a rectangular channel. The following first introduces the method for identifying two-phase flow patterns in a rectangular channel provided by the embodiments of the present application.
[0022] Figure 1 FIG. 1 is a flow chart of a method for identifying two-phase flow patterns in a rectangular channel provided by an embodiment of the present application. Figure 1 As shown, the method includes the following steps: S101 to S105.
[0023] S101: Obtain a visualization image of a fluid in a rectangular channel of a heat exchange system.
[0024] In a specific implementation, the sensor can be controlled to collect visual images of the fluid in the channel in real time, and the collected visual images are stored in a database or file system in an appropriate format for subsequent processing.
[0025] S102: Extracting grayscale features from the above-mentioned visualized image to obtain corresponding grayscale feature information.
[0026] In the specific implementation, the color image is converted into a grayscale image using an image processing library, and the grayscale value is normalized. Then, the grayscale features can be extracted through algorithms such as scale-invariant feature transform (SIFT). These features represent important information such as the shape and edge of the fluid in the image, and the corresponding grayscale feature information is obtained.
[0027] S103: Input the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset ensemble learning model, and classify them respectively through each classifier in the above-mentioned preset ensemble learning model to determine the two-phase flow type prediction category corresponding to each classifier, and the types of the above-mentioned multiple classifiers include K-nearest neighbor algorithm and convolutional neural network.
[0028] In the specific implementation, multiple classifiers are prepared based on the preset integrated learning framework, including the K nearest neighbor algorithm and convolutional neural network. The visual image and grayscale feature information are appropriately adjusted, such as adjusting the dimension and data type, to ensure that they can be processed by the classifier. After that, the adjusted data are input into different classifiers respectively. Each classifier will predict the fluid according to its own algorithm characteristics, and then determine the two-phase flow prediction category corresponding to each classifier.
[0029] S104: Counting the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model, and determining the two-phase flow pattern prediction category with the largest number in the statistical results.
[0030] In the specific implementation, the prediction results of each classifier are collected into a list or array, the number of occurrences of each category is counted, and the prediction result with the highest frequency of occurrence of the category and the corresponding two-phase flow type prediction category are found.
[0031] S105: The two-phase flow pattern prediction category with the largest number is used as the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system.
[0032] In a specific implementation, the category with the largest number counted in the previous step is determined as the final classification result, which is used as the classification category of the two-phase flow type of the fluid in the rectangular channel of the above-mentioned nuclear power system.
[0033] The rectangular channel two-phase flow pattern identification method provided in the embodiment of the present application is to extract features from the visualized image of the fluid in the rectangular channel of the nuclear power system after acquiring the visualized image to obtain corresponding grayscale feature information, and then input the visualized image and the grayscale feature information into a preset integrated learning model, and process them by each K nearest neighbor algorithm or convolutional neural network classifier in the preset integrated learning model to obtain the two-phase flow pattern prediction categories corresponding to different classifiers, and finally, based on a preset combination strategy, determine the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system according to the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model. The integrated learning method is used to effectively combine the advantages of the K nearest neighbor algorithm and the convolutional neural network, so that the system can process a large amount of data in a short time. By combining the results of multiple classifiers, the sensitivity of the model to a single wrong prediction is reduced, and the prediction accuracy of the model under different working conditions is enhanced.
[0034] In order to accurately obtain grayscale feature information, in some embodiments, the grayscale feature information includes grayscale value variance, grayscale value smoothness, grayscale value energy and grayscale value entropy, and the above S102 may include the following steps: S1021 to S1027.
[0035] S1021: grayscale the above-mentioned visualization image.
[0036] In the specific implementation, the image processing library is used to read the collected color image and convert the color image into a single-channel grayscale image.
[0037] S1022: Counting the grayscale value of each pixel in the grayscale visualized image.
[0038] In the specific implementation, each pixel of the grayscale image is traversed to obtain its grayscale value, and the grayscale value of each pixel is stored in a list or array for calculation.
[0039] S1023: Calculate the average value of the grayscale value of each pixel to obtain the grayscale value mean.
[0040] In a specific implementation, all values in the gray value list are summed, and the total number of pixels is recorded, and the gray value mean is obtained by dividing the sum by the number of pixels.
[0041] S1024: Calculate the variance of the grayscale value of each pixel according to the grayscale value mean to obtain the grayscale value variance.
[0042] In a specific implementation, the grayscale value mean is subtracted from the grayscale value of each pixel, the deviation of each pixel from the grayscale value mean is determined, the squared results of all deviations are summed, and then divided by the number of pixels to obtain the grayscale value variance.
[0043] S1025: Calculate the transformation speed of the grayscale value transformation of each pixel according to the grayscale value variance to obtain the grayscale value smoothness.
[0044] In a specific implementation, the standard deviation, that is, the square root of the variance, may be calculated, and the grayscale value smoothness may be obtained by using the standard deviation as a measure of smoothness.
[0045] S1026: Determine the grayscale value energy according to the distribution uniformity of the grayscale values of each pixel.
[0046] In a specific implementation, after counting the frequency of occurrence of each gray value, the sum of the squares of the frequency of each gray value is calculated to obtain the gray value energy.
[0047] S1027: Calculate the negative expected value of the probability distribution logarithm of the gray value of each pixel to obtain the gray value entropy.
[0048] In a specific implementation, for each gray value, its occurrence probability is calculated, that is, the ratio of the frequency of occurrence of the gray value to the total number of pixels, and the negative expected value of the logarithm of the probability is calculated to obtain the gray value entropy.
[0049] The above-mentioned implementation method of the embodiment of the present application grayscales the visualized image, then counts the grayscale values of each pixel in the grayscale visualized image, and then calculates the average value of the grayscale values to obtain the grayscale value mean, obtains the grayscale value variance through the grayscale value mean, calculates the transformation speed of the grayscale value transformation of each pixel according to the grayscale value variance, and obtains the grayscale value smoothness, and then determines the grayscale value energy according to the distribution uniformity of the grayscale values of each pixel, calculates the negative expected value of the probability distribution logarithm of the grayscale values of each pixel, and obtains the grayscale value entropy, and then accurately obtains the grayscale feature information including grayscale value variance, grayscale value smoothness, grayscale value energy and grayscale value entropy.
[0050] In order to obtain the grayscale value smoothness more accurately, in some implementations, the above S1025 may include: The transformation speed of each pixel gray value transformation is calculated by the following formula to obtain the gray value smoothness:
[0051] in, is the gray value smoothness, is the gray value variance.
[0052] The above implementation of the embodiment of the present application substitutes the gray value variance into the formula to calculate the gray value smoothness, which can obtain the gray value smoothness more accurately.
[0053] In order to obtain a suitable ensemble learning model, refer to Figure 2In some implementations, before the above S103, the above method may further include the following steps: S201 to S206.
[0054] S201: Acquire an initial training sample set; the training sample set includes a plurality of training samples, each of which includes a rectangular channel fluid image sample and a grayscale feature information sample, as well as a corresponding category label.
[0055] In a specific implementation, multiple fluid image samples and their corresponding grayscale features and category labels are collected from experimental data or simulation software, and the collected samples are stored in a list or array according to a predefined data structure to form a complete initial training sample set.
[0056] For each classifier in the initial ensemble learning model, perform the following steps: S202: Randomly extract multiple training samples from the initial training sample set to form a training sample set corresponding to the classifier.
[0057] In a specific implementation, for each classifier in the initial integrated learning model, a preset number of samples are randomly extracted from the initial training sample set, and the extracted samples are stored in a new data structure as the training sample set corresponding to the classifier.
[0058] For each training sample in the training sample set, perform the following steps respectively: S203: Based on the rectangular channel fluid image samples and the grayscale feature information samples, classification is performed through a classifier to obtain a two-phase flow pattern prediction result.
[0059] In the specific implementation, rectangular channel fluid image samples and grayscale feature information are extracted from the extracted training sample set to form the input data of the model. Based on different classifiers, the prediction method of the classifier is called to process the input data to obtain the prediction result of the two-phase flow type.
[0060] S204: Determine a loss function value of a classifier according to the difference between the two-phase flow pattern prediction result and the corresponding category label.
[0061] In the specific implementation, choose a suitable loss function, such as cross entropy loss or mean square error, to measure the difference between the predicted result and the true category label. Use the true category label and the predicted result to calculate the loss value and determine the loss function value of the classifier.
[0062] S205: Determine whether the loss function value of the classifier meets the preset training stop condition.
[0063] In a specific implementation, it is determined whether the loss function value of the current classifier meets a preset training stop condition. The specific training stop condition may be that the loss function value reaches a certain threshold or the number of iterations reaches a preset number.
[0064] S206: When the loss function value of the classifier does not satisfy the preset training stop condition, adjust the relevant parameters of the classifier, return to the step of classifying the rectangular channel fluid image sample and the grayscale feature information sample through the classifier to obtain the two-phase flow type prediction result.
[0065] In a specific implementation, if the stopping condition is not met, the parameters of the classifier are adjusted according to an optimization algorithm, such as gradient descent, random search, etc. After the parameters are adjusted, return to S203 and reclassify to update the prediction result and continue training.
[0066] S207: When the loss function values of all the above classifiers meet the preset training stop conditions, stop the training to obtain the trained integrated learning model.
[0067] In the specific implementation, the above steps are repeated for each classifier until the loss function values of all classifiers meet the preset training stop condition. Once the loss function values of all classifiers meet the condition, the training process is stopped. This means that the classifier has been trained to the best state, and then the trained ensemble learning model can be obtained.
[0068] The above-mentioned implementation method of the embodiment of the present application obtains an initial training sample set including multiple training samples, and for each classifier in the initial integrated learning model, randomly extracts multiple training samples from the above-mentioned initial training sample set to form a training sample set corresponding to the classifier. Then, based on the rectangular channel fluid image samples and grayscale feature information samples in the training samples, classification is performed through the classifier to obtain the two-phase flow type prediction result, and then the corresponding loss function value is determined, so as to train the models in each classifier and finally obtain a suitable integrated learning model.
[0069] In order to obtain a suitable K-nearest neighbor algorithm classifier, in some implementations, when the classifier is the K-nearest neighbor algorithm, the above S203 may include the following steps.
[0070] The above grayscale feature information samples are used as the input of the K nearest neighbor algorithm to obtain the two-phase flow pattern prediction results.
[0071] The above S206 may include: When the loss function value of the above classifier does not meet the preset training stop condition, adjust the K value of the K nearest neighbor algorithm, return to the step of using the above grayscale feature information as the input of the K nearest neighbor algorithm to obtain the two-phase flow pattern prediction result.
[0072] In the specific implementation, after the K nearest neighbor model makes a prediction, the corresponding loss function value, such as accuracy, cross entropy, etc., is calculated to evaluate the performance of the prediction result. It is determined whether the loss function value meets the preset training stop condition. If not, the K value is adjusted and the appropriate K value is selected according to the current loss function value. Specifically, the K value can be selected using fixed increment adjustment, random adjustment or grid search methods. Then the K value of the K nearest neighbor classifier is updated and the new K value is used for reclassification.
[0073] The above-mentioned implementation method of the embodiment of the present application obtains the two-phase flow type prediction result by using the above-mentioned grayscale feature information sample as the input of the K-nearest neighbor algorithm when the above-mentioned classifier is the K-nearest neighbor algorithm. Then, when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, the K value of the K-nearest neighbor algorithm is adjusted to train the K-nearest neighbor algorithm to obtain a suitable K-nearest neighbor algorithm classifier.
[0074] In order to obtain a suitable convolutional neural network classifier, in some implementations, when the classifier is a convolutional neural network, the above S203 may include: The above rectangular channel fluid image samples are used as the input of the convolutional neural network to obtain the two-phase flow pattern prediction results.
[0075] The above S206 may include: When the loss function value of the above-mentioned classifier does not meet the preset training stop condition, the model parameters in the above-mentioned convolutional neural network are adjusted, and the step of returning to using the above-mentioned rectangular channel fluid image sample as the input of the convolutional neural network to obtain the two-phase flow pattern prediction result is returned.
[0076] In a specific implementation, a rectangular channel fluid image sample is input into a convolutional neural network to obtain a prediction result, and a loss function value is calculated based on the prediction result. If the loss function value does not meet the preset conditions, the model parameters in the convolutional neural network are adjusted. After adjusting the model parameters, the above process is repeated until the loss function meets the preset conditions, and the training of the convolutional neural network is completed.
[0077] The above-mentioned implementation method of the embodiment of the present application obtains a two-phase flow type prediction result by using the above-mentioned rectangular channel fluid image sample as the input of the convolutional neural network when the above-mentioned classifier is a convolutional neural network. Then, when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, the model parameters in the above-mentioned convolutional neural network are adjusted to train the convolutional neural network to obtain a suitable convolutional neural network classifier.
[0078] In order to obtain a suitable convolutional neural network classifier, in some embodiments, the above S103 may include the following steps: S1031 to S1033.
[0079] S1031: Input the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset integrated learning model.
[0080] In the specific implementation, first prepare the visualization image and the corresponding grayscale feature information. The visualization image can be preprocessed into a format suitable for input, such as uniform size and normalization. The grayscale feature information can be extracted by the image processing algorithm to form a feature vector. Select a variety of classifiers to form an ensemble learning model. The types of classifiers can specifically include K nearest neighbor algorithm, decision tree, support vector machine and convolutional neural network. Input the visualization image and grayscale features into each classifier in the preset ensemble learning model.
[0081] S1032: When the above classifier is a K-nearest neighbor algorithm, classification is performed using the K-nearest neighbor algorithm according to the above grayscale feature information to determine the two-phase flow pattern prediction category corresponding to the classifier.
[0082] In the specific implementation, when the classifier is the K nearest neighbor algorithm, grayscale feature information is used for classification. KNN determines the category of a new sample by calculating the distance between the feature information of the new sample and other samples, and obtains the corresponding two-phase flow pattern prediction category.
[0083] S1033: In the case where the above-mentioned classifier is a convolutional neural network, the above-mentioned visualization image is input into the convolutional neural network, and the two-phase flow pattern prediction category corresponding to the classifier is determined according to the classification identifier output by the above-mentioned convolutional neural network.
[0084] In the specific implementation, when the selected classifier is a convolutional neural network, the visualization image needs to be directly input into the convolutional neural network. The convolutional neural network will extract and classify the image features according to its internal weights, and then determine the two-phase flow type prediction category corresponding to the classifier.
[0085] The above-mentioned implementation method of the embodiment of the present application inputs the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset integrated learning model, and then performs different processing according to different situations where the classifier is a K-nearest neighbor algorithm and the classifier is a convolutional neural network, so as to obtain a more reasonable two-phase flow type prediction category.
[0086] In one embodiment of the present application, after obtaining the flow images of the two-phase flow experiment, the images are uniformly batch-cropped and gray-scaled for subsequent data processing. Each image is labeled with a corresponding label according to the flow type. The label can be represented by 0, 1, 2, and 3, where 0 represents bubbly flow, 1 represents plug flow, 2 represents stirring flow, and 3 represents annular flow. As the boiling develops, the bubbles gradually increase. The bubbly flow bubbles labeled 0 are small and messy, and the bubbles are clearly visible. The plug flow bubbles labeled 1 gradually increase, and the bubbles are clearer. The stirring flow bubbles labeled 2 are partially connected and have some small bubbles. The annular flow bubbles labeled 3 are connected and have almost no small bubbles. Since the bubbles in the picture will affect the distribution of the grayscale value of the picture, the category of the fluid in the rectangular channel can be judged based on the grayscale features in the picture.
[0087] Specifically, the grayscale histogram of the image can be used as a discrete function of the grayscale level To express:
[0088] Among them, i represents the gray level, L represents the range and type of gray level, Refers to the number of pixels with gray level i in the image, and N refers to the number of image pixel samples. The gray histogram describes the ratio of the number of pixels with this gray level to the total number of pixels in the image. Different flow images have different characteristics. During the boiling process, from bubbling flow to plug flow to stirring flow and then to annular flow, the bubbles become larger and larger and gradually connect into one piece. With the change of flow pattern, the grayscale white area becomes more and more, and the gray-black area becomes less and less.
[0089] Grayscale features specifically include grayscale mean ,variance , smoothness , gray value third-order moment ,energy and entropy The mean reflects the average grayscale value of an image, and the calculation formula is as follows:
[0090] The calculation formula of the n-th moment of gray value is:
[0091] When n=3, the calculated third-order moment is the gray value third-order moment When n=2, the second-order moment is calculated as the variance. = , the variance reflects the discrete distribution of the grayscale of an image in terms of numerical values. Using variance to calculate smoothness The smoothness calculation formula is as follows. The smoothness range is 0-1. The closer to 0, the smoother the grayscale changes, and the closer to 1, the larger the grayscale changes.
[0092]
[0093] energy It reflects the uniformity of grayscale distribution. When the grayscale distribution is more uniform, the energy is relatively large, and when the grayscale distribution is more discrete, the energy is relatively small. It can be obtained by the following formula:
[0094] entropy Reflects the uniformity of the distribution of the grayscale histogram:
[0095] The above six statistics are calculated to form a feature vector and the corresponding grayscale feature information is obtained.
[0096] Among the multiple classifiers in the preset ensemble learning model, the types of classifiers include K-nearest neighbor algorithm and convolutional neural network. When using the K-nearest neighbor algorithm, each sample can be represented by its k nearest neighbors. The core of the algorithm is that a sample is most similar to k samples in the data set. If most of the k samples belong to a certain category, then the sample belongs to this category.
[0097] Convolutional Neural Networks (CNN) are often used in the field of image classification and processing. The original image can be directly input for classification. The core of the convolutional neural network is the convolution layer, and the core part of the convolution layer is the convolution operation. The operation of performing inner product between the image and the convolution kernel is the so-called convolution operation. In CNN, the convolution kernel performs convolution calculation on the local input data. After calculating the local data in a data window, the data window is continuously translated and slid according to the step size until all the data is calculated. Specifically, a uniformly cropped grayscale image can be input, and the convolution layer performs a two-dimensional convolution operation on the image, and the convolution kernel slides on the image. The convolution layer is alternately connected to the pooling layer, and the fully connected layer is connected to the last convolution layer. Some neurons are discarded with a certain probability to prevent overfitting. Finally, the flow classification result is output according to the calculation result of the fully connected layer.
[0098] For the above two classifiers, the use of ensemble algorithms can improve the accuracy and stability of the model by enhancing the diversity of the model and reduce the generalization error. Specifically, the bootstrap aggregating algorithm (bagging) can be used as an ensemble algorithm, such as Figure 3As shown, there is no dependency between each classifier in the integrated algorithm and they can be generated in parallel. The process specifically includes the following steps: S301 to S303.
[0099] S301: Obtain n training samples by performing n random sampling on the original training data.
[0100] The training set of individual weak classifiers in bagging is obtained by random sampling, and each weak classifier has a corresponding training set.
[0101] S302: n classifiers are independently trained according to the n training samples.
[0102] S303: The n classifiers are combined through a strategy to obtain a final strong classifier.
[0103] For classification problems, the combination strategy generally uses the voting method, that is, the category with the largest number of prediction results for samples by n classifiers is the final classification category.
[0104] The CNN data set is the corresponding image, and the k-nearest neighbor algorithm data set is the extracted grayscale histogram features. The two data sets are matched to each other to ensure that the divided training set and test set are consistent. The hybrid integration model can be composed of 10 CNN algorithm modules and 20 k-nearest neighbor algorithm modules. The CNN model is complex and can learn the main features of the image and has a high accuracy in identifying flow types, but it takes a long time. The k-nearest neighbor algorithm is relatively simple, has a short training time, and can be quickly identified, but the recognition accuracy is slightly lower. Bagging is used to hybridize KNN and CNN, taking into account both prediction accuracy and prediction speed.
[0105] Based on the rectangular channel two-phase flow pattern identification method provided in the above embodiment, the present application also provides a specific implementation of a rectangular channel two-phase flow pattern identification device. Please refer to the following embodiment.
[0106] See first Figure 4 The rectangular channel two-phase flow pattern identification device 400 provided in the embodiment of the present application includes the following modules: The acquisition module 401 is used to acquire a visualized image of the fluid in the rectangular channel of the heat exchange system.
[0107] The extraction module 402 is used to extract the grayscale features in the above-mentioned visualization image to obtain corresponding grayscale feature information.
[0108] The classification module 403 is used to input the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset integrated learning model, and classify them through each classifier in the above-mentioned preset integrated learning model respectively to determine the two-phase flow type prediction category corresponding to each classifier. The types of the above-mentioned multiple classifiers include K-nearest neighbor algorithm and convolutional neural network.
[0109] The statistical module 404 is used to count the two-phase flow pattern prediction categories corresponding to each classifier in the above-mentioned preset integrated learning model, and determine the two-phase flow pattern prediction category with the largest number in the statistical results.
[0110] The determination module 405 is used to use the two-phase flow pattern prediction category with the largest number as the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system.
[0111] The rectangular channel two-phase flow pattern identification device provided in the embodiment of the present application obtains a visualization image of the fluid in the rectangular channel of the nuclear power system, extracts features from the visualization image, obtains corresponding grayscale feature information, and then inputs the visualization image and the grayscale feature information into a preset integrated learning model, and processes them by each K nearest neighbor algorithm or convolutional neural network classifier in the preset integrated learning model to obtain the two-phase flow pattern prediction categories corresponding to different classifiers. Finally, based on a preset combination strategy, the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the nuclear power system is determined according to the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model. The integrated learning method is used to effectively combine the advantages of the K nearest neighbor algorithm and the convolutional neural network, so that the system can process a large amount of data in a short time. By combining the results of multiple classifiers, the sensitivity of the model to a single wrong prediction is reduced, and the prediction accuracy of the model under different working conditions is enhanced.
[0112] As an implementation of the present application, the extraction module 402 includes: The grayscale unit is used to grayscale the above visualization image.
[0113] The statistical unit is used to count the grayscale value of each pixel in the grayscale visualized image.
[0114] The calculation unit is used to calculate the average value of the grayscale value of each pixel to obtain the grayscale value mean.
[0115] The calculation unit is further used to calculate the variance of the grayscale value of each pixel according to the grayscale value mean to obtain the grayscale value variance.
[0116] The calculation unit is further used to calculate the transformation speed of the gray value transformation of each pixel according to the gray value variance to obtain the gray value smoothness.
[0117] The determination unit is used to determine the gray value energy according to the distribution uniformity of the gray value of each pixel.
[0118] The determination unit is further used to calculate the negative expected value of the probability distribution logarithm of the gray value of each pixel to obtain the gray value entropy.
[0119] The above-mentioned implementation method of the embodiment of the present application grayscales the visualized image, then counts the grayscale values of each pixel in the grayscale visualized image, and then calculates the average value of the grayscale values to obtain the grayscale value mean, obtains the grayscale value variance through the grayscale value mean, calculates the transformation speed of the grayscale value transformation of each pixel according to the grayscale value variance, and obtains the grayscale value smoothness, and then determines the grayscale value energy according to the distribution uniformity of the grayscale values of each pixel, calculates the negative expected value of the probability distribution logarithm of the grayscale values of each pixel, and obtains the grayscale value entropy, and then accurately obtains the grayscale feature information including grayscale value variance, grayscale value smoothness, grayscale value energy and grayscale value entropy.
[0120] As an implementation of the present application, the rectangular channel two-phase flow pattern identification device 400 further includes: The acquisition module is used to acquire an initial training sample set; the training sample set includes a plurality of training samples, each of which includes a rectangular channel fluid image sample and a grayscale feature information sample, as well as a corresponding category label.
[0121] The extraction module is used to randomly extract multiple training samples from the above initial training sample set to form a training sample set corresponding to the classifier.
[0122] The classification module is used to classify the rectangular channel fluid image samples and the grayscale feature information samples through a classifier to obtain a two-phase flow pattern prediction result.
[0123] The determination module is used to determine the loss function value of the classifier according to the difference between the two-phase flow pattern prediction result and the corresponding category label.
[0124] The adjustment module is used to adjust the relevant parameters of the above-mentioned classifier when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, return the steps of classifying the above-mentioned rectangular channel fluid image sample and the above-mentioned grayscale feature information sample through the classifier to obtain the two-phase flow type prediction result.
[0125] The determination module is also used to stop training when the loss function values of each of the above classifiers meet the preset training stop conditions to obtain the trained integrated learning model.
[0126] The above-mentioned implementation method of the embodiment of the present application obtains an initial training sample set including multiple training samples, and for each classifier in the initial integrated learning model, randomly extracts multiple training samples from the above-mentioned initial training sample set to form a training sample set corresponding to the classifier. Then, based on the rectangular channel fluid image samples and grayscale feature information samples in the training samples, classification is performed through the classifier to obtain the two-phase flow type prediction result, and then the corresponding loss function value is determined, so as to train the models in each classifier and finally obtain a suitable integrated learning model.
[0127] As an implementation of the present application, the classification module includes: The determination unit is used to use the grayscale feature information sample as the input of the K nearest neighbor algorithm to obtain the two-phase flow pattern prediction result.
[0128] Adjustment modules, including: An adjustment unit, used for adjusting the K value of the K nearest neighbor algorithm when the loss function value of the classifier does not meet the preset training stop condition, and returning to the step of using the gray feature information as the input of the K nearest neighbor algorithm to obtain the two-phase flow pattern prediction result; The above-mentioned implementation method of the embodiment of the present application obtains the two-phase flow type prediction result by using the above-mentioned grayscale feature information sample as the input of the K-nearest neighbor algorithm when the above-mentioned classifier is the K-nearest neighbor algorithm. Then, when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, the K value of the K-nearest neighbor algorithm is adjusted to train the K-nearest neighbor algorithm to obtain a suitable K-nearest neighbor algorithm classifier.
[0129] As an implementation of the present application, the classification module includes: The determination unit is used to use the rectangular channel fluid image sample as the input of the convolutional neural network to obtain the two-phase flow pattern prediction result.
[0130] Adjustment modules, including: The adjustment unit is used to adjust the model parameters in the above-mentioned convolutional neural network when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, and return to the step of using the above-mentioned rectangular channel fluid image sample as the input of the convolutional neural network to obtain the two-phase flow pattern prediction result.
[0131] The above-mentioned implementation method of the embodiment of the present application obtains a two-phase flow type prediction result by using the above-mentioned rectangular channel fluid image sample as the input of the convolutional neural network when the above-mentioned classifier is a convolutional neural network. Then, when the loss function value of the above-mentioned classifier does not meet the preset training stop condition, the model parameters in the above-mentioned convolutional neural network are adjusted to train the convolutional neural network to obtain a suitable convolutional neural network classifier.
[0132] As an implementation of the present application, the classification module 403 includes: An input unit is used to input the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset integrated learning model.
[0133] The classification unit is used to classify the grayscale feature information by using the K nearest neighbor algorithm when the classifier is the K nearest neighbor algorithm, so as to determine the two-phase flow pattern prediction category corresponding to the classifier.
[0134] The classification unit is also used to input the above-mentioned visualization image into the convolutional neural network when the above-mentioned classifier is a convolutional neural network, and determine the two-phase flow type prediction category corresponding to the classifier according to the classification identifier output by the above-mentioned convolutional neural network.
[0135] The above-mentioned implementation method of the embodiment of the present application inputs the above-mentioned visualization image and the above-mentioned grayscale feature information into multiple classifiers of a preset integrated learning model, and then performs different processing according to different situations where the classifier is a K-nearest neighbor algorithm and the classifier is a convolutional neural network, so as to obtain a more reasonable two-phase flow type prediction category.
[0136] The various modules in the rectangular channel two-phase flow pattern identification device provided in the embodiment of the present application can implement the various steps in the above-mentioned rectangular channel two-phase flow pattern identification method and achieve the corresponding effects. For the sake of concise description, they will not be repeated here.
[0137] Figure 5 A schematic diagram of the structure of the rectangular channel two-phase flow pattern identification hardware provided in an embodiment of the present application is shown.
[0138] The two-phase flow pattern identification device in a rectangular channel may include a processor 501 and a memory 502 storing computer program instructions.
[0139] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0140] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.
[0141] The memory may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the rectangular channel two-phase flow pattern identification method according to any one embodiment of the present disclosure.
[0142] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement any one of the two-phase flow pattern identification methods in the rectangular channel in the above embodiments.
[0143] In one example, the rectangular channel two-phase flow pattern identification device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0144] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0145] Bus 510 includes hardware, software or both, and couples the components of online data traffic billing equipment to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnect (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. Where appropriate, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0146] In addition, in combination with the method for identifying two-phase flow patterns in a rectangular channel in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the methods for identifying two-phase flow patterns in a rectangular channel in the above embodiment is implemented.
[0147] An embodiment of the present application also provides a computer program product, including a computer program, which, when processed and executed, implements any one of the methods for identifying two-phase flow patterns in a rectangular channel in the above-mentioned embodiments.
[0148] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0149] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0150] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0151] Aspects of the present disclosure are described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0152] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for identifying two-phase flow patterns in a rectangular channel, characterized in that: include: Obtain visualization of the flow in a rectangular channel of a heat exchange system; Extracting grayscale features in the visualized image to obtain corresponding grayscale feature information; Inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, respectively performing classification by each classifier in the preset ensemble learning model, and determining a two-phase flow pattern prediction category corresponding to each classifier, wherein the types of the plurality of classifiers include a K nearest neighbor algorithm and a convolutional neural network; Counting the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model, and determining the two-phase flow pattern prediction category with the largest number in the statistical results; The two-phase flow pattern prediction category with the largest number is used as the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the heat exchange system.
2. The rectangular channel two-phase flow pattern identification method according to claim 1 is characterized in that: The grayscale feature information includes grayscale value variance, grayscale value smoothness, grayscale value energy and grayscale value entropy. The grayscale features in the visualized image are extracted to obtain corresponding grayscale feature information, including: Gray-scaling the visualized image; Counting the grayscale value of each pixel in the grayscale visualized image; Calculate the average value of the grayscale value of each pixel to obtain a grayscale value mean; Calculating the variance of the grayscale value of each pixel according to the grayscale value mean to obtain the grayscale value variance; Calculate the transformation speed of the gray value transformation of each pixel according to the gray value variance to obtain the gray value smoothness; Determining the gray value energy according to the distribution uniformity of the gray value of each pixel; The negative expected value of the probability distribution logarithm of the gray value of each pixel is calculated to obtain the gray value entropy.
3. The rectangular channel two-phase flow pattern identification method according to claim 2 is characterized in that: The step of calculating the transformation speed of the grayscale value transformation of each pixel according to the grayscale value variance to obtain the grayscale value smoothness includes: The transformation speed of each pixel gray value transformation is calculated by the following formula to obtain the gray value smoothness: in, is the gray value smoothness, is the gray value variance.
4. The rectangular channel two-phase flow pattern identification method according to claim 1 is characterized in that: Before inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset integrated learning model, performing classification by each classifier in the preset integrated learning model, and determining the two-phase flow pattern prediction category corresponding to each classifier, the method further includes: Acquire an initial training sample set; the training sample set includes a plurality of training samples, each of which includes a rectangular channel fluid image sample and a grayscale feature information sample, as well as a corresponding category label; For each classifier in the initial ensemble learning model, perform the following steps: Randomly extract multiple training samples from the initial training sample set to form a training sample set corresponding to the classifier; For each training sample in the training sample set, perform the following steps respectively: Based on the rectangular channel fluid image samples and the grayscale feature information samples, classification is performed by a classifier to obtain a two-phase flow pattern prediction result; Determining a loss function value of a classifier according to a difference between the two-phase flow pattern prediction result and a corresponding category label; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned, and the two-phase flow pattern prediction result is obtained by classification through the classifier; When the loss function values of each of the classifiers meet the preset training stop condition, the training is stopped to obtain the trained integrated learning model.
5. The rectangular channel two-phase flow pattern identification method according to claim 4 is characterized in that: In the case where the classifier is a K-nearest neighbor algorithm, the rectangular channel fluid image sample and the grayscale feature information sample are classified by the classifier to obtain a two-phase flow pattern prediction result, including: Using the grayscale feature information sample as the input of the K nearest neighbor algorithm to obtain a two-phase flow pattern prediction result; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned and classified by the classifier to obtain the two-phase flow pattern prediction result, including: When the loss function value of the classifier does not meet the preset training stop condition, the K value of the K nearest neighbor algorithm is adjusted, and the grayscale feature information is returned as the input of the K nearest neighbor algorithm to obtain a two-phase flow pattern prediction result.
6. The rectangular channel two-phase flow pattern identification method according to claim 4 is characterized in that: In the case where the classifier is a convolutional neural network, the rectangular channel fluid image sample and the grayscale feature information sample are classified by the classifier to obtain a two-phase flow pattern prediction result, including: Using the rectangular channel fluid image sample as an input of a convolutional neural network to obtain a two-phase flow pattern prediction result; When the loss function value of the classifier does not meet the preset training stop condition, the relevant parameters of the classifier are adjusted, and the rectangular channel fluid image sample and the grayscale feature information sample are returned and classified by the classifier to obtain the two-phase flow pattern prediction result, including: When the loss function value of the classifier does not meet the preset training stop condition, the model parameters in the convolutional neural network are adjusted, and the rectangular channel fluid image sample is returned as the input of the convolutional neural network to obtain the two-phase flow pattern prediction result.
7. The method for identifying two-phase flow patterns in a rectangular channel according to any one of claims 1 to 6, characterized in that: The step of inputting the visualized image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, performing classification by each classifier in the preset ensemble learning model, and determining a two-phase flow pattern prediction category corresponding to each classifier includes: Inputting the visualized image and the grayscale feature information into multiple classifiers of a preset ensemble learning model; In the case where the classifier is a K-nearest neighbor algorithm, classification is performed using the K-nearest neighbor algorithm according to the grayscale feature information to determine a two-phase flow pattern prediction category corresponding to the classifier; In the case where the classifier is a convolutional neural network, the visualization image is input into the convolutional neural network, and the two-phase flow pattern prediction category corresponding to the classifier is determined according to the classification identifier output by the convolutional neural network.
8. A rectangular channel two-phase flow pattern identification device, characterized in that: The device comprises: An acquisition module, used for acquiring a visualization image of a fluid in a rectangular channel of a heat exchange system; An extraction module, used to extract grayscale features in the visual image to obtain corresponding grayscale feature information; A classification module, used for inputting the visualization image and the grayscale feature information into a plurality of classifiers of a preset ensemble learning model, performing classification by each classifier in the preset ensemble learning model, and determining a two-phase flow pattern prediction category corresponding to each classifier, wherein the types of the plurality of classifiers include a K-nearest neighbor algorithm and a convolutional neural network; A statistical module, used to count the two-phase flow pattern prediction categories corresponding to each classifier in the preset integrated learning model, and determine the two-phase flow pattern prediction category with the largest number in the statistical results; The determination module is used to use the two-phase flow pattern prediction category with the largest number as the classification category of the two-phase flow pattern of the fluid in the rectangular channel of the heat exchange system.
9. A rectangular channel two-phase flow pattern identification device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the rectangular channel two-phase flow pattern identification method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for identifying two-phase flow patterns in a rectangular channel as described in any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the rectangular channel two-phase flow pattern identification method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method for recognizing flow pattern of gas-liquid two-phase flow based on combination of time-frequency analysis algorithm and deep learning theory
CN108304770A
Intelligent identification method for flow pattern of gas-liquid two-phase spiral flow in horizontal circular pipe
CN116341213A
Two-phase flow pattern recognition method and device based on attention mechanism and convolutional neural network, computer equipment and storage medium
CN118072069A
Cited By
Vapor-liquid two-phase flow pattern identification method based on ensemble learning and related equipment
CN120510454A
