0% found this document useful (0 votes)
67 views3 pages

Handwritten Digit Recognition Final Report

This project investigates handwritten digit recognition using the MNIST dataset, employing K-Nearest Neighbors, Logistic Regression, and Convolutional Neural Networks (CNN). The CNN model significantly outperformed traditional methods with over 98% accuracy due to its ability to learn spatial hierarchies. The findings emphasize the superiority of deep learning approaches for high-dimensional structured data tasks.

Uploaded by

davidnwachukwum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views3 pages

Handwritten Digit Recognition Final Report

This project investigates handwritten digit recognition using the MNIST dataset, employing K-Nearest Neighbors, Logistic Regression, and Convolutional Neural Networks (CNN). The CNN model significantly outperformed traditional methods with over 98% accuracy due to its ability to learn spatial hierarchies. The findings emphasize the superiority of deep learning approaches for high-dimensional structured data tasks.

Uploaded by

davidnwachukwum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Handwritten Digit Recognition Using

Machine Learning and Deep Learning


Abstract

This project explores the implementation of multiple machine learning and deep learning
techniques for handwritten digit recognition, using the MNIST dataset as the testing ground.
The problem is both classic and essential, involving the classification of 28x28 pixel
grayscale images into digits (0-9). Three models were used: K-Nearest Neighbors (KNN),
Logistic Regression, and a Convolutional Neural Network (CNN). The project demonstrates
the evolution from traditional models to more sophisticated deep learning approaches, with
CNNs achieving superior accuracy through automatic feature extraction and hierarchical
learning.

1. Introduction

Handwritten digit recognition is more than just a toy problem — it mirrors the foundational
ideas of pattern recognition and computer vision. From postal services to automated data
entry systems, the implications are real. The goal of this project is to explore how well
different machine learning paradigms perform on this task and reflect on the decision-
making involved in choosing models, preprocessing techniques, and evaluation strategies.

2. Background

The MNIST dataset is often referred to as the 'Hello World' of image classification. It
consists of 60,000 training images and 10,000 test images of handwritten digits. What
makes it useful is not just the size, but the complexity introduced by human variation in
handwriting. It's the perfect candidate to test both traditional and modern learning
techniques.

3. Methodology
This project follows a structured pipeline:

 - Data Preprocessing (flattening, scaling)


 - Training Traditional Models: KNN and Logistic Regression
 - Designing and Training a Convolutional Neural Network
 - Evaluating Model Performance Using Accuracy, Precision, Recall, F1-Score
 - Visualizations (PCA, Confusion Matrix, ROC Curve)

📸 Insert screenshot of the original MNIST sample images here

📸 Insert screenshot of PCA cluster visualization here

4. Traditional Machine Learning Models

4.1 K-Nearest Neighbors (KNN)

KNN was chosen for its simplicity. While not optimal for high-dimensional data, it provides
a useful baseline. The model achieved an accuracy of around 94%. However, performance
quickly plateaued regardless of hyperparameter tuning.

📸 Insert screenshot of KNN confusion matrix here

4.2 Logistic Regression

Despite its name, Logistic Regression works decently in multi-class classification via the
One-vs-Rest strategy. It achieved an accuracy of about 92%. However, its limitations
became obvious when compared to CNN due to lack of spatial understanding.

📸 Insert screenshot of ROC curves or Logistic Regression confusion matrix here

5. Deep Learning with CNN

The CNN model consisted of two convolutional layers, max-pooling, and dense layers. This
architecture was able to reach over 98% accuracy. Its strength lies in its ability to learn
spatial hierarchies — something traditional models completely ignore.

📸 Insert screenshot of CNN training accuracy and loss curves here

📸 Insert screenshot of CNN confusion matrix here

6. Evaluation and Metrics

All models were evaluated using the following metrics: Accuracy, Precision, Recall, and F1-
score. CNN clearly outperformed the rest, especially in recognizing complex or ambiguous
digits. Visual tools such as confusion matrices and ROC curves further revealed the models'
strengths and weaknesses.

📸 Insert screenshot of evaluation metric tables or classification report here

7. Key Findings

- KNN and Logistic Regression are fast to implement but limited in performance.
- CNNs significantly outperform traditional models due to their architectural design.
- Visualization tools like PCA help understand feature space, even before training.
- Overfitting was carefully managed by monitoring validation loss and accuracy over epochs.

8. Challenges & Reflections

Tuning hyperparameters on CNN, especially choosing the right number of filters and
neurons, required several attempts. Understanding the role of flattening and dropout also
added to the learning curve. Despite these, CNNs provided the most satisfying development
experience.

9. Conclusion

This project reinforced one core idea: deeper architectures can outperform classical
methods when the problem involves high-dimensional structured data. The CNN achieved
over 98% accuracy and showed remarkable robustness across classes. The traditional
models served as strong benchmarks, and the overall comparison highlighted why deep
learning has become essential in image-related tasks.

You might also like