Surveyor Robotics Journal |
|||||
|
email:
web:
rss: Archives |
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 ... |
||||