Next Article in Journal
Power Reconstruction and Quantitative Analysis of Photovoltaic Cluster Fluctuation Characteristics Considering Cloud Movement Time Lag
Next Article in Special Issue
A Reproducible Monte Carlo Framework for Evaluating Cost–Latency Trade-Offs in Cloud Continuum
Previous Article in Journal
PCICaching: Learning-Driven and Resilient UAV Caching with Cache-Aware User Association in SAGINs
Previous Article in Special Issue
An Enhanced Siamese Network-Based Visual Tracking Algorithm with a Dual Attention Mechanism
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Domain Adaptation with Contrastive Group Construction for Human Activity Recognition in Multi-Sensor

School of Automation, Guangdong University of Technology, Guangzhou 510006, China
*
Author to whom correspondence should be addressed.
Electronics 2026, 15(6), 1171; https://doi.org/10.3390/electronics15061171
Submission received: 26 January 2026 / Revised: 7 March 2026 / Accepted: 9 March 2026 / Published: 11 March 2026
(This article belongs to the Special Issue Advances in Mobile Networked Systems)

Abstract

Multi-sensor-based human activity recognition (HAR) models trained with deep learning often exhibit limited generalization when applied to data collected under conditions different from those seen during training. To alleviate this issue, we present an adversarial domain adaptation framework that incorporates contrastive group construction to promote class-aware feature alignment. Specifically, augmented and perturbed sample groups are generated in both source and target domains and optimized through contrastive learning objectives, allowing the feature extractor to compact semantically similar representations while separating dissimilar ones without relying on target-domain annotations. This joint design preserves semantic structure while reducing cross-domain distribution discrepancies, resulting in representations that are both domain-invariant and discriminative. Experiments conducted on the Opportunity dataset validate the effectiveness of the proposed approach, demonstrating consistent performance gains over representative unsupervised domain adaptation methods.

1. Introduction

Human activity recognition (HAR), applied in domains like fall detection and sports monitoring, enables machines to understand human behavior. This capability is critical for advanced scenarios such as robot-assisted surgery in low-visibility environments [1]. Recent advances in deep learning have significantly improved human activity recognition in multi-sensor, offering powerful feature extraction from complex sensor signals [2]. However, deep learning models often overfit domain-specific characteristics related to particular subjects, environments, or sensor types, resulting in degraded performance when deployed in unseen domains [3]. This limitation motivates the need for unsupervised domain adaptation (UDA), which adapts models to unlabeled target domains without costly manual annotation, thereby enhancing the generalization of human activity recognition in multi-sensor system.
Compared with models trained on fully labeled data, unsupervised domain adaptation (UDA) can learn effective representations and achieve comparable performance on an unlabeled target domain by leveraging labeled data from a source domain. To alleviate the domain shift induced by variations in environments, subjects, or sensor configurations, UDA methods commonly minimize a discrepancy loss that measures the distributional divergence between source and target features. Such approaches are typically referred to as discrepancy-based methods. For example, DeepCORAL [4] aligns second-order feature statistics by matching covariance matrices across domains. With the advent of generative adversarial networks (GANs) [5], adversarial learning has demonstrated strong capability in extracting domain-invariant representations by introducing a domain discriminator that distinguishes the origin of extracted features. Conditional Domain Adversarial Networks (CDAN) [6], for instance, employ a conditional domain discriminator and a multilinear conditioning strategy to adversarially train the feature extractor, thereby encouraging domain-invariant feature learning. Despite their effectiveness, existing approaches—irrespective of their methodological paradigm—generally assume that the learned feature space inherently exhibits a semantically meaningful structure that can be directly aligned across domains. In practice, however, global feature alignment may induce class-level mismatches, as illustrated in Figure 1b, where features from different classes remain entangled across domains. Consequently, samples belonging to different categories may become mixed in the latent space, leading to degraded classification performance.
In this work, we propose a contrastive domain adaptation framework that enhances class-level feature alignment for multi-sensor activity recognition. Motivated by the success of contrastive learning in self-supervised time-series representation learning [7], we design a structured sample grouping strategy that incorporates original samples together with carefully constructed positive and negative counterparts through augmentation and disturbance. Specifically, augmented samples that share the same class label are regarded as positive samples, whereas samples associated with different labels are treated as negative samples. For positive samples, we perform frequency-domain augmentation by transforming the signals using the Fourier transform and injecting Gaussian noise with a controlled magnitude, followed by an inverse Fourier transform to reconstruct the augmented signals in the temporal domain. For negative samples, since class labels in the target domain are unavailable, there exists an inherent risk of inadvertently selecting samples belonging to the same class as the anchor. To mitigate this issue, we introduce random disturbances to the selected negative samples by partially replacing segments of the original signal with synthetic perturbations. These disturbances are categorized into four types—local, global, trend and seasonal perturbations—thereby increasing the likelihood of semantic discrepancy between negative sample and the anchor. After constructing the sample groups, a contrastive loss is employed to promote class-consistent feature alignment while preserving inter-class separability [8]. By integrating this contrastive structure within an adversarial learning framework, the proposed method facilitates the learning of a feature space that is both domain-invariant and class-discriminative. Our contributions are summarized as follows:
  • We introduce a contrastive discrimination paradigm integrated with adversarial learning for multi-sensor domain adaptation. The proposed framework incorporates a structured sample grouping strategy with contrastive loss constraints to enhance classification performance in the target domain.
  • We propose an augmentation–disturbance strategy for constructing positive and negative samples. Specifically, Gaussian noise is injected into positive samples in the frequency domain, while negative samples are generated by partially perturbing the original signals with structured disturbances, thereby increasing semantic separability.
  • We validate our approach on a real-world multi-sensor dataset, demonstrating superior performance compared to other UDA methods across different feature extractors.

2. Related Work

