Oil pumping unit packing oil leakage fault detection method

By introducing the Retinexformer image enhancement module and lightweight MobileNet v3 network into the YOLOv8 object detection algorithm, combining the depth separation convolution and efficient multi-scale attention mechanism, the accuracy of oil leakage fault detection of oil pumps in harsh environments is solved, achieving higher detection accuracy and production safety.

CN119810808APending Publication Date: 2025-04-11NANJING FUDAO OIL & GAS INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411869824.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the harsh environment of the oil pump, the prior art is difficult to accurately detect oil leakage failures in special circumstances such as insufficient light and shadow shading, resulting in missed inspection and missed inspection problems.

Method used

Based on the YOLOv8 object detection algorithm, the Retinexformer image enhancement module was introduced to improve the brightness and contrast of dark light images, and replaced the original backbone network with a lightweight MobileNet v3 network, combining depth separation convolution and efficient multi-scale attention mechanism to improve feature extraction and detection accuracy.

Benefits of technology

The improved YOLOv8 model can more accurately detect oil leakage failure of the oil pumping machine under special circumstances, improving detection accuracy and production safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810808A_ABST
    Figure CN119810808A_ABST
Patent Text Reader

Abstract

The invention discloses a pumping unit packing oil leakage fault detection method. According to the method, firstly, a Retinexformer dark light image enhancement network is utilized, the image brightness and contrast are improved, and feature information of key parts of oil pumping unit packing equipment is highlighted; a backbone network of YOLOv8 is replaced with a MobileNet v3 lightweight network, the calculation load is reduced, features extracted by a backbone are input to a neck network, and the relation between different scales is further fused. An efficient multi-scale attention mechanism EMA module is introduced, channel dimensions and batch dimensions are reorganized, the feature processing capacity of the model is improved, and the corresponding relation of pixel levels is captured. In the regression loss detection process, CIOU is replaced with Wise-IOU to balance the proportion of high and low mass samples and reduce the penalty effect of low mass samples. According to the method, the oil leakage fault of the pumping unit packing can be accurately warned in real time, and the production safety is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of detection of oil leakage faults of packings of pumping units in oil well production, and uses artificial intelligence to complete real-time detection of oil leakage faults of packings of pumping units. Background Art

[0002] The oil pump is an important equipment in oil well production. Due to the harsh environment in which it is located, it requires frequent maintenance. Due to its scattered location, its labor maintenance cost is high and its work efficiency is low.

[0003] For underground failure problems of oil pumps, current analysis and identification are mainly based on the indicator diagram; while for common failure problems on the well, such as packing leakage, they can only rely on manual on-site inspections, which seriously affects production safety.

[0004] With the rapid development of artificial intelligence, deep learning target detection technology has begun to be widely used in industrial scenarios. The current YOLO target detection algorithm has attracted widespread attention due to its performance advantages. After multiple iterations, the YOLOv8 version has the advantages of high detection accuracy and fast speed, and can perform real-time detection of packing in key parts of oil pumps.

[0005] However, in actual operation, due to the harsh environment in which the pumping unit is located, special situations such as insufficient lighting and shadows are prone to occur, resulting in problems such as missed detection and false detection during the detection process. Therefore, it is necessary to improve the original target detection algorithm to improve the fault detection and diagnosis capabilities of the packing part of the pumping unit under special circumstances. Summary of the invention

[0006] In view of the problems existing in the background technology, the present invention improves the YOLOv8 target detection algorithm, and the method has the following steps:

[0007] 1. Collect pictures of oil pumping units in the working process, use data enhancement method for preprocessing, build oil pump working image dataset S, divide it into training set, validation set and test set according to the ratio of 7:2:1.

[0008] 2. Introducing Retinexformer in the YOLOv8 front-end module can effectively enhance the brightness and contrast of dark-light images while reducing noise distortion caused by image enhancement. Retinexformer is an image enhancement method based on the combination of Retinex and Transformer. It is a single-stage network architecture based on retinal theory, which is divided into an illumination estimator and a damage compensator to enhance the quality of dark-light images. This can provide clearer detail information for the subsequent YOLOv8 target detection network to improve the detection accuracy of oil pumping unit packing leakage failures.

