Better way to deal with downsampled MNIST images

model = tf.keras.models.Sequential([
tf.keras.layers.MaxPool2D(4, 4, input_shape=(28,28,1)),
tf.keras.layers.MaxPool2D(2, 2),
tf.keras.layers.Dropout(0.25),

tf.keras.layers.MaxPool2D(2, 2),
tf.keras.layers.Dropout(0.25),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])

optimizer = tf.keras.optimizers.RMSprop(lr=0.00020, rho=0.99, epsilon=1e-8, decay=0.0)

model.compile(optimizer=optimizer,loss='sparse_categorical_crossentropy',metrics=['accuracy'])


So, the MNIST images are downsampled from 28*28 to 7*7 from the first line. Using that,I want to get a good accuracy and the maximum I'm getting is 89% with 40 epoch and 6000 test images. How can I improve this without removing the first line?

• by the first line, you mean sequential or max-pool layer? if max-pool why you put max-pool layer as the first layer of your model? Apr 24, 2019 at 8:06
• @SoK its a challenge, it becomes more difficult to improve accuracy that way Apr 24, 2019 at 8:08
• Ok, try to put dropout before each dense layer, and play with divers dropout rates. Apr 24, 2019 at 8:11