Table of Contents
Fetching ...

A Unified Shape-Aware Foundation Model for Time Series Classification

Zhen Liu, Yucheng Wang, Boyuan Li, Junhao Zheng, Emadeldeen Eldele, Min Wu, Qianli Ma

TL;DR

UniShape introduces a unified shape-aware foundation model for time series classification that jointly learns multi-scale, interpretable shapelet representations through a shape-aware adapter and a prototype-based pretraining module. It pretrains on a large-scale, multi-domain corpus (~1.89 million samples) to capture transferable shape patterns, then fine-tunes on diverse target domains. Empirical results across 158 datasets (128 UCR plus 30 cross-domain) show state-of-the-art accuracy and strong zero-shot generalization, supported by interpretability analyses and comprehensive ablations. The approach advances TSC by combining scalable shape-aware representation learning with prototype-guided pretraining to improve transferability and interpretability across domains.

Abstract

Foundation models pre-trained on large-scale source datasets are reshaping the traditional training paradigm for time series classification. However, existing time series foundation models primarily focus on forecasting tasks and often overlook classification-specific challenges, such as modeling interpretable shapelets that capture class-discriminative temporal features. To bridge this gap, we propose UniShape, a unified shape-aware foundation model designed for time series classification. UniShape incorporates a shape-aware adapter that adaptively aggregates multiscale discriminative subsequences (shapes) into class tokens, effectively selecting the most relevant subsequence scales to enhance model interpretability. Meanwhile, a prototype-based pretraining module is introduced to jointly learn instance- and shape-level representations, enabling the capture of transferable shape patterns. Pre-trained on a large-scale multi-domain time series dataset comprising 1.89 million samples, UniShape exhibits superior generalization across diverse target domains. Experiments on 128 UCR datasets and 30 additional time series datasets demonstrate that UniShape achieves state-of-the-art classification performance, with interpretability and ablation analyses further validating its effectiveness.

A Unified Shape-Aware Foundation Model for Time Series Classification

TL;DR

UniShape introduces a unified shape-aware foundation model for time series classification that jointly learns multi-scale, interpretable shapelet representations through a shape-aware adapter and a prototype-based pretraining module. It pretrains on a large-scale, multi-domain corpus (~1.89 million samples) to capture transferable shape patterns, then fine-tunes on diverse target domains. Empirical results across 158 datasets (128 UCR plus 30 cross-domain) show state-of-the-art accuracy and strong zero-shot generalization, supported by interpretability analyses and comprehensive ablations. The approach advances TSC by combining scalable shape-aware representation learning with prototype-guided pretraining to improve transferability and interpretability across domains.

Abstract

Foundation models pre-trained on large-scale source datasets are reshaping the traditional training paradigm for time series classification. However, existing time series foundation models primarily focus on forecasting tasks and often overlook classification-specific challenges, such as modeling interpretable shapelets that capture class-discriminative temporal features. To bridge this gap, we propose UniShape, a unified shape-aware foundation model designed for time series classification. UniShape incorporates a shape-aware adapter that adaptively aggregates multiscale discriminative subsequences (shapes) into class tokens, effectively selecting the most relevant subsequence scales to enhance model interpretability. Meanwhile, a prototype-based pretraining module is introduced to jointly learn instance- and shape-level representations, enabling the capture of transferable shape patterns. Pre-trained on a large-scale multi-domain time series dataset comprising 1.89 million samples, UniShape exhibits superior generalization across diverse target domains. Experiments on 128 UCR datasets and 30 additional time series datasets demonstrate that UniShape achieves state-of-the-art classification performance, with interpretability and ablation analyses further validating its effectiveness.
Paper Structure (28 sections, 13 equations, 4 figures, 4 tables)

This paper contains 28 sections, 13 equations, 4 figures, 4 tables.

Figures (4)

  • Figure 1: Illustration of the unified shape-aware classifier trained across multiple domains. Red lines represent shapelets extracted from the ECG5000, Chinatown, HouseTwenty, and CricketX datasets, corresponding to four distinct domains in the UCR time series archive dau2019ucr.
  • Figure 2: The overall architecture of the UniShape framework. UniShape comprises two core modules: ① a shape-aware adapter that takes variable-length subsequences $[\mathcal{S}^{(q)}]_{q=1}^{Q}$ as input and applies attention pooling to fuse discriminative patterns into class tokens; and ② a prototype-based pretraining module that jointly uses instance-prototype and shape-prototype contrastive learning to optimize prototype representations $\{\mathbf{p}_c\}_{c=1}^{C}$ based on instance-level class tokens and subsequence-level shape tokens.
  • Figure 3: Results comparison on 18 UCR datasets with different numbers of pretraining samples. Win denotes the number of datasets where the method performs best.
  • Figure 4: Visualization of attention scores learned by the shape-aware adapter across different shape lengths. Darker red denotes higher attention, highlighting discriminative regions for the target class, while darker blue indicates lower attention and reduced relevance to target features.