- model 1 (3 layers with 1 convolution layer)
model = keras.models.Sequential([
keras.layers.Conv2D(32, (3,3), activation = 'relu', input_shape = (28, 28,1)), # layer 1
keras.layers.MaxPool2D((2,2)), # layer 2
keras.layers.Flatten(),
keras.layers.Dense(10, activation = 'softmax')]) # layer 3
- model 2 (5 layers with 2 convolution layer)
model = keras.models.Sequential([
keras.layers.Conv2D(32, (3,3), activation = 'relu', input_shape=(28,28,1)), # layer 1
keras.layers.MaxPool2D((2,2)), # layer 2
keras.layers.Conv2D(64, (3,3), activation = 'relu'), # layer 3
keras.layers.MaxPool2D((2,2)), # layer 4
keras.layers.Flatten(),
keras.layers.Dense(10, activation = 'softmax')]) # layer 5
- model 3 (7 Layers with 4 convilution layer)
model = keras.models.Sequential([
keras.layers.Conv2D(32, (3,3), activation = 'relu', input_shape = (28, 28,1)), # layer 1
keras.layers.MaxPool2D((2,2)), # layer 2
keras.layers.Conv2D(64, (3,3), activation = 'relu'), # layer 3
keras.layers.Conv2D(64, (3,3), activation = 'relu'), # layer 4
keras.layers.MaxPool2D((2,2)), # layer 5
keras.layers.Conv2D(128, (3,3), activation = 'relu'), # layer 6
keras.layers.Flatten(),
keras.layers.Dense(10, activation = 'softmax')]) # layer 7
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 26, 26, 32) 320
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 13, 13, 32) 0
_________________________________________________________________
flatten (Flatten) (None, 5408) 0
_________________________________________________________________
dense (Dense) (None, 10) 54090
=================================================================
Total params: 54,410
Trainable params: 54,410
Non-trainable params: 0
_________________________________________________________________
Model: "sequential_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d_1 (Conv2D) (None, 26, 26, 32) 320
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 13, 13, 32) 0
_________________________________________________________________
conv2d_2 (Conv2D) (None, 11, 11, 64) 18496
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 5, 5, 64) 0
_________________________________________________________________
flatten_1 (Flatten) (None, 1600) 0
_________________________________________________________________
dense_1 (Dense) (None, 10) 16010
=================================================================
Total params: 34,826
Trainable params: 34,826
Non-trainable params: 0
_________________________________________________________________
Model: "sequential_2"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d_3 (Conv2D) (None, 26, 26, 32) 320
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 13, 13, 32) 0
_________________________________________________________________
conv2d_4 (Conv2D) (None, 11, 11, 64) 18496
_________________________________________________________________
conv2d_5 (Conv2D) (None, 9, 9, 64) 36928
_________________________________________________________________
max_pooling2d_4 (MaxPooling2 (None, 4, 4, 64) 0
_________________________________________________________________
conv2d_6 (Conv2D) (None, 2, 2, 128) 73856
_________________________________________________________________
flatten_2 (Flatten) (None, 512) 0
_________________________________________________________________
dense_2 (Dense) (None, 10) 5130
=================================================================
Total params: 134,730
Trainable params: 134,730
Non-trainable params: 0
_________________________________________________________________
Test accuracies and losses.
![loss_accuracy](https://user-images.githubusercontent.com/77837101/121796686-ffc02100-cc55-11eb-9e40-997671b5079a.png)
![model1](https://user-images.githubusercontent.com/77837101/121797329-8414a300-cc5a-11eb-9968-2907787d93f1.png)
![model2](https://user-images.githubusercontent.com/77837101/121797331-8545d000-cc5a-11eb-9f4a-0dcb477cf461.png)
![model3](https://user-images.githubusercontent.com/77837101/121797332-8676fd00-cc5a-11eb-8b21-895ca2a60138.png)
images and corresponding probability that predicted wrong
![plot error](https://user-images.githubusercontent.com/77837101/121796688-0058b780-cc56-11eb-9635-ecd125bd8b0d.png)