I am not able to understand the include_top = False in the
If you look into the code, it is a simple if-else condition:
if include_top:
# Classification block
x = layers.Flatten(name='flatten')(x)
x = layers.Dense(4096, activation='relu', name='fc1')(x)
x = layers.Dense(4096, activation='relu', name='fc2')(x)
x = layers.Dense(classes, activation='softmax', name='predictions')(x)
else:
if pooling == 'avg':
x = layers.GlobalAveragePooling2D()(x)
elif pooling == 'max':
x = layers.GlobalMaxPooling2D()(x)
If you set include_top=True, it creates a classification layer (for fine-tuning purposes) otherwise, the output of the previous layer is used (for feature-extraction) through a GlobalAvreagePooling2D().
I would like to know how to decide which pretrained model to use for
which kind of image classification task?
Every model has its own pros and cons. The number of parameters, training time, inference time, accuracy, and some other things are a few things that caused a researcher to favor one model over another. There is no model which excels on every task or dataset [see no free launch theorem].