Abstract
Time-series classification (TSC) often suffers from a lack of labeled data and poor model interpretability. This paper introduces DiffShape (Diffusion Language-Shapelets), a semi-supervised framework that addresses these challenges by integrating diffusion models with contrastive language learning. By generating realistic shapelets grounded in semantic descriptions, DiffShape achieves state-of-the-art performance even with extremely limited labels, providing both high accuracy and human-understandable insights.
Introduction
Time-series classification is vital across domains like healthcare and industrial monitoring. However, two major hurdles persist: the high cost of expert labeling and the "black box" nature of deep learning models. Shapelets—small, discriminative subsequences—offer a path to interpretability, but traditional methods struggle in semi-supervised settings, often producing noisy, unrealistic patterns. DiffShape solves this by using diffusion models to ensure shapelet realism and language models to provide semantic anchoring.
Methods
DiffShape employs two core mechanisms to learn effective shapelets from sparse data:
1. Self-Supervised Diffusion Learning
Instead of treating shapelets as arbitrary weights, DiffShape generates them via a 1D U-Net diffusion process. The model searches unlabeled data for real subsequences similar to current shapelets and uses them as conditions. This ensures generated shapelets remain "on-manifold," resembling actual physical data patterns rather than mathematical artifacts.
2. Contrastive Language-Shapelets Learning
To enhance discriminative power, class labels are converted into natural language prompts (e.g., "This time series is walking on carpet"). Using a pre-trained T5 language encoder, the model aligns shapelet embeddings with these semantic descriptions via contrastive loss. This process leverages the common-sense knowledge of Large Language Models (LLMs) to distinguish statistically similar but semantically different classes.
Experimental Evaluation
The framework was evaluated on 106 datasets from the UCR Time Series Archive, covering robotics, medicine, and sensors. Testing focused on semi-supervised scenarios with 10%, 20%, and 40% labeling ratios, as well as extreme "data desert" cases with as few as 2 labels per class.
Results and Discussion
DiffShape consistently outperformed 10 major semi-supervised baselines. At a 10% labeling ratio, it achieved top accuracy on 51 out of 106 datasets. In extreme low-data regimes (2 labels/class), it maintained a significantly better average rank (1.42) compared to its closest competitor (2.92).
Qualitative analysis confirms that DiffShape produces more realistic shapelets. While traditional methods like LTS or ADSN often generate patterns that deviate significantly from the underlying data distribution, DiffShape's shapelets closely match ground-truth physical patterns. t-SNE visualizations further indicate that DiffShape produces tighter, more distinct clusters in the feature space compared to other state-of-the-art methods.
Limitations
While effective, the current approach focuses on univariate time series. Real-world applications often involve multivariate data, which adds complexity in how shapelets interact across dimensions. Additionally, the use of diffusion models introduces higher computational overhead during training compared to standard CNNs.
Conclusion
DiffShape demonstrates that diffusion models can act as powerful geometric regularizers for time-series features, while language alignment provides necessary semantic grounding. This combination allows for high-performance classification that remains interpretable to domain experts, bridging the gap between accuracy and clarity in semi-supervised learning.
Summary updated