Skip to content

TrustAIoT/TadFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Directory Structure

πŸ“‚ Datasets

All datasets are part of the UCR Anomaly Archive (2021) Please download and navigate to AnomalyDatasets_2021\UCR_TimeSeriesAnomalyDatasets2021\FilesAreInHere\ and copy UCR_Anomaly_FullData/ to the root folder

The root directory should contain the following:

  • UCR_Anomaly_FullData/: Folder containing all 250 raw datasets from the UCR 2021 anomaly archive.
  • env.yml: Conda environment file specifying all dependencies for reproducibility.
.
β”œβ”€β”€ main.py               # Main script: training, evaluation, anomaly detection
β”œβ”€β”€ common.py            # helper utils for contextual.py
β”œβ”€β”€ contextual.py        # Contextual precision, recall, F1 evaluation functions
β”œβ”€β”€ hyperparameters.py   # Configuration dictionary + dataset filenames
β”œβ”€β”€ results/             # Saved CSVs with F1, precision, recall
β”œβ”€β”€ saved_models/        # Periodically saved checkpoints (every 10k iterations)
β”œβ”€β”€ saved_raw_scores/    # Raw z-scores before filtering

βš™οΈ Installation

# Step 1: Create the conda environment from the YAML file
conda env create -f env.yml

# Step 2: Activate the environment
conda activate research-env

πŸ§ͺ Running Experiments

python main.py

The script will:

  1. Iterate through all 250 datasets defined in hyperparameters.py
  2. Train the TadFlow model for 100,000 iterations per dataset.
  3. Save raw scores, filtered scores, and evaluation metrics (F1, precision, recall) to results/.

πŸ“ˆ Output

Each experiment logs the following to results/result.csv:

data_group, dataset_name, expected, predicted, f1_score, precision, recall, time_elapsed (minutes)

About

Time Series Anomaly Detection using Flow Matching

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages