# MSPT **Repository Path**: btbuvislab/mspt ## Basic Information - **Project Name**: MSPT - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-16 - **Last Updated**: 2025-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # **MSPT: A Framework of the Multi-Scale Patch Decomposition Transformer and Visual Analytics for Enhancing Time Series Forecasting This is the [PyTorch](https://pytorch.org/) and [Lightning](https://lightning.ai/) implementation of our paper: ***MSPT: A Framework of the Multi-Scale Patch Decomposition Transformer and Visual Analytics for Enhancing Time Series Forecasting***. ## Abstract Transformer-based models have shown strong performance in time series forecasting, but often struggle to capture temporal patterns at multiple scales and lack interpretability. We propose the Multi-Scale Patch Decomposition Transformer (MSPT), a framework that integrates a forecasting model and a visual analytics system. The MSPT model introduces a multi-scale temporal patching mechanism into the Transformer architecture, enabling the decomposition of time series into scale-specific components. It combines intra-patch, inter-patch, and inter-channel attention to capture rich temporal dependencies and improve forecasting accuracy. To support interpretability, we develop MSPT-vis, a visual analytics system that reveals attention distributions, patching effects, and prediction errors. Qualitative evaluations on real-world datasets demonstrate its utility for analyzing model behavior and guiding parameter configuration. Extensive experiments on six public datasets show that MSPT outperforms three state-of-the-art baselines. The whole framework is available at: \url{https://gitee.com/btbuvislab/mspt}. ## Dependency Setup * Create a conda virtual environment ```bash conda create -n MSPT python=3.10 conda activate MSPT ``` * Install Python Packages ```bash pip install -r requirements.txt ``` ## Run MSPT Please use `python main.py` to run the experiments. Please use the `-h` or `--help` argument for details. Example training commands: * Run all benchmarks ```bash python main.py ltf # equivalent python main.py ltf --dataset all --pred_len all ``` * Run specific benchmarks ```bash python main.py ltf --dataset etth1 etth2 --pred_len 96 192 336 If you find this repo useful, please consider citing our paper: ``` @article{Hao2025MSPT, title={MSPT: A Framework of the Multi-Scale Patch Decomposition Transformer and Visual Analytics for Enhancing Time Series Forecasting}, author={Jinlong Hao, Yi Chen, Cheng LV, Xianpeng Yuan, Haomiao Wang, Qinghui Zhang, Yu Dong}, year={2025} } ```