Top drive drilling anomaly detection method and system based on machine vision

By introducing image feature difference analysis into the non-local mean filtering algorithm and optimizing weight calculation, the problem of existing algorithms ignoring the difference in image information is solved, and the denoising accuracy of top-drive drilling operation images and the accuracy of drilling detection are significantly improved.

CN119991674AActive Publication Date: 2025-05-13BAOJI RUIHE MASCH MFG CO LTD

Patent Information

Application Number
CN202510473367.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-05-13
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

The existing non-local mean filtering algorithm ignores the difference in image information expressed by neighboring blocks and reference blocks during image denoising, resulting in unreasonable weight calculations, affecting the accuracy of filtering results, and thus reducing the denoising effect of top drive drilling operation images and the accuracy of drilling detection.

Method used

By introducing image feature difference analysis, the weight calculation of the non-local mean filtering algorithm is optimized, the difference in noise performance and position importance of neighboring blocks and reference blocks is taken into account, and the filter weight is adjusted to make it more accurately reflect the true structure of the image.

Benefits of technology

It significantly improves the denoising accuracy of the top drive drilling operation images, enhances the clarity of the image, provides more reliable image data support for subsequent abnormality detection, improves the accuracy of drilling phenomenon detection, and ensures the smooth progress of top drive drilling operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991674A_ABST
    Figure CN119991674A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to a top drive drilling anomaly detection method and system based on machine vision. The method comprises the following steps: acquiring gray values of all pixel points in a current operation image of the top drive drilling well in real time; constructing a reference block of each pixel point, marking any pixel point as a target pixel point, marking the reference block of the target pixel point as a target block, and selecting a plurality of reference blocks as neighborhood blocks of the target block; determining a noise value of the neighborhood block; determining the importance degree of the target pixel point; determining a weight optimization factor and an optimization weight of the neighborhood block; and de-noising the current operation image by using a non-local mean filtering algorithm, and carrying out anomaly detection through the trained deep learning model. According to the method, the image feature difference analysis between the neighborhood block and the reference block is introduced, and the weight calculation of the non-local mean filtering algorithm is optimized, so that the de-noising precision of the operation image of the top drive well drilling can be remarkably improved, and the accuracy of anomaly detection is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a top drive drilling anomaly detection method and system based on machine vision. Background Art

[0002] In the modern oil and gas extraction industry, drilling operations are the core link in the entire exploration and production process. With the increase in global energy demand, drilling operations are becoming more and more in-depth and complex, especially in extreme environments and high-risk operating conditions. It is particularly important to ensure the safety and efficiency of operations. In the drilling process, drill bit sticking is a common abnormality, which is usually manifested as the drill string cannot drill normally. When detecting drill bit sticking during top drive drilling operations, since the environment at the drilling site is often full of pollutants such as dust and smoke, the image data of top drive drilling equipment is often affected by environmental noise, resulting in poor image quality, which in turn affects the accuracy of the anomaly detection system; therefore, denoising the collected images is a key step to ensure anomaly detection. An existing method for denoising images in top drive drilling operations is a non-local mean filtering algorithm. The non-local mean filtering algorithm is used to denoise the images collected during the top drive drilling operation, which not only improves the quality of the operation image, but also improves the accuracy of the drill bit sticking detection. At the same time, it has important social significance in terms of operation safety, efficiency and cost control.

[0003] However, when the non-local mean filtering algorithm denoises an image, it will establish a reference block for each pixel and search for several blocks similar to the reference block in the entire image. Subsequently, the filtering results of the pixels are weighted according to all the neighborhood blocks. In the specific analysis process, the distance and similarity between each neighborhood block and the reference block will be used as its weight, and the quantification of the similarity is based on the difference in gray value performance and noise performance. However, in this process, the influence of the difference in image information expressed by the neighborhood block and the reference block on the weight is ignored. That is, if a neighborhood block has a large weight obtained by the similarity and Euclidean distance analysis obtained by the existing method, but the image information expressed by the reference block or the image area where the reference block is located is large, the neighborhood block should not have a large weight, and the influence of the neighborhood block on the filtering result of the pixel being filtered should be appropriately reduced. Therefore, the existing method may reduce the accuracy of the filtering result of each pixel being filtered, resulting in the denoising result of the entire top drive drilling operation image, thereby reducing the accuracy of the subsequent detection of the stuck drill phenomenon. Summary of the invention