[0009] 3. Improve the YOLOv8 network, and replace the original backbone network with the MobileNet v3 network. It uses the neural network architecture search technology NAS, and combines the deep separable convolution and linear bottleneck inversion residual structure fusion of MobileNet v1 and MobileNet v2 to achieve higher accuracy and lower latency. It is mainly composed of the convolution activation CBH module, Bneck module, and pooling operation Pool. At the same time, the SE lightweight channel attention mechanism is introduced to improve the feature extraction capability. The new backbone network is more lightweight and can find optimized models for specific hardware platforms. It has good deployment effect and low latency on mobile terminals.

[0010] 4. The training set of pumping unit working images is input into the improved YOLOv8 detection model for training. In the backbone, it passes through a lightweight MobileNet v3 network, in which the convolution operation is a depth-separable convolution, which includes two convolution processes: channel-by-channel convolution (DWC) and point-by-point convolution (PWC). DWC performs channel-by-channel single-kernel convolution on M-layer feature maps, while PWC pays more attention to the relationship between multi-scale feature maps. After weighted fusion, a new feature map is obtained. Compared with the traditional fixed convolution kernel, the number of parameters is reduced and the computational cost is saved. Three different levels of features F1, F2, and F3 are extracted through processes such as spatial pyramid pooling SPFF.

[0011] 5. Input F1, F2, and F3 into the Neck module, and after the upsampling process and concatenation operation, realize the fusion of different scales, introduce C2f to obtain richer gradient flow information, and introduce the efficient multi-scale attention EMA module in the Neck network to enhance the multi-scale feature extraction capability. The EMA module mainly improves the model's ability to process features by reorganizing the channel dimension and batch dimension. Add it between the C2f module and the detection head in the Neck network, and use cross-dimensional interaction to capture the relationship at the pixel level, and finally obtain the new three-layer features F4, F5, and F6.

[0012] 6. Input the three-layer features of F4, F5, and F6 into the detection module, decouple them through the decoupling head, and obtain two branches, namely classification loss and bounding box regression loss. For the classification problem, the binary cross entropy BCE loss is used. For the detection bounding box regression loss, the bounding box loss Wise-IOU Loss and the distribution focus loss DFL are combined to improve the convergence speed of the model and the accuracy of the detection box. The YOLOv8 algorithm adopts the Task-Aligned Assigner dynamic sample allocation strategy. The optimal Top k positive samples are obtained by sorting according to the predicted category score and the IOU intersection-and-union weighted score. K is usually 10, and the following formula is used for sample screening:

[0013] t=s α ×u β

[0014] Where α and β are weight hyperparameters, s is the category score predicted for each pixel, u is the regression score of the pixel prediction box and all target boxes, and t is the weighted score.

[0015] 7. The improved neural network model obtained after training inputs the image information of the pumping unit packing part into the improved YOLOv8 network to provide real-time warning of the pumping unit packing oil leakage fault condition.

[0016] Beneficial effects:

[0017] The present invention proposes a method for detecting oil leakage faults in the packing of an oil pumping unit. The improved YOLOv8 model is adopted, and the Retinexformer dark light enhancement module is introduced in the front end to provide clearer image features for the subsequent backbone network. The YOLOv8 backbone network is replaced with the lightweight model MobileNet v3 to ensure high detection accuracy while saving computational complexity. The EMA efficient multi-scale attention mechanism is added to the neck network to improve the model's ability to process features by reorganizing the channel dimension and batch dimension, and to capture pixel-level relationships by cross-dimensional interaction. In the partial loss function of the detection head, the CIOU in the border regression loss is replaced by Wise-IOU to improve the convergence speed of the model. The improved YOLOv8 model is of great value for timely and accurate detection of oil leakage faults in the packing of oil pumping units and ensuring production safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a system flow chart of a method for detecting oil leakage fault of a packing of an oil pumping unit according to the present invention;

[0019] Figure 2 This is a block diagram of the improved YOLOv8 model network structure in the present invention;

[0020] Figure 3 This is the Retinexformer image enhancement effect diagram in the present invention;

[0021] Figure 4 This is a structural block diagram of the depthwise separable convolution module in the present invention;

[0022] Figure 5 This is a structural block diagram of the EMA module of the efficient attention mechanism in the present invention. DETAILED DESCRIPTION

[0023] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments, and the implementation effect of the method in the working process of the oil pump is described by a specific operation process. This implementation case is implemented based on the technical solution of the present invention, but the protection scope of the present invention is not limited to the following embodiments.

