One Batch Is Enough: A Unified Dataset Condensation Framework for General Time Series Analysis
May 17, 2026 · View on GitHub
In this paper, we propose UniTSC, a unified dataset condensation framework for general time series analysis.
The framework of UniTSC consists of three stages: (i) Task-Adaptive Synthetic Initialization: We initialize latent parameters by utilizing task-adaptive priors. (ii) Multi-View Hybrid Encoder: A shared backbone extracts holistic representations by integrating temporal, spectral, and topological views. (iii) Tri-Space Alignment: We optimize by minimizing the divergence between student and expert models across parameter, frequency, and topology spaces, yielding the condensed dataset .
Extensive experiments show that UniTSC retains up to 97.9% of downstream performance using as little as 0.01% of the original training data, revealing that a single batch-equivalent budget ( 128 samples) is sufficient to capture the essential dynamics of complex time-series data.

Environment
- Python.version = 3.9.21
- PyTorch.version = 2.5.1
- Other dependencies are listed in
requirements.txt.
Datasets
We evaluate UniTSC on across four mainstream time-series tasks on 22 datasets, with detailed statistics summarized in the table below.
| Tasks | Datasets | Dim | Length | Train | Test | Information |
|---|---|---|---|---|---|---|
| Forecasting | ETTm1, ETTm2 | 7 | 96 | 34,369 | 11,425 | Electricity |
| ETTh1, ETTh2 | 7 | 96 | 8,449 | 2,785 | Electricity | |
| Weather | 21 | 96 | 36,696 | 10,444 | Weather | |
| Electricity | 321 | 96 | 18,221 | 5,165 | Electricity | |
| Traffic | 862 | 96 | 12,089 | 3,413 | Transportation | |
| Imputation | ETTm1, ETTm2 | 7 | 96 | 34,369 | 11,425 | Electricity |
| ETTh1, ETTh2 | 7 | 96 | 8,449 | 2,785 | Electricity | |
| Weather | 21 | 96 | 36,696 | 10,444 | Weather | |
| Electricity | 321 | 96 | 18,221 | 5,165 | Electricity | |
| Classification (UEA) | EthanolConcentration | 3 | 1751 | 261 | 263 | Alcohol |
| FaceDetection | 144 | 62 | 5890 | 3524 | Face | |
| Handwriting | 3 | 152 | 150 | 850 | Handwriting | |
| Heartbeat | 61 | 405 | 204 | 205 | Heart Beat | |
| JapaneseVowels | 12 | 29 | 270 | 370 | Voice | |
| PEMS-SF | 963 | 144 | 267 | 173 | Transport | |
| SelfRegulationSCP1 | 6 | 896 | 268 | 293 | Health | |
| SelfRegulationSCP2 | 7 | 1152 | 200 | 180 | Health | |
| SpokenArabicDigits | 13 | 93 | 6599 | 2199 | Voice | |
| UWaveGestureLibrary | 3 | 315 | 120 | 320 | Gesture | |
| Anomaly Detection | SMAP | 25 | 100 | 135,183 | 427,617 | Spacecraft |
| PSM | 25 | 100 | 132,481 | 87,841 | Server | |
| SMD | 38 | 100 | 708,405 | 708,420 | Server | |
| SWaT | 51 | 100 | 495,000 | 449,919 | Infrastructure | |
| MSL | 55 | 100 | 73,729 | 58,317 | Spacecraft |
Please refer to TSLib for the download links of each dataset.
Code Structure
UniTSC/
├── README.md # Official README
├── requirements.txt # pip dependency list for quick environment setup
├── run.py # Unified entry that parses args and dispatches tasks
├── framework.jpg # README figure
├── buffer_forecast.py # Forecasting experts training
├── buffer_imputation.py # Imputation experts training
├── buffer_cls.py # Classification experts training
├── buffer_ad.py # Anomaly detection experts training
├── distill_forecast.py # Forecasting dataset condensation
├── distill_imputation.py # Imputation dataset condensation
├── distill_cls.py # Classification dataset condensation
├── distill_ad.py # Anomaly detection dataset condensation
├── data_provider/ # Dataset loaders and splits
│ ├── data_factory.py # Chooses the proper DataLoader per task
│ ├── data_loader.py # Generic TS reader with sliding-window logic
│ └── uea.py # Parsers for UEA formats
├── models/ # All model implementations
│ ├── backbone.py # Main forecasting models
│ ├── layers.py # Reusable attention / conv / embedding blocks
│ └── embed.py # Shared primitives
├── tools/ # Utility toolbox
│ ├── augmentation.py # Augmentations for classification / detection
│ ├── data_generator.py # Task-adaptive synthetic initialization
│ ├── dtw.py # DTW calculator
│ ├── exp.py # Training utilities for four tasks
│ ├── masking.py # Imputation masking
│ ├── metrics.py # MSE / MAE / DTW and other metrics
│ ├── reparam_module.py # Reparameterizes modules
│ ├── timefeatures.py # Time feature generators
│ └── utils.py # General helpers such as EarlyStopping
├── scripts_buffer/ # Bash scripts for generate expert buffer
│ ├── forecast/ # Forecasting scripts
│ ├── imputation/ # Imputation scripts
│ ├── classification/ # Classification scripts
│ └── anomaly_detection/ # Anomaly detection scripts
└── scripts_distill/ # Bash scripts for dataset condensation
├── forecast/ # Forecasting scripts
├── imputation/ # Imputation scripts
├── classification/ # Classification scripts
└── anomaly_detection/ # Anomaly detection scripts
Quick Start
bash scripts_buffer/forecast/etth1.sh
bash scripts_distill/forecast/etth1.sh