A method for detecting abnormal pumping wells based on convolutional neural networks

By using a convolutional neural network-based method, the problem of low efficiency in traditional oil well fault diagnosis has been solved, enabling intelligent diagnosis and efficient detection of pumping unit well faults, and ensuring the accuracy of oil well operating conditions.

CN115641495BActive Publication Date: 2026-01-30XI'AN PETROLEUM UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211327287.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-25
Publication Date
2026-01-30
Estimated Expiration
2042-10-25

AI Technical Summary

Technical Problem

Traditional methods for diagnosing abnormal faults in oil wells are inefficient, and manual feature extraction carries the risk of information loss and errors, which affects the performance of classification algorithms.

Method used

A convolutional neural network-based approach is adopted. By preparing source and target domain datasets, performing dynamometer preprocessing, constructing a two-branch road domain separation convolutional neural network model using Adaboost, and redesigning the loss function, automatic feature extraction and learning are achieved.

Benefits of technology

It improves the accuracy and efficiency of fault diagnosis in oil pumping wells, meets the needs of on-site intelligent diagnosis, and makes up for the shortcomings of manual feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115641495B_ABST
    Figure CN115641495B_ABST
Patent Text Reader

Abstract

This invention provides a method for detecting abnormal pumping unit wells based on convolutional neural networks (CNNs). The method comprises the following steps: Step 1: Prepare source and target domain datasets and draw dynamometer diagrams; Step 2: Preprocess the dynamometer diagrams; Step 3: Divide the dataset; Step 4: Construct a two-branch domain separation convolutional neural network model and design a loss function; Step 5: Build a system using the pumping unit anomaly diagnosis model. This method for diagnosing abnormal pumping unit wells based on convolutional neural networks utilizes a large amount of historical data and excellent computing power to automatically extract and learn features, thus overcoming the drawback of potential human error in manual feature extraction. Furthermore, this invention enables intelligent diagnosis of pumping unit well faults, ensuring the accuracy of well condition diagnosis, improving the efficiency of pumping unit well fault diagnosis, and meeting the actual field needs of intelligent diagnosis of pumping unit well conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of abnormal pumping well detection technology, specifically relating to an abnormal pumping well detection method based on convolutional neural networks. Background Technology

[0002] Oil wells are the foundation of modern petroleum development, and the diagnosis of abnormal oil well malfunctions has always been a key focus and challenge in petroleum industry production. Under the traditional oilfield management model, my country generally adopts a use-and-maintenance strategy for pumping wells, meaning maintenance is only carried out when a malfunction affects normal industrial production. This approach requires frequent equipment inspections, increasing time costs and potentially extending the downtime of some pumping wells, leading to a decline in oil production. In line with the trends of refined and information-based management of abnormal wells, and coupled with the rapid development of artificial intelligence technology in recent years, the use of computer technology for abnormal well diagnosis has gained attention from scholars and researchers. For example, expert systems, support vector machines, and fuzzy theory have all been applied to methods for abnormal well diagnosis.

[0003] However, the main process of these methods involves manually extracting sample features first, and then using classification methods to classify patterns. Feature extraction generally employs data dimensionality reduction techniques to simplify complex data. This involves data transformation or mapping to obtain a new feature while preserving all the information from the original data. The process of manually extracting features carries risks such as information loss and errors in information extraction, which can affect the performance of subsequent classification algorithms. Summary of the Invention

[0004] To address the inefficiencies of traditional abnormal well diagnosis methods and the drawbacks of manual feature extraction in improved methods, the present invention aims to provide an abnormal pumping well detection method based on convolutional neural networks.

[0005] Therefore, the present invention provides a method for detecting abnormal pumping wells based on convolutional neural networks, comprising the following steps:

[0006] Step 1: Prepare source and target domain datasets, and plot the load and displacement in each motion cycle of the target domain as a dynamometer diagram;

[0007] Step 2: Preprocess the indicator diagram;

[0008] Step 3: Use Adaboost to make the source domain and target domain have similar distributions, determine the operating conditions of the oil wells according to the production and operation characteristics of the pumping unit wells, label the corresponding operating conditions on the dynamometer diagrams, and divide the dataset;

[0009] Step 4: Construct a two-branch domain separation convolutional neural network model and redesign the loss function;

[0010] Step 5: Build a system using the pumping unit anomaly diagnosis model.

