Abstract
Self-supervised learning has emerged as a method for utilizing massive unlabeled data for pre-training models, providing an effective feature extractor for various mobile sensing applications. However, when deployed to end-users, these models encounter significant domain shifts attributed to user diversity. We investigate the performance degradation that occurs when self-supervised models are fine-tuned in heterogeneous domains. To address the issue, we propose SelfReplay, a few-shot domain adaptation framework for personalizing self-supervised models. SelfReplay proposes self-supervised meta-learning for initial model pre-training, followed by a user-side model adaptation by replaying the self-supervision with user-specific data. This allows models to adjust their pre-trained representations to the user with only a few samples. Evaluation with four benchmarks demonstrates that SelfReplay outperforms existing baselines by an average F1-score of 8.8%p. Our on-device computational overhead analysis on a commodity off-the-shelf (COTS) smartphone shows that SelfReplay completes adaptation within an unobtrusive latency (in three minutes) with only a 9.54% memory consumption, demonstrating the computational efficiency of the proposed method.
Introduction: The Challenge of Domain Shift
Self-supervised learning (SSL) is a cornerstone of modern mobile sensing, enabling heart rate monitoring, step counting, and gesture recognition without the need for expensive data labeling. However, these models face a significant hurdle: domain shift. A model pre-trained on data from young users wearing a device on their left wrist often performs poorly when deployed to an older user wearing a phone in their pocket. This shift can cause performance drops of up to 19.6% in F1-score, as the underlying feature extractor remains anchored in the source domain.
The SelfReplay Framework
To overcome this, we propose SelfReplay, a framework that combines meta-learning with self-supervision to enable rapid on-device personalization. Instead of learning static features, SelfReplay trains the model to be highly adaptable.
MetaSSL: Pre-training for Adaptability
In the pre-training phase, we use MetaSSL, a meta-learning approach inspired by MAML. The model is trained on a variety of tasks across different domains to find initial weights that are optimized for quick adaptation. To maintain robustness with the small batches typical of meta-learning, we developed a Domain-Invariant Negative Queue for contrastive learning, providing challenging, domain-agnostic examples.
ReplaySSL: User-Side Adaptation
Once deployed, the model performs ReplaySSL, a quick "replay" of the self-supervised task using the new user's specific unlabeled data. This aligns the model’s internal representations with the target domain before final supervised fine-tuning. This synergy is critical: without MetaSSL pre-training, replaying SSL on a few samples leads to overfitting and degrades pre-trained features.
Experimental Results
We evaluated SelfReplay across seven diverse mobile sensing benchmarks, including human activity recognition (IMU), gesture recognition (sEMG), and stress detection (ECG).
- Accuracy: SelfReplay improved the F1-score by an average of 9.4%p across all benchmarks compared to standard SSL baselines.
- Efficiency: The adaptation step is remarkably lightweight. On a Samsung Galaxy S20 Ultra, SimCLR-based adaptation completed in just 10 seconds with less than 100MB of RAM usage.
- Versatility: The framework is method-agnostic, showing consistent gains when integrated with SimCLR, Predictive Coding (CPC), and Multi-task Learning.
Discussion and Insights
Our analysis revealed a Model Size Paradox: larger models often suffer more from domain shift due to their capacity to overfit source-domain quirks. This makes SelfReplay particularly important for large-scale sensory models.
While MetaSSL pre-training is computationally intensive (taking ~50x longer than standard SSL), the resulting on-device efficiency makes it practical for real-world deployment. Future research will focus on unsupervised domain clustering to eliminate the need for domain labels during pre-training and exploring continuous adaptation as user behavior evolves over time.
Summary updated