Next Article in Journal
Automated Compactness Quantitative Metrics for Wrist Bone on Conventional Radiography in Rheumatoid Arthritis: A Clinical Evaluation Study
Previous Article in Journal
Print Quality Assessment of QR Code Elements Achieved by the Digital Thermal Transfer Process
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

SREF: Semantics-Refined Feature Extraction for Long-Term Visual Localization

1
Beijing Key Laboratory of Information Service Engineering, Beijing Union University, Beijing 100101, China
2
College of Robotics, Beijing Union University, Beijing 100101, China
3
Department of Precision Instrument, Tsinghua University, Beijing 100084, China
*
Author to whom correspondence should be addressed.
J. Imaging 2026, 12(2), 85; https://doi.org/10.3390/jimaging12020085
Submission received: 8 January 2026 / Revised: 11 February 2026 / Accepted: 17 February 2026 / Published: 18 February 2026
(This article belongs to the Section Computer Vision and Pattern Recognition)

Abstract

Accurate and robust visual localization under changing environments remains a fundamental challenge in autonomous driving and mobile robotics. Traditional handcrafted features often degrade under long-term illumination and viewpoint variations, while recent CNN-based methods, although more robust, typically rely on coarse semantic cues and remain vulnerable to dynamic objects. In this paper, we propose a fine-grained semantics-guided feature extraction framework that adaptively selects stable keypoints while suppressing dynamic disturbances. A fine-grained semantic refinement module subdivides coarse semantic categories into stability-homogeneous sub-classes, and a dual-attention mechanism enhances local repeatability and semantic consistency. By integrating physical priors with self-supervised clustering, the proposed framework learns discriminative and reliable feature representations. Extensive experiments on the Aachen and RobotCar-Seasons benchmarks demonstrate that the proposed approach achieves state-of-the-art accuracy and robustness while maintaining real-time efficiency, effectively bridging coarse semantic guidance with fine-grained stability estimation. Quantitatively, our method achieves strong localization performance on Aachen (up to 88.1% at night under the ( 0 . 2 ° , 0.25   m ) threshold) and on RobotCar-Seasons (up to 57.2%/28.4% under the same threshold for day/night), demonstrating improved robustness to seasonal and illumination changes.

1. Introduction

Visual localization serves as a fundamental component of SLAM (simultaneous localization and mapping), enabling autonomous driving and mobile robotics to navigate and map unknown environments in real time. A typical visual SLAM pipeline consists of three stages: feature extraction, feature matching, and pose estimation, where the accuracy of pose estimation heavily depends on the quality of extracted keypoints in the first stage.
Traditional feature extraction methods, such as Harris [1], FAST (Features from Accelerated Segment Test) [2], SIFT (Scale-Invariant Feature Transform) [3], and ORB (Oriented FAST and Rotated BRIEF) [4], have long dominated this pipeline due to their simplicity and efficiency. Recent advances in deep learning have shown that convolutional neural networks can outperform handcrafted techniques in both keypoint detection [5,6] and descriptor generation [7,8], exhibiting greater resilience to appearance variations and implicitly learning invariances beyond gradient statistics. More recently, several works in semantic SLAM, such as SemanticFusion [9], DS-SLAM [10], and DynaSLAM [11], have incorporated semantic information into localization, aiming to suppress dynamic regions and emphasize semantically meaningful structures.
Despite this progress, challenges remain in achieving robust feature extraction for localization. Traditional handcrafted methods, though efficient, are highly sensitive to illumination changes, viewpoint variations, and dynamic environments. CNN-based approaches alleviate some of these issues but often treat all feature responses uniformly, failing to distinguish between stable cues and unstable details. Semantic SLAM methods further improve robustness by masking dynamic objects, yet their reliance on coarse class-level segmentation prevents finer discrimination within the same semantic region, leaving residual noise to propagate into pose estimation. These limitations highlight the need for a more adaptive mechanism to model feature reliability at a finer granularity.
To address the limitations of CNN-based approaches in distinguishing stable from unstable visual cues, we introduce an attention-driven feature extraction framework. By assigning weights to different feature elements, they enhance the robustness and discriminative power of feature extraction, making them particularly effective in complex and dynamic scenarios. First, a BAM (Bottleneck Attention Module) [12] is applied during the early feature extraction stage to emphasize locally stable keypoints and suppress noisy responses from dynamic regions. Subsequently, a CBAM (Convolutional Block Attention Module) [13] is introduced within the branching process, where it simultaneously refines feature extraction and descriptor generation by adaptively modeling both spatial and channel-wise importance. This dual-attention design produces a more discriminative and reliable descriptor set, directly improving pose estimation accuracy while maintaining adaptability across diverse environmental conditions.
To overcome the limitations of semantic-guided methods that rely on coarse, class-level stability modeling [9,10,11,14], we further propose a fine-grained semantic refinement mechanism. This approach subdivides broad semantic classes into smaller, stability-homogeneous sub-clusters, enabling more accurate suppression of unstable regions such as reflective windows or vegetation while preserving robust structural cues. In addition, a lightweight, rule-based physical prior is incorporated: objects closer to the ground plane tend to be more stable than elevated or suspended structures, consistent with the observation that “lower-layer structures act as a foundation” [15]. Rather than producing an explicit semantic map, these cues are implicitly embedded into the feature extraction process. The network directly outputs keypoints and descriptors enriched with fine-grained stability information, yielding a more discriminative representation while avoiding the computational overhead of dense semantic modeling. Our quantitative analysis confirms that this integration maintains high inference speeds and a low memory footprint, making it suitable for real-time applications. This implicit integration ensures that our method remains lightweight, yet significantly improves the robustness of feature extraction in dynamic and cluttered environments.
The main contributions of this paper are as follows:
  • We propose a physically guided, fine-grained stability modeling framework that dynamically adapts feature learning across semantic and geometric variations, surpassing prior static weighting schemes.
  • We introduce a dual-attention architecture to enhance keypoint stability and descriptor consistency in dynamic environments.
  • We embed semantic cues implicitly into the feature extraction pipeline, achieving robust and real-time localization without explicit segmentation.
The remainder of this article is organized as follows: Section 1 reviews related work on feature detection and description. Section 2 describes our proposed methodology in detail. Section 3 presents extensive experiments and analysis. Section 4 discusses current limitations and outlines future research directions, and finally, Section 5 concludes the paper.

2. Related Work

This section reviews prior research relevant to our work, including traditional handcrafted features, learning-based CNN approaches, and semantic-guided feature extraction methods, followed by a discussion of current limitations that motivate our design.

2.1. Traditional Feature Extraction

Traditional feature extraction methods form the foundation of visual SLAM and odometry, where image-based techniques estimate camera motion by detecting and matching keypoints across frames. Early detectors such as Harris [1], FAST [2], and Shi–Tomasi “good features to track” [16] focus on corners and edges that provide strong local gradients and discriminative patterns, yet they remain sensitive to viewpoint and illumination changes. Subsequent descriptors like SURF (Speeded-Up Robust Features) [17] and ORB [4] improved robustness through rotation- and scale-invariant encoding, coupling detection and description into a unified pipeline. These handcrafted methods offer high computational efficiency and repeatability, and they have long served as standard baselines in classical SLAM and visual odometry systems. However, their reliance on gradient-based heuristics limits generalization to complex real-world environments involving dynamic motion, lighting variations, or textureless regions.

2.2. Learning-Based Feature Extraction (CNN)

Learning-based approaches, particularly those based on convolutional neural networks (CNNs), have demonstrated superior robustness and generalization compared with handcrafted methods. CNN-based detectors such as SIPs [5] learn repeatable keypoints through probabilistic objectives, while D2D [18] reuses descriptor confidences to guide detection, improving localization accuracy without extra supervision. Descriptor learning methods, including AffNet [7], ContextDesc [19], and L2-Net [20], further enhance discriminability and invariance via architectural and loss-function innovations. Unified joint detection–description frameworks like SuperPoint [21], D2Net [22], ASLFeat [23], R2D2 [24], and DISK [25] integrate both stages end-to-end, achieving high consistency between detection and matching. XFeat [26] further optimizes this design by balancing accuracy and efficiency through a lightweight CNN architecture, enabling real-time and hardware-independent feature extraction. Recently, DarkFeat [27] extends CNN-based feature extraction to extreme low-light conditions by directly detecting and describing features from RAW images, achieving state-of-the-art robustness and a 70% reduction in computational cost. Despite these advances, most CNN-based pipelines emphasize per-frame repeatability and neglect long-term temporal or physical consistency, often treating all features equally without distinguishing stable cues from dynamic noise.