[0004] In order to solve the problem that the quantification of similarity of the non-local mean filtering algorithm is based on the difference in gray value expression and noise expression, while ignoring the influence of the difference in image information expressed by the neighborhood block and the reference block on the weight, the accuracy of the filtering result of each pixel point filtered by the non-local mean filtering algorithm is reduced, resulting in affecting the denoising result of the entire top drive drilling operation image, thereby reducing the accuracy of subsequent detection of the stuck pipe phenomenon, the present invention provides a top drive drilling anomaly detection method and system based on machine vision.

[0005] In a first aspect, the present invention provides a top drive drilling anomaly detection method based on machine vision, which adopts the following technical solution: The grayscale values ​​of all pixels in the current operation image of top drive drilling are obtained in real time; a reference block of each pixel is constructed with each pixel as the center and a preset length as the side length, any pixel is recorded as a target pixel, and the reference block of the target pixel is recorded as the target block. Based on the difference in the grayscale mean values ​​of the remaining reference blocks and the pixels in the target block, multiple reference blocks are selected as neighborhood blocks of the target block, and the noise value of the neighborhood block is determined according to the extreme difference and sub-extreme difference of the grayscale values ​​of the pixels in the neighborhood block; based on the change of the grayscale values ​​of the neighboring pixels of the target pixel in several operation images before the current operation image, the pixel line of the target pixel and multiple reference points of the target pixel are obtained, and the target pixel line is obtained according to the grayscale value difference between the target pixel and the current operation image. The importance of the target pixel is determined by the average of the absolute difference in the grayscale values ​​of the corresponding pixels in several previous job images and the difference in the length of the pixel line between the target pixel and each reference point; the average of the importance of all pixels in the reference block is recorded as the position importance of the reference block; the weight optimization factor of the neighborhood block is determined according to the position importance of the target pixel and the noise value and position importance of the neighborhood block; the optimization weight of the neighborhood block is determined according to the weight optimization factor and the Euclidean distance from the neighborhood block to the target block; based on the optimization weight, the current job image is denoised using a non-local mean filtering algorithm, and then the denoised current job image is subjected to anomaly detection through the trained deep learning model.

[0006] The present invention introduces image feature difference analysis between neighborhood blocks and reference blocks and optimizes weight calculation of non-local mean filtering algorithm, which can significantly improve the denoising accuracy of top drive drilling operation images; the traditional non-local mean filtering algorithm only calculates weights based on gray value similarity and Euclidean distance, ignores the difference in image information expressed by neighborhood blocks and reference blocks, resulting in unreasonable weighting, which in turn affects the accuracy of filtering results, while by considering the difference in noise performance and position importance between neighborhood blocks and reference blocks, not only can the real structure of the operation image be reflected more accurately, but also the weight of irrelevant neighborhood blocks can be reasonably reduced, thereby improving the filtering effect; the calculation method of optimizing weights can adjust the filtering weights according to the actual influence of each neighborhood block, so that the denoising effect of the image is more ideal, thereby providing more reliable image data support, improving the accuracy of pipe jamming detection, and ensuring the smooth progress of top drive drilling operations.

[0007] Furthermore, the neighborhood block is obtained by sorting the remaining reference blocks according to the grayscale mean difference between the reference blocks and the target blocks, and selecting multiple reference blocks as the neighborhood blocks of the target block in ascending order.

[0008] Furthermore, the noise value satisfies: ; In the formula, Pixel The reference block The noise value of the neighborhood blocks, Pixel The reference block The extreme difference of the gray value of the pixel in the neighborhood block is Pixel The reference block The second extreme difference of the gray value of the pixel in the neighborhood block, is the first hyperparameter.

