A SEMINAR REPORT ON TAMIL CHARACTER RECOGNITION USING NEURAL NETWORKS SPONSORED BY: MODULAR INFOTECH SUBMITTED BY AKSHAY APTE HARSHAD GADO SOURABH BARVE Project guide: RAM PATTARKINE Professor and H.O.D (E&TC) DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION ENGINEERING PUNE VIDYARTHI GRIHA’S COLLEGE OF ENGINEERING AND TECHNOLOGYPARVATI,PUNE-411030. Page | 1 Certificate This is to certify that Akshay Apte Harshad Gado Sourabh Barve of B.E (Electronics &Telecommunication Engineering.) has delivered a seminar entitled “TAMIL CHARACTER RECOGNITION” during the academic session 2007-08 in satisfactory manner in the partial fulfillment of the requirement for the degree of “Bachelor of Engineering” in Electronics & Telecommunication Engineering of Pune University , Pune under my guidance and supervision Internal guide PROFESSOR K.J.Kulkarni DEPT. OF ELECTRONICS & TELECOMMUNICATION ENGINEERING Pune Vidyarthi Griha’s COLLEGE OF ENGINEERING & TECHNOLOGY, PUNE. 2007-08 Page | 2 ACKNOWLEDGEMENTS We would like to thank MODULAR INFOTECH for giving us an opportunity to work on this project. We are grateful to them for their timely assistance and co-operation. We would also like to thank our project guide Professor Ram Pattarkine for his able guidance. We acknowledge your valuable criticism as well as timely appreciation. Finally we would like to express our gratitude towards Professor K.J.Kulkarni who went out of her way to help us. HARSHAD GADO AKSHAY APTE SOURABH BARVE Page | 3 INDEX • ABSTRACT………………………….…………………………………………………..…………………..……….5 • SPECIFICATIONS……………………………………………………….………………………………..………..6 • FLOWCHART……………..…………………………………………………………….………….…….………..7 - Training phase - Testing phase • Features of MATLAB…………………………………………………….………………………….…….…….10 • Block diagram..…………………………………………………………….….….....11 • What is NEURAL NETWORK?..............................................................................12 • Working .…………….…………………………………………………….….……..13 • Features extracted ..………………………………………………….…….……… 14 • Models of neural networks under consideration…………………………..………19 - Bi-directional Associative Memory……………………………………….……19 - Neocognitron…………………………………………………………….………20 - Radial Basis Function Network……………………………………….………..21 • Applications …………………………………………………………..….….……....22 • Current status…………………………………………………………….....……....23 • Future plan………………………………………………………..…….…..…….....24 • Bibliography…………………………………………………………………..……..25 • Set of TAMIL characters………..…………………………………...……..………26 Page | 4 FIGURE NUMBER TITLE OF THE FIGURE PAGE NUMBER 1 Block diagram 11 2 Character height 14 3 Characters having closed loops 15 4 Number of Horizontal Transitions 16 5 Maximum number of vertical transitions 17 6 Number of pixels in different quadrants 18 7 Bi-directional associative memory 19 8 Neocognitron model 20 9 Radial Basis Function Network 21 Page | 5 ABSTRACT Many of today’s document scanners for the PC come with the software that performs a task of character recognition. OCR software allows you to scan a printed document and then convert the electronic text in word format. In our project we try to recognize characters of an Indian regional language. No such software is presently available in the market which is satisfactorily providing the required results. We scan a Tamil document and then recognize the characters using Neural Networks by extracting their features. Today India is considered to be a huge market for all kinds of products. But many parts of the country are still not that well conversed with the English language. So to communicate with the people at grass root level or even the residents of that particular region, local or regional languages have to be used for communication. Thus to have the documentations in regional languages is the need of today. So after thorough discussions and analyzing the needs of the market we decided to make this project. Though a very small part of digital image processing we find that the implementations of OCR in the corporate world are huge. It can be used in banking & other financial institutions, libraries, convert existing books into computer format so the books can be taken on a CD-ROM or directly uploaded on the internet. Page | 6 SPECIFICATIONS Language : Tamil Software used : MATLAB Character size : 5mm-15mm Expected accuracy : 80% Color of page on which data is present : White Color of the character : Black Number of people from whom samples will be taken : 50 - Number of sets of samples to be taken from each person: 10 - Each set will consist of every character of the concerned regional language. Page | 7 TRAINING PHASE FLOWCHART Start Scan the handwritten document Take one character at a time Extract features of the character. Give the feature vector to the neural network Update weights of the neural network. END Page | 8 TESTING PHASE FLOWCHART Start Scan the handwritten document Take one character at a time Extract features of the character. Give the feature vector to the neural network Print the character END Page | 9 FEATURES OF MATLAB MATLAB is a highly productive development environment for creating scientific and engineering algorithms and applications, providing powerful tools for every step in the process. The high level language, interactive programming environment, built-in Math functions, editing and debugging tools, and deployment options all contribute to your overall development time. With MATLAB you don’t have to develop algorithms from scratch or work with complicated interfaces to external libraries as is common with C and C++. You can write IMAGE PROCESSING algorithms in MATLAB just as you would express them mathematically. Most algorithms in the Image Processing toolbox are implemented in open MATLAB language, which allows you to learn from and customize existing algorithms. Building applications around complex algorithms and graphics is easy with interactive GUIDE (Graphical User Interface Development Environment) tool, which lets you design and modify user interfaces with list boxes, pull-down menus, push buttons, radio buttons, and sliders as well as MATLAB plots and ActiveX controls. Alternatively, you can create GUIs programmatically using MATLAB functions. You have several options for deploying your application. MATLAB lets you automatically convert your MATLAB programs into self-contained applications, and software components to share with end users. Applications and components created using the compiler do not require MATLAB to run. MATLAB builder for COM enables you to easily convert MATLAB algorithms to Common Object Model (COM) objects that are accessible from any com-based application. MATLAB supports standard data and image formats, including JPEG, TIFF, PNG, HDF, HDF-EOS, FITS, XLS, ASCII and BINARY files. It also supports multiband image formats, such as LANDSAT. Low level input/output functions enable you to develop custom routines for working with any data format. Page | 10 BLOCK DIAGRAM Fig 1 : BLOCK DIAGRAM Page | 11 What IS Neural Network? Neural networks are simplified models of biological nervous system. It is highly interconnected network of a large number of processing elements called neurons in an architecture inspired by the brain. A neural network can be massively parallel and therefore is said to exhibit parallel distributed processing. Neural network exhibit characteristics such as mapping capabilities or pattern association, generalization, robustness, fault tolerance and parallel and high speed processing. Neural network learn by examples. They can therefore be trained with known examples of a problem to acquire knowledge about it. Neural network adopts various learning mechanisms of which supervised learning and unsupervised learning methods have turned out to be very popular. In supervised learning, a ‘teacher’ is assumed to be present during the learning process. That is the network aims to minimize the error between the targets (desired) output presented by ‘teacher’ and the computed output, to achieve better performance. However, in unsupervised learning, there is no teacher present to hand over the desired output and the network therefore tries to learn by itself, organizing the input of the problem. Though NN architecture has been broadly classified as single layer feedforward networks, multilayer feedforward networks, and recurrent networks, over the years several other NN architectures have evolved. Some of the well known NN systems include backpropogation network, perceptron, ADALINE (Adaptive Linear Element), associative memory, Boltzmann machine, adaptive resonance theory, self-organizing feature map, and Hopfield network. Neural network have been successfully applied to problems in the fields of pattern recognition, image processing, data compression, forecasting, and optimization to quote a few. Page | 12 WORKING The handwritten document is scanned using a scanner. The image of the scanned document is processed using the program. Initially each line is separated. Then the different words on each line are separated, and then each character in the word is isolated. Then the individual isolated character is subjected to “Feature Extraction”. The features are the distinguishing characteristics of the letters, which are used to classify the letters into different classes. At the end of “Feature Extraction” every character has a Feature Vector assigned to it. This Feature Vector is a set of numbers corresponding to the characteristics of the letter. Now this Feature Vector is given to the Neural Network. The Neural Network has two phases of operation -Training phase -Testing phase Training phase In this phase the Neural Network is trained by using the Feature Vector which is extracted from the characters. During training the network updates its weights according to the input pattern. At the end of training phase, the neural network reaches a steady state where its weights do not change. The weights attain a final value such that any pattern similar to those samples which are presented in the training phase can be recognized. Testing phase In this phase, the Feature Vector of the character is given as input to the Neural Network. The Neural Network processes these inputs and recognizes the character. During this phase no weight change takes place. These characters are then converted to a font recognized by a computer and then displayed. Page | 13 Features Extracted Character height (Tamil “ki”) Fig 2 :Character height Some characters are taller than the others. Hence, such characters which have a part lying above a particular level fixed in the program can be distinguished from the other shorter characters. Page | 14 Characters having closed loops (Tamil “a”) (Tamil “zha”) Fig 3 : Characters having closed loops Some characters have closed loops, which can be filled using the MATLAB function “imfill”. If the characters are divided into four quadrants, different characters show such loops in different quadrants. Hence, when the loops are filled, the number of pixels in particular quadrants increases. This can be used to group such characters with closed loops into different categories. Page | 15 Maximum Number of Horizontal Transitions (Tamil “Ta”) (Tamil “Na”) Fig 4: Maximum Number of Horizontal Transitions Here, a ‘transition’ refers to going from background to foreground and back to the background once. When scanned horizontally, different characters show different number of maximum transitions, based on which, different characters can be grouped into categories. Page | 16 Maximum Number of vertical transitions (Tamil “ja”) (Tamil “pa”) Fig 5: Maximum Number of Vertical Transitions Similar to horizontal transitions, when scanned vertically, different characters show different characters show different number of transitions. Page | 17 Number of pixels in different quadrants (Tamil “pa”) (Tamil “Sha”) Fig 6 : Number of pixels in different quadrants Different characters show different pixel density in different quadrants. This feature can be used to differentiate amongst the characters. Page | 18 MODELS OF NEURAL NETWORKS UNDER CONSIDERATION Bidirectional Associative Memory Figure 7: Bi-directional associative memory Bi-directional associative memory is a hetero-associative recurrent neural network consisting of two layers. The net iterates by sending a signal back and forth. Between the two layers until each neuron’s activation remains constant for many steps (i.e. till it reaches equilibrium). The net associates a set of patterns by summing bipolar correlation matrices. The net can respond to input on either layer. Page | 19 Neocognitron Model The Neocognitron is powerful in its ability to recognize patterns despite translation, rotation, distortion and changes in scale. It can accept two dimensional patterns like those imaged into the retina and processes them in successive layers. It is a hierarchical net in which there are many layers with sparse and localized pattern of connectivity between the layers. The Neocognitron is based on supervised learning. Each layer has units arranged in number of square arrays. Only very limited number of signals are transmitted from one unit to other. The layers are arranged in pairs that is, there is an s-layer followed by a c-layer. The S arrays are trained to respond to particular pattern or group of patterns. All cells in simple array plane respond to same pattern. Each simple cell is sensitive to a restricted area by input pattern. These areas overlap to cover the entire pattern. The C-cells combine the outputs from S-cells and simultaneously thin out the number of units in each array. Complex cells serve to make the system less sensitive to position of patterns in input field. Page | 20 Radial Basis Function Network 1 1 m i n Radial basis function network can be used for approximating functions and recognizing patterns. It uses Gaussian Potential functions. The Gaussian potential functions are also used in networks called regularization networks. The architecture of radial basis function network is a multilayer feed forward network. There are n input neurons and m output layers along with the hidden layer that exists between the input and output layer. The interconnection between the input and hidden layer forms hypothetical connection and between the hidden and output layer forms weighted connection. Page | 21 APPLICATIONS With help of our project images of text pages having TAMIL characters can be converted into ASCII character files for editing, combining with other files. There is an increasing demand to convert paper document to electronic versions. This system provides bridge from printing back to electronic storage and editing. Automatic sorting of mails in Post office. In various offices there are many pages of printed data and storage of these printed data is becoming increasing difficult. Also to catalogue and refer these things is difficult. In such offices this system is useful. As we have recognized these characters are based on images, this system can be used as an interactive system for physically challenged such as a blind person. Modification is required to generate sound files of recognized characters so that a blind person will be able to understand data on page. Digitization of hand-filled forms. Digitization of books (manuscripts and printed). Page | 22 CURRENT STATUS • A Program, for extracting few features has been developed. • The following features have been considered in the program : - Characters having parts below the line. - Characters having part above the line. - Number of pixels in different quadrant. - Number of horizontal transitions. - Characters having closed loops. • Only individual characters have been considered instead of a full document. • Only characters written on a ruled page have been considered. • Characters written with black ink on a white page have been considered. • The following three models of neural network - Neocognitron - Radial Basis Function Network - Bi-directional Associative Memory Page | 23 FUTURE WORK AND PLAN OF ACTION • • • • NEURAL NETWORK – 5th January 2008 to 25th January 2008 - Selection of the NEURAL NETWORK to be used. - Training the NEURAL NETWORK. NOISE CONSIDERATIONS – 28th January 2008 to 15th February 2008 - Ink blots, scratched-out characters should not be recognized as characters. - Getting satisfactory results with Blurred images. REDUCTION OF LIMITATIONS – 20th February 2008 to 10th April 2008 - Characters not written on a ruled page should be recognized. - Reduction in the size limitations of the characters. - Numerical characters should be recognized. - Separation and recognition of accidentally joined characters. ORIENTATION CONSIDERATIONS – 15th April to 25th April 2008 - Slanting characters should be recognized. Page | 24 BIBLIOGRAPHY 1. Gonzalez , Woods ,Eddins ‘Digital Image Processing Using MATLAB’ - Fundamentals (Page no.-12) - Histogram (Page no.-76) - Special filtering (Page no.-89) - Morphological image processing (Page no.-334) 2. S.N.Shinvanandum, S.Sumathi, S.N.Deepa ‘Introduction To Neural Networks Using MATLAB’ - Bi-directional Associative Memory (Page no.-153) - Neocognitron (Page no.-318) - Radial Basis Function Network (Page no.-212) 3. James A Freeman, David M. Skapura ‘Neural Networks’ - Neocognitron (Page no.-373) Papers referred - Optical Character Recognition for printed Tamil text using Unicode by Seethalakshmi R., Sreeranjani T.R., Balachandar T. - Handwritten Character Recognition By Miguel Po-Hsein Wu. - Hand-Printed Character Recognizer using Neural Networks By: Shahzad Malik. Page | 25 APPENDIX Tamil alphabet Vowels and vowel diacritics Non-standard consonant-vowel combinations Page | 26 Consonants Sample text in Tamil Page | 27