Auto-Augmentation Contrastive Learning for Wearable-based Human Activity Recognition


Abstract

For low-semantic sensor signals from human activity recognition (HAR), contrastive learning (CL) is essential to implement novel applications or generic models without manual annotation, which is a high-performance self-supervised learning (SSL) method. However, CL relies heavily on data augmentation for pairwise comparisons. Especially for low semantic data in the HAR area, conducting good performance augmentation strategies in pretext tasks still rely on manual attempts lacking generalizability and flexibility. To reduce the augmentation burden, we propose an end-to-end auto-augmentation contrastive learning (AutoCL) method for wearable-based HAR. AutoCL is based on a Siamese network architecture that shares the parameters of the backbone and with a generator embedded to learn auto-augmentation. AutoCL trains the generator based on the representation in the latent space to overcome the disturbances caused by noise and redundant information in raw sensor data. The architecture empirical study indicates the effectiveness of this design. Furthermore, we propose a stop-gradient design and correlation reduction strategy in AutoCL to enhance encoder representation learning. Extensive experiments based on four wide-used HAR datasets demonstrate that the proposed AutoCL method significantly improves recognition accuracy compared with other SOTA methods.

Self-Supervised Learning, Contrastive Learning, Human Activity Recognition

1 Introduction↩︎

With the development of mobile and wearable computing, human activity recognition (HAR) using the inertial measurement unit (IMU) on wearable devices is researched in diverse areas. And the applications and services of wearable-based HAR are becoming ubiquitous, such as assisting life, context-aware, anomaly detection, human-computer interaction, etc. These researches use sensors placed at different body locations to perform data mining and inference, which is critical to human-centered care and enables ubiquitous intelligence. Wearable-based HAR has traditionally been explored through sensor-based methods leveraging signal processing algorithms or conventional machine learning, lacking robustness, especially for complex activities. The landscape of HAR research has been significantly reshaped in recent years by introducing deep learning models such as convolutional neural networks, recurrent neural networks, attention-based networks, etc., effectively elevating precision and robustness. These methods are mostly based on supervised learning, which requires recollecting data and retraining across different tasks because the activities, sensor types, sensor positions, etc., are varied, which means a heavy manual annotation burden.

Figure 1: (a) The contrastive learning framework relies on data augmentation strategies to construct different views of each sample to maximize pairwise agreement [1], [2]. (b) The illustration of AutoCL’s exploring of data-driven augmentation contrastive learning method.

Therefore, self-supervised learning (SSL) without manual annotation, especially contrastive learning (CL) becomes essential, which is a high-performance SSL method. It constructs pairwise samples of the original sample in the pretext task and learns the latent space by decreasing the positive sample distance and increasing the negative sample distance through CL loss functions. At the early stage of CL development, the need to construct and accumulate negative samples to enlarge the receptive field of the model led to approaches with the memory bank design [3], momentum encoder design [4], etc., which caused much extra computational and storage overhead. Starting with SimCLR’s demonstration of the option to directly use samples in the mini-batch as negative samples while training and conducting excellent performance as well [1], the construction of negative pairs was gradually simplified.

However, the construction of positive samples still requires. Current mainstream contrastive learning approaches, as in Figure 1 (a), require manual selection and implementation of different augmentation strategies to construct positive augmented views for maximizing pairwise agreement. Especially in wearable HAR, data augmentation strategies are not as intuitive as they are for highly semantic data such as images, so it is challenging to intuitively select or construct efficient data augmentation approaches for specific HAR tasks. Previous studies have shown that the optimal augmentation strategy is inconsistent across different tasks due to the varying number of sensors, sampling rate, modality, etc. [5]. This makes CL in wearable HAR for data augmentation of low semantic data from sensors still manually dependent and lacks flexibility and generalizability.

In this paper, we explore an auto-augmentation contrastive learning method in HAR, which achieves end-to-end self-supervised contrastive learning of HAR sensor signals without additional manual construction of augmentation strategies by the idea of generating augmented samples through the knowledge of the original sample itself, as illustrated in Figure 1 (b). Auto-augmentation is performed directly during the model training process while achieving CL. Specifically, AutoCL employs a Siamese network architecture that shares the parameters of the backbone as [1], [6], [7]. A generator is embedded in the architecture to learn auto-augmentation from the feature embedding of the backbone instead of the original data to reduce the effect of noise and redundant information in raw sensor data. Finally, the model implements contrastive learning based on the original and auto-augmented samples by maximizing pairwise agreement. And we propose stop-gradient and correlation reduction strategies in AutoCL to learn a better latent space representation. The contributions of our paper are summarized as follows:

  • We explore an auto-augmentation contrastive learning method to eliminate the data augmentation burden of low semantic sensor signals in HAR. To the best of our knowledge, this is the first study that conducts end-to-end auto-augmentation CL for wearable HAR.

  • An AutoCL framework with a generator embedded is designed and uses the stop-gradient design and correlation reduction strategy to enhance encoder representation learning. It achieves state-of-the-art performance compared to the baselines with current HAR data augmentation strategies. The evaluation results further demonstrate the prospects of the data-driven AutoCL framework.

  • Our insightful discussion provides additional analyses of the effectiveness of our approach by architecture empirical study. Additionally, we visualize the auto-augmented samples, which shows the space of auto-augmentation operations is far more than the human-specified strategy, with the capability for better performance.