2.3. Semantic-Guided Feature Extraction

Beyond purely visual cues, recent research introduces semantic information to enhance robustness in dynamic or perceptually ambiguous scenes. Semantic-aware descriptors [28] embed contextual information into compact representations for improved matching consistency. LLN [29] identifies discriminative landmarks using semantic priors, while [30] leverages semantic consistency to re-rank correspondences under large appearance variations. MS2DG-Net [31] further exploits sparse semantic similarities between paired images to dynamically construct semantic graphs, capturing local topological relationships while maintaining permutation equivariance. Long-term localization research [32] highlights the importance of semantic stability for scene understanding and place recognition in changing environments. Recent work [33] combines semantic and depth information through domain-adaptive feature learning with Generative Adversarial Networks, effectively coupling semantic–depth cues and sequence continuity for more robust long-term visual place recognition. Building on this direction, SFD2 [14] models class-level semantic stability to balance robustness and computational efficiency. Nevertheless, most semantic-guided methods remain coarse in granularity, using fixed category weights that overlook intra-class variations and lack adaptation to physical constraints such as ground contact or structural support.

2.4. Compact Comparison

Table 1 summarizes key limitations of representative method categories and explicitly positions the contribution of the proposed approach with respect to the identified research gap.
The Table 1 highlights that while prior methods have addressed aspects of robustness (e.g., improved descriptors or coarse semantic masking), none simultaneously operate at fine-grained pixel-level semantics, explicitly quantify temporal photometric stability, and incorporate lightweight physical priors to guide stability weighting. Our method fills this gap by (i) deriving fine-grained sub-classes via pixel-level semantic clustering, (ii) measuring temporal photometric stability per sub-class for stability-weighted losses, and (iii) combining these with simple physical priors (e.g., ground proximity) to improve long-term localization robustness.

3. Method

Our method proposes a semantics-guided local feature framework that integrates fine-grained semantic refinement, stability-aware detection, and semantically-refined descriptors enhanced by dual attention modules (Figure 1). Given an input image, a CNN backbone extracts dense features, which are refined via self-supervised semantic clustering. These semantics guide a detection branch that combines repeatability and stability to generate a reliability map, and a descriptor branch that fuses geometric–appearance features with semantic embeddings and attention mechanisms for more discriminative and consistent representations.

3.1. Semantic Refinement

3.1.1. Semantic Clustering

Fine-grained segmentation extends a standard semantic-segmentation CNN by hierarchically subdividing each high-level class into more specific sub-classes, producing a coarse-to-fine label map. Unlike conventional approaches that assign uniform reliability to all pixels within a semantic class, our method enables pixel-level differentiation via self-supervised clustering.
Given dense feature maps { d n } n = 1 N R d , we apply k-means clustering offline as a preprocessing step to obtain m semantic centroids C = [ c 1 , , c m ] R d × m and corresponding one-hot assignments y n { 0 , 1 } m . The clustering objective explicitly minimizes the total within-cluster variance:
min C , { y n } 1 N n = 1 N j = 1 m y n , j d n c j 2 2 , s . t . y n , j { 0 , 1 } , j = 1 m y n , j = 1 .
This standard k-means formulation minimizes the within-cluster sum of squared distances (WCSS), driving each descriptor d n toward its nearest centroid c j . Cluster assignments y n * and centroids C * are iteratively updated within the k-means procedure until convergence.
To maintain balanced partitions and avoid degenerate clusters, any empty cluster c j is reinitialized from a randomly selected non-empty centroid with Gaussian perturbation:
c j c r + ϵ , r { 1 , , m } j , ϵ N ( 0 , σ 2 I ) ,
ensuring that all clusters contain valid pixel embeddings and preventing degenerate partitions during clustering.
Unlike image-level clustering [34], our approach operates at the pixel level and exploits 2D–2D correspondences between frames. This fine-grained clustering produces stability-homogeneous regions that suppress unreliable dynamics while enriching local descriptor diversity. The resulting centroids and assignments encode both semantic and geometric regularities, yielding descriptors that are physically meaningful and temporally consistent.
Note that the clustering process is performed independently of network optimization and does not involve gradient backpropagation or online updates during training. To illustrate this effect, Figure 2 compares segmentation before and after refinement. The ConvNeXt-based semantic map (middle) captures coarse regions but exhibits inconsistent boundaries, whereas our clustering-based refinement (right) generates semantically coherent subregions, providing stronger cues for keypoint detection and descriptor learning.

3.1.2. Fine-Grained Semantic Weight Allocation

To achieve robust long-term localization under dynamic and diverse conditions, we propose a fine-grained semantic weight allocation mechanism that extends beyond coarse class-based stability categories. Inspired by the physical reasoning principle in [15], our method integrates both physical plausibility and semantic granularity into the stability weighting process.
Each semantic class l L is first assigned a physical prior weight w l ( 0 ) reflecting its geometric grounding and motion stability. Objects inherently anchored to the ground (e.g., roads, buildings) are given higher weights, while dynamic or floating entities (e.g., vehicles, pedestrians, sky) are penalized. The initialization is formulated as:
w l ( 0 ) = 1 Z α p P ground ( l ) + α s S static ( l ) ,
where P ground ( l ) [ 0 , 1 ] measures the geometric contact ratio with the ground plane. P ground ( l ) is implemented as a rule-based heuristic computed from the normalized vertical image coordinates. Assuming an upright camera with gravity-aligned orientation, pixels closer to the bottom of the image are assigned higher ground likelihood values, as they are physically more likely to represent grounded surfaces. S static ( l ) [ 0 , 1 ] reflects the likelihood of being static, α p and α s are balancing factors, and Z normalizes the weights. This physically grounded initialization encodes the principle that “cars cannot fly,” ensuring that objects with unrealistic elevation or motion receive lower priors.
To further capture intra-class variations, each coarse semantic class l is decomposed into a set of fine-grained sub-classes C l = { c 1 , c 2 , , c n } obtained from the refined segmentation in Section 3.1. For each sub-class c, we compute a refined stability weight w c by integrating temporal appearance consistency ρ c and geometric priors:
w c = clip [ 0 , 1 ] w l ( 0 ) + β ρ c ρ ¯ l + γ π c ,
where ρ ¯ l = 1 | C l | c C l ρ c denotes the intra-class mean stability. The term π c [ 0 , 1 ] represents a structural stability prior assigned as a fixed scalar for each sub-class based on its typical physical properties (e.g., road surface > car > roof > tree crown). These scalars encode expert knowledge to regularize the self-supervised learning process. The coefficients β and γ control the influence of statistical and geometric refinements, respectively.
While these physical priors are simple heuristics, they effectively guide the model to focus on stable structures. We note that these priors assume a consistent vertical layout common in urban and suburban outdoor environments. For scenarios with non-upright camera configurations or unstructured environments (e.g., aerial or indoor scenes), these priors can be adapted by estimating the gravity direction or simply disabled by setting them to uniform values.

3.2. Semantics-Guided Feature Extraction

Recent work emphasizes local repeatability—the quality of a feature within a single frame. For long-term localization, we decompose reliability into two complementary terms: local repeatability and global stability.

3.2.1. BAM-Based Local Feature Reliability

