I am currently working on a multi-label classification of images with a small number of labels.
I am using CNNs to do this, but I have one question.
In Kaggle, etc., they use a pre-trained model with 1-2 dense layers for classification, but I think a CNN network for multi-label classification should have a dense layer branch for each label, since it does binary classification of labels.
Does it not make sense to do so?
import efficientnet.keras as efn
base_model = efn.EfficientNetB1(include_top=False, weights='imagenet',input_tensor = Input(shape=(128, 128, 3)))
x = base_model.output
x = GlobalAveragePooling2D()(x)
x1 = Dense(1024, activation = 'relu')(x)
x1 = Dropout(0.5)(x1)
x1 = Dense(1024, activation = 'relu')(x1)
x1 = Dropout(0.5)(x1)
x2 = Dense(1024, activation = 'relu')(x)
x2 = Dropout(0.5)(x2)
x2 = Dense(1024, activation = 'relu')(x2)
x2 = Dropout(0.5)(x2)
x3 = Dense(1024, activation = 'relu')(x)
x3 = Dropout(0.5)(x3)
x3 = Dense(1024, activation = 'relu')(x3)
x3 = Dropout(0.5)(x3)
x4 = Dense(1024, activation = 'relu')(x)
x4 = Dropout(0.5)(x4)
x4 = Dense(1024, activation = 'relu')(x4)
x4 = Dropout(0.5)(x4)
x5 = Dense(1024, activation = 'relu')(x)
x5 = Dropout(0.5)(x5)
x5 = Dense(1024, activation = 'relu')(x5)
x5 = Dropout(0.5)(x5)
out1 = Dense(1, activation = 'sigmoid')(x1)
out2 = Dense(1, activation = 'sigmoid')(x2)
out3 = Dense(1, activation = 'sigmoid')(x3)
out4 = Dense(1, activation = 'sigmoid')(x4)
out5 = Dense(1, activation = 'sigmoid')(x5)
Thanks for reading.
I am waiting for your answer.
question from:
https://stackoverflow.com/questions/65661322/what-does-it-mean-to-branch-the-dense-layer-for-each-label-in-cnn-multi-label-cl 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…