[0011] Furthermore, in a method for detecting abnormal pumping wells based on convolutional neural networks, step 2, the specific process of preprocessing the dynamometer card, is as follows:

[0012] Step 201: Data Deduplication: Use the imagededup package in Python to delete exactly duplicate images in the dynamometer dataset using a hash algorithm;

[0013] Step 202, Image Enhancement: To remove redundant interference and highlight important information from the samples, data augmentation is required. Common data augmentation methods can alter the characteristics of the indicator image. Operations such as flipping, Mixup (randomly mixing two samples proportionally and distributing the classification results proportionally), CutOut (randomly deleting parts of the sample and filling them with 0 pixel values), and CutMi (deleting parts of the region but not filling them with 0 pixels, instead randomly filling them with pixel values ​​from other data in the training set) can change the integrity of the indicator image. Therefore, the enhancement methods adopted by this invention for the indicator image include binarization, line distortion, random scaling, and center displacement. This step can also increase the number of samples to some extent. The specific steps are as follows:

[0014] ① Binarize the image using the threshold function in OpenCV. Pixel values ​​above the threshold are set to 255, and pixel values ​​below the threshold are changed to 0. Then normalize the image and draw it as a 224*224 image.

[0015] ② Perform a sine transformation on the pixel coordinates of the indicator diagram and map them to the corresponding coordinates to complete the random line twisting operation;

[0016] ③ The dynamometer image is randomly scaled and stretched. The scaling operation involves scaling the target image to a random size and then filling it with pixels to a size of 224*224. The stretching operation involves randomly stretching the target image to a size and then cropping it to a size of 224*224. To ensure the integrity of the dynamometer image, the stretching degree is set between (0.82-1.18).

[0017] ④ Perform random vertical and horizontal displacement operations on the dynamometer image sample. Random displacement means moving all pixel values ​​on the target image randomly horizontally or vertically in a certain direction, while ensuring that the image size remains unchanged. However, this will cause some original pixels to be removed from the image, so the pixel values ​​of a certain area need to be reset. In this invention, in order to maintain the integrity of the dynamometer image, the pixel value range for horizontal displacement is set to -50 to 50, and the pixel value range for vertical displacement is set to -100 to 100. This ensures that important information of the dynamometer image is not displaced out of the image. At the same time, black is used to fill the areas where pixel values ​​need to be reset.

[0018] Step 203: The characteristics of each category of the dynamometer image can be greatly expanded by using inter-class transformation methods such as rotation.

[0019] ①For example Figure 2 (a) A similar normal dynamometer diagram can be rotated 180 degrees and still be included in the dataset as a normal dynamometer diagram. However, in actual oil well operations, there are fewer abnormal dynamometer diagrams and more normal dynamometer diagrams. In order to ensure the generalization ability of the model and the balance of the data, this invention performs a random deletion operation on the normal dynamometer diagrams.

[0020] ②For example Figure 2 (b) The data for the lower and upper impact pumps can be converted by rotating 180 degrees;

[0021] ③ For example Figure 2 (c) Leakage of the moving valve and such Figure 2 (d) The fixed valve leakage indicator diagram can be rotated 180 degrees to convert between different diagrams;

[0022] ④ Part such as Figure 2 (f) Indicator diagram for slow closing of traveling valve and such Figure 2 (e) The two dynamometers for insufficient liquid supply are similar and need to be carefully screened before conversion. The conversion method is still to rotate 180 degrees.

[0023] Furthermore, step 3: using Adaboost to make the source domain and target domain form similar distributions, determining the well's operating conditions based on the production and operation characteristics of the pumping unit well, labeling the corresponding operating conditions on the dynamometer card, and dividing the dataset, includes the following steps:

[0024] Step 301: Sample Transfer. Addressing the class imbalance problem in the dataset, the AdaBoost algorithm is used to filter out samples from the source domain that differ significantly from the target domain by assigning different weights to the samples. Then, the samples in the source domain are reweighted to form a distribution similar to the target domain. Let the weight of the source domain be w. source The weight of the target domain is w target The specific form is as follows:

[0025]

[0026]

[0027] Then, the weight update operations for the source and target domains are performed in a loop:

[0028]

[0029] In equation (3), β in the source domain is denoted as β source ; β in the target domain is denoted as β target The formula is as follows:

[0030]

[0031]

[0032] β target The error rate of each weak classifier G(x) in the target dataset is:

