A phone in a pocket or a strap on a thigh measures motion along its own three axes. In daily life those axes point in arbitrary directions relative to the body. The usual fix is to collapse the three axes into one rotation-free number, the acceleration magnitude. That number is identical however the device is held, but it also erases the tilt information that separates postures such as sitting and standing. We propose a different fix, borrowed from medical imaging. There, the strongest remedy for networks that learn from the wrong part of an image is to locate the anatomy first and then let the classifier see only that region, in a standardized geometry. Our wearable analogue uses walking as the anatomical landmark. During gait, a limb segment rotates mostly about one hinge axis while gravity defines vertical. Those two directions pin down the segment's own coordinate frame. We then carry that frame forward into the still periods that follow, so posture can be read in body coordinates instead of device coordinates.
The claim is specific. A single sensor can recover its mounting offset from a few strides, without a calibration pose. Re-expressing the signal in the recovered segment frame keeps what magnitude features throw away and removes what raw-axis models wrongly learn. To our knowledge, no work in the supplied literature treats sensor orientation as a shortcut to be audited and masked the way imaging treats background tissue.
Core Claim
The Role of Pleura and Adipose in Lung Ultrasound AI supplies the motivating evidence. Unmasked ultrasound classifiers learned to score COVID-19 severity from subcutaneous fat, a cue that correlates with severity but is not the disease. Masking to the pleura and the region beneath it raised the area under the ROC curve (AUC) from 0.6553 to 0.7742. Geometric "straightening" of the pleural line added accuracy (0.5348 vs 0.5261) but not AUC (0.7642).
We argue device orientation plays the same role in wearable activity recognition. In lab datasets every subject wears the sensor the same way, so fixed-axis gravity components become a reliable cue that breaks the moment placement changes. Reiss et al. documents this sharp degradation in daily-living deployment.
The two known responses each fail one half of the problem:
- Scalar invariants. Magnitude, the gravity-subtracted "Euclidean norm minus one" (ENMO), and jerk features (Li et al., Luu et al., Tang and Cheng) are fully invariant but blind to posture.
- Raw-axis models. Models like the boosting ensemble in A competitive approach for human activity recognition on smartphones keep the directional information but tie it to one mounting.
Our representation sits between these. It is invariant to how the device sits on the segment, but not to how the segment sits relative to gravity.
Research Program
The method has three parts.
Gravity estimate. Within each window, we estimate gravity in the sensor frame by low-pass filtering acceleration.
Hinge-axis estimate. During detected walking bouts, we estimate the segment's dominant rotation axis as the principal direction of the gyroscope signal. For the thigh or shank this is the flexion axis. Gravity, averaged over complete gait cycles, gives the segment's long axis up to a known stance-phase bias. Orthogonalizing the two yields an estimated sensor-to-segment rotation, which we call $\hat R_{BS}$.
Gating and carry-forward. The estimate is updated only when a gate confirms enough rotational diversity. This mirrors the Rotation Diversity trigger in Transformer IMU Calibrator. The estimate is carried forward with a confidence weight that decays with time since the last walking bout.
The classifier then receives three input groups:
- the segment-frame tilt, given by gravity rotated through $\hat R_{BS}$;
- rotation-free dynamic features: vertical acceleration, horizontal acceleration magnitude, and gyroscope magnitude;
- the confidence weight.
When confidence is low, segment-frame tilt is down-weighted toward the magnitude-only representation. This is the wearable counterpart of the soft, Gaussian-smoothed mask in Computed tomography–based COVID–19 triage through a deep neural network using mask–weighted global average pooling. It also guards against the cascading failure that Gare et al. and Bo et al. report when landmark detection breaks: here, a person who has not yet walked.
Role of prior work
Several cited works shape the design in different ways.
Transformer IMU Calibrator is the closest prior work. It learns sensor-to-body and drift rotations for six-sensor full-body motion capture with a transformer and no anatomical model. We differ in three ways:
- we target single-sensor activity recognition;
- we use an explicit, interpretable estimate tied to the hinge anatomy of gait;
- our central question is the trade-off between invariance and shortcuts, not pose reconstruction.
DisPad handles displacement with entropy-based channel ranking and distribution alignment. That is blind to geometry and limited to one hinge degree of freedom. We use the hinge geometry explicitly instead.
The straightening result in Gare et al. constrains our expectations. Normalizing geometry added little beyond masking there. So we must show that frame recovery adds something over plain invariance, not merely over raw axes.
Baselines
Naive reference. A raw six-axis model trained on the dataset's canonical mounting and tested under random mounting rotations. On unrotated UCI HAR, A competitive approach for human activity recognition on smartphones reports 99.29% accuracy with 561 features and 98.30% with 26 accelerometer-only features. No reported result was found on Lacuna for UCI HAR under rotated test conditions; producing that number is part of the shortcut audit. We will reproduce a boosted-tree and a small convolutional model on raw axes.
Full-invariance baseline. The same models on magnitude, ENMO and jerk features only. This is the strongest simple competitor for robustness. Beating it means matching its accuracy under rotation while cutting sitting-versus-standing (or sitting-versus-lying) confusion on thigh-mounted data.
Rotation-augmentation baseline. A deep model trained with uniformly random rotations applied to every training window. Beating it requires the same posture gain at equal parameters and tuning budget.
Learned-calibration baseline. The Transformer IMU Calibrator approach, adapted to estimate a single sensor's offset, feeding the same classifier. No reported result was found on Lacuna for its calibration error on AMASS, DIP, DSTIC or IMUPoser. We will therefore compare angular error of the estimated offset directly, with both estimators given identical windows.
Ablations. These isolate the key ingredient:
- removing the carry-forward, so tilt is used only within walking windows;
- replacing the gait-derived offset with the ground-truth offset, which gives an upper bound;
- removing the confidence gate.
All models share data splits, a fixed hyperparameter search budget, and model size comparable to XTinyHAR. XTinyHAR reports 98.71% accuracy on UTD-MHAD, which serves as a reference for a strong tiny inertial model under standard mounting.
Why not just…?
Why not just use signal magnitude? It is the right answer whenever posture does not matter, and we expect it to tie us on dynamic activities. It cannot separate postures that differ only in segment tilt. A competitive approach for human activity recognition on smartphones shows that static postures are where classifiers confuse. The posture-confusion experiment below directly tests whether our extra information pays off.
Why not just augment with random rotations? This is a real threat. A rotation-augmented network becomes invariant, but that is the same invariance magnitude provides: it discards posture tilt. It could recover tilt only by relating gravity to the gait axis inside the same window, and static windows contain no gait. To be fair, we also give the augmented model minutes-long context, a recurrent model over consecutive windows. If that model learns to carry the frame implicitly and matches us, our explicit estimator reduces to an interpretability and efficiency contribution, and we will say so.
Why not just ask for a calibration pose? Static calibration assumes the mounting never changes. That assumption is invalid as sensors slip (Transformer IMU Calibrator) and impractical for populations such as hip-osteoarthritis patients (De Brabandere et al.). We include a one-time-pose baseline with mid-session synthetic re-mounting to measure how fast it degrades.
Proposed Experiments
Shortcut audit. On UCI HAR we train raw-axis models and test under two perturbation families:
- rotations about gravity only (heading);
- tilt rotations.
We report accuracy and macro-F1 against rotation angle, plus feature attributions on gravity-carrying channels. This mirrors the Grad-CAM evidence in Gare et al. The prediction is that tilt perturbations cause large drops while heading perturbations cause small ones, which would localize the shortcut.
Frame recovery accuracy. On synthetic thigh and shank sensors generated from AMASS and DIP with known random offsets, and on real DSTIC recordings with optical ground truth, we measure the angular error of the estimated offset against the number of strides observed. On the in-vitro cadaveric dataset of Weygers et al., we compare the gyroscope-derived flexion axis with the CT-defined anatomical axis. That ground truth agrees with the bone pins to 0.98° ± 0.55° at the femur. The comparison asks whether hinge estimation stays meaningful given internal rotation reaching 22.86°.
Posture separation, the decisive check. On AMASS-synthesized thigh sensors and on thigh-mounted UTD-MHAD trials, we measure sitting-versus-standing confusion after a walking bout under random mounting. Our method must beat both the magnitude baseline and the rotation-augmented long-context baseline, with confidence intervals over subjects. We also need to see degradation toward the magnitude baseline as time since the last walking bout grows; that would show the gain comes from the carried frame. On waist-mounted UCI HAR we predict no posture gain, because torso tilt is the same in both postures. Confirming this null result is part of validating the mechanism.
References
- The Role of Pleura and Adipose in Lung Ultrasound AI
- A competitive approach for human activity recognition on smartphones
- Does feature matter: anomaly detection in sensor networks
- Accurate Step Count with Generalized and Personalized Deep Learning on Accelerometer Data
- Feature pyramid biLSTM: Using smartphone sensors for transportation mode detection
- Transformer IMU Calibrator: Dynamic On-body IMU Calibration for Inertial Motion Capture
- Computed tomography–based COVID–19 triage through a deep neural network using mask–weighted global average pooling
- Interpretable Rheumatoid Arthritis Scoring via Anatomy-Aware Multiple Instance Learning
- DisPad: Flexible On-Body Displacement of Fabric Sensors for Robust Joint-Motion Tracking
- A tiny inertial transformer for human activity recognition via multimodal knowledge distillation and explainable AI
- A Machine Learning Approach to Estimate Hip and Knee Joint Loading Using a Mobile Phone-Embedded IMU
- Reference in-vitro dataset for inertial-sensor-to-bone alignment applied to the tibiofemoral joint