WISDM watch statistical XGBoost
CPU classifier for one 5 s, 20 Hz smartwatch IMU window (T=100, C=6) into 18 WISDM activities. The ONNX file is the XGBoost tree head only. Statistical features (104 dims) still run in Python in notsubash/Activity-Recognition.
Not a medical or safety device. Watch windows only. Do not send phone IMU to this bundle.
Metrics to cite
Protocol B, 5-fold GroupKFold on subject_id, 51 subjects, repaired 20 Hz WISDM (UCI 507). Source: docs/reports/protocol_b_watch_stat_xgb.json.
| Metric | Value |
|---|---|
| macro-F1 | 0.7031 |
| accuracy | 0.7013 |
| mean fold macro-F1 | 0.7027 (std 0.0506) |
| locomotion group F1 | 0.9292 |
| posture group F1 | 0.6606 |
| hand group F1 | 0.8788 |
| eating group F1 | 0.8450 |
Primary metric is macro-F1. The ONNX in this repo is a refit on all windows (one subject held out only for XGBoost early stopping). It is not a GroupKFold fold. Cite the table above, not an export-fit score.
Weak watch class: eating sandwich (L), per-class F1 0.2816. Stairs 0.7028, kicking 0.7831.
Files
| File | Role |
|---|---|
watch_stat_xgb.onnx |
XGBoost classifier (onnxmltools / ONNX 1.22, input [None, 104]) |
watch_stat_xgb.json |
Sidecar (har.onnx.v1): window contract, device, classes |
LICENSE |
MIT |
Config used to train: configs/protocol_b_watch_stat_xgb.yaml (200 trees, max_depth 6, statistical features, 5.0 s window, 1.0 s hop).
Use
Install the package from GitHub, then download this repo so the .onnx and .json sit together:
from pathlib import Path
import numpy as np
from huggingface_hub import snapshot_download
from har.models.export import load_bundle, predict_window
local = snapshot_download("axlesubash/wisdm-watch-stat-xgb")
bundle = load_bundle(Path(local) / "watch_stat_xgb.onnx")
# 100 rows, channels ax, ay, az, gx, gy, gz
window = np.zeros((100, 6), dtype=np.float32)
print(predict_window(bundle, window))
Input contract:
device:watchhz: 20- shape:
(100, 6) - channels:
ax, ay, az, gx, gy, gz
Phone windows are out of contract. This is not transformers.AutoModel.
Training data
WISDM Smartphone and Smartwatch Activity and Biometrics Dataset (UCI 507): 51 subjects (1600-1650), 18 activities (A-S skipping N), watch on the dominant hand, accelerometer and gyroscope. Sessions are repaired onto a shared 20 Hz grid. There are no demographics, so there is no fairness slice. Raw WISDM is not redistributed here.
Limitations
- Subject-independent watch HAR only. Phone statistical XGBoost is 0.3272 macro-F1 under the same protocol and is a different bundle.
- Sandwich, stairs, and kicking are the weaker watch classes.
- Abstain threshold is 0.0 (never abstain) and is uncalibrated.
- Statistical features stay in Python.
onnxruntimeruns the tree head only. - No 12-channel phone+watch fusion.
Citation
WISDM (Weiss et al., UCI 507). Training code and protocol: notsubash/Activity-Recognition. Weights in this Hub repo are MIT. The dataset has its own UCI terms.