2 Related Work↩︎

This section presents an overview of the existing literature on human activity recognition and contrastive learning techniques, encapsulating prior efforts in these areas.

2.1 Human Activity Recognition↩︎

Considerable research in recent years has targeted wearable human activity recognition, with a primary focus on extracting features through deep neural networks, such as convolutional networks, residual networks, attention-based networks, etc. [8][10]. These models show commendable accuracy provided that many training samples are available. However, their performance drops in scenarios where labels are scarce. This problem has been approached through semi-supervised learning techniques, which employ unlabeled training samples that are more readily accessible [11], [12]. Furthermore, weakly-supervised learning strategies employ minimal inaccurate or coarse labels to alleviate this issue [13], [14]. Transfer learning methods have also been proposed to relay helpful information from label-abundant source domains to label-sparse target domains [15].

Recently, self-supervised learning, particularly contrastive learning, has shown exemplary capabilities in feature learning without supervision [16], [17]. Many recent investigations have been into various forms of data transformation in contrastive learning. [18] examined several data augmentation techniques designed for wearable sensors, replacing image augmentation operators in the SimCLR model. [19] implemented both time-domain and frequency-domain augmentation techniques in SimCLR, adapting the encoder from [20] to accommodate features in time and frequency domains. The temporal and contextual contrasting method with jittering and permutation augmentation is proposed to incorporate the temporal characteristics of time series into contrastive learning [21].

2.2 Contrastive Learning↩︎

Driven by the constraints of manual annotation, contrastive learning generates alternate views of the same sample to form positive pairs in a label-free environment. Methods like SimCLR derive two batches of positive samples from the original samples and compare them against a pool of other samples [1]. This strategy is rooted in the principle of sample discrimination, where each sample is considered a unique category. Besides generating positive samples from a single sample, some methods assign samples from the same cluster or nearest neighbors as positives [22]. Techniques such as BYOL [23] and SimSiam [7] based on the dual-stream architecture have demonstrated competitive performance without requiring negative samples, thereby circumventing the necessity for large numbers of such samples. Recent works have provided a review of existing approaches [2].

Even with the considerable enhancements brought about by contrastive models, understanding the underlying factors, especially pairwise augmentation, is a nascent research area. This has instigated studies exploring the mechanisms that drive the success of contrastive learning [24][26]. Existing reliance on contrast learning for pair construction introduces an additional task of non-intelligent, artificial sample augmentation in the pretext task, which needs more flexibility and generalizability. This issue is especially evident for low-semantic sensor signals, where creating semantically consistent sample pairs is a significant challenge [27]. In wearable HAR, some studies have adopted a multimodal approach to enable cross-channel sensor signals comparison without additional augmentation [17]. However, it is constrained by the limited number of sensors available in practical applications. To overcome the limitations of data augmentation in existing contrastive learning methods, our work aims to conduct an end-to-end contrastive learning study from an auto-augmentation standpoint for wearable HAR.

Figure 2: Overall of AutoCL Methodology. (a) AutoCL architecture. (b) Implementation of the generator.

3 Methodology↩︎

In this section, we propose an Auto-Augmentation Contrastive Learning method for HAR, namely AutoCL. We are given the pretraining dataset \(\mathcal{D}_{pret} = \{x_{i}^{pret} | i = 1, . . . , N \}\) of unlabeled human activity time series samples. Let \(\mathcal{D}_{tune} = \{x_{i}^{tune} | i = 1, . . . , M \}\) be a fine-tuning dataset of labeled human activity time series samples. The goal is to use \(\mathcal{D}_{pret}\) to pre-train an encoder \(f\) so that by fine-tuning model parameters on \(\mathcal{D}_{tune}\), the fine-tuned model produces good representations \(f(x_i^{tune})\) for every \(x_i^{tune}\).

3.1 Motivation↩︎

Many successful contrastive learning approaches based on Siamese network architecture rely on selecting suitable augmentation strategies to generate augmented samples for comparison, aiming to maximize pairwise agreement. The AutoCL method, in its pursuit of data-driven automatic augmentation, is inspired by the Squeeze-and-Excitation (SE) attention mechanism [28] (self-guiding its own attention weighting). Intuitively, AutoCL aspires to leverage the knowledge from the original samples to drive a generator for producing augmented samples (self-guiding its own augmentation strategy) and maximize the pairwise agreement via the contrastive learning loss.

