Skip to main content

RIANN (Robust IMU-based Attitude Neural Network)

PyPI version Python versions License Docs DOI

RIANN is the official implementation of the model proposed in:

Weber, D.; Gühmann, C.; Seel, T. RIANN—A Robust Neural Network Outperforms Attitude Estimation Filters. AI 2021, 2(3), 444–463. https://doi.org/10.3390/ai2030028

If you use RIANN in your research, please cite the paper.

What is RIANN?

RIANN is a lightweight neural network implementation for estimating orientation (attitude) from inertial measurement unit (IMU) data. It processes accelerometer and gyroscope readings to provide quaternion-based attitude estimation, optimized for real-time applications.

Key Features

  • Fast and accurate quaternion-based attitude estimation
  • Optimized for real-time processing with state preservation
  • Supports both batch processing and step-by-step integration
  • Robust against sensor noise and motion artifacts
  • Simple Python API with minimal dependencies

Installation

pip install riann

or from source

git clone https://github.com/daniel-om-weber/riann.git
cd riann
pip install -e .

Quickstart

import numpy as np
from riann.riann import RIANN

# Initialize RIANN
riann = RIANN()

# Prepare IMU data
acc = np.ones((100, 3))  # Accelerometer data (100 samples, XYZ axes)
gyr = np.zeros((100, 3)) # Gyroscope data (100 samples, XYZ axes)
fs = 200                 # Sampling rate in Hz

# Get attitude quaternions (w,x,y,z)
attitude = riann.predict(acc, gyr, fs)
print(f"Output shape: {attitude.shape}")  # (100, 4) - 100 unit quaternions
Output shape: (100, 4)

Input and output conventions

RIANN takes accelerometer and gyroscope readings from a single IMU and returns unit quaternions.

Field Shape Units Notes
acc (N, 3) (or (3,) for predict_step) m/s² Accelerometer, axis order x, y, z
gyr (N, 3) (or (3,) for predict_step) rad/s Gyroscope, axis order x, y, z
fs scalar Hz Sampling rate of the data
output (N, 4) (or (4,)) — Unit quaternion (w, x, y, z)
  • acc and gyr must be expressed in the same sensor-fixed coordinate frame and the same axis order.
  • The gyroscope is in radians per second (not deg/s); the accelerometer measures specific force in m/s², so a sensor at rest reads ≈ 9.81 along the up-axis (e.g. [0, 0, 9.81]).
  • Data should be (approximately) uniformly sampled at fs.
  • The output quaternion describes the orientation of the IMU relative to a fixed inertial frame whose vertical axis is aligned with gravity. Because no magnetometer is used, absolute heading (yaw) is not observable and may drift slowly; roll and pitch (inclination) are estimated robustly.

If your data is in different units or axis conventions (e.g. gyro in deg/s, or accelerometer in g), convert it before calling RIANN.

Citation

If you use RIANN in academic work, please cite:

Weber, D.; Gühmann, C.; Seel, T. RIANN—A Robust Neural Network Outperforms Attitude Estimation Filters. AI 2021, 2, 444–463. https://doi.org/10.3390/ai2030028

@article{weber2021riann,
  title   = {{RIANN}---A Robust Neural Network Outperforms Attitude Estimation Filters},
  author  = {Weber, Daniel and G{\"u}hmann, Clemens and Seel, Thomas},
  journal = {AI},
  volume  = {2},
  number  = {3},
  pages   = {444--463},
  year    = {2021},
  publisher = {MDPI},
  doi     = {10.3390/ai2030028},
  url     = {https://www.mdpi.com/2673-2688/2/3/28}
}

Metadata

Release files for riann 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for riann 0.2.0
File Size Uploaded Provenance Actions
riann-0.2.0.tar.gz 1.4 MB With provenance Details for riann-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for riann 0.2.0
File Interpreter ABI Platform Actions
riann-0.2.0-py3-none-any.whl Python 3 none any Details for riann-0.2.0-py3-none-any.whl

Total release size: 2.8 MB

Release files / riann-0.2.0.tar.gz

Download URL riann-0.2.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
436bdf46dc21ba0e770f95c7a9660c89e4be2ea9e04506b7a96422ae08024d57
BLAKE2b-256 checksum
How to use checksums
9daa2dd388338c853d4b4294dad4c464b32b85a030fb9550340917b0bacb54af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / riann-0.2.0-py3-none-any.whl

Download URL riann-0.2.0-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e7292f567630ce3b30c031c49dde9c9d1e98769efc6d513cdeb52b243743022d
BLAKE2b-256 checksum
How to use checksums
6ead5b7e6006d7f0a8e961a378fe97d8e6b61885a5f54bd52115b5f2f68f7622
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Security for riann 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for riann-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page