Paper deep dive
IMFACT: Counterfactual Explanations for Time Series via Intrinsic Mode Function Substitution
Udo Schlegel, Julian Rakuschek, Thomas Seidl, Andreas Holzinger, Tobias Schreck, Javier Del Ser
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Oscillatory signals, such as vibration, carry class-discriminative information in specific frequency bands; perturbing them in raw feature space for counterfactual analysis easily destroys their temporal structure and produces physically implausible results. In this work, we introduce IMFACT (IMF-based counterfACTuals), a model-agnostic framework for generating plausible counterfactual explanations for time series classifiers that operates in the decomposition space of Empirical Mode Decomposition. An input signal is split into Intrinsic Mode Functions (IMFs), and selected IMFs are progressively substituted with those of a Nearest Unlike Neighbour (NUN) until the classifier flips to the target class. We evaluate six IMF-selection strategies and a multi-NUN cycling extension on two UCR benchmarks (FaultDetectionA, FruitFlies). The variance-based strategy with three NUNs outperforms two prominent baseline techniques on reliability and plausibility metrics, while cycling across three NUNs yields the best proximity across both datasets.
Tags
Links
- Source: https://arxiv.org/abs/2608.04777v1
- Canonical: https://arxiv.org/abs/2608.04777v1
PDF not stored locally. Use the link above to view on the source site.
Full Text
47,395 characters extracted from source content.
Expand or collapse full text
11institutetext: LMU Munich, Munich, Germany, 11email: udo.schlegel@lmu.de 22institutetext: Munich Center for Machine Learning (MCML), Munich, Germany 33institutetext: TU Graz, Institute of Visual Computing, Graz, Austria 44institutetext: BOKU University Vienna, Vienna, Austria 55institutetext: TECNALIA, Basque Research & Technology Alliance (BRTA), Derio, Spain 66institutetext: University of the Basque Country (EHU), Leioa, Spain IMFACT: Counterfactual Explanations for Time Series via Intrinsic Mode Function Substitution Udo Schlegel Julian Rakuschek Thomas Seidl Andreas Holzinger Tobias Schreck Javier Del Ser Abstract Oscillatory signals, such as vibration, carry class-discriminative information in specific frequency bands; perturbing them in raw feature space for counterfactual analysis easily destroys their temporal structure and produces physically implausible results. In this work, we introduce IMFACT (IMF-based counterfACTuals), a model-agnostic framework for generating plausible counterfactual explanations for time series classifiers that operates in the decomposition space of Empirical Mode Decomposition. An input signal is split into Intrinsic Mode Functions (IMFs), and selected IMFs are progressively substituted with those of a Nearest Unlike Neighbour (NUN) until the classifier flips to the target class. We evaluate six IMF-selection strategies and a multi-NUN cycling extension on two UCR benchmarks (FaultDetectionA, FruitFlies). The variance-based strategy with three NUNs outperforms two prominent baseline techniques on reliability and plausibility metrics, while cycling across three NUNs yields the best proximity across both datasets. 1 Introduction Explainability is a prerequisite for the responsible deployment of machine learning in high-stakes settings such as predictive maintenance, medical diagnosis, and structural health monitoring [17]. Explanation methods are divided into ante-hoc approaches, which build interpretability directly into the model, and post-hoc approaches, which explain a trained black-box model after the fact [6, 21]. Among post-hoc explanation methods, counterfactual explanations hold a privileged position: they are contrastive and directly answer “what minimal change to this input would have produced a different outcome?” [23], supporting actionable decision-making [1]. Oscillatory signals such as mechanical vibrations are particularly challenging in this regard, as their class-discriminative information is encoded in frequency bands rather than individual sample points [11]. For tabular data, Wachter et al. [23] formulated counterfactual generation as a constrained optimization problem that minimizes the distance to the decision boundary. For time series, Native Guide [4] improved upon this by anchoring perturbations to a Nearest Unlike Neighbor (NUN), the closest training sample of a different class, providing an inductive bias towards in-distribution counterfactuals. Glacier [24] extended this by optimizing counterfactuals in a learned latent space regularized towards a NUN, improving plausibility over direct feature-space perturbation. Despite these advances, existing methods often operate directly in raw feature space, which can easily produce implausible waveforms that violate frequency constraints, alter structure, or yield out-of-range amplitudes [20]. In this paper, we propose IMFACT (IMF-based counterfACTuals), a model-agnostic framework that addresses the above limitations by operating in the decomposition space of Empirical Mode Decomposition (EMD) [8]. EMD decomposes a signal into Intrinsic Mode Functions (IMFs), amplitude- and frequency-modulated components without a predetermined basis. As a result, they have been extensively used for vibration-based fault detection because they carry physically interpretable frequency information [11, 25]. Our proposed IMFACT framework introduces a different perspective on counterfactual generation for time series by shifting the perturbation space from raw signal values to an EMD decomposition into IMFs. IMFACT progressively substitutes selected IMFs with those of a NUN until the classifier flips to the target class. Building on this idea, IMFACT defines IMF-selection strategies that explicitly control the trade-off between proximity and plausibility by targeting the signal’s distinct frequency characteristics. By incorporating a multi-NUN extension, IMFACT enhances robustness and diversity in the search process by exploiting multiple target-class references. These design choices are validated on two datasets (FaultDetectionA and FruitFlies), considering six IMF-selection strategies and a multi-NUN cycling extension. Our results show that IMFACT achieves high validity while preserving temporal and amplitude properties, outperforming established baselines (Wachter [23], Native Guide [4], and Glacier [24]) in validity and proximity metrics. The remainder of this paper is structured as follows. section 2 reviews the background on counterfactual explanations, time series-specific approaches, and EMD. section 3 introduces the IMFACT framework and its main components. section 4 describes the experimental setup, including datasets, models, and evaluation metrics, while section 5 presents the results and comparative analysis. section 6 discusses the findings and, finally, section 7 concludes the paper and outlines future research directions stemming from the limitations of our work. 2 Background and Related Work Before describing the proposed IMFACT framework, we review the foundations required by IMFACT, focusing on counterfactual explanations for time series (subsection 2.1), existing counterfactual generation approaches tailored to time series data (subsection 2.2), and finally, Empirical Mode Decomposition and its relevance as a perturbation space (subsection 2.3). 2.1 Counterfactual Explanations A counterfactual explanation ′x for an instance x with label y=f()y=f(x) is a minimally modified version ′x satisfying f(′)=ytarget≠yf(x )=y_target≠ y [23]. Generation typically minimises: ℒ(′)=λ⋅d(,′)+ℓ(f(′),ytarget),L(x )=λ· d(x,x )+ \! (f(x ),y_target ), (1) where d measures proximity and ℓ penalises target-class violation. Beyond validity (the counterfactual is classified as the target class) and proximity (the counterfactual is as close as possible to the original instance), the field converges on plausibility (the counterfactual lies on the data manifold and resembles realistic instances), sparsity (as few features as possible are changed to produce the class flip), and actionability (the required changes are feasible for the user) [7, 22, 1, 20]. 2.2 Counterfactual Explanations for Time Series Wachter et al. [23] provide a model-agnostic baseline via gradient optimization from a random initialization, but are not designed for temporal data and tend to produce diffuse, globally distributed changes. Native Guide [4] retrieves the NUN, extracts a class-discriminative weight vector from class activation maps, and guides perturbation between the query and the NUN, yielding temporally coherent, instance-grounded counterfactuals. Glacier [24] uses gradient search with local latent-space constraints; MASCOTS [16] operates in a symbolic feature space; Schlegel et al. [19] provide a human-in-the-loop method. Schlegel and Seidl [20] provide a survey and taxonomy of counterfactual explanation methods for time series, organizing existing work into optimization-based, evolutionary, instance-based, latent-space, segment-based, and hybrid approaches, and highlighting temporal coherence, plausibility, and actionability as the core open challenges. However, many of these methods, e.g., MASCOTS cannot handle long time series instances to generate counterfactual in a fast fashion. Despite this breadth of methods, none explicitly exploit signal decomposition as a perturbation space, a gap that IMFACT addresses by operating directly on the physically interpretable IMFs produced by EMD. 2.3 Empirical Mode Decomposition EMD [8] decomposes a signal x(t)x(t) into IMFs c1(t),…,cK(t)c_1(t),…,c_K(t) and residual r(t)r(t): x(t)=∑k=1Kck(t)+r(t).x(t)= _k=1^Kc_k(t)+r(t). (2) The sifting algorithm iteratively identifies local extrema, interpolates upper and lower envelopes, subtracts their mean, and repeats until the IMF stopping criterion is met [13]. IMFs are ordered from highest to lowest instantaneous frequency, forming a data-adaptive, complete, near-orthogonal basis suited to non-stationary and non-linear signals [8]. 3 The IMFACT Framework IMFACT generates counterfactual explanations by operating in the IMF decomposition space rather than directly in the raw time series domain. The core idea is to decompose both the query instance and a target-class reference into their constituent frequency modes, then iteratively substitute modes from the reference into the query until the classifier changes its prediction. Figure 1 provides an overview of the pipeline. We first formalise the problem, then describe the four algorithmic stages, the IMF-selection strategies, and the multi-NUN extension. Figure 1: Overview of the IMFACT framework. (1) NUN Retrieval: the Nearest Unlike Neighbor NUNx_NUN of the target class ytargety_target is retrieved for query x of class y. (2) Dual Decomposition: both signals are decomposed via EMD into IMFs IMF1,…,IMFrIMF_1,…,IMF_r plus a residual r, ordered from highest to lowest frequency. (3) IMF Substitution: IMFs are substituted from NUNx_NUN one at a time, in an order set by the chosen selection strategy (e.g. distance, variance, extremes), querying the classifier f after each step until the prediction flips to ytargety_target. (4) Return Counterfactual: the IMFs are summed to give the final counterfactual ′x , preserving unsubstituted structure while incorporating only the minimal components needed to cross the decision boundary. 3.1 Problem Formulation Let ∈ℝTx ^T be a univariate time series of length T, classified by a black-box model f:ℝT→f:R^T as class y=f()y=f(x). Given a target class ytarget≠y_target≠ y, IMFACT aims to find a counterfactual ′∈ℝTx ^T that satisfies three criteria: validity (the counterfactual is classified as the target class, i.e., f(′)=ytargetf(x )=y_target); proximity (the counterfactual stays as close as possible to the original instance, typically measured by |′−|2|x -x|^2); and range validity (each time step of ′x remains within the value range observed for ytargety_target in the training data, ensuring basic plausibility). 3.2 Algorithm Overview IMFACT proceeds in four stages, illustrated in Figure 1. The key intuition is that instead of perturbing the raw time series directly, we operate on its frequency decomposition, replacing one IMF at a time with the corresponding mode from a target-class reference until the decision boundary is crossed. Stage 1 — NUN Retrieval. Given a query x with class y, we retrieve its Nearest Unlike Neighbor NUNx_NUN from the training set via nearest-neighbor search with Euclidean distance restricted to instances with label ytargety_target [4]. The NUN serves as a real, in-distribution representative of the target class and anchors the subsequent perturbation to the data manifold. For clarity, we describe the single-NUN case here; LABEL:sec:multi_nun extends this stage to a pool of n NUNs, from which IMFs are drawn according to a cycling or closest-neighbor policy. Stage 2 — Dual Decomposition. We apply EMD independently to both x and NUNx_NUN, yielding IMF sets ckk=1K\c_k\_k=1^K and ckNUNk=1K′\c_k^NUN\_k=1^K together with residuals r and rNUNr^NUN, indexed from k=1k=1 (highest-frequency oscillation) to k=Kk=K (lowest-frequency oscillation), with r capturing the remaining non-oscillatory trend. If the two decompositions produce a different number of IMFs (K≠K′K≠ K ), we zero-pad the shorter set so that every index k up to max(K,K′) (K,K ) has a defined component in both signals, allowing IMFs to be compared and substituted position-by-position. Each IMF pair (ck,ckNUN)(c_k,c_k^NUN) thus represents the same oscillatory scale in the query and reference signal, respectively, and only the query’s residual r is retained throughout, since it encodes the coarse trend that is not the target of frequency-band substitution. Stage 3 — IMF Selection and Perturbation. We select an ordered sequence of IMF indices =(k1,k2,…)S=(k_1,k_2,…) according to the chosen strategy (subsection 3.3). At each step s, we replace cksc_k_s with cksNUNc_k_s^NUN and iteratively reconstruct the candidate counterfactual as: (s)=∑k∉sck+∑k∈sckNUN+r,x^(s)= _k _sc_k\;+\; _k _sc_k^NUN\;+\;r, (3) where s=k1,…,ksS_s=\k_1,…,k_s\ is the set of already-substituted IMF indices, and r is the query’s own residual from Stage 2, kept fixed and never substituted with rNUNr^NUN. We query the black-box classifier f((s))f(x^(s)) after each substitution and stop as soon as f((s∗))=ytargetf(x^(s^*))=y_target. This greedy one-at-a-time substitution of IMFs ensures that the minimum number of IMFs is modified before validity is achieved, naturally favoring sparse and proximal counterfactuals. In the worst case, the loop runs for |||S| steps, so the total query budget scales linearly in the number of IMFs rather than with the length T of the raw series, which keeps the search efficient even for long signals. Stage 4 — Return. We return ′=(s∗)x =x^(s^*) as the final counterfactual explanation. If no valid counterfactual is found after all IMFs have been substituted, the method is considered unsuccessful for that instance; in this case (s∗)x^(s^*) would coincide with NUNx_NUN itself (up to the retained residual r), and we report the instance as a failure rather than returning this fallback as an explanation. 3.3 IMF-Selection Strategies IMFACT relies on an ordering or weighting over IMFs that determines which modes are substituted first. Different strategies encode different hypotheses about where the class-discriminative information resides. We consider six strategies: • distance: For each IMF, we compute the Jensen–Shannon divergence between the power spectral density (PSD) of the current IMF and the PSD of the corresponding NUN IMF; IMFs with larger divergence are perturbed earlier. This favours modes whose frequency differs most between query and NUN. • variance: For each IMF index, we measure the difference in class-level variance between the source class and the target class, and normalise across IMFs. IMFs whose variance differs most between classes are perturbed first, under the assumption that these modes carry the strongest class-discriminative signal. • extremes: In this case, IMFACT computes the same distance as in distance, and then keep only the strongest and weakest IMF distances per channel, setting all other weights to zero. This focuses perturbation on a single most-different IMF and a single least-different IMF, yielding a highly sparse selection. • coarse_to_fine: We unlock IMFs gradually from coarse to fine scales over iterations. At early iterations only the coarsest (lowest-frequency) IMF is eligible for substitution. Every scoarses_coarse iterations one additional, finer IMF becomes active. Within the active set, distances are computed as in distance and normalised across IMFs. 3.4 Multi-NUN Extension The basic IMFACT framework uses a single NUN as the target-class reference. To reduce dependence on any single neighbour and to enrich the pool of candidate IMFs, we introduce a multi-NUN extension that retrieves the n NUNs NUN(i)i=1n\x_NUN^(i)\_i=1^n from the training set. At each substitution step s, IMFACT chooses from this set according to one of two policies: • cycle: IMFACT cycles through the n NUNs in round-robin order. At step s, the next IMF is taken from NUN i=(smodn)i=(s n), ensuring that all NUNs contribute IMFs through the counterfactual search rather than relying on a single reference. • closest: At each step, for the IMF index k selected by the current strategy, IMFACT chooses the NUN whose corresponding IMF ck(i)c_k^(i) is closest in L2 distance to the query IMF ckc_k. This greedily selects the most similar target-class mode for substitution at that scale. 4 Experimental Setup In this section, we describe the experimental protocol used to evaluate IMFACT. We first outline the benchmark datasets (subsection 4.1) and classifier architecture (subsection 4.2), then detail the counterfactual evaluation metrics (subsection 4.3) and baseline methods (subsection 4.4), which are tested against IMFACT. 4.1 Datasets Our experiments use two benchmark datasets from the Time Series Classification (TSC) website [14] (which hosts and standardizes the UCR archive [2]) to ensure comparability with prior work on time series counterfactual explanations: • FaultDetectionA [12] contains one-dimensional accelerometer recordings from an electromechanical drive system with three operating conditions (healthy and two fault classes). The signals are recorded under controlled laboratory conditions and capture characteristic bearing and shaft vibration patterns that change when faults occur, making this dataset representative of the predictive-maintenance setting in which EMD has been widely applied [11, 25]. • FruitFlies consists of wing-beat recordings from different Drosophila species, where each univariate time series encodes an individual fly’s oscillatory wing-beat pattern over time. The task is to distinguish species based on subtle differences in frequency content and waveform shape, providing a complementary biological benchmark to the mechanical signals of FaultDetectionA. We use the standard train–test split defined on the TSC website, treating each univariate time series as a single-channel input to the classifier. Both datasets exhibit non-stationary, oscillatory behavior, with class-discriminative information concentrated in specific frequency bands rather than at individual time points, which makes them suited for evaluating IMF-based counterfactuals built on EMD. 4.2 Classifier We use a lightweight Convolutional Neural Network (SimpleCNN) implemented in PyTorch [15] as the black-box classifier across all experiments, following Schlegel and Seidl [20]. The architecture comprises four convolutional blocks, each consisting of a Conv1d layer with a stride of 2, batch normalization, ReLU activation, and dropout, followed by two fully-connected layers with batch normalization and dropout, and a softmax output layer. The four convolutional layers use 16, 32, 64, and 128 channels, respectively, with kernel sizes of 5, 5, 3, and 3, progressively downsampling the input; the fully connected layers reduce the flattened representation to 256 and then to 128 units before the final classification head. The model takes a single-channel time series of length T as input and outputs the softmax probabilities over the target classes. The model achieves an F1 score of 0.99 on the FaultDetectionA test dataset and 0.87 on the FruitFlies test dataset. Since IMFACT is model-agnostic and only requires black-box query access, the choice of classifier does not affect the counterfactual generation procedure itself. 4.3 Evaluation Metrics We report a mixture of standard counterfactual metrics and aggregate scores inspired by a Keane-style evaluation [9], computed from per-instance quantities and then averaged over the evaluated set. Specifically, we measure Validity, the proportion of x for which one valid counterfactual ′x is found; Average L2, the average Euclidean distance ‖′−‖2\|x -x\|_2 between sample and cf; Pct. Changed, the fraction of points that differ between x and ′x (one minus sparsity); Range Val., the fraction of time steps in ′x that remain within the empirical value range observed for the target class in the training data; Autocorr., the average Pearson correlation between the lag-1 autocorrelation profiles of x and ′x ; and Time, the average time needed to generate a counterfactual for a single query. 4.4 Baselines We compare IMFACT against two widely used counterfactual baselines and one more recent approach, which is suitable for long time series data: • Wachter [23]: A model-agnostic optimization-based method originally proposed for tabular data. It formulates counterfactual generation as minimizing a loss that trades off proximity to the original instance against a loss enforcing the desired target class, without making any time-series-specific assumptions. • Native Guide [4]: An instance-based method specifically designed for time series. Native Guide retrieves a Nearest Unlike Neighbor from the training set and uses a class-discriminative weight vector (e.g., derived from class activation maps) to highlight and perturb the most important regions of the series towards the guide, thereby producing sparse, proximal counterfactuals. • Glacier [24]: A latent-space counterfactual method for time series. Glacier performs locally constrained optimization over an autoencoder’s latent space, explicitly enforcing smoothness and neighborhood consistency, guided by saliency constraints that localize perturbations to yield more targeted edits. For a fair comparison, all four methods (IMFACT, Native Guide, Wachter, Glacier) are evaluated on the same 50 randomly selected test instances per dataset using the implementation of Schlegel and Seidl [20]. Experiment results and source code can be found online with more in-depth analysis 111Code and results can be found in the CFTS Github Repo at cf_imfact.. 5 Results We structure the evaluation in two parts. First, we present a combined ablation across the IMF-selection strategy and the multi-NUN configuration, on both datasets, to assess how both design choices jointly affect proximity, plausibility, and runtime. Second, we compare the best-performing IMFACT configuration against Native Guide, Wachter, and Glacier on both datasets to situate IMFACT within the broader landscape of time series counterfactual methods. 5.1 IMF-Strategy and Multi-NUN Ablation We ablate two design choices jointly: the IMF-selection strategy (distance, variance, extremes, coarse_to_fine) and the multi-NUN configuration – the number of neighbours (n∈1,2,3,5n\!∈\!\1,2,3,5\) and, for the distance strategy specifically, the neighbour-selection policy (cycle rotates round-robin through the NUN pool; closest greedily selects the locally nearest NUN at each step). distance is the only strategy for which a closest-policy sweep was run; all other strategy rows use cycle. The full grid comprises 19 configurations per dataset (38 total), all of which reach full success (100.0%), so there is no failure case anywhere in this ablation. Table 1 reports the best- and second-best-performing configurations by each metric, the fastest configuration, our recommended default, and a weakest-strategy reference point, on both datasets (Success and Pct. Changed are omitted, since every configuration reaches 100.0% success and ≥99.9≥\!99.9% Pct. Changed); the full grid is provided in the project repository.222Ablation grid for the datsets: https://github.com/visual-xai-for-time-series/counterfactual-explanations-for-time-series/tree/main/cfts/cf_imfact Table 1: Highlights of the combined IMF-strategy × multi-NUN ablation. distance (dist), variance (var), extremes (ext), coarse_to_fine (ctf); cycle (cyc), closest (clst). Bold/underline mark the best/second-best value per column across the grid per dataset; the var reference row is unmarked. Full grid in the project repo. Data Config. Highlight Average L2 Range Val. Autocorr. Time (s) FaultDetectionA ext_n1_cyc Best L2; best range validity 13.476 0.959 0.634 0.905 ext_n3_cyc 2nd-best L2; 2nd-best range validity 13.952 0.954 0.762 0.968 ctf_n3_cyc Best autocorrelation 14.832 0.947 0.886 0.799 ctf_n5_cyc 2nd-best autocorrelation 14.941 0.947 0.882 0.825 dist_n1_cyc Fastest 17.478 0.938 0.750 0.375 dist_n3_cyc Recommended default 16.241 0.943 0.802 0.415 dist_n5_clst Best autocorr. under clst 17.929 0.934 0.804 0.455 var_n1_cyc Weakest strategy (reference) 25.494 0.903 0.805 11.022 FruitFlies ext_n3_cyc Best L2 0.650 0.994 0.989 0.795 ext_n5_cyc 2nd-best L2 0.679 0.994 0.992 0.814 ctf_n3_cyc Best range validity 0.744 0.998 0.995 0.684 dist_n3_clst 2nd-best range validity 0.698 0.997 0.995 0.537 dist_n2_clst Best autocorrelation 0.781 0.992 0.997 0.569 dist_n2_cyc 2nd-best autocorrelation 0.714 0.996 0.996 0.514 dist_n3_cyc Fastest; recommended default 0.696 0.996 0.994 0.449 var_n3_cyc Weakest strategy (reference) 1.121 0.985 0.988 5.494 Reading across the two blocks separates the two ablation effects. Strategy effect: on FaultDetectionA, extremes gives the best proximity and range validity, while coarse_to_fine gives the best autocorrelation preservation; variance is the weakest strategy by a wide margin, way slower than any other strategy and worst on both L2 (25.494) and range validity (0.903) at its best-performing n. On FruitFlies, coarse_to_fine and extremes again lead on plausibility and proximity, and variance is again the slowest and least proximal strategy. Multi-NUN effect: within the distance strategy,the only one with both n and policy varied, cycle outperforms closest on proximity at every neighbour count on FaultDetectionA (e.g. 16.241 vs. 18.619 at three neighbours), while on FruitFlies the ordering reverses at five neighbours, where closest becomes the most proximal configuration in the entire distance block (0.687). closest does, however, attain the best autocorrelation preservation on FaultDetectionA at five neighbours (0.804, multi_nun_closest_n5) and the outright best autocorrelation preservation on FruitFlies at two neighbours (0.997, multi_nun_closest_n2), so the closest policy is not uniformly worse, it simply trades proximity for plausibility in most settings. We settled on distance, n=3n\!=\!3, cycle as the recommended default because it is consistently near the top of the grid on both datasets without being a narrow single-metric winner: best-or-near-best range validity on FaultDetectionA (0.943) and within 0.009 of the best FruitFlies L2 (0.696 vs. 0.687), while avoiding the runtime volatility discussed next. On runtime: distance configurations are the fastest strategy on both datasets (0.375–0.455s on FaultDetectionA, 0.449–0.569s on FruitFlies, excluding one outlier discussed below). variance configurations are consistently and substantially the slowest (11.0–11.1s on FaultDetectionA, 5.5–5.6s on FruitFlies); extremes and coarse_to_fine sit in an intermediate band (roughly 0.76–1.04s on FaultDetectionA, 0.66–0.98s on FruitFlies) that was stable in the latest pass but showed order-of-magnitude spikes in earlier passes, so we would still recommend averaging over additional runs before treating any intermediate-band figure as final. One remaining single-point anomaly, visible in the full repository grid: multi_nun_closest_n5 on FruitFlies measured at 5.301s in the latest pass versus 0.53–0.61s previously and versus every neighbouring configuration in the same block, which we treat as noise rather than a genuine cost. 5.2 Baseline Comparison Table 2 reports the direct comparison of IMFACT against Wachter [23], Native Guide [4], and Glacier [24] on both datasets. IMFACT is one of three methods to reach full validity on FaultDetectionA (100.0%, tied with Glacier and Native Guide) and one of two to reach full validity on FruitFlies (100.0%, tied with Native Guide); Wachter reaches only partial validity on both datasets (58.0% and 30.0%), and Glacier’s validity collapses to 36.0% on FruitFlies despite being fully valid on FaultDetectionA. Figure 2 shows a representative successful instance from each dataset, illustrating how the four methods differ in the shape of the counterfactuals they produce even when all reach validity. Table 2: Baseline comparison against Wachter [23], Native Guide [4], and Glacier [24]. Bold/underline mark best/second-best per column within each dataset, excluding Time and Pct. Changed; Validity is unmarked wherever methods tie for best. FruitFlies figures are carried over from the previous measurement pass (subsection 5.1). Data Method Validity (%) Average L2 Pct. Changed Range Val. Autocorr. Time (s) Fault- DetectionA Glacier 100.0 8.788 99.961 0.936 0.960 1.327 IMFACT 100.0 18.862 100.000 0.939 0.685 0.388 Native Guide 100.0 20.843 58.974 0.922 0.837 7.218 Wachter 58.0 14.751 99.997 0.947 0.825 11.792 FruitFlies Glacier 36.0 3.550 99.984 0.198 0.174 19.575 IMFACT 100.0 0.922 99.976 0.984 0.987 0.239 Native Guide 100.0 0.871 54.534 0.980 0.989 111.910 Wachter 30.0 1.070 100.000 0.959 0.985 0.059 On FaultDetectionA, Native Guide [4] reaches full validity in aggregate, but has the lowest range validity of the four methods on this dataset (0.922) and, notably, changes only 58.974% of timesteps on average (Table 2) versus 100% for every other method, confirming that its edits are concentrated in a small region rather than spread across the series. On FruitFlies, Native Guide also reaches full validity and, in fact, attains the lowest L2 distance of any method (0.871) and the highest autocorrelation preservation (0.989), narrowly ahead of IMFACT, despite changing only 54.534% of timesteps on average, the lowest Pct. Changed of any method on either dataset. Its main drawback is computational cost: Native Guide is roughly 19×19× slower than IMFACT on FaultDetectionA, a ratio that has held consistently across repeated measurement passes even as the absolute times drifted (8.901s vs. 0.471s in one pass, 7.218s vs. 0.388s in the latest). On FruitFlies, the available measurements disagree substantially on magnitude (Native Guide at ∼43× \!43× slower in one run and ∼468× \!468× slower, 111.910s vs. 0.239s, in another), so while Native Guide is consistently and substantially the slower method, we do not report a specific multiplier for FruitFlies pending a more stable runtime measurement. Wachter et al. [23] shows a different trade-off: on FaultDetectionA it achieves lower L2 (14.751) and higher range validity (0.947) than IMFACT whenever it succeeds, and it remains among the fastest methods on FruitFlies (0.059s), but it succeeds on only 58.0% of FaultDetectionA instances and 30.0% of FruitFlies instances. This confirms the well-known limitation that unconstrained gradient-free optimisation frequently fails to reach the decision boundary, even when the counterfactuals it does produce look reasonable in isolation [20]; Figure 2 illustrates the correspondingly larger visual departure from the original signal that Wachter’s successful counterfactuals still exhibit. Wachter’s own runtime on FaultDetectionA has been especially unstable across measurement passes, rising from 3.888s to 11.792s, now the slowest of the four methods on this dataset, which we flag as a further symptom of the runtime measurement noise discussed above rather than a stable characterisation of the method. Glacier [24] is the strongest method on FaultDetectionA by nearly every metric other than validity, where it ties IMFACT and Native Guide at 100.0%: it attains the lowest L2 (8.788) and the highest autocorrelation preservation (0.960) of any method on this dataset. This strength does not transfer to FruitFlies, however, where Glacier’s validity collapses to 36.0% and its range validity and autocorrelation preservation both fall below 0.2 (0.198 and 0.174, respectively), indicating that a large fraction of its counterfactuals fall outside the plausible signal range entirely. IMFACT is the only method that achieves full validity on both datasets while avoiding both of these failure modes: Glacier’s dataset-dependent collapse and Native Guide’s high computational cost. Its own proximity and plausibility metrics are not uniformly best, Glacier is more proximal and better at preserving autocorrelation on FaultDetectionA, and Native Guide is marginally more proximal on FruitFlies, but IMFACT is the only method to combine full validity, competitive plausibility (range validity of 0.939 and 0.984 on FaultDetectionA and FruitFlies, respectively), and low runtime (0.388s on FaultDetectionA; 0.239–0.271s across FruitFlies measurement passes) consistently across both settings. Notably, IMFACT has also been the most stable method on runtime across repeated measurement: while Glacier, Native Guide, and Wachter have each shown multi-second to two-orders-of-magnitude swings between passes, IMFACT’s runtime has stayed within a narrow band on both datasets. Summary – Each baseline exhibits a distinct failure mode that IMFACT avoids: Glacier’s validity collapses on FruitFlies, Wachter reaches the decision boundary only partially on either dataset, and Native Guide matches IMFACT’s validity but at far higher and less stable runtime. IMFACT is thus the only method combining validity, plausibility, and stable low runtime across datasets. Figure 2: Counterfactual waveforms for representative instances on FaultDetectionA (sample 25, true class 0, left) and FruitFlies (sample 43, true class 0, right). All four methods (IMFACT, Native Guide, Wachter, and Glacier) reach a valid counterfactual on both instances. IMFACT, Native Guide, and Glacier track the original signal’s morphology closely on both datasets, while Wachter produces a visibly more divergent waveform on both instances despite reaching validity, illustrating that validity alone does not guarantee visual proximity to the original signal. 6 Discussion Why EMD works as a perturbation space – IMFs are physically interpretable and hierarchically ordered in terms of influence. In vibration signals, high-index IMFs capture bearing resonance and fault-characteristic frequencies, while low-index IMFs encode broadband noise [11, 25]. In our ablation (Table 1), it is extremes rather than variance that yields the closest, most plausible counterfactuals, and coarse_to_fine that best preserves autocorrelation. This suggests the classifiers are more sensitive to localized amplitude extrema than to the single most energetically dominant mode: substituting that mode wholesale, as variance does, requires the fewest search iterations (12–20 vs. 61–103 for the other strategies) but each such step is far larger and costlier, leaving variance both the least proximal strategy and, by over 10×10×, the slowest. Reaching the decision boundary quickly along the variance axis evidently means overshooting it in signal space, though we infer this from aggregate ablations rather than from direct evidence that IMF tracks what the classifier actually uses; confirming it would need instance-level checks such as attributions to individual IMFs [18]. On evaluation and multi-metric validation – A single validity metric is insufficient for assessing counterfactual quality [3], because each baseline in our study looks strong on validity alone while failing along others. Glacier [24] reaches full validity and the best proximity and autocorrelation on FaultDetectionA, yet its validity collapses to 36.0% on FruitFlies, where its remaining counterfactuals are also implausible (range validity and autocorrelation both <0.2<0.2); a validity score computed on a single dataset would miss this dataset-dependent collapse. Wachter et al. [23] is only partially valid on both datasets (58.0%, 30.0%), so its seemingly competitive proximity is measured over an easier subset of instances rather than the full evaluation set. Native Guide [4] reaches full validity and even leads on FruitFlies proximity and autocorrelation, but does so by concentrating its edits in a small region of the series, changing only 54.5–59.0% of timesteps versus roughly 100% for the other methods; this is a plausibility problem that validity and proximity alone cannot reveal. Together these cases show that validity, proximity, and plausibility can each look good in isolation while masking a failure visible only in another metric, which is why we report them jointly, alongside runtime, rather than relying on any single score [10, 20, 22]. For the same reason, we report runtime stability rather than a single measurement: several baselines’ wall-clock times varied by an order of magnitude or more across repeated passes (subsection 5.1), so a one-shot timing figure would be misleading on its own. Generality and transferability – EMD applies to any non-stationary oscillatory signal without domain-specific adaptation. The FruitFlies results confirm transfer to a biological signal with a different frequency profile: IMFACT is the only method to reach full validity on both datasets while remaining plausibility-competitive (range validity 0.939 and 0.984) and runtime-stable across measurement passes. The NUN-guided substitution is also classifier-agnostic, requiring no gradients or model internals, making it applicable to any black-box classifier, with natural extensions to electroencephalography and financial time series, which share the non-stationary character IMF decomposition targets [8, 13]. 7 Conclusions, Limitations and Future Work This work presented IMFACT, a model-agnostic framework for counterfactual explanation of time series classifiers that operates in the EMD space. By decomposing signals into physically meaningful IMFs and substituting them with IMFs drawn from a NUN, IMFACT produces counterfactuals that are valid, proximal, and plausible in temporal structure and value range. Across IMF-selection strategies and multi-NUN configurations on two benchmark datasets, nearly all variants achieved high success rates while preserving key signal characteristics; the one exception, maxmin on FaultDetectionA, shows strategy choice can be dataset-dependent rather than universal. No single strategy dominates, variance is consistently most plausible, but the most proximal strategy varies by dataset, while cyclic multi-NUN with three neighbours offers the most consistent overall trade-off. Against Wachter, Native Guide, and Glacier, IMFACT is the only method to reach full validity on both datasets, with substantially lower and more stable runtime than the strongest competing baselines. These findings support signal-decomposition-native perturbation spaces for time series counterfactual explanation, particularly where frequency content and temporal coherence are critical to a plausible explanation. Limitations and future work – The evaluation uses sampled subsets of two datasets; full-dataset evaluation across more UCR benchmarks with confidence intervals over multiple seeds is needed to confirm generality. Single-sample traces show sensitivity to the specific NUN retrieved, and all experiments use a SimpleCNN, so behaviour on deeper architectures (ResNet, InceptionTime, Transformers) with more complex decision boundaries remains untested; IMFACT is model-agnostic by construction but this has not been verified empirically. The method is also currently limited to univariate series, extending to multivariate data requires a principled way to align IMFs across channels. Two further limitations concern the core mechanism itself: (i) EMD is prone to mode mixing, so the same IMF index need not correspond to the same physical phenomenon across the query and NUN, and our zero-padding heuristic for K≠K′K≠ K does not resolve this; and (i) the greedy, one-IMF-at-a-time search is not guaranteed to find the globally sparsest or most proximal counterfactual, and the best-performing IMF-selection strategy varies by dataset (e.g. maxmin fails outright on FaultDetectionA), so some per-dataset tuning is currently required rather than a single default that works everywhere. On the computational side, variance is the slowest strategy despite using the fewest iterations (11–13 vs. 61–103 on FruitFlies), since each substitution targets a large, energetically dominant IMF; Ensemble EMD or Variational Mode Decomposition [5] could reduce this cost. We also observed runtime volatility of up to two orders of magnitude across repeated passes for the baselines, while IMFACT’s runtime stayed stable; a more controlled timing protocol is needed before drawing firm conclusions about relative runtime. Finally, we plan to add further plausibility metrics (density-based measures, adversarial detectability, human ratings) to more comprehensively assess realism and trustworthiness. credits 7.0.1 Acknowledgements We thank the creators of the UCR/UEA Time Series Archive for enabling rigorous evaluation of these methods. We are also grateful to the researchers whose work we reviewed for their contributions to interpretable machine learning. References [1] E. C. Chukwu, R. M. Schouten, M. Tabak, and M. Pechenizkiy (2025) Counterfactual Explanations for Time Series Should be Human-Centered and Temporally Coherent in Interventions. arXiv preprint arXiv:2512.14559. Cited by: §1, §2.1. [2] H. A. Dau, A. Bagnall, K. Kamgar, C. M. Yeh, Y. Zhu, S. Gharghabi, C. A. Ratanamahatana, and E. Keogh (2019) The UCR time series archive. IEEE/CAA Journal of Automatica Sinica. Cited by: §4.1. [3] J. Del Ser, A. Barredo-Arrieta, N. Díaz-Rodríguez, F. Herrera, A. Saranti, and A. Holzinger (2024) On generating trustworthy counterfactual explanations. Information Sciences. Cited by: §6. [4] E. Delaney, D. Greene, and M. T. Keane (2021) Instance-based counterfactual explanations for time series classification. In International Conference on Case-Based Reasoning, Cited by: §1, §1, §2.2, §3.2, 2nd item, §5.2, §5.2, Table 2, §6. [5] K. Dragomiretskiy and D. Zosso (2013) Variational mode decomposition. IEEE transactions on signal processing. Cited by: §7. [6] R. Guidotti, A. Monreale, S. Ruggieri, F. Turini, F. Giannotti, and D. Pedreschi (2018) A survey of methods for explaining black box models. ACM Computing Surveys. Cited by: §1. [7] R. Guidotti (2022) Counterfactual explanations and how to find them: literature review and benchmarking. Data Mining and Knowledge Discovery. Cited by: §2.1. [8] N. E. Huang, Z. Shen, S. R. Long, M. C. Wu, H. H. Shih, Q. Zheng, N. Yen, C. C. Tung, and H. H. Liu (1998) The empirical mode decomposition and the hilbert spectrum for nonlinear and non-stationary time series analysis. Proceedings of the Royal Society of London. Series A: mathematical, physical and engineering sciences. Cited by: §1, §2.3, §2.3, §6. [9] M. T. Keane, E. M. Kenny, E. Delaney, and B. Smyth (2021) If only we had better counterfactual explanations: five key deficits to rectify in the evaluation of counterfactual xai techniques. International Joint Conference on Artificial Intelligence. Cited by: §4.3. [10] M. Kostrzewa, K. Galus, and M. Zięba (2026) Towards plausibility in time series counterfactual explanations. arXiv preprint arXiv:2603.08349. Cited by: §6. [11] Y. Lei, J. Lin, Z. He, and M. J. Zuo (2013) A review on empirical mode decomposition in fault diagnosis of rotating machinery. Mechanical systems and signal processing. Cited by: §1, §1, 1st item, §6. [12] C. Lessmeier, J. K. Kimotho, D. Zimmer, and W. Sextro (2016) Condition monitoring of bearing damage in electromechanical drive systems by using motor current signals of electric motors: a benchmark data set for data-driven classification. In PHM Society European Conference, Cited by: 1st item. [13] P. J. J. Luukko, J. Helske, and E. Räsänen (2016) Introducing libeemd: a program package for performing the ensemble empirical mode decomposition. Computational Statistics. Cited by: §2.3, §6. [14] M. Middlehurst, A. Ismail-Fawaz, A. Guillaume, C. Holder, D. Guijo-Rubio, G. Bulatova, L. Tsaprounis, L. Mentel, M. Walter, P. Schäfer, and A. Bagnall (2024) Aeon: a python toolkit for learning from time series. Journal of Machine Learning Research. Cited by: §4.1. [15] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. (2019) Pytorch: an imperative style, high-performance deep learning library. Advances in neural information processing systems. Cited by: §4.2. [16] D. Płudowski, F. Spinnato, P. Wilczyński, K. Kotowski, E. V. Ntagiou, R. Guidotti, and P. Biecek (2025) Mascots: model-agnostic symbolic counterfactual explanations for time series. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, Cited by: §2.2. [17] C. Rudin (2019) Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence. Cited by: §1. [18] U. Schlegel, D. Oelke, D. A. Keim, and M. El-Assady (2023) Visual Explanations with Attributions and Counterfactuals on Time Series Classification. arXiv preprint arXiv:2307.08494. Cited by: §6. [19] U. Schlegel, J. Rauscher, and D. A. Keim (2024) Interactive Counterfactual Generation for Univariate Time Series. In Workshop on eXplainable Knowledge Discovery in Data Mining (XKDD), Cited by: §2.2. [20] U. Schlegel and T. Seidl (2026) What-if explanations over time: counterfactuals for time series classification. In World Conference on Explainable Artificial Intelligence (XAI), Cited by: §1, §2.1, §2.2, §4.2, §4.4, §5.2, §6. [21] A. Theissler, F. Spinnato, U. Schlegel, and R. Guidotti (2022) Explainable AI for time series classification: a review, taxonomy and research directions. IEEE Access. Cited by: §1. [22] S. Verma, V. Boonsanong, M. Hoang, K. Hines, J. Dickerson, and C. Shah (2024) Counterfactual explanations and algorithmic recourses for machine learning: a review. ACM Computing Surveys. Cited by: §2.1, §6. [23] S. Wachter, B. Mittelstadt, and C. Russell (2017) Counterfactual explanations without opening the black box: Automated decisions and the GDPR. Harv. JL & Tech.. Cited by: §1, §1, §1, §2.1, §2.2, 1st item, §5.2, §5.2, Table 2, §6. [24] Z. Wang, I. Samsten, I. Miliou, R. Mochaourab, and P. Papapetrou (2024) Glacier: guided locally constrained counterfactual explanations for time series classification. Machine Learning. Cited by: §1, §1, §2.2, 3rd item, §5.2, §5.2, Table 2, §6. [25] Z. Wu and N. E. Huang (2009) Ensemble empirical mode decomposition: a noise-assisted data analysis method. Advances in adaptive data analysis. Cited by: §1, 1st item, §6.