NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TreeMIL: A Multi-instance Learning Framework for Time Series Anomaly Detection with Inexact Supervision

Chen Liu, Shibo He, Haoyu Liu, Shizhong Li · DOI

TL;DR

This paper introduces TreeMIL, a novel framework for time series anomaly detection that uses only coarse-grained, series-level labels for training. By representing time series data as a tree structure to capture anomalies at multiple scales, TreeMIL significantly outperforms existing methods, especially in detecting collective anomalies.

What Problem Does This Paper Address?

Detecting anomalies in time series data is crucial for many applications, but obtaining precise, point-level anomaly labels for training is often impractical and labor-intensive. Traditional unsupervised methods can be prone to false alarms due to limited variations in normal data. While weakly supervised approaches using series-level labels exist, they often struggle with "collective anomalies"—abnormal patterns that span subsequences rather than isolated points. Existing multi-instance learning (MIL) methods for time series anomaly detection typically focus on individual time steps, missing these more complex collective anomalies and leading to high false negative rates.

Methods

TreeMIL tackles this by employing a tree-based Multi-Instance Learning (MIL) framework. The core idea is to represent the time series data hierarchically. An N-ary tree is constructed where leaf nodes correspond to individual time points, and internal nodes represent subsequences of increasing lengths at different levels. This multi-resolution representation allows the model to capture anomalies at various scales.

Key steps include:

  1. Multi-resolution Temporal Embedding: The time series is embedded into an N-ary tree structure. Each node's embedding is computed bottom-up, leveraging embeddings from its children nodes.
  2. Feature Extraction with Attention: An attention mechanism is used to extract anomaly features for each node. This mechanism considers information from the node itself, its parent, children, and neighbors, allowing for a rich contextual representation.
  3. Anomaly Discriminator: During training, a global pooling layer aggregates features from all nodes to predict a series-level anomaly label, trained using binary cross-entropy loss. For testing, a time-wise pooling mechanism aggregates features from nodes encompassing each time point to predict point-level anomaly scores.

Datasets

The authors evaluated TreeMIL on seven public time series datasets:

  • EMG (myographic signals)
  • GECCO (drinking water composition)
  • SWAN-SF (space weather data)
  • Credit Card (transaction data)
  • SMD (server machine metrics)
  • PSM (server machine metrics)
  • SMAP (telemetry data)

These datasets span various domains and include both point and collective anomalies. The paper does not introduce new benchmarks but uses established datasets to compare against existing methods.

Key Insights and Ideas

  • Hierarchical Representation is Key for Collective Anomalies: The most significant insight is that representing time series data in a multi-scale, hierarchical (tree) structure is crucial for effectively detecting collective anomalies. By considering subsequences of varying lengths, TreeMIL can identify patterns that span beyond individual time points.
  • Attention Mechanism for Contextual Features: The use of an attention mechanism that incorporates information from a node's context (parent, children, neighbors) allows for a more robust and informative feature representation, better capturing the anomalous nature of subsequences.
  • Weak Supervision is Sufficient and Practical: The paper reinforces that using only series-level labels for training is a practical and effective approach for anomaly detection, significantly reducing the labeling burden while achieving state-of-the-art performance.

Key Results

TreeMIL demonstrated superior performance across the evaluated datasets.

  • Quantitative Improvement: TreeMIL achieved an average improvement of 32.3% in F1-D (point-level F1-score) and 51.8% in IoU (Intersection over Union) compared to previous state-of-the-art methods.
  • Handling Collective Anomalies: Visualizations (Figure 2) clearly show how TreeMIL's anomaly scores adapt to different anomaly lengths, with lower tree levels highlighting longer collective anomalies and higher levels capturing shorter ones. This visually validates its ability to model collective anomalies.
  • Comparison to Baselines: TreeMIL outperformed all unsupervised and weakly supervised baselines. It was particularly effective on datasets containing both point and collective anomalies, whereas methods like WETAS performed comparably on datasets with only point anomalies.

Limitations and Future Work

  • Sensitivity to Pooling Type: While generally robust, the paper notes that the choice of pooling type (max vs. average) can have a minimal impact, with max pooling showing a slight advantage for datasets with more short collective anomalies (Figure 3a).
  • Ary Size Impact: The N-ary tree structure's size (N) was found to have a minimal impact, with N=2 (binary tree) generally providing the best results, suggesting that capturing fine-grained temporal information is beneficial (Figure 3b).
  • Future Work: The paper implicitly suggests that further exploration into optimizing the tree structure and attention mechanisms could yield even better results. The success on diverse datasets also points towards potential applications in various real-world domains.

Summary updated

BibTeX
@inproceedings{liu2024treemil,
  author = {Chen Liu and Shibo He and Haoyu Liu and Shizhong Li},
  title = {{TreeMIL: A Multi-instance Learning Framework for Time Series Anomaly Detection with Inexact Supervision}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10447536},
}
Figure