Abstract
While Vision Transformers (ViTs) have established a reputation for inherent robustness in image classification tasks, this study demonstrates that they are "unreasonably vulnerable" when applied to image restoration. Through an analysis of state-of-the-art models like Restormer and NAFNet, we reveal that nearly invisible adversarial perturbations can cause catastrophic failure in pixel-wise reconstruction. We identify specific architectural choices—notably the use of simplified linear gates—as primary sources of instability. Finally, we propose an "easy fix" involving the reintroduction of traditional non-linear activations (ReLU) and adversarial training, which significantly hardens these models against attack.
Introduction
In recent years, Vision Transformers (ViTs) have emerged as the gold standard for a wide array of computer vision tasks. A significant portion of existing literature suggests that ViTs are inherently more robust to adversarial attacks—small, intentional perturbations designed to fool a model—than traditional Convolutional Neural Networks (CNNs). However, this narrative is largely built on classification benchmarks where the goal is to assign a single label to an image.
This paper investigates whether this robustness extends to image restoration, a regression task where every pixel matters. In safety-critical applications such as autonomous driving or medical imaging, the reliability of restoration models is paramount. If a deblurring or denoising model can be "broken" by a perturbation invisible to the human eye, the downstream consequences could be disastrous. We explore why popular restoration models fail under pressure and how they can be effectively hardened.
Methodology
Architectures Under Evaluation
The researchers evaluated several Transformer-based architectures to isolate the causes of vulnerability:
- Restormer: A high-performance model utilizing multi-head self-attention (MHSA) designed for high-resolution image processing.
- NAFNet & Baseline: Simplified versions of Restormer optimized for efficiency. These models replace complex attention mechanisms with "Simple Gates" (element-wise products).
- Intermediate Models: Custom variants designed to isolate specific design choices, such as swapping gates for traditional activation functions.
Adversarial Attacks
To test the limits of these models, two primary adversarial attacks were employed:
- Projected Gradient Descent (PGD): A standard "white-box" attack that iteratively searches for the perturbation that maximizes the model's loss.
- CosPGD: A specialized attack tailored for pixel-wise tasks. It utilizes cosine similarity to focus the attack on pixels the model is currently reconstructing correctly, making the perturbation more efficient and damaging.
Defense Strategy
The primary defense mechanism tested was Adversarial Training (AT). Using the Fast Gradient Sign Method (FGSM), the models were trained on a mixture of clean and perturbed images, teaching the network to ignore adversarial noise during the restoration process.
Key Insights: The Source of Vulnerability
The "Simple Gate" Trap
A critical finding of this research is that the "Simple Gate"—a design choice intended to improve efficiency and clean-data performance in NAFNet—is a major security liability. Under adversarial pressure, these gates produce bizarre grid-like patterns and severe color-mixing artifacts, effectively destroying the restored image.
Attention as a Shield
In contrast, Restormer’s multi-head self-attention (MHSA) provides a degree of inherent protection. The complexity of the attention mechanism appears to help the model generalize better against adversarial noise compared to its simplified counterparts. This suggests that the trend toward "simplifying" Transformers for restoration may inadvertently sacrifice robustness.
The Importance of Non-Linearity
The "easy fix" identified by the authors involves the choice of activation functions. The study found that using non-smooth, non-linear activations like ReLU (Rectified Linear Unit) instead of the "Simple Gate" or GELU significantly improved robustness. Remarkably, this improvement was observed even before adversarial training was applied, suggesting that architectural "smoothness" may actually facilitate adversarial exploitation.
Experimental Results
The study utilized the GoPro dataset for dynamic image deblurring, consisting of 3,214 real-world images. The results highlight a stark contrast between clean and adversarial performance:
- Catastrophic Failure: Under a 5-iteration CosPGD attack, the standard Restormer’s performance plummeted from a Peak Signal-to-Noise Ratio (PSNR) of 31.99 dB to just 11.36 dB. The resulting images were dominated by "ringing" artifacts and spectral noise.
- Effectiveness of Defense: Adversarial training (+ADV) successfully recovered Restormer’s performance to 24.49 dB under the same attack conditions.
- The ReLU Advantage: The "Intermediate + ReLU" model achieved a robust result of 13.87 dB without any adversarial training, outperforming the more complex NAFNet (8.67 dB) under attack.
Conclusion and Future Work
This research challenges the assumption that Transformers are inherently robust across all vision tasks. In the context of image restoration, architectural simplifications made for the sake of efficiency can lead to extreme vulnerability. While the proposed fixes—ReLU activations and adversarial training—significantly harden these models, they do introduce a "Robustness-Accuracy Gap." For instance, Restormer's clean PSNR dropped from 31.99 dB to 30.25 dB after adversarial training.
Future work should focus on narrowing this gap, exploring methods to maintain the crispness of restorations while ensuring the model remains resilient to perturbations. Investigating the role of activation functions during downsampling layers remains a promising avenue for further architectural hardening.
Summary updated