Created
February 21, 2021 23:18
-
-
Save daxinniu/57866808fec816479b8ac89b7d303b41 to your computer and use it in GitHub Desktop.
Baseline model for Cassava Leaf Disease classification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_baseline_vgg(): | |
input_shape = (160, 120, 3) | |
baseline_model = VGG16(weights='imagenet', include_top=False, input_shape=input_shape) | |
x = baseline_model.output | |
x = Flatten()(x) | |
x = Dense(512, activation='relu')(x) | |
x = Dropout(rate=0.25)(x) | |
x = Dense(256, activation='relu')(x) | |
x = Dropout(rate=0.25)(x) | |
x = Dense(128, activation='relu')(x) | |
x = Dropout(rate=0.25)(x) | |
predictions = Dense(5, activation='softmax')(x) | |
model = Model(inputs=baseline_model.input, outputs=predictions) | |
model.compile(optimizer=_opt, | |
loss=_loss, | |
metrics=_metrics) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment