Why does my CIFAR 100 CNN model mainly predict two classes?

前端 未结 4 1105
不思量自难忘°
不思量自难忘° 2021-01-17 00:06

I am currently trying to get a decent score (> 40% accuracy) with Keras on CIFAR 100. However, I\'m experiencing a weird behaviour of a CNN model: It tends to predict some c

4条回答
  •  执念已碎
    2021-01-17 01:03

    1. I don't see you doing mean-centering, even in datagen. I suspect this is the main cause. To do mean centering using ImageDataGenerator, set featurewise_center = 1. Another way is to subtract the ImageNet mean from each RGB pixel. The mean vector to be subtracted is [103.939, 116.779, 123.68].

    2. Make all activations relus, unless you have a specific reason to have a single tanh.

    3. Remove two dropouts of 0.25 and see what happens. If you want to apply dropouts to convolution layer, it is better to use SpatialDropout2D. It is somehow removed from Keras online documentation but you can find it in the source.

    4. You have two conv layers with same and two with valid. There is nothing wrong in this, but it would be simpler to keep all conv layers with same and control your size just based on max-poolings.

提交回复
热议问题