Domain adaptation for sensor-based human activity recognition (HAR) has attracted increasing attention due to distribution shifts caused by variations in subjects, sensor placement, environmental conditions, and device configurations. Existing approaches can generally be grouped into three methodological categories: discrepancy-driven, adversarial-learning-based, and reconstruction-oriented methods.
Discrepancy-driven approaches reduce cross-domain divergence by aligning statistical properties of feature representations extracted from multi-sensor signals. For example, HoMM [9] mitigates domain shift by matching higher-order moments of feature distributions, while DSAN [10] aligns subdomain-level statistics to reduce fine-grained discrepancies. Such strategies aim to enforce feature consistency across domains, which is particularly important in HAR scenarios where motion patterns vary significantly across individuals. Adversarial-learning-based methods introduce domain discriminators to encourage sensor features from different domains to become indistinguishable. DANN [11] employs a gradient reversal layer to guide the feature extractor toward domain-invariant representations, whereas DIRT [12] further enhances invariance through iterative adversarial refinement. CDAN [6] extends this paradigm by conditioning the discriminator on classifier outputs, facilitating multimodal alignment. In HAR settings, these methods help alleviate distribution mismatch induced by heterogeneous sensor characteristics and subject-dependent motion variability. Reconstruction-oriented approaches assume that reconstructing input signals can preserve domain-specific structure while promoting shared representations. SDA [13], for instance, learns unified representations capable of reconstructing data from multiple domains using a shared network. Although originally proposed for visual tasks, such strategies have been adapted to sequential sensor data to maintain temporal coherence.
Despite these advances, many existing methods are either originally designed for image-based applications or do not fully exploit the intrinsic properties of multi-sensor time-series signals, such as temporal continuity and cross-sensor correlation. To address time-series-specific challenges, several dedicated approaches have been proposed. AdvSKM [14] employs a kernel-based metric to quantify domain discrepancy in sequential representations. CoDATS [15] aligns temporal feature distributions through adversarial training with temporal consistency constraints. CoTMix [16] introduces contrastive learning with sequence-level mixup to generate synthetic time-series samples. However, when domain gaps are substantial, mixed sequences may deviate from realistic motion dynamics, limiting their effectiveness in HAR scenarios.
Motivated by these limitations, we develop a unified framework that integrates adversarial learning with a structured contrastive grouping mechanism tailored for multi-sensor sequential data. By explicitly enhancing class-level alignment while preserving temporal and semantic structure, the proposed approach facilitates the learning of discriminative and domain-robust representations for sensor-based HAR.

3. Problem Definition

We denote a multi-sensor dataset as D = { ( x i , y i ) } i = 1 n , where n is the number of multivariate time-series samples. Each sample x i R T × d consists of readouts from d sensors over T time steps, while y i { 1 , 2 , , N } represents the corresponding label, where N denotes the number of classes, denoted as C . Therefore, we define the labeled source domain dataset as D s = { ( x i s , y i s ) } i = 1 n s , where n s refer to the number of the source domain samples, x i s represents the i-th source domain sample, and y i s denotes the associated label. The target domain dataset is unlabeled and is denoted as D t = { ( x i t ) } i = 1 n t , where n t represents the number of unlabeled target domain samples. Source and target domains have samples drawn from source and target distributions, D s p s ( x s , y s ) and D t p t ( x t , y t ) . Considering the assumption of the domain shift problem, we focus on the scenario where the marginal probability distributions of x differ, p s ( x ) p t ( x ) , while conditional probability distributions remain constant across domains, p s ( y | x ) = p t ( y | x ) . However, when class-conditional distributions vary significantly between domains, domain alignment may result in suboptimal or biased decision boundaries. Such violations correspond to conditional shift and can lead to performance degradation. Accordingly, we adopt a model h θ = g θ f θ , parameterized by θ , where f θ : X Z is a feature extractor mapping input data to a latent space Z , and g θ : Z C is a classifier mapping features to class predictions.
Following the domain adaptation theory in [17], let H be the hypothesis space and let ( D s , ϵ s ) and ( D t , ϵ t ) represent the two domains and their corresponding generalization error functions. Then for any h H , we have the following inequality:
ϵ t ( h ) ϵ s ( h ) + 1 2 d H Δ H ( D s , D t ) + λ
where λ = min h H [ ϵ t ( h ) + ϵ s ( h ) ] , and d H Δ H denotes the H Δ H -distance between two domains, and is defined as
d H Δ H = 2 sup h , h H P D s [ h h ] P D t [ h h ]
This bound reveals that the target error depends on three terms: the source error ϵ s ( h ) , the divergence H Δ H between domains, and the joint optimal error of the ideal hypothesis across both domains. Thus, an effective UDA strategy aims to minimize the domain divergence while maintaining low source error, implicitly encouraging the learned hypothesis h to approach the optimal joint hypothesis h .

4. Methodology

4.1. Model Overview

We tackle unsupervised domain adaptation (UDA) for human activity recognition in multi-sensor by enhancing the feature extractor with a tailored contrastive learning objective, as illustrated in Figure 2. Specifically, we introduce class-aware augmentation-disturbance strategy to construct positive and negative pair in the source domain and the target domain. By jointly minimizing the contrastive losses in both domains within an adversarial learning framework, our approach effectively reduces the divergence H Δ H between domains while promoting class-discriminative and domain-invariant feature representations.

4.2. Augmentation–Disturbance-Based Sample Grouping Strategy

For each anchor sample derived from multi-sensor sequential data, a corresponding group of positive and negative samples is constructed to form contrastive sample groups. In the source domain, where class labels are available, a sample sharing the same label as the anchor x i , s is selected as the positive sample x p , s , while samples belonging to different classes are selected as negative samples x n , s . In the target domain, where labels are unavailable, the anchor x i , t itself is used to construct the positive sample through augmentation, whereas another sequence is randomly selected from the same batch and treated as the negative sample x n , t .
Contrastive learning relies on data augmentation to shape invariant feature representations, enforcing proximity among augmented views of the same signal and separation from representations of other signals [18]. Accordingly, augmentation is applied to construct positive pairs x i p . However, when negative samples are randomly selected from a batch, there exists an inherent risk that they may share the same underlying class as the anchor. To mitigate this issue, structured disturbances are introduced to construct negative pairs x i n , thereby increasing semantic discrepancy between contrastive pairs. The augmentation and perturbation strategies are described in detail in the following paragraphs, and an example of the constructed sample group is illustrated in Figure 3.
To construct positive pairs, we inject controlled noise into the original signals, as this directly enforces the inductive bias that the core semantic representation of a sample should remain invariant under continuous, low-magnitude perturbations in the input space. Such perturbations encourage a more robust and smoothly varying latent embedding. Specifically, we perform frequency-domain augmentation by injecting Gaussian noise into the Fourier spectrum of each sequence sample x i [19]. The procedure is defined as
x i ¯ = { F 1 ( F { x i } + η · 1 N m = 0 N 1 | X [ m ] | · ( N R [ k ] + j N I [ k ] ) ) }
where X [ m ] is denoted as Discrete Fourier Transform of x i :
X [ m ] = F { x i } [ m ] = n = 0 N 1 x i [ n ] e j 2 π m n / N , m , k { 0 , 1 , , N 1 }
Here, F ( · ) and F 1 ( · ) denote the Fourier transform and its inverse, respectively, and { · } extracts the real part of the reconstructed signal. The parameter η controls the noise magnitude. The terms N R [ k ] and N I [ k ] represent independent and identically distributed Gaussian noise applied to the real and imaginary components, respectively.
To construct negative pairs, a structured disturbance strategy is introduced to mitigate the risk of selecting samples that share the same underlying class as the anchor. Considering the intrinsic properties of multi-sensor sequential signals, the proposed disturbances are designed to reflect plausible variations observed in real-world sensor measurements rather than arbitrary noise injection. In practical HAR scenarios, sensor readings may exhibit localized abnormal spikes due to transient motion artifacts, sensor displacement, or environmental interference, as well as sustained temporal deviations caused by gradual posture changes or motion pattern shifts. Accordingly, we introduce two categories of perturbations. Point-level disturbances simulate instantaneous measurement anomalies by modifying individual timestamps using statistically extreme values derived from the signal distribution. Subsequence-level disturbances emulate structured temporal deviations, such as trend shifts or periodic pattern alterations, within a contiguous segment [20]. These perturbations preserve the overall signal structure while introducing sufficient semantic deviation, thereby ensuring that negative samples remain physically plausible yet discriminatively distinct from the anchor and positive samples. The disturbance ratio is varied from 5 data points to 90% of the entire sequence. For point-level disturbances, statistical properties of the signal are exploited to generate abnormal perturbations. Specifically, for the global disturbance, the mean μ w and standard deviation σ w are computed over the entire sequence. Abnormal values are then randomly sampled from the group { μ w + m · σ w , μ w m · σ w } , where m [ 3 ,   5 ] , and used to replace randomly selected points in the original signal. For the local disturbance, a local temporal region is first selected, within which the mean μ l and standard deviation σ l are computed. Abnormal values sampled from group { μ l + m · σ l , μ l m · σ l } are then used to perturb randomly selected points within this region. For subsequence-level disturbances, a temporal segment is selected with start and end indices denoted by p 1 and p 2 , respectively. The trend disturbance is defined as:
s ( t ) = s ( t ) + m σ w p 1 t p 2 s ( t ) Otherwise .
where s ( t ) and s ( t ) denote the original and perturbed signals, respectively. In addition, the seasonal disturbance is defined as
s ( t ) = s ( p 1 + ( [ t p 1 ] · f ) mod   L ) p 1 t < p 2 , f 1 s ( t ) Otherwise .
where f is a randomly sampled scaling factor and L = p 2 p 1 denotes the length of the disturbed subsequence.

