Introduction
Arbitrary-Scale Image Super-Resolution (ASSR) is a challenging computer vision task where a single model must upscale images to any non-integer factor (e.g., x2.3 or x3.7). While current models achieve high accuracy, they often suffer from significant computational inefficiency. Most existing feature extractors are "scale-agnostic," applying the same heavy-duty processing regardless of whether the task is a simple x2 upscale of a smooth image or a complex x4 upscale of a textured scene.
The Task-Aware Dynamic Transformer (TADT) addresses this redundancy by introducing a "task-aware" feature extractor. By dynamically adapting its internal architecture based on both input content and target magnification, TADT achieves state-of-the-art accuracy while significantly reducing computational overhead compared to fixed-architecture models like SwinIR.
Methodology: Dynamic Routing and Multi-Scale Transformers
The core of TADT is its ability to intelligently allocate computational resources. The architecture consists of two main components: a Task-Aware Routing Controller (TARC) and a Multi-Scale Transformer Backbone.
Task-Aware Routing Controller (TARC)
The TARC acts as the decision-making unit of the system. It processes the input image and the target scale factor to predict an optimal inference path. It generates a routing vector that determines which branches within the transformer blocks should be activated or bypassed. To make these discrete "on/off" decisions differentiable during training, the authors employ Bernoulli sampling combined with a Straight-Through Estimator (STE), allowing gradients to flow through non-differentiable routing choices.
Multi-Scale Transformer Blocks (MSTB)
The backbone is composed of groups of MSTBs. Each block contains four parallel branches: three dedicated to Local Self-Attention (LSA) with varying window sizes and one for Global Self-Attention (GSA). Depending on the routing vector from the TARC, specific branches are bypassed to save computation for "easier" tasks.
To ensure theoretical savings translate to real-world performance, TADT utilizes Slice-able Linear Projections. When branches are inactive, the model uses a sliced weight matrix to avoid unnecessary multiplications, effectively reducing FLOPs without sacrificing the integrity of the feature maps. Additionally, a task-aware loss function ($L_\beta$) penalizes the "intensity" of activated branches, encouraging the model to find the most efficient path that still meets accuracy requirements.
Performance and Efficiency
The model was trained on the DIV2K dataset and evaluated against standard benchmarks including Set5, Set14, B100, Urban100, and Manga109.
Key Results
- Efficiency Gains: On the DIV2K validation set for x2 upscaling, TADT outperformed the popular SwinIR model while requiring approximately 25% fewer FLOPs.
- State-of-the-Art Accuracy: TADT consistently surpassed fixed-architecture models like RCAN, RDN, and SwinIR across multiple scales and datasets. Visual comparisons show that TADT produces sharper edges and more accurate textures where fixed models often produce blurring or artifacts.
- Task Sensitivity: Experimental data confirms that the model's internal "difficulty gauge" naturally increases with the magnification scale. Furthermore, the TARC activates more branches for high-frequency textures (e.g., stone or fabric) and fewer for smooth regions (e.g., sky), demonstrating true content awareness.
Conclusion
The Task-Aware Dynamic Transformer represents a significant step forward in efficient image restoration. By moving away from "one-size-fits-all" architectures, TADT proves that models can be both more accurate and more computationally responsible. While the training process involves a multi-stage approach (pre-training a baseline before adding the routing controller), the resulting efficiency and visual quality make it a compelling choice for real-world ASSR applications. Future work may extend this dynamic routing principle to other restoration tasks such as denoising and deblurring.
Summary updated