Fractal Evolver: Interactive Evolutionary Design of Fractals with Grid ...

1 downloads 0 Views 1MB Size Report
Abstract. Interactive Evolutionary Computing is a powerful methodo- logy that can be ... dependent on aesthetics, such as in the areas of art and music. Our pa-.
Fractal Evolver : Interactive Evolutionary Design of Fractals with Grid Computing Ryan D. Moniz and Christian Jacob Computer Science, University of Calgary, Calgary, Alberta, Canada {rdmoniz,cjacob}@ucalgary.ca http://www.swarm-design.org

Abstract. Interactive Evolutionary Computing is a powerful methodology that can be incorporated into the creative design process. However, for such a system to be useful, the evolutionary process should be simple to understand and easy to operate. This is especially true in applications where it is difficult to create a mathematical formula or model of the fitness evaluation, or where the quality of the solution is subjective and dependent on aesthetics, such as in the areas of art and music. Our paper explores this idea further by presenting a system that evolves fractal patterns using an interactive evolutionary design process. The result is a tool, Fractal Evolver, that employs grid computing and swarm intelligence concepts through particle swarm optimization to evolve fractal designs. Keywords: Interactive Evolution, Distributed, Parallel, Interface, Particle Swarm Optimization, Fractals.

1

Introduction

This paper demonstrates an application of how an interactive evolutionary process can be utilized to explore the numerous combinations and permutations of fractals [1]. It can be a challenging and daunting task to create, understand, and predict the design of a fractal from a set of parameters, especially considering the large range of parameters and values that are used for fractals in a recursive formula. It can be extremely difficult to observe a relationship between the parameters of a description of a fractal and what their corresponding effect entails. The fractal in Figure 1(b) results from slight parameter changes from the fractal in Figure 1(a). Comparing the fractals in Figure 1(a) and (c), the extensive modifications to the parameters have yielded major changes to the final rendering of the fractal. What is not apparent, however, is which parameters have the greatest or least effect on potential fractal designs. This is where evolutionary exploration and design tools, as our Fractal Evolver, become valuable. For the very same reasons, it is laborious to manually adjust parameters hoping that one may gain some understanding of how to steer or evolve fractals M. Giacobini et al. (Eds.): EvoWorkshops 2009, LNCS 5484, pp. 442–451, 2009. c Springer-Verlag Berlin Heidelberg 2009 

Interactive Evolutionary Design of Fractals with Grid Computing

443

Fig. 1. Effects of parameter mutation: The original fractal’s parameter settings (a), minor changes to 5 parameter values in (b), and major changes to 14 parameter values in (c)

towards a certain design. In this paper, we present an Interactive Evolutionary Computation (IEC) system that allows for the exploration and optimization of a parametric fractal system. We illustrate how Swarm Intelligence (SI) concepts in the form of particle swarm optimizers can provide assistance in discovering new designs, while also enhancing the design process of fractals. This paper is organized as follows: Section 2 discusses related works in this field with a focus on fractal flames and Particle Swarm Optimization (PSO). Section 3 explores our work on Grid Computing for efficient fractal generation. Section 4 presents our results thus far and discusses future expansions.

2

Related Work

Fractals can be described as shapes, where small sections of the fractal share a resemblance to the full shape (Figure 2). This concept demonstrates ‘selfsimilarity’ [1]. Fractals are created using an iterative formula where the output of the formula is redirected as input. Usually interesting patterns emerge from the use of fractal formulas as illustrated in Figure 3 . Fractals have been known for quite some time and have been thoroughly studied by scientists and mathematicians [1], [2]. 2.1

Fractal Flames

A new approach to creating fractals –“fractal flames”– was introduced by Draves as part of the “Electric Sheep” project [3]. In fractal flames an iterated function

444

R.D. Moniz and C. Jacob

Fig. 2. The fractal starts as a single square but changes after using two functions that transform, scale, and rotate. Three more iterations are performed using the same functions recursively [5].

Fig. 3. The evolution of a fractal flame from generation 0 to 5 using Fractal Evolver

system (IFS) is defined for polygons and a series of transformations (rotate, transform, and scale) is iteratively applied. The IFS mapping is defined by S = n n n ∪m i fi (S), where S ⊂ R and fi : R → R are the functions to be iterated. S, is the fixed point of a Hutchinson operator, where m functions fi are applied [4]. The diagram in Figure 2 shows the creation of an IFS from two affine functions. The functions transform the square shape into the shaded square. The merging of the two functions becomes the Hutchinson operator. Some examples of fractal flames created in this manner are illustrated in Figure 3. The genetic code for a fractal flame consists of 6 transformation functions with 6 affine coefficients, 7 variation coefficients and a weight value. This results in a model of 84 dimensions (6*(6+7+1)). In our project we use 103 parameters (Table 1) to evolve fractal flames. Some of these parameters are also shown in Figure 1. 2.2

