A C++ Neural Network that Learns to Recognise Diagrams

Authors Avatar

Biomimetics Assignment 2:

A C++ Neural Network that Learns to Recognise Diagrams

Author: Daniel Rose                                                Date: 4/12/02

F. A. O: Dr A. Bowyer

Summary

An investigation was carried out to ascertain the usefulness of Artificial Neural Networks.  A program written in C++ was used to model a simple feed forward back propagation network.  Experiments were carried out to test the systems ability to cope with noise, the effect of training it more than once on a particular set of noise levels, and the ability to recognise different patterns.  The network performed well on data at moderate noise levels and was not really affected much by the amount of training it received, as long as it received some. It proved very good at recognising different patterns; there is no reason why it can’t be trained to recognise any pattern at all.

Introduction

An investigation has been carried out on the usefulness of Neural Networks.  Only one particular network has been studied, which was modelled in the C++ programming language by Daniel Franklin; it is used to recognise diagrams or patterns.  The network is known as a three layer back propagation type; the meaning of this is explained later.  As part of the investigation, the network was trained, using a random noise generating function to vary the pattern slightly each time.  The patterns used were two dimensional grids of ones and zeros, depicting horizontal, vertical and diagonal lines.  Its capability was tested by presenting it with a pattern after training and seeing if it recognised it.  These processes were then automated, so that the network could be trained and tested many times, producing a series of results, from which graphs were produced.  The amount of noise was automatically changed for training and testing, increasing from no noise at all to some suitable value; the maximum noise level being 100.  Finally, the patterns were changed, to find out how successful the network is at recognising different patterns.

Background and Theory

This investigation is based on and artificial neural network (ANN).  These are greatly simplified models of the human brain, but much, much simpler. The human brain typically has around 1011 neurons, ANNs typically have no more than a few dozen [1].  However, they can still be extremely useful.

When modelled on a computer they tend to be quite slow to learn, this is partly because an ordinary computer is a serial machine, whereas a neural network runs in parallel.  This means the operations of the network must keep running back and forth, slowing the whole process down.  Maybe one day we will have ‘quantum computers’ which will run processes in parallel, making the use of neural nets much more effective.

As a neural network is a greatly simplified model of the brain, an artificial neuron is a greatly simplified model of a real one.  These are often called perceptrons and contain 2 inputs and a bias.  Each of the inputs and the bias is connected to the main perceptron by a connection weight. This is generally represented as a real number between 0 and 1. When an input number is fed into the perceptron, it is multiplied by the corresponding weight [2].  This forms the basis of ANN learning; every time the network is fed information it modifies the connection weights, certain inputs become more likely to follow certain paths, and give certain results. When the correct result is obtained the network increases the appropriate connection weights.

Join now!

Procedure

The investigations were carried out in three stages:

  1. Firstly the program was altered to work out its percentage success rate of recognition of three patterns automatically as the noise increases from 0 to a suitable value then output the results to a file.  The patterns tested were of horizontal, vertical, and diagonal stripes as figure 1 shows:

0 0 0 0 0 0                0 1 0 1 0 1                0 1 0 1 0 1                 

1 1 1 1 1 1                0 1 0 1 0 1 ...

This is a preview of the whole essay