简体   繁体   English

CNN 模型验证准确率并未提高

[英]CNN model validation accuracy is not improving

I am currently working on a CNN model for classification, I have to predict words on a wav file.我目前正在研究用于分类的 CNN 模型,我必须预测 wav 文件中的单词。 I encountered a problem with my validation accuracy that stays (almost) the same, first I was thinking of overfitting but that does not seem to be the problem.我遇到了一个问题,我的验证准确性(几乎)保持不变,首先我想到了过度拟合,但这似乎不是问题。 Below you can see a photo with the result at the different epochs:您可以在下面看到一张照片,其中包含不同时期的结果: 在此处输入图片说明

I am building a CNN model with Keras and using the 'adam' optimizer and 'categorical_crossentropy' for the loss.我正在用 Keras 构建一个 CNN 模型,并使用 'adam' 优化器和 'categorical_crossentropy' 来计算损失。 I already have tried to increase the number of epochs until 1000 and changed the batch size.我已经尝试将 epoch 数增加到 1000 并更改了批量大小。

Your training loss seems to be decreasing but val_loss is increasing while val_accuracy is approximately same.您的训练损失似乎在减少,但 val_loss 正在增加,而 val_accuracy 大致相同。 This is standard case of overfitting.这是过拟合的标准情况。 Why do you think that's not the case?为什么你认为情况并非如此?


Increasing the training epochs or batch size is not helpful as you're just changing the number of times the model sees the data or the quantity of data it sees in one epoch.增加训练时期或批次大小没有帮助,因为您只是更改模型在一个时期内看到数据的次数或数据量。


For current scenario, the best model is created till the point both val_loss and train_loss continues to decrease before it becomes saturated.对于当前场景,创建最佳模型,直到 val_loss 和 train_loss 在饱和之前继续下降。 To address the problem, you need to add noise in the training data so that the model generalizes better, generalize the examples better, create balanced categories in terms of training data volume.为了解决这个问题,您需要在训练数据中添加噪声,以便模型更好地泛化,更好地泛化示例,在训练数据量方面创建平衡的类别。


Secondly, you can increase your validation dataset to see if it continues to have the same issue.其次,您可以增加验证数据集以查看它是否仍然存在相同的问题。 If it's there then the model is definitely overfitting.如果它在那里,那么模型肯定是过度拟合的。 ALso please update your question about what kind of validation set and technique you're using.还请更新您关于您使用的验证集和技术类型的问题。 If possible, add the code snippet of your validation set and loss function如果可能,添加验证集和损失函数的代码片段

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

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