简体   繁体   English

Keras CNN训练精度不错,但是测试精度很低

[英]Keras CNN training accuracy is good but test accuracy is very low

Please give me any comment for these CNN results. 请给我有关这些CNN结果的任何评论。 I have used 2000 training images and 400 test images. 我已经使用了2000个训练图像和400个测试图像。 Training accuracy is perfect but test accuracy is very low. 训练精度是完美的,但测试精度却很低。 I think it because there is much variation between training and test images. 我认为是因为训练图像和测试图像之间存在很大差异。 Anyone have a good idea for this case? 有人对此案有个好主意吗?

[ [ 精度图 ] ]

This is clear case of over-fitting. 这显然是过度拟合的情况。 How many learneable parameters you have? 您有多少个可学习的参数? For example VGGnet has 138M parameters and in this case its not very hard to see some neuron in the network must have sort of memorized a training image as it is and thus your network is not generalizing well. 例如,VGGnet具有138M参数,在这种情况下,很难看到网络中的某些神经元必须已经记住了某种训练图像,因此您的网络不能很好地概括。

To fix that, first of all you can try a simpler model if task is simple like discriminating between shapes . 要解决此问题,首先,如果任务很简单(例如区分shape),则可以尝试使用更简单的模型 Also you can increase training data via transformations like swapping color channels (if it doesnt impact the output class), flipping or rotating image to make your net generalize better. 此外,您还可以通过交换颜色通道(如果不影响输出类),翻转或旋转图像等变换来增加训练数据,以使网络更全面。 Include L1/L2 regularization in your loss function and try dropouts. 在损失函数中包括L1 / L2正则化,然后尝试辍学。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM