Two-phase flow pattern identification method based on multi-scale convolution network

文档序号:616062 发布日期:2021-05-07 浏览:2次 中文

阅读说明:本技术 一种基于多尺度卷积网络的两相流流型识别方法 (Two-phase flow pattern identification method based on multi-scale convolution network ) 是由 张国渊 王烈文 黎旭康 王杰 党佳琦 于 2021-01-25 设计创作,主要内容包括:本发明属于图像处理与深度学习技术领域,涉及高效的图像分类处理,尤其涉及一种基于多尺度卷积网络的两相流流型识别方法,其特征是:至少包括十个步骤。本文利用RBF神经网络进行图像重建,构建卷积神经网络的图像数据集,并将数据集按4:1:1的比例划分为训练集、验证集和测试集,多尺度卷积分类网络训练完成后可以使用测试集来进行网络性能的测试。它实现芯型流型和环型流型的准确识别。(The invention belongs to the technical field of image processing and deep learning, relates to high-efficiency image classification processing, and particularly relates to a two-phase flow pattern recognition method based on a multi-scale convolution network, which is characterized by comprising the following steps of: at least ten steps are included. The image reconstruction is carried out by using an RBF neural network, an image data set of a convolutional neural network is constructed, and the data set is calculated according to the following formula 4: 1: 1 into a training set, a verification set and a test set, and after the multi-scale convolution classification network training is completed, the test set can be used for testing the network performance. It realizes the accurate identification of core type flow pattern and ring type flow pattern.)

1. A two-phase flow pattern recognition method based on a multi-scale convolution network is characterized in that: at least comprises the following steps:

the method comprises the following steps: utilizing the RBF neural network to reconstruct images, constructing an image data set of the convolutional neural network, namely constructing an image data set for identifying a two-phase flow type, classifying the acquired images into a ring type flow type and a core type flow type respectively, and carrying out image reconstruction according to the ratio of 4: 1: 1, dividing the ratio into a training set, a verification set and a test set;

step two: performing Batch processing on the flow pattern images in the training set, randomly selecting 10 flow pattern images from the training set as Batch, performing down-sampling on the images to generate 256 × 256 images, and inputting the images into a multi-scale network for training;

step three: reading the Batch in the step two into a multi-scale convolution network, and extracting features on different scales through 3 convolution modules; each convolution block consists of convolution layers, an activation layer and a pooling layer, the convolution kernel size of the first convolution layer is 1, the convolution kernel size of the second convolution layer is 3, and the convolution kernel size of the third convolution layer is 5; the pooling layers are maximum pooling to retain important information and remove unimportant or useless information;

step four: for multi-scale features f in step threeiThe combination is carried out, the number of the combined channels is 128 x 3, the feature dimension is high, and the performance of the network can be effectively improved by introducing an attention mechanism;

step five: inputting the output features in the last step into a feature fusion and dimension reduction module to realize fusion and dimension reduction of features with different scales;

step six: inputting the characteristics in the fifth step into a classifier, classifying the flow pattern type of the image, outputting a core image as 0, outputting a ring image as 1, setting the parameter of Droupout as 0.5, namely randomly deleting 50% of neuron connections, reducing the fitting of the network, reducing the number of channels to 2 through a convolution layer, activating a function through a ReLU, and outputting a classification result through global adaptive pooling;

step seven: calculating the classification result and the label of the image by adopting a cross entropy loss function, and returning the calculation result, namely the loss of the network;

class in the formula represents a label value, does not participate in direct calculation, but is used as an index, and an index object is an actual category; j represents the number of categories of the classification problem;

step eight: calculating the gradient of the network parameters through random gradient descent, and updating the network through an optimizer;

step nine: fixing the updated network parameters, extracting the Batch from the data set again and inputting the extracted Batch into the network, repeating the second step to the ninth step, and updating the network parameters through continuous training so as to continuously improve the performance of the network;

