Skip to content

Latest commit

 

History

History
97 lines (44 loc) · 2.83 KB

File metadata and controls

97 lines (44 loc) · 2.83 KB

Handwritten Digit Recognition Using Neural Networks

Project Overview : This project implements a neural network to recognize handwritten digits (0–9) from the MNIST dataset. The dataset, widely used as a benchmark in the field of machine learning, consists of grayscale images of handwritten digits. The goal of the project is to train and evaluate a fully connected neural network for multi-class classification.

Features of the Project : Dataset: MNIST, which contains labeled images of handwritten digits.

Model: A dense neural network with multiple hidden layers.

Preprocessing: Includes image flattening and normalization for efficient training.

Evaluation: Performance metrics include accuracy and loss.

Dataset Information

The MNIST dataset contains:

Training Set: 60,000 images, used for model training.

Test Set: 10,000 images, used for evaluating the model.

Image Format: Grayscale, 28x28 pixels.

Labels: Numeric digits from 0 to 9.

Each image represents a single digit, and the dataset is pre-labeled, making it ideal for supervised learning.

Model Architecture :

The neural network used in this project is a feedforward model with the following structure:

Input Layer: Accepts flattened vectors of size 784 (28x28 pixel images).

Hidden Layers: Three layers with progressively fewer nodes to extract and process features.

Activation function: ReLU (Rectified Linear Unit) for non-linearity.

Output Layer: Contains 10 nodes, one for each digit class (0–9).

Activation function: Softmax, to output probabilities for multi-class classification.

Implementation Workflow

  1. Data Preprocessing

The dataset images are flattened into one-dimensional vectors for processing by the dense network.

Pixel values are normalized to the range of 0 to 1 to improve training stability.

Labels are one-hot encoded to create a multi-class representation for the output layer.

  1. Model Compilation The model is configured with:

Optimizer: Adam, an adaptive learning rate optimizer.

Loss Function: Categorical Crossentropy, ideal for multi-class problems.

Metrics: Accuracy, used to evaluate classification performance.

  1. Training the Model

The training data is passed through the network in small batches.

Each iteration adjusts the weights using backpropagation to minimize the loss.

Validation is performed on a separate dataset during training to monitor overfitting.

  1. Model Evaluation

The trained model is evaluated on the test dataset to calculate accuracy and loss.

Results are compared to benchmarks, and the network’s performance is visualized using plots for loss and accuracy over epochs.

Results

The model achieves high accuracy on the test dataset, demonstrating its effectiveness in digit classification.

Performance metrics such as accuracy and loss are visualized, showing the model’s training progression and validation results.