4.3. Contrastive Discrimination Based on Adversarial Representation Learning

In our framework, the choice of feature extractor is flexible, as the focus lies in improving cross-domain feature alignment rather than evaluating extractor performance. For each domain, we obtain features for anchors and their corresponding positive negative samples: z i , s , z i , s p , z i , s n Z s and z i , t , z i , t p , z i , t n Z t , where Z s and Z t representing source and target features, respectively. In the source domain, labeled data allow explicit construction of positive and negative pairs. This yields the following supervised contrastive loss:
L c o n t s = 1 | B | i = 1 | B | m a x ( 1 | N | j = 1 | N | ( z i , s z i , s p 2 2 z i , s z j , s n 2 2 + m ) , 0 )
where | B | is the batch size, and | N | is the number of negative samples in the batch. This loss function uses true source domain labels to enhance the separation of different class feature by at least the margin m. Compared with probability-based objectives such as InfoNCE, the Euclidean margin loss provides a clearer geometric interpretation, directly encouraging compact intra-class clustering and explicit inter-class separation. Moreover, it is easier to optimize and less sensitive to batch size. By leveraging explicit labels, this loss enforces clear inter-class separation in the source feature space. Importantly, this structured feature space also serves as a reference for aligning the target domain, implicitly guiding the learning of domain-invariant representations. In the target domain, where labels are unavailable, we rely on the assumption that nearby samples are more likely to share semantics. We construct pseudo-positive pairs using nearest neighbors and negatives using distant samples. The target unsupervised contrastive loss is
L c o n t t = 1 | B | i = 1 | B | m a x ( z i , t z i , t p 2 2 z i , t z i , t n 2 2 + m , 0 )
This enforces that target features are more tightly aligned with their positives while being separated from negatives, implicitly improving domain alignment and class- level discrimination.
To further mitigate domain shift, we incorporate an adversarial learning framework, which encourages the extraction of domain-invariant features. This framework includes a domain discriminator and a task classifier. The discriminator is trained to distinguish between source and target domain representations, while a Gradient Reversal Layer (GRL) allows adversarial signals to update the feature extractor by reversing gradients during backpropagation. The discriminator loss is defined as
L d = sup D [ E z Z s [ ln D ( z ) ] + E z Z t [ 1 ln D ( z ) ] ]
In parallel, a task classifier minimizes the supervised classification loss on the source domain:
L c l s = E x , y D s [ y ln h θ ( x ) ]
which directly reduces the source error term ϵ s ( h ) in the theoretical domain adaptation bound based on H Δ H -divergence. The overall training objective integrates all components as
L o v e r a l l = α · L c o n t s + β · L c o n t t + γ · L d + λ · L c l s
where hyperparameters α , β , γ , λ balance the contribution of each loss term. By jointly optimizing this objective, the model learns features that are discriminative, domain-invariant, and robust across source and target domains.

5. Experiments

5.1. Dataset

We select the publicly available Opportunity [21] dataset to evaluate our proposed method. This dataset includes a rich set of sensor modalities, such as inertial measurement units (IMUs), various body-worn sensors, and object-mounted sensors. The configuration of the body-worn sensors is illustrated in Figure 4. It provides extensive recordings of multiple subjects performing a wide range of activities, such as walking, sitting, and interacting with various objects. These characteristics make Opportunity particularly suitable for our study, as it enables rigorous evaluation under diverse motion patterns and sensor configurations. Furthermore, it is widely recognized as a benchmark in Human Activity Recognition (HAR) and sensor-based motion analysis, ensuring comparability with prior work and relevance to real-world applications.

5.2. Experimental Setup

We select baseline methods according to three criteria: (1) coverage of diverse unsupervised domain adaptation (UDA) paradigms, including adversarial approaches (e.g., CDAN [6]), discrepancy-based methods (e.g., DeepCORAL [4]), and reconstruction-based techniques (e.g., CoTMix [16]), enabling a comprehensive evaluation; (2) relevance to time-series domain adaptation, with a focus on methods designed for or adaptable to sequential data; and (3) inclusion of strong and widely recognized baselines to ensure a rigorous comparison. Each dataset is partitioned by subject into 70% training and 30% testing sets. All splits are normalized using statistics computed from the training data. Experiments are conducted on a server equipped with eight AMD EPYC 7702 64-core CPUs and an NVIDIA GeForce RTX 4090 GPU.
To effectively capture complex dependencies in multivariate sensor data, we adopt a Graph Neural Network (GNN) as the primary feature extractor. The architecture consists of three convolutional blocks augmented with Graph Convolutional Network (GCN) layers [22], enabling explicit modeling of spatial relationships among sensors. We first compare our proposed method with five representative baselines using the same GNN backbone to ensure a fair evaluation. Subsequently, we further analyze classification performance under different adaptation scenarios to validate the effectiveness of our approach. In the ablation study, we evaluate the robustness of our framework from three aspects. First, to verify that the method is not overly dependent on a specific backbone, we replace the GNN with a Temporal Convolutional Network (TCN). Second, we assess the individual contributions of each loss component under different adaptation settings. Third, we examine the necessity of the proposed augmentation–perturbation strategy on three different tasks. Finally, we conduct a sensitivity analysis to examine the influence of three key hyperparameters, along with a computational analysis to evaluate the actual computational cost of the proposed method.
For fair comparison, we standardize the training protocol, feature extractor configurations, and optimizer settings across all methods, following the AdaTime benchmark [23]. All models are trained for 40 epochs with a batch size of 32 using the Adam optimizer with a learning rate of 1 × 10 3 . Reported results are presented as the mean and standard deviation over 10 independent runs with different random seeds across five domain adaptation scenarios.

5.3. Experimental Performance

5.3.1. Comparison with Baselines

All methods are implemented using a unified architecture consisting of a representative GNN feature extractor followed by a single fully connected classification layer. This consistent design ensures a fair comparison by isolating the contribution of domain adaptation strategies. GNNs are particularly suitable for modeling spatial relationships among multiple sensors. Performance is evaluated using Accuracy and Macro-F1 (MF1). While Accuracy reflects overall correctness, MF1 provides a balanced evaluation under class-imbalanced conditions, which are common in human activity recognition datasets.
Table 1 reports the performance comparison on the Opportunity dataset. Statistical significance is assessed using a t-test, with p-values below 0.05 and 0.01 indicated in the table. The proposed method consistently achieves the best results, reaching 88.22% Accuracy and 85.95% MF1, demonstrating strong effectiveness and generalization capability. In contrast, CoTMix, a reconstruction-based approach that performs sequence-level mixup between domains, exhibits performance degradation. This is likely due to semantic distortion caused by mixing heterogeneous sequences, particularly in the unlabeled target domain.
To further analyze baseline performance, we conduct class-wise evaluation. Table 2 presents overall target-domain accuracy, and Figure 5 illustrates the confusion matrix for the adaptation scenario from scenario 3 to scenario 1. Our method demonstrates superior stability and robustness across tasks, notably improving the classification of standing activity from walk and lie.
Although our experiments primarily focus on the Opportunity [21] dataset, as the augmentation and perturbation strategies are closely related to its sensor characteristics, we further evaluate our approach on the HHAR [24] dataset, another widely used benchmark for human activity recognition. As shown in Table 3, our method still outperforms the compared approaches overall, demonstrating its robustness and confirming that constructing high-quality negative samples is crucial for improving domain adaptation performance.
Table 1. Overall Accuracy and Macro-F1 (MF1) obtained by different unsupervised domain adaptation approaches on the Opportunity [21] dataset with a GNN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
Table 1. Overall Accuracy and Macro-F1 (MF1) obtained by different unsupervised domain adaptation approaches on the Opportunity [21] dataset with a GNN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
GNNCDAN [6]CoTMix [16]DeepCORAL [4]DSAN [10]SASA [25]Ours
AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)
3 → 177.05% ± 4.11% †68.86% ± 13.65%65.45% ± 22.06% †56.69% ± 20.91% †78.55% ± 4.09%58.42% ± 3.96% ‡73.95% ± 7.37% †65.59% ± 9.68% †76.75% ± 5.25% †65.75% ± 14.81%82.65% ± 6.26%78.59% ± 14.43%
2 → 374.55% ± 5.05% ‡58.32% ± 5.99% ‡62.80% ± 20.75% †59.04% ± 21.66%79.65% ± 1.72%60.41% ± 5.99%70.05% ± 5.10% ‡53.05% ± 3.74% ‡74.80% ± 4.23% ‡58.81% ± 9.38% ‡80.90% ± 3.07%73.72% ± 3.58%
3 → 490.90% ± 2.14%91.16% ± 1.87%72.45% ± 23.32% †65.28% ± 23.26% ‡87.20% ± 2.99% ‡69.86% ± 10.67% ‡78.95% ± 5.16% ‡72.20% ± 10.87% ‡92.35% ± 2.36%90.19% ± 9.14%92.40% ± 0.94%92.39% ± 1.06%
4 → 191.00% ± 1.63%91.74% ± 1.52%63.80% ± 21.29% ‡57.39% ± 20.33% ‡84.65% ± 3.23% ‡84.78% ± 3.49% ‡87.30% ± 4.24%84.54% ± 6.48% †89.50% ± 2.95%90.91% ± 2.75%88.80% ± 2.20%89.60% ± 2.16%
1 → 384.75% ± 4.27%70.23% ± 13.58%72.35% ± 8.90% ‡66.47% ± 11.63% ‡77.70% ± 1.16% ‡51.04% ± 2.81% ‡73.70% ± 6.17% ‡61.35% ± 11.09% ‡80.85% ± 2.46% ‡63.78% ± 8.03% ‡90.25% ± 3.65%87.34% ± 8.32%
2 → 488.55% ± 2.84% †88.33% ± 4.54%71.20% ± 22.84% †68.18% ± 23.46% †91.60% ± 1.60%90.59% ± 2.51%74.90% ± 6.43% ‡60.99% ± 16.55% ‡87.05% ± 2.29% ‡86.08% ± 3.99% ‡91.50% ± 1.78%91.49% ± 1.38%
1 → 490.05% ± 2.29%87.72% ± 8.37%79.20% ± 5.73% ‡72.74% ± 6.56% ‡83.15% ± 3.50% ‡69.87% ± 11.55% ‡75.70% ± 5.49% ‡64.42% ± 16.45% ‡89.80% ± 0.86% ‡88.55% ± 2.70%93.55% ± 1.91%92.86% ± 2.32%
3 → 273.60% ± 2.67%59.07% ± 5.87%65.90% ± 5.09% ‡56.85% ± 5.88% †80.50% ± 2.00%61.30% ± 1.51%73.35% ± 9.72%66.39% ± 11.17%77.25% ± 4.35%66.11% ± 10.39%76.60% ± 5.08%68.26% ± 13.53%
4 → 393.50% ± 0.85%92.86% ± 1.05%67.85% ± 32.01% †64.84% ± 33.04% †84.80% ± 2.10% ‡71.26% ± 7.23% ‡77.45% ± 8.03% ‡66.76% ± 19.43% ‡88.45% ± 3.83% †83.41% ± 12.15%91.65% ± 1.27%90.84% ± 1.39%
2 → 193.65% ± 1.60%94.22% ± 1.33%68.70% ± 22.50% ‡64.53% ± 22.10% ‡88.65% ± 1.76% ‡88.52% ± 2.14% ‡86.65% ± 5.50% ‡86.02% ± 7.63% ‡92.70% ± 1.69%93.28% ± 1.69%93.85% ± 0.75%94.39% ± 0.76%
Overall85.76% ± 8.01%80.25% ± 15.48%68.97% ± 19.89% ‡63.20% ± 20.23% ‡83.64% ± 5.03% ‡70.60% ± 14.18% ‡77.20% ± 8.24% ‡68.13% ± 15.25% ‡84.95% ± 7.24% ‡78.69% ± 15.18% ‡88.22% ± 6.49%85.95% ± 10.95%
Table 2. Class-wise classification accuracy of different methods across all evaluation scenarios. The highest values in each column are shown in bold, and the second-highest values are underlined.
Table 2. Class-wise classification accuracy of different methods across all evaluation scenarios. The highest values in each column are shown in bold, and the second-highest values are underlined.
StandWalkSitLie
CDAN [6]67.11%92.91%70.25%92.52%
CoTMix [16]71.19%70.08%67.54%68.52%
DeepCORAL [4]37.89%97.03%50.99%94.86%
DSAN [10]54.05%76.40%73.76%91.74%
SASA [25]60.89%89.13%75.35%93.77%
Ours82.44%95.00%69.78%92.17%
Table 3. Overall Accuracy and Macro-F1 (MF1) obtained by different unsupervised domain adaptation approaches on the HHAR [24] dataset with a GNN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
Table 3. Overall Accuracy and Macro-F1 (MF1) obtained by different unsupervised domain adaptation approaches on the HHAR [24] dataset with a GNN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
GNNCDAN [6]CoTMix [16]DeepCORAL [4]DSAN [10]SASA [25]Ours
AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)
0 → 652.51% ± 7.21%50.28% ± 6.68%65.67% ± 25.05%57.22% ± 27.48%60.44% ± 9.52%54.20% ± 9.14%55.35% ± 8.86%53.50% ± 8.30%58.78% ± 9.14%54.91% ± 8.12%54.89% ± 6.37%50.85% ± 5.80%
1 → 692.96% ± 1.78%92.92% ± 1.76%47.16% ± 37.49% ‡39.21% ± 44.07% ‡83.89% ± 4.25% ‡83.72% ± 4.84% ‡93.39% ± 1.68%93.38% ± 1.69%91.64% ± 0.60%91.59% ± 0.58%92.25% ± 1.10%92.19% ± 1.13%
2 → 759.94% ± 1.50%60.34% ± 1.08%79.02% ± 4.70%71.80% ± 5.08%48.14% ± 3.23% ‡44.12% ± 2.95% ‡58.00% ± 7.00%56.94% ± 7.83%51.31% ± 8.07%48.37% ± 7.05% †55.84% ± 3.93%55.63% ± 4.78%
3 → 887.41% ± 9.03% †87.40% ± 9.18% †71.23% ± 35.33%67.28% ± 42.61%79.04% ± 1.38% ‡78.48% ± 1.71% ‡95.40% ± 0.90%95.62% ± 0.90%82.07% ± 5.49% ‡81.70% ± 5.73% ‡95.77% ± 0.94%95.97% ± 0.93%
4 → 597.50% ± 0.41%97.58% ± 0.40%78.65% ± 30.51%75.01% ± 36.93%82.94% ± 6.38% ‡83.19% ± 6.33% ‡96.81% ± 0.61%96.89% ± 0.59%94.95% ± 2.08%95.08% ± 2.17%93.13% ± 3.21%93.19% ± 3.27%
5 → 032.60% ± 9.89% ‡30.18% ± 8.66% ‡65.97% ± 16.40%60.80% ± 19.50%39.78% ± 2.77% ‡35.65% ± 3.81% ‡27.42% ± 5.56% ‡29.17% ± 4.95% ‡33.15% ± 3.42% ‡28.45% ± 3.27% ‡50.41% ± 4.61%48.56% ± 3.51%
6 → 194.31% ± 1.03%94.16% ± 1.09%87.67% ± 23.21%86.08% ± 28.17%85.06% ± 2.21% ‡84.45% ± 2.35% ‡95.36% ± 0.80%95.24% ± 0.84%93.04% ± 1.78%92.89% ± 1.83%93.13% ± 1.28%93.00% ± 1.31%
7 → 496.39% ± 1.18%96.45% ± 1.11%93.21% ± 2.15%93.20% ± 2.63%87.34% ± 4.36% ‡87.21% ± 4.34% ‡96.41% ± 0.96%96.42% ± 0.92%92.00% ± 1.12%91.84% ± 1.18%93.69% ± 3.37%93.71% ± 3.29%
8 → 393.77% ± 10.65%94.11% ± 9.81%64.38% ± 33.62% †58.47% ± 38.36% †76.13% ± 8.60% ‡72.92% ± 11.22% ‡96.83% ± 0.39%96.91% ± 0.38%96.85% ± 0.40%96.94% ± 0.40%95.69% ± 1.42%95.78% ± 1.49%
0 → 277.41% ± 3.70%70.80% ± 4.83%72.47% ± 19.33%64.87% ± 21.06%66.59% ± 3.07% ‡59.59% ± 4.16% ‡73.45% ± 3.75%67.92% ± 3.31%77.43% ± 2.75%70.21% ± 2.52%76.42% ± 3.65%69.61% ± 3.63%
Overall78.48% ± 22.27%77.42% ± 23.07%72.54% ± 27.40% †67.39% ± 32.13% ‡70.94% ± 16.64% ‡68.35% ± 18.63% ‡78.84% ± 23.64%78.20% ± 23.75%77.12% ± 21.41%75.20% ± 23.07%80.12% ± 18.49%78.85% ± 19.62%

