80
Evolutionary Algorithms Dr. Bo Yuan

Evolutionary Algorithms Dr. Bo Yuan Overview Global Optimization Genetic Algorithms Genetic Programming Evolvable Things 2

Embed Size (px)

Citation preview

Genetic Algorithms and Related Topics

Evolutionary AlgorithmsDr. Bo Yuan

OverviewGlobal OptimizationGenetic AlgorithmsGenetic ProgrammingEvolvable Things2

4

Learning from Nature5

Motivation of EAsWhat can EAs do for us?

Optimization

Help people understand the evolution in nature.

What is optimization?

The process of searching for the optimal solution from a set of candidates to the problem of interest based on certain performance criteria.

Accomplish a predefined task to the highest standard.Job Shop Problem

Produce maximum yields given limited resources.Investment Strategy6Key ConceptsGeneric Population-Based Stochastic Optimization Methods

Inherently Parallel

A Good Example of Bionics in Engineering

Survival of the Fittest

Chromosome, Crossover, Mutation

Metaheuristics

Bio-/Nature Inspired Computing7The Big Picture8ProblemCoding

Objective Function

Domain KnowledgeEA FamilyGA: Genetic AlgorithmGP: Genetic ProgrammingES: Evolution StrategiesEP: Evolutionary Programming

EDA: Estimation of Distribution AlgorithmPSO: Particle Swarm OptimizationACO: Ant Colony OptimizationDE: Differential Evolution9

10

Objective Functionfx1

xnOutput12Portfolio Optimization13Travelling Salesman Problem

There are 20!=2,432,902,008,176,640,000 different routes for a 20-city problem.14Knapsack Problem$

15

Bin Packing Problem16

Machine Learning Problems

RegressionClassification17Local OptimaXf0Xf0fX018Local Optima + DimensionalityThe size of the search space grows exponentially!19

The Bad NewsMany interesting optimization problems are not trivial.

The optimal solution cannot always be found in polynomial time.

Feature Selection Problem

Start with N features.Redundant/Irrelevant/Noisy

Select a subset of features.Objective: Highest Accuracy

How challenging is this task?20

The Bad NewsGiven 32 features (N=32)

1: selected feature; 0: unselected feature

The optimal solution may look like:0010 1100 0000 0100 0000 0000 0000 0001{3, 5, 6, 14, 32}

However, there are 232-1 combinations in total.1 in 4,294,967,295 chanceNeedle-in-a-haystack situationUnless you are extremely lucky.

The Limitation of Computation21

FLOPSFLoating point OPerations per SecondGFLOPS (gigaFLOPS):109 (10)TFLOPS (teraFLOPS): 1012 (1)PFLOPS (petaFLOPS): 1015 (1)

Intel Core i7 980 XE: ~100 GFLOPS

Bremermann's Limitc2/h=91016/6.626068961034 1.361050 bitss-1kg-1Is it fast enough?22

~6 1024 KGHow to solve it?Local SearchXf0Multimodal23

How to solve it?Divide-and-ConquerDependences24Z=f (X, Y)XY0Solution: Parallel SearchConduct searching in different areas simultaneously.Population BasedAvoid unfortunate starting positions.

Employ heuristic methods to effectively explore the space.Focus on promising areas.Also keep an eye on other regions. More than random restart strategies.

This is where EAs come into play!25

PublicationsTop Journals:

IEEE Transactions on Evolutionary Computation

Evolutionary Computation Journal (MIT Press)

Major Conferences:

IEEE Congress on Evolutionary Computation (CEC)

Genetic and Evolutionary Computation Conference (GECCO)

Parallel Problem Solving from Nature (PPSN)26

PeopleProf. Xin YaoThe University of Birminghamwww.cercia.ac.uk Former EiC: IEEE Transactions on Evolutionary ComputationPresident of the IEEE Computational Intelligence Society

Dr. David FogelNatural Selection Inc.www.natural-selection.comBlondie24: Playing at the Edge of AI

Prof. Zbigniew MichalewiczUniversity of Adelaidewww.solveitsoftware.comHow to Solve It: Modern Heuristics27

PeopleProf. David E. GoldbergUniversity of Illinois at Urbana-Champaignhttp://www.davidegoldberg.com/Genetic Algorithms in Search, Optimization and Machine Learning (1989)

Prof. Kenneth A. De Jong George Mason University www.cs.gmu.edu/~eclab De Jong Test Suite (PhD Thesis, 1975)Evolutionary Computation: A Unified Approach (MIT Press, 2006)

Prof. Melanie MitchellPortland State University web.cecs.pdx.edu/~mmAn Introduction to Genetic Algorithms (MIT Press, 1996)28Blondie2429

