Question: Create, train and evaluate three extra CNN models by extending the Model _ 0 . For each model, you are required to print the summary
Create, train and evaluate three extra CNN models by extending the Model For each model, you are required to print the summary of model structure, train the model over epochs, plot the training and validation accuracies and losses, and evaluate the trained model with the test data. Explain what you observe.
Model:
from tensorflowkeras.models import Sequential
from tensorflowkeras.layers import CorvD MaxPoolingD Dropout, Flatten, Dense
# Buld the CNN model
model Sequential
# Layer
modeladdCorvO activetion'relu', inputshepe
modeladdMaxPoolingO
# Layer
modeladdiComO activation"relu'
modeladdMaxPooling
# Layer a
modeladdComO activation'relu'
# Layer
modeladdCorvD activation"relu'
# Layer c
modeladdCorvO activation'relu'
# Layer
modeladdiCornO activation'relun'
# Layer
modeladdCom actlwation'rel
# Layer
modeladdMaxPoolingD
modeladdDropout
# Flatten layer
modeladdFlatten
Dense layers
modeladdDense activation'relu'
modeladdDense activation'softmax'
# Compile the model
modelcompileoptimizer"adam', loss'sparsecategoricalcrossentropy, metricsaccuracy
Table
iModel: Take the structure of Model but quadruple the number of filters in each convolutional layer so the first layer has filters and the last convolutional layer has filters Leave the dense layers as they are. Save your model as modelh
iiModel: Based on what you have learnt from residual connections:
modify Model to add a residual link from the output of the layer marked a in Table to the output of the layer marked bie skipping the convolution layers with output shapes
add another residual link from the output of the layer marked c to the output of the layer marked die skipping the final convolution layer
Save your model as modelh
iii.Model: Based on what you have learnt from data augmentation, apply two data augmentation methods eg normalisation, horizontal translation, or rotation to generate augmented training data. Create Model using the same structure as Model above. Train Model with the augmented training data. Save your model as modelh
ivCompare the performance of the four models Model from Qa and the three models in Qb and provide a brief discussion on how the different mode structures affected their performance.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