The most crucial consideration in this process is whether to use the original samples directly as the generator input or use the feature embeddings from the backbone network as the generator’s input for auto-augmentation. Due to the low semantic information and susceptibility to noise interference inherent in sensor signals, extracting valuable features and generating augmented data is challenging. This problem is indicated in the HAR sensor signals generation study by Wang et al. [29], [30], who suggested that better performance can be achieved by generating HAR sensor signals based on the feature embeddings.

Therefore, we explore the architecture design of AutoCL: using the feature embeddings from the backbone network to guide the generator for auto-augmentation in self-supervised contrastive learning. Subsequently, original samples and auto-augmented samples constitute sample pairs to guide the backbone network for more effective contrastive learning. The details of AutoCL architecture are as follows. We further provide the empirical study in Section 5.1, which attests to the rationality and advancement of the AutoCL architecture.

3.2 Description of AutoCL↩︎

AutoCL’s goal is to learn a representation \(z_{\theta}\), which can then be used for downstream tasks. As described previously, AutoCL uses a Siamese network and a generator network to learn, as shown in Figure 2. The Siamese network is defined by a set of weights \(\theta\) and is comprised of two stages: an encoder \(f_{\theta}\), a projector \(p_{\theta}\). The generator \(g_{\xi}\) uses a set of weights \(\xi\) and is obtained by training together with the Siamese network’s weights \(\theta\).