Local repeatability describes robustness to appearance and viewpoint changes. Learning-based detectors achieve stability either through ground-truth supervision or via descriptor discriminability. The former is usually more robust, yet real ground-truth is scarce. We treat SuperPoint [21] corners as pseudo ground-truth, where G [ 0 , 1 ] H × W denotes the SuperPoint response map.
To enhance the discriminative capacity of the reliability map, we integrate a Bottleneck Attention Module (BAM) [12]. As illustrated in Figure 3, BAM jointly models channel and spatial attention to re-weight feature responses, allowing the network to emphasize informative regions and suppress noisy ones before computing reliability. Given an intermediate feature map F R C × H × W , the refined feature map is defined as
F = F + F M ( F ) ,
where M ( F ) [ 0 , 1 ] C × H × W is the combined attention map and ⊙ denotes element-wise multiplication. Following [12], M ( F ) is computed as
M ( F ) = σ M c ( F ) + M s ( F ) ,
where σ is the sigmoid activation, M c ( F ) and M s ( F ) represent the channel and spatial attention maps, respectively.
Each channel of F encodes a particular semantic response. We first apply global average pooling to obtain a channel descriptor F c = AvgPool ( F ) R C × 1 × 1 . To model inter-channel dependencies, BAM employs a two-layer MLP with reduction ratio r:
M c ( F ) = BN W 1 δ ( W 0 F c + b 0 ) + b 1 ,
where W 0 R C / r × C , W 1 R C × C / r , b 0 , b 1 are biases, δ is ReLU (Rectified Linear Unit), and BN denotes batch normalization to align the scale with the spatial branch.
To capture long-range contextual dependencies, the spatial attention branch aggregates spatial cues using dilated convolutions. The feature map F is first reduced along channels via 1 × 1 convolution ( f 1 × 1 0 ) and then processed by two 3 × 3 dilated convolutions ( f 3 × 3 1 , f 3 × 3 2 ) followed by another 1 × 1 projection:
M s ( F ) = BN ( f 1 × 1 3 ( f 3 × 3 2 ( f 3 × 3 1 ( f 1 × 1 0 ( F ) ) ) ) ) ,
where the dilated convolutions expand the receptive field, enabling the module to infer more context-aware spatial attention.
The final BAM-enhanced feature is then used to compute the refined local reliability:
S rel ( p ) = σ λ , Conv ( F ( p ) ) ,
where λ scales the output to [ 0.05 , 0.95 ] to prevent gradient saturation. This formulation ensures that locally reliable features are emphasized while unstable responses in dynamic regions are suppressed, yielding more robust keypoint detection for long-term localization.

3.2.2. CBAM-Based Global Stability Estimation

Global stability builds upon the semantic class of a pixel. While previous work [14] has made notable progress by partitioning the 120 ADE20K classes into four stability categories, this coarse taxonomy often fails to capture intra-class variability. For instance, tree branches may swing under strong winds and become unstable, yet they are still classified as part of a generally stable class. To address such inconsistencies, we exploit the fine-grained sub-classes obtained in the previous section, subdividing each coarse class into stability-homogeneous regions and adapting their weights instead of relying on fixed values, as illustrated in Figure 4.
To further suppress instability and emphasize semantically reliable regions, we integrate a Convolutional Block Attention Module (CBAM) [13] into the global stability branch, as shown in Figure 5. Let F g R H × W × D denote the backbone features used by the global-stability module. CBAM computes channel and spatial attention maps as follows.
The channel attention is computed by global pooling followed by a shared MLP and sigmoid activation:
M c ( F g ) = σ MLP ( AvgPool c ( F g ) ) + MLP ( MaxPool c ( F g ) ) R D ,
where AvgPool c and MaxPool c denote global average/max pooling over spatial dimensions and σ is the sigmoid.
The feature map is then channel-reweighted:
F g ( p ) = F g ( p ) M c ( F g )
The spatial attention is computed from channel-pooled feature maps and a small convolutional module:
M s ( F g ) = σ Conv [ AvgPool s ( F g ) ; MaxPool s ( F g ) ] R H × W ,
where [ · ; · ] denotes channel-wise concatenation of the pooled maps. The resulting spatial attention scalar at pixel p is
A s ( p ) = M s ( F g ) ( p ) ( 0 , 1 ) .
Intuitively, A s ( p ) highlights spatial locations that are both channel-informative and spatially consistent according to CBAM. We use this spatial attention as a multiplicative refinement of the data-driven/physics-driven stability weight w c (defined below). Formally, let L be the set of coarse semantic labels and C l the sub-classes of coarse class l. For each sub-class c, define the empirical stability ratio
ρ c = N c stable N c ,
where N c denotes the total number of pixels belonging to sub-class c, and N c stable denotes the number of pixels whose photometric error over a temporal validation set is below the threshold τ . We further introduce a physical prior π c [ 0 , 1 ] , with higher values assigned to grounded sub-classes. Based on these quantities, we first construct a base sub-class weight:
w c = w l + β ρ c ρ ¯ l + γ π c , ρ ¯ l = 1 | C l | c C l ρ c ,
and clip w c to [ 0 , 1 ] .
Finally, CBAM’s spatial attention modulates this base weight at pixel level. The pixel-wise global stability is defined as
S sta ( p ) = clip [ 0 , 1 ] w c p · ( 1 λ ) + λ A s ( p ) ,
where c p is the sub-class of pixel p, λ [ 0 , 1 ] controls the influence of CBAM-driven spatial attention, and clip [ 0 , 1 ] enforces the final stability to lie in [ 0 , 1 ] .

3.3. Loss Function with Fine-Grained Semantic Weighting

Our training objective integrates semantic-guided detection and descriptor learning under the proposed fine-grained stability weighting scheme. We first describe the sub-losses and then present the unified objective function.
Detection Loss. The detection branch aims to learn reliable and repeatable keypoints. Given the predicted reliability map S and the target map S g t (Section 3.2), the detection loss is defined as:
L det = BCE ( S , S g t ) ,
where BCE ( · ) denotes binary cross-entropy.
Descriptor Loss. Following prior work [14], we adopt a descriptor loss that jointly optimizes intra-class compactness and inter-class separability. This formulation remains consistent with previous studies; our contribution lies in the integration of fine-grained semantic weighting rather than the loss structure itself. Formally, the descriptor loss for pixel p is expressed as:
L desc ( p ) = L intra ( p ) + L inter ( p ) .
The intra-class loss L intra encourages feature compactness within the same semantic subclass while preserving local diversity. Following the soft-ranking formulation in [14], it is defined as:
L intra ( p ) = 1 AP d p , S p + ,
where d p denotes the descriptor at pixel p, S p + is the set of positive samples sharing the same semantic label, and AP ( · ) measures average precision in retrieval.
The inter-class loss L inter enhances feature separability across different semantic categories and follows the margin-based triplet structure of [14]:
L inter ( p ) = 1 N p ( j , k ) d p d j + 2 2 d p d k 2 2 + m + ,
where d j + and d k are positive and negative samples, m is the margin, [ · ] + = max ( · , 0 ) denotes the hinge operator, and N p is the number of valid triplets.
Fine-Grained Semantic Weighting. Each pixel p is associated with a semantic–physical stability weight w c p [ 0 , 1 ] , derived from physical priors, temporal consistency, and structural depth cues (Section 3.1.2). These weights modulate the contribution of each sample in the loss function, assigning higher importance to geometrically stable and semantically reliable regions while suppressing gradients from dynamic or uncertain areas.
Overall loss. The total training loss combines detection and descriptor objectives under the proposed fine-grained weighting:
L l o s s = p w c p L det ( p ) + λ L intra ( p ) + L inter ( p ) ,
where λ balances the descriptor and detection branches.

4. Experiments

We first give implementation details. Then, we test our method on visual localization tasks in Section 4.1 and analyze the running time in Section 4.2. Finally, we perform an ablation study in Section 4.3.
Implementation Details. The training set comprises reference images from the Aachen v1.0 dataset together with additional web-collected images. As SFD2 [14] and R2D2 [24], we augment the training images via style transfer. To alleviate segmentation noise introduced by stylization, semantic labels for the stylized samples are inferred from their corresponding original images. The network is developed in PyTorch (>=1.8) and optimized with the Adam solver ( β 1 = 0.9, β 2 = 0.9). Training is performed on one RTX 4090 GPU for 40 epochs with a mini-batch size of 4 and a weight-decay coefficient of 4 × 10 4 .

4.1. Localization Test

We tested our method on Aachen (v1.0 and v1.1) and RobotCar-Seasons datasets under various illumination, season, and weather conditions. Aachen v1.0 contains 4328 reference and 922 query images captured around the Aachen city center. Aachen v1.1 expands v1.0 by adding 2369 reference and 93 query images. RoCaS has 26,121 reference and 11,934 query images. It is challenging because of various conditions of day query images and poor lighting of night query images in suburban areas. Following the evaluation protocol of the long-term visual localization benchmark [35], we report the success ratio at the error thresholds of ( 2 ° , 0.25 m), ( 5 ° , 0.5 m), ( 10 ° , 5 m) as metric.
Baselines. We evaluate our model against recent methods that leverage semantic information, including LLN [14,29,31,33,36,37,38,39], as well as approaches based on learned feature representations [3,21,22,23,24,26,40,41]. Following established protocols, we employ the HLoc pipeline for 3D reconstruction and mutual nearest neighbor (MNN) matching. Furthermore, we compare our approach with state-of-the-art learned matchers [42,43,44,45,46,47,48,49]. All reported results are taken either from the visual benchmark [35] or the original publications.
Quantitative Results. Table 2, Table 3 and Table 4 present the localization accuracy on the Aachen (v1.0/v1.1) and RobotCar-Seasons benchmarks. Overall, our method consistently achieves the best or on-par performance across all datasets and conditions, particularly under challenging night and weather scenarios.
Comparison with semantic-based methods (S). Among methods explicitly leveraging semantic cues, LBR and SFD2 exhibit strong baselines due to their use of building-instance matching and stability-driven semantic weighting, respectively. While SFD2 assigns stability through a static, class-based mapping, our method learns a dynamic fine-grained stability field that adapts to intra-class variations and physical scene constraints. Built upon this principle, we introduce a fine-grained semantic weight allocation mechanism that refines class-level stability into sub-class semantics guided by geometric priors. This adaptive design enables the model to better capture subtle variations in motion, structure, and illumination, effectively suppressing unstable regions such as vegetation or reflective surfaces. As shown in Table 2, our method slightly surpasses SFD2 in both day and night conditions on Aachen v1.0 and achieves consistent gains on Aachen v1.1 and RobotCar-Seasons, demonstrating improved robustness in dynamic and low-light environments.
Comparison with learned feature methods (L). Compared with learned feature extractors such as D2Net, R2D2, and ASLFeat achieve higher accuracy thanks to end-to-end descriptor optimization. However, these methods still struggle under illumination changes and dynamic interference. Our semantics-guided model yields superior accuracy and maintains high stability at night, outperforming all learned counterparts. The results confirm that incorporating fine-grained semantic priors within feature extraction effectively enhances descriptor discriminability and localization reliability.
Comparison with Advanced matchers (M). Modern matching frameworks like SuperGlue [42], SGMNet [43], and ClusterGNN [44] improve correspondence consistency through graph reasoning or attention-based matching. Nevertheless, they often rely on computationally intensive post-matching modules. In contrast, our method achieves comparable or better performance using only simple mutual nearest neighbor (MNN) matching, validating that the proposed fine-grained semantic refinement and attention-based feature extraction already yield highly distinctive and geometrically stable features.
As shown in Figure 6, our method achieves more accurate and denser feature correspondences compared to R2D2 and DISK, even under challenging day–night variations. While R2D2 and DISK rely on SuperGlue for correspondence estimation, they still suffer from sparse or unstable matches—R2D2 produces few correspondences in low-light scenes, whereas DISK yields more but less reliable ones. In contrast, our approach directly establishes correspondences using a nearest-neighbor matching strategy, enabled by semantically weighted feature extraction and fine-grained stability refinement. This design effectively suppresses unstable regions while preserving semantically consistent structures, leading to higher inlier ratios and improved robustness under illumination and nighttime conditions.

4.2. Visualization and Effectiveness of Fine-Grained Semantic Weighting

To further validate the effectiveness of the proposed fine-grained semantic weighting mechanism, we visualize the stability-aware segmentation and the corresponding weight heatmap, as shown in Figure 7. The visualization consists of three parts: (i) the fine-grained semantic zone division obtained from self-supervised clustering, (ii) the computed stability heatmap based on semantic, geometric, and physical priors, and (iii) the resulting feature extraction map after applying the proposed weighting.
As observed, the fine-grained segmentation produces semantically coherent yet physically distinct regions, which allow the weighting process to better capture intra-class variations in stability. The stability heatmap assigns higher weights to geometrically grounded and static areas such as roads, walls, and building structures, while suppressing dynamic or weakly constrained regions. This adaptive weighting helps the network focus on physically reliable cues during training, leading to improved consistency in keypoint detection and descriptor learning, particularly under dynamic and low-light scenarios.
Quantitatively, this fine-grained weighting yields more stable localization performance across both static and dynamic sequences, demonstrating the advantage of incorporating physical priors and intra-class semantic distinctions into the feature extraction pipeline.

4.3. Ablation Study

Table 5 presents the ablation results on the Aachen_v1.1 dataset. Starting from the baseline with semantic weighting (SW), introducing the proposed fine-grained weighting (FW) leads to consistent improvements by modeling intra-class stability variations and integrating physical priors. Adding the dual attention (DA) module further enhances robustness by jointly refining spatial and channel-wise cues, allowing the network to better emphasize physically stable regions and suppress transient or ambiguous features. Together, SW, FW, and DA achieve the best performance, improving both day and night localization success ratios, especially under challenging illumination and dynamic conditions.
Table 6 further explores the impact of clustering granularity on the effectiveness of fine-grained weighting by varying the number of clusters k for each semantic class. Increasing k from 2 to 4 leads to a significant performance boost, particularly in night-time queries. This demonstrates that finer subdivisions allow the stability weights to better distinguish between reliable structural elements and unstable dynamic parts within the same semantic category. However, further increasing k to 5 results in marginal performance saturation, suggesting that overly fragmented subdivisions may introduce noise or redundant spatial constraints.
Notably, since our clustering is performed as an offline pre-processing step based on spatial coordinates, it introduces zero computational overhead during the training phase while providing stable and consistent geometric guidance. Consequently, k = 4 is chosen as our default configuration to balance structural granularity and training stability.

5. Limitations and Future Work

Despite the promising results achieved in urban long-term localization, several limitations of the proposed framework remain to be addressed in future research.

5.1. Offline Clustering vs. Online Adaptation

A primary constraint of the current implementation is that the fine-grained semantic sub-classes are generated via an offline k-means clustering process prior to training. While this approach ensures training stability and computational efficiency, it prevents the sub-class boundaries from adapting to the evolving feature space of the encoder during the self-supervised learning process. Future work will explore the integration of online or incremental clustering mechanisms to allow the semantic subdivisions to co-evolve with the feature representations.

5.2. Scope of Generalization

Our experimental evaluation has been primarily focused on urban driving scenarios (Aachen and RobotCar-Seasons), which are characterized by gravity-aligned camera orientations and consistent vertical scene layouts. The performance of the proposed physical priors, such as ground proximity, has not been explicitly validated in diverse domains like indoor environments, aerial platforms, or unstructured off-road scenes. In these scenarios, the “upright camera” assumption may not hold. We plan to extend our framework by incorporating IMU-based gravity estimation or learned spatial priors to enhance its versatility across cross-domain environments.

5.3. Extreme Meteorological Conditions

While our method demonstrates improved robustness to illumination and moderate seasonal shifts, its performance boundaries under more extreme weather conditions, such as dense fog, heavy snowfall, or sandstorms, have not been fully tested. The performance trend observed from the relatively clear Aachen dataset to the more challenging RobotCar-Seasons (which includes rain and light snow) suggests a potential degradation in localization precision when photometric information is severely compromised. Evaluating the model on specialized adverse-weather datasets and developing specialized stability-weighting strategies for these conditions remain key priorities for our future work.

5.4. Dependency on Pre-Trained Segmenters

Lastly, the quality of our fine-grained refinement depends on the initial masks provided by the semantic segmenter. In environments where the segmenter fails (e.g., highly unusual or textureless objects), the stability weights may be sub-optimal. Exploring joint learning of semantic segmentation and feature stability is a promising direction to improve the system’s end-to-end reliability.

