0% found this document useful (0 votes)
4 views

Machine Learning Report

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Machine Learning Report

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

MINI PROJECT

Date of

Announcement: Date

of Submission:

Branch/division: Computer-B

Semester: VII

Subject: Natural Language processing

Marks & Signature:

R1 R2 R3 Total Signature

(2 Marks) (2 Marks) (1 Marks) (05 Marks)

1
A MINI PROJECT REPORT
ON

“Handwritten Digit Recognition

SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE


DEGREE OF
BACHELOR OF COMPUTER ENGINEERING

BY
RUSHIKESH M. MANJE (B-09)
SANGARAM R. LAD (B-03)

UNDER GUIDANCE OF
Prof. P. P. Karhade

UNIVERSITY OF MUMBAI
DEPARTMENT OF COMPUTER ENGINEERING
DATTA MEGHE COLLEGE OF ENGINEERING
PLOT NO.98 SECTOR-3, AIROLI, NAVI MUMBAI
ACADAMIC YEAR 2024-25

2
DATTA MEGHE COLLEGE OF ENGINEERING
AIROLI, NAVI MUMBA

CERTIFICATE

This is to certify that the project entitled “Handwritten Digit Recognition” is bonafide work
of “Rushikesh Manje (09), Sangaram lad (03) ” submitted to the University of Mumbai in
partial fulfilment of the requirement for the award of BE in “Computer Engineering”.

Prof. P.P.Karhade Dr. A. P. Pande Dr. P.A.Dode


Project Guide Head of the Department Principal

3
DATTA MEGHE COLLEGE OF ENGINEERING
AIROLI, NAVI MUMBAI

MINI PROJECT APPROVAL

This project report entitled “Handwritten Digit Recognition ” of the students “Rushikesh
Manje (09), Sangaram lad (03)” approved for the degree of Computer Engineering.

Internal Examiner External Examiner


Date: Date:
Place: Place:

4
ACKNOWLEDGEMENT

Motivation and guidance are the keys towards success. I would like to extend my thanks to
all the sources of motivation.

We would like to grab this opportunity to thank Dr. P. A. Dode, Principal for
encouragement and support he has given for our project.

We express our deep gratitude to Dr. A. P. Pande, Head of the Department who has been
the constant driving force behind the completion of this project.

We wish to express our heartfelt appreciation and deep sense of gratitude to my project guide
Prof. P. P. Karhade for her encouragement, invaluable support, timely help, lucid
suggestions and excellent guidance which helped us to understand and achieve the project
goal. Her concrete directions and critical views have greatly helped us in successful
completion of this work.

We extend our sincere appreciation to all Professors for their valuable inside and tip during
the designing of the project. Their contributions have been valuable in so many ways that we
find it difficult to acknowledge of them individually.

We are also thankful to all those who helped us directly or indirectly in completion of this
work.

Place: Name of the student


Date:

5
INDEX

1. INTRODUCTION
2. REQUIREMENT ANALYSIS
3. PROJECT DESIGN (flow chart)
4. TECHNOLOGIES USED
5. RESULTS AND DISCUSSIONS
6. CONCLUSIONS AND FUTURE SCOPE
7. REFERENCES

6
1. INTRODUCTION

, unpredictable weather conditions, soil degradation, and resource constraints make it


Handwritten digit recognition is a crucial task in optical character recognition, enabling
machines to interpret and process handwritten numbers effectively. With the rise of data-
driven applications, recognizing handwritten digits has become essential in various domains,
including postal services, banking, and educational assessment.

This project aims to develop a Handwritten Digit Recognition system using machine learning
techniques to accurately classify handwritten digits from images. By utilizing a dataset such
as the MNIST (Modified National Institute of Standards and Technology), we can train
models to recognize digits based on their features.

2. REQUIREMENT ANALYSIS

2.1 Functional Requirements


 Input Parameters:
The system takes an image of a handwritten digit (28x28 pixel grayscale image) as input.
 Output:
The system outputs the recognized digit (0-9) based on the input image.
 Model Training:
