Classical Machine Learning Approach for Human Activity Recognition Using Location Data
UbiComp/ISWC '21 Adjunct: Adjunct Proceedings of the 2021 ACM International Joint Conference on Pervasive and Ubiquitous Computing and the 2021 ACM International Symposium on Wearable Computers
TL;DR
Can a phone tell whether you are walking, cycling, or on a train from location data alone? A carefully engineered classical pipeline gets close to 80%.
- 78.14%validation accuracy
- 78.28%weighted F1 score
- 8locomotion and transportation modes
- 11thplace in the SHL Challenge 2021

Abstract
The Sussex-Huawei Locomotion-Transportation (SHL) recognition Challenge 2021 was a competition to classify 8 different activities and modes of locomotion performed by three individual users. There were four different modalities of data (Location, GPS, WiFi, and Cells) which were recorded from the phones of the users in their hip position. The train set came from user-1 and the validation set and test set were from user-2 and user-3. Our team 'GPU Kaj Kore Na' used only location modality to give our predictions in test set of this year's competition as location data was giving more accurate predictions and the rest of the modalities were too noisy as well as not contributing much to increase the accuracy. In our method, we used statistical feature set for feature extraction and Random Forest classifier to give prediction. We got validation accuracy of 78.138% and a weighted F1 score of 78.28% on the SHL Validation Set 2021.
The challenge
SHL Recognition Challenge 2021
The task was to recognize eight modes of locomotion and transportation, namely Still, Walking, Run, Bike, Car, Bus, Train and Subway, using only radio data from a phone carried at the hip. That data included GPS reception, GPS location, WiFi scans and GSM cell-tower scans.
- Cross-user split. Training data came from one user over 59 days, and validation and test data from two different users.
- Messy sensing. Sensors were sampled asynchronously at roughly 1 Hz, often dropped out, and some test timestamps had no sensor data at all.
- Class imbalance. Some activities, such as Run, had very few training examples.
Method
Clean, window, featurize, classify
- Label matchingEach sensor reading at time \(s\) takes the label of the label-file timestamp \(t\) with \(t \le s < t+1\). Unmatched readings are dropped.
- Motion featuresHaversine distance and average speed between consecutive location fixes turn raw coordinates into movement.
- Windowed statisticsWindows of 30 samples with no overlap yield 14 statistics per signal, from min, max and variance to autocorrelation and mean-crossing rate.
- Classify and fill gapsA 300-tree random forest predicts each window. Timestamps without location data are filled by interpolation.
Here \(\alpha\) and \(\beta\) are latitude and longitude in radians.
Results
Validation accuracy by modality
| Modality | Accuracy |
|---|---|
| WiFi | 30.99% |
| GPS | 32.97% |
| GPS + Location | 75.56% |
| Location | 78.14% |
Location alone was the strongest signal. Adding GPS made it slightly worse, and WiFi and GPS on their own were too noisy to help, so the final submission used location data only.

Takeaways
Class imbalance biased the model toward frequent activities, and up-sampling did not fix it. Richer, more general features from the WiFi, cell and GPS streams, or a deep-learning model, could improve recognition of the rare classes further.
Citation
@inproceedings{arib2021classical,
title = {Classical Machine Learning Approach for Human Activity Recognition Using Location Data},
author = {Arib, Safaeid Hossain and Akter, Rabeya and Shahid, Omar and Ahad, Md Atiqur Rahman},
booktitle = {Adjunct Proceedings of the 2021 ACM International Joint Conference on Pervasive and
Ubiquitous Computing and Proceedings of the 2021 ACM International Symposium on
Wearable Computers},
year = {2021},
doi = {10.1145/3460418.3479376}
}