Bend the Basics: Degradation-Aware Deformable Tokenization for All-in-One Image Restoration

Zihao He, Yunfeng Wu, Xinchao Wang, Songhua Liu

The Problem with Rigid Grids in Image Restoration

The field of image restoration—which encompasses denoising, deraining, dehazing, deblurring, and low-light enhancement—has increasingly shifted toward "all-in-one" models capable of handling multiple types of visual corruption with a single neural network. Most modern architectures for this task rely on Vision Transformers (ViTs), which process images by breaking them down into a rigid grid of square patches or "tokens."

However, real-world degradations do not adhere to a neat grid. A rain streak or a complex blur kernel might be arbitrarily sliced in half by a patch boundary, forcing a single token to represent an unnatural mix of clean and corrupted pixels. When standard Transformer models attempt to reconstruct the image from these mixed tokens, the result is often visible "grid artifacts"—faint seams or discontinuities along the patch boundaries. This rigid tokenization creates a bottleneck, limiting the model's ability to accurately recover fine details and textures.

Introducing the Flexible Image Transformer (FIT)

To address this fundamental flaw, researchers introduce the Flexible Image Transformer (FIT). FIT moves beyond the rigid patch partitioning of standard ViTs by introducing Degradation-Guided Deformable Tokenization (DGDT). Instead of sampling pixels from a fixed $P \times P$ grid, FIT dynamically "bends" the patch boundaries to adapt to the local structure of the degradation.

Key Mechanisms

  1. Dual-Granularity Degradation Encoder (DGDE): A lightweight convolutional network analyzes the input image to produce two conditioning variables: a global vector ($g$) representing the overall degradation type, and a spatial map ($M$) indicating where the damage is most severe.
  2. Deformable Patch Embedding: Using $g$ and $M$, the model predicts learned spatial offsets ($\Delta$) for every sampling point. Instead of extracting pixels at fixed coordinates $(x, y)$, the model samples from $(x+\Delta x, y+\Delta y)$. This allows patch boundaries to naturally align with the edges of rain streaks or the depth contours of haze.
  3. Deformable Unembedding: To ensure a smooth, artifact-free output, FIT performs the inverse operation during reconstruction, warping the processed tokens back into pixel space using the same learned offsets.
  4. Task-Token Dropout (TTD): To improve robustness across different degradation types, FIT employs a dropout strategy during training. By randomly dropping explicit task labels, the model is forced to rely on its internal degradation encoder, improving its ability to generalize.

Emergent Structural Awareness

One of the most striking findings of the FIT architecture is its emergent geometric awareness. The model learns to "look through" degradations without explicit geometric supervision. For example, in rainy images, the learned sampling offsets naturally align perpendicular to rain streaks. In hazy images, the offsets strongly correlate with scene depth. The model independently discovers that adapting its geometry to the physical structure of the corruption makes restoration significantly easier.

Furthermore, this deformable approach breaks the "capacity plateau" observed in standard fixed-grid models. While traditional models eventually stop improving with increased size due to grid artifact bottlenecks, FIT's flexible tokenization allows it to continuously benefit from scaling.

State-of-the-Art Results

FIT was evaluated across a comprehensive suite of standard benchmarks, including BSD68 (denoising), Rain100L (deraining), SOTS (dehazing), GoPro (deblurring), and LOLv1/LOLv2 (low-light enhancement).

  • Quantitative Dominance: FIT achieves a new state-of-the-art (SOTA) in all-in-one restoration, reaching an average 30.72 dB PSNR on the five-degradation setting—outperforming previous best methods by +0.5 to 1.1 dB.
  • Task-Specific Breakthroughs: The performance gains are most dramatic in tasks characterized by heavy spatial structure. FIT achieves a massive +2.52 dB improvement over baselines in dehazing and +1.66 dB in deraining.
  • Zero-Shot Generalization: When tested on unseen degradations like JPEG compression artifacts, real-world sensor noise, and defocus blur, FIT consistently outperforms rigid-grid baselines, proving that its deformable logic captures universal properties of image corruption.
  • Qualitative Quality: Visual comparisons confirm that FIT produces significantly cleaner textures and sharper edges, entirely eliminating the seam artifacts that plague other Transformer-based restorers.

Limitations and Future Directions

While highly effective, FIT's flexibility comes with a computational cost. The model is roughly 15–20% slower than its fixed-grid counterparts because irregular sampling (which relies on bilinear interpolation) is less optimized for current GPU hardware than dense matrix operations. Additionally, for perfectly uniform corruptions—like synthetic Gaussian noise applied equally to every pixel—the benefits of deformable tokenization are less pronounced, as there is no underlying spatial structure for the grid to follow.

Future iterations of the architecture may explore a "gated" deformation mechanism, applying irregular sampling only in high-uncertainty or highly structured regions to save on computation. This could pave the way for deploying FIT in real-time applications such as mobile photography and autonomous driving.

Summary updated

BibTeX
@inproceedings{he2026bend,
  author = {Zihao He and Yunfeng Wu and Xinchao Wang and Songhua Liu},
  title = {{Bend the Basics: Degradation-Aware Deformable Tokenization for All-in-One Image Restoration}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ZFOA8DZqhl},
}
Figure