6. Conclusions

In this paper, we presented a fine-grained semantics-guided feature extraction framework for robust long-term visual localization. Our approach enhances stability modeling through fine-grained semantic weight allocation, which refines coarse class-level priors using sub-class semantics and geometric constraints. By integrating dual attention mechanisms, the network effectively suppresses dynamic or unstable regions while emphasizing semantically consistent structures. This joint modeling of semantic granularity, physical priors, and attention yields features that are both geometrically distinctive and semantically stable. Extensive experiments on Aachen and RobotCar-Seasons benchmarks demonstrate that our method outperforms existing semantic and learned feature baselines, achieving superior robustness under challenging illumination, weather, and viewpoint variations while maintaining real-time performance.

Author Contributions

Conceptualization, D.W. and H.S.; methodology, D.W. and K.Z.; software, D.W. and K.Z.; validation, D.W., K.Z. and F.Z.; formal analysis, D.W. and K.Z.; investigation, D.W.; resources, H.S. and M.K.; data curation, D.W. and F.Z.; writing—original draft preparation, K.Z.; writing—review and editing, D.W., H.S. and F.Z.; visualization, K.Z.; supervision, H.S. and M.K.; project administration, H.S.; funding acquisition, H.S. and M.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by by the Open Foundation of the State Key Laboratory of Precision Space-time Information Sensing Technology No. STL2023-B-06-01(K) and the Academic Research Projects of Beijing Union University (No. ZK20202201).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author due to privacy restrictions.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
SLAMSimultaneous localization and mapping
BAMBottleneck Attention Module
CBAMConvolutional Block Attention Module
CNNConvolutional Neural Network
SWSemantic weighting
FWFine-grained weighting
DADual attention module

