T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting
Quang Duc Nguyen 1 Siyuan Liang 1 Yiming Li 1 Fushuo Huo 1 Dacheng Tao 1
Abstract
Legend Poisoned Timestamp
arXiv:2605.22365v1 [cs.CR] 21 May 2026
Time Series Forecasting (TSF) plays a critical role across many domains, yet it is vulnerable to backdoor attacks. However, backdoor defenses tailored to TSF remain underexplored, due to data entanglement and task-formulation shift challenges. To fill this gap, we conduct a systematic evaluation of thirteen representative backdoor defenses across the TSF life cycle and analyze their failure modes. Our results reveal two fundamental issues: (1) data entanglement induces channellevel signal dilution, rendering sample-filtering and trigger-synthesis defenses ineffective at localizing backdoors; and (2) task-formulation shift leads to training-loss degeneration, causing poisoned and clean windows to become indistinguishable at training stages. Based on these findings, we propose a training-time backdoor defense for TSF, termed T IME G UARD. Our method adopts channel-wise pool training as the core paradigm and initializes a high-confidence pool using timeaware criteria to mitigate signal dilution. Moreover, we introduce distance-regularized loss selection to progressively expand the reliable pool during training and ease loss degeneration. Extensive experiments across multiple datasets, forecasting architectures, and TSF backdoor attacks demonstrate that T IME G UARD substantially improves robustness, boosting MAEP by 1.96× over the leading baseline, while preserving clean performance within 5% MAEC .
Clean Channel
Original Data
Trigger Pattern
Sample
Attack Pattern
Prediction Clean Channel
Naïve Training
Inference
t
Poisoned Channel
Poisoned Channel Poisoned Model t
(a) Backdoor Injection via Data Poisoning
(b) Training and Inference on Poisoned Data
Figure 1. A backdoor is injected into selected channels during training and activated at inference to manipulate TSF predictions.
ning, and economic analysis. However, recent studies have shown that TSF models are also susceptible to backdoor attacks (Liang et al., 2024b; Liu et al., 2025a; Liang et al., 2025), where an attacker implants hidden trigger patterns into the data during the training phase such that the model behaves normally under benign inputs but outputs attackerspecified predictions under trigger conditions (Lin et al., 2024). This type of attack is highly covert and may pose serious risks to practical applications relying on TSF (Liu et al., 2025c; Zhang et al., 2024b; Liu et al., 2024a), such as undermining the reliability of decision-making and forecasting (Zhang et al., 2015), which highlights the necessity of studying TSF backdoor defense methods (Wang et al., 2022; Liang et al., 2024a; Guo et al., 2024). Although backdoor defense mechanisms have been extensively studied in classification and generative model domains (Wu et al., 2025a; Li et al., 2025; Lin et al., 2025), backdoor defenses for time series forecasting (TSF) remain significantly underdeveloped. Defense against TSF backdoors is still evidently insufficient. This is mainly due to two inherent challenges in TSF scenarios: one is data entanglement, i.e., multivariate time series exhibiting simultaneous channel structure and temporal dependency (Xu et al., 2026a), which causes backdoor injections to be highly coupled with clean signals at the data level; and the other is task-formulation shift, i.e., TSF shifts from discrete classification to continuous-value regression and training window overlap (Kim et al., 2025), resulting in substantial changes in the discriminative signals relied upon by existing defense methods during training (Kuang et al., 2024; Xu et al., 2026b). Therefore, it is often difficult to directly transfer existing backdoor defense techniques to TSF scenarios.
1. Introduction Time Series Forecasting (TSF) is widely used in critical domains such as climate prediction, transportation plan1
Nanyang Technological University, Singapore. Correspondence to: Siyuan Liang <[email protected]>, Dacheng Tao <[email protected]>. Proceedings of the 43 rd International Conference on Machine Learning, Seoul, South Korea. PMLR 306, 2026. Copyright 2026 by the author(s).
1
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting
To fill the above research gap, we conduct a systematic evaluation of backdoor defenses in TSF scenarios by adapting and analyzing 13 representative defense methods across the four phases of the deep neural network lifecycle (Wu et al., 2025a). Experimental results indicate that the failures of existing methods in TSF mainly manifest in two aspects induced by these inherent challenges: first, data entanglement in multivariate time series leads to channel-level signal dilution, where backdoor injections only affect a subset of channels, making it difficult for sample-level filtering and trigger-synthesis-based defenses to accurately localize backdoors when the attack granularity and defense granularity are mismatched; second, task-formulation shift further causes training loss degeneration, and the continuousvalue regression targets together with overlapping window structures result in poisoned and clean windows exhibiting similar loss distributions during early training stages, thereby weakening or even invalidating defense strategies that rely solely on training losses. In addition, we observe that training-phase defenses (Xun et al., 2025; Liang et al., 2024a) remain effective when relatively reliable clean training data are available.
specific failure modes arising from data entanglement and task-formulation shift. • We propose T IME G UARD, a training-time backdoor defense that learns from channel-wise reliable data and effectively mitigates signal dilution and training-loss degeneration without requiring additional clean samples. • We extensively evaluate T IME G UARD on three TSF forecasters, showing consistent mitigation across three TSF attacks with different settings; ablation studies further validate the contribution of each component. Notably, T IME G UARD also transfers to the LLM-based method, yielding at least a 5.14× MAEP gain with only a 3.8% change in clean MAEC .
2. Threat Model Victim model. Time series forecasting (TSF) (Kim et al., 2025) aims to predict future values over one or multiple horizons given historical observations of a univariate or multivariate time series. We consider a multivariate time series dataset denoted as X ∈ RT ×C , where T is the number of time steps and C is the number of variables (or channels). For each forecasting sample indexed by timestamp t, we denote the history (input) window and future (target) window as Xt,h = X[t − Lin : t, :] and Xt,f = X[t : t + Lout , :], where Lin and Lout denote the history and future lengths, and we use half-open indexing (end exclusive). Thus Xt,h ∈ RLin ×C and Xt,f ∈ RLout ×C . Sliding this windowing process over time yields overlapping-window training set D = {(Xt,h , Xt,f ) | Lin ≤ t ≤ T − Lout }, following standard TSF practice (Nie et al., 2023; Lin et al., 2024). A forecasting model fθ maps histories to futures, i.e., fθ : RLin ×C → RLout ×C , and is trained by minimizing a prediction loss (e.g., mean absolute error (MAE) or mean squared error (MSE)) over D.
Based on the above analysis, we propose a training-time backdoor defense method for TSF, termed T IME G UARD. Motivated by training-phase defenses, T IME G UARD adopts Channel-wise reliable pool training as the core paradigm, reconfiguring conventional sample-level training into finergrained channel-level training, thereby exploiting the majority of channel information in multivariate time series that remains reliable. Building upon this paradigm, we further design a time-aware pool initialization strategy, which selects high-confidence time-channel units from two complementary perspectives of learning behavior and temporal structure, providing an initial reliable pool with higher signal purity. Furthermore, to address the training loss degeneration problem induced by task-formulation shift, T IME G UARD introduces a Distance-Regularized Loss Selection mechanism, which progressively expands the reliable pool during training while reducing the risk of highly correlated poisoned windows being reintroduced into the training process, without sacrificing forecasting performance. Through these designs, T IME G UARD effectively mitigates the signal dilution and training loss degeneration without requiring additional clean data. Experiments on three datasets, three forecasting architectures, and three representative TSF backdoor attacks demonstrate that T IME G UARD substantially improves robustness, achieving a 1.96× improvement in MAEP over the leading baseline, while preserving clean performance within 5% MAEC . Due to space constraints, we defer a detailed discussion of related work to Appendix A. Our main contributions are:
Attacker’s capabilities. We follow the TSF poisoning backdoor setup in BackTime (Lin et al., 2024), as depicted in Figure 1. Given a multivariate training series X, the attacker selects (i) a set of poisoned timestamps Tatk with temporal injection rate ηT and (ii) a set of target variables S with spatial injection rate ηS . For each t ∈ Tatk , the attacker generates a trigger pattern Gt ∈ RLtgr ×|S| and overwrites the Ltgr steps immediately preceding t on the target variables: X[t − Ltgr : t, S] ← Gt . The attacker also overwrites the subsequent Lptn future steps: X[t : t + Lptn , S] ← X[t − Ltgr − 1, S] ⊕ P, where P ∈ RLptn ×|S| is a predefined attack pattern template and ⊕ denotes element-wise addition with broadcasting along the time dimension. Thus, the trigger and target patterns are injected consecutively around t. At inference time t0 , the adversary injects the trigger over the Ltgr most recent steps in the input stream, i.e., during [t0 − Ltgr , t0 ). Trigger gen-
• We present the first systematic evaluation of backdoor defenses for time series forecasting, and reveal two TSF2
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting Table 1. Performance comparison of training-phase defenses on Table 2. Detection performance comparison of inference-time dePEMS03 dataset. Best and second results are bold and underline. fenses on three datasets, averaged over three models. Inference time We report performance averaged across the three forecasting models. is measured on 200 samples. Best and second results are bold and underline. Full per-model results are provided in Appendix G.1. Full per-model results are provided in Appendix G.1. Attack →
Random
BackTime
Defense ↓
MAEC ↓ MAEP ↑ FDER ↑ MAEC ↓ MAEP ↑ FDER ↑
No Defense
17.634 17.772
-
17.607 14.201
-
Spectral (Tran et al., 2018)
18.389 18.356
0.502
18.666 15.245
0.539
TED (Mo et al., 2024)
18.434 20.063
0.528
18.606 13.953
0.495
Dataset
Defense
Total Inference Time (s) ↓
Random
BackTime
AUC ↑ F1 ↑ AUC ↑ F1 ↑
No Defense
2.497
0.500 0.500 0.500 0.500
STRIP (Gao et al., 2019)
278.283
0.518 0.532 0.501 0.516
TeCo (Liu et al., 2023a)
38.407
0.563 0.564 0.478 0.512
PEMS03
TED++ (Le et al., 2025)
19.197 19.184
0.499
18.565 14.541
0.513
IBD-PSC (Hou et al., 2024)
9.903
0.364 0.514 0.486 0.535
Fine-tuning (Gu et al., 2019)
19.003 30.909
0.625
18.934 18.196
0.594
No Defense
2.330
0.500 0.500 0.500 0.500
Fine-pruning (Liu et al., 2018) 19.020 31.643
0.633
18.686 19.736
0.623
STRIP (Gao et al., 2019)
198.480
0.300 0.510 0.497 0.531
NAD (Li et al., 2021b)
18.795 26.809
0.600
18.584 18.158
0.600
TeCo (Liu et al., 2023a)
25.447
0.581 0.590 0.547 0.574
IMS (Dunnett et al., 2025)
19.239 17.731
0.466
18.418 14.351
0.509
IBD-PSC (Hou et al., 2024)
9.838
0.317 0.519 0.390 0.534
ABL (Li et al., 2021a)
19.637 19.104
0.493
18.761 14.481
0.509
No Defense
2.297
0.500 0.500 0.500 0.500
PDB (Wei et al., 2024)
18.630 54.690
0.693
18.967 22.397
0.639
STRIP (Gao et al., 2019)
205.453
0.490 0.525 0.477 0.506
ESTI (Yu et al., 2025)
19.910 17.186
0.454
19.219 15.897
0.532
TeCo (Liu et al., 2023a)
25.443
0.614 0.591 0.524 0.521
T IME G UARD
17.928 104.677 0.868
18.048 39.303
0.808
IBD-PSC (Hou et al., 2024)
9.749
0.378 0.513 0.486 0.518
Weather
ETTm1
eration is constrained to use information available up to the current time (at most t0 ) to respect forecasting timeliness.
3. Revisiting Existing Backdoor Defenses for Forecasting
Attacker’s goals. The attacker aims to poison the training data such that the victim prediction model learns hidden backdoor behaviors (Lin et al., 2024; Xiang et al., 2025): (i) Maintain normal prediction accuracy on clean historical windows; (ii) When the input historical window contains a trigger pattern G on a poisoned channels S, force the model’s predictions on the corresponding channels to follow the attacker-specified target pattern induced by the pre-defined attack template P, while keeping the prediction behavior of the remaining channels unchanged.
This section systematically adapts existing backdoor defenses originally developed for classification to the TSF setting and evaluates their effectiveness. We also introduce FDER as a forecasting-specific metric and analyze the key characteristics and failure modes of existing defenses. 3.1. Experimental Settings Datasets and models. We conduct experiments on three representative datasets, PEMS03 (Song et al., 2020), Weather (Wu et al., 2021), and ETTm1 (Zhou et al., 2022), covering different application domains. Following existing TSF backdoor work (Lin et al., 2024), we evaluate three forecasting models: SimpleTM (Chen et al., 2025a), FEDformer (Zhou et al., 2022), and TimesNet (Wu et al., 2023). We use a 6:2:2 train/validation/test split and report results averaged over the three architectures. More dataset and model details are provided in Appendix F.2 and F.3.
Defender’s capabilities and goals. The defender aims to safeguard forecasting models against backdoor poisoning attacks without prior knowledge of the trigger pattern, attack pattern, or the poisoned timestamps and variables. Depending on the defense strategy, the defender may access different components of the model life cycle, including the training data, the training procedure, the trained model, or only inference-time predictions (Wu et al., 2025a). Some defenses further assume access to a small subset of trusted clean samples (Liu et al., 2018; Wei et al., 2024).
Attack methods. We evaluate against three representative TSF backdoor attacks: Random (Gu et al., 2019), FreqBack-TSF (Huang et al., 2025b), and BackTime (Lin et al., 2024). Random attack injects a fixed random trigger, inspired by BadNets (Gu et al., 2019). FreqBack-TSF adapts FreqBack (Huang et al., 2025b), originally proposed for time series classification, and uses a universal optimized trigger crafted via frequency analysis. BackTime (Lin et al., 2024) is a state-of-the-art TSF attack that generates sampledependent triggers via a GNN-based generator. Unless stated otherwise, we use Lin =Lout =12 with poisoning rates ηT =0.03 and ηS =0.3 following BackTime settings (Lin et al., 2024). Attack details are provided in Appendix F.4.
Accordingly, existing defenses can be broadly categorized into: (i) training-phase defenses, which intervene before, during, or after model training (i.e., pre-training, in-training, or post-training) to obtain models that are robust to backdoor activation while preserving benign forecasting utility and disrupting malicious target alignment (Tran et al., 2018; Li et al., 2021a; Wei et al., 2024); and (ii) inference-time defenses, which detect or suppress triggered inputs at test time without modifying the trained model (Liu et al., 2023a; Gao et al., 2019; Wang et al., 2025).
3
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting
0.32 0.00
0.0 0.1 0.2 0.3 0.4 0.5 0.6
Neighboorhood Distance
Poisoned Channels
0.63 0.00
Forecasting Model
0.4
Clean Samples Poisoned Samples
0.2
0.0
0.0 0.1 0.2 0.3 0.4 0.5 0.6
Neighboorhood Distance
1
5
9
Epoch
13
17
Backcasting Model
0.4
Poisoned Samples Clean Samples
Loss
0.63
1.27
Loss
Clean Samples Poisoned Samples
Proportion (%)
Proportion (%)
Clean Channels
20
Poisoned Samples Clean Samples
0.2
0.0
1
5
9
Epoch
13
17
20
Figure 2. Neighborhood distance distributions of poisoned and clean samples, averaged over clean and poisoned channels, on Weather (Wu et al., 2021) under BackTime (Lin et al., 2024). The neighborhood distance is defined in Section 4.
Figure 3. Training loss of clean and poisoned samples, averaged over poisoned channels, for forecasting and backcasting FEDformer models (Zhou et al., 2022) on the Weather dataset (Wu et al., 2021) under BackTime attack (Lin et al., 2024).
Evaluation metrics. Following prior TSF backdoor settings (Lin et al., 2024; Xiang et al., 2025), we report Mean Absolute Error (MAE) on clean inputs (MAEC ) and on triggered inputs (MAEP ) for training-phase defenses. An effective defense should preserve a low MAEC while achieving high MAEP (Gao et al., 2023a; Yu et al., 2025).
3.2. Backdoor Defenses under TSF Setting Since backdoor defenses for TSF remain underexplored, we adapt 13 representative defenses originally developed for classification, covering the four stages of the model life cycle and diverse defense paradigms (Wu et al., 2025a; Li et al., 2022a; Ren et al., 2025). To ensure a fair comparison, we follow each method’s default implementation whenever applicable and apply minimal modifications needed for TSF. Concretely, we replace accuracy-based criteria with MAE-based counterparts, and for inference-time and input-modification defenses we use time-series-specific modifications; otherwise, we keep the original procedures unchanged.
However, in our preliminary evaluation, we observe “false wins,” where MAEP increases primarily because the model’s overall forecasting quality degrades, which is also reflected by a higher MAEC ; the reverse can also occur, as in the IMS defense in Table 1. To capture robustness gains while penalizing clean-performance degradation, we propose the Forecasting Defense Effectiveness Rating (FDER), adapted from DER (Zhu et al., 2023) but defined using relative MAEbased measures suitable for forecasting:
Specifically, we evaluate ten training-phase defenses, including pre-training methods (Spectral (Tran et al., 2018), TED (Mo et al., 2024), TED++ (Le et al., 2025)), posttraining methods (Fine-tuning (Gu et al., 2019), Finepruning (Liu et al., 2018), NAD (Li et al., 2021b), IMS (Dunnett et al., 2025)), and in-training methods (ABL (Li et al., 2021a), PDB (Wei et al., 2024), ESTI (Yu et al., 2025)), as well as three inference-time defenses (STRIP (Gao et al., 2019), TeCo (Liu et al., 2023a), and IBD-PSC (Hou et al., 2024)). More implementation details, our baseline selection rationale, and a comparison of key defense attributes are deferred to Appendix F.7 and B, respectively.
max(0, ρMAEP ) − max(0, ρMAEC ) + 1 ∈ [0, 1], 2 (1) where the relative attack and clean gain are defined as: FDER =
ρMAEP = 1 −
MAEund P , MAEP
ρMAEC = 1 −
MAEund C . (2) MAEC
und Here MAEund P and MAEC denote the attack/clean MAE errors of the undefended backdoored model. Higher FDER indicates stronger backdoor mitigation with smaller cleanperformance overhead. For inference-time defenses, we evaluate detection capability using AUROC and F1 score, where higher values indicate better performance (Liu et al., 2023a; Wang et al., 2025).
3.3. Preliminary Evaluation and Key Insights We summarize training-phase defense results on PEMS03 and inference-time detection results, both under the Random and BackTime attacks in Table 1 and Table 2, respectively. We highlight four empirical insights, which we analyze next.
Thus, in TSF backdoor settings (Lin et al., 2024), benign behavior corresponds to accurate forecasting on clean inputs, reflected by low MAEC ; malicious success corresponds to triggered inputs being steered toward the attacker’s target, reflected by low MAEP ; and general failure corresponds to poor forecasting quality overall, which is also reflected by high clean-input error. Therefore, an effective TSF defense should preserve benign forecasting utility, as indicated by comparable or lower MAEC , while disrupting malicious target alignment, as indicated by higher MAEP or, more compactly, higher FDER, despite attacker-defined trigger and target patterns. Further discussion is in Appendix E.
Insight 3.1: Sample-level filtering and trigger-synthesis style defenses yield limited robustness gains against TSF backdoor attacks. Sample-level filtering defenses (Spectral, TED, TED++) yield only marginal robustness gains (FDER ≈ 0.54), and trigger-synthesis-based defenses (IMS) achieve similarly near-neutral FDER (best ≈ 0.51), despite comparable MAEC . This suggests that a common bottleneck may arise under channel-subset TSF poisoning, where attackers typically poison only a subset of channels: sample-level criteria are dominated by non-poisoned variables; while trigger syn4
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting
MAEP by only 1.58× with a 7.72% MAEC increase on PEMS03 and still requires clean data. These trends persist across datasets and attacks, as shown in Appendix G.1. Moreover, TSF models are often deployed in continuous real-time settings (Kim et al., 2025; Lin et al., 2024), where inference-time checks can introduce substantial overhead. Together with Insight 3.4, these observations motivate our focus on training-phase defense, which incurs no inferencetime overhead; we leave the development of efficient TSF inference-time defenses for future work.
thesis optimized over all channels receives diluted gradients, leading to “smeared” reconstructions. Consistently, Figure 2 shows that neighborhood distance (Section 4) statistics differ sharply between clean and poisoned channels, indicating that this measure is inherently channel-dependent. Insight 3.2: Defenses relying primarily on training-loss criteria are unreliable and fail to safeguard TSF models against backdoor attacks. Training-loss-only defenses (ABL, ESTI) fail to safeguard TSF models, with an average FDER of 0.497. Figure 3 (FEDformer) shows poisoned-sample losses quickly converging to clean-sample losses within the first few epochs, weakening the early-loss separation signal these methods depend on. This behavior may stem from TSF’s continuous regression objective (rather than an argmax-based discrete target), which encourage poisoned windows to achieve low loss, while overlapping input-output windows introduce affected hard samples, further blurring loss-based partitioning.
4. T IME G UARD Motivated by the partial success of fine-tuning and intraining baselines (Section 3), we propose T IME G UARD, an in-training defense against TSF backdoor attacks that constructs and maintains a channel-wise training pool without requiring any prior clean subset. The key idea is to refactor multivariate TSF training from a sample-level decision into a time × channel-wise decision (Section 4.1), since TSF backdoors often corrupt only a subset of channels (Lin et al., 2024). T IME G UARD then constructs and maintains per-channel reliable pools throughout training process via time-aware criteria (Section 4.2 and Section 4.3).
Insight 3.3: Fine-tuning-based and in-training modelagnostic defenses provide partial mitigation against TSF backdoor attacks, yet require a clean subset. Fine-tuning-based defenses (Fine-tuning, Fine-pruning, NAD) and the in-training model-agnostic defense (PDB) provide partial mitigation, achieving FDER > 0.6 on average across the two attacks. Compared to fine-tuning-based defense, PDB performs best (FDER = 0.666), suggesting that model-agnostic in-training intervention can be more effective than post-hoc repair. However, these methods all assume access to a verified clean subset, which is costly to obtain in time series domain (Lin et al., 2024).
4.1. Channel-wise Reliable Pool Training Many existing defenses (Li et al., 2021a; Huang et al., 2022; Gao et al., 2023a; Shen et al., 2025) adopt a sample-level formulation that discards suspected poisoned forecasting windows and trains on the remaining data. This assumption breaks in multivariate TSF, where backdoor injection often modifies only a subset of channels (Lin et al., 2024), making it wasteful to discard entire windows. Channel-wise objective. Given the training set D, we treat each channel objective independently. Particularly, for channel c, define the channel-wise window set D(c) = (c) (c) (c) (c) {(xt,h , xt,f )}, where xt,h ∈ RLin and xt,f ∈ RLout are the history and future windows. The full channel-wise win(c) (c) (c) dow sample is xt := [xt,h ; xt,f ]. We maintain a per-
Insight 3.4: Inference-time defenses offer marginal detection with high inference overhead in TSF. Inference-time defenses (STRIP, TeCo, IBD-PSC) provide only marginal detection after TSF adaptation, achieving just 0.551 AUROC and 0.559 F1 on the best method, TeCo, despite our attempts for time-aware perturbations and augmentations. Moreover, they impose heavy overhead (4–100×), increasing latency from ∼ 2s to > 200s, makes those impractical for real-time TSF systems (Fan & McDonald, 1994).
(c)
channel reliable pool Drel ⊆ D(c) and an unreliable pool (c) (c) Dunrel = D(c) \ Drel . We further introduce a binary mask mt,c ∈ {0, 1} indicating whether timestamp t for channel c is currently included in the reliable pool. The forecaster is trained by minimizing the masked empirical loss:
Summary. Our evaluation shows inconsistent effectiveness of existing TSF defenses, which we attribute to two TSF-specific failure modes: (1) Data Entanglement (Insights 3.1, 3.4), where channel-subset poisoning and temporal coupling dilute backdoor signals and undermine channelagnostic filtering, trigger synthesis, and inference-time detection; and (2) Task-Formulation Shift (Insight 3.2), where TSF’s regression objective and overlapping windows collapse training-loss-based separation. While fine-tuning and model-agnostic in-training baselines provide partial mitigation (Insight 3.3), the best baseline (PDB) improves
P 1 (c) (c) t,c mt,c ℓ(fθ (Xt,h ), xt,f ), m t,c t,c
Ldef (θ; m) = P
(3) (c) where fθ (·) is the prediction for channel c and ℓ(·, ·) is the forecasting loss. The key challenge is to construct and pro(c) gressively update mt,c so that Drel has high precision (few poisoned windows) while preserving sufficient diversity to maintain clean forecasting performance. For notational simplicity, we omit the channel superscript (c) below. 5
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting Stage I: Time-aware Reliable Pool Initialization
𝒟
Stage II: Distance-Regularized Loss Selection
𝒟
Reverse-Consistency Filtering (RCF)
(Sliding Windows)
Train Tb epochs
𝒃𝝓
Losses on 𝒟
RCF
Distance-Regularized Loss Selection (DRLS)
(𝒟!"# ∪ 𝒟$%!"# ) 𝒟!"#
𝒟'()
Repeat T2 (after warm-up T1) Losses on candidates
Train on 𝒟$%&
𝒇𝜽
Loss Selection
𝒟!"# ← 𝒟'() ∩ 𝒟*+) Neighborhood Diversity Filtering (NDF) Neighbors: 𝒟
NDF
Reverse-Consistency Filtering (RCF) Samples with Loss ≤ Threshold
Threshold
X 𝒟$%!"# ← 𝒟 ∖ 𝒟!"#
𝒟$%!"#
𝒟*+)
NDF
,-#. 𝒟*+)
Update: 𝒟$%& ← 𝒟+'/0 , 𝒟"#$%& ← 𝒟 ∖ 𝒟+'/0
Legend
Neighborhood Diversity Filtering (NDF) Current Sample
Neighbor Candidate
Samples with Distance ≥ Threshold
Poisoned Sample Affected Sample
𝒟*+)
Distance
Loss
Neighborhood Distance
Neighbors from 𝒟/𝒟"#$%& Score on 𝒟
Clean Sample
Threshold
𝒟'()
Training Loss from 𝑏!
Neighbors: 𝒟"#$%&
Neighborhood Distances on 𝒟
𝒟!"#
Reliable Pool
𝒟$%!"#
Unreliable Pool
𝑏& / 𝑓'
Backcaster/ Forecaster
Figure 4. Overview of T IME G UARD. Stage I forms the reliable pool Drel by intersecting the subsets selected by Reverse-Consistency Filtering (RCF) and Neighborhood Diversity Filtering (NDF). Stage II trains fθ while progressively updating Drel via Distance-Regularized Loss Selection (DRLS) to prevent re-admitting correlated poisoned windows. All pools and filtering criteria operate in a channel-wise manner.
Pipeline overview. T IME G UARD instantiates and updates mt,c via a two-stage channel-wise procedure, as summarized in Figure 4. In Stage I: Time-aware Reliable Pool Initialization (Section 4.2), we construct a conservative, highprecision initial reliable pool by intersecting samples selected by two complementary time-aware criteria: ReverseConsistency Filtering (RCF) from a learning-behavior perspective and Neighborhood Diversity Filtering (NDF) from a temporal-structure perspective. In Stage II: DistanceRegularized Loss Selection (Section 4.3), we progressively update the reliable pool using Distance-Regularized Loss Selection (DRLS), which regularizes loss-based admission with neighborhood diversity to avoid re-including correlated, low-loss poisoned windows. Throughout training, the forecaster fθ is trained with the masked objective in Equation 3, and the full algorithm is given in Appendix D.1.
loss alone to separate samples is unreliable in TSF. We instead exploit a temporal asymmetry of TSF backdoors: the injected dependency is designed for the forecasting direction (history → future), but it does not enforce a consistent reverse dependency (future → history) (Lin et al., 2024). This mismatch makes reverse reconstruction less compatible with the backdoor dependency. RCF operationalizes this via an auxiliary backcasting task. We train a backcaster bϕ (Hyndman & Athanasopoulos, 2018) (using the same architecture as fθ ) for a small number of Tb epochs to reconstruct the flipped history window from the flipped future window. Let Flip(·) denote temporal reversal along the time axis. The reverse-consistency loss is: Lrcf (xt ) = ℓ(bϕ (Flip(Xt,f )), Flip(xt,h )).
(4)
We then select samples with relatively low reverseconsistency loss using a quantile threshold ΓRCF (the αquantile):
4.2. Time-aware Reliable Pool Initialization In Stage I, we initialize a high-precision yet conservative reliable pool without any clean reference set. Rather than maximizing recall, this stage aims to provide a trustworthy starting point for subsequent training and prevent early backdoor reinforcement. We therefore apply two complementary criteria and intersect their selections to form Drel .
DRCF = {xt | Lrcf (xt ) ≤ ΓRCF }.
(5)
Neighborhood diversity filtering (NDF). We now introduce the temporal-structure criterion used both in this stage and in the following stage. We begin by analyzing the conditions under which a TSF backdoor succeeds, drawing on NTK-inspired kernel analyses (Jacot et al., 2018) and previous backdoor studies (Guo et al., 2022; Xian et al., 2023).
Reverse-consistency filtering (RCF). As shown in Figure 3 and Table 1, using the forecaster’s forward training 6
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting Table 3. Main results of backdoor defense against TSF backdoor attacks on PEMS03. Best and second results are bold and underline. Lower MAEC indicates better performance, while higher MAEP and FDER are preferred. We report performance averaged across the three forecasting models. Full per-model results and visualization examples are provided in Appendix G.1 and Appendix H, respectively. Attack → Defense ↓
MAEC ↓
Random MAEP ↑
FDER ↑
MAEC ↓
No Defense Spectral (Tran et al., 2018)
17.634 18.389
17.772 18.356
– 0.502
17.583 18.765
14.683 14.027
TED (Mo et al., 2024) TED++ (Le et al., 2025) Fine-tuning (Gu et al., 2019) Fine-pruning (Liu et al., 2018) NAD (Li et al., 2021b) IMS (Dunnett et al., 2025)
18.434 19.197 19.003 19.020 18.795 19.239
20.063 19.184 30.909 31.643 26.809 17.731
0.528 0.499 0.625 0.633 0.600 0.466
18.785 18.706 18.837 19.073 18.539 18.521
ABL (Li et al., 2021a) PDB (Wei et al., 2024)
19.637 18.630
19.104 54.690
0.493 0.693
ESTI (Yu et al., 2025) T IME G UARD
19.910 17.928
17.186 104.677
0.454 0.868
MAEC ↓
BackTime MAEP ↑
FDER ↑
– 0.475
17.607 18.666
14.201 15.245
– 0.539
13.984 13.445 22.479 23.543 20.297 14.570
0.473 0.473 0.641 0.647 0.614 0.479
18.606 18.565 18.934 18.686 18.584 18.418
13.953 14.541 18.196 19.736 18.158 14.351
0.495 0.513 0.594 0.623 0.600 0.509
18.649 19.512
15.055 26.014
0.501 0.652
18.761 18.967
14.481 22.397
0.509 0.639
18.793 17.628
14.684 57.759
0.475 0.847
19.219 18.048
15.897 39.303
0.532 0.808
where x̄i,ω denotes the weighted mean of xi under weights ω as follows: P (τ − Lin )2 τ ωτ xi [τ ] x̄i,ω = P , ωτ = exp − . 2σ 2 τ ωτ (7) We fix σ = 2 in all experiments and define the induced distance dω (xi , xj ) = 1 − rω (xi , xj ). Let NK (i) be the indices of the K nearest neighbors of xi under dω . The neighborhood distance score is: 1 X S(xi ) = dω (xi , xj ). (8) K
This analysis motivates our neighborhood diversity criterion, which we formalize below. Theorem 4.1 (TSF Backdoor Success Bound). Let x := xt,h denote a triggered test input window, and consider a TSF predictor ŷ(x) approximated by a Nadaraya– Watson kernel regressor trained on Np poisoned samples (x′j , T (x′j )) and Nbg background samples (xi , yi ) with an RBF kernel K(u, v) = exp(−γ∥u − v∥22 ), where xi := xi,h and yi := xi,f . Define ε := maxi K(x, xi ) and PNp σp2 (x) := N1p j=1 ∥x−x′j ∥22 . Assume (i) ∥yi −T (x)∥2 ≤ M for all background samples, and (ii) T (·) is locally LipsNp chitz with constant LT on a neighborhood of {x}∪{x′j }j=1 . Then Nbg M ε + LT σp (x). ŷ(x) − T (x) 2 ≤ Np exp − γ σp2 (x)
j∈NK (i)
NDF criterion. To promote temporal-structure diversity and reduce the risk of selecting poisoned windows, NDF prioritizes samples with larger neighborhood distance. Concretely, we select the top α fraction with the highest scores:
Proof. Deferred to Appendix C. Remark 4.2. The bound decreases as poisoned inputs concentrate around the triggered window (small σp (x)), which increases their kernel weight. Thus, successful TSF backdoors tend to induce a tight, highly similar cluster of poisoned input windows and consequently highly similar poisoned input–output windows. For instance-normalized windows, squared Euclidean distance is proportional to 1 − ρ(·, ·) (Pearson correlation) (Berthold & Höppner, 2016), motivating our correlation-based neighborhood distance for identifying more diverse samples as reliable candidates.
DNDF = {xt | S(xt ) ≥ ΓNDF },
(9)
where ΓNDF is the (1 − α)-quantile of {S(xi )}. Empirically, Figure 2 shows that poisoned samples exhibit abnormally smaller neighborhood distances in poisoned channels, consistent with the similarity concentration implied by Theorem 4.1. Finally, we obtain the initial reliable pool by intersecting the two criteria: Drel = DRCF ∩ DNDF . 4.3. Distance-Regularized Loss Selection After initializing Drel , T IME G UARD enters Stage II and progressively updates the reliable pool during training. A key risk in TSF is that poisoned windows may become indistinguishable from clean windows under loss-only criteria as training proceeds. We therefore regularize loss-based selection with a neighborhood-diversity constraint, which maintains forecasting performance while avoiding the reinclusion of highly correlated poisoned windows.
Gaussian-weighted Pearson-correlation neighborhood distance. We measure temporal similarity using a Gaussianweighted Pearson correlation that emphasizes the transition region between history and future. The weighted correlation between two window samples xi and xj is: xi [τ ] − x̄i,ω xj [τ ] − x̄j,ω q 2 P 2 , P τ ωτ xi [τ ] − x̄i,ω τ ωτ xj [τ ] − x̄j,ω P
rω (xi , xj ) = q
FreqBack-TSF MAEP ↑ FDER ↑
τ ωτ
cand DDRLS = {xt ∈ DNDF | L(xt ) ≤ ΓDRLS }.
(6) 7
(10)
T IME G UARD: Channel-wise Pool Training for Backdoor Defense in Time Series Forecasting Table 4. Defense performance across PEMS03, Weather, and ETTm1 datasets under Random and BackTime attacks. Attack → Defense ↓
Random
Attack →
BackTime
MAEC ↓ MAEP ↑ FDER ↑ MAEC ↓ MAEP ↑ FDER ↑
No Defense 17.634 PEMS03 PDB (Wei et al., 2024) 18.630 T IME G UARD 17.928
17.772 54.690 104.677
– 0.693 0.868
17.607 18.967 18.048
14.201 22.397 39.303
– 0.639 0.808
No Defense 11.210 Weather PDB (Wei et al., 2024) 12.305 T IME G UARD 10.587
14.991 91.237 177.583
– 0.841 0.942
10.768 11.732 10.716
15.913 56.439 66.534
– 0.827 0.874
No Defense ETTm1 PDB (Wei et al., 2024) T IME G UARD
1.059 2.972 6.481
– 0.766 0.881
1.114 1.274 1.268
0.805 1.422 1.443
– 0.648 0.652
1.144 1.230 1.235
MAEC ↓ MAEP ↑ FDER ↑ MAEC ↓ MAEP ↑ FDER ↑
No Defense T IME G UARD
17.634 17.928
17.772 104.677
– 0.868
17.607 18.048
14.201 39.303
– 0.808
w/o Channel-wise w/o NDF w/o RCF w/o NDF+RCF w/o DRLS
18.320 18.581 18.063 18.336 19.748
16.145 104.457 104.405 91.780 76.442
0.478 0.853 0.865 0.852 0.607
19.068 18.418 18.608 18.273 20.081
14.925 38.349 39.612 38.560 22.918
0.507 0.795 0.796 0.799 0.586
FDER