【论文阅读】Look-into-Object: Self-supervised Structure Modeling for Object Recognition

摘要

Most object recognition approaches predominantly focus on learning discriminative visual patterns while overlooking the holistic object structure. Though important, structure modeling usually requires significant manual annotations and therefore is labor-intensive. In this paper, we propose to “look into object” (explicitly yet intrinsically model the object structure) through incorporating self-supervisions into the traditional framework. We show the recognition backbone can be substantially enhanced for more robust representation learning, without any cost of extra annotation and inference speed. Specifically, we first propose an object-extent learning module for localizing the object according to the visual patterns shared among the instances in the same category. We then design a spatial context learning module for modeling the internal structures of the object, through predicting the relative positions within the extent. These two modules can be easily plugged into any backbone networks during training and detached at inference time. Extensive experiments show that our look-into-object approach (LIO) achieves large performance gain on a number of benchmarks, including generic object recognition (ImageNet) and fine-grained object recognition tasks (CUB, Cars, Aircraft). We also show that this learning paradigm is highly generalizable to other tasks such as object detection and segmentation (MS COCO). Project page: https://github.com/JDAI-CV/LIO.

大多数的物体识别方法主要集中在学习有区别的视觉模式,而忽略了整体的物体结构。虽然很重要,但结构建模通常需要大量的手工注释,因此是劳动密集型的。在本文中,我们建议通过将自我监督整合到传统框架中来“研究对象”(明确而本质地建模对象结构)。我们证明了识别主干可以被大大增强,以获得更健壮的表示学习,而无需额外的注释和推理速度的代价。具体来说,我们首先提出一个对象范围学习模块,用于根据同一类别中的实例之间共享的可视化模式定位对象。然后,我们设计了一个空间情境学习模块,通过预测物体在范围内的相对位置来建模物体的内部结构。这两个模块可以很容易地在训练期间插入任何骨干网,并在推理时分离。大量的实验表明,我们的寻找对象方法(LIO)在一些基准测试中获得了很大的性能提升,包括通用对象识别(ImageNet)和细粒度对象识别任务(CUB, Cars, Aircraft)。我们还表明,这种学习模式是高度可推广到其他任务,如目标检测和分割(MS COCO)。项目页面:https://github.com/JDAI-CV/LIO。

具体实现

整体框架

•分类模块(CM):提取基本图像表示并产生最终对象类别的主干分类网络。
•对象范围学习模块(Object-Extent Learning, OEL):一个用于定位给定图像中的主要对象的模块。
•空间上下文学习模块(Spatial Context Learning Module, SCL):一个自我监督的模块,通过CM中特征单元(后面介绍)之间的相互作用来加强区域之间的联系。
在这里插入图片描述

分类模块 Classification Module(CM)

给定图像 I I I,标签 l l l,通过基本网络得到特征图 f ( I ) f(I) f(I),特征图大小为 N × N × C N×N×C N×N×C,通过池化全连接层得到最后的特征向量 y ( I ) y(I) y(I),通过交叉熵损失来优化网络。
L c l s = − ∑ I ∈ I l ⋅ log ⁡ y ( I ) \mathcal{L}_{c l s}=-\sum_{I \in \mathcal{I}} l \cdot \log \boldsymbol{y}(I) Lcls=IIllogy(I)
OEL模块和SCL模块旨在帮助我们的主干分类网络学习有利于结构理解和对象定位的表示。这两个模块都是轻量级的,只引入了少量的可学习参数。此外,在推理时禁用OEL和SCL,只需要分类模块来提高计算效率。

对象范围学习模块Object-Extent Learning (OEL)

1.将特征图 f ( I ) f(I) f(I)在像素维度上分成 N × N N×N N×N个特征向量 f ( I ) i , j ∈ R 1 × C \boldsymbol{f}(I)_{i, j} \in \mathbb{R}^{1 \times C} f(I)i,jR1×C ( 1 ≤ i , j ≤ N ) (1 \leq i, j \leq N) (1i,jN),每个特征向量集中响应输入图像I中的某个区域。
2.采样和图片 I I I具有相同标签的数据 I ′ = { I 1 ′ , I 2 ′ , ⋯   , I P ′ } \boldsymbol{I}^{\prime}=\left\{I_{1}^{\prime}, I_{2}^{\prime}, \cdots, I_{P}^{\prime}\right\} I={I1,I2,,IP},测量 f ( I ) i , j f(I)_{i, j} f(I)i,j与同标签其他每幅图像 I ′ ∈ I ′ I^{\prime} \in \boldsymbol{I}^{\prime} II之间的区域级相关性。

