List of Figures • Figure 1.1: Crossover and Mutation • Figure 1.2: IGA processing • Figure 1.1: a female's dress design • Figure 1.4: An example of encoding arm-and-sleeve styles • Figur
Trang 1A 3-Dimension Room Design System With Interactive Genetic Algorithm
Ha Thi Kim Dung Faculty of Information Technology University of Engineering and Technology Vietnam National University, Hanoi Supervised by Assoc Prof Bui The Duy
A thesis submitted in fulfillment of the requirements for the degree of
Master of Computer Science
Trang 2• My college's teachers were devoted to give vast amount of knowledge
• My colleagues were enabling me to complete course
• Our classmates, the best friends I could have
Trang 3Signed
Trang 4Table of Content
Acknowledgements 1
Originality Statement 2
Table of Content 3
List of Figures 4
List of Abbreviations 5
Abstract 6
Introduction 7
Chapter 1: Related work 8
1 Genetic Algorithm versus Interactive Genetic Algorithm 8
2 IGA-based design system 12
Chapter 2: Construction of a 3D Room Design System with Interactive Genetic Algorithm 21
1 Overview 21
2 Encoding and decoding a room design 24
3 About roomfitness function, selection, crossover and mutation in the IGA 34
3 Experiments and results 37
Conclusion 39
Reference 43
Trang 5List of Figures
• Figure 1.1: Crossover and Mutation
• Figure 1.2: IGA processing
• Figure 1.1: a female's dress design
• Figure 1.4: An example of encoding arm-and-sleeve styles
• Figure 1.5 : Chromosome encoding
• Figure 1.6: Decoding from example genotype
• Figure 1.7: User interface of the system
• Figure 1.8: Chromosomes and the corresponding designs (a) and (b) are two parents and show a crossover point, and (c) is the offspring generated by applying crossover to (a) and (b)
• Figure 1.9: A chromosome of a Kimono
• Figure 1.10: Example of crossover
• Figure 1.11: User interface for selection of the first individuals
• Figure 1.12: User interface after action of the button
• Figure 1.13: Example of Yukata by using improved system
• Figure 2.1: System overview
• Figure 2.2: An example of choosing some colors in color set to
• Initial color sets representing materials products made from
• Figure 2.3: A 3D preview of a home
• Figure 2.4 a: Using 2 bits to encode beds
• Figure 2.4 b: Using 2 bits to encode chairs and another 2 bits to encode tables
• Figure 2.4 c: Using 1 bits to encode wardrobes and another 2 bits to encode dressers
• Figure 2.4 d: Using 2 bits to encode windows
• Figure 2.4 e: Using 3 bits to encode doors
Trang 6• Figure 2.5: Genes of wooden color, iron color, leather color
• Figure 2.6: Another colors
• Figure 2.7: A chromosome
• Figure 2.8: A visualization of a home
• Figure 2.9: a pair of parents generate offspring
• Figure 2.10: Run 1- Most of users rated in a muddle with only one user chose a desirable design
• Figure 2.11: Run 2 - at the ninth generation, users chose the best one
• With highest fitness values are 7 and 8
• Figure 2.12: Run 3 - users chose the favorite designs from the seventh or the tenth generation
• Figure 2.13 a: 4 initial designs were rated with lowest values
• Figure 2.13 b: new designs generated when evolution happened
• Figure 2.13 c: After several steps, the evolution stopped because of 3 designs looked alike
List of Abbreviations
• GA: Genetic Algorithm
• IGA: Interactive Genetic Algorithm
• CAD: Computer-Aided Design
Trang 7Abstract
The thesis "A 3-Dimension Room Design System with Interactive Genetic
Algorithm" will introduce an application of Interactive Genetic Algorithms (IGAs) to
the problem of 3D room design The major goal of the proposal is to help a user obtain
a desirable 3D room design in an easy and fast way Therefore, time cost of designing
is reduced The user only has to rate each presented design then the system will calculate and generate new designs based on the user's selections More over, generating designs based on the choices of the user is one of potential ways to meet customer's taste, which always changes
Trang 8In the thesis, we propose a new approach that integrates an Interactive Genetic Algorithm (IGA) to a 3D room design to reduce time cost of designing With this approach, the system repeatedly present several designs based on user's preference The preference is expressed through their rates of designs The system will calculate and generate new designs from current rated designs It will reduce designing time because it creates automatically the scheme between models of furniture Interactive Genetic Algorithm is similar to genetic algorithm except user fitness function The user fitness function gets user's choices to be an input then results fitness values The higher values are used to auto-generate new room designs until user accepts Actually, IGA is
a searching problem that helps users find out desirable designs without trying all cases
in search space Moreover, basing on user's choices is one of potential ways to meet user's taste, which always changes
The thesis is organized as follows: Chapter 1 presents related work In this chapter,
we will introduce some information about GA, IGA and some IGA-based design systems In chapter 2, we recommend about the new approach of applying Interactive Genetic Algorithm in 3D Room Design System We also present some information about experiments and results
Trang 9Chapter 1: Related work
1 Genetic Algorithm versus Interactive Genetic Algorithm
Genetic Algorithm (GA) was proposed by John Holland in early 1970s It based on Darwin's theory about evolution It applies some of natural evolution steps like
crossover, mutation, and replace Algorithm started with a set of solutions (represented
by chromosomes) called population Solutions from one population are taken and used to form a new population (called offspring) The evolution makes the thinking
that the new population will be better than the old one Solutions, which form new solutions, are selected according to their fitness values Which solutions have higher fitness values; they will have more chances to reproduce These works are repeated until some conditions (for example number of populations or improvement of the best solution) are satisfied The algorithm is applied to many problems of optimization and classification, etc
The GA algorithm is following [2]:
1 [Start] Generate random population of n chromosomes (suitable solutions
for the problem)
2 [Fitness] Evaluate the fitness f(x) of each chromosome x in the population
3 [New population] Create a new population by repeating following steps
until the new population is complete
a [Selection] Select two parent chromosomes from a population
according to their fitness (the better fitness, the bigger chance to be selected)
b [Crossover] With a crossover probability cross over the parents to
form a new offspring (children) If no crossover was performed, offspring is an exact copy of parents
c [Mutation] With a mutation probability, mutate new offspring at
each locus (position in chromosome)
d [Accepting] Place new offspring in a new population
4 [Replace] Use new generated population for a further run of algorithm
5 [Test] If the end condition is satisfied, stop, and return the best solution in
current population
6 [Loop] Go to step 2
Trang 10Figure 1.1: Crossover and Mutation [1]
Chromosomes chosen are usually better than other ones in hoping that better parents can generate better offspring Nevertheless, it is possible to lost best chromosomes
from last population Therefore, elitism phenomenon is applied that best solutions will
be copied from last population to new one
The common way used to encode each chromosome is a binary string encoding Here is an example of chromosome encoding:
Chromosome 1 1011010001001 Chromosome 2 1010101010101
Each bit or a bit group represents a characteristic of the solution They call genes
To generate a new population, chromosomes need to exchange some bits with each
other This step called Crossover operator The simplest way to do this is to choose
randomly some crossover point for all parents, then swap the front part of Chromosome 1 to the front one of Chromosome 1 Here is an example of crossover:
Trang 11Chromosome 1 1011|010001001 Chromosome 2 1010|101010101
Like crossover of genes in real world, offspring inherit characteristics from parents Mutation operation reverses some bits in the binary string at very low rate After a crossover is performed, mutation step takes place This is to prevent falling all
solutions in population into a local optimum of solved problem [2] Mutation changes
at random positions in chromosomes of the new generation For binary encoding, we can switch a few randomly chosen bits from 1 to 0 or from 0 to 1 Mutation can then be following:
Original 1 1010010001001 Original 2 1011101010101 Mutated 1 1011010001001 Mutated 2 1011101110101
Selection operator selects solutions from population based on fitness values of
individuals A fitness function prescribes the optimality of a solution so that a particular chromosome is ranked against all the other chromosomes Optimal chromosomes, or at least chromosomes which are more optimal, are allowed to breed and mix their datasets by any of several techniques, producing a new generation that will be even better An ideal fitness function correlates closely with the algorithm's goal, and yet may be computed quickly Speed of execution is very important, as a typical genetic algorithm must be iterated many, many times in order to produce a usable result for a non-trivial problem This is one of the main drawbacks of GAs in real world applications and limits their applicability in some industries
Trang 12Definition of the fitness function is not straightforward in many cases and often is performed iteratively if the fittest solutions produced by GA are not what is desired In some cases, it is very hard or impossible to come up even with a guess of what fitness
function definition might be Interactive genetic algorithms address this difficulty by
outsourcing evaluation to external agents (normally humans)
Interactive Genetic Algorithm, one type of Interactive Evolutionary Computation
(IEC) or Aesthetic Selection problems is a general term for methods of evolutionary computation that use human evaluation Usually human evaluation is necessary when the form of fitness function is unknown (for example, visual appeal or attractiveness;
as in Dawkins, 1986) or the result of optimization should fit a particular user preference (for example, taste of coffee or color set of the user interface) [13]
Interactive Genetic Algorithm is the same as GA except fitness function In IGA user gives fitness to each individual instead of fitness function Therefore, the system can meet user's expectation or what a customer's preference in the course of evolution
Actually, the Selection step in the algorithm applied in home decorating can be
understood that "What kind of decoration is better?" and "better", "good", "bad" definitely depend on human's sense IGA may be one of the solutions for this problem Figure 1.2 is the visualization of IGA
Trang 13Figure 1.2: IGA processing
Next, we will present some available design systems integrated IGA to improve the capability of user-oriented design
1 IGA-based design system
When researching about using IGA in 3D design, there have two outstanding proposals we explored Hee-Su Kim and Sung-Bae Cho proposed one [1] They created
a 3D design IGA-based system for fashion design In this system, they designed female's dresses They divided a dress into seven parts:
Trang 14Figure 1.3: a female's dress design
There was a database of partial design elements Each design was stored as 3D models System selected the models of each part and combined them into a number of individual designs The population was displayed and user gave fitness values to each design Then, system reproduced the population according to the fitness value of each design, and applied crossover and mutation to make the next generation As they mentioned, iteration of these processes could produce the population of higher fitness value, namely better designs This system works with OpenGL and VRML
They encoded the detail model based on the knowledge of the fashion design First, they reclassified general detail factors of a dress into some parts then encoded them with some bits for each, which chooses the color of each part A design was made from combining them With IGA, some combinations that preferred by user was generated, resulting in more realistic and reasonable design
Trang 15Figure 1.4: An example of encoding arm-and-sleeve styles
Trang 16Figure 1.5 : Chromosome encoding
Figure 1.6: Decoding from example genotype
Trang 17Figure 1.7: User interface of the system
Trang 18Figure 1.8: Chromosomes and the corresponding designs
(a) and (b) are two parents and show a crossover point, and (c) is the offspring generated by applying crossover to (a) and (b)
The system was built very completed and potential The design of this system is quite similar to 3D room design system we want to build
The next one is proposed by Maiko Sugahara, Mitsunori Miki, And Tomoyuki Hiroyasu to design an IGA-based system of Japanese Kimono (Yukata) [15]
This system did not dividing and encoding each sample like the system mentioned earlier They divided a Kimono into three parts: Yukata fabric, obi and pattern Yukata fabric is a kind of material Obi is a part of a Kimono and pattern is decorated-sample
of a Kimono Each part was encoded with bit genes representing to three elements of HSB The HSB color system is based on three different ways of varying color as Hue, a particular gradation of color; Saturation, the vividness of hue; Brightness, the percentage of brightness of the color [16]
Trang 21
Figure 1.13: Example of Yukata by using improved system
In the second system, because of details in a Kimono is not much In addition, difference between samples depending almost on color and pattern However, in a 3D room design, style, number, color of furniture in a room affect visualization of a design In conclusion, we decided to design our system on the reference to Hee-Su Kim and Sung-Bae Cho's system
Trang 22Chapter 2: Construction of a 3D Room Design System with Interactive Genetic Algorithm
1 Overview
In this chapter, we present our approach to use Interactive Genetic Algorithms for the problem of 3D room self-design The Interactive Genetic Algorithms are used in a 3D Room Design System to allow users to obtain their desirable designs in an easy and fast manner
The overview of the system can be seen in Figure 2.1 First, some initial room designs are generated and presented to the user These designs are encoded as binary
strings (chromosomes) which form the initial population P of the IGA The user then
rates designs User's rating is used to calculate the fitness function After that, an iteration of main processes of IGA is carried out until the user accepts At each
iteration i, all individuals in the current population are estimated by the fitness function
as mentioned above These individuals are selected basing on their fitness values to
generate new population (new room designs) Pi Chromosomes, which have higher
rated values, will have more chance to be selected corresponding to a probability They are called candidates Some individuals with highest fitness values from candidates are
moved to Pi Other ones are composed to pairs of chromosomes (designs) A crossover
operator then crosses chromosomes in each pair together over After doing this operator, new chromosomes are generated With a certain probability, mutation operator then implements on some new offspring After all, we decode chromosomes
in Pi to generate new designs