Interactive Evolutionary Computation

In Interactive Evolutionary Computation (IEC) the mathematical formula model of the fitness evaluation is replaced or augmented by a human evaluator. Dawkins

Interactive Evolutionary Design of Fractals with Grid Computing

445

Table 1. The complete set of default parameters for creating fractal flames and their range values. Fields denoted by an asterisk (*) are created m number of times depending on the number of xForms specified. Parameter Scale Time Fractal Symmetry Brightness Gamma Gamma Threshold Hue Palette Selection Vibrancy Batches Estimator Estimator Curve Estimator Minimum Filter Filter Type Motion Exponent Oversample Temporal Samples

Min 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 1 0

Max 100000 10000 2 10000 100000 1 1 699 100000 59 5 1 1 1 13 59 59 59

Parameter Co-efficient 1X* Co-efficient 1Y* Co-efficient 2X* Co-efficient 2Y* Co-efficient 3X* Co-efficient 3Y* Post Co-efficient 1X* Post Co-efficient 1Y* Post Co-efficient 2X* Post Co-efficient 2Y* Post Co-efficient 3X* Post Co-efficient 3Y* xForms Symmetry* Weight* Co-efficient* Final XForm* Variation Type Number of xForms

Min -100000 -100000 -100000 -100000 -100000 -100000 -100000 -100000 -100000 -100000 -100000 -100000 0 0 0 0 0 1

Max 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 1 1 1 38 6

was one of the first to apply IEC to artistic design [6]. Naturally, this approach led to other visual IEC systems like Sims’ genetic art [7], or Latham’s Mutator [8]. A similar system to evolve fractals was made by Lutton called ArtiE-Fract [9] using an Evolutionary Algorithm and Evolutionary Strategies [10] to evolve fractals. At the time of Dawkins, Sims, and Latham computing resources were limited to a single computer, and the interface for evolution was constrained to selecting one individual to mutate. Our system utilizes the population dynamics of multiple potential solutions. Although one solution will be ranked the highest out of the entire population, the solutions that are ranked lower will still contribute to the evolution of the next generation of fractal designs. This is due to our choice to use Particle Swarm Optimization as our population-based search algorithm. 2.3

Particle Swarm Optimization

Particle Swarm Optimization (PSO) was inspired by the manner in which bird flocks move in synchronization and maintain their distance from neighboring birds [11]. In the PSO algorithm, each of the “birds” fly through an n-dimensional search space. To understand the PSO search dynamics, we illustrate the location update for the particles, each of which represents a solution in n-dimensional space. The particle location, Xn , and velocity vector, Vn , are updated for each subsequent timestep as follows: Xn (t + Δt) = Xn (t) + Vn (t) ∗ Δt

where

n = 1, .., N.

(1)

446

R.D. Moniz and C. Jacob

The velocity vector for each of the particles is updated by: Vn (t + Δt) = Vn (t) + c1 ∗ Random[0, 1] ∗ (G(best) (t) − Xn (t)) + c2 ∗ Random[0, 1] ∗ (Pn(best) (t) − Xn (t)).

(2)

The Δt parameter determines the discrete time interval for a particle’s movement, where higher granularity results in a larger area being searched in fewer time steps. Two attractive forces determine the direction of each particle: the (best) global best solution, G(best) , and the personal best solution, Pn . This process is performed for each element of the velocity vector. The uniformly distributed random numbers, Random[0,1], help the particle move through the solution space by randomly giving more or less emphasis to the global or personal best solutions, defined by the weight constants c1 and c2 , respectively. The key here is that the particles swarm around the solution space, gravitating towards the global and personal best solutions. The stochastic elements permit the particles to cover more of the solution space, while maintaining proximity to the best known solutions. The PSO algorithm is very efficient, computationally inexpensive, and excels at tuning parameter type problems better than some traditional evolutionary algorithms [12].

3

Grid Computing of Fractals

