# Designing and Making Software Handwriting Recognition Letters Using

• Slides: 32

Designing and Making Software Handwriting Recognition Letters Using Backpropagation Setiawan Santoso (26406058)

Background • Nowadays computer is part of human life • Computers can assist humans in processing the data into an information. • humans are not able to match the speed of data processing on the computer by entering data manually into a computer.

Objective • Created a system that can recognize handwriting. • This application will be able to recognize handwriting with image processing and neural network.

Application Process

Image Processing • Image Processing is the discipline of science that studies issues relating to improvement of image quality, image transformation and feature images. • Image Processing used in this application : – Grayscaling – Thresholding – Filtering – Skew Angel Detection – Segmentation

Grayscaling • Grayscale is a technique used in image processing to produce an image that has a value of white that has the greatest intensity to black which has the lowest intensity as shown in the picture below. • Sample : Full Color Image Grayscale Image

Thresolding • Thresholding is a process for separating objects of interest from background in an image. • This process is used to generate binary image, the image with only two colors, black and white. • Sample : Before Threshold After Threshold

Filtering • Filtering is a process for image restoration. • This process is used to eliminate noise. • In this application, the method uses convolution window. IF f(x) larger than 10 → not noise IF f(x) smaller than 10 → noise Where f(x) = (Active Pixels 1 * pixel value 1) + … + (Active Pixels 9 * pixel value 9) Active Pixel : Black = 1 , White = 0

Skew Angle Detection(1) • Skew angel detection is a method for finding the angle. • In this application, trigonometry used to find the angle between 2 lines as shown in the picture below. Counter Clockwise 3 degree

Skew Angle Detection(2) • To find the degree between that line, this following formula is used :

Segmentation • Segmentation is an important method used to convert the input image into output image based on attributes that are taken from that image. • In this application, there are 3 types of segmentation – Training Paper Segmentation – Character Segmentation – Recognize Segmentation

Training Paper Segmentation • This segmentation is used to cut each character on training paper.

Character Segmentation • This segmentation is used to eliminate the unnecessary pixel in each character image.

Recognize Segmentation • This segmentation is used in the recognize menu.

Region Extraction • Region Extraction used to get the weight to be processed in neural network. • By using the center of mass method, for each region will be divided by 30 degrees. • For each region, number of black pixel will be calculated.

Backpropagation • Backpropagation method is a branch of the ANN (Artificial Neural Network) which in principle is the thinking pattern of human brain to remember the past are gained from learning of the data or information obtained in the past.

Training Backpropagation • Training in backpropagation is divided into 4 phase: – – Initialization phase Activation phase Weight Training phase Iteration phase

Initialization Phase • At this phase, random weight and threshold in range (-2, 4 / Fi, 2. 4 / Fi) Where Fi is the total of the amount of input from neuron i in the neural network.

Activation Phase(1) • At this activation phase is to enter the desired input and output. • After that, calculation for output neuron for hidden layer and output neuron for output layer

Activation Phase(2) • The Formula : Calculation of the output neurons in the hidden layer: where n is the input number from neuron j in hidden layer and sigmoid is sigmoid activation function. Calculation of output neurons in the output layer: where m is input number from neuron k in output layer.

Weight Training Phase(1) • At this phase calculation error, new weight, update weight. • This calculation starts from neuron output layer to neuron hidden layer, neuron hidden layer to neuron hidden layer and neuron hidden layer to neuron input layer.

Weight Training Phase(2) • The Formula : Calculation of the gradient error in the output layer: Calculation of weight correction Update weight in output neuron

Weight Training Phase(3) • The Formula : Calculation of the gradient error in the hidden layer: Calculation of weight correction Update weight in hidden neuron

Iteration Phase • In this phase, iteration by returning to the activation phase and repeat the process of weight training until the desired RMSE value or specified epoch. • RMSE can be calculated using the formula: Where SSE : Where e is : Description : RMSE = Root Mean Square Error SSE = Sum Square Error N = Number of data on Training K = Number of Output Node

Database Store • Data storage in this application using txt files. File Name Description savegroupsample. txt Save a group of samples were added. Tsample. txt Saving the amount of data sample Tgrayscale. txt Storing the sample data that has been made grayscale process. Tthreshold. txt Storing the sample data that has been made threshold process. Tfilter. txt Storing the sample data that has been made filtering process. Tskewangle. txt Storing the sample data that has been made skew angle detection process. Tsegmen. txt Storing the sample data that has been made training paper segmentation process. Tsegmenhuruf. txt Storing the sample data that has been made character segmentation process. Stable. Weight. txt Save the existing configuration of backpropagation through the training process. Desire. Output. txt Storing the desired output during training. Trecognize. txt Storing the number of characters that will be recognized on Recognize process.

Testing Application • Testing is done as much as 18 times based on changes in the number of samples and the configuration parameters backpropagation. • Testing on this application is divided into 3 types of testing – Testing with trained sample – Testing with not trained sample – Testing for input with color.

Testing with Trained Sample • The test is performed to identify the characters who have been trained on this application. • In this test obtained the best results with 97. 0% success rate and the worst result is 40. 8% success rate with every character was trained (table testing can be seen on page 105).

Testing with not Trained Sample • The test is performed to identify the characters who are not trained in this application. • This testing is divided into 2 types : – Tests with the same author – Tests with different authors

Testing with not Trained Sample • Tests with the same author – In this test obtained the best results with 40. 0 % success rate and the worst result is 21. 6% success rate with every character was trained (table testing can be seen on page 107). • Tests with different authors – In this test obtained the best results with 36. 6% success rate and the worst result is 17. 8% success rate with every character was trained (table testing can be seen on page 109).

Testing for Input with Color • This test has the input image with the background and text with color • At the time of text and background that contrast in color, this application can recognize between text and background but on the contrary, if the color text and background colors are not contradictory, this application will recognize the text as a background. • Sample :

Conclusion • The time taken to process image preprocessing on each sample it is ± 5 minutes. This time can be accelerated by reducing the resolution of image samples. • The time needed to process the training of the fastest around the 73 s (± 1 minute). For the longest time about 138. 314 s (± 38 hours). • The percentage of success can be improved by adding the number of hidden layers and number of hidden nodes in backpropagation neural network. • Text and background color did not influence the recognition process.

Suggestion • inputs used for training and Recognize not too large as it takes considerable time during the process of image preprocessing. • For the configuration of backpropagation, can be added to the number of hidden layers and hidden nodes to increase the percentage level of recognition success. • For the method of division of regions should not use only one method.