CHARACTER RECOGNITION USING NEURAL NETWORK SYAHFINASH BINTI SHAFII This Report Is Submitted In Partial Fulfillment Of Requirement For The Bachelor Degree of Electonic Engineering (Computer Engineering) Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer Universiti Teknikal Malaysia Melaka June 2016
24
Embed
CHARACTER RECOGNITION USING NEURAL NETWORK …eprints.utem.edu.my/18080/1/Character Recognition Using Neural... · belajar. Reka bentuk rangkaian neural yang asas mempunyai ... mempunyai
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
CHARACTER RECOGNITION USING NEURAL NETWORK
SYAHFINASH BINTI SHAFII
This Report Is Submitted In Partial Fulfillment Of Requirement For The
Bachelor Degree of Electonic Engineering (Computer Engineering)
Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer
Universiti Teknikal Malaysia Melaka
June 2016
iii
iv
v
ACKNOWLEDGEMENT
I would like to express my greatest gratitude to ALLAH S.W.T for the mercy,
blessing and strength given for me to complete this thesis. With HIS blessing and
bestowed, I have able to complete this thesis.
My special thanks goes to my dedicated supervisor, En. Rosman bin Abd
Rahim, who always provides good supervision, encouragement and critics. I am truly
indebt with all the helps that he has done for me in completing this final project from
the beginning until the end of this thesis.
My thanks also go to my family for their support and endless encouragement
throughout my life. They have been a wonderful source of support, inspiration, and
encouragement throughout my education, and they deserve much credit for where I
am today.
Lastly, my deepest appreciation to all the persons that involved directly and
indirectly in this project with full willingness in contributing their efforts, time, energy
and idea in helping me completing this thesis. There are no other words that would
able to express my feeling of gratitude towards them except thank you.
vi
ABSTRACT
Humans have the ability to recognize characters. For example, human can
distinguish between different characters and recognize them easily as an A or a B and
so on. Therefore, project is intended to develop a neural network system that is able to
perform character recognition, particularly English alphabets. Neural network is a
system inspired by human brain function; consists of neurons connected in parallel
with the ability to learn. A basic design of neural network has input layer, hidden layer,
and output layer. The use of neural network can improve the quality of recognition
while achieving good performance. A total of 650 samples characters are used with 25
samples of each character. The performance of evaluation is divided to 80% of training
and 20% for testing. Scaled conjugate gradient training function is used as this function
can perform faster in pattern recognition as well as its small memory requirement. Two
training methods are used. The first one is the Gradient Technique with 39 neurons in
hidden layer. The second training method is Geometric Feature Extraction with 35
neurons in hidden layer. Gradient Technique and Geometric Feature Extraction; both
show an excellent recognition rate of 94.6% and 94.3% respectively. The output of
recognized characters is shown in a .txt file.
vii
ABSTRAK
Manusia mempunyai keupayaan untuk mengenal pasti abjad. Sebagai contoh,
manusia boleh membezakan antara abjad-abjad yang berbeza dan dengan mudah dapat
mengenali sama ada abjad tersebut adalah A atau B dan sebagainya. Oleh itu, projek
ini bertujuan untuk membina satu sistem rangkaian neural dengan keupayaan untuk
melaksanakan pengecaman abjad, terutamanya huruf bahasa Inggeris. Rangkaian
neural adalah satu sistem yang diilhamkan oleh fungsi otak manusia; yang terdiri
daripada neuron-neuron yang disambung secara selari yang berkebolehan untuk
belajar. Reka bentuk rangkaian neural yang asas mempunyai lapisan input, lapisan
tersembunyi, dan lapisan output. Penggunaan rangkaian neural boleh meningkatkan
kualiti pengecaman abjad disamping mencapai prestasi pengecaman yang baik.
Sejumlah 650 sampel abjad yang telah digunakan bersamaan dengan 25 sampel bagi
setiap abjad. Penilaian prestasi dibahagikan kepada 80% latihan dan 20% untuk ujian.
Skala konjugat kecerunan digunakan sebagai fungsi latihan kerana fungsi ini
mempunyai keupayaan yang lebih cepat dalam pengecaman corak serta memerlukan
memori yang kecil. Terdapat dua kaedah latihan yang digunakan. Yang pertama adalah
teknik kecerunan yang mempunyai 39 neuron di lapisan tersembunyi. Manakala
kaedah latihan yang kedua adalah pengekstrakan ciri geometri yang mengandungi 35
neuron di lapisan tersembunyi. Teknik kecerunan dan pengekstrakan ciri geometri ini
masing-masing menunjukkan kadar pengenalpastian abjad yang sangat baik iaitu
94.6% dan 94.3%. Output bagi abjad yang dapat dikenalpasti dipaparkan dalam fail
.txt.
viii
TABLE OF CONTENTS
CHAPTER CONTENT PAGE
PROJECT TITLE i
REPORT VERIFICATION STATUS FORM ii
DECLARATION iii
SUPERVISOR'S DECLARATION iv
ACKNOWLEDGEMENT v
ABSTRACT vi
ABSTRAK vii
TABLE OF CONTENT viii
LIST OF TABLES xi
LIST OF FIGURES xii
LIST OF ABBREVIATIONS xiv
1 INTRODUCTION
1.1 Project Background 1
1.2 Problem Statement 1
1.3 Objectives 2
1.4 Scope and Limitation 2
1.5 Project Methodology 3
ix
1.6 Report Structure 4
2 LITERATURE REVIEW
2.1 MATLAB 6
2.2 Image Processing 7
2.2.1 Image processing in MATLAB 9
2.3 Character Recognition 9
2.3.1 Handwritten character recognition 10
2.4 Neural Network 10
2.5 Comparison of literature review 12
3 METHODOLOGY
3.1 Project Design 18
3.2 Project Process Flow 18
3.2.1 Literature Review 19
3.2.2 Research on Algorithm 19
3.2.3 Coding Development in MATLAB 20
3.2.4 Character Recognition 20
3.2.5 Result and Analysis 20
3.2.6 Discussion and Future Work 20
3.3 Project Methodology 21
3.4 Image Pre-processing 22
3.4.1 Image Conversion 22
3.4.2 Morphology 23
3.4.3 Edge Detection 25
3.5 Feature Extraction 26
3.5.1 Gradient Technique 26
3.5.2 Geometric Feature Extraction 27
3.6 Training and Classification 28
3.6.1 Supervised Learning 28
x
3.6.2 Unsupervised Learning 29
4 RESULT AND ANALYSIS
4.1 Result 30
4.1.1 Gradient Technique 31
4.1.2 Geometric Feature Extraction 32
4.1.3 Performance comparison between
training methods 34
4.2 Graphical User Interface (GUI) 44
4.3 Discussion 48
5 CONCLUSION
5.1 Conclusion 50
5.2 Future Work 51
REFERENCES 52
APPENDIX 54
xi
LIST OF TABLES
NO TITLE PAGE
2-1 Comparison of literature review 12
3-1 Rule for Dilation and Erosion 24
4-1 Characters recognition rate for Gradient Technique 31
4-2 Characters recognition rate for Geometric Feature Extraction 32
4-3 The network performance after training 35
4-4 The output of recognition 36
4-5 Summary of optimal result when employing different methods 44
xii
LIST OF FIGURES
NO TITLE PAGE
1.1 Process flow for Final Year Project (FYP) 4
2.1 MATLAB symbol 6
2.2 MATLAB platform 7
2.3 Fundamental of digital image processing 8
2.4 The components of image processing system 8
2.5 The example of image processing using MATLAB
for counting circular objects in an image 9
2.6 Example of handwriting recognition 10
2.7 A drawing of biological neurons 11
2.8 Neural Network modelled layer 11
3.1 Project process flow 19
3.2 Flow of algorithm development 21
3.3 Coding for converting RGB to grayscale to binary image 23
3.4 Output of image conversion 23
3.5 Coding for morphology function 24
3.6 Output images for morphology 24
3.7 Coding for edge detection 25
3.8 Example of edge detection output using Sobel algorithm 25
4.1 Neural network training block and progress 30
4.2 Neural network training progress for (a) Gradient Technique
and (b) Geometric Feature Extraction 34
4.3 The sample input image 36
4.4 Validation performance plot when employing gradient
technique method 36
4.5 Validation performance plot when employing geometric
feature extraction method 37
4.6 Gradient and validation checks plots when employing
xiii
gradient technique method 38
4.7 Gradient and validation checks plots when employing