Understanding and Improving Convolutional Neural Networks via CReLU

Pairing phenomenon

论文作者在 AlexNet 的模型上做了一个有趣的实验,发现:低层的卷积层中的一些滤波器核存在着负相关程度很高的滤波器核,而层次越高的卷积层,这一现象越不明显。作者把这一现象称为 pairing phenomenon。

设网络的某层卷积层的滤波器组的卷积核的单位向量组表示为 ϕ⃗ 1,ϕ⃗ 2,,ϕ⃗ n ,定义的 pairing filter 为 ϕ⃗ i=argminϕ⃗ jϕ⃗ i,ϕ⃗ j ,其中 j=1,2,,n n 为该层卷积层的滤波器数目。滤波器 ϕ⃗ i ϕ⃗ i 之间的余弦相似度记为, μϕi=ϕ⃗ i,ϕ⃗ i
这里写图片描述

笔者做了相似的实验,实验代码如下:

#coding=utf-8
'''
2017年02月14日
'''
import os
import numpy as np
import matplotlib.pyplot as plt
import caffe

def plotPairFilterCosineHist(net):
    filtersList = []
    for item in net.params:
        if item.startswith('conv'):
            filtersList.append( net.params[item][0].data)
    layerNum = len(filtersList)
    for k, filters in enumerate(filtersList):
        filterNum = filters.shape[0]
        filters = filters.reshape(filterNum, -1)
        filters = filters / np.linalg.norm(filters, axis=1, keepdims=True)
        pairFilterCosine = np.empty(filterNum, dtype=np.float)
        for i in range(filterNum):
            minCosine = 1
            for j in range(filterNum):
                minCosine = min(minCosine, np.dot(filters[i], filters[j]))
            pairFilterCosine[i] = minCosine
        plt.subplot(1, layerNum, k + 1)
        plt.title('conv{}'.format(k + 1))
        plt.hist(pairFilterCosine, 10)

if __name__ == '__main__':
    caffe.set_mode_gpu()
    modelRoot = r'D:\caffe-master\models\bvlc_reference_caffenet'
    deployPrototxt =  os.path.join(modelRoot, 'deploy.prototxt')
    modelFile = os.path.join(modelRoot, 'bvlc_reference_caffenet.caffemodel')
    net = caffe.Net(deployPrototxt, modelFile, caffe.TEST)
    plotPairFilterCosineHist(net)

输出结果如下:
这里写图片描述
由上图可以得到和原论文相似的结论:直方图主要集中于负半轴,且随着卷积层的加深,直方图向右偏移。

CReLU

论文作者基于上面的现象提出了一个假设:

we hypothesize that despite ReLU erasing negative linear responses, the first few convolution layers of a deep CNN manage to capture both negative and positive phase information through learning pairs or groups of negatively correlated filters. This conjecture implies that there exists a redundancy among the filters

为了消除 ReLU 带来的冗余,论文作者提出了一个新的激活机制(activation scheme),称为Concatenated Rectified Linear Units,简称为CReLU。设 []+=max(,0) ,则 CReLU 定义如下:

CReLU(x)=([x]+,[x]+)

注意到其与一般激活函数的不同之处:CReLU有二维输出,而一般的激活函数只有一维输出。所以,论文中提到:CReLU is based on an activation scheme rather than a function, which fundamentally differentiates itself from Leaky ReLU or other variants. 不过笔者觉得将 CReLU 视作一维输入二维输出的激活函数也无妨。

实验和分析

最后作者在三个数据集上验证了CReLU的有效性:CIFAR-10,CIFAR-100和ImageNet。此外论文作者还从正则化和重建角度对CReLU的有效性进行了定性的讨论。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值