René's URL Explorer Experiment


Title: 一文弄懂CNN及图像识别(Python) · Issue #37 · aialgorithm/Blog · GitHub

Open Graph Title: 一文弄懂CNN及图像识别(Python) · Issue #37 · aialgorithm/Blog

X Title: 一文弄懂CNN及图像识别(Python) · Issue #37 · aialgorithm/Blog

Description: 一、卷积神经网络简介 卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算的前馈神经网络,是基于图像任务的平移不变性(图像识别的对象在不同位置有相同的含义)设计的,擅长应用于图像处理等任务。在图像处理中,图像数据具有非常高的维数(高维的RGB矩阵表示),因此训练一个标准的前馈网络来识别图像将需要成千上万的输入神经元,除了显而易见的高计算量,还可能导致许多与神经网络中的维数灾难相关的问题。 对于高维图像数据,卷积神经网络利...

Open Graph Description: 一、卷积神经网络简介 卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算的前馈神经网络,是基于图像任务的平移不变性(图像识别的对象在不同位置有相同的含义)设计的,擅长应用于图像处理等任务。在图像处理中,图像数据具有非常高的维数(高维的RGB矩阵表示),因此训练一个标准的前馈网络来识别图像将需要成千上万的输入神经元,除了显而易见的高计算量,还...

X Description: 一、卷积神经网络简介 卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算的前馈神经网络,是基于图像任务的平移不变性(图像识别的对象在不同位置有相同的含义)设计的,擅长应用于图像处理等任务。在图像处理中,图像数据具有非常高的维数(高维的RGB矩阵表示),因此训练一个标准的前馈网络来识别图像将需要成千上万的输入神经元,除了显而易见的高计算量,还...

