Dynamic Multi-Scale Convolutional Neural Network for Time Series Classification

Bin Qian, Yong Xiao, Zhenjing Zheng, Mi Zhou, Wanqing Zhuang, Sen Li, Qianli Ma

Standard Convolutional Neural Networks (CNNs) are limited by fixed-length filters that cannot adapt to patterns occurring at varying time scales. This paper presents the Dynamic Multi-Scale CNN (DMS-CNN), a novel architecture that employs a learnable soft-masking mechanism to generate sample-specific, variable-length filters. Evaluated on 85 datasets from the UCR Time Series Classification Archive, DMS-CNN demonstrates superior performance over traditional and deep learning baselines by effectively capturing multi-scale temporal features.

The Challenge of Fixed Scales in Time Series

Time Series Classification (TSC) is a fundamental task in data science, with applications ranging from medical monitoring to industrial sensor analysis. While CNNs have become a preferred tool for TSC due to their ability to learn local features, they typically rely on filters of a fixed, pre-defined length. This "one size fits all" approach is problematic because discriminative patterns in time series data often manifest at different scales—both across different datasets and even between samples within the same class.

Examples of time series patterns from different classes and samples, illustrating the need for multi-scale feature extraction.

As shown in the figure above, patterns can vary significantly in duration and position. A fixed-length filter might be too long to capture a sharp spike or too short to encompass a broad wave, leading to suboptimal feature representation. Standard practice often requires manual tuning of filter sizes for every new dataset, which is inefficient and lacks flexibility.

The DMS-CNN Architecture

To address this limitation, the authors propose the DMS-CNN. The core innovation is the Variable-Length Filters Generator, which adapts filter lengths dynamically for each individual input sample. The architecture follows a multi-step process:

  1. Embedding: The input time series is transformed into a latent representation.
  2. Length Prediction: A mask generator sub-network predicts an optimal length for each filter based on the sample embedding.
  3. Soft Masking: To maintain end-to-end differentiability, a sigmoid-based "soft mask" is applied to the filter weights. This mask effectively truncates the filter to the predicted length without interrupting the gradient flow during training.
  4. Dynamic Convolution: These custom-length filters are convolved with the input to extract features.
  5. Max-over-time Pooling: This layer selects the most salient features regardless of their exact temporal location, ensuring invariance to pattern shifts.

Evaluation on the UCR Archive

The DMS-CNN was rigorously tested on the UCR Time Series Classification Archive, a comprehensive benchmark of 85 datasets. These datasets cover diverse domains, including medical recordings (ECG/EEG), motion sensors, electricity usage, and image-derived outlines.

The results indicate that DMS-CNN is highly competitive:

  • Superiority over Traditional Methods: It outperformed 12 traditional TSC algorithms, including the robust 1-Nearest Neighbor with Dynamic Time Warping (1NN-DTW).
  • Competitive with Deep Learning: It achieved an average rank of 2.653 when compared against state-of-the-art deep learning models like ResNet and Fully Convolutional Networks (FCN).
  • Consistency: The model secured the "best" performance on 24 datasets against traditional methods and 25 datasets against deep learning baselines—more than any other single model in the study.

Discussion and Future Work

A key insight from this research is the importance of sample-specific adaptation. By allowing the network to "choose" its filter scales on the fly, DMS-CNN handles intra-class variations where patterns may be temporally stretched or compressed. Visualization of the learned filters revealed that the model naturally aligns its scales with meaningful physical or biological components of signals, such as specific waves in an ECG, without explicit supervision.

Despite its success, the model currently focuses on univariate time series. Future work will explore extending this dynamic scaling mechanism to multivariate data. Additionally, addressing the increased computational overhead of generating per-sample masks remains an area for optimization. In summary, DMS-CNN represents a significant step forward in making CNNs more flexible and effective for the complexities of real-world time series data.

Summary updated

BibTeX
@article{qian2020dynamic,
  author = {Bin Qian and Yong Xiao and Zhenjing Zheng and Mi Zhou and Wanqing Zhuang and Sen Li and Qianli Ma},
  title = {{Dynamic Multi-Scale Convolutional Neural Network for Time Series Classification}},
  journal = {IEEE Access},
  year = {2020},
  doi = {10.1109/access.2020.3002095},
}
Figure