如何解释模型是否过拟合或过拟合以及如何提高精度?

时间:2019-04-08 12:20:39

标签: python tensorflow keras deep-learning computer-vision

我正在开发车牌识别算法。我的数据集包含15万个火车,30.000个测试和680个验证图像。我的模型结构是:

__________________________________________________________________________________________________
Layer (type)                    Output Shape         Param #     Connected to                     
==================================================================================================
the_input (InputLayer)          (None, 64, 128, 3)   0                                            
__________________________________________________________________________________________________
conv1 (Conv2D)                  (None, 64, 128, 48)  3648        the_input[0][0]                  
__________________________________________________________________________________________________
pooling1 (MaxPooling2D)         (None, 32, 64, 48)   0           conv1[0][0]                      
__________________________________________________________________________________________________
dropout_1 (Dropout)             (None, 32, 64, 48)   0           pooling1[0][0]                   
__________________________________________________________________________________________________
conv2 (Conv2D)                  (None, 32, 64, 64)   76864       dropout_1[0][0]                  
__________________________________________________________________________________________________
pooling2 (MaxPooling2D)         (None, 16, 64, 64)   0           conv2[0][0]                      
__________________________________________________________________________________________________
dropout_2 (Dropout)             (None, 16, 64, 64)   0           pooling2[0][0]                   
__________________________________________________________________________________________________
conv3 (Conv2D)                  (None, 16, 64, 128)  204928      dropout_2[0][0]                  
__________________________________________________________________________________________________
pooling3 (MaxPooling2D)         (None, 8, 32, 128)   0           conv3[0][0]                      
__________________________________________________________________________________________________
dropout_3 (Dropout)             (None, 8, 32, 128)   0           pooling3[0][0]                   
__________________________________________________________________________________________________
flatten_1 (Flatten)             (None, 32768)        0           dropout_3[0][0]                  
__________________________________________________________________________________________________
dense_1 (Dense)                 (None, 160)          5243040     flatten_1[0][0]                  
__________________________________________________________________________________________________
dense_2 (Dense)                 (None, 64)           10304       dense_1[0][0]                    
__________________________________________________________________________________________________
out1 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out2 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out3 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out4 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out5 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out6 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out7 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out8 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
__________________________________________________________________________________________________
out9 (Dense)                    (None, 23)           1495        dense_2[0][0]                    
==================================================================================================
Total params: 5,552,239
Trainable params: 5,552,239
Non-trainable params: 0
________________________________________________________________________________ 
__________________

当我尝试从验证图像中识别车牌号时,它只能正确识别18/680。如何理解训练和测试准确性值为何很高,但是在训练后该模型也无法识别验证图像和测试图像?如何改善模型?

它绘制了这样的图:

Model accuracy which has multiplied all outputs

Model loss

0 个答案:

没有答案