Title: Genetic Programming for Image Processing
1Genetic Programming for Image Processing
- Brian A. Smith
- 2007.04.18
2Natural Evolution
- Requirements for evolution
- Representation
- Selection Pressure
- Recombination
- Diversity
3Natural Evolution
- Representation DNA
- Selection Pressure Survival, Reproduction
(determined implicitly by environment) - Recombination Mating, Replicating
- Diversity Population
4Natural EvolutionPanthera leo
- Representation
- Linear DNA
- Diploid cells
- Selection Pressure
- Rate of Reproduction
- Recombination
- Sexual reproduction
- Diversity
- Prides, with some inter-pride exchange
Image courtesy of Wikimedia Commons. (CCA 2.0
License, author yaaaay)
5Natural Evolution Streptococcus pyogenes
- Representation
- Circular DNA
- Monoploid cells
- Selection Pressure
- Rate of Reproduction
- Recombination
- Binary fission (asexual)
- Diversity
- Very little
- Occasional mutations
Image courtesy of Center for Disease Control and
Prevention, via Wikipedia. (Public domain image)
6Artificial Evolution Genetic Algorithms
- Genetic algorithms are arguably the simplest
class of evolutionary algorithms - GAs make use of simple representation,
reproduction, and diversity mechanisms - These aspects are usually independent of the
problem domain
7Artificial Evolution Genetic Algorithms
- Representation Linear chromosome
- (array of values)
- Selection Pressure Explicit fitness function,
- Selection algorithms
- Recombination Crossover, Mutation
- Diversity Fixed-size population
8Artificial Evolution Genetic Algorithms
- Representation Linear chromosome
- (array of values)
0 1 1 0 1 1 0 1 0 1 0 1
0.5 1.2 0.0 0.2 1.0 -2.1 -1.0 0.5 -0.3
0.6 3.1 0.2
9Artificial Evolution Genetic Algorithms
- Representation Linear chromosome
- (array of values)
- Chromosome can be Boolean-valued, integer-valued,
real-valued, complex-valued, etc.
10Artificial Evolution Genetic Algorithms
- Selection Pressure Explicit fitness function
- Fitness function is problem-specific. The only
limits are those of imagination and practicality. - The fitness function usually assigns a
real-valued fitness score that does not change.
11Artificial Evolution Genetic Algorithms
- Selection Pressure Selection algorithms
- Selection algorithms are usually applied to
choose which individuals reproduce - and sometimes which individuals are culled.
12Artificial Evolution Genetic Algorithms
- Selection Pressure Selection algorithms
- Common selection algorithms include
- Roulette wheel selection,
- Rank-based selection,
- and Tournament selection (my favorite).
13Artificial Evolution Genetic Algorithms
Parent 0
One-point Xover
Parent 1
14Artificial Evolution Genetic Algorithms
Parent 0
One-point Xover
Parent 1
Child 0
Child 1
15Artificial Evolution Genetic Algorithms
Parent 0
Two-point Xover
Parent 1
Child 0
Child 1
16Artificial Evolution Genetic Algorithms
Parent 0
Uniform Xover
Parent 1
Child 0
Child 1
17Artificial Evolution Genetic Algorithms
Parent 0
Point Mutation
Child 0
18Artificial Evolution Genetic Algorithms
- Recombination Duplication
Parent 0
Used for Elitism
Child 0
19Artificial Evolution Genetic Algorithms
- Diversity Fixed-size population
- Generational GAs use individuals from current
generation to create an entirely new generation
of the same size. - Steady-state GAs replace individuals one or two
at a time.
20GA Example Noise Reduction
Images courtesy of me.
21GA Example Noise Reduction
- Reasonable choices
- Pick a window size of nn
- Use a real-valued chromosome of length n2
- Use a blending crossover
- Use a modest mutation operator
- Apply mask to noisy images
- Set fitness to the Euclidean distance between
original images and noisy images
22GA Example Noise Reduction
- Would we expect the evolved solution to work well
for BW noise? - Would we expect the evolved solution to work well
for images from other domains?
23GA Example Noise Reduction
- You get what you evolve for!
- So write your fitness function carefully.
- Diversity is very important.
24GA Example Noise Reduction
- Barring some much more creative way of using the
linear chromosome, we cant evolve a simple
median filter using this representation. - Wouldnt it be nice if we could evolve algorithms
instead of masks or arrays?
25Artificial Evolution Genetic Programs
- Genetic programs are a (slightly) more complex
class of evolutionary algorithms. - The main difference is in the representation,
which allows for arbitrarily complex algorithms
to evolve.
26Artificial Evolution Genetic Programs
- Representation Program tree
if
z
ifgt0
4
1
y
y
x
exp
x
x
27Artificial Evolution Genetic Programs
- Representation Program tree
- The user must specify a function set and a
terminal set.
if
y
x
z
1
v
0
A Boolean function set
A Boolean terminal set
28Artificial Evolution Genetic Programs
- Representation Program tree
- Chromosome can be Boolean-valued, integer-valued,
real-valued, complex-valued, etc. - Chromosome can also be null-valued where nodes
perform some action (such as moving a robot
forward) but have no return value.
29Artificial Evolution Genetic Programs
- Representation Program tree
- Chromosome can also be strongly-typed where
multiple node types are used subject to some
constraints.
30Artificial Evolution Genetic Programs
- Selection Pressure Explicit fitness function
- Problem specific, same as GA
- Selection Pressure Selection algorithms
- Same as GA
31Artificial Evolution Genetic Programs
Parent 0
Parent 1
32Artificial Evolution Genetic Programs
Parent 0
Parent 1
Child 0
Child 1
33Artificial Evolution Genetic Programs
- Recombination Crossover
- Because crossover does not preserve the
morphology of the tree, diversity is not as
important in the GP paradigm.
34Artificial Evolution Genetic Programs
Grow an entire new subtree
Parent 0
Child 0
35Artificial Evolution Genetic Programs
- Diversity Population
- Generational and steady-state populations are
common. Same as GA.
36GP Example Landslide Detection
- From Rosin and Hervás 2002 paper
Image Thresholding for
Landslide Detection by Genetic Programming.
37GP Example Landslide Detection
- Focused on the task of identifying landslide
areas in an image using before and after
satellite images from Veneto, Italy. - Desired output is a binary image with the pixels
in the landslide area colored black and all other
pixels white. - Previous work using more conventional image
processing techniques were unsatisfactory.
38GP Example Landslide Detection
Images from Rosin and Hervás (2002).
39GP Example Landslide Detection
- Representation Real-valued program tree
- Function set
, , -, /, abs, sigmoid, min, max - Terminal set random constants, difference image
pixel values, smoothed difference values, pixel
values from various other transforms - Maximum depth 7
40GP Example Landslide Detection
- Interpretation Positive landslide
- Negative no landslide
- 0? (not reported in paper)
- Fitness function of correctly
classified pixels - Selection algorithms
- Not reported in paper
- Recombination
- Standard Xover and mutation
41GP Example Landslide Detection
- Diversity Generational GP
- Population size 20,000
- of generations 200-300
42GP Example Landslide Detection
- Results best-of-run
- s10 is Gaussian smoothing with st. dev. of 10
- o15 is opened image with a 15x15 mask
- dt is distance transformed pixel value
- difference is the difference image pixel value
43GP Example Landslide Detection
Best-of-run result on entire image
Ground truth
Images from Rosin and Hervás (2002).
44GP Example Landslide Detection
- Problems with the methodology
- Very few details, would be difficult to reproduce
- Only used a portion (3) of a single image for
training - Used the same image for evaluation!!!
- Did not report fitness scores for experiments,
rely instead on the readers subjective measure
of accuracy
45GP Example Landslide Detection
- Strong points of the research
- Shows benefit of using pre-processed inputs
- Evolved better classifier than the authors were
able to design themselves - Shows that intuitive understanding of final
result is unnecessary
46Concluding points
- Evolutionary algorithms such as GP may be
suitable for evolving, rather than designing,
image processing algorithms - Evolutionary algorithms are not guaranteed to
produce an optimal solution - Evolutionary algorithms may take a long time
(hours, days, or even weeks) to complete
47Questions or comments?
48Resources
- Dawkins, Richard. 1976. The Selfish Gene. Oxford
University Press, Oxford, UK. - Introduces Dawkins selfish gene theory, which
argues that the gene- not the individual or the
species- is the unit of evolutionary selection.
Extremely important for understanding natural
evolution, with some ramifications for artificial
evolution, as well. - Eiben, A.E. and J.E. Smith, ed. 1998.
Introduction to Evolutionary Computing.
Springer-Verlag, Berlin, Germany. - Provides very brief introductions to all of the
major classes of evolutionary algorithms. Good
for breadth, but not for depth.
49Resources
- Goldberg, D.E. 1989. Genetic Algorithms in
Search, Optimization, and Machine Learning.
Addison-Wesley. - The bible of the simple GA. Focuses on the
Boolean (bit string) representation and gives
theoretic justifications for its success. - Holland, J.H. 1975. Adaptation in Natural and
Artificial Systems. The University of Michigan
Press, Ann Arbor, MI. - From the man who is credited with inventing the
genetic algorithm and birthing the field of
evolutionary algorithms. (Though I have read that
von Neumann suggested the idea of evolutionary
algorithms in a letter decades earlier.) This
work is the foundation of all future GA work.
50Resources
- Koza, J.R. 1992. Genetic Programming On the
Programming of Computers by Means of Natural
Selection. MIT Press, Cambridge, MA. - Introduces the genetic program. Some earlier work
can arguably be said to fall under the title
genetic program, but Koza was the first to
treat it as a rigorous methodology. The work is a
tour de force in the technique, using GPs to
efficiently solve a broad range of problems. 800
pages, but it reads very quickly. - Koza, J.R. 1992. Genetic Programming II
Automatic Discovery of Reusable Programs. MIT
Press, Cambridge, MA. - Introduces the automatically defined function.
ADFs allow for the evolution of functions with
arbitrary arguments. Dramatically improves the
performance of GPs in a number of domains.
51Resources
- Rosin, P.L. and J. Hervás. 2002. Image
Thresholding for Landslide Detection by Genetic
Programming, in L. Bruzzone and P. Smiths, ed,
Analysis of Multi-Temporal Remote Sensing Images,
pp. 65-72. World Scientific.