https://github.com/esbenp/number-reader
A CNN that estimates numbers based on the MNIST data set from Kaggle
https://github.com/esbenp/number-reader
Last synced: 3 months ago
JSON representation
A CNN that estimates numbers based on the MNIST data set from Kaggle
- Host: GitHub
- URL: https://github.com/esbenp/number-reader
- Owner: esbenp
- Created: 2018-04-14T09:21:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-14T10:17:21.000Z (about 7 years ago)
- Last Synced: 2025-01-23T04:44:39.919Z (5 months ago)
- Language: Python
- Size: 12.3 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Number reader
Playing around with MNIST and CNN networks.
Based on the work of [Yassine Ghouzam](https://www.kaggle.com/yassineghouzam/introduction-to-cnn-keras-0-997-top-6)
To download training and validation data run `kaggle competitions download -c digit-recognizer -p ./data`
Train the model using `train.py` optionally pass the numbers of epochs as the first arguments, e.g. `python3 train.py 5` (train using epochs=5). Default is 2.
The model achieves accuracy of .984 after 2 epochs.
```
Epoch 1/2
- 159s - loss: 0.4434 - acc: 0.8570 - val_loss: 0.0631 - val_acc: 0.9793
Epoch 2/2
- 162s - loss: 0.1282 - acc: 0.9623 - val_loss: 0.0516 - val_acc: 0.9848
```## Utils
*Show image*
You can open the image representation of a number using `show_image.py [row_index]`, e.g. `python3 show_image.py 5` will open the 5th row in the dataset and convert it into its image representation
*Predict*
You can predict the number of a data row using `predict.py [row_index]`, e.g. `python3 predict.py 5` will predict what number the 5th row in the dataset is