Given a set of unlabeled time series samples \(\mathcal{D}_{pret}\), a sample \(x \sim \mathcal{D}_{pret}\) sampled uniformly from \(\mathcal{D}_{pret}\). AutoCL produces augmented sample \(x'_{\theta, \xi} \triangleq g_{\xi}(y_{\theta})\), where \(y_{\theta}\) is from \(x\) embedded by \(f_{\theta}\) and \(p_{\theta}\). For the first input of the Siamese network, the network outputs a representation \(z_{\theta} \triangleq f_{\theta}(x)\) and a projection \(y_{\theta} \triangleq p_{\theta}(z_{\theta})\). The other stream of the Siamese network outputs \(z'_{\theta, \xi} \triangleq f_{\theta}(x'_{\theta, \xi})\) and the projection \(y'_{\theta, \xi} \triangleq p_{\theta}(z'_{\theta, \xi})\) from the second input \(x'_{\theta, \xi}\). Finally, we define the normalized temperature-scaled cross-entropy (NT-Xent) loss function between the projections \(y_{\theta}\) and \(y'_{\theta, \xi}\) [1]:

\[\mathcal{L}_{\theta, \xi}=-\log{\frac{\exp(\text{sim}(y_{\theta, i},y'_{\theta, \xi, i})/\tau)}{\sum_{k=1}^{2N}{\mathbb{1}}_{[k\neq i]}\exp(\text{sim}(y_{\theta, i},y_{\theta, k})/\tau)}}\]

where \(N\) is the batch size, \(\tau\) is a temperature hyper-parameter that controls the smoothness of the distribution, \(\text{sim}(y_{\theta, i}, y'_{\theta, \xi, i})\) is the cosine similarity between the embeddings of the original and augmentation projection, and \(\mathbb{1}\) is the indicator function that equals \(1\) if \(k \not= i\) and \(0\) otherwise. In our work, \(\tau\) is \(0.1\).

3.3 Correlation Reduction↩︎

During the training process of AutoCL, we believe that relying solely on generated samples for training \(g_{\xi}\) towards the CL loss function may lead to overfitting and loss of the capacity to learn semantics from sensor signals better. If the results lead to \(x'{\theta, \xi} \rightarrow x{\theta}\), it reduces the comparative difficulty for contrastive learning, approximating the training process of an auto-encoder, which has been shown to perform far less effectively than contrastive learning [31]. It is indicated that the smaller the correlation between positive samples, the better the performance of contrastive learning [5]. We added a term to the loss function, \({\frac{\sum_{i=1}^{N}(x_{i}-{\overline{{x}}})(x'_{\theta, \xi, i}-{\overline{{x'_{\theta, \xi}}}})}{{\sqrt{\sum_{i=1}^{N}(x_{i}-{\overline{{x}}})^{2}}}{{\sqrt{\sum_{i=1}^{N}(x'_{\theta, \xi, i}-{\overline{{x'_{\theta, \xi}}}})^{2}}}}}}\), attempting to maximize the diversity between pairs of positive samples during contrastive learning, thus enhancing the performance of contrastive learning. The final loss function of AutoCL \(\mathcal{L}_{\theta, \xi}^{AutoCL}\) is as follows:

\[\begin{align} \mathcal{L}_{\theta, \xi}^{AutoCL}=-\log{\frac{\exp(\text{sim}(y_{\theta, i},y'_{\theta, \xi, i})/\tau)}{\sum_{k=1}^{2N}{\mathbb{1}}_{[k\neq i]}\exp(\text{sim}(y_{\theta, i},y_{\theta, k})/\tau)}} \\+ {\frac{\sum_{i=1}^{N}(x_{i}-{\overline{{x}}})(x'_{\theta, \xi, i}-{\overline{{x'_{\theta, \xi}}}})}{{\sqrt{\sum_{i=1}^{N}(x_{i}-{\overline{{x}}})^{2}}}{{\sqrt{\sum_{i=1}^{N}(x'_{\theta, \xi, i}-{\overline{{x'_{\theta, \xi}}}})^{2}}}}}} \end{align}\]

3.4 Stop-Gradient↩︎

During the training process, in order to make the generation process of the generator \(g_{\xi}\) depend on the feature embedding of \(f_{\theta}\) and \(p_{\theta}\), and let the generated sample \(x'_{\theta, \xi}\) through \(f_{\theta}\) and \(p_{\theta}\) for CL to conduct recurrent training of \(f_{\theta}\), we stop the gradient in \(y_{\theta}\) as in Figure 2 (a), resulting in the final gradient calculation as follows:

\[\nabla \mathcal{L}_{\theta, \xi}^{A u t o C L}=\frac{\partial \mathcal{L}_{\theta, \xi}}{\partial p_\theta} \frac{\partial p_\theta}{\partial f_\theta} \frac{\partial f_\theta}{\partial g_{\xi}} \frac{\partial g_{\xi}}{\partial p_\theta} \frac{\partial p_\theta}{\partial f_\theta} \frac{\partial f_\theta}{\partial \theta, \xi}\]

Finally, We perform a stochastic optimization step to minimize \(\mathcal{L}_{\theta, \xi}^{AutoCL}\) with respect to \(\theta\) and \(\xi\). AutoCL’s dynamics are summarized as follows:

\[{\theta, \xi} \leftarrow\mathrm{optimizer}\bigl(\theta, \xi, \nabla{\mathcal{L}}_{\theta,\xi}^{\mathrm{AutoCL}}, lr)\] where \(\mathrm{optimizer}\) is an optimizer and \(lr\) is a learning rate.

3.5 Implementation Details↩︎

The encoder, projector, generator, and optimization implementation details are introduced in this section. Specifically, the inputs \(x, x'_{\theta, \xi} \in \mathbb{R}^{N \times W \times C}\), which are sensor signals in HAR. \(N\) represents the batch size. \(W\) represents the time window. \(C\) represents the number of signal channels.

3.5.1 Encoder↩︎

For the realization of the encoder \(f_{\theta}\), we opt for a 3-layer fully convolutional network (FCN) [32]. Each layer of the FCN consists of a 1-dimensional (1-D) convolutional layer, accompanied by batch normalization, ReLU activation, max pooling, and a 10% dropout operation. Every layer utilizes a convolutional kernel of size 8 with 1 stride and a pooling kernel of size and stride both of 2.

3.5.2 Projector↩︎

The projector \(p_{\theta}\), an essential structure after the encoder in contrastive learning, assists in the training of the encoder throughout the self-supervised process, amplifying the robustness of the encoder [1]. In our research, \(p_{\theta}\) adopts a Multi-Layer Perceptron (MLP) design, including a fully connected layer incorporating 256 neurons, batch normalization, and ReLU activation function, and concluding with another fully connected layer hosting 128 neurons with a softmax activation function.

3.5.3 Generator↩︎

The generator \(g_{\xi}\), as depicted in Figure 2 (b), duplicates the feature embedding \(y_{\theta}\) over time and introduces it into a 3-layer bidirectional gate recurrent unit (BiGRU). The hidden layer’s size within this network amounts to \(4 \times C\). A final global linear transformation is executed via a 1-D group convolutional layer with kernel size and stride of 1, mapping the \(4 \times C\) channels to \(C\) by \(C\) group, thereby producing \(y'_{\theta, \xi}\). Notably, batch normalization and ReLU activation are performed before feature input the generator and are used to avoid overfitting after the MLP projection module.

3.5.4 Optimization↩︎

The optimization process is carried out employing the Adam optimizer with a learning rate and weight decay both set at \(\num{1e-3}\).

4 Experiments↩︎

In this section, we evaluate the performance of AutoCL on HAR datasets. To evaluate the performance of AutoCL for automatic augmentation through end-to-end self-supervised learning, we adopt widely adopted advanced data augmentation methods in HAR: scale, permutation, noise, and their combination using on state-of-the-art CL methods[1], [6], [7], [21], [23]. Moreover, we evaluate the reduced correlation strategy and the stop-gradient design for ablation experiments to assess its effectiveness.

Table 1: Briefly description of experimental HAR datasets
Description PAMAP2 UCIHAR UTD-MHAD DSADS
1-5 Number of Subjects \(9\) \(30\) \(8\) \(8\)
Number of Activities \(12\) \(6\) \(27\) \(19\)
Number of Channels \(36\) \(9\) \(6\) \(45\)
Sample Rate \(100\)Hz \(50\)Hz \(50\)Hz \(25\)Hz
1-5 Window Size \(128\) \(128\) \(128\) \(128\)
Overlap \(50\%\) \(50\%\) \(50\%\) \(50\%\)

3pt

4.1 Dataset Description↩︎

We evaluate the effectiveness of our approach on four widely-used public datasets, summarised in Table 1. The PAMAP2 Dataset [33] is collected from 9 participants who wore numerous sensors, including chest, wrist, and ankle sensors, to collect data. The UCIHAR Dataset [34] comprises data from 30 participants who performed 6 activities while donning a smartphone on their midsection. The UTD-MHAD Dataset [35] is a high-quality action dataset gathered using a Microsoft Kinect camera and a wearable IMU sensor. It includes 27 actions, and each is performed four times by 8 individuals. Finally, the DSADS Dataset [36] consists of data collected on 19 activities performed for 5 minutes by eight participants, 9 of which were utilized in our evaluation.

4.2 Experimental Setup↩︎

In our experiment, we employ contrastive learning methods for pre-training the encoder, followed by the few-shot classification task as a downstream evaluation method, following the evaluation framework in [37]. During the pre-training phase, we implement four state-of-the-art contrastive learning methods as baselines utilizing the same backbone for training without labels. The same batch size, optimizer, and procedure are used to facilitate comparison. In evaluation, we add the MLP prediction module to the pre-trained encoder for datasets’ classification by fixing the pre-trained encoder and fine-tuning the prediction module. During the fine-tuning process, we randomly choose 20% of the labeled data from the dataset for few-shot learning. The remaining 80% of the data is used to evaluate the classification accuracy, thereby further measuring the performance of different baselines. The details of the pre-training and fine-tuning setup are as follows:

4.2.1 Pre-Training↩︎

The pre-training employs the 3-layer FCN as the encoder backbone network (Section 3.5.1) and maintains an identical projection module (Section 3.5.2). The batch size is set at 256 (Section 3.5.4). To ensure a consistent model selection strategy, early stopping is adopted; pre-training is halted after five epochs without loss decrease, with the model corresponding to the smallest loss selected for subsequent evaluation.

4.2.2 Fine-Tuning↩︎

During fine-tuning, the prediction module comprises two fully-connected layers, with batch normalization and ReLU activation in the first, and softmax activation in the second for classification. The number of neurons in these layers is 128 and the number of classes, respectively. A batch size of 128 is adopted, with the Adam optimizer set at a learning rate of \(\num{1e-3}\) and weight decay of \(\num{1e-4}\). To normalize fine-tuning evaluation, each method is fine-tuned 100 epochs. The final evaluation accuracy is determined by averaging the top ten accuracy results from the test set.

4.3 Comparison with Other Methods↩︎

We aim to compare AutoCL with state-of-the-art contrastive learning baselines such as NNCLR [6], SimCLR [1], SimSiam [7], and BYOL [23]. These contrastive learning methods are all based on a dual-stream network structure, with implementations based on the same backbone (Section 3.5) and hyperparameters being the same. Their inputs depend on the data augmentation strategy. Therefore, we choose to use a combination of time-series data augmentation methods, which are widely acknowledged in the HAR [21] for better evaluation:

  • Jittering (J): Adds random Gaussian noise to signals.

  • Scaling (S): An augmentation that multiplies input signals with values sampled from the normal distribution.

  • Permutation (P): Splits input signals into a certain number of intervals and randomly permutes them.

  • Original Data (O): Original data without data augmentation.

In our evaluation, we compare AutoCL, which does not require data augmentation operations in the pretext task, with state-of-the-art contrastive learning baselines that adopt a combination of the augmentation strategies. The results indicate that the optimal data augmentation method or combination is inconsistent across different datasets from varying scenarios, modalities, and data collection settings. AutoCL not only releases the burden of data augmentation under various applications but also achieves state-of-the-art performance on these HAR datasets, as detailed in Table ¿tbl:tab:exp95pamap95uci?. This suggests that its design approach is effective.

Figure 3: Illustrate confusion matrix: (a) AutoCL. (b) SimCLR.

To further analyze the effectiveness of the AutoCL mechanism, since AutoCL is mainly based on the SimCLR architecture, we use SimCLR as a baseline with the best augmentation strategy in Table ¿tbl:tab:exp95pamap95uci? to show the confusion matrix with AutoCL on DSADS. DSADS has a more significant number of samples, which can indicate the performance between the methods more clearly. As illustrated in Figure 3, AutoCL is better regarding the number of correct categorizations. And in some activities where the difference is not significant such as A10 and A11, A9 and A11, AutoCL shows fewer errors, which implies that AutoCL has an advantage in recognizing fine-grained features in self-supervised contrastive learning due to the design of auto-augmentation.

Figure 4: AutoCL with vs. without Stop-Gradient (SG) and/or Correlation Reduction (CR).

4.4 Ablation Study↩︎

In addition to the overall evaluation of auto-augmentation architecture, we design the ablation experiment to verify the effectiveness of the correlation reduction strategy and the stop-gradient design in AutoCL. As illustrated in Figure 4, we compared the implementation of the AutoCL method with the alternatives that do not employ the correlation reduction (CR) strategy and the stop-gradient (SG) design. Due to the diversity among the datasets, the improvement of these strategies is not equal across datasets, especially on the UTD-MHAD dataset, where the addition of SG and CR makes the AutCL self-supervised encoder performance significantly outperform the supervised one.

Overall AutoCL’s SG and CR strategies show robustness and achieve performance gains on all datasets. The experimental results indicate that the correlation reduction strategy and the stop-gradient design in AutoCL are crucial to the architecture of automatic data augmentation, significantly enhancing the performance of our end-to-end contrastive learning approach.

5 Discussion↩︎

In this section, we discuss the effectiveness of the architecture design of AutoCL by conducting an architecture empirical study. Furthermore, we visually analyze the samples generated by AutoCL’s augmentation to discuss the promise of data-driven data augmentation methods for low-semantic data.

5.1 Architecture Empirical Study↩︎

In this section, we perform a comprehensive empirical study of the AutoCL architecture, focusing specifically on the impact of auto-augmentation derived from feature embeddings on performance enhancement. We established two auto-augmentation models: AutoCL-D, which is constructed directly from the original data (Figure 5 (a)), and AutoCL-E, which is based on feature embedding (Figure 5 (b)). Both models utilize the Siamese network structure and generator backbone as same as AutoCL. Notably, the input data for AutoCL-D undergoes batch normalization, while the input data for AutoCL-E is processed as detailed in Section 3.5.3 due to the heterogeneity of the raw data and feature embedding. Our experimental methodology involves pre-training and few-shot classification assessments on the HAR dataset (refer to Section 4.2).

Figure 5: (a) AutoCL-E architecture, which is based on feature embedding. (b) AutoCL-D architecture, which is based on original data.

The results of these evaluations are presented in Figure 6. AutoCL-E is generally superior to AutoCL-D. The PAMAP2, UCIHAR, and DSADS consist of continuous activities with considerable variations. In contrast, UTD-MHAD, characterized by atomic actions following the same trajectory, exhibits less data noise. As a result, the performance difference between AutoCL-E and AutoCL-D on the UTD-MHAD dataset is the smallest.

Figure 6: Comparison of Auto-E and Auto-D architecture.

Moreover, we display the t-distributed stochastic neighborhood embedding (t-SNE) diagrams of the pre-trained encoders of the two architectures on the UCI dataset in Figure 7. The UCI dataset has minimal categories for easy understanding. These diagrams illustrate that auto-augmentation via feature embeddings enhances the representation capacity of the contrastive learning encoder. For instance, Figure 7 (a) reveals some difficulties in distinguishing features except the yellow class, whereas 7 (b) demonstrates that the features generated by AutoCL-E are more discernible.

Figure 7: The t-SNE diagrams of the pre-trained encoders of AutoCL-D and AutoCL-E.

The architecture empirical study results demonstrate that AutoCL-E’s embedding-feature-based auto-augmentation architecture can significantly improve performance. For HAR sensor data, auto-augmentation based on latent space representation can facilitate the backbone to learn effective representations and avoid sensor noise and redundant information interference. The empirical study validates the rationality and effectiveness of the design motivation for the AutoCL architecture in Section 3.1.

5.2 Auto-Augmentation Visualize↩︎

To delve deeper into the details and principles of the AutoCL design, we have visualized the samples generated by the generator compared to the original samples, as shown in Figure 8. We visualize the original and auto-augmented 6-axis IMU data from UTD-MHAD. It can be seen that AutoCL implements augmentation for the samples, consisting mainly of operations such as scaling, cropping, reversing, etc. This data augmentation is data-driven. The model will implement data-driven augmentation for the raw data, e.g., the first line mainly performs scaling, and the second line mainly performs reversing, but is not limited to this. For low semantic sensor data, the space of data-driven augmentation operations should be far more than the human-specified strategy, with the capability to achieve better performance.

Figure 8: Visualization of original and auto-augmented data using the 6-axis IMU sample from UTD-MHAD dataset.

6 Conclution↩︎

Human activity recognition has become ubiquitous in recent years due to mobile and wearable computing advancements. In the context of prevalent low-semantic sensor signals, pursuing high performance and reduced manual annotation burden has spurred research and development in contrastive learning within this domain. However, data augmentation in the pretext tasks of contrastive learning remains, to some extent, manual and non-data-driven, lacking generalizability and flexibility. Therefore, we propose AutoCL, an end-to-end auto-augmentation contrastive learning method that implements high-performance contrastive learning through auto-augmentation architecture, correlation reduction strategy, and stop-gradient design. Furthermore, for low-semantic data, a data-driven automated augmentation approach holds greater space for data augmentation operations than the human-specified strategy and has more potential to ensure semantic consistency with flexibility between augmented samples than manually implemented.

7 Acknowledgments↩︎

This work is supported by the National Key Research & Development Plan of China No. 2021YFC2501202, National Natural Science Foundation of China (No. 62202455, No. 61972383, No. 62101530), Youth Innovation Promotion Association CAS (No. 2021101), Beijing Municipal Science & Technology Commission (No. Z221100002722009).

References↩︎

[1]
T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in International conference on machine learning, 2020, pp. 1597–1607.
[2]
P. H. Le-Khac, G. Healy, and A. F. Smeaton, “Contrastive representation learning: A framework and review,” Ieee Access, vol. 8, pp. 193907–193934, 2020.
[3]
Z. Wu, Y. Xiong, S. X. Yu, and D. Lin, “Unsupervised feature learning via non-parametric instance discrimination,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 3733–3742.
[4]
K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum contrast for unsupervised visual representation learning,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2020, pp. 9729–9738.
[5]
H. Qian, T. Tian, and C. Miao, “What makes good contrastive learning on small-scale wearable-based tasks?” in Proceedings of the 28th ACM SIGKDD conference on knowledge discovery and data mining, 2022, pp. 3761–3771.
[6]
D. Dwibedi, Y. Aytar, J. Tompson, P. Sermanet, and A. Zisserman, “With a little help from my friends: Nearest-neighbor contrastive learning of visual representations,” in Proceedings of the IEEE/CVF international conference on computer vision, 2021, pp. 9588–9597.
[7]
X. Chen and K. He, “Exploring simple siamese representation learning,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021, pp. 15750–15758.
[8]
J. Wang, Y. Chen, S. Hao, X. Peng, and L. Hu, “Deep learning for sensor-based activity recognition: A survey,” Pattern recognition letters, vol. 119, pp. 3–11, 2019.
[9]
C. Xu, J. Shen, F. Fan, T. Qiu, and Z. Mao, “An enhanced human activity recognition algorithm with positional attention,” in Asian conference on machine learning, 2023, pp. 1181–1196.
[10]
C. Xu, Z. Mao, F. Fan, T. Qiu, J. Shen, and Y. Gu, “A shallow convolution network based contextual attention for human activity recognition,” in International conference on mobile and ubiquitous systems: Computing, networking, and services, 2022, pp. 155–171.
[11]
Y. Ma and H. Ghasemzadeh, “LabelForest: Non-parametric semi-supervised learning for activity recognition,” in Proceedings of the AAAI conference on artificial intelligence, 2019, vol. 33, pp. 4520–4527.
[12]
S. Oh, A. Ashiquzzaman, D. Lee, Y. Kim, and J. Kim, “Study on human activity recognition using semi-supervised active transfer learning,” Sensors, vol. 21, no. 8, p. 2760, 2021.
[13]
H. Qian, S. J. Pan, and C. Miao, “Weakly-supervised sensor-based activity segmentation and recognition via learning from distributions,” Artificial Intelligence, vol. 292, p. 103429, 2021.
[14]
T. Sheng and M. Huber, “Siamese networks for weakly supervised human activity recognition,” in 2019 IEEE international conference on systems, man and cybernetics (SMC), 2019, pp. 4069–4075.
[15]
H. Qian, S. J. Pan, and C. Miao, “Latent independent excitation for generalizable sensor-based cross-person activity recognition,” in Proceedings of the AAAI conference on artificial intelligence, 2021, vol. 35, pp. 11921–11929.
[16]
H. Haresamudram et al., “Masked reconstruction based self-supervision for human activity recognition,” in Proceedings of the 2020 ACM international symposium on wearable computers, 2020, pp. 45–49.
[17]
S. Deldari, H. Xue, A. Saeed, D. V. Smith, and F. D. Salim, “Cocoa: Cross modality contrastive learning for sensor data,” Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 6, no. 3, pp. 1–28, 2022.
[18]
C. I. Tang, I. Perez-Pozuelo, D. Spathis, and C. Mascolo, “Exploring contrastive learning in human activity recognition for healthcare,” arXiv preprint arXiv:2011.11542, 2020.
[19]
D. Liu, T. Wang, S. Liu, R. Wang, S. Yao, and T. Abdelzaher, “Contrastive self-supervised representation learning for sensing signals from the time-frequency perspective,” in 2021 international conference on computer communications and networks (ICCCN), 2021, pp. 1–10.
[20]
S. Yao et al., “Stfnets: Learning sensing signals from the time-frequency perspective with short-time fourier neural networks,” in The world wide web conference, 2019, pp. 2192–2202.
[21]
E. Eldele et al., “Time-series representation learning via temporal and contextual contrasting,” arXiv preprint arXiv:2106.14112, 2021.
[22]
D. Dwibedi, Y. Aytar, J. Tompson, P. Sermanet, and A. Zisserman, “With a little help from my friends: Nearest-neighbor contrastive learning of visual representations,” in Proceedings of the IEEE/CVF international conference on computer vision, 2021, pp. 9588–9597.
[23]
J.-B. Grill et al., “Bootstrap your own latent-a new approach to self-supervised learning,” Advances in neural information processing systems, vol. 33, pp. 21271–21284, 2020.
[24]
Y. Tian, C. Sun, B. Poole, D. Krishnan, C. Schmid, and P. Isola, “What makes for good views for contrastive learning?” Advances in neural information processing systems, vol. 33, pp. 6827–6839, 2020.
[25]
S. Purushwalkam and A. Gupta, “Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases,” Advances in Neural Information Processing Systems, vol. 33, pp. 3407–3418, 2020.
[26]
L. Fan, S. Liu, P.-Y. Chen, G. Zhang, and C. Gan, “When does contrastive learning preserve adversarial robustness from pretraining to finetuning?” Advances in neural information processing systems, vol. 34, pp. 21480–21492, 2021.
[27]
H. Li, J. Cao, J. Zhu, Q. Luo, S. He, and X. Wang, “Augmentation-free graph contrastive learning of invariant-discriminative representations,” IEEE Transactions on Neural Networks and Learning Systems, 2023.
[28]
J. Hu, L. Shen, and G. Sun, “Squeeze-and-excitation networks,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 7132–7141.
[29]
J. Wang, Y. Chen, and Y. Gu, “A wearable-HAR oriented sensory data generation method based on spatio-temporal reinforced conditional GANs,” Neurocomputing, vol. 493, pp. 548–567, 2022.
[30]
J. Wang, Y. Chen, Y. Gu, Y. Xiao, and H. Pan, “SensoryGANs: An effective generative adversarial framework for sensor-based human activity recognition,” in 2018 international joint conference on neural networks (IJCNN), 2018, pp. 1–8.
[31]
B. Khaertdinov, E. Ghaleb, and S. Asteriadis, “Contrastive self-supervised learning for sensor-based human activity recognition,” in 2021 IEEE international joint conference on biometrics (IJCB), 2021, pp. 1–8.
[32]
J. Long, E. Shelhamer, and T. Darrell, “Fully convolutional networks for semantic segmentation,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 3431–3440.
[33]
A. Reiss and D. Stricker, “Introducing a new benchmarked dataset for activity monitoring,” in 2012 16th international symposium on wearable computers, 2012, pp. 108–109.
[34]
D. Anguita, A. Ghio, L. Oneto, X. Parra, and J. L. Reyes-Ortiz, “Human activity recognition on smartphones using a multiclass hardware-friendly support vector machine,” in Ambient assisted living and home care: 4th international workshop, IWAAL 2012, vitoria-gasteiz, spain, december 3-5, 2012. Proceedings 4, 2012, pp. 216–223.
[35]
C. Chen, R. Jafari, and N. Kehtarnavaz, “UTD-MHAD: A multimodal dataset for human action recognition utilizing a depth camera and a wearable inertial sensor,” in 2015 IEEE international conference on image processing (ICIP), 2015, pp. 168–172.
[36]
B. Barshan and K. Altun, DOI: https://doi.org/10.24432/C5C59FDaily and Sports Activities.” UCI Machine Learning Repository, 2013.
[37]
P. Shi, W. Ye, and Z. Qin, “Self-supervised pre-training for time series classification,” in 2021 international joint conference on neural networks (IJCNN), 2021, pp. 1–8.