TL;DR
This paper introduces a novel approach to Human Activity Recognition (HAR) that bypasses complex feature engineering by using Dynamic Time Warping (DTW) for template selection and classification. Their method achieves comparable or better accuracy than traditional feature-based methods, particularly in noisy conditions and for new subjects, while requiring less domain expertise.
What Problem Does This Paper Address?
Human Activity Recognition (HAR) using sensor data, especially from smartphones, is a growing area with applications in health monitoring and human-computer interaction. Existing methods often rely on extracting intricate features from sensor data (like accelerometers and gyroscopes) to achieve high classification accuracy. However, this process is computationally intensive, requires significant domain expertise to select the right features, and can lead to high-dimensional data. The authors aim to develop a more efficient and accessible HAR method that avoids this complex feature engineering.
Methods
The core of the proposed method lies in a modified Dynamic Time Warping (DTW) algorithm and a template-based classification strategy.
- Modified DTW (DTWsubseq): The standard DTW can struggle with time series that are horizontally displaced. The authors introduce
DTWsubseq(subsequence DTW) which relaxes the strict boundary conditions of DTW, allowing it to better match time series with similar shapes but different starting/ending points. This is achieved by considering all possible displacements within a defined window (dw). They also incorporate a bandwidth parameter (bw) for computational efficiency, similar to FastDTW. - Template Selection and Classification: Instead of extracting features, the approach uses the training data to build "templates" representing each activity.
- Clustering: Hierarchical clustering is used to group similar time series within each activity. A
cutparameter controls the granularity of clustering. - Template Generation: Two methods are explored for creating templates from clusters:
- DTW Pointwise Averaging (DPA): Finds a central point in a cluster and aligns other series to it before averaging.
- DTW Barycenter Averaging (DBA): A more global method that iteratively averages series to minimize the sum of squared DTW distances.
- Classification: Test data is classified by computing its
DTWsubseqDdistance to each generated template. This distance vector then serves as a feature vector, which is optionally processed by PCA and classified using an SVM.
Datasets
- UCI HAR Dataset: A publicly available dataset containing 10,299 samples from 30 subjects performing six activities (walking, walking upstairs, walking downstairs, sitting, standing, lying). Data is collected from accelerometers and gyroscopes. The dataset was preprocessed and sampled into fixed-width sliding windows.
- Synthetic Data: A custom dataset generated to simulate noisy sensor data and test the algorithm's ability to generalize to new subjects. It involves adding controlled noise to templates derived from the UCI HAR dataset.
Key Insights and Ideas
- DTW as a Similarity Measure is Powerful: The paper demonstrates that DTW, especially its subsequence variant, can effectively capture time series similarity without explicit feature engineering.
- Template-Based Approach Reduces Domain Expertise: By learning representative templates directly from data, the need for manual feature selection based on domain knowledge is significantly reduced.
- DTWsubseq Handles Temporal Shifts Better: The modification to DTW is crucial for handling variations in the speed or timing of activities, which are common in real-world sensor data.
- Clustering Granularity Matters: Lowering the
cutthreshold in hierarchical clustering (leading to more clusters/templates) generally improves accuracy, though it can lead to overfitting. - DBA vs. DPA Nuances: While DBA is theoretically more robust, in practice, DPA often performed comparably or better, especially in the presence of noise, possibly due to its initialization strategy.
Key Results
- UCI HAR Dataset: The best performance achieved was 0.860 accuracy using DTW-DBA with a
cutof 0.25. When combining static activities, accuracy reached 0.977. This is comparable to feature extraction methods (0.890 raw, 0.965 combined). - Synthetic Data: The proposed method, particularly DTWsubseq-DPA with
cut= 0.25, achieved 0.700 accuracy, outperforming feature extraction (0.67). This highlights its robustness to noise and generalization capabilities. - Computational Efficiency: The use of FastDTW and bandwidth parameters helps manage the computational cost of DTW. The number of templates generated (e.g., ~220 with
cut=0.25) was significantly less than the number of features used by traditional methods (e.g., 568).
Limitations and Future Work
- Flat Curves in Static Activities: The authors note that flat curves in static activities in the UCI HAR dataset were difficult to remove completely and contributed to classification errors.
- Overfitting with More Templates: While lowering the
cutthreshold increases accuracy, it can lead to overfitting, especially with a large number of templates. - Future Work:
- Modifying DTW to learn more complex activities.
- Cross-validating parameters like
cutandbwfor optimal prediction accuracy. - Removing redundant templates and limiting overfitting.
- Creating more sophisticated synthetic data.
- Applying the algorithm to other domains beyond HAR.
Summary updated