A method and device for identifying a dynamometer diagram
By designing a combination of adaptive status space modules, depth separation convolution modules, channel attention mechanism modules and classification modules, solving the automatic recognition efficiency of oil drawing machines in the existing technology The problem achieves high accuracy automatic recognition and fault diagnosis.
Patent Information
- Application Number
- CN202410945262.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-07-15
AI Technical Summary
The prior art is difficult to realize automatic identification of the category of oil pumping engine power diagrams, resulting in low fault diagnosis efficiency and prone to misjudgment.
Designed a method of demonstration diagram, adopt a combination model of adaptive status space module, depth separation convolutional module, channel attention mechanism module and classification module. Realize the automatic identification of the graph class category.
The accurate and automatic recognition of the brigade of the oil pumping machine is realized, the efficiency and accuracy of the fault diagnosis is improved, and the dependence of manual judgment is reduced.
Smart Images

Figure CN118799640B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of oil and gas exploration, and in particular to a method and a device for identifying a dynamometer diagram. Background Art
[0002] As a non-renewable energy source, oil is not only the first energy element of the world's industry, but also a vital strategic resource. Oil is the material basis for human life and the rapid development of society, and is crucial to economic development. Under the severe background of serious underinvestment in international oil supply and rapid growth in demand, the world's thirst for new oil supply will increase day by day. my country should not only continue to expand the space for foreign oil markets, but also increase its efforts in oil development, adjust oil production plans, and optimize the allocation of oil resources. Most of my country's oil fields use rod pumping units as oil production equipment, but the oil fields are buried deep, the types are complex, the natural conditions are poor, and the oil pumps are unattended and often operate in abnormal conditions. Their failures will cause a waste of labor, physical resources and time.
[0003] In order to improve the efficiency of oil exploration, the condition monitoring technology of pumping units is widely used in the field of fault diagnosis of pumping unit systems. The dynamometer diagram is a widely used tool in fault diagnosis of pumping unit systems. It is a closed curve diagram obtained by the change relationship between load and displacement. Different shapes of dynamometer diagrams correspond to different fault levels, which in turn produce different effects, such as reduced production, high energy costs, increased workload of oil well maintenance, and even production problems such as oil well closure. Manual identification of dynamometer diagrams requires complex prior knowledge, too much workload restrictions when updating the knowledge base, and subjective judgments may lead to misjudgments in the diagnosis process. Traditional dynamometer diagram classification methods are time-consuming and cannot adapt to modern automatic data generation and acquisition technologies. Summary of the invention
[0004] Based on the above, the purpose of the present invention is to provide a method and device for identifying a dynamometer diagram, so as to realize automatic identification and judgment of the type of the dynamometer diagram.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A first aspect of the present application provides a method for identifying a dynamometer diagram, which comprises:
[0007] Obtain the indicator diagram to be identified;
[0008] Input the dynamometer diagram to be identified into the target dynamometer diagram classification model, perform test classification on the dynamometer diagram to be identified, and output the target prediction result;
[0009] Among them, the target dynamometer diagram classification model includes an adaptive state space module, a deep separable convolution module, a channel attention mechanism module and a classification module, so as to obtain data-dependent global visual context features from the dynamometer diagram to be identified through the adaptive state space module, extract features of the dynamometer diagram to be identified while ensuring sufficient local representation through the deep separable convolution module, fuse the output features of the adaptive state space module and the deep separable convolution module through the channel attention mechanism module to balance the global and local features, and identify and judge the output of the channel attention mechanism module through the classification module to output the target prediction result.
[0010] In some embodiments, before inputting the dynamometer diagram to be identified into the target dynamometer diagram classification model, performing test classification on the dynamometer diagram to be identified, and outputting the target prediction result, it also includes training and obtaining the target dynamometer diagram classification model, and the training and obtaining the target dynamometer diagram classification model includes the following steps:
[0011] Collect and organize the dynamometer diagrams to be tested and the classification description of the image features of the dynamometer diagrams to be tested;
[0012] Performing standardization processing on the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested;
[0013] Using the standardized dynamometer diagram to be tested to create a training data set, a verification data set and a test data set, and establishing an Ada-VisionMamba deep learning model as an initial dynamometer diagram recognition model;
[0014] Based on the training data set and the validation data set, the initial dynamometer diagram recognition model is optimized using a stochastic gradient descent method, and iterated until a stable and accurate optimized dynamometer diagram classification model is obtained;
[0015] The optimized dynamometer diagram classification model is used to classify the dynamometer diagrams to be tested in the test data set to obtain the test prediction results;
[0016] The test prediction results are compared with the standard labels corresponding to the test data set, and the test prediction results are analyzed to obtain a target dynamometer diagram classification model.
[0017] In some embodiments, a dynamometer diagram generated by a downhole dynamometer in the actual working conditions of oil wells in the Fengxi area in the western part of the Qaidam Basin is used as the dynamometer diagram to be tested; and / or, the image feature classification description includes basic category features and composite category features composed of multiple basic category features, so as to complete the classification description of the dynamometer diagram to be tested through the image feature classification description, wherein the basic category features include normal, infilling, gas influence, sand production, wax deposition, sucker rod breakage, tubing leakage, floating valve leakage, fixed valve loss, double valve loss, upstroke hitting the pump, downstroke hitting the pump, thick oil, and out of the working cylinder.
[0018] In some embodiments, the step of using the standardized dynamometer diagram to be tested to prepare a training data set, a verification data set, and a test data set comprises:
[0019] The standardized dynamometer diagram to be tested is scaled to a first preset pixel size to obtain a scaled dynamometer diagram to be tested, and then the scaled dynamometer diagram to be tested is divided into the training data set, the verification data set and the test data set according to a first preset ratio.
[0020] In some embodiments, the first preset pixel is 224x224, and the first preset ratio is 6:2:2.
[0021] In some implementations, the step of performing standardization processing on the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested comprises:
[0022] The standardized processing of the dynamometer diagram to be tested is realized by using a standardized formula:
[0023]
[0024] In the formula, norm is the value after standardization, x i is the image pixel value, max(x) is the maximum value of the image pixel, and min(x) is the minimum value of the image pixel.
[0025] In some embodiments, in the step of optimizing the initial dynamometer diagram recognition model using the stochastic gradient descent method based on the training data set and the validation data set, AdamW is used as an optimizer to optimize the initial dynamometer diagram recognition model, and the loss function used is a Focal loss loss function.
[0026] In some embodiments, obtaining data-dependent global visual context features from the dynamometer diagram to be identified by an adaptive state space module includes:
[0027] The input dynamometer diagram to be identified is divided into image blocks, and then the image blocks are expanded into one-dimensional vectors, and classification vector tokens and position coding tokens are added to obtain an embedding matrix after adding position coding;
[0028] The embedding matrix after adding position encoding is introduced into the adaptive state space module. The attention layer of the adaptive state space module will learn the importance of each image block relative to other image blocks. The multi-layer perceptron mixer of the adaptive state space module integrates the image block information in the spatial and feature dimensions to improve the model's ability to process different types of features and realize adaptive weight allocation for different image blocks.
[0029] The processed embedding matrix is normalized to obtain a normalized sequence, and the normalized sequence is subjected to two different linear transformations to obtain a bidirectional cyclic scanning input and a gating mechanism sequence; then, the bidirectional cyclic scanning input is subjected to an adaptive state space scanning block, and is multiplied with the gating mechanism sequence to calculate a forward cyclic scanning sequence and a backward cyclic scanning sequence respectively;
[0030] After the forward loop scanning sequence and the backward loop scanning sequence are combined, they are added to the original input sequence through residual connection, and the feature sequence obtained by loop feature extraction at this moment is obtained through linear transformation.
[0031] In some embodiments, the feature extraction of the indicator diagram to be identified is performed by the depthwise separable convolution module while ensuring sufficient local representation, the output features of the two modules of the adaptive state space module and the depthwise separable convolution module are fused by the channel attention mechanism module to balance global and local features, and the output of the channel attention mechanism module is identified and judged by the classification module to output the target prediction result, including:
[0032] Each channel of the input dynamometer diagram to be identified is trained separately using an independent convolution kernel;
[0033] Combine and transform the output channels of the depthwise convolution, adjust the number of channels of the feature map after the depthwise convolution and integrate the information of different channels through point-by-point convolution;
[0034] The channel attention mechanism module extracts important features from different channels, and inputs the feature sequence extracted by the adaptive state space module and the features extracted by the depthwise separable convolution module into the channel attention mechanism module for feature selection and filtering.
[0035] The temporal features and spatial features output by the channel attention mechanism module are fused and input into the classification module for recognition and judgment of the composite dynamometer diagram to output the target prediction results.
[0036] A second aspect of the present application provides a dynamometer diagram recognition device, comprising:
[0037] at least one processor; and,
[0038] a memory communicatively coupled to the at least one processor;
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the dynamometer diagram recognition method of any of the above-mentioned embodiments.
[0040] The beneficial effects of the present invention are:
[0041] The present invention takes into account the linear variation characteristics of the dynamometer diagram and innovatively designs a target dynamometer diagram recognition model, which includes an adaptive state space module, a deep separable convolution module, a channel attention mechanism module and a classification module. The adaptive state space module can avoid image-specific inductive biases while obtaining data-dependent global visual contexts; the deep separable convolution module achieves more effective feature extraction while ensuring sufficient local representation; the channel attention mechanism module fuses the output features of the adaptive state space module and the deep separable convolution module to balance global and local features. Through this model design, accurate and automatic recognition of the dynamometer diagram of the oil pumping unit is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the contents of the embodiments of the present invention and these drawings without paying any creative work.
[0043] Figure 1 A schematic diagram of a method for identifying a dynamometer diagram according to some embodiments of the present invention;
[0044] Figure 2 A schematic diagram of a training process of a target dynamometer diagram recognition model according to some embodiments of the present invention;
[0045] Figure 3 Schematic diagram of the overall architecture of the target dynamometer diagram recognition model used in some embodiments of the present invention.
[0046] Figure 4 Schematic diagram of the architecture of the adaptive state space module in some embodiments of the present invention, wherein (b) is a diagram of the adaptive state space scanning block structure;
[0047] Figure 5A diagram of an adaptive state space scanning architecture in some embodiments of the present invention;
[0048] Figure 6 This is a visualization result of classification of some randomly selected categories on a test data set using an optimized dynamometer diagram recognition model in some embodiments of the present invention. DETAILED DESCRIPTION
[0049] In order to make the technical problems solved by the present invention, the technical solutions adopted and the technical effects achieved clearer, the technical solutions of the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] In the description of the present invention, unless otherwise clearly specified and limited, the terms "connected", "connected", and "fixed" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0051] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0052] In the description of this embodiment, the terms "upper", "lower", "left", "right", etc., and the orientation or position relationship are based on the orientation or position relationship shown in the drawings, and are only for the convenience of description and simplified operation, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used to distinguish in the description and have no special meaning.
[0053] In recent years, with the development of artificial intelligence technology, various fields have begun to apply AI technology to achieve intelligence, such as smart home, autonomous driving, etc. In terms of pumping unit fault diagnosis, for complex dynamometer diagram classification and recognition problems, the problem-solving mode has changed from traditional manual-based methods to deep learning-based methods.
[0054] In view of the above situation, this study uses the self-developed Ada-VisionMamba deep learning model as the basis to build a target dynamometer diagram classification model, and realizes the automatic classification of the dynamometer diagram in the fault diagnosis of the oil pumping unit. Different from the single classification task, we use the label multi-feature learning method to deal with the complex situations of various basic fault types that may occur in actual work, so as to make more accurate oil pumping fault judgments. In addition, considering the characteristics of the dynamometer diagram, we use an adaptive state space model to extract features to make the model more stable and reasonable. This study provides an effective way for intelligent diagnosis of oil pumping unit faults.
[0055] The dynamometer diagram recognition method and device provided in this application are introduced in detail below.
[0056] refer to Figure 1-2 The embodiment of the present application provides a method for identifying a dynamometer diagram, and the method for identifying a dynamometer diagram includes:
[0057] Step 100, obtaining the indicator diagram to be identified; for explanation, all the indicator diagrams in this application mainly refer to the indicator diagrams of the oil pumping unit.
[0058] Step 200: input the target dynamometer diagram to be identified into the target dynamometer diagram classification model, perform test classification on the target dynamometer diagram to be identified, and output the target prediction result; wherein, reference Figure 3-5 The target dynamometer diagram classification model includes an adaptive state space module, a deep separable convolution module, a channel attention mechanism module and a classification module, so as to obtain data-dependent global visual context features from the dynamometer diagram to be identified through the adaptive state space module, extract features of the dynamometer diagram to be identified while ensuring sufficient local representation through the deep separable convolution module, fuse the output features of the adaptive state space module and the deep separable convolution module through the channel attention mechanism module to balance global and local features, and identify and judge the output of the channel attention mechanism module through the classification module to output the target prediction result.
[0059] The implementation method of the present application takes into account the linear variation characteristics of the dynamometer diagram and innovatively designs a target dynamometer diagram recognition model, which includes an adaptive state space module, a deep separable convolution module, a channel attention mechanism module, and a classification module. The adaptive state space module can avoid image-specific inductive biases while obtaining data-dependent global visual context; the deep separable convolution module achieves more effective feature extraction while ensuring sufficient local representation; the channel attention mechanism module fuses the output features of the adaptive state space module and the deep separable convolution module to balance global and local features. Through this model design, accurate and automatic recognition of the dynamometer diagram of the oil pump is achieved.
[0060] In some embodiments, reference Figure 2 In the step 200, the dynamometer diagram to be identified is input into the target dynamometer diagram classification model, and the dynamometer diagram to be identified is tested and classified, and before the target prediction result is output, the step 000 is also included, training and obtaining the target dynamometer diagram classification model, and the step 000, training and obtaining the target dynamometer diagram classification model includes the following steps:
[0061] Step 010, collecting and arranging the dynamometer diagram to be tested and the image feature classification description of the dynamometer diagram to be tested;
[0062] Step 020, standardizing the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested;
[0063] Step 030, using the standardized dynamometer diagram to be tested to create a training data set, a verification data set and a test data set, and establish an Ada-VisionMamba deep learning model as an initial dynamometer diagram recognition model; specifically, it can be written in the Pytorch framework (version 2.1.0).
[0064] Step 040: Based on the training data set and the verification data set, the initial dynamometer diagram recognition model is optimized using a stochastic gradient descent method, and the optimization is performed iteratively until a stable and accurate optimized dynamometer diagram classification model is obtained;
[0065] Step 050, use the optimized dynamometer classification model to classify the dynamometer diagram to be tested in the test data set to obtain the test prediction result; for explanation, refer to Figure 6 , Figure 6 This is a visualization result of the classification of some randomly selected categories on the test data set using the optimized dynamometer recognition model in some embodiments of the present invention. The depth of the color represents the importance of the area for the network to make the final classification decision. The darker the area, the greater the contribution to the model's prediction, and the model pays more attention to these areas when making decisions. On the contrary, the lighter the area, the less impact it has on the prediction.
[0066] Step 060: Compare the test prediction result with the standard label corresponding to the test data set, analyze the test prediction result, and obtain the target dynamometer diagram classification model. Through the analysis, the accuracy of the target dynamometer diagram classification model can be determined.
[0067] In some embodiments, the specific implementation method of the dynamometer diagram to be tested and the image feature classification description of the dynamometer diagram to be tested in step 010 is: the dynamometer diagram generated by the downhole dynamometer in the actual working conditions of the oil wells in the western wind west area of the Qaidam Basin is used as the dynamometer diagram to be tested. The implementation method of the present application is well trained and tested on the dynamometer diagram data set from the oil wells in the western wind west area of the Qaidam Basin. After experimental verification, a composite dynamometer diagram recognition accuracy of 94.3% can be obtained on the test data set. In addition, the implementation method of the present application emphasizes the adaptive state space features and the depth separable convolution features to classify the dynamometer diagram, which is more conducive to the actual situation encountered in the working process. Compared with the classification model of other single dynamometer diagrams, it further reflects the scientificity and rationality of the implementation method of the present application. In particular, it has great potential in the recognition of composite dynamometer diagrams. In the experiment of some embodiments, there can be 58 composite dynamometer diagrams, which can accurately, efficiently and universally identify 58 composite dynamometer diagrams.
[0068] In some embodiments, the image feature classification description in step 010 includes basic category features and composite category features composed of multiple basic category features, so as to complete the classification description of the dynamometer diagram to be tested through the image feature classification description, wherein the basic category features include normal, insufficiency, gas influence, sanding, wax deposition, sucker rod breakage, tubing leakage, floating valve leakage, fixed valve leakage, double valve leakage, upstroke hitting the pump, downstroke hitting the pump, oil thickness, and falling out of the working cylinder. Specifically, more types may be included. In the test training of some embodiments, there may be 58 types of dynamometer diagrams with composite category features, which are more diverse and can improve the recognition accuracy of composite dynamometer diagrams.
[0069] In some implementations, the step 020 of standardizing the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested includes:
[0070] The standardized processing of the dynamometer diagram to be tested is realized by using a standardized formula, and the standardized formula is:
[0071]
[0072] In the formula, norm is the value after standardization, x i is the image pixel value, max(x) is the maximum value of the image pixel, and min(x) is the minimum value of the image pixel.
[0073] In some implementations, the step 030, using the standardized dynamometer diagram to be tested to create a training data set, a validation data set, and a test data set, includes:
[0074] The standardized dynamometer diagram to be tested is scaled to a size of a first preset pixel to obtain a scaled dynamometer diagram to be tested, and then the scaled dynamometer diagram to be tested is divided into the training data set, the verification data set, and the test data set according to a first preset ratio. Specifically, in some embodiments, the first preset pixel is 224x224, and the first preset ratio is 6:2:2.
[0075] In some embodiments, in the step 040, based on the training data set and the verification data set, the step of optimizing the initial dynamometer diagram recognition model using the stochastic gradient descent method, specifically using AdamW as an optimizer to optimize the initial dynamometer diagram recognition model, and the loss function used is the Focal loss loss function. In some embodiments, the model can be iterated 80 times, each time using the predicted value and the true value to calculate the loss, and the model is optimized using the loss, so that the model prediction value is constantly close to the true value, and after the loss tends to be stable, the trained optimized dynamometer diagram classification model can be obtained.
[0076] In some embodiments, reference Figure 3-5 In step 200, obtaining data-dependent global visual context features from the dynamometer diagram to be identified by using an adaptive state space module includes:
[0077] Step 210: Segment the input dynamometer diagram to be identified into image blocks, then expand the image blocks into one-dimensional vectors, and add classification vector tokens and position coding tokens to obtain an embedding matrix after adding position coding;
[0078] Explanatory, first, in the adaptive state space module, the input dynamometer diagram to be identified (assuming X∈R H ×W×C ) is split into N P×P image patches, which are then expanded into a one-dimensional vector and the classification vector token and position encoding token are added:
[0079] x i =E·Flatten(patch i );
[0080] X'=Concat(x cls ,x1,x2,…,x N );
[0081] X”=X'+E pos ;
[0082] In the formula, patch i is the i-th image block, x i is the flattened image patch of the ith image patch. E is a linear projection matrix used to transform image patches from the original pixel space to a high-dimensional feature space. The Flatten function is used to flatten each image patch into a one-dimensional vector. X' is the feature information added to the classification vector. The Concat function is used to concatenate all image patches together according to the specified dimension. cls Refers to the classification vector token, which is responsible for the final dynamometer classification; X” represents the embedding moment after adding position encoding; E pos It represents position encoding, which can embed the position information into the feature vector of the sequence and adaptively learn the embedding parameters of the position through the training process.
[0083] Step 220, introducing the embedding matrix after adding the position encoding into the adaptive state space module, wherein the attention layer of the adaptive state space module will learn the importance of each image block relative to other image blocks, and the multi-layer perceptron mixer of the adaptive state space module will integrate the image block information in the spatial and feature dimensions to improve the model's ability to process different types of features and realize adaptive weight allocation for different image blocks.
[0084] Explanatory, the image block is placed in the adaptive state space module. First, the input image sequence is passed through the self-attention mechanism to dynamically assign weights to different image sequences to obtain the attention score Output of the image sequence attention ; Then, two multi-layer perceptrons with different angles are used for learning through a multi-perceptron mixer to adaptively adjust the contribution of each image sequence, making the training more adaptable to image changes:
[0085] Q,K,V=X”(W q ,W k ,W v )
[0086]
[0087]
[0088] Output channel =MLP channel (Output token )
[0089]
[0090] Wherein, the Q matrix is used to query the relationship between the current image block and other image blocks, the K matrix is used to calculate the similarity between the query image block, and the V matrix calculates the specific information of Q and K and is used to calculate the final self-attention output; the Q, K, and V matrices are obtained by multiplying the image block and the learnable matrix respectively, where W q ,W k ,W v is a learnable matrix; QK T Calculate the similarity between each Q and all K. Each element of the result matrix represents the matching degree of a Q corresponding to a K. Finally, multiply it with the V matrix and perform Softmax normalization to obtain the attention score Output attention ; For matrix Output attention The purpose is to mix the feature information of different image blocks and then perform the token multi-layer perceptron operation; another channel multi-layer perceptron is applied on the image block dimension to help transfer information between different channels of the image block; the output is obtained through the fully connected layer and the Sigmoid activation function channel The score for each image patch is obtained in the output.
[0091] refer to Figure 4 , Figure 4 Schematic diagram of the architecture of the adaptive state space module in some embodiments of the present invention, wherein (b) is a diagram of the adaptive state space scanning block structure, wherein the self-attention mechanism and the multi-layer perceptron mixer constitute the block adaptive weighted block in the adaptive state space module.
[0092] The above scheme implements adaptive weight allocation for different image patch patches; the attention layer of the adaptive state space module learns the importance of each image patch relative to other image patch patches, thereby dynamically allocating more weight to image patch patches with information; the role of the multi-layer perceptron mixer of the adaptive state space module is, first, to weight and redistribute the features of each image patch patch, so that the output of each image patch is the result of adjustment of the common information of all image patch patches. Second, the features within each image patch patch are fused, which helps to transfer information between different channels of the image patch patch and further strengthen the model's learning of features.
[0093] Step 230, normalize the processed embedding matrix to obtain a normalized sequence, and obtain a bidirectional cyclic scan input and a gating mechanism sequence by performing two different linear transformations on the normalized sequence; then perform adaptive state space scanning on the bidirectional cyclic scan input through an adaptive state space scanning block, multiply it with the gating mechanism sequence, and calculate a forward cyclic scan sequence and a backward cyclic scan sequence respectively;
[0094] Explanatory, reference Figure 4 (b), two different linear transformations are performed on the standardized sequence to obtain the bidirectional cyclic scanning input z1 and the gating mechanism sequence z2: Next, the adaptive state space scanning block is processed and multiplied with the previously calculated gating mechanism sequence z2 to calculate the forward cyclic scanning sequence y' forward and backward loop scanning sequence y' backward :
[0095]
[0096] y1 = DWConv(z1);
[0097] SS2D=SSM σ (y1),σ∈{forward,backward}
[0098] y forward ,y backward =Norm(SS2D);
[0099] y' forward =y forward ⊙SiLU(z2);
[0100] y' backward =y backward ⊙SiLU(z2);
[0101] In the formula, Linear is a linear transformation function, and two sequences z1 and z2 are obtained. z1 is used as the input of the next bidirectional cyclic scan, and the gating mechanism sequence z2 is subsequently used for the gating mechanism. This gating operation can help the network model adjust its behavior according to the current input or past information, and enhance the flexibility and effectiveness of the model in processing information; DWConv is a deep convolution, which captures the important features of the input data through its weights, thereby enhancing the representation ability of the model. SS2D means that the vector is input into the forward and backward state space models respectively through the adaptive state space scanning block, and two results are obtained, namely bidirectional state space scanning, where SSM is state space processing; Norm is used to characterize the standardized processing.
[0102] Step 240: After combining the forward loop scanning sequence and the backward loop scanning sequence, the sequence is added to the original input sequence through a residual connection, and a feature sequence obtained through loop feature extraction at this moment is obtained through linear transformation.
[0103] Explanation: the forward loop scans the sequence y' forward and backward loop scanning sequence y' backward After combination, it is added to the original input sequence X through residual connection l-1 , and finally obtain X" through linear transformation l :
[0104] X” l =Linear(y' forward +y' backward )+X” l-1 ;
[0105] In the formula, X” l It represents the feature sequence obtained through cyclic feature extraction at this moment.
[0106] In some embodiments, reference Figure 3 The step 200 extracts features of the indicator diagram to be identified by using the depthwise separable convolution module while ensuring sufficient local representation, fuses the output features of the adaptive state space module and the depthwise separable convolution module by using the channel attention mechanism module to balance global and local features, and identifies and judges the output of the channel attention mechanism module by using the classification module to output the target prediction result, including:
[0107] Step 250, each channel of the input dynamometer diagram to be identified is trained separately using an independent convolution kernel;
[0108] Explanatory, the input dynamometer diagram to be identified (assuming X∈R H×W×C ) is trained separately using independent convolution kernels:
[0109] Y C (i,j)=∑ m,n X c (i+m,j+n)×K c (m,n);
[0110] Where Y C is the feature information obtained by a deep convolution of the Cth channel; K c is the convolution kernel of the Cth channel; the i,j indexes indicate the position of the output element currently being calculated; the m,n indexes indicate the row and column indexes inside the convolution kernel, which are used to access the specific elements of the convolution kernel.
[0111] Step 260: combine and transform the output channels of the depthwise convolution, adjust the number of channels of the feature map after the depthwise convolution and integrate the information of different channels through point-by-point convolution;
[0112] Explanatory, the output channels of the depth convolution are combined and transformed, and the number of channels of the feature map after the depth convolution is adjusted and the information of different channels is integrated through point-by-point convolution:
[0113]
[0114] In the formula, Z c' (i,j) is the value of the C'th channel at position (i,j) in the output feature map, It is a specific weight in the convolution kernel, which is used to transfer information from the Cth channel of the input feature map to the C'th channel of the output feature map.
[0115] Step 270: The channel attention mechanism module extracts important features of different channels, and inputs the feature sequence extracted by the adaptive state space module and the features extracted by the depthwise separable convolution module into the channel attention mechanism module for feature selection and filtering.
[0116] Step 280: Fuse the temporal features and spatial features output by the channel attention mechanism module, input the classification module to identify and judge the composite dynamometer diagram, and output the target prediction result.
[0117] Explanatory, Feature = SE(X') + SE(Z);
[0118] Diram=Sigmoid(AveragePool(Feature));
[0119] In the formula, Feature represents the result of the fusion of the adaptive state space module and the deep separable module; AveragePool represents average pooling, which reduces the spatial dimension of the feature map and the amount of data while maintaining important feature information; Sigmoid activation function maps the learned category features to probability values; Diram represents the final dynamometer classification result, that is, the target prediction result.
[0120] The target dynamometer diagram recognition model of the implementation mode of the present application includes an adaptive state space module, a deep separable convolution module and a channel attention mechanism module, which utilizes the imaging characteristics of the merged upstroke and downstroke curves of the dynamometer diagram, and uses the adaptive state space module to obtain the position encoding of the curve continuity according to feature learning, which can not only fully identify a single fault category, but also use the learned single fault category features to fuse and distinguish compound fault categories, so as to cope with the actual situation of various basic fault types that may occur in oil production. The dynamometer diagram recognition method of the implementation mode of the present application has achieved excellent recognition accuracy, and also improved the rationality and stability of the model, providing an effective way for intelligent diagnosis of pumping unit faults.
[0121] In addition, an embodiment of the present application also provides a dynamometer diagram recognition device, which includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the dynamometer diagram recognition method of any of the above-mentioned embodiments, and the details are not repeated here.
[0122] In summary, the dynamometer diagram recognition method and device proposed in the present invention have high computational efficiency and can realize good state recognition on the composite dynamometer diagram.
[0123] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for identifying a dynamometer diagram, characterized in that: include: Obtain the dynamometer diagram to be identified; Input the dynamometer diagram to be identified into the target dynamometer diagram classification model, perform test classification on the dynamometer diagram to be identified, and output the target prediction result; The target dynamometer diagram classification model includes an adaptive state space module, a depth-separable convolution module, a channel attention mechanism module and a classification module, so as to obtain data-dependent global visual context features from the dynamometer diagram to be identified through the adaptive state space module, extract features of the dynamometer diagram to be identified while ensuring sufficient local representation through the depth-separable convolution module, fuse the output features of the adaptive state space module and the depth-separable convolution module through the channel attention mechanism module to balance global and local features, and identify and judge the output of the channel attention mechanism module through the classification module to output the target prediction result; The step of obtaining data-dependent global visual context features from the dynamometer diagram to be identified by using an adaptive state space module includes: The input dynamometer diagram to be identified is divided into image blocks, and then the image blocks are expanded into one-dimensional vectors, and classification vector tokens and position coding tokens are added to obtain an embedding matrix after adding position coding; The embedded matrix after adding position encoding is introduced into the adaptive state space module to obtain the processed embedded matrix. The attention layer of the adaptive state space module will learn the importance of each image block relative to other image blocks. The multi-layer perceptron mixer of the adaptive state space module integrates the image block information in the spatial and feature dimensions to improve the model's ability to process different types of features and realize adaptive weight allocation for different image blocks. The processed embedding matrix is normalized to obtain a normalized sequence, and the normalized sequence is subjected to two different linear transformations to obtain a bidirectional cyclic scanning input and a gating mechanism sequence; then, the bidirectional cyclic scanning input is subjected to an adaptive state space scanning block, and is multiplied with the gating mechanism sequence to calculate a forward cyclic scanning sequence and a backward cyclic scanning sequence respectively; After the forward loop scanning sequence and the backward loop scanning sequence are combined, they are added to the original input sequence through residual connection, and the feature sequence obtained by loop feature extraction at this moment is obtained through linear transformation.
2. The dynamometer diagram recognition method according to claim 1, characterized in that: Before inputting the dynamometer diagram to be identified into the target dynamometer diagram classification model, testing and classifying the dynamometer diagram to be identified, and outputting the target prediction result, it also includes training and obtaining the target dynamometer diagram classification model, and the training and obtaining the target dynamometer diagram classification model includes the following steps: Collect and organize the dynamometer diagrams to be tested and the classification description of the image features of the dynamometer diagrams to be tested; Performing standardization processing on the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested; Using the standardized dynamometer diagram to be tested to create a training data set, a verification data set and a test data set, and establishing an Ada-VisionMamba deep learning model as an initial dynamometer diagram recognition model; Based on the training data set and the validation data set, the initial dynamometer diagram recognition model is optimized using a stochastic gradient descent method, and iterated until a stable and accurate optimized dynamometer diagram classification model is obtained; The optimized dynamometer diagram classification model is used to classify the dynamometer diagrams to be tested in the test data set to obtain the test prediction results; The test prediction results are compared with the standard labels corresponding to the test data set, and the test prediction results are analyzed to obtain a target dynamometer diagram classification model.
3. The dynamometer diagram recognition method according to claim 2, characterized in that: The dynamometer diagram generated by the downhole dynamometer in the actual working conditions of the oil wells in the Fengxi area in the western part of the Qaidam Basin is used as the dynamometer diagram to be tested; and / or the image feature classification description includes basic category features and composite category features composed of multiple basic category features, so as to complete the classification description of the dynamometer diagram to be tested through the image feature classification description, wherein the basic category features include normal, infilling, gas influence, sand production, wax deposition, sucker rod breakage, oil pipe leakage, floating valve leakage, fixed valve leakage, double valve leakage, upstroke hitting the pump, downstroke hitting the pump, thick oil, and falling out of the working cylinder.
4. The dynamometer diagram recognition method according to claim 2, characterized in that: The method of using the standardized dynamometer diagram to be tested to prepare a training data set, a verification data set and a test data set comprises: The standardized dynamometer diagram to be tested is scaled to a first preset pixel size to obtain a scaled dynamometer diagram to be tested, and then the scaled dynamometer diagram to be tested is divided into the training data set, the verification data set and the test data set according to a first preset ratio.
5. The dynamometer diagram recognition method according to claim 4, characterized in that: The first preset pixel is 224x224, and the first preset ratio is 6:2:
2.
6. The dynamometer diagram recognition method according to claim 2, characterized in that: The standardizing process of the dynamometer diagram to be tested to obtain a standardized dynamometer diagram to be tested comprises: The standardized processing of the dynamometer diagram to be tested is realized by using a standardized formula: In the formula, norm is the value after standardization, x i is the image pixel value, max(x) is the maximum value of the image pixel, and min(x) is the minimum value of the image pixel.
7. The dynamometer diagram recognition method according to claim 2, characterized in that: In the step of optimizing the initial dynamometer diagram recognition model using the stochastic gradient descent method based on the training data set and the verification data set, AdamW is used as an optimizer to optimize the initial dynamometer diagram recognition model, and the loss function used is the Focalloss loss function.
8. The dynamometer diagram recognition method according to claim 1, characterized in that: The method extracts features of the indicator diagram to be identified by the deep separable convolution module while ensuring sufficient local representation, fuses the output features of the two modules of the adaptive state space module and the deep separable convolution module by the channel attention mechanism module to balance global and local features, and recognizes and judges the output of the channel attention mechanism module by the classification module to output the target prediction result, including: Each channel of the input dynamometer diagram to be identified is trained separately using an independent convolution kernel; Combine and transform the output channels of the depthwise convolution, adjust the number of channels of the feature map after the depthwise convolution and integrate the information of different channels through point-by-point convolution; The channel attention mechanism module extracts important features from different channels, and inputs the feature sequence extracted by the adaptive state space module and the features extracted by the depthwise separable convolution module into the channel attention mechanism module for feature selection and filtering. The temporal features and spatial features output by the channel attention mechanism module are fused and input into the classification module for recognition and judgment of the composite dynamometer diagram to output the target prediction results.
9. A dynamometer diagram recognition device, characterized in that: include: at least one processor; as well as, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the dynamometer diagram recognition method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Oil pumping unit indicator diagram fault diagnosis method based on deep learning
CN117094370A
Memory-Guided Video Object Detection
US20220189170A1