CSP Examples Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
Lecture 11 Last Time: Local Search, Constraint Satisfaction Problems Today: More on CSPs.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Satisfaction problems (CSP)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
Constraint Satisfaction Problems
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Satisfaction Problems
Constraint Satisfaction
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint Satisfaction Problems
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 4 Constraint Satisfaction Problems Instructor: Alireza Tavakkoli September 17, 2009 University.
1 Constraint Satisfaction Problems Slides by Prof WELLING.
CSPs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
CSPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CSC 8520 Spring Paula Matuszek Based on Hwee Tou Ng, aima.eecs.berkeley.edu/slides-ppt, which are based on Russell, aima.eecs.berkeley.edu/slides-pdf.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 Chapter 5 Constraint Satisfaction Problems. 2 Outlines  Constraint Satisfaction Problems  Backtracking Search for CSPs  Local Search for CSP  The.
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
CSPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
Lecture 5: Solving CSPs Fast! 1/30/2012 Robert Pless – Wash U. Multiple slides over the course adapted from Kilian Weinberger, Dan Klein (or Stuart Russell.
MDPs (cont) & Reinforcement Learning
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
CSE 473: Artificial Intelligence Constraint Satisfaction Daniel Weld Slides adapted from Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer.
Constraint Satisfaction Problems (Chapter 6)
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Grand Challenge:
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Constraint Satisfaction Problems University of Berkeley, USA
4/18/2005EE5621 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 5, 4/18/2005 University of Washington, Department of Electrical Engineering Spring.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
EXAMPLE: MAP COLORING. Example: Map coloring Variables — WA, NT, Q, NSW, V, SA, T Domains — D i ={red,green,blue} Constraints — adjacent regions must.
Constraint Propagation Artificial Intelligence CMSC January 22, 2002.
CS 188: Artificial Intelligence Fall 2006 Lecture 5: CSPs II 9/12/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either Stuart Russell.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Dr. Shazzad Hosain Department of EECS North South University Lecture 01 – Part C Constraint Satisfaction Problems.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (Chapter 6)
ECE 448, Lecture 7: Constraint Satisfaction Problems
Advanced Artificial Intelligence
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Lecture 15: Structure from motion
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

CSP Examples Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore, Percy Liang, Luke Zettlemoyer

Announcements/Reminders HW1 due date extended to Sunday, Sept 13, 11:59pm on classroom server – submit one solution per group and Ric with the location of your directory and names of your group

Review from last class

Backtracking search In CSP’s, variable assignments are commutative – For example, [WA = red then NT = green] is the same as [NT = green then WA = red] We only need to consider assignments to a single variable at each level (i.e., we fix the order of assignments) Depth-first search for CSPs with single-variable assignments is called backtracking search

Example

Red?Green?Blue? x xx x

Backtracking search algorithm

Improving Backtracking Efficiency Ordering – How should we order variables for assignment? – How should we order values from the domains?

Backtracking search algorithm

Improving Backtracking Efficiency Ordering – How should we order variables for assignment? – How should we order values from the domains? Filtering – Can we detect inevitable failures early?

Early detection of failure Apply inference to reduce the space of possible assignments and detect failure early

Early detection of failure: Forward checking Keep track of remaining legal values for unassigned variables Terminate search when any variable has no legal values

Simplest form of constraint propagation makes each pair of variables consistent: – X  Y is consistent iff for every value of X there is some allowed value of Y Arc consistency Consistent!

Simplest form of constraint propagation makes each pair of variables consistent: – X  Y is consistent iff for every value of X there is some allowed value of Y Arc consistency

Simplest form of propagation makes each pair of variables consistent: – X  Y is consistent iff for every value of X there is some allowed value of Y – When checking X  Y, throw out any values of X for which there isn’t an allowed value of Y If X loses a value, all pairs Z  X need to be rechecked Arc consistency

Simplest form of propagation makes each pair of variables consistent: – X  Y is consistent iff for every value of X there is some allowed value of Y – When checking X  Y, throw out any values of X for which there isn’t an allowed value of Y Arc consistency detects failure earlier than forward checking Can be run before or after each assignment Arc consistency

Improving Backtracking Efficiency Ordering – How should we order variables for assignment? – How should we order values from the domains? Filtering – Can we detect inevitable failures early? Structure – Can we exploit problem structure?

Tasmania and the mainland are separate structures. We can solve them independently and then combine their solutions. More generally, we can decompose the CSP into separate connected components (sub-problems of the CSP). Then the solution is the union of the sub- problem solutions. This can be much more efficient than solving the entire CSP as one problem.

Algorithm for tree-structured CSPs Choose one variable as root, order variables from root to leaves such that every node's parent precedes it in the ordering

Algorithm for tree-structured CSPs Choose one variable as root, order variables from root to leaves such that every node's parent precedes it in the ordering Backward removal phase: check arc consistency starting from the rightmost node and going backwards

Algorithm for tree-structured CSPs Choose one variable as root, order variables from root to leaves such that every node's parent precedes it in the ordering Backward removal phase: check arc consistency starting from the rightmost node and going backwards Forward assignment phase: select an element from the domain of each variable going left to right. We are guaranteed that there will be a valid assignment because each arc is arc consistent

Alternatives to backtracking

Local Search Methods Local Search: Improve what you have until you can’t make it better Generally much faster and more memory efficient than back-tracking search (but not necessarily complete)

Local search for CSPs Start with an initial assignment of variables to values Allow states with unsatisfied constraints Attempt to improve states by reassigning variable values Hill-climbing search: – In each iteration, randomly select any conflicted variable and choose value that violates the fewest constraints – I.e., attempt to greedily minimize total number of violated constraints h = number of conflicts

Local search for CSPs Start with “complete” states, i.e., all variables assigned Allow states with unsatisfied constraints Attempt to improve states by reassigning variable values Hill-climbing search: – In each iteration, randomly select any conflicted variable and choose value that violates the fewest constraints – I.e., attempt to greedily minimize total number of violated constraints – Problem: local minima h = 1

Origin of CSPs

CSP in computer vision: Line drawing interpretation An example polyhedron: David WaltzDavid Waltz, 1975 Desired output: Goal: Label lines in drawing as convex (+), concave (-), or boundary (>). How could we set this up as a CSP? Variables? Domains? Constraints?

CSP in computer vision: Line drawing interpretation Four vertex types: Constraints imposed by each vertex type: David WaltzDavid Waltz, 1975

CSPs in recent research!

Inferring Temporal Order of Images from 3d Structure Grant Schindler, Frank Dellaert, Sing Bing Kang IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR),

