35
An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Embed Size (px)

Citation preview

Page 1: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Page 2: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

OUTLINEOUTLINEIntroductionIntroductionWhat is Optical Character RecognitionWhat is Optical Character RecognitionOCR ModelOCR ModelAcquiring ImageAcquiring ImageInput PreprocessingInput PreprocessingInput SegmentationInput SegmentationFeature ExtractionFeature ExtractionMulti-Layer Perceptron Neural NetworkMulti-Layer Perceptron Neural NetworkTrainingTrainingRecognitionRecognitionExperimental ResultExperimental ResultConclusionsConclusionsReferencesReferences

May 1, 2023 2An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 3: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

May 1, 2023 3An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Representing the architecture of Optical Character Recognition(OCR) that is designed using artificial computational model same as biological neuron network.

Introduction

Page 4: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

What is What is OOptical ptical CCharacterharacter RRecognitionecognition??

OCR allow to convert mechanical or electronic image base text into the machine encodes able text through an optical mechanism.

The ultimate objective of OCR is to simulate the human reading capabilities so the computer can read, understand, edit and do similar activities it does with the text.

May 1, 2023 4An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 5: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

OCR ModelOCR Model

Figure 1: Figure 1: Optical Character Recognizer Model.

May 1, 2023

5An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 6: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Acquiring ImageAcquiring Image

- Image is acquisition from any possible source that can be hardware device like camera, scanner and so on.May 1, 202

36An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 7: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input PreprocessingInput Preprocessing

- Image processing is a signal processing that convert either an image or a set of characteristics or parameters related to the image.

-It is achieve correction of distortion, noise reduction, normalization, filtering the image and so on.May 1, 2023

7An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 8: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input PreprocessingInput Preprocessing

- The RGB color space contains red, green, blue that are added together in a variety of ways to reproduce a array of color.

May 1, 2023

8An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

RGB to Gray scale Conversion

Input ImageRGB to Gray scale Conversion

Page 9: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input PreprocessingInput Preprocessing

- A binary image has only two possible color value for each pixel is that black and white. This color depth is 1-bit monochrome.

May 1, 2023

9An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Gray scale to Binary Image Conversion

RGB to Gray scale ImageGray scale to Binary image

Page 10: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input Input Segmentation

- By the Image segmentation simplify and/or change the representation of an image into something that is more meaningful and easier to analyze.-Image segmentation is used for object recognition of an image; detect the boundary estimation, image editing or image database look-up.May 1, 2023

10An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 11: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input Input Segmentation

- Enumeration of character lines in a character image is essential in delimiting the bounds within which the detection can precede.

May 1, 2023

11An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Determining Character Line

Figure-6: Boundary detection of character line.

Page 12: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Input Input Segmentation

- Detection of individual symbols involves scanning character lines for orthogonally separable images composed of black pixels.

May 1, 2023

12An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Detecting Individual Character

Figure-7: Boundary detection of a character.

Page 13: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Feature ExtractionFeature Extraction

- Feature extraction extract set of feature to produce the relevant information from the original input set data that can be represent in a lower dimensionality space.

-To implement the feature extraction process we have used Image to matrix mapping process. May 1, 2023

13An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Page 14: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Feature ExtractionFeature Extraction

- By the matrix mapping process the character image is converted corresponding two dimensional binary matrixes.

May 1, 2023

14An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Image to Matrix Mapping

Image to Matrix Mapping

Binary Representation

Page 15: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Multi-Layer Perceptron Neural Multi-Layer Perceptron Neural NetworkNetwork

May 1, 2023 15An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Multi-Layer Perceptron Neural network has an input layer, hidden layer and output layer. Input layer feed the input data set that is came from feature extraction and output layer produced the set of output vector.

Page 16: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

TrainingTraining

May 1, 2023 16An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Appling the learning process algorithm within the multilayer network architecture, the synaptic weights and threshold are update in a way that the classification/recognition task can be performing efficiently.

Presenting 600-602-6 three Layer Neural network architecture to perform the Optical Character Recognition Learning process.

Page 17: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Algorithm (sequential)

1. Apply an input vector and calculate all activations, a and u2. Evaluate k for all output units via:

(Note similarity to perceptron learning algorithm)3. Backpropagate ks to get error terms for hidden layers using:

