为什么迁移学习和数据增强的准确度得分较低?

时间:2021-06-03 19:36:33

标签: python deep-learning conv-neural-network vgg-net data-augmentation

我正在开发分类模型。我有 5 种花,每种花大约 1000 张照片。

我有两个问题。

  1. 我使用 VGG16 和迁移学习作为模型,准确度得分为 84。为了提高准确度分数,我尝试了数据增强。但是,当我同时使用迁移学习和数据增强时,准确率下降到 %74。

  2. 如果不能同时使用迁移学习和数据增强,我可以将增强的照片保存到训练文件夹,然后使用迁移学习吗?

    select Batsman_, sum(batsman_runs)/count(player_dismissed) as Average 
    from
    (
     (select batsman as Batsman_ from IPL_BALL_BY_BALL) 
     union all 
     (select non_striker as Batsman_ from IPL_BALL_BY_BALL)
    )
    group by Batsman_ 
    order by Average desc;
    
    def define_model_vgg_16():
    # load model
    model = VGG16(include_top=False,input_shape=(224,224,3))
    # mark loaded layers as not trainable
    for layer in model.layers:
        layer.trainable = False
    # add new classifier layers
    flat1 = Flatten()(model.layers[-1].output)
    class1 = Dense(128,activation='relu',kernel_initializer='he_uniform')(flat1)
    output = Dense(5,activation='softmax')(class1)
    # define new model
    model = Model(inputs=model.inputs, outputs = output)
    #compile model
    opt = SGD(lr=0.001,momentum=0.9)
    model.compile(optimizer=opt,loss='categorical_crossentropy',metrics=['accuracy'])
    return model
    

0 个答案:

没有答案