CTIN: Robust Contextual Transformer Network for Inertial Navigation

Bingbing Rao, Ehsan Kazemi, Yifan Ding, Devu M. Shila, Frank M. Tucker, Liqiang Wang

Abstract

Inertial navigation, the process of estimating position using only Inertial Measurement Units (IMUs), faces significant challenges due to exponential drift and noisy sensor data. We present CTIN (Contextual Transformer Network), a novel deep-learning architecture that treats IMU data as a spatial-temporal problem. By replacing standard convolutions with local and global self-attention and incorporating uncertainty modeling, CTIN achieves state-of-the-art accuracy in trajectory prediction, outperforming existing models by up to 37%.

Introduction

Estimating a person's or robot's position using only IMUs—accelerometers and gyroscopes—is notoriously difficult. Traditional Newtonian methods suffer from exponential drift because they integrate noisy sensor data twice, causing tiny errors to explode into massive inaccuracies. While recent data-driven approaches using LSTMs or ResNets have improved performance, they often suffer from spatial blindness (failing to capture cross-axis relationships), temporal limitations in handling high-frequency data, and a failure to model fluctuating sensor uncertainty.

The CTIN Architecture

CTIN is the first Transformer-based model specifically designed for inertial navigation. Its architecture is built upon three main pillars:

  1. Enhanced Spatial Encoder: Utilizing a ResNet-18 backbone, the encoder replaces standard convolutions with Local and Global Self-Attention. Local attention captures immediate context within the feature map, while global attention correlates features across the entire sensor window.
  2. Temporal Transformer Decoder: This component uses multi-head attention to fuse spatial features with temporal knowledge. Masked self-attention ensures the model only utilizes past data, facilitating real-time navigation.
  3. Multi-Task Learning with Uncertainty: The network predicts both 2D velocity and a covariance matrix. By employing a Negative Log-Likelihood (NLL) loss, the model learns to weight its predictions based on its confidence in the sensor data.
The CTIN architecture, highlighting the Spatial Encoder with attention mechanisms and the Temporal Decoder.

Additionally, an Integral Velocity Loss (IVL) is used to integrate velocity over a window, directly optimizing for positional accuracy rather than just instantaneous velocity.

Experimental Evaluation

The researchers evaluated CTIN on five diverse datasets:

  • Public Benchmarks: RIDI, OxIOD, RoNIN, and IDOL, covering various phone placements and motion types.
  • CTIN Dataset: A new dataset containing 100 sequences from 5 subjects, using Samsung Galaxy devices and Google ARCore for high-precision ground truth.

Key Results and Insights

CTIN consistently outperformed state-of-the-art baselines, such as RoNIN's R-LSTM and R-TCN variants, across nearly all metrics.

  • Accuracy: On the CTIN dataset, it achieved an Absolute Trajectory Error (ATE) of 1.28m, a significant improvement over the 2.02m achieved by the best RoNIN variant.
  • Generalization: The model demonstrated exceptional performance on "unseen" subjects, proving its ability to generalize beyond specific training gaits.
  • Efficiency: Despite its Transformer architecture, CTIN is highly efficient with only 0.55M parameters, compared to 4.63M for R-ResNet and 2.03M for R-TCN.
Quantitative comparison of CTIN against baselines. (a) Cumulative Distribution Function (CDF) for ATE and RTE. (b) Box plots for MSE loss and PDE.

The success of CTIN highlights that attention mechanisms are superior to fixed-weight convolutions for sensor data, as they allow the model to dynamically focus on relevant axes. Furthermore, learning to predict uncertainty makes the system significantly more robust to sensor noise.

Limitations and Future Work

While CTIN represents a major advancement, it currently focuses on 2D trajectories. Future work will involve expanding the model to 3D motion (e.g., climbing) and integrating additional low-power sensors like barometers. Additionally, the reliance on high-fidelity ground truth for training remains a challenge for scaling data collection.

Reference: Rao, B., et al. (2022). CTIN: Robust Contextual Transformer Network for Inertial Navigation. Proceedings of the AAAI Conference on Artificial Intelligence.

Summary updated

Abstract

Recently, data-driven inertial navigation approaches have demonstrated their capability of using well-trained neural networks to obtain accurate position estimates from inertial measurement units (IMU) measurements. In this paper, we propose a novel robust Contextual Transformer-based network for Inertial Navigation~(CTIN) to accurately predict velocity and trajectory. To this end, we first design a ResNet-based encoder enhanced by local and global multi-head self-attention to capture spatial contextual information from IMU measurements. Then we fuse these spatial representations with temporal knowledge by leveraging multi-head attention in the Transformer decoder. Finally, multi-task learning with uncertainty reduction is leveraged to improve learning efficiency and prediction accuracy of velocity and trajectory. Through extensive experiments over a wide range of inertial datasets~(e.g. RIDI, OxIOD, RoNIN, IDOL, and our own), CTIN is very robust and outperforms state-of-the-art models.
BibTeX
@inproceedings{rao2022ctin,
  author = {Bingbing Rao and Ehsan Kazemi and Yifan Ding and Devu M. Shila and Frank M. Tucker and Liqiang Wang},
  title = {{CTIN: Robust Contextual Transformer Network for Inertial Navigation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i5.20479},
}
Figure