# Why do convolutional neural networks work?

I have often heard people saying that why convolutional neural networks are still poorly understood. Is it known why convolutional neural networks always end up learning increasingly sophisticated features as we go up the layers? What caused them create such a stack of features and would this also be true for other types of deep neural networks?

• Great explanation from Jeremy Howard in the second half of this video: youtube.com/watch?v=ACU-T9L4_lI – Dan Jan 4 '18 at 18:43
• I think you're misunderstanding. We absolutely understand fairly well why convnets work as a class of algorithms. On the other hand, it is often very difficult to understand why a specific model made a particular prediction. This is why we call them "black box models: their inference process is opaque to us. That doesn't mean we are confused about why they are effective. – David Marx Jan 4 '18 at 23:42

Actually I guess the question is a bit broad! Anyway.

# Understanding Convolution Nets

What is learned in ConvNets tries to minimize the cost function to categorize the inputs correctly in classification tasks. All parameter changing and learned filters are in order to achieve the mentioned goal.

### Learned Features in Different Layers

They try to reduce the cost by learning low level, sometimes meaningless, features like horizontal and vertical lines in their first layers and then stacking them to make abstract shapes, which often have meaning, in their last layers. For illustrating this fig. 1, which has been used from here, can be considered. The input is the bus and the gird shows the activations after passing the input through different filters in the first layer. As it can be seen the red frame which is the activation of a filter, which its parameters have been learned, has been activated for relatively horizontal edges. The blue frame has been activated for relatively vertical edges. It is possible that ConvNets learn unknown filters that are useful and we, as e.g. computer vision practitioners, have not discovered that they may be useful. The best part of these nets is that they try to find appropriate filters by their own and don't use our limited discovered filters. They learn filters to reduce the amount of cost function. As mentioned these filters are not necessarily known.

In deeper layers, the features learned in previous layers come together and make shapes which often have meaning. In this paper it has been discussed that these layers may have activations which are meaningful to us or the concepts which have meaning to us, as human beings, may be distributed among other activations. In fig. 2 the green frame shows the activatins of a filter in the fifth layer of a ConvNet. This filter cares about the faces. Suppose that the red one cares about hair. These have meaning. As it can be seen there are other activations that have been activated right in the position of typical faces in the input, the green frame is one of them; The blue frame is another example of these. Accordingly, abstraction of shapes can be learned by a filter or numerous filters. In other words, each concept, like face and its components, can be distributed among the filters. In cases where the concepts are distributed among different layers, if someone look at each of them, they may be sophisticated. The information is distributed among them and for understanding that information all of those filters and their activations have to be considered although they may seem so much complicated.

CNNs should not be considered as black boxes at all. Zeiler et all in this amazing paper have discussed the development of better models is reduced to trial and error if you don't have understanding of what is done inside these nets. This paper tries to visualize the feature maps in ConvNets.

### Capability to Handle Different Transformations to Generalize

ConvNets use pooling layers not only to reduce the number of parameters but also to have the capability to be insensitive to the exact position of each feature. Also the use of them enables the layers to learn different features which means first layers learn simple low level features like edges or arcs, and deeper layers learn more complicated features like eyes or eyebrows. Max Pooling e.g. tries to investigate whether a special feature exists in a special region or not. The idea of pooling layers is so useful but it is just capable to handle transition among other transformations. Although filters in different layers try to find different patterns, e.g. a rotated face is learned using different layers than a usual face, CNNs by there own do not have any layer to handle other transformations. To illustrate this suppose that you want to learn simple faces without any rotation with a minimal net. In this case your model may do that perfectly. suppose that you are asked to learn all kind of faces with arbitrary face rotation. In this case your model has to be much more bigger than the previous learned net. The reason is that there have to be filters to learn these rotations in the input. Unfortunately these are not all transformations. Your input may also be distorted too. These cases made Max Jaderberg et all angry. They composed this paper to deal with these problems in order to settle down our anger as theirs.

### Convolutional Neural Networks Do Work

Finally after referring to these points, they work because they try to find patterns in the input data. They stack them to make abstract concepts by there convolution layers. They try to find out whether the input data has each of these concepts or not in there dense layers to figure out which class the input data belongs to.

ConvNets work because they exploit feature locality. They do it at different granularities, therefore being able to model hierarchically higher level features. They are translation invariant thanks to pooling units. They are not rotation-invariant per se, but they usually converge to filters that are rotated versions of the same filters, hence supporting rotated inputs.

I know of no other neural architecture that profits from feature locality in the same sense as ConvNets do.

• I would say that RNNs benefit in a similar way to CNNs, re-using weights over time series. CNNs can also be thought of as not necessarily translation invariant, but "dimension invariant" (although I'm not sure that is a correct or recognised term) – Neil Slater Dec 24 '16 at 15:40
• Thanks for your answer. Correct me if I am wrong on the following conclusions - 1. It seems that we have implicitly designed ConvNets to learn hierarchically higher level features though pooling. Its not an accident that features get sophisticated up the layers. 2. Including the domain information in one's neural network design can make huge difference in learning efficiency. ConvNets and RNNs are trying to do just that. – Praise the lord Dec 27 '16 at 4:30
• Your statements 1 and 2 seem correct to me. – ncasas Jan 9 '17 at 15:29
• I think capsule networks are supposed to leverage feature locality in a similar way – David Marx Feb 11 '18 at 21:19

One should never forget the other components in a typical ConvNet. The convolution filters pick out the spatial invariant features, like edges and circles. These features are quantified in a pooling layer which follows the C layer. Finally, they are fed into (usually) multiple fully connected layers (fc). Credit must be given to these fully connected layers which are nothing more than what you find in any ordinary MLP.

Convolutional neural networks work because it's a good extension from the standard deep-learning algorithm.

Given unlimited resources and money, there is no need for convolutional because the standard algorithm will also work. However, convolutional is more efficient because it reduces the number of parameters. The reduction is possible because it takes advantage of feature locality, exactly what @ncasas writes.

• This should be the best answer – Jie.Zhou Jan 6 at 4:41

# Is it known why convolutional neural networks always end up learning increasingly sophisticated features as we go up the layers?

This is pure mathematics. A neural network, at the end of the day, is a big mathematical function. And the deeper the network, the bigger the function it represents. And by bigger, I obviously mean high-dimensional. The features learned are more sophisticated because they are the results of more sophisticated functions.

# What caused them create such a stack of features

Interestingly enough, conventional neural networks were inspired by our own, actually cat's, biology. Hubel and Wiesel conducted experiments on the visual cortex of cats, and they realized that light was perceived by stacks of optic fields. This is what inspired convolutional layer and a deeper architecture.

Building on ncasas and horaceT answers, ConvNets are very efficient because:

1. They are invavriant to geometrical transformations and learn features that get increasingly complicated and detailed, hence being powerful hierarchical feature extractors thanks to the convolutional layers.
2. They combine the extracted features and aggregate them in a non linear fashion to predict the output and therefore being robust classifiers thanks to the fully connected layers.

If you want to learn more about convnets and the different blocks building them as well as the intuitions that underly, here's a post I recently wrote on my personal blog that goes through the details.

• Please note if you want to promote your own product/blog you must disclose your affiliation in the answer, otherwise, your answer may be flagged as spam. If you are not affiliated with the site, I recommend you say so to prevent this. Please read How to not be a spammer – A J Jan 1 '18 at 12:29