6 Introduction to Behaviors Is the reactive layer
6 Introduction to Behaviors Is the reactive layer really like ethology? If so, how do you get that crunchy-chewy animal documentary stuff into a computational format? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 1
6 Specific Learning Objectives • Describe three levels in a Computational Theory Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • Explain in one or two sentences each of the three categories of behaviors (reflexive, reactive, conscious) and reflexive behaviors: (reflexes, taxes, fixed-action patterns) • Be able to use schema theory to decompose an overall behavior into object-oriented modules (motor and perceptual schemas) • Express a set of behaviors using S-R notation © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 2
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Recall: Reactive 1 SENSE ACT PLAN 2 © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 3
6 Reactive Robots Use Behaviors RELEASER Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary SENSE behavior ACT • Behaviors (independent processes), released by perceptual or internal events (state) • No world models or long term memory • Highly modular, generic • Overall behavior emerges © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 4
6 Reactive Robots Use Behaviors RELEASER Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary ? ? ? SENSE behavior ACT • Behaviors (independent processes), released by perceptual or internal events (state) • No world models or long term memory • Highly modular, generic • Overall behavior emerges © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 5
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary VIA A STORY OF SUMMER JOBS, LEUKEMIA, FROGS, AND OBJECT-ORIENTED PROGRAMMING David Marr’s Computational Theory Michael Arbib and Rana Computatrix S-R Notation Schema Theory © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 6
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary The Summer job from hell… © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 7
6 Let’s return to the late 60’s Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • MIT: photos to line drawings • Children can recognize objects based on line drawings, how hard can it be? – Hubel and Wiesel © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 8
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Let’s return to the late 60’s a e r , y eall r a h lly d , n o s r e p ) r r a e s r t ’ t u fo i p y y m s l l a co e a u s a ’ t r it o f f Ac i d r r: a e h b e m b e o m (re ikely t l s ’ t i • MIT: photos to line drawings • Children can recognize objects based on line drawings, how hard can it be? – Hubel and Wiesel © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 9
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary The Last Outpost- courtesy of You. Tube © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 10
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary David Marr • Neuroscientist • Came to MIT in the late 1970 s • Brought together neuroscience, psychology, and computer science • Died 1980 © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 11
Marr’s Computational Theory Level 1 (theory/computational): What is the phenomena we’re trying to represent? Level 2 (algorithmic): How it be represented as a process with inputs/outputs? for (i=n)Col. . Level 3 (implementation): How is it implemented? 12
6 Level 1: Existence Proof Goal: how to make line drawings of objects? people can do this by age 10, computers should Level 1: What is the phenomena we’re trying to represent? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 13
6 Level 2: Inputs, Outputs, Transforms light drawing lines (edges) retina (gradient) Level 2: How it be represented as a process with inputs/outputs? drawing for (i=n)Col. . © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 14
6 Level 3: Implementation - - + - - Center Surround Cell in retinal ganglion -1 0 +1 -2 0 +2 -1 0 +1 +1 +2 +1 0 0 -1 -2 -1 0 Sobel Edge Detector in computer vision Level 3: How is it implemented? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 15
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Industrial Espionage is Common • Examples of how biology has informed modern technology – Manned flight – Sonar – Velcro – Saw blades – From http: //en. wikipedia. org/wiki/Bionics © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 16
6 Thought Question • Are three levels of a computational theory roughly analogous to the three types of architectures (operational, systems, technical)? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 17
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary So the principles of industrial espionage can be captured in Artificial Intelligence as a computational theory…. But WHERE DO THE FROGS COME IN? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 18
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Rana Computatrix • Michael Arbib in late 1970 s, early 80’s began studying animal intelligence as a means of understanding robot intelligence • Targeted frog and toad studies where there was a good neurophysiological (how) and ethological (what) understanding, or neuroethology • Focused on visuomotor coordination © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 19
6 4 F’s of Survival (Arbib) • Feeding Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • Fleeing • Fighting • Reproduction © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 20
6 Fly Snapping Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 21
6 Fly Not Snapping Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Not dead flies, Even if starving Not live flies, If not moving © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 22
6 Back to Fly Snapping Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 23
6 Back to Fly Snapping Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 24
6 Rana Computatrix • Frog is not PLAN-ing, it’s re-ACT-ing to SENSE-d • The reaction is technically called a “reflex” or a reflexive behavior – Sense-act in our primitives or – Stimulus-response or S-R © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 25
6 Side Note: Types of Behaviors • Reflexive Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary – stimulus-response, often abbreviated S-R • Reactive – learned or “muscle memory” • Conscious – deliberately stringing together WARNING Overloaded terms: Roboticists often use “reactive behavior” to mean purely reflexive, and refer to reactive behaviors as “skills” © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 26
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary How Does this Relate to Behaviors? • According to our reactive layer organization, there should be SENSE-ACT modules • What is the ACTing? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 27
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Recall: Reactive Layer SENSE ACT PLAN © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 28
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary So… SENSE-ACT Pairs • According to our reactive layer organization, there should be SENSE-ACT modules • What is the ACTing? Snap Orient towards and snap Runaway Orient away and move © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 29
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary So… SENSE-ACT Pairs • According to our reactive layer organization, there should be SENSE-ACT modules • What is the SENSEing? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 30
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary “Percept” is a Label We Impose • According to our reactive layer organization, there should be SENSE-ACT modules • What is the SENSEing? “Predator” Large and looming “Prey” Small and looming © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 31
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Here They Are! • According to our reactive layer organization, there should be SENSE-ACT modules Prey detector Predator detector Snap Runaway © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 32
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Two Behaviors • According to our reactive layer organization, there should be SENSE-ACT modules Prey detector Predator detector Snap Runaway FEED FLEE © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 33
6 INTERESTING BUT WHERE ARE WE GOING WITH THIS? - How to represent mathematically (S-R notation) and convert to programming objects (schema theory) © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 34
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Lesson • A behavior is a sense-act pair, in this case a visuomotor pair • “Behavior” for rana computatrix could be considered two behaviors, each with a unique action and percept • The two percepts were derived from the same input (vision) Reactive layer: sense-act pairs, local sensing that could be used by multiple behaviors © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 35
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Lesson • A behavior is a sense-act pair, in this case a visuomotor pair • “Behavior” for rana computatrix could be considered two behaviors, each with a Concepts: Schema Theory to decompose unique action and percept into object-like modules and express using S-R notation • The two percepts were derived from the same input (vision) © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 36
6 Behavior Official Definition BEHAVIOR, B Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary S S, Sensory Input R R. Pattern of Motor Actions (responses) {B: S->R} A behavior is a mapping of sensory inputs to a pattern of motor actions which are then used to achieve a task. © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 37
6 S-R Notation B[S]=R Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • Notionally, a Behavior B is represented as a function with input S (for sensing) and output R (for reaction or response) – B, S, R will also be functions – S will take sensor data and return a percept – R will take the percept and return an action • It connotes a self-contained loop that is independent of other behaviors; it is complete © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 38
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Return to the Frogs: S-R Notation Using B[S]=R, we’d say Flee[predator]=Runaway Feed[prey]=Snap © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 39
6 Multiple Independent Behaviors Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 40
6 Side Note: Factoring functions Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 41
6 Side Note: Factoring functions © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 42
6 See a trend? • The SENSE and ACT modules are reusable modules Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • The SENSE and ACT modules are templates that can be instantiated with different conditions (e. g. Predator, Prey) to produce results © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 43
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Before object-oriented programming… © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 44
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Before object-oriented programming… Before programming… © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 45
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Before object-oriented programming… Before programming… Is she counting Ada Lovelace? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 46
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Before object-oriented programming… Before programming… There was SCHEMA THEORY! © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 47
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Schema Theory as a Computational Theoretic Way of Programming schema- is used in cognitive science and ethology to refer to a particular organized way of perceiving cognitively and responding to a complex situation or set of stimuli • is generic, equivalent to an object in OOP: can encapsulate 2 types of knowledge: – schema specific knowledge (local data) – procedural knowledge (methods) • schema instantation is specific to a situation, equivalent to an instance in OOP • A schema can be composed of other schemas © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 48
6 Schema: 2 Parts • Local data or schema specific knowledge Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • Procedural knowledge – Motor – Perceptual © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 49
6 Pareto Principle • 80% of any AI app is finding the right knowledge representation Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • In this case, it’s “procedural” knowledge of how to sense and act • Want to find structures and control schemes © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 50
6 Where are the Schemas/Objects in B(S)=R? S=Prey R= snap Feeding BEHAVIOR Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Pattern of Sensory Input Pattern of Motor Actions © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 51
6 Perceptual Schema S=Prey R= snap Feeding BEHAVIOR Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Pattern of Sensory Input Pattern of Motor Actions Perceptual Schema © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 52
6 Motor Schema S=Prey R= snap Feeding BEHAVIOR Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Pattern of Sensory Input Perceptual Schema Pattern of Motor Actions Motor Schema © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 53
6 Behavioral Schema= PS+MS S=Prey R= snap Feeding BEHAVIOR Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Pattern of Sensory Input Pattern of Motor Actions Perceptual Schema Motor Schema Behavioral Schema © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 54
Behavioral Schema is made up of 2 schemas 6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary sensor Perceptual Schema (PS) percept, strength Motor Schema (MS) Action, gain Behaviors must have a PS and MS, though 1 can be NULL Reflexive behaviors usually just have “methods”, not data © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 55
6 2 Parts of a Schema Behavior-specific knowledge Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary data Methods (2) sensor Perceptual Schema (PS) percept, strength Motor Schema (MS) Action, gain Behavior specific knowledge can be timers, logic for instantiating the appropriate perceptual schema, etc. © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 56
6 Thought Exercise Find the behaviors (and SENSE ACT modules) for the following robot Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary A very small security guard robot hears a noise and homes in on it. © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 57
6 Robot Exercise Find the behaviors (and SENSE ACT modules) for the following robot A very small security guard robot hears a noise and homes in on it. HOMING Intruder: Detect Sound Direction Home: Move Towards © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 58
6 S-R Notation Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 59
6 Robot Exercise Find the behaviors (and SENSE ACT modules) for the following robot Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary A very small security guard robot hears a noise and homes in on it. HOMING Detect Sound Direction Doesn’t it need to plan So it won’t get stuck? Move Towards © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 60
6 Robot Exercise Find the behaviors (and SENSE ACT modules) for the following robot Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary A very small security guard robot hears a noise and homes in on it. If it is blocked, it turns to the most open area. HOMING © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 61
6 Robot Exercise Find the behaviors (and SENSE ACT modules) for the following robot Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary A very small security guard robot hears a noise and homes in on it. If it is blocked, it turns to the most open area. HOMING AVOID Blocked Turn to Open Area © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 62
6 S-R Notation Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 63
6 Robot Exercise Find the behaviors (and SENSE ACT modules) for the following robot Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary A very small security guard robot hears a noise and homes in on it. If it is blocked, it turns left or right randomly and continues on. Don’t they need to Be coordinated? HOMING AVOID Blocked Turn to Open Area © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 64
6 But Both Can Be “On” At Same Times • One can subsume the other • Do a combination • … (future lectures) © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 65
6 Advantages of Schemas • modular Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • can assemble new behaviors from existing schemas – learning by experimentation • can substitute alternatives – reroute nerves © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 66
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary SUMMARY © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 67
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • It is often helpful to turn to biology for principles of intelligence and we often discuss the relationship in terms of a computation theory • A behavior is a mapping of sensory inputs to a pattern of motor actions which are then used to achieve a task • This can be represented notationally S-R (stimulusresponse) notation • Behaviors can be grouped into recursively composable programming objects using schema theory © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 68
6 Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary Return to Questions • Is the reactive layer really like ethology? If so, how do you get that crunchy-chewy animal documentary stuff into a computational format? – Marr’s Computational Theory gives a framework – SR Notation- gives us a mathematical representation for behaviors – Schema theory gives us the Schema Object • 2 parts: data, procedural • Recursive building blocks – Ethology suggests 3 types of schemas • Behavioral schema • Perceptual schema • Motor schema © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 69
6 Questions for Next Time • What goes in the schemas, especially the perceptual schema? Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary • Don’t you need some sort of coordination to get complex emergent behavior? © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 70
6 Questions for Next Time • What goes in the schemas, especially the perceptual schema? Objectives Motivation Comp. Theory R. Computatrix S-R notation Schema Theory Summary – Affordances • Don’t you need some sort of coordination to get complex emergent behavior? – Innate releasing mechanisms – gains © 2019 Robin Murphy Introduction to AI Robotics 2 nd Edition (MIT Press 2019) 71
- Slides: 71