[0009] The present invention combines the extreme difference and sub-extreme difference of the gray value in the neighborhood block, which can more accurately measure the impact of noise on the target pixel point and effectively capture the subtle noise changes in the image, thereby providing a more powerful basis for subsequent denoising processing.

[0010] Furthermore, the secondary extreme value is the difference between the maximum value and the minimum value in the remaining grayscale values ​​after removing the pixel points corresponding to the grayscale extreme value in the neighborhood block.

[0011] Furthermore, the pixel line of the target pixel point and the multiple reference points of the target pixel point are obtained in the following manner: extending to the left and right sides with the target pixel point as the center, terminating the extension on this side in response to the grayscale values ​​of the multiple consecutive pixel points on the left and right sides and the corresponding pixel points in the several working images between them being the same, and when the extensions on both sides are terminated, the pixel line of the target pixel point is formed by the target pixel point and the extended pixel points; in response to the grayscale values ​​of the upper and lower sides of the target pixel point, If the number of pixel points contained in the plurality of consecutive pixel lines is less than the preset number in the pixel lines of the plurality of pixel points, the pixel points corresponding to the first pixel line in the plurality of consecutive pixel lines are The sequence number of the pixels is recorded as , the target pixel point on this side pixels and the other side pixels as reference points, where The preset number of pixels.

[0012] Furthermore, the importance satisfies: ; In the formula, Pixel The importance of Pixel The average of the absolute differences in the grayscale values ​​of the corresponding pixels in several job images before the current job image, Pixel The number of reference points, Pixel The length of the pixel line, Pixel No. The length of the target reference pixel line, is the standard normalization function, is the absolute value symbol.

[0013] The importance calculation of the present invention is not only based on the grayscale value difference between the current pixel point and the corresponding pixel point in the previous operation image, but also introduces the structural information of the pixel line, which is helpful to extract more accurate information and enhance the image denoising effect; by introducing the number of reference points and the length corresponding to the pixel line of the reference point, it can flexibly adapt to the image characteristics in different scenes, so that the calculation of the importance can be adjusted for complex drilling scenes, and different pixel lines of reference points will affect the final result in different situations; by calculating the importance of each pixel point and effectively applying it to the subsequent filtering and anomaly detection process, it can better emphasize those pixels that have a significant impact or are sensitive to the target state change, thereby improving the accuracy and sensitivity of detection; by fully considering the correlation between the image information at the previous moment and the current state in the importance calculation, the non-local mean filtering algorithm can more effectively denoise and identify anomalies when processing images, thereby improving the quality of the overall operation image.

[0014] Furthermore, the weight optimization factor satisfies: ; In the formula, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block The noise value of the neighborhood blocks, Pixel The position importance of the reference block, Pixel The reference block The position importance of the neighboring blocks, is the second hyperparameter, is the natural exponential function, is the absolute value symbol.

[0015] The calculation of the weight optimization factor of the present invention takes into account the difference between the noise value and the position importance at the same time, ensuring that in the case of large noise, weighting is performed according to the importance of the reference block and the neighborhood block, thereby improving the filtering effect; by using the form of a natural exponential function, the weight optimization factor given can not only reflect the noise characteristics of the neighborhood block, but also dynamically adjust the weight of the neighborhood block, depending on its relationship with the target pixel, so that it is more flexible and adaptable when denoising; when the position importance of the neighborhood block is low, the weight optimization factor will reduce its influence, thereby effectively suppressing the interference to abnormal or unimportant areas during the denoising process, and improving the overall image quality.

[0016] Furthermore, the optimization weights satisfy: ; In the formula, Pixel The reference block The optimization weights of the neighborhood blocks, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block Neighborhood blocks and pixels The Euclidean distance of the reference block, Pixel The number of neighboring blocks of the reference block, is a natural exponential function.