The World Changes Over Time How can we reason about time in structure from motion problems?

Ultimate Goal Produce time-varying 3d models of cities from historical photographs Requires: Building 3d models Reasoning about time

Temporal Inference Problem 1. When was each photograph taken? 2. When did each building first appear? 3. When was each building removed? Set of Photographs: Set of Objects: Buildings

Temporal Inference Problem (a, b)Time Interval tTime Temporal Inference Problem Given observations Z and scene geometry X, what are the temporal parameters T? Images Structure from Motion (x,y,z)Position (x,y,z)Translation (y,p,r)Rotation f Focal Length Structure Cameras Correspondence s 3D

Overview 3D Images + Time Structure + Time Intervals Buildings D Correspondences Images

Overview 3D Images + Time Structure + Time Intervals Buildings D Correspondences Images

Overview 3D Images + Time Structure + Time Intervals Buildings D Correspondences Images

Overview 3D Images + Time Structure + Time Intervals Buildings D Correspondences Image s

3D Reconstruction Images 3D Point Cloud Structure from Motion Bundler Software by Noah Snavely (Snavely et al SIGGRAPH 2006)

Scene Reconstruction Automatically estimate – position, orientation, and focal length of cameras – 3D positions of feature points Feature detection Pairwise feature matching Pairwise feature matching Incremental structure from motion Correspondence estimation

Input Photos

Feature detection Detect features points on objects [Lowe, IJCV 2004]

Pairwise feature matching Match feature points between each pair of images

Correspondence estimation Link up pairwise matches to form matches across several images Image 1Image 2Image 3Image 4

Structure from motion Camera 1 Camera 2 Camera 3 R 1,t 1 R 2,t 2 R 3,t 3 p1p1 p4p4 p3p3 p2p2 p5p5 p6p6 p7p7 minimize f (R, T, P)f (R, T, P)

Incremental structure from motion See: e.g. for more infohttp://

Grouping Points into Buildings 3D Point Cloud 3D Buildings Building Geometry 1. Convex hull of each group 2. Fit ground plane to camera centers 3. Extend convex hulls to ground Point Grouping Group points according to both: a. Distance < threshold in 3D b. Observed simultaneously in 1+ images

3D Reconstruction: Points vs. Objects Lower Manhattan 454 images 83,860 points960 Buildings

Reasoning About Time: From Constraint Satisfaction… Key Idea: Visibility of 3D points constrains image ordering Variables? Domains? Constraints? Disadvantage: Only relative image ordering

Visibility Reasoning Goal: reorder images (columns) to have as few violations as possible observed missing occluded Columns: images Rows: points Violates constraints: Satisfies constraints:

Temporal Ordering via CSP Goal: reorder images (columns) to have as few violations as possible Backtracking search: intractable (n! solutions for n images) Local search: start with random ordering of columns, swap columns or groups of columns to reduce the number of conflicts

Results...

Temporal Ordering via CSP Goal: reorder images (columns) to have as few violations as possible Local search: start with random ordering of columns, swap columns or groups of columns to reduce the number of conflicts Can also reorder the rows to group together points that appear and disappear at the same time – that gives you buildings

Results: Time-varying 3d model

... Results

Conclusions Authors demonstrated that constraint satisfaction problems provide a powerful framework in which to solve temporal ordering problems Presented the first known method for solving this ordering problem. Remaining challenges? – Dealing with noise in classification of points as observed/missing/occluded.