Diffusion-Based Synthetic Data Pretraining for Enhancing Activity Recognition
Authors: E. Riveros, D. Vega-Oliveros, A. Soriano-Vargas, A. Rocha
Organizations: Institute of Computing, State University of Campinas, Campinas, Brazil · Institute of Computing State University of Campinas Unicamp Campinas, Brazil · Institute of Science and Technology, Federal University of Sao Paulo, Sao Jose dos Campos, Brazil · Institute of Science and Technology Federal University of S˜ao Paulo UNIFESP S˜ao Jos´e dos Campos, Brazil · Universidad de Ingenieria y Tecnologia, Lima, Peru · Dept. Acad´emico de Ciencia de Computaci´on y Datos Universidad de Ingenier´ıa y Tecnolog´ıa UTEC Lima, Per´u
Human activity recognition (HAR) is increasingly important for healthcare, well-being, and daily monitoring ap- plications, for which detecting alimentary activities such as eating and drinking can provide actionable insight into dietary habits and chronic disease management. HAR systems, however, often underperform on subtle and underrepresented classes, limiting their utility in real-world dietary monitoring. This work builds upon CABiGRU, a convolutional architecture with Bidirectional GRU layers, multi-head attention, and residual connections, designed to capture discriminative temporal patterns from smart- watch accelerometer, gyroscope, and magnetometer data. To improve CaBiGRU's generalization and reduce underfitting in the minority class, we leverage synthetic sensor data windows using a diffusion model and adopt a two-stage training strategy: pre-training CABiGRU on synthetic data, followed by fine-tuning on the real-world data. On the DEO (drinking/eating/other) dataset, the proposed pipeline achieves a balanced accuracy of 90.6%, improving over a strong supervised baseline and showing the benefits of diffusion-based synthetic pre-training for recognizing alimentary activities and representing a step forward dealing with unbalanced classes. These results suggest that combining diffusion-generated data with targeted fine-tuning enhances robust recognition of dietary behaviors, supporting more reliable deployment in healthcare and nutrition-monitoring settings.
Figures & tables
Fig. 1 : Overview of the proposed pipeline for alimentary activity recognition: (A) acquisition of accelerometer, gyroscope, and magnetometer biosignals from a smartwatch; (B) preprocessing into 5-second windows with 50% overlap; (C) diffusion model trained to generate synthetic multivariate windows; (D) CABiGRU trained with a two-stage strategy (pre-training on synthetic data and fine-tuning on real data); and (E) final classification into eating , drinking , or other activities.
Fig. 2 : A diffusion model inspired by Li et al. (2025) is trained on raw multivariate time-series windows using Bidirectional GRU layers.
Fig. 3 : Training and validation accuracy and loss curves for CABiGRU under two training settings. The pretraining-based strategy yields more stable convergence, lower validation loss, and a smaller train-validation gap, indicating reduced overfitting and improved generalization.
Metric
No synthetic data
PCF-GAN pretrain
Diffusion pretrain
Balanced accuracy
0.8655
0.8802
0.9055
Sensitivity (Drink)
0.8269
0.8139
0.8849
Sensitivity (Eat)
0.8701
0.9216
0.9014
Sensitivity (Other)
0.8995
0.9051
0.9304
Specificity (Drink)
0.9404
0.9526
0.9486
Specificity (Eat)
0.9516
0.9500
0.9779
TABLE I : Comparison of downstream task performance under different data generation strategies for the minority classes of DEO drink–eat using a subject-wise split. The first column reports the baseline performance without any data augmentation.
Sensors are critical components of modern intelligent devices. The proliferation of the Internet of Things (IoT) and wearable mobile devices has enabled the integration of such sensors to monitor the environment and enable users to take predictive actions. Human activity recognition (HAR) is a popular application in which Inertial Measurement Unit (IMU)-based sensors, such as accelerometers and gyroscopes, are used to provide insights into health, training, and medical diagnosis. However, the accuracy of such a model is hindered by the lack of data. The diffusion model-based technique has proven successful in generating synthetic data for training HAR models. In this paper, we propose a backdoor training technique, IMU-DM-CLIP, that leverages a diffusion model to enable trigger-based attacks on HAR models. Our empirical analysis shows that the attack is successful even with a very small backdoor injection rate of 10% and 10% of the data guided for the diffusion model.
Human Activity Recognition (HAR) from wearable sensors supports broad healthcare and behavior science applications. However, data heterogeneity and the scarcity of labeled data limit its real-world generalization. Recent advances in self-supervised learning (SSL) in vision and language domains have shown strong capability for learning generalizable representations from unlabeled data. Yet, few studies have systematically compared the generalization performance of SSL methods or explored how to adapt them for generalizable HAR. To address these gaps, we present BenchHAR, a unified framework for evaluating the generalization capability of SSL methods for sensor-based HAR on unseen target distributions. BenchHAR curates a large-scale dataset (~258K samples) and evaluates eight representative SSL methods across 12 encoder-classifier architectures. Our results reveal that existing SSL methods struggle to achieve satisfactory generalization performance. We find that: (1) For HAR models, the hybrid paradigm (combining reconstruction and contrastive pretraining) achieves the best overall performance. The CNN encoder exhibits the strongest ability to learn generalizable representations, while more expressive classifier architectures further improve generalization. (2) For data scale, increasing the amount of pretraining data from downstream activity classes consistently improves generalization, while adding more labeled data yields limited gains. Interestingly, incorporating unlabeled data from non-downstream activity classes does not improve generalization. (3) Sensor data collected from custom-grade devices generalizes better than that from research-grade devices, and data from limb transfers more effectively to trunk positions. BenchHAR provides a unified benchmark and actionable insights for generalizable sensor-based HAR systems. Our code is available at https://github.com/saiketa/HAR-Bench.
Yize Cai, Rui Feng, Anlan Yu +2
The Hong Kong University of Science and Technology (Guangzhou) · Peking University · Singapore-MIT Alliance for Research and Technology
Human Activity Recognition (HAR) has shown remarkable effectiveness in various applications, such as smart healthcare and intelligent manufacturing. However, a major challenge faced by HAR is the distribution shift across different sensor data domains, which often leads to decreased performance when deployed for real-world applications. To address this issue, this paper introduces GenHAR, a novel framework designed to mitigate the domain gap by learning domain-invariant sensor representations. GenHAR aims to enhance the generalization capabilities of HAR on target domains purely with data from the source domain. The key novelty of GenHAR lies in two aspects. Firstly, GenHAR tokenizes sensor data and learns correlations among frequency sensor channel dimensions to improve the robustness of HAR models. Secondly, GenHAR improves the efficiency via selective masking and an efficient attention mechanism. We conduct a systematic analysis of GenHAR by comparing it with state-of-the-art HAR methods on real-world human activity datasets. Results show that GenHAR outperforms state-of-the-art methods by 9.97% in accuracy, and reduces Floating Point Operations by 6.4 times. Moreover, we deploy GenHAR at a leading logistics company in 4 cities, and have detected 2.15 billion real-time activities. We release our code at: https://github.com/Sensor-FoundationModel/GenHAR.
Zhiqing Hong, Zelong Li, Xiubin Fan +5
HKUST (GZ) Guangzhou, China · JD Logistics Beijing, China · Beijing Normal–Hong Kong Baptist University Zhuhai, China +2