Wednesday, July 2, 2008

BNN v1

Bitmapping Neural Network (version 1) is a simple neural network that I prototyped after reading an introduction to artificial neural networks (ANNs). The idea behind the project is to explore ANN fundamentals by creating a neural network which exrapolates patterns from bitmaps.

Version 1 (Source) is comprised of two main classes, NeuralNet and Neuron, and one utility class, BitmapUtil. In this initial version, the neural network's capabilities are limited to downscaling (resizing) a perfect square 0/1 bitmap. As an additional restriction, all input bitmaps must be an integral constant ratio larger than the expected output (i.e. all input bitmaps must be the same size).

To test BNN v1, I ran 4 teach cases, followed by 5 use cases on the same NeuralNet instance. Each case had an expected output length of 10 (i.e. a 10x10 output bitmap), and an input length-ratio of 2 (i.e. a 20x20 input bitmap). The results of the test were interesting because the code knows nothing of resizing algorithms; and, yet, it was still able to accurately resize a bitmap with multiple patterns (use 4) and nested patterns (use 5). The teach cases were interesting precisely because they were uninteresting--four very simple patterns allowed accurate behavior for more complex input.

Of all the teach cases, however, none taught non-zero data to the neurons which correpsonded to the outer-most bits of the output bitmap. Thus in any use case involving non-zero input data for those neurons the output bitmap will be incorrect. This omission exposes the obvious limitation of neural networks: they are only as smart as their teaching mechanism (in this case, handcrafted sample data). Future work for the project will probably involve addressing this limitation, among other things.

0 comments: