Welcome to the MNIST Digit Classifier! 🎉 This project combines machine learning and web development to create a web application that classifies handwritten digits from the MNIST dataset. Whether you're a data science enthusiast, a machine learning newbie, or just curious, you can test out this cool web app to see how well a neural network can recognize digits.
At the heart of this application is a Convolutional Neural Network (CNN) designed to recognize handwritten digits. Here's a quick rundown of the model:
- Architecture: SimpleCNN
- Layers:
- 2 Convolutional Layers
- 2 ReLU Activations
- 2 MaxPooling Layers
- 1 Fully Connected Layer
- Output: 10 classes (digits 0-9)
- Dataset: MNIST
- Frameworks: PyTorch
The web app provides a user-friendly interface for uploading images and receiving predictions. It’s built with Flask and features:
- Frontend: HTML, CSS, and JavaScript
- Backend: Python Flask, integrated with the PyTorch model
- Upload an Image: Select a file containing a handwritten digit.
- Model Prediction: The image is processed, transformed into a tensor, and passed through the CNN model.
- Result Display: The app returns the predicted digit based on the model’s output.
Here's an overview of the project files and their roles:
app.py: The Flask application code that handles image uploads and communicates with the ML model.model.py: Defines theSimpleCNNmodel architecture used for digit classification.static/: Contains CSS and JavaScript files for the web app.templates/: HTML files for the web app's frontend..vercelignore: Specifies files and directories to ignore during deployment.requirements.txt: Lists the Python packages required for the app.Procfile: Instructions for the web server to run the Flask app.
To get this project up and running on your local machine:
-
Clone the repository:
git clone https://github.com/your-username/MNIST-Digit-Classifier.git cd MNIST-Digit-Classifier -
Create a virtual environment and activate it:
python -m venv venv venv\Scripts\activate # For Windows source venv/bin/activate # For macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Open your browser and go to: http://localhost:5000
Want to contribute? Great! Open an issue or create a pull request. Contributions, feedback, and suggestions are always welcome! 🙌
This project is licensed under the MIT License. See the LICENSE file for details.
Here are some screenshots of the application in action:

