A comprehensive benchmark for evaluating foundation models in sensor-based Human Activity Recognition (HAR).
Leaderboard: https://litchi7777.github.io/harbench/
# Build image
docker build -t harbench .
# Start container
docker run -dit --gpus all --name harbench harbench bash
# Enter container
docker exec -it harbench bash
# Inside container: preprocess and run benchmark
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
python run_benchmark.py --model mtl --eval all
# Create virtual environment
python -m venv .env
source .env/bin/activate
# Install dependencies
pip install torch torchvision torchaudio
pip install -r requirements.txt
# Preprocess all 18 fine-tuning datasets
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
# Run benchmark
python run_benchmark.py --model mtl --eval all
Want to turn your own IMU data into feature vectors with a HARBench model,
without running the full benchmark pipeline? Install the package and call
load_model / encode.
# Install directly from GitHub (bundles the mtl weights)
pip install git+https://github.com/litchi7777/harbench.git
import numpy as np
import harbench
# Load the mtl feature extractor (pretrained weights ship with the package)
model = harbench.load_model("mtl") # device auto-selects cuda/cpu
# x: windowed IMU data shaped (num_windows, num_sensors * 3, sequence_length)
# The mtl weights were trained on 30 Hz, 5-second windows (sequence_length = 150).
x = np.random.randn(8, 3, 150).astype("float32")
feats = model.encode(x) # -> (8, 512) numpy array
Notes:
num_sensors and stack channels accordingly:
harbench.load_model("mtl", num_sensors=2) expects (N, 6, 150) and
returns (N, 1024).encode accepts numpy arrays or torch tensors and returns the same type.
Use encode(x, batch_size=256) to process large inputs in chunks.harbench.available_models() lists the models exposed through this API.har-bench2/
├── finetune.py # Fine-tuning and evaluation
├── pretrain.py # Self-supervised pretraining
├── run_benchmark.py # Full benchmark runner
├── src/
│ ├── data/ # Data loading utilities
│ └── models/ # Model definitions
├── pretrained/ # Pretrained weights
│ ├── mtl.pth # (included)
│ ├── simclr.pth # (included)
│ ├── moco.pth # (included)
│ ├── cpc.pth # (included)
│ ├── timemask.pth # (included)
│ ├── timechannel.pth # (included)
│ ├── limubert.pt.url # (download separately)
│ ├── imumae.pth.url # (download separately)
│ └── selfpab.ckpt.url # (download separately)
├── har-datasets/ # Dataset preprocessors
└── results/ # Experiment results
| Model | Type | Description | Weights |
|---|---|---|---|
| resnet | Baseline | 1D ResNet (random init) | - |
| mtl | SSL | Multi-Task Learning | Included |
| simclr | SSL | SimCLR | Included |
| moco | SSL | MoCo | Included |
| timechannel | SSL | Masked Resnet (time+channel) | Included |
| timemask | SSL | Masked Resnet (time only) | Included |
| cpc | SSL | Contrastive Predictive Coding | Included |
| harnet | Pretrained | OxWearables HARNet | Auto-download |
| selfpab | Transformer | SelfPAB (STFT + Transformer) | Download required |
| limubert | Transformer | LIMU-BERT | Download required |
| imumae | Transformer | IMU-Video-MAE (ECCV 2024) | Download required |
| patchtst | Foundation | PatchTST | Auto-download |
| moment | Foundation | MOMENT | Auto-download |
# List available datasets
python preprocess.py --list
# Preprocess a single dataset with auto-download
python preprocess.py --dataset dsads --download
# Preprocess all 18 fine-tuning datasets
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
# Preprocess all 14 pretraining datasets (excluding NHANES)
python preprocess.py --dataset adlrd chad capture24 dog har70plus hhar imsb kddi_kitchen_left kddi_kitchen_right motionsense opportunity sbrhapt tmd wisdm --download
# NHANES is very large and takes a long time to process - run separately
python preprocess.py --dataset nhanes --download
Processed data will be saved to har-datasets/data/processed/{dataset}/
Fine-tuning Datasets (18)
| Dataset | Sensors | Classes | Domain |
|---|---|---|---|
| DSADS | 5 | 19 | Exercise |
| PAMAP2 | 3 | 18 (12) | Daily |
| MHEALTH | 3 | 12 | Exercise |
| RealDisp | 9 | 33 | Exercise |
| MEX | 2 | 7 | Exercise |
| Forthtrace | 5 | 16 (11) | Daily |
| HARTH | 2 | 12 (10) | Daily |
| IMWSHA | 3 | 11 | Daily |
| PAAL | 1 | 24 (10) | Daily |
| RealWorld | 7 | 8 | Daily |
| SelfBack | 2 | 9 | Daily |
| UCAEHAR | 1 | 8 (6) | Daily |
| USC-HAD | 1 | 12 | Daily |
| WARD | 5 | 13 | Daily |
| LARa | 5 | 8 (6) | Industry |
| OpenPack | 4 | 10 (9) | Industry |
| Exoskeletons | 5 | 4 | Industry |
| VTT-ConIoT | 3 | 16 | Industry |
Pretraining Datasets (14)
| Dataset | Sensors | Description |
|---|---|---|
| NHANES | 1 | Large-scale (~13K subjects) |
| Capture-24 | 1 | Large-scale (151 subjects) |
| ADLRD | 1 | Daily activities |
| CHAD | 1 | Daily activities |
| Dog | 3 | Animal activity |
| HAR70+ | 2 | Elderly activities |
| HHAR | 7 | Device heterogeneity |
| IMSB | 2 | Daily activities |
| KDDI-Kitchen | 1 | Kitchen activities |
| MotionSense | 1 | Daily activities |
| Opportunity | 7 | Daily activities |
| SBR-HAPT | 1 | Daily activities |
| TMD | 1 | Transportation |
| WISDM | 2 | Daily activities |
Run comprehensive evaluation across multiple datasets:
# Run all evaluations for a model
python run_benchmark.py --model mtl --eval all
# Run specific evaluation types
python run_benchmark.py --model mtl --eval average # Average performance
python run_benchmark.py --model mtl --eval domain # Cross-domain evaluation
python run_benchmark.py --model mtl --eval position # Sensor position evaluation
python run_benchmark.py --model mtl --eval fewshot # Few-shot learning
python run_benchmark.py --model mtl --eval zeroshot # Zero-shot evaluation
# Run on specific datasets
python run_benchmark.py --model mtl --datasets dsads pamap2 mhealth
# Multi-GPU parallel execution
python run_benchmark.py --model mtl --num_gpus 4 --parallel 2
Results will be saved to results/benchmark/.
python finetune.py --model mtl --dataset dsads --sensors LeftArm --epochs 50
Train your own SSL models:
python pretrain.py --method mtl --device cuda:0
Some models require downloading weights from external sources:
| Model | Source | Instructions |
|---|---|---|
| limubert | LIMU-BERT | Download and place as pretrained/limubert.pt |
| imumae | IMU-Video-MAE | Download and place as pretrained/imumae.pth |
| selfpab | SelfPAB | Download and place as pretrained/selfpab.ckpt |
See .url files in pretrained/ for download links.
@inproceedings{harbench2026,
title={HARBench: A Comprehensive Benchmark for Evaluating Foundation Models in Sensor-based Human Activity Recognition},
author={Tanigaki, Kei and Maekawa, Takuya and Hara, Takahiro},
booktitle={2026 IEEE International Conference on Pervasive Computing and Communications (PerCom)},
year={2026}
}
14 commits
Python
99.9%
A comprehensive benchmark for evaluating foundation models in sensor-based Human Activity Recognition (HAR).
Leaderboard: https://litchi7777.github.io/harbench/
# Build image
docker build -t harbench .
# Start container
docker run -dit --gpus all --name harbench harbench bash
# Enter container
docker exec -it harbench bash
# Inside container: preprocess and run benchmark
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
python run_benchmark.py --model mtl --eval all
# Create virtual environment
python -m venv .env
source .env/bin/activate
# Install dependencies
pip install torch torchvision torchaudio
pip install -r requirements.txt
# Preprocess all 18 fine-tuning datasets
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
# Run benchmark
python run_benchmark.py --model mtl --eval all
Want to turn your own IMU data into feature vectors with a HARBench model,
without running the full benchmark pipeline? Install the package and call
load_model / encode.
# Install directly from GitHub (bundles the mtl weights)
pip install git+https://github.com/litchi7777/harbench.git
import numpy as np
import harbench
# Load the mtl feature extractor (pretrained weights ship with the package)
model = harbench.load_model("mtl") # device auto-selects cuda/cpu
# x: windowed IMU data shaped (num_windows, num_sensors * 3, sequence_length)
# The mtl weights were trained on 30 Hz, 5-second windows (sequence_length = 150).
x = np.random.randn(8, 3, 150).astype("float32")
feats = model.encode(x) # -> (8, 512) numpy array
Notes:
num_sensors and stack channels accordingly:
harbench.load_model("mtl", num_sensors=2) expects (N, 6, 150) and
returns (N, 1024).encode accepts numpy arrays or torch tensors and returns the same type.
Use encode(x, batch_size=256) to process large inputs in chunks.harbench.available_models() lists the models exposed through this API.har-bench2/
├── finetune.py # Fine-tuning and evaluation
├── pretrain.py # Self-supervised pretraining
├── run_benchmark.py # Full benchmark runner
├── src/
│ ├── data/ # Data loading utilities
│ └── models/ # Model definitions
├── pretrained/ # Pretrained weights
│ ├── mtl.pth # (included)
│ ├── simclr.pth # (included)
│ ├── moco.pth # (included)
│ ├── cpc.pth # (included)
│ ├── timemask.pth # (included)
│ ├── timechannel.pth # (included)
│ ├── limubert.pt.url # (download separately)
│ ├── imumae.pth.url # (download separately)
│ └── selfpab.ckpt.url # (download separately)
├── har-datasets/ # Dataset preprocessors
└── results/ # Experiment results
| Model | Type | Description | Weights |
|---|---|---|---|
| resnet | Baseline | 1D ResNet (random init) | - |
| mtl | SSL | Multi-Task Learning | Included |
| simclr | SSL | SimCLR | Included |
| moco | SSL | MoCo | Included |
| timechannel | SSL | Masked Resnet (time+channel) | Included |
| timemask | SSL | Masked Resnet (time only) | Included |
| cpc | SSL | Contrastive Predictive Coding | Included |
| harnet | Pretrained | OxWearables HARNet | Auto-download |
| selfpab | Transformer | SelfPAB (STFT + Transformer) | Download required |
| limubert | Transformer | LIMU-BERT | Download required |
| imumae | Transformer | IMU-Video-MAE (ECCV 2024) | Download required |
| patchtst | Foundation | PatchTST | Auto-download |
| moment | Foundation | MOMENT | Auto-download |
# List available datasets
python preprocess.py --list
# Preprocess a single dataset with auto-download
python preprocess.py --dataset dsads --download
# Preprocess all 18 fine-tuning datasets
python preprocess.py --dataset dsads pamap2 mhealth realdisp mex forthtrace harth imwsha paal realworld selfback ucaehar uschad ward lara openpack exoskeletons vtt_coniot --download
# Preprocess all 14 pretraining datasets (excluding NHANES)
python preprocess.py --dataset adlrd chad capture24 dog har70plus hhar imsb kddi_kitchen_left kddi_kitchen_right motionsense opportunity sbrhapt tmd wisdm --download
# NHANES is very large and takes a long time to process - run separately
python preprocess.py --dataset nhanes --download
Processed data will be saved to har-datasets/data/processed/{dataset}/
Fine-tuning Datasets (18)
| Dataset | Sensors | Classes | Domain |
|---|---|---|---|
| DSADS | 5 | 19 | Exercise |
| PAMAP2 | 3 | 18 (12) | Daily |
| MHEALTH | 3 | 12 | Exercise |
| RealDisp | 9 | 33 | Exercise |
| MEX | 2 | 7 | Exercise |
| Forthtrace | 5 | 16 (11) | Daily |
| HARTH | 2 | 12 (10) | Daily |
| IMWSHA | 3 | 11 | Daily |
| PAAL | 1 | 24 (10) | Daily |
| RealWorld | 7 | 8 | Daily |
| SelfBack | 2 | 9 | Daily |
| UCAEHAR | 1 | 8 (6) | Daily |
| USC-HAD | 1 | 12 | Daily |
| WARD | 5 | 13 | Daily |
| LARa | 5 | 8 (6) | Industry |
| OpenPack | 4 | 10 (9) | Industry |
| Exoskeletons | 5 | 4 | Industry |
| VTT-ConIoT | 3 | 16 | Industry |
Pretraining Datasets (14)
| Dataset | Sensors | Description |
|---|---|---|
| NHANES | 1 | Large-scale (~13K subjects) |
| Capture-24 | 1 | Large-scale (151 subjects) |
| ADLRD | 1 | Daily activities |
| CHAD | 1 | Daily activities |
| Dog | 3 | Animal activity |
| HAR70+ | 2 | Elderly activities |
| HHAR | 7 | Device heterogeneity |
| IMSB | 2 | Daily activities |
| KDDI-Kitchen | 1 | Kitchen activities |
| MotionSense | 1 | Daily activities |
| Opportunity | 7 | Daily activities |
| SBR-HAPT | 1 | Daily activities |
| TMD | 1 | Transportation |
| WISDM | 2 | Daily activities |
Run comprehensive evaluation across multiple datasets:
# Run all evaluations for a model
python run_benchmark.py --model mtl --eval all
# Run specific evaluation types
python run_benchmark.py --model mtl --eval average # Average performance
python run_benchmark.py --model mtl --eval domain # Cross-domain evaluation
python run_benchmark.py --model mtl --eval position # Sensor position evaluation
python run_benchmark.py --model mtl --eval fewshot # Few-shot learning
python run_benchmark.py --model mtl --eval zeroshot # Zero-shot evaluation
# Run on specific datasets
python run_benchmark.py --model mtl --datasets dsads pamap2 mhealth
# Multi-GPU parallel execution
python run_benchmark.py --model mtl --num_gpus 4 --parallel 2
Results will be saved to results/benchmark/.
python finetune.py --model mtl --dataset dsads --sensors LeftArm --epochs 50
Train your own SSL models:
python pretrain.py --method mtl --device cuda:0
Some models require downloading weights from external sources:
| Model | Source | Instructions |
|---|---|---|
| limubert | LIMU-BERT | Download and place as pretrained/limubert.pt |
| imumae | IMU-Video-MAE | Download and place as pretrained/imumae.pth |
| selfpab | SelfPAB | Download and place as pretrained/selfpab.ckpt |
See .url files in pretrained/ for download links.
@inproceedings{harbench2026,
title={HARBench: A Comprehensive Benchmark for Evaluating Foundation Models in Sensor-based Human Activity Recognition},
author={Tanigaki, Kei and Maekawa, Takuya and Hara, Takahiro},
booktitle={2026 IEEE International Conference on Pervasive Computing and Communications (PerCom)},
year={2026}
}
14 commits
Python
99.9%