This project was based on chapter two of Deep Learning With Python and implements a keras model that is able to classify black and white images of handwritten digits. It uses the mnist dataset and a multi layer deep learning model to accurately output a prediction.
The MNIST dataset is a widely used benchmark in machine learning for handwritten digit recognition. It contains preprocessed handwritten digit images derived from the original NIST dataset, making it suitable for research and experimentation.
- The MNIST dataset consists of 70,000 grayscale images in total.
- It is divided into 60,000 training images and 10,000 testing images.
- Each image represents a single handwritten digit.
- The images have a fixed resolution of 28 × 28 pixels.
- Each image contains 784 numerical features (28 × 28).
- The dataset has a standardized structure with clearly labeled classes.
- It serves as a benchmark dataset for testing classification algorithms.
Cited from https://www.geeksforgeeks.org/machine-learning/mnist-dataset/
The data is represented using numpy tensors, which are basically arrays to higher dimensions, or known as axes. The training and testing data is first loaded from the mnist data set in the form (features, width, height), but reshaped to (1,28*28) to input into the model.
The model consists of two dense layers fully connected. One hidden layer with 512 nuerons and the reLu activation function. One output layer with 10 nuerons which correspond to probabilities (converted to 0-1 using the softmax activation function) for the numbers 0-9. The model uses the "adam" optimizer and sparse categorical cross-entropy loss function.
Model summary: