Reputation: 121
If I am wanting to train on a dataset of images of cats and dogs, what is the benefit of creating my own sequential model vs just using MobilenetV2 and using the imagenet weight initializations? How would it differ with another problem such as identifying different types of fruits?
Here I have the basic sequential model ...
model = models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
and then using Mobilenet...
tf.keras.applications.MobileNet(
input_shape=None,
alpha=1.0,
depth_multiplier=1,
dropout=0.001,
include_top=True,
weights="imagenet",
input_tensor=None,
pooling=None,
classes=1000,
classifier_activation="softmax",
**kwargs
)
Upvotes: 0
Views: 701
Reputation: 565
First of all, MobileNet is much more complex than your model. It's (probably) well designed and tested on multiple applications that proves it work like intended.
People are using backbones (encoders) - parts of networks that are made for extracting features from input image - that are pretrained on different task but similar domain or vice versa (e.g. backbone trained on classification of animals can help in model which will detect animals on image). If you want more information about this you can read about transfer learning
.
The point of using imagenet
weights is that you can use smaller set of your data because model is already trained to extract features and you need to only 'show it' how to classifie it (in theory).
Upvotes: 1