您的位置:首页 > 其它

Visualizing and Understanding Convolutional Networks阅读笔记

2017-08-21 19:08 561 查看
本文采用Deconvnet对CNN学习到的features进行可视化。

核心思想

对CNN的第n层中的某一个feature map,每一个unit就是一个activation,当我们想要可视化某一个activation时,将第n层中除了这个activation以外的所有feature maps中的activations都设为零,一起输入给deconvnet,即可得到一个reconstruction image,它反映出原输入图像中产生activation的部分。

整个过程类似但不同于将一个strong activation反向传播,找到产生这个strong activation的input pattern。

算法缺点

一次只能可视化一个activation,而不能将某一层中所有的activations都可视化。

流程



右侧为卷积过程:包括卷积(卷积核为F)、Relu、max-pooling,输入input image,输出feature maps

左侧为反卷积:包括max-unpooling、Relu、卷积(卷积核为F的转置),输入feature maps,输出reconstruction image。

想要可视化哪一个activation,就把所有feature maps里面除了这个activation以外的所有unit都设为零,再输入给deconvnet。

关于feature maps 、units



上图中,从第二层到第四层,分别有4、4、8、8个feature maps,每个feature map里面的一个小方块就是一个unit,即activation。

The hidden units within a feature map are unique in that they are connected to different units in the lower layer. So for the first hidden layer, units within a feature map will be connected to different regions of the input image.

Each unit in a feature map looks for the same feature but at different positions of the input image.

因此,每个feature map里面的units都代表着同一种特征,我们可以对不同feature maps里面的activation(即unit)进行可视化,来寻找输入图像中的不同特征。

代码

可以参考https://github.com/ChienliMa/DeConvNet

大致是这样的思路:

假设我们要可视化第1个feature map的第一个unit的activation,则计算一下多个输入图像各自经过前向传播后在这个unit上产生的activation,取出activation最大的前九个图像,作为input images。

然后将这九个input images分别在这个unit上产生的activation进行反向传播(即输入给deconvnet),即可得到九个reconstruction。

代码里一共可视化了6个unit 上的activation(从左往右数一共是6大列)



参考网址:

https://www.quora.com/What-is-meant-by-feature-maps-in-convolutional-neural-networks
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  可视化 cnn