Pumping unit key position inspection method based on artificial intelligence video identification technology
By combining artificial intelligence video recognition technology and wellside cameras, real-time detection and fault analysis of key positions of the oil pump is achieved, and the problems of high manual inspection intensity and high threshold for use of new technologies during the oil pump well inspection are solved, and faults are improved Timeliness of alarm and patrol efficiency.
Patent Information
- Application Number
- CN202411050872.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-22
AI Technical Summary
The inspection of existing pump wells relies on manual inspection, which has problems such as high work intensity, long inspection intervals, safety hazards and high costs. New technologies such as drone inspection have problems such as high usage threshold and limited coverage. .
Adopt the inspection method based on artificial intelligence video recognition technology and cameras by the wellside camera, through the camera interaction module, the key positioning algorithm of the oil pump, the oil leakage recognition algorithm, the hairy braided button recognition algorithm, the donkey head motion recognition algorithm, and the crank The fixed recognition algorithm and belt breakage and belt slip recognition algorithm realize real-time detection and fault analysis of key positions of the oil pump.
It has achieved high accuracy, low inspection frequency and complete inspection points, shortened inspection frequency, improved the timeliness of fault alarms, reduced the work intensity of inspection personnel, and reduced the safety hazards of oil field inspections.
Smart Images

Figure CN119007068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent inspection of oil pumping units, and specifically, uses artificial intelligence video recognition technology combined with real-time video streams from wellside cameras to detect key positions of oil pumping wells, thereby identifying key equipment failures and promptly discovering abnormal failures of oil pumping wells, thereby providing technical support for reducing the workload of well inspection personnel and improving the production time efficiency of oil pumping wells. Background Art
[0002] Most of the oilfield pumping wells are located in areas that are relatively remote from residential areas and the distance between individual wells is relatively far. Most of the pumping wells produce around the clock. In order to ensure that faults in the pumping wells can be discovered in time, oilfield inspection personnel need to conduct inspections on time according to a fixed schedule. Relying on manual inspections has the following problems: (1) There are many oil wells and they are widely distributed. The inspection work of only personnel is arduous, and the inspection interval is long, so there is a possibility that faults cannot be discovered in time; (2) The oil wells are located in remote areas, and there are certain safety hazards in inspections at night or in bad weather; (3) Manual inspections will result in certain material losses and high inspection costs;
[0003] The investigation found that in order to solve the problems of manual inspection, various oil fields are also adopting new technical means to conduct inspections, including laying optical fiber and installing cameras next to the wells to conduct remote video viewing for inspections, and using drones equipped with cameras to inspect wells with relatively concentrated distribution ranges. The above methods can alleviate the workload of manual inspections to a certain extent, but they also have their own disadvantages. For example, remote viewing of cameras requires inspection personnel to click on the cameras next to the wells one by one and use the gimbal to adjust the video, which is still a heavy workload. Inspections using drones can only cover pumping wells within a certain distance due to battery life issues and require planning the flight path of the drone in advance. For ordinary oilfield workers, there is a very high threshold for use.
[0004] The artificial intelligence-based video recognition technology is applied to the field of oil pump inspection. By regularly pulling the real-time images of the wellside camera to locate the key positions of the oil pump and analyze the faults, auxiliary manual inspections can effectively shorten the frequency of intelligent inspections, improve the timeliness of fault reporting, extend the frequency of manual inspections at the wellside and the number of well inspections, thereby reducing the workload of personnel. Summary of the invention
[0005] In view of the above problems, the present invention discloses a method for inspecting the key positions of oil pumping units based on artificial intelligence video recognition technology. The artificial intelligence video recognition technology and the video stream of the wellside camera are combined and applied to the inspection of oil pumping units. The method has the characteristics of high accuracy, low inspection frequency and full inspection points. The method can be described as follows:
[0006] (1) The camera interaction module is responsible for collecting real-time video streams and controlling the angle and focal length of the camera; in the preferred solution, it specifically includes:
[0007] (1-1) Inspection task starts. The camera acquisition and control module obtains the real-time video stream of the camera through the standard rtsp protocol, obtains the video frame I and records the current angle position and focal length of the camera as the preset point P.
[0008] (1-2) I is input to the key position positioning algorithm of the pumping unit, and the pixel area R of the packing box, the rope hanger, the donkey head, the crank, and the pulley is output. box , R rod , R donkey , R crank , R belt , R = (x, y, w, h), x, y represents the coordinate point of the upper left corner of the rectangle, w, h represents the width and height of the rectangle,
[0009] (1-3) According to R box The coordinates of the center point (x+0.5*w, y+0.5*h) are calculated to be the deviation angle α from the center point of the video frame I. box The width and height (w,h) of the rectangle are used to calculate the focal length f that needs to be enlarged.
[0010] (1-4) The camera is controlled to rotate α toward the packing box through the Onvif protocol, and the focal length f is enlarged at the same time.
[0011] (1-5) After the packing box oil leakage recognition algorithm analysis is completed, the camera is controlled to return to the preset point P.
[0012] (1-6) Rope suspension device R rod , pulley R belt Perform steps (1-3) to (1-5) in sequence to complete the inspection of key points.
[0013] (2) The key position positioning algorithm of the oil pumping unit, based on the input video frame I, outputs the pixel position area of the target category detected by the model, and in the preferred solution, specifically includes:
[0014] (2-1) The key position positioning algorithm of the pumping unit is divided into two stages: model training and model inference. Model training adopts an offline supervised method, and the trained model is stored and converted into a format that can be loaded and used in the inference stage;
[0015] (2-2) In the model training phase, the video stream of the camera next to the pumping well is recorded and the video frames are extracted from it. The location and category information of the packing box, rope hanger, donkey head, crank, and pulley in the picture are annotated using the target detection and annotation tool to form a labeled data set.
[0016] (2-3) Divide into training set, validation set and test set,
[0017] (2-4) Construct a pumping unit key position detection model based on convolutional neural network. The model includes data input layer Input, data dimension reduction layer Scale, feature extraction layer Feature, target detection layer Head,
[0018] (2-5) Set the hyperparameters learning rate lr, momentum momentum, weight decay weightdecay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model.
[0019] (2-6) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference phase.
[0020] (2-7) The model inference phase initializes and loads the engine file. The camera video stream image is fed into the model to output the pixel positions of the detected packing box, rope hanger, donkey head, crank, and pulley.
[0021] (3) Based on the image area of the packing box sent in, an oil leakage recognition algorithm at the packing box is used to determine whether there is an oil leakage. The preferred solution specifically includes:
[0022] (3-1) The oil leakage identification at the packing box is realized by using the target detection algorithm based on convolutional neural network. The training set is produced by annotation and synthesis in the training stage.
[0023] (3-2) The camera records the video stream by adjusting the pan / tilt to the location of the packing box. The video frame is extracted and the target detection and annotation tool is used to annotate the location of the oil leak in the image to form a labeled data set d′.
[0024] (3-3) The video frame does not contain the picture of the oil leakage at the packing. The image fusion method is used to simulate the location of the oil leakage to form a synthetic data set d″.
[0025] (3-4) The datasets d′ and d″ are combined and divided into training set, validation set and test set according to the holdout method.
[0026] (3-5) Construct a packing box oil leakage detection model based on convolutional neural network. The model includes data input layer Input, feature extraction layer Feature, target detection layer Head,
[0027] (3-6) Set the hyperparameters learning rate lr, momentum momentum, weight decay weightdecay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model until the loss function value converges to the set threshold η or reaches the total training rounds;
[0028] (3-7) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference stage.
[0029] (3-8) The model inference stage initializes and loads the engine file. The video image of the camera focusing on the root of the packing is sent to the model to output whether there is an oil leak area;
[0030] (4) A hair braid knot recognition algorithm is used to determine whether there is a knot according to the image area near the rope hanging device. The preferred solution specifically includes:
[0031] (4-1) The braid knot recognition algorithm is implemented using a convolutional neural network-based target detection algorithm.
[0032] (4-2) During the training phase, the camera is adjusted to record the video stream at the location of the rope suspension through the gimbal. The video frame is extracted with the center point of the rope suspension position, and a 320*320 pixel area is cut out and saved as an image.
[0033] (4-3) Use the target detection and annotation tool to annotate the button location area in the image to form a labeled data set.
[0034] (4-4) is divided into training set, validation set and test set,
[0035] (4-5) A hair braid knot detection model based on a convolutional neural network is constructed. The model is consistent with the oil leakage detection model at the packing box constructed in (3-5). The model training and model file export are consistent with (3-6) and (3-7). The model inference stage is initialized to load the engine file. The camera is focused on the rope hanger position. With the rope hanger as the center point, a 320*320 pixel area image is captured and sent to the model to output whether there is a hair braid knot.
[0036] (5) The donkey head immobility identification algorithm determines whether the donkey head is stationary based on the change of the donkey head center point position identified by multiple calls to the pumping unit key position positioning algorithm. The preferred solution specifically includes:
[0037] (5-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the donkey head, and obtain the position set of the donkey head N times (R1, R2, ... R N ),
[0038] (5-2) Extract the pixel center point coordinates (p1, p2, ... p N ),
[0039] (5-3) Calculate the Euclidean distance between the center points of the donkey head N times. When the distance is less than the threshold δ, it is determined that the donkey head is not moving, otherwise the donkey head is working normally;
[0040] (6) The crank stationary identification algorithm determines whether the crank is stationary based on the pixel changes of the crank position identified by the key position positioning algorithm of the oil pumping unit by calling it multiple times. In the preferred solution, it specifically includes:
[0041] (6-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the crank, and obtain the position set of the crank N times (R1, R2, ... R N ),
[0042] (6-2) Extract the image corresponding to the N crank position sets
[0043] (6-3) Using the frame difference method to estimate the change information of the image set, when the change is less than the threshold β, it is determined that the crank is not moving, otherwise the crank is running normally;
[0044] (7) The belt break and belt slippage identification algorithm determines whether there is a belt break and belt slippage according to the image of the pulley focused by the camera and the state of the crank. The preferred solution specifically includes:
[0045] (7-1) Extract the image of the focused pulley and use the canny edge detection and Hoffman line detection methods to determine whether there are two long straight lines. If so, the belt is considered normal. If not, the belt is considered broken.
[0046] (7-2) The belt is in a normal condition and combined with the crank status. If the crank does not move and the well is not stopped, it is considered that the belt is slipping.
[0047] Beneficial Effects
[0048] The present invention discloses a method for inspecting key positions of oil pumps based on artificial intelligence video recognition technology. The method integrates artificial intelligence video recognition technology and real-time video streams from cameras beside the well, and monitors the operating status of the oil pump wells by utilizing customized key point positioning algorithms and abnormal fault diagnosis models. The method has the characteristics of high accuracy, low inspection frequency, and complete inspection points. It can effectively shorten the inspection frequency, improve the timeliness of fault alarms, and reduce the workload of inspection personnel, providing an effective technical support for oil pump inspections. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Flowchart of the inspection algorithm for key positions of oil pumps based on artificial intelligence video recognition technology.
[0050] Figure 2 Structural diagram of the pumping unit key position detection algorithm model.
[0051] Figure 3 Structure diagram of the packing box oil leakage detection algorithm model.
[0052] Figure 4 Video frames from a camera next to a pumping well.
[0053] Figure 5 Results of key positioning detection of the oil pumping unit.
[0054] Figure 6 A captured image of the pumping unit crank area.
[0055] Specific implementation process
[0056] The following is a description of the implementation effect of a method for inspecting key positions of an oil pumping unit based on artificial intelligence video recognition technology proposed by the present invention in conjunction with the accompanying drawings. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, modifications of various equivalent forms of the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0057] Combination Figure 1 A flow chart of an inspection algorithm for key positions of an oil pumping unit based on artificial intelligence video recognition technology is provided. The inspection method of the present invention specifically comprises the following steps:
[0058] (1) The camera interaction module is responsible for collecting real-time video streams and controlling the angle and focal length of the camera; in the preferred solution, it specifically includes:
[0059] (1-1) Inspection task starts. The camera acquisition and control module obtains the real-time video stream of the camera through the standard rtsp protocol, obtains the video frame I and records the current angle position and focal length of the camera as the preset point P.
[0060] (1-2) I is input to the key position positioning algorithm of the pumping unit, and the pixel area R of the packing box, the rope hanger, the donkey head, the crank, and the pulley is output. box , R rod , R donkey , R crank , R belt , R = (x, y, w, h), x, y represents the coordinate point of the upper left corner of the rectangle, w, h represents the width and height of the rectangle,
[0061] (1-3) According to R boxThe coordinates of the center point (x+0.5*w, y+0.5*h) are calculated to be the deviation angle α from the center point of the video frame I. box The width and height (w,h) of the rectangle are used to calculate the focal length f that needs to be enlarged.
[0062] (1-4) The camera is controlled to rotate α toward the packing box through the Onvif protocol, and the focal length f is enlarged at the same time.
[0063] (1-5) After the packing box oil leakage recognition algorithm analysis is completed, the camera is controlled to return to the preset point P.
[0064] (1-6) Rope suspension device R rod , pulley R belt Perform steps (1-3) to (1-5) in sequence to complete the inspection of key points.
[0065] (2) The key position positioning algorithm of the oil pumping unit, based on the input video frame I, outputs the pixel position area of the target category detected by the model, and in the preferred solution, specifically includes:
[0066] (2-1) The key position positioning algorithm of the pumping unit is divided into two stages: model training and model inference. Model training adopts an offline supervised method, and the trained model is stored and converted into a format that can be loaded and used in the inference stage;
[0067] (2-2) In the model training phase, the video stream of the camera next to the pumping well is recorded and the video frames are extracted from it. The location and category information of the packing box, rope hanger, donkey head, crank, and pulley in the picture are annotated using the target detection and annotation tool to form a labeled data set.
[0068] (2-3) Divide into training set, validation set and test set,
[0069] (2-4) Construct a pumping unit key position detection model based on convolutional neural network. The model includes data input layer Input, data dimension reduction layer Scale, feature extraction layer Feature, target detection layer Head. The detailed model structure is as follows: Figure 2 As shown,
[0070] (2-5) Set the hyperparameters learning rate lr, momentum momentum, weight decay weightdecay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model.
[0071] (2-6) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference phase.
[0072] (2-7) The model inference phase initializes and loads the engine file. The camera video stream image is fed into the model to output the pixel positions of the detected packing box, rope hanger, donkey head, crank, and pulley.
[0073] (3) Based on the image area of the packing box sent in, an oil leakage recognition algorithm at the packing box is used to determine whether there is an oil leakage. The preferred solution specifically includes:
[0074] (3-1) The oil leakage identification at the packing box is realized by using the target detection algorithm based on convolutional neural network. The training set is produced by annotation and synthesis in the training stage.
[0075] (3-2) The camera records the video stream by adjusting the pan / tilt to the location of the packing box. The video frame is extracted and the target detection and annotation tool is used to annotate the location of the oil leak in the image to form a labeled data set d′.
[0076] (3-3) The video frame does not contain the picture of the oil leakage at the packing. The image fusion method is used to simulate the location of the oil leakage to form a synthetic data set d″.
[0077] (3-4) The datasets d′ and d″ are combined and divided into training set, validation set and test set according to the holdout method.
[0078] (3-5) Construct a packing box oil leakage detection model based on convolutional neural network. The model includes data input layer Input, feature extraction layer Feature, target detection layer Head. The detailed model structure is as follows: Figure 3 As shown,
[0079] (3-6) Set the hyperparameters learning rate lr, momentum momentum, weight decay weightdecay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model until the loss function value converges to the set threshold η or reaches the total training rounds;
[0080] (3-7) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference stage.
[0081] (3-8) The model inference stage initializes and loads the engine file. The video image of the camera focusing on the root of the packing is sent to the model to output whether there is an oil leak area;
[0082] (4) A hair braid knot recognition algorithm is used to determine whether there is a knot according to the image area near the rope hanging device. The preferred solution specifically includes:
[0083] (4-1) The braid knot recognition algorithm is implemented using a convolutional neural network-based target detection algorithm.
[0084] (4-2) During the training phase, the camera is adjusted to record the video stream at the location of the rope suspension through the gimbal. The video frame is extracted with the center point of the rope suspension position, and a 320*320 pixel area is cut out and saved as an image.
[0085] (4-3) Use the target detection and annotation tool to annotate the button location area in the image to form a labeled data set.
[0086] (4-4) is divided into training set, validation set and test set,
[0087] (4-5) A hair braid knot detection model based on a convolutional neural network is constructed. The model is consistent with the oil leakage detection model at the packing box constructed in (3-5). The model training and model file export are consistent with (3-6) and (3-7). The model inference stage is initialized to load the engine file. The camera is focused on the rope hanger position. With the rope hanger as the center point, a 320*320 pixel area image is captured and sent to the model to output whether there is a hair braid knot.
[0088] (5) The donkey head immobility identification algorithm determines whether the donkey head is stationary based on the change of the donkey head center point position identified by multiple calls to the pumping unit key position positioning algorithm. The preferred solution specifically includes:
[0089] (5-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the donkey head, and obtain the position set of the donkey head N times (R1, R2, ... R N ),
[0090] (5-2) Extract the pixel center point coordinates (p1, p2, ... p N ),
[0091] (5-3) Calculate the Euclidean distance between the center points of the donkey head N times. When the distance is less than the threshold δ, it is determined that the donkey head is not moving, otherwise the donkey head is working normally;
[0092] (6) The crank stationary identification algorithm determines whether the crank is stationary based on the pixel changes of the crank position identified by the key position positioning algorithm of the oil pumping unit by calling it multiple times. In the preferred solution, it specifically includes:
[0093] (6-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the crank, and obtain the position set of the crank N times (R1, R2, ... R N ),
[0094] (6-2) Extract the image corresponding to the N crank position sets
[0095] (6-3) Using the frame difference method to estimate the change information of the image set, when the change is less than the threshold β, it is determined that the crank is not moving, otherwise the crank is running normally;
[0096] (7) The belt break and belt slippage identification algorithm determines whether there is a belt break and belt slippage according to the image of the pulley focused by the camera and the state of the crank. The preferred solution specifically includes:
[0097] (7-1) Extract the image of the focused pulley and use the canny edge detection and Hoffman line detection methods to determine whether there are two long straight lines. If so, the belt is considered normal. If not, the belt is considered broken.
[0098] (7-2) The belt is in a normal condition and combined with the crank status. If the crank does not move and the well is not stopped, it is considered that the belt is slipping. Example
[0099] It is known that a pumping well in a certain oil field is located in a remote area and a Hikvision pan-tilt camera is installed next to the well. The program implemented according to the method proposed in the present invention runs on the edge computing terminal of the weak current cabinet next to the well. The computing terminal and the camera are connected by a network cable. Combined with this actual case, the implementation of each block involved in the present invention is as follows:
[0100] (1) The real-time video stream I of the camera is obtained at an interval of 1 second through the standard RTSP protocol rtsp: / / admin:111111hk@192.168.1.108:554. A total of 5 pictures are obtained. For a single video stream, Figure 4 As shown, the current viewing angle is saved as the preset point P of the Hikvision camera;
[0101] (2) The five images are sequentially fed into the key position detection algorithm of the oil pump based on the PyTorch framework training and TensorRT inference, and the pixel position information of the packing box, rope hanger, donkey head, crank and pulley in each image is output. The video stream with position marks is as follows: Figure 5 As shown;
[0102] (3) Calculate the pixel coordinates of the center point of the donkey head from the pixel position area of the donkey head in 5 consecutive pictures, and determine whether the donkey head is in operation according to the Euclidean distance measurement between the 5 coordinate points;
[0103] (4) According to the position information of the crank in the five images, the corresponding image area is cropped. Some of the cropped crank areas are as follows: Figure 6 As shown, the frame difference method based on opencv is used to determine whether the crank is in operation;
[0104] (5) According to the coordinate positions of the center point of the packing box area and the center point of the image calculated in step 2, the camera is controlled to rotate to focus on the packing box position through the Onvif protocol, and the focal length is appropriately enlarged;
[0105] (6) Through the oil leakage detection algorithm at the packing box trained by PyTorch and inferred by TensorRT, the picture of the packing box area is sent to the model to determine whether there is an oil leakage;
[0106] (7) Control the camera to return to the preset point P through the Onvif protocol;
[0107] (8) According to the coordinate positions of the area center point of the suspension rope and the image center point calculated in step 2, the camera is controlled to rotate to focus on the suspension rope position through the Onvif protocol, and the focal length is appropriately enlarged;
[0108] (9) Through the PyTorch trained hair braid knot detection algorithm, the picture of the rope suspension area is sent to the model to determine whether there is a knot;
[0109] (10) Control the camera to return to the preset point P through the Onvif protocol;
[0110] (11) According to the coordinate positions of the center point of the belt pulley area and the center point of the image calculated in step 2, the camera is controlled to rotate to focus on the belt pulley position through the Onvif protocol, and the focal length is appropriately enlarged;
[0111] (12) The belt area image is sent to the canny edge detection and Huffman line detection algorithm implemented by OpenCV to determine whether the belt is broken, and combined with the pumping well status and crank status to determine whether the belt may slip;
[0112] (13) Summarize the inspection results of each module and transmit the results of a single inspection back to the host computer monitoring platform through the resful interface.
[0113] From the above analysis, it can be seen that the method for inspecting key positions of oil pumps based on artificial intelligence video recognition technology proposed in the present invention can realize the inspection of key positions and abnormal faults of oil pumps.
Claims
1. A method for inspecting key positions of oil pumping units based on artificial intelligence video recognition technology, characterized in that The following steps are involved: (1) The camera interaction module is responsible for collecting real-time video streams and controlling the angle and focal length of the camera; (2) Based on the input video frame I, the pixel location area of the target category detected by the output model; (3) Determine whether there is oil leakage based on the image area of the packing box sent in; (4) judging whether there is a knot according to the image area near the rope hanging device; (5) repeatedly calling the key position positioning algorithm of the oil pump to identify the donkey head, and judging whether the donkey head is stationary according to the change of the position of the center point of the identified donkey head; (6) calling the key position positioning algorithm of the pumping unit multiple times to identify the crank, and judging whether the crank is stationary based on the pixel change of the identified crank position; (7) Determine whether the belt is broken or slipping based on the image of the pulley focused by the camera and the state of the crank.
2. The method according to claim 1, characterized in that Step (1) specifically includes: (1-1) Obtain the real-time video stream of the camera through the standard rtsp protocol, obtain the video frame I and record the current angle position and focal length value of the camera as the preset point P; (1-2) I is input to the key position positioning algorithm of the pumping unit. The pixel area of the output packing box, rope hanger, donkey head, crank, and pulley is recorded as R box , R rod , R donkey , R crank , R belt , pixel area R = (x, y, w, h), x, y represents the coordinate point of the upper left corner of the rectangle, w, h represents the width and height of the rectangle; (1-3) According to R box The coordinates of the center point (x+0.5*w, y+0.5*h) are calculated to be the deviation angle α from the center point of the video frame I. box The width and height (w, h) of the rectangle are used to calculate the focal length f that needs to be enlarged; (1-4) Control the camera to rotate α toward the packing box through the Onvif protocol, and at the same time enlarge the focal length f; (1-5) After the analysis of the oil leakage identification algorithm at the packing box is completed, the camera is controlled to return to the preset point P; (1-6) Rope suspension device R rod , pulley R belt Perform steps (1-3) to (1-5) in sequence to complete the inspection of key points.
3. The method according to claim 1, characterized in that In step (2), according to the input video frame I, the pixel position area of the target category detected by the pumping unit key position positioning algorithm is output, which specifically includes: (2-1) The key position positioning algorithm of the pumping unit is divided into two stages: model training and model inference. Model training adopts an offline supervised method, and the trained model is stored and converted into a format that can be loaded and used in the inference stage; (2-2) Record the video stream of the camera next to the pumping well, extract the video frame from it, and use the target detection and annotation tool to annotate the position and category information of the packing box, rope hanger, donkey head, crank, and pulley in the picture to form a labeled data set; (2-3) The labeled dataset is divided into training set, validation set and test set according to the holdout method; (2-4) Construct a pumping unit key position detection model based on convolutional neural network, which includes a data input layer Input, a data dimension reduction layer Scale, a feature extraction layer Feature, and a target detection layer Head; (2-5) Set the hyperparameters learning rate lr, momentum momentum, weight decay weight decay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model until the loss function value converges to the set threshold η or reaches the total training rounds; (2-6) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference phase; (2-7) The model inference stage initializes and loads the engine file. The camera video stream image is fed into the model to output the pixel area positions of the detected packing box, rope hanger, donkey head, crank, and pulley.
4. The method according to claim 1, characterized in that: In step (3), an oil leakage identification algorithm at the packing box is used to determine whether there is an oil leakage according to the image area of the packing box sent in, specifically including: (3-1) The oil leakage identification at the packing box is realized by using the target detection algorithm based on convolutional neural network, which is divided into training stage and inference stage. The model training adopts supervised training method, and the trained model is stored and converted into a format that can be loaded and used in the inference stage; (3-2) The camera records the video stream by adjusting the pan / tilt to the location of the packing box, extracts the video frame, and uses the target detection and annotation tool to annotate the location of the oil leak in the image to form a labeled data set d′; (3-3) The video frame does not contain the picture of the oil leakage at the packing. The image fusion method is used to simulate the location area of the oil leakage to form a synthetic data set d″; (3-4) Datasets d′ and d″ are merged and divided into training set, validation set and test set according to the holdout method; (3-5) Constructing a packing box oil leakage detection model based on convolutional neural network, the model includes a data input layer Input, a feature extraction layer Feature, and a target detection layer Head; (3-6) Set the hyperparameters learning rate lr, momentum momentum, weight decay weightdecay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model until the loss function value converges to the set threshold η or reaches the total training rounds; (3-7) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference phase; (3-8) The model inference stage initializes and loads the engine file. The video image focused by the camera on the root of the packing is sent to the model to output whether there is an oil leak area.
5. The method according to claim 1, characterized in that In step (4), the hair braid knot recognition algorithm determines whether there is a knot based on the image area near the rope hanging device. (4-1) The braid button recognition algorithm is implemented using a convolutional neural network-based target detection algorithm, which is divided into a training phase and an inference phase. The model training adopts a supervised training method, and the trained model is stored and converted into a format that can be loaded and used in the inference phase; (4-2) The camera is adjusted to record the video stream at the location of the rope suspension device through the pan / tilt adjustment, and the video frame is extracted with the center point of the rope suspension device, and a 320*320 pixel area is cut out and saved as a picture; (4-3) Use the object detection and annotation tool to annotate the button location area in the image to form a labeled data set; (4-4) The labeled dataset is divided into training set, validation set and test set according to the holdout method; (4-5) Construct a hair braid knot detection model based on convolutional neural network; the model includes a data input layer Input, a feature extraction layer Feature, and a target detection layer Head; (4-6) Set the hyperparameters learning rate lr, momentum momentum, weight decay weight decay, and total training rounds epoch, and use Adam optimization and model weight Ema to train the model until the loss function value converges to the set threshold η or reaches the total training rounds; (4-7) After training is completed, select the weight with the highest accuracy on the validation set and save it as the model file weight, and export it as the model file engine loaded in the inference phase; (4-8) The model inference stage is initialized and the engine file is loaded. The camera is focused on the position of the suspension rope. With the suspension rope as the center point, a 320*320 pixel area image is captured and sent to the model to output whether there is a braid or a knot.
6. The method according to claim 1, characterized in that The specific steps of step (5) include: (5-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the donkey head, and obtain the position set of the donkey head N times (R1, R2, ... R N ); (5-2) Extract the pixel center point coordinates (p1, p2, ... p N ); (5-3) Calculate the Euclidean distance between the center points of the donkey head N times. When the distance is less than the threshold δ, it is determined that the donkey head is not moving, otherwise the donkey head is working normally.
7. The method according to claim 1, characterized in that The specific steps of step (6) include: (6-1) The inspection task starts and a real-time video stream is pulled every α seconds and sent to the key position positioning algorithm of the pumping unit to obtain the coordinate position R of the crank, and obtain the position set of the crank N times (R1, R2, ... R N ); (6-2) Extract the image corresponding to the N crank position sets (6-3) The frame difference method is used to estimate the change information of the image set. When the change amount is less than the threshold β, it is determined that the crank is not moving, otherwise the crank is running normally.
8. The method according to claim 1, characterized in that The specific steps of step (7) include: (7-1) Extract the image of the focused pulley and use the canny edge detection and Hoffman line detection methods to determine whether there are two long straight lines. If so, the belt is considered normal; if not, the belt is considered broken. (7-2) The belt is in a normal condition and combined with the crank status. If the crank does not move and the well is not stopped, it is considered that the belt is slipping.
Citation Information
Patent Citations
Visualization system and method based on RTSP / ONVIF protocol
CN106302488A
Beam-pumping unit kinematics analysis method based on deep learning
CN113837004A
Belt edge tearing detection method
CN114926446A
Beam-pumping unit fault detection method based on intelligent video analysis
CN116682045A
Sample acquisition method, device and equipment for training oil contamination leakage detection model
CN118172625A
Cited By
Beam-pumping unit state determination method, device, storage medium and system
CN119540247A
Beam pumping unit state determination method, device, storage medium and system
CN119540247B
Improved YOLO11-based method for detecting breakage of hair braid of oil pumping unit in low-light scene
CN121330456A
Pumping unit horsehair fracture detection method in low-light scene based on improved YOLO11
CN121330456B
