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_0. For each model, you are required to print the summary of model structure, train the model over 60 epochs, plot the training and validation accuracies and losses, and evaluate the trained model with the test data. Explain what you observe.
Model_0:
from tensorflowkeras.models import Sequential
from tensorflowkeras.layers import Corv2D, MaxPooling2D, Dropout, Flatten, Dense
# Buld the CNN model
model_0= Sequential 0
# Layer 1
model_0.add(Corv2O , activetion='relu', input_shepe-(144,144,3)))
model_0.add(MaxPooling2O((2,2)))
# Layer 2
model_0.addi(Com2O , activation="relu'))
model_0.add(MaxPooling20((2,2)))
# Layer 3a
model_0.add(Com2O , activation='relu'))
# Layer 3b
model_0.add(Corv2D , activation="relu'))
# Layer 3c
model_0.add(Corv2O , activation='relu'))
# Layer 4
model_0.addi(Corn2O , activation='relun'))
# Layer 5
model_0.add(Com , actlwation='rel))
# Layer 6
model_0.add(MaxPooling2D((2,2)))
model_0.add(Dropout(0.5))
# Flatten layer
model_0.add(Flatten0)
" Dense layers
model_0.add(Dense(128, activation='relu'))
model_0.add(Dense(6, activation='softmax'))
# Compile the model
model_0,compile(optimizer="adam', loss='sparse_categorical_crossentropy, metrics=['accuracy]]
Table 1
i.Model_1: Take the structure of Model_0, but quadruple the number of filters in each convolutional layer (so the first layer has 8 filters and the last convolutional layer has 32 filters). Leave the dense layers as they are. Save your model as model_1.h5.
ii.Model_2: Based on what you have learnt from residual connections:
modify Model_0 to add a residual link from the output of the layer marked (a) in Table 1 to the output of the layer marked (b)(i.e. skipping the convolution layers with output shapes (35,35,4))
add another residual link from the output of the layer marked (c) to the output of the layer marked (d)(i.e. skipping the final convolution layer)
Save your model as model_2.h5.
iii.Model_3: Based on what you have learnt from data augmentation, apply two data augmentation methods (e.g. normalisation, horizontal translation, or rotation) to generate augmented training data. Create Model_3 using the same structure as Model_1 above. Train Model_3 with the augmented training data. Save your model as model_3.h5.
iv.Compare the performance of the four models (Model_0 from Q1a, and the three models in Q1b) and provide a brief discussion on how the different mode structures affected their performance.
 Create, train and evaluate three extra CNN models by extending the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!