5.3.2. Ablation Study

To verify that the proposed framework is not overly dependent on a specific backbone, we evaluate its robustness by replacing the primary GNN with a Temporal Convolutional Network (TCN) [23] as an alternative feature extractor. As summarized in Table 4, our method maintains strong performance even when transitioned to a purely temporal-based architecture. This consistency across different architectural paradigms demonstrates that the efficacy of our domain adaptation strategy is backbone-agnostic and generalizes well to diverse feature extraction mechanisms.
To evaluate the individual contributions of the components within our framework, we conduct a systematic ablation study on the loss functions. While the classification loss L c l s is retained across all variants, we analyze the impact of the source-domain contrastive loss L c o n t s , a target-domain contrastive loss L c o n t t and and a domain discriminator loss L d .
The results in Table 5 indicate that the removal of contrastive learning from either domain consistently leads to a deterioration in classification accuracy compared to the full configuration. Specifically, when contrastive learning is restricted to the target domain, features tend to cluster without sufficient semantic alignment. Conversely, applying it solely to the source domain forces target features to align rigidly with source-class centers, failing to capture the intrinsic structure within the target domain. Furthermore, the discriminator loss L d proves crucial for promoting the aggregation of target features toward their respective semantic centers. These observations underscore the necessity of jointly leveraging dual-domain contrastive objectives and adversarial learning.
Finally, we evaluate the efficacy of our proposed data augmentation and perturbation grouping strategy. As shown in Table 6, the experimental results across three scenarios support the consensus in contrastive learning research that proper augmentation is essential for performance. We further compare our perturbation strategy for negative sample construction against standard Fourier augmentation ( F ). We observe that since Fourier augmentation primarily adds frequency noise to sequences, it may result in negative samples that are insufficiently discriminative from positive samples, potentially leading to a slight performance drop compared to the no-augmentation baseline. In contrast, our perturbation strategy is specifically designed to enhance the discriminability of negative sequences relative to the anchor and positive samples, thereby facilitating the learning of more robust and separable representations.

5.3.3. Sensitivity and Computational Analysis

