首页 文章

在CNN中实施辍学会降低培训准确率

提问于
浏览
0

实施用于图像分类的卷积神经网络,我的训练集精度(98%)有很好的结果,但测试集的准确性仍然很低(约82%) . 我正面临一个过度拟合的问题 . 我试图通过实现一个dropout函数来解决它(保持50%的神经元),但事实证明这个解决方案使我的训练精度下降到80%!这是否意味着我的CNN中应该有更多的神经元?我该怎么做才能防止这个问题?

我正在使用Tensorflow库,这里是训练循环的一段代码:(我不确定我是否正确实现了它)

for epoch in range(22000):
    permutation=np.random.permutation(19600)
    permutation=permutation[0:200]
    batch=[train_set[permutation],train_label[permutation]]
    summary,model,cost=sess.run([merged,train_step,cross_entropy],feed_dict={X:batch[0],Yreal:batch[1],drop_value:0.5}) #training with 50% of the neurons
    train_writer.add_summary(summary,epoch)
    print(cost)
    if epoch%500==0:
        print(epoch)
        summary=sess.run(merged,feed_dict={X:test_set[0:300],Yreal:test_label[0:300],drop_value:1}) #evaluating testing set accuracy using 100% of the neurons
        test_writer.add_summary(summary,epoch)

1 回答

  • 2

    如果您的测试精度与辍学情况下的训练准确度大致相同,那么您可以增加神经元的数量 . 此外,初始丢失0.50非常高 . 从0.25开始(即保留丢失层的概率为0.75 . )另外,我建议使用一些数据增强,如旋转,扭曲亮度,根据数据的性质交换颜色通道,以及使用一些正则化 . 还绘制学习曲线并检查测试精度如何随训练精度而变化 .

相关问题