Method and apparatus for detecting oil leaks

By employing a multi-branch parallel processing method for oil leak detection, combined with texture, geometric, and physical feature extraction, the oil leak stages of oil extraction equipment during oil extraction are identified. This solves the problem of inaccurate oil leak status identification in existing technologies and achieves efficient and accurate oil leak detection.

CN122289795APending Publication Date: 2026-06-26JIAYANG SMART SECURITY TECH (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIAYANG SMART SECURITY TECH (BEIJING) CO LTD
Filing Date
2026-04-22
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify oil leaks in oil extraction equipment, especially in complex oilfield scenarios where leaks are diverse in form and inefficient, easily leading to false alarms.

Method used

An oil leak detection method employing multi-branch parallel processing extracts branches through texture, geometric, and physical features, and combines image analysis to identify the stages of oil leakage, including seepage, puncture, and flow. It utilizes industrial-grade monitoring cameras to acquire image frames and dynamically adjusts the field of view, thereby achieving full-cycle oil leak detection for oil production equipment.

Benefits of technology

It enables accurate identification of oil leakage conditions in oil production equipment, improves detection efficiency and accuracy, avoids the problem of single model failure, and can identify oil leakage in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289795A_ABST
    Figure CN122289795A_ABST
Patent Text Reader

Abstract

This disclosure belongs to the field of image detection technology and provides an oil leak detection method and device. The method includes: acquiring multiple image frames at different acquisition times of the oil production equipment; obtaining multiple regions of interest (ROI) frames corresponding to the target location from the image frames; extracting interface environment features through a texture feature extraction branch and predicting the oil leak penetration stage based on these features; extracting jet morphology features through a geometric feature extraction branch and predicting the oil leak piercing stage based on these features; and extracting flow reflection features through a physical feature extraction branch and predicting the oil leak flow stage based on these features. Then, the oil leak detection result of the target location is obtained based on the prediction results. By utilizing the different changes in different features of the same oil production equipment image at different oil leak stages, the oil leak stage of the oil production equipment can be identified accordingly, enabling timely and accurate identification of the oil leak situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure belongs to the field of image detection technology, and in particular relates to an oil leak detection method and device. Background Technology

[0002] During oil extraction, wellheads and other oil production equipment are prone to oil and gas leaks due to insufficient sealing. Currently, oil leak detection relies on manual inspections or traditional image processing methods. However, due to changes in oilfield environments and the diverse forms of leaks, existing technologies struggle to accurately identify the nature of leaks. Summary of the Invention

[0003] This disclosure provides an oil leak detection method and device that can accurately identify various oil leak conditions.

[0004] In a first aspect, embodiments of this disclosure provide an oil leak detection method, the method comprising: Acquire multiple image frames at different acquisition times of the oil production equipment, with each image frame containing the target part of the oil production equipment; Region detection of the target area is performed on multiple image frames to obtain multiple regions of interest frames corresponding to the target area; Multiple regions of interest frames corresponding to the target part are input into the oil leak detection model, which includes a texture feature extraction branch, a geometric feature extraction branch, and a physical feature extraction branch. The interface environment features of multiple regions of interest frames are extracted through the texture feature extraction branch, and the oil leakage and penetration stage is predicted based on the interface environment features. The jet morphology features of multiple regions of interest frames are extracted through the geometric feature extraction branch, and the oil leakage and puncture stage is predicted based on the jet morphology features. The flow reflection features of multiple regions of interest frames are extracted through the physical feature extraction branch, and the oil leakage and flow stage is predicted based on the flow reflection features. Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, and the oil leakage flow stage, the oil leakage detection results of the target location are obtained.

[0005] In one feasible implementation, multiple image frames are acquired at different acquisition times from the oil production equipment, including the steps of acquiring image frames and adjusting the acquisition field of view. The steps for acquiring image frames include: acquiring the current image frame of the oil production equipment with the current field of view; The steps for adjusting the acquisition field of view include: The suspected oil leakage stage is determined based on the pixel grayscale features of the current image frame. The suspected oil leakage stage is at least one of the suspected seepage stage, suspected puncture stage, and suspected flow stage. Based on the judgment of the suspected oil leak stage, the current field of view is changed; The steps of acquiring image frames and adjusting the acquisition field of view are repeated, using the changed current acquisition field of view as the current acquisition field of view for the next image frame, until multiple image frames at different acquisition times are obtained.

[0006] In one feasible implementation, the step of adjusting the acquisition field of view includes: When the pixel grayscale feature indicates that the pixel grayscale change is less than the preset grayscale change threshold and the contour feature extracted from the current image frame does not meet the preset conditions, the current image frame is determined to be in the suspected penetration stage, the current acquisition field of view is adjusted to the telephoto field of view, and the lens focal length is adjusted to the first focal length. When the pixel grayscale feature indicates that the pixel grayscale change is greater than or equal to the preset grayscale change threshold and is directional, the current image frame is determined to be in the suspected leakage stage. The current acquisition field of view is adjusted to the telephoto field of view, and the lens focal length is adjusted to the second focal length, which is less than the first focal length. When there are dark gray areas in the ground region represented by pixel grayscale features and the area of ​​the dark area is greater than the preset area threshold, the current image frame is determined to be in the suspected flowing stage, and the current acquisition field of view is adjusted to a wide-angle field of view.

[0007] In one feasible implementation, the method further includes the step of obtaining an oil leak detection model by training a model to be trained, and the step of obtaining an oil leak detection model by training a model to be trained includes: Based on the oil leak detection results output by the model to be trained for the input image frame, the category probability is obtained; When the class probability is less than the preset probability value, the loss function value is calculated using the following formula:

[0008] in, Category weights; This is a unique hot tag; For class probabilities; C is the focus parameter; C is the set of categories; This represents the loss function value.

[0009] In one feasible implementation, the interface environment features include texture variation features. Interface environment features are extracted from multiple region-of-interest frames via a texture feature extraction branch, and prediction of the oil leakage / penetration stage is performed based on these interface environment features. This includes: Directional filtering is applied to the frame of the region of interest to obtain texture variation features in different directions; When the texture of the target area changes, the oil leakage and penetration stage is predicted for the region of interest frame. Predicting the oil leakage and penetration stages for the region of interest frame, including: The texture entropy is calculated based on the pixel grayscale distribution of the region of interest frame, and the result of the texture entropy calculation is used to determine whether the target area is in the penetration stage.

[0010] In one feasible implementation, the jet morphology features include fluid edge features and edge initiation features. Multiple region-of-interest frames are extracted using a geometric feature extraction branch, and prediction of the oil leak / puncture stage is performed based on these jet morphology features, including: Edge detection is performed on the region of interest frame to obtain fluid edge features and edge initiation features; The fluid detection results are obtained based on the changes in fluid edge features and edge origin features in adjacent frames of interest. Predicting the oil leak and puncture stages based on fluid detection results; Predicting the oil leak and puncture stages based on fluid detection results, including: When the fluid detection results indicate that the fluid is in a strip-like shape and originates from the target area, the target area is determined to be in the puncture and leakage stage.

[0011] In one feasible implementation, the flow reflection features of multiple region-of-interest frames are extracted through a physical feature extraction branch, including: Specular reflection highlights are obtained by processing the region of interest frame based on the bidirectional reflection distribution function. Calculate the motion vector field of adjacent frames in the region of interest, and filter out the oil drop features from the motion vector field; The static background of the region of interest frame is removed by background subtraction to obtain the oil extension region; Predicting the oil spill flow stages based on flow reflection characteristics includes: Based on time-series analysis, the specular reflection bright spots, oil drop characteristics, and changes in the oil expansion area in multiple consecutive regions of interest frames corresponding to the target location are determined to obtain liquid phase detection results. When the liquid phase detection results show that the specular reflection bright spot continues to flash, the oil droplet falling characteristics are stable downward, and the oil expansion area continues to expand, it is determined that the target location is in the flow stage.

[0012] In one feasible implementation, after processing the region of interest frame based on the bidirectional reflection distribution function to obtain specular reflection highlights, the method further includes: Based on the classification threshold determined by the collected environmental data, specular reflection bright spots are filtered out.

[0013] In one feasible implementation, the oil leak detection model further includes an edge feature extraction branch; the method also includes: Edge features of multiple regions of interest frames are extracted through an edge feature extraction branch, and prediction of the oil spill dripping stage is made based on the edge features. Based on the prediction results of the oil seepage stage, the oil puncture stage, and the oil flow stage, the oil leak detection results at the target location are obtained, including: Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, the oil leakage flow stage, and the oil leakage dripping stage, the oil leakage detection results of the target location are obtained. Edge features are extracted from multiple regions of interest frames through an edge feature extraction branch, and prediction of the oil spill dripping stage is made based on these edge features, including: When the edge of the target object near the target location is teardrop-shaped and / or spherical, and the teardrop-shaped and / or spherical target objects appear periodically, the target location is determined to be in the dripping stage.

[0014] In one feasible implementation, at least one oil production device exists within an image frame. Region detection of the target area is performed on multiple image frames to obtain multiple regions of interest frames corresponding to the target area, including: Target detection of oil production equipment is performed on the image frames, and the area where the oil production equipment is located is magnified at multiple scales to obtain multiple images to be analyzed; Based on the proportion of the maximum bounding box of the oil production equipment in the image to be analyzed, multiple images to be analyzed are filtered to obtain multiple valid images; Target detection is performed on the target parts within the maximum bounding box of the oil production equipment in each valid image to obtain multiple regions of interest frames corresponding to the target parts.

[0015] In one feasible implementation, after obtaining the oil leak detection results at the target location, the method further includes: An alarm signal is issued when the oil leakage detection results of consecutive region of interest frames within a preset time window all indicate an oil leakage.

[0016] Secondly, this disclosure provides an oil leak detection device, which includes a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the above-described oil leak detection method.

[0017] The oil leak detection method and device of this disclosure can accurately identify various oil leak states. This disclosure deeply studies the characteristics of oil leak morphology changes over time. Based on image analysis, it utilizes the different changes in the image features of the oil extraction equipment at different oil leak stages to identify the corresponding oil leak stage. Specifically, in the initial oil leak, a small amount of oil seeps in, causing significant changes in the interface environment characteristics of the oil extraction equipment, thus identifying the oil seepage stage; based on the significant changes in the geometric characteristics of the ejected fluid caused by pressure puncture, the oil puncture stage is identified; based on the significant changes in the flow and reflection characteristics of the liquid phase caused by continuous flow, the oil flow stage is identified, achieving full-cycle identification from small seepage to high-pressure injection to large-area flow. Furthermore, the oil leak detection model employs heterogeneous multi-branch parallel processing of corresponding image features and oil leak stage identification, avoiding interference from mixed features, optimizing the understanding ability within branches, and avoiding the problem of single models failing at certain stages. This improves model processing efficiency and accuracy, enabling timely and accurate identification of oil leaks. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments of this disclosure will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic flowchart of an oil leak detection method provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of a wide-angle field-of-view capture screen provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of the captured image magnified 2 times according to an embodiment of this disclosure; Figure 4 This is a schematic diagram of the captured image magnified 4 times according to an embodiment of this disclosure; Figure 5 This is a schematic diagram of another acquisition screen provided in the embodiments of this disclosure for a wide-angle field of view; Figure 6 This is a schematic diagram of the acquisition screen provided in the embodiment of this disclosure with a telephoto field of view; Figure 7 This is a digitally magnified image of the captured screen provided in an embodiment of this disclosure; Figure 8 This is a schematic diagram of an oil well tree leaking according to an embodiment of this disclosure; Figure 9 This is a schematic diagram showing that the oil well tree has not leaked oil, according to an embodiment of this disclosure; Figure 10This is a schematic diagram of the basic workflow of the oil leak detection model provided in the embodiments of this disclosure; Figure 11 This is a schematic diagram of a cloudy day environment provided in an embodiment of this disclosure; Figure 12 This is a schematic diagram of a rainy weather environment provided in an embodiment of this disclosure; Figure 13 This is a schematic diagram of a sunny day environment provided in an embodiment of this disclosure; Figure 14 This is a schematic diagram of the structure of an oil leak detection device provided in an embodiment of this disclosure. Detailed Implementation

[0020] The features and exemplary embodiments of various aspects of this disclosure will now be described in detail. To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description, in conjunction with the accompanying drawings and specific embodiments, will provide a further detailed description. It should be understood that the specific embodiments described herein are intended only to explain this disclosure and not to limit it. For those skilled in the art, this disclosure can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this disclosure by illustrating examples.

[0021] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0022] The acquisition, storage, use, and processing of data in this application embodiment all comply with the relevant provisions of national laws and regulations.