References

  1. Harris, C.; Stephens, M. A combined corner and edge detector. In Proceedings of the Alvey Vision Conference, Manchester, UK, 31 August–2 September 1988; Volume 15, pp. 10–5244. [Google Scholar]
  2. Rosten, E.; Drummond, T. Machine learning for high-speed corner detection. In European Conference on Computer Vision; Springer: Berlin/Heidelberg, Germany, 2006; pp. 430–443. [Google Scholar]
  3. Lowe, D.G. Distinctive image features from scale-invariant keypoints. Int. J. Comput. Vis. 2004, 60, 91–110. [Google Scholar] [CrossRef]
  4. Rublee, E.; Rabaud, V.; Konolige, K.; Bradski, G. ORB: An efficient alternative to SIFT or SURF. In Proceedings of the 2011 International Conference on Computer Vision, Barcelona, Spain, 6–13 November 2011; pp. 2564–2571. [Google Scholar]
  5. Cieslewski, T.; Derpanis, K.G.; Scaramuzza, D. Sips: Succinct interest points from unsupervised inlierness probability learning. In Proceedings of the 2019 International Conference on 3D Vision (3DV), Québec, QC, Canada, 16–19 September 2019; pp. 604–613. [Google Scholar]
  6. Suwanwimolkul, S.; Komorita, S.; Tasaka, K. Learning of low-level feature keypoints for accurate and robust detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Virtual, 5–9 January 2021; pp. 2262–2271. [Google Scholar]
  7. Mishkin, D.; Radenovic, F.; Matas, J. Repeatability is not enough: Learning affine regions via discriminability. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 284–300. [Google Scholar]
  8. Dusmanu, M.; Miksik, O.; Schönberger, J.L.; Pollefeys, M. Cross-descriptor visual localization and mapping. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 11–17 October 2021; pp. 6058–6067. [Google Scholar]
  9. McCormac, J.; Handa, A.; Davison, A.; Leutenegger, S. Semanticfusion: Dense 3D semantic mapping with convolutional neural networks. In Proceedings of the 2017 IEEE International Conference on Robotics and automation (ICRA), Singapore, 29 May–3 June 2017; pp. 4628–4635. [Google Scholar]
  10. Yu, C.; Liu, Z.; Liu, X.J.; Xie, F.; Yang, Y.; Wei, Q.; Fei, Q. DS-SLAM: A semantic visual SLAM towards dynamic environments. In Proceedings of the 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Madrid, Spain, 1–5 October 2018; pp. 1168–1174. [Google Scholar]
  11. Bescos, B.; Fácil, J.M.; Civera, J.; Neira, J. DynaSLAM: Tracking, mapping, and inpainting in dynamic scenes. IEEE Robot. Autom. Lett. 2018, 3, 4076–4083. [Google Scholar] [CrossRef]
  12. Park, J.; Woo, S.; Lee, J.Y.; Kweon, I.S. A simple and light-weight attention module for convolutional neural networks. Int. J. Comput. Vis. 2020, 128, 783–798. [Google Scholar] [CrossRef]
  13. Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
  14. Xue, F.; Budvytis, I.; Cipolla, R. Sfd2: Semantic-guided feature detection and description. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 5206–5216. [Google Scholar]
  15. Choi, S.; Kim, J.T.; Choo, J. Cars can’t fly up in the sky: Improving urban-scene segmentation via height-driven attention networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 9373–9383. [Google Scholar]
  16. Shi, J. Good features to track. In Proceedings of the 1994 Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 21–23 June 1994; pp. 593–600. [Google Scholar]
  17. Bay, H.; Tuytelaars, T.; Van Gool, L. Surf: Speeded up robust features. In European Conference on Computer Vision; Springer: Berlin/Heidelberg, Germany, 2006; pp. 404–417. [Google Scholar]
  18. Tian, Y.; Balntas, V.; Ng, T.; Barroso-Laguna, A.; Demiris, Y.; Mikolajczyk, K. D2D: Keypoint extraction with describe to detect approach. In Proceedings of the Asian Conference on Computer Vision, Kyoto, Japan, 30 November–4 December 2020. [Google Scholar]
  19. Luo, Z.; Shen, T.; Zhou, L.; Zhang, J.; Yao, Y.; Li, S.; Fang, T.; Quan, L. Contextdesc: Local descriptor augmentation with cross-modality context. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–17 June 2019; pp. 2527–2536. [Google Scholar]
  20. Tian, Y.; Fan, B.; Wu, F. L2-net: Deep learning of discriminative patch descriptor in euclidean space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 661–669. [Google Scholar]
  21. DeTone, D.; Malisiewicz, T.; Rabinovich, A. Superpoint: Self-supervised interest point detection and description. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, Salt Lake City, UT, USA, 18–22 June 2018; pp. 224–236. [Google Scholar]
  22. Dusmanu, M.; Rocco, I.; Pajdla, T.; Pollefeys, M.; Sivic, J.; Torii, A.; Sattler, T. D2-net: A trainable cnn for joint description and detection of local features. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–17 June 2019; pp. 8092–8101. [Google Scholar]
  23. Luo, Z.; Zhou, L.; Bai, X.; Chen, H.; Zhang, J.; Yao, Y.; Li, S.; Fang, T.; Quan, L. Aslfeat: Learning local features of accurate shape and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 6589–6598. [Google Scholar]
  24. Revaud, J.; De Souza, C.; Humenberger, M.; Weinzaepfel, P. R2d2: Reliable and repeatable detector and descriptor. Adv. Neural Inf. Process. Syst. 2019, 32, 12414–12424. [Google Scholar]
  25. Tyszkiewicz, M.; Fua, P.; Trulls, E. Disk: Learning local features with policy gradient. Adv. Neural Inf. Process. Syst. 2020, 33, 14254–14265. [Google Scholar]
  26. Potje, G.; Cadar, F.; Araujo, A.; Martins, R.; Nascimento, E.R. Xfeat: Accelerated features for lightweight image matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 16–22 June 2024; pp. 2682–2691. [Google Scholar]
  27. He, Y.; Hu, Y.; Zhao, W.; Li, J.; Liu, Y.J.; Han, Y.; Wen, J. DarkFeat: Noise-robust feature detector and descriptor for extremely low-light RAW images. In Proceedings of the AAAI Conference on Artificial Intelligence, Montréal, QC, Canada, 8–10 August 2023; Volume 37, pp. 826–834. [Google Scholar]
  28. Naseer, T.; Oliveira, G.L.; Brox, T.; Burgard, W. Semantics-aware visual localization under challenging perceptual conditions. In Proceedings of the 2017 IEEE International Conference on Robotics and Automation (ICRA), Singapore, 29 May–3 June 2017; pp. 2614–2620. [Google Scholar]
  29. Xin, Z.; Cai, Y.; Lu, T.; Xing, X.; Cai, S.; Zhang, J.; Yang, Y.; Wang, Y. Localizing discriminative visual landmarks for place recognition. In Proceedings of the 2019 International Conference on Robotics and Automation (ICRA), Montreal, QC, Canada, 20–24 May 2019; pp. 5979–5985. [Google Scholar]
  30. Toft, C.; Stenborg, E.; Hammarstrand, L.; Brynte, L.; Pollefeys, M.; Sattler, T.; Kahl, F. Semantic match consistency for long-term visual localization. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 383–399. [Google Scholar]
  31. Dai, L.; Liu, Y.; Ma, J.; Wei, L.; Lai, T.; Yang, C.; Chen, R. MS2DG-Net: Progressive correspondence learning via multiple sparse semantics dynamic graph. In Proceedings of the IEEE/CVF conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–22 June 2022; pp. 8973–8982. [Google Scholar]
  32. Stenborg, E.; Toft, C.; Hammarstrand, L. Long-term visual localization using semantically segmented images. In Proceedings of the 2018 IEEE International Conference on Robotics and Automation (ICRA), Brisbane, Australia, 21–25 May 2018; pp. 6484–6490. [Google Scholar]
  33. Tan, Y.; Ji, P.; Zhang, Y.; Ge, F.; Zhu, S. Learning robust representation and sequence constraint for retrieval-based long-term visual place recognition. Eng. Appl. Artif. Intell. 2024, 138, 109425. [Google Scholar] [CrossRef]
  34. Caron, M.; Bojanowski, P.; Joulin, A.; Douze, M. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 132–149. [Google Scholar]
  35. Sattler, T.; Maddern, W.; Toft, C.; Torii, A.; Hammarstrand, L.; Stenborg, E.; Safari, D.; Okutomi, M.; Pollefeys, M.; Sivic, J.; et al. Benchmarking 6dof outdoor visual localization in changing conditions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8601–8610. [Google Scholar]
  36. Xue, F.; Budvytis, I.; Reino, D.O.; Cipolla, R. Efficient large-scale localization by global instance recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 17348–17357. [Google Scholar]
  37. Shi, T.; Shen, S.; Gao, X.; Zhu, L. Visual localization using sparse semantic 3D map. In Proceedings of the 2019 IEEE International Conference on Image Processing (ICIP), Taipei, Taiwan, 22–25 September 2019; pp. 315–319. [Google Scholar]
  38. Hu, H.; Qiao, Z.; Cheng, M.; Liu, Z.; Wang, H. Dasgil: Domain adaptation for semantic and geometric-aware image-based localization. IEEE Trans. Image Process. 2020, 30, 1342–1353. [Google Scholar] [CrossRef] [PubMed]
  39. Anoosheh, A.; Sattler, T.; Timofte, R.; Pollefeys, M.; Van Gool, L. Night-to-day image translation for retrieval-based localization. In Proceedings of the 2019 International Conference on Robotics and Automation (ICRA), Montreal, QC, Canada, 20–24 May 2019; pp. 5958–5964. [Google Scholar]
  40. Tian, Y.; Yu, X.; Fan, B.; Wu, F.; Heijnen, H.; Balntas, V. Sosnet: Second order similarity regularization for local descriptor learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–17 June 2019; pp. 11016–11025. [Google Scholar]
  41. Li, K.; Wang, L.; Liu, L.; Ran, Q.; Xu, K.; Guo, Y. Decoupling makes weakly supervised local feature better. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 15838–15848. [Google Scholar]
  42. Sarlin, P.E.; DeTone, D.; Malisiewicz, T.; Rabinovich, A. Superglue: Learning feature matching with graph neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 4938–4947. [Google Scholar]
  43. Chen, H.; Luo, Z.; Zhang, J.; Zhou, L.; Bai, X.; Hu, Z.; Tai, C.L.; Quan, L. Learning to match features with seeded graph matching network. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 6301–6310. [Google Scholar]
  44. Shi, Y.; Cai, J.X.; Shavit, Y.; Mu, T.J.; Feng, W.; Zhang, K. Clustergnn: Cluster-based coarse-to-fine graph neural network for efficient feature matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 12517–12526. [Google Scholar]
  45. Chen, H.; Luo, Z.; Zhou, L.; Tian, Y.; Zhen, M.; Fang, T.; Mckinnon, D.; Tsin, Y.; Quan, L. Aspanformer: Detector-free image matching with adaptive span transformer. In European Conference on Computer Vision; Springer Nature: Cham, Switzerland, 2022; pp. 20–36. [Google Scholar]
  46. Sun, J.; Shen, Z.; Wang, Y.; Bao, H.; Zhou, X. LoFTR: Detector-free local feature matching with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 8922–8931. [Google Scholar]
  47. Liu, X.; Qin, R.; Yan, J.; Yang, J. Ncmnet: Neighbor consistency mining network for two-view correspondence pruning. IEEE Trans. Pattern Anal. Mach. Intell. 2024, 46, 11254–11272. [Google Scholar] [CrossRef] [PubMed]
  48. Gong, Z.; Xiao, G.; Shi, Z.; Chen, R.; Yu, J. MSGA-Net: Progressive feature matching via multi-layer sparse graph attention. IEEE Trans. Circuits Syst. Video Technol. 2024, 34, 5765–5775. [Google Scholar] [CrossRef]
  49. Giang, K.T.; Song, S.; Jo, S. Learning to produce semi-dense correspondences for visual localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 16–22 June 2024; pp. 19468–19478. [Google Scholar]
  50. Li, Z.; Ma, J. Learning feature matching via matchable keypoint-assisted graph neural network. IEEE Trans. Image Process. 2024, 34, 154–169. [Google Scholar] [CrossRef] [PubMed]
  51. Germain, H.; Bourmaud, G.; Lepetit, V. S2DNet: Learning image features for accurate sparse-to-dense matching. In European Conference on Computer Vision; Springer International Publishing: Cham, Switzerland, 2020; pp. 626–643. [Google Scholar]
  52. Jiang, X.; Wang, F.; Galliani, S.; Vogel, C.; Pollefeys, M. R-score: Revisiting scene coordinate regression for robust large-scale visual localization. In Proceedings of the Computer Vision and Pattern Recognition Conference, Nashville, TN, USA, 15–18 October 2025; pp. 11536–11546. [Google Scholar]
  53. Wang, Q.; Zhou, X.; Hariharan, B.; Snavely, N. Learning feature descriptors using camera pose supervision. In European Conference on Computer Vision; Springer International Publishing: Cham, Switzerland, 2020; pp. 757–774. [Google Scholar]
  54. Sarlin, P.E.; Unagar, A.; Larsson, M.; Germain, H.; Toft, C.; Larsson, V.; Pollefeys, M.; Lepetit, V.; Hammarstrand, L.; Kahl, F.; et al. Back to the feature: Learning robust camera localization from pixels to pose. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 3247–3257. [Google Scholar]
  55. Germain, H.; Bourmaud, G.; Lepetit, V. Sparse-to-dense hypercolumn matching for long-term visual localization. In Proceedings of the 2019 International Conference on 3D Vision (3DV), Quebec City, QC, Canada, 16–19 September 2019; pp. 513–523. [Google Scholar]
