Skip to content

nikhil-1603/Handwritten-Digit-Classification-using-Neural-Networks-MNIST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Handwritten Digit Classification using Neural Networks (MNIST)

📌 Project Overview

This project implements a feedforward neural network (Multilayer Perceptron) using TensorFlow/Keras to classify handwritten digits from the MNIST dataset. The notebook demonstrates a complete deep learning workflow, including data loading, preprocessing, model design, training, and evaluation.

The model learns to classify grayscale images of handwritten digits (0–9) with high accuracy.


📂 Dataset

MNIST Handwritten Digits Dataset

  • 60,000 training images
  • 10,000 test images
  • Image resolution: 28 × 28 pixels
  • Grayscale images
  • Classes: digits 0 to 9

The dataset is loaded directly using Keras:

from tensorflow import keras
(X_train, y_train), (X_test, y_test) = keras.datasets.mnist.load_data()

Data Preprocessing

  • Images are normalized to the range [0, 1].
  • Flattened into 1D vectors to feed into the fully connected layers.
  • Dataset is split into training and test sets.

Model Architecture

The model is a fully connected feedforward neural network (MLP).

Layer Type Units Activation Purpose
Input Flatten 784 Converts 2D image to 1D vector
Hidden Layer 1 Dense 128 ReLU Learns high-level features
Hidden Layer 2 Dense 64 ReLU Feature refinement
Output Layer Dense 10 Softmax Class probability distribution

Model Evaluation

After training, the model is evaluated on the unseen test dataset.

✅ Results

Test Accuracy: ~ 97–98%

About

A neural network project to classify handwritten digits (0–9) using the MNIST dataset. Implemented with Python and TensorFlow/Keras, it demonstrates image recognition, model training, and prediction on unseen data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors