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

Multiple Instance Learning for Detecting Anomalies over Sequential Real-World Datasets

Parastoo Kamranfar, David Lattanzi, Amarda Shehu, Daniel BarbaráarXiv 2022 · DOI

Abstract

Anomaly detection in sequential real-world data is often hampered by the difficulty of obtaining precise labels. This paper presents MIL-StrOUD, a framework combining Multiple Instance Learning (MIL) with strangeness-based outlier detection. By operating on "bags" of data rather than individual points, the method achieves robustness against label noise and timing inaccuracies. Evaluation across diverse datasets—including mechanical vibrations, sensor data, and surveillance video—demonstrates that MIL-StrOUD significantly outperforms traditional single-instance methods, particularly on noisy datasets like bridge vibration monitoring.

Introduction

Detecting anomalies in continuous data streams—such as video surveillance or industrial sensor feeds—is a critical task with applications ranging from public safety to predictive maintenance. However, traditional supervised learning approaches face a significant hurdle: the "annotation bottleneck." In sequential data, it is notoriously difficult for human experts to pinpoint the exact onset and duration of an anomalous event. This leads to "fuzzy" labels where the ground truth is often shifted or imprecise.

Furthermore, anomalies are by definition rare, resulting in highly imbalanced datasets. Most existing models struggle when trained on noisy, sparse labels. To address these challenges, we propose a hybrid framework that leverages the strengths of Multiple Instance Learning (MIL) and statistical "strangeness" testing to provide a robust, semi-supervised solution for anomaly detection.

The MIL-StrOUD Framework

The proposed framework, MIL-StrOUD (Multiple Instance Learning - Strangeness based OUtlier Detection), shifts the focus from individual data points to groups of points, known as "bags."

Multiple Instance Learning (MIL)

In the MIL paradigm, training data is organized into bags. A bag is labeled as anomalous if it contains at least one anomalous instance (a "witness"). If a bag is labeled normal, all instances within it are assumed to be normal. This formulation is ideal for sequential data because it only requires knowing that an anomaly occurred within a certain time window, rather than requiring the exact timestamp.

Strangeness and Statistical Testing

The core of the detection logic relies on calculating a "strangeness" value for each instance. We explored two primary metrics for strangeness:

  1. Local Outlier Factor (LOF): A density-based method that identifies outliers by comparing the local density of a point to that of its neighbors.
  2. Autoencoder (AE) Reconstruction Error: A neural network-based approach where the strangeness is defined by how poorly a pre-trained model can reconstruct a given input.

Once instance-level scores are calculated, they are aggregated into a bag-level score. Our experiments showed that maximum aggregation—taking the highest strangeness score in a bag—is the most effective method, as it directly identifies the most likely "witness" of an anomaly.

To determine if a test bag is truly anomalous, we use a transductive statistical approach. We compare the test bag's score against a baseline distribution of scores from known "normal" bags.

Algorithm 1: Procedure for creating the baseline anomaly distribution from training bags.

As shown in Algorithm 1, the baseline is constructed by calculating anomaly scores for all training bags and sorting them to create an ordered list. A p-value is then calculated for any new test bag; a low p-value indicates that the bag's strangeness is statistically significant compared to the normal baseline.

Experimental Evaluation

We evaluated MIL-StrOUD across four datasets representing different modalities and levels of complexity:

  • CWRU Bearing Dataset: Clean mechanical vibration data used as a baseline for "easy" detection.
  • HAPT Dataset: Smartphone sensor data for human activity recognition, focusing on postural transitions.
  • VIRAT Video Dataset: Real-world surveillance footage where anomalies include specific prohibited actions.
  • Bridge Ambient Vibration Dataset: The most challenging dataset, consisting of noisy sensor data from a bridge in Japan. The labels here are particularly noisy due to the difficulty of identifying exactly when structural damage affects vibration patterns.

Key Results and Insights

The MIL-based approach proved highly versatile. On "cleaner" datasets like CWRU and HAPT, MIL-StrOUD achieved near-perfect performance with AUC scores of 1.0 and 0.996, respectively.

The true value of the framework became apparent on the "hard" datasets. On the Bridge dataset, traditional single-instance StrOUD achieved an AUC of only 0.720, whereas MIL-StrOUD reached 0.931. This performance gap highlights the robustness of the bag-based approach in the presence of label noise.

ROC curves for the Bridge dataset comparing different strangeness measures within the MIL-StrOUD framework.

As illustrated in Figure 6, the choice of strangeness measure significantly impacts performance. Density-based methods like LOF (top plot) generally outperformed reconstruction-based methods like Autoencoders (bottom plot, labeled MSE) on raw physical signals. This suggests that local density is a more reliable indicator of "strangeness" in high-noise environments than the ability of a neural network to compress and reconstruct the signal.

Conclusion

MIL-StrOUD offers a powerful alternative to traditional anomaly detection for sequential data. By relaxing the requirement for precise temporal labels through Multiple Instance Learning and employing robust statistical testing, the framework handles real-world noise and labeling inaccuracies effectively. Future work will focus on automating bag construction and exploring more complex MIL assumptions where anomalies might be defined by the collective behavior of multiple instances rather than a single witness.

Summary updated

BibTeX
@misc{kamranfar2022multiple,
  author = {Parastoo Kamranfar and David Lattanzi and Amarda Shehu and Daniel Barbará},
  title = {{Multiple Instance Learning for Detecting Anomalies over Sequential Real-World Datasets}},
  year = {2022},
  eprint = {2210.01707},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.01707},
}
Figure