感受野计算

感受野

  • The receptive field is defined as the region in the input space that a particular CNN’s feature is looking at (i.e. be affected by)
  • 感受野被定义为,CNN的某个特征查看输入空间中的区域(即受影响的区域)

感受野计算

  • (1) nout=nin+2pks+1n_{out}=\lfloor {n_{in}+2p-k \over s} \rfloor + 1
  • ninn_{in} : number of input features
  • noutn_{out}: number of out features
  • k: convolution kernel size
  • p: convolution padding size
  • s: convolution stride size
  • (2) jout=jinsj_{out}=j_{in} * s
  • (3) rout=rin+(k1)jinr_{out}=r_{in}+(k-1) * j_{in}
  • (4) startout=startin+(k12)jinstart_{out}=start_{in} + ({k-1\over2}) * j_{in}

对于初始输入图片,jump = 1,等式3计算一个输出特征的感受野大小(size of receptive field,r)

等式4计算第一个输出特征感受野的中心位置,start 是一像素中心坐标(The fourth equation calculates the center position of the receptive field of the first output feature. Here, start is the center coordinate of one pixel.)

  • {‘alexnet’: {‘net’:[[11,4,0],[3,2,0],[5,1,2],[3,2,0],[3,1,1],[3,1,1],[3,1,1],[3,2,0]],
    ‘name’:[‘conv1’,‘pool1’,‘conv2’,‘pool2’,‘conv3’,‘conv4’,‘conv5’,‘pool5’]},
  • ‘vgg16’: {‘net’:[[3,1,1],[3,1,1],[2,2,0],[3,1,1],[3,1,1],[2,2,0],[3,1,1],[3,1,1],[3,1,1],
    [2,2,0],[3,1,1],[3,1,1],[3,1,1],[2,2,0],[3,1,1],[3,1,1],[3,1,1],[2,2,0]],
    ‘name’:[‘conv1_1’,‘conv1_2’,‘pool1’,‘conv2_1’,‘conv2_2’,‘pool2’,‘conv3_1’,‘conv3_2’,‘conv3_3’,‘pool3’,‘conv4_1’,‘conv4_2’,‘conv4_3’,‘pool4’,‘conv5_1’,‘conv5_2’,‘conv5_3’,‘pool5’]}
  • ‘zf-5’:{‘net’: [[7,2,3],[3,2,1],[5,2,2],[3,2,1],[3,1,1],[3,1,1],[3,1,1]],
    ‘name’: [‘conv1’,‘pool1’,‘conv2’,‘pool2’,‘conv3’,‘conv4’,‘conv5’]}}

感受野计算
[1]: https://syncedreview.com/2017/05/11/a-guide-to-receptive-field-arithmetic-for-convolutional-neural-networks/