【发布时间】:2018-04-22 21:52:08
【问题描述】:
我正在构建一个 CNN,用 50x50 像素灰度图像(每类 1400 个)对 6 个类进行分类。在训练模型并评估损失和准确度之后,一切似乎都运行良好,训练准确度约为 98%,损失下降到 3.0,但是在对每个类的测试数据评估模型时,模型已经偏离了。我的课程是面部表情的图像: 1) 愤怒 2)恐惧 3) 快乐 4) 中立 5) 伤心 6) 惊喜
这里是 Jupyter 笔记本:https://www.floydhub.com/arse123/projects/cnn-1/20/code/train_edge.ipynb
例如,当我为每个类别提供 350 张测试图像时,只会预测 anger 和 suprise 类别。
TEST IMAGES RESULTS
Angry - it classified 76 angry, and 273 surprise
Fear - it classified 8 angry and 342 surprise
Happy - 12 angry and 338 surprise
Neutral - 350 surprise
Sad - 22 angry and 328 surprise
Surprise - a full 350/350 classified for this one..
很明显,由于没有一张其他图像被分类一次,因此存在一些对愤怒和惊讶的偏见。
当我在训练后运行acc.eval({x: test_images, y: test_labels, is_training : False})(每个类和相应的 2100 张图像)时,我得到了 82% 的准确率,所以我不知道这是怎么发生的。该模型是否有可能一直在这两个课程上进行训练?
@注意:图像和标签是一种热编码,也是随机打乱的,已实现批量标准化
更新
我重新训练了模型,它具有相同的效果,但具有不同的类别。这一次它倾向于悲伤和惊奇,而不是愤怒和惊奇。 结果如下:
Angry - Sad 259 and surprise 75
Fear - Sad 118 and surprise 218 (some classifications missing here for some reason)
Happy - Sad 167 times and suprise 160 times (same again, missing some classifications)
Neutral - sad 94 and surprise 249
Sad - sad 211 and surprise 122
Surprise - Sad 284 and surprise 52
【问题讨论】:
-
看起来像 cell [5] 鞋你的标签有相同的单热编码...是真的吗?
-
是的,它们是一种热编码,但这只是偶然,它们似乎都几乎相同,我检查了 labels[0:100] 并且标签正确洗牌
标签: python tensorflow machine-learning neural-network conv-neural-network