Industrial Strength Evolution, Genetics, and AI
By: Dan Lovy
Tags: Artificial Intelligence, Technology, Cellular Automata, Neural Networks, Genetic Algorithm

Commercializing Genetic Algorithms | Towards AI

Bringing Scale and Commerce to Genetic Algorithms

Using genetic algorithms in commercial AI applications has taken a back seat to deep learning neural net technologies. Machine learning has captured all the headlines and the experiments of a few years ago are now real-world applications. This has not happened with genetic algorithms. They are certainly a lot of fun to play with. On a quick YouTube tour you will find examples that play Flapping Birds, Mario Brothers, drive cars and get both simulated soft and hard-bodied creatures to walk. How do we make the same transition from science experiments to industrial practice? Any commercialization is going to require this level of rigor.

We theorize about applying genetic algorithm techniques to AI. Can we evolve meaningful solutions that compare to the results being achieved by more commercial machine learning technologies? You can evolve very simple and small scale experiments. It is great fun to evolve a solution to playing a video game, however, where do those experiments lead?

You run into a wall when you start to think about genetic algorithms at a commercial scale. The idea that you can take a few hundred thousand simulated neurons, design a great fitness function, let it percolate overnight and get something as smart as an ant simply doesn’t work. It clearly does not work on a more complex brain (no disrespect to the ant brain). We can’t even simulate the few hundred neurons in a worm.

HERE is a great list of animal species and their neuron counts. The aforementioned ant brain has about 250,000 neurons. A modern Nvidia GPU has enough horsepower to simulate a network of that size. I have a poorly implemented neural simulator, running on a 5-year-old laptop that clocks in at processing one million fake neurons per second.

How do we take genetic algorithm technology and ideas and push it to a level of scale we see in nature?

It’s About Process

Genetic algorithms are attempting to be inspired by nature. We create phenotypes, genotypes, and chromosomes. We simulate genetic breeding (crossovers) and invent ways to determine ‘organism’ viability and breeding likelihood. It doesn’t function exactly like nature, but this inspiration does yield results.

There is a part of the natural inspiration that is missing. The history is missing. A typical GA experiment involves creating the mathematical model for the problem, creating a chromosome representation and a ‘fitness function’ that decides who gets to breed. You fire it up and see what emerges.

Human beings are specialized fish. Much of what we carry around inside trace back to our watery ancestors. Our brains are the same. We have layers and parts that have been passed down to us. The reason we run from danger and want to mate is driven by our amygdala. We’ve had that since we were all lizards.

Our model for GA development is not taking this into account. We run our experiments, get fun and sometimes useful results, then start over. That is a fundamental problem that limits scale.

An Evolution Platform

I’m going to take off my evolutionary biologist hat (I am a naive amateur) and put on a software engineering hat (fits better). This cries out for a platform solution. There is a need for a consistent platform. We are seeing that emerge in machine learning (TensorFlow, Google.ai, FaceBook’s FAIR). Matlab has GA tools available and there are a few other tool kits. However, there are no large scale platforms focused on neural simulation, genetic algorithms, and this historical component.

Key Features:

A set of standard interfaces and methodologies. Let’s define the basics of how a neural simulation works. We can create a definition of the chromosomes including how to vary it. You can imagine a standard mechanism for defining fitness functions. The ability to base work on past work. Nervous systems and parts of the nervous system can be used and reused. Artificial brain source control should show lineages and the kind of branching you see in nature. Each experiment does not begin from scratch. An environment for multiple and disparate contributions. The software world already knows how to do this. We need to create a repository of code (fitness functions, simulated environments, connection to other systems, GA rules, etc.) and evolved data sets that can be used by the community.

Prototype Environment

To test some of these ideas, I have built an experimental platform. There are links to demonstration videos at the end as well as the source code. This project is not meant to form the basis of any system but to test out ideas for how to build such a platform. I apologize in advance to anyone looking through the code. I have been out of the coding scene for 15+ years, so my skills are a bit rusty and my tool choice might seem quaint and very old school. Everything has been done in C++, MS Visual Studio 2017 and targeted as a Windows desktop app. A real platform would take a more modern approach. Consider this an invitation for others to join.

In this experiment, I have evolved creatures ranging from simple filter feeders to ones that swim around and can avoid objects. This prototype platform features a general purpose GA platform, a simple neural simulation model and data management tools.

Step One — A GA Platform

I first developed basic frameworks for creating controls and displaying results. I then implemented a basic set of C++ objects that can execute genetic algorithms. To test this, I had it solve the Traveling Salesman Problem.

The goal was not to solve this problem but to create and test the scaffolding needed to build a larger platform. This object set allows for the overloading of things like; the fitness function, crossover methods, breeding selection, and chromosome design. The platform retains the ability to run the TSP.

Step Two — Design a Neural Simulation Environment

The video presentation goes into greater detail. A brain is made up of a set of neurons and connections that behave in a very simple fashion. Each neuron simply determines its state by summing its inputs. This sum is then passed on to the next neurons it is connected to.

A chromosome for the purposes of GA is simply a pointer to a simulated synapse. A synapse has a start neuron, an end neuron and a polarity (plus or minus). Evolution occurs in the recombination of this list of synapses, not neurons. This may need to be revisited. The resulting neural simulator if fast and small. As stated before, I get a performance of about one million neurons per second before I’ve optimized any of the code. I am currently adding the ability to have nodes on this network reference other networks.

Step Three — Let Nature Take Its Course

I layered this neural simulation environment on to my GA platform and began to evolve little creatures. I created little filter feeders of varying sensory capability and creatures that can swim around and navigate obstacle courses. Again, check out the videos at the end to see these in action.

One of the key aspects of this experiment was to embody a historical approach. Each creature is not the result of a stand-alone experiment, but a collection of stepwise evolutionary successes.

This is a picture of all the filter feeders, called critters that I evolved. They all share bits of neural hardware that were evolved earlier. Each one more capable of sophisticated food sorting and based on a previous and successful organism.

My swimming creatures, called guppies, feature movement and eyes that can detect objects in a simulated world (Episode 2 — Video). My plan is to see if I can take this basic brain and add an associative learning capability, post-evolution.

Interested?

Building commercial applications and solving larger AI problems using evolution and genetic algorithms are going to take an industrial platform approach. My goal is to start that conversation.

You can follow the journey and sign up for updates etc at danlovy.com/critter

Facebook group:

Bio — A.I.

Episode One features a full description of the platform and first creatures: https://www.youtube.com/watch?v=BaAqFHr0nts

Episode Two features the swimming guppies: https://www.youtube.com/watch?v=0D6B1sU_Fiw

Episode Three features a more capable swimming creature: https://www.youtube.com/watch?v=Z6fmkZW9JCM

Some of the funniest YouTube videos featuring GA solutions: Mario, Soft Body Creatures, Driving Car, Flapping Birds. There are dozens more.