Reference implementation for the paper:
Hawarey, M. (2026). A Constellation-Aware Transformer Architecture for Multi-GNSS Positioning: Learned Inter-System Bias Estimation and Attention-Based Satellite Selection. AIR Journal of Engineering and Technology, Vol. 2026, AIRJET2026613. https://doi.org/10.65737/AIRJET2026613
CxTF is a transformer-based architecture for multi-constellation GNSS single-point positioning that introduces three innovations:
- Constellation embeddings — learnable vector representations for GPS, Galileo, BeiDou, and GLONASS
- Cross-constellation attention — implicit inter-system bias (ISB) learning via the natural block structure of the attention matrix
- Attention-based satellite selection — learned importance scores jointly optimizing geometry, signal quality, and constellation balance
- Input: 10-dimensional per-satellite feature vectors (pseudorange, carrier phase, C/N₀, elevation, azimuth, Doppler, direction vector, residual)
- Constellation embedding + elevation positional encoding
- L-layer transformer encoder with multi-head self-attention
- Sigmoid-gated satellite selection with sparsity regularization
- Position correction MLP outputting Δr ∈ ℝ³
Default configuration: d_model=128, L=4, H=8, ~800K parameters.
Python >= 3.10
torch >= 2.0
pandas
numpy
scikit-learn
matplotlib
Install:
pip install torch pandas numpy scikit-learn matplotlibThis implementation uses the Google Smartphone Decimeter Challenge (GSDC) 2023–2024 dataset. Download Pixel 7 Pro traces from Kaggle and organize as:
data/
2023-05-09-21-32/
device_gnss.csv
ground_truth.csv
2023-05-16-19-55/
device_gnss.csv
ground_truth.csv
...
The published results use 12 Pixel 7 Pro traces (7 from May 2023, 5 from September 2023). Each trace folder needs only device_gnss.csv (raw GNSS measurements) and ground_truth.csv (NovAtel SPAN reference positions). The script auto-discovers all trace folders under data/.
python cxtf_full_experiment.py --data_dir ./data --output_dir ./resultsOptions:
--data_dir— path to data directory (default:./data)--output_dir— path for results (default:./results)--device—auto,cpu, orcuda(default:auto)
The script will:
- Load and preprocess all traces (6-step pipeline per paper Section 4.1)
- Evaluate the WLS-SPP baseline
- Train the full CxTF model with early stopping
- Train three ablation variants (no embeddings, no selection, no PE)
- Run interpretability analysis (embedding geometry, selection patterns)
- Generate publication figures and save results
cxtf_supplementary.py runs the additional baselines (T-SPP, WLS random-walk ISB) and statistical significance tests (Wilcoxon signed-rank, Cohen's d) reported in Tables 5–6 of the paper. It loads the trained CxTF checkpoint from the main experiment:
python cxtf_supplementary.py --data_dir ./data --output_dir ./resultsresults/
results.json — All metrics in JSON format
results_summary.txt — Formatted results table
cxtf_best.pt — Best model weights
fig_cdf.png — Position error CDF curves
fig_embeddings.png — Learned constellation embedding analysis
fig_selection.png — Satellite selection score analysis
| Method | 3D RMSE (m) | Median (m) | 95th %ile (m) | Improvement |
|---|---|---|---|---|
| WLS-SPP (baseline) | 6.68 | 5.15 | 11.15 | — |
| CxTF (proposed) | 5.30 | 3.59 | 8.73 | 20.6% (RMSE) / 30.3% (median) |
| Ablation A (no emb.) | 5.49 | 3.64 | 9.24 | 17.8% |
| Ablation B (no sel.) | 5.25 | 3.48 | 8.50 | 21.5% |
| Ablation C (no PE) | 5.44 | 3.63 | 8.83 | 18.6% |
Validation uses 12 GSDC traces from a single receiver type (Google Pixel 7 Pro), split per-trace (70/15/15%) to prevent data leakage. See the paper (Section 4.4.1) for full details.
@article{hawarey2026cxtf,
title={A Constellation-Aware Transformer Architecture for Multi-GNSS Positioning: Learned Inter-System Bias Estimation and Attention-Based Satellite Selection},
author={Hawarey, Mosab},
journal={AIR Journal of Engineering and Technology},
volume={2026},
year={2026},
doi={10.65737/AIRJET2026613} }Dr. Mosab Hawarey PhD, Geodetic & Photogrammetric Engineering (ITU) | MSc, Geomatics (Purdue) | MBA (Wales) | BSc, MSc (METU)
- GitHub: https://github.com/mhawarey
- Personal: https://hawarey.org/mosab
- ORCID: https://orcid.org/0000-0001-7846-951X
MIT License. See LICENSE for details.