Domain Generalization for Activity Recognition via Adaptive Feature Fusion

Xin Qin, Jindong Wang, Yiqiang Chen, Wang Lu, Xinlong Jiang

TL;DR

This paper introduces AFFAR (Adaptive Feature Fusion for Activity Recognition), a framework designed to make Human Activity Recognition (HAR) models work reliably on new users without needing their data during training. By adaptively fusing domain-invariant features (what all users have in common) with domain-specific features (individual nuances), AFFAR achieves state-of-the-art performance across multiple benchmarks and a real-world clinical application for ADHD diagnosis.

What Problem Does This Paper Address?

Machine learning models for wearable-sensor-based activity recognition often suffer from a "generalization gap." A model trained on one group of people frequently fails when deployed to a new user because sensor readings are highly sensitive to individual body shapes, acting styles, and habits. This is known as domain shift.

While Domain Adaptation (DA) techniques can mitigate this, they typically require access to data from the new "target" user during the training phase. In the real world, we want to "train once, deploy everywhere"—a scenario called Domain Generalization (DG). The challenge in DG for activity recognition is building a model that is robust enough to handle completely unseen distributions without ever having peeked at the target data.

![Fig.

  1. The distributions of accelerometer readings vary among different users. When the test dataset has different distributions and cannot be accessed during training, the performance of existing methods will drop while our method can reach better performance.](/figures/art_5c6b21b9398a46e48a6fc33436849def)

Methods

The authors propose Adaptive Feature Fusion for Activity Recognition (AFFAR). The core idea is that while every user is unique, an unseen user's activity patterns can be represented as a weighted combination of patterns from known users.

The architecture consists of four main modules:

  1. Feature Extraction: A shared CNN that pulls low-level features from raw sensor data.
  2. Domain-Specific Branches: $K$ separate fully connected layers (one for each training domain/user group) that capture the unique characteristics of specific domains.
  3. Domain-Invariant Learning: A module that uses Maximum Mean Discrepancy (MMD) to minimize the distribution gap between source domains, forcing the model to learn transferable, "general" knowledge.
  4. Adaptive Fusion: A domain classifier that takes the shared features and outputs weights. These weights determine how to fuse the outputs of the $K$ domain-specific branches to best represent the current input sample.
Illustration of the AFFAR framework.

During inference, even though the model doesn't know the "domain label" of the new user, the domain classifier adaptively assigns weights based on how similar the new data looks to the training domains it has already seen.

Datasets

The authors evaluated AFFAR on three widely-used public HAR datasets and one specialized clinical dataset:

  • DSADS: Daily and sports activities from 8 subjects (4 domains).
  • USC-HAD: 12 activities from 14 subjects (5 domains).
  • PAMAP2: 18 activities from 9 subjects (4 domains).
  • ADHD Dataset: A real-world dataset involving 166 children (83 healthy, 83 with ADHD) performing diagnostic tasks, used to test the model's ability to classify ADHD subtypes.

Key Insights and Ideas

  • The "Best of Both Worlds" Strategy: Most DG methods focus solely on domain-invariant features. AFFAR argues that domain-specific features are equally important in HAR because they preserve the diversity of human movement, which helps the model better "triangulate" an unseen user's style.
  • Adaptive Weighting as Reconstruction: The model doesn't just average the source domains; it learns a similarity-based weighting. If a new user moves like a mix of "User A" and "User C," the fusion module will prioritize those specific branches.
  • Visualizing Generalization: Using t-SNE visualizations, the authors show that adding domain-specific learning enlarges class margins, while domain-invariant learning aligns the domains. Combining them (AFFAR) results in tight, well-separated clusters that are consistent across different users.
Visualization of the t-SNE embeddings of USC-HAD dataset.

Key Results

AFFAR consistently outperformed state-of-the-art DG methods like MLDG, DANN, and RSC:

  • Public Benchmarks: AFFAR improved the weighted F1 score by 2.5% on DSADS, 1.7% on USC-HAD, and 3.7% on PAMAP2 compared to the next-best comparison method.
  • Clinical Application: In the ADHD diagnosis task, AFFAR achieved a 2.44% improvement in multi-class accuracy for identifying ADHD subtypes, demonstrating its potential for real-world healthcare.
  • Robustness: Parameter sensitivity analysis showed that the model is robust to a wide range of values for its trade-off hyperparameters ($\lambda$ and $\beta$).

Limitations and Future Work

  • The "Ideal Case" Gap: While AFFAR is the best-performing DG method, there is still a performance gap between it and "Fine-tuning" (where the model is allowed to see some target data). Bridging this gap remains an open challenge.
  • Inference Overhead: Because AFFAR maintains $K$ domain-specific branches, its inference time is slightly higher than a simple baseline CNN (though still well within the range for real-time application).
  • Future Directions: The authors plan to explore more advanced domain-invariant modules and extend the framework to other healthcare domains, such as Parkinson’s disease diagnosis.

Summary updated

BibTeX
@article{qin2022domain,
  author = {Xin Qin and Jindong Wang and Yiqiang Chen and Wang Lu and Xinlong Jiang},
  title = {{Domain Generalization for Activity Recognition via Adaptive Feature Fusion}},
  journal = {ACM Trans. Intell. Syst. Technol.},
  year = {2022},
  url = {https://openreview.net/forum?id=HAroB14LwX},
}
Figure