[0033]

[0034] Step 302: Target domain dataset partitioning: The expanded indicator maps are divided into several categories based on their type, such as normal operation indicator maps, insufficient fluid supply indicator maps, and gas-affected indicator maps. Each indicator map is saved to a txt file, named in the format of image "path tag", such as (img / 1 / a001.jpg), for model retrieval. Indicator maps of different categories are saved in different folders, thus obtaining the number of categories, and then stored in the same folder containing the txt files. After saving, the file order is randomly shuffled, and then 70% is randomly selected as the training set and 30% as the test set.

[0035] Furthermore, in step 4: constructing a two-branch domain separation convolutional neural network model, and simultaneously redesigning the two-branch domain separation convolutional neural network model in the loss function as a Vgg16 model, the Softmax activation function in the top layer of the Vgg16 model is as follows:

[0036]

[0037] Among them, a k It is the k-th input signal in the output layer, and i is the number of output nodes;

[0038] The empirical estimate of MMD can be expressed as:

[0039]

[0040] Furthermore, the loss function includes difference loss, similarity loss, and classification loss;

[0041] The difference loss function is

[0042]

[0043] Where λ is the regularization term, used to balance the difference loss, classification loss, and MMD value, while... Where k(x) i y j ) is the kernel function, and the radial product function is usually chosen for calculation.

[0044] The classification loss function is the sum of the loss functions of the two classifiers, one for the source domain and the other for the target domain. The specific formula is as follows:

[0045]

[0046] Where L source and L target Let be the classification losses for the source domain and the target domain, respectively, where n is the number of classes in the source domain, and y is the classification loss for the target domain. pi The classifier predicts the class of a sample; m is the class of the target domain, and y is the class of the sample. pj Predict the class of a sample for the classifier.

[0047] Furthermore, the specific steps for updating the two-branch domain separation convolutional neural network model are as follows:

[0048] Step 601: Input the source domain and target domain data into the network simultaneously;

[0049] Step 602: Use a network structure with shared parameters to extract common features, and use an independent network structure to extract private features of the source and target domains;

[0050] Step 603: Based on the extracted features and combined with the MMD values, calculate the total loss function of the model.

[0051] Furthermore, the accuracy level of the two-branch domain separation convolutional neural network model is determined by calculating the overall loss value using the following formula:

[0052] Loss=αL d +βL s +γL c (12)

[0053] α, β, and γ are the coefficients of each loss, used to control the weights of each loss value.

[0054] This invention provides a diagnostic method for abnormal pumping unit wells based on convolutional neural networks. Convolutional neural networks in deep learning can utilize vast amounts of historical data and superior computing power to automatically extract and learn features, overcoming the potential human error associated with manual feature extraction. Simultaneously, this invention enables intelligent diagnosis of pumping unit well faults, ensuring the accuracy of well condition diagnosis, improving the efficiency of pumping unit well fault diagnosis, and meeting the practical needs of intelligent diagnosis of pumping unit well conditions in the field, thus bringing new vitality to the research of fault diagnosis technology.

[0055] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. Attached Figure Description

[0056] Figure 1 This is a flowchart of the abnormal pumping well diagnosis method based on convolutional neural networks in this invention.

[0057] Figure 2 These are different types of indicator diagrams.

[0058] Figure 3 This is a diagram of the Vgg16 structure.

[0059] Figure 4 This is a diagram of the architecture designed for network training.

[0060] Figure 5 This is the new top-level structure diagram. Detailed Implementation

[0061] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the specific implementation methods, structural features and effects of the present invention are described in detail below with reference to the accompanying drawings and embodiments.

[0062] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] All features disclosed in this specification, or all steps in all disclosed methods or processes, may be combined in any way, except for mutually exclusive features and / or steps.

[0064] Any feature disclosed in this specification (including any appended claims, abstract, and drawings) may be replaced by other equivalent or similar features, unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is merely one example of a series of equivalent or similar features.

[0065] This embodiment provides a method such as Figure 1 The method for detecting abnormal pumping wells based on convolutional neural networks, as shown, includes the following steps:

[0066] Step 1: Prepare source and target domain datasets, and plot the load and displacement in each motion cycle of the target domain as a dynamometer diagram;

[0067] Step 2: Preprocess the indicator diagram;