The system is trained on the MNIST dataset using the following machine learning
algorithms:
o Convolutional Neural Network (CNN): A deep learning model used to
process and classify image data.
o K-Nearest Neighbors (KNN): A simple and intuitive algorithm that
classifies data points based on their distance to the nearest training data
points.
o Support Vector Machine (SVM): A powerful classifier that finds
the hyperplane which best separates the different classes.

7
3. PROJECT DESIGN (flow chart)

The flow of the Handwritten Digit Recognition project is as follows:


1. Data Preprocessing:
o Load the MNIST dataset.
o Normalize the pixel values to scale between 0 and 1.
o Split the dataset into training and testing sets.
2. Model Training:
o Train the models (CNN, KNN, SVM) on the training dataset.
o Evaluate model performance using accuracy and other metrics.
3. Prediction:
o Provide an input image (handwritten digit).
o Predict the digit using the trained models.
4. Output:
o Display the predicted digit with a confidence score.

8
4. TECHNOLOGIES USED

Programming Language: Python was chosen due to its simplicity and the availability of
powerful libraries for machine learning and data processing.

Libraries Used:
 TensorFlow/Keras: Used for building and training the CNN model.
 OpenCV: Utilized for image processing tasks, such as resizing, normalization,
and augmentation of the handwritten digit images.
 Scikit-learn: Used for implementing KNN and SVM models, and for splitting data
into training and testing sets.
 Matplotlib & Seaborn: Libraries used for visualizing data distributions,
model performance metrics, and results.

Dataset: Instead of using the standard MNIST dataset, a custom dataset of handwritten digits
was created. The dataset consists of [number of images] images collected from [mention the
sources, e.g., various individuals or sources]. These images were preprocessed and split into
training and testing sets for model training and evaluation.

9
5. RESULTS

Source Code:

#prediction of image drawn in paint


import joblib
import cv2
import numpy as np #pip install numpy
import time
import pyscreenshot as ImageGrab

model=joblib.load("model/digit_recognizer")
image_folder="img/"

while True:
img=ImageGrab.grab(bbox=300,300,800,900))

img.save(images_folder+"img.png")
im = cv2.imread(images_folder+"img.png")
im_gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
im_gray = cv2.GaussianBlur(im_gray, (5, 5), 0) # Smaller kernel for less blurring

#Threshold the image


ret, im_gray = cv2.GaussianBlur(im_gray, (5, 5), 0) # Smaller kernel for less blurring

roi = cv2.resize(im_th, (800,900), interpolation =cv2.INTER_AREA)

rows,cols=roi.shape

X = []

## Fill the data array with pixels one by one.


for i in range(rows):
for j in range(cols):
k = roi[i,j]
if k>100:
k=1
else:
k=0
X.append(k)

predictions =model.predict([X])
print("Prediction:",predictions[0])
cv2.putText(im, "Prediction is: "+str(predictions[0]), (300,300, 0, 0.8,(0,500,0),2,cv2.LINE_AA)

cv2.startWindowThread()
cv2.namedWindow("Result")
cv2.imshow("Result",im)
cv2.waitKey(10000)
if cv2.waitKey(1)==13: #27 is the ascii value of esc, 13 is the ascii value of enter
break
cv2.destroyAllWindows()
10
Output:

11
6. CONCLUSION & FUTURE SCOPE

6.1 Conclusions:

The Handwritten Digit Recognition System built using machine learning algorithms
successfully classified handwritten digits from the MNIST dataset with a high degree of
accuracy. The CNN model proved to be the most effective due to its ability to process and
extract features from images efficiently.

6.2 Future Scope:

 Real-Time Recognition:
Future versions of the system could include real-time digit recognition, allowing users to draw
digits and get instant predictions.

 Mobile Application:
Developing a mobile app for handwritten digit recognition would provide wider accessibility to
users in various sectors, such as education and banking.

 Improved Accuracy:
Further improvement in accuracy can be achieved by fine-tuning hyperparameters or using more
advanced deep learning architectures like ResNet.

REFERENCES

1. LeCun, Y., et al. (1998). The MNIST Database of Handwritten


Digits. Available at: http://yann.lecun.com/exdb/mnist/
2. Scikit-learn Documentation.
Available at: https://scikit-learn.org
3. Keras Documentation.
Available at: https://keras.io

12

You might also like