FourStat: A Dual AutoEncoder Leveraging Frequency and Stationarity for Time Series Anomaly Detection

Saman Hadian, Ramtin Moslemi, Mohammad Mohammadi, Sarina Heshmati, Siavash Ahmadi, Babak Hossein Khalaj, Mohammad Hossein RohbanarXiv 2026

TL;DR

Finding anomalies in a single stream of data over time is like listening to a symphony through a keyhole: look too closely, and you miss a skipped beat; zoom out too far, and a tiny, sharp squeak gets drowned out. FourStat solves this by splitting the job between two specialized neural networks—one listening for big-picture rhythms in the frequency domain, and another watching for sudden local hiccups. Along the way, the authors introduce a strict, pass/fail evaluation metric called "Perfect Point" to cut through the noisy, threshold-gaming benchmarks common in time series research.

What Problem Does This Paper Address?

Univariate Time Series Anomaly Detection (TSAD)—spotting weird behavior in a single continuous signal like an ECG or an industrial sensor—suffers from a Goldilocks problem with window sizes.

Most reconstruction-based models chop long time series into small, fixed-length windows to learn what "normal" looks like. However, small windows suffer from contextual blindness: if an anomaly is a missing peak or an abnormally long pause in a slow cycle, a narrow window only sees a flat line—which looks completely normal in isolation.

Examples of contextual anomalies—like a missing peak or a time shift—that are invisible to narrow input windows.

Conversely, feeding giant windows into standard models causes headaches: LSTMs forget, Transformers demand too much data, and single-point spikes get "diluted" when averaged across hundreds of normal data points.

To make matters worse, TSAD evaluation is notoriously brittle. Standard F1-scores depend heavily on manually chosen thresholds and can be artificially inflated. (For instance, randomly guessing on a dataset with long, rare anomalies can bizarrely yield a ~97% composite F1-score!)

Methods

Instead of forcing one network to do everything, FourStat decomposes the problem using a dual-autoencoder architecture, preceded by a clever window-sizing trick:

  • Adaptive Context Selection: Rather than guessing a window size, FourStat runs a fast, binary-search-style sweep using its Fourier module as a lightweight proxy, shrinking the window until just before reconstruction quality drops.
  • Fourier AutoEncoder (FAE) for the Big Picture: Operating on the full, large window, the FAE uses a Fast Fourier Transform (FFT) to convert the time series into the frequency domain (separating real and imaginary components), passes them through standard fully connected layers, and converts them back via Inverse FFT. To prevent the model from lazily predicting a flat mean line—a classic flaw of Mean Squared Error (MSE) when amplitudes are near zero—it uses a novel composite loss combining MSE with scale-aware Relative Squared Error (RSE).
  • Stationary AutoEncoder (SAE) for Local Spikes: In parallel, an LSTM-based autoencoder looks only at the final 32 time steps of the window. It uses a dual loss: a stationarity loss that forces the latent representation toward a mean of 0 and standard deviation of 1 (stripping away local trends), and a MaxDiff loss that penalizes the single worst point-wise reconstruction error rather than the average, keeping it hyper-sensitive to sharp spikes. Its output is added directly to the tail end of the FAE's reconstruction.
The FourStat architecture, combining a global frequency-domain FAE on the full window with a local LSTM-based SAE on the final 32 steps.

Finally, the authors introduce Perfect Point (PP), a binary, threshold-free evaluation metric. Acting like a software unit test, PP asks a simple, unforgiving question: Does ANY threshold exist where the model catches 100% of anomalous events with zero false-positive points?

Datasets

The main text evaluates models across 311 univariate time series categorized into 10 distinct anomaly groups (such as Amplitude, Flat, Frequency, Missing, Reversed, and Time Shift). Examples from the TSB-AD benchmark are explicitly illustrated, though the full breakdown of datasets and experimental settings is deferred to the paper's appendices (not included in the main body).

Key Insights and Ideas

  • Why MSE flattens wavy signals: Visualizing loss landscapes reveals that near zero amplitude, MSE has a flat plateau with almost zero gradient, trapping optimizers. Blending in RSE carves out helpful valleys around Fourier harmonics, guiding the network toward the true frequency and amplitude.
Loss surfaces showing how combining MSE and RSE smooths out flat plateaus and highlights harmonic frequencies.
  • Decoupling beats compromising: You don't need a massive sequence model to spot a local blip, and you shouldn't use a short-memory model to learn long seasons. Separating global frequency modeling (FAE) from local, worst-case error tracking (SAE) prevents "anomaly dilution."
  • Group robustness exposes hidden blind spots: Many baselines look great on aggregate benchmarks simply because one easy anomaly type dominates the dataset. Breaking results down by anomaly structure reveals that standard reconstruction models completely fail (scoring 0) on missing peaks or reversed segments.

Key Results

Evaluated across 311 time series using the strict Perfect Point metric:

  • Adaptive FourStat achieves the highest overall score, finding a Perfect Point on 196 out of 311 series (and 188 without adaptive windowing).
  • It outperforms strong forecasting-based Transformers like PSformer (176) and Informer (174), and dramatically outpaces classic reconstruction baselines like LSTM-AE (96), USAD (91), and DAGMM (90).
  • Component ablation shows why both halves matter: standalone FAE achieves 163 Perfect Points (excelling at time shifts and noise), while adding the SAE and adaptive windowing pushes performance to the top spot across 7 of the 10 anomaly categories—especially on subtle flat segments (19/28) and frequency shifts (11/14).

Limitations and Future Work

  • Perfect Point is not a deployment threshold: The authors candidly note that while PP proves whether a model's anomaly scores are cleanly separable using ground-truth labels, it does not solve the practical problem of picking an operating threshold in live deployment.
  • Remaining blind spots: Even with Adaptive FourStat, over a third of the tested time series (115 out of 311) still fail to achieve a Perfect Point—particularly on "Missing" (7/17) and "Inverted" (10/19) anomalies—highlighting that subtle univariate anomalies remain an open challenge. Future work directions are not explicitly discussed in the main text.

Summary updated

Abstract

While numerous studies have focused on multivariate time series anomaly detection, many existing methods perform poorly or are not directly applicable to univariate settings. We introduce FourStat, a dual-model framework for univariate time series anomaly detection that combines two complementary approaches. The Fourier Autoencoder (FAE) captures global patterns like seasonality through frequency-domain analysis, while the Stationary Autoencoder (SAE) focuses on local structures by enforcing statistical stationarity. We also propose a new evaluation metric called Perfect Point that assesses whether perfect F1-scores can be achieved directly from anomaly scores, eliminating thresholding subjectivity. Results demonstrate that FourStat outperforms existing baselines, particularly on challenging anomaly types, while the new metric provides clearer insights into model performance gaps and advantages.
BibTeX
@misc{hadian2026fourstat,
  author = {Saman Hadian and Ramtin Moslemi and Mohammad Mohammadi and Sarina Heshmati and Siavash Ahmadi and Babak Hossein Khalaj and Mohammad Hossein Rohban},
  title = {{FourStat: A Dual AutoEncoder Leveraging Frequency and Stationarity for Time Series Anomaly Detection}},
  year = {2026},
  eprint = {2611.32714},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32714},
}
Figure