Table of Contents
Fetching ...

ShapeFormer: Shapelet Transformer for Multivariate Time Series Classification

Xuan-May Le, Ling Luo, Uwe Aickelin, Minh-Tuan Tran

TL;DR

ShapeFormer tackles multivariate time series classification by integrating class-specific discriminative features from shapelets with generic features learned via a CNN-guided transformer. It introduces Offline Shapelet Discovery based on perceptually important points and a Shapelet Filter that computes difference features between shapelets and their best-fit subsequences, enriching the representation with class-specific information. The architecture comprises a class-specific transformer and a generic transformer whose outputs are fused for final prediction, yielding state-of-the-art results on the UEA MTSC collection and demonstrating robustness on imbalanced data. The work highlights the value of combining class-aware structure with global patterns and provides a scalable pipeline and code for broader use and future extensions in time series analysis.

Abstract

Multivariate time series classification (MTSC) has attracted significant research attention due to its diverse real-world applications. Recently, exploiting transformers for MTSC has achieved state-of-the-art performance. However, existing methods focus on generic features, providing a comprehensive understanding of data, but they ignore class-specific features crucial for learning the representative characteristics of each class. This leads to poor performance in the case of imbalanced datasets or datasets with similar overall patterns but differing in minor class-specific details. In this paper, we propose a novel Shapelet Transformer (ShapeFormer), which comprises class-specific and generic transformer modules to capture both of these features. In the class-specific module, we introduce the discovery method to extract the discriminative subsequences of each class (i.e. shapelets) from the training set. We then propose a Shapelet Filter to learn the difference features between these shapelets and the input time series. We found that the difference feature for each shapelet contains important class-specific features, as it shows a significant distinction between its class and others. In the generic module, convolution filters are used to extract generic features that contain information to distinguish among all classes. For each module, we employ the transformer encoder to capture the correlation between their features. As a result, the combination of two transformer modules allows our model to exploit the power of both types of features, thereby enhancing the classification performance. Our experiments on 30 UEA MTSC datasets demonstrate that ShapeFormer has achieved the highest accuracy ranking compared to state-of-the-art methods. The code is available at https://github.com/xuanmay2701/shapeformer.

ShapeFormer: Shapelet Transformer for Multivariate Time Series Classification

TL;DR

ShapeFormer tackles multivariate time series classification by integrating class-specific discriminative features from shapelets with generic features learned via a CNN-guided transformer. It introduces Offline Shapelet Discovery based on perceptually important points and a Shapelet Filter that computes difference features between shapelets and their best-fit subsequences, enriching the representation with class-specific information. The architecture comprises a class-specific transformer and a generic transformer whose outputs are fused for final prediction, yielding state-of-the-art results on the UEA MTSC collection and demonstrating robustness on imbalanced data. The work highlights the value of combining class-aware structure with global patterns and provides a scalable pipeline and code for broader use and future extensions in time series analysis.

Abstract

Multivariate time series classification (MTSC) has attracted significant research attention due to its diverse real-world applications. Recently, exploiting transformers for MTSC has achieved state-of-the-art performance. However, existing methods focus on generic features, providing a comprehensive understanding of data, but they ignore class-specific features crucial for learning the representative characteristics of each class. This leads to poor performance in the case of imbalanced datasets or datasets with similar overall patterns but differing in minor class-specific details. In this paper, we propose a novel Shapelet Transformer (ShapeFormer), which comprises class-specific and generic transformer modules to capture both of these features. In the class-specific module, we introduce the discovery method to extract the discriminative subsequences of each class (i.e. shapelets) from the training set. We then propose a Shapelet Filter to learn the difference features between these shapelets and the input time series. We found that the difference feature for each shapelet contains important class-specific features, as it shows a significant distinction between its class and others. In the generic module, convolution filters are used to extract generic features that contain information to distinguish among all classes. For each module, we employ the transformer encoder to capture the correlation between their features. As a result, the combination of two transformer modules allows our model to exploit the power of both types of features, thereby enhancing the classification performance. Our experiments on 30 UEA MTSC datasets demonstrate that ShapeFormer has achieved the highest accuracy ranking compared to state-of-the-art methods. The code is available at https://github.com/xuanmay2701/shapeformer.
Paper Structure (24 sections, 12 equations, 13 figures, 5 tables, 1 algorithm)

This paper contains 24 sections, 12 equations, 13 figures, 5 tables, 1 algorithm.

Figures (13)

  • Figure 1: The illustration depicts the shapelet in the Atrial Fibrillation dataset. The best-fit subsequence is the subsequence with the sortest distance to the shapelet in the time series. It is clear that the shapelet can discriminate between classes by utilising their distance to the best-fit subsequences.
  • Figure 2: The separating hyperplane using (a) the generic feature has a higher overall accuracy, while the hyperplane using (b) the class-specific feature is better in classifying a single class.
  • Figure 3: The general architecture of ShapeFormer.
  • Figure 4: The process of Offline Shapelet Discovery.
  • Figure 5: The illustrations for: (a) best-fit subsequence finding method; (b) difference feature calculation method.
  • ...and 8 more figures