SetCon: Text-based IMU activity recognition
2 min readupdated
The SetCon model aligns inertial measurement unit (IMU) signals, such as those from accelerometers and gyroscopes, with text descriptions to perform zero-shot physical activity recognition on wearable devices. Its encoder maps signal windows into the text embedding space of a frozen CLIP ViT-B/32 encoder, classifying activities using the nearest text vector. The design accounts for sensor placement on the body and outperforms existing methods on real-world datasets.
Key features
- Zero-shot recognition: Classifies activities using class names or text anchors without fine-tuning on specific datasets.
- Selective invariance: A calibrator assesses device placement on the body using a few unlabeled windows instead of requiring full placement invariance.
- Compact size: The graph encoder has 6.4 million parameters, the text projection has 0.13 million, and the calibrator has 0.48 million parameters (float32).
- High accuracy: Achieves 56.6% average zero-shot accuracy using class names and 65.3% using anchors across 13 real-world datasets.
What you can do
- Project integration: Use pretrained model checkpoints in research projects to analyze human movement from accelerometer and gyroscope data.
- Evaluation and reproduction: Run scripts from the repository to verify results and reproduce tables from the research paper on test data.
- Sensor analysis: Use built-in helper processing functions to prepare data windows, calibrate, and extract embeddings.
Example
Loading the SetCon model and preparing data to generate zero-shot predictions:
import numpy as np
from transformers import AutoModel
import processing_setcon as P
model = AutoModel.from_pretrained("lschiweck/SetCon", trust_remote_code=True).to("cuda").eval()
windows = P.prepare_device(acc, gyro, fs=50)
ref = model.estimate_reference(windows[context_idx], site="r_wrist")
windows = P.set_reference(windows, ref["reference"])
x = P.place_devices({"r_wrist": windows})
z = model.embed(x)
pred = (z @ class_vectors.T).argmax(1)Read more
DetailsBenchmarks: 56.6% accuracy by class names and 65.3% by anchors (compared to 41.8% and 46.7% for AnyMo).
Requirements: Encoder on CUDA with bfloat16, calibrator on CPU in float32.
Limitations: Model and code are released under the CC BY-NC 4.0 license for non-commercial research only.
Details: Trained on IMU data simulated from 3D model movements based on the Nymeria dataset.










Comments