Thursday, September 26, 2013

Using neural networks to identify patterns

In the previous entry, the basis for classifying our test images was the distance from the training images on the color versus shape plot. What I will be showing you now is the use of neural networks to actually train the computer in identifying the characteristics that I need from the set of images. The term "training" for the previous entry was loosely used, as I simply measured two parameters on the two sets of images and used them as reference points.

The artificial neural network toolbox of Scilab accepts different parameters for the training: number of iterations, tolerance, and learning rate.

Using the same set of data obtained by characterizing the "shape" and "color" of the petals of the blue plumbago (Plumbago auriculata) and galphimia vine (Galphimia gracilis), the following output was given by the ann_FF_run() function:

first sample: 0.5002511    
second sample: 0.5023937     
third sample: 0.5002258  

parameters:

  1. learning rate: 2.5
  2. tolerance: 1
  3. iterations: 700


If you'd remember, the first and third samples are of the blue plumbago and the second one is from a galphimia vine. The results indicate that with the given parameters, the computer was able to determine which of them come from a certain type of plant. Although the value given for the first and second differ only by as much as 0.002, we can say that the output is reliable, as the difference between the first and the third vary only by around 0.000025. The first difference is almost 100 times than that of the second. 

I tried to vary the number of iterations that the ANN toolbox would use, and found this result:
Figure 1. Plot of output versus the number of iterations for the training process. the blue triangle and star correspond to the first and third sample respectively and the yellow circle correspond to the second sample.

You'll see that at some point the outputs are higher for the blue samples than the yellow sample, and in the other the opposite is observed. For this to be applied on a completely unknown sample, we must first compare it to test sets to have a reference.

For this activity, I will give myself a grade of 10/10.

References:
1. A15 - Neural Networks. M. Soriano. 2013.

No comments :

Post a Comment