arXiv-2017
文章目录
1 Background and Motivation
随着深度学习技术的发展,CNN 在很多计算机视觉任务中崭露头角,但 increased representational power also comes increased probability of overfitting, leading to poor generalization.
为提升模型的泛化性能,模拟 object occlusion, 作者提出了 Cutout 数据增强的方法——randomly masking out square regions of input during training,take more of the image context into consideration when making decisions.
This technique encourages the network to better utilize the full context of the image, rather than relying on the presence of a small set of specific visual features(which may not always be present).
2 Related Work
- Data Augmentation for Images
- Dropout in Convolutional Neural Networks
- Denoising Autoencoders & Context Encoders(self-supervised,挖去部分,网络补上,以强化特征)
3 Advantages / Contributions
监督学习中提出 Cutout 数据增强方法(dropout 的一种形式,自监督中也有类似方法)
4 Method
初始版:remove maximally activated features
最终版:随机中心点,正方形遮挡(可以在图片外,被图片边界截取后就不是正方形了)
使用时需要中心化一下(也即减去均值)
the dataset should be normalized about zero so that modified images will not have a large effect on the expected batch statistics.
5 Experiments
5.1 Datasets and Metrics
- CIFAR-10(32x32)
- CIFAR-100(32x32)
- SVHN(Street View House Numbers,32x32)
- STL-10(96x96)
评价指标为 top1 error
5.2 Experiments
1)CIFAR10 and CIFAR100
单个实验都重复跑了5次,±x
下图探索 cutout 中不同 patch length 的影响,
2)STL-10
3)Analysis of Cutout’s Effect on Activations
引入 cutout 后浅层激活均有提升,深层 in the tail end of the distribution.
The latter observation illustrates that cutout is indeed encouraging the network to take into account a wider variety of features when making predictions, rather than relying on the presence of a smaller number of features
再聚焦下单个样本的
6 Conclusion(own) / Future work
-
code:https://github.com/uoguelph-mlrg/Cutout
-
memory footprint 内存占用
-
相关工作介绍 drop out 时,文章中出现了这句话:All activations are kept when evaluating the network, but the resulting output is scaled according to the dropout probability
-
dropout 作用在 FC 上的效果比 Conv 上好,作者的解释是:1)convolutional layers already have much fewer parameters than fully-connected layers; 2)neighbouring pixels in images share much of the same information(丢一些无伤大雅)
-
cutout——连续区域的仅作用在输入层的 dropout 技术
Dropout on Conv layer
Dropout 首次应用于 FC 层,后被推广至 Conv 层,Conv 层中的具体形式如何呢?
先回顾下 dropout 在 FC 层是如何发挥作用的
再看看其在 Conv 层中是如何发挥作用的
im2col
核心步骤,im2col + segmm
caffe 中的数据是行优先(row-major)存储的
im2col是什么?
Rearrange image blocks into columns
输入图像batch input_num = 1
输入通道 input_channel = 1
输入图像高 input_h = 4;
输入图像宽 input_w = 4;
卷积核高 kernel_h = 3;
卷积核宽 kernel_w = 3;
步长 stride = 1;
pad = 0;
首先将输入图像的像素点按照“卷积区域”,挨个排列起来
输入三通道的时候
需要注意各通道im2col的数据在内存中也是连续存储的,全部弄好后拼成这样的矩阵!
kernal
kernel的通道数据在内存中也是连续存储的。(每行每列扫下来)
接下来就是矩阵乘法了,也就是所谓的 sgemm。
矩阵乘法可以直接使用 CUDA 中的 cublas 库,常用的也就是 3 个参数,M 是左边矩阵的行数,这里的 kernal 是一行,因此M=1;而 N 表示输出矩阵的列,也就是输出图像一共多少个像素点;K 表示左边输入矩阵的列,右边输入矩阵的行;
M = 1
N = output_h * output_w
K = input_channels * kernel_h * kernel_w
因为图像数据是连续存储,因此输出图像也可以如下图所示 output_h * output_w = 2*2:
如果我们输出的Tensor是多通道的,也就是说输入图像是 (1,3,224,224),输出是(1,3,112,112),那么参数变化为这样:
M=output_channels ,
N=output_h * output_w
K=input_channels * kernel_h * kernel_w
output_channels × output_h × output_w = 322