Evolutionary Neural Networks in Processing

Project Owner

  • Jim Cook (ICT, TechLab)

Project Credits

  • Jim Cook (ICT, TechLab)

Start Date

3rd December 2017


Initial prototype delivered 4th December, 2017 Classroom delivery is ready for Semester 1, 2018.

Problem Statement

One of a series of Neural Network experiments in various languages, to understand the core types of Machine Learning that are becoming prevalent in industry and academia. This example leverages the processing language due to its reduced complexity and is based on the artificial intelligence concepts of Neuroevolution.

Final Brief

An Evolutionary Simulator developed in Processing using Genetic Algorithms.

This program generates 1000 creatures. The creatures are very simple and very very stupid. However, they get a lot smarter, very quickly, usually within a thousand generation.

Creatures have nodes (blobs of mass) and muscles (simple springs between nodes). Nodes have variable mass, speed and friction and Muscles have variable strength and speed. Most creatures in generation 1 will fall over. That’s just the way the Universe works.

Creatures also have 3 measures that define their fitness:

  • Distance travelled to the right.
  • Energy used.
  • Nausea induced.
  • By default only distance contributes to fitness, but any calculation of the three can be used (see documentation).

Over hundreds of generations, the elegant triangle usually rises to the top, but in some cases quadrupeds and wheels develop! That’s evolution!

You can adjust the following:

  • Gravity
  • Air resistance
  • The terrain. It’s currently irregular stairs, but for faster more satisfying creatures I recommend a flat plane.
  • Mutability of the creatures
  • The random seed
  • The complexity of the population (e.g. you can stop the pesky triangles from being in the starting population, but they might develop anyway!)

This demonstration will be used in Biology 1st year with approximately 2,000 students to demonstrate the “how and the why” of digital literacies scaffolded into their learnings.

Challenges & Learnings

  • C1. This is written in a single file (essentially), this is bad, especially when working with a memory hog like processing.
  • L1. In the future, modularisation will be key. However, this current example is deemed sufficient for a demonstration.
  • C2. While there are many tutorials for this kind of algorithm, there isn’t detailed explanation around the mathematics. This leads to a lot of “trial and error” to produce the desired changes.
  • L2. In-depth research and continued learning is the only way to become proficient in these types of algorithms. It is recommended that The TechLab curate a collection of the best explanations and lessons for this material.

Languages / Framework

Processing, Processing.js

Links to Resources