We conduct a sensitivity analysis on the Scenario 3 → Scenario 1 domain adaptation task to evaluate the impact of three key hyperparameters: the separation margin m, the Fourier-transform-based augmentation ratio η and and the disturbance-affected area L. As illustrated in Figure 6, increasing the margin m helps establish clearer decision boundaries and does not lead to severe performance degradation even at larger values, indicating that the proposed method is relatively robust to this parameter. In contrast, the augmentation ratio η exhibits a clear upper bound: excessively large values result in performance collapse, as positive samples become dominated by noise and lose their semantic consistency. Finally, the results show that increasing the disturbance-affected area L generally improves performance by encouraging tighter clustering of target-domain features, thereby enhancing final classification accuracy.
Table 7 reports the computational cost of our method compared with several baselines. Our approach incurs a higher training time (3.17 s/epoch), mainly due to the CPU-based perturbation generation used to construct high-quality negative pairs. In addition, the feature extractor is repeatedly applied to learn representations from the augmented and perturbed samples, rather than processing a single source–target pair as in conventional methods. To further analyze the computational overhead, we compare our method with the adversarial-based approach CDAN [6] in Table 8. The results show that the FLOPs of the feature extractor in our framework are approximately three times those of CDAN during training. However, this additional cost is strictly confined to the offline training phase. During inference, the feature extractor is executed only once, and the proposed method maintains a highly competitive inference latency (0.4370 ms), demonstrating its suitability for real-time deployment.

6. Limitation and Future Work

Although the experimental results demonstrate the effectiveness and robustness of the proposed framework, several limitations remain. A primary constraint lies in the construction of high-quality negative pairs, which is physics-informed and relies on the inherent physical properties and spatial correlations of sensor data. In this study, the perturbation strategy was tailored to the sensor configuration and semantic activity patterns of the Opportunity benchmark. While this design ensures physically meaningful negative samples, it requires manual adaptation when applied to datasets with substantially different sensor modalities or configurations.
Nevertheless, incorporating physical consistency into contrastive learning is essential for mitigating semantic misalignment in unsupervised domain adaptation. As future work, we plan to develop adaptive perturbation policies capable of automatically inferring physical constraints from sensor metadata, thereby improving generalization across diverse human activity recognition scenarios.

7. Conclusions

We propose a domain adaptation framework for multi-sensor human activity recognition that integrates a contrastive discrimination strategy within an adversarial learning architecture. Specifically, contrastive sample groups are constructed via an augmentation–disturbance mechanism and processed by a shared feature extractor, guided by a contrastive loss applied to both source and target domains. This design encourages semantically similar samples to cluster in the feature space while separating dissimilar ones, even in the absence of target-domain labels. Experiments conducted on the Opportunity dataset provide initial validation of the proposed framework. The results demonstrate consistent performance improvements over representative domain adaptation baselines, indicating that the proposed contrastive grouping strategy is effective in mitigating domain shifts in multi-sensor human activity recognition.

Author Contributions

Conceptualization, Y.T. and S.L.; methodology, Y.T.; software, Y.T.; validation, Y.T.; formal analysis, Y.T.; investigation, Y.T.; resources, Y.T.; data curation, Y.T.; writing—original draft preparation, Y.T.; writing—review and editing, Y.T. and S.L.; visualization, Y.T.; supervision, S.L.; project administration, S.L.; funding acquisition, S.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Natural Science Foundation of China under Grant 62403144, and Grant 62573140; in part by the Guangdong Basic and Applied Basic Research Foundation under Grant 2024B1515250008.

Data Availability Statement

