Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRISM: Powerful Time Series to Image (TS2I) Representations for Multivariate Anomaly Detection

How to run the experiments?

This repository contains the code and artifacts required to reproduce the experimental results reported in the paper, following IJCAI reproducibility guidelines.


Preliminaries

Requirements

  • Python >= 3.10 (used version: 3.10.13)
  • uv for environment management

Environment setup

The experimental environment is managed using uv.

uv installation guidelines: https://docs.astral.sh/uv/getting-started/installation/

uv python install 3.10.13
uv python list
uv venv --python 3.10.13
source .venv/bin/activate
python -V
uv run python -m ensurepip --upgrade
uv sync
uv tool install ruff

All dependencies required to run the experiments are specified in pyproject.toml.


Datasets

Data source

All datasets used in this work are taken from the TSB-AD benchmark, which is publicly available:

No new datasets are introduced in this repository.

Dataset structure

This work uses the TSB-AD-M (multivariate) datasets. The internal structure of the datasets is preserved exactly as in the original benchmark repository.

The expected local directory layout is:

data/
└── TSB-AD/
    ├── TSB-AD-M/
    │   ├── <dataset_name_1>.csv
    │   ├── <dataset_name_2>.csv
    │   └── ...
    ├── TSB-AD-M.csv
    ├── TSB-AD-M-Eva.csv
    └── TSB-AD-M-Tuning.csv

The CSV files inside TSB-AD-M/ contain multivariate time series and follow the original benchmark specification.

Raw datasets are not redistributed in this repository and must be downloaded from the benchmark source.


Running the experiments

All experiments were executed on NVIDIA GH200 GPUs.

Example commands:

uv run -m cli.entrypoint list-methods
uv run -m cli.entrypoint list-datasets
uv run -m cli.entrypoint one-method --dataset OPPORTUNITY --method RickerWaveletTransform_MeanStdMax
uv run -m cli.entrypoint all-methods --dataset OPPORTUNITY
uv run -m cli.entrypoint full --csv-file cli/tsb-ad-m-datasets-part-1.csv --output-dir output-dir --device cpu

The CLI handles dataset loading, preprocessing, model execution, evaluation, and result serialization.


Hyperparameters and configuration

  • Model architectures are defined in src/models/.
  • Hyperparameters are specified in the configuration file config/default.yaml.
  • The same hyperparameter configuration is used across datasets.

Results

Raw results

  • Raw experimental outputs are stored in results/raw/.
  • These files correspond to individual datasets and experimental runs.

Aggregated results

  • Aggregated results reported in the paper are stored as CSV files in results/.
  • Aggregation is deterministic and implemented using the script scripts/consolidate.py.
  • No manual post-processing of results is performed.
  • results/cnn_ae.csv contains aggregated results for the CNN Autoencoder.
  • results/resnet18_ae.csv contains aggregated results for the Autoencoder with a ResNet18-based encoder.
  • All tables/results reported in the paper were generated using scripts provided in the scripts/ directory.
  • For instance, to inspect fine-grained time complexity results run uv run python scripts/empirical_time_complexity.py

Reproducibility

  • All code required to run the experiments is included in this repository.
  • All datasets are publicly available via the TSB-AD benchmark.
  • Experimental procedures, configurations, and result aggregation are fully specified.
  • Random seeds and relevant parameters are fixed to ensure determinism; determinism was verified in repeated runs.
  • The TSB-AD directory from the original benchmark repository is included at the project root to ensure that the same evaluation code and evaluation protocol as in the original benchmark are used. In addition, the original train–test splits are preserved to ensure that the evaluation follows the benchmark’s rigorous protocol.

Tables

Table 1. VUS-PR of 54 detection methods on 14 TSB-AD-M datasets

Best results in bold, second-best underlined.

Method CATSv2 CreditCard Daphnet Exathlon GECCO Genesis LTDB MSL OPP PSM SMAP SMD SWaT TAO
PRISM(CNN AE + RN-REP) 0.04 0.03 0.08 0.12 0.02 0.01 0.18 0.11 0.06 0.15 0.05 0.05 0.16 0.78
PRISM(CNN AE + SG-REP) 0.11 0.20 0.43 0.86 0.37 0.06 0.28 0.39 0.17 0.17 0.22 0.45 0.33 0.95
PRISM(CNN AE + LG-REP) 0.06 0.14 0.38 0.97 0.29 0.02 0.18 0.18 0.09 0.18 0.16 0.38 0.18 1.00
PRISM(CNN AE + GASF-PCA) 0.10 0.03 0.13 0.19 0.17 0.01 0.23 0.15 0.10 0.16 0.15 0.14 0.29 1.00
PRISM(CNN AE + GASF-MSM) 0.08 0.18 0.07 0.76 0.12 0.09 0.19 0.30 0.04 0.16 0.19 0.13 0.17 1.00
PRISM(CNN AE + GADF-PCA) 0.07 0.03 0.05 0.58 0.03 0.01 0.26 0.11 0.16 0.16 0.11 0.11 0.17 0.65
PRISM(CNN AE + GADF-MSM) 0.05 0.02 0.05 0.45 0.02 0.01 0.19 0.31 0.09 0.13 0.15 0.06 0.15 0.64
PRISM(CNN AE + MTF-PCA) 0.04 0.03 0.06 0.41 0.02 0.01 0.16 0.13 0.11 0.15 0.16 0.06 0.18 0.79
PRISM(CNN AE + MTF-MSM) 0.06 0.03 0.07 0.84 0.02 0.10 0.18 0.25 0.07 0.14 0.18 0.07 0.14 0.74
PRISM(CNN AE + RP-PCA) 0.04 0.03 0.16 0.35 0.06 0.02 0.21 0.19 0.08 0.17 0.07 0.08 0.21 0.77
PRISM(CNN AE + RP-MSM) 0.05 0.03 0.32 0.78 0.05 0.02 0.23 0.17 0.11 0.15 0.07 0.11 0.15 0.78
PRISM(CNN AE + MWT-PCA) 0.07 0.04 0.43 0.95 0.09 0.01 0.16 0.23 0.18 0.25 0.22 0.44 0.46 0.99
PRISM(CNN AE + MWT-MSM) 0.23 0.16 0.35 0.86 0.13 0.45 0.29 0.45 0.13 0.28 0.28 0.46 0.60 0.91
PRISM(CNN AE + RWT-PCA) 0.07 0.05 0.28 0.97 0.08 0.01 0.19 0.24 0.10 0.23 0.25 0.32 0.27 0.82
PRISM(CNN AE + RWT-MSM) 0.16 0.17 0.32 0.86 0.22 0.48 0.35 0.43 0.29 0.26 0.26 0.30 0.26 0.87
PRISM(ResNet18 AE + RN-REP) 0.04 0.03 0.08 0.12 0.02 0.01 0.18 0.10 0.06 0.15 0.05 0.05 0.16 0.78
PRISM(ResNet18 AE + SG-REP) 0.10 0.17 0.35 0.98 0.31 0.80 0.38 0.43 0.21 0.15 0.32 0.44 0.64 0.89
PRISM(ResNet18 AE + LG-REP) 0.06 0.14 0.45 0.98 0.43 0.74 0.28 0.23 0.39 0.25 0.24 0.40 0.48 1.00
PRISM(ResNet18 AE + GASF-PCA) 0.12 0.03 0.29 0.29 0.20 0.14 0.37 0.23 0.06 0.18 0.22 0.18 0.32 1.00
PRISM(ResNet18 AE + GASF-MSM) 0.10 0.19 0.15 0.74 0.11 0.19 0.30 0.24 0.06 0.16 0.24 0.15 0.18 1.00
PRISM(ResNet18 AE + GADF-PCA) 0.12 0.02 0.44 0.81 0.07 0.03 0.35 0.15 0.06 0.17 0.18 0.15 0.35 0.75
PRISM(ResNet18 AE + GADF-MSM) 0.06 0.02 0.21 0.66 0.07 0.02 0.31 0.33 0.07 0.16 0.19 0.08 0.17 0.62
PRISM(ResNet18 AE + MTF-PCA) 0.05 0.03 0.35 0.50 0.03 0.01 0.20 0.14 0.05 0.16 0.22 0.11 0.15 0.80
PRISM(ResNet18 AE + MTF-MSM) 0.07 0.03 0.12 0.76 0.05 0.09 0.19 0.22 0.06 0.15 0.21 0.09 0.16 0.71
PRISM(ResNet18 AE + RP-PCA) 0.04 0.03 0.24 0.49 0.03 0.01 0.19 0.26 0.06 0.16 0.18 0.08 0.16 0.79
PRISM(ResNet18 AE + RP-MSM) 0.06 0.03 0.33 0.76 0.03 0.01 0.24 0.29 0.08 0.14 0.23 0.14 0.15 0.78
PRISM(ResNet18 AE + MWT-PCA) 0.10 0.06 0.47 0.97 0.09 0.16 0.21 0.27 0.20 0.28 0.25 0.45 0.49 0.99
PRISM(ResNet18 AE + MWT-MSM) 0.25 0.13 0.41 0.86 0.12 0.51 0.37 0.48 0.13 0.31 0.35 0.48 0.59 0.93
PRISM(ResNet18 AE + RWT-PCA) 0.09 0.05 0.38 0.98 0.10 0.46 0.20 0.29 0.17 0.27 0.29 0.39 0.28 0.81
PRISM(ResNet18 AE + RWT-MSM) 0.18 0.16 0.35 0.86 0.16 0.60 0.42 0.42 0.14 0.34 0.34 0.45 0.59 0.86
Baseline Methods
xLSTMAD 0.10 0.06 0.50 0.91 0.04 0.01 0.40 0.38 0.16 0.18 0.35 0.35 0.34 0.80
CNN 0.08 0.02 0.21 0.68 0.03 0.10 0.33 0.35 0.16 0.22 0.19 0.35 0.41 1.00
OmniAnomaly 0.04 0.02 0.34 0.84 0.02 0.00 0.44 0.22 0.18 0.16 0.12 0.17 0.15 0.81
PCA 0.12 0.10 0.13 0.95 0.20 0.02 0.24 0.15 0.30 0.16 0.09 0.36 0.45 1.00
LSTMAD 0.04 0.02 0.31 0.82 0.02 0.04 0.30 0.22 0.17 0.24 0.16 0.33 0.16 0.99
USAD 0.04 0.02 0.34 0.84 0.02 0.00 0.41 0.23 0.18 0.19 0.11 0.16 0.15 0.81
AutoEncoder 0.06 0.03 0.13 0.91 0.05 0.01 0.21 0.22 0.14 0.28 0.13 0.30 0.58 1.00
KMeansAD 0.12 0.02 0.30 0.37 0.06 0.89 0.41 0.44 0.06 0.21 0.38 0.36 0.16 0.86
CBLOF 0.06 0.03 0.10 0.86 0.03 0.02 0.20 0.21 0.14 0.19 0.14 0.22 0.29 1.00
MCD 0.13 0.06 0.14 0.80 0.03 0.06 0.21 0.23 0.17 0.26 0.10 0.26 0.54 1.00
OCSVM 0.08 0.02 0.06 0.83 0.04 0.08 0.20 0.22 0.12 0.19 0.12 0.28 0.44 0.81
Donut 0.07 0.02 0.17 0.66 0.03 0.18 0.26 0.30 0.15 0.20 0.18 0.19 0.44 0.75
RobustPCA 0.04 0.02 0.06 0.77 0.02 0.00 0.23 0.22 0.13 0.12 0.07 0.10 0.12 1.00
FITS 0.13 0.02 0.33 0.63 0.03 0.10 0.23 0.17 0.05 0.13 0.08 0.17 0.15 0.78
OFA 0.13 0.02 0.31 0.58 0.04 0.22 0.29 0.14 0.05 0.17 0.08 0.17 0.12 0.78
EIF 0.06 0.02 0.15 0.41 0.04 0.06 0.19 0.18 0.10 0.18 0.13 0.32 0.32 0.89
COPOD 0.05 0.05 0.11 0.40 0.04 0.08 0.21 0.21 0.17 0.20 0.10 0.19 0.31 0.99
IForest 0.05 0.03 0.13 0.35 0.04 0.08 0.21 0.21 0.18 0.19 0.09 0.26 0.39 0.93
HBOS 0.05 0.04 0.15 0.32 0.04 0.08 0.21 0.23 0.17 0.17 0.09 0.25 0.30 0.83
TimesNet 0.07 0.02 0.27 0.42 0.03 0.02 0.27 0.17 0.06 0.14 0.09 0.14 0.14 0.79
KNN 0.07 0.02 0.25 0.33 0.11 0.04 0.19 0.18 0.06 0.12 0.12 0.30 0.11 0.78
TranAD 0.04 0.02 0.31 0.10 0.02 0.04 0.26 0.24 0.16 0.23 0.09 0.30 0.15 0.81
LOF 0.05 0.02 0.11 0.16 0.13 0.08 0.19 0.14 0.10 0.15 0.09 0.16 0.15 0.79
AnomalyTransformer 0.03 0.02 0.07 0.10 0.02 0.01 0.21 0.12 0.07 0.21 0.06 0.07 0.18 0.77

Table 2. Mean performance across 9 metrics for 54 detection methods on 14 TSB-AD datasets

Best results in bold, second-best underlined.

Method AUC-PR AUC-ROC VUS-PR VUS-ROC Standard-F1 PA-F1 Event-based-F1 R-based-F1 Affiliation-F1
PRISM(CNN AE + RN-REP) 0.14 0.50 0.15 0.52 0.21 0.94 0.39 0.33 0.80
PRISM(CNN AE + SG-REP) 0.49 0.75 0.48 0.76 0.53 0.90 0.79 0.42 0.93
PRISM(CNN AE + LG-REP) 0.45 0.73 0.44 0.75 0.50 0.93 0.76 0.40 0.92
PRISM(CNN AE + GASF-PCA) 0.24 0.61 0.23 0.63 0.31 0.94 0.62 0.37 0.88
PRISM(CNN AE + GASF-MSM) 0.38 0.70 0.37 0.71 0.43 0.93 0.73 0.36 0.90
PRISM(CNN AE + GADF-PCA) 0.27 0.53 0.26 0.55 0.34 0.88 0.64 0.40 0.89
PRISM(CNN AE + GADF-MSM) 0.26 0.54 0.25 0.55 0.37 0.90 0.62 0.42 0.86
PRISM(CNN AE + MTF-PCA) 0.24 0.57 0.24 0.59 0.30 0.93 0.63 0.39 0.86
PRISM(CNN AE + MTF-MSM) 0.35 0.63 0.35 0.64 0.42 0.92 0.66 0.39 0.88
PRISM(CNN AE + RP-PCA) 0.22 0.57 0.22 0.58 0.28 0.86 0.53 0.30 0.84
PRISM(CNN AE + RP-MSM) 0.31 0.62 0.31 0.63 0.37 0.83 0.59 0.30 0.88
PRISM(CNN AE + MWT-PCA) 0.49 0.76 0.48 0.77 0.53 0.89 0.77 0.41 0.93
PRISM(CNN AE + MWT-MSM) 0.51 0.74 0.51 0.75 0.56 0.92 0.85 0.45 0.94
PRISM(CNN AE + RWT-PCA) 0.45 0.72 0.45 0.73 0.51 0.90 0.75 0.40 0.92
PRISM(CNN AE + RWT-MSM) 0.47 0.74 0.47 0.75 0.54 0.92 0.82 0.42 0.93
PRISM(ResNet18 AE + RN-REP) 0.14 0.50 0.15 0.52 0.21 0.93 0.32 0.32 0.77
PRISM(ResNet18 AE + SG-REP) 0.52 0.76 0.52 0.77 0.57 0.93 0.81 0.41 0.93
PRISM(ResNet18 AE + LG-REP) 0.50 0.80 0.49 0.81 0.54 0.96 0.80 0.39 0.93
PRISM(ResNet18 AE + GASF-PCA) 0.27 0.65 0.27 0.66 0.35 0.96 0.70 0.37 0.90
PRISM(ResNet18 AE + GASF-MSM) 0.38 0.73 0.37 0.74 0.44 0.94 0.77 0.36 0.92
PRISM(ResNet18 AE + GADF-PCA) 0.30 0.62 0.29 0.63 0.36 0.94 0.67 0.37 0.89
PRISM(ResNet18 AE + GADF-MSM) 0.30 0.58 0.29 0.60 0.39 0.94 0.67 0.38 0.88
PRISM(ResNet18 AE + MTF-PCA) 0.23 0.58 0.23 0.59 0.30 0.93 0.60 0.37 0.86
PRISM(ResNet18 AE + MTF-MSM) 0.33 0.63 0.33 0.64 0.41 0.92 0.62 0.36 0.87
PRISM(ResNet18 AE + RP-PCA) 0.22 0.55 0.22 0.56 0.29 0.89 0.59 0.35 0.85
PRISM(ResNet18 AE + RP-MSM) 0.34 0.62 0.34 0.63 0.41 0.89 0.68 0.38 0.89
PRISM(ResNet18 AE + MWT-PCA) 0.50 0.76 0.50 0.77 0.55 0.94 0.84 0.42 0.95
PRISM(ResNet18 AE + MWT-MSM) 0.53 0.75 0.53 0.76 0.58 0.92 0.86 0.45 0.95
PRISM(ResNet18 AE + RWT-PCA) 0.48 0.73 0.48 0.74 0.54 0.92 0.81 0.40 0.93
PRISM(ResNet18 AE + RWT-MSM) 0.51 0.74 0.50 0.75 0.57 0.92 0.83 0.42 0.94
Baseline Methods
xLSTMAD 0.40 0.74 0.48 0.78 0.48 0.57 0.50 0.43 0.82
CNN 0.36 0.75 0.35 0.77 0.41 0.80 0.68 0.41 0.88
OmniAnomaly 0.28 0.66 0.33 0.70 0.33 0.55 0.41 0.39 0.81
PCA 0.36 0.73 0.36 0.78 0.43 0.88 0.67 0.32 0.87
LSTMAD 0.36 0.73 0.36 0.77 0.41 0.83 0.68 0.43 0.89
USAD 0.27 0.65 0.32 0.69 0.32 0.53 0.40 0.39 0.80
AutoEncoder 0.36 0.70 0.35 0.72 0.40 0.64 0.51 0.33 0.82
KMeansAD 0.28 0.70 0.33 0.74 0.35 0.70 0.54 0.36 0.83
CBLOF 0.33 0.69 0.32 0.72 0.37 0.71 0.53 0.36 0.83
MCD 0.32 0.71 0.32 0.75 0.39 0.53 0.39 0.23 0.80
OCSVM 0.27 0.63 0.31 0.70 0.32 0.55 0.48 0.35 0.82
Donut 0.24 0.78 0.32 0.86 0.34 0.63 0.44 0.26 0.98
RobustPCA 0.28 0.60 0.28 0.63 0.33 0.62 0.46 0.37 0.82
FITS 0.17 0.60 0.24 0.69 0.24 0.70 0.32 0.17 0.82
OFA 0.14 0.57 0.22 0.65 0.21 0.73 0.39 0.15 0.83
EIF 0.22 0.69 0.25 0.73 0.30 0.77 0.51 0.30 0.83
COPOD 0.23 0.68 0.23 0.72 0.31 0.76 0.47 0.27 0.82
IForest 0.22 0.68 0.23 0.71 0.29 0.71 0.44 0.26 0.81
HBOS 0.18 0.65 0.22 0.70 0.27 0.72 0.47 0.28 0.82
TimesNet 0.14 0.58 0.21 0.67 0.22 0.65 0.31 0.18 0.83
KNN 0.16 0.54 0.21 0.63 0.22 0.73 0.52 0.24 0.81
TranAD 0.15 0.60 0.20 0.66 0.23 0.68 0.40 0.22 0.79
LOF 0.11 0.54 0.16 0.62 0.17 0.60 0.36 0.16 0.77
AnomalyTransformer 0.08 0.52 0.14 0.58 0.13 0.51 0.32 0.14 0.73

Table 3. Mean performance across 10 metrics of 15 PRISM's TS2I projection schemes

Best results in bold, second-best underlined.

Projection scheme AUC-PR AUC-ROC VUS-PR VUS-ROC Standard-F1 PA-F1 Event-based-F1 R-based-F1 Affiliation-F1 Time (s / 100 img)
RN-REP 0.14 0.50 0.15 0.52 0.21 0.94 0.34 0.32 0.77 0.20
SG-REP 0.51 0.76 0.51 0.77 0.56 0.92 0.81 0.41 0.93 0.18
LG-REP 0.49 0.78 0.48 0.79 0.53 0.95 0.79 0.39 0.93 1.40
GASF-PCA 0.26 0.64 0.26 0.65 0.34 0.95 0.68 0.37 0.89 0.32
GASF-MSM 0.38 0.72 0.37 0.73 0.44 0.94 0.76 0.36 0.92 0.32
GADF-PCA 0.29 0.59 0.28 0.61 0.36 0.93 0.67 0.38 0.89 0.34
GADF-MSM 0.29 0.57 0.28 0.59 0.38 0.93 0.66 0.39 0.88 0.33
MTF-PCA 0.23 0.58 0.23 0.59 0.30 0.93 0.60 0.37 0.86 0.32
MTF-MSM 0.33 0.63 0.33 0.64 0.41 0.92 0.63 0.37 0.87 0.32
RP-PCA 0.22 0.55 0.22 0.57 0.29 0.88 0.58 0.33 0.85 0.25
RP-MSM 0.34 0.62 0.34 0.63 0.40 0.87 0.66 0.36 0.89 0.24
MWT-PCA 0.50 0.76 0.50 0.77 0.54 0.93 0.82 0.42 0.94 0.40
MWT-MSM 0.53 0.76 0.52 0.76 0.58 0.92 0.86 0.45 0.95 0.37
RWT-PCA 0.47 0.73 0.47 0.74 0.53 0.92 0.79 0.40 0.93 0.39
RWT-MSM 0.50 0.74 0.50 0.75 0.56 0.92 0.83 0.42 0.94 0.37

Table 4. Mean performance across 10 metrics of 3 TL strategies for ResNet18 AE

Best results in bold, second-best underlined.

Strategy AUC-PR AUC-ROC VUS-PR VUS-ROC Std-F1 PA-F1 Evt-F1 R-F1 Aff-F1 Time (s)
FE 0.36 0.66 0.35 0.67 0.42 0.93 0.70 0.38 0.89 94
PU 0.37 0.67 0.37 0.68 0.43 0.93 0.71 0.38 0.90 141
DLR 0.38 0.68 0.38 0.69 0.44 0.93 0.71 0.39 0.90 167

Labels:

  • FE - Frozen Encoder
  • PEU - Progressive Encoder Unfreezing
  • DLR - Differential Learning Rates

About

PRISM: Powerful Time Series to Image (TS2I) Representations for Multivariate Anomaly Detection

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages