Time series adversarial attacks: an investigation of smooth perturbations and defense approaches

Gautier Pialla, Hassan Ismail Fawaz, Maxime Devanne, Jonathan Weber, Lhassane Idoumghar, Pierre-Alain Muller, Christoph Bergmeir, Daniel F. Schmidt, Geoffrey I. Webb, Germain ForestierInt. J. Data Sci. Anal 2025

Introduction

Deep neural networks (DNNs) have demonstrated remarkable performance in time series classification across various domains, from healthcare (ECG monitoring) to industrial sensor analysis. However, like their counterparts in computer vision, these models are susceptible to adversarial attacks—small, intentional perturbations designed to induce misclassification. While adversarial noise in images is often imperceptible to the human eye, time series data presents a unique challenge: standard iterative attacks often produce jagged, "sawtooth" patterns that are easily identified by human experts or automated detection systems.

The Challenge of Visibility

Most traditional adversarial attacks, such as the Basic Iterative Method (BIM) or Carlini & Wagner (C&W), rely on clipping noise within a specific range. In a one-dimensional time series, this frequently results in high-frequency oscillations that do not resemble natural signal fluctuations. These "jagged" artifacts serve as a clear indicator of tampering, undermining the primary goal of an adversarial attack: stealth. To address this, researchers have sought methods to generate perturbations that are not only small in magnitude but also smooth in their temporal transitions.

The Smooth Gradient Method (SGM)

To overcome the visibility of standard attacks, this research introduces the Smooth Gradient Method (SGM). SGM is a white-box attack that prioritizes "stealth" by enforcing smoothness constraints directly within the optimization objective.

The additive process of generating an adversarial time series. A smooth perturbation is added to the original signal to change its classification from 0 to 1.

Methodology

The core innovation of SGM lies in its objective function, which combines three key components:

  1. Classification Loss: Maximizing the divergence between the original and perturbed probability distributions (typically using KL-divergence).
  2. Magnitude Penalty: An $L_2$ norm penalty to keep the total energy of the noise low.
  3. Smoothness Constraint: A fused lasso term that penalizes the sum of absolute differences between adjacent noise points. This mathematical constraint forces the generated noise to change gradually, eliminating the sharp spikes characteristic of previous methods.

To quantify this effect, the authors utilize a smoothness metric ($s(x)$) based on second-order finite differences, providing a numerical benchmark for the "jaggedness" of a signal.

Experimental Results

The effectiveness of SGM was evaluated using the UCR Archive (128 univariate datasets) and the RTD "air-writing" dataset. The results highlight a critical trade-off between attack success and stealth.

Attack Success Rate (ASR)

When compared against established baselines like the C&W attack, SGM demonstrates competitive performance. As shown in the comparison across the UCR archive, SGM often achieves a higher Average Success Rate (ASR) than C&W while maintaining the required smoothness constraints.

Comparison of Attack Success Rate (ASR) between SGM and C&W across the UCR archive. SGM outperforms C&W on 66 datasets, with 2 draws.

Stealth and Detection

The primary advantage of SGM is its resistance to detection. In experiments where a secondary "detector" model (a Fully Convolutional Network) was trained to identify adversarial samples, SGM-perturbed data proved significantly harder to catch. The detector achieved only ~54% accuracy on SGM samples—barely better than random guessing—compared to over 62% for BIM. On the RTD dataset, SGM-perturbed samples remained visually indistinguishable from originals, even when causing the classifier to misidentify characters with 100% confidence.

Defense and Robustness

The study also investigated mitigation strategies, finding that adversarial training is highly effective against these smooth attacks. By incorporating SGM-generated samples into the training set, the authors were able to reduce the attack success rate to zero for 72 out of the 128 UCR datasets. This suggests that while smooth attacks are harder to detect post-hoc, models can be hardened against them during the training phase.

Conclusion

The Smooth Gradient Method represents a significant step forward in making adversarial attacks on time series data more realistic and harder to detect. By treating smoothness as a first-class citizen in the optimization process, SGM aligns adversarial noise with the natural temporal logic of the underlying signals. Future work will likely explore the application of these smooth constraints in black-box scenarios and more complex multivariate time series environments.

Summary updated

BibTeX
@article{pialla2025time,
  author = {Gautier Pialla and Hassan Ismail Fawaz and Maxime Devanne and Jonathan Weber and Lhassane Idoumghar and Pierre-Alain Muller and Christoph Bergmeir and Daniel F. Schmidt and Geoffrey I. Webb and Germain Forestier},
  title = {{Time series adversarial attacks: an investigation of smooth perturbations and defense approaches}},
  journal = {Int. J. Data Sci. Anal.},
  year = {2025},
  doi = {10.1007/s41060-023-00438-0},
}
Figure