HCFM: Helmholtz Component Flow Matching for Time Series Anomaly Detection
Organizations: Department of Computer Science, Missouri University of Science and Technology, Rolla, MO, USA · Department of ECE, University of Kentucky, Lexington, KY, USA
Abstract
Flow Matching (FM) is an efficient simulation-free approach for training flow-based generative models, making it a promising foundation for scalable time-series anomaly detection (TSAD). However, standard FM learns a monolithic vector field in which nominal transport and local density-changing behavior are entangled. This creates a central challenge for TSAD; local expansion and contraction carry crucial anomaly-sensitive information, yet isolating this signal requires expensive Jacobian-trace estimation over the entire field. We propose Helmholtz Component Flow Matching (HCFM), an unsupervised TSAD framework that parameterizes the vector field prediction network with separate transport, compression, and residual heads. The transport head is constrained to be divergence-free, so divergence estimation is restricted to the compression head, while a lightweight residual head absorbs the remaining mismatch. This structured parameterization improves scalability and detection performance by separating volume-preserving nominal transport from density-changing compression, yielding cleaner anomaly signals from distinct deviations of nominal behavior. Experiments on large-scale univariate and multivariate TSAD benchmarks show that HCFM consistently improves detection accuracy while maintaining efficient inference compared with 16 baselines. The code is available at https://github.com/TrustAIoT/HCFM__time-series-anomaly/
Figures & tables
| Operation | Kernel / Stride | Units / Shape | Activation |
| Shared Input | |||
| Input | – | – | |
| Timestep embedding | – | SiLU | |
| Transport Head | |||
| Low-rank skew transport | – | – | |
| Compression Head |
| Property | Dataset | ||||||
|---|---|---|---|---|---|---|---|
| UCR | SMAP | MSL | GECCO | SMD | PSM | SWAN | |
| # Sub-datasets | 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 | 4.16 | 27.76 | 32.60 |
| Model | Best F1 | Precision | VUS-PR | AUROC | AUPRC/AP | FP@95R | Hundman F1 |
|---|---|---|---|---|---|---|---|
| TadGAN [ 12 ] | 0.131 | 0.092 | 0.332 | 0.641 | 0.118 | 0.617 | 0.154 |
| DENSE-AE [ 36 ] | 0.159 | 0.136 | 0.352 | 0.662 | 0.147 | 0.584 | 0.181 |
| LSTM-DT [ 36 ] | 0.320 | 0.289 | 0.442 | 0.731 | 0.306 | 0.462 | 0.342 |
| DONUT [ 30 ] | 0.351 | 0.325 | 0.458 | 0.746 | 0.337 | 0.439 | 0.371 |
| LSTM-AE [ 36 ] | 0.355 | 0.301 | 0.472 | 0.754 | 0.351 | 0.427 | 0.384 |
| MERLIN [ 31 ] | 0.414 | 0.402 | 0.503 | 0.781 | 0.419 | 0.386 | 0.432 |
| Method | GECCO | SWAN | MSL | SMAP | PSM | SMD | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| VUS-PR | Best F1 | VUS-PR | Best F1 | VUS-PR | Best F1 | VUS-PR | Best F1 | VUS-PR | Best F1 | VUS-PR | Best 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.648 | 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.768 | 0.839 | 0.878 | 0.749 | 0.789 | 0.698 | 0.748 | 0.791 | 0.821 | 0.784 | 0.808 |
| Method | AUROC | AUPRC/AP | FP@95R | Hundman F1 |
|---|---|---|---|---|
| OmniAnomaly | 0.781 | 0.521 | 0.774 | 0.705 |
| LSTM-AE | 0.796 | 0.548 | 0.751 | 0.727 |
| DCDetector | 0.823 | 0.592 | 0.704 | 0.782 |
| USAD | 0.831 | 0.611 | 0.681 | 0.798 |
| TranAD | 0.846 | 0.637 | 0.646 | 0.821 |
| CARLA | 0.858 | 0.653 | 0.623 | 0.835 |
| Method | Training time (min) | Latency (ms/window) | Rel. time |
|---|---|---|---|
| LSTM-AE | 8.6 | 1.74 | |
| Vanilla FM | 14.2 | 2.05 | |
| HCFM | 22.8 | 3.92 | |
| FDM | 31.5 | 6.03 | |
| TranAD | 24.7 | 7.64 | |
| SGFM | 36.9 | 8.13 |
| Channels | Training time (min) | Latency (ms/window) |
|---|---|---|
| 1 | 22.80 ( ) | 3.92 ( ) |
| 8 | 23.92 ( ) | 3.98 ( ) |
| 16 | 26.52 ( ) | 4.03 ( ) |
| 32 | 34.06 ( ) | 3.98 ( ) |
| 64 | 49.04 ( ) | 4.06 ( ) |
| Scoring method | Divergence target | AUPRC | FP@95R | VUS-PR | Best F1 | Rel. time | Rel. memory |
|---|---|---|---|---|---|---|---|
| Vanilla FM: base energy | None | 0.566 | 0.270 | 0.589 | 0.562 | ||
| Vanilla FM: base full divergence | Full field | 0.578 | 0.260 | 0.598 | 0.574 | ||
| FDM: base full divergence | Full field | 0.594 | 0.248 | 0.606 | 0.588 | ||
| HCFM: base only | None | 0.682 | 0.206 | 0.651 | 0.671 | ||
| HCFM: compression divergence only | Compression head | 0.735 | 0.180 | 0.684 | 0.724 | ||
| HCFM: base compression divergence | Compression head | 0.757 | 0.171 | 0.694 | 0.742 |
| Variant | Field parameterization | Score used | AUPRC | FP@95R | VUS-PR | Best F1 | Hundman F1 |
|---|---|---|---|---|---|---|---|
| Vanilla FM | Base energy | 0.566 | 0.270 | 0.589 | 0.562 | 0.586 | |
| Vanilla FM divergence | Base | 0.578 | 0.260 | 0.598 | 0.574 | 0.598 | |
| No transport head | Base | 0.724 | 0.185 | 0.676 | 0.713 | 0.743 | |
| No compression head | Base energy | 0.647 | 0.226 | 0.632 | 0.636 | 0.665 | |
| No residual head | Base | 0.743 | 0.178 | 0.686 | 0.728 | 0.759 | |
| Full HCFM | Base | 0.757 | 0.171 | 0.694 | 0.742 | 0.776 |
| AUPRC | FP@95R | Best F1 | |||
|---|---|---|---|---|---|
| 0.686 | 0.232 | 0.668 | 1.721 | ||
| 0.715 | 0.207 | 0.697 | 1.084 | ||
| 0.723 | 0.199 | 0.705 | 0.923 | ||
| 0.741 | 0.181 | 0.727 | 0.514 | ||
| 0.731 | 0.193 | 0.713 | 0.682 | ||
| 0.757 | 0.171 | 0.742 | 0.287 |
| Best F1 | AUPRC | AUROC | VUS-PR | FP@95R | |
|---|---|---|---|---|---|
| 0.704 | 0.721 | 0.912 | 0.671 | 0.194 | |
| 0.724 | 0.739 | 0.917 | 0.684 | 0.183 | |
| 0.732 | 0.748 | 0.920 | 0.689 | 0.177 | |
| 0.742 | 0.757 | 0.922 | 0.694 | 0.171 | |
| 0.736 | 0.751 | 0.919 | 0.690 | 0.174 |
Time-Series Anomaly Detection
Time-Series Anomaly Detection identifies unusual patterns or events in sequential data, from sensor readings and network traffic to health and industrial telemetry.
See all 208 papers