ZFNet (2013) and visualized beginning

Blog: blog.shinelee.me | blog park | CSDN

EDITORIAL

ZFNet from the paper "Visualizing and Understanding Convolutional Networks" , author Matthew D. Zeiler and Rob Fergus-- apparently ZFNet is the first letter of the name of two authors named, as 20,190,911, the amount of citations 4207. ZFNet is generally considered ILSVRC 2013 champion method, but in fact ZFNet ranked No. 3, the top two are Clarifai and NUS, but Clarifai and ZFNet come from the hand of Matthew D. Zeiler, see ILSVRC2013 Results .

ZFNet (2013) on the basis of AlexNet (2012) on the performance again, as shown below, images from cs231n_2019_lecture09 .

ImageNet Winners

The maximum contribution has two papers:

  • Proposed ZFNet , a better performance than AlexNet network architecture
  • It presents a characteristic visual methods, and uses them to analyze and understand the network

This article will focus on the above-described two points, introduce network architecture, introduces further features a method of visualizing.

Network architecture and motivation

ZFNet network architecture as follows

ZFNet Architecture

ZFNet network architecture is modified from the AlexNet basis, compared with AlexNet, does not differ greatly:

  • The first convolutional layer, kernel size is reduced from 11 to 7, the stride is reduced from 4 to 2 (which will result in doubling the feature map)
  • 为了让后续feature map的尺寸保持一致,第2个卷积层的stride从1变为2

仅这2项修改,就获得了几个点的性能提升。所以,重要的是为什么这样修改?这样修改的动机是什么?文中这样叙述:

ZFNet Architecture Selection

通过对AlexNet的特征进行可视化,文章作者发现第2层出现了aliasing。在数字信号处理中,aliasing是指在采样频率过低时出现的不同信号混淆的现象,作者认为这是第1个卷积层stride过大引起的,为了解决这个问题,可以提高采样频率,所以将stride从4调整为2,与之相应的将kernel size也缩小(可以认为stride变小了,kernel没有必要看那么大范围了),这样修改前后,特征的变化情况如下图所示,第1层呈现了更多更具区分力的特征,第二2层的特征也更加清晰,没有aliasing现象。更多关于aliasing的内容,可以参见Nyquist–Shannon sampling theoremAliasing

stride 2 vs 4, kernel size 7x7 vs 11x11

这就引出了另外一个问题,如何将特征可视化?正如论文标题Visualizing and Understanding Convolutional Networks所显示的那样,与提出一个性能更好的网络结构相比,这篇论文更大的贡献在于提出一种将卷积神经网络深层特征可视化的方法

特征可视化

在博文《卷积神经万络之卷积计算、作用与思想》 博客园 | CSDN | blog.shinelee.me 中,我们讲到卷积神经网络通过逐层卷积将原始像素空间逐层映射到特征空间,深层feature map上每个位置的值都代表与某种模式的相似程度,但因为其位于特征空间,不利于人眼直接观察对应的模式,为了便于观察理解,需要将其映射回像素空间,“从群众中来,到群众中去”,论文《 Visualizing and Understanding Convolutional Networks》就重点介绍了如何“到群众中去”。

可视化操作,针对的是已经训练好的网络,或者训练过程中的网络快照,可视化操作不会改变网络的权重,只是用于分析和理解在给定输入图像时网络观察到了什么样的特征,以及训练过程中特征发生了什么变化。

下面这张图截自论文同款talk

Projecting Back

给定1张输入图像,先前向传播,得到每一层的feature map,如果想可视化第\(i\)层学到的特征,保留该层feature map的最大值,将其他位置和其他feature map置0,将其反向映射回原始输入所在的像素空间。对于一般的卷积神经网络,前向传播时不断经历 input image→conv → rectification → pooling →……,可视化时,则从某一层的feature map开始,依次反向经历 unpooling → rectification → deconv → …… → input space,如下图所示,上方对应更深层,下方对应更浅层,前向传播过程在右半侧从下至上,特征可视化过程在左半侧从上至下:

deconvnet

可视化时每一层的操作如下:

  • Unpooling:在前向传播时,记录相应max pooling层每个最大值来自的位置,在unpooling时,根据来自上层的map直接填在相应位置上,如上图所示,Max Locations “Switches”是一个与pooling层输入等大小的二值map,标记了每个局部极值的位置。
  • Rectification:因为使用的ReLU激活函数,前向传播时只将正值原封不动输出,负值置0,“反激活”过程与激活过程没什么分别,直接将来自上层的map通过ReLU。
  • Deconvolution:可能称为transposed convolution更合适,卷积操作output map的尺寸一般小于等于input map的尺寸,transposed convolution可以将尺寸恢复到与输入相同,相当于上采样过程,该操作的做法是,与convolution共享同样的卷积核,但需要将其左右上下翻转(即中心对称),然后作用在来自上层的feature map进行卷积,结果继续向下传递。关于Deconvolution的更细致介绍,可以参见博文《一文搞懂 deconvolution、transposed convolution、sub-­pixel or fractional convolution》 博客园 | CSDN | blog.shinelee.me

不断经历上述过程,将特征映射回输入所在的像素空间,就可以呈现出人眼可以理解的特征。给定不同的输入图像,看看每一层关注到最显著的特征是什么,如下图所示:

Visualization of features in a fully trained model

其他

除了网络架构和可视化方法,论文中还有其他一些值得留意的点,限于篇幅就不展开了,这里仅做记录,详细内容可以读一读论文:

  • Occlusion Sensitivity 实验:使用一个灰色的小块,遮挡输入图像的不同区域,观察对正类输出概率的影响,以此来分析哪个区域对分类结果的影响最大,即对当前输入图像,网络最关注哪个区域。结果发现,feature map最强响应可视化后对应的区域影响最大。
  • The Generalization the Feature : pre-trained on ImageNet, fixed weight, and then migrate to other libraries (Caltech-101, Caltech-256 ), re-training the last softmax classifier, only a few will be able to sample fast convergence, and good performance.
  • The Analysis the Feature : for the trained network, wherein each layer based training alone or Softmax SVM classifier, to assess the ability to distinguish the different layers of features, find the stronger ability to distinguish the deep features.

the above.

reference

Guess you like

Origin www.cnblogs.com/shine-lee/p/11563237.html