[0023] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.

[0024] Wellhead oil production equipment contains several critical sealing components to prevent the leakage of high-pressure oil and gas from the well. If these sealing components age, wear out, or are improperly installed, oil leaks can easily occur, resulting not only in resource waste and environmental pollution, but also potentially inducing major safety accidents such as fires and explosions.

[0025] Currently, oil leak detection mainly relies on manual inspections or traditional image processing methods, which suffer from low efficiency, high subjectivity, and difficulty in all-weather operation. In recent years, some intelligent detection solutions have attempted to introduce target detection technology to directly locate and identify oil leak areas. However, such methods require extremely high boundary accuracy of the labeled data and face multiple challenges in the complex scenarios of actual oil fields: First, the on-site lighting conditions are highly variable, such as strong reflections, shadows, and low light at night, which seriously affects the stability of the detection model; second, oil leaks take many forms, such as trace seepage, dripping, and flowing, resulting in large differences in target size and appearance, and insufficient generalization ability of a single detection model; third, relying solely on target detection makes it difficult to distinguish between suspected oil stains and actual oil leaks, easily leading to false alarms.

[0026] To address the problems of existing technologies, this disclosure provides an oil leak detection method and device. First, considering the diversity of oil leak morphologies, different types of image features are extracted from images of the same oil leak area. These image features are then further analyzed to determine the oil leak stage of the oil extraction equipment. Furthermore, when identifying and analyzing each type of image feature, the impact of scene changes on that type of image feature is considered to improve the accuracy of the predicted results. In addition, the oil extraction equipment is first coarsely located, and then the region of interest related to the target location is specifically located to avoid omissions and ensure the accuracy of the input image.

[0027] This oil leak detection method can be applied to oil extraction processes, specifically for detecting oil leaks in oil production equipment. The device executing this method can be any electronic device aimed at the oil production equipment and capable of image processing and analysis. Here, the oil production equipment can be a device whose main components, such as the wellhead, are located on the ground, and whose critical sealing components and other easily leaking parts are exposed to the outside and can be captured by a camera. The critical sealing components can be the packing of the wellhead.

[0028] The oil leak detection method provided in the embodiments of this disclosure will be introduced first.

[0029] Figure 1 A schematic flowchart of an oil leak detection method according to an embodiment of this disclosure is shown. Figure 1 As shown, the method may include the following steps: S110. Acquire multiple image frames at different acquisition times of the oil production equipment, with each image frame containing the target part of the oil production equipment; S120. Perform region detection on multiple image frames to obtain multiple regions of interest frames corresponding to the target parts; S130. Input multiple regions of interest frames corresponding to the target part into the oil leak detection model. The oil leak detection model includes a texture feature extraction branch, a geometric feature extraction branch, and a physical feature extraction branch. S140. Extract the interface environment features of multiple regions of interest frames through the texture feature extraction branch and predict the oil leakage and penetration stage based on the interface environment features. Also, extract the jet morphology features of multiple regions of interest frames through the geometric feature extraction branch and predict the oil leakage and puncture stage based on the jet morphology features. Also, extract the flow reflection features of multiple regions of interest frames through the physical feature extraction branch and predict the oil leakage and flow stage based on the flow reflection features. S150. Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, and the oil leakage flow stage, the oil leakage detection results of the target location are obtained.

[0030] Here, the target location varies depending on the oil production equipment. For example, when the oil production equipment is a treehouse, the target location could be the tree root system. Of course, there can be one or more target locations. When multiple target locations exist, image features of a single target location can be identified to predict the oil leak stage, or the identification results of multiple adjacent or strongly related target locations can be used together to predict the oil leak stage. The region of interest frame represents the target location on the oil production equipment and the area near that target location, serving as the input image for identifying the oil leak stage at that target location.

[0031] In addition, the aforementioned interface environment characteristics refer to the environmental state characteristics presented by the surface of the oil production equipment, which are used to characterize the humidity, texture, roughness, etc. of the surface of the oil production equipment.

[0032] Thus, based on image analysis, the different changes in the image features of the oil production equipment at different stages of oil leakage can be used to identify the corresponding stage of the oil leakage. Specifically, in the initial stage of oil leakage, a small amount of oil seeps in, and the interface environment of the oil production equipment changes significantly, thus identifying the seepage stage; based on the significant changes in the geometric features of the ejected fluid caused by pressure puncture, the puncture stage is identified; based on the significant changes in the flow and reflection characteristics of the liquid phase caused by continuous flow, the flow stage is identified. This achieves full-cycle identification from small seepage to high-pressure injection to large-area flow, and can adapt to complex working conditions. Secondly, the oil leakage detection model adopts heterogeneous multi-branch parallel processing of the corresponding image features and identification of oil leakage stages, avoiding interference from mixed features, optimizing the feature understanding ability of branches, avoiding the problem of single model failure for certain stages, improving the model's processing efficiency and accuracy, and thus enabling timely and accurate identification of oil leakage.

