## 6 Conclusions  
For the gas drainage environment, the drill pipe counting speed is slow and the accuracy is low, and the traditional image processing algorithm is easy to lose the drilling rig target and other problems may arise, therefore, the YOLOV7-GFCA model detection drilling rig was proposed:  
1. Redundant features in the coal mine environment are effectively eliminated through the incorporation of the GhostNetV2 network, resulting in the acceleration of reasoning speed and the creation of a lightweight model. By embedding the lightweight FCA module into YOLOv7, the salience of the drilling rig is augmented, particularly within complex backgrounds. The feature expression capability of the rig is consequently improved, leading to heightened precision in detection outcomes. The conventional IOU measurement method is replaced by the NWD measurement method. This substitution mitigates the effects of drilling rig vibration, drill sticking, and other pertinent factors, consequently further enhancing the accuracy of drilling rig positioning.
2. The exceptional performance of YOLOV7-GFCA is demonstrated by experimental results, showcasing a remarkable detection accuracy of 99.5% at a detection speed of 80 FPS. This surpasses the performance of existing mainstream target detection algorithms. Upon the application of the YOLOV7-GFCA model to real-time dynamic videos of drilling rig working faces, the accuracy of drill pipe counting is impressively elevated to 99.8% through the filtration of motion trajectories. Furthermore, accurate determination of drilling depth is achieved by the proposed method. Compelling validation for the practicality and feasibility of the approach in real-world scenarios is provided by these results.
3. Owing to the distinctive challenges inherent in the coal mine environment, YOLOv7-GFCA might encounter limitations in the effective detection of drilling rig targets under specific circumstances. For instance, instances where underground workers directly shine searchlights at the camera or obstruct the camera for extended periods can potentially compromise the performance of the detection function. These situations introduce unique challenges that necessitate further investigation and potential adjustments to the detection algorithm, aiming to enhance robustness in such demanding conditions.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Method**} & **Actual** & **Detect** & **Actual Total** & **Detect Total** & \multirow{2}{*}{**Accuracy/(\%)**} \\  & **Number** & **Number** & **Depth/(m)** & **Depth/(m)** & \\ \hline Manual & 500 & 484 & 750 & 726 & 96.8 \\ Counting & 500 & 487 & 750 & 730.5 & 97.4 \\ YOLOV7-GFCA & 500 & 499 & 750 & 748.5 & 99.8 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison between the manual counting method and the algorithm before and after improvement.  
**Author Contributions:** Conceptualization, T.C. and L.D.; methodology, T.C. and X.S.; software, T.C.; validation, T.C., L.D. and X.S.; formal analysis, T.C.; investigation, T.C.; resources, L.D.; data curation, L.D.; writing--original draft preparation, T.C.; writing--review and editing, X.S.; visualization, T.C.; supervision, X.S.; project administration, L.D.; funding acquisition, L.D. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Informed consent was obtained from all subjects involved in the study.  
**Data Availability Statement:** The data source is explained in the article.  
**Conflicts of Interest:** The authors declare no conflict of interest.