[0017] The optimization weight of the present invention provides a relative importance for each neighborhood block. Based on its noise characteristics and the Euclidean distance from the target pixel block, this relative weight improves the accuracy of information fusion and makes the image denoising process more effective. By combining the weight optimization factor of the neighborhood block with the Euclidean distance, the interference of the neighborhood block far away from the target pixel on the final judgment can be effectively reduced. The importance of the farther neighborhood block will be automatically reduced in the weight calculation, ensuring that the pixels closer to the target have a greater influence. By using the local features of the neighborhood block, the optimization weight can effectively retain the local information of the image and avoid the feature loss caused by denoising, so as to better identify abnormal phenomena in subsequent abnormality detection.

[0018] Furthermore, the deep learning model adopts a CNN model.

[0019] In a second aspect, the present invention provides a top drive drilling anomaly detection system based on machine vision, which adopts the following technical solutions: A top drive drilling anomaly detection system based on machine vision comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the top drive drilling anomaly detection method based on machine vision is implemented.

[0020] By adopting the above technical solution, the above-mentioned top drive drilling anomaly detection method based on machine vision is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made according to the memory and the processor for easy use.

[0021] The present invention has the following technical effects: (1) The similarity quantification of the traditional non-local mean filtering algorithm is only based on the grayscale value performance and noise performance differences. The present invention not only considers the grayscale mean difference between the pixels in the neighborhood block and the reference block to select the neighborhood block, but also determines the noise value according to the extreme difference and sub-extreme difference of the grayscale value of the pixels in the neighborhood block. At the same time, the importance of the target pixel is determined based on the grayscale value change of the target pixel in the current and previous working images, the length difference between the pixel line of the target pixel and the pixel line of the reference point, etc., and then the position importance of the target block is obtained. By comprehensively considering the above indicators, the weight determination is more reasonable, avoiding ignoring the influence of image information differences on the weight, thereby improving the accuracy of the filtering result of each pixel point by the non-local mean filtering algorithm.

[0022] (2) Since the weight calculation of the neighborhood blocks is optimized, a more reasonable optimization weight is obtained. Based on this, the non-local mean filtering algorithm is used to denoise the current job image. Compared with the traditional method, it can remove noise more effectively, improve the denoising quality of the job image, make the image clearer, and provide a better image basis for subsequent anomaly detection.

[0023] (3) High-quality denoising results help the deep learning model to analyze top drive drilling operation images more accurately, thereby improving the accuracy of detecting abnormal situations such as pipe sticking. It can detect abnormalities in the top drive drilling process more timely and accurately, providing strong support for ensuring the safety and smooth progress of drilling operations, and reducing production accidents and economic losses caused by untimely detection of abnormal situations.

[0024] (4) By considering the change in the grayscale value of the target pixel in the time dimension (the current working image and the previous working image) and the relationship between the pixel line of the target pixel and the pixel line of the reference point, the implicit information in the image is fully mined, and the importance of the pixel is evaluated from multiple angles, making the algorithm's processing of the image more in line with the actual situation, thereby improving the algorithm's performance and adaptability to complex images. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a method flow chart of a top drive drilling anomaly detection method based on machine vision in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] The embodiment of the present invention discloses a top drive drilling anomaly detection method based on machine vision, referring to Figure 1 , comprising steps S1 to S6: S1: Real-time acquisition of the grayscale values ​​of all pixels in the current operation image of top drive drilling.

[0028] The present invention collects the top drive drilling operation image in real time through a high-definition camera, then performs grayscale processing on each frame of the image to obtain a grayscale image of the top drive drilling operation image, and further obtains the grayscale value of each pixel point.

[0029] S2: construct a reference block for each pixel, record any pixel as a target pixel, record the reference block of the target pixel as a target block, and select multiple reference blocks as neighborhood blocks of the target block.

[0030] A reference block for each pixel is constructed with each pixel as the center and a preset length as the side length. Based on the difference in grayscale mean values ​​between the remaining reference blocks and the pixels in the target block, multiple reference blocks are selected as neighborhood blocks of the target block.

[0031] Implementers can set the side length and the number of neighborhood blocks according to specific implementation situations. For example, if the side length is 7×7 and there are less than 7 pixels on one side of the pixel location, the number of pixels is padded from the opposite side; the number of neighborhood blocks is 10.