[0033] The steps described above are explained in detail below.

[0034] Regarding S110, based on the dynamic characteristics of the oil leak process, image frames containing the oil production equipment are acquired at different times. Here, the image frames must at least include the target part of the oil production equipment to facilitate analysis of the oil leak morphology changes of the target part over time and to obtain the oil leak detection results.

[0035] Industrial-grade monitoring cameras deployed in the wellhead oil production equipment area continuously acquire real-time video streams at a resolution of 1920×1080. These streams consist of multiple image frames captured at different times. To balance resource consumption and real-time performance requirements, a fixed-interval frame-sampling strategy can be employed to downsample the original video stream to [resolution value missing]. Frames per second (default) (This can be adjusted according to the site conditions or task type) to ensure continuous data input for subsequent processing.

[0036] To improve the quality of image acquisition, this disclosure adaptively adjusts the field of view of the image frames during the acquisition process. A preliminary assessment of the leakage scenario is performed before image processing to acquire image frames with a scale more suitable for the current leakage scenario, providing a data foundation for subsequent accurate analysis.

[0037] Figure 2 This illustration shows a schematic diagram of a wide-angle field-of-view capture screen provided in one embodiment of the present disclosure; Figure 3 This illustration shows a magnified (2x) captured image provided in one embodiment of the present disclosure; Figure 4 This illustration shows a 4x magnified view of a captured image provided in one embodiment of the present disclosure. Figures 2 to 4As shown, in multi-scale frame extraction, multiple image frames of different scales can be obtained at the same time to supplement and improve the input data.

[0038] In one optional implementation, multiple image frames are acquired at different acquisition times from the oil production equipment, including the steps of acquiring image frames and adjusting the acquisition field of view, wherein... The steps for acquiring image frames include: Acquire the current image frame of the oil extraction equipment based on the current field of view; The steps for adjusting the acquisition field of view include: The suspected oil leakage stage is determined based on the pixel grayscale features of the current image frame. The suspected oil leakage stage is at least one of the suspected seepage stage, suspected puncture stage, and suspected flow stage. Based on the judgment of the suspected oil leak stage, the current field of view is changed; The steps of acquiring image frames and adjusting the acquisition field of view are repeated, using the changed current acquisition field of view as the current acquisition field of view for the next image frame, until multiple image frames at different acquisition times are obtained.

[0039] Here, during image acquisition, this disclosure employs a target-driven intelligent scale-adaptive zoom strategy. Based on the current image frame, the most probable leakage scenario is determined, i.e., the suspected oil leak stage. Based on the determination of the suspected oil leak stage, the scale of the next image frame is determined, providing the most suitable image data for subsequent accurate detection.

[0040] Specifically, when the infiltration scene is suspected, the field of view is switched to the maximum magnification so that the micro-textures can be effectively captured by the subsequent texture branches; when the leakage scene is suspected, the field of view is switched to a moderate magnification and captured with a high-speed shutter to ensure that the edges of the high-speed liquid jet are clear and without ghosting; when the flowing scene is suspected, a wide-angle field of view is maintained to monitor the diffusion area of ​​the oil pool.

[0041] To fully demonstrate the advantages of the dynamic optical zoom solution, 100 test samples with relatively small targets in wide-angle images were selected for testing. The optical zoom of this disclosure was used as the experimental group, and the comparison groups were wide-angle images and digitally magnified images. The test results are detailed in Table 1, the zoom strategy effect comparison table.

[0042] Table 1 Comparison of Zoom Strategy Effects

[0043] Figure 5 This illustration shows another capture image of a wide-angle field of view provided in one embodiment of the present disclosure; Figure 6 A schematic diagram of a telephoto field of view acquisition screen provided in an embodiment of this disclosure is shown; Figure 7A schematic diagram of a digitally magnified captured image provided in one embodiment of this disclosure is shown. For example... Figures 5 to 7 As shown, the wide-angle view contains multiple complete oil extraction devices, while the telephoto view contains only one. (Referring to Table 1, and...) Figures 5 to 7 This disclosure achieves image scaling, i.e., optical zoom, by controlling the focal length, compared to... Figure 7 The digital magnification method disclosed herein captures image details more accurately and produces a clearer image.

[0044] In this way, by adjusting the field of view in real time based on image content, adaptive observation of different suspected oil leak stages is achieved, ensuring that subsequent data acquisition can operate under optimal imaging parameters, thereby improving the overall accuracy and robustness of oil leak detection. This dynamic zoom always acquires images within the most suitable field of view, avoiding ineffective wide-angle searches or blind telephoto zooms. It focuses on details while preventing missed targets, thus improving detection efficiency.

[0045] Furthermore, to accurately capture different oil spill patterns, it is necessary to establish a correlation between the scale of image frames and the oil spill pattern. For example, when a suspected flow occurs, the scale needs to be reduced to initially determine the suspected oil spill stage. Then, image frames corresponding to the acquisition field of view for the suspected oil spill stage are acquired based on the suspected oil spill stage. In specific zoom decisions, the suspected oil spill stage can be determined based on image entropy, contrast, and preliminary edge density.

[0046] In one alternative implementation, the step of adjusting the acquisition field of view includes: When the pixel grayscale feature indicates that the pixel grayscale change is less than the preset grayscale change threshold and the contour feature extracted from the current image frame does not meet the preset conditions, the current image frame is determined to be in the suspected penetration stage, the current acquisition field of view is adjusted to the telephoto field of view, and the lens focal length is adjusted to the first focal length. When the pixel grayscale feature indicates that the pixel grayscale change is greater than or equal to the preset grayscale change threshold and is directional, the current image frame is determined to be in the suspected leakage stage. The current acquisition field of view is adjusted to the telephoto field of view, and the lens focal length is adjusted to the second focal length, which is less than the first focal length. When there are dark gray areas in the ground region represented by pixel grayscale features and the area of ​​the dark area is greater than the preset area threshold, the current image frame is determined to be in the suspected flowing stage, and the current acquisition field of view is adjusted to a wide-angle field of view.

[0047] Here, the contour feature can be the variance of the Laplacian response of the current image frame. When the variance of the Laplacian response of the current image frame is less than a preset variance threshold, it can be determined that there is no obvious contour in the current image frame. The contour feature can also be the gradient magnitude of the current image frame. When the gradient magnitude is less than a preset gradient magnitude threshold, it can be determined that there is no obvious contour in the current image frame. Of course, the contour feature can also be an edge probability map of the current image frame obtained based on a segmentation network or an object detection network. In this case, the preset condition can be set based on the edge probability threshold of the edge probability map. Contour features can also include other components, which will not be elaborated upon here.

[0048] In a specific example, if the low-frequency components dominate and have no clear outline, it is determined to be a suspected penetration stage, and the zoom motor is controlled to the maximum magnification, such as the magnification factor. To capture microscopic textures; if high-frequency components are accompanied by strong directional edges, it is determined to be a suspected leakage stage, and the zoom is adjusted to a moderate magnification and the shutter speed is increased to reduce motion blur; if a large dark area is detected on the ground, it is determined to be a suspected flow stage, and a wide-angle field of view is maintained to monitor the diffusion area.

[0049] Of course, other methods can also be used to achieve this. The monitoring system operates based on a preset time interval Δ (default (Minutes), periodically triggering target-driven optical zoom operations. First, the system uses a target detection model to detect all oil production equipment targets in the wide-angle view and determines the zoom target sequence of the oil production equipment to be processed in order from left to right. Then, an optical zoom operation is performed on each target in the sequence. The zoom process is not a one-step process, but a gradual magnification to the target magnification. (default During this zoom process, multi-scale video frames are continuously extracted to improve positioning accuracy at different scales in subsequent steps. This multi-target, multi-scale magnified image is dedicated to refined state analysis to capture clear details and textures of the root structure and oil stain morphology, while wide-angle images are used for background and environmental monitoring during other regular periods.

[0050] In this way, by using temporally correlated image frames, the nonlinear characteristics of oil stain diffusion are accurately captured. Continuously extracting multi-scale video frames during zooming not only effectively ensures the high definition of the input features for the fine-scale classification model but also improves the localization accuracy of the target detection model at different scales by utilizing multi-scale information. This ensures that subsequent detection models can perform refined analysis on the most critical visual information. Furthermore, the judgment logic based on physical features rather than semantic features enhances the robustness of scene recognition, enabling preliminary scene prediction in a very short time while avoiding erroneous zooming caused by environmental interference such as flying insects or shadows.

[0051] Furthermore, multiple image frames can be rapidly acquired at each moment to facilitate image filtering and processing. After obtaining multiple image frames, the frames first undergo a filtering process to remove low-quality frames, such as completely black or severely damaged frames. Then, non-local mean filtering (NLM) is used for noise reduction, with the filter strength parameters set accordingly. (default This effectively suppresses oil stain reflection and high-frequency background noise.

[0052] Finally, apply contrast-limited adaptive histogram equalization and set a contrast limit threshold. (default ) and block size (default The image undergoes illumination normalization. Excessively high contrast is suppressed, while excessively low contrast is compensated. Local calculations are performed in blocks before overall calculation to prevent overly bright local lighting from affecting the representation of dark areas and to suppress realistic bright areas that would cause light features to disappear. This approach can handle variations in shadows and strong light, thereby improving image quality, enhancing target features, and ensuring the stability of subsequent model inputs.

[0053] Regarding S120, the aforementioned image frames represent the coarse positioning results of the oil production equipment, meaning that each image frame includes at least one or more oil production equipment to avoid omissions. This step, based on the image frames obtained in S110, further corrects the coarse positioning and refines the target location of each oil production equipment.

[0054] Figure 8 This diagram illustrates an oil leak occurring in an oil wellhead according to an embodiment of the present disclosure. Figure 9 A schematic diagram illustrating an embodiment of this disclosure showing that no oil leakage has occurred in the wellhead. For example... Figure 9 As shown, the oil production equipment within the yellow boundary box is the wellhead. Figure 8 As mentioned above, oil leaks may occur at the surface of the wellhead, and the oil will exhibit different forms depending on the severity of the leak.

[0055] In one optional implementation, at least one oil extraction device exists within each image frame. Region detection of the target area is performed on multiple image frames to obtain multiple regions of interest frames corresponding to the target area, including: Target detection of oil production equipment is performed on the image frames, and the area where the oil production equipment is located is magnified at multiple scales to obtain multiple images to be analyzed; Based on the proportion of the maximum bounding box of the oil production equipment in the image to be analyzed, multiple images to be analyzed are filtered to obtain multiple valid images; Target detection is performed on the target parts within the maximum bounding box of the oil production equipment in each valid image to obtain multiple regions of interest frames corresponding to the target parts.

[0056] For example, when an image frame contains multiple oil production devices, the area where one oil production device is located is magnified at a corresponding scale so that the image to be analyzed completely contains one oil production device.

[0057] In the magnified image, the area of ​​the detected oil production equipment bounding box is continuously calculated for images at different scales. Occupying the entire image area The proportion; only when that proportion Reaching or exceeding a preset threshold (default When the current image is deemed to have sufficient clarity and completeness for detailed analysis, it is allowed to proceed to the subsequent processing flow; otherwise, it is discarded to avoid invalid calculations and obtain a valid image.

[0058] Next, image frames that meet the analysis criteria are input into a customized trained Yolov5m target detection model. This model quickly identifies and locates the overall structure of wellhead oil production equipment in the image and outputs its bounding box coordinates. At this stage, the focus is not on the details of the oil leak, but only on ensuring that the main body of the oil extraction equipment is completely contained. This achieves coarse-grained target localization and significantly reduces the reliance on fine-grained annotations of the oil leak area in the training data. Subsequently, based on the bounding box coordinates of the oil extraction equipment, the region of interest (ROI) image is cropped from the original image frame. That is, the region of interest frame.

[0059] This operation effectively isolates the target body of the wellhead oil production equipment from the complex well site background, such as pipelines, supports, and ground debris, achieving background suppression. This allows the subsequent classification model to focus all computational resources on the target body, improving detection efficiency and accuracy.

[0060] Furthermore, to achieve model specialization, a coarse localization model is used to identify bounding boxes, completing the above process. Afterwards, the coarse localization model can be coupled to the oil leak detection model. The training process of the coarse localization model is described below.

[0061] First, 2000 field samples were collected, covering various lighting conditions, weather conditions, and oil leak morphologies. Industrial-grade monitoring video streams were acquired from the wellhead production tree site in the oilfield, covering a variety of complex operating conditions, including multi-scale images, various weather conditions, diverse oil leak morphologies (such as trace seepage, dripping, and flowing), and normal samples. These 2000 images were used as the original training data, with 800 samples exhibiting root canal oil leaks. The dataset was divided into a training set of 1600 images, a validation set of 200 images, and a test set of 200 images in an 8:1:1 ratio. The environment was configured according to the experimental environment and hardware configuration table in Table 2.

[0062] Table 2 Experimental Environment and Hardware Configuration

[0063] Next, data annotation is performed, simply marking the overall bounding box of the oilfield tree in the image with a rectangle. The Yolov5m model is selected as the basic architecture, and CIoU Loss is used for bounding box regression optimization to improve localization accuracy. The aforementioned customized trained Yolov5m object detection model is the completed coarse localization model. Conventional data augmentation techniques such as random cropping and color dithering are used during training. The training parameter configuration of the coarse localization model is detailed in Table 3 below.

[0064] Table 3. Training Parameter Configuration Table for Coarse Localization Model

[0065] During training, the normalized images are... Input the model to be trained, and extract multi-level features through CBS and C3 residual structures to obtain feature representations. And completed via SPPF (Spatial Pyramid Pooling Fast) structure. Scale-based pooling and fusion are employed to enhance the global representation of the oil production equipment at different zoom scales. Subsequently, a predictive feature layer is formed through cross-scale feature fusion using PANet (Path Aggregation Network). Predict bounding box parameters in each layer of the detector head, corresponding to small, medium, and large scales respectively. The training phase is based on manually labeled ground truth bounding boxes. With prediction box Calculate the CIoU loss. The formula for calculating the CIoU loss is shown in equation (1).

[0066]

[0067] in, Indicates CIoU loss; This represents the intersection-over-union ratio (IoU), which measures the degree of overlap between the predicted bounding box and the ground truth bounding box. , This represents the area of ​​the actual bounding box. Indicates the area of ​​the prediction box; Indicates the weighting coefficient. ; , This represents the width of the actual bounding box. Indicates the height of the actual bounding box. This indicates the width of the prediction box. Indicates the height of the prediction box; The Euclidean distance is the center point. The minimum diagonal length of the bounding box; Describe the consistency of aspect ratio; This refers to the predicted center point of the bounding box; Refers to the center point of the actual bounding box.

[0068] Then, the overall objective function is constructed by combining the target confidence loss and the classification loss, and the calculation formulas are shown in equation (2) and equation (3).

[0069]

[0070] in, and Both are cross-entropy loss functions; Indicates the total loss; For category weights, This is a unique hot tag; Indicates category; This represents the probability of a category.

[0071] Finally, the network parameters are iteratively updated through backpropagation, enabling the model to stably output the coarse localization bounding box of the main body of the oil production tree in different lighting, focal length and well site environments, providing accurate regional constraints for subsequent ROI pruning and fine classification processing.

[0072] Thus, by employing a two-stage visual analysis strategy, the complex task of oil leak detection is decoupled, enabling a specialized division of labor between target localization and state discrimination. Coarse-grained localization is performed only on the overall wellhead oil production equipment, significantly reducing the reliance on high-precision annotation of small, irregular oil leak areas in the training data, thereby lowering annotation costs and model complexity. Subsequently, the detected oil production equipment area is automatically cropped and enlarged for input into the oil leak detection model, accurately determining whether oil leaks exist at the target location. This effectively suppresses interference from complex well site backgrounds, allowing the oil leak detection model to focus resources on the enlarged region of interest frame, thereby achieving accurate identification of various oil leak scenarios such as trace seepage, dripping, and flowing.

[0073] In step S130, the processed region of interest frame is input into the oil leak detection model to output the oil leak detection results of the oil production equipment. The format of the oil leak detection results can be set as needed.

[0074] In a specific example, for an oil leak detection model, the wellhead is considered the oil production equipment, and the packing is the target location. The oil leak detection result represents the probability that the oil production equipment is functioning normally and / or the probability of being in the current oil leak stage. The trimmed... The input is fed into an image classification model built on a residual structure. This model has a multi-branch parallel processing structure, which can utilize its deep feature extraction capabilities to analyze clear images after magnification. It outputs the probability of normal or oil leakage penetration stage, oil leakage puncture stage, oil leakage flow stage, and combined oil leakage stage through the fully connected layer at the end. When the confidence score of the predicted probability Greater than the preset classification threshold (default When an oil leak occurs, it can be determined that an oil leak has occurred, thereby enabling accurate identification of various oil leak scenarios such as trace oil seepage, dripping, or flowing.

[0075] The training process for the oil leak detection model is as follows.

[0076] First, based on the detection boxes of the coarse localization model, the corresponding local regions are cropped from the original images to obtain the regions of interest frames, which are then organized into a training dataset. Next, 800 images showing oil leakage due to entanglement are further subdivided into four types based on their leakage characteristics: seepage, intermittent dripping, continuous flow, and combined leakage. These four types of leakage samples serve as the annotation set for the four categories. The remaining 1200 normal images are designated as the normal class.

[0077] Training configuration: ResNet50, built based on residual structure, was selected as the classification network to leverage its deep feature extraction capabilities. During training, images cropped from the ROI were used as input, with a focus on sampling difficult-to-distinguish samples such as minor oil leaks and drips to enhance the model's generalization ability. The parameter configuration of the oil leak detection model is detailed in Table 4 below.

[0078] Table 4 Parameter Configuration Table for Oil Leak Detection Model

[0079] Training process: Normalize the image obtained from the ROI cropped in the coarse localization stage. Input a ResNet50 classification network built on a residual structure, and obtain a high-dimensional semantic representation through multi-stage convolutional feature mapping and identity residual connections. ,in This represents the feature transformation of the network; it generates a global feature vector after global average pooling. The data is then mapped to a multi-class space via a fully connected layer to obtain the class probability distribution. Corresponding category tag set .in, Represents global feature vectors The weight matrix, This represents the bias vector.

[0080] During the training phase, the weighted cross-entropy loss of Equation (3) is used to alleviate the imbalance problem of different types of oil spill samples. However, the traditional cross-entropy loss is dominated by a large number of normal samples, such as normal oil production equipment under a clear sky. Visually, these samples are easily confused with dark background oil slicks and light oil seepage, which may have blurred edges. This results in insufficient training of the model on easily confused difficult samples. For easily confused light oil seepage and background oil slicks, this invention further introduces the Focal Loss mechanism, as shown in Equation (4), to apply higher gradient weights to difficult samples.

[0081] In an optional implementation, the method further includes the step of obtaining the oil leak detection model by training a model to be trained, and the step of obtaining the oil leak detection model by training a model to be trained includes: Based on the oil leak detection results output by the model to be trained for the input image frame, the category probability is obtained; When the category probability is less than a preset probability value, the loss function value is calculated using the following formula:

[0082] in, Category weights; This is a unique hot tag; For class probabilities; C is the focus parameter; C is the set of categories; This represents the loss function value.

[0083] Thus, the following was introduced The modulation factor is used to differentiate between easily classified samples. When the sample is easy to classify, the modulation factor is close to 0, and the loss contribution of that sample is significantly reduced. When the sample is difficult to classify, the modulation factor is close to 1, and the loss of that sample is preserved or even amplified. This allows the model to focus its efforts on distinguishing between high-difficulty, high-value samples such as mild oil seepage and background oil pollution, effectively improving the model's ability to distinguish in easily confused regions.

[0084] Finally, the gradients of the network parameters are calculated. Combined with the AdamW optimizer for iterative updates, the model can stably distinguish between normal and various types of oil leaks under actual well site conditions such as multi-scale zoom, different weather, and reflective interference. This enables refined multi-classification identification of target locations within the ROI, providing reliable input for subsequent time-series judgment and alarm mechanisms.

[0085] Figure 10 This diagram illustrates the basic workflow of an oil leak detection model provided in one embodiment of the present disclosure, as follows: Figure 10 As shown, the trained oil leak detection model can perform the following steps.

[0086] First, S1, acquire the video stream from the camera. S2, process the video stream into multiple image frames. S3, perform image preprocessing and target detection on the preprocessed images. This involves real-time acquisition of wide-angle image frames by the monitoring system. The data is preprocessed and input into the coarse positioning network Yolov5m, and a preliminary detection frame of the main body of the oil production equipment is obtained through forward propagation. Until the oil extraction equipment is detected. S4, the image is magnified by optical zoom, and image frames of different scales are extracted. Based on the dynamic optical zoom operation, the camera is aimed at the predicted position and discrete focal lengths are used. Gradually zooming in from the wide-angle view to the target magnification, each focal length acquires corresponding image frames in real time. To ensure the quality of subsequent sub-classification, this disclosure calculates the tree coverage rate for each focal length frame. ,in, Indicates preliminary detection box area, Represents the image frames acquired in real time for each focal length. The area, only at that time >Preset oil well cover threshold If the frame is deemed to have sufficient sharpness and detail resolution, then S5 is performed to crop and normalize the region of interest (ROI). The ROI is then cropped from frames at each focal length. This serves as a valid input to the oil leak detection model. Subsequently, the ROI is input into a multi-class ResNet50 network to obtain the probability distributions of five oil leak states. The category set is Furthermore, a time-scale joint stabilization strategy was implemented for the results of each focal length, using a weighted attenuation coefficient. Construct scale-weighted prediction scores Finally, S6, in the timing sliding window In the middle, when all frames are judged as oil leaks and The overall score satisfies The alarm is triggered in time, thereby realizing a high-precision oil leak detection reasoning process of coarse positioning, dynamic optical zoom, fine classification and time sequence confirmation. By combining a two-stage decoupling strategy with dynamic optical zoom and time sequence judgment strategy, high-precision and low false alarm detection of trace oil leaks in the wellhead production tree packing is achieved.

[0087] Furthermore, to further enhance the relevance of the scene, this disclosure also incorporates physical equations into the neural network learning process. When identifying high-pressure leaks and flow processes, the movement of the oil follows the Navier-Stokes equations. Based on the physical information correction concept, a loss function of equation (5) is established. For example, in a leak scenario, the momentum decay of the liquid jet is closely related to the pressure difference. This method of hard-coding the physical laws of the scene into the algorithm allows the model to not only learn image features but also simulate physical processes.

[0088]

[0089] in, The approximation represents the total loss function value, and the predicted oil flow vector must conform to fluid dynamics. Indicates data loss; Indicates physical loss; This represents the weighting coefficient.

[0090] S140 is involved, which is a multi-branch parallel structure for image processing. During processing, the optimization goals are processing efficiency and result accuracy, so that each feature processing branch can accurately identify the corresponding scene.

[0091] During the infiltration stage, micro-gaps form at the sealing interface, and the oil slowly precipitates out driven by surface tension and micro-pressure difference. The characteristics of the metal interface are used to identify the oil leakage infiltration stage; at this stage, the metal surface texture becomes blurred, reflectivity is locally reduced, and wetting shadows appear. Therefore, the identification is based on interface environmental characteristics, such as ambient humidity, surface roughness of the smooth rod, and lubricant viscosity.

[0092] In one optional implementation, the interface environment features include texture variation features. Interface environment features are extracted from multiple region-of-interest frames via a texture feature extraction branch, and prediction of the oil leakage / penetration stage is performed based on these interface environment features. This includes: Directional filtering is applied to the frame of the region of interest to obtain texture variation features in different directions; When the texture of the target area changes, the oil leakage and penetration stage is predicted for the region of interest frame.

[0093] For example, a multi-scale Gabor filter bank is used to extract texture responses in the 0, 45, 90, and 135 degree directions to obtain texture variation features in different directions.

[0094] The 0-degree angle, representing the horizontal direction, detects transverse scratches or the horizontal spread of oil. A strong horizontal response is observed if the polished rod surface has annular wear. The 45-degree angle is primarily used to detect diagonal textures. Oil flowing under gravity doesn't always flow vertically; it may branch diagonally. This direction captures these patterns. The 90-degree angle, representing the vertical direction, is crucial because the polished rod moves up and down, resulting in predominantly vertical machining and wear lines. Oil also flows vertically under gravity, and the 90-degree angle response most strongly reflects the vertical stripe characteristics of the polished rod. The 135-degree angle complements the 45-degree angle, covering most diagonal textures and ensuring no anomalies are missed.

[0095] Under normal circumstances, the texture direction does not change. However, when the texture of the target area, as represented by the texture change feature, changes in multiple directions, it indicates that oil penetration has occurred, requiring further determination to determine whether it is the oil leakage penetration stage. Thus, optimizing the texture feature extraction branch for the scene characteristics of the penetration stage can effectively address the smoothing effect caused by oil stains in penetration scenes, thereby allowing for a focus on the loss patterns of local contrast.

[0096] Thus, by applying directional filtering to the region of interest and extracting texture change features in different directions, the attenuation of texture response in specific directions can be accurately obtained, capturing weak signals that traditional methods cannot detect. Furthermore, since factors such as changes in lighting and lens contamination usually cause overall image blurring, texture attenuation occurs simultaneously in all directions. However, oil penetration primarily affects directions consistent with the processing texture. Through multi-directional comparison, genuine penetration can be effectively distinguished from environmental interference, thereby accurately identifying whether penetration has occurred.

[0097] Furthermore, the oil leakage and penetration stages are predicted for the region of interest frames, including: The texture entropy is calculated based on the pixel grayscale distribution of the region of interest frame, and the result of the texture entropy calculation is used to determine whether the target area is in the penetration stage.

[0098] In the early stages of penetration, the oil film thickness is often around 1. Up to 10 In this context, there are no obvious object outlines in the visible light image. Traditional convolutional neural networks tend to extract mid-to-high frequency semantic features, easily ignoring such weak signals. To address this, this disclosure introduces Local Binary Pattern (LBP) and Gray-Level Co-occurrence Matrix (GLCM) for texture energy analysis.

[0099] When oil fills the microcracks and processing textures on a metal surface, the second-order moment features of the local region will shift significantly. Oil penetration will increase the texture entropy of the metal surface. By embedding a texture-aware attention mechanism in the backbone network of the oil leak detection model, higher weights can be assigned to areas where penetration may occur. The mathematical expression of texture entropy is as follows (6):

[0100] in, This represents the probability distribution of the local gray-level histogram. For texture entropy; The gray level is represented by 0 to (L-1), which represents the range of gray levels. (L-1) represents the highest gray level value, and L is used to indicate the count.

[0101] In addition, the fluorescence properties of oils under ultraviolet light excitation can be utilized. When a 365nm ultraviolet LED array is used as the active excitation light source, the previously invisible oil penetration traces will emit bright blue fluorescence, thus transforming the complex background suppression problem into a simple color gamut segmentation problem.

[0102] Thus, by utilizing the fact that oil fills microcracks during infiltration, the originally regular grayscale distribution becomes uniform, and the texture entropy increases significantly. This transforms the surface blurring, which is imperceptible to the human eye, into calculable and comparable values, providing an objective and quantitative basis for judging the infiltration stage. Before the oil film forms visible droplets or streaks, the change in texture entropy is captured, enabling the detection of trace infiltration in the earliest stage of oil leakage, enhancing the timeliness of detection, and significantly improving the detection capability in the most concealed stage of oil leakage.

[0103] During the leak-through stage, the local seal completely fails, and high-pressure fluid is ejected through tiny pores, forming an atomized or linear spray. At this point, pressure leaks manifest as highly directional linear or conical targets, specifically as slender liquid jets, fan-shaped spray mists, and abrupt changes in edge gradients. In this scenario, the general rectangular bounding box (BBox) cannot describe the essential characteristics of the target. This disclosure utilizes edge-aware technology, such as the DexiNed algorithm, to extract extremely fine fluid edges. Therefore, the leak-through stage is determined based on jet morphology characteristics, such as wellhead casing pressure, pore geometry, and fluid velocity.

[0104] In one optional implementation, the jet morphology features include fluid edge features and edge initiation features. Multiple region-of-interest frames are extracted using a geometric feature extraction branch, and prediction of the oil leak / puncture stage is performed based on these jet morphology features, including: Edge detection is performed on the region of interest frame to obtain fluid edge features and edge initiation features; The fluid detection results are obtained based on the changes in fluid edge features and edge origin features in adjacent frames of interest. Predicting the oil leak and puncture stages based on fluid detection results.

[0105] For example, edge detection can be performed by extracting and analyzing the axial vector distribution of the oil jet. The visual characteristics of the leaking liquid jet satisfy specific geometric constraints, namely, a sharp brightness jump in the normal direction. The gradient vector flow (GVF) is calculated using equation (7) to obtain the axial vector distribution of the liquid jet.

[0106]

[0107] in, Represents pixel coordinates, Represents the coordinates of pixel u. Represents the coordinates of pixel v; It represents the gradient vector flow formed by pixels u and v, pointing in the direction of the fastest change in brightness, and the magnitude represents the intensity of the change.

[0108] Thus, based on the continuous motion trajectory of high-speed fluid between adjacent frames, by analyzing the temporal changes in edge features, such as the extension and oscillation of the liquid jet, the dynamic properties of the fluid, rather than static interference traces, can be efficiently captured. By comparing adjacent frames, the continuous existence, extension, or change of the fluid can be confirmed, thereby effectively distinguishing between static interference and dynamic leakage.

[0109] Furthermore, predictions of the oil leak puncture stage based on fluid detection results include: When the fluid detection results indicate that the fluid is in a strip-like shape and originates from the target area, the target area is determined to be in the puncture and leakage stage.

[0110] In a specific example, in the geometric feature extraction branch, an edge connection operator with an attention mechanism is used to find fluid strips with specific aspect ratios and curvature distributions.

[0111] Here, since leaks typically occur at the point of seal failure, their initial coordinates are relatively fixed, exhibiting a topological feature radiating outwards from the center point. Therefore, it is possible to verify whether the edge vector originates from the boundary of the seal at the target location. This scenario prior can be encoded into the loss function of the classification network. If the detected target does not satisfy this geometric orientation, it is determined to be due to ambient light and shadow interference, such as tree branch shadows or metallic reflections.

[0112] Thus, based on the strip-shaped geometric constraints, puncture leaks can be clearly distinguished from other stages of oil leakage, avoiding misjudgments. By eliminating external interference based on the leak source, it ensures that the alarmed leak truly originates from the monitored equipment, making the detection results highly interpretable and improving the reliability of the detection. This achieves accurate identification of high-pressure puncture leaks, effectively capturing real leaks while significantly reducing the false alarm rate caused by static or external interference such as scratches, water droplets, and light shadows, ensuring the accuracy and reliability of the alarm.

[0113] During the flow stage, the leakage exceeds the surface's liquid-holding capacity, and the oil forms a continuous downward-flowing strip along the equipment surface, manifesting as a longitudinally extending liquid strip, highly reflective bright spots, and an expanding oil pool at the bottom. Therefore, the oil leakage flow stage is determined based on the direction of gravity and the properties of the equipment surface coating.

[0114] In one optional implementation, the flow reflection features of multiple region-of-interest frames are extracted via a physical feature extraction branch, including: Specular reflection highlights are obtained by processing the region of interest frame based on the bidirectional reflection distribution function. Calculate the motion vector field of adjacent frames in the region of interest, and filter out the oil drop features from the motion vector field; The static background of the region of interest frame is removed by background subtraction to obtain the oil extension region.

[0115] In a specific example, the Dense Optical Flow method can be used to calculate the motion vector field of adjacent pixels and extract the components that conform to the characteristics of gravitational acceleration to obtain the oil falling vector.

[0116] By using background subtraction enhancement, static interference is filtered out, and the background is updated in real time using a Gaussian mixture model (GMM), retaining only the leaking targets with dynamic attributes.

[0117] Furthermore, due to the continuous fluidity of the flow, it is necessary to focus on capturing and analyzing the dynamic process of oil evolution over time to improve detection accuracy and distinguish between historically accumulated dried oil traces and ongoing real-time flow. To this end, this solution incorporates temporal scene features. A temporal convolutional network (TCN) is used to determine the persistence of the leak, recording the evolution trend of classification probabilities in frame images to identify sudden splashes or slow expansion.

[0118] Thus, when oil covers a metal surface, it creates a bright, mirror-like reflection that shimmers with surface fluctuations. By precisely capturing these physical reflection characteristics, it's possible to effectively distinguish oil from other darker areas (such as shadows, stains, and watermarks). Furthermore, by constructing a motion vector field, the flow direction and speed of the oil can be directly observed. Since the flow often accompanies the gradual expansion of the oil pool, it's possible to accurately extract the dynamic, changing areas, effectively distinguishing flowing oil from dried, old oil stains. These characteristics confirm that the oil is flowing and spreading, comprehensively depicting the flow scene from different dimensions.

[0119] Furthermore, prediction of the oil spill flow stage based on flow reflection characteristics includes: Based on time-series analysis, the specular reflection bright spots, oil drop characteristics, and changes in the oil expansion area in multiple consecutive regions of interest frames corresponding to the target location are determined to obtain liquid phase detection results. When the liquid phase detection results show that the specular reflection bright spot continues to flash, the oil droplet falling characteristics are stable downward, and the oil expansion area continues to expand, it is determined that the target location is in the flow stage.

[0120] In flowing scenarios, the bidirectional reflection distribution function (RDF) of oil and metal surfaces generates specularly reflective bright spots that vary over time. The optimization scheme further eliminates interference from fixed strong light sources (such as streetlights and searchlights) by monitoring the flicker frequency and positional drift of these high-brightness spots in the time domain.

[0121] Thus, the continuous flashing of the specular reflection highlights eliminates interference from reflections from fixed light sources; the stable downward movement of the falling oil droplets eliminates interference from random movements such as flying insects and fallen leaves; and the continuous expansion of the oil spill area eliminates interference from temporary water accumulation or brief wetting. By monitoring the flashing frequency, falling speed, and expansion rate, the system effectively captures the actual flow while significantly reducing false alarms caused by static interference (shadows, oil stains) or random interference (flying insects, fallen leaves). This allows the system not only to determine if a leak is occurring but also to assess the severity of the leak.

[0122] In order to enhance environmental adaptability and further avoid misjudgment, the aforementioned steps are optimized by taking into account the impact of environmental changes. Figure 11 This disclosure includes a schematic diagram of a cloudy day environment provided in one embodiment; Figure 12 This disclosure includes a schematic diagram of a rainy weather environment provided in one embodiment; Figure 13 A schematic diagram of a sunny day environment provided in one embodiment of this disclosure is shown. For example... Figure 11 Figure 13As shown, under different weather conditions, the reflection, contrast and other characteristics of image frames will show different or even opposite trends. Therefore, considering the changes in the environment is beneficial to the detection effect of this disclosure based on scene characteristics.

[0123] In an optional implementation, after processing the region of interest frame based on the bidirectional reflection distribution function to obtain specular reflection highlights, the method further includes: Based on the classification threshold determined by the collected environmental data, specular reflection bright spots are filtered out.

[0124] Thus, by combining on-site environmental data, such as ambient light levels and the status of rain sensors, the physical feature extraction branch is optimized. When the environment of the same scene changes, the classification threshold is automatically adjusted to enhance environmental adaptability and detection accuracy. For example, on rainy days, the threshold for filtering reflective bright spots is automatically increased to utilize the difference between diffuse reflection caused by rain and specular reflection from oil stains to filter out rainwater interference.

[0125] During the dripping stage, the oil overcomes surface tension under gravity, forming discrete droplets that fall from the sealed bottom. These droplets appear periodically as spherical / teardrop-shaped objects with consistent falling trajectories. Therefore, the dripping stage of oil leakage is determined based on the pumping unit stroke frequency and the viscosity-temperature characteristics of the oil.

[0126] In one optional implementation, the oil leak detection model further includes an edge feature extraction branch; the method also includes: Edge features of multiple regions of interest frames are extracted through an edge feature extraction branch, and prediction of the oil spill dripping stage is made based on the edge features. Based on the prediction results of the oil seepage stage, the oil puncture stage, and the oil flow stage, the oil leak detection results at the target location are obtained, including: Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, the oil leakage flow stage, and the oil leakage dripping stage, the oil leakage detection results of the target location are obtained.

[0127] Thus, from infiltration to dripping to puncture and then to flow, the entire evolution of an oil leak from occurrence to development is represented, achieving complete coverage of the entire oil leak lifecycle. Parallel prediction by four branches ensures that the final result integrates multi-dimensional information. Even if the confidence level of one branch decreases due to environmental interference, other branches can still provide support, thereby improving the overall stability and reliability of the system.

[0128] Furthermore, edge features of multiple region-of-interest frames are extracted through an edge feature extraction branch, and prediction of the oil spill dripping stage is made based on these edge features, including: When the edge of the target object near the target location is teardrop-shaped and / or spherical, and the teardrop-shaped and / or spherical target objects appear periodically, the target location is determined to be in the dripping stage.

[0129] Thus, based on the principle of droplet formation and shedding dominated by surface tension, spherical or teardrop-shaped droplets can effectively distinguish dripping from other stages of oil leakage. Furthermore, the periodicity of dripping originates from the reciprocating motion of the pumping unit. By verifying whether the target appears periodically, static interference such as fixed oil stains and paint spots on the equipment, as well as random interference such as occasional flying insects and falling leaves, can be effectively eliminated.

[0130] In one optional implementation, after obtaining the oil leak detection results at the target location, the method further includes: An alarm signal is issued when the oil leakage detection results of consecutive region of interest frames within a preset time window all indicate an oil leakage.

[0131] Here, by recording features such as the rate of change of the area of ​​the oil spill area and the changes in the texture of the oil stains on the bare barn of the wellhead, the trend of these physical quantities can be judged within the sliding window to help determine the oil spill trend over time.

[0132] In a specific example, for each image frame detected as an oil leak, its timestamp and classification result are recorded, and it is added to a dynamic history list. Simultaneously, a list containing the most recent... A sliding window of frame classification results is used for real-time temporal tracking of oil leak events. Within the sliding window, the most recent... The classification results of the frames are judged temporally; only when all frames within the sliding window are considered sequentially... The alarm mechanism is triggered only when each frame is continuously classified as an oil leak.

[0133] In addition, the N value can be dynamically adjusted according to changes in ambient light, such as N=3 during the day and N=5 at night when there is more interference; or the length of the sliding window can be dynamically adjusted based on historical false alarm statistics.

[0134] To verify the effectiveness of the timing judgment strategy disclosed herein in suppressing false alarms, 100 consecutive video clips that generated false alarms under complex scenarios such as different lighting and weather conditions were selected for testing. The test results are detailed in Table 5, which shows the false alarm suppression effect of the timing judgment strategy.

[0135] Table 5. False Alarm Suppression Effect of Sequential Judgment Strategy

[0136] Thus, by introducing time-based confirmation, an alarm confirmation mechanism based on time-series information was established, effectively filtering out false alarms caused by brief environmental changes, such as sudden changes in light, flying insects, or occasional factors in a single frame, thereby significantly enhancing the stability and reliability of the entire oil leak detection system.

[0137] In summary, this disclosure proposes a scenario-driven visual monitoring solution through in-depth analysis of the physical processes of oil leakage in wellhead oil production equipment. First, this solution breaks through the homogeneous framework of traditional multi-scale target detection by establishing a strong correlation mechanism between penetration-texture features, puncture-geometric features, and flow-dynamic features, significantly improving the accuracy and environmental robustness of oil leakage identification. Second, this method effectively avoids the labeling difficulties and environmental sensitivity issues arising from directly detecting small, irregular oil leakage areas, significantly improving the system's robustness and generalization ability in complex real-world oilfield scenarios. Compared to traditional manual inspection or single-target detection solutions, this invention offers advantages such as high automation, low labeling accuracy requirements, strong anti-interference capabilities, and low false alarm rate. By identifying oil leakage status in real time and accurately, it can promptly warn of potential safety risks, prevent oil and gas leaks and environmental pollution, and ensure the safe and efficient operation of oil extraction. Furthermore, this method has a clear structure, flexible deployment, and is applicable to various well site environments, possessing good engineering implementation value and promising prospects for widespread application. Therefore, it can effectively solve the technical problems of existing wellhead oil production equipment leakage detection methods, which rely heavily on high-precision target marking and have difficulty in ensuring detection accuracy under complex lighting and variable leakage patterns.

[0138] Furthermore, this disclosure includes comparative experiments between the disclosed solution and existing technologies. This solution specifically addresses the limitations of multi-scale schemes in complex environments to evaluate oil leak classification performance under complex conditions. 5000 real-world scene samples were collected, including those from environments with strong reflections, low light at night, rain and fog, and equipment shadows. The disclosed solution is then compared with traditional multi-scale single-classification models.

[0139] Table 6 compares the performance of different solutions in typical oil leak detection scenarios. As shown in Table 6, the general solution was used as the comparison group, and the solution disclosed in this paper was used as the experimental group. Comparison experiments were conducted between the comparison group and the experimental group for different scenarios. Experimental group A corresponds to the infiltration scenario, experimental group B corresponds to the puncture leak scenario, and experimental group C corresponds to the flow scenario. The experimental results show that by strongly associating the classification logic with specific physical scenarios such as infiltration, puncture leak, flow, and dripping, the system achieved a 13% performance improvement in the most challenging micro-infiltration identification, while reducing the false alarm rate by more than 60% in complex environments. This fully demonstrates that the solution that associates physical features has greater engineering practical value and technical sophistication than the solution that simply increases the convolution depth.

[0140] Table 6 Comparison of oil leak detection performance of different schemes in typical scenarios

[0141] In addition to visual images, acoustic emission signals, vibration spectrum analysis, and fiber optic sensing data can all serve as supplementary dimensions for scene-related features. Besides the oil leak morphology, configurations can be differentiated according to different types of industrial application scenarios.

[0142] Taking the packing box in marine engines (a two-stroke crossover diesel engine) and the tree trunk in onshore oilfields as examples, there are significant differences in their structure and operating conditions. Therefore, an environmental perception adapter can be added to automatically identify the current industrial scenario and call upon the corresponding parameter set. For example, in an onshore oilfield scenario, the monitoring operator for oil pool expansion will be automatically activated; while indoors or in enclosed marine compartments, the infrared thermal imaging analysis branch targeting smoke / leaking mist will be emphasized. Furthermore, Table 7 shows the scenario-differentiated configuration table for onshore oilfields and offshore platforms. As shown in the table, background complexity, vibration intensity, and leakage medium are set as scenario variables. By utilizing the differences in the same scenario variables under different industrial scenarios, corresponding detection strategies can be set to enhance the accuracy of oil leak detection.

[0143] Table 7 Comparison of Algorithm Optimization Focus in Different Industrial Application Scenarios

[0144] Figure 14 A schematic diagram of the hardware structure of the oil leak detection device provided in an embodiment of this disclosure is shown.

[0145] The oil leak detection device may include a processor 301 and a memory 302 storing computer program instructions.

[0146] Specifically, the processor 301 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this disclosure.

[0147] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 302 may include removable or non-removable (or fixed) media, or memory 302 may be non-volatile solid-state memory. Memory 302 may be internal or external to the integrated gateway disaster recovery device.

[0148] In one instance, memory 302 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0149] Memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0150] The processor 301 reads and executes computer program instructions stored in the memory 302 to achieve... Figures 1 to 13 The oil leak detection method in the illustrated embodiment.

[0151] In one example, the oil leak detection device may also include a communication interface 303 and a bus 304. For example, Figure 14 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 304 and complete communication with each other.

[0152] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this disclosure.

[0153] Bus 304 includes hardware, software, or both, that couples components of the oil leak detection device together. For example, and not as a limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 304 may include one or more buses. Although specific buses are described and illustrated in embodiments of this disclosure, this disclosure contemplates any suitable bus or interconnect.

[0154] It should be clarified that this disclosure is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this disclosure is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this disclosure.

[0155] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this disclosure are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0156] It should also be noted that the exemplary embodiments mentioned in this disclosure describe methods or systems based on a series of steps or apparatus. However, this disclosure is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0157] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0158] The above description is merely a specific embodiment of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this disclosure is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this disclosure, and these modifications or substitutions should all be covered within the protection scope of this disclosure.

Claims

1. A method for detecting oil leaks, characterized in that, The method includes: Multiple image frames are acquired at different acquisition times of the oil production equipment, and each image frame contains the target part of the oil production equipment; Perform region detection on the target region in the plurality of image frames to obtain a plurality of region of interest frames corresponding to the target region; Multiple regions of interest frames corresponding to the target location are input into the oil leak detection model, which includes a texture feature extraction branch, a geometric feature extraction branch, and a physical feature extraction branch. The texture feature extraction branch extracts interface environment features of multiple regions of interest frames and predicts the oil leakage and penetration stage based on the interface environment features; the geometric feature extraction branch extracts jet morphology features of multiple regions of interest frames and predicts the oil leakage and puncture stage based on the jet morphology features; and the physical feature extraction branch extracts flow reflection features of multiple regions of interest frames and predicts the oil leakage and flow stage based on the flow reflection features. Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, and the oil leakage flow stage, the oil leakage detection results of the target location are obtained.

2. The oil leak detection method according to claim 1, characterized in that, The acquisition of multiple image frames at different acquisition times from the oil extraction equipment includes the steps of acquiring image frames and adjusting the acquisition field of view. The step of acquiring image frames includes: acquiring the current image frame of the oil production equipment with the current acquisition field of view; The steps for adjusting the acquisition field of view include: The suspected oil leakage stage is determined based on the pixel grayscale features of the current image frame. The suspected oil leakage stage is at least one of the suspected seepage stage, suspected puncture stage, and suspected flow stage. Based on the judgment result of the suspected oil leak stage, the current acquisition field of view is changed; Using the changed current acquisition field of view as the current acquisition field of view for the next image frame, the steps of acquiring the image frame and adjusting the acquisition field of view are repeated until multiple image frames at different acquisition times are obtained.

3. The oil leak detection method according to claim 2, characterized in that, The steps for adjusting the acquisition field of view include: When the pixel grayscale feature indicates that the pixel grayscale change is less than the preset grayscale change threshold and the contour feature extracted from the current image frame does not meet the preset conditions, the current image frame is determined to be in the suspected penetration stage, the current acquisition field of view is adjusted to the telephoto field of view, and the lens focal length is adjusted to the first focal length. When the pixel grayscale feature indicates that the pixel grayscale change is greater than or equal to a preset grayscale change threshold and is directional, the current image frame is determined to be in the suspected leakage stage. The current acquisition field of view is adjusted to a telephoto field of view, and the lens focal length is adjusted to a second focal length, which is less than the first focal length. When there is a dark area in the pixel grayscale feature representing the ground area and the area of ​​the dark area is greater than a preset area threshold, the current image frame is determined to be in the suspected flowing stage, and the current acquisition field of view is adjusted to a wide-angle field of view.

4. The oil leak detection method according to claim 1, characterized in that, The method further includes the step of obtaining the oil leak detection model by training the model to be trained, and the step of obtaining the oil leak detection model by training the model to be trained includes: Based on the oil leak detection results output by the model to be trained for the input image frame, the category probability is obtained; When the category probability is less than a preset probability value, the loss function value is calculated using the following formula: in, Category weights; This is a unique hot tag; For class probabilities; C is the focus parameter; C is the set of categories; This represents the loss function value.

5. The oil leak detection method according to any one of claims 1 to 4, characterized in that, The interface environment features include texture variation features. The step of extracting interface environment features from multiple frames of the region of interest through the texture feature extraction branch and predicting the oil leakage / penetration stage based on the interface environment features includes: Directional filtering is performed on the frame of the region of interest to obtain texture variation features in different directions; When the texture change feature represents a change in the texture of the target area, the oil leakage and penetration stage is predicted for the region of interest frame. The prediction of the oil leakage and penetration stage for the region of interest frame includes: The texture entropy is calculated based on the pixel grayscale distribution of the frame in the region of interest, and the target area is determined to be in the penetration stage based on the calculation result of the texture entropy.

6. The oil leak detection method according to any one of claims 1 to 4, characterized in that, The jet morphology features include fluid edge features and edge initiation features. The step of extracting jet morphology features from multiple frames of interest through the geometric feature extraction branch and predicting the oil leak / puncture stage based on the jet morphology features includes: Edge detection is performed on the region of interest frame to obtain fluid edge features and edge initiation features; The fluid detection results are obtained based on the changes in fluid edge features and edge origin features in adjacent frames of interest. Based on the fluid detection results, the oil leakage and puncture stage can be predicted; The prediction of the oil leak / puncture stage based on the fluid detection results includes: When the fluid detection results indicate that the fluid is in a strip-like shape and originates from the target area, the target area is determined to be in the puncture and leakage stage.

7. The oil leak detection method according to any one of claims 1 to 4, characterized in that, The step of extracting flow reflection features from multiple frames of interest through the physical feature extraction branch includes: The region of interest frame is processed based on the bidirectional reflectance distribution function to obtain specular reflectance bright spots; Calculate the motion vector field of adjacent region of interest frames, and filter out oil drop features from the motion vector field; The static background of the region of interest frame is removed by background subtraction to obtain the oil extension region; The prediction of the oil spill flow stage based on the flow reflection characteristics includes: Based on time-series analysis, the changes in the specular reflection bright spots, the oil falling characteristics, and the oil expansion area in multiple consecutive region of interest frames corresponding to the target location are determined to obtain the liquid phase detection results. When the liquid phase detection results indicate that the specular reflection bright spot continues to flash, the oil droplet falling characteristic is stable downward, and the oil expansion area continues to expand, it is determined that the target location is in the flow stage.

8. The oil leak detection method according to claim 7, characterized in that, After processing the region of interest frame based on the bidirectional reflectance distribution function to obtain specular reflection highlights, the method further includes: The specular reflection bright spots are filtered based on the classification threshold determined by the collected environmental data.

9. The oil leak detection method according to any one of claims 1 to 4, characterized in that, The oil leak detection model also includes an edge feature extraction branch; The method further includes: The edge feature extraction branch extracts edge features from multiple frames of the region of interest and predicts the oil dripping stage based on the edge features; The oil leakage detection results at the target location are obtained based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, and the oil leakage flow stage, including: Based on the prediction results of the oil leakage penetration stage, the oil leakage puncture stage, the oil leakage flow stage, and the oil leakage dripping stage, the oil leakage detection results of the target location are obtained. The step of extracting edge features from multiple frames of the region of interest through the edge feature extraction branch and predicting the oil dripping stage based on the edge features includes: When the edge of the target object near the target location characterized by the edge feature is teardrop-shaped and / or spherical, and the teardrop-shaped and / or spherical target object appears periodically, the target location is determined to be in the dripping stage.

10. The oil leak detection method according to any one of claims 1 to 4, characterized in that, At least one of the oil extraction devices exists within the image frame. The process of performing region detection on the target location within the plurality of image frames to obtain multiple regions of interest frames corresponding to the target location includes: The image frames are subjected to target detection of oil production equipment, and the area where the oil production equipment is located is magnified at multiple scales to obtain multiple images to be analyzed; Based on the proportion of the maximum bounding box of the oil production equipment in the image to be analyzed, multiple images to be analyzed are filtered to obtain multiple valid images; Target detection is performed on the target parts within the maximum bounding box of the oil production equipment in each valid image to obtain multiple regions of interest frames corresponding to the target parts.

11. The oil leak detection method according to any one of claims 1 to 4, characterized in that, After obtaining the oil leak detection results at the target location, the method further includes: An alarm signal is issued when the oil leak detection results of consecutive region of interest frames within a preset time window all indicate an oil leak.

12. An oil leak detection device, characterized in that, The device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the oil leak detection method as described in any one of claims 1-11.