step ten: and when the loss of the network is stable or the set training stopping condition is reached, stopping the training of the network and storing the trained network structure and model parameters.

2. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim, which is characterized in that: the first step is specifically operated by building an ERT two-phase flow model of 16 electrodes through Comsol simulation software.

3. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim, which is characterized in that: the three convolution modules in the third step are expressed by the following formulas:

f1=max pool(ReLU(σ(1,1)(x)))

f3=max pool(ReLU(σ(3,3)(x)))

f5=max pool(ReLU(σ(5,5)(x)))

in the above formula, fiThe feature of the convolution kernel size i is represented, the number of channels of each convolution layer is 128, the padding of convolution with the convolution kernel size 3 is 1, and the padding of convolution with the convolution kernel size 5 is 2, so that matching on the feature scale of the subsequent step is guaranteed.

4. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim 1, which is characterized in that: the fourth step comprises the following steps: let x be an element of RW×H×CW, H, C is the width, height and channel number of the feature map for the output of a certain convolution layer;

x is subjected to GAP global average pooling operation to obtain 1 × 1 × C channel description;

then, a weight coefficient of each channel is obtained through a down-sampling layer and an up-sampling layer;

and multiplying the weight coefficient by the original characteristic to obtain a new characteristic after scaling, and performing weighted distribution on the characteristics of different channels again, wherein the sigma is a Sigmoid function.

5. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim 1, which is characterized in that: the fourth step comprises the following steps: the input dimension is first reduced to 256 by a first convolution and then to 128 by a second convolution, the calculation is as follows:

fConv1=(ReLU(σ(3,3)(x)))

fConv2=max pool(ReLU(σ(3,3)(x)))。

6. the method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim 1, which is characterized in that: the second step comprises the following steps: collecting boundary potential data as training samples and inputting the training samples into an RBF neural network model for training;

inputting a test sample into the trained model and carrying out image reconstruction;

and (3) adjusting speed parameters of a newrb function in the RBF neural network model to enable the image reconstruction results to have differences every time, and constructing an image data set for the convolutional neural network to identify the flow pattern.

7. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim 6, which is characterized in that: the image data set comprises a total of 400 images, wherein the total number of the images is 200 ring images and 200 core images, and the size of each image is 875 × 655; the core image is labeled 0 and the ring image is labeled 1.

8. The method for identifying the flow pattern of the two-phase flow based on the multi-scale convolutional network as claimed in claim 6, which is characterized in that: the image dataset was as per 4: 1: the proportion of 1 is divided into a training set, a verification set and a tester, wherein the training set is used for training network parameters, the verification set is used for observing the convergence condition of the network in the training process, and the test set is used for testing the classification performance of the model.

Technical Field

The invention belongs to the technical field of image processing and deep learning, relates to efficient image classification processing, and particularly relates to a two-phase flow pattern identification method based on a multi-scale convolution network.

Background

The two-phase flow phenomenon widely exists in industrial production processes, and as a complex fluid flow phenomenon, a safety problem may be induced, and even the stable and reliable operation of the whole system or equipment may be affected. Therefore, it is the core of constant attention in the industry and science and technology to acquire the physical properties. In the physical property research of two-phase flow, the research of two-phase flow pattern has been a key point in the industrial production process. With the development of the neural network, the traditional BP, wavelet and RBF neural networks are successively applied to two-phase flow image reconstruction, and because the neural network algorithms have self limitations, the fidelity of the two-phase flow image reconstruction is not high, so that the two-phase flow pattern identification is carried out through the convolutional neural network on the basis of the image reconstruction. The data set constructed for two-phase flow pattern recognition can be obtained by reconstructing an RBF neural network image, and the principle of the data set can be obtained by referring to the positive and negative problems of two-phase flow measurement based on the ERT technology and the experimental research [ D ] the university of electronic technology of SiAn 2020 ]. The specific operation method comprises the steps of building an ERT two-phase flow model with 16 electrodes through Comsol simulation software, collecting boundary potential data as training samples, inputting the training samples into an RBF neural network model for training, finally inputting test samples into the trained model for image reconstruction, and enabling image reconstruction results to be different each time by adjusting speed parameters of a newrb function in the RBF neural network model (different speed parameter settings lead to different parameters of the trained RBF neural network model and further different image reconstruction results), so that an image data set for flow pattern recognition of a convolutional neural network can be built.

At present, a great amount of convolutional neural networks are applied to image recognition, and image features can be automatically extracted, so researchers in various fields also develop convolutional network models for solving practical problems related to the fields based on the existing convolutional network models. For example, the patent of the invention with the patent authorization number of CN 105975931B and the name of "a convolutional neural network face recognition method based on multi-scale pooling" discloses a network model for extracting face image features to realize face recognition by using multi-scale pooling. In the method, a convolution and multi-scale pooling strategy is adopted for feature extraction, and all features are input into a full connection layer finally. The network model solves the problem that the image input size can be unfixed, and greatly improves the performance of the network, thereby promoting the application of multi-scale pooling in the convolutional network. However, if the network model in the invention is applied to two-phase flow pattern recognition, the following defects can exist: (1) the image features are not fully extracted, and the identification accuracy is low. The convolution layer of the network model only uses one convolution kernel to extract the features, so that much information of the image can be lost, for the two-phase flow image, the difference of the features is small, and if the feature extraction is insufficient, the recognition error can be caused; (2) the network model still employs a fully connected layer. Because the feature map (feature map) generated after convolution is flattened before entering the full-connection layer, the spatial position information of the feature map is lost, and in addition, all pixels in the full-connection layer are fully connected, so that overfitting is easy. For example, patent No. CN 106570564B, entitled "deep network-based multi-scale pedestrian detection method", discloses a VGG model trained based on ImageNet database, and constructs three large, medium, and small-scale convolutional neural network models. The network fully excavates the characteristics of pedestrians with different scales in the image through three rows of convolutional neural networks, so that the pedestrian detection performance is remarkably improved. However, if the network in the invention is applied to two-phase flow pattern identification, the following defects exist: (1) the network generalization performance is poor. The network in the invention uses a VGG model, the network has large requirement (at least 10000 pieces) on the training sample data volume, but the image data set of two-phase flow pattern recognition is within 1000 pieces, so that the generalization capability of the network is weak, and the recognition effect is poor; (2) the VGG model has a large number of layers, reaches 19 layers, and causes long training time, so the requirement of two-phase flow pattern recognition cannot be met in real time.

Disclosure of Invention

The invention aims to provide a two-phase flow pattern identification method based on a multi-scale convolutional network aiming at the defect that the conventional convolutional network model is used for identifying a two-phase flow pattern so as to accurately identify a core flow pattern and an annular flow pattern.

The invention provides a two-phase flow pattern recognition method based on a multi-scale convolution network, which is characterized by comprising the following steps: at least comprises the following steps:

the method comprises the following steps: utilizing the RBF neural network to reconstruct images, constructing an image data set of the convolutional neural network, namely constructing an image data set for identifying a two-phase flow type, classifying the acquired images into a ring type flow type and a core type flow type respectively, and carrying out image reconstruction according to the ratio of 4: 1: 1, dividing the ratio into a training set, a verification set and a test set;

step two: performing Batch processing on the flow pattern images in the training set, randomly selecting 10 flow pattern images from the training set as Batch, performing down-sampling on the images to generate 256 × 256 images, and inputting the images into a multi-scale network for training;

step three: reading the Batch in the step two into a multi-scale convolution network, and extracting features on different scales through 3 convolution modules; each convolution block consists of convolution layers, an activation layer and a pooling layer, the convolution kernel size of the first convolution layer is 1, the convolution kernel size of the second convolution layer is 3, and the convolution kernel size of the third convolution layer is 5; the pooling layers are maximum pooling to retain important information and remove unimportant or useless information;