PSO has been shown to be effective for solving complex parameter optimization problems, usually comprising of a large number of parameters [13]. Typically, when performing a lot of optimization runs, additional computation power is required. Rendering fractals in sufficient detail and gradable quality is an expensive computation. Calculating fractals can require extensive computing resources. A 640 × 480 pixel image contains over 300,000 points, where each of these points is repeatedly recalculated through the IFS over several hundred times. As a result, an image would require more than 300,000,000 calculations. Depending on the complexity of the parameter settings and the processing power of the computer used. Therefore, rendering times for fractals can vary from several minutes to several hours. As a consequence we need a method to speed up calculations. This can be remedied through the use of grid computing. Grid computing utilizes distributed computing resources through groups of independent computers that appear to form a large virtual supercomputer. The computers on the grid can be geographically dispersed around the world, thus providing enormous flexibility. Rendering images such as fractals is ideal as it is an independent task that does not require communications with other machines for completion. Our project utilizes Xgrid, a grid computing technology built into Mac OS X that facilitates the creation and organization of a grid of computers to run computationally intensive applications, such as the rendering of a large number of fractals [14]. Xgrid leverages a three-tiered architecture approach to grid computing as seen in Figure 4.

Interactive Evolutionary Design of Fractals with Grid Computing

447

Fig. 4. Fractal Evolver ’s process overview involving Grid Computing

Fig. 5. Fractal Evolver interface: The designer can view fractals in a grid like fashion, view parameters, and assign a ranking score of 1 to 5 stars to each fractal

448

R.D. Moniz and C. Jacob

Fig. 6. Fractal Evolver interface: Viewing a fractal in full resolution and assigning a ranking score of 4 stars

Fractal Evolver generates fractal designs and relies on an evaluator to assess the fitness value for each fractal in the population (Figure 5). The initial process begins by specifying how many individuals (fractal flames) to use for the population. The fractal genomes are then created and submitted to the Grid for rendering (Step 1 in Figure 4). The Xgrid Controller receives all the fractal genome files and begins to distribute the task to all available Agent computers in the Grid for rendering (Step 2). As each fractal is rendered and completed (Step 3), the Agent sends the image to the Xgrid Controller, which in turn is sent to the Client for evaluation (Steps 4 & 5). In the graphical control interface, fractals are displayed in a grid-like fashion (Figure 5). Each of the fractals can be resized to full image resolution for more detailed evaluation (Figure 6). The designer or “breeder” can assign a fitness evaluation of 1 to 5 stars to each fractal, 1 being the lowest and 5 being the highest fitness evaluation. After at least one fractal has been ranked, the designer will invoke the “Evolve” button, and the interactive PSO algorithm will iterate through all the individuals, evolving the parameters following the PSO algorithm as described before. This new generation of fractals will then be submitted to the Grid to be rendered. This process is repeated until the designer is satisfied with the resulting fractals.

Interactive Evolutionary Design of Fractals with Grid Computing

4

449

Results and Conclusion

In our tests the use of Grid Computing has significantly accelerated the IEC process by generating a diversity of results, with much reduced response times. This is particularly important with a human in the evaluation loop (Figure 7). Our evolutionary process saw a speedup of at least 3.5 when working with large population sizes of up to 640 fractals. In comparison, the serial processing approach delays the evolutionary process by rendering each fractal sequentially forcing the user to wait until the last fractal is rendered for assessment. As seen in Figure 7, generating 640 simple fractals with image resolutions of 1440 × 900 sequentially takes more than 2 hours to complete. Using the distributed approach, the rendering takes about 30 minutes. Typically, with any interactive system, the designer may suffer from fatigue having to observe and evaluate all the possible designs that the evolutionary system produces [15]. Reducing the system’s response time has helped to alleviate the fatigue that designers experience, while one is able to go well beyond simple fractal designs that might render more quickly, but do not produce interesting results. The easy setup and use of grid computing to distributively render fractals in parallel speeds up the evolutionary process as the

Fig. 7. Experiments were conducted on a single computer (Duo Core 2GHz & 2GB RAM) and on a grid of computers (230GHz & 113GB RAM). Grid computing resulted in less time spent waiting for fractals with resolutions of 1440 × 900 to be generated compared to a single computer, on average 4.7x faster. Composited onto the graph is the progress view from Fractal Evolver that displays the current job progress when fractals are distributed to the grid for rendering.

450

R.D. Moniz and C. Jacob

