CVPR2018 oral《Relation Networks for Object Detection》论文阅读笔记

本文介绍了《Relation Networks for Object Detection》的核心内容,该论文提出的关系网络可以用于目标检测,提高检测结果,替代NMS。文章详细解析了关系模块的设计,包括Scaled Dot-Product Attention的原理和关系权重的计算,并探讨了如何使用关系网络去除重复检测框,实现全端到端的目标检测网络。
摘要由CSDN通过智能技术生成

前言

最近希望能够寻找一个NMS的替代方案,能够去除冗余检测框,并且不阻断梯度传递。这篇论文的核心内容是设计了一种关系网络,输入输出维度相等,能嵌入到目标检测任务中提高检测结果,也能代替NMS作为后处理模块。论文主要参照了Attention方法中的一些思想,设计的Relation Module是由《Attention is all you need》论文中self-attention模型改进而来。
本人对NLP完全小白,因此翻了翻attention的一些资料,在这里推荐一下:
[1] https://zhuanlan.zhihu.com/p/47063917
[2] https://blog.csdn.net/yujianmin1990/article/details/85221271
关键词:Relation ModuleDuplicate Removal

注:编者水平有限,如有谬误,欢迎指正。若要转载,请注明出处,谢谢。
联系方式:
邮箱:yue_zhan@yahoo.com
QQ:1156356625


Object Relation Module

首先回顾一下Scaled Dot-Product Attention,这是作者relation module的构建原型,这方面推荐[1]中介绍得很详细。上公式 v o u t = s o f t m a x ( q K t d k ) V (1) v^{out}=softmax(\frac{qK^t}{\sqrt{d_k}})V\tag{1} vout=softmax(dk qKt)V(1)这里attention的本质是一个加权和,通过 q q q K K K的点乘表示相似度,再通过 s o f t m a x softmax softmax得到权值分布,最后对 V V V求加权和得到当前“时刻”v输出。这里不对公式在NLP中具体含义做展开,只要理解这个Attention本质为加权和即可。
有了公式(1),就可以对论文中的relation module进行拆解,上构造图
在这里插入图片描述
这里的 f A f_A fA f G f_G fG代表检测目标的纹理特征和几何特征,分别为卷积层feature和bbox坐标。这里的 m m m n n n挺容易误解,根据文义应该是代指任意两个目标, { f G m , f G n } \{f^m_G,f^n_G\} {fGm,fGn}则代表任意两目标对。从左部分可以看出module输入输出维度保持不变,每个relation模块出来后用concat是考虑到计算代价问题。
右半部分本质是公式(1),橙色框scaled dot输出如果直接与 W V W_V WV加权点乘,则与公式(1)一致。因此有 f R ( n ) = ∑ m ω m n ⋅ ( W V ⋅ f A m ) (2) \textup f_R(n)=\sum_m\omega^{mn}\cdot(W_V\cdot\textup f^m_A)\tag 2 fR(n)=mωmn(WVfAm)(2)其中 ω m n \omega^{mn} ωmn与公式(1)中 s o f t m a x softmax softmax等价, W V ⋅ f A m W_V\cdot\textup f^m_A WVfAm是对纹理特征做维度转换,等价于(1)中V。继续看 ω m n \omega^{mn} ωmn的计算方式 ω m n = ω G m n ⋅  exp ( ω A m n ) ∑ k w G k n ⋅ exp ( ω A m n ) (3) \omega^{mn}=\frac{\omega^{mn}_G\cdot \textup{ exp}(\omega^{mn}_A)}{\sum_k{w^{kn}_G\cdot \textup{exp}(\omega^{mn}_A)}}\tag3 ωmn=kwGknexp(ωAmn)ωGmn exp(ωAmn)(3)可以看出,除去 ω G m n \omega^{mn}_G ωGmn,则完全等价于公式(1)的 s o f t m a x softmax softmax,文章原文:The usage of geometric weight Eq. (5) in the attention weight Eq. (3) makes our approach distinct from the basic attention Eq. (1). 也印证了这一观点。
公式(4)中 ω A \omega_A ωA计算方式与公式(1)一致,这里两个 W W W将特征投影到子空间,然后点乘计算两个目标纹理特征的相似度。 ω A m n = d o t ( W K f A m , W Q f A n ) d k (4) \omega^{mn}_A=\frac{dot(W_K\textup f^m_A,W_Q\textup f^n_A)}{\sqrt{d_k}}\tag4 ωAmn=dk dot(WKfAm,WQfAn)(4)文中几何权重 的计算方式为 ω G m n = m a x { 0 , W G ⋅ ε G ( f G m , f G n ) } (5) \omega^{mn}_G=max\{0,W_G\cdot\varepsilon_G(\textup f^m_G,\textup f^n_G)\}\tag 5 ωGmn=max{0,WGεG(fGm,fGn)}(5) ε G 将 \varepsilon_G将 εG两个目标的几何特征embedded to a high-dimensional( d g d_g dg) representation by method in <Attention is all you need>,4-d几何特征向量形式为 ( l o g ( ∣ x m − x n ∣ w m ) , l o g ( ∣ y m − y n ∣ h m ) , l o g ( w n w m ) , l o g ( w n w m ) ) T (log(\frac{|x_m-x_n|}{w_m}),log(\frac{|y_m-y_n|}{h_m}),log(\frac{w_n}{w_m}),log(\frac{w_n}{w_m}))^T (log(wmxmxn),log(hmymyn),log(wmwn),log(wmwn))T W G W_G WG ReLU \textup{ReLU} ReLU将映射过后的相似度归一化并clip掉负值部分。
当然作者并没有直接解释公式(5)的设计理念,而是通过对照实验验证效果。通过调整 ω G m n \omega^{mn}_G ωGmn形式,验证其效果。module内参数的优化算法部分此处省略。

