The following Convolutional Neural Network was constructed
Layer (type) | Output Shape | Param # |
---|---|---|
conv2d (Conv2D) | (None, 26, 26, 32) | 320 |
max_pooling2d (MaxPooling2D) | (None, 13, 13, 32) | 0 |
conv2d_1 (Conv2D) | (None, 11, 11, 64) | 18496 |
max_pooling2d (MaxPooling2D) | (None, 5, 5, 64) | 0 |
conv2d_1 (Conv2D) | (None, 3, 3, 128) | 73856 |
max_pooling2d (MaxPooling2D) | (None, 1152) | 0 |
dense (Dense) | (None, 128) | 147584 |
dense_1 (Dense) | (None, 10) | 1290 |
Train the CNN with 10 Epochs using the 60k samples, the training accuracy reached over 95.93%. Validation accuracy is slightly lower but still north of 90%.
xxxxxxxxxx
Train on 60000 samples
Epoch 1/10
60000/60000 [==============================] - 62s 1ms/sample - loss: 0.4719 - acc: 0.8269
Epoch 2/10
60000/60000 [==============================] - 62s 1ms/sample - loss: 0.2994 - acc: 0.8901
Epoch 3/10
60000/60000 [==============================] - 63s 1ms/sample - loss: 0.2557 - acc: 0.9058
Epoch 4/10
60000/60000 [==============================] - 62s 1ms/sample - loss: 0.2226 - acc: 0.9174
Epoch 5/10
60000/60000 [==============================] - 62s 1ms/sample - loss: 0.1970 - acc: 0.9263
Epoch 6/10
60000/60000 [==============================] - 61s 1ms/sample - loss: 0.1747 - acc: 0.9342
Epoch 7/10
60000/60000 [==============================] - 61s 1ms/sample - loss: 0.1538 - acc: 0.9424
Epoch 8/10
60000/60000 [==============================] - 62s 1ms/sample - loss: 0.1362 - acc: 0.9494
Epoch 9/10
60000/60000 [==============================] - 61s 1ms/sample - loss: 0.1198 - acc: 0.9549
Epoch 10/10
60000/60000 [==============================] - 61s 1ms/sample - loss: 0.1077 - acc: 0.9593
<tensorflow.python.keras.callbacks.History at 0x7f58207a4080>
Histogram of accuracy by class is given below. In my case, Trouser appear to have the highest.
Sample of correctly/incorrectly predicted images
Sample filter learnt in the first Conv2D layer