KDiscShapeNet: A Structure-Aware Time Series Clustering Model with Supervised Contrastive Learning
Xi Chen, Yufan Jiang, Yingming Zhang, Chunhe Song · Mathematics · 2025
Time series clustering plays a vital role in various analytical and pattern recognition tasks by partitioning structurally similar sequences into semantically coherent groups, thereby facilitating downstream analysis. However, building high-quality clustering models remains challenging due to three key issues: (i) capturing dynamic shape variations across sequences, (ii) ensuring discriminative cluster structures, and (iii) enabling end-to-end optimization. To address these challenges, we propose KDiscShapeNet, a structure-aware clustering framework that systematically extends the classical k-Shape model. First, to enhance temporal structure modeling, we adopt Kolmogorov–Arnold Networks (KAN) as the encoder, which leverages high-order functional representations to effectively capture elastic distortions and multi-scale shape features of time series. Second, to improve intra-cluster compactness and inter-cluster separability, we incorporate a dual-loss constraint by combining Center Loss and Supervised Contrastive Loss, thus enhancing the discriminative structure of the embedding space. Third, to overcome the non-differentiability of traditional K-Shape clustering, we introduce Differentiable k-Shape, embedding the normalized cross-correlation (NCC) metric into a differentiable framework that enables joint training of the encoder and the clustering module. We evaluate KDiscShapeNet on nine benchmark datasets from the UCR Archive and the ETT suite, spanning healthcare, industrial monitoring, energy forecasting, and astronomy. On the Trace dataset, it achieves an ARI of 0.916, NMI of 0.927, and Silhouette score of 0.931; on the large-scale ETTh1 dataset, it improves ARI by 5.8% and NMI by 17.4% over the best baseline. Statistical tests confirm the significance of these improvements (p < 0.01). Overall, the results highlight the robustness and practical utility of KDiscShapeNet, offering a novel and interpretable framework for time series clustering.