Opengraph URL: https://github.com/aialgorithm/Blog/issues/37

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"一文弄懂CNN及图像识别(Python)","articleBody":"## 一、卷积神经网络简介\r\n卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算的前馈神经网络,是基于图像任务的平移不变性(图像识别的对象在不同位置有相同的含义)设计的,擅长应用于图像处理等任务。在图像处理中,图像数据具有非常高的维数(高维的RGB矩阵表示),因此训练一个标准的前馈网络来识别图像将需要成千上万的输入神经元,除了显而易见的高计算量,还可能导致许多与神经网络中的维数灾难相关的问题。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-2dfe876b793c339e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n对于高维图像数据,卷积神经网络利用了卷积和池化层,能够高效提取图像的重要“特征”,再通过后面的全连接层处理“压缩的图像信息”及输出结果。对比标准的全连接网络,卷积神经网络的模型参数大大减少了。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-30f10f3a28164817.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n\r\n\r\n## 二、卷积神经网络的“卷积”\r\n\r\n### 2.1 卷积运算的原理\r\n\r\n在信号处理、图像处理和其它工程/科学领域,卷积都是一种使用广泛的技术,卷积神经网络(CNN)这种模型架构就得名于卷积计算。但是,深度学习领域的“卷积”本质上是信号/图像处理领域内的互相关(cross-correlation),互相关与卷积实际上还是有些差异的。\r\n**卷积**是分析数学中一种重要的运算。简单定义f , g 是可积分的函数,两者的卷积运算如下:\r\n![](https://upload-images.jianshu.io/upload_images/11682271-ac8013afe4729dad.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n其定义是两个函数中一个函数(g)经过反转和位移后再相乘得到的积的积分。如下图,函数 g 是过滤器。它被反转后再沿水平轴滑动。在每一个位置,我们都计算 f 和反转后的 g 之间相交区域的面积。这个相交区域的面积就是特定位置出的卷积值。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-83fbb3cbea3e7a8b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n**互相关**是两个函数之间的滑动点积或滑动内积。互相关中的过滤器**不经过反转**,而是直接滑过函数 f,f 与 g 之间的交叉区域即是互相关。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-2df598cda54d702e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n下图展示了卷积与互相关运算过程,相交区域的面积变化的差异:\r\n![](https://upload-images.jianshu.io/upload_images/11682271-7ec40d4c838044b1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n在卷积神经网络中,卷积中的过滤器不经过反转。严格来说,这是离散形式的互相关运算,**本质上是执行逐元素乘法和求和**。但两者的效果是一致,因为过滤器的权重参数是在训练阶段学习到的,经过训练后,学习得到的过滤器看起来就会像是反转后的函数。\r\n\r\n### 2.2 卷积运算的作用\r\n\r\nCNN通过设计的卷积核(convolution filter,也称为kernel)与图片做卷积运算(平移卷积核去逐步做乘积并求和)。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-ac1d32b5a53c559c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n\r\n如下示例设计一个(特定参数)的3×3的卷积核:\r\n![](https://upload-images.jianshu.io/upload_images/11682271-f125864ce7d6c881.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n让它去跟图片做卷积,卷积的具体过程是:\r\n- 1. 用这个卷积核去覆盖原始图片;\r\n- 2. 覆盖一块跟卷积核一样大的区域之后,对应元素相乘,然后求和;\r\n- 3. 计算一个区域之后,就向其他区域挪动(假设步长是1),继续计算;\r\n- 4. 直到把原图片的每一个角落都覆盖到为止;\r\n\r\n\r\n![](https://upload-images.jianshu.io/upload_images/11682271-ae820152bfad6053.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n可以发现,通过特定的filter,让它去跟图片做卷积,就可以提取出图片中的某些特征,比如边界特征。\r\n\r\n进一步的,我们可以借助庞大的数据,足够深的神经网络,使用反向传播算法让机器去自动学习这些卷积核参数,不同参数卷积核提取特征也是不一样的,就能够提取出局部的​、更深层次和更全局的特征以应用于决策。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-bdb30995d2e8f3f8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n**卷积运算的本质性总结:过滤器(g)对图片(f)执行逐步的乘法并求和,以提取特征的过程**。卷积过程可视化可访问:https://poloclub.github.io/cnn-explainer/   或   https://github.com/vdumoulin/conv_arithmetic\r\n\r\n## 三、卷积神经网络\r\n\r\n卷积神经网络通常由3个部分构成:卷积层,池化层,全连接层。简单来说,卷积层负责提取图像中的局部及全局特征;池化层用来大幅降低参数量级(降维);全连接层用于处理“压缩的图像信息”并输出结果。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-02f798215203d1ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n###  3.1 卷积层(CONV)\r\n\r\n#### 3.1.1 卷积层基本属性\r\n卷积层主要功能是动态地提取图像特征,由滤波器filters和激活函数构成。一般要设置的超参数包括filters的数量、大小、步长,激活函数类型,以及padding是“valid”还是“same”。\r\n\r\n- 卷积核大小(Kernel):直观理解就是一个滤波矩阵,普遍使用的卷积核大小为3×3、5×5等。在达到相同感受野的情况下,卷积核越小,所需要的参数和计算量越小。卷积核大小必须大于1才有提升感受野的作用,而大小为偶数的卷积核即使对称地加padding也不能保证输入feature map尺寸和输出feature map尺寸不变(假设n为输入宽度,d为padding个数,m为卷积核宽度,在步长为1的情况下,如果保持输出的宽度仍为n,公式,n+2d-m+1=n,得出m=2d+1,需要是奇数),所以一般都用3作为卷积核大小。\r\n\r\n- 卷积核数目:主要还是根据实际情况调整, 一般都是取2的整数次方,数目越多计算量越大,相应模型拟合能力越强。\r\n\r\n- 步长(Stride):卷积核遍历特征图时每步移动的像素,如步长为1则每次移动1个像素,步长为2则每次移动2个像素(即跳过1个像素),以此类推。步长越小,提取的特征会更精细。\r\n\r\n- 填充(Padding):处理特征图边界的方式,一般有两种,一种是“valid”,对边界外完全不填充,只对输入像素执行卷积操作,这样会使输出特征图像尺寸变得更小,且边缘信息容易丢失;另一种是还是“same”,对边界外进行填充(一般填充为0),再执行卷积操作,这样可使输出特征图的尺寸与输入特征图的尺寸一致,边缘信息也可以多次计算。\r\n\r\n- 通道(Channel):卷积层的通道数(层数)。如彩色图像一般都是RGB三个通道(channel)。\r\n\r\n- 激活函数:主要还是根据实际验证,通常选择Relu。\r\n\r\n另外的,卷积的类型除了标准卷积,还演变出了反卷积、可分离卷积、分组卷积等各种类型,可以自行验证。\r\n\r\n\r\n\r\n#### 3.1.2 卷积层的特点\r\n\r\n通过卷积运算的介绍,可以发现卷积层有两个主要特点:局部连接(稀疏连接)和权值共享。\r\n\r\n- 局部连接,就是卷积层的节点仅仅和其前一层的部分节点相连接,只用来学习局部区域特征。(局部连接感知结构的理念来源于动物视觉的皮层结构,其指的是动物视觉的神经元在感知外界物体的过程中起作用的只有一部分神经元。)\r\n\r\n- 权值共享,同一卷积核会和输入图片的不同区域作卷积,来检测相同的特征,卷积核上面的权重参数是空间共享的,使得参数量大大减少。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-cad4287437305f60.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n由于局部连接(稀疏连接)和权值共享的特点,使得CNN具有**仿射的不变性(平移、缩放等线性变换)**\r\n\r\n### 3.2 池化层(Pooling)\r\n\r\n池化层可对提取到的特征信息进行降维,一方面使特征图变小,简化网络计算复杂度;另一方面进行特征压缩,提取主要特征,增加平移不变性,减少过拟合风险。 但其实池化更多程度上是一种计算性能的一个妥协,强硬地压缩特征的同时也损失了一部分信息,所以现在的网络比较少用池化层或者使用优化后的如SoftPool。\r\n\r\n池化层设定的超参数,包括池化层的类型是Max还是Average(Average对背景保留更好,Max对纹理提取更好),窗口大小以及步长等。如下的MaxPooling,采用了一个2×2的窗口,并取步长stride=2,提取出各个窗口的max值特征(AveragePooling就是平均值):\r\n\r\n![](https://upload-images.jianshu.io/upload_images/11682271-a7032d1994948ad0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n###  3.3 全连接层(FC)\r\n\r\n在经过数次卷积和池化之后,我们最后会先将多维的图像数据进行压缩“扁平化”, 也就是把 (height,width,channel) 的数据压缩成长度为 height × width × channel 的一维数组,然后再与全连接层连接(这也就是传统全连接网络层,每一个单元都和前一层的每一个单元相连接,需要设定的超参数主要是神经元的数量,以及激活函数类型),通过全连接层处理“压缩的图像信息”并输出结果。\r\n![](https://upload-images.jianshu.io/upload_images/11682271-be1d40e71c2e17bc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n### 3.4  示例:经典CNN的构建(Lenet-5)\r\n\r\n![](https://upload-images.jianshu.io/upload_images/11682271-48231f52b5db9ad8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\nLeNet-5由Yann LeCun设计于 1998年,是最早的卷积神经网络之一。它是针对灰度图进行训练的,输入图像大小为32*32*1,不包含输入层的情况下共有7层。下面逐层介绍LeNet-5的结构:\r\n\r\n\r\n\r\n- 1、C1-卷积层\r\n\r\n\r\n\r\n第一层是卷积层,用于过滤噪音,提取关键特征。使用5 * 5大小的过滤器6个,步长s = 1,padding = 0。\r\n\r\n- 2、S2-采样层(平均池化层)\r\n\r\n第二层是平均池化层,利用了图像局部相关性的原理,对图像进行子抽样,可以减少数据处理量同时保留有用信息,降低网络训练参数及模型的过拟合程度。使用2 * 2大小的过滤器,步长s = 2,padding = 0。**池化层只有一组超参数pool_size 和 步长strides,没有需要学习的模型参数**。\r\n\r\n\r\n- 3、C3-卷积层\r\n\r\n第三层使用5 * 5大小的过滤器16个,步长s = 1,padding = 0。\r\n\r\n- 4、S4-下采样层(平均池化层)\r\n\r\n第四层使用2 * 2大小的过滤器,步长s = 2,padding = 0。没有需要学习的参数。 \r\n\r\n- 5、C5-卷积层\r\n\r\n第五层是卷积层,有120个5 * 5 的单元,步长s = 1,padding = 0。\r\n\r\n- 6、F6-全连接层\r\n\r\n有84个单元。每个单元与F5层的全部120个单元之间进行全连接。\r\n\r\n- 7、Output-输出层\r\n\r\nOutput层也是全连接层,采用RBF网络的连接方式(现在主要由Softmax取代,如下示例代码),共有10个节点,分别代表数字0到9(因为Lenet用于输出识别数字的),如果节点i的输出值为0,则网络识别的结果是数字i。\r\n\r\n如下Keras复现Lenet-5:\r\n![](https://upload-images.jianshu.io/upload_images/11682271-7634d6e4cf91bb44.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n\r\n\r\n```python\r\nfrom keras.models import Sequential\r\nfrom keras import layers \r\n\r\nle_model = keras.Sequential()\r\nle_model.add(layers.Conv2D(6, kernel_size=(5, 5), strides=(1, 1), activation='tanh', input_shape=(32,32,1), padding=\"valid\"))\r\nle_model.add(layers.AveragePooling2D(pool_size=(2, 2), strides=(2, 2), padding='valid'))\r\nle_model.add(layers.Conv2D(16, kernel_size=(5, 5), strides=(1, 1), activation='tanh', padding='valid'))\r\nle_model.add(layers.AveragePooling2D(pool_size=(2, 2), strides=(2, 2), padding='valid'))\r\nle_model.add(layers.Conv2D(120, kernel_size=(5, 5), strides=(1, 1), activation='tanh', padding='valid'))\r\nle_model.add(layers.Flatten())\r\nle_model.add(layers.Dense(84, activation='tanh'))\r\nle_model.add(layers.Dense(10, activation='softmax'))\r\n```\r\n\r\n\r\n## 四、keras实战CNN图像分类\r\n\u003e 以keras经典的CIFAR10图像数据集的分类为例,代码:https://github.com/aialgorithm/Blog\r\n\r\n- 训练集输入数据的样式为:(50000, 32, 32, 3)对应 (样本数, 图像高度, 宽度, RGB彩色图像通道为3) \r\n```\r\nfrom keras.datasets import cifar10\r\nfrom keras.preprocessing.image import ImageDataGenerator\r\nfrom keras.models import Sequential\r\nfrom keras.layers import Dense, Dropout, Activation, Flatten\r\nfrom keras.layers import Conv2D, MaxPooling2D\r\nimport keras\r\nimport os\r\n\r\n# 数据,切分为训练和测试集\r\n(x_train, y_train), (x_test, y_test) = cifar10.load_data()\r\nprint('x_train shape:', x_train.shape)\r\nprint(x_train.shape[0], 'train samples')\r\nprint(x_test.shape[0], 'test samples')\r\n```\r\n\r\n- 展示数据集,共有10类图像:\r\n![](https://upload-images.jianshu.io/upload_images/11682271-ce270db7096bb41f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n![](https://upload-images.jianshu.io/upload_images/11682271-6deb275e68fd26cf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n```\r\n# 展示数据集\r\nimport matplotlib.pyplot as plt\r\nclass_names = ['airplane', 'automobile', 'bird', 'cat', 'deer',\r\n               'dog', 'frog', 'horse', 'ship', 'truck']\r\n\r\nplt.figure(figsize=(10,10))\r\nfor i in range(25):\r\n    plt.subplot(5,5,i+1)\r\n    plt.xticks([])\r\n    plt.yticks([])\r\n    plt.grid(False)\r\n    plt.imshow(x_train[i])\r\n    # The CIFAR labels happen to be arrays, \r\n    # which is why you need the extra index\r\n    plt.xlabel(class_names[y_train[i][0]])\r\nplt.show()\r\n```\r\n- 数据及标签预处理:\r\n```\r\n# 将标签向量转换为二值矩阵。\r\nnum_classes = 10  #图像数据有10个实际标签类别\r\ny_train = keras.utils.to_categorical(y_train, num_classes)\r\ny_test = keras.utils.to_categorical(y_test, num_classes)\r\n\r\nprint(y_train.shape, 'ytrain')\r\n\r\n# 图像数据归一化\r\nx_train = x_train.astype('float32')\r\nx_test = x_test.astype('float32')\r\nx_train /= 255\r\nx_test /= 255\r\n```\r\n- 构造卷积神经网络: 输入层-\u003e多组卷积及池化层-\u003e全连接网络-\u003esoftmax多分类输出层。(如下图部分网络结构)\r\n![](https://upload-images.jianshu.io/upload_images/11682271-6fd16f4dd336b3cd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n\r\n\r\n```\r\n# 构造卷积神经网络\r\nmodel = Sequential()\r\n\r\n# 图像输入形状(32, 32, 3) 对应(image_height, image_width, color_channels) \r\nmodel.add(Conv2D(32, (3, 3), padding='same',\r\n                 input_shape=(32, 32, 3)))\r\nmodel.add(Activation('relu'))\r\nmodel.add(Conv2D(32, (3, 3)))\r\nmodel.add(Activation('relu'))\r\nmodel.add(MaxPooling2D(pool_size=(2, 2)))\r\nmodel.add(Dropout(0.25))\r\n\r\n# 卷积、池化层输出都是一个三维的(height, width, channels)\r\n# 越深的层中,宽度和高度都会收缩\r\nmodel.add(Conv2D(64, (3, 3), padding='same'))\r\nmodel.add(Activation('relu'))\r\nmodel.add(Conv2D(64, (3, 3)))\r\nmodel.add(Activation('relu'))\r\nmodel.add(MaxPooling2D(pool_size=(2, 2)))\r\nmodel.add(Dropout(0.25))\r\n\r\n#  3 维展平为 1 维 ,输入全连接层\r\nmodel.add(Flatten())\r\nmodel.add(Dense(512))\r\nmodel.add(Activation('relu'))\r\nmodel.add(Dropout(0.5))\r\nmodel.add(Dense(num_classes))   # CIFAR数据有 10 个输出类,以softmax输出多分类\r\nmodel.add(Activation('softmax')) \r\n```\r\n- 模型编译:设定RMSprop 优化算法;设定分类损失函数.\r\n```\r\n# 初始化 RMSprop 优化器\r\nopt = keras.optimizers.rmsprop(lr=0.001, decay=1e-6)\r\n\r\n# 模型编译:设定RMSprop 优化算法;设定分类损失函数;\r\nmodel.compile(loss='categorical_crossentropy',\r\n              optimizer=opt,\r\n              metrics=['accuracy'])\r\n\r\n```\r\n\r\n- 模型训练: 简单验证5个epochs\r\n```\r\nbatch_size = 64\r\nepochs = 5  \r\n\r\nhistory = model.fit(x_train, y_train,\r\n              batch_size=batch_size,\r\n              epochs=epochs,\r\n              validation_data=(x_test, y_test),\r\n              shuffle=True)\r\n```\r\n- 模型评估:测试集accuracy: 0.716,可见训练/测试集整体的准确率都不太高(欠拟合),可以增加epoch数、模型调优验证效果。\r\n\u003e 附卷积神经网络优化方法(tricks):\r\n超参数优化:可以用随机搜索、贝叶斯优化。推荐分布式超参数调试框架Keras Tuner包括了常用的优化方法。\r\n数据层面:数据增强广泛用于图像任务,效果提升大。常用有图像样本变换、mixup等。更多优化方法具体可见:https://arxiv.org/abs/1812.01187\r\n\r\n![](https://upload-images.jianshu.io/upload_images/11682271-3f6501d1de7cb521.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\r\n\r\n```\r\n# 保存模型和权重\r\nnum_predictions = 20\r\nsave_dir = os.path.join(os.getcwd(), 'saved_models')\r\nmodel_name = 'keras_cifar10_trained_model.h5'\r\n\r\nif not os.path.isdir(save_dir):\r\n    os.makedirs(save_dir)\r\nmodel_path = os.path.join(save_dir, model_name)\r\nmodel.save(model_path)\r\nprint('Saved trained model at %s ' % model_path)\r\n\r\n# 评估训练模型\r\nscores = model.evaluate(x_test, y_test, verbose=1)\r\nprint('Test loss:', scores[0])\r\nprint('Test accuracy:', scores[1])\r\n\r\nplt.plot(history.history['accuracy'], label='accuracy')\r\nplt.plot(history.history['val_accuracy'], label = 'val_accuracy')\r\nplt.xlabel('Epoch')\r\nplt.ylabel('Accuracy')\r\nplt.ylim([0.5, 1])\r\nplt.legend(loc='lower right')\r\nplt.show()\r\n```\r\n---\r\n文章首发公众号“算法进阶”,公众号阅读原文可访问文章相关代码","author":{"url":"https://github.com/aialgorithm","@type":"Person","name":"aialgorithm"},"datePublished":"2021-12-08T14:49:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/37/Blog/issues/37"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:11c55005-eab3-5cfc-f2a0-5ced43915db0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA046:3A6082:6BA7A4:8ABD0B:696AEB96
html-safe-noncee567ddd648511f4ca0a2f51e7933788b2002bba5bdd193e1efc11f593152f11f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDQ2OjNBNjA4Mjo2QkE3QTQ6OEFCRDBCOjY5NkFFQjk2IiwidmlzaXRvcl9pZCI6Ijg1NzU1NjQ5MTMwOTY0NTMwMTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8a3269c9b8e0360214bc30f0a1df5372fd0af65b83200bd5aca5e03e8e172067
hovercard-subject-tagissue:1074493064
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aialgorithm/Blog/37/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ef2fa1b45ba6bdb0529cfd60edc4d5dbd290698ca59bc51b6dfe141b661ab16f/aialgorithm/Blog/issues/37
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ef2fa1b45ba6bdb0529cfd60edc4d5dbd290698ca59bc51b6dfe141b661ab16f/aialgorithm/Blog/issues/37
og:image:alt一、卷积神经网络简介 卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算的前馈神经网络,是基于图像任务的平移不变性(图像识别的对象在不同位置有相同的含义)设计的,擅长应用于图像处理等任务。在图像处理中,图像数据具有非常高的维数(高维的RGB矩阵表示),因此训练一个标准的前馈网络来识别图像将需要成千上万的输入神经元,除了显而易见的高计算量,还...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaialgorithm
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/aialgorithm/Blog git https://github.com/aialgorithm/Blog.git
octolytics-dimension-user_id33707637
octolytics-dimension-user_loginaialgorithm
octolytics-dimension-repository_id147093233
octolytics-dimension-repository_nwoaialgorithm/Blog
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id147093233
octolytics-dimension-repository_network_root_nwoaialgorithm/Blog
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/aialgorithm/Blog/issues/37#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Faialgorithm%2FBlog%2Fissues%2F37
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Faialgorithm%2FBlog%2Fissues%2F37
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=aialgorithm%2FBlog
Reloadhttps://github.com/aialgorithm/Blog/issues/37
Reloadhttps://github.com/aialgorithm/Blog/issues/37
Reloadhttps://github.com/aialgorithm/Blog/issues/37
aialgorithm https://github.com/aialgorithm
Bloghttps://github.com/aialgorithm/Blog
Notifications https://github.com/login?return_to=%2Faialgorithm%2FBlog
Fork 259 https://github.com/login?return_to=%2Faialgorithm%2FBlog
Star 942 https://github.com/login?return_to=%2Faialgorithm%2FBlog
Code https://github.com/aialgorithm/Blog
Issues 66 https://github.com/aialgorithm/Blog/issues
Pull requests 0 https://github.com/aialgorithm/Blog/pulls
Actions https://github.com/aialgorithm/Blog/actions
Projects 0 https://github.com/aialgorithm/Blog/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/aialgorithm/Blog/security
Please reload this pagehttps://github.com/aialgorithm/Blog/issues/37
Insights https://github.com/aialgorithm/Blog/pulse
Code https://github.com/aialgorithm/Blog
Issues https://github.com/aialgorithm/Blog/issues
Pull requests https://github.com/aialgorithm/Blog/pulls
Actions https://github.com/aialgorithm/Blog/actions
Projects https://github.com/aialgorithm/Blog/projects
Security https://github.com/aialgorithm/Blog/security
Insights https://github.com/aialgorithm/Blog/pulse
New issuehttps://github.com/login?return_to=https://github.com/aialgorithm/Blog/issues/37
New issuehttps://github.com/login?return_to=https://github.com/aialgorithm/Blog/issues/37
一文弄懂CNN及图像识别(Python)https://github.com/aialgorithm/Blog/issues/37#top
https://github.com/aialgorithm
https://github.com/aialgorithm
aialgorithmhttps://github.com/aialgorithm
on Dec 8, 2021https://github.com/aialgorithm/Blog/issues/37#issue-1074493064
https://camo.githubusercontent.com/bd7b28d15c0be131164f7d109ec504bb3928395b1b2cb83633eaf24bb744abc1/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d326466653837366237393363333339652e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/37743c99b1be5bc915fc4e214f30a724e106fb25555ef1e1dd1f9fc632ce7fda/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d333066313066336132383136343831372e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/e08432a062f4079d51fb07fb240013d13096a1733e2668e2318746207b44d4e5/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d616338303133616665343732396461642e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/6623cb101c8a64765d9b533e11735d339a389f2387f2d7894189a3874973aebb/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d383366626233636265613365376138622e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/e558fc0671600877e3f68ec57a7585942da7489de9d3de12299fbeb5983b7763/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d326466353938636461353464373032652e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/25ba30354c9d4ae03a82c6c533255610957c694d0fdbeee67af5fdc855399692/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d376563343064346338333830343462312e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/9e971a6754b195738358cb0d155cd73f54e7f33011a5826971c4945efa15a787/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d616331643332623561353363353539632e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/34a661afaa6327ed66c6b8f09cf600edaf4c921785c419418303e404a7d1e897/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d663132353836346365376436633838312e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/8de69a54c151c8d03968447754fc9d79abd5808da62a2694def9a8b059dc8a0a/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d616538323031353262666164363035332e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/2f144e415041acb707c730ad075187a0705583c048285259df3e705a42713600/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d626462333039393564326538663366382e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://poloclub.github.io/cnn-explainer/https://poloclub.github.io/cnn-explainer/
https://github.com/vdumoulin/conv_arithmetichttps://github.com/vdumoulin/conv_arithmetic
https://camo.githubusercontent.com/35db9e1d8a65b16246c6a3993ce4532d96007604aa2ba1a3a991e2f4af48a354/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d303266373938323135323033643166662e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/8056b43c06e4596418a2f7d3cd0b64799925124b03300a2ec64793139d9c9e01/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d636164343238373433373330356636302e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/dd3fc103483411fc240e54ccd5eeb51b71400bead8c21a06d1553ce301077d9d/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d613730333264313939343934386164302e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/b3e8584918a0a26e7cd412148623bdfaec378f6efbaa000cfcbc61aeeb122b1b/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d626531643430653731633265313762632e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/736c473821dd0582a63d9af353777104e6dadb3b912059b6c75e72a610a62617/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d343832333166353262356462396164382e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/c6a4f4f0d9554246f92b988108c138343a98a54103ac0c7df4e18f0f48360598/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d373633346436653463663931626234342e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://github.com/aialgorithm/Bloghttps://github.com/aialgorithm/Blog
https://camo.githubusercontent.com/8533e0e8fcbc1dc5be69ebe78fb429252ceda89a1dc5299377d5e6313019fa52/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d636532373064623730393662623431662e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/380d719120a2af47616021f6c64a77cd3db5086d529440c88f33660ac7e6f8ef/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d366465623237356536386664323663662e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://camo.githubusercontent.com/57786c2f2b1296cffa24807549788aa7b04d4d68b7cc9193a46d90ec1eb208fd/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d366664313666346464333336623363642e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://arxiv.org/abs/1812.01187https://arxiv.org/abs/1812.01187
https://camo.githubusercontent.com/570ec1a2b002471c8299d0085797a0bc654476756b0244015f2c0254e4508826/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d336636353031643164653763623532312e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.