Set Functions for Time Series

Max Horn, Michael Moor, Christian Bock, Bastian Rieck, Karsten M. Borgwardt

Overview

Traditional deep learning models often assume that time series data must be processed as strictly ordered sequences. The Set Functions for Time Series (SeFT) architecture challenges this "sequential prior." By treating observations as unordered sets and utilizing differentiable set functions with positional encodings, SeFT achieves competitive classification performance on messy, real-world healthcare data. Crucially, it does so while offering an order-of-magnitude reduction in runtime and providing inherent interpretability.

The Challenge of Irregular Time Series

In domains such as healthcare, time series data is notoriously messy. Measurements are frequently irregularly sampled (e.g., vitals taken at varying intervals) and asynchronous (e.g., heart rate recorded every minute, but lab results only every few hours).

Traditional approaches like Recurrent Neural Networks (RNNs) struggle in this environment because they typically assume a regular grid, requiring complex "imputation" schemes to fill in missing values. While advanced models like GRU-D or Gaussian Process Adapters can handle these irregularities, they are computationally expensive, difficult to scale to long sequences, and often act as "black boxes" that offer little insight into their predictions. There is a critical need for models that are highly scalable, data-efficient, and capable of handling unaligned measurements natively without losing the valuable information hidden in the missingness patterns themselves.

Methods: Rephrasing as Set Classification

The core innovation of SeFT is reframing time series classification as a set classification problem.

Overview of the SeFT architecture
  1. Set Representation: Instead of a sequence, a time series is treated as a set of observations $S = \{(t_1, z_1, m_1), \dots, (t_M, z_M, m_M)\}$, where each tuple contains a timestamp ($t$), a value ($z$), and a modality indicator ($m$, e.g., "Heart Rate").
  2. Time Encoding: To retain temporal information without forcing a sequential processing order, the authors use positional encodings (similar to those found in Transformer architectures). This maps the 1D time axis into a multi-dimensional space using trigonometric functions of varying frequencies.
  3. Differentiable Set Functions: The model leverages the "Deep Sets" framework. Each observation is processed independently by a multi-layer perceptron (MLP), and the results are subsequently aggregated.
  4. Attention-based Aggregation: Rather than relying on a simple mean or sum, SeFT employs a multi-head attention mechanism. This allows the model to dynamically learn which specific observations are most relevant to the classification task.
  5. Scalability: Because observations are processed independently before aggregation, the computational complexity is $O(M)$—scaling linearly with the number of observations—making it highly parallelizable.

Key Insights

  • The "Sequentialness Prior" is Optional: For many classification tasks, the exact order of processing isn't as critical as the global distribution of values and their relative timing. Relaxing the sequential requirement unlocks massive computational speedups.
  • Avoiding "Future Leakage": The authors discovered that some state-of-the-art models (like Interpolation-Prediction Networks and certain Transformer variants) inadvertently "leak" future information into the present through global normalization or imputation steps. SeFT's architecture naturally prevents this, making it robust for real-world online monitoring.
  • Interpretability via Attention: Because the model assigns an attention weight to every single observation, clinicians can "open the black box." For example, the model might highlight that a high-risk prediction was driven by a sudden spike in systolic blood pressure, providing actionable clinical insights.

Key Results

The authors evaluated SeFT on three prominent healthcare datasets characterized by irregular sampling: MIMIC-III (M3-Mortality), Physionet 2012 (P-Mortality), and Physionet 2019 (P-Sepsis).

Runtime vs. AUPRC performance comparison
  • Unmatched Speed: SeFT is significantly faster than its competitors. On the M3-Mortality task, SeFT required only 14.5 seconds per epoch, compared to 133 seconds for GRU-D and over 4,600 seconds for Latent-ODE.
  • Competitive Performance: SeFT performed competitively across all tasks. While it did not always achieve the absolute highest Area Under the ROC Curve (AUROC), it consistently ranked among the top performers while being vastly more efficient.
  • Robust Online Monitoring: In the Sepsis prediction task, SeFT demonstrated superior performance in a strictly "masked" scenario where future data was unavailable, highlighting the structural flaws in baseline models that rely on global sequence information.

Limitations and Future Work

While highly effective, SeFT has a few limitations. For extremely long time series (very high cardinality sets), the summation in the aggregation step could lead to numerical imprecision, suggesting a need for techniques like Kahan summation. Additionally, the paper notes a performance gap compared to some previous reports on MIMIC-III, attributed to distribution shifts between validation and test sets. Future work may involve designing attention mechanisms specifically optimized for sets with thousands of elements to further enhance performance in high-frequency monitoring scenarios.

Summary updated

BibTeX
@inproceedings{horn2020set,
  author = {Max Horn and Michael Moor and Christian Bock and Bastian Rieck and Karsten M. Borgwardt},
  title = {{Set Functions for Time Series}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure