Transformers have become the standard in state-of-the-art vision architectures, achieving impressive performance on both image-level and dense pixelwise tasks. However, training vision transformers for high-resolution pixelwise tasks has a prohibitive cost. Typical solutions boil down to hierarchical architectures, fast and approximate attention, or training on low-resolution crops. This latter solution does not constrain architectural choices, but it leads to a clear performance drop when testing at resolutions significantly higher than that used for training, thus requiring ad-hoc and slow post-processing schemes. In this paper, we propose a novel strategy for efficient training and inference of high-resolution vision transformers. The key principle is to mask out most of the high-resolution inputs during training, keeping only N random windows. This allows the model to learn local interactions between tokens inside each window, and global interactions between tokens from different windows. As a result, the model can directly process the high-resolution input at test time without any special trick. We show that this strategy is effective when using relative positional embedding such as rotary embeddings. It is 4 times faster to train than a full-resolution network, and it is straightforward to use at test time compared to existing approaches. We apply this strategy to three dense prediction tasks with high-resolution data. First, we show on the task of semantic segmentation that a simple setting with 2 windows performs best, hence the name of our method: Win-Win. Second, we confirm this result on the task of monocular depth prediction. Third, we further extend it to the binocular task of optical flow, reaching state-of-the-art performance on the Spring benchmark that contains Full-HD images with an order of magnitude faster inference than the best competitor.
S2WAT: Image Style Transfer via Hierarchical Vision Transformer using Strips Window Attention
Sichuan Normal University(四川师范大学);Nanjing University of Aeronautics and Astronautics(南京航空航天大学);Zhejiang Lab(之江实验室);Zhejiang University(浙江大学);Visual Computing and Virtual Reality Key Laboratory of Sichuan Provience(四川省视觉计算与虚拟现实重点实验室)
SimViT: Exploring a Simple Vision Transformer with sliding windows
Institute of Software Chinese Academy of Science(中国科学院软件研究所);Institute of Computing Technology Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学)
Northwest University(西北大学);University of Technology Sydney(悉尼科技大学);University of Oxford(牛津大学);South China University of Technology(华南理工大学);Sun Yat-sen University(中山大学);PengCheng Laboratory(鹏城实验室);RMIT University(皇家墨尔本理工大学)
Heterogeneous window transformer for image denoising
Northwestern Polytechnical University(西北工业大学);National Tsing Hua University(国立清华大学);Xidian University(西安电子科技大学);Chinese University of Hong Kong (Shenzhen)(香港中文大学(深圳));Shenzhen Institute of Artificial Intelligence and Robotics for Society(深圳市人工智能与机器人研究院)