CNN中的卷积层

时间:2018-01-12 06:16:29

标签: deep-learning caffe

我们知道CNN中的卷积层使用过滤器,不同的过滤器会在输入图像中查找不同的信息。

但是在这个SSD中,我们有原型文件,它有卷积层的规范为

layer {
  name: "conv2_1"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2_1"
  param {
    lr_mult: 1.0
    decay_mult: 1.0
  }
  param {
    lr_mult: 2.0
    decay_mult: 0.0
  }
  convolution_param {
    num_output: 128
    pad: 1
    kernel_size: 3
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0.0
    }
  }
}

不同网络中的所有卷积层(如GoogleNet,AlexNet,VGG等)或多或少相似。 只要看一下以及如何理解,这个卷积层中的过滤器尝试提取输入图像的哪些信息?

编辑: 让我澄清一下我的问题。 我从prototxt文件中看到两个卷积层,如下所示。他们来自SSD。

layer {
  name: "conv1_1"
  type: "Convolution"
  bottom: "data"
  top: "conv1_1"
  param {
    lr_mult: 1.0
    decay_mult: 1.0
  }
  param {
    lr_mult: 2.0
    decay_mult: 0.0
  }
  convolution_param {
    num_output: 64
    pad: 1
    kernel_size: 3
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0.0
    }
  }
}

layer {
  name: "conv2_1"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2_1"
  param {
    lr_mult: 1.0
    decay_mult: 1.0
  }
  param {
    lr_mult: 2.0
    decay_mult: 0.0
  }
  convolution_param {
    num_output: 128
    pad: 1
    kernel_size: 3
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0.0
    }
  }
}

然后我在这里打印他们的输出

数据

enter image description here

conv1_1和conv2_1图片为herehere

所以我的查询是这两个转换层如何产生不同的输出。但是prototxt文件没有区别。

2 个答案:

答案 0 :(得分:4)

enter image description here 早期图层的滤镜代表边缘等低级特征 (这些功能保留更高 用于精确定位的空间分辨率,具有类似于Gabor滤波器的响应图的低级视觉信息。另一方面,中层提取物处的滤镜具有角落或斑点等特征,这些滤镜更为复杂。

out

随着您的深入,您无法对这些功能进行可视化和解释,因为中级和高级图层中的滤镜不直接连接到输入图像。例如,当您获得第一层的输出时,您实际上可以将其可视化并将其解释为边缘,但是当您更深入并将第二个卷积层应用于这些提取的边缘(第一层的输出)时,您会得到类似边缘的东西边缘(或像这样)并捕获更多的语义信息和更细粒度的空间细节。在原型文件文件中,所有卷积和其他类型的操作可以彼此相似。但是由于具有不同的顺序和权重,它们提取不同类型的特征。 enter image description here

答案 1 :(得分:1)

"Convolution"图层不仅在参数上有所不同(例如,kernel_sizestridepad等等,而且还有权重 :卷积核的可训练参数 您会看到不同的输出(又名"响应"),因为过滤器的权重不同。

有关"数据"之间的区别,请参阅this answer。 blob和"参数/权重" caffe中的blob。

相关问题