φ i , j ( I , I ′ ) = 1 C max ⁡ 1 ≤ i ′ , j ′ ≤ N ⟨ f ( I ) i , j , f ( I ′ ) i ′ , j ′ ⟩ \varphi_{i, j}\left(I, I^{\prime}\right)=\frac{1}{C} \max _{1 \leq i^{\prime}, j^{\prime} \leq N}\left\langle\boldsymbol{f}(I)_{i, j}, \boldsymbol{f}\left(I^{\prime}\right)_{i^{\prime}, j^{\prime}}\right\rangle φi,j(I,I)=C11i,jNmaxf(I)i,j,f(I)i,j
⟨ ⋅ , ⋅ ⟩ \langle\cdot, \cdot\rangle ,为点乘
—————————————————————————————————————
关于这个公式联系下图开会时我也思考了一下:同类图片得到特征图之后,分成N*N份特征向量单元,点乘可以评估两个特征向量的相似程度,因此对每个特征单元分别进行点乘后选取最大的即表明对应的区域相似度最高,由此产生了对应于整个物体的特征。
—————————————————————————————————————
3.与分类 L c l s L_{cls} Lcls联合训练,相关分数的 φ i , j ( I , I ′ ) \varphi_{i, j}\left(I, I^{\prime}\right) φi,j(I,I)通常与 l l l的语义相关度呈正相关关系。
4.这种语义相关掩码 φ \varphi φ可以很好地捕获来自同一类别的图像的共性,其中 φ \varphi φ中的值自然地区分了主要目标区域和背景。考虑到视点变化和变形的影响,使用多个正图像来定位一个对象的主要区域。
M ( I , I ′ ) = 1 P ∑ p = 1 P φ ( I , I p ′ ) M\left(I, \boldsymbol{I}^{\prime}\right)=\frac{1}{P} \sum_{p=1}^{P} \varphi\left(I, I_{p}^{\prime}\right) M(I,I)=P1p=1Pφ(I,Ip)
M ( I , I ′ ) M\left(I, \boldsymbol{I}^{\prime}\right) M(I,I)也可以被认为是同一类别图像之间共有的表征。

在这里插入图片描述5.在得到特征图 f ( I ) f(I) f(I)后,对 f ( I ) f(I) f(I)中所有特征映射进行加权融合。对特征进行1 × 1卷积处理,得到单通道的输出 m ′ ( I ) m^{\prime}(I) m(I)(实际上就是将特征集合起来以此得到目标的整体结构)。与传统的注意力的目的是检测某些特定的部分或区域不同,我们的OEL模块被训练为收集物体内部的所有区域,忽略背景或其他无关的物体。
OEL模块 L oel  \mathcal{L}_{\text {oel }} Loel 可以定义为对象范围的伪掩模 M ( I , I ′ ) M\left(I, \boldsymbol{I}^{\prime}\right) M(I,I) m ′ ( I ) m^{\prime}(I) m(I)之间的距离:
L oel  = ∑ I ∈ I MSE ⁡ ( m ′ ( I ) , M ( I , I ′ ) ) \mathcal{L}_{\text {oel }}=\sum_{I \in \mathcal{I}} \operatorname{MSE}\left(m^{\prime}(I), M\left(I, \boldsymbol{I}^{\prime}\right)\right) Loel =IIMSE(m(I),M(I,I))

空间上下文学习模块Spatial Context Learning (SCL)

此模块同样作用于 f ( I ) f(I) f(I),目的是学习区域之间的结构关系。首先,对 f ( I ) f(I) f(I)进行1 × 1卷积加ReLU处理,得到新映射 h ( I ) ∈ R N × N × C 1 \boldsymbol{h}(I) \in \mathbb{R}^{N \times N \times C_{1}} h(I)RN×N×C1,描述了不同特征元的空间信息。 h ( I ) \boldsymbol{h}(I) h(I)中的每个cell(每个i, j位置)集中代表了图像 I I I中一个区域的语义信息。通过建立不同区域之间的空间连接,可以很容易地建模对象不同部分之间的结构关系。
1.选用极坐标系来建模这种结构关系。 N × N N×N N×N平面作为极坐标平面,原点为特征中值最大的位置 R o = R x , y R_{o}=R_{x, y} Ro=Rx,y,区域 R i , j R_{i, j} Ri,j的极坐标可以写成 ( Γ i , j , θ i , j ) \left(\Gamma_{i, j}, \theta_{i, j}\right) (Γi,j,θi,j),此作为自监督的标签。 Γ i , j = ( x − i ) 2 + ( y − j ) 2 / 2 N θ i , j = ( atan2 ⁡ ( y − j , x − i ) + π ) / 2 π \begin{aligned} \Gamma_{i, j} &=\sqrt{(x-i)^{2}+(y-j)^{2}} / \sqrt{2} N \\ \theta_{i, j} &=(\operatorname{atan2}(y-j, x-i)+\pi) / 2 \pi \end{aligned} Γi,jθi,j=(xi)2+(yj)2 /2 N=(atan2(yj,xi)+π)/2π
atan2
在这里插入图片描述

2.对每个cell h ( I ) i , j h(I)_{i, j} h(I)i,j和原点处 h ( I ) x , y h(I)_{x, y} h(I)x,y在通道维度上进行级联,通过全连接层和relu激活函数,得到预测的极坐标 ( Γ i , j ′ , θ i , j ′ ) \left(\Gamma_{i, j}^{\prime}, \theta_{i, j}^{\prime}\right) (Γi,j,θi,j),从OEL模块学到的对象范围掩码 m ′ ( I ) m^{\prime}(I) m(I)(one channel)也适用于SCL模块。通过以下损失函数进行优化。

L d i s = ∑ I ∈ I ∑ 1 ≤ i , j ≤ N m ′ ( I ) i , j ( Γ i , j ′ − Γ i , j ) 2 ∑ m ′ ( I ) \mathcal{L}_{d i s}=\sum_{I \in \mathcal{I}} \sqrt{\frac{\sum_{1 \leq i, j \leq N} m^{\prime}(I)_{i, j}\left(\Gamma_{i, j}^{\prime}-\Gamma_{i, j}\right)^{2}}{\sum m^{\prime}(I)}} Ldis=IIm(I)1i,jNm(I)i,j(Γi,jΓi,j)2
L ∠ = ∑ I ∈ I ∑ 1 ≤ i , j ≤ N m ′ ( I ) i , j ( θ Δ i , j − θ ˉ Δ ) 2 ∑ m ′ ( I ) \mathcal{L}_{\angle}=\sum_{I \in \mathcal{I}} \sqrt{\frac{\sum_{1 \leq i, j \leq N} m^{\prime}(I)_{i, j}\left(\theta_{\Delta_{i, j}}-\bar{\theta}_{\Delta}\right)^{2}}{\sum m^{\prime}(I)}} L=IIm(I)1i,jNm(I)i,j(θΔi,jθˉΔ)2
θ Δ i , j = { θ i , j ′ − θ i , j ,  if  θ i , j ′ − θ i , j ≥ 0 1 + θ i , j ′ − θ i , j ,  otherwise  \theta_{\Delta_{i, j}}=\left\{\begin{array}{ll}\theta_{i, j}^{\prime}-\theta_{i, j}, & \text { if } \theta_{i, j}^{\prime}-\theta_{i, j} \geq 0 \\ 1+\theta_{i, j}^{\prime}-\theta_{i, j}, & \text { otherwise }\end{array}\right. θΔi,j={θi,jθi,j,1+θi,jθi,j, if θi,jθi,j0 otherwise 
θ ˉ Δ = 1 ∑ m ′ ( I ) ∑ 1 ≤ i , j ≤ N m ′ ( I ) i , j θ Δ i , j \bar{\theta}_{\Delta}=\frac{1}{\sum m^{\prime}(I)} \sum_{1 \leq i, j \leq N} m^{\prime}(I)_{i, j} \theta_{\Delta_{i, j}} θˉΔ=m(I)11i,jNm(I)i,jθΔi,j
3.SCL模块的损失为:
L s c l = L d i s + L L \mathcal{L}_{s c l}=\mathcal{L}_{d i s}+\mathcal{L}_{L} Lscl=Ldis+LL

联合训练

分类、对象范围学习和空间上下文学习模块以端到端方式进行训练

L = L c l s + α L o e l + β L s c l \mathcal{L}=\mathcal{L}_{c l s}+\alpha \mathcal{L}_{o e l}+\beta \mathcal{L}_{s c l} L=Lcls+αLoel+βLscl
α = β = 0.1 \alpha=\beta=0.1 α=β=0.1

个人网站 https://aydenfan.github.io/

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值