Machine Vision-Based Top Drive Drilling Abnormality Detection Method and System
By optimizing the weight calculation of the non-local mean filtering algorithm and considering the difference in image characteristics, the problem of ignoring the difference in image information during the denoising process in the prior art is solved, and the denoising accuracy of top-drive drilling operation images and the accuracy of drilling detection are improved.
Patent Information
- Application Number
- CN202510473367.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-04-16
AI Technical Summary
In the denoising process, the non-local mean filtering algorithm ignores the difference in image information expressed by neighboring blocks and reference blocks, resulting in a decrease in the accuracy of the filtering result, affecting the denoising effect of the top drive drilling operation image and the accuracy of the drilling detection.
By introducing image feature difference analysis, the weight calculation of the non-local mean filtering algorithm is optimized, the noise performance and position importance differences between neighboring blocks and reference blocks are taken into account, and the filter weight is adjusted to reflect the image structure more accurately.
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, and improves the accuracy of drilling phenomenon detection.
Smart Images

Figure CN119991674B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and particularly 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 a core part of the entire exploration and extraction process. With the increasing global energy demand, drilling operations are becoming deeper and more complex. Especially in extreme environments and high-risk operating conditions, ensuring the safety and efficiency of operations becomes particularly important. During the drilling process, sticking of the drill string is a common abnormal situation, usually manifested as the drill string being unable to drill normally. When detecting sticking during top drive drilling operations, due to the drilling site environment often being filled with pollutants such as dust and smoke, the image data of the 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. There is an existing method for denoising images of top drive drilling operations, which is the non-local means filtering algorithm. Using the non-local means filtering algorithm to denoise the images collected during top drive drilling operations not only improves the quality of the operation images but also enhances the accuracy of 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 means filtering algorithm denoises an image, it will establish a reference block for each pixel point and search for several blocks similar to its reference block in the entire image. Subsequently, the filtering result of the pixel point is weighted and calculated based on all neighboring blocks. In the specific analysis process, the distance and similarity between each neighboring block and the reference block will be used as its weight, and the quantification of similarity is obtained based on the differences in gray value representation and noise representation. However, in this process, the influence of the difference in the image information expressed by the neighboring block and the reference block on the weight is ignored. That is, if a neighboring block has a large weight obtained from the analysis of similarity and Euclidean distance in the existing method, but the difference in the image information it expresses from the reference block or the image region where the reference block is located is large, this neighboring block should not originally have a large weight, and the influence of this neighboring block on the filtering result of the pixel point being filtered should be appropriately reduced. Therefore, the existing method may reduce the accuracy of the filtering result of each pixel point being filtered, resulting in an impact on the denoising result of the entire top drive drilling operation image, and further reducing the accuracy of subsequent sticking detection. Summary of the Invention
[0004] To solve the problem that the quantization of similarity in the non - local mean filtering algorithm is obtained based on the differences in gray - value performance and noise performance, while ignoring the influence of the differences in the image information expressed by the neighborhood block and the reference block on the weight, which reduces the accuracy of the filtering result of each pixel point to be filtered by the non - local mean filtering algorithm, resulting in an impact on the denoising result of the operation image of the top - drive drilling, and further reducing the accuracy of the subsequent detection of sticking - drill phenomena, the present invention provides a top - drive drilling anomaly detection method and system based on machine vision.
[0005] In the first aspect, the present invention provides a top - drive drilling anomaly detection method based on machine vision, adopting the following technical solutions:
[0006] Obtain the gray - values of all pixel points in the current operation image of the top - drive drilling in real - time; with each pixel point as the center and a preset length as the side length, construct a reference block for each pixel point. Denote any pixel point as the target pixel point and the reference block of the target pixel point as the target block. Based on the difference in the gray - value means of the pixels in the remaining reference blocks and the target block, select multiple reference blocks as the neighborhood blocks of the target block. Determine the noise value of the neighborhood block according to the range and the second - largest range of the gray - values of the pixels in the neighborhood block; Based on the change situation of the gray - values of the adjacent pixels of the target pixel point in several previous operation images before the current operation image, obtain the pixel line of the target pixel point and multiple reference points of the target pixel point, including: extending from the target pixel point to the left and right sides. The pixel points on the left and right sides respectively terminate the extension on their respective sides in response to the gray - values of the continuous multiple pixel points on their respective sides being the same as the corresponding pixel points in several previous operation images before the current operation image. The extended pixel points do not include the continuous multiple pixel points that cause the termination of the extension on their respective sides; If the termination condition is never met, then when the extension reaches the pixel points on the boundary in the current operation image, the extension automatically terminates; When the extensions on both the left and right sides terminate, form the pixel line of the target pixel point with the target pixel point and the extended pixel points; Take multiple pixel points adjacent to the upper and lower sides of the target pixel point as reference points, and similarly obtain the pixel lines of the reference points;
[0007] Determine the importance of the target pixel point according to the mean of the absolute differences between the gray - values of the target pixel point and the corresponding pixel points in several previous operation images before the current operation image, and the difference in the lengths between the pixel line of the target pixel point and the pixel lines of each reference point, satisfying the relational expression:
[0008] ;
[0009] In the formula, is the importance of the pixel point ; is the mean of the absolute differences between the gray - values of the pixel point and the corresponding pixel points in several previous operation images before the current operation image; is the number of reference points of the pixel point ; is the length of the pixel line of the pixel point ; is the length of the th target reference pixel line of the pixel point, and the length of the target reference pixel line is the length of the pixel line of the reference point of the pixel point ; ; is the standard normalization function, is the absolute value symbol;
[0010] Denote the mean value of the importance degrees of all pixel points in the reference block as the position importance degree of the reference block; determine the weight optimization factor of the neighborhood block according to the position importance degree of the reference block of the target pixel point and the noise value and the position importance degree of the neighborhood block; determine the optimized weight of the neighborhood block according to the weight optimization factor and the Euclidean distance from the neighborhood block to the target block; perform denoising on the current working image by using the non-local means filtering algorithm based on the optimized weight, and then perform anomaly detection on the denoised current working image through the trained deep learning model.
[0011] By introducing the analysis of the image feature differences between the neighborhood blocks and the reference blocks, the present invention optimizes the weight calculation of the non-local mean filtering algorithm, which can significantly improve the denoising accuracy of the operation images of the top drive drilling. The traditional non-local mean filtering algorithm only calculates the weights based on the similarity of gray values and the Euclidean distance, ignoring the differences in the image information expressed by the neighborhood blocks and the reference blocks, resulting in unreasonable weighting and thus affecting the accuracy of the filtering result. By considering the differences in the noise performance and position importance of the neighborhood blocks and the reference blocks, it can not only more accurately reflect the true structure of the operation images, but also reasonably reduce the weights of the irrelevant neighborhood blocks, thereby improving the filtering effect. Optimizing the weight calculation method can adjust the filtering weights according to the actual influence of each neighborhood block, making the denoising effect of the image more ideal, thus providing more reliable image data support, improving the accuracy of stuck pipe phenomenon detection, and ensuring the smooth progress of the top drive drilling operation. Moreover, the calculation of the importance degree of the present invention is not only based on the gray 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 helps to extract more accurate information and enhances the image denoising effect. By introducing the number of reference points and the length of the pixel line corresponding to the reference points, it can flexibly adapt to the image characteristics in different scenarios, enabling the calculation of the importance degree to be adjusted for complex drilling scenarios, and the pixel lines of the reference points in different situations will affect the final result. By calculating the importance degree of each pixel point and effectively applying it to the subsequent filtering and anomaly detection processes, it can better emphasize the pixel points that have a significant or sensitive impact on the target state change, thereby improving the accuracy and sensitivity of the detection. By fully considering the relevance between the image information at the previous moment and the current state in the importance degree 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 images.
[0012] Further, the obtaining method of the neighborhood blocks is as follows: the remaining reference blocks are sorted according to the difference in the gray mean value of the pixel points within the reference blocks and the target block, and multiple reference blocks are selected as the neighborhood blocks of the target block based on the ascending order.
[0013] Further, the noise value satisfies: ; in the formula, is the noise value of the th neighborhood block of the reference block of the pixel point , is the range of the gray values of the pixel points within the th neighborhood block of the reference block of the pixel point , is the secondary range of the gray values of the pixel points within the th neighborhood block of the reference block of the pixel point , and is the first hyperparameter.
[0014] The present invention combines the range and the secondary range of the gray values within the neighborhood block, which can more accurately measure the influence of noise on the target pixel point, effectively capture the subtle noise changes in the image, and thus provide a more powerful basis for subsequent denoising processing.
[0015] Further, the secondary range is the difference between the maximum value and the minimum value of the remaining gray values after removing the pixel points corresponding to the extreme gray values within the neighborhood block.
[0016] Further, using multiple pixel points adjacent to the upper and lower sides of the target pixel point as reference points includes:
[0017] In response to the number of pixel points included in any one of the pixel lines of the adjacent pixel points on the upper or lower side of the target pixel point being less than the preset number in multiple consecutive pixel lines, recording the serial number of the adjacent pixel point corresponding to the first pixel line in the multiple consecutive pixel lines among the adjacent pixel points as , and selecting the adjacent pixel points of the target pixel point on this side and the adjacent pixel points of the target pixel point on the other side of the upper and lower sides as reference points, where is the preset number of pixel points.
[0018] Further, the weight optimization factor satisfies: ; in the formula, is the weight optimization factor of the th neighborhood block of the reference block of the pixel point , is the noise value of the th neighborhood block of the reference block of the pixel point , is the position importance of the reference block of the pixel point , is the position importance of the th neighborhood block of the reference block of the pixel point , is the second hyperparameter, is the natural exponential function, is the absolute value symbol.
[0019] The calculation of the weight optimization factor of the present invention takes into account the differences in both the noise value and the position importance, ensuring that in the case of high noise, weighting is performed based on the importance of the reference block and the neighborhood blocks, thus improving the filtering effect; by using the form of the natural exponential function, the given weight optimization factor can not only reflect the noise characteristics of the neighborhood blocks, but also dynamically adjust the weights of the neighborhood blocks depending on their relationship with the target pixel, making the denoising more flexible and adaptable; when the position importance of the neighborhood block is low, the weight optimization factor reduces its influence, thereby effectively suppressing interference to abnormal or unimportant regions during the denoising process and improving the overall image quality.
[0020] Further, the optimized weight satisfies: ; where is the optimized weight of the th neighborhood block of the reference block of pixel point , is the weight optimization factor of the th neighborhood block of the reference block of pixel point , is the Euclidean distance between the th neighborhood block of the reference block of pixel point and the reference block of pixel point , is the number of neighborhood blocks of the reference block of pixel point , is the natural exponential function.
[0021] The optimized weight of the present invention provides 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, it is possible to effectively reduce the interference of neighborhood blocks far from the target pixel to the final decision. The farther neighborhood blocks will have their importance automatically reduced in this weight calculation, ensuring that pixels closer to the target have a greater influence; by using the local features of the neighborhood blocks, the optimized weight can effectively retain the local information of the image and avoid feature loss caused by denoising, thus better identifying abnormal phenomena in subsequent anomaly detection.
[0022] Further, the deep learning model adopts a CNN model.
[0023] In a second aspect, the present invention provides a top drive drilling anomaly detection system based on machine vision, adopting the following technical solution:
[0024] The top-drive drilling anomaly detection system based on machine vision includes: a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the above-mentioned top-drive drilling anomaly detection method based on machine vision.
[0025] 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 the memory to be loaded and executed by the processor, so as to manufacture a terminal device according to the memory and the processor, which is convenient to use.
[0026] The present invention has the following technical effects:
[0027] (1) The similarity quantization of the traditional non-local mean filtering algorithm is only based on the differences in gray value performance and noise performance. However, in the present invention, when selecting the neighborhood block, not only the gray mean difference of the pixel points in the neighborhood block and the reference block is considered, but also the noise value is determined according to the range and sub-range of the gray values of the pixel points in the neighborhood block. At the same time, the importance of the target pixel point is determined based on the change of the gray value of the target pixel point in the current and previous operation images, the length difference between the pixel line of the target pixel point 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 indexes, the determination of the weight is made 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.
[0028] (2) Since the weight calculation of the neighborhood block is optimized to obtain a more reasonable optimized weight, based on this, the non-local mean filtering algorithm is used to denoise the current operation image, which can remove noise more effectively than the traditional method, improve the denoising quality of the operation image, make the image clearer, and provide a better image basis for subsequent anomaly detection.
[0029] (3) The high-quality denoising result helps the deep learning model to analyze the top-drive drilling operation image more accurately, and then improves the accuracy of detecting anomalies such as sticking accidents, and can more timely and accurately detect the anomalies in the top-drive drilling process, providing strong support for ensuring the safety and smooth progress of the drilling operation, and reducing production accidents and economic losses caused by untimely discovery of anomalies.
[0030] (4) By considering the change of the gray value of the target pixel point in the time dimension (the current operation image and the previous operation image), as well as the relationship between the pixel line of the target pixel point and the pixel line of the reference point, the hidden information in the image is fully exploited, and the importance of the pixel point is evaluated from multiple angles, making the processing of the algorithm for the image more in line with the actual situation, and improving the performance of the algorithm and the adaptability to complex images. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is the flowchart of the method for abnormal detection of top drive drilling based on machine vision in the embodiments of the present invention. Specific implementation manners
[0032] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0033] The embodiments of the present invention disclose a method for abnormal detection of top drive drilling based on machine vision. Refer to Figure 1 , which includes steps S1 - S6:
[0034] S1: Real - time obtain the gray values of all pixel points in the current operation image of the top drive drilling.
[0035] In the present invention, the operation images of the top drive drilling are collected in real - time by a high - definition camera, and then each frame of the image is grayscale - processed to obtain a grayscale image of the operation image of the top drive drilling, and further obtain the gray value of each pixel point.
[0036] S2: Construct a reference block for each pixel point. Denote any pixel point as the target pixel point, and denote the reference block of the target pixel point as the target block. Select multiple reference blocks as the neighborhood blocks of the target block.
[0037] Centered on each pixel point, with a preset length as the side length, construct a reference block for each pixel point. Based on the difference in the average gray values of the pixels in the remaining reference blocks and the target block, select multiple reference blocks as the neighborhood blocks of the target block.
[0038] Implementers can set the side length and the number of neighborhood blocks according to the specific implementation situation. For example, the side length is 7×7. If the number of pixel points on one side of the position where the pixel point is located is less than 7, it is filled from the opposite side; the number of neighborhood blocks is 10.
[0039] Specifically, the obtaining method of the neighborhood blocks is as follows:
[0040] Sort the remaining reference blocks according to the difference in the average gray values of the pixels in the reference blocks and the target block, and select multiple reference blocks as the neighborhood blocks of the target block based on the ascending order.
[0041] S3: Determine the noise value of the neighborhood blocks.
[0042] It should be noted that in this step, the gray value performance of the pixel points 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 the reference block of each pixel point. The calculation of the noise value is because the gray value of the noise pixel points is relatively prominent and their occurrence positions are relatively random. Therefore, the greater the range of the gray values in each neighborhood block of the reference block of each pixel point, the greater the possibility of the existence of noise pixel points and the corresponding greater the noise value. However, a large range of gray values in a neighborhood block may also be due to a large change in the gray values that actually occur in its area. Therefore, the difference between the secondary range and the range after removing the maximum and minimum gray values in each neighborhood block of the reference block of each pixel point can be further analyzed. The greater the difference, the greater the credibility that the pixel points with relatively extreme gray values in this neighborhood block appear in the form of single pixel points. Then, it can be explained that the greater the possibility that the large range of gray values in this neighborhood block is affected by noise, and the greater the corresponding noise value of this neighborhood block.
[0043] Determine the noise value of the neighborhood block according to the range and secondary range of the gray values of the pixel points in the neighborhood block.
[0044] Specifically, the noise value satisfies:
[0045] ;
[0046] In the formula, is the noise value of the -th neighborhood block of the reference block of pixel point , is the range of the gray values of the pixel points in the -th neighborhood block of the reference block of pixel point , is the secondary range of the gray values of the pixel points in the -th neighborhood block of the reference block of pixel point , is the first hyperparameter.
[0047] Implementers can set the value of the first hyperparameter according to the specific implementation situation. For example, 0.01. The existence of the first hyperparameter is to prevent the situation where the calculation result is meaningless when .
[0048] Among them, the larger it is, the greater the possibility that there are pixel points with relatively extreme gray values in the -th neighborhood block of the reference block of pixel point , indicating that the greater the possibility that there are noise pixel points in the -th neighborhood block of the reference block of pixel point , and the greater the corresponding noise intensity; in the formula The larger it is, it indicates that the pixel in the n-th neighborhood block of the reference block of has a greater credibility that the pixel points with extreme gray values appear in the form of single pixel points. Then it can be explained that the n-th neighborhood block has a greater possibility of being affected by noise due to a larger gray value range, and the noise value corresponding to the
[0049] n-th neighborhood block is larger.
[0050] S4: Determine the importance of the target pixel point.
[0051] It should be noted that in order to make the filtering result of each pixel being filtered more accurate, when finally determining the filtering weight corresponding to each neighborhood block of each reference block of each pixel, it is also necessary to analyze the difference between the position importance of each reference block of each pixel and the position importance of each neighborhood block of each reference block of each pixel; when analyzing the above indicators, the importance of a pixel can be calculated first, and then by calculating the average value of the importance of all pixel points in each reference block of each pixel and each neighborhood block of each reference block of each pixel, the position importance of each reference block of each pixel and each neighborhood block of each reference block of each pixel can be obtained.
[0052] It should also be noted that before calculating the importance of each pixel point, it is necessary to clarify that the core of detecting the sticking phenomenon in top-drive drilling lies in the analysis of the drill string area. Therefore, compared with pixel points in other areas, the filtering of pixel points in the drill string area should have a more accurate filtering accuracy. Otherwise, the subsequent detection of the sticking phenomenon will be more affected. Therefore, here it is necessary to analyze the possibility of each pixel point being located in the drill string area, that is, quantify its importance factor, and based on this, obtain the position importance of the reference block and its neighborhood block of each pixel point, which can make the filtering of pixel points in the drill string area more meticulous and accurate. Since the drill string is in a moving state during operation, when analyzing the importance of each pixel point, the more obvious the difference in the gray values of each pixel point at the corresponding position in multiple consecutive frames, the greater the possibility that it belongs to the drill string area, and the greater the corresponding importance. However, in the actual scenario, there are not only drill strings among the moving objects, so it is necessary to quantify the characteristics of the drill string area more meticulously. Since the drill string is usually cylindrical, it will have a highly consistent width when reflected in the image. Therefore, the length of the pixel line composed of pixel points with gray value changes in the horizontal direction (both left and right sides) of a pixel point in consecutive frames is more consistent with the length of the pixel lines of the pixel points adjacent to the upper and lower sides of this pixel point, indicating that the pixel points with gray value changes in the horizontal direction and the adjacent horizontal directions above and below this pixel point in consecutive frames are more likely to be in the drill string area, and then the possibility of this pixel point belonging to the drill string area is greater, and its importance is greater.
[0053] Based on the change situation of the gray values of the adjacent pixel points of the target pixel point in several previous operation images before the current operation image, obtain the pixel line of the target pixel point and multiple reference points of the target pixel point.
[0054] Implementers can set the number of several previous operation images and the number of multiple target reference pixel lines according to the specific implementation situation. For example, there are 5 previous operation images. For the first 5 collected operation images, they are only used as reference operation images and no calculation and processing are performed; the number of target reference pixel lines is 10.
[0055] Specifically, the obtaining method of the target pixel line and multiple target reference pixel lines of the target pixel point is as follows:
[0056] The obtaining method of the pixel line of the target pixel point and multiple reference points of the target pixel point is as follows:
[0057] Extend to the left and right sides centered on the target pixel point. In response to the gray values of a continuous number of pixel points (exemplarily, 5 pixel points) among the pixel points on the left and right sides being the same as the gray values of the corresponding pixel points in a number of previous job images (the 5 previous job images in succession), terminate the extension on this side (the pixel points of the extension at termination do not include the above 5 pixel points; if the termination condition is never met, when extending the pixel points at the boundary in the job image, it will automatically terminate). When the extensions on both sides terminate, form a pixel line of the target pixel point with the target pixel point and the extended pixel points.
[0058] In response to any one side among the upper and lower sides of the target pixel point in the pixel line of pixel points, if there are continuously multiple pixel lines (exemplarily, 3 consecutive pixel lines) containing a number of pixel points less than the preset number (exemplarily, the preset number is 20), record the sequence number of the pixel points corresponding to the first pixel line among the continuously multiple (exemplarily, 3 consecutive) pixel lines as among pixel points on this side of the target pixel point, and use the pixel points on this side of the target pixel point and the pixel points on the other side as reference points, where is the preset number of pixel points (exemplarily, ).
[0059] Determine the importance of the target pixel point based on the mean of the absolute differences between the gray values of the target pixel point and the corresponding pixel points in a number of previous job images, and the difference in the lengths of the pixel lines between the target pixel point and each reference point.
[0060] Specifically, the importance satisfies:
[0061] ;
[0062] In the formula, is the importance of pixel point , is the mean of the absolute differences between the gray values of pixel point and the corresponding pixel points in a number of previous job images, is the number of reference points of pixel point , is the length of the pixel line of pixel point , is the length of the th target reference pixel line of pixel point is the standard normalization function, is the absolute value symbol.
[0063] In the formula, The larger it is, the more it indicates that pixel point 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.
[0064] 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.
[0065] The average importance of all pixels in the reference block is recorded as the position importance of the reference block.
[0066] S5: Determine the weight optimization factor and optimization weight of the neighborhood block.
[0067] 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.
[0068] 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.
[0069] Specifically, the weight optimization factor satisfies:
[0070] ;
[0071] In the formula, Pixel The reference block The weight optimization factor of the neighborhood blocks, Pixel The noise value of the th neighborhood block of the reference block of is the position importance of the reference block of pixel ; is the position importance of the th neighborhood block of the reference block of pixel ; is the second hyperparameter, is the natural exponential function, is the absolute value symbol.
[0072] Implementers can set the second hyperparameter according to the specific implementation situation. For example, 0.001. The existence of the second hyperparameter is to prevent from occurring when the calculation result is meaningless.
[0073] It should be noted that the larger the weight optimization factor of each neighborhood block of the reference block of each pixel, the larger the corresponding optimized filtering weight (i.e., the optimized weight). The smaller the Euclidean distance between each neighborhood block of the reference block of each pixel and the reference block to which it belongs, the greater the reference value of its filtering result for the pixel 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, combined with the Euclidean distance between each neighborhood block of the reference block of each pixel and the reference block (i.e., the Euclidean distance between the central pixels of the two blocks), the optimized filtering weight of each neighborhood block of the reference block of each pixel is calculated.
[0074] Determine the optimized weight of the neighborhood block according to the weight optimization factor and the Euclidean distance from the neighborhood block to the target block.
[0075] Specifically, the optimized weight satisfies:
[0076] ;
[0077] In the formula, is the optimized weight of the th neighborhood block of the reference block of pixel ; is the weight optimization factor of the th neighborhood block of the reference block of pixel ; is the Euclidean distance between the th neighborhood block of the reference block of pixel and the reference block of pixel ; is the number of neighborhood blocks of the reference block of pixel ; is the natural exponential function.
[0078] S6: Denoise the current operation image using the non-local means filtering algorithm, and then perform anomaly detection through the trained deep learning model.
[0079] Based on the optimized weights, denoise the current operation image using the non-local means filtering algorithm, and then perform anomaly detection on the denoised current operation image of the top drive drilling through the trained deep learning model.
[0080] It should be noted that an image dataset containing normal drilling operations and stuck pipe phenomena is used to train the deep learning model to learn the characteristics of the stuck pipe phenomenon, and then the denoised current operation image of the top drive drilling is screened and identified. When an anomaly is identified, a warning prompt is issued to notify relevant technical personnel for maintenance and processing.
[0081] Specifically, the deep learning model uses a CNN model.
[0082] The embodiment of the present invention also discloses a top drive drilling anomaly detection system based on machine vision, including a processor and a memory. 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 the present invention is implemented.
[0083] 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 settings and functions are known in the art, so they will not be elaborated here.
[0084] The above are all the preferred embodiments of the present invention, and the protection scope of the present invention is not limited hereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention should be covered within 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 the 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 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, including: extending to the left and right sides with the target pixel as the center, the pixel points on the left and right sides respectively respond to the grayscale values of the continuous multiple pixels on the side being the same as the corresponding pixels in several working images before the current working image, and terminating the extension of the side; the extended pixel points do not include the continuous multiple pixels that cause the termination of the extension of the side; if the termination condition is not met all the time, it is automatically terminated when it reaches the pixel point located at the boundary in the current working image; when the extension on both the left and right sides is terminated, the pixel line of the target pixel is composed of the target pixel and the extended pixel points; taking the multiple adjacent pixel points on the upper and lower sides of the target pixel as reference points, and similarly obtaining the pixel line of the reference point; The importance of the target pixel is determined based on the average of the absolute difference between the target pixel and the corresponding pixel in several working images before the current working image, and the difference between the length of the pixel line of the target pixel and the pixel line of each reference point, satisfying the relationship: ; In the formula, Pixel The importance of Pixel The average of the absolute differences between the grayscale values of 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 length of the pixel point The length of the pixel line of the reference point; is the standard normalization function, is the absolute value symbol; 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 reference block of the target pixel, the noise value of the neighborhood block and the 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 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; Pixel The reference block The second extreme value 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, 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 method of taking a plurality of adjacent pixels on both sides of the target pixel as reference points includes: 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 a preset number in the pixel lines of the plurality of adjacent pixel points, the adjacent pixel points corresponding to the first pixel line in the plurality of consecutive pixel lines are placed in the The serial numbers of adjacent pixels are recorded as , and select the neighboring pixels on the side of the target pixel The pixel point and the target pixel point are adjacent to the other side of the upper and lower sides. 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 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 each neighborhood block; is the second hyperparameter, is the natural exponential 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 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.
8. 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.
9. 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 8 is implemented.
Citation Information
Patent Citations
Visual inspection system for animal husbandry and veterinary medicine
CN118096735A
Quality detection method for constructional engineering concrete prefabricated part
CN119205763A