Hand Writing Recognition Using Convolutional Neural Networks
Introduction
This CNN-based model for recognition of hand written digits attains a validation accuracy of 99.2% after training for 12 epochs. Its trained on the MNIST dataset on Kaggle.
##Usage
The model architecture and weights are saved in the files model_architecture.json
and model_weights.h5
. Note that these weights are compatible only with the Tensorflow backed.
To train the model run train.py
. The file test.py
generates a file predictions.csv
which contains the predicted labels to the images in the test set. This file can be used for submission at Kaggle. display_random.py
displays 25 random images from the test set along with their predicted labels.
Requirements
- Python 2.7
- Tensorflow
- Keras
- h5py
- numpy
- matplotlib
- pandas
Dataset
-
The model is trained on the MNIST dataset downloaded from Kaggle.
-
The file
train.csv
contains pixel intensity values as flattened vectors for 42000 images and their corresponding labels. Similarly,test.csv
has pixel intensity values for 28000 unlabelled images.