Image 验证损失在CNN、模型拟合或过度拟合中显著减少?

Image 验证损失在CNN、模型拟合或过度拟合中显著减少?,image,machine-learning,classification,loss-function,cnn,Image,Machine Learning,Classification,Loss Function,Cnn,我的CNN模型有问题 我有89张原始眼底图像,其中5张是正常的,84张是非正常的。然后,我用OpenCV扩展了normal类,所以我有85张normal类和84张unnormal类的图像 我用ResNet-50训练它。我得到: Train on 118 samples, validate on 51 samples Epoch 1/200 118/118 [==============================] - 9s 80ms/sample - loss: 0.3268 - accu

我的CNN模型有问题

我有89张原始眼底图像,其中5张是正常的,84张是非正常的。然后,我用OpenCV扩展了normal类,所以我有85张normal类和84张unnormal类的图像

我用ResNet-50训练它。我得到:

Train on 118 samples, validate on 51 samples
Epoch 1/200
118/118 [==============================] - 9s 80ms/sample - loss: 0.3268 - accuracy: 0.8475 - val_loss: 1260226.0000 - val_accuracy: 0.7549
Epoch 2/200
118/118 [==============================] - 1s 8ms/sample - loss: 0.2474 - accuracy: 0.8771 - val_loss: 114804.7059 - val_accuracy: 0.7549
Epoch 3/200
118/118 [==============================] - 1s 8ms/sample - loss: 0.2740 - accuracy: 0.8390 - val_loss: 6039848.1569 - val_accuracy: 0.7549
Epoch 4/200
118/118 [==============================] - 1s 8ms/sample - loss: 0.1889 - accuracy: 0.9110 - val_loss: 3247823.3725 - val_accuracy: 0.7549
.
.
.
Epoch 32/200
118/118 [==============================] - 1s 8ms/sample - loss: 7.9578e-04 - accuracy: 1.0000 - val_loss: 0.2045 - val_accuracy: 0.9314
Epoch 33/200
112/118 [===========================>..] - ETA: 0s - loss: 2.0889e-04 - accuracy: 1.0000

Epoch 34/200
112/118 [===========================>..] - ETA: 0s - loss: 0.0019 - accuracy: 1.0000
Epoch 00034: val_accuracy did not improve from 0.96078

Epoch 00034: ReduceLROnPlateau reducing learning rate to 1.5625000742147677e-05.
Restoring model weights from the end of the best epoch.
118/118 [==============================] - 1s 9ms/sample - loss: 0.0018 - accuracy: 1.0000 - val_loss: 0.1718 - val_accuracy: 0.9314
Epoch 00034: early stopping
  • 阴谋

你觉得这个怎么样?我很困惑,因为在第一个纪元中,
val_损失
很高,但在最后一个纪元中,
val_损失
很低。可以吗?还是我的模特太合适了


如果我的模型是错误的,我应该怎么做才能获得更好的结果?

经过长时间的训练,神经网络学习非常特定的模式,从而减少训练损失,增加验证损失。在这种情况下,您可以说您的模型安装过度

对你来说,我认为你的模型很适合

如果您的模型开始过拟合,请尝试减少要训练的模型参数的数量或应用提前停止