4. Evaluate changes using:

))(('))()(()( tagtytdt iiii

k

kikii wttugt )())((')(

)()()()1(

)()()()1(

tzttwtw

txttvtv

jiijij

jiijij

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 17

Page 18: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Once weight changes are computed for all units, weights are updated at the same time (bias included as weights here). An example:

y1

y2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

v10= 1v20= 1

w11= 1

w21= -1

w12= 0

w22= 1

Use identity activation function (ie g(a) = a)

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 18

Page 19: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

All biases set to 1. Will not draw them for clarity.

Learning rate = 0.1

y1

y2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1

Have input [0 1] with target [1 0].

x1= 0

x2= 1

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 19

Page 20: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Forward pass. Calculate 1st layer activations:

y1

y2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1u2 = 2

u1 = 1

u1 = -1x0 + 0x1 +1 = 1

u2 = 0x0 + 1x1 +1 = 2

x1

x2

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 20

Page 21: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Calculate first layer outputs by passing activations thru activation functions

y1

y2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1z2 = 2

z1 = 1

z1 = g(u1) = 1

z2 = g(u2) = 2

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 21

Page 22: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Calculate 2nd layer outputs (weighted sum thru activation functions):

y1= 2

y2= 2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1

y1 = a1 = 1x1 + 0x2 +1 = 2

y2 = a2 = -1x1 + 1x2 +1 = 2

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 22

Page 23: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Backward pass:

1= -1

2= -2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1

)())(('))()((

)()()()1(

tztagtytd

tzttwtw

jiii

jiijij

Target =[1, 0] so d1 = 1 and d2 = 0So:1 = (d1 - y1 )= 1 – 2 = -12 = (d2 - y2 )= 0 – 2 = -2

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 23

Page 24: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Calculate weight changes for 1st layer (cf perceptron learning):

1 z1 =-1x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 1

w21= -1

w12= 0

w22= 1

)()()()1( tzttwtw jiijij

z2 = 2

z1 = 1

1 z2 =-2

2 z1 =-2

2 z2 =-4

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 24

Page 25: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Weight changes will be:

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

w11= 0.9

w21= -1.2

w12= -0.2

w22= 0.6

)()()()1( tzttwtw jiijij

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 25

Page 26: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

But first must calculate ’s:

1= -1

2= -2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

1 w11= -1

2 w21= 21 w12= 0

2 w22= -2

k

kikii wttugt )())((')(

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 26

Page 27: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

’s propagate back:

1= -1

2= -2

x1

x2

v11= -1

v21= 0v12= 0

v22= 1

1= 1

2 = -2

1 = - 1 + 2 = 12 = 0 – 2 = -2

k

kikii wttugt )())((')(

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 27

Page 28: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

And are multiplied by inputs:

1= -1

2= -2

v11= -1

v21= 0v12= 0

v22= 1

1 x1 = 0

2 x2 = -2

)()()()1( txttvtv jiijij

x2= 1

x1= 0

2 x1 = 0

1 x2 = 1

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 28

Page 29: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Finally change weights:

v11= -1

v21= 0v12= 0.1

v22= 0.8

)()()()1( txttvtv jiijij

x2= 1

x1= 0 w11= 0.9

w21= -1.2

w12= -0.2

w22= 0.6

Note that the weights multiplied by the zero input are unchanged as they do not contribute to the error

We have also changed biases (not shown)

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 29

Page 30: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Now go forward again (would normally use a new input vector):

v11= -1

v21= 0v12= 0.1

v22= 0.8

)()()()1( txttvtv jiijij

x2= 1

x1= 0 w11= 0.9

w21= -1.2

w12= -0.2

w22= 0.6z2 = 1.6

z1 = 1.2

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 30

Page 31: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Now go forward again (would normally use a new input vector):

v11= -1

v21= 0v12= 0.1

v22= 0.8

)()()()1( txttvtv jiijij

x2= 1

x1= 0 w11= 0.9

w21= -1.2

w12= -0.2

w22= 0.6 y2 = 0.32

y1 = 1.66

Outputs now closer to target value [1, 0]

May 1, 2023 An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network 31

Page 32: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

RecognitionRecognition

May 1, 2023 32An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Feature data is feed to the network input layer and produced an output vector and calculating the error function.

Page 33: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Experimental ResultExperimental Result

May 1, 2023 33An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Chart-1: Isolated Character Recognition experiment result comparison.

62 English character (i.e, English Capital Alphabets A to Z, English Small Alphabets a to z, English Numerical Digits 0 to 9) image recognition.

So the average Success rate for the Isolated Character Recognition is = 91.53%

Isolated Character Recognition

Page 34: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

Experimental ResultExperimental Result

May 1, 2023 34An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network

Chart-2: Sentential Case Character Recognition experiment result comparison.

For the sentential case character we have used the sentence is “A Quick Brown Fox Jumps over the Lazy Dog.” This experimental sentence is written four different type of font like Arial, Calibri (body), Segoe UI and Times New Roman.

So the average Success rate for the sentential case Character Recognition is = 80.65%

Sentential Case Character Recognition

020406080

100

CorrectRecognition

WrongRecognition

Success(%)

Error(%)

Page 35: An approach to empirical Optical Character recognition paradigm using Multi-Layer Perceptorn Neural Network

ConclusionsConclusions In our proposed system are achieved

91.53% accuracy for the isolated character and 80.65% accuracy for the sentential case character.

In future we try to be improved the accuracy of the OCR model by better preprocessing method and optimal ANN architecture.

May 1, 2023 35An approach to empirical OCR paradigm using Multi-Layer Perceptorn Neural Network