Paper commentary
Multi-task Self-Supervised Learning for Human Activity Detection
- Problem Labeled smartphone activity data are costly and privacy-sensitive to collect, so supervised human activity recognition is hard to scale.
- Method Pre-trains a temporal convolutional network to recognize eight signal transformations as binary tasks, then transfers its convolutional layers to an activity classifier.

Fig. 1 . Illustration of the proposed multi-task self-supervised approach for feature learning. We train a temporal convolutional network for transformation recognition as a pretext task as shown in Step 1. The learned features are utilized by (or transferred to) the activity recognition model (Step 2) for improved detection rate with a small labeled dataset.
Original paper · CC BY 4.0 · Aaqib Saeed, Tanir Ozcelebi, Johan Lukkien · Multi-task Self-Supervised Learning for Human Activity Detection · Original paper figure · Extracted the figure area from page 3 of the original PDF.Why labeled activity data are the bottleneck
Convolutional and recurrent networks trained on raw labeled signals have raised detection rates for smartphone-based human activity recognition over traditional methods. Collecting enough labeled data is difficult for several reasons: smartphone data are privacy sensitive, annotation is slow and expensive, and the variety of devices, sensors, phone usage and environments makes labeling hard to scale.
The study therefore asks whether representations can be learned without activity labels and still be on par with features learned by fully-supervised training.
A transformation-recognition pretext task
The Transformation Prediction Network (TPN) is a multi-task temporal convolutional network with a shared trunk and a separate head for each signal transformation. Each unlabeled signal is copied with every transformation applied, so the original is labeled as untransformed and each altered copy as transformed. The labels are derived from the data itself, and no human annotation is needed.
Figure 1 summarizes the two steps: pre-training on the transformation tasks, then reuse of the learned features by a small labeled activity model.
The training objective sums a weighted binary cross-entropy over the tasks, with each task averaged over its own instances: \[\min_{\theta}\sum_{t\in T}\psi_t\Big[-\frac{1}{m_t}\sum_{i=1}^{m_t}\big(y_{ti}\log M_\theta(x_{ti})+(1-y_{ti})\log(1-M_\theta(x_{ti}))\big)\Big]\] Here M_θ(x_ti) is the predicted probability that the instance x_ti is a transformed version for task t, θ holds the learnable parameters, m_t is the number of instances of task t, and ψ_t is the loss weight of task t.
The minus sign makes the bracketed term a negative log-likelihood that is minimized. Because all heads share one trunk, the shared layers must encode information that serves every transformation question, while each head specializes. The architecture could handle several transformations applied to the same signal, but the study does not train for that case.
Choosing eight signal transformations
Eight transformations are used. They were picked to be simple but varied, so that together they cover several invariances that occur in temporal data. Noising adds random jitter to the signal, scaling multiplies the window by a random scalar, and the rotated transformation inverts sample signs, which mimics a device held upside down. Negation is both a scaling by minus one and a rotation, and horizontal flipping reverses the time axis.
Permutation swaps segments of a window, time-warping stretches the time intervals locally, and channel shuffling reorders the axes of a triaxial accelerometer.
The authors argue that a range of transformation tasks forces the network to pick up device placement, time shifts, amplitude and noise robustness, all of which matter for activity recognition. They contrast this with signal reconstruction by autoencoders, which they expect to give a weaker supervisory signal and possibly trivial features.
Network size, training and transfer
The TPN has three one-dimensional convolutional layers with 32, 64, and 96 feature maps and kernel sizes of 24, 16 and 8, all with stride 1. Dropout with rate 0.1 follows each layer, L2 regularization uses a rate of 0.0001, and global max pooling follows the last convolutional layer. Each task head is a fully-connected layer of 256 hidden units with a sigmoidal output.
ReLU is used in all other layers, and the network is trained with Adam for a maximum of 30 epochs at a learning rate of 0.0003 unless stated otherwise.
The architecture is kept simple so that any gain can be attributed to self-supervised pre-training rather than to extra parameters, extra layers or techniques such as batch normalization. The activity recognition model reuses the convolutional layers of the TPN, adds a fully-connected layer of 1024 hidden units with a softmax output, and uses early stopping when the training set is fully fit.
After pre-training, the convolutional weights move to the activity network. Either all transferred layers are frozen, or only the last convolutional layer is fine-tuned, and the dense layers of the activity model are trained on the labeled activity data.
Which convolutional block gives the best features
Classifiers were trained on top of each of the three convolutional blocks of a pre-trained TPN, with the block features kept fixed. Kappa was measured on test sets and averaged over 10 independent runs to reduce the effect of classifier weight initialization.
The authors suggest that the last block may become too specialized to the transformation task, or that the self-supervision did not use the entire dataset. For consistency, later experiments use the last convolutional layer on all datasets.
Comparison with autoencoder and supervised baselines
Table 2 reports precision, recall, f-score and kappa over 10 independent runs on the six datasets. The Random Init. baseline keeps the convolutional layers frozen and random, and trains only a classifier. The Autoencoder baseline is pre-trained by reconstruction, its encoder is frozen, and a classifier is trained on top.
The Self-Supervised rows train a classifier on the frozen TPN, while Self-Supervised (FT) also fine-tunes the last convolutional layer. Training a classifier on randomly initialized convolutional layers performed poorly, which the authors take as evidence that the gain is not only due to the classifier.
The TPN features outperformed the autoencoder and reached results on par with the fully-supervised model, where the fully-supervised network is trained end-to-end on activity labels. Fine-tuning the last convolutional layer further improved classification on several datasets, including UniMiB, HHAR, MobiAct and UCI HAR. A 5-fold user-split cross-validation was also run for every method on all datasets, and its results are given in Table 4 of the appendix.
Single tasks versus the joint model
A TPN was pre-trained on each single transformation task, its weights were transferred to an activity classifier, and the result was compared with the multi-task TPN.
Multi-task pre-training gave clearly better end-task performance than each single task in every case the authors examined. Channel-shuffled, permuted and rotated tasks performed better than the others across datasets, each reaching a kappa above 0.60 on different activity recognition problems.
The authors suggest that a group of tasks may be enough for a good model. They recommend training individual tasks first, then dropping low-performing tasks or giving them low loss weights, since task complexity differs between datasets. The authors mention automatically tuning the task-loss weights using homoscedastic uncertainty as another option.
Few labels and transfer from another dataset
In the semi-supervised setting, a TPN is first trained on the full training set for transformation prediction, and the activity classifier is then trained with only a small amount of labeled data.
The authors report that the self-supervised features drastically improved detection when very few labeled instances were available. Features transferred from the unlabeled MobiAct data improved performance compared with training a model from scratch, and they also raised the performance of the recognizer in semi-supervised learning on the dataset of interest.
Comparing representations with SVCCA, saliency and t-SNE
Three analyses compare the representations: SVCCA for similarity across networks and layers, saliency maps, and t-SNE embeddings. SVCCA identifies optimal linear relationships between two sets of neuron activation vectors. Figure 8 reports the mean similarity of the top 20 correlation coefficients for all layer pairs of the self-supervised network and the fully-supervised network.
Averaging 20 coefficients assumes that all CCA vectors are equally important for a layer. The authors justify this by noting that high-performing deep networks do not use the full dimensionality of a layer.
The authors report that the self-supervised representations are very similar to those of the fully-supervised network trained with activity labels.
Limitations
The approach was not evaluated on an imbalanced activity dataset with many classes, where collecting a few labeled examples for each class is not feasible. Evaluation in a real-world setting, with the application deployed on real devices, was not carried out, so computational, energy and labeled data requirements remain to be examined.
The layer analysis shows one exception on HHAR, and the SVCCA similarity relies on averaging a fixed number of coefficients under an equal-importance assumption. The main comparisons use the six publicly available datasets described in the study, so conclusions do not extend to other data without further tests.
Paper info
- Authors
- Aaqib Saeed, Tanir Ozcelebi, Johan Lukkien
- Venue
- arXiv · Preprint
- First published
- 2019-7-27
- Added
- 2026-11-5
- Updated
- 2019-7-27
- Version
- v1
- arXiv
- 1907.11879
- DOI
- 10.1145/3328932
- Category
- cs.LG · stat.ML
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Deep learning methods are successfully used in applications pertaining to ubiquitous computing, health, and well-being. Specifically, the area of human activity recognition (HAR) is primarily transformed by the convolutional and recurrent neural networks, thanks to their ability to learn semantic representations from raw input. However, to extract generalizable features, massive amounts of well-curated data are required, which is a notoriously challenging task; hindered by privacy issues, and annotation costs. Therefore, unsupervised representation learning is of prime importance to leverage the vast amount of unlabeled data produced by smart devices. In this work, we propose a novel self-supervised technique for feature learning from sensory data that does not require access to any form of semantic labels. We learn a multi-task temporal convolutional network to recognize transformations applied on an input signal. By exploiting these transformations, we demonstrate that simple auxiliary tasks of the binary classification result in a strong supervisory signal for extracting useful features for the downstream task. We extensively evaluate the proposed approach on several publicly available datasets for smartphone-based HAR in unsupervised, semi-supervised, and transfer learning settings. Our method achieves performance levels superior to or comparable with fully-supervised networks, and it performs significantly better than autoencoders. Notably, for the semi-supervised case, the self-supervised features substantially boost the detection rate by attaining a kappa score between 0.7-0.8 with only 10 labeled examples per class. We get similar impressive performance even if the features are transferred from a different data source. While this paper focuses on HAR as the application domain, the proposed technique is general and could be applied to a wide variety of problems in other areas.
Quote from the paper
Aaqib Saeed, Tanir Ozcelebi, Johan Lukkien (2019). Multi-task Self-Supervised Learning for Human Activity Detection. arXiv:1907.11879v1. https://doi.org/10.1145/3328932
BibTeX
@article{saeed2019multi,
title = {{Multi-task Self-Supervised Learning for Human Activity Detection}},
author = {Aaqib Saeed and Tanir Ozcelebi and Johan Lukkien},
year = {2019},
eprint = {1907.11879},
archivePrefix = {arXiv},
doi = {10.1145/3328932},
url = {https://arxiv.org/abs/1907.11879v1}
}