## 1 Introduction  
China's growing economy has resulted in an increased demand for coal resources [1]. However, the drilling site environment poses unique challenges due to its complexity, including the presence of significant coal dust and the risk of gas explosions. To mitigate these risks, coal mining enterprises commonly employ drilling rigs for gas extraction [2]. Not only is gas recovered as an energy source through this approach, but also the occurrence of gas explosions is minimized. The critical parameter in gas drainage operations is served by the drilling depth, as safety hazards can be induced by drilling too deep. In practical production, the drilling depth is determined by the total length of the drill pipe. Since each drill pipe has a consistent length, counting the number of drainage drill pipes enables the calculation of the drilling depth, ensuring safe gas extraction. As coal mines embrace intelligent construction, researchers are increasingly utilizing image processing algorithms to enable intelligent production using existing video surveillance systems. [PERSON] et al. [3] introduced an enhanced Camshift algorithm for the real-time capture of drill pipe targets to facilitate accurate drill pipe counting. Meanwhile, [PERSON] et al. [4] proposed a corner detection method combined with the pyramid optical flow technique to estimate the optical flow field of moving drilling rigs, employing frame skipping. However, limitations are encountered by the traditional manual feature extraction approach in the complex mine environment, which is characterized by uneven lighting and interference from coal dust. As a result, inaccurate statistical outcomes are yielded by this traditional method. In recent years, significant advancements and successful applications in various image-related tasks were witnessed in deep learning. In line with this trend, researchers have explored its potential for drill pipe counting. [PERSON] et al. [5] presented an improved version of the ResNet network for binary classification. They utilized the integral method to filter video classification confidence and counted the number of falling edges in the confidence curve, thereby achieving quantitative drill pipe counting. [PERSON] et al. [6] involved the use of spatio-temporal graph convolutional neural networks to identify the unloading action of drilling rigs, enabling the determination of the number of drill pipes. However, the focus of these methods is primarily on distinguishing the actions of rods being loaded and unloaded by workers, and their applicability is limited across different working scenarios. Additionally, the drill pipe counting speed in these approaches is slow, posing challenges in meeting the demands of real working environments. In the gas extraction process, the drilling rig identifies the reciprocating drilling rig target along a specific straight line and subsequently counts the number of reciprocations. Drilling depth is determined by the number of drill pipes. To address this, a target detection-based method is proposed for the efficient and accurate counting of light drilling rigs in complex environments. Advanced target detection technology is employed by this method to swiftly and precisely detect the moving targets of drilling rigs, ultimately enhancing the overall safety and efficiency of gas drainage operations. Object detection algorithms can be categorized into one-stage and two-stage approaches. Representative two-stage algorithms include Faster Regions with CNN features(R-CNN) [7] and Mask-RCNN [8]. While higher detection accuracy is offered by these algorithms, their speed is comparatively slower. In the context of coal mine drilling sites, these algorithms are unsuitable for real-time deployment of industrial equipment. On the other hand, first-stage algorithms like Single Shot MultiBox Detector(SSD) [9] and You Only Look Once(YOLO) series [10] exhibit fast detection speeds.