[0068] Step 3: Use Adaboost to make the source domain and target domain have similar distributions, determine the operating conditions of the oil wells according to the production and operation characteristics of the pumping unit wells, label the corresponding operating conditions on the dynamometer diagrams, and divide the dataset;

[0069] Step 4: Construct a two-branch domain separation convolutional neural network model and redesign the loss function;

[0070] Step 5: Build a system using the pumping unit anomaly diagnosis model.

[0071] Further, in step 1, prepare the relevant datasets: including the ImageNet dataset as the source domain and the pumping unit dynamometer diagram dataset as the target domain. When the target domain dataset is a large amount of numerical data with labels, the units of loads should be standardized to kilonewtons (kN) and the units of displacement data should be standardized to meters (m), and the data should be stored in a CSV file for later use. Then, using the data in the CSV file as the raw data, with displacement on the horizontal axis and load on the vertical axis, the dynamometer diagram is plotted using the matplotlib library in Python.

[0072] Furthermore, in step 2: For the dynamometer card: to reduce the negative impact of samples on the model and thus improve the model's accuracy, the dynamometer card samples generated in the first step need to undergo three preprocessing steps: The specific preprocessing process is as follows:

[0073] Step 201: Data Deduplication: Use the imagededup package in Python to delete exactly duplicate images in the dynamometer dataset using a hash algorithm;

[0074] Step 202, Image Enhancement: To remove redundant interference and highlight important information from the samples, data augmentation is required. Common data augmentation methods can alter the characteristics of the indicator image. Operations such as flipping, Mixup (randomly mixing two samples proportionally and distributing the classification results proportionally), CutOut (randomly deleting parts of the sample and filling them with 0 pixel values), and CutMi (deleting parts of the region but not filling them with 0 pixels, instead randomly filling them with pixel values ​​from other data in the training set) can change the integrity of the indicator image. Therefore, the enhancement methods adopted by this invention for the indicator image include binarization, line distortion, random scaling, and center displacement. This step can also increase the number of samples to some extent. The specific steps are as follows:

[0075] ① Binarize the image using the threshold function in OpenCV. Pixel values ​​above the threshold are set to 255, and pixel values ​​below the threshold are changed to 0. Then normalize the image and draw it as a 224*224 image.

[0076] ② Perform a sine transformation on the pixel coordinates of the indicator diagram and map them to the corresponding coordinates to complete the random line twisting operation;

[0077] ③ The dynamometer image is randomly scaled and stretched. The scaling operation involves scaling the target image to a random size and then filling it with pixels to a size of 224*224. The stretching operation involves randomly stretching the target image to a size and then cropping it to a size of 224*224. To ensure the integrity of the dynamometer image, the stretching degree is set between (0.82-1.18).

[0078] ④ Perform random vertical and horizontal displacement operations on the dynamometer image sample. Random displacement means moving all pixel values ​​on the target image randomly horizontally or vertically in a certain direction, while ensuring that the image size remains unchanged. However, this will cause some original pixels to be removed from the image, so the pixel values ​​of a certain area need to be reset. In this invention, in order to maintain the integrity of the dynamometer image, the pixel value range for horizontal displacement is set to -50 to 50, and the pixel value range for vertical displacement is set to -100 to 100. This ensures that important information of the dynamometer image is not displaced out of the image. At the same time, black is used to fill the areas where pixel values ​​need to be reset.

[0079] Step 203: The characteristics of each category of the dynamometer image can be greatly expanded by using inter-class transformation methods such as rotation.

[0080] ①For example Figure 2(a) A similar normal dynamometer diagram can be rotated 180 degrees and still be included in the dataset as a normal dynamometer diagram. However, in actual oil well operations, there are fewer abnormal dynamometer diagrams and more normal dynamometer diagrams. In order to ensure the generalization ability of the model and the balance of the data, this invention performs a random deletion operation on the normal dynamometer diagrams.

[0081] ②For example Figure 2 (b) The data for the lower and upper impact pumps can be converted by rotating 180 degrees;

[0082] ③ For example Figure 2 (c) Leakage of the moving valve and such Figure 2 (d) The fixed valve leakage indicator diagram can be rotated 180 degrees to convert between different diagrams;

[0083] ④ Part such as Figure 2 (f) Indicator diagram for slow closing of traveling valve and such Figure 2 (e) The two dynamometers for insufficient liquid supply are similar and need to be carefully screened before conversion. The conversion method is still to rotate 180 degrees.

[0084] Furthermore, step 3: using Adaboost to make the source domain and target domain form similar distributions, determining the well's operating conditions based on the production and operation characteristics of the pumping unit well, labeling the corresponding operating conditions on the dynamometer card, and dividing the dataset, includes the following steps:

[0085] Step 301: Sample Transfer. Addressing the class imbalance problem in the dataset, the AdaBoost algorithm is used to filter out samples from the source domain that differ significantly from the target domain by assigning different weights to the samples. Then, the samples in the source domain are reweighted to form a distribution similar to the target domain. Let the weight of the source domain be w. source The weight of the target domain is w target The specific form is as follows:

[0086]

[0087]

[0088] Then, the weight update operations for the source and target domains are performed in a loop:

[0089]

[0090] In equation (3), β in the source domain is denoted as β source ; β in the target domain is denoted as β target The formula is as follows:

[0091]

[0092]

[0093] β target The error rate of each weak classifier G(x) in the target dataset is:

[0094]

[0095] Step 302: Target domain dataset partitioning: The expanded indicator maps are divided into several categories based on their type, such as normal operation indicator maps, insufficient fluid supply indicator maps, and gas-affected indicator maps. Each indicator map is saved to a txt file, named in the format of image "path tag", such as (img / 1 / a001.jpg), for model retrieval. Indicator maps of different categories are saved in different folders, thus obtaining the number of categories, and then stored in the same folder containing the txt files. After saving, the file order is randomly shuffled, and then 70% is randomly selected as the training set and 30% as the test set.

[0096] Further, step 4: Construct a two-branch domain separation convolutional neural network model based on Vgg16, and redesign the loss function;

[0097] Based on the idea of ​​transfer learning, a convolutional neural network for training and a network loss function that fits the requirements are designed: the convolutional neural network model is modified from Vgg16 and selected from InceptionV3, Vgg16, Resnet-v2 and Xception. Although Vgg16 is not the most accurate among the four different initial models, it is the optimal choice for this invention when considering the model size comparison. Specific information is shown in Table 1.

[0098] Table 1. Information for four different initial models

[0099]

[0100] If we divide the Vgg16 network structure using the Maxpooling layer as the boundary, it can be viewed as consisting of 6 modules, such as... Figure 3 As shown, the number of channels is the same in each block structure. Due to the difference between the source and target domains, this invention uses the first five modules of Vgg16 to design a two-branch domain separation convolutional neural network. The structure mainly consists of three parts: feature extraction, adaptation layer, and classification, as shown in the diagram. Figure 4 As shown.

[0101] Feature extraction is based on the Vgg16 architecture, with private and shared encoding structures designed for the source and target domains. The private encoding structure extracts private features, while the shared encoding structure extracts common features. In the private encoding structure, Vgg models 1 through 5 are used to extract features from the source and target domain images, respectively. In the shared encoding structure, Vgg models 1 through 4 are trained on the source and target domain datasets, respectively, and share parameters. Module 5 extracts high-level features from the corresponding images.

[0102] The fifth module connects to the new top layer, such as... Figure 5 The new top layer shown is designed as a dense layer with 512 neurons and a softmax output layer. The softmax activation function in the top layer of the Vgg16 model is as follows:

[0103]

[0104] Among them, a k It is the k-th input signal in the output layer, and i is the number of output nodes;

[0105] Since there are certain differences in the feature distributions between the source and target domains, simply extracting image features separately through the feature extraction layer cannot effectively reduce the difference between the two feature distributions. Therefore, an adaptation layer is added to the new top layer, introducing the MMD criterion to learn domain-invariant feature representations. During training, the difference between the two domains is reduced by minimizing the adaptive metric. Simultaneously, when the target domain has few data labels, the high-quality operation of the model can be guaranteed. Let MMD be a continuous function set in a sample space, then the empirical estimate of MMD can be expressed as:

[0106]

[0107] After the adaptation layer calculates the MMD distance, it is used together with the loss function as the network's optimization objective. By minimizing the feature distribution differences between the source and target domains and the classifier loss, the network's recognition performance is further improved. The loss function includes difference loss, similarity loss, and classification loss.

[0108] The difference loss function is defined by the soft subspace orthogonality constraint between private and shared domain features, causing shared and private encodings to encode different aspects of the input. The input to this loss function consists of the target domain image features obtained from the target domain private encoding structure and the source domain image features obtained from the source domain private encoding structure. The specific formula is as follows:

