Draw the rest of the Hummingbird

Updated on Saturday, February 19, 2022

Generation three thousand of a genetic algorithm learning to draw a hummingbird

A genetic algorithm learns to draw a hummingbird:

The video is an animation of three thousand generations of evolution. It starts with a random mix of line segments which are then mutated by adding or removing lines and by changing the start, end and color of existing lines. Each generation has 32 individuals. The best individual is mutated to create the next generation.

For this implementation the best or fittest individual is the one with the least error on a pixel by pixel comparison to a stock art drawing of a hummingbird. Because I care more about the shape than completely filling in the drawing an error outside the figure is penalized three times more than a gap inside the figure.

Color is mutated each generation but not selected for, so it's just changing randomly.

Add your comment...

Related Posts

You Might Also Like

(All Etc Posts)

(Published to the Fediverse as: Draw the rest of the Hummingbird #etc #video #genetic #hummingbird Animation of three thousand generations of a generic algorithm learning how to draw a hummingbird. )