Paper deep dive
Attending to Routers Aids Indoor Wireless Localization
Ayush Roy, Tahsin Fuad Hassan, Roshan Ayyalasomayajula, Vishnu Suresh Lokhande
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 90%
Last extracted: 7/21/2026, 1:29:34 AM
Summary
This paper introduces 'Attention to Routers,' a method that integrates channel-wise attention mechanisms into machine learning-based indoor wireless localization models. By adaptively weighting the contributions of different Wi-Fi access points (routers) during information aggregation, the model improves localization accuracy, particularly in challenging environments with multipath interference or Non-Line of Sight conditions. The approach outperforms baseline architectures by over 30% in accuracy, reducing median localization error significantly.
Entities (8)
Relation Signals (6)
Attention to Routers → improves → Wi-Fi Localization
confidence 95% · emphasizing the relevance of each router can substantially improve overall performance
Attention to Routers → reduces → Localization Error
confidence 93% · achieves a 28.7% reduction in median error
Attention to Routers → uses → Access Point
confidence 92% · ensuring that each router's contribution is weighted differently when aggregating information from multiple routers
Attention to Routers → outperforms → DLoc
confidence 90% · Attention to Routers outperforms the benchmark architecture by over 30% in accuracy
Encoder-Decoder Architecture → incorporates → Attention to Routers
confidence 88% · we apply attention over the encoder’s embeddings in the encoder-decoder model
Attention to Routers → processes → Channel State Information
confidence 85% · converting raw channel state information (CSI) through angle-of-arrival (AoA) and time-of-flight (ToF) processing
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Modern machine learning-based wireless localization using Wi-Fi signals continues to face significant challenges in achieving groundbreaking performance across diverse environments. A major limitation is that most existing algorithms do not appropriately weight the information from different routers during aggregation, resulting in suboptimal convergence and reduced accuracy. Motivated by traditional weighted triangulation methods, this paper introduces the concept of attention to routers, ensuring that each router's contribution is weighted differently when aggregating information from multiple routers for triangulation. We demonstrate, by incorporating attention layers into a standard machine learning localization architecture, that emphasizing the relevance of each router can substantially improve overall performance. We have also shown through evaluation over the open-sourced datasets and demonstrate that Attention to Routers outperforms the benchmark architecture by over 30% in accuracy.
Tags
Links
- Source: https://arxiv.org/abs/2602.16762v1
- Canonical: https://arxiv.org/abs/2602.16762v1
Trouble viewing inline? Open PDF directly →
Full Text
22,571 characters extracted from source content.
Expand or collapse full text
Attending to Routers Aids Indoor Wireless Localization†thanks: Accepted at the AAAI 2026 Workshop on Machine Learning for Wireless Communication and Networks (ML4Wireless) Ayush Roy, Tahsin Fuad Hassan†, Roshan Ayyalasomayajula, Vishnu Suresh Lokhande Equal contributions. Abstract Modern machine learning-based wireless localization using Wi-Fi signals continues to face significant challenges in achieving groundbreaking performance across diverse environments. A major limitation is that most existing algorithms do not appropriately weight the information from different routers during aggregation, resulting in suboptimal convergence and reduced accuracy. Motivated by traditional weighted triangulation methods, this paper introduces the concept of attention to routers, ensuring that each router’s contribution is weighted differently when aggregating information from multiple routers for triangulation. We demonstrate, by incorporating attention layers into a standard machine learning localization architecture, that emphasizing the relevance of each router can substantially improve overall performance. We have also shown through evaluation over the open-sourced datasets and demonstrate that Attention to Routers outperforms the benchmark architecture by over 30% in accuracy. Dataset: https://github.com/ucsdwcsng/DLoc˙pt˙code/blob/main/wild.mdDataset Code: https://github.com/AyushRoy2001/Attending-to-RoutersCode Introduction Indoor localization has accelerated with the increasing deployment of IoT devices and indoor robots (Radhakanth Kodukula, Antino 2025). Specifically, wireless techniques based on Wi-Fi Channel State Information (CSI) (Kotaru et al. 2015; Jiang et al. 2025) enable applications in robotics, activity detection, and assistive navigation (Arun et al. 2024; Ayyalasomayajula et al. 2020; zhang2024rloc), driving a projected 43.243.2 bn market by 2030. Accessibility has improved with the development of open-source toolboxes (Jiang et al. 2025; Arun et al. 2024) and advances in Wi-Fi standards (Du et al. 2024). Over time, localization solutions have moved from RSSI-based (Bahl and Padmanabhan 2000) to CSI-based methods (Vasisht et al. 2016; Kotaru et al. 2015), with recent data-driven approaches (Ayyalasomayajula et al. 2020; zhang2024rloc) that address Non-Line of Sight (NLoS) challenges. Current machine learning architectures (Ayyalasomayajula et al. 2020; zhang2024rloc) often assign equal weight to routers, or expect the network to infer the weights implicitly based on aggregate performance. This practice increases the number of parameters and can reduce localization accuracy (Nazarovs et al. 2021). In contrast, traditional localization algorithms (Kotaru et al. 2015) improve performance with weighted triangulation, where router weights are hand-tuned. Within machine learning models, these weights can be optimized using attention mechanisms (Vaswani et al. 2017; Lee et al. 2019). In this work, we investigate the benefits of integrating attention layers into baseline machine learning models for localization, allowing the model to explicitly learn the importance of each router a concept we refer to as Attention to Routers. This explicit weighting improves the network’s performance on the localization objective. We evaluate Attention to Routers by constructing a baseline model and an enhanced version with attention layers. In our baseline, we follow DLoc (Ayyalasomayajula et al. 2020) and RLoc (zhang2024rloc), utilizing Angle-of-Arrival and Time-of-Flight (AoA-ToF) heatmaps from each router to extract accurate AoA values. These are used for triangulation, supported by a triangulation loss. To introduce a straightforward attention mechanism, we apply attention over the encoder’s embeddings in the encoder-decoder model (see Figure 1), as these embeddings summarize the input AoA-ToF heatmaps. Finally, we compare our algorithm against a baseline machine learning model without attend-and-excite, using one of the most widely used open-source datasets provided by DLoc (Ayyalasomayajula et al. 2020). Our results, benchmarked against a vanilla machine learning algorithm, show significant improvements: i) Localization error, trained and tested across the environment, is 4444 cm (median) and 9494 cm (90th90^th percentile), outperforming the baseline by 30%30\%. i) Attention models reduce baseline errors at harder locations by 45%45\% and at moderately difficult locations by 26%26\%, highlighting the advantage of Attention to Routers. An Encoder-Decoder WiFi Localization Let ℋ=[H1,H2,…,HNAP]H=[H_1,H_2,…,H_N_AP] denote the stack of two-dimensional heatmaps obtained from NAPN_AP access points (APs). Each heatmap HiH_i encodes the likelihood distribution in relative polar (AoA,ToF)(AoA,ToF) coordinates of the client device with respect to AP locations ℛ=[r1,r2,⋯,rNAP]R=[r_1,r_2,·s,r_N_AP], after converting raw channel state information (CSI) through angle-of-arrival (AoA) and time-of-flight (ToF) processing (Ayyalasomayajula et al. 2020). The ground-truth target for the network is another image locationT_location of identical spatial dimensions, in which the true client position is represented as a Gaussian peak rather than a one-hot pixel. This smooth representation improves gradient flow during training and mitigates vanishing gradient issues. Consequently, the localization task is formulated as an image-translation problem, mapping ℋ→locationH _location, which facilitates generalization to arbitrary environmental layouts and AP deployments (Ayyalasomayajula et al. 2020). Network Design. The model consists of a single encoder-decoder architecture (Lokhande et al. 2022), where the encoder ℰ:ℋ→ℋ^E → H compresses the multi-AP input stack into a latent feature representation ℋ H, and the decoder D:H^→YD H→ Y reconstructs a spatial likelihood map of the client’s position. The architecture is inspired by ResNet-based image translation networks (Ayyalasomayajula et al. 2020). The encoder begins with a 7×77× 7 convolution followed by a Tanh activation to mimic log-scale feature combination, while subsequent layers employ residual blocks for hierarchical representation learning. The decoder mirrors this structure with transposed convolutions, instance normalization, and ReLU activations to recover spatial resolution and generate the output heatmap Y. This design enables the network to implicitly account for environment geometry, multipath reflections, and random ToF offsets across APs. Figure 1: The input heatmaps ℋH are encoded by ℰE, processed by set-invariant attention f, and decoded by D to predict y, supervised with losses ℒLocL_Loc and ℒAoAL_AoA. Loss Function. Given predicted output =(ℰ(ℋ))Y=D(E(H)) and target locationT_location, the training objective combines pixel-wise reconstruction and sparsity regularization. The primary term is an L2 loss enforcing similarity to the 2D-location target: ℒLoc=‖Tri((ℰ(ℋ)),ℛ)−location‖22,L_Loc=\|Tri(D(E(H)),R)-T_location\|_2^2, (1) where Tri(⋅,⋅)Tri(·,·), is the standard triangulation algorithm that uses the AoA values predicted by the network along with the router locations ℛR. Because the desired output is the final location predicted from the Angle of Arrival (AoA), we also enforce an L1 loss over the AoA values predicted by the decoder for each AP’s embeddings: ℒAoA=λ∥(ℰ(ℋ)−AoA∥1.L_AoA=λ\,\|D(E(H)-T_AoA\|_1. (2) The total loss is thus ℒ=ℒLoc+ℒAoA =L_Loc+L_AoA =‖Tri((ℰ(ℋ)),ℛ)−location‖22 =\|Tri(D(E(H)),R)-T_location\|_2^2 (3) +‖(ℰ(ℋ))−AoA‖1, +\|D(E(H))-T_AoA\|_1, where λ is a tunable weight controlling the sparsity strength. This objective jointly optimizes the encoder and decoder to produce precise and accurate client location (Ayyalasomayajula et al. 2020). Channel-wise Attention for Router Importance Weighting Recall that our architecture so far includes an encoder ℰ:ℋ→ℋ^E:H→ H and a decoder :ℋ^→ℋD: H . Given that the input tensor ℋH comprises multiple channels corresponding to routers (access points, APs), it is natural to assume that not all routers contribute equally to localization accuracy. Routers subject to multipath interference or weaker signals tend to introduce noise, whereas others provide reliable spatial cues. To model this heterogeneity, we introduce a lightweight channel-wise attention mechanism (Vaswani et al. 2017; Lee et al. 2019) that adaptively emphasizes informative routers while attenuating unreliable ones. This module is inserted between the encoder and decoder and modifies the latent representation ℋ H before decoding. Set-Invariant Functional Attention Let ℋ^=[h^1,h^2,…,h^R] H=[ h_1, h_2,…, h_R] denote the encoded embeddings from R routers, where h^r∈d h_r ^d represents d-dimensional feature embedding for router r. We seek a mapping f:h^1,h^2,…,h^R→α1,α2,…,αR, f:\ h_1, h_2,…, h_R\→\ _1, _2,…, _R\, (4) where αr∈[0,1] _r∈[0,1] and ∑r=1Rαr=1 _r=1^R _r=1, such that routers with higher localization relevance receive larger αr _r. The function f is drawn from the space of set-invariant functionals ℱF 111See Bloem-Reddy and Teh, Probabilistic Symmetries and Invariant Neural Networks, Sec. 2.1 and Example 1 (“Deep Sets”) for formal definitions of functional symmetry and set-invariant functionals. Example 1 characterizes set-invariant functions and gives the canonical representation f(Xn)=ρ(∑iϕ(Xi))f(X_n)=ρ\! ( _iφ(X_i) ). (Bloem-Reddy and Teh 2020, Sec. 2.1), meaning that f is invariant to permutations of its inputs formally, f(h^π(1),…,h^π(R))=f(h^1,…,h^R)f(\ h_π(1),…, h_π(R)\)=f(\ h_1,…, h_R\) for any permutation π. This ensures that router attention depends on their representations rather than their ordering. Computation of Attention Weights To compute αr _r, we first summarize each router embedding via average pooling: sr=1d∑j=1dh^rj,∀r∈1,…,R s_r= 1d _j=1^d h_rj, ∀ r∈\1,…,R\ (5) resulting in a summary vector =[s1,s2,…,sR]⊤s=[s_1,s_2,…,s_R] . A lightweight multilayer perceptron (MLP) g(⋅)g(·) then projects each srs_r into a scalar attention score uru_r: ur=g(sr)=W2σ(W1sr+b1)+b2, u_r=g(s_r)=W_2\,σ(W_1s_r+b_1)+b_2, (6) where σ(⋅)σ(·) denotes a ReLU activation, and W1,W2,b1,b2W_1,W_2,b_1,b_2 are trainable parameters. These unnormalized scores are converted into probabilistic attention weights via a Softmax operation: αr=exp(ur)∑k=1Rexp(uk) _r= (u_r) _k=1^R (u_k) (7) The Softmax acts as a self-gating mechanism (Hu et al. 2018), introducing non-linearity and ensuring that attention weights are differentiable and normalized. Optionally, a global context vector h¯=1R∑r=1Rh^r h= 1R _r=1^R h_r can be concatenated to each h^r h_r before scoring to enable relative comparison between routers. Feature Recalibration and Interpretability Finally, the attention weights αr _r are used to recalibrate the latent features: h~r=αr⋅h^r,∀r∈1,…,R h_r= _r· h_r, ∀ r∈\1,…,R\ (8) resulting in the attended embedding ℋ~=[h~1,h~2,…,h~R] H=[ h_1, h_2,…, h_R]. This attended feature map is passed to decoder D for reconstruction or localization prediction. The mechanism effectively amplifies embeddings from routers that exhibit stable and informative signal patterns while suppressing those dominated by noise or multi-path distortion. Moreover, learned attention weights αr\ _r\ offer interpretable measure of each router’s contribution to localization, providing valuable insights into spatial relevance of network layout. Experiments Localization Error in Easy and Hard Cases Figure 2(b) illustrates the spatial distribution of easy, medium, and hard samples relative to the Access Points (APs). Here, easy samples correspond to locations with low localization error, medium samples exhibit moderate error, and hard samples represent high-error or ambiguous cases. The plot clearly reveals where these categories cluster in the environment, showing that hard cases often concentrate around specific APs (highlighted on the map), whereas easy cases tend to appear in regions with denser AP coverage. This pattern suggests that the attention mechanism learns to allocate greater representational capacity to spatially challenging or under-determined regions, thereby mitigating the impact of unreliable AP geometry. Table 1 provides a quantitative comparison of localization error between the baseline and our attention-aided model across multiple statistical measures. Consistent improvements are observed at all percentiles, with the proposed approach achieving a 28.7%28.7\% reduction in median error and up to 39.4%39.4\% improvement at the 99th99^th percentile. Figure 2(a) further breaks down the mean localization error by difficulty category: while the attention-based model shows a modest 36.9%36.9\% increase in error for easy cases, reflecting a deliberate redistribution of representational focus, it achieves substantial gains of 26.2%26.2\% and 45.5%45.5\% for medium and hard cases, respectively. Collectively, these results indicate that the attention mechanism enhances robustness by emphasizing complex and ambiguous samples, reducing high-error outliers, and maintaining overall performance stability across varying environmental conditions. Table 1: Comparison of localization error between baseline and attention-based method across different statistical measures. Results are based on 3,966 total samples, showing consistent improvement across all percentiles with the attention-based approach. The method achieves a 28.7%28.7\% reduction in median error (18.1618.16 cm improvement) and up to 39.4%39.4\% improvement at the 99th99^th percentile. Metric Base (cm) Ours (cm) Δ Median 63.17 45.01 +28.7% Mean 77.90 54.01 +30.7% 90th Percentile 140.63 92.88 +34.0% 95th Percentile 172.00 114.32 +33.5% 99th Percentile 302.32 183.20 +39.4% Figure 2: (a) Performance comparison between Vanilla and Attention models across case difficulty levels: The mean localization error (in cm) is reported for three difficulty tiers: Easy (bottom 30%30\%), Medium (middle 40%40\%), and Hard (top 30%30\%) cases. (b) Spatial distribution of easy vs medium vs hard cases overlaid with AP locations: Easy (blue), Medium (orange) and Hard (red) samples are plotted with counts in the legend; APs are labeled and emphasized to show which access points are surrounded by high-error samples. (c) Router based Attention weight distribution: Shows the attention weights’ distribution for each AP. We can clearly see tighter distributions for APs that provide equal attention to all samples like AP1, and at AP4 which has more skewed distribution demonstrating skewed attention across samples. Weights of the Attention mechanism Figure 2(c) visualizes the distribution of attention weights assigned to each Access Point (AP). Each box represents the interquartile range (IQR) of attention weights across all test samples, with the mean and median indicated by dashed red and solid yellow lines, respectively. The model distributes focus non-uniformly across APs, highlighting the learned spatial selectivity of the attention mechanism. In particular, AP 33 receives the highest median and mean attention, indicating its stronger relevance for accurate localization in the given environment. Conversely, AP 11 and AP 22 exhibit tighter distributions around lower weights, suggesting consistent but lower contribution. The overall entropy of the mean attention vector corresponds to approximately 92%92\% uniformity, confirming that while the model leverages all APs, it adaptively prioritizes the most informative ones. Localization Error CDF analysis Table 1 presents the various percentiles of errors from the cumulative distribution function (CDF) of localization error for the baseline model and the proposed attention model. Across full range of error magnitudes, the attention-enhanced variant consistently achieves higher cumulative probabilities, indicating that a larger fraction of samples attain lower localization error. Most notable improvement appears in medium-to-high error regime, where the green curve lies distinctly above the baseline, reflecting superior robustness under challenging conditions. Quantitatively, median error (50th50^th percentile) decreases from approximately 5959 cm to 4545 cm, while the 90th90^th percentile drops from 120120 cm to about 100100 cm, corresponding to a 28.7%28.7\% and 39.4%39.4\% reduction, respectively. These shifts confirm the attention module does not merely improve average accuracy but effectively suppresses extreme outlier errors. Shaded region between the curves visualizes this consistent gain across all percentiles, demonstrating that the attention module improves both reliability and stability in localization. Discussion In this work, we introduce attention mechanisms into machine learning-based Wi-Fi indoor localization models, allowing the network to learn and emphasize the contribution of each router. This approach, inspired by weighted triangulation in traditional localization, yields substantial improvements in convergence and accuracy, particularly under challenging conditions such as Non-Line of Sight and multipath scenarios. Attention weights provide interpretability by prioritizing routers with more reliable signals and mitigating errors from noisier sources, resulting in up to 39.4% error reduction at the 99th percentile and significant improvements for hard and moderately difficult locations. By enabling adaptive weighting within encoder-decoder frameworks, our method enhances robustness, mitigates high-error outliers, and supports more generalizable and resilient localization performance in complex indoor environments. References A. Arun, W. Hunter, R. Ayyalasomayajula, and D. Bharadia (2024) WAIS: leveraging wifi for resource-efficient slam. In Proceedings of the 22nd Annual International Conference on Mobile Systems, Applications and Services, p. 561–574. Cited by: Introduction. R. Ayyalasomayajula, A. Arun, C. Wu, S. Sharma, A. R. Sethi, D. Vasisht, and D. Bharadia (2020) Deep learning based wireless localization for indoor navigation. In Proceedings of the 26th Annual International Conference on Mobile Computing and Networking, p. 1–14. Cited by: Introduction, Introduction, Introduction, Introduction, Network Design., Loss Function., An Encoder-Decoder WiFi Localization. V. Bahl and V. Padmanabhan (2000) RADAR: An In-Building RF-based User Location and Tracking System. INFOCOM. Cited by: Introduction. B. Bloem-Reddy and Y. W. Teh (2020) Probabilistic symmetries and invariant neural networks. Journal of Machine Learning Research 21 (90), p. 1–61. Cited by: footnote 1. R. Du, H. Hua, H. Xie, X. Song, Z. Lyu, M. Hu, Y. Xin, S. McCann, M. Montemurro, T. X. Han, et al. (2024) An overview on ieee 802.11 bf: wlan sensing. IEEE Communications Surveys & Tutorials. Cited by: Introduction. J. Hu, L. Shen, and G. Sun (2018) Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, p. 7132–7141. Cited by: Computation of Attention Weights. Z. Jiang, Y. Duan, H. Hao, J. Han, W. Xi, Q. Yu, K. Wang, Q. Jiang, B. Huangfu, Y. Li, L. Yang, M. Xu, X. Zhang, J. Duan, R. Li, T. H. Luan, C. He, X. Ren, D. Lv, X. Li, T. Teng, J. Zhao, and Zhao (2025) PicoScenes Wi-Fi ISAC Research Platform: Enabling the modern Wi-Fi Integrated Sensing And Communication (ISAC) research!. Note: https://ps.zpj.io/ Cited by: Introduction. M. Kotaru, K. Joshi, D. Bharadia, and S. Katti (2015) SpotFi: decimeter level localization using wi-fi. In Proceedings of the 2015 ACM Conference on Special Interest Group on Data Communication, SIGCOMM ’15. Cited by: Introduction, Introduction. J. Lee, Y. Lee, J. Kim, A. Kosiorek, S. Choi, and Y. W. Teh (2019) Set transformer: a framework for attention-based permutation-invariant neural networks. In International conference on machine learning, p. 3744–3753. Cited by: Introduction, Channel-wise Attention for Router Importance Weighting. V. S. Lokhande, R. Chakraborty, S. N. Ravi, and V. Singh (2022) Equivariance allows handling multiple nuisance variables when analyzing pooled neuroimaging datasets. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, p. 10432–10441. Cited by: Network Design.. J. Nazarovs, R. R. Mehta, V. S. Lokhande, and V. Singh (2021) Graph reparameterizations for enabling 1000+ monte carlo iterations in bayesian deep neural networks. In Uncertainty in Artificial Intelligence, p. 118–128. Cited by: Introduction. Radhakanth Kodukula, Antino (2025) Top IoT Trends in 2025 and What IoT Holds for the Future?. Note: https://w.antino.com/blog/top-9-iot-trends Cited by: Introduction. D. Vasisht, S. Kumar, and D. Katabi (2016) Decimeter-Level Localization with a Single Wi-Fi Access Point. NSDI. Cited by: Introduction. A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin (2017) Attention is all you need. Advances in neural information processing systems 30. Cited by: Introduction, Channel-wise Attention for Router Importance Weighting.