The MNIST dataset is a widely used collection of handwritten digits, commonly employed for training and testing image classification systems .It contains 60,000 training images and 10,000 testing images, each being a 28x28 pixel grayscale image of a digit from 0 to 9. The dataset serves as a benchmark for evaluating and comparing different image classification algorithms
The MNIST database (Modified National Institute of Standards and Technology database[1]) is a large database of handwritten digits that is commonly used for training various image processing systems. It was created by "re-mixing" the samples from NIST's original datasets.
Source - https://en.wikipedia.org/wiki/MNIST_database
How to use it: Libraries like Keras and TensorFlow provide easy access to the MNIST dataset.
Python code to train and test autoencoder_mnist.keras model :
import tensorflow as tf
from tensorflow.keras import layers, models
import numpy as np
import matplotlib.pyplot as plt
model = keras.models.load_model('autoencoder_mnist.keras')
(x_train, _), (x_test, _) = tf.keras.datasets.mnist.load_data()
decoded_images = model.predict(x_test)
n = 10
plt.figure(figsize=(20,4))
for i in range(n):
ax = plt.subplot(2, n, i+1)
plt.imshow(x_test[i].reshape(28,28), cmap="gray")
plt.title("Original")
plt.gray()
ax.axis('off')
ax = plt.subplot(2, n, i+1+n)
plt.imshow(decoded_images[i].reshape(28,28), cmap="gray")
plt.title("Reconstructed")
plt.gray()
ax.axis('off')
plt.show()