0% found this document useful (0 votes)
243 views7 pages

AI Mini Project Report

The document summarizes a project on handwritten digit recognition using a neural network model. The model achieved 97.3% accuracy on the MNIST test set. It used a feedforward neural network with one hidden layer of 128 neurons and an output layer of 10 neurons. The objectives were to develop an accurate classification model, evaluate its performance, analyze parameter impacts, and compare results to other algorithms.

Uploaded by

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

AI Mini Project Report

The document summarizes a project on handwritten digit recognition using a neural network model. The model achieved 97.3% accuracy on the MNIST test set. It used a feedforward neural network with one hidden layer of 128 neurons and an output layer of 10 neurons. The objectives were to develop an accurate classification model, evaluate its performance, analyze parameter impacts, and compare results to other algorithms.

Uploaded by

Darshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

EC3066D Artificial Intelligence

Mini Project Report

Project On: Handwritten Digit Recognition


Group No: 34

Group Member Details:


S.No Name Roll No Email ID
1 Kiran Prasad B201007EC kiran_b201007ec@nitc.ac.in
Yerneni

2 Adepu Mani B200975EC adepu_b200975ec@nitc.ac.in


Deep
Topic: Handwritten digit Classification.
Model: Feedforward neural network with one hidden layer.
The topic of this project is hand-written digit classification using artificial
neural networks. The problem addressed in this project is the recognition of
digits in images, specifically hand-written digits, using machine learning
techniques.

Objectives:
The main objective of this project is to develop an artificial neural network
model that can accurately classify hand-written digits with high accuracy.
The specific objectives are as follows:

➢ To train a neural network model on the MNIST dataset


➢ To evaluate the performance of the model using various evaluation
metrics
➢ To analyze the impact of different parameters on the model's
performance
➢ To compare the performance of the proposed model with other
algorithms reported in the literature.

Literature Survey:
➢ The problem of hand-written digit recognition has been studied
extensively in the literature, and various algorithms have been
proposed.
➢ The most popular algorithms for this problem are based on deep
learning techniques such as Convolutional Neural Networks (CNNs),
Recurrent Neural Networks (RNNs), support vector machines (SVMs),
decision trees and random forests.
➢ These algorithms have achieved state-of-the-art performance on the
MNIST dataset and have been used in various applications such as
optical character recognition and digit recognition in postal services.

Background:
➢ The model proposed in the code uses a neural network with one hidden
layer and one output layer for digit recognition.
➢ The first hidden layer has 128 neurons, and the second hidden layer
has 10 neurons corresponding to the 10 digits.
➢ The model uses the relu activation function in the first hidden layer and
the sigmoid activation function in the output layer.
➢ The model is trained using the Adam optimizer and the sparse
categorical cross-entropy loss function.

Methodology:
The methodology used in the code for hand-written digit recognition using
FNN can be expanded as follows:

Data Preprocessing:
➢ Load the MNIST dataset from Keras.
➢ Normalize the pixel values of the images to the range [0, 1] by dividing
them by 255.
➢ Reshape the images from 28x28 to 784x1 vectors.

Model Architecture:
➢ The model consists of a single hidden layer with 128 units and a
sigmoid activation function, followed by an output layer with 10 units
and a sigmoid activation function.
➢ The hidden layer is responsible for learning the important features from
the input images, while the output layer predicts the class probabilities.
Model Compilation:

➢ The model is compiled using the Adam optimizer, sparse categorical


cross-entropy loss function, and accuracy metric.
Model Training:

➢ The model is trained on the training set for 5 epochs using the fit()
method of Keras.
➢ The training process involves adjusting the weights of the model to
minimize the loss function.

Model Evaluation:
➢ The model is evaluated on the test set using the evaluate() method of
Keras.
➢ The evaluation process involves computing the loss and accuracy of
the model on the test set.
Prediction:

➢ Load the image of the handwritten digit to be recognized.


➢ Convert the image to a 28x28 grayscale image and invert it.
➢ Reshape the image to a 784x1 vector.
➢ Normalize the image by dividing it by 255.
➢ Use the model's predict() method to predict the class probabilities of
the input image.
➢ Select the class with the highest probability as the predicted class.

Visualization:
➢ The confusion matrix is plotted using the Seaborn library to visualize
the model's performance.

Overall, the methodology involves building a simple neural network model,


training it on the MNIST dataset, and evaluating its performance on the
testing data. The model is then used to predict the class labels of new input
images. The performance of the model is visualized using a confusion
matrix, and a sample input image is used to demonstrate the model's ability
to classify handwritten digits.

Experimental setup:
Dataset:

For this project, we used the MNIST dataset, which is a large database of
handwritten digits that is commonly used for training and testing machine
learning models. The dataset consists of 60,000 training images and 10,000
testing images, each of which is a 28x28 grayscale image of a handwritten
digit.
We loaded the dataset using the Keras library and split it into training and
testing sets with a 6:1 ratio, where 6 parts were used for training and 1 part
was used for testing.

Training-Testing Strategies:
To train our AI model, we used the Adam optimizer and sparse categorical
cross-entropy as the loss function. We set the number of epochs to 5,
meaning that our model was trained on the entire training set five times. We
used the evaluate() function to test the model's performance on the testing
set.

Parameter Selection:
In our model, we used two dense layers with different parameters. The first
layer had 128 neurons and used the ReLU activation function, while the
second layer had 10 neurons and used the sigmoid activation function.
These parameters were selected based on their effectiveness in previous
studies and experiments.
We used the sparse categorical cross-entropy loss function and Adam
optimizer as they are the recommended choices for multiclass classification
problems.
Evaluation Methods:

To evaluate the performance of our AI model, we used two methods:


accuracy score and confusion matrix. The accuracy score is the percentage
of correctly classified images out of all images in the testing set. We also
used a confusion matrix, which is a table that summarizes the performance
of a classification algorithm by comparing predicted and actual class labels.
We used the confusion matrix to visualize the distribution of errors made by
our model and to identify which classes are being confused.
accuracy = (number of correctly predicted digits / total number
of digits) * 100%

Results:
➢ The model achieves an accuracy of 97.3% on the test set, indicating
its ability to recognize hand-written digits accurately.
➢ The confusion matrix generated using the predicted and true labels of
the test set shows the model's performance for each digit.
➢ The model's performance is sensitive to the number of hidden layers,
number of epochs, the number of neurons in each layer, the activation
functions, and the optimization algorithm used.
Conclusion:
➢ We have developed a deep learning model using TensorFlow and
Keras to classify handwritten digits from the MNIST dataset. The model
achieved a high level of accuracy, indicating its ability to perform well
on similar tasks.
➢ The model can be used in various applications such as postal services,
banking, and healthcare.
➢ The performance of the model can be improved by tuning the
hyperparameters, using data augmentation techniques, and using
more complex architectures.

References:
➢ LeCun, Y., Cortes, C., & Burges, C. (1998). The MNIST database of
handwritten digits. Retrieved from http://yann.lecun.com/exdb/mnist/
➢ TensorFlow documentation: https://www.tensorflow.org/
➢ Keras documentation: https://keras.io/

You might also like