Using unlabeled data in a sparse-coding framework for human activity recognition

Sourav Bhattacharya, Petteri Nurmi, Nils Y. Hammerla, Thomas Plötz

This paper presents a robust approach to Human Activity Recognition (HAR) that tackles the "data bottleneck" in mobile computing: the high cost of labeling sensor data and the brittleness of manually designed features. By leveraging unsupervised sparse coding, the authors demonstrate how to turn vast amounts of easily collected, unlabeled sensor data into a powerful tool for recognizing complex human behaviors.

TL;DR

The authors propose a sparse-coding framework that automatically learns feature representations from unlabeled sensor data, drastically reducing the need for manual feature engineering and expensive data labeling. Their approach outperforms state-of-the-art supervised methods and generalizes effectively across different users, activities, and sensor types.

What Problem Does This Paper Address?

Most Human Activity Recognition (HAR) systems rely on supervised learning, which has two major pain points:

  1. Feature Engineering: Researchers must manually "hand-craft" features (like calculating the mean, variance, or frequency peaks of accelerometer data). These features often fail to generalize across different activities or sensor placements.
  2. The Labeling Burden: Training these systems requires "ground truth" labels (e.g., a user marking exactly when they started walking or boarded a bus). Asking users to do this in real-time is intrusive, prone to error, and results in very small datasets.

The authors aim to move toward self-taught learning, where a system can "learn how to represent movement" by looking at hours of unlabeled data, and then use a tiny sliver of labeled data to actually learn the names of those movements.

Methods

The framework operates in two distinct phases, as illustrated in the overview below:

Overview of the sparse-coding framework showing the unsupervised learning of a codebook (a) followed by classifier training using sparse activations (b).
  • Phase 1: Unsupervised Codebook Learning. The system takes raw, unlabeled sensor streams and learns a "codebook" of basis vectors. These vectors represent fundamental primitives of human motion. The authors use a fast iterative algorithm to ensure this codebook is "over-complete," meaning it has more basis vectors than the input dimensions, allowing it to capture complex, high-order patterns that linear methods like PCA miss.
  • Codebook Selection: To keep the system efficient, they use hierarchical clustering to group similar basis vectors (like time-shifted versions of the same movement) and prune the less informative ones using an information-theoretic criterion.
Dendrogram used for codebook selection to reduce redundancy among basis vectors.
  • Phase 2: Feature Extraction and Classification. Once the codebook is ready, labeled data is projected onto it. This results in sparse activations—a feature vector where most entries are zero, highlighting only the specific basis vectors that "match" the current movement. These sparse features are then fed into a standard classifier (like an SVM).

Datasets

The authors evaluated their framework on two distinct challenges:

  1. Transportation Mode Analysis (TMA): A dataset they collected consisting of ~6 hours of accelerometer data from three users carrying smartphones in various locations (pocket, backpack). It covers six modes: still, walking, bus, train, metro, and tram.
  2. Opportunity Dataset: A well-known benchmark for "Activities of Daily Living" (ADL). This allowed them to test how well the framework generalizes to gesture recognition using both accelerometers and gyroscopes.

Key Insights and Ideas

  • Movement Primitives are Universal: The core "aha moment" is that while "taking a bus" and "walking" are different activities, they share underlying movement patterns. By learning these patterns from any unlabeled data, the model builds a robust vocabulary for describing all activities.
  • Neutralizing Bias: Traditional unsupervised methods like PCA are "blind" and get dominated by high-variance activities (like walking), often ignoring subtler, more informative signals. Sparse coding is much better at neutralizing these biases, leading to better recognition of "rare" or low-variance activities.
  • Extreme Data Efficiency: The framework is remarkably "sample efficient." It can achieve high accuracy with just a few minutes of labeled data, whereas traditional methods require hours of carefully annotated recordings to reach the same level.

Key Results

  • Superior Accuracy: On the transportation task, the sparse-coding framework achieved a 79.9% $F_1$-score, significantly outperforming handcrafted features (67.9%) and PCA-based learning (65.5%).
  • Robustness to Minimal Labels: When using only 2% of the available labeled data (roughly 3 minutes of recording), the system still achieved a 75.1% $F_1$-score, which is better than what the baseline supervised methods achieved with much more data.
  • Cross-Modal Success: On the Opportunity dataset, the method outperformed state-of-the-art feature engineering across different sensor combinations, proving it isn't just limited to accelerometers.
  • Real-time Feasibility: Feature extraction for 1,000 frames takes less than 200ms on a standard PC, suggesting that once the codebook is learned (off-device), the system can run efficiently on modern smartphones.

Limitations and Future Work

  • Computational Cost of Learning: While using the codebook is fast, learning it is computationally heavy. The authors suggest this part should happen on a server or in the cloud rather than on the mobile device itself.
  • Open-Set Challenges: While the system generalizes well, its performance dips slightly when encountering "extraneous" activities (like running or biking) that weren't represented at all in the unlabeled training set.
  • Future Directions: The authors suggest exploring how this framework could adapt to changing sensor orientations or "drifting" sensor data over long-term deployments.

Summary updated

BibTeX
@article{bhattacharya2014using,
  author = {Sourav Bhattacharya and Petteri Nurmi and Nils Y. Hammerla and Thomas Plötz},
  title = {{Using unlabeled data in a sparse-coding framework for human activity recognition}},
  journal = {Pervasive Mob. Comput.},
  year = {2014},
  doi = {10.1016/j.pmcj.2014.05.006},
}
Figure