Fine-Grained Visual Classification via Progressive Multi-Granularity Training of Jigsaw Patches

一. Fine-Grained Visual Classification via Progressive Multi-Granularity Training of Jigsaw Patches

基于渐进式多粒度拼图训练的细粒度视觉分类

code:https://github.com/PRIS-CV/PMG-Progressive-Multi-Granularity-Training

paper:https://arxiv.org/abs/2003.03836

Abstract

细粒度分类比传统分类难

目前解决方法主要关注:locate the most discriminative parts, more complementary parts, and parts of various granularities.

但是,对于哪些粒度最具有识别性,以及如何跨多粒度融合信息的研究较少。fuse information cross multi-granularity

提出:

  • a novel progressive training strategy.
  • a simple jigsaw puzzle generator to form images contain information of different granularity levels.(一个用于生成图像的简单拼图生成器,其包含不同粒度级别的信息。)

Approach

在这里插入图片描述
模型在较浅的层中学习稳定的细粒度信息,并随着训练的进展逐渐将注意力转移到更深的层中学习大粒度级别的抽象信息。

4个step表示对应着4种不同的输入,

对于step1来说,最乱,分成的patch为 n = 2 L − ( L − 2 ) + 1 = 8 n = 2^{L-(L-2)+1}=8 n=2L(L2)+1=8 ,frozen之后的2个stage,

step 2,分成的patch为 n = 2 L − ( L − 1 ) + 1 = 4 n = 2^{L-(L-1)+1}=4 n=2L(L1)+1=4 ,frozen之后的1个stage,

step 3,分成的patch为 n = 2 L − ( L ) + 1 = 2 n = 2^{L-(L)+1}=2 n=2L(L)+1=2

step 4,原图,将原图送入网络中,最后三个stage得到的feature map concatenate后送去分类。

每一个step都有loss,share the same label

Network Architecture

F F F:backbone feature extractor。其含有 L L L个stage

  • 每个stage的输出特征图: F l ∈ R H l × W l × C l , l = { 1 , 2 , 3 , . . . , L } F^l∈R^{H_l \times W_l \times C_l} , l = \{1,2,3,...,L\} FlRHl×Wl×Cl,l={1,2,3,...,L}

目标:在不同的中间阶段(stage)对提取的特征图施加分类损失。

  • F l F^l Fl 经过convolution block H c o n v l H_{conv}^l Hconvl 后化简成向量表示为 V l = H c o n v l ( F l ) V^l = H_{conv}^l(F^l) Vl=Hconvl(Fl)

  • 之后接 classification module H c l a s s l H_{class}^l Hclassl,包含两个fc,BN,Elu,预测类的概率分布 y l = H c l a s s l ( V l ) y^l = H_{class}^l(V^l) yl=Hclassl(Vl)

对于最后S个stage,即 l = L , L − 1 , . . . , L − S + 1 l = L,L-1,...,L-S+1 l=L,L1,...,LS+1

  • 将最终这S个输出concat起来得到 V c o n c a t = c o n c a t [ V L − S + 1 , . . . , V L − 1 , V L ] V^{concat} = concat[V^{L-S+1},...,V^{L-1},V^L] Vconcat=concat[VLS+1,...,VL1,VL]
  • 最后分类, y c o n c a t = H c l a s s c o n c a t ( V c o n c a t ) y^{concat} = H_{class}^{concat}(V^{concat}) yconcat=Hclassconcat(Vconcat)

Progressive Training

train the low stage first and then progressively add new stages for training.

浅层的感受野和表示能力受限,所以更能学习到一些local details

与直接训练整个网络相比,这种渐进式的训练方法allows the model to locate discriminative information **from local details to global structures **

两种形式的output:

  • the outputs from each stages
  • the output from the concatenated features

loss采用的交叉熵
在这里插入图片描述

Jigsaw Puzzle Generator

输入图像 : d ∈ R 3 × W × H d \in R^{3 \times W \times H} dR3×W×H

将其分成 n × n n \times n n×n 个patch,每个patch的大小为 3 × W n × H n 3 \times \frac{W}{n}\times\frac{H}{n} 3×nW×nH,W和H应该是n的整数倍

然后,将这些小块随机打乱并合并到一个新的图像 P ( d , n ) P(d,n) P(d,n)中。patch的粒度由超参数n控制。

n需要满足以下条件:

  • patch的size需要小于相应stage的感受野,否则其性能会受到影响
  • patch size应随着stage感受野成比例增加

通常情况下,每一stage的感受野大约是后面stage的两倍。因此,对于第 l l l个stage, n = 2 L − l + 1 n = 2^{L-l+1} n=2Ll+1

Inference

输入:原始图片,不需要jigsaw puzzle generator (即不需要打乱了)

只需用 y c o n c a t y^{concat} yconcat进行预测,就可以移除其它stage中fc层带来的计算量,在该情况下,最终结果: C 1 = a r g m a x ( y c o n c a t ) C_1 = argmax(y^{concat}) C1=argmax(yconcat)

但是multi-output可以带来更好的performance,该情况下,最终结果: C 2 = a r g m a x ( ∑ l = L − S + 1 l y l + y c o n c a t ) C_2 = argmax(\sum_{l=L-S+1}^l {y^l+y^{concat}}) C2=argmax(l=LS+1lyl+yconcat)

4 Experiment Results and Discussion

数据集:Caltech UCSD-Birds (CUB), Stanford Cars (CAR) , FGVC-Aircraft (AIR)

4.1 Implementation Details

backbone: VGG16 & ResNet50

stage数目: L = 5 L=5 L=5

S = 3 , α = 1 , β = 2 S = 3,\alpha = 1,\beta=2 S=3,α=1,β=2 (哪里需要 α , β ? ? ? \alpha,\beta??? α,β???实验验证了S取3最好

训练阶段:先resize成 550x550,之后随机裁剪448x448,使用水平翻转进行数据增强

测试阶段:resize成550x550,之后中心裁剪成448x448

优化器:SGD

对于新加的conv和fc层来说,初始化学习率为0.002,之后采用cosine annealing schedule 进行学习率的衰减。

对于pre-trianed的卷积层来说,其学习率为新加层的 1 10 \frac{1}{10} 101

epoch=300,batch size=16,weight decay=0.0005,momentum=0.9

4.2 Comparisons with State-of-the-Art Methods

在这里插入图片描述

combined accuracy表示concat四个output。

4.3 Ablation Study

数据集:CUB

ResNet50,no jigsaw puzzle generator jigsaw puzzle generator
在这里插入图片描述
在这里插入图片描述
S不是越大越好,S大于4之后会导致patch太小,很难保留一些信息,导致模型变差。

4.4 Visualization

在这里插入图片描述
(a)-©是作者model中第三到第五个stage卷积层的可视化结果,可以看到,stage3的注意力放在小粒度的有区分性的部分,比如鸟眼和羽毛纹理,

到©中可以看到,更关注到整体(larger granularity),可视化结果表明,作者的模型能够根据小粒度到大粒度的区分逐步给出预测。

baseline模型只在最后一个stage给出了一两个部分的注意力,而作者的model却可以覆盖到整体,这是由于 jigsaw puzzle generator 迫使网络在不同粒度level下学习到more discriminative parts。

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值