GoogLeNet之InceptionV2神经网络简介与代码实战

1.介绍

Inception V2是Inception家族的一个中间件产物,具体可以参见论文Rethinking the Inception Architecture for Computer Vision中。

2.模型结构

InceptionV1子结构 

 InceptionV2子结构 

3.模型特点
Inception V2相比Inception V1进行了如下改进:

1.使用Batch Normalization,加快模型训练速度;

2.使用两个3x3的卷积代替5x5的大卷积,降低了参数数量并减轻了过拟合;

3.去除Dropout并减轻L2正则化(因BN已起到正则化的作用);

4.代码实现 keras

def Conv2d(x, nb_filter,kernel_size, padding='same',strides=(1,1)):
    x = Conv2D(nb_filter,kernel_size,padding=padding,strides=strides)(x)
    x = BatchNormalization(axis=3)(x)
    x = Activation('relu')(x)
    return x
 
 
def Inception(x,nb_filter=[128,128,192,32,96,64]):
    branch1x1 = Conv2d(x,nb_filter[0],(1,1), padding='same',strides=(1,1))
 
    branch3x3 = Conv2d(x,nb_filter[1],(1,1), padding='same',strides=(1,1))
    branch3x3 = Conv2d(branch3x3,nb_filter[2],(3,3), padding='same',strides=(1,1))
 
    branch5x5 = Conv2d(x,nb_filter[3],(1,1), padding='same',strides=(1,1))
    branch5x5 = Conv2d(branch5x5,nb_filter[4],(3,3), padding='same',strides=(1,1))
    branch5x5 = Conv2d(branch5x5,nb_filter[4],(3,3), padding='same',strides=(1,1))
 
    branchpool = MaxPooling2D(pool_size=(3,3),strides=(1,1),padding='same')(x)
    branchpool = Conv2d(branchpool,nb_filter[5],(1,1),padding='same',strides=(1,1))
 
    x = concatenate([branch1x1,branch3x3,branch5x5,branchpool],axis=3)
 
    return x

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值