[0109]

[0110] in, The source domain common characteristic matrix, For the source domain private feature matrix, The common feature matrix of the target domain, The target domain's private feature matrix;

[0111] The similarity loss function is measured by MMD distance, and the specific formula is as follows:

[0112] Ls=λMMD 2 [F, X, Y] (10)

[0113] Where λ is the regularization term, used to balance the difference loss, classification loss, and MMD value, while... Where k(x) i y j ) is the kernel function, and the radial product function is usually chosen for calculation.

[0114] The classification loss function is the sum of the loss functions of the two classifiers, one for the source domain and the other for the target domain. The specific formula is as follows:

[0115]

[0116] Where L source and L target Let be the classification losses for the source domain and the target domain, respectively, where n is the number of classes in the source domain, and y is the classification loss for the target domain. pi The classifier predicts the class of a sample; m is the class of the target domain, and y is the class of the sample. pj Predict the class of a sample for the classifier.

[0117] Furthermore, the accuracy level of the two-branch domain separation convolutional neural network model is determined by calculating the overall loss value using the following formula:

[0118] Loss=αL d +βL s +γL c (12)

[0119] α, β, and γ are the coefficients of each loss, used to control the weights of each loss value.

[0120] like Figure 4 As shown, the specific steps for updating the two-branch domain separation convolutional neural network model are as follows:

[0121] Step 601: Input the source domain and target domain data into the network simultaneously;

[0122] Step 602: Use a network structure with shared parameters to extract common features, and use an independent network structure to extract private features of the source and target domains;

[0123] Step 603: Based on the extracted features and combined with the MMD values, calculate the total loss function of the model. Determine whether the diagnostic model has reached the preset accuracy. If it has not reached the preset accuracy, adjust the initialization parameters and continue the above steps until the diagnostic model reaches the preset accuracy. The preset accuracy standard of this invention is that the output result or loss remains almost unchanged. If the preset accuracy is reached, verify the diagnostic model that has reached the preset accuracy to obtain the verification accuracy.

[0124] Step 5: Based on the abnormal pumping well diagnosis method based on convolutional neural network, construct an abnormal pumping well diagnosis system. Input the dynamometer card, output the identification and diagnosis results, and give corresponding suggestions. For example, when the system diagnosis result is sand production in the well, it will give corresponding treatment measures: install sand anchor, optimize parameters, flush the well or circulate oil pumping.

[0125] In summary, this method for diagnosing abnormal pumping unit wells based on convolutional neural networks (CNNs) leverages the vast amounts of historical data and superior computational power of deep learning's CNNs to automatically extract and learn features, thus mitigating the potential for human error in manual feature extraction. Furthermore, this invention enables intelligent diagnosis of pumping unit well faults, ensuring the accuracy and efficiency of well condition diagnosis, and meeting the practical needs of intelligent pumping unit well condition diagnosis in the field, thus bringing new vitality to the research of fault diagnosis technology.

[0126] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for detecting an abnormal pumping well based on a convolutional neural network, characterized in that, Comprising the following steps: Step 1: Prepare the source domain and target domain data set, plot the load and displacement in each motion cycle of the target domain into a dynamometer diagram; Step 2: Preprocess the dynamometer diagram; Step 3: Use Adaboost to make the source domain and target domain constitute similar distribution, determine the working condition of the oil well according to the production operation characteristics of the pumping well, label the dynamometer diagram corresponding to the working condition, and divide the data set; Specifically comprising the following steps: Step 301: sample migration, for the problem of inter-class imbalance of the data set, the Adaboost algorithm is used to filter out the samples that are very different from the target domain in the source domain by giving different weights to the samples, and then the weights in the source domain are reweighted to form a similar distribution to the target domain; first, the weight of the source domain is w source , the weight of the target domain is w target , and the specific form is as follows: After that, the weight updating operation of the source domain and the target domain is performed in a loop: In formula (3), β in the source domain is denoted as β source ; β in the target domain is denoted as β target , and the formula is as follows: β target The error rate of each weak classifier G(x) in the target dataset is: Step 302: For the division of the target domain data set: according to the different categories, the expanded dynamometer diagram is divided into normal working dynamometer diagram, insufficient liquid supply dynamometer diagram and gas influence dynamometer diagram; Step 4: Construct a two-branch domain separation convolutional neural network model and redesign the loss function; Step 5: Use the pumping unit abnormal diagnosis model to build a system.

