What is Artificial Intelligence? ENGG1811: Computing for Engineers • Meet ELIZA • Written between 1964-1966 • At MIT by Joseph Weizenbaum Artificial Intelligence – What Is Artificial Intelligence? – Why Study AI? – Fields in AI – Expert Systems – Machine Learning – Natural Language Processing – Vision & Perception – Robotics – Decision Trees – Summary ! A * on slide title means it contains something examinable ENGG1811 © UNSW, CRICOS Provider No: 00098G 1 ENGG1811 2 © UNSW, CRICOS Provider No: 00098G Is ELIZA Intelligent? * What is Artificial Intelligence? • No? • Asks silly questions • Yes? • Processes Human Text • Does what a physiologist does • What is Artificial Intelligence? • Human-like Intelligence? !“What is intelligence, anyway? It is only a word that people use to name those unknown processes with which our brains solve problems we call hard. But whenever you learn a skill yourself, you are less impressed or mystified when other people do the same. ! This is why the meaning of “intelligence” seems so elusive: It describes not some definite thing but only the momentary horizon of our ignorance about how minds might work.” - Marvin Minsky The exciting new effort to make computers think … Machines with Minds - Haugeland 1985 The study of how to make computers do things at which, at the moment, people are better - Rich and Knight, 1991 ENGG1811 © UNSW, CRICOS Provider No: 00098G 3 ENGG1811 © UNSW, CRICOS Provider No: 00098G The art of creating machines that perform functions that require intelligence when performed by people - Kurzweil, 1990 4 * Turing Test Alan Turing (1912−1954) In 1950, Turing published a paper defining intelligence by imagining a test, called the Turing test Turing, considered by many to be the father of computer science, was a brilliant cryptographer and provided much of the mathematical basis for cracking the German Enigma codes during WWII. In this test, an interrogator sits alone in room and types questions into a computer terminal. The questions can be about anythingmaths, science, politics, sports, art, entertainment, emotions anything. The interrogator tries to guess whether those answers came from a person or a computer on the other end of the wire Despite being largely responsible for saving thousands of Allied lives he was later persecuted by the British authorities for his homosexuality and committed suicide in 1954, aged just 41. He chose to enact a Snow White death, eating an apple laced with cyanide (Steve Jobs denied that the Apple logo is in homage to Turing, but it makes a great story). ENGG1811 © UNSW, CRICOS Provider No: 00098G Source of images: Wikipedia 5 If a computer could answer well enough that the interrogator cannot tell whether there is a person or a machine answering, the machine is said to be intelligent ENGG1811 © UNSW, CRICOS Provider No: 00098G Is Human-like Intelligence Enough? * What is Artificial Intelligence? • Deep Blue • There are many definitions • The debate still rages • Systems that Act Rationally • A system that usually makes a sensible action • Could be the action a human makes • But humans sometimes make mistakes • Waston • Self-Driving Cars • Robotic Soccer 6 AI … is concerned with intelligent behaviour in artefacts - Nilsson, 1998 The study of computations that make it possible to perceive, reason and act - Winston, 1992 ENGG1811 © UNSW, CRICOS Provider No: 00098G 7 ENGG1811 © UNSW, CRICOS Provider No: 00098G 8 * Why Study AI? * Major Areas of AI Why would we want artificial intelligence? • Perform computationally difficult tasks • Reduce Human Errors • Make Jobs safer • Make machines easier to use • Study the human mind or intelligence • Amplify our own intelligence There are many areas of study that come under the general heading of AI: • Knowledge Representation and Reasoning • Search and Planning • Machine Learning • Natural Language Processing • Vision and Perception • Robotics ENGG1811 © UNSW, CRICOS Provider No: 00098G 9 ENGG1811 © UNSW, CRICOS Provider No: 00098G * Knowledge Representation and Reasoning * Knowledge Representation and Reasoning Information needs to be represented in a formation the computer can understand so that an AI system can reason (or make decisions) about it. The is an important and challenging part of AI. How would you represent? A Spreadsheet? X O O An Image? An Object? X The Rules of a Game? (like Tic-Tac-Toe) First Order Logic can be processed quickly by computers • Facts are expressed by True/False atoms occupied(x, 1, 1) • Rules state what can and cannot be true occupied(x,1,1) and … => 3_in_row 3_in_row => win ENGG1811 © UNSW, CRICOS Provider No: 00098G 10 ! More complex logic languages can give even more powerful expressions. 11 ENGG1811 © UNSW, CRICOS Provider No: 00098G 12 * Knowledge Representation and Reasoning * Search and Planning Logic is hard for humans to read - but easy for computers. Given a set of facts and rules, how can you find or know the what to do? An AI system needs to search for the right answer, or plan a sequence of actions (or moves) to solve the problem (or win a game). X ! O O X “Blind” Tic-tac-Toe in GDL-II 1 2 3 4 5 6 role(xplayer). role(oplayer). init(control(xplayer)). init(cell(1,1,b)). ... init(cell(3,3,b)). 18 19 20 21 22 23 7 8 9 10 11 12 24 legal(R,mark(M,N)) :- true(control(R)), true(cell(M,N,Z)), not true(tried(M,N)). legal(xplayer,noop) :- true(control(oplayer)). legal(oplayer,noop) :- true(control(xplayer)). 25 26 27 28 29 13 14 30 validmove :- does(R,mark(M,N)), true(cell(M,N,b)). 31 15 16 17 32 next(F) next(tried(M,N)) next(cell(M,N,x)):- validmove, does(xplayer,mark(M,N)). next(cell(M,N,o)):- validmove, does(oplayer,mark(M,N)). next(cell(M,N,Z)):- validmove, true(cell(M,N,Z)), does(P,mark(I,J)), distinct(M,I). next(cell(M,N,Z)):- validmove, true(cell(M,N,Z)), does(P,mark(I,J)), distinct(N,J). next(control(oplayer)):- validmove, true(control(xplayer)). next(control(xplayer)):- validmove, true(control(oplayer)). :- not validmove, true(F). :- not validmove, does(P,mark(M,N)). 33 34 sees(R,yourmove) :- not validmove, true(control(R)). sees(xplayer,yourmove) :- validmove, true(control(oplayer)). sees(oplayer,yourmove) :- validmove, true(control(xplayer)). Figure 1: A GDL-II description of “Krieg-Tictactoe.” The game positions are encoded using the three features control(R), where R ∈ {xplayer, oplayer}; cell(M, N, Z), where M, N ∈ {1, 2, 3} and Z ∈ {x, o, b}, with b meaning “blank;” and 13 © UNSW, CRICOS Provider No: 00098G tried(M, N ). For the sake of simplicity, we have omitted the (straightforward) specification of termination and goal values. ENGG1811 COMP9414/9814/3411 13s1 of this sort is the domain of acDrawing conclusions tion theories, and the Situation Calculus is the oldest technique for formalising and automating reasoning about actions (McCarthy 1963). To be able to exploit this line of research in the context of General Game Playing requires to fully embed the game description language GDL-II into the Situation Calculus. The mapping that we will develop in this section is based on an extended Situation Calculus with a special fluent to represent the knowledge of agents (Scherl and Levesque 2003). We will have to slightly modify and further extend this approach for our purposes. In general, the Situation Calculus is a predicate logic with a few predefined language elements: • constant s0 , denoting the initial situation, and construcMAX (X) tor D O(α, σ), denoting the situation resulting from doing action α in situation σ; • predicate H OLDS(ϕ, σ), denoting that fluent ϕ (i.e., an atomic state feature) is true in situation σ; • predicate P OSS(α, σ), denoting that action α is possible X X X in situation σ. MIN (O) X Games Derived action predicates Compound actions In games with two or more players, a position update results from all players moving simultaneously. An adequate formalisation in the Situation Calculus requires to identify the X α with X X O O a vector . .k.⟩ conconcept of an action ⟨m1 , . . . , m MAX (X) taining one move for each player.OIn a given GDL-II description, the domain of moves is implicitly determined by the arguments of keyword legal and the second arguments of does; e.g. mark(M, N ) and noop in Krieg-Tictactoe. Assuming an arbitrary but fixed order of the players, as in X Ooplayer), X XweOdefine a simple X O axiom that. identifies (xplayer, .. MIN (O) the individual moveXof a player r inXan action vector: We now show how any GDL-II description G can be mapped in a modular way into a Situation Calculus theory. First, some atoms that occur in G are rewritten as follows. ⃗ are replaced by f (X, ⃗ S) and 1. All derived fluents f (X) ⃗ by p(X, ⃗ A, S), indiall derived action predicates p(X) cating the dependence on a situation S and an action A, respectively. ... ... TERMINAL X O X O X O ... Search tree becomes very large, very quickly • Tic-Tac-Toe ≈ 10^5 • Chess ≈ 10^123 • Backgammon ≈ 10^144 • Go (19x19) ≈ 10^360 • (There are 10^80 atoms in the universe) ! Searching the tree efficiently is a major AI problem 4. Each next(ϕ) is replaced by H OLDS(ϕ, Do(A, S)). 5. Each does(ϱ, µ) is replaced by ACT(ϱ, A) = µ. ... © UNSW, CRICOS Provider No: 00098G X O X O O X X X O Search and Planning 3. Each true(ϕ) is replaced by H OLDS(ϕ, S). E.g., ACT(xplayer, ⟨mark(1, 3), noop⟩) = mark(1, 3). ENGG1811 14 2. Each init(ϕ) is replaced by H OLDS(ϕ, s0 ). (1) ACT(r, ⟨m1 , . . . , mr , . . . , mk ⟩) = mr © UNSW, CRICOS Provider No: 00098G 13 Given a GDL-II game description, we identify as primitive fluents those terms that occur in the scope of either of the keywords init(F), true(F), or next(F); in Fig. 1 these are control(R), cell(M, N, Z), and tried(M, N ). As derived fluents we take all domain-specific predicates that depend on true but not on does. Following (Davis 1990), derived fluents do not require their own successor state axioms because their truth-values are fully determined by the game rules once the values of all primitive fluents are fixed in a (successor) situation. The keywords terminal and goal(R,N) are treated as derived fluents, too. In addition to derived fluents, a mapping of GDL-II into the Situation Calculus requires the introduction of the new concept of a derived action predicate. These are the domainspecific predicates that depend on both true and does. Similar to derived fluents, the truth-value of a derived action predicate is fully determined by the game rules once we have fixed both the values of all primitive fluents in a situation and the action that is being taken in that situation. An example of X a derived action X predicate in Krieg-Tictactoe is validmove. X X The mapping X * Search Planning deterministic) Game Treeand (2-player, Let’s play tic-tac-toe ENGG1811 X O X X X O O ... 848 15 ENGG1811 © UNSW, CRICOS Provider No: 00098G 16 * Machine Learning * Machine Learning - Reinforcement Learning Rather than searching for a solution, just “know” the answer. Machine Learning teaches or trains a computer so that it can solve a task (or know what move to make) instantly. Types of Machine Learning include: • Reinforcement Learning • Neural Networks • Classifiers • … and more Like teaching tricks to your pet. Classic problem of Pole-and-Cart • Try to balance the pole • Reward or successful behaviour • Punish if the pole falls down ENGG1811 © UNSW, CRICOS Provider No: 00098G 17 ENGG1811 © UNSW, CRICOS Provider No: 00098G * Natural Language Processing * Vision and Perception Allowing computers to understand and produce meaning from naturally spoken or written language. “Natural” means as you would talk to another person who is fluent in the same language. Talking without using special commands or “dumbed-down” language. Interpret and find objects within an Image. A computer sees an image as an array of numbers, and computer vision finds “meaning” within those numbers. Challenges with vision • Lighting • Inconsistent colour • Occlusion • Distortion • Blur ENGG1811 © UNSW, CRICOS Provider No: 00098G 19 ENGG1811 © UNSW, CRICOS Provider No: 00098G 18 20 * Robotics Robotics - Decision Trees Incorporates many aspects of other fields of AI. In AI, we aim to get robots to solve tasks: • Independently - without human interference • Intelligently - react to changes in the world • In Real Time - the robot can’t sit and think Simple DT in soccer to kick a ball. We have three variables: • can_see (true or false) - can the robot see the ball? • ball_dist (double) : distance ball is from the robot • ball_x (double) : x-position of the ball relative to the robot ! One of the biggest challenges however, is devising Pr opo s e de x a mque s t i ons : ways to let robots make decisions A21. I nr e f e r e nc et oAr t i ✏c i a lI nt e l l i g e nc e , whi c ho neo ft hef o l l o wi ngi sf a l s e ? A)Fi r s tOr de rLo g i ci sc o mmo nl yus e df o rKno wl e dg eRe pr e s e nt a t i o na ndRe a s o ni ng . B)Ma c hi neLe a r ni nga i mst ot e a c ha na g e ntho wt os o l v eag i v e nt a s k . C)Na t ur a lLa ng ua g ePr o c e s s i ngc o nv e r t sma c hi ner e a da bl ec o dei nt ohuma nr e a da b l e wr i t t e nt e x t . D)I nRo bo t i c sma ny✏e l dso fAImus tbec o mbi ne dt oa l l o war o b o tt oc o mpe t eat a s k. ENGG1811 A22. Whi c ho n o ft he f o l l o w i ngi s t r u ef o rt heTur i ngTe s t ? ©e UNSW, CRICOS Provider No: 00098G 21 ENGG1811 © UNSW, CRICOS Provider No: 00098G 22 A)I tt r i e st ot e s ti fama c hi neha sa nyAr t i ✏c i a lI nt e l l i g e nc e . B)I tt r i e st ot e s ti fama c hi neha sI nt e l l i g e nc ee qui v a l e ntt oaHuma n. C)I tt r i e st ot e s ti fape r s o ni si nt e l l i g e nt . D)I tt r i e st ot e s ti fape r s o na c t sl i k eama c hi ne . A23. 2ef o l l o wi ngde c i s i o nt r e ec ho o s e sa nAc t i o nf o rar o bo tt ha tpl a y ss o c c e rus i ngi nf o r ma t i o n * Robotics -ebaDecision Trees a bo utt h l l . 2r e ev a r i a bl e sa r eu s e d:can_see ( b o o l e a nf o rwhe t he rt her o bo tc a ns e et heb a l l ) ball_dist ( di s t a nc eo ft her o bo tt ot heba l l )a ndball_x ( r o bo tr e l a t i v ex c o o r di na t eo ft he ba l l ) . Action if: can_see = false! can_see ? ! Action if:! can_see = true! ball_dist = 1.5! ball_x = 0.5 True ball_dist < 1.0 True Kick Left Foot ENGG1811 AI studies how to make computers act rationally. As technology progress, AI becomes more prominent ! False Look for ball False AI systems are still limited by constraints. Understanding how AI systems are built lets humans work effectively with them. ! ball_x < 0 True Summary We have barely scratched the surface of how AI systems are built and what they are capable of. Walk to Ball False Kick Right Foot Wha ta c t i o nwi l lt her o bo ts e l e c ti f © UNSW, CRICOS Provider No: 00098G can_see = true ball_dist = 0.5 ball_x = 0.06 A)Lo o kf o rBa l l . 23 ENGG1811 © UNSW, CRICOS Provider No: 00098G 24