& Evolving 3D Morphology and Behavior by Competition Papers by Karl Sims Presented by Sarah Waziruddin
Jan 03, 2016
Evolving Virtual Creatures&Evolving 3D Morphology and Behavior by Competition
Papers by Karl SimsPresented by Sarah Waziruddin
Motivation
• What: Automatically generate physically simulated characters without fully understanding the procedures used to control them
• How: Utilize optimization technique to generate complex behaviours automatically
Use of Optimization in this paper
• Genetic Algorithm used as an optimization technique to search genotypes (encoding of a solution)
Genetic AlgorithmsGenetic Algorithms
Imitate the processes of evolution and Imitate the processes of evolution and natural selection in biological world to natural selection in biological world to generate/evolve the best solutiongenerate/evolve the best solution
Genetic AlgorithmsGenetic Algorithms
Goal: Goal: Create a computer program to solve Create a computer program to solve a problem defined by high level a problem defined by high level statementsstatements
High level statements:High level statements: Define objective function Define objective function Define and implement genetic representationDefine and implement genetic representation Define and implement genetic operators Define and implement genetic operators
Genetic AlgorithmsGenetic Algorithms [Start] [Start] Generate random population of Generate random population of nn suitable solutions suitable solutions
for the problemfor the problem [Fitness][Fitness] Evaluate the fitness of each solution in the Evaluate the fitness of each solution in the
population population [New population] [New population] Create a new population: Create a new population:
[Selection] [Selection] Select two parent solutions from a Select two parent solutions from a population according to their fitness (the better fitness, population according to their fitness (the better fitness, the bigger chance to be selected) the bigger chance to be selected)
[Mutation][Mutation] With a mutation probability, mutate new With a mutation probability, mutate new offspring at each position in solution offspring at each position in solution
[[Sexual Reproduction]Sexual Reproduction] With some probability, combine With some probability, combine parents to form new offspringparents to form new offspring
[Replace][Replace] Replace current population with newly generated Replace current population with newly generated population population
[Test][Test] If the end condition is satisfied, If the end condition is satisfied, stopstop, and return the , and return the best solution in current population best solution in current population
[Loop][Loop] Go to Fitness Step Go to Fitness Step
Application of Genetic AlgorithmApplication of Genetic Algorithm
Define objective functionDefine objective function Define and implement genetic Define and implement genetic
representationrepresentation Define and implement genetic Define and implement genetic
operatorsoperators
Objective FunctionObjective Function
Stated implicitlyStated implicitly To create realistic looking and To create realistic looking and
acting creaturesacting creatures Fitness functions used to help Fitness functions used to help
evaluate if the objective function is evaluate if the objective function is satisfiedsatisfied
Genetic RepresentationGenetic Representation
Defined by creature morphology and Defined by creature morphology and neurologyneurology
Morphology: “The form and structure of Morphology: “The form and structure of an organism or one of its parts”an organism or one of its parts”
Neurology (Nervous system): “The Neurology (Nervous system): “The system of cells, tissues, and organs that system of cells, tissues, and organs that regulates the body's responses to internal regulates the body's responses to internal and external stimuli”and external stimuli”
Creature Morphology• Articulated three dimension rigid body parts
• Represented as a directed graph of nodes and connections
• Each node describes one body part– Many parameters to a node
Creature NeurologyCreature Neurology
Comprised of:Comprised of: Sensors Sensors NeuronsNeurons EffectorsEffectors
Sensors
• Each sensor is at a different part of the body
• Measure– That body part– The world relative to that body part
• Different types of sensors– Joint angle sensor– Contact sensors– Photo sensors
Neurons
• Virtual brain: Function based on sensor input • Provides output effector values
Effectors
• Each effecter controls a degree of freedom in a joint
• Each effectors value is applied as forces or torques
• Only exert simulated muscle force• Connected to neuron or sensor
Neural System
• Local neural system:– Neural system generated along with
morphological system– Connection allowed between local neural
systems
• Global neural system:– Neurons not associated with a specific node– Can be connected with local neural systems
Genetic Operators: Mutation (1/5) Genetic Operators: Mutation (1/5) Alter internal node parametersAlter internal node parameters
Dimensions- determine the physical shape of the Dimensions- determine the physical shape of the partpart
Joint type- number of DOF for each joint and Joint type- number of DOF for each joint and movement allowed for each DOFmovement allowed for each DOF
Joint limits- point where spring forces will be Joint limits- point where spring forces will be exerted for each DOFexerted for each DOF
Recursive limitRecursive limit Set of local neuronsSet of local neurons Set of connections to other nodesSet of connections to other nodes
Position, orientation, scale and reflection Position, orientation, scale and reflection relative to parent relative to parent
Genetic Operators: Mutation (2/5) Genetic Operators: Mutation (2/5) Add a new node at randomAdd a new node at random
Leg Segment
BodySegment
Head Segment
Genetic Operators: Mutation (3/5) Genetic Operators: Mutation (3/5) Parameter of each connection is Parameter of each connection is
subject to changesubject to change
Leg Segment
BodySegment
9045
Genetic Operators: Mutation (4/5) Genetic Operators: Mutation (4/5) New connections are added at New connections are added at
random and old ones are deletedrandom and old ones are deleted
Leg Segment
BodySegment
Head Segment
Genetic Operators: Mutation (5/5) Genetic Operators: Mutation (5/5) Delete unconnected nodesDelete unconnected nodes
Leg Segment
BodySegment
Head Segment
Genetic Operators: CrossoverGenetic Operators: Crossover
Genetic Operators: GraftingGenetic Operators: Grafting
Genetic AlgorithmsGenetic Algorithms [Start] [Start] Generate random population of Generate random population of nn suitable solutions suitable solutions
for the problemfor the problem [Fitness][Fitness] Evaluate the fitness of each solution in the Evaluate the fitness of each solution in the
population population [New population] [New population] Create a new population: Create a new population:
[Selection] [Selection] Select two parent solutions from a Select two parent solutions from a population according to their fitness (the better fitness, population according to their fitness (the better fitness, the bigger chance to be selected) the bigger chance to be selected)
[Mutation][Mutation] With a mutation probability, mutate new With a mutation probability, mutate new offspring at each position in solution offspring at each position in solution
[[Sexual Reproduction]Sexual Reproduction] With some probability, combine With some probability, combine parents to form new offspringparents to form new offspring
[Replace][Replace] Replace current population with newly generated Replace current population with newly generated population population
[Test][Test] If the end condition is satisfied, If the end condition is satisfied, stopstop, and return the , and return the best solution in current population best solution in current population
[Loop][Loop] Go to Fitness Step Go to Fitness Step
Start
• Generate random population of n suitable solutions for the problem – Random generation of nodes and connections– Use existing genotype to seed function– Create genotype manually to seed function
FitnessFitness
Swimming, walking, jumping Swimming, walking, jumping Distance travelled by COM/unit of timeDistance travelled by COM/unit of time
FollowingFollowing Speed at which creature moves towards Speed at which creature moves towards
targettarget CompetitionCompetition
Pairs of individuals compete for control over a Pairs of individuals compete for control over a cubecube
Final distance of the creature from cube and Final distance of the creature from cube and opponents final distance from cubeopponents final distance from cube
New populationNew population
Survival ratio: 1/5 of 300Survival ratio: 1/5 of 300 40% mutation, 30% crossover, 30% 40% mutation, 30% crossover, 30%
graftinggrafting Children from crossover and Children from crossover and
grafting are sometimes mutatedgrafting are sometimes mutated
Results
• Different runs converged on characters with different evolved characteristics
• Specify a User Preference using the Algorithm– User can specify a preference over multiple runs
of the simulation– User can perform the natural selection
ResultsResults
VideoVideo
Advantages
• Generate characters without specification or knowledge about exactly how they work
• Less likely to get stuck on a local solution since we are searching on an encoding
• Easy to parallelize
Disadvantages
• The characters could produce incorrect behaviour that could go undetected because of the lack of understanding of the underlying algorithm
• Process is not very reusable Can reuse some of the components of the
implementation, for example, the neuron language
• Genetic Algorithms sometimes require a lot of tweaking to work right
Disadvantages
• Difficult to obtain ideal size for the neuron language, node types and parameters (joint types and parameters and connection parameters), sensor and effecter types
• i.e. Difficult to obtain best size for the search space – If the size is too small, then there aren't enough variations
in the population– If the size is too large, then changes in isolated parts of
the creature do not have a big affect on the behavior or structure
Questions
?
ReferencesReferences
http://www.genetic-programming.com/http://www.genetic-programming.com/ http://lancet.mit.edu/~mbwall/presentationhttp://lancet.mit.edu/~mbwall/presentation
s/IntroToGAs/s/IntroToGAs/ http://cs.felk.cvut.cz/~xobitko/ga/http://cs.felk.cvut.cz/~xobitko/ga/
Physical Simulation
Dynamics used to calculate movement of characters– Articulated body dynamics– Numerical Integration– Collision detection and response– Friction– Option viscous fluid
Crucial for the physical simulator to be bug free as the GA will find ways to exploit bugs