Human activity recognition with contrastive learning and TimeGAN-Based data augmentation
摘要
Human Activity Recognition (HAR) is crucial in healthcare, smart homes, and fitness tracking. Existing methods often struggle with class imbalance, limited data, and generalization to diverse real-world environments. This research proposes an approach that combines contrastive learning, optimized data augmentation, and selective synthetic data generation using TimeGAN to improve HAR performance. Contrastive learning enhances the model’s ability to differentiate overlapping activities such as walking, jogging, sitting, standing, walking_upstairs, and walking_downstairs by learning more discriminative features. Optuna automatically tunes augmentation parameters, including jitter, scaling, and time-masking, ensuring diverse and effective data augmentation. Unlike prior work that generates synthetic data for all classes, this study focuses on confusing or under-represented classes to produce realistic and diverse samples. The method is evaluated with Leave-One-Subject-Out (LOSO) cross-validation and achieved 95.82% accuracy on UCI-HAR, 96.11% on WISDM, and 91.10% on PAMAP2. Metrics including accuracy, precision, recall, F1-score, confusion matrices, UMAP, and t-SNE demonstrate the framework’s robustness and effectiveness across varied activity recognition tasks.