## 3 Materials and Methods
### First-Frame Localization Model Based on Improved RFBNet
#### 3.1.1 Network Infrastructure
From Conv1 to Stage 4, the size of the input image is reduced by a factor of 16 through downsampling, which enables the model to capture the essential information in the image while maintaining a certain level of computational efficiency. Through a series of convolution and block stacking operations, the optimized RFBNet first-frame  
Figure 3: ShuffleNet V2 block. localization model can more accurately determine the position of the perforating robot arm in the image. To enhance the model's capacity to comprehensively understand the perforated robotic arm, from local texture to overall semantics, we adopt the strategy of detecting target objects from multi-scale feature maps. In total, six layers of features are extracted from the deep structure of the backbone network, which encompasses a comprehensive range of information, from the minutiae to the global information. In particular, the middle- and high-level features are captured by utilizing Stages 3 and 4 of the backbone network, which correspond to feature maps of sizes \(40\times 40\) and \(20\times 20\), respectively. The aforementioned feature maps contain more detailed spatial information about the perforated robotic arm and certain semantic information, which is of great importance for the process of localizing the target object. Subsequently, to extract higher-level semantic features, two RFB (Receptive Field Block) modules are introduced following Stage 4. The RFB modules capture broader contextual information through carefully designed convolution and pooling operations. These modules use dilated convolutions with different dilation rates, effectively expanding the receptive field and enabling the model to capture multi-scale contextual information. After processing by the RFB modules, we obtained two smaller but semantically richer feature maps, sized \(10\times 10\) and \(5\times 5\). This multi-scale feature aggregation compensates for the resolution degradation caused by the lightweight backbone design, preserving fine local details while enhancing the expression of high-level semantic features. Finally, to further enhance the discriminative power and adaptability of the features, two additional convolution layers are added at the end of the network, namely, Conv10-2 and Conv11-2. The function of Conv10-2 is to further fuse local spatial information, while the function of Conv11-2 is to compress the number of channels and generate the final feature representation through a \(1\times 1\) convolution layer. The multi-scale feature fusion and progressive deepening of the network structure enable our model to comprehensively comprehend the local texture and overall semantics of the perforating robotic arm, thereby facilitating more accurate tracking and localization. The conventional IoU is constrained in its ability to address scenarios where the bounding boxes exhibit minimal or no overlap. This limitation hinders its capacity to accurately represent the disparities in the position and dimensions between the two boxes. In contrast, GIoU evaluates the similarity between two boxes more comprehensively by introducing the concept of an enclosing box. This takes into account not only the overlapping regions of the predicted and real bounding boxes but also the non-overlapping regions between them. To enhance the precision of the target bounding box prediction for the perforated robotic arm, this study employs GIoU (Generalized Intersection over Union) as an evaluation metric, utilizing the RFBNet model in place of the conventional IoU (Intersection over Union). During the training process, GIoU is employed as a criterion for the selection of positive and negative samples about the predicted bounding box. Should the GIoU value of the predicted and actual bounding boxes exceed the pre-established positive sample threshold, the former is deemed a positive sample, thereby contributing to the positive training of the model.