Introduction
In many real-world applications, such as clinical monitoring or industrial sensor networks, multivariate time series (MTS) data rarely conforms to the neat, regularly sampled grids expected by traditional deep learning architectures. Instead, measurements are often sparse, asynchronous, and irregularly sampled due to sensor failures, varying measurement frequencies, or event-driven data collection. Standard approaches typically rely on data imputation—filling in missing values—which can introduce significant noise and artifacts.
The "Compatible Transformer" (CoFormer) addresses these challenges by shifting from a variate-centric or time-centric perspective to a sample-centric approach. Rather than forcing irregular data into a fixed grid, CoFormer treats every measurement as an independent entity defined by its value, variable identity, and precise timestamp.
The Problem: Misalignment in Time Series
Irregularly sampled MTS data presents two primary hurdles for conventional models:
- Temporal Misalignment: Observations for a single variable occur at unpredictable intervals, making it difficult for standard recurrent or attention-based models to capture the underlying dynamics.
- Variate Misalignment: Different variables (e.g., heart rate and oxygen saturation) are rarely measured at the same time. This lack of synchronization complicates the modeling of cross-variable correlations.
Existing models often aggregate data into coarse-grained representations too early in the pipeline, losing the fine-grained temporal nuances essential for high-stakes predictions like medical diagnosis.
The CoFormer Architecture
CoFormer introduces a "sample-centric" modeling paradigm where each data point is represented as a tuple $p = (i, t)$, where $i$ denotes the variable index and $t$ represents the continuous timestamp.
Triple Encoding
To preserve the full context of each measurement, CoFormer employs a triple encoding scheme:
- Value Encoding: A Multi-Layer Perceptron (MLP) maps the raw measurement value into a high-dimensional space.
- Variable Encoding: Dictionary learning is used to provide a unique embedding for each sensor or variable ID.
- Time Encoding: Continuous timestamps are transformed using trigonometric functions, allowing the model to perceive the exact duration between samples rather than just their ordinal position.
Dual-Attention Mechanism
The core of CoFormer consists of two specialized attention modules that alternate to capture different types of dependencies:
- Intra-variate Attention: This module focuses on the temporal evolution of a single variable. By attending to historical "neighbors" of the same sensor, the model learns the specific trajectory of that signal.
- Inter-variate Attention: This module captures correlations across different sensors. It looks at measurements from other variables within a specific time window ($\Delta\tau$), enabling the model to learn how different physiological or physical signals interact even when they are not synchronized.
Efficiency and Scalability
A significant challenge in applying Transformers to long time series is the $O(N^2)$ complexity of global attention. CoFormer mitigates this by utilizing K-Nearest Neighbors (KNN) to restrict attention to the most relevant points. This reduces the computational complexity from $O(N^2)$ to $O(NK)$, where $K$ is the number of neighbors, making the model scalable to long sequences and high-frequency data.
Experimental Evaluation
The researchers evaluated CoFormer against state-of-the-art (SOTA) methods, including Raindrop, SeFT, and mTAND, across three diverse datasets:
- PhysioNet Sepsis Prediction (P19): Monitoring 34 sensors across ~38,000 patients. CoFormer achieved an AUROC of 89.2%, outperforming the previous SOTA of 87.0%.
- PhysioNet Mortality Prediction (P12): Predicting clinical outcomes for ICU patients. CoFormer demonstrated superior performance in identifying high-risk patients.
- Physical Activity Monitoring (PAM): To test robustness, the authors randomly removed 60% of the data from this 17-sensor dataset. CoFormer maintained an F1 score of 92.8%, a 3% improvement over the next best model.
Ablation studies confirmed that both the continuous time encoding and the dual-attention mechanism are critical to the model's success. Removing either component resulted in a measurable drop in predictive accuracy.
Conclusion and Future Directions
CoFormer represents a significant advancement in "sensor-agnostic" AI. By treating every measurement as a unique point in a variate-time space, it bypasses the need for noisy imputation and handles irregularity as a first-class citizen. While the current work focuses on classification tasks, the architecture's flexibility suggests potential applications in forecasting and regression. Future research may focus on automating the selection of the neighborhood parameter $K$ and further optimizing the computational overhead of the multi-stage encoding process.
Summary updated