The Opportunity dataset [21] used in this study is publicly available from the UCI Machine Learning Repository at https://archive.ics.uci.edu/dataset/226/opportunity+activity+recognition, accessed on 15 February 2026. The HHAR dataset [24] used in this study is publicly available from the UCI Machine Learning Repository at https://archive.ics.uci.edu/dataset/344/heterogeneity+activity+recognition, accessed on 25 February 2026.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Olugbade, T.; He, L.; Maiolino, P.; Heylen, D.; Bianchi-Berthouze, N. Touch Technology in Affective Human–, Robot–, and Virtual–Human Interactions: A Survey. Proc. IEEE 2023, 111, 1333–1354. [Google Scholar] [CrossRef]
  2. Meng, W.; Liu, Z.; Li, B.; Cui, W.; Zhou, J.T.; Zhang, L. GrapHAR: A Lightweight Human Activity Recognition Model by Exploring the Sub-Carrier Correlations. IEEE Trans. Wirel. Commun. 2024, 23, 2755–2770. [Google Scholar] [CrossRef]
  3. Wang, M.; Deng, W. Deep visual domain adaptation: A survey. Neurocomputing 2018, 312, 135–153. [Google Scholar] [CrossRef]
  4. Sun, B.; Saenko, K. Deep coral: Correlation alignment for deep domain adaptation. In Computer Vision—ECCV 2016 Workshops; Springer: Cham, Switzerland, 2016; pp. 443–450. [Google Scholar] [CrossRef]
  5. Goodfellow, I.J.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial nets. Adv. Neural Inf. Process. Syst. 2014, 27, 2672–2680. [Google Scholar]
  6. Long, M.; Cao, Z.; Wang, J.; Jordan, M.I. Conditional adversarial domain adaptation. Adv. Neural Inf. Process. Syst. 2018, 31, 1–11. [Google Scholar]
  7. Eldele, E.; Ragab, M.; Chen, Z.; Wu, M.; Kwoh, C.K.; Li, X.; Guan, C. Self-Supervised Contrastive Representation Learning for Semi-Supervised Time-Series Classification. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 15604–15618. [Google Scholar] [CrossRef] [PubMed]
  8. Darban, Z.Z.; Yang, Y.; Webb, G.I.; Aggarwal, C.C.; Wen, Q.; Pan, S.; Salehi, M. DACAD: Domain Adaptation Contrastive Learning for Anomaly Detection in Multivariate Time Series. IEEE Trans. Knowl. Data Eng. 2025, 37, 4485–4496. [Google Scholar] [CrossRef]
  9. Chen, C.; Fu, Z.; Chen, Z.; Jin, S.; Cheng, Z.; Jin, X.; Hua, X.S. Homm: Higher-order moment matching for unsupervised domain adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; pp. 3422–3429. [Google Scholar] [CrossRef]
  10. Zhu, Y.; Zhuang, F.; Wang, J.; Ke, G.; Chen, J.; Bian, J.; Xiong, H.; He, Q. Deep Subdomain Adaptation Network for Image Classification. IEEE Trans. Neural Netw. Learn. Syst. 2021, 32, 1713–1722. [Google Scholar] [CrossRef] [PubMed]
  11. Ganin, Y.; Ustinova, E.; Ajakan, H.; Germain, P.; Larochelle, H.; Laviolette, F.; March, M.; Lempitsky, V. Domain-adversarial training of neural networks. J. Mach. Learn. Res. 2016, 17, 1–35. [Google Scholar]
  12. Shu, R.; Bui, H.H.; Narui, H.; Ermon, S. A DIRT-T Approach to Unsupervised Domain Adaptation. arXiv 2018, arXiv:1802.08735. [Google Scholar] [CrossRef]
  13. Glorot, X.; Bordes, A.; Bengio, Y. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th International Conference on Machine Learning, Bellevue, WA, USA, 28 June–2 July 2011; pp. 513–520. [Google Scholar]
  14. Liu, Q.; Xue, H. Adversarial Spectral Kernel Matching for Unsupervised Time Series Domain Adaptation. In Proceedings of the 30th International Joint Conference on Artificial Intelligence, Virtual, 19–26 August 2021; pp. 2744–2750. [Google Scholar] [CrossRef]
  15. Wilson, G.; Doppa, J.R.; Cook, D.J. Multi-Source Deep Domain Adaptation with Weak Supervision for Time-Series Sensor Data. In Proceedings of the 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual, 6–10 July 2020; pp. 1–10. [Google Scholar] [CrossRef]
  16. Eldele, E.; Ragab, M.; Chen, Z.; Wu, M.; Kwoh, C.-K.; Li, X. Contrastive Domain Adaptation for Time-Series Via Temporal Mixup. IEEE Trans. Artif. Intell. 2024, 5, 1185–1194. [Google Scholar] [CrossRef]
  17. Ben-David, S.; Blitzer, J.; Crammer, K.; Kulesza, A.; Pereira, F.; Vaughan, J.W. A theory of learning from different domains. Mach. Learn. 2010, 79, 151–175. [Google Scholar] [CrossRef]
  18. Zhang, W.; Yang, L.; Geng, S.; Hong, S. Self-Supervised Time Series Representation Learning via Cross Reconstruction Transformer. IEEE Trans. Neural Netw. Learn. Syst. 2024, 35, 16129–16138. [Google Scholar] [CrossRef] [PubMed]
  19. Cooley, J.W.; Lewis, P.A.W.; Welch, P.D. The Fast Fourier Transform and Its Applications. IEEE Trans. Educ. 1969, 12, 27–34. [Google Scholar] [CrossRef]
  20. Darban, Z.Z.; Webb, G.I.; Pan, S.; Aggarwal, C.C.; Salehi, M. CARLA: Self-Supervised Contrastive Representation Learning for Time Series Anomaly Detection. Pattern Recognit. 2025, 157, 110874. [Google Scholar] [CrossRef]
  21. Chavarriaga, R.; Sagha, H.; Calatroni, A.; Digumarti, S.T.; Tröster, G.; Millán, J.d.R.; Roggen, D. The Opportunity challenge: A benchmark database for on-body sensor-based activity recognition. Pattern Recognit. Lett. 2013, 34, 2033–2042. [Google Scholar] [CrossRef]
  22. Wang, Y.; Xu, Y.; Yang, J.; Wu, M.; Li, X.; Xie, L.; Chen, Z. Graph-aware contrasting for multivariate time-series classification. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; pp. 1–10. [Google Scholar] [CrossRef]
  23. Ragab, M.; Eldele, E.; Tan, W.L.; Foo, C.S.; Chen, Z.; Wu, M.; Kwoh, C.K.; Li, X. ADATIME: A Benchmarking Suite for Domain Adaptation on Time Series Data. ACM Trans. Knowl. Discov. Data 2023, 17, 106. [Google Scholar] [CrossRef]
  24. Stisen, A.; Blunck, H.; Bhattacharya, S.; Prentow, T.S.; Kjærgaard, M.B.; Dey, A.; Sonne, T.; Jensen, M.M. Smart Devices are Different: Assessing and MitigatingMobile Sensing Heterogeneities for Activity Recognition. In Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems (SenSys ’15), Seoul, Republic of Korea, 1–4 November 2015; pp. 127–140. [Google Scholar] [CrossRef]
  25. Cai, R.; Chen, J.; Li, Z.; Chen, W.; Zhang, K.; Ye, J.; Li, Z.; Yang, X.; Zhang, Z. Time series domain adaptation via sparse associative structure alignment. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual, 2–9 February 2021; pp. 6859–6867. [Google Scholar] [CrossRef]
