GNR602-Lec22 Genetic Algorithms
GNR602-Lec22 Genetic Algorithms
Advanced Methods in
Satellite Image Processing
Instructor: Prof. B. Krishna Mohan
CSRE, IIT Bombay
[email protected]
Slot 13
Genetic Algorithms
• Genetic algorithms are one of the well
known tools for optimization.
• They are employed to generate optimal
solutions employing the principles of
genetic evolution.
• They employ the concept of random
search instead of deterministic search
Genetic Algorithms
• Genetic algorithms are inspired by
evolutionary processes in living
organisms.
• 27 videos of a full course on this subject
taught by Prof. David Delchamps (Cornell
University) can be found on Youtube.
• Search key on Youtube: ECE4271 David
Delchamps Evolutionary Processes
GNR602 Lecture 22 B. Krishna Mohan
IIT Bombay Slide 3
Basic Principle
• Numerical approach to problem solving
• Uses genetics as its model of problem
solving.
• Apply rules of reproduction, gene crossover,
and mutation
• Start with a number of candidate solutions
that evolve over “genetic cycles” towards the
optimal solution
• Solutions evaluated using “fitness” criteria
• Fittest will survive
Genetic Algorithms
Different from traditional methods
•Work with a coding of the parameter set
•Search from a population of points
•Use payoff (objective function) information
•Use probabilistic transition rules
Genetic Algorithm
• A computer algorithm inspired by the principles of
genetic evolution
Local peak
Climber i
Multiple Candidates
• Multi-climbers
Climber j
Climber k
Climber i
Motivation
• In course of time at least one candidate
may reach the global peak
Candidate
n at
global
peak!
Candidate j
Candidate i
GA based Search
• Based on the principle of evolution and
genetics into search .
• Simulate the process in natural systems.
• Create a population of individuals
represented by chromosomes, in essence a
set of character strings, that are analogous to
the DNA, that we have in our own
chromosomes.
no
Stop?
GNR602 Lecture yes
22 B. Krishna Mohan
The End
IIT Bombay Slide 12
Designing GA...
How to represent genomes?
How to define the crossover operator?
How to define the mutation operator?
How to define fitness function?
How to generate next generation?
How to define stopping criteria?
Crossover
• Crossover is concept from genetics.
• Crossover combines genetic material
from two parents, in order to produce
superior offspring.
• A few types of crossover:
– One-point
– Multiple point.
Mutation
• Introduces randomness into population.
• Unary operation.
• The idea is to reintroduce divergence
into a converging population.
• Performed on small part of population,
in order to avoid entering unstable state.
Mutation
Parent 1 1 0 1 0 0 0 1
Child 0 1 0 1 0 1 0 1
Probabilistic Operations
• Average probability for individual to
crossover is about 80%.
• Average probability for individual to
mutate is about 1-2%.
• Probability of genetic operators follow
the probability in natural systems.
• Better solutions reproduce more often.
GNR602 Lecture 22 B. Krishna Mohan
IIT Bombay Slide 19
Fitness Function
• Fitness function is evaluation function,
that determines what solutions are
better than others.
• Fitness is computed for each individual.
• Fitness function is application
dependent.
Selection
• Copies a single individual, probabilistically selected
based on fitness, into the next generation
• Possible ways of selection:
– “Only the strongest survive”
– “Some weak solutions survive”
• Assign a probability that a particular individual
will be selected for the next generation
• More diversity
• Some bad solutions might have good parts!
Stopping Criteria
Two possible solutions:
Advantages of GAs
• Concept is easy to understand.
• Minimum human involvement.
• Find new solution!
• Modular, separate from application
• Supports multi-objective optimization
• Easy to exploit previous or alternate solutions
CHROMOSOME
0 1 0 0 1 1 0
1
GENE 1 GENE 2
ALLELES (BITS)
1 0 1 0 0 1 1 0
1 1 0 0 1 1 0 0
1 1 0 0 0 1 1 0 OFFSPRING 1
1 0 1 0 1 1 0 0 OFFSPRING 2
Shuffling Crossover
AFTER
1 0 0 0 1 1 0 0 MUTATION
Uniform Mutation
1 0 0 1 1 1 0 0
Y N N Y
N N Y N
0 1 1 0 1 1 0 1
Swap Mutation
1 0 1 0 1 1 0 0
RANDOM
POINTS FOR
SWAPPING
1 1 1 0 1 0 0 0
Is NO
(MUTATE
==
TRUE)
YES
DON’T CHANGE BIT
VALUE
nmutation = nmutation
+1
CHANGE BIT VALUE OF ALLELE
STOP
GNR602 Lecture 22 B. Krishna Mohan
IIT Bombay Slide 31
Fitness Function
• Cost associated with a weight set =
Average error in classification for the entire set
of test samples
• Lower error = Higher fitness
• Using a number of candidate weight sets, a
multilayer perceptron network is initialized.
Image classification application using ANN
• Rank selection
• Tournament selection
REPEAT
ROULETTE WHEEL
SELECTION
J = J +1
SELECT J
END
END
STOP
Convergence Criteria
Image Classification
Role of GA in JPEG
• Predict the quantization table given a
compression factor
• Fitness function based on –
– Quality of image after decompression
– Size of the compressed image
– Variable weightage to the two factors based
on user requirement
Approach
• Generate a large number of candidate
quantization tables
• Encode quantization tables
• Apply Crossover
• Apply Mutation
• Compress image
• Check size of compressed image
Approach contd.
• Decompress the compressed image
• Compare decompressed image with
original
• Note distortion in pixel values
• Fitness based on
– Minimum deviation of compressed file size
– Minimum distortion due to compression
Convergence Criteria
Image Compression
Results
Original CR = 6
GNR602 Lecture 22 B. Krishna Mohan
IIT Bombay Slide 49
Sample Quantization Table CR=6
2 8 9 13 13 21 22 41
8 10 12 13 21 22 40 43
10 12 15 20 23 40 44 55
11 15 20 23 39 46 54 55
17 17 25 35 46 54 56 83
17 25 35 49 51 57 63 88
28 32 50 51 59 61 104 115