AdaWPT: Adaptive Window Pruning for Deblurring
- The paper introduces AdaWPT, a mechanism that prunes non-blurred regions to enhance deblurring efficiency and accuracy in Vision Transformers.
- It combines window-based attention, blur confidence prediction, and Gumbel-Softmax sampling to prune approximately 66% of windows, reducing FLOPs and accelerating inference.
- Empirical results show improved PSNR and computational savings through its U-shaped encoder–decoder approach, highlighting a balance between performance and efficiency.
AdaWPT (Adaptive Window Pruning Transformer) is a mechanism designed to enhance the efficiency and fidelity of local motion deblurring in high-resolution images by dynamically selecting computation regions within a vision Transformer architecture. Local motion blur, characterized by spatially varying blur patterns due to moving objects and static backgrounds, presents challenges for contemporary deblurring networks that predominantly perform global operations. AdaWPT addresses this inefficiency by pruning non-blurred spatial windows during processing, focusing Transformer capacity on genuinely degraded regions. Developed in the context of the Local Motion Deblurring Vision Transformer (LMD-ViT), AdaWPT integrates window-based attention, blur-aware confidence prediction, Gumbel-Softmax-based discrete window selection, and loss functions guided by annotated blur masks (Li et al., 2023).
1. Structural Overview and Context
LMD-ViT employing AdaWPT follows a U-shaped encoder–decoder architecture with skip connections. AdaWPT blocks are inserted at various resolution levels, both in the encoder, bottleneck, and decoder pathways. The input image is projected to an initial feature map . Each encoder stage includes a down-sampling operation followed by AdaWPT blocks, generating successively lower-resolution () feature maps. After a two-block AdaWPT bottleneck, the decoder symmetrically upsamples the features, integrating encoder features via skip connections. The network outputs a residual image , added to the input to yield the final sharp prediction . Only AdaWPT blocks conduct adaptive window pruning; other layers use standard convolutional or sampling operations (Li et al., 2023).
2. Window Partitioning and Feature Tokenization
An input feature map entering an AdaWPT block is partitioned into a grid of non-overlapping spatial windows:
Each window 0 is flattened and/or linearly projected to a token vector:
1
This yields a set of tokens 2 representing local regions, forming the computational units for adaptivity.
3. Blurriness Confidence Prediction and Gumbel-Softmax Pruning
AdaWPT employs a learned blurriness confidence predictor. In the first block at each scale (AdaWPT-F), each 3 passes through a multi-layer perceptron stack:
4
Softmax is applied to 5 to obtain a blur confidence 6:
7
Subsequent blocks at the same scale (AdaWPT-P) reuse the same 8 decision map.
During training, binarization of 9 is facilitated by the Gumbel-Softmax re-parameterization. Sampling with Gumbel noise 0 and temperature 1 yields a soft, differentiable discrete decision:
2
where 3, 4. The hard sample 5 is used in the forward pass, with gradients propagated through the soft variable 6 (straight-through estimator). At inference, 7 is set as 8 if 9 (a threshold, with 0 used in practice), and 1 otherwise (Li et al., 2023).
4. Pruning Mechanism and Transformer Application
During the forward pass, only windows with 2 are retained for subsequent Transformer computation; others are zeroed:
3
Retained windows proceed through window-based multi-head self-attention (W-MSA) and local feed-forward (W-LeFF) operations. After processing, outputs are scattered back into the original spatial grid.
The pruning procedure is applied in both encoder and decoder stages, compounding computational savings by focusing on windows corresponding to blurred regions. A single confidence map is predicted and reused within each resolution group, reducing redundant computation (Li et al., 2023).
5. Supervision and Loss Functions
End-to-end training of LMD-ViT with AdaWPT is supervised by a composite loss:
- Reconstruction loss (4): Per-pixel loss (e.g., 5) between deblurred prediction 6 and ground truth 7, potentially emphasizing annotated blur regions defined by mask 8.
- Pruning loss (9): Binary cross-entropy between predicted windowwise 0 and downsampled ground-truth mask 1, enforcing 2 on blurred regions and 3 elsewhere:
4
The total loss is
5
with 6 tuned to balance deblurring and pruning accuracy (7--8) (Li et al., 2023).
6. Computational Complexity and Comparative Results
With 9 windows and local window FLOPs 0, the unpruned network computes 1 operations per block. Window pruning yields
2
with relative FLOPs reduction 3. Empirically, AdaWPT prunes 4 of windows, leading to a 66\% FLOPs saving and over 5 inference speedup versus global Transformer baselines (Uformer, Restormer), while also increasing PSNR by 6 dB. Weighted PSNR improves by 7 dB over the best-performing CNNs with comparable or faster inference. Pruning in all 9 AdaWPT blocks provides the optimal trade-off, reducing inference time from 1.30 s to 0.56 s. Refined blur masks enhance pruning precision from 66\% to 97\%, yielding a further 8 dB PSNR increase (Li et al., 2023).
| System | FLOPs Reduction | Speedup | PSNR Gain |
|---|---|---|---|
| vs. best CNN (ReLoBlur) | n/a | similar | +0.50 dB |
| vs. global Transformer | 66% | >2× | +0.28 dB |
7. Limitations and Prospective Enhancements
Operationally, AdaWPT is not yet real-time for very high-resolution images. While pruning precision exceeds 95%, small or subtle blur regions may be missed. A plausible implication is that precise blur-region detection governs deblurring fidelity and computational efficiency. Future extensions proposed include integrating cross-window context into the confidence predictor, employing dynamic window sizes, multi-task deblurring and mask refinement, hardware-aware real-time implementations, and expanding to temporal modules for multi-frame deblurring.
In summation, AdaWPT’s integration of region-aware token selection, blur-confidence prediction, Gumbel-Softmax binarization, and selective Transformer computation efficiently targets the spatially localized nature of real-world motion blur, elevating both restoration accuracy and resource utilization efficiency (Li et al., 2023).