[0024] This case takes a certain enterprise as an example to illustrate the effectiveness and implementation process of this method. The working image training set of the oil pumping unit in different scenes from September to October 2024 of a certain enterprise is used to analyze the effectiveness of the method of the present invention in detecting faults in the working process of the oil pumping unit. The overall flow chart of the system of the present invention is as follows: Figure 1 shown.

[0025] The specific process is as follows:

[0026] 1) 2000 images of packing equipment during oil extraction of oil pumping units were obtained and divided into 1400 training sets, 400 validation sets and 200 test sets in a ratio of 7:2:1 according to the hold-out method.

[0027] 2) The improved YOLOv8 model network diagram is as follows Figure 2 As shown in the figure, due to the low brightness and contrast of the image, the feature extraction ability of the model is affected, which will lead to missed detection and false detection of key parts of the oil pump packing equipment, reducing the accuracy of model detection. Therefore, the Retinexformer image enhancement network is introduced at the front end. The Retinexformer framework contains an illumination evaluator and a loss restorer. The IGAB illumination-guided attention module included in the loss restorer introduces the illumination-guided multi-head attention mechanism IG-MSA, which uses illumination features to guide the non-local interaction of the modeling area. By inserting the illumination-guided architecture into the Retinex-based single-stage framework ORF, the long-distance dependency problem is effectively solved. The effect comparison before and after dark light image enhancement is as follows: Figure 3 shown.

[0028] 3) The original backbone network is replaced with a lightweight MobileNet v3, which is mainly composed of a convolutional activation CBH module, a Bneck module, and a pooling operation Pool, and the SE channel attention mechanism is introduced. The convolution operation mode used is a depth-separable convolution, such as Figure 4 As shown in the figure, the steps are mainly divided into two processes: channel-by-channel convolution DWC and point-by-point convolution PWC. The DWC operation is to pass the original feature map of size D*D*M through M C*C convolution kernels with a channel of 1, perform single-channel convolution, and obtain M convolution features. Then perform the PWC operation, and convolve the D*D*M feature map through N 1*1*M convolution kernels to obtain a new feature map of D*D*N. The total calculation amount FLOPs and parameter amount P are calculated as follows:

[0029] FLOPs = D F ×D F ×M×D K ×D K +M×N×D F ×D F

[0030] P=M×D K ×D K +M×N

[0031] 4) In the backbone network, three levels of features P1, P2, and P3 are output. The feature map sizes are 80*80, 40*40, and 20*20 respectively, and the number of channels is different. The smaller-scale feature maps are concat-fused with the larger-scale feature maps through upsampling and other processes. Subsequently, the C2f module combines the residual structure and the idea of ​​shunting to obtain richer gradient flow information while ensuring lightweight. After the three branches of C2f, the EMA attention mechanism module is integrated. Figure 5 As shown in the figure, some channels are reshaped into batch dimensions, and the channel dimensions are grouped into multiple sub-features so that the spatial semantic features are evenly distributed in each feature group. In addition, the output features of the two parallel branches are aggregated through cross-dimensional interaction to capture the corresponding relationship at the pixel level. The new three-level features P4, P5, and P6 are obtained and input into the subsequent detection module.

[0032] 5) The detection process mainly separates the category prediction and bounding box regression prediction based on the decoupling head. YOLOv8 uses binary cross entropy BCE loss for category loss, and distribution focus loss DFL and bounding box loss Wise-IOULoss for bounding box regression. In this model, Wise-IOU v3 is used to replace CIOU. Because it has a dynamic non-monotonic focusing mechanism, it provides a wise gradient gain allocation strategy for the imbalance problem of positive and negative samples, weighing the ratio of high-quality samples and low-quality samples, which can effectively reduce the penalty effect brought by low-quality samples. Wise-IOU v3 adds a dynamic non-monotonic focusing mechanism based on the v1 version. The specific calculation is as follows:

[0033] L IoU =1-IOU

[0034] L WIoUv1 =R WIoU L IoU

[0035]

[0036] Among them, IOU is used to measure the overlap between the predicted position and the actual position of the target, x, y represent the predicted position coordinates, x gt ,y gt Indicates the actual position coordinates of the target, W g and H g Represents the width and height of the minimum closed area of ​​the real box and the predicted box of the detected object, and the bounding box loss L is obtained WIoUv1, where the role of “*” is to separate the variables from the computational graph and effectively remove the factors that hinder convergence.

[0037]