Figure 1. Overview of the proposed network architecture. The model integrates semantic understanding and stability estimation through two stages: coarse semantic extraction with physics-aware priors, and fine-grained weighting guided by CBAM (Convolutional Block Attention Module) during keypoint and descriptor generation. This design allows the network to adaptively emphasize semantically stable and physically consistent regions.
Figure 1. Overview of the proposed network architecture. The model integrates semantic understanding and stability estimation through two stages: coarse semantic extraction with physics-aware priors, and fine-grained weighting guided by CBAM (Convolutional Block Attention Module) during keypoint and descriptor generation. This design allows the network to adaptively emphasize semantically stable and physically consistent regions.
Jimaging 12 00085 g001
Figure 2. Illustration of semantic segmentation limitations in localization. (a) Input image. (b) Coarse and inconsistent region labeling from the standard ConvNeXt-based segmentation network. (c) Our refined segmentation with significantly richer semantics and finer spatial granularity.
Figure 2. Illustration of semantic segmentation limitations in localization. (a) Input image. (b) Coarse and inconsistent region labeling from the standard ConvNeXt-based segmentation network. (c) Our refined segmentation with significantly richer semantics and finer spatial granularity.
Jimaging 12 00085 g002
Figure 3. BAM (Bottleneck Attention Module) enhances local feature reliability via dual attention. Channel attention refines keypoints through pooled MLP normalization, while spatial attention fuses semantic cues and physical priors to form fine-grained stability weights.
Figure 3. BAM (Bottleneck Attention Module) enhances local feature reliability via dual attention. Channel attention refines keypoints through pooled MLP normalization, while spatial attention fuses semantic cues and physical priors to form fine-grained stability weights.
Jimaging 12 00085 g003
Figure 4. Semantics-guided feature extraction and stability-aware keypoint selection. The different colored zones in (c) denote the fine-grained semantic categories used to guide the filtering process. (a) Keypoints extracted by SPP (SuperPoint) [21], where features are densely detected but include points from unstable or dynamic regions. (b) Fine-grained semantic segmentation result, which provides pixel-level stability cues and highlights potentially unstable regions. (c) Keypoints produced by our method after semantic and stability filtering, where keypoints in unstable regions are suppressed, resulting in more reliable and semantically consistent features for long-term localization.
Figure 4. Semantics-guided feature extraction and stability-aware keypoint selection. The different colored zones in (c) denote the fine-grained semantic categories used to guide the filtering process. (a) Keypoints extracted by SPP (SuperPoint) [21], where features are densely detected but include points from unstable or dynamic regions. (b) Fine-grained semantic segmentation result, which provides pixel-level stability cues and highlights potentially unstable regions. (c) Keypoints produced by our method after semantic and stability filtering, where keypoints in unstable regions are suppressed, resulting in more reliable and semantically consistent features for long-term localization.
Jimaging 12 00085 g004
Figure 5. CBAM (Convolutional Block Attention Module) refines global stability estimation via dual attention. Channel attention branch aggregates local keypoints through average and max pooling followed by two-layer MLPs (Multilayer Perceptron) to generate global keypoints. Spatial attention branch fuses the pooled features and fine-grained semantic cues via a 7 × 7 convolution to produce the final stability-aware weighting map.
Figure 5. CBAM (Convolutional Block Attention Module) refines global stability estimation via dual attention. Channel attention branch aggregates local keypoints through average and max pooling followed by two-layer MLPs (Multilayer Perceptron) to generate global keypoints. Spatial attention branch fuses the pooled features and fine-grained semantic cues via a 7 × 7 convolution to produce the final stability-aware weighting map.
Jimaging 12 00085 g005
Figure 6. Comparison of feature matching performance under challenging conditions. (a) Our proposed method; (b) R2D2 [24]; (c) DISK [25]. Our model provides more reliable inliers and denser correspondences compared to other learned features.
Figure 6. Comparison of feature matching performance under challenging conditions. (a) Our proposed method; (b) R2D2 [24]; (c) DISK [25]. Our model provides more reliable inliers and denser correspondences compared to other learned features.
Jimaging 12 00085 g006
Figure 7. Visualization of the proposed fine-grained semantic weights and dual-attention responses. The different colored zones in (a) represent the clustered fine-grained semantic regions, while the colored dots in (c) visualize the extracted feature points where the colors reflect the semantic refinement and stability responses derived from (b). (a) Fine-grained semantic zone division obtained from self-supervised clustering; (b) stability weight heatmap where red represents high stability and blue represents low weight; (c) resulting feature extraction map. The weighting mechanism effectively emphasizes physically stable and semantically consistent regions while suppressing dynamic or uncertain areas.
Figure 7. Visualization of the proposed fine-grained semantic weights and dual-attention responses. The different colored zones in (a) represent the clustered fine-grained semantic regions, while the colored dots in (c) visualize the extracted feature points where the colors reflect the semantic refinement and stability responses derived from (b). (a) Fine-grained semantic zone division obtained from self-supervised clustering; (b) stability weight heatmap where red represents high stability and blue represents low weight; (c) resulting feature extraction map. The weighting mechanism effectively emphasizes physically stable and semantically consistent regions while suppressing dynamic or uncertain areas.
Jimaging 12 00085 g007
Table 1. Comparison of representative methods and our positioning.
Table 1. Comparison of representative methods and our positioning.
CategoryKey LimitationsProposed Contribution & Gap Addressing
HandcraftedIllum./viewpoint sensitivity; lack of semantic/temporal context.Gap: No scene understanding. Ours: Robustness via semantic guidance and stability weighting.
Learning-basedFocus on patch repeatability; ignore pixel-level temporal consistency.Gap: No long-term stability modeling. Ours: Self-supervised stability supervision via pixel clustering.
Semantic-aidedCoarse class-level masks; neglect intra-class heterogeneity.Gap: Coarse granularity. Ours: Subdivides classes into fine-grained sub-classes via physical priors.
Ours (SREF)Integrated Framework: Fuses fine-grained semantics, temporal stability, and physical priors.
Table 2. Quantitative evaluation of localization performance on the Aachen v1.0 benchmark across day and night conditions. Precision rates (%) are reported at three standard pose error thresholds: T1 ( 0 . 2 ° , 0.25 m), T2 ( 5 ° , 0.5 m), and T3 ( 10 ° , 5 m). Methods are grouped into: (S) semantic-based approaches, (L) local feature-based extractors, and (M) advanced matching pipelines. Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
Table 2. Quantitative evaluation of localization performance on the Aachen v1.0 benchmark across day and night conditions. Precision rates (%) are reported at three standard pose error thresholds: T1 ( 0 . 2 ° , 0.25 m), T2 ( 5 ° , 0.5 m), and T3 ( 10 ° , 5 m). Methods are grouped into: (S) semantic-based approaches, (L) local feature-based extractors, and (M) advanced matching pipelines. Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
GroupMethodDay (T1/T2/T3)Night (T1/T2/T3)FPS ↑Mem. (MB) ↓
SSSM [37]71.8/91.5/96.858.2/76.5/90.815.2458.6
LLN [29]62.4/71.8/79.935.7/44.9/54.111.1324.2
MS2DG [31]85.7/93.9/97.972.4/82.7/92.910.5892.5
LBR [36]88.3/95.6/98.884.7/93.9/100.018.5645.8
SFD2 [14]88.2/96.0/98.787.8/94.9/100.030.11184.3
OURS88.8/96.4/98.588.1/95.0/100.024.6584.2
LSPP [21]80.5/87.4/94.242.9/62.2/76.576.3412.7
D2Net [22]84.8/92.6/97.584.7/90.8/96.92.41846.5
XFeat [26]84.7/91.5/96.577.6/89.8/98.055.0286.3
R2D2 [24]-76.5/90.8/100.013.81422.0
PoSFeat [41]-81.6/90.8/100.08.4954.1
ASLFeat [23]-81.6/87.8/100.08.91104.2
OURS88.8/96.4/98.588.1/95.0/100.024.6584.2
MDeViLoc [49]87.4/94.8/98.287.8/93.9/100.01.23215.7
MakeGNN [50]83.9/91.3/95.666.3/75.5/87.84.52108.4
MSGA [48]83.4/92.0/96.766.3/89.8/96.63.82412.3
S2DNet [51]84.5/90.3/95.374.5/82.7/94.92.12806.5
NCMNet [47]84.2/92.5/96.048.2/59.7/75.46.41910.8
SPP+SPG [21,42]89.6/95.4/98.886.7/93.9/100.06.81512.6
SPP+SGMNet [21,43]86.8/94.2/97.783.7/91.8/99.010.21208.4
SPP+CluGNN [44]89.4/95.5/98.581.6/93.9/100.07.11815.3
R-SCoRe [52]74.8/86.9/96.464.3/89.8/96.913.852.4
OURS88.8/96.4/98.588.1/95.0/100.024.6584.2
Note: Bold values indicate the best performance; ↑ and ↓ indicate that higher and lower values are better, respectively; italics are used for environmental condition headers.
Table 3. Localization results on the Aachen v1.1 dataset, which contains expanded reference imagery and more challenging night-time queries compared to v1.0. Precision rates (%) are measured against standard thresholds T1–T3. This table highlights our performance relative to (L) local feature descriptors and (M) sophisticated matching-based frameworks. Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
Table 3. Localization results on the Aachen v1.1 dataset, which contains expanded reference imagery and more challenging night-time queries compared to v1.0. Precision rates (%) are measured against standard thresholds T1–T3. This table highlights our performance relative to (L) local feature descriptors and (M) sophisticated matching-based frameworks. Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
GroupMethodDay (T1/T2/T3)Night (T1/T2/T3)FPS ↑Mem.(MB) ↓
LSPP [21]87.9/93.6/96.870.2/84.8/93.776.1414.2
D2Net [22]84.1/91.0/95.563.4/83.8/92.12.31848.1
R2D2 [24]88.8/95.3/97.872.3/88.5/94.213.61425.4
ASLFeat [23]88.0/95.4/98.270.7/84.3/94.28.81107.5
CAPS+SIFT [3,53]82.4/91.3/95.961.3/83.8/95.310.41015.6
PoSFeat [41]-73.8/87.4/98.48.3958.2
OURS89.6/96.7/99.579.4/92.8/99.924.4586.8
MSPP+SGMNet [21,43]88.7/96.2/98.975.9/89.0/99.010.11211.3
SPP+SPG [21,42]89.8/96.1/99.477.0/90.6/100.06.71516.4
NCMNet [47]82.6/91.9/97.231.4/38.7/45.56.31914.5
LoFTR [46]88.7/95.6/99.078.5/90.6/99.04.02849.2
ASpanFormer [45]89.4/95.6/99.077.5/91.6/99.53.43112.5
OURS89.6/96.7/99.579.4/92.8/99.924.4586.8
Note: Bold values indicate the best performance; ↑ and ↓ indicate that higher and lower values are better, respectively; italics are used for environmental condition headers.
Table 4. Localization results on the RobotCar-Seasons dataset. Precision rates (%) are reported at thresholds T1: (0.2°, 0.25 m), T2: (5°, 0.5 m), T3: (10°, 5 m). Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
Table 4. Localization results on the RobotCar-Seasons dataset. Precision rates (%) are reported at thresholds T1: (0.2°, 0.25 m), T2: (5°, 0.5 m), T3: (10°, 5 m). Inference efficiency is quantified via frames per second (FPS) and peak GPU memory consumption (MB) to illustrate the trade-off between accuracy and resource usage.
GroupMethodDay (T1–T3)Night (T1–T3)N-Rain (T1–T3)FPS ↑Mem. (MB) ↓
SSSM [37]54.5/81.6/96.710.0/23.7/45.414.5/33.2/47.515.0462.1
LLN [29]7.9/30.0/85.911.9/26.0/55.015.7/34.5/60.510.9327.5
DASGIL-FD [38]8.7/30.7/81.31.6/4.8/19.91.8/4.3/21.614.6514.8
ToDayGAN [39]52.2/80.1/95.916.4/43.2/73.324.1/50.5/74.18.31209.3
SFD2 [14]56.9/81.6/97.427.6/66.2/90.243.0/71.1/90.029.81188.6
LBR [36]56.7/81.7/98.224.9/62.3/86.147.5/73.4/90.018.2649.2
Method [33]8.4/29.2/86.93.9/9.5/33.11.8/5.9/19.112.3558.7
OURS57.2/81.8/97.228.4/67.5/91.144.1/71.5/90.424.2589.5
LSPP [21]56.5/81.5/97.116.9/41.6/71.522.0/45.0/68.075.8418.3
D2Net [22]54.5/80.0/95.318.0/39.7/53.922.7/40.5/56.12.31852.4
R2D2 [24]57.4/81.9/97.918.3/43.4/67.829.1/50.2/68.213.51428.1
CAPS [53]56.0/81.5/96.521.9/54.3/86.827.0/58.9/85.910.31018.6
ASLFeat [23]57.1/81.9/98.423.5/55.9/80.141.1/66.8/86.18.71110.4
OURS57.2/81.8/97.228.4/67.5/91.144.1/71.5/90.424.2589.5
MSPP+SPG [21,42]56.9/81.7/98.124.2/62.6/87.442.3/69.3/90.26.61519.2
DeViLoc [49]56.9/81.8/98.031.3/68.9/92.443.9/77.3/95.51.13224.5
Pixloc [54]56.9/82.0/98.124.2/62.8/88.445.5/72.5/90.70.54132.6
AHM [55]45.7/78.0/95.116.2/55.3/93.628.4/68.4/95.52.72519.8
OURS57.2/81.8/97.228.4/67.5/91.144.1/71.5/90.424.2589.5
Note: Bold values indicate the best performance; ↑ and ↓ indicate that higher and lower values are better, respectively; italics are used for environmental condition headers.
Table 5. Ablation study on Aachen_v1.1 dataset. SW: Semantic Weighting, FW: Fine-grained Weighting, DA: Dual Attention.
Table 5. Ablation study on Aachen_v1.1 dataset. SW: Semantic Weighting, FW: Fine-grained Weighting, DA: Dual Attention.
SWFWDASuccess Ratio (%)
DayNight
(0.2°, 0.25 m)/(5°, 0.5 m)/(10°, 5 m)
85.2/92.4/98.176.3/85.7/96.5
87.9/94.1/98.875.0/86.2/97.7
89.6/96.4/99.579.4/92.8/99.9
91.3/97.5/99.882.1/94.6/100.0
Note: The check marks (✓) indicate the components selected for each experimental configuration; bold values represent the best results for each evaluation metric; italics are used for environmental condition headers.
Table 6. Sensitivity to the number of clusters k (Aachen_v1.1). Success ratios are shown for thresholds ( 0.2 , 0.25 m ) / ( 5 , 0.5 m ) / ( 10 , 5 m ) .
Table 6. Sensitivity to the number of clusters k (Aachen_v1.1). Success ratios are shown for thresholds ( 0.2 , 0.25 m ) / ( 5 , 0.5 m ) / ( 10 , 5 m ) .
ExperimentSettingDayNight
Number of clusters k k = 2 85.2/92.4/98.176.3/85.7/96.5
k = 3 89.6/96.4/99.579.4/92.8/99.9
k = 4 91.3/97.5/99.882.1/94.6/100.0
k = 5 91.0/97.3/99.781.8/94.3/100.0
Note: Bold values indicate the best results for each evaluation metric; italics are used for environmental condition headers.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wu, D.; Zhu, K.; Shi, H.; Zhou, F.; Kuang, M. SREF: Semantics-Refined Feature Extraction for Long-Term Visual Localization. J. Imaging 2026, 12, 85. https://doi.org/10.3390/jimaging12020085

AMA Style

Wu D, Zhu K, Shi H, Zhou F, Kuang M. SREF: Semantics-Refined Feature Extraction for Long-Term Visual Localization. Journal of Imaging. 2026; 12(2):85. https://doi.org/10.3390/jimaging12020085

Chicago/Turabian Style

Wu, Danfeng, Kaifeng Zhu, Heng Shi, Fenfen Zhou, and Minchi Kuang. 2026. "SREF: Semantics-Refined Feature Extraction for Long-Term Visual Localization" Journal of Imaging 12, no. 2: 85. https://doi.org/10.3390/jimaging12020085

APA Style

Wu, D., Zhu, K., Shi, H., Zhou, F., & Kuang, M. (2026). SREF: Semantics-Refined Feature Extraction for Long-Term Visual Localization. Journal of Imaging, 12(2), 85. https://doi.org/10.3390/jimaging12020085

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop