• No results found

4.6 Colour molecule optimisation

4.6.4 Avoiding premature convergence

The genetic optimisation technique allows the search to range widely within the solution space and will frequently result in good solutions. However, it has its own set of

15

Note that the tweaking of the real colour scheme that follows the optimisation allows the user to rotate the wireframe and so change the hues, so this restriction is only temporary.

disadvantages. For example, the derivation of solutions is opaque. While the logic underlying the genetic optimiser is well-defined, the system operates as a “black box”, with no explanatory power regarding the derivation of any single solution.

A more significant problem relates to the stochastic approach – there is no guaran- tee of convergence to a good solution. This is partially addressed by selecting parents in proportion to their fitness. However, if there is insufficient randomness left in the cur- rent population, the randomness induced by mutation may be insufficient to allow the optimiser to escape from a poor solution. This is known as premature convergence, and can be addressed by introducing more variability into the population. Two methods are commonly used. The first is to forcibly introduce significant randomness into the pop- ulation and restart the optimisation, which introduces diversity while preserving some of the good solutions. The second is introduce some diversity into the population by introducing good candidates from another population. An example of this technique is that of “island crossover” or “niching” Marsland (2009). The name “island crossover” is an analogy for the situation in which two populations of a biological species have evolved separately on different islands, but occasionally, some members of one popula- tion travel to the other and introduce some genetic diversity. However, introducing a strong member of one population into a weaker and genetically less diverse second pop- ulation introduces the risk of both populations converging to the same (or substantially similar) solutions. As the express reason for maintaining multiple separate populations is to generate different colour schemes – to maintain diversity – island crossover was not used. Instead, to enable the optimiser to recover when progress had stalled, the dynamic restart algorithm (Solano and Joyner, 2007) was used. This monitors the change in fitness of the best scoring scheme in each population and, if no progress has been made for a preset number of generations, atoms within the population are ran- domly coloured and the optimisation restarted. This significantly reduced the number of stalled optimisations.

In the prototype implementation of the Colour Harmoniser, the string representa- tion of a colour molecule used by the optimiser is (x1, y1, z1. . . xn, yn, zn), where each

(x, y, z) is the real16 position of a colour atom in abstract colour space. There were ten independently optimised populations, each of which had 100 members, 80 of the each population had the colour atom on the wireframe in various orderings, and in the remaining 20, the colour atoms were positioned randomly. The crossover points were randomly selected between atoms and therefore only crossover complete atom positions. The mutation rate was 5%: that is, each molecule in a generation has 5% chance of being mutated17. Both elitism – copying the best four solutions – and tour- nament selection were used when creating the next generation. Although the number of iterations required for the optimisation to converge varies depending on the num- ber of colour atoms, the number of user-defined constraints and the wireframe shape, typically 100 to 150 iterations is sufficient.

As an illustration of the variability within a population, four schemes from a single

16 therefore this is a real-valued genetic optimiser, not one that (directly) uses bit-strings. 17

with the resulting atom position being scaled if necessary to lie inside the unit sphere in the abstract colour space.

unoptimised population are shown in figure 4.11. As can be seen, in the top ranking scheme, the colours are pleasant, but the readability is poor. The best random scheme has good readability and all the elements are clearly distinguishable, but the lack of coherence in the scheme results in a poor wireframe alignment score (0.17) and the garish use of colours results in a poor colour balance score (0.19). After optimisation, the best scoring schemes are free of these defects, as can be seen in the two top scoring schemes shown the lower two schemes in figure 4.11.

The variability in the resulting ten optimised schemes can be seen in figure 4.12, which clearly shows how, even with colours constrained to a wireframe, significant differences in overall appearance can result.

The lowest scoring molecule with atoms on the wireframe from an un- optimised population (score of 2.38).

The highest scoring molecule with atoms on the wireframe from an un- optimised population (score of 3.28).

The lowest scoring of the random ar- rangements from an unoptimised pop- ulation. The scheme has poor contrast and little coherency in the underlying colouring (score of 1.68).

The highest scoring random scheme from an unoptimised population. This has better contrast (score of 2.2).

After optimisation, the top scoring scheme from one of the ten populations (score = 3.76).

After optimisation, the top scoring scheme from another of the ten pop- ulations (score = 3.70.)

Figure 4.11: The top four images show colour schemes from a single population before optimisation: some molecules have the atoms spaced evenly on the wireframe (top row), and some have the colour atoms positioned randomly in the colour space (middle row). As can be seen the schemes have different mixes of readability, distinguishable elements, and pleasing colour schemes, and some are more usable than others. This is reflected in their fitness function scores (out of 4). After optimisation, as shown by the schemes in the bottom row, readability has improved, all the items are distinct, and the saturation of colours is appropriate to their area.

Figure 4.12: The ten colour schemes resulting from optimising ten different populations, all using hues defined by the current wireframe rotation angle. The images illustrate the diversity of schemes possible using the same underlying colours. The basis for all of these colour schemes is a split-complementary wireframe augmented to allow the positioning of items on the black-white axis. All would be suitable for online use.