Convolutional Neural Networks(2):Sparse Interactions, Receptive Field and Parameter Sharing

Sparse Interactions, Receptive Field and Parameter Sharing是整个CNN深度网络的核心部分,我们用本文来具体分析其原理。

首先我们考虑Feedforward Neural Network,L层的输出矩阵,等于L层的输入矩阵与L层的权重矩阵做矩阵乘法,而后进行非线性变换。也就是说,L层的每一个输出数据,与L层的每一个输入数据都有关系。若输入数据是m维,输出数据是n维,则存在m*n个权重项来表征输入与输出间的关系。所以,Forward-propagation的时间复杂度是O(m*n)。

根据在机器学习方面的实际经验看来,weight过多导致的问题主要有:难以训练,overfitting等。所以CNN引入Sparse Interactions来解决稠密权重(Dense Weight)的问题。以一个核宽度为3的网络来举例:下一层的输出S3,只与3个输入x2,x3,x4有关。

x2,x3,x4称为s3的Receptive Field,这其实是一个从生物视觉舶来的概念。这里引用wikipedia关于Receptive Field的一段原文吧:

“Work by Hubel and Wiesel in the 1950s and 1960s showed that cat and monkey visual cortexes contain neurons that individually respond to small regions of the visual field. Provided the eyes are not moving, the region of visual space within which visual stimuli affect the firing of a single neuron is known as its receptive field. Neighboring cells have similar and overlapping receptive fields. Receptive field size and location varies systematically across the cortex to form a complete map of visual space. The cortex in each hemisphere represents the contralateral visual field.”

在位于枕叶(Occiptal Lobe)的大脑视觉皮质(Visual Cortex)中,存在一些神经元,每个单独的神经元对应一个Receptive Field。这也是Biological Neural Network在图像处理方面启发Artificial Neural Network的地方。如果仅仅到此为止,我们的确降低了模型的复杂度,并且把Weight Matrix缩小至k*n,k是kernel的大小。也就是说,在下一层中共有n个neurons,每一个neuron仅仅与上一层的k个值有关。

但Weight Sharing概念的引入,则将模型进一步简化,从而达到:weight的个数仅仅与kernel的大小有关。对于Kernel 和 Weight Sharing,可以这样理解:L层与L-1层之间并没有固定的连接线,而是采取动态绑定,在两层之间存在一个小小的window,称为kernel。透过该窗口可以看到原图像的一小部分,随着窗口不断从左到右,从上到下滑动,整个图片都被扫描。而扫描到的图片区,和kernel来做卷积,生成feature map。而整张图片,共享的weight其实就是kernel的值,如果kernel改变,整张图的扫描结果(feature map)将会改变。过程如下图:

 到这一步,我个人认为已经可以解决第一个W即what的问题了,但是关于Why、How,后续还需要很多篇幅和时间,慢慢来学习和分析。此为CNN之二,未完待续。

猜你喜欢

转载自www.cnblogs.com/rhyswang/p/8961096.html