Supervision Recovery for Time Series Anomaly Detection via Context-Anchored Pairing
Organizations: Department of Industrial Engineering, Tsinghua University · Huawei
Abstract
Time series anomaly detection (TSAD) remains challenging not only because anomaly labels are scarce, but also because temporal anomalies are highly context-dependent. Existing methods often rely on unsupervised objectives or surrogate abnormal patterns, providing limited supervision for context-dependent normal--anomalous distinctions. We propose Context-Anchored Pair Supervision (CAPS), a supervision-recovery framework for TSAD. CAPS views ideal anomaly supervision as a matched comparison between normal and anomalous outcomes under the same temporal context, and seeks to recover such supervision without target-domain anomaly labels. Using simulated normal--anomalous pairs, CAPS learns structure and anomaly-semantic representations through reconstruction, background consistency, and within-pair counterfactual recombination. The resulting anomaly representations form a continuous semantic space with coarse modes and induce a sampleable multimodal prior. CAPS conditionally realizes sampled semantics as residual-form effects on target reference trajectories. The resulting context-anchored normal--anomalous counterparts provide temporal supervision for discriminative detector learning. Experiments on nine datasets show that CAPS achieves the strongest aggregate performance across all four evaluation metrics among the compared methods, while complementary ablations and transfer analyses support the roles of context anchoring, semantic disentanglement, and conditional realization.
Figures & tables
| Method | Aff.-F | Std.-F1 | VUS-PR | Avg.R | T1 | T2 | |||||
| Score | Rank | Score | Rank | Score | Rank | Score | Rank | ||||
| Unsupervised TSAD baselines | |||||||||||
| LOF | 72.26 | 8.94 | 28.19 | 7.44 | 23.11 | 8.33 | 23.19 | 8.06 | 8.19 | 0 | 2 |
| IForest | 47.86 | 10.67 | 14.15 | 10.94 | 15.65 | 9.72 | 18.72 | 8.67 | 10.00 | 0 | 0 |
| OmniAnomaly | 73.48 | 7.78 | 28.35 | 5.56 | 23.82 | 6.67 | 25.04 | 6.28 | 6.57 | 1 | 6 |
| TranAD | 73.39 | 8.67 | 21.46 | 7.67 | 19.00 | 8.44 | 22.54 | 7.28 | 8.01 | 0 | 0 |
| Variant | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| Shuffled residuals | 79.27 | 41.21 | 37.78 | 41.30 |
| w/o residual parameterization | 82.76 | 40.96 | 38.35 | 42.27 |
| Direct source-residual injection | 81.58 | 43.16 | 39.96 | 42.58 |
| w/o counterfactual loss | 83.65 | 42.76 | 39.11 | 43.11 |
| CAPS | 85.33 | 46.53 | 42.91 | 46.82 |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Setting |
|---|---|
| Input shape | |
| Default mode organization | (trend / periodic / point) |
| Latent dimensions | , |
| Encoder | hidden dims , dropout |
| Multi-scale extractor | 4 branches; kernels ; dilations |
| Residual experts | hard-routed experts ( by default) |
| Name | Domain | #TS | Avg. Length | AR (%) |
|---|---|---|---|---|
| UCR | Misc. | 228 | 67818.7 | 0.6 |
| NAB | Web | 28 | 5099.7 | 10.6 |
| YAHOO | Web | 259 | 1560.2 | 0.6 |
| IOPS | Operations | 17 | 72792.3 | 1.3 |
| MGAB | Sensor | 9 | 97777.8 | 0.2 |
| SED | Energy | 3 | 23332.3 | 4.1 |
| Metric | Method | IOPS | MGAB | NAB | Power | SED | UCR | NEK | TODS | YAHOO |
|---|---|---|---|---|---|---|---|---|---|---|
| Affiliation-F | LOF | 81.06 | 68.44 | 75.75 | 66.76 | 63.85 | 73.53 | 84.74 | 60.58 | 75.63 |
| IForest | 52.81 | 68.82 | 39.84 | 0.00 | 70.09 | 50.56 | 71.15 | 44.17 | 33.30 | |
| OmniAnomaly | 80.32 | 67.35 | 92.35 | 78.16 | 61.26 | 73.53 | 86.30 | 50.73 | 71.31 | |
| TranAD | 83.19 | 67.28 | 90.28 | 71.56 | 61.03 | 73.31 | 85.02 | 52.76 | 76.08 | |
| USAD | 71.08 | 67.81 | 91.54 | 76.48 | 55.60 | 76.00 | 71.13 | 47.90 | 53.05 | |
| AnomTrans. | 70.79 | 67.65 | 79.03 | 71.57 | 68.21 | 80.03 | 75.32 | 44.57 | 64.75 |
| Metric | Method | IOPS | MGAB | NAB | Power | SED | UCR | NEK | TODS | YAHOO |
|---|---|---|---|---|---|---|---|---|---|---|
| Affiliation-F | CAPS | 89.24 | 69.22 | 93.25 | 85.98 | 74.09 | 88.41 | 86.30 | 86.85 | 94.63 |
| Shuffled residuals | 83.41 | 68.04 | 86.84 | 78.81 | 70.16 | 81.99 | 81.11 | 75.03 | 88.06 | |
| CAPS | 60.62 | 7.58 | 57.90 | 29.20 | 24.27 | 41.53 | 80.15 | 46.17 | 71.35 | |
| Shuffled residuals | 53.32 | 1.76 | 52.75 | 20.38 | 22.88 | 37.18 | 74.98 | 38.15 | 69.50 | |
| Standard-F1 | CAPS | 51.63 | 4.54 | 51.78 | 29.37 | 24.11 | 37.70 | 76.23 | 41.24 | 69.58 |
| Shuffled residuals | 46.85 | 1.62 | 46.31 | 20.38 | 22.81 | 32.29 | 68.40 | 34.12 | 67.26 |
| Metric | Method | IOPS | MGAB | NAB | Power | SED | UCR | NEK | TODS | YAHOO |
|---|---|---|---|---|---|---|---|---|---|---|
| Affiliation-F | CAPS | 89.24 | 69.22 | 93.25 | 85.98 | 74.09 | 88.41 | 86.30 | 86.85 | 94.63 |
| w/o residual parameterization | 84.91 | 68.07 | 90.61 | 85.11 | 77.54 | 87.26 | 81.16 | 77.92 | 92.27 | |
| CAPS | 60.62 | 7.58 | 57.90 | 29.20 | 24.27 | 41.53 | 80.15 | 46.17 | 71.35 | |
| w/o residual parameterization | 44.06 | 1.26 | 54.96 | 24.03 | 19.96 | 39.59 | 76.53 | 39.91 | 68.37 | |
| Standard-F1 | CAPS | 51.63 | 4.54 | 51.78 | 29.37 | 24.11 | 37.70 | 76.23 | 41.24 | 69.58 |
| w/o residual parameterization | 37.98 | 1.15 | 48.91 | 24.02 | 19.87 | 35.67 | 72.43 | 35.78 | 69.34 |
| Method | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| Direct source-residual injection | 81.58 | 43.16 | 39.96 | 42.58 |
| CAPS | 85.33 | 46.53 | 42.91 | 46.82 |
| Dataset | Method | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|---|
| YAHOO | TCN-Supervised (BCE) | 83.11 | 59.52 | 51.24 | 44.28 |
| Weighted BCE | 85.10 | 59.90 | 56.90 | 45.70 | |
| Balanced Window Sampling | 83.10 | 37.30 | 34.50 | 39.30 | |
| Focal Loss | 83.70 | 38.50 | 35.70 | 40.30 | |
| CAPS | 94.63 | 71.35 | 69.58 | 83.70 | |
| NEK | TCN-Supervised (BCE) | 85.24 | 72.93 | 62.58 | 67.52 |
| Contamination | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| 0% | 85.74 | 34.17 | 37.54 | 34.05 |
| 1% | 84.29 | 33.08 | 34.98 | 31.19 |
| 2% | 83.94 | 33.05 | 35.48 | 30.77 |
| 5% | 84.48 | 31.06 | 32.69 | 29.44 |
| 10% | 84.53 | 30.83 | 31.65 | 29.46 |
| 20% | 84.20 | 30.61 | 29.22 | 26.52 |
| Variant | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| w/o | 83.65 | 42.76 | 39.11 | 43.11 |
| CAPS | 85.33 | 46.53 | 42.91 | 46.82 |
| Method | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| CAPS w/o highest-associated mode | 79.31 | 38.42 | 37.81 | 39.87 |
| CAPS | 85.33 | 46.53 | 42.91 | 46.82 |
| Organization | Affiliation-F | Standard-F1 | VUS-PR | ||
|---|---|---|---|---|---|
| Data-driven | 1 | 82.34 | 39.92 | 37.23 | 41.36 |
| Data-driven | 3 | 84.98 | 43.75 | 40.12 | 45.76 |
| Data-driven | 5 | 83.10 | 44.04 | 40.43 | 44.76 |
| Data-driven | 7 | 81.61 | 42.38 | 38.78 | 43.38 |
| Knowledge-based | 3 | 85.33 | 46.53 | 42.91 | 46.82 |
| Strategy | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| Direct source-residual injection | 81.58 | 43.16 | 39.96 | 42.58 |
| VAE residual generator | 83.28 | 42.32 | 38.82 | 42.63 |
| CAPS (diffusion) | 85.33 | 46.53 | 42.91 | 46.82 |
| Positive source | Score | Feature |
|---|---|---|
| Rule-based injection | 0.4531 | 0.6218 |
| Direct source-residual injection | 0.4783 | 0.6712 |
| CAPS | 0.3990 | 0.6123 |
| Metric | CAPS (TCN) | CAPS (Transformer) |
|---|---|---|
| Affiliation-F | 85.33 | 81.10 |
| 46.53 | 42.12 | |
| Standard-F1 | 42.91 | 40.37 |
| VUS-PR | 46.82 | 43.28 |
| Prior | Affiliation-F | Standard-F1 | VUS-PR | |
|---|---|---|---|---|
| Isotropic Gaussian | 84.97 | 45.88 | 42.36 | 46.21 |
| Diagonal Gaussian | 85.33 | 46.53 | 42.91 | 46.82 |
| Full-covariance Gaussian | 85.40 | 47.11 | 42.74 | 46.70 |
| Student- t | 85.21 | 46.47 | 42.68 | 46.95 |
| Metric | 5,000 | 10,000 | 20,000 | 48,000 |
|---|---|---|---|---|
| Affiliation-F | 77.66 | 78.93 | 82.15 | 85.33 |
| 44.36 | 47.24 | 46.21 | 46.53 | |
| Standard-F1 | 41.05 | 43.52 | 42.78 | 42.91 |
| VUS-PR | 39.68 | 42.40 | 44.79 | 46.82 |
| Number of simulated pairs | Simulated-domain training | Pair generation | Test-time detection |
|---|---|---|---|
| 5,000 | 23.6 min | 50 ms / pair | 2 ms / sequence |
| 10,000 | 48.5 min | 50 ms / pair | 2 ms / sequence |
| 20,000 | 95.1 min | 50 ms / pair | 2 ms / sequence |
| 48,000 | 180.5 min | 50 ms / pair | 2 ms / sequence |
| Name | Domain | #TS | #Dim | Avg. Length | AR (%) |
|---|---|---|---|---|---|
| MSL | Space | 16 | 55 | 3119.4 | 5.1 |
| PSM | Sensor | 1 | 25 | 217624.0 | 11.2 |
| SMAP | Space | 27 | 25 | 7855.9 | 2.9 |
| SMD | Server | 22 | 38 | 25466.4 | 3.8 |
| Metric | Model | MSL | PSM | SMAP | SMD |
|---|---|---|---|---|---|
| Affiliation-F | LOF | 84.35 | 61.98 | 63.32 | 64.13 |
| IForest | 63.36 | 63.78 | 59.96 | 69.71 | |
| OmniAnomaly | 83.15 | 58.17 | 91.38 | 85.82 | |
| TranAD | 79.91 | 73.83 | 87.39 | 92.20 | |
| USAD | 81.86 | 57.86 | 87.25 | 85.09 | |
| AnomTrans. | 74.38 | 66.04 | 74.82 | 73.44 |