Residual-Tail-Informed Flow Matching for Time Series Anomaly Detection
Organizations: Department of Computer Science, Missouri University of Science and Technology, Rolla, MO, USA · Department of Electrical and Computer Engineering, University of Kentucky, Lexington, KY 40506, USA
Abstract
Time series anomaly detection (TSAD) models are often trained on nominal data using average-risk objectives, which emphasize dominant normal patterns. However, real time series can contain rare but valid nominal regimes that are underrepresented in the training distribution. We show that data-space flow matching can over-penalize such rare-normal windows and assign them anomaly scores comparable to those of true anomalies. To address this, we propose Residual-Tail-Informed Flow Matching (RT-FM), an unsupervised framework that uses a temporal variational autoencoder to estimate residual latent tailness and converts it into bounded, warmup-annealed weights for training a data-space flow matching model. Experiments on seven TSAD benchmarks show that RT-FM improves rare-normal coverage while preserving strong anomaly discrimination, substantially reducing false alarms on such windows and resulting in improved aggregate detection performance. The code is available at: https://github.com/trustAIoT/RT-FM_time-series-anomaly
Figures & tables
| Operation | Kernel | Stride | Units / Shape | Activation |
| Encoder | ||||
| Conv1D + GroupNorm | hidden size | SiLU | ||
| ResidualBlock + GroupNorm (x3) | hidden size | SiLU | ||
| Flatten | – | – | – | |
| Fully Connected | – | – | for | – |
| Fully Connected | – | – | for | – |
| Operation | Kernel | Stride | Units / Shape | Activation |
| Main Network | ||||
| Input | – | – | – | |
| Timestep embedding | – | – | SiLU | |
| Input Conv1D | hidden size | – | ||
| ResidualBlock + GroupNorm (x5) | hidden size | SiLU | ||
| Conv1D output projection | – |
| Property | Dataset | ||||||
|---|---|---|---|---|---|---|---|
| UCR | SMAP | MSL | GECCO | SMD | PSM | SWAN | |
| # Series / entities | 250 | 55 | 27 | 1 | 28 | 1 | 1 |
| # Dimensions ( ) | 1 | 25 | 55 | 9 | 38 | 25 | 38 |
| # Train size | 5,302,449 | 140,825 | 58,317 | 69,260 | 708,405 | 132,481 | 60,000 |
| # Test size | 14,051,317 | 444,035 | 73,729 | 69,261 | 708,420 | 87,841 | 60,000 |
| AR (%) | 0.225 | 13.13 | 10.72 | 1.05 | 27.76 | 5.77 | 32.60 |
| Model | F1 | Precision | VUS-PR | AUROC | AP | FP@95R | Event F1 |
|---|---|---|---|---|---|---|---|
| TadGAN [ 13 ] | 0.131 | 0.092 | 0.332 | 0.641 | 0.118 | 0.617 | 0.154 |
| DENSE-AE [ 21 ] | 0.159 | 0.136 | 0.352 | 0.662 | 0.147 | 0.584 | 0.181 |
| LSTM-DT [ 21 ] | 0.320 | 0.289 | 0.442 | 0.731 | 0.306 | 0.462 | 0.342 |
| DONUT [ 22 ] | 0.351 | 0.325 | 0.428 | 0.726 | 0.337 | 0.439 | 0.371 |
| LSTM-AE [ 21 ] | 0.355 | 0.301 | 0.472 | 0.754 | 0.351 | 0.427 | 0.384 |
| MERLIN [ 23 ] | 0.414 | 0.402 | 0.503 | 0.781 | 0.419 | 0.386 | 0.492 |
| Method | GECCO | SWAN | MSL | SMAP | PSM | SMD | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| VUS-PR | F1 | VUS-PR | F1 | VUS-PR | F1 | VUS-PR | F1 | VUS-PR | F1 | VUS-PR | F1 | |
| OmniAnomaly | 0.612 | 0.661 | 0.746 | 0.790 | 0.628 | 0.678 | 0.578 | 0.635 | 0.703 | 0.742 | 0.677 | 0.725 |
| LSTM-AE | 0.637 | 0.684 | 0.768 | 0.813 | 0.650 | 0.700 | 0.606 | 0.662 | 0.724 | 0.761 | 0.693 | 0.740 |
| DCDetector | 0.681 | 0.728 | 0.805 | 0.846 | 0.698 | 0.745 | 0.748 | 0.701 | 0.756 | 0.789 | 0.733 | 0.780 |
| USAD | 0.701 | 0.746 | 0.825 | 0.859 | 0.720 | 0.761 | 0.678 | 0.725 | 0.772 | 0.804 | 0.748 | 0.792 |
| TranAD | 0.724 | 0.721 | 0.839 | 0.878 | 0.719 | 0.729 | 0.698 | 0.748 | 0.791 | 0.821 | 0.784 | 0.808 |
| Method | AUROC | AP | FP@95R | Event F1 |
|---|---|---|---|---|
| OmniAnomaly | 0.781 | 0.521 | 0.774 | 0.705 |
| LSTM-AE | 0.796 | 0.548 | 0.751 | 0.727 |
| DCDetector | 0.813 | 0.592 | 0.704 | 0.782 |
| USAD | 0.831 | 0.611 | 0.621 | 0.798 |
| TranAD | 0.816 | 0.637 | 0.646 | 0.821 |
| CARLA | 0.828 | 0.612 | 0.623 | 0.835 |
| Method | AUROC | AP | VUS-PR | FP@95R | Event F1 |
|---|---|---|---|---|---|
| Uniform FM | 0.881 | 0.706 | 0.812 | 0.572 | 0.861 |
| Amplitude FM | 0.875 | 0.697 | 0.798 | 0.591 | 0.856 |
| Raw-radius FM ( ) | 0.884 | 0.714 | 0.817 | 0.561 | 0.867 |
| Raw-radius FM ( ) | 0.887 | 0.721 | 0.821 | 0.552 | 0.872 |
| Residual-tail FM ( ) | 0.888 | 0.724 | 0.823 | 0.548 | 0.874 |
| Residual-tail FM ( ) | 0.894 | 0.738 | 0.833 | 0.526 | 0.883 |
| Input | Batch size | FM forward / window | NLL scoring / window |
|---|---|---|---|
| Univariate ( ) | 1 | 1.664 ms | 30.056 ms |
| Univariate ( ) | 32 | 0.053 ms | 0.970 ms |
| Univariate ( ) | 256 | 0.007 ms | 0.124 ms |
| Multivariate ( ) | 1 | 1.674 ms | 30.189 ms |
| Multivariate ( ) | 32 | 0.053 ms | 0.951 ms |
| Multivariate ( ) | 256 | 0.007 ms | 0.127 ms |
Unsupervised Anomaly Detection
Unsupervised anomaly detection finds unusual patterns without labeled examples of faults, attacks, defects, or other rare events.
See all 241 papers