Oil-water two-phase flow pattern classification system and method based on multi-scale attention
By converting one-dimensional timing electromagnetic signals into two-dimensional images and using multi-scale attention residual network, the problem of low recognition accuracy of oil-water two-phase flow flow patterns in oil fields is solved, and water-in-water, oil-in-water, and transitions are achieved Accurate recognition of flow improves recognition rate.
Patent Information
- Application Number
- CN202411061326.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-19
AI Technical Summary
In oil fields, it is difficult for traditional methods to accurately identify the flow patterns of oil and water flow in two phases, especially during high water-bearing periods, which leads to a decrease in the accuracy of flow patterns identification, affecting the production characteristics and dynamic monitoring of oil wells.
By converting one-dimensional timing electromagnetic signals into two-dimensional images and using a multi-scale attention residual network for flow recognition, the accurate identification of three flow types: water-in-oil, oil-in-water, and transitional flow are achieved. The system includes electromagnetic signal acquisition module, preprocessing module, image encoding module, initial feature extraction module, multi-scale perception module and classification module. It uses wavelet threshold denoising, graphical differential field conversion and multi-scale attention perception layer and other technologies to construct Multi-scale attention residual network.
It improves the accuracy of oil-water two-phase flow type recognition, visualizes the flow characteristic information of electromagnetic signals, facilitates neural network training, improves recognition rate, and is suitable for other one-dimensional timing signal recognition problems.
Smart Images

Figure CN118981983A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil well measurement, and in particular to an oil-water two-phase flow pattern classification system and method based on multi-scale attention. Background Art
[0002] Most oil fields will enter a high water content period when they enter the middle and late stages of exploitation. Complex mixed flows of multiphase flows such as oil-water, oil-gas-water, etc. will occur in the oil fields. Therefore, higher requirements are placed on the measurement of oil flow characteristics in downhole vertical pipes. Among them, oil-water two-phase flow is common in oil wells of water injection oil fields. The oil-water flow pattern has a great influence on the production characteristics and dynamic monitoring of the oil wells. Therefore, flow pattern identification is an important direction of two-phase flow research.
[0003] In flow pattern identification, electromagnetic signals, as a time series, preserve the temporal structure of the vertical pipe oil-water two-phase flow observation data and are often studied and analyzed as a whole. Traditional data analysis methods include prediction, clustering, classification, and association analysis. However, due to the continuous increase in data volume and computational complexity and the continuous deepening and expansion of analysis purposes, it has become increasingly difficult to improve the accuracy of flow pattern identification using traditional methods. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a system and method for classifying oil-water two-phase flow patterns based on multi-scale attention. The system can transform one-dimensional time-series electromagnetic signals into two-dimensional images using a graphic differential field, and perform flow pattern recognition through a multi-scale attention residual network, converting the flow characteristic information in the original signal into three flow patterns: oil-in-water, water-in-oil, and transition flow, to achieve accurate recognition of the flow pattern.
[0005] To solve the above technical problems, the technical solution adopted by the present invention is: an oil-water two-phase flow type classification system based on multi-scale attention, including an electromagnetic signal acquisition module and a preprocessing module connected to each other, and a two-dimensional image encoding module, an initial feature extraction module, a multi-scale perception module and a classification module are sequentially connected after the preprocessing module, wherein the multi-scale attention residual network is sequentially composed of an initial feature extraction module, a multi-scale perception module and a classification module, the initial feature extraction module sequentially includes a first feature extraction layer and a second feature extraction layer, and the multi-scale perception module sequentially includes a first multi-scale perception layer, a second multi-scale perception layer and a third multi-scale perception layer.
[0006] The further improvement of the technical solution of the present invention is that the specific structure and function of each module are as follows:
[0007] The electromagnetic signal acquisition module includes an electromagnetic induction sensor, a 5V DC power supply, a multi-channel signal acquisition box and a PC which are connected to each other in sequence;
[0008] The preprocessing module is used to reduce the noise of the original electromagnetic signal by using wavelet threshold denoising;
[0009] The two-dimensional image encoding module is used to convert the noise-reduced electromagnetic signal into a two-dimensional image using a graphic difference field;
[0010] The first feature extraction layer includes two 3*3 convolutional layers with 64 output channels and ReLU activation functions, one attention layer with 64 output channels, and one maximum pooling layer with a stride of 2 from input to output.
[0011] The second feature extraction layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output.
[0012] The attention layer of the initial feature extraction module is used to adjust the output weight, and includes 1 1*1 global average pooling layer, 1 fully connected layer, 1 ReLU activation function layer, 1 fully connected layer, and 1 Sigmoid activation function layer in order from input to output;
[0013] The first multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 256, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output.
[0014] The second multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 512 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output.
[0015] The third multi-scale perception layer includes two multi-scale attention perception layers with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output.
[0016] The attention layer of the multi-scale perception module has the same structure as the attention layer in the initial feature extraction module. The multi-scale attention perception layer includes, from input to output, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 2x downsampling layer, 1 4x downsampling layer, 1 8x downsampling layer, 3 1*1 convolution layers and 3 attention layers, 3 2x upsampling operations, and 1 addition operation.
[0017] The classification module includes, from input to output, a 7*7 adaptive average pooling layer, a flatten function, two fully connected layers with 4096 output channels, a ReLU activation function, a Dropout layer, and a fully connected layer with 4096 output channels.
[0018] A method for classifying oil-water two-phase flow patterns based on multi-scale attention, the specific steps are as follows:
[0019] Step 1: Use the electromagnetic signal acquisition module to collect the original signal;
[0020] Step 2: The original electromagnetic signal is input into the preprocessing module for preprocessing to obtain a noise-reduced signal;
[0021] Step 3: Input the pre-processed and denoised data into a two-dimensional image encoding module to convert it into a two-dimensional image;
[0022] Step 4: Input the two-dimensional image into the initial feature extraction module to perform initial feature extraction to obtain an initial feature map;
[0023] Step 5: Input the initial feature map into the multi-scale perception module for multi-scale perception to obtain a multi-scale perception feature map;
[0024] Step 6: Input the multi-scale perception feature map into the classification module for flow type classification.
[0025] The further improvement of the technical solution of the present invention is that the specific steps of step 2 are as follows:
[0026] Step 2.1: Decompose the original signal into various scales using wavelet threshold denoising;
[0027] Step 2.2: Set the wavelet coefficients belonging to noise below the threshold to zero, and keep the wavelet coefficients belonging to the signal;
[0028] Step 2.3: Use inverse wavelet transform to reconstruct the denoised signal.
[0029] The further improvement of the technical solution of the present invention is that the specific steps of step 3 are as follows:
[0030] Step 3.1: normalize the noise-reduced data signal to obtain a normalized signal value;
[0031] Step 3.2: Select a frame of data and get the graphics set Where s represents a time window, d is equivalent to the step size and time shift, and t represents the moving window;
[0032] Step 3.3: Get the graph difference set
[0033] Step 3.4: Perform zero-filling operation to construct a new set
[0034]
[0035] Step 3.5: Define the graphic difference field. For the i-th channel, define the image array as:
[0036]
[0037] I d n Represents the (n-1) sequence set corresponding to the step size d, so that the graphic difference field can generate the corresponding (n-1) channel images;
[0038] Step 3.6: For the i-th channel, define the image array as:
[0039]
[0040] in
[0041] Step 3.7: Fill The zero elements in define each channel of the image:
[0042]
[0043] in, Is Rotated 180°, ⊙ is the Hadamard product;
[0044] The further improvement of the technical solution of the present invention is that the specific steps of step 4 are as follows:
[0045] Step 4.1: Input the two-dimensional image into the first feature extraction layer to obtain a first feature extraction map;
[0046] Step 4.2: Input the first feature extraction map into the second feature extraction layer to obtain an initial feature map.
[0047] A further improvement of the technical solution of the present invention is that the processing steps in the attention layer in step 4 are specifically as follows:
[0048] Step 4.11: Get the number of channels c of the attention layer input feature map;
[0049] Step 4.12: After the attention layer input feature map is fed into the global average pooling with an output of 1*1, the result is flattened into a two-dimensional tensor;
[0050] Step 4.13: Send the flattened two-dimensional tensor to the fully connected layer, compress the number of channels to the number of input channels divided by the compression ratio, the compression ratio ratio = 16, and then send it to the output of the ReLU activation function;
[0051] Step 4.14: Send the compressed activated output features to the fully connected layer, restore the number of channels to c, and then send them to the Sigmoid activation function output;
[0052] Step 4.15: Expand the output feature map of step 4.14 to the size of the input feature map of the attention layer, and multiply it with the input feature map of the attention layer to obtain the weighted feature map representation as the output of the attention layer.
[0053] The further improvement of the technical solution of the present invention is that the specific steps of step 5 are as follows:
[0054] Step 5.1: Input the initial feature map into the first multi-scale perception layer to obtain a first multi-scale perception feature map;
[0055] Step 5.2: inputting the first multi-scale perceptual feature map into the second multi-scale perceptual layer to obtain a second multi-scale perceptual feature map;
[0056] Step 5.3: Input the second multi-scale perceptual feature map into the third multi-scale perceptual layer to obtain a multi-scale perceptual feature map.
[0057] A further improvement of the technical solution of the present invention is that the attention layer processing method in step 5 is the same as that in step 4, and the processing steps in the multi-scale attention perception layer in step 5 are specifically as follows:
[0058] Step 5.11: Get the input feature map of the multi-scale attention perception layer, input the multi-scale attention perception layer input feature map into the 3*3 convolution layer, and then output it through the batch normalization layer and ReLU activation function;
[0059] Step 5.12: Input the feature map output in the previous step into the 3*3 convolution layer, and then output it through the batch normalization layer and ReLU activation function;
[0060] Step 5.13: Perform 2x downsampling, 4x downsampling, and 8x downsampling on the feature map output in the previous step to obtain a 2x downsampling feature map, a 4x downsampling feature map, and an 8x downsampling feature map;
[0061] Step 5.14: Upsample the 8-fold downsampled feature map by 2 times, fuse it with the 4-fold downsampled feature map through a 1*1 convolutional layer, input it into the attention layer to adjust the channel weights, and then output it;
[0062] Step 5.15: Upsample the feature map output in the previous step by 2 times, fuse it with the 2 times downsampled feature map through a 1*1 convolution layer, input it into the attention layer to adjust the channel weights, and then output it;
[0063] Step 5.16: Upsample the feature map output from the previous step by a factor of 2, fuse it with the feature map output from step 5.12 through a 1*1 convolutional layer, and then input it into the attention layer to adjust the channel weights before outputting it;
[0064] Step 5.17: Add the output feature map of the previous step to the original multi-scale attention perception layer input feature map to form a residual structure, which is then activated by the ReLU function and used as the output of the multi-scale attention perception layer.
[0065] The further improvement of the technical solution of the present invention is that the specific steps of step 6 are as follows:
[0066] Step 6.1: Input the multi-scale perceptual feature map into the adaptive average pooling layer, adjust the size of the feature map to 7x7, and then expand it according to the first dimension through the fallten function and output it;
[0067] Step 6.2: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer;
[0068] Step 6.3: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer;
[0069] Step 6.4: Input the feature map output from the previous step into a fully connected layer with 3 output channels, whose output is the output of the multi-scale attention residual network to obtain the flow classification result.
[0070] Due to the adoption of the above technical scheme, the technical progress achieved by the present invention is: converting a one-dimensional electromagnetic signal into a two-dimensional image through the graphic differential field technology, using the graphic differential field enhancement to extract the flow characteristic information of the electromagnetic signal, and retaining the time domain and frequency domain characteristics of the electromagnetic signal, so that the electromagnetic signal can be visualized and easy to train the neural network.
[0071] By constructing a multi-scale attention residual network, the channel features of the input feature map are enhanced through the attention layer to improve the recognition rate of the network. The input feature map is downsampled at different scales through the multi-scale attention perception layer to obtain a feature representation that integrates multi-scale information, helping the network to better capture information at different scales. The residual structure solves the gradient vanishing problem and increases the number of network layers.
[0072] In summary, the present invention uses an electromagnetic signal measurement system to collect original electromagnetic signals, converts one-dimensional electromagnetic signals into two-dimensional images using a graphic differential field, retains the time domain and frequency domain characteristics of the electromagnetic signal while enhancing the effect of extracting the flow characteristic information of the electromagnetic signal, divides the image into three flow types according to the working conditions: oil-in-water, water-in-oil, and transition flow, and then trains through a multi-scale attention residual network to obtain an oil-water two-phase flow type recognition system with a high recognition rate. This system has superiority in the field of recognition and is easy to promote and use in other one-dimensional time series signal recognition problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0074] Figure 1 It is a schematic diagram of the structure of the classification system of the present invention;
[0075] Figure 2 It is a schematic diagram of the process of the classification method of the present invention;
[0076] Figure 3 It is a schematic diagram of the flow type classification by means of electromagnetic signals in the present invention; DETAILED DESCRIPTION
[0077] The present invention is further described in detail below in conjunction with embodiments:
[0078] like Figure 1 As shown, it is a structural schematic diagram of an oil-water two-phase flow pattern classification system based on multi-scale attention, including an electromagnetic signal acquisition module and a preprocessing module connected to each other, a two-dimensional image encoding module connected to the preprocessing module, and a multi-scale attention residual network connected to the two-dimensional image encoding module. The multi-scale attention residual network specifically includes an initial feature extraction module, a multi-scale perception module and a classification module connected in sequence, wherein the multi-scale attention residual network is composed of an initial feature extraction module, a multi-scale perception module and a classification module in sequence, the initial feature extraction module includes a first feature extraction layer and a second feature extraction layer in sequence, and the multi-scale perception module includes a first multi-scale perception layer, a second multi-scale perception layer and a third multi-scale perception layer in sequence.
[0079] The specific structure and function of each module are as follows: the electromagnetic signal acquisition module includes, in sequence, an electromagnetic induction sensor, a 5V DC power supply, a multi-channel signal acquisition box and a PC that are connected to each other and are arranged in the oil field flow pattern measurement pipeline;
[0080] The preprocessing module is used to reduce the noise of the original electromagnetic signal by using wavelet threshold denoising;
[0081] The two-dimensional image encoding module is used to convert the noise-reduced electromagnetic signal into a two-dimensional image using a graphic difference field;
[0082] The first feature extraction layer includes two 3*3 convolutional layers with 64 output channels and ReLU activation functions, one attention layer with 64 output channels, and one maximum pooling layer with a stride of 2 from input to output.
[0083] The second feature extraction layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output.
[0084] The attention layer of the initial feature extraction module is used to adjust the output weight, and includes 1 1*1 global average pooling layer, 1 fully connected layer, 1 ReLU activation function layer, 1 fully connected layer, and 1 Sigmoid activation function layer in order from input to output;
[0085] The first multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 256, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output.
[0086] The second multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 512 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output.
[0087] The third multi-scale perception layer includes two multi-scale attention perception layers with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output.
[0088] The attention layer of the multi-scale perception module has the same structure as the attention layer in the initial feature extraction module. The multi-scale attention perception layer includes, from input to output, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 2x downsampling layer, 1 4x downsampling layer, 1 8x downsampling layer, 3 1*1 convolution layers and 3 attention layers, 3 2x upsampling operations, and 1 addition operation.
[0089] The classification module includes, from input to output, a 7*7 adaptive average pooling layer, a flatten function, two fully connected layers with 4096 output channels, a ReLU activation function, a Dropout layer, and a fully connected layer with 4096 output channels.
[0090] The multi-scale attention residual network is trained using three flow type images: oil-in-water, water-in-oil, and transition flow to obtain a trained network model.
[0091] like Figure 2 As shown, the collected electromagnetic signals are identified and classified by means of the above classification system. The specific steps are as follows:
[0092] Step 1: Use the electromagnetic signal acquisition module to collect the original signal;
[0093] Step 2: The original electromagnetic signal is input into the preprocessing module for preprocessing to obtain a noise-reduced signal;
[0094] Step 2.1: Decompose the original signal into various scales using wavelet threshold denoising;
[0095] Step 2.2: Set the wavelet coefficients belonging to noise below the threshold to zero, and keep the wavelet coefficients belonging to the signal;
[0096] Step 2.3: Use inverse wavelet transform to reconstruct the denoised signal.
[0097] Step 3: Input the pre-processed and denoised data into a two-dimensional image encoding module to convert it into a two-dimensional image;
[0098] Step 3.1: normalize the noise-reduced data signal to obtain a normalized signal value;
[0099] Step 3.2: Select a frame of data and get the graphics set Where s represents a time window, d is equivalent to the step size and time shift, and t represents the moving window;
[0100] Step 3.3: Get the graph difference set
[0101] Step 3.4: Perform zero-filling operation to construct a new set
[0102]
[0103] Step 3.5: Define the graphic difference field. For the i-th channel, define the image array as:
[0104]
[0105] Id n Represents the (n-1) sequence set corresponding to the step size d, so that the graphic difference field can generate the corresponding (n-1) channel images;
[0106] Step 3.6: For the i-th channel, define the image array as:
[0107]
[0108] in
[0109] Step 3.7: Fill G i The zero elements in n define each channel of the image and obtain a two-dimensional image:
[0110]
[0111] in, Is Rotated 180°, ⊙ is the Hadamard product;
[0112] Step 4: Input the two-dimensional image into the initial feature extraction module to perform initial feature extraction to obtain an initial feature map;
[0113] Step 4.1: Input the two-dimensional image into the first feature extraction layer to obtain a first feature extraction map;
[0114] In the first feature extraction layer, there is an attention layer. The processing steps in the attention layer are as follows:
[0115] Step 4.11: Get the number of channels c of the attention layer input feature map;
[0116] Step 4.12: After the attention layer input feature map is fed into the global average pooling with an output of 1*1, the result is flattened into a two-dimensional tensor;
[0117] Step 4.13: Send the flattened two-dimensional tensor to the fully connected layer, compress the number of channels to the number of input channels divided by the compression ratio, the compression ratio ratio = 16, and then send it to the output of the ReLU activation function;
[0118] Step 4.14: Send the compressed activated output features to the fully connected layer, restore the number of channels to c, and then send them to the Sigmoid activation function output;
[0119] Step 4.15: Expand the output feature map of step 4.14 to the size of the input feature map of the attention layer, and multiply it with the input feature map of the attention layer to obtain the weighted feature map representation as the output of the attention layer.
[0120] Step 4.2: Input the first feature extraction map into the second feature extraction layer to obtain an initial feature map.
[0121] There is still an attention layer in the second feature extraction layer, and the specific processing steps in the attention layer are consistent with the above steps;
[0122] Step 5: Input the initial feature map into the multi-scale perception module for multi-scale perception to obtain a multi-scale perception feature map;
[0123] Step 5.1: Input the initial feature map into the first multi-scale perception layer to obtain a first multi-scale perception feature map;
[0124] The first multi-scale perception layer, the second multi-scale perception layer, and the third multi-scale perception layer in the multi-scale perception module all include an attention layer and a multi-scale attention perception layer. The processing method of the attention layer in step 5 is the same as that in step 4 above. The processing steps in the multi-scale attention perception layer in step 5 are as follows:
[0125] Step 5.11: Get the input feature map of the multi-scale attention perception layer, input the multi-scale attention perception layer input feature map into the 3*3 convolution layer, and then output it through the batch normalization layer and ReLU activation function;
[0126] Step 5.12: Input the feature map output in the previous step into the 3*3 convolution layer, and then output it through the batch normalization layer and ReLU activation function;
[0127] Step 5.13: Perform 2x downsampling, 4x downsampling, and 8x downsampling on the feature map output in the previous step to obtain a 2x downsampling feature map, a 4x downsampling feature map, and an 8x downsampling feature map;
[0128] Step 5.14: Upsample the 8-fold downsampled feature map by 2 times, fuse it with the 4-fold downsampled feature map through a 1*1 convolutional layer, input it into the attention layer to adjust the channel weights, and then output it;
[0129] Step 5.15: Upsample the feature map output in the previous step by 2 times, fuse it with the 2 times downsampled feature map through a 1*1 convolution layer, input it into the attention layer to adjust the channel weights, and then output it;
[0130] Step 5.16: Upsample the feature map output from the previous step by a factor of 2, fuse it with the feature map output from step 5.12 through a 1*1 convolutional layer, and then input it into the attention layer to adjust the channel weights before outputting it;
[0131] Step 5.17: Add the output feature map of the previous step to the original multi-scale attention perception layer input feature map to form a residual structure, which is then activated by the ReLU function and used as the output of the multi-scale attention perception layer.
[0132] Step 5.2: inputting the first multi-scale perceptual feature map into the second multi-scale perceptual layer to obtain a second multi-scale perceptual feature map;
[0133] Step 5.3: Input the second multi-scale perceptual feature map into the third multi-scale perceptual layer to obtain a multi-scale perceptual feature map.
[0134] Step 6: Input the multi-scale perception feature map into the classification module for flow type classification.
[0135] Step 6.1: Input the multi-scale perceptual feature map into the adaptive average pooling layer, adjust the size of the feature map to 7x7, and then expand it according to the first dimension through the fallten function and output it;
[0136] Step 6.2: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer;
[0137] Step 6.3: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer;
[0138] Step 6.4: Input the feature map output from the previous step into a fully connected layer with 3 output channels, whose output is the output of the multi-scale attention residual network to obtain the flow classification result.
[0139] like Figure 3 As shown, when the electromagnetic signal is classified by the present invention, the original electromagnetic signal is preprocessed and then denoised to obtain a preprocessed electromagnetic signal, which is then converted into a two-dimensional image using a graphic difference field. The image is input into a trained and optimized multi-scale attention residual network to obtain a flow classification result.
[0140] In view of the shortcomings of electromagnetic signals, such as large data volume, high calculation difficulty and inability to intuitively reflect flow characteristics, the present invention proposes an oil-water two-phase flow pattern classification system and method based on multi-scale attention. The one-dimensional time-series electromagnetic signal is converted into a two-dimensional image using a graphic differential field, and flow pattern recognition is performed through a trained and optimized multi-scale attention residual network. The flow characteristic information in the original signal is converted into three flow patterns: oil-in-water, water-in-oil, and transition flow, thereby improving the accuracy of oil-gas-water two-phase flow pattern recognition.
[0141] The embodiments described above are merely descriptions of preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A multi-scale attention-based oil-water two-phase flow pattern classification system, comprising an electromagnetic signal acquisition module and a preprocessing module connected to each other, Features: A two-dimensional image encoding module, an initial feature extraction module, a multi-scale perception module and a classification module are sequentially connected after the preprocessing module, wherein the multi-scale attention residual network is sequentially composed of the initial feature extraction module, the multi-scale perception module and the classification module, the initial feature extraction module sequentially includes the first feature extraction layer and the second feature extraction layer, and the multi-scale perception module sequentially includes the first multi-scale perception layer, the second multi-scale perception layer and the third multi-scale perception layer.
2. According to claim 1, a multi-scale attention-based oil-water two-phase flow pattern classification system, Features: The specific structure and function of each module are as follows: The electromagnetic signal acquisition module includes an electromagnetic induction sensor, a 5V DC power supply, a multi-channel signal acquisition box and a PC which are connected to each other in sequence; The preprocessing module is used to reduce the noise of the original electromagnetic signal by using wavelet threshold denoising; The two-dimensional image encoding module is used to convert the noise-reduced electromagnetic signal into a two-dimensional image using a graphic difference field; The first feature extraction layer includes two 3*3 convolutional layers with 64 output channels and ReLU activation functions, one attention layer with 64 output channels, and one maximum pooling layer with a stride of 2 from input to output. The second feature extraction layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output. The attention layer of the initial feature extraction module is used to adjust the output weight, and includes 1 1*1 global average pooling layer, 1 fully connected layer, 1 ReLU activation function layer, 1 fully connected layer, and 1 Sigmoid activation function layer in order from input to output; The first multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 256 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 256, one attention layer with an output channel of 256, and one maximum pooling layer with a stride of 2 from input to output. The second multi-scale perception layer includes two 3*3 convolutional layers with an output channel of 512 and a ReLU activation function, one multi-scale attention perception layer with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output. The third multi-scale perception layer includes two multi-scale attention perception layers with an output channel of 512, one attention layer with an output channel of 512, and one maximum pooling layer with a stride of 2 from input to output. The attention layer of the multi-scale perception module has the same structure as the attention layer in the initial feature extraction module. The multi-scale attention perception layer includes, from input to output, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 3*3 convolution layer, batch normalization layer, ReLU activation function layer, 1 2x downsampling layer, 1 4x downsampling layer, 1 8x downsampling layer, 3 1*1 convolution layers and 3 attention layers, 3 2x upsampling operations, and 1 addition operation. The classification module includes, from input to output, a 7*7 adaptive average pooling layer, a flatten function, two fully connected layers with 4096 output channels, a ReLU activation function, a Dropout layer, and a fully connected layer with 4096 output channels.
3. A method for classifying oil-water two-phase flow patterns based on multi-scale attention, applied to the classification system as claimed in claim 1 or 2 Features: The specific steps are as follows: Step 1: Use the electromagnetic signal acquisition module to collect the original signal; Step 2: The original electromagnetic signal is input into the preprocessing module for preprocessing to obtain a noise-reduced signal; Step 3: Input the pre-processed and denoised data into a two-dimensional image encoding module to convert it into a two-dimensional image; Step 4: Input the two-dimensional image into the initial feature extraction module to perform initial feature extraction to obtain an initial feature map; Step 5: Input the initial feature map into the multi-scale perception module for multi-scale perception to obtain a multi-scale perception feature map; Step 6: Input the multi-scale perception feature map into the classification module for flow type classification.
4. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 3, Features: Step 2 The specific steps are as follows: Step 2.1: Decompose the original signal into various scales using wavelet threshold denoising; Step 2.2: Set the wavelet coefficients belonging to noise below the threshold to zero, and keep the wavelet coefficients belonging to the signal; Step 2.3: Use inverse wavelet transform to reconstruct the denoised signal.
5. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 3, Features: Step 3 The specific steps are as follows: Step 3.1: normalize the noise-reduced data signal to obtain a normalized signal value; Step 3.2: Select a frame of data and get the graphics set Where s represents a time window, d is equivalent to the step size and time shift, and t represents the moving window; Step 3.3: Get the graph difference set Step 3.4: Perform zero-filling operation to construct a new set Step 3.5: Define the graphic difference field. For the i-th channel, define the image array as: Represents the (n-1) sequence set corresponding to the step size d, so that the graphic difference field can generate the corresponding (n-1) channel images; Step 3.6: For the i-th channel, define the image array as: in Step 3.7: Fill The zero elements in define each channel of the image and obtain a two-dimensional image: in, Is Rotated 180°, ⊙ is the Hadamard product.
6. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 3, Features: Step 4 The specific steps are as follows: Step 4.1: Input the two-dimensional image into the first feature extraction layer to obtain a first feature extraction map; Step 4.2: Input the first feature extraction map into the second feature extraction layer to obtain an initial feature map.
7. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 6, Features: The processing steps in the attention layer in step 4 are as follows: Step 4.11: Get the number of channels c of the attention layer input feature map; Step 4.12: After the attention layer input feature map is fed into the global average pooling with an output of 1*1, the result is flattened into a two-dimensional tensor; Step 4.13: Send the flattened two-dimensional tensor to the fully connected layer, compress the number of channels to the number of input channels divided by the compression ratio, the compression ratio ratio = 16, and then send it to the output of the ReLU activation function; Step 4.14: Send the compressed activated output features to the fully connected layer, restore the number of channels to c, and then send them to the Sigmoid activation function output; Step 4.15: Expand the output feature map of step 4.14 to the size of the input feature map of the attention layer, and multiply it with the input feature map of the attention layer to obtain the weighted feature map representation as the output of the attention layer.
8. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 3, Features: Step 5 The specific steps are as follows: Step 5.1: Input the initial feature map into the first multi-scale perception layer to obtain a first multi-scale perception feature map; Step 5.2: input the first multi-scale perceptual feature map into the second multi-scale perceptual layer to obtain a second multi-scale perceptual feature map; Step 5.3: Input the second multi-scale perceptual feature map into the third multi-scale perceptual layer to obtain a multi-scale perceptual feature map.
9. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 8, Features: The processing method of the attention layer in step 5 is the same as that in step 4. The processing steps in the multi-scale attention perception layer in step 5 are as follows: Step 5.11: Get the input feature map of the multi-scale attention perception layer, input the multi-scale attention perception layer input feature map into the 3*3 convolution layer, and then output it through the batch normalization layer and ReLU activation function; Step 5.12: Input the feature map output from the previous step into a 3*3 convolutional layer, and then output it through a batch normalization layer and ReLU activation function; Step 5.13: Perform 2-fold downsampling, 4-fold downsampling, and 8-fold downsampling on the feature map output in the previous step to obtain a 2-fold downsampling feature map, a 4-fold downsampling feature map, and an 8-fold downsampling feature map; Step 5.14: Upsample the 8-fold downsampled feature map by 2 times, fuse it with the 4-fold downsampled feature map through a 1*1 convolutional layer, input it into the attention layer to adjust the channel weights, and then output it; Step 5.15: Upsample the feature map output in the previous step by 2 times, fuse it with the 2 times downsampled feature map through a 1*1 convolution layer, input it into the attention layer to adjust the channel weights, and then output it; Step 5.16: Upsample the feature map output from the previous step by a factor of 2, fuse it with the feature map output from step 5.12 through a 1*1 convolutional layer, and then input it into the attention layer to adjust the channel weights before outputting it; Step 5.17: Add the output feature map of the previous step to the original multi-scale attention perception layer input feature map to form a residual structure, which is then activated by the ReLU function and used as the output of the multi-scale attention perception layer.
10. The oil-water two-phase flow pattern classification method based on multi-scale attention according to claim 3, Features: Step 6 The specific steps are as follows: Step 6.1: Input the multi-scale perceptual feature map into the adaptive average pooling layer, adjust the size of the feature map to 7x7, and then expand it according to the first dimension through the fallten function and output it; Step 6.2: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer; Step 6.3: Input the feature map output from the previous step into a fully connected layer with 4096 output channels, and then output it through the ReLU activation function and the Dropout layer; Step 6.4: Input the feature map output from the previous step into a fully connected layer with 3 output channels, whose output is the output of the multi-scale attention residual network to obtain the flow classification result.
