Demonstration 1 of 1
Left-right swap augmentation on unseen subjects, by how many people recorded a left-hand wave
When does a left-right swap help a wearable activity classifier, and what does it cost when the label is not updated with the swap?
Right-hand waves look like left-hand waves after the swap, so the relabelled swap turns the abundant class into examples of the rare one: it matters most when few people recorded the left wave, and does little when many did. Keeping the original label teaches the model that left-handed waving is a right-hand wave, which makes it far worse than no augmentation whenever any left-hand waves were recorded (with none, there is nothing to spoil). A window-level cross-validation estimate leaks each person's style and a split among the training people cannot see a class that none of them recorded; with a single left-wave recorder, a person-level split can also land far from the unseen-people score.
Scroll sideways for the whole equation
A window has shape (time, sensors, 3). The swap S exchanges the sensor axis and negates the lateral axis, and the label map m sends wave_right to wave_left, wave_left to wave_right and leaves rest and walk fixed. Macro F1 is the mean of the per-class F1 scores.
Predict first. If nobody in the training set recorded the left-hand wave, what macro F1 does the relabelled swap reach on unseen people, against no augmentation?
Choose an example
Scroll sideways for the whole figure
Constructed example: six seeded cohorts of synthetic wrist-sensor recordings and a random forest, measured by the chapter activity.
Calculated values
- No augmentation
- 0.900
- Swap, relabelled
- 0.966
- Swap, label kept
- 0.651
- Left-wave F1, relabelled swap
- 0.962
- Window-level CV (no augmentation)
- 0.987
When 1 of 12 training people recorded the left-hand wave, the model with no augmentation scores a macro F1 of 0.900 on unseen people and the relabelled swap 0.966, so 0.966 - 0.900 = 0.066 is the gain (left-wave F1 0.799 to 0.962). The swap that keeps the label scores 0.651, 0.900 - 0.651 = 0.249 below no augmentation. Window-level cross-validation on the training people reports 0.987 and person-level 0.716, against 0.900 on unseen people.
Worked steps
- Gain from the relabelled swap: 0.966 - 0.900 = +0.066.
- Cost of keeping the label: 0.651 - 0.900 = -0.249.
- Left-wave F1 with the relabelled swap: 0.962, without augmentation 0.799.
- Window-level CV minus unseen people: 0.987 - 0.900 = +0.087.
Use the idea
Apply a mirror augmentation only where the label is invariant or is updated with the geometry, test it by subject-held-out score with and without it, and split by person before cutting windows.
Where the conclusion applies
Constructed signals in which the left wave is the exact mirror of the right wave, so the relabelled swap is valid by design; a real non-dominant hand can differ and the gain would then be smaller. Gradient-boosted trees or a neural model on raw windows would give different absolute scores. The classes separate by amplitude and spectrum, so the axis flip itself matters little in this generator; it is kept because it is the correct geometry for mirrored units. Twelve training people and six cohorts give the means.
Check your understanding: With all 12 people recording the left wave the relabelled swap gains almost nothing, and the label-keeping swap loses a lot. Why do the two differ so much?
Chapter 58 source: section "Keep Assessment Subjects Independent".