Downloads · 30 days
0
Aminrezaei/LRF-IMU
LRF-IMU is a machine learning model from Aminrezaei. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch.
<p align="center" <img src="https://raw.githubusercontent.com/aminsens/LRF-IMU/main/assets/lrf-imu-header.png" alt="LRF-IMU latent Rectified Flow generation of wearable IMU signals" width="100%" </p
Downloads · 30 days
0
Access
Public
Updated Aug 12, 2026
Repo size
4.5 GB
Likes
0
Public
Click a slice to open those files.
.pt4.5 GB · 100%
From the Hugging Face model README
This model repository hosts the fold-specific VAE and latent Rectified Flow checkpoint pairs for class-conditioned synthetic wearable IMU generation.
The accompanying GitHub repository contains the training, generation, evaluation, analysis, and reproducibility code.
These weights accompany the published paper:
<!-- **A latent rectified flow approach to generate synthetic wearable data – a LABDA solution** Amin Rezaei, Morten Kjærgaard, Jasper Schipperijn *Machine Learning: Health* (2026) https://doi.org/10.1088/3049-477X/ae91ef -->Code: github.com/aminsens/LRF-IMU
Used Dataset: REALDISP Activity Recognition Dataset — UCI Machine Learning Repository
MLHEALTH-100129.R2).MLHEALTH-100129.R1).LRF-IMU combines a variational autoencoder (VAE) with a class-conditioned Rectified Flow model. The VAE maps a 3.2-second IMU window to a compact latent representation. Rectified Flow transports Gaussian noise to an activity-conditioned latent, and the frozen VAE decoder maps that latent back to a time-domain sensor window.
activity class + Gaussian noise
↓
class-conditioned Rectified Flow
latent shape B × 48 × 40
↓
frozen VAE decoder
↓
standardized IMU window B × C × 160
| Specification | Value |
|---|---|
| Dataset used for the study | REALDISP, ideal-placement logs |
| Sensor location | Right thigh |
| Sampling frequency | 50 Hz |
| Native window | 160 samples (3.2 s) |
| Hop used in the study | 40 samples (0.8 s; 75% overlap) |
| Latent shape | B × 48 × 40 |
| Rectified Flow width | 256 in the distributed historical checkpoints |
| Flow classes | 4 |
| Paper sampler | 10 explicit reverse-Euler steps, noise at t=1 to data at t=0 |
| Study protocol | 12-fold leave-one-subject-out (LOSO) |
Two independently trained sensor configurations are included:
| Configuration | Channels | Signal shape | Checkpoint pairs |
|---|---|---|---|
six_channel | ax, ay, az, gx, gy, gz | B × 6 × 160 | 12 |
accelerometer_only | ax, ay, az | B × 3 × 160 | 12 |
The accelerometer-only model is not made by dropping gyroscope channels from a six-channel model at inference time. It has its own VAE and Rectified Flow weights.
The checkpoints were trained and evaluated using the REALDISP Activity Recognition Dataset from the UCI Machine Learning Repository.
LRF-IMU uses the documented ideal-placement, right-thigh subset with 12 complete participants and four activity classes: walking, running, jump up, and cycling.
The REALDISP recordings themselves are not included in this Hugging Face repository. They can be obtained directly from UCI:
👉 Download / view REALDISP on the UCI Machine Learning Repository
The corresponding data-access and preprocessing assumptions are documented in DATA_ACCESS.md.
Each directory contains one matched vae.pt and flow.pt pair:
checkpoints/
├── six_channel/
│ └── fold_XX/{vae.pt, flow.pt, manifest.json}
└── accelerometer_only/
└── fold_XX/{vae.pt, flow.pt, manifest.json}
Available held-out folds are:
01, 02, 03, 05, 08, 09, 10, 11, 12, 13, 14, 16
A fold number names the REALDISP participant held out from model training. For example, fold_01 is the pair trained without participant 01 and intended for the participant-01 LOSO fold. There is no single global checkpoint in this collection. Choose the pair matching the held-out participant and never mix VAE and Flow files across sensors or folds.
Every pair was retained only after its SHA-256 hashes, sensor configuration, held-out fold, channel geometry, latent geometry, Flow width, and successful loader-generation record agreed. Exact hashes and byte sizes are in the adjacent manifest.json and the top-level model_index.json. The files were copied byte-for-byte; weights were not retrained, resaved, or converted.
| Class ID | Activity | REALDISP activity code |
|---|---|---|
| 0 | walking | 1 |
| 1 | running | 3 |
| 2 | jump_up | 4 |
| 3 | cycling | 33 |
The following are the paper-reported downstream macro-F1 results across the 12 LOSO folds (mean ± sample SD):
| Scenario | 6-ch RF | 3-ch RF | 6-ch CNN | 3-ch CNN |
|---|---|---|---|---|
| TRTR — full real training | 0.985 ± 0.021 | 0.980 ± 0.027 | 1.000 ± 0.000 | 0.957 ± 0.083 |
| Scarce — 2 real windows/class | 0.400 ± 0.088 | 0.467 ± 0.082 | 0.340 ± 0.190 | 0.441 ± 0.202 |
| TSTR — synthetic-only training | 0.956 ± 0.081 | 0.980 ± 0.061 | 0.845 ± 0.195 | 0.954 ± 0.085 |
| TSTR + scarce real data | 0.951 ± 0.087 | 0.979 ± 0.061 | 0.858 ± 0.145 | 0.969 ± 0.058 |
The main six-channel Random Forest TSTR result retained approximately 97.1% of the full-real baseline.
The signal analyses reported no synthetic acceleration samples above 10g and a mean log-PSD correlation of approximately 0.966, while also identifying attenuation in the upper-frequency tail.
Privacy results apply only to the paper's stated membership-inference and reconstruction threat models; they do not establish a general anonymization guarantee.
Python 3.10 or newer is supported. Install the model implementation from GitHub and the Hugging Face client:
python -m pip install "lrf-imu[training] @ git+https://github.com/aminsens/LRF-IMU.git"
python -m pip install huggingface_hub
For a local code checkout:
git clone https://github.com/aminsens/LRF-IMU.git
cd LRF-IMU
python -m pip install -e ".[training]"
python -m pip install huggingface_hub
The included example downloads only model_index.json, the selected configuration, and the selected fold's manifest, VAE, and Flow files. It verifies SHA-256 hashes before loading the checkpoints through the validated lrf_imu API.
python examples/generate.py \
--sensor six_channel \
--fold 1 \
--activity walking \
--count 8 \
--steps 10 \
--seed 42 \
--device cpu \
--output walking_fold01.npz
For the separately trained accelerometer-only model:
python examples/generate.py \
--sensor accelerometer_only \
--fold 1 \
--activity cycling \
--count 8 \
--output cycling_acc_fold01.npz
The NPZ contains samples with shape [count, channels, 160] and integer labels. A neighboring .metadata.json records the selected fold, activity, seed, solver steps, checkpoint hashes, output hash, and coordinate system.
The decoder output is in training-standardized VAE signal space. These values are not physical m/s² or rad/s until the matching fold's training-only normalization statistics are applied inversely. Those participant-derived statistics are not contained in this model repository. Do not assign physical units directly to the raw generated array.
To download one pair without the example:
hf download Aminrezaei/LRF-IMU \
model_index.json \
configs/six_channel_160_40.yaml \
checkpoints/six_channel/fold_01/manifest.json \
checkpoints/six_channel/fold_01/vae.pt \
checkpoints/six_channel/fold_01/flow.pt \
--local-dir lrf-imu-fold01
REALDISP recordings are not included. Obtain the original dataset from the UCI Machine Learning Repository and follow the data-access instructions in DATA_ACCESS.md.
The study used ideal-placement logs, the right-thigh sensor, participants 1, 2, 3, 5, 8, 9, 10, 11, 12, 13, 14, and 16, and activity codes 1, 3, 4, and 33. Normalization is fit only on the training participants for each LOSO fold.
The code repository contains checkpoint-safe loaders, the exact source-compatible VAE and Flow model geometry, the 10-step paper generation profile, evaluation commands, reproducibility instructions, and documented result comparisons. Use model_index.json and each fold manifest to verify all downloaded bytes before execution.
exact_paper_reproduction=false: manuscript and historical implementation evidence disagree on some training settings, including a Flow width-128 description versus the width-256 historical checkpoints distributed here.If you use these checkpoints, please cite the associated paper:
@article{rezaei2026lrfimu,
title = {A latent rectified flow approach to generate synthetic wearable data -- a LABDA solution},
author = {Rezaei, Amin and Kjærgaard, Morten and Schipperijn, Jasper},
journal = {Machine Learning: Health},
year = {2026},
doi = {10.1088/3049-477X/ae91ef},
publisher = {IOP Publishing}
}