java neural network
Forum  |  Blog  |  Wiki  
Get Java Neural Network Framework Neuroph at SourceForge.net. Fast, secure and Free Open Source software downloads
      

RECOGNITION OF BRAILLE USING NEURAL NETWORKS

By Stefan Risteski, Faculty of Organization Sciences, University of Belgrade

An experiment for Intelligent Systems course

 

Info

In this experiment I have used Neuroph Studio to overcome problem of text recognition.

 

Problem

Our main goal is to train neural network, to be able to recognize which character of Braille alphabet is inputed. For our testing we will use Serbian Cyrilic Braille alphabet.

 

Solution

As each letter is represented by six dots, we will have a matrix of dimension 3x2. Each element of the matrix represent one input. We will have 6 inputs, for each dot.
As far as output, the number will vary depending on the architecture. There are 3 different architectures(solutions)!

Inputs

1. Dot1,1 2. Dot1,2

3. Dot2,1 4. Dot2,2

5. Dot3,1 6. Dot3,2

 

Implementation

For inputs, we will use 1(„dot is raised“) and 0(„dot is not raised“). For outputs we will also use 1 and 0. All data is type of boolean, so there is no need to normalize data before training.

 

Training and Testing Network

For network training, ie. 80% of randomly selected Braille letters will be used. Of the other 20%, 100% will be used for network testing. In tables will be shown 50% of the data that best represent, if network can recognize data with which has not worked until then.

 

I. First Arhitecture

First architecture is designed to be as simple as possible. Each Braille character, or cell, is made up of six dot positions, arranged in a rectangle containing two columns of three dots each. So, we will have 6 inputs, for every dot. A dot may be raised at any of the six positions to form sixty-four (26) possible subsets, including the arrangement in which no dots are raised. For reference purposes, a particular permutation may be described by naming the positions where dots are raised, the positions being universally numbered 1 to 3, from top to bottom, on the left, and 4 to 6, from top to bottom, on the right. For example, dots 1-2-5 would describe a cell with three dots raised, at the top and bottom in the left column and on top of the right column, i.e., the letter M. With 25 combinations we can represents 32 characters, and our alphabet have 30. Instead of a neural network has 30 outputs, for each letter of the alphabet separately, the network has only five outs. Outs are coded with 0 i 1.

Inputs

1. Dot1,1 2. Dot1,2

3. Dot2,1 4. Dot2,2

5. Dot3,1 6. Dot3,2


Coded Outpusts

A = 00001; Б = 00010; В = 00011; Г = 00100; Д = 00101; Ђ = 00110; Е = 00111; Ж = 01000; З = 01001; И = 01010; Ј = 01011; К = 01100; Л = 01101; Љ = 01110; М = 01111;
Н = 10000; Њ = 10001; О = 10010; П = 10011; Р = 10100; С = 10101; Т = 10110; Ћ = 10111; У = 11000; Ф = 11001; Х = 11010; Ц = 11011; Ч = 11100; Џ = 11101; Ш = 11110;

After many hours of testing, it was found that the network must contain a minimum of 7 hidden neurons. Interestingly enough, the number of neurons in the hidden layer correspond to recommended formula for number of hidden neurons (number of inputs + outputs)/2+1. With a smaller number of hidden neurons, independent of the other parameters, the network was unable to process the data for training. The complete data set (data_set5), the data set for training (test_set5), and a set of data for testing (training_set5), can be seen in the attached .txt files.


First set of parameters:

Results:

Graph:

Testing:


The network was tested with 3 random set of inputs. Coded results indicate that the network, in the first case, roughly generates the desired output, by which it can be concluded that 5th letter of the alphabet, D, was inputed.


Second set of parameters:

Results:

Graph:

Testing:


The network was tested with 3 random set of inputs. Coded results indicate that the network is unable to generate the desired output, for data with which has not worked before. The results are rounded to three decimal places.


Third set of parameters:

Results:

Graph:

Testing:


The network was tested with 3 random set of inputs. Coded results indicate that the network is unable to generate the desired output, for data with which has not worked before. The results are rounded to three decimal places.


 

II. Second Arhitecture

Unlike the first architecture where the goal was simplicity, in this architecture, the emphasis was on functionality. Neuro network consists of 6 inputs and 30 outputs for each letter of the Braille alphabet. A letter was represented as output vector {1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}, the letter B as output vector {0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}. As can be seen from the attached, the 1 is moving through the vector for one place, and the index on which the 1 is found indicates the ordinal number of the letter in the alphabet.

