Unfolding Once is Enough: A Deployment-Friendly Transformer Unit for Super-Resolution

Yong Liu, Hang Dong, Boyang Liang, Songwei Liu, Qingji Dong +4 more
8/5/2023
cs.CV

Official code: yongliuy/DITN (27 stars, Apache-2.0, last commit 2023-11-02).

Abstract

Recent years have witnessed a few attempts of vision transformers for single image super-resolution (SISR). Since the high resolution of intermediate features in SISR models increases memory and computational requirements, efficient SISR transformers are more favored. Based on some popular transformer backbone, many methods have explored reasonable schemes to reduce the computational complexity of the self-attention module while achieving impressive performance. However, these methods only focus on the performance on the training platform (e.g., Pytorch/Tensorflow) without further optimization for the deployment platform (e.g., TensorRT). Therefore, they inevitably contain some redundant operators, posing challenges for subsequent deployment in real-world applications. In this paper, we propose a deployment-friendly transformer unit, namely UFONE (i.e., UnFolding ONce is Enough), to alleviate these problems. In each UFONE, we introduce an Inner-patch Transformer Layer (ITL) to efficiently reconstruct the local structural information from patches and a Spatial-Aware Layer (SAL) to exploit the long-range dependencies between patches. Based on UFONE, we propose a Deployment-friendly Inner-patch Transformer Network (DITN) for the SISR task, which can achieve favorable performance with low latency and memory usage on both training and deployment platforms. Furthermore, to further boost the deployment efficiency of the proposed DITN on TensorRT, we also provide an efficient substitution for layer normalization and propose a fusion optimization strategy for specific operators. Extensive experiments show that our models can achieve competitive results in terms of qualitative and quantitative performance with high deployment efficiency. Code is available at \url{https://github.com/yongliuy/DITN}.

View on arXivView PDF

Code Implementations(1)

yongliuy/DITNOfficial100%
Apache-2.0

Unfolding Once is Enough: A Deployment-Friendly Transformer Unit for Super-Resolution

272PythonJul 6, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{liu2023unfolding,
  title  = {Unfolding Once is Enough: A Deployment-Friendly Transformer Unit for Super-Resolution},
  author = {Yong Liu and Hang Dong and Boyang Liang and Songwei Liu and Qingji Dong and Kai Chen and Fangmin Chen and Lean Fu and Fei Wang},
  year   = {2023},
  eprint = {2308.02794},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.02794v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.02794.svg)](https://codeofpaper.com/paper/2308.02794)

Discussion