Convolutions and Convolutional Neural Networks

Convolutions and Convolutional Neural Networks

convolution

Given a convolution kernel, cover it in the matrix of the input image, multiply and add the value of each cell of the input image and the corresponding convolution kernel value, and write it into the output cell. Given The step size slides in turn to fill the output matrix. Use padding to prevent edge features from being ignored.
convolution operation

basic structure

As early as 1998, the basic structure was established in LeNet5 , convolution, pooling, convolution, pooling, full connection, full connection, output. The convolutional layer is used to extract the underlying features of the image, the pooling layer is used to prevent overfitting and reduce the data dimension, the fully connected layer is used to summarize the features and information obtained by the previous convolutional layer and pooling layer, and finally Output (softMax/sigmod)
convolutional neural network
A convolutional layer consists of many kernels . These kernels (sometimes called convolutional filters ) present in a convolutional layer learn local features present in an image (for example, how a human eye looks). Such local features learned by convolutional layers are called feature maps . These features are then convolved on the image. This convolution operation will result in a matrix (sometimes called an activation map ). Activation maps produce high values ​​at a given location if the feature represented in the convolutional filter is present at that location in the input.
Convolution Kernel Operations

Pooling layer and fully connected layer

The pooling layer makes the CNN a little bit translation invariant in the output of the convolution ( for example , if the eye is shifted slightly in the two images, the CNN will still recognize it as an eye ). There are two different pooling mechanisms (max pooling and average pooling). Generally, max pooling ( max Pooling ) is called pooling because max pooling is widely used compared to average pooling. More precisely, the pooling operation ( max Pooling ) outputs the maximum value of the input at a given position, which falls in the kernel.

The role of pooling:

  1. Reduce the amount of parameters
  2. prevent overfitting

The pooling layer is flattened into a long vector flatten and finally fed to the fully connected neural network. In a fully connected neural network, each layer is connected to all neurons in the previous layer and finally becomes a dense connection, so it is called fully connected.
Full connection operation
A Visual Guide to
Convolutional Neural Networks

Guess you like

Origin blog.csdn.net/qq_43759081/article/details/124269718