Relation for Duplicate Removal

中间跳过了relation module嵌入目标检测网络的部分,因为我的关注点在于其如何取代NMS,从而使整个网络fully end-to-end。下图是duplicate removal模块的框架

在这里插入图片描述

s 0 s_0 s0 s 1 s_1 s1分别表示classification scoredegree of confidence(取值0到1),这里关于score有个疑惑是,原文写了classification score,但是又说N objects are sorted in descending order of their scores,所以这个score感觉又像是检测的置信度,头大。rank embed部分没有理解,希望大佬们解答。
通过relation module后, W s W_s Ws s i g m o i d \textup sigmoid sigmoid组成的线性分类器是完成duplicate操作的核心,可以把relation module理解为一个特征提取模块,然后接分类器。还有一个问题是文中计算IoU的部分,两张图上都没有画出,个人理解是网络中并不包含NMS常见的计算IoU。而是在计算loss时,需要评估与ground truth最匹配的检出框,而以不同的阈值得到的IoU结果不同。文中的multiple thresholds对 W s W_s Ws的修改也是通过设置不同IoU得到的matched GT,分别与 s 1 s_1 s1计算loss,训练后得到的对应阈值的分类器,在inference阶段仅做一个平均。也就是说,inference阶段不需要计算IoU。这里纠结了很久,为什么不需要NMS的情况下还需要计算IoU,且不会干扰梯度。

结论

至此,文章的核心内容就解读完毕。这篇论文反复看了有2、3遍,能找到的笔记资料也都看过,但还是觉得大部分笔记都仅仅是翻译原文,或者讲的过于简略。因此我个人的理解也还是不够透彻,所以关于模型替代NMS的部分还希望大佬斧正。
接下来会找源码来看,不过快过年了也没有太大动力hhh。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CVPR2018oral论文合集。 包含以下论文: A Certifiably Globally Optimal Solution to the Non-Minimal Relative Pose Problem.pdf Accurate and Diverse Sampling of Sequences based on a “Best of Many” Sample Objective .pdf Actor and Action Video Segmentation from a Sentence .pdf An Analysis of Scale Invariance in Object Detection - SNIP .pdf Analytic Expressions for Probabilistic Moments of PL-DNN with Gaussian Input.pdf Are You Talking to Me_ Reasoned Visual Dialog Generation through Adversarial Learning .pdf Augmented Skeleton Space Transfer for Depth-based Hand Pose Estimation .pdf Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering .pdf CodeSLAM — Learning a Compact, Optimisable Representation for Dense Visual SLAM .pdf Context Contrasted Feature and Gated Multi-scale Aggregation for Scene Segmentation.pdf Context Encoding for Semantic Segmentation.pdf Convolutional Neural Networks with Alternately Updated Clique .pdf Deep Layer Aggregation.pdf Deep Learning of Graph Matching.pdf DensePose Multi-Person Dense Human Pose Estimation In The Wild.pdf Density Adaptive Point Set Registration.pdf Detail-Preserving Pooling in Deep Networks.pdf Direction-aware Spatial Context Features for Shadow Detection .pdf Discriminative Learning of Latent Features for Zero-Shot Recognition .pdf DoubleFusion_Real-time Capture of Human Performance with Inner Body Shape from a Single Depth Sensor.pdf Efficient Optimization for Rank-based Loss Functions .pdf Egocentric Activity Recognition on a Budget .pdf Fast and Furious_Real Time End-to-End 3D Detection, Tracking and Motion Forecasting with a Single Convolutional Net.pdf Feature Space Transfer for Data Augmentation.pdf Finding It”_ Weakly-Supervised Reference-Aware Visual Grounding in Instructional Video” .pdf Finding Tiny Faces in the Wild with Generative Adversarial Network.pdf FlipDial_A Generative Model for Two-Way Visual Dialogue .pdf Group Consistent Similarity Learning via Deep CRFs for Person Re-Identification .pdf High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs .pdf Hybrid Camera Pose Estimation .pdf Illuminant Spectra-based Source Separation Using Flash Photography .pdf Im2Flow_Motion Hallucination from Static Images for Action Recognition .pdf Im2Pano3D_Extrapolating 360 Structure and Semantics Beyond the Field of View .pdf Improved Fusion of Visual and Language Representations by Dense Symmetric Co-Attention for Visual Question Answering .pdf Learning Face Age Progression_A Pyramid Architecture of GANs .pdf Learning to Find Good Correspondences .pdf Left-Right Comparative Recurrent Model for Stereo Matching .pdf MapNet_An Allocentric Spatial Memory for Mapping Environments.pdf Maximum Classifier Discrepancy for Unsupervised Domain Adaptation .pdf Neural Kinematic Networks for Unsupervised Motion Retargetting.pdf
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值