This script trains a convolutional neural network (CNN) to classify handwritten digits from the MNIST dataset. The CNN architecture consists of multiple convolutional and pooling layers followed by fully connected layers. The model is trained using the Adam optimizer and categorical crossentropy loss function.
- Convolutional neural network (CNN) architecture
- Training on the MNIST dataset
- Evaluation using test set accuracy
- Confusion matrix visualization
- Clone this repository to your local machine.
- Install the dependencies:
pip install numpy keras tensorflow scikit-learn matplotlib seaborn
- Run numberPredict.py
python numberPredict.py
- The MNIST dataset was obtained here.
- This code is inspired by Jousef Murad's Image Classification Model Project on Coursera.