# Rebar Recognition Using Multi-Hyperbolic Attention in Faster R-CNN
## 2 Materials and Methods
The algorithm framework of this study is illustrated in Figure 2. Faster R-CNN is a deep learning algorithm for object detection, consisting of two main components: the Region Proposal Network (RPN) and the detection network. First, the input image is processed by a Convolutional Neural Network (CNN) to extract a feature map. The RPN then generates candidate regions on this feature map, computing scores and performing bounding box regression for each region. Subsequently, these candidate regions are fed into the detection network for classification and precise bounding box adjustments, ultimately producing the class and location of each target. Faster R-CNN improves detection accuracy through end-to-end training. This paper presents three modifications to the Faster R-CNN framework. Firstly, ResNet50 was selected as the baseline of the backbone due to its proven balance of performance and computational efficiency, as demonstrated in object detection tasks on challenging datasets like MS COCO. Specifically, ResNet50 combined with the Deformable Attention to Capture Salient Information (DAS) mechanism served as the feature extraction module for ground-penetrating radar (GPR) images. According to previous evaluations [17], in object detection experiments using the Faster R-CNN model on the MS COCO dataset, the ResNet50+DAS model surpasses other backbones, such as ResNet-101, SENet-50, CBAM-50, and Triplet Attention-50, in terms of metrics like \(AP\), \(AP_{50}\), \(AP_{75}\), \(AP_{M}\), and \(AP_{L}\), while maintaining a lower parameter count compared to larger models (e.g., ResNet-101). The DAS mechanism integrated Depthwise Separable Convolution (DSC)  
Figure 2: A Faster R-CNN model enhanced by multi-hyperbolic attention mechanisms. and Deformable Convolution (DC) to enhance attention on salient regions and compute dense pixel-directional attention weights. The structure of the feature extraction module is shown in Figure 3. In each residual block of ResNet50, the DAS attention mechanism was incorporated to focus on significant image regions, thereby enhancing convolutional performance and training efficacy. Secondly, a hyperbolic attention transformer (HAT) module was introduced before the Region Proposal Network (RPN) and region of interest (ROI) pooling. The structure of the HAT module is shown in Figure 4. The \(H\), \(W\), and \(C\) represent the height, width, and channels of the feature map. This module leveraged the properties of hyperbolic space to more effectively capture and represent hyperbolic patterns within images, enhancing the accuracy of rebar identification. The HAT module computed hyperbolic distances by applying hyperbolic geometry, specifically the widely used Poincare model in machine learning. In the Poincare disk model, the hyperbolic distance between two points can be calculated as  
\[d(q,k)=cosh^{-1}(1+2\frac{\parallel q-k\parallel^{2}}{(1-\parallel q\parallel ^{2})(1-\parallel k\parallel^{2})}) \tag{3}\]  
In this equation, \(\parallel q\parallel\) and \(\parallel k\parallel\) represent the Euclidean distances to the origin, and it is imperative to ensure that both points \(q\) and \(k\) reside within hyperbolic space (i.e., their norms are less than 1). The dataset utilized in the present study was predominantly derived from GPR detection images obtained from the Husa Tunnel along the Tengchong to Longchuan Expressway. Data acquisition was performed by utilizing a commercial ground-penetrating radar system, specifically the SIR3000, which operates at a central frequency of 400 MHz. In order to ensure that the reflected waves accurately represent the rebar, this study implemented a procedure for the removal of DC offset from the acquired data.