The Horny Fly
or How simple Neural Circuitry Can Give Rise to Complex Behaviour
The above applet is a demonstration of how a simple network of interconnected
neurons can give rise to a complex behaviour, such as chasing a stimulus in an
environment. It seems hard to believe that a network such as this, which
uses only a handful of neurons compared to 100 billion in our own brains
could exhibit such seemingly intelligent behavior.
This is an example of the neural net approach to artificial intelligence.
Since there are only 10 neurons in this network, it was possible to
implement them using parallel processing with java Threads instead of
simulating the process in a serial processing way. This more closely models
the actual human brain.
Using java, I defined a few classes of objects to build neural nets with.
The first class I defined was the Axon class. Each Axon contains a reference
to a Nucleus object, a type(either excitatory or inhibitory), and a strength.
It also has methods which allow the Axons to fire, which simulates putting a
certain amount of neurotransmitter into the synapse (based on the strength).
The source code for the Axon class is here.
The next class I defined was the Nucleus class. This is where the parallel
threads are implemented. Each nucleus has a reference to an array of axons,
and it keeps track of the simulated amount of neurotransmitter in the synapse.
When the amount of neurotransmitter in the synapse reaches a certain threshold,
the Nucleus will fire each Axon in its array of Axons. The source code for
Nuclei is here.
The next class I defined was the Network class. This class is where I
implemented the actual neural net which corresponds to my horny fly.
It has to Nuclei which correspond to the two wings ( a "fire" of those neurons
is essentially one flap of the flys wings), a hidden layer of 4 nuclei, and 4
"eyes" which fire when the stimulus lies in their visual field. All of these
nuclei are interconnected with Axons in ways which give rise to intelligent
behavior. The source code for this class is here.
The classes FlyApplet and Fly work together to simulate the
environment of the fly. They do things like move the fly accordingly
when its wings are flapping, turn the fly when one wing is flapping more
than the other and so on. These also tell the fly which visual field the
stimulus lies in so he "knows" which neuron to fire. This may seem
like cheating, like I'm "hard coding" the behavior into the program, but
this in effect happens to you and me when light hits our retina. Instead
of simulating light beams and bouncing them around the virtual environment,
I decided it would be easier just to let the fly know when a light beam
would have been intercepted by one of his censors. The sources: for
Fly, and for FlyApplet.
Playing around with the above applet (you can click the mouse to move the
stimulus) shows that the fly will always careen toward its stimulus, moving
back and forth until he finally reaches it. This is almost like the way a fly
buzzes back and forth in real life. Surely the neural network that is a fly's
brain is exponentially more complicated than this one, but it goes to show you
that a few neurons go a long way. It also shows us that with 100 billion
neurons, behavior would be very complex indeed.
This is certainly not the State-of-the-Art in Neural Networks. Todays
Neural nets have learning algorithms that allow neural nets to make
decisions based on its "training data". Companies can now have neural
nets that make decisions for them that do better than their human
counterparts. Kurzweil predicts that soon neural nets and genetic
algorithms will be so superior in their decision making to their human
couterparts that we will come to rely almost completely on such
technologies for decision making. While this is a staggering claim, it
doesn't seem like there will be any way around this outcome.
For more information, try these links:
Email: Matthew.Bridges@mail.trincoll.edu