Want to know more?

WikipediaEC Digest: http://ec-digest.research.ucf.edu30

ReviewEvolutionary AlgorithmsKey ConceptsEA FamilyWhere to find related information?

What is optimization?

Typical Optimization Problems

What makes a problem difficult to optimize?

Take a break and come back in 5 minutes.

31A Gentle Introduction toGenetic Algorithms32

Biology Background33Biology BackgroundGene A working subunit of DNA

Gene TraitFor example: colour of eyes

AllelePossible settings for a trait (e.g., Blown, Gray and Blue)

GenotypeThe actual genes carried by an individual

PhenotypeThe physical characteristics into which genes are translated

34Genetic AlgorithmsJohn HollandAdaptation in Natural and Artificial Systems, 1975

Inspired by and (loosely) based on Darwins TheoryChromosomeCrossoverMutationSelection (Survival of the Fittest)

Basic IdeasEach solution to the problem is represented as a chromosome.The initial solutions may be randomly generated. Solutions are evolved during generations.Improved gradually based on the principle of natural evolution.

35

Basic ComponentsRepresentationHow to encode the parameters of the problem?Binary Problems10001 00111 11001 ..Continuous Problems0.8 1.2 -0.3 2.1 ..

Selection StrategyWhich chromosomes should be involved in reproduction?Which offspring should be able to survive?

Genetic OperatorsCrossoverExchange genetic materials between two chromosomes.Mutation: Randomly modify gene values at selected locations.

36?RepresentationIndividual (Chromosome)A vector that represents a specific solution to the problem.Each element on the vector corresponds to a certain variable/parameter.

PopulationA set of individualsGAs maintain and evolve a population of individuals.Parallel Search Global Optimization

OffspringNew individuals generated via genetic operatorsHopefully contain better solutions.

EncodingBinary vs. GrayHow to encode TSP problems??37Selection I

18.223.231.441.2Values?38Negative Values?

Selection II18.242-3.2131.424-1.23RankValues

39Selection III

Tournament Selection?FIGHT!40Tournament Size?Selection IVElitismOffspring are not necessarily better than their parents.The best individual in the current population may be lost.Destroyed by crossover & mutationCopy the best individual to the next generation.Improve the stability and performance of GAs.

Offspring SelectionUsually the old population is replaced by the offspring.Are their any other options?(, ) Strategy(+) Strategy?41Crossover IParent 1Parent 2Offspring 1Offspring 2One Point Crossover42Crossover IIParent 1Parent 2Offspring 1Offspring 2Two Point Crossover43Crossover IIIParent 1Parent 2Offspring Uniform Crossover44Is It Always Easy?123456789312849576Parent 1Parent 2123449576312856789Offspring 1Offspring 2

Crossover of Two Individuals for TSP 45MutationParentOffspring Mutation is mainly used to maintain the genetic diversity. ?46Mutation vs. CrossoverPopulation DiversityLoss of genetic diversity Premature ConvergencePopulation01011001111111kth dimension47

Selection vs. Crossover vs. MutationSelectionBias the search effort towards promising individuals.Loss of genetic diversity

CrossoverCreate better individuals by combining genes from good individuals.Building Block HypothesisMajor search power of GAsNo effect on genetic diversity

MutationIncrease genetic diversity.Force the algorithm to search areas other than the current focus.

Exploration vs. Exploitation

48The Complete PicturePopulationCrossoverMutationOffspringSelectionkth individual49Initialization: Generate a random population P of M individualsEvaluation: Evaluate the fitness f(x) of each individual Repeat until the stopping criteria are met:Reproduction: Repeat the following steps until all offspring are generatedParent Selection: Select two parents from PCrossover: Apply crossover on the parents with probability PcMutation: Apply mutation on offspring with probability PmEvaluation: Evaluate the newly generated offspringOffspring Selection: Create a new population from offspring and POutput: Return the best individual foundGA Framework50ParametersPopulation SizeToo big: Slow convergence rateToo small: Premature convergence

Crossover RateRecommended value: 0.8

Mutation RateRecommended value: 1/LToo big: Disrupt the evolution processToo small: Not enough to maintain diversity

Selection StrategyTournament SelectionTruncation Selection (Select top T individuals)Need to be careful about the selection pressure.51

A Few More WordsNo Free Lunch!So called optimal parameter values do not exist!Vary from problems to problems.Need some trials to find suitable parameter values.

RandomnessInherently stochastic algorithmsIndependent trials are needed for performance evaluation.

Why does it work?Easy to understand & implement (No maths required!)Very difficult to analyse mathematically.Converge to global optimum with probability 1 (infinite population).Schema Theorem