After many hours of testing, it was found that the network must contain a minimum of 7 hidden neurons. With a smaller number of hidden neurons, independent of the parameters, the network was unable to process the data for training. The complete data set (data_set30), the data set for training (test_set30), and a set of data for testing (training_set30), can be seen in the attached .txt files.


First set of parameters:

Results:

Graph:

Testing:

The network was tested with 6 inputs, of which 3 have shown which best represent if the network can work with data which is not seen until then. Results indicate that the network is unable to generate sufficient output for the data that has not worked before, except in the first case when the network is wrong for one index, and displays the letter Ј(J) insted letter И(I).


Second set of parameters:

Results:

Graph:

Testing:

The network was tested with 6 inputs, of which 3 have shown that best represent that the network can work with data that is not seen until then. Rrezultati indicate that the network is unable to generate sufficient output for the data that has not worked before, but in another case when the network is wrong for two of the index, and displays the letter З(Z) instead of the letter И(I).


Third set of parameters:

Results:

Graph:

Testing:

The network was tested with 6 inputs, of which 3 have shown, which best represent that the network can work with data that has not previously worked for. Results indicate that the network is unable to generate sufficient output for the data that has not worked before, except in the first case when the network is wrong for one index, and displays the letter Г(G) instead of a Д(D), as in the other case when the network mistaken for the two indexes, and displays the letter О(O) instead of Р(R) letter.

 

III. Third Arhitecture

The third architecture is designed to work with images, instead of working with numeric values. This architecture should provide the basis for developing software which use neural networks to recognize Braille letters. Each image can be represented as a two-dimensional array, where each element contains color information for exactly one pixel. Each color can be represented as a combination of three basic colors: red, green and blue. To represent an image in RGB color system, we use three-dimensional array, each for one of the primary colors.

Red pixel at location [100] [50] represented in RGB system have values [255] [0] [0].
redValue [100] [50] = 255;
greenValue [100] [50] = 0;
blueValue [100] [50] = 0;

Green pixel at location [50] [150] represented in RGB system have values [0] [255] [0].
redValue [50] [150] = 0;
greenValue [50] [150] = 255;
blueValue [50] [150] = 0;

Blue pixel location [150] [150] represented in of RGB values [0] [0] [255].
redValue [150] [150] = 0;
greenValue [150] [150] = 0;
blueValue [150] [150] = 255;

The dimensions of each array are [imageHeight*imageWidth], which also represents the number of pixels. Since each pixel should contain information about the three basic colors, we obtain a array of dimensions to be [imageHeight*imageWidth*3]. This array can be understood as a series of arrays, whose elements are the values of red, green and blue. All we have to do is to turn it into a one one-dimensional array that is vector. Now, this vector can be used as input to the neural. The most appropriate type of neuralnetworks for such tasks is a Multi Layer Perceptron.

 

Creating a neural network

To create a neural network for image recognition, it is necessary to first create a new project. Through the main menu File / New Project, or combination of keys Ctrl + Shift +N.

After that, it is necessary to make a neural network for image recognition.

Then we select a set of training data, and select an option Black and White, learning process will be faster in black and white than color.

After that is done, select the images that neural networks should not recognize. In our case the red, blue and green, because our images are black and white.

After that, we select the name of training set and size on which the images are reduced, for faster identification process


First set of parameters:

Results:

Graph:

Testing:

Testing was performed for the entire training set, and Total Mean Square Error is 0.146. The following table shows the probability with which the trained network recognizes the inputs, which areused for training, as well as those used for testing.


Second set of parameters:

Results:

Graph:

Testing:

Testing was performed for the entire training set, and Total Mean Square Error is 0.148. The following table shows the probability with which the trained network recognizes the inputs, which areused for training, as well as those used for testing.


Third set of parameters:

Results:

Graph:

Testing:

Testing was performed for the entire training set, and Total Mean Square Error is 0.144. The following table shows the probability with which the trained network recognizes the inputs, which areused for training, as well as those used for testing.

DOWNLOAD

All files used in project

Neuroph Image Tester Application

See also:

Image Recognition

Multi Layer Perceptron

 

      Java Get Powered      Java Get Powered                           Get Java Neural Network Framework Neuroph at SourceForge.net. Fast, secure and Free Open Source software downloads