TL;DR
This paper introduces Semantic-Discriminative Mixup (SDMix), a novel domain generalization method designed for sensor-based Human Activity Recognition (HAR). By adapting the popular Mixup data augmentation technique to account for varying activity "semantic ranges" across domains and incorporating a large margin loss, SDMix enables deep learning models to generalize effectively to completely unseen users, sensor positions, and datasets. Across extensive evaluations, SDMix achieves an average accuracy improvement of 6% over state-of-the-art approaches.
What Problem Does This Paper Address?
Building robust Human Activity Recognition (HAR) models typically requires massive amounts of labeled sensor data (e.g., from accelerometers and gyroscopes). However, models trained on a specific set of individuals or sensor configurations often fail dramatically when deployed in new environments due to distribution shifts. For instance, an adult walks differently than an elderly person, and a sensor on the wrist captures different patterns than one on the hip.
While Domain Adaptation (DA) techniques attempt to bridge this gap, they require access to unlabeled data from the target domain during training—a luxury not always available in real-world deployments. Domain Generalization (DG) aims to train a model on one or more source domains so that it generalizes to entirely unseen target domains.
While the popular data augmentation technique Mixup (which creates virtual training samples by linearly interpolating pairs of inputs and labels) has been used for DG in computer vision, it struggles in HAR due to two main limitations:
- Semantic Inconsistency: Different activities have different distribution variances (semantic ranges) across domains, causing vanilla Mixup to produce biased decision boundaries.
- Discriminative Slackness: Linear interpolation can easily generate noisy virtual data points near decision boundaries, leading to misclassifications.
Methods
The authors propose SDMix to overcome these limitations through two core components:
- Semantic-aware Mixup: Instead of using the same interpolation weight ($\lambda$) for both the sensor data and the labels, SDMix calculates an activity semantic factor ($t$) to adjust the label blend. This factor is based on the activity semantic range ($R_c$), which measures the maximum statistical shift of an activity from its class center. This calibration ensures that the decision boundary isn't unfairly biased toward classes with larger distribution shifts.
- Large Margin Loss: To combat discriminative slackness, SDMix replaces the standard cross-entropy loss with a large margin loss. This forces the model to maximize the distance between different activity classes in the feature space, ensuring that generated virtual data points fall safely between well-separated classes rather than introducing noise.
Datasets
The authors evaluated SDMix on five widely used public HAR datasets:
- UniMib SHAR: 17 activity/fall classes from 30 subjects using smartphone accelerometers.
- DSADS (Daily and Sports Activities Dataset): 19 activities from 8 subjects wearing 5 body-worn sensors.
- UCI-HAR: 6 daily activities from 30 subjects using waist-mounted smartphones.
- PAMAP2: 18 physical activities from 9 subjects wearing 3 inertial measurement units.
- USC-HAD: 12 activities from 14 subjects with a hip-mounted sensor.
These datasets were used to construct three distinct cross-domain evaluation scenarios: Cross-Person, Cross-Dataset, and Cross-Position generalization.
Key Insights and Ideas
- Context Matters for Activity Variance: The same activity can have vastly different semantic ranges depending on the domain. For example, walking in an open parking lot involves more freedom of movement and variance than walking on a treadmill. Vanilla Mixup treats these variances equally, which degrades generalization.
- Pushing Classes Apart Protects Augmentation: Mixup inherently risks creating "noisy" virtual samples if the underlying classes are close together in the feature space. By enforcing a large margin between classes, the virtual points generated by interpolation become much more reliable and effective for training.
- Mixup Shines on Hard Tasks: The authors observed that Mixup-based data augmentation provides the most dramatic performance boosts when the dataset volume is relatively small but the number of target classes is large (i.e., highly complex and difficult classification tasks).
Key Results
SDMix significantly outperformed standard Empirical Risk Minimization (DeepAll) and several state-of-the-art domain generalization methods (such as DANN, CORAL, Mixup, GroupDRO, RSC, and ANDMask):
- Cross-Person HAR: SDMix achieved a 6.0% average accuracy improvement across the datasets.
- Cross-Dataset HAR: SDMix demonstrated its strongest performance here, yielding a 10.33% average accuracy improvement, proving highly robust against simultaneous shifts in user base, sensor types, and positions.
- Cross-Position HAR: SDMix achieved a 2.34% average accuracy improvement when generalizing to unseen sensor locations on the body.
Limitations and Future Work
The authors note that when the activity semantic range is difficult to estimate accurately—such as in cross-position settings with very limited data or an excessively high number of categories—the performance gains of SDMix are more modest.
For future work, the authors plan to extend the SDMix framework to handle even more complex and dynamic real-world HAR challenges, specifically focusing on cross-category generalization (handling unseen activities) and incremental learning (updating the model continuously over time).
Summary updated