2. The convolutional neural network-based abnormal pumping well detection method of claim 1, wherein: The specific process of the step 2: preprocessing the dynamometer diagram is: Step 201, data deduplication: using the imagededup package of python, the hash algorithm is used to delete the exactly repeated pictures in the dynamometer diagram data set; Step 202, image enhancement: the strengthening methods adopted for the dynamometer diagram are binarization, line distortion, random scaling and center displacement, and the specific steps are: ①Through the threshold function in OpenCV, the image is binarized, the pixel value higher than the threshold value is determined as 255, and the pixel value lower than the threshold value is changed to 0, then the image is normalized and its size is plotted as 224*224; ②Sinusoidal transformation is performed on the pixel coordinates of the dynamometer diagram, which is mapped to the corresponding coordinates to complete the random line distortion operation; ③Random scaling and stretching operation is performed on the dynamometer diagram, the scaling operation is to scale the target picture to a random size, then the pixel filling method is used to fill it to the size of 224*224, the stretching operation is to randomly stretch the target picture to a size, then the cropping operation is used to crop it to the size of 224*224, and the stretching degree is set between (0.82-1.18); ④Random vertical and horizontal displacement operation is performed on the dynamometer diagram sample, the random displacement is to move all pixel values on the target picture in a certain direction, while ensuring that the size of the image does not change; the pixel value interval of horizontal displacement is set to negative 50 to 50, and the pixel value interval of vertical displacement is set to negative 100 to 100; Step 203: According to the characteristics of each category of the dynamometer diagram, the data set image is expanded through rotation and other inter-class transformation methods.

3. The convolutional neural network-based abnormal pumping well detection method of claim 1, wherein: The step 302 further comprises storing each dynamometer diagram into a txt file and naming it, the naming format is "picture path label", so that the model can be read; the dynamometer diagrams of different categories are stored in different folders; after storage, the files are randomly shuffled in order, then 70% is randomly selected as the training set and 30% is randomly selected as the test set.

4. The convolutional neural network-based abnormal pumping well detection method of claim 1, wherein: The two-branch domain separation convolutional neural network model constructed in the step 4 and the redesigned loss function are based on Vgg16, and the Softmax activation function in the network top layer of the Vgg16 model is as follows: where a k is the kth input signal in the output layer, i is the number of output nodes; The empirical estimation of MMD can be expressed as:

5. The convolutional neural network-based abnormal pumping well detection method of claim 4, wherein: The loss function comprises a difference loss, a similarity loss and a classification loss; The difference loss function is wherein, is a source domain public feature matrix, is a source domain private feature matrix, is a target domain public feature matrix, is a target domain private feature matrix; The similarity loss function is measured by MMD distance, and a specific formula is: Ls = λMMD 2 [F, X, Y] (10) where λ is a regularization term to balance the discrepancy loss, the classification loss and the MMD value, while where k(x i ,y j ) is a kernel function, usually a radial product function The classification loss function takes the sum of two classifier loss functions for classification tasks of the source domain and the target domain, and a specific formula is: where L source and L target are the classification loss of source domain and target domain respectively, n is the class of source domain, y pi is the class of the sample predicted by the classifier; m is the class of target domain, y pj is the class of the sample predicted by the classifier.

6. The convolutional neural network-based abnormal pumping unit well detection method of claim 4, wherein: The specific steps of updating the two-branch domain separation convolutional neural network model are: Step 601, inputting the source domain and the target domain data into the network simultaneously; Step 602, extracting common features using a network structure sharing parameters, and extracting private features of the source domain and the target domain using independent network structures; Step 603, calculating the total loss function of the model according to the extracted features and in combination with the MMD value.

7. The convolutional neural network-based abnormal pumping unit well detection method of claim 4, wherein: The accuracy level of the two-branch domain separation convolutional neural network model is determined by calculating the overall loss value through the following formula: Loss = aL d + βL s + γL c (12) Wherein, α, β and γ are coefficients of each loss, used to control the weight of each loss value.

Citation Information

Patent Citations

  • Rod-pumped well fault diagnosis method based on feature recalibration residual convolutional neural network model

    CN111810124A

  • Landslide identification method and system based on attention mechanism and multi-modal representation learning

    CN114170533A