step four: for multi-scale features f in step threeiThe combination is carried out, the number of the combined channels is 128 x 3, the feature dimension is high, and the performance of the network can be effectively improved by introducing an attention mechanism;

step five: inputting the output features in the last step into a feature fusion and dimension reduction module to realize fusion and dimension reduction of features with different scales;

step six: inputting the characteristics in the fifth step into a classifier, classifying the flow pattern type of the image, outputting a core image as 0, outputting a ring image as 1, setting the parameter of Droupout as 0.5, namely randomly deleting 50% of neuron connections, reducing the fitting of the network, reducing the number of channels to 2 through a convolution layer, activating a function through a ReLU, and outputting a classification result through global adaptive pooling;

step seven: calculating the classification result and the label of the image by adopting a cross entropy loss function, and returning the calculation result, namely the loss of the network;

class in the formula represents a label value, does not participate in direct calculation, but is used as an index, and an index object is an actual category; j represents the number of categories of the classification problem;

step eight: calculating the gradient of the network parameters through random gradient descent, and updating the network through an optimizer;

step nine: fixing the updated network parameters, extracting the Batch from the data set again and inputting the extracted Batch into the network, repeating the second step to the ninth step, and updating the network parameters through continuous training so as to continuously improve the performance of the network;

step ten: and when the loss of the network is stable or the set training stopping condition is reached, stopping the training of the network and storing the trained network structure and model parameters.

The first step is specifically operated in a way that an ERT two-phase flow model of 16 electrodes is built through Comsol simulation software;

the three convolution modules in the third step are expressed by the following formulas:

f1=maxpool(ReLU(σ(1,1)(x)))

f3=maxpool(ReLU(σ(3,3)(x)))

f5=maxpool(ReLU(σ(5,5)(x)))

in the above formula, fiThe feature of the convolution kernel size i is represented, the number of channels of each convolution layer is 128, the padding of convolution with the convolution kernel size 3 is 1, and the padding of convolution with the convolution kernel size 5 is 2, so that matching on the feature scale of the subsequent step is guaranteed.

The fourth step comprises the following steps: let x be an element of RW×H×CW, H, C is the width, height and channel number of the feature map for the output of a certain convolution layer;

x is subjected to GAP global average pooling operation to obtain 1 × 1 × C channel description;

then, a weight coefficient of each channel is obtained through a down-sampling layer and an up-sampling layer;

and multiplying the weight coefficient by the original characteristic to obtain a new characteristic after scaling, and performing weighted distribution on the characteristics of different channels again, wherein the sigma is a Sigmoid function.

The fourth step comprises the following steps: the input dimension is first reduced to 256 by a first convolution and then to 128 by a second convolution, the calculation is as follows:

fConv1=(ReLU(σ(3,3)(x)))

fConv2=maxpool(ReLU(σ(3,3)(x)))。

the second step comprises the following steps: collecting boundary potential data as training samples and inputting the training samples into an RBF neural network model for training;

inputting a test sample into the trained model and carrying out image reconstruction;

and (3) adjusting speed parameters of a newrb function in the RBF neural network model to enable the image reconstruction results to have differences every time, and constructing an image data set for the convolutional neural network to identify the flow pattern.

The image data set comprises a total of 400 images, wherein the total number of the images is 200 ring images and 200 core images, and the size of each image is 875 × 655; the core image is labeled 0 and the ring image is labeled 1.

The image dataset was as per 4: 1: the proportion of 1 is divided into a training set, a verification set and a tester, wherein the training set is used for training network parameters, the verification set is used for observing the convergence condition of the network in the training process, and the test set is used for testing the classification performance of the model.

The method is used for two-phase flow type identification, constructs a special flow type image data set, designs a multi-scale light-weight convolution classification network, and has the following advantages:

