Skip to content

NeuroEvolution

Neuroevolution, is a form of artificial intelligence that uses evolutionary algorithms to generate artificial neural networks (ANN), parameters, topology and rules.

Encoding the Neural Network

Evolutionary algorithms operate on a population of genotypes (also referred to as genomes). In neuroevolution, a genotype is mapped to a neural network phenotype. This process called "Encoding".

Direct Encoding

A direct encoding will explicitly specify everything about an individual. If it represents a neural network this means that each gene will directly be linked to some node, connection, or property of the network. This can be a binary encoding of 1s and 0s, a graph encoding (linking various nodes by weighted connections), or something even more complex. The point is that there will always be a direct connection between genotype and phenotype that is very obvious and readable. Examples :

  • Connection Matrix
  • Node based encoding
    1. Schiffmann node-based encoding
    2. Koza node-based encoding
  • Pathway based encoding
  • Neuroevolution of augmenting topologies (NEAT)
  • Simple feedforward network encoding
  • Layer based encoding

InDirect Encoding

An indirect encoding is the exact opposite. Instead of directly specifying what a structure may look like, indirect encodings tends to specify rules or parameters of processes for creating an individual. As a result, indirect encodings are much more compact. Examples :

  • Lindenmayer systems
  • Matrix rewriting
  • Cellular encoding
  • Cellular graph grammars

Note

each encoding type is useful for a type of GANN (Genetic Algorithm Neural Network) problem such us finding best weights, train the NN, update the architecture, etc ...

Basic algorithm

ne-algorithm

  1. Initialize N random networks to create our population (The encoding problem).
  2. Train all the NNs simultaneously or one by one.
  3. Calculate the “fitness” (how well it did in that iteration) of each NN. Fitness will be used to increase the chances of a NN “reproducing.” Higher the fitness, higher is its chance of reproducing (example of fitness : the training cost of NN → lowest cost is better).
  4. if the optimization criterion is not reached , make a new population
    1. Select 2 NN
    2. Crossover on them (depending on Encoding)
    3. Mutate on them (depending on encoding)
  5. go to step 2