Powerful technology for image classification is the convolution neural network and it works really well with transfer learning. So we’ll go through the basics of CNNs first and then we’ll learn how to apply transfer learning to train CNNs. A typical convolutional neural network or CNN architecture looks a bit like this. Conceptually, a CNNs earlier layers extract low-level features such as edges. Later layers use those lower-level features to extract higher-level features such as shapes.
The image is fed in through one or more layers, some of which are special types called convolutional layers. These are represented in this diagram as Conv 1 and Conv 2. Each layer contains multiple filters, which are represented in the diagram as the stacks of orange rectangles. Each filter can extract features from the image. And when those features are matched to labels, we then have the basis of a model that can classify a picture. There are often many filters in each layer, so at each layer, we pass the image through each filter. For example, if there are 64 filters in the first layer Conv 1, then effectively 64 filtered copies of the image have passed to the second layer. And if that had 64 filters, then 64 times 64 copies of the image have passed forward. Now that can get computationally intensive. So pulling layers, which appear after Conv 1 and again after Conv 2 are used to reduce the number of computations. Pulling is a methodology to reduce the number of pixels in the image while maintaining the features of the image and often enhancing those features.
The CNN architecture follows a series of convolutional and pooling layers with dense layers. Since images are typically two dimensions with a width and a height, this is incompatible with dense layers for classification. So the 2D layer is first flattened into a one D array using a flattened layer,
before being fed into the dense layers for a typical classification. And there’s an output layer having one neuron for each output class representing the probability that the input matches that class. In the diagram, the capital N refers to the number of classes that the model can choose amongst. So if the classifier can choose between cats, dogs, and birds then N equals 3 and the output layer has three neurons. The output layer uses a softmax activation to scale its output value so that they add up to one and can be treated as probabilities that the image is a cat, a dog, or a bird.


0 Comments
Post a Comment