Movement-strain autoencoders (Group 3, Motion Atlas)

Autoencoders developed by Group 3 for the IAAC AI Methods I hackathon and the Motion Atlas project. They reconstruct construction-worker movement from wearable inertial sensors (IMU) or from video pose keypoints, and use the reconstruction error as an anomaly score. Despite the project name, reconstruction error is not a validated measurement of physical strain or injury risk.

Repository layout

Folder Model Input Used by the Motion Atlas API
imu/ Conv1D autoencoder, latent 32 200 time steps Γ— 18 IMU channels Yes (sensor CSV analysis)
keypoint/ Dense autoencoder, latent 16 48 frames Γ— 34 pose coordinates Yes (video pose analysis)
repository root Mixed files, see below – No

imu/ and keypoint/ each hold a matching model.onnx, config.json and scaler.npz. Always use the three files from the same folder: mixing files from different folders produces wrong shapes or wrong scaling.

At the repository root, model.onnx is a copy of the keypoint model, while config.json and scaler.npz belong to the earlier dense IMU baseline. The root files do not form a working set; use imu/ or keypoint/ instead.

imu/notebook_conv1d32/ is an identical copy of the imu/ export, with its own model card.

IMU model (imu/): Conv1D-32 anomaly detector

  • Architecture: 1D convolutional autoencoder, latent dimension 32.
  • Input: float32 windows of shape (batch, 200, 18), two seconds at 100 Hz. Channels are accelerometer and gyroscope axes from the trousers, back and hand sensors, in the exact order listed in imu/config.json.
  • Preprocessing: z-score each channel with (raw - mean) / std from imu/scaler.npz. Scaling happens outside the ONNX graph.
  • ONNX input sensor_window, output reconstruction (batch, 200, 18).
  • Training: normal activities only (tasks 13, 14, 15). Anomaly activities used for testing: tasks 7, 8, 11, 12.
  • Splits: workers 1–9 train, 10–11 validation, 12–13 test (1,566 / 175 / 406 windows).
  • Anomaly score: mean squared reconstruction error. Threshold anomaly_threshold = 1.6177, the 95th percentile of normal validation errors.

Test results on the held-out workers:

Metric Value
ROC AUC 0.839
Precision 0.934
Recall 0.366
F1-score 0.526

The detector is precise but misses many anomalies (147 of 232 anomalous test windows).

Pose model (keypoint/)

  • Architecture: dense autoencoder, latent dimension 16.
  • Input: (batch, 48, 34), i.e. 48 frames at 25 fps of 17 (x, y) keypoints.
  • Preprocessing: coordinates are centred on the hips and divided by the median torso length. Keypoints with confidence below 0.02 are treated as missing, gaps up to 25 frames are filled, values are clipped to Β±6, and windows with more than 30 % missing values are rejected. The full settings are in keypoint/config.json.
  • Training: normal tasks 13, 14 and 15; comparison tasks 7, 8, 11 and 12. Participants 1–9 train, 10–11 validation, 12–13 test.
  • Anomaly threshold: threshold_mse = 0.6588, the 90th percentile of normal validation reconstruction error.

Occlusion and missed joints can raise the score without any change in movement.

Dense IMU baseline (earlier model)

The first IMU model of the project. Its configuration and scaler are kept at the repository root for reference; its ONNX export is no longer published here.

  • Architecture: dense encoder 3600 β†’ 256 β†’ 64 β†’ 32 with ReLU, mirrored decoder 32 β†’ 64 β†’ 256 β†’ 3600.
  • Input: (batch, 200, 18), same channels as the IMU model; scale with (raw - mean) / scale from the root scaler.npz.
  • Trained for reconstruction on all activities (users 1–9 train, 10–11 validation, 12–13 test).
Metric Value
Training / validation / test windows 8,295 / 929 / 928
Best epoch 25
Best validation MSE 0.4346
Test MSE 0.3406
Training-mean baseline test MSE 1.0112

For comparison, the convolutional models with latent sizes 32 and 16 reached a test MSE of 0.369 and 0.457 on the same reconstruction task.

Dense IMU autoencoder training and validation loss

Original and reconstructed wearable sensor signals on a held-out window

Local inference (IMU anomaly score)

Install numpy, pandas, onnxruntime and huggingface_hub, then run:

import json
from pathlib import Path
import numpy as np
import pandas as pd
import onnxruntime as ort
from huggingface_hub import snapshot_download

folder = Path(snapshot_download(
    "iaac-maai/hackathon-team3-movement-strain-ae",
    allow_patterns=["imu/model.onnx", "imu/config.json", "imu/scaler.npz"],
)) / "imu"
config = json.loads((folder / "config.json").read_text())
scaler = np.load(folder / "scaler.npz")

frame = pd.read_csv("your_imu_recording.csv")
raw = frame[config["features"]].iloc[:config["window"]].to_numpy(dtype=np.float32)
assert raw.shape == (200, 18) and np.isfinite(raw).all()
x = ((raw - scaler["mean"]) / scaler["std"])[None].astype(np.float32)

session = ort.InferenceSession(str(folder / "model.onnx"),
                               providers=["CPUExecutionProvider"])
(reconstruction,) = session.run(["reconstruction"], {"sensor_window": x})
score = float(np.mean((x - reconstruction) ** 2))
print("Anomaly score:", score, "| flagged:", score > config["anomaly_threshold"])

For the pose model, download the keypoint/ files instead and apply the preprocessing described in keypoint/config.json; compare the score with threshold_mse.

Using these models in Motion Atlas

The FastAPI model server downloads this repository and loads imu/ for sensor CSV files and keypoint/ for pose windows. Keep the ONNX file, scaler and configuration together when publishing a new revision. The React app and Cloudflare Worker provide the user interface.

Training data

Dataset: VTT-ConIoT, with 207 IMU recordings from 13 participants performing up to 16 construction-related activities. Participants are separated across splits, and channel scaling is fitted on training participants only. Random seed: 42.

Intended use and limitations

For educational research, sensor and pose reconstruction, and experimental anomaly detection. A high reconstruction error can reflect unfamiliar movements, sensor noise, occlusion or distribution shift; it does not establish unsafe posture, fatigue, pain or injury. These models do not detect PPE or produce RULA/REBA scores. They were evaluated on only two held-out workers, and the thresholds are dataset-specific. Do not use them as a standalone worker safety or medical assessment.

This repository hosts model files only; it does not deploy an application or an inference endpoint.

Sources and license

Model repository license: MIT. The original dataset is licensed separately; consult its source record for reuse conditions. Raw dataset files are not included here.

Downloads last month
215
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including iaac-maai/hackathon-team3-movement-strain-ae