## 3 Methodology
### Data Preprocessing and Input Representation
The extracted features, denoted as \(\textbf{F}_{i}\) for each \(bbx\), are a high-dimensional vector representing the appearance and spatial characteristics of the detected pedestrian. LightGlue is a feature matching technique that facilitates the alignment of bbxes across consecutive frames. It computes descriptors that are used to associate detections between frames, thus enabling accurate tracking. Let \(\textbf{D}_{i}\) represent the descriptor vector extracted by LightGlue for \(bbx\)\(b_{i}\). The similarity between descriptors from different frames is calculated using a distance metric, typically the cosine similarity as given in Equation (2):  
\[\text{sim}(D_{i},D_{j})=\frac{D_{i}\cdot D_{j}}{\|D_{i}\|\|D_{j}\|} \tag{2}\]The keypoint (kp) detection structure of XFeat is designed to achieve a balance between accuracy and computational efficiency, making it suitable for deployment on hardware-constrained devices such as mobile robots and embedded systems. Thekp detection is handled by a dedicated branch within the network, a design choice that deviates from traditional approaches wherekp detection and descriptor extraction are typically coupled. This decoupling allows XFeat to independently optimize each task, resulting in faster and more accuratekp detection. Thekp detection branch in XFeat processes the input image by first transforming it into a grid structure, with each grid cell representing an 8 \(\times\) 8 pixel region. The image is then reshaped into a 64-dimensional feature vector for each grid cell, preserving spatial granularity. A series of rapid \(1\times 1\) convolutions are applied to this representation to regress thekp coordinates efficiently. The final output of this branch is akp embedding as given in Equation (3):  
\[\mathbf{K}\in\mathbb{R}^{\frac{H}{8}\times\frac{W}{8}\times(64+1)} \tag{3}\]  
where \(k_{ij}\) is classified into 1 of 64 possible positions within its corresponding cell \(k_{ij}\in\mathbb{R}^{65}\), with an additional \"dustbin\" option for cases where nokp is detected. The dustbin is discarded during inference, and the remaining heatmap is interpreted as an 8 \(\times\) 8 cell. The descriptor extraction process in XFeat focuses on generating a dense feature map FF with compact 64-dimensional descriptors. This map is built using a multi-scale feature merging strategy, which enhances the robustness of the network to variations in viewpoint and illumination--critical aspects for applications in real-world scenarios such as mobile robotics. The dense feature map given in Equation (4):  
\[\mathbf{F}\in\mathbb{R}^{\frac{H}{8}\times\frac{W}{8}\times(64)} \tag{4}\]  
This is obtained by merging features from different scales, \(\{\frac{1}{8},\frac{1}{16},\frac{1}{32}\}\), of the image. The merging process involves bilinear upsampling of intermediate representations to match the resolution of the final map, followed by an element-wise summation. This strategy leverages the benefits of feature pyramids to increase the receptive field of the network while maintaining the compactness of the descriptors. A convolutional fusion block, consisting of three basic layers, combines these representations into the final feature map. An additional convolutional block is employed to generate the reliability map given in Equation (5):  
\[\mathbf{R}\in\mathbb{R}^{\frac{H}{8}\times\frac{W}{8}} \tag{5}\]  
which models the unconditional probability \(R_{i,j}\) that a given local feature \(F_{i,j}\) can be confidently matched. This map plays a crucial role in filtering out unreliable features, further enhancing the accuracy of the matching process. The following is an explanation of datasets used and the data preprocessing steps. For dense matching, XFeat introduces a lightweight module that enables semi-dense matching while controlling memory and computational footprints. This module selects the \(top-K\) image regions based on their reliability scores \(R_{i,j}\) and caches them for future matching.