Abstract
Time Series Motif Discovery (TSMD) is a fundamental task for identifying repeating patterns in temporal data, such as heartbeats in an ECG or exercise repetitions in wearable sensor data. However, traditional unsupervised TSMD methods often surface mathematically similar but semantically irrelevant noise. We introduce LoCoMotif-DoK, a highly expressive framework that allows users to inject domain knowledge via hard and soft constraints to steer the discovery process. By guiding the search space with expert-defined requirements, LoCoMotif-DoK dramatically improves the relevance and accuracy of discovered patterns across various real-world datasets.
Introduction
The primary challenge in TSMD is that algorithms often find "off-target" motifs. For instance, in an exercise dataset, an unsupervised algorithm might identify a pattern consisting of the end of one repetition and the beginning of the next, rather than the complete movement. While domain experts often possess specific knowledge about the target patterns—such as expected duration or the number of repetitions—existing TSMD techniques offer limited ways to incorporate this information. Most current methods rely on simple binary masks, which lack the expressiveness required for complex real-world constraints.
The LoCoMotif-DoK Framework
LoCoMotif-DoK formulates domain-guided TSMD as a constrained optimization problem. The framework supports two distinct categories of domain knowledge:
- Hard Constraints (Requirements): These are strict rules that a motif set must satisfy. Examples include minimum/maximum length, exact cardinality (number of occurrences), or non-overlapping requirements.
- Soft Constraints (Preferences): These are defined via desirability functions that score a motif set on a scale from 0 (undesirable) to 1 (perfectly desirable).
The algorithm operates in two main phases. First, it performs Candidate Generation using Local Concurrences (LoCo) to find similar time segments while allowing for dynamic time warping. Second, it performs Filtering and Scoring, where candidate sets violating hard constraints are discarded, and the remaining sets are ranked based on a combination of similarity fitness and soft constraint scores.
Experimental Evaluation
The authors evaluated LoCoMotif-DoK on a diverse set of data:
- Physiotherapy Data: 40 real-world accelerometer series of patients performing physical therapy exercises.
- TSMD Benchmark: A synthetic dataset with ground-truth motifs for quantitative assessment.
- Real-World Series: Five specialized datasets including ECG (heart activity), EOG (eye movement), and Seismology (earthquakes).
Results and Discussion
LoCoMotif-DoK demonstrated significant performance gains over the baseline LoCoMotif. In the physiotherapy use case, providing simple constraints regarding the expected number of repetitions and approximate length allowed the algorithm to perfectly isolate exercises, whereas the baseline often grouped irrelevant resting periods.
Key Insights
- Expressiveness vs. Masking: Simple start-time masking is insufficient for complex patterns. Combining constraints like cardinality and length range forces the algorithm to find semantic events rather than phase-shifted artifacts.
- Soft Constraints for Robustness: Strict hard constraints can be brittle in the presence of noise. Soft constraints (e.g., "prefer 10 repetitions but accept 9") yield higher F1-scores by allowing for real-world signal corruption.
- Anchoring Variable-Length Discovery: While dynamic time warping is powerful, it expands the search space significantly. Domain constraints act as a necessary anchor, making variable-length motif discovery practically viable by filtering out semantically meaningless warped segments.
Conclusion and Future Work
LoCoMotif-DoK successfully bridges the gap between unsupervised discovery and expert intuition. While highly effective, the authors note that applying strict length constraints after candidate generation can be computationally challenging. Future research will focus on integrating these constraints more natively into the time-warping calculations to further enhance efficiency and performance.
Summary updated