user does not have to wait for each of the individual fractals to be rendered one after the other. The distributive approach also increases the number of potential solutions generated, which gives the user more options to find a particular design that they will like. In terms of evolution, the PSO algorithm has been proven effective in dealing with fine-tuning a large parametric system such as the fractal flames. The intuitive interface with its simplified grid view browser for observing fractal designs easily allows users to examine and assess a large population of fractals (Figure 5). The browser is particularly useful after the fact, when one needs to inspect all the fractals produced by the system. The all-in-one design provides parameter information for on demand analysis of the current evolutionary process without cluttering up the computer screen with multiple windows. Assigning a score of 1 to 5 stars to the population gives the PSO algorithm more flexibility to explore the design space. Ideally, the user will pick one fractal image from the population and assess it a score of 5 stars indicating that this is the best fractal design. The 5 star ranking system was selected as our method to classify and evaluate the quality of fractal designs because 5-point scales are commonly used by websites, applications, restaurants, hotels, movies, etc. [16]. The 5 star ranking system provides a linear visual form and data that has been ranked using the 5 star method are easier to sort and compare. These experiments clearly show the need to balance the advantages of human evaluation with an evolutionary system. Our further research will attempt to minimize the amount of human interaction with the evolutionary system by utilizing both a machine learning component, as well as having the designer only evaluating every n-th generation. The project was built with the intention of being able to easily replace the fractal design problem by any other computeintensive task. Recent developments have shifted to also include automatic evaluation for projects that do not require aesthetic appraisal. The same IEC system will be applied to evolving a parametric gene regulatory system that simulates biomolecular interactions within an E.coli bacterial cell [17]. We will then take what we have learned from evolving the gene regulatory system and introduce an automatic evaluation component to pre-filter undesirable fractals. This will reduce the number of fractals that the user will have to assess overall because only the fractal designs that have passed the user’s automatic evaluation criteria will be displayed. Acknowledgments. We would like to extend our thanks and appreciation to Namrata Khemka and Navneet Bhalla for their continued support and encouragement.

References 1. Peitgen, H.O., Richter, P.H.: The Beauty of Fractals. Images of Complex Dynamical Systems. Springer, Heidelberg (1986) 2. Flake, G.W.: The Computational Beauty of Nature: Computer Explorations of Fractals, Chaos, Complex Systems, and Adaptation. MIT Press, Cambridge (2000)

Interactive Evolutionary Design of Fractals with Grid Computing

451

3. Draves, S.: The electric sheep and their dreams in high fidelity, Annecy, France. ACM Press, New York (2006) 4. Peitgen, H.-O., J¨ urgens, H., Saupe, D.: Chaos and Fractals. Springer, Heidelberg (2004) 5. Draves, S.: Electric sheep, http://www.electricsheep.org 6. Dawkins, R.: The Blind Watchmaker. Penguin, London (1986) 7. Sims, K.: Artificial evolution for computer graphics. In: Proceedings of SIGGRAPH 1991. ACM Press, New York (1991) 8. Todd, S., Latham, W.: Evolutionary Art and Computers. Academic Press, London (1992) 9. Lutton, E., Cayla, E., Chapuis, J.: Artie-fract: The artist’s viewpoint. In: Evo Workshops [12], pp. 510–521 10. Engelbrecht, A.: Computational Intelligence: An Introduction. Halsted Press, New York (2002) 11. Eberhart, R.C., Kennedy, J.: A new optimizer using particles swarm theory. In: Proc. Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, pp. 39–43. IEEE Service Center, Piscataway (1995) 12. An Evolutionary Modularized Data Mining Mechanism for Financial Distress Forecasts. Studies in Fuzziness and Soft Computing, vol. 163. Springer, Heidelberg (2006) 13. Khemka, N.: Comparing particle swarms and evolution strategies: Benchmarks and application, Master’s thesis, University of Calgary, Calgary, AB, Canada (2005) 14. Kramer, D., MacInnis, M.: Utilization of a local grid of mac os x-based computers using xgrid, hpdc, vol. 00, pp. 264–265 (2004) 15. Kamalian, R., Zhang, Y., Takagi, H., Agogino, A.M.: Reduced human fatigue interactive evolutionary computation for micromachine design. In: Proceedings of 2005 International Conference on Machine Learning and Cybernetics, vol. 9, pp. 5666–5671 (August 2005) 16. Pu, P., Punit, G.: Visualizing reputation and recommendation in scientific literature. In: 10th International Conference on Human - Computer Interaction, Crete, Greece (2003) 17. Jacob, C., Burleigh, I.: Biomolecular swarms - an agent-based model of the lactose operon. Natural Computing 3(4), 361–376 (2004)

Suggest Documents