README.md

May 15, 2026 ยท View on GitHub

[ICLR 2026] PaAno: Patch-based Representation Learning for Time-Series Anomaly Detection

This repository is the official Pytorch implementation code of our "PaAno: Patch-based Representation Learning for Time-Series Anomaly Detection - Jinju Park, Seokho Kang". PaAno is a simple yet effective representation-based method for fast and efficient time-series anomaly detection. Our paper is available here: [Paper Link]

๐ŸŽ‰ [2026.1] PaAno has been accepted in ICLR 2026!

๐Ÿ› ๏ธ [2026.5] We made minor implementation refinements to align this repo with the final paper.


Abstract

Although recent studies on time-series anomaly detection have increasingly adopted ever-larger neural network architectures such as transformers and foundation models, they incur high computational costs and memory usage, making them impractical for real-time and resource-constrained scenarios. Moreover, they often fail to demonstrate significant performance gains over simpler methods under rigorous evaluation protocols. In this study, we propose Patch-based representation learning for time-series Anomaly detection (PaAno), a lightweight yet effective method for fast and efficient time-series anomaly detection. PaAno extracts short temporal patches from time-series training data and uses a 1D convolutional neural network to embed each patch into a vector representation. The model is trained using a combination of triplet loss and pretext loss to ensure the embeddings capture informative temporal patterns from input patches. During inference, the anomaly score at each time step is computed by comparing the embeddings of its surrounding patches to those of normal patches extracted from the training time-series. Evaluated on the TSB-AD benchmark, PaAno achieved state-of-the-art performance, significantly outperforming existing methods, including those based on heavy architectures, on both univariate and multivariate time-series anomaly detection across various range-wise and point-wise performance measures.


Installation

Clone the repository and set up the environment as follows:

# Make conda environment
conda create -n PaAno python=3.11 -y
conda activate PaAno

# Install dependencies
pip install -r requirements.txt

Quick Start

We provide a shell script for convenient execution. Once dependencies are installed, simply run:

# Univariate time-series anomaly detection
bash script/run_uni.sh

or

# Multivariate time-series anomaly detection
bash script/run_mul.sh

This will launch PaAno with the default configuration. Sample data from the TSB-AD benchmark are included in the data/ directory for quick and easy start.


Dataset

Please download data from https://github.com/thedatumorg/TSB-AD and move to data/.


Project Structure

PaAno/
โ”œโ”€โ”€ affiliation/                 
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ affiliation_zone.py
โ”‚   โ”œโ”€โ”€ integral_interval.py
โ”‚   โ”œโ”€โ”€ single_ground_truth_event.py
โ”‚   โ”œโ”€โ”€ generics.py
โ”‚   โ””โ”€โ”€ metrics.py
โ”‚
โ”œโ”€โ”€ assets/   # for README.md                  
โ”‚   โ”œโ”€โ”€ mul_results.png
โ”‚   โ”œโ”€โ”€ qualitative_results.png
โ”‚   โ””โ”€โ”€ train.png 
โ”‚   โ””โ”€โ”€ uni_results.png
โ”‚
โ”œโ”€โ”€ data/                       
โ”‚   โ”œโ”€โ”€ TSB-AD-M/               
โ”‚   โ””โ”€โ”€ TSB-AD-U/                
โ”‚
โ”œโ”€โ”€ script/                     
โ”‚   โ”œโ”€โ”€ run_mul.sh               
โ”‚   โ””โ”€โ”€ run_uni.sh               
โ”‚
โ”œโ”€โ”€ utils/                       
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ basic_metrics.py         
โ”‚   โ”œโ”€โ”€ data_preprocess.py       
โ”‚   โ”œโ”€โ”€ evaluation.py            
โ”‚   โ”œโ”€โ”€ metrics.py               
โ”‚   โ””โ”€โ”€ utils.py                 
โ”‚
โ”œโ”€โ”€ main.py                      
โ”œโ”€โ”€ model.py                     
โ”œโ”€โ”€ train.py                    
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ requirements.txt


Results

PaAno consistently outperforms 39 baseline methods on the TSB-AD benchmark for univariate time-series anomaly detection.

PaAno also robustly outperforms 31 baseline methods on the TSB-AD benchmark for multivariate time-series anomaly detection.

Furthermore, PaAno is shown to be effective in capturing various types of anomalies and yields stable performance across all six evaluation metrics compared with the five strong recent methods.


Citation

If you think our repo is useful, please cite our paper:

@inproceedings{park2026paano,
  title={PaAno: Patch-based Representation Learning for Time-Series Anomaly Detection},
  author={Park, Jinju and Kang, Seokho},
  booktitle={Proceedings of International Conference on Learning Representations},
  year={2026}
}

Acknowledgement

We sincerely appreciate the following GitHub repositories for their valuable contributions:

https://github.com/TheDatumOrg/TSB-AD

https://github.com/thuml/Time-Series-Library

https://github.com/decisionintelligence/CATCH

https://github.com/iambowen/DADA.git

https://github.com/issaccv/KAN-AD