Figure 1. Illustration of the proposed method. (a) Without domain adaptation, target-domain features exhibit unclear decision boundaries and significant distribution mismatch. (b) With alignment, cross-domain distributions become closer, yet partial class-level misalignment remains. (c) The proposed method produces compact intra-class clusters and clearer separation in the target domain.
Figure 1. Illustration of the proposed method. (a) Without domain adaptation, target-domain features exhibit unclear decision boundaries and significant distribution mismatch. (b) With alignment, cross-domain distributions become closer, yet partial class-level misalignment remains. (c) The proposed method produces compact intra-class clusters and clearer separation in the target domain.
Electronics 15 01171 g001
Figure 2. Illustration of the proposed framework. In the source domain, class-consistent samples are augmented to form positive pairs, while samples from different classes are perturbed to serve as negatives. In the target domain, positives are generated via anchor augmentation, and negatives are constructed from randomly selected disturbed samples. The resulting sample groups are processed by a shared feature extractor, followed by classification, adversarial alignment, and contrastive optimization in the latent space.
Figure 2. Illustration of the proposed framework. In the source domain, class-consistent samples are augmented to form positive pairs, while samples from different classes are perturbed to serve as negatives. In the target domain, positives are generated via anchor augmentation, and negatives are constructed from randomly selected disturbed samples. The resulting sample groups are processed by a shared feature extractor, followed by classification, adversarial alignment, and contrastive optimization in the latent space.
Electronics 15 01171 g002
Figure 3. Visualization of augmented sample groups. Negative sequences differ substantially from the original sample, whereas positive sequences preserve semantic similarity. Only the first three channels are shown for clarity. (a) Negative sequence of Channel 0; (b) Original sequence of Channel 0; (c) Positive sequence of Channel 0; (d) Negative sequence of Channel 1; (e) Original sequence of Channel 1; (f) Positive sequence of Channel 1; (g) Negative sequence of Channel 2; (h) Original sequence of Channel 2; (i) Positive sequence of Channel 2.
Figure 3. Visualization of augmented sample groups. Negative sequences differ substantially from the original sample, whereas positive sequences preserve semantic similarity. Only the first three channels are shown for clarity. (a) Negative sequence of Channel 0; (b) Original sequence of Channel 0; (c) Positive sequence of Channel 0; (d) Negative sequence of Channel 1; (e) Original sequence of Channel 1; (f) Positive sequence of Channel 1; (g) Negative sequence of Channel 2; (h) Original sequence of Channel 2; (i) Positive sequence of Channel 2.
Electronics 15 01171 g003
Figure 4. Overview of body-worn sensors used in the Opportunity [21] dataset. A2 represents the localization system; B1 is a wireless microphone; B2 are Bluetooth-based acceleration sensors; B3 is a custom motion jacket; B4 is a custom magnetic relative positioning sensor; B5 is an inertial sensor system; and B6 are acceleration sensors.
Figure 4. Overview of body-worn sensors used in the Opportunity [21] dataset. A2 represents the localization system; B1 is a wireless microphone; B2 are Bluetooth-based acceleration sensors; B3 is a custom motion jacket; B4 is a custom magnetic relative positioning sensor; B5 is an inertial sensor system; and B6 are acceleration sensors.
Electronics 15 01171 g004
Figure 5. Confusion matrix of baseline methods in domain adaptation from scenario 3 to scenario 1.
Figure 5. Confusion matrix of baseline methods in domain adaptation from scenario 3 to scenario 1.
Electronics 15 01171 g005
Figure 6. Sensitivity analysis of the proposed method with respect to three key hyperparameters: (a) separation margin m; (b) Fourier-transform-based augmentation ratio η ; (c) disturbance-affected area L.
Figure 6. Sensitivity analysis of the proposed method with respect to three key hyperparameters: (a) separation margin m; (b) Fourier-transform-based augmentation ratio η ; (c) disturbance-affected area L.
Electronics 15 01171 g006
Table 4. Comparison of baseline methods on the Opportunity [21] dataset with a TCN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
Table 4. Comparison of baseline methods on the Opportunity [21] dataset with a TCN-based feature extractor. The highest values in each column are shown in bold, and the second-highest values are underlined. Statistical significance is indicated by † (p < 0.05) and ‡ (p < 0.01).
TCNCDAN [6]CoTMix [16]DeepCORAL [4]DSAN [10]SASA [25]Ours
AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)AccuracyMacro-F1 (MF1)
2 → 380.05% ± 4.24%64.47% ± 8.33%66.35% ± 5.94% ‡60.24% ± 10.31% ‡78.95% ± 1.42%60.50% ± 2.85% ‡70.55% ± 2.18% ‡53.53% ± 1.65% ‡73.60% ± 2.63% ‡57.34% ± 4.02% ‡80.90% ± 4.45%74.19% ± 7.11%
3 → 490.90% ± 3.63%88.64% ± 10.11%82.05% ± 3.71% ‡80.87% ± 5.18% ‡90.30% ± 1.34% †89.57% ± 2.58% †75.80% ± 4.74% ‡67.35% ± 10.36% ‡92.45% ± 1.21%92.66% ± 1.16%92.00% ± 1.53%91.98% ± 1.56%
4 → 185.40% ± 3.75%86.79% ± 2.84%66.55% ± 2.89% ‡63.03% ± 2.81% ‡87.80% ± 2.10%89.12% ± 1.94%79.05% ± 3.79% ‡79.82% ± 6.33% ‡90.30% ± 2.70%91.38% ± 2.47%86.60% ± 2.44%88.10% ± 2.20%
1 → 387.15% ± 4.49%78.01% ± 14.26%69.00% ± 7.77% ‡64.54% ± 12.60% ‡82.35% ± 2.42% ‡61.83% ± 2.06% ‡71.35% ± 1.11% ‡53.70% ± 0.73% ‡81.70% ± 3.01% ‡62.27% ± 4.61% ‡90.25% ± 4.20%87.76% ± 9.88%
2 → 491.50% ± 3.26%89.84% ± 9.58%77.00% ± 7.04% ‡75.24% ± 7.92% ‡90.15% ± 1.62%87.09% ± 3.91%79.15% ± 2.93% ‡77.94% ± 10.62% ‡87.25% ± 2.72% ‡87.23% ± 2.55% †90.20% ± 1.16%89.79% ± 1.81%
Overall87.00% ± 5.62%81.55% ± 13.39%72.19% ± 8.42% ‡68.78% ± 11.41% ‡85.91% ± 4.89% †77.62% ± 13.86% ‡75.18% ± 4.81% ‡66.47% ± 13.39% ‡85.06% ± 7.26% †78.18% ± 15.64% ‡87.99% ± 4.96%86.36% ± 8.32%
Table 5. Ablation results evaluating the contributions of each loss components. The highest values in each row are shown in bold.
Table 5. Ablation results evaluating the contributions of each loss components. The highest values in each row are shown in bold.
Loss Component3 → 14 → 2
L cont s L cont t L d AccuracyMacro-F1AccuracyMacro-F1
/80.00%75.90%82.05%81.74%
/80.60%73.92%83.10%82.80%
/82.10%61.64%83.45%79.37%
//79.10%74.57%83.10%82.78%
82.65% 78.59%83.75%83.29%
“/” denotes absence of the component, while “•” denotes inclusion.
Table 6. Ablation study results evaluating the efficiency of augmentation and perturbation strategies. The highest values in each row are shown in bold.
Table 6. Ablation study results evaluating the efficiency of augmentation and perturbation strategies. The highest values in each row are shown in bold.
Augment Sample3 → 12 → 42 → 3
PostiveNegativeAccuracyMF1AccuracyMF1AccuracyMF1
//78.35%74.30%91.35%91.16%78.15%72.35%
F F 81.50%81.20%91.15%91.35%78.10%70.51%
F Ours82.65%78.59%91.50%91.49%80.90%73.72%
Table 7. Comparison of computational cost with baseline methods in terms of parameter count, training time, FLOPs, and inference latency for practical deployment.
Table 7. Comparison of computational cost with baseline methods in terms of parameter count, training time, FLOPs, and inference latency for practical deployment.
Parameters (M)Training Time (s/epoch)FLOPs (M)Inference Time (ms)
CDAN [6]1.220.6374.310.4514
CoTMix [16]0.620.831440.4309
DeepCORAL [4]0.620.6782.510.4538
DSAN [10]0.620.6335.950.4348
SASA [6]0.650.6171.880.7472
Ours1.093.172180.4370
Table 8. Comparison with CDAN in terms of FLOPs consumption and parameter counts of each trainable component.
Table 8. Comparison with CDAN in terms of FLOPs consumption and parameter counts of each trainable component.
MethodologyComponentsParameters (M)FLOPs (M)
CDAN [6]Feature Extractor0.61271.882
Discrminator0.5942.376
Classifier0.0090.009
Overall1.21674.314
OursFeature Extractor0.612216
Projector0.3121.869
Discrminator0.1520.303
Classifier0.0090.009
Overall1.085218
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Tan, Y.; Lian, S. Domain Adaptation with Contrastive Group Construction for Human Activity Recognition in Multi-Sensor. Electronics 2026, 15, 1171. https://doi.org/10.3390/electronics15061171

AMA Style

Tan Y, Lian S. Domain Adaptation with Contrastive Group Construction for Human Activity Recognition in Multi-Sensor. Electronics. 2026; 15(6):1171. https://doi.org/10.3390/electronics15061171

Chicago/Turabian Style

Tan, Yongtu, and Shikang Lian. 2026. "Domain Adaptation with Contrastive Group Construction for Human Activity Recognition in Multi-Sensor" Electronics 15, no. 6: 1171. https://doi.org/10.3390/electronics15061171

APA Style

Tan, Y., & Lian, S. (2026). Domain Adaptation with Contrastive Group Construction for Human Activity Recognition in Multi-Sensor. Electronics, 15(6), 1171. https://doi.org/10.3390/electronics15061171

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop