Skip to content
Marek Sedláček edited this page Oct 25, 2021 · 8 revisions

Abstract Evolution

Abstract Evolution (AE) is an application using genetic programming to create abstract renderings of passed in images (which can be other abstract art or even photographs).

How to use AE

Once you open up the app (for information on how to run the app see readme file) you can simply click on the "Upload button" in the middle of the screen and pick image file to evolve into. In the main screen in the top bar you can also change language or open up another window (be aware that you should not have more than 5 project windows open from one application, because QT5 will hide some when exceeding this amount). After picking an image the "Evolution parameters" window should open on its own (if you closed it, you can open in from the "File" > "Evolution parameters" menu at the top bar). You can then adjust the evolution parameters (to get to know what each parameter does see further section) and hit "Start Evolution". Once the evolution is started the window displays a text about evolution taking some time, in this part all the structures and phenotypes are being initialized, once the progress bar shows up, this means that the evolution iterations had started. Be patient, the initialization itself might take quite a long time and then the iterations might be lot faster or other way around. In this part there is a chance that your OS might shadow out the window and display message that AE is not responding, this is a known "bug" caused by the evolution running in the background and not updating the GUI, which makes the OS think that the program is stuck, but it's not (in 99 % in the other 1 % it might have crashed, but this can be seen in the terminal window or by seeing that the progress bar was not updates, even though it should have been).

Be aware that AE takes quite a long time to evolve into an image with good fitness (resemblance) when used on high resolution image. This is also constrained by the evolution parameters set (see further section).

Evolution parameters

Here are the evolution parameters described as well as their complexity to give you some estimate on how long could your evolution be (long, short), but this is best found out by using the program. There are also some "recommended values", don't take these like something you should go by, use your artistic feel based on experimenting with the app, sometimes you might want way lower or way larger values to get the evolution to create some aesthetic. So these values are here just for your first steps with the program.

Iterations

Amount of iterations in one evolution to be done. Each iteration evolves all the phenotypes.

  • Recommended values: 300-700. Based on the image size and what precision wants to be reached.
  • Time complexity: It's complexity is affected by the other attributes because all of those are done Iterations amount of times.
  • Abstraction (precision): The bigger value to more precise (less abstract) the evolved image will be.

Population size

Amount of phenotypes in a population. There is only one population for each run (for fitness function cannot overcome artists judgment).

  • Recommended values: 100-400.
  • Time complexity: Initialization is heavily affected by this as each phenotype in the population needs to be initialized and since each phenotype contains image with the size of reference image, that makes the reference image size affect this as well. On top of creating image they might also be initializing and drawing seeds (if enabled). In iterations this attribute once again time is affected by this as for each phenotype fitness function needs to be computed as well as mutations and crossovers.
  • Abstraction and precision: The bigger amount the bigger chance that more precise image will be found.

Random colors

If this is checked, then colors for each phenotype will be picked at random.
If this is not checked, then colors will be picked from reference image from random positions.

  • Recommended values: Checked for more abstract and less precise output, unchecked otherwise.
  • Time complexity: There should be only a very little difference between checked and unchecked. Checked should be unnoticeably faster.
  • Abstraction and precision: Unchecked is more precise.

Unique colors

If this is checked then no 2 phenotypes can have the same color. Be aware that this might case infinite loop if the amount of unique colors in the image is less than Population size.

  • Recommended values: Checked for more precise output, unchecked otherwise.
  • Time complexity: When checked this might affect the time, but not too harshly as multiple color pics might be done when picked color was already picked by other phenotype. Population size affects this as well as this is done for each phenotype in population.
  • Abstraction and precision: Checked should result in more precise output.

Evolve lines

When checked lines from seeds will be evolved.
Checking this will enable line settings.

  • Recommended values: Depending on the wanted output.
  • Time complexity: Depends on the other line settings, but should take longer to initialize.
  • Abstraction and precision: When checked then (depending on other settings for lines) there should be more objects, might cause higher abstraction or not.

Grow seeds during evolution

If checked (and Evolve lines is checked) then line seeds will be grown out in each evolution iteration. If not checked, then seeds will be grown in the initialization stage.

  • Recommended values: Unchecked for possibly more precise output.
  • Time complexity: When checked, then iteration will be affected. When unchecked, then initialization stage will be affected by this. This is also affected by Population size.
  • Abstraction and precision: Unchecked might cause more precision, but less abstraction.

Maximum line seeds

The biggest amount of lines there can be.

  • Recommended values: 5-30. Depending on the wanted output and reference image.
  • Time complexity: The bigger value the longer initialization or evolution might take (based on Grow seeds during evolution).
  • Abstraction and precision: Higher value should cause more abstract output.

Minimum line seeds

The lowest amount of lines there can be.

  • Recommended values: 0 so that evolution might or might not use it.
  • Time complexity: The bigger value the longer initialization or evolution might take (based on Grow seeds during evolution).
  • Abstraction and precision: Higher value should cause more abstract output.

Maximum line width

The biggest possible line width in pixels.

  • Recommended values: 20-60. Based on the reference image resolution and content.
  • Time complexity: The bigger the line the longer it takes to render it, but it is not that time constraining.
  • Abstraction and precision: Depends on wanted output.

Minimum line width

The lowest possible line width in pixels.

  • Recommended values: 5-15. Based on the reference image resolution and content.
  • Time complexity: The bigger the line the longer it takes to render it, but it is not that time constraining.
  • Abstraction and precision: Depends on wanted output.

Minimum line length

Lowest possible line length in pixels. This only does something when Grow seeds during evolution is unchecked.

  • Recommended values: 10-100. Based on the image resolution and reference image.
  • Time complexity: The bigger the value the longer might initialization take.
  • Abstraction and precision: Depends on wanted output.

Direction change chance

Chance (in %) that a line will in each grow change direction.

  • Recommended values: 0 % for straight lines, bigger value for possibly bended lines.
  • Time complexity: This does not affect time complexity as the check is always done.
  • Abstraction and precision: Higher value might result in more abstract output as the line might do lots of turns.

Elitism

When checked this ensures that the image's fitness cannot get worse with more iterations. Meaning that the best phenotype will not be changed in next iteration.

  • Recommended values: Checked.
  • Time complexity: This does not affect time complexity.
  • Abstraction and precision: Checked for more precise output.

Crossover

What portion (in %) of the population should be crossed over with other phenotypes.

  • Recommended values: 40 % - 70 %.
  • Time complexity: The bigger percentage the longer it takes (more crossovers are done).
  • Abstraction and precision: Low value should result in less precise output.

Mutation chance

Chance that a phenotype will be mutated. Mutation means that a new colored (based on Random colors) object will be rendered to the phenotype's image.

  • Recommended values: 5 % - 15 %.
  • Time complexity: The higher the value to more time consuming this should be, but the overall complexity isn't too high.
  • Abstraction and precision: This might cause more or less precision.

Fitness function

Fitness function is what tells how much the image resembles the reference image.

  • Recommended values: UPM (Uniform point match)

CH (Color histogram)

Uses color histogram over the whole image. The sum of differences with reference image's histogram is used as the final fitness value.
This function does not take the position on objects into account, but only the color similarity to reference image.

  • Time complexity: Very fast method.
  • Abstraction and precision: Abstract.

UPM (Uniform point match)

This function places Amount of points points on the image of size Point size and also to reference image, then it subtracts them and sums up the absolute values resulting in pixel color difference sum, which is used as the fitness function.
Unlike CH this takes object positions into account and also their color.

  • Time complexity: Very slow method.
  • Abstraction and precision: Very precise.

RPM (Random point match)

Same as the UPM, but points are placed in images at random positions (same in phenotype and reference of course).
This approach might cause even more precise output in some cases when randomness picks more points in places where there is higher density of objects. But it might also pick badly.

  • Time complexity: Very slow method.
  • Abstraction and precision: Precise.

Amount of points

How many points in UMP or RMP will be placed in the images and compared.

  • Recommended values: 200-500. Based on the picture resolution.
  • Time complexity: The bigger the number the more time consuming. Also affected by Population size, because every phenotype will be compared using this method.
  • Abstraction and precision: More points for more precise output.

Point size

Size of the comparison point in RMP or UMP.

  • Recommended values: 2-4.
  • Time complexity: The bigger the point the more time consuming.
  • Abstraction and precision: Bigger points should cause less precise output, but this is affected by the amount of points.

Match only same colors

Only when the point exactly (to a difference set by Maximal color difference) matched with the reference image it is then set as a match in the fitness function, otherwise it is as if the pixel was the most different it can be.

  • Recommended values: Checked for more precise output.
  • Time complexity: When checked this affects each comparison's time complexity.
  • Abstraction and precision: Checked should be more precise color-wise.

Maximal color difference

When Match only same color is checked, then this value is what makes the pixel be matched or not.

  • Recommended values: 15-60.
  • Time complexity: For 0 an optimized version is used, otherwise slower method is used.
  • Abstraction and precision: Higher value should be less precise color-wise.

Update image every x %

How often should GUI be updated with the currently best phenotype.
Percentage is taken from the number of iterations.

  • Recommended values: 10 % for when sometimes checking on the evolution. 1 % for when wanting to watch the evolution happen. 100 % when wanting to run the evolution in the background and not check on it.
  • Time complexity: The lower the value the more time complex this is, because more often image has to be rendered, but the overall complexity isn't too bad.
  • Abstraction and precision: This does not affect evolution, but GUI and is only for the artist.