Baseline model
Following the standard three-step approach of building, compiling, and fitting, we will construct a convolutional neural network (CNN) model comprising two Conv2D and pooling layers, coupled with a fully connected layer that has a dense layer of 1,050 neurons. The output layer consists of four neurons, which represent the four classes in our dataset. We then compile and fit the model using the training data for 20 epochs:
#Build model_1 = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(filters=16, kernel_size=3, # can also be (3, 3) activation="relu", input_shape=(224, 224, 3)), #(height, width, colour channels) tf.keras.layers.MaxPool2D(2,2), tf.keras.layers.Conv2D(32, 3, activation="relu...