Abstract
Human Activity Recognition (HAR) systems often struggle with the inherent heterogeneity of human movement, where the same activity is performed differently across individuals. This paper introduces CLAUDIA (Contrastive Learning with Auxiliary User Detection for Identifying Activities), a framework designed to improve HAR by integrating User Identification (UI) as an auxiliary task. By employing a novel supervised contrastive loss, CLAUDIA learns user-invariant activity representations. Experimental results on three benchmark datasets—WASH scripted, WASH unscripted, and Extrasensory—demonstrate that CLAUDIA significantly outperforms state-of-the-art models, particularly in real-world, unscripted environments.
Introduction
Modern Human Activity Recognition (HAR) has evolved to be increasingly Context-Aware (CA), accounting for variables such as device placement (e.g., phone in pocket vs. hand). However, a significant gap remains in User-Awareness (UA). Human behavior is highly heterogeneous; factors like gait, speed, and personal habits mean that "walking" or "climbing stairs" looks different from one person to the next.
Traditional models often fail to generalize across diverse users because they do not explicitly distinguish between user-specific nuances and the core patterns of the activity itself. CLAUDIA addresses this by bridging the gap between capturing user-specific patterns for identification and extracting user-invariant patterns for robust activity recognition.
The CLAUDIA Framework
CLAUDIA treats User Identification (UI) not as a nuisance variable, but as a beneficial auxiliary subtask. The framework is composed of three primary modules:
1. Data Encoder
The model utilizes a multi-modal encoding strategy. It processes raw sensor time-series data through a two-layer Long Short-Term Memory (LSTM) network to capture local temporal rhythms. Simultaneously, it incorporates handcrafted features to capture global statistical properties, ensuring a comprehensive representation of the signal.
2. Alignment Module
Following encoding, the alignment module projects the data into distinct latent spaces. These spaces are optimized for three specific objectives: activity prediction, phone placement prediction, and user identification. This separation allows the model to disentangle features relevant to the user's identity from those relevant to the activity.
3. Supervised Contrastive Loss ($L_d$)
The core innovation of CLAUDIA is its supervised contrastive loss function. Unlike standard self-supervised approaches that rely on data augmentation, CLAUDIA leverages ground-truth labels to pull together representations of the same activity performed by different users. Simultaneously, it pushes apart representations of different activities. To maintain stability during optimization—especially in multi-label batches where the number of positive and negative pairs fluctuates—the authors implement a strategy of averaging vectors for positive and negative samples before calculating the loss.
Experimental Evaluation
Datasets
The framework was evaluated on three benchmark datasets representing varying degrees of environmental control:
- WASH scripted: Data from controlled environments with specific participant instructions.
- WASH unscripted: "In-the-wild" data where participants performed natural daily activities.
- Extrasensory: A large-scale dataset featuring over 6 million instances from 60 participants using smartphones and smartwatches in unscripted settings.
Performance Metrics
To account for class imbalances common in HAR data, the study utilized the Matthews Correlation Coefficient (MCC) and Macro F1 scores as primary evaluation metrics.
Results and Discussion
CLAUDIA consistently outperformed established baselines, including Graph Convolutional Networks (GCNs) and LightGBM.
- Significant Gains in Accuracy: The model achieved an average improvement of 11.7% to 14.2% in MCC and 5.4% to 7.3% in Macro F1 scores across the tested datasets.
- Robustness in Unscripted Settings: The most substantial performance leaps occurred in unscripted datasets. This suggests that CLAUDIA is uniquely capable of handling the messy, varied behaviors characteristic of real-world applications, whereas traditional models tend to overfit to specific, scripted movement patterns.
- High-Fidelity User Identification: The model achieved near-perfect UI performance (up to 0.999 F1 score). This dual capability has significant implications for security and medical compliance, such as verifying that a specific patient is performing their prescribed physical therapy exercises.
- Ablation Insights: Removing the LSTM component resulted in the most significant performance degradation, confirming that temporal sequencing is vital for distinguishing between similar activities, such as ascending versus descending stairs.
Conclusion
CLAUDIA demonstrates that incorporating user identity as a regularization factor, rather than a source of noise, significantly enhances the reliability of activity recognition. While the current implementation focuses on recurrent architectures, future work will explore the integration of Transformers to better capture long-range dependencies. Additionally, the high accuracy of user identification necessitates future research into privacy-preserving techniques, such as differential privacy, to ensure the secure deployment of UA-HAR systems in sensitive environments.
Summary updated