[0038] The outlier degree β is defined to describe the quality of the anchor box, and the hyperparameters α and δ are model learning parameters. IoU is the model focusing coefficient, and the bounding box loss L with dynamic gradient gain allocation strategy characteristics is obtained WIoUv3 .

[0039] The experimental environment configuration and experimental parameter settings involved in the implementation of this method are shown in Table 1.

[0040] Table 1 Configuration information table

[0041]

[0042] In order to verify the advantages of the model designed by the present invention over other models, Faster R-CNN, YOLOv5, YOLOv7, YOLOv8 and the improved model of the present invention were selected for comparative experiments under the same configuration environment, and the comparison results are shown in Table 2. The results show that the frame rate and mAP@0.5 results of Faster R-CNN are lower, YOLOv7 and YOLOv5 have improved fault detection performance, and the improved model shows obvious advantages in precision P and mAP@0.5.

[0043] Table 2 Comparison test

[0044]

[0045] From the above analysis, it can be seen that the method for detecting oil leakage fault of oil pumping unit proposed in the present invention can timely and accurately warn the oil pumping unit packing leakage fault condition by improving the backbone network, neck network and detection module in the YOLOv8 model, and effectively ensure the smooth and normal operation of the oil pumping unit.

Claims

1. A method for detecting oil leakage fault of a pumping unit packing, characterized in that The YOLOv8 target detection algorithm is improved to complete the detection of oil leakage faults in the pumping unit packing. The specific steps include: 1) Collect image information of the packing equipment of the oil pumping unit in working state and construct an oil pumping unit working image dataset S; 2) The Retinexformer module is introduced at the front end of the YOLOv8 detection model to enhance dark light images. The Retinex and Transformer are combined to enhance image brightness and contrast, and suppress the amplification of noise loss. 3) Improve the YOLOv8 detection model: introduce a lightweight backbone network MobileNet v3 to replace the original backbone network to balance the relationship between model lightweight and accuracy, and introduce an efficient multi-scale attention mechanism EMA module in the Neck module at the front end of the detection module; 4) Input the training set S of the pumping unit working images into the improved YOLOv8 detection model for training. In the backbone, it passes through the MobileNet v3 network, whose internal convolution operation mode is depth-separable convolution, and extracts three different levels of features F1, F2, and F3; 5) Input F1, F2, and F3 into the neck module, and obtain new three-layer features F4, F5, and F6 based on the introduced efficient multi-scale attention mechanism EMA module in the neck module; 6) Input F4, F5, and F6 to the detection module, and use the decoupling head to decouple them to obtain two branches, namely classification loss and bounding box regression loss. For the detection bounding box regression loss, the Wise-IOU loss function is used to replace CIOU to improve the detection accuracy; 7) The data set S obtained in step 1) is divided into a training set, a validation set and a test set, and an improved model is obtained after training; the image to be detected is input into the improved model to provide a real-time warning of oil leakage failure of the pumping unit packing.

2. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that Step 1) The oil extraction machine working image dataset S is divided into a training set, a validation set and a test set in a ratio of 7:2:

1.

3. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that In step 2), Retinexfomer realizes low-light image enhancement based on the combination of Retinex and Transformer. It first estimates the lighting information to enhance the low-light image quality, and then uses the loss restorer to eliminate the noise and artifacts caused by the enhancement process.

4. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that The lightweight backbone network MobileNet v3 described in step 3) uses the neural network architecture search technology NAS, combines the deep separable convolution and linear bottleneck inversion residual structure fusion of MobileNet v1 and MobileNet v2, and introduces the SE channel attention mechanism.

5. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that In step 4), the depth-wise separable convolution described in the convolution process is divided into channel-wise convolution Depth-Wise and point-wise convolution Point-Wise.

6. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that The EMA module described in step 5) improves the model's ability to process features by reorganizing the channel dimension and the batch dimension.

7. A method for detecting oil leakage fault of a pumping unit packing according to claim 1, characterized in that The original model detection regression loss described in step 6) uses Wise-IOU to replace CIOU loss, and the dynamic non-monotonic focusing mechanism uses outliers instead of IOU to improve the quality evaluation of anchor frames, balance the reward and punishment relationship between high-quality anchor frames and low-quality anchor frames, and increase the number of focused ordinary anchor frames.

Citation Information

Cited By

  • Lightweight security behavior detection method and system deployed on edge side

    CN120088865A