https://github.com/thatlinuxguyyouknow/mnist-digit-classifier
A simple KERAS based CNN trained on the MSINT Dataset
https://github.com/thatlinuxguyyouknow/mnist-digit-classifier
Last synced: over 1 year ago
JSON representation
A simple KERAS based CNN trained on the MSINT Dataset
- Host: GitHub
- URL: https://github.com/thatlinuxguyyouknow/mnist-digit-classifier
- Owner: ThatLinuxGuyYouKnow
- Created: 2025-03-06T10:59:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-09T12:49:50.000Z (over 1 year ago)
- Last Synced: 2025-03-09T13:34:23.868Z (over 1 year ago)
- Language: Python
- Size: 7.19 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MNIST Digit Classifier
[](https://www.python.org/)
[](https://www.tensorflow.org/)
[](https://numpy.org/)
[](https://pillow.readthedocs.io/en/stable/)
This project is a backend-only Python application that trains, evaluates, and tests a Convolutional Neural Network (CNN) model for classifying handwritten digits from the MNIST dataset. It uses TensorFlow/Keras for model building and training, NumPy for numerical operations, and Pillow for image manipulation.
## Accessible Routes & Methods
The application is run from the command line and doesn't have traditional web routes. Instead, it offers the following command-line actions:
* **`python main.py train`**: Trains the MNIST model using the MNIST dataset. No parameters are required. This command saves the model to `mnist_model.h5`
* **`python main.py evaluate`**: Loads the model from `mnist_model.h5` and evaluates its performance on the MNIST test dataset. Prints the test accuracy. No parameters are required.
* **`python main.py test`**: Loads the model from `mnist_model.h5` and uses it to predict the digit in `test.png`. Requires a `test.png` image in the same directory. The image should be a 28x28 grayscale image of a handwritten digit.
* **`python main.py easy`**: Loads the model from `mnist_model.h5` and uses it to predict the digit in `test_easy.png`. Requires a `test_easy.png` image in the same directory. The image should be a 28x28 grayscale image of a handwritten digit.
All actions use the `GET` method implicitly through command-line arguments. No parameters are passed directly as part of a request, but the presence or absence of specific files (e.g., `test.png`) indirectly influences the behavior. Error handling is implemented to gracefully handle the absence of a trained model or required image files.