Inception New
Inception New
Introduction
Building a powerful deep neural network is possible by
increasing the number of layers in a network.
In case you have not read the previous article, we are trying
to classify images into 6 different classes, the training data is
fairly balanced and with a convolution neural network, we
were able to achieve a validation accuracy of 77%.
Let us now use an inception model and train only its last
layer as below.
# Initialize the InceptionV3 model without the top layer (for feature
extraction)
pre_trained_model = InceptionV3(input_shape = (150, 150, 3), # Input
image size (150x150, 3 color channels)
include_top = False, # Exclude the
top (classification) layer
weights = None) # Do not load
default weights initially
# Create the final model with the pre-trained input and the custom layers
on top
model = Model(pre_trained_model.input, x)
# Train the model using the training and validation data generators
history = model.fit(train_generator, # Training
data generator
epochs=10, # Train for
10 epochs
validation_data=validation_generator) # Validation
data generator for evaluation