I wrote my CNN code from scratch with some convolution kernels. But my CNN can't recognize flipped/spinned images correctly when there are only a few convolution kernels (3*3). My convolution kernels change very little during training. Why?

When there are over 10 convolution kernels, my CNN starts to recognize fipped images. So more kernels help. However it also starts to make wrong recognition.

How will the resolution of images affect the result compared to the convolution kernel size? The higher the resolution, the higher the dimension of this fitting problem

  • 1
    $\begingroup$ I think you should look at capsule networks $\endgroup$ – Alex Feb 19 at 9:33
  • $\begingroup$ Does data augmentation help in this problem (fora given image, also include spinned images in train_x)? $\endgroup$ – Shamit Verma Mar 8 at 18:47
  • $\begingroup$ i didnt try. but id rather not do it, cuz the essence of cnns is to recognize spinned images, that's y i dont wanna put spinned ones in the training set $\endgroup$ – feynman Mar 9 at 2:43

Learning for a CNN depends on the width and depth of a network. Wider and deeper networks can learn more complex data structures, including data augmented images. Increasing the width and depth of a network increase the capacity of the model to learn features.

Width is generally associated with the number of features. The wider a network is the more features it is able to learn. Imagine a network that is very thin. It would only learn the single feature that is correlated with high performance on the task.

Depth is will increase the capacity of the model better weigh lower-level features. Each successive layer is a combination of the previous layer. The lower layers learn simple features which are combined to create complex features in higher layers. In the case of faces, lower layers learn lines of different orientations. Higher layers learn to combine those lines to form eyes and noses.

Increasing the number of kernels is one way to increase the width of the network.

Increasing the number of layers (i.e., depth) is generally more useful.

  • $\begingroup$ ok, could u explain y depth and width can help $\endgroup$ – feynman Mar 9 at 2:45
  • $\begingroup$ Sure - I edited it to hopefully clarify the idea. $\endgroup$ – Brian Spiering Mar 9 at 15:57
  • $\begingroup$ so which of convolution and pooling do u think can reserve rotational invariance $\endgroup$ – feynman Mar 12 at 10:29

Does your CNN contain pooling layers? They are used for used for handling invariances as explained in https://stats.stackexchange.com/a/239079

  • $\begingroup$ no pooling layer yet, but my code is able to recognize spinned images with an increase in conv filters $\endgroup$ – feynman Mar 10 at 4:02
  • $\begingroup$ thx for the link. but i dont think pooling is responsible for rotational invariance always. if the rotation or translation are within the size of the pooling stride, then yes, invariant. otherwise, useless $\endgroup$ – feynman Mar 12 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.