Skip to content

fly-orange/TreeMIL

Repository files navigation

TreeMIL

This is the code of "TreeMIL: A Multi-instance Learning Framework for Time Series Anomaly Detection with Inexact Supervision" (IEEE ICASSP 2024)

Overview


Figure 1. The overall framework of TreeMIL.

Our proposed framework, termed as TreeMIL, optimizes model by leveraging only weak supervision (i.e., instance-level anomaly labels, rather than point-level anomaly labels). The framework is designed with three charaterisctis:

  1. The entire time series is represented as a N -ary tree, where nodes represent subsequences of varying lengths
  2. The anomalous features of each node (subsequence) are generated using an attention mechanism that incorporates information from its parent node, children nodes, neighbor nodes and itsel
  3. The anomaly discriminator considers anomaly features from subsequences at various scales when calculating point-level anomaly scores.

Run the codes

STEP 1. Install the python libraries / packages

  • numpy
  • numba
  • scikit-learn
  • pytorch

STEP 2. Download the real-world datasets for temporal anomaly segmentation

STEP 3. Train and evaluate the TreeMIL framework

  • You can simply run the code with the default setting, by using the following command.
python train.py

Main results


Figure 2. Weak F1-score, dense F1-score, and IoU


Figure 3. Precision, recall, and AUC-ROC

Anomaly scores map


Figure 4. Both long and short collective anomalies can be captured by multi-scale nodes in the tree

Reference

  1. 2021_ICCV_Weakly Supervised Temporal Anomaly Segmentation with Dynamic Time Warping
  2. https://github.com/tsy935/eeg-gnn-ssl
  3. https://github.com/thuml/Anomaly-Transformer

About

A multi-instance learning framework for TSAD with inexact supervision

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages