CNN(1)中,我们用到下图来说明卷积之后feature maps尺寸和深度的变化。这一节中,我们讨论feature map size, padding and stride。

首先,在Layer1中,输入是32x32的图片,而卷积之后为28x28,试问filter的size(no padding)? (答案是5x5)。 如果没答上来,请看下图:

I是一张7x7的图片,filter是3x3的,I*K生成的feature map是5x5的。所以我们推出feature map size公式为:

其中n(l)表示在l层中图片的大小,f(l)是filter的大小所以在最初的问题中filtersize=32-28+1=5。

而在convolution操作中,有一个padding参数可以在原图外围加上空白格,从而使feature map的size不发生变化。通常不使用padding的Convolution称为Valid Convolution,而使用padding输出相同size的feature map,则称为Same Convolution。Feature map和Padding的Size计算公式为:

其中,p(l)是padding的大小。使用Padding的原因主要有二:

第一,因为architecture的原因,不希望图片尺寸发生变化;

其二,如果不使用padding,在图片边缘的pixel只被计算了一次,其数据被低估了。

Stride是表示filter工作间隔的参数,默认是1,根据需要可以设置为其他值,在设置了Stride之后,feature map的计算公式为:

其中,s(l)是stride步幅的大小。当然,图片并不都是正方的,我们可以分别计算feature map的width和height

Convolutional Neural Networks(4):Feature map size,Padding and Stride的更多相关文章

  1. 机器视觉:Convolutional Neural Networks, Receptive Field and Feature Maps

    CNN 大概是目前 CV 界最火爆的一款模型了,堪比当年的 SVM.从 2012 年到现在,CNN 已经广泛应用于CV的各个领域,从最初的 classification,到现在的semantic se ...

  2. 《Deep Feature Extraction and Classification of Hyperspectral Images Based on Convolutional Neural Networks》论文笔记

    论文题目<Deep Feature Extraction and Classification of Hyperspectral Images Based on Convolutional Ne ...

  3. A Beginner's Guide To Understanding Convolutional Neural Networks(转)

    A Beginner's Guide To Understanding Convolutional Neural Networks Introduction Convolutional neural ...

  4. (转)A Beginner's Guide To Understanding Convolutional Neural Networks Part 2

    Adit Deshpande CS Undergrad at UCLA ('19) Blog About A Beginner's Guide To Understanding Convolution ...

  5. (转)A Beginner's Guide To Understanding Convolutional Neural Networks

    Adit Deshpande CS Undergrad at UCLA ('19) Blog About A Beginner's Guide To Understanding Convolution ...

  6. [转]An Intuitive Explanation of Convolutional Neural Networks

    An Intuitive Explanation of Convolutional Neural Networks https://ujjwalkarn.me/2016/08/11/intuitive ...

  7. 卷积神经网络用于视觉识别Convolutional Neural Networks for Visual Recognition

    Table of Contents: Architecture Overview ConvNet Layers Convolutional Layer Pooling Layer Normalizat ...

  8. 【论文翻译】MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

    MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications 论文链接:https://arxi ...

  9. Convolutional Neural Networks for Visual Recognition

    http://cs231n.github.io/   里面有很多相当好的文章 http://cs231n.github.io/convolutional-networks/ Table of Cont ...

随机推荐

  1. POJ 1383题解(树的直径)(BFS)

    题面 Labyrinth Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 4997 Accepted: 1861 Descript ...

  2. 日志处理--高效Linux命令整理

    序 在学习使用python处理日志开始阶段,对我阻力最大的莫过于对linux的不熟悉了,有种寸步难行的感觉. 在之后乱学一通之后,发现有点对我颇有益处: 学<鸟哥linux私房菜基础学习篇> ...

  3. Mybatis中dao层实现

    在上一个笔记中继续: 因为要基于dao层,那么我们只需要又一个dao的接口,和一个mapper的文件就可以测试了. 但是基于dao层的时候需要规范: Mapper.xml文件中的namespace与m ...

  4. CSS3选择器 :read-only选择器 CSS3选择器 :read-write选择器

    CSS3选择器 :read-only选择器 “:read-only”伪类选择器用来指定处于只读状态元素的样式.简单点理解就是,元素中设置了“readonly=’readonly’” 示例演示 通过“: ...

  5. shelve模块 xml模块

    # import shelve# f=shelve.open('db.shl')# # f['stu1']={'name':'alex1','age':28}# # f['stu2']={'name' ...

  6. Jenkins 使用python进行调度,并下载apphost上的安装包

    在持续集成的过程中,Jenkins工具是我们必须要会用的工具,那么今天分享一个使用python对Jenkins进行调度的案例 使用的是python-jenkins 库,借用selenium登陆jenk ...

  7. 对webpack的初步研究3

    Output配置output配置选项告诉webpack如何将编译后的文件写入磁盘.请注意,虽然可以有多个entry点,但只output指定了一个配置. A filename to use for th ...

  8. redis测试

    1,安装redis软件 2,引入redis jar包 3,案例 package test; import java.util.List; import redis.clients.jedis.Jedi ...

  9. Android逆向之旅---基于对so中的函数加密技术实现so加固

    一.前言 今天我们继续来介绍so加固方式,在前面一篇文章中我们介绍了对so中指定的段(section)进行加密来实现对so加固 http://blog.csdn.net/jiangwei0910410 ...

  10. [CSP-S模拟测试]:trade(反悔贪心)

    题目传送门(内部题62) 输入格式 第一行有一个整数$n$.第二行有$N$个整数:$a_1\ a_2\ a_3\cdot\cdot\cdot a_n$. 输出格式 一行一个整数表示最大收益. 样例 样 ...