Surveyor Robotics Journal
   



email:
support@surveyor.com

web:
Surveyor Corporation

rss:
Subscribe

Archives
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
Februray 2006
January 2006

       
Sun, 01 Feb 2009

Neural Net Engine for Surveyor SRV-1 / SVS

This long-awaited projected, which started two years ago, is finally reaching fruition. As discussed on the Surveyor Robotics Forum, neural net code is included in the latest firmware build (020109 or later).

Initially, we are using the neural net for pixel pattern matching. We are using 8x8 pixel patterns, and there are 16 pre-programmed patterns which are easily changed, e.g.

unsigned char npattern[NUM_NPATTERNS * 8] = {
0x18, 0x7E, 0x7E, 0xFF, 0xFF, 0x7E, 0x7E, 0x18, // #0 solid ball
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // #1 solid square
0x18, 0x18, 0x18, 0xFF, 0xFF, 0x18, 0x18, 0x18, // #2 cross
0xFF, 0xFF, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, // #3 box
0x18, 0x7E, 0x66, 0xC3, 0xC3, 0x66, 0x7E, 0x18, // #4 circle
0xC3, 0xC3, 0x24, 0x18, 0x18, 0x24, 0xC3, 0xC3, // #5 xing
 ...
 ...
};

You can display a pattern (0-f) using the "nd" command, e.g.
nd5
##nd 5
** **                  ** **
** **                  ** **
       **            **
             ** **
             ** **
       **            **
** **                  ** **
** **                  ** **

You can replace a pattern using the "np" command
np57830303030307800
##np 5
nd5
##nd 5
     ** ** ** **
          ** **
          ** **
          ** **
          ** **
          ** **
     ** ** ** **

Look at font8x8.h and you'll find a full set of 8x8 ASCII patterns that would be suitable for replacing the pre-programmed patterns -



Once you have your patterns,

1. send "ni" to initialzed the network with random weights
2. then send "nt" to train the network on the stored set of patterns
3. then use "nx" to test the network against various patterns

For example, after adding the 'I' character as pattern 5, I tried
nx3030303030303030
##nx
0 0 1 0 0 97 0 0 16 0 0 0 0 0 0 5

and you can see that it matches best against pattern 5

The next step is to add the "nb" command for matching blobs against patterns. The blob needs to be scaled into an 8x8 pattern to match, and there is an issue with aspect ratios, as demonstrated here




These patterns will be okay, because they occupy the full width and height of a template. The problem will occur with characters such as 'I' or numbers such as '1' which don't occupy the full width, or '-' which doesn't occupy full height, and I am open to suggestion on how to handle this. Once we have scaling working properly, we can directly connect the blob search to the neural pattern matching. At that point, we will add functions to the built-in C and Scheme interpreters for accessing these features.

Posted Sun, 01 Feb 2009 13:15 | HTML Link | see additional stories ...