← Latest papers
🤖 machine learning

IMFACT: Counterfactual Explanations for Time Series via Intrinsic Mode Function Substitution

This paper introduces IMFACT, a model-agnostic framework that generates physically plausible counterfactual explanations for time series classifiers by decomposing signals into Intrinsic Mode Functions via Empirical Mode Decomposition and substituting selected components with those from Nearest Unlike Neighbors, a method that outperforms existing baselines in reliability, plausibility, and proximity on benchmark datasets.

Original authors: Udo Schlegel, Julian Rakuschek, Thomas Seidl, Andreas Holzinger, Tobias Schreck, Javier Del Ser

Published 2026-08-06
📖 5 min read🧠 Deep dive

Original authors: Udo Schlegel, Julian Rakuschek, Thomas Seidl, Andreas Holzinger, Tobias Schreck, Javier Del Ser

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to teach a robot how to tell the difference between a healthy heartbeat and a sick one, or a smooth engine hum and a grinding gear. You show the robot thousands of recordings, and it learns to spot the patterns. But here's the tricky part: if you ask the robot, "Why did you think this engine was broken?", it can't just point to a single second of noise. The answer is hidden in the rhythm and the vibration of the whole sound. This is the world of time series data—information that changes over time, like stock prices, weather patterns, or machine vibrations.

Now, imagine you want to know what tiny change would have made the robot say, "Actually, this engine is fine." This is called a counterfactual explanation. It's like asking, "What if I had taken a different route?" to understand why you got stuck in traffic. For simple lists of numbers (like your height and weight), this is easy. But for wiggly, vibrating signals, it's a nightmare. If you just randomly tweak the numbers in the signal, you might create a sound that looks mathematically close to the original but sounds like a glitchy robot screaming—a result that makes no physical sense. Scientists need a way to find these "what-if" scenarios that are not only mathematically correct but also sound like something that could actually happen in the real world.

This is where the paper IMFACT comes in. The researchers, led by Udo Schlegel and his team, realized that to fix a vibrating signal without breaking its physics, you shouldn't mess with the raw sound waves directly. Instead, you should take the signal apart into its musical notes. They use a technique called Empirical Mode Decomposition (EMD), which acts like a super-smart prism. It splits a complex, messy vibration into simpler, pure tones called Intrinsic Mode Functions (IMFs). Think of a complex chord played on a piano; EMD separates it into the individual notes (the high squeaks, the mid-range hums, and the low thumps).

The team's big idea is to swap these individual "notes" (IMFs) from a broken signal with notes from a healthy signal until the robot changes its mind. They call this process IMFACT (IMF-based counterfACTuals). Instead of randomly twisting the raw data, they gently replace the "broken" frequencies with "healthy" ones, one by one, until the machine says, "Ah, now this looks like a healthy engine!"

To test if this works, they tried it on two very different things: a dataset of FaultDetectionA, which records vibrations from a machine with a faulty bearing, and FruitFlies, which records the wing-beat sounds of different species of flies. They compared their method against three other popular ways of generating explanations. The results were quite clear. While the other methods sometimes failed to find a solution at all, or created signals that were mathematically close but physically impossible (like a fly wing beating at a speed that would tear it apart), IMFACT succeeded in finding a valid explanation 100% of the time for both datasets.

The paper suggests that by working in this "decomposition space" (swapping the notes rather than the noise), IMFACT creates explanations that are not only correct but also plausible. For instance, on the machine data, their method kept the signal within realistic ranges 93.9% of the time, and for the flies, it was even higher at 98.4%. Furthermore, it was incredibly fast, generating these explanations in about 0.388 seconds for the machine data and 0.239 seconds for the flies. In contrast, one of the other methods took over 111 seconds for the fly data, and another method only succeeded in finding a valid answer for 30% of the fly cases.

The authors found that the best way to do this was to swap the "notes" based on how much their frequency content differed between the healthy and broken states (a strategy called distance), and to cycle through a few different "healthy" examples (specifically three neighbors) to find the best match. They discovered that while some strategies were faster, they often produced less realistic results, and while others were very precise, they were too slow. In fact, the strategy that looked at energy differences (variance) turned out to be the slowest and least effective approach. The "sweet spot" they found was a balanced approach using the distance strategy with three neighbors, which was both fast and reliable.

However, the paper is careful to note that this isn't a magic bullet for every problem yet. The method currently only works on single-channel signals (one microphone, one sensor) and relies on a specific way of breaking down the signal that can sometimes get confused if the signal is too messy. They also admit that while their method worked great on the specific machine and fly datasets they tested, they haven't tried it on every possible type of data or every type of AI model. But, the core finding is strong: if you want to explain why a time-based AI made a decision, it's often better to swap the underlying "ingredients" of the signal rather than just tweaking the final taste.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →