Intelligent underground drill rod counting method based on improved YOLO v8n algorithm
Through the improved YOLO v8n algorithm and DeepSORT algorithm, combined with Dyhead and Inner-WIoU loss functions, the inefficiency and susceptibility of underground drilling pipe counting technology of coal mines is solved, and accurate and fast drilling pipe counting is achieved in complex environments. Improve the intelligence level of coal mine gas safety management.
Patent Information
- Application Number
- CN202410969266.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-12
AI Technical Summary
The existing drill pipe counting technology has problems such as low efficiency, susceptibility to human interference, easy equipment damage and complex wave energy control in coal mines, which is difficult to meet the needs of coal mine gas safety management.
The improved YOLO v8n algorithm is used, combined with the Dyhead module, EMA module and Inner-WIoU loss function, a drill pipe counting network model is built, and the DeepSORT algorithm is used for target tracking, and the IoU value judgment is used to achieve accurate drill pipe counting.
The accuracy of drill pipe identification and counting is improved in complex downhole environments, compensates for the shortcomings of traditional counting methods, realizes fast and efficient object detection and real-time counting, and improves work efficiency and safety.
Smart Images

Figure CN118941518A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision recognition, and in particular to an intelligent downhole drill rod counting method based on an improved YOLO v8n algorithm. Background Art
[0002] In the field of coal mining, gas safety is of vital importance. As the mining depth increases, the risk of gas accumulation and explosion increases. For this reason, drilling extraction technology has become a key means to reduce gas concentration and prevent explosion accidents. This technology relies on the number of drill rods to ensure the drilling depth, which in turn affects the gas extraction effect. As the gas content and pressure of coal seams increase, it becomes particularly important to accurately count the number of drill rods. This is not only the basis for ensuring the adequacy and effectiveness of gas extraction, but also a necessary measure to ensure safe production in coal mines. Therefore, efficient and accurate counting of the number of drill rods is of great significance to coal mine gas safety management.
[0003] With the continuous advancement of intelligent mine technology, traditional drill rod counting methods have gradually exposed many limitations. Although the manual counting method is direct, it is inefficient and easily interfered by human factors, and there is a hidden danger of falsely reporting the depth of the borehole. Although the instrument counting method has improved the degree of automation, its equipment is easily damaged in harsh environments and its scope of use is limited. Although the stress wave method is feasible in principle, the wave velocity calibration process is complicated, and it is difficult to control the energy of the wave to meet the safety and explosion-proof requirements of coal mines. The electric standing wave method faces the risks of wave energy control and possible electrical signals in the instrument. Therefore, in order to meet the safe and efficient production needs of mines, it is urgent to explore new drill rod counting technologies to improve the intelligence level and safety performance of mine production.
[0004] As the construction of intelligent coal mines continues to deepen, the requirements for work efficiency, safety and intelligence are increasing. Computer vision technology, as a technology that can automatically obtain information from images or videos and analyze and understand them, has brought revolutionary changes to coal mine production. Summary of the invention
[0005] In view of the above-mentioned technical deficiencies, the purpose of the present invention is to provide a research method for intelligent downhole drill rod counting based on an improved YOLO v8n algorithm.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The present invention provides an intelligent downhole drill rod counting research method based on an improved YOLO v8n algorithm, comprising the following steps:
[0008] Step 1: Acquire an image of a downhole drilling rod and preprocess the image to obtain a preprocessed image;
[0009] Step 2: Based on the YOLO V8n network model structure, the Dyhead module, EMA module and Inner-WIoU loss function are introduced to build a drill rod counting network model;
[0010] Step 3: Use the DeepSORT algorithm to track the person, drill rod, and drilling machine types detected in the image;
[0011] Step 4: Calculate whether the IoU value between person and drill rod is greater than the set threshold 1. If it is greater, proceed to the next step; if it is less, return to tracking;
[0012] Step 5: Determine whether the IoU value between the drill rod and the drilling machine is greater than the set threshold 2. If it is greater, the count is increased by 1; if it is less, return to tracking.
[0013] Preferably, in step 1, acquiring the downhole drilling rod image and preprocessing the image to obtain the preprocessed image specifically includes:
[0014] The downhole drilling video is divided into frames to obtain image data, and the image is preprocessed by horizontal rotation, vertical rotation, brightness enhancement and noise addition.
[0015] Preferably, the step 2 is based on the YOLO V8n network model structure, introduces the Dyhead module, the EMA module and the Inner-WIoU loss function, and constructs a drill rod counting network model, which specifically includes:
[0016] (1) Replacing the detection head of YOLO v8n with DyHead (Dynamic Head) can significantly improve the performance of the model. DyHead enhances the feature fusion capability through dynamic convolution and multi-scale feature fusion modules, enabling the model to better capture details and improve detection accuracy.
[0017] (2) Add the EMA (Efficient Multi-Scale Attention) attention mechanism strategy. This mechanism aims to remove redundant features in the network while retaining and strengthening the feature information that is critical to target detection.
[0018] (3) A method is proposed to replace the CIoU loss function with Inner-IoU and WIou v3 combined with an improved Inner-WIoUv3 loss function to improve the accuracy and speed up the regression of the bounding box (or recognition box).
[0019] Preferably, the step 3 uses the DeepSORT algorithm to track the person, drill rod and drilling machine types detected in the image. The specific design steps are as follows:
[0020] (1) DeepSORT assigns a unique ID to each target (person, drill rod, or drilling machine) detected for the first time and initializes a new trajectory with the initial state set to “unconfirmed”.
[0021] (2) Match the detected objects in subsequent frames with the existing tracks based on IOU (intersection over union) and appearance features. The matching results are divided into three categories: track mismatch (the track has no matching detected object), detection mismatch (the detected object has no matching track), and track match (the detected object successfully matches the track).
[0022] (3) For an “unconfirmed” trajectory, if multiple consecutive frames successfully match the detected target, its status will be updated to “confirmed”. Trajectories in the “confirmed” state will be cascade matched, with the most recently successfully matched trajectory being prioritized.
[0023] (4) Use the Kalman filter to predict the position of each target in the next frame. If the target moves or changes in state, the corresponding trajectory information is updated.
[0024] Preferably, in step 4, the IoU value between the person and the drill rod is calculated to be greater than a set threshold 1. If it is greater, the next step is judged; if it is less, the tracking is returned. The specific steps are as follows:
[0025]
[0026] Among them, IntersectionArea is the area of the overlapping area of the two bounding boxes, and UnionArea is the area of the union area of the two bounding boxes. Calculation steps: upper left corner coordinates: (max(x1 A ,x1 B ),max(y1 A ,y1 B )), lower right corner coordinates: (min(x2 A ,x2 B ),min(y2 A ,y2 B ))
[0027] Intersection Area = max(0,x right -x left )×max(0,y bottom -ytop )
[0028] Union Area = Area A +Area B -Intersection Area
[0029] The next step is to make a judgment by calculating the IoU value between person and drillrod and combining it with the preset threshold 1.
[0030] Preferably, in step 5, it is determined whether the IoU value of drillrod and drillingmachine is greater than a set threshold value 2. If it is greater, the count is increased by 1, and if it is less, the tracking is returned. The calculation process is the same as step 4. If the result is greater than the set threshold value 2, the count is increased by 1, and if it is less, the tracking is continued.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] 1. In complex downhole environments, especially in the presence of visual interference and uncertainty, YOLOv8-modified can more accurately identify and count drill rods through its optimized target detection algorithm.
[0033] 2. This improved technology effectively compensates for the defects in traditional counting methods, such as human error and the influence of visual interference. In addition, the improved YOLO v8n achieves fast and efficient target detection, enabling the intelligent system to process image data in almost real time and give accurate drill rod counting results.
[0034] 3. This real-time performance not only improves work efficiency, but also provides timely decision-making support for operators and has practical application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flow chart of intelligent downhole drill rod counting based on improved YOLO v8n algorithm provided by the present invention;
[0037] Figure 2 is a picture after image preprocessing in an embodiment of the present invention;
[0038] Figure 32 is a schematic diagram of the structure of YOLO v8n according to an embodiment of the present invention;
[0039] Figure 4 1 is a structural diagram of a DyHead (Dynamic Head) module according to an embodiment of the present invention;
[0040] Figure 5 EMA (Efficient Multi-Scale Attention) module structure diagram of an embodiment of the present invention;
[0041] Figure 6 This is a diagram of the tracking results of the DeepSORT algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, a person of ordinary skill in the art can make various changes or modifications to the present invention, and these equivalent forms are also within the scope of the claims attached to this application.
[0043] like Figures 1 to 6 As shown, this embodiment provides an intelligent downhole drill rod counting research method based on the improved YOLO v8n algorithm. This example takes the YOLO v8n improvement and Deepsort tracking algorithm as examples to further illustrate and explain the present invention.
[0044] It is now expected that they will increase the detection accuracy and improve the accuracy of drill rod counting. To implement the algorithm, the following steps are required:
[0045] Step 1: Acquire the downhole drilling rod image and preprocess the image to obtain the preprocessed image, which specifically includes:
[0046] The downhole drilling video is divided into frames to obtain image data, and the image is preprocessed by horizontal rotation, vertical rotation, brightness enhancement, and noise addition to improve the generalization of the model.
[0047] Step 2: Based on the YOLO V8n network model structure, the Dyhead module, EMA module and Inner-WIoU loss function are introduced to build a drill rod counting network model, which includes:
[0048] (1) Replacing the detection head of YOLO v8n with DyHead (Dynamic Head) can significantly improve the performance of the model. DyHead enhances the feature fusion capability through dynamic convolution and multi-scale feature fusion modules, enabling the model to better capture details and improve detection accuracy.
[0049] (2) Add the EMA (Efficient Multi-Scale Attention) attention mechanism strategy. This mechanism aims to remove redundant features in the network while retaining and strengthening the feature information that is critical to target detection.
[0050] (3) A method is proposed to replace the CIoU loss function with the improved Inner-WIoUv3 loss function combined with Inner-IoU and WIou v3 to improve the accuracy and speed up the regression of the bounding box (or recognition box). The improved algorithm also improves the detection accuracy, recall rate and precision.
[0051] Step 3: Use the DeepSORT algorithm to track the person, drill rod, and drilling machine types detected in the image, as follows:
[0052] (1) DeepSORT assigns a unique ID to each target (person, drill rod, or drilling machine) detected for the first time and initializes a new trajectory with the initial state set to “unconfirmed”.
[0053] (2) Match the detected objects in subsequent frames with the existing tracks based on IOU (intersection over union) and appearance features. The matching results are divided into three categories: track mismatch (the track has no matching detected object), detection mismatch (the detected object has no matching track), and track match (the detected object successfully matches the track).
[0054] (3) For an “unconfirmed” trajectory, if multiple consecutive frames successfully match the detected target, its status will be updated to “confirmed”. Trajectories in the “confirmed” state will be cascade matched, with the most recently successfully matched trajectory being prioritized.
[0055] (4) Use the Kalman filter to predict the position of each target in the next frame. If the target moves or changes in state, the corresponding trajectory information is updated.
[0056] Step 4: Calculate whether the IoU value between person and drill rod is greater than the set threshold 1. If it is greater, proceed to the next step. If it is less, return to tracking. The details are as follows:
[0057]
[0058] Among them, IntersectionArea is the area of the overlapping area of the two bounding boxes, and UnionArea is the area of the union area of the two bounding boxes. Calculation steps: upper left corner coordinates: (max(x1 A ,x1 B),max(y1 A ,y1 B )), lower right corner coordinates: (min(x2 A ,x2 B ),min(y2 A ,y2 B ))
[0059] Intersection Area = max(0,x right -x left )×max(0,y bottom -y top )
[0060] Union Area = Area A +Area B -Intersection Area
[0061] The next step is to make a judgment by calculating the IoU value between person and drillrod and combining it with the preset threshold 1.
[0062] Step 5: Determine whether the IoU value of drillrod and drillingmachine is greater than the set threshold 2. If it is greater, the count is increased by 1; if it is less, return to tracking; the specific calculation formula is shown in step 4.
[0063] In order to evaluate the performance of the improved algorithm, the measured data results are shown in the following table:
[0064]
[0065] It can be seen from the table that the model has improved in key indicators such as precision (P), recall (R) and average precision (mAP), proving the effectiveness of these improvements.
[0066] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core ideas and methods of the invention. At the same time, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. An intelligent downhole drill rod counting method based on an improved YOLO v8n algorithm, characterized in that: The counting method comprises the following steps: Step 1: Acquire an image of a downhole drilling rod and preprocess the image to obtain a preprocessed image; Step 2: Based on the YOLO v8n network model structure, the Dyhead module, EMA module and Inner-WIoU loss function are introduced to build a drill rod counting network model; Step 3: Use the DeepSORT algorithm to track the person, drill rod, and drilling machine types detected in the image; Step 4: Calculate whether the IoU value between person and drill rod is greater than the set threshold 1. If it is greater, proceed to the next step; if it is less, return to tracking; Step 5: Determine whether the IoU value between the drill rod and the drilling machine is greater than the set threshold 2. If it is greater, the count is increased by 1; if it is less, return to tracking.
2. The intelligent downhole drill rod counting research method based on the improved YOLO v8n algorithm as claimed in claim 1, characterized in that: The step 1 specifically includes: dividing the downhole drill pipe video into frames to obtain image data, and performing horizontal rotation, vertical rotation, brightness enhancement and noise preprocessing on the image.
3. The intelligent downhole drill rod counting research method based on the improved YOLO v8n algorithm as claimed in claim 1, characterized in that: In step 2, the Dyhead module, EMA module and Inner-WIoU loss function are introduced to construct a drill rod counting network model, which specifically includes: (1) Replace the detection head of YOLO v8n with DyHead (Dynamic Head), which uses dynamic convolution and multi-scale feature fusion modules; (2) Adding the EMA (Efficient Multi-Scale Attention) attention mechanism strategy to remove redundant features in the network while retaining and strengthening the feature information that is critical to target detection; (3) The CIoU loss function is replaced by Inner-IoU and WIou v3 combined with the improved Inner-WIoUv3 loss function to improve the accuracy and speed up the regression of the bounding box (or recognition box).
4. The intelligent downhole drill rod counting method based on the improved YOLO v8n algorithm as claimed in claim 1, characterized in that: In step 3, the improved YOLO v8n algorithm detects the types of person, drill rod and drilling machine in the image, and uses the DeepSORT algorithm to track the targets, and the process is as follows: (1) DeepSORT assigns a unique ID to each first detected target (person, drill rod, or drilling machine) and initializes a new trajectory with the initial state set to "unconfirmed"; (2) Match the detected targets in subsequent frames with the existing trajectories based on IOU (intersection over union) and appearance features, where the matching results are divided into three types: track mismatch (the track has no matching detection target), detection mismatch (the detected target has no matching track), and track match (the detection target successfully matches the track); (3) For an "unconfirmed" trajectory, if multiple consecutive frames successfully match the detected target, its status will be updated to "confirmed". The trajectory in the "confirmed" state will be cascade matched, with the most recently successfully matched trajectory being prioritized; (4) Use the Kalman filter to predict the position of each target in the next frame. If the target moves or its state changes, the corresponding trajectory information is updated.
5. The intelligent downhole drill rod counting research method based on the improved YOLO v8n algorithm as claimed in claim 1, characterized in that: In step 4, the calculation formula is: Among them, IntersectionArea is the area of the overlapping area of the two bounding boxes, and UnionArea is the area of the union area of the two bounding boxes. Calculation steps: upper left corner coordinates: (max(x1 A ,x1 B ),max(y1 A ,y1 B )), lower right corner coordinates: (min(x2 A ,x2 B ),min(y2 A ,y2 B )); Intersection Area = max(0,x right -x left )×max(0,y bottom -y top ); Union Area = Area A +Area B -Intersection Area; The next step is to make a judgment by calculating the IoU value between person and drillrod and combining it with the preset threshold 1.
6. The intelligent downhole drill rod counting method based on the improved YOLOv8n algorithm as claimed in claim 5, characterized in that: In step 5, the IoU value of the drillrod and the drillingmachine is calculated, and the calculation formula is as shown in claim 5. If it is greater than the set threshold 2, the count is increased by 1, and if it is less than, the tracking continues.
Citation Information
Patent Citations
Automatic counting method for underground drill rods based on machine vision
CN114511812A
Mine drill rod counting method, system and equipment based on improved YOLOV5 and DeepSort
CN115909121A
Method for counting drill feeding / retreating number of drill pipe machine
CN118097483A
Automatic counting method for drill rods
CN118155115A
Method for counting drilling pipe withdrawals in a drilling video on basis of human body pose recognition
WO2023279531A1
