# Self-supervised Learning for Human Activity Recognition Using 700,000 Person-days of Wearable Data

Hang Yuan, Shing Chan, Andrew P. Creagh, Catherine Tong, Aidan Acquah, David A. Clifton and 1 more · arXiv · 2022-6-6

- **Problem** Deep learning for activity recognition from wrist-worn sensors is held back by small labelled datasets, and labelling is labour intensive.
- **Method** Pre-trains one ResNet-V2 on unlabelled UK-Biobank accelerometer windows using three pretext tasks, then fine-tunes it on seven labelled benchmarks.
- **Results** Fine-tuning all layers after SSL pre-training gave a median 18.4% relative F1 gain over training from scratch across seven datasets.

![Figure 2: Accuracy test curves for training four self-supervised tasks individually using 1000 subjects from the UK-Biobank with and without weighted sampling.…](https://refivu.com/papers/7d06c47d-a111-423f-a4f8-68d244e1093c/figures/figure-1bf018a3c0f25fc8bd0528445a7f55f4.png?thumb=512)

**Figure 2** : Accuracy test curves for training four self-supervised tasks individually using 1000 subjects from the UK-Biobank with and without weighted sampling. The patience for early-stopping was five.

[Original paper](https://arxiv.org/abs/2206.02909v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Hang Yuan, Shing Chan, Andrew P. Creagh, Catherine Tong, Aidan Acquah, David A. Clifton, Aiden Doherty · Self-supervised Learning for Human Activity Recognition Using 700,000 Person-days of Wearable Data · Original paper figure · Extracted the figure area from page 5 of the original PDF.

## Why labelled wearable data limits activity recognition

Activity recognition from wrist-worn sensors still leans on hand-crafted features, and the usual explanation is that labelled datasets are too small for data-hungry deep networks. Labelling is the bottleneck: for wearable data an annotator has to match the sensor trace against synchronised video, which makes each labelled hour expensive to obtain.

Unlabelled wearable recordings are far easier to gather, and large cohorts such as UK-Biobank and NHANES already hold them. Self-supervised learning turns such a stream into a training signal by building a prediction task from the data itself, following the route taken by language and vision models.

Earlier SSL studies for HAR used small laboratory-style datasets (n \<10,000), so their findings were confounded by the data they used. Whether SSL can help HAR at scale therefore remained unanswered.

This study takes the UK-Biobank wrist-worn recordings as the pre-training source, roughly 700,000 person-days of free-living data. The pretext tasks were picked to capture the time structure of movement, and the evaluation covers seven labelled benchmarks that differ in devices, populations and settings.

## Pretext tasks and the windows they act on

Each input is a tri-axial accelerometer window from a wrist-worn tracker, resampled to 30 Hz and cut into ten-second windows. The 30 Hz rate sits above the presumed Nyquist rate of 20 Hz, and the authors chose it because most human activities fall below 10 Hz.

Arrow of time reverses a window along the time axis, so the network must judge whether a window has been played backwards. Permutation splits a window into four chunks, each at least 10 timestamps long, and shuffles them. Time warping stretches and compresses random segments, so parts of a window run slower and other parts faster.

Each task becomes a binary decision about whether its transformation was applied, and each task has its own cross-entropy loss with equal weight in the total. The three tasks come from earlier multi-task SSL work on wearables, where they were first used as data augmentation. Because each task depends on the order and timing of motion, a network that solves them has to model how movement unfolds.

Not every task may help when trained together, so the task combinations are tested separately before the main experiments. Axis orientation differs between device makers, so random axis swaps and rotations are added to the augmentation.

## Weighting windows by movement

Real-world recordings contain long low-movement stretches that carry little information about activity. For these tasks the issue is sharper, because a static signal barely changes under reversal, permutation or warping.

Each window's chance of being drawn scales with its standard deviation, so high-movement periods receive more weight during training. The authors report that this choice mattered for training stability and convergence.

## Shared network and pre-training loop

All three tasks share one feature extractor, a ResNet-V2 with 18 layers and 1D convolutions, totalling 10M parameters. Each pretext task gets its own softmax layer on top of the 1024-dimensional feature vector, so the trunk is shared while the output heads are task-specific.

Each iteration loads up to four subjects, and for each subject one day is drawn from the week of recordings. From that day 1500 ten-second windows are sampled, so a batch of four subjects contains 1500 times 4 = 6000 windows.

Training uses Adam with a learning rate of 1e-3, with the learning rate scaled linearly for the large batch and five epochs of burn-in. The multi-task model was trained on four Tesla V100-SXM2 GPUs with 32GB of memory for about 420 GPU hours, around 20 epochs. The SSL experiments used an 8:2 train/test split.

For downstream use, a fully connected layer of size 512 is added between the feature extractor and the softmax readout, and this structure is kept fixed across downstream runs. Fine-tuning reuses the pre-training setup where possible, with the batch size adjusted to each dataset.

## Downstream protocol and baselines

The UK-Biobank pool is listed with 100K participants and 6 B unlabelled samples, all from free-living recordings. The seven labelled benchmarks range from 600 to 600,000 samples, span 4 to 18 activity classes, use five device brands, and cover free-living, scripted and lab protocols.

Datasets with fewer than ten subjects use held-one-subject-out cross-validation, and classes not performed by every subject are removed. Larger datasets use five-fold subject-wise cross-validation with a 7:1:2 train, validation and test split, and early stopping with a patience of five.

Fine-tuning either updates every layer, or freezes the trunk and trains only the fully connected layers at the end. The baselines are the same architecture trained from scratch and a random forest built on tried-and-tested time-series features. The random forest is included because it is often under-compared, and one shared code path handles training, evaluation and preprocessing.

Changes in training rates, regularisation and augmentation can shift results, so a single fixed protocol was used across all benchmarks. The authors say earlier work lacked such a protocol, which made baseline comparisons hard to read.

## Downstream gains over scratch and random forest

Table 3 reports subject-wise F1 and Kappa for the random forest, the network trained from scratch, and two fine-tuning modes, with 100,000 participants used for pre-training. Across all seven datasets the fully fine-tuned SSL network had higher F1 than both the random forest and the scratch network.

The random forest beat the scratch network on every dataset except Capture-24. On Capture-24 the fully fine-tuned model reached .726 ± .093, against .708 ± .094 from scratch, a relative gain of 2.5%. On ADL the same comparison moves from .414 ± .179 to .829 ± .101, a relative gain of 100.0%.

The median relative F1 gain over training from scratch across the seven datasets was 18.4%, and the authors report a median of 8.5% against the random forest. The per-dataset gains over scratch run from 2.5% on Capture-24 to 100.0% on ADL, with Opportunity at 55.4%.

The gains were largest on the smaller datasets, and the authors describe the benefit as more modest for the larger ones. Fine-tuning all layers beat fine-tuning only the layers after the convolutional trunk.

## Which pretext tasks to combine

Single tasks and combinations were pre-trained on 1,000 UK-Biobank participants and then fine-tuned on Capture-24, Rowlands and Opportunity. These three benchmarks were picked to stand for large, medium and small datasets.

On Capture-24 single-task F1 spans .671 ± .094 for arrow of time to .721 ± .093 for permutation, and all three tasks together reached .718 ± .095. On Rowlands the spread is much wider, from .565 ± .120 for arrow of time alone to .783 ± .099 for permutation alone, while all three tasks reached .770 ± .102. On Opportunity the scores run from .482 ± .078 with all three tasks to .588 ± .076 with permutation alone.

The authors state that combinations differed less on the large datasets than on Opportunity. The Rowlands column spans .565 to .783, which is wider than the .482 to .588 range on Opportunity, so that statement does not hold for Rowlands. No single configuration was clearly best, so all three tasks were used for the remaining experiments, on the reasoning that more tasks together may give a more general representation.

## Effect of weighted sampling on single-task training

Single pretext tasks were trained on 1000 UK-Biobank subjects with and without weighted sampling, and test accuracy was tracked across epochs. Early stopping used a patience of five.

Without weighted sampling, every task converged worse. The largest loss was for arrow of time and permutation. Arrow of time stayed at chance level, and permutation test performance fell by roughly 10 percentage points. The text gives no separate figure for time warping in this comparison.

## Labelled pre-training as a comparison

Capture-24 and Rowlands, the two largest labelled datasets, were used as supervised pre-training sources and fine-tuned on other benchmarks. Each source was also used for self-supervised pre-training, and UK-Biobank self-supervised pre-training is shown as a further column.

The rows are downstream targets, and each row pairs a supervised and a self-supervised result for each labelled source. In most cells the self-supervised model scores higher, for example .702 ± .123 against .680 ± .109 on WISDM from the Rowlands source. Two cells favour supervised pre-training: from the Capture-24 source on ADL, .768 ± .169 against .754 ± .159, and Opportunity from Capture-24 at .547 ± .043 against .547 ± .042.

The margins for the Capture-24 target and the Rowlands target are small, at .709 against .707 and .730 against .728 respectively. The authors suspect the limited number of labels in the source datasets left out information that the pretext tasks can learn.

## How labelled and unlabelled data volume matters

On Capture-24 and Rowlands the number of labelled downstream subjects was varied. Pre-trained models held up across that range, whereas fully supervised and random forest models were more sensitive to the number of labelled subjects.

The gain from adding labelled subjects was roughly linear in the number of people, and it was steeper when fewer labelled subjects were available. Downstream F1 rose roughly linearly with the number of unlabelled pre-training subjects on a log scale. That gain was largest on Opportunity, the smallest downstream dataset.

Pre-training subjects were varied from 100 upward in steps of one order of magnitude. With 10,000 participants, the data ratio per subject was varied from .25 to 1, where .25 means six hours of data per subject instead of one day. Reducing the ratio from 1.0 to .25 did not degrade performance much, which the authors attribute to a sufficiently large number of subjects.

## What the features and attributions show

UMAP with default parameters projected raw inputs, untrained features and SSL-derived features into low-dimensional space. Figure 4 shows two of the downstream datasets, and the authors observed that SSL-derived features cluster similar activities and their intensities better, with the remaining datasets in the appendix. The authors describe these clusters as more compact within a class and better separated between classes.

To read the relevance maps, one participant wore the same accelerometer as in UK-Biobank, with synchronised video, while performing hand shaking and playing tennis. The inspection combines the raw signal, its continuous wavelet transform scalograms and the task-localised relevance scores.

For tennis, relevance tended to highlight the swing and ball-hitting moments. For hand shaking, relevance also picked up the intensity and the periodicity of the signal. For augmented signals, relevance concentrated on visually unrealistic dynamics, such as unnatural fragmentation of frequency or mismatches between axes, and stationary periods were not relevant.

Most tasks highlighted similar regions, which the authors attribute to the large shared feature extractor with small task heads.

The faithfulness test masked samples cumulatively, most relevant first, for 1000 out-of-sample UK-Biobank subjects. For most explanation methods, accuracy fell faster than under random masking, which suggests these methods identified relevant patterns.

The authors interpret multi-task SSL as learning human motion dynamics, intensity levels and synchronisation between axes. They also state that the pre-trained models can distinguish human activities before fine-tuning.

## Limitations

Licence information is recorded for three of the seven benchmarks, and consent information for four. The authors note that many open benchmark datasets lacked suitable licence or consent information, possibly because data governance awareness was low when they were collected.

The task-combination comparison used 1,000 pre-training participants, so the choice of task set is tested at that size only. The main Table 3 results use 100,000 pre-training participants, a different pre-training size from the one used to compare task sets.

The single-task convergence curves and the faithfulness analysis each rest on 1000 subjects. The authors offer the label-count explanation for the transfer result as a suspicion, and the text reports no test of it.

## Paper info

- **Authors**: Hang Yuan, Shing Chan, Andrew P. Creagh, Catherine Tong, Aidan Acquah, David A. Clifton, Aiden Doherty
- **Venue**: arXiv · Preprint
- **First published**: 2022-6-6
- **Added**: 2026-11-6
- **Updated**: 2024-6-20
- **Version**: v3
- **arXiv**: 2206.02909
- **DOI**: 10.1038/s41746-024-01062-3
- **Category**: eess.SP · cs.AI · cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2206.02909v3) · [PDF ↗](https://arxiv.org/pdf/2206.02909v3)

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

Advances in deep learning for human activity recognition have been relatively limited due to the lack of large labelled datasets. In this study, we leverage self-supervised learning techniques on the UK-Biobank activity tracker dataset--the largest of its kind to date--containing more than 700,000 person-days of unlabelled wearable sensor data. Our resulting activity recognition model consistently outperformed strong baselines across seven benchmark datasets, with an F1 relative improvement of 2.5%-100% (median 18.4%), the largest improvements occurring in the smaller datasets. In contrast to previous studies, our results generalise across external datasets, devices, and environments. Our open-source model will help researchers and developers to build customisable and generalisable activity classifiers with high performance.

## Quote from the paper

Hang Yuan, Shing Chan, Andrew P. Creagh, Catherine Tong, Aidan Acquah, David A. Clifton, Aiden Doherty (2022). Self-supervised Learning for Human Activity Recognition Using 700,000 Person-days of Wearable Data. arXiv:2206.02909v3. https://doi.org/10.1038/s41746-024-01062-3

**BibTeX**

```
@article{yuan2022self,
  title = {{Self-supervised Learning for Human Activity Recognition Using 700,000 Person-days of Wearable Data}},
  author = {Hang Yuan and Shing Chan and Andrew P. Creagh and Catherine Tong and Aidan Acquah and David A. Clifton and Aiden Doherty},
  year = {2022},
  eprint = {2206.02909},
  archivePrefix = {arXiv},
  doi = {10.1038/s41746-024-01062-3},
  url = {https://arxiv.org/abs/2206.02909v3}
}
```

## Other paper commentary

- [Multi-task Self-Supervised Learning for Human Activity Detection](https://refivu.com/en/papers/ae7c537d-33fb-4fec-8014-37dab4536341-multi-task-self-supervised-learning-for-human-activity.md)
- [Neural Discrete Representation Learning](https://refivu.com/en/papers/111a9c5f-9d7d-4bff-bbad-a962285094a3-neural-discrete-representation-learning.md)
- [Momentum Contrast for Unsupervised Visual Representation Learning](https://refivu.com/en/papers/4093c4bb-ce8b-4d26-bded-60ec02bc0fac-momentum-contrast-for-unsupervised-visual-representation.md)
- [A Simple Framework for Contrastive Learning of Visual Representations](https://refivu.com/en/papers/3db73a26-109e-4e04-9c02-471468632adf-a-simple-framework-for-contrastive-learning-of-visual.md)
- [Inductive Representation Learning on Large Graphs](https://refivu.com/en/papers/ff5e1161-efee-4eaf-8a5b-ca4227613b73-inductive-representation-learning-on-large-graphs.md)
- [Bootstrap your own latent: A new approach to self-supervised Learning](https://refivu.com/en/papers/e1bafe00-ea17-46b4-a31b-5db9555dcd50-bootstrap-your-own-latent-a-new-approach-to.md)
- [A Generalized Deep Learning Framework for Whole-Slide Image Segmentation and Analysis](https://refivu.com/en/papers/17229723-709e-4a8a-9857-8cd6f0d14883-a-generalized-deep-learning-framework-for-whole-slide.md)
- [Attention Spiking Neural Networks](https://refivu.com/en/papers/2c52d99c-a249-4911-96bd-79f6720c0a09-attention-spiking-neural-networks.md)
- [Uncovering near-wall blood flow from sparse data with physics-informed neural networks](https://refivu.com/en/papers/5532e81a-0a00-4722-b226-e72f33cb333a-uncovering-near-wall-blood-flow-from-sparse-data.md)
- [Deep Unsupervised Learning using Nonequilibrium Thermodynamics](https://refivu.com/en/papers/0a712ab6-ae49-4e62-8de7-48f3f793c53f-deep-unsupervised-learning-using-nonequilibrium.md)
- [A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning](https://refivu.com/en/papers/08306129-4598-48b6-baf3-9d1af09e03a6-a-reduction-of-imitation-learning-and-structured-prediction.md)
- [NICE: Non-linear Independent Components Estimation](https://refivu.com/en/papers/f56da4f3-4308-4b66-a0bf-e0d6e495195a-nice-non-linear-independent-components-estimation.md)

## Terms in this paper

- [ADAM](https://refivu.com/en/terms/0e9ad0199e08-adam)
- [transfer learning](https://refivu.com/en/terms/9c71d6928a00-transfer-learning)
- [F1](https://refivu.com/en/terms/a443de87a37a-f1)
- [random forest](https://refivu.com/en/terms/e69b7b54f2ea-random-forest)
- [self-supervised learning](https://refivu.com/en/terms/5cfb8786ff12-self-supervised-learning)
- [layer-wise relevance propagation](https://refivu.com/en/terms/8f88b1c3f79a-layer-wise-relevance-propagation)
- [UMAP](https://refivu.com/en/terms/aeb869edc5de-umap)
- [human activity recognition](https://refivu.com/en/terms/7f915c171d33-human-activity-recognition)
- [arrow of time](https://refivu.com/en/terms/4965a8cc4037-arrow-of-time)
- [Opportunity](https://refivu.com/en/terms/c1b969497dc5-opportunity)
- [PAMAP2](https://refivu.com/en/terms/6dc151120bcd-pamap2)
- [Permutation](https://refivu.com/en/terms/bde2aeb76c57-permutation)
- [supervised pre-training](https://refivu.com/en/terms/1b22b3fd5ce4-supervised-pre-training)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/7d06c47d-a111-423f-a4f8-68d244e1093c-self-supervised-learning-for-human-activity-recognition)