1. the network model provided by the invention is a lightweight convolutional neural network, and compared with the traditional VGGNet and ResNet convolutional neural network models, the network model has the advantages that the calculation amount of parameters is much smaller, and the operation efficiency is higher.

2. The lightweight multi-scale convolution network provided by the invention can extract different scale characteristics of images, a certain performance is reserved for more detailed flow pattern identification while the core flow pattern and the annular flow pattern are correctly classified, and the more detailed flow pattern identification can be realized by setting the number of output categories of a classifier in the network provided by the invention, namely, a multi-type identification task of the core flow pattern and the annular flow pattern can be realized.

3. Based on the advantage 2, the method has function expandability, and can expand to more flow patterns on the basis of the existing flow pattern identification.

Drawings

FIG. 1 is a framework diagram of a multi-scale convolution two-phase flow pattern recognition network proposed by the present invention;

FIG. 2 is a ReLU activation function image used in the present invention;

FIG. 3 is Batch in the training process;

FIG. 4 is a schematic diagram of an attention mechanism module herein.

Detailed Description

The method comprises the following specific implementation steps: a two-phase flow pattern identification method based on a multi-scale convolution network is disclosed, a frame diagram of which is shown in figure 1, and comprises the following steps:

the method comprises the following steps: utilizing the RBF neural network to reconstruct images, constructing an image data set of the convolutional neural network, namely constructing an image data set for identifying a two-phase flow type, classifying the acquired images into a ring type flow type and a core type flow type respectively, and carrying out image reconstruction according to the ratio of 4: 1: the scale of 1 is divided into a training set, a validation set, and a test set.

Specifically, an ERT two-phase flow model with 16 electrodes is built through Comsol simulation software, boundary potential data are collected and used as training samples to be input into an RBF neural network model for training, finally, test samples are input into the trained model for image reconstruction, and through adjusting speed parameters of a newrb function in the RBF neural network model (different speed parameter settings lead to different parameters of the trained RBF neural network model and further different image reconstruction results), image reconstruction results are different every time, so that an image data set for a convolutional neural network to perform flow pattern recognition can be built. The data set of the present invention has a total of 400 images, wherein there are 200 ring images and 200 core images, the core image is labeled 0, the ring image is labeled 1, and the size of each image is 875 × 655. And then according to the following steps of 4: 1: 1 into a training set, a validation set and a tester. The training set is used for training network parameters, the verification set is used for observing the convergence condition of the network in the training process, and the test set is used for testing the classification performance of the model.

Step two: and carrying out Batch processing on the flow pattern images in the training set, randomly selecting 10 flow pattern images from the training set as Batch, carrying out downsampling on the images to generate 256 × 256 images, and inputting the images into a multi-scale network for training.

Step three: and reading the Batch in the step two into a multi-scale convolution network, and extracting features on different scales through 3 convolution modules. Each convolution block consists of convolution layers, an active layer and a pooling layer, the convolution kernel size of the first convolution layer is 1, the convolution kernel size of the second convolution layer is 3, and the convolution kernel size of the third convolution layer is 5. Pooling layers are all maximally pooled to retain important information and remove unimportant or useless information.

f1=maxpool(ReLU(σ(1,1)(x)))

f3=maxpool(ReLU(σ(3,3)(x)))

f5=maxpool(ReLU(σ(5,5)(x)))

In the above formula, fiThe feature of the convolution kernel size i is represented, the number of channels of each convolution layer is 128, the padding of convolution with the convolution kernel size 3 is 1, and the padding of convolution with the convolution kernel size 5 is 2, so that matching on the feature scale of the subsequent step is guaranteed.

Step four: for the multi-scale features in the last stepSign fiThe number of channels after combination is 128 × 3, and the feature dimension is high at this time, and the performance of the network can be effectively improved by introducing an attention mechanism, that is, the attention mechanism module in fig. 4.

Let x be an element of RW×H×CFor the output of a particular convolutional layer, W, H, C is the width, height, and number of channels of the feature map. x is subjected to GAP global average pooling operation to obtain 1 x C channel description, then a down-sampling layer and an up-sampling layer are carried out to obtain a weight coefficient of each channel, the weight coefficient is multiplied by the original characteristics to obtain new characteristics after scaling, the whole process actually carries out weighting distribution again on the characteristics of different channels, and sigma is a Sigmoid function.

Step five: and inputting the output features in the last step into a feature fusion and dimension reduction module to realize fusion and dimension reduction of features with different scales. The module firstly reduces the input dimensionality to 256 through a first convolution, and then reduces the dimensionality to 128 through a second convolution, and the calculation process is as follows:

fConv1=(ReLU(σ(3,3)(x)))

fConv2=maxpool(ReLU(σ(3,3)(x)))

step six: as shown in fig. 2, the features in step five are input into a classifier, the flow pattern classes of the images are classified, the core image is output as 0, and the ring image is output as 1. The parameter of Droupout is set to 0.5, namely 50% of neuron connections are deleted randomly, overfitting of the network is reduced, the number of channels is reduced to 2 through the convolution layer (the number of input channels is 128, the number of output channels is 2, the size of a convolution kernel is 3), and after the ReLU activation function is carried out, the classification result is output through global adaptive pooling.

Step seven: the classification result is calculated with the label of the image (core image output is 0, ring image output is 1), and the calculation result, that is, the loss of the network is returned. The invention adopts a cross entropy loss function.

Class in the formula represents a label value, does not participate in direct calculation, but is used as an index, and an index object is an actual category; j denotes the number of categories of the classification problem.

Step eight: the gradient of the network parameters is calculated by random gradient descent, and the network is updated by an optimizer. In the invention, the parameters are updated by adopting random gradient descent, the learning rate is set to be 0.001, and the momentum is set to be 0.9.

As shown in fig. 3, step nine: fixing the updated network parameters, extracting the Batch from the data set again and inputting the extracted Batch into the network, repeating the second step to the ninth step, and updating the network parameters through continuous training so as to continuously improve the performance of the network.

Step ten: and when the loss of the network is stable or the set training stopping condition is reached, stopping the training of the network and storing the trained network structure and model parameters.

The image reconstruction is carried out by using an RBF neural network, an image data set of a convolutional neural network is constructed, and the data set is calculated according to the following formula 4: 1: 1 into a training set, a verification set and a test set, and after the multi-scale convolution classification network training is completed, the test set can be used for testing the network performance. In order to improve the accuracy of flow pattern classification, firstly, multi-scale feature extraction is carried out on training data, convolution kernels with kernel sizes of (1, 1), (3, 3) and (5, 5) are respectively used for carrying out multi-scale feature extraction, a feature extraction module of each scale comprises a convolution layer, an activation layer and a pooling layer, the activation layer uses a ReLU activation function to solve the problems of gradient disappearance and gradient explosion in the training process, and the pooling layer uses maximum pooling, reduces the parameter number and accelerates the training process. And then the extracted multi-scale information is subjected to feature combination, and the channel weight of the combined high-dimensional features is adjusted through an attention mechanism, so that the network classification performance is further improved. And then, fusing and reducing the dimensions of the combined high-dimensional features by using two convolution modules to reduce the number of network parameters, wherein the first convolution module consists of a convolution layer and an activation layer, the second convolution module consists of a convolution layer, an activation layer and a pooling layer, and the pooling layer is maximum pooling, namely information which has the maximum influence on the classification result is reserved, and small and useless information on the classification result is filtered. And finally, classifying through a classifier and outputting a classification result, wherein the classifier consists of a convolutional layer, an activation layer and a self-adaptive global pooling layer.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图像识别方法和装置、存储介质和电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!