https://github.com/ata-turhan/mnist-digit-classification-pytorch
A complete solution for the MNIST handwritten digit classification challenge using PyTorch, including data exploration, model training, and Kaggle submission generation.
https://github.com/ata-turhan/mnist-digit-classification-pytorch
computer-vision deep-learning image-classification python pytorch
Last synced: 4 months ago
JSON representation
A complete solution for the MNIST handwritten digit classification challenge using PyTorch, including data exploration, model training, and Kaggle submission generation.
- Host: GitHub
- URL: https://github.com/ata-turhan/mnist-digit-classification-pytorch
- Owner: ata-turhan
- License: mit
- Created: 2024-11-19T03:42:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T03:48:45.000Z (11 months ago)
- Last Synced: 2025-03-29T07:45:23.868Z (7 months ago)
- Topics: computer-vision, deep-learning, image-classification, python, pytorch
- Language: Jupyter Notebook
- Homepage:
- Size: 27.3 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MNIST Digit Classification with PyTorch
A complete PyTorch-based solution for the MNIST handwritten digit classification challenge, including data exploration, model training, evaluation, and Kaggle submission generation.
## Overview
The MNIST dataset is a collection of 70,000 grayscale images of handwritten digits (0–9). This project solves the multi-class classification problem of identifying the correct digit for each image. It serves as an excellent introduction to deep learning concepts, particularly neural networks.
## Features
- **Data Preprocessing**: Includes normalization and custom PyTorch `Dataset` creation.
- **Exploratory Data Analysis**: Visualizes sample images and provides statistical insights.
- **Deep Learning Model**: Implements a fully connected neural network using PyTorch.
- **Training and Evaluation**: Tracks loss and accuracy with a validation split.
- **Kaggle Submission**: Generates predictions and prepares a CSV for Kaggle competition submission.## Getting Started
### Prerequisites
- Python 3.8+
- PyTorch 1.12+
- Jupyter Notebook or Kaggle environment### Installation
1. Clone this repository:
```bash
git clone https://github.com/ata-turhan/MNIST-Digit-Classification-PyTorch.git
```
2. Navigate to the project directory:
```bash
cd MNIST-Digit-Classification-PyTorch
```
3. Install the required dependencies:
```bash
pip install -r requirements.txt
```## Usage
1. **Run the Notebook**:
Open `mnist_digit_classification.ipynb` in Jupyter Notebook or directly on Kaggle.
2. **Train the Model**:
Execute the notebook cells to preprocess data, train the model, and evaluate it.3. **Generate Kaggle Submission**:
Run the prediction step to create `submission.csv`, ready for upload to Kaggle.## Repository Structure
```
MNIST-Digit-Classification-PyTorch/
│
├── README.md # Project overview
├── mnist_digit_classification.ipynb # Main notebook
├── requirements.txt # Python dependencies
└── LICENSE # MIT License
```## Results
The model achieves an accuracy of **96.95%** on the validation set and **96.89%** on Kaggle leaderboard submissions.
## Contributing
Contributions are welcome! Please submit a pull request or raise an issue if you find a bug or have suggestions for improvement.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.