[0032] Specifically, the neighborhood block is obtained in the following manner: The remaining reference blocks are sorted according to the difference in the grayscale mean value of the pixels in the reference block and the target block, and multiple reference blocks are selected from small to large order as the neighborhood blocks of the target block.

[0033] S3: Determine the noise value of the neighborhood block.

[0034] It should be noted that in this step, the grayscale value performance of the pixels in each neighborhood block of the reference block of each pixel point will be analyzed to obtain the noise value of each neighborhood block of each pixel point reference block. The noise value is calculated because the grayscale value of the noise pixel point is more prominent and its position is more random. Therefore, the greater the range of the grayscale value in each neighborhood block of the reference block of each pixel point, the greater the possibility of the existence of noise pixels, and the larger the corresponding noise value; however, the large range of the grayscale value in a neighborhood block may also be due to the large change in the grayscale value actually occurring in its area. Therefore, the difference between the sub-extreme difference and the extreme difference after removing the maximum and minimum values ​​in the grayscale value in each neighborhood block of the reference block of each pixel point can be further analyzed. If the difference is larger, it means that the pixel point with more extreme grayscale value in this neighborhood block has a greater credibility in the form of a single pixel point, then it can be explained that the reason why the range of the grayscale value in this neighborhood block is larger is that it is more likely to be affected by noise, and the corresponding noise value of this neighborhood block is larger.

[0035] The noise value of the neighborhood block is determined according to the extreme difference and sub-extreme difference of the grayscale values ​​of the pixels in the neighborhood block.

[0036] Specifically, the noise value satisfies: ; In the formula, Pixel The reference block The noise value of the neighborhood blocks, Pixel The reference block The extreme difference of the gray value of the pixel in the neighborhood block is Pixel The reference block The second extreme difference of the gray value of the pixel in the neighborhood block, is the first hyperparameter.

[0037] The implementer can set the value of the first hyperparameter according to the specific implementation situation, for example, 0.01. The first hyperparameter exists to prevent This makes the calculation result meaningless.

[0038] in, The larger the pixel The reference block The greater the possibility that there are pixels with relatively extreme gray values ​​in the neighborhood block, the greater the probability that the pixel The reference block The greater the possibility of the existence of noise pixels in a neighborhood block, the greater the corresponding noise intensity; in the formula The larger the pixel The reference block The more extreme the grayscale value of a pixel in a neighborhood block is, the more reliable it is that it appears as a single pixel. The greater the gray value range within a neighborhood block, the more likely it is to be affected by noise. The noise value of each neighborhood block is larger.

[0039] Specifically, the secondary extreme value is the difference between the maximum value and the minimum value in the remaining grayscale values ​​after removing the pixel points corresponding to the grayscale extreme value in the neighborhood block.

[0040] S4: Determine the importance of the target pixel.

[0041] It should be noted that in order to make the filtering results of each pixel being filtered more accurate, when finally determining the filtering weights corresponding to each neighborhood block of each pixel's reference block, it is also necessary to analyze the differences in the positional importance of each pixel's reference block and the positional importance of each neighborhood block of each pixel's reference block; when analyzing the above indicators, the importance of a pixel can be calculated first, and then the positional importance of each pixel's reference block and each neighborhood block of each pixel's reference block can be obtained by calculating the average of the importance of all pixels in each pixel's reference block and each neighborhood block of each pixel's reference block.

[0042] It should also be noted that before calculating the importance of each pixel point, it is necessary to make it clear that the core of the detection of the stuck drill bit in top drive drilling is the analysis of the drill string area. Therefore, compared with the pixels in other areas, the filtering of the pixels in the drill string area should have a more precise filtering accuracy, otherwise the subsequent detection of the stuck drill bit will be more affected; therefore, it is necessary to analyze the possibility of each pixel point being located in the drill string area, that is, to quantify its importance factor, and based on this, obtain the position importance of the reference block of each pixel point and its neighborhood block, which can make the filtering of the pixels in the drill string area more detailed and accurate. Since the drill string is in motion when working, when analyzing the importance of each pixel, the more obvious the difference in the grayscale value at the corresponding position of each pixel in multiple consecutive frames, the greater the possibility that it belongs to the drill string area, and the greater the corresponding importance; however, in actual scenes, there are not only moving objects such as drill strings, so it is necessary to quantify the characteristics of the drill string area in more detail; since the drill string is usually a cylinder, it will have a highly consistent width when reflected in the image, so the length of the pixel line composed of pixels with grayscale changes in the horizontal direction (left and right sides) of a pixel in continuous frames is more consistent with the length of the pixel line of the adjacent pixels on the upper and lower sides of the pixel, indicating that the horizontal direction of this pixel and the upper and lower adjacent horizontal directions The pixels with grayscale changes in continuous frames are all The credibility is greater, and then the possibility that this pixel belongs to the drill string area is greater, and its importance is greater.

[0043] Based on the change of the grayscale values ​​of the neighboring pixels of the target pixel in several working images before the current working image, the pixel line of the target pixel and the multiple reference points of the target pixel are obtained.

[0044] The implementer can set the number of several working images and the number of multiple target reference pixel lines according to the specific implementation situation. For example, the previous working image is 5 frames. The first 5 frames of working images collected are only used as reference working images and no calculation processing is performed; the number of target reference pixel lines is 10.

[0045] Specifically, the target pixel line and multiple target reference pixel lines of the target pixel point are obtained as follows: The pixel line of the target pixel point and the multiple reference points of the target pixel point are obtained in the following manner: Extending to the left and right sides with the target pixel as the center, in response to the grayscale values ​​of a plurality of consecutive pixels (for example, 5 pixels) in the pixels on the left and right sides being the same as the corresponding pixels in a number of working images (working images 5 consecutive frames ago) between them, terminating the extension on this side (when terminating, the pixels extended on this side do not include the above 5 pixels. If the termination condition is not met all the time, the pixel points located at the boundary in the working image are extended and automatically terminated). When the extension on both sides is terminated, the pixel line of the target pixel is formed by the target pixel and the extended pixel points; In response to the target pixel point on either side of the upper or lower side In the pixel lines of the pixel points, the number of pixel points contained in the plurality of consecutive pixel lines is less than a preset number (exemplarily, the preset number is 20), and the pixel point corresponding to the first pixel line in the plurality of consecutive pixel lines (exemplarily, 3 consecutive pixel lines) is The sequence number of the pixels is recorded as , the target pixel point on this side pixels and the other side pixels as reference points, where is a preset number of pixels (exemplarily, ).

[0046] The importance of the target pixel is determined according to the average of the absolute differences in grayscale values ​​between the target pixel and corresponding pixels in several working images before the current working image, and the difference in the length of the pixel line between the target pixel and each reference point.

[0047] Specifically, the importance satisfies: ; In the formula, Pixel The importance of Pixel The average of the absolute differences in the grayscale values ​​of the corresponding pixels in several job images before the current job image, Pixel The number of reference points, Pixel The length of the pixel line, Pixel No. The length of the target reference pixel line, is the standard normalization function, is the absolute value symbol.

[0048] In the formula, The larger the pixel The more obvious the difference in grayscale values ​​at the corresponding position in consecutive frames is, the more likely it is to belong to the drill string area, and the greater the corresponding importance; The smaller the pixel The greater the confidence, the more pixels with grayscale changes in the left and right directions and the upper and lower adjacent horizontal directions belong to the drill string area. The more obvious the difference in the grayscale values ​​at the corresponding position in the continuous frames, the greater the credibility. The greater the possibility of belonging to the drill string area, the greater the corresponding importance.

[0049] It should be noted that after obtaining the importance of each pixel, the average importance of all pixels in the reference block of each pixel can be used to obtain the position importance of the reference block of each pixel, and the average importance of all pixels in each neighborhood block of the reference block of each pixel can be used to obtain the position importance of each neighborhood block of the reference block of each pixel.

[0050] The average importance of all pixels in the reference block is recorded as the position importance of the reference block.

[0051] S5: Determine the weight optimization factor and optimization weight of the neighborhood block.

[0052] It should be noted that the lower the noise value of each neighborhood block of the reference block of each pixel point, the stronger its corresponding reliability, then the larger the corresponding filtering weight of the neighborhood block when weighted calculating the filtering result of the pixel point being filtered, the smaller the difference between the position importance of each neighborhood block of the reference block of each pixel point and the position importance of the reference block to which it belongs, the stronger the consistency of the image information expressed by the reference block and its neighborhood block, and the greater the credibility that the two are located in the same area of ​​the image, then the larger the corresponding filtering weight of the neighborhood block when weighted calculating the filtering result of the pixel point being filtered; therefore, the weight optimization factor of the neighborhood block is calculated in combination with the noise value and the position importance.

[0053] The weight optimization factor of the neighborhood block is determined according to the position importance, and the noise value and position importance of the neighborhood block.

[0054] Specifically, the weight optimization factor satisfies: ; In the formula, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block The noise value of the neighborhood blocks, Pixel The position importance of the reference block, Pixel The reference block The position importance of the neighboring blocks, is the second hyperparameter, is the natural exponential function, is the absolute value symbol.

[0055] The implementer can set the second hyperparameter according to the specific implementation situation, for example, 0.001. The second hyperparameter exists to prevent This makes the calculation result meaningless.

[0056] It should be noted that the larger the weight optimization factor of each neighborhood block of the reference block of each pixel point, the larger the corresponding optimized filtering weight (i.e., optimization weight), and the smaller the Euclidean distance between each neighborhood block of the reference block of each pixel point and the reference block to which it belongs, the greater its reference value for the filtering result of the pixel point being filtered, and the larger the corresponding optimized filtering weight; therefore, after obtaining the weight optimization factor of each neighborhood block of the reference block of each pixel point, the optimized filtering weight of each neighborhood block of the reference block of each pixel point is calculated in combination with the Euclidean distance between each neighborhood block of the reference block of each pixel point and the reference block (i.e., the Euclidean distance between the central pixels of the two blocks).

[0057] The optimization weight of the neighborhood block is determined according to the weight optimization factor and the Euclidean distance from the neighborhood block to the target block.

[0058] Specifically, the optimization weights satisfy: ; In the formula, Pixel The reference block The optimization weights of the neighborhood blocks, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block Neighborhood blocks and pixels The Euclidean distance of the reference block, Pixel The number of neighboring blocks of the reference block, is a natural exponential function.

[0059] S6: Use the non-local mean filtering algorithm to denoise the current job image, and then perform anomaly detection through the trained deep learning model.

[0060] Based on the optimized weights, the current job image is denoised using a non-local mean filtering algorithm, and then anomaly detection is performed on the denoised current job image using a trained deep learning model.

[0061] It should be noted that the deep learning model is trained using an image dataset containing normal drilling operations and stuck drill phenomena to learn the characteristics of the stuck drill phenomenon. The denoised current operation images of top drive drilling are then screened and identified. When an abnormality is identified, an early warning prompt is issued to notify relevant technicians to perform maintenance.

[0062] Specifically, the deep learning model adopts a CNN model.

[0063] An embodiment of the present invention also discloses a top drive drilling anomaly detection system based on machine vision, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a top drive drilling anomaly detection method based on machine vision according to the present invention is implemented.

[0064] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0065] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A top drive drilling anomaly detection method based on machine vision, characterized in that: include: Real-time acquisition of the grayscale values ​​of all pixels in the current operation image of top drive drilling; Taking each pixel as the center and a preset length as the side length, a reference block of each pixel is constructed, any pixel is recorded as a target pixel, and the reference block of the target pixel is recorded as the target block. Based on the difference in the grayscale mean values ​​of the remaining reference blocks and the pixels in the target block, multiple reference blocks are selected as neighborhood blocks of the target block, and the noise value of the neighborhood block is determined according to the extreme difference and sub-extreme difference of the grayscale values ​​of the pixels in the neighborhood block; based on the change in the grayscale values ​​of the neighboring pixels of the target pixel in several working images before the current working image, the pixel line of the target pixel and multiple reference points of the target pixel are obtained, and the importance of the target pixel is determined according to the average of the absolute difference in the grayscale values ​​of the corresponding pixels in several working images before the current working image and the difference in the length of the pixel line between the target pixel and each reference point; the average of the importance of all pixels in the reference block is recorded as the position importance of the reference block; the weight optimization factor of the neighborhood block is determined according to the position importance of the target pixel, and the noise value and position importance of the neighborhood block; Determine the optimization weight of the neighborhood block according to the weight optimization factor and the Euclidean distance from the neighborhood block to the target block; Based on the optimized weights, the current job image is denoised using a non-local mean filtering algorithm, and then anomaly detection is performed on the denoised current job image using a trained deep learning model.

2. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The neighborhood block is obtained in the following manner: The remaining reference blocks are sorted according to the difference in the grayscale mean value of the pixels in the reference block and the target block, and multiple reference blocks are selected from small to large order as the neighborhood blocks of the target block.

3. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The noise value satisfies: ; In the formula, Pixel The reference block The noise value of the neighborhood blocks, Pixel The reference block The extreme difference of the gray value of the pixel in the neighborhood block is Pixel The reference block The second extreme difference of the gray value of the pixel in the neighborhood block, is the first hyperparameter.

4. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1 or 3, characterized in that: The secondary extreme value is the difference between the maximum value and the minimum value in the remaining grayscale values ​​after removing the pixel points corresponding to the grayscale extreme value in the neighborhood block.

5. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The pixel line of the target pixel point and the multiple reference points of the target pixel point are obtained in the following manner: Extending to the left and right sides with the target pixel as the center, in response to the grayscale values ​​of a plurality of consecutive pixels on the left and right sides being the same as the corresponding pixels in the several working images between them, terminating the extension on that side, and when the extension on both sides is terminated, the pixel line of the target pixel is formed by the target pixel and the extended pixels; In response to the target pixel point on either side of the upper or lower side If the number of pixel points contained in the plurality of consecutive pixel lines is less than the preset number in the pixel lines of the plurality of pixel points, the pixel points corresponding to the first pixel line in the plurality of consecutive pixel lines are The sequence number of the pixels is recorded as , the target pixel point on this side pixels and the other side pixels as reference points, where The preset number of pixels.

6. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The importance meets the following requirements: ; In the formula, Pixel The importance of Pixel The average of the absolute differences in the grayscale values ​​of the corresponding pixels in several job images before the current job image, Pixel The number of reference points, Pixel The length of the pixel line, Pixel No. The length of the target reference pixel line, is the standard normalization function, is the absolute value symbol.

7. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The weight optimization factor satisfies: ; In the formula, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block The noise value of the neighborhood blocks, Pixel The position importance of the reference block, Pixel The reference block The position importance of the neighboring blocks, is the second hyperparameter, is the natural exponential function, is the absolute value symbol.

8. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The optimization weights satisfy: ; In the formula, Pixel The reference block The optimization weights of the neighborhood blocks, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The reference block Neighborhood blocks and pixels The Euclidean distance of the reference block, Pixel The number of neighboring blocks of the reference block, is a natural exponential function.

9. The method for detecting abnormalities in top drive drilling based on machine vision according to claim 1, characterized in that: The deep learning model adopts the CNN model.

10. The top drive drilling anomaly detection system based on machine vision is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the top drive drilling anomaly detection method based on machine vision according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Profile contour detection method and system based on machine vision

    CN116777941A

  • Video image transmission quality enhancement method and system

    CN117408890A

  • Ultrasonic image processing method based on image enhancement

    CN117649357A

  • Road vehicle dangerous behavior identification method and system based on attention neural network

    CN117935177A

  • Visual inspection system for animal husbandry and veterinary medicine

    CN118096735A

Cited By

  • Measurement-while-drilling image acquisition and processing system and method

    CN120676257A

  • Vacuum degree monitoring method and system for refrigerator vacuumizing

    CN120740850A

  • A vacuum degree monitoring method and system for a refrigerator vacuumization

    CN120740850B