Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

✍️ Handwritten Digit Recognition using Neural Networks

A deep learning project that recognizes handwritten digits (0–9) using an Artificial Neural Network (ANN) built with TensorFlow/Keras. The model is trained on the Kaggle Digit Recognizer dataset and demonstrates the complete machine learning workflow, from data preprocessing to prediction.


📖 Overview

Handwritten digit recognition is a fundamental problem in computer vision with applications in optical character recognition (OCR), postal mail sorting, bank cheque processing, and document digitization.

In this project, a feedforward Artificial Neural Network (ANN) is trained to classify grayscale images of handwritten digits into one of ten classes (0–9). The implementation covers data preprocessing, model development, training, validation, and prediction.


📂 Dataset

This project uses the Digit Recognizer dataset available on Kaggle.

Dataset Link:
https://www.kaggle.com/competitions/digit-recognizer/data

Dataset Details

Training Dataset

  • 42,000 labeled images
  • Dataset shape: (42000, 785)
  • First column contains the digit label (0–9)
  • Remaining 784 columns represent pixel values of a 28 × 28 grayscale image

Test Dataset

  • 28,000 unlabeled images
  • Dataset shape: (28000, 784)

⚙️ Data Preprocessing

The following preprocessing steps are performed:

  • Load the dataset using Pandas
  • Check for missing values
  • Separate image pixels and labels
  • Normalize pixel values to the range [0,1]
  • One-hot encode class labels
  • Split the training data into 80% training and 20% validation

🧠 Model Architecture

The classifier is a fully connected Artificial Neural Network consisting of:

Input (28 × 28 × 1)
        │
     Flatten
        │
Dense (128, ReLU)
        │
Dense (64, ReLU)
        │
Dense (10, Softmax)

Training Configuration

  • Optimizer: Adam
  • Loss Function: Categorical Crossentropy
  • Activation Functions: ReLU and Softmax
  • Evaluation Metric: Accuracy

🛠️ Technologies Used

  • Python
  • TensorFlow / Keras
  • NumPy
  • Pandas
  • Matplotlib
  • Scikit-learn

🚀 Installation

Clone the repository:

git clone https://github.com/Programiz-007/Handwritten-Digit-Classifier-using-NN.git
cd Handwritten-Digit-Classifier-using-NN

Install the required dependencies:

pip install tensorflow pandas numpy matplotlib scikit-learn

▶️ Running the Project

Open and run the notebook:

Handwritten_Digit_Recognition.ipynb

or launch Jupyter Notebook:

jupyter notebook

📁 Project Structure

Handwritten-Digit-Classifier-using-NN/
│
├── HandwrittenDigitClassifer_NN.ipynb
└── README.md

📊 Model Performance

The trained model successfully classifies handwritten digits with high accuracy on the validation dataset. This project demonstrates the complete workflow of:

  • Data preprocessing
  • Neural network training
  • Multi-class image classification
  • Model evaluation
  • Prediction on unseen handwritten digits

🚀 Future Improvements

  • Replace the ANN with a Convolutional Neural Network (CNN)
  • Add support for custom handwritten digit images
  • Deploy the model using Streamlit or Flask
  • Save and reload trained models for inference

📚 References


📄 License

This project is intended for educational and learning purposes. Feel free to fork, modify, and extend it for your own projects.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages