Transformer with self-attention has led to the revolutionizing of natural language processing field, and recently inspires the emergence of Transformer-style architecture design with competitive results in numerous computer vision tasks. Nevertheless, most of existing designs directly employ self-attention over a 2D feature map to obtain the attention matrix based on pairs of isolated queries and keys at each spatial location, but leave the rich contexts among neighbor keys under-exploited. In this work, we design a novel Transformer-style module, i.e., Contextual Transformer (CoT) block, for visual recognition. Such design fully capitalizes on the contextual information among input keys to guide the learning of dynamic attention matrix and thus strengthens the capacity of visual representation. Technically, CoT block first contextually encodes input keys via a $3\times3$ convolution, leading to a static contextual representation of inputs. We further concatenate the encoded keys with input queries to learn the dynamic multi-head attention matrix through two consecutive $1\times1$ convolutions. The learnt attention matrix is multiplied by input values to achieve the dynamic contextual representation of inputs. The fusion of the static and dynamic contextual representations are finally taken as outputs. Our CoT block is appealing in the view that it can readily replace each $3\times3$ convolution in ResNet architectures, yielding a Transformer-style backbone named as Contextual Transformer Networks (CoTNet). Through extensive experiments over a wide range of applications (e.g., image recognition, object detection and instance segmentation), we validate the superiority of CoTNet as a stronger backbone. Source code is available at \url{https://github.com/JDAI-CV/CoTNet}.


翻译:带有自我注意的变换器导致自然语言处理字段的革命性,最近又激发了变换式结构设计,在众多计算机视觉任务中取得了竞争性结果。然而,大多数现有设计直接使用对二维特征地图的自我注意,以获得基于每个空间位置的孤立查询和钥匙对齐的注意矩阵,但使相邻关键键的丰富背景未得到充分开发。在这项工作中,我们设计了一个新型变换器式模块,即环境变换器(COT)块,以进行视觉识别。这种设计充分利用了输入键之间的背景信息,以指导动态关注矩阵矩阵的学习,从而加强了视觉代表的能力。技术上,COT区块首先通过3\time3$ convolution来编码输入键,导致输入的静态背景描述。我们进一步将编码键与输入查询以通过连续两次的1\timeal-developmental comploral complorations。我们所学的注意矩阵最终通过输入值值来实现动态变式变式变式变现的内值, 变现式结构的变现式结构是我们变式变式结构的变式结构的变式结构的变式结构的翻现式结构。

0
下载
关闭预览

相关内容

专知会员服务
45+阅读 · 2021年6月1日
剑桥大学《数据科学: 原理与实践》课程,附PPT下载
专知会员服务
51+阅读 · 2021年1月20日
最新《Transformers模型》教程,64页ppt
专知会员服务
314+阅读 · 2020年11月26日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
105+阅读 · 2020年8月30日
【深度学习视频分析/多模态学习资源大列表】
专知会员服务
92+阅读 · 2019年10月16日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
154+阅读 · 2019年10月12日
简评 | Video Action Recognition 的近期进展
极市平台
20+阅读 · 2019年4月21日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
计算机视觉领域顶会CVPR 2018 接受论文列表
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
【推荐】用Python/OpenCV实现增强现实
机器学习研究会
15+阅读 · 2017年11月16日
Capsule Networks解析
机器学习研究会
11+阅读 · 2017年11月12日
【推荐】全卷积语义分割综述
机器学习研究会
19+阅读 · 2017年8月31日
Arxiv
6+阅读 · 2019年4月4日
SlowFast Networks for Video Recognition
Arxiv
19+阅读 · 2018年12月10日
Exploring Visual Relationship for Image Captioning
Arxiv
15+阅读 · 2018年9月19日
VIP会员
相关VIP内容
相关资讯
简评 | Video Action Recognition 的近期进展
极市平台
20+阅读 · 2019年4月21日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
计算机视觉领域顶会CVPR 2018 接受论文列表
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
【推荐】用Python/OpenCV实现增强现实
机器学习研究会
15+阅读 · 2017年11月16日
Capsule Networks解析
机器学习研究会
11+阅读 · 2017年11月12日
【推荐】全卷积语义分割综述
机器学习研究会
19+阅读 · 2017年8月31日
Top
微信扫码咨询专知VIP会员