Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

✍️ Handwritten Digit Classification using CNN & RNN

Python Deep Learning Dataset


📌 Project Description

This project implements a deep learning-based solution for recognizing handwritten digits (0–9) using two different approaches: Convolutional Neural Networks (CNN) and Recurrent Neural Networks (RNN).

The main objective is to understand how different neural network architectures perform on image classification tasks. CNN is used to capture spatial features, while RNN processes the image as a sequence to explore an alternative approach.

The project covers the complete pipeline including data preprocessing, model building, training, and evaluation. A comparison between CNN and RNN is also performed to analyze performance differences.

Key highlights:

  • Built CNN and RNN models from scratch
  • Used MNIST dataset for training and testing
  • Achieved high accuracy with CNN (~98–99%)
  • Compared sequential vs spatial learning approaches

📌 Project Overview

This project focuses on classifying handwritten digits (0–9) using deep learning models.

Dataset details:

  • 60,000 training images
  • 10,000 testing images
  • Image size: 28×28 grayscale

🧠 Model Architectures

🔹 CNN Architecture

CNN Architecture

Components:

  • Convolution layers
  • ReLU activation
  • Max pooling
  • Fully connected layers
  • Softmax output

🔹 RNN Architecture

RNN Architecture

Components:

  • Sequential input (row-wise image)
  • Hidden state learning
  • Dense output layer

⚙️ Technologies Used

  • Python
  • PyTorch / TensorFlow
  • NumPy
  • Matplotlib

📊 Workflow

  1. Load MNIST dataset
  2. Preprocess data
  3. Build CNN & RNN models
  4. Train models
  5. Evaluate performance
  6. Compare results

📈 Results

Model Accuracy
CNN ~98–99%
RNN ~90–92%

CNN outperforms RNN due to better spatial feature extraction.


📌 Applications

  • Handwritten digit recognition
  • OCR systems
  • Bank cheque processing
  • Postal code detection

💡 Key Learnings

  • CNN vs RNN comparison
  • Image vs sequential data handling
  • Model optimization techniques
  • End-to-end deep learning workflow

About

Implemented handwritten digit classification using RNN and CNN models on the MNIST dataset to compare sequential and spatial learning approaches. The RNN model achieved 91.89% accuracy, while the CNN model achieved 98.90%, clearly demonstrating the effectiveness of convolutional architectures

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages