dropout layer in Unet
I'm using unet for semantic segmentation but my model is overfitting, so can I add a dropout layer for unet because I think that there isn't .
Hello, Yes there isn't dropout layers in the implementation of unet, but you can use regularizers set_regularization(model, kernel_regularizer=keras.regularizers.l2(0.001),bias_regularizer=keras.regularizers.l2(0.001)) you can also try data augmentation. But if it is necessary to add dropout you can stop after some layers and add after it the dropout layers you want like this: model = sm.Unet(......) model_input = model.input model_output = model.get_layer('final_conv').output (any layer you want) #add dropout model_output = keras.layers.Dropout(0.3)(model_output) #add activation output = keras.layers.Activation(activation, name=activation)(model_output) model_dp = keras.models.Model(model_input, output)