TL;DR
Mantis is a lightweight, 8-million-parameter foundation model built specifically for time series classification rather than forecasting. Using a Vision Transformer (ViT) backbone and contrastive pre-training over 1.89 million series, Mantis outperforms models nearly 50× its size (such as the 385M-parameter MOMENT) across hundreds of benchmarks while exhibiting state-of-the-art confidence calibration out of the box.
What Problem Does This Paper Address?
While the machine learning community has seen a boom in time series foundation models (TSFMs), the vast majority prioritize forecasting or rely on general-purpose generative objectives (e.g., masked autoencoding or next-step prediction). These reconstruction-based objectives often fall short for classification, where learning discriminative, invariant representations between classes is crucial.
Moreover, existing models can be computationally prohibitive, scale poorly to high-dimensional multivariate data, and suffer from poor probability calibration—a serious roadblock for safety-critical domains such as healthcare and industrial fault detection.
Methods
Mantis adapts a Vision Transformer (ViT) architecture to time series by combining specialized token generation with contrastive pre-training:
- Token Generator Unit: Inputs are interpolated to a fixed length of 512 and normalized via instance-level standardization. The sequence is processed through three parallel streams to form 32 patch tokens (dimension 256):
- Raw Signal Features: Extracted via 1D convolution followed by mean pooling.
- First-Order Differential Features: A parallel 1D convolution and pooling path operating on the first difference ($\Delta x_t = x_t - x_{t-1}$) to capture trends and ensure stationarity.
- Statistical Encodings: Per-patch mean and standard deviation encoded using a Multi-Scaled Scalar Encoder.
- Backbone: A compact ViT with 6 transformer layers and 8 attention heads per layer (8M total parameters). A learnable
[CLS]token aggregates sequence-level representations. - Contrastive Pre-Training: Rather than masked reconstruction, Mantis is trained self-supervised using an InfoNCE-style contrastive loss with
RandomCropResizeaugmentations (cropping 0–20% of the series and resizing). - Channel Adapters for Multivariate Data: When handling multivariate series with many channels $d$, independent channel processing risks out-of-memory errors. The authors introduce plug-and-play channel adapters (unsupervised methods like PCA, SVD, and variance thresholding, as well as a learned Differentiable Linear Combiner) to project $d$ channels down to $d_{\text{new}} \le 10$ prior to encoding.
Datasets
- Pre-training: 1.89 million univariate time series spanning multiple public domains, including UCR, UEA (excluding benchmark test sets and two large datasets), ECG, EMG, Epilepsy, motor current signals (FD-A/FD-B), Gesture, HAR, and SleepEEG.
- Evaluation:
- 159-D Benchmark (Zero-shot): All 128 UCR univariate datasets, 27 multivariate UEA datasets (UEA-27), and 4 real-world sets (Blink, MotionSenseHAR, EMOPain, SharePriceIncrease).
- 131-D Benchmark (Fine-tuning & Calibration): 131 datasets selected from the above after filtering out sequences exceeding hardware memory constraints.
Key Insights and Ideas
- Model size $\neq$ Classification performance: Mantis (8M parameters) consistently beats MOMENT (385M parameters). Pre-training objectives aligned with classification (contrastive instance discrimination) produce far more transferable representations than large-scale autoencoding.
- Differencing matters in tokenization: Explicitly feeding first-order differences alongside raw patches visibly boosts zero-shot accuracy by isolating high-frequency transients and local trends from absolute baseline shifts.
- Inherent Calibration: Modern deep neural networks frequently produce overconfident, miscalibrated probabilities. Mantis displays significantly lower Expected Calibration Error (ECE) before any post-hoc adjustments, remaining superior even after applying temperature scaling or isotonic regression.
- Simple adapters solve channel explosion: Treating multivariate series as independent channels causes GPU out-of-memory errors on datasets with $\ge 28$ channels. Standard dimensionality reduction (PCA/SVD) across channels before encoding completely avoids OOM errors and often enhances accuracy by reducing noise.
Key Results
- Zero-Shot Feature Extraction (159 Datasets): Mantis embeddings trained with a Random Forest classifier achieved 78.16% average accuracy, outperforming MOMENT (76.63%) and NuTime (76.39%). Mantis achieved the highest score on 74 of the 159 datasets.
- Full Fine-Tuning (131 Datasets): Fine-tuned Mantis reached 84.08% accuracy, surpassing all competitors: UniTS (72.01%), GPT4TS (72.05%), MOMENT (79.24%), and NuTime (82.24%).
- Uncertainty Calibration: Uncalibrated Mantis attained an Expected Calibration Error (ECE) of 0.1131, compared to 0.1297 for MOMENT and 0.1743 for NuTime. Post-hoc temperature scaling further brought Mantis’s ECE down to 0.0673 (lowest across all baselines).
- Multivariate Scaling: Applying variance-based channel selection or PCA enabled full fine-tuning on previously intractable benchmarks like DuckDuckGeese (1345 channels) and PEMS-SF (963 channels), achieving competitive scores where standard fine-tuning failed due to memory exhaustion.
Limitations and Future Work
- Zero-Shot vs. Fine-Tuning Gap: A noticeable performance gap remains between zero-shot frozen extraction (78.16%) and full fine-tuning (84.08%), indicating that truly general zero-shot classification in time series is still an open challenge.
- Learned vs. Classical Adapters: The supervised, differentiable linear adapter (
LComb) underperformed simpler, unsupervised methods like PCA and variance-based selection, likely due to optimization instability during joint fine-tuning. - Future Directions: Exploring whether the geometry of Mantis’s contrastive latent space can be leveraged for unsupervised out-of-distribution detection, performance estimation, and interpretability.
Summary updated