52

Feature SelectionSelect a subset of features from the original features.Dimension ReductionRemove irrelevant features

MotivationLess challenging in trainingFaster running timeHigher accuracyBetter understanding

ApproachesFilter Method: Does not consider classification error.Wrapper Method: Does consider classification error.53GAs & Feature SelectionRepresentationBinary strings

Fitness FunctionClassification errors (KNN, SVM, ANN etc.)

Evolve a population of candidate subset of features.

Major IssuesThe number of candidate features (Curse of Dimensionality)Computational cost

Reading MaterialsA Survey of Genetic Feature Selection in Mining Issues CEC99

54ClusteringDefinition

The process of partitioning a group of data into K groups based on certain similarity metric.

Unsupervised Learning (Unlabeled Data)

55K-Means1. Choose K points as the initial cluster centres.

2. Assign each point to the cluster with the closest centre.

3. Recalculate the positions of the K centres.

4. Repeat Steps 2 and 3 until the centres no longer move. Major Issue: Sensitive to the initial K centres!Could get stuck at suboptimal solutions!56GAs & ClusteringUse GAs to final an optimal set of cluster centres!

RepresentationA string of K centresLength: KD (D is the data dimensionality)

Fitness EvaluationAssign each data to the nearest cluster.Calculate the new cluster centres.Update the old cluster centres (individuals).The quality of clustering is measured by:

Reading MaterialsGenetic algorithm-based clustering technique Pattern Recognition , vol. 33(9), 200057

Open QuestionsParameter ControlParameter TuningHeuristics for changing parameter values on the run

Constraint HandlingAll real-world problems have constraints.Box-Bound ConstraintsLinear Constrains

Multi-Objective OptimizationObjectives may be contradicting.Model Complexity vs. Prediction AccuracyProfit vs. Risk

58Pareto Front59

ReviewBasic Concept of GAs

Major ComponentsCrossoverMutationSelectionRepresentation

GA Framework

Practical Issues

Applications in Feature Selection & Clustering

Take a break and come back in 5 minutes.

60

Genetic Programming and evolvable Things61

GA vs. GPGP is a branch of GAs.Crossover/Mutation/Selection

RepresentationGA: Strings of numbers (0/1)GP: Computer programs in tree structure (LISP)

OutputGA: A set of parameter values optimizing the fitness functionGP: A computer program (Yes, a computer program!)

John KozaGenetic Programming: On the Programming of Computers by Means of Natural Selection. Cambridge, MIT Press, 1992.www.genetic-programming.org

62Functions & TerminalsImportant Concepts in GP

Building Block of Computer Programs

Terminal SetVariables: x, y, z Constants: 1, 2, 3,

Function Set+, -, *, /Problem specific functions

63

Crossover64

Crossover65

Mutation66

An Example of GPSymbolic Regression

Given a set of data points (x, y)

Evolve a quadratic polynomialApproximation of y given xFind the underlying function y=f(x).

Fitness EvaluationAbsolute values of the differences (errors)|y-y |67

Generation 0T = {X, R} F = {+, -, *, %} 68

Generation 0Fitness Values690.67(a)

1.0(b)

1.70(c)

2.67(d)

Generation XOptimal Solution70

ReviewTree-Structured Computer ProgramsFlexible in lengthProblem specific functions and terminals

ApplicationsRegression problemControl problemClassification

Genetic Programming and Evolvable Machines Journal

Evolvable HardwareCircuits that change their architecture and behavior dynamically and autonomously by interacting with its environment.71

Evolvable Circuits72

Antenna for NASA73

http://www.nasa.gov/centers/ames/news/releases/2004/antenna/video.htmlCar Design74

Artificial Life75

Evolutionary Arts76

What is the major challenge?Evolving Mona Lisa77

http://alteredqualia.com/visualization/evolve/

Parallel Computing78

There are many parallel components in EAs

There is No Fate But What We Evolve 79

Take Home MessageEvolutionary AlgorithmsA group of nature-inspired algorithmsGeneral purpose techniques (Very Powerful!)

Genetic Algorithms can do Function OptimizationFeature SelectionClassificationClustering

Genetic Programming can doRegressionClassificationIntelligent Design

80

Chart18.23.21.41.2

Roulette Wheel SelectionSales

Sheet1Sales1st Individual8.22nd Individual3.23rd Individual1.44th Individual1.2To resize chart data range, drag lower right corner of range.

Chart14123

Rank SelectionSales

Sheet1Sales1st Individual42nd Individual13rd Individual24th Individual3To resize chart data range, drag lower right corner of range.