Artificial Intelligence
Artificial Intelligence
Unit - 1
Introduction
• AI
– concerned with getting computer doing the task
of human intelligence
– Attempts not just to understand but also build
intelligent entities.
– Systematizes and automates intellectual tasks and
is therefore potentially relevant to any sphere of
human intellectual activity
What Is Intelligence
• Elements
Understanding reasoning
problem solving learning
common sense generalization
inference analogy
recall intuition
emotion self-awareness
What is AI?
• Computational models of human behavior
- programs that behave like human
• Computational models of human thought process
-programs that operate the way humans do
• Computational systems that think intelligently
• Computational systems that behave rationally
-does the “right thing” given what it knows.
Definitions of AI
Acting Humanly
Problem:
1) Turing test is not reproducible,
constructive, and amenable to
mathematic analysis.
2) What about physical interaction
with interrogator and environment?
Trap door
8
What would a computer need to pass
the Turing test?
9
What would a computer need to pass
the Turing test?
10
Historic milestone in artificial
intelligence set by Alan Turing
• The 65 year-old iconic Turing Test was passed for
the very first time by computer programme
during Turing Test 2014 held at the renowned
Royal Society in London
• Eugene Goostman, a computer program with the
persona of a teenage Ukrainian boy, passed a
Turing Test competition at the University of
Reading
• The program fooled at least a third of the 30 judges
in to thinking it was human.
Thinking Humanly: Cognitive Science
13
Acting Rationally: The Rational Agent
• Rational behavior: Doing the right thing!
• The right thing: That which is expected to maximize
the expected return
• Provides the most general view of AI because it
includes:
– Correct inference (“Laws of thought”)
– Uncertainty handling
– Resource limitation considerations (e.g., reflex vs.
deliberation)
– Cognitive skills (NLP, AR, knowledge representation, ML,
etc.)
14
Acting Rationally: The Rational Agent
• Advantages:
– More general
– Its goal of rationality is well defined
15
Typical AI Problems
• Intelligent entities (or agents) need to be able
to do both mundane and expert task:
• Mundane tasks:
– Planning route, activity
– Recognizing (through vision) people, objects.
– Navigating round obstacles on the street
• Expert tasks:
– Medical diagnosis
– Mathematical problem solving
What’s easy and hard
• Its easier to mechanize many of the high-level
tasks we usually associate with intelligence in
people
– Symbolic integration
– Proving theorem
– Playing chess
– Medical diagnosis
What’s easy and hard
- Economics
•How should we make decision so as to maximize payoff?
•How should we do this when others may not go along?
•How should we do this when the payoff may be far in future?
- Neuroscience
•How do brain process information?
- Psychology
•How do humans and animals think and act?
Foundation of AI…
- Computer Science
• How can we build efficient computers?
- Linguistics
• How does language relate to thoughts?
History of AI
Applications of AI
• Autonomous planning and scheduling
• Game playing
• Diagnosis
• Logistics Planning
• Robotics
• Language understanding and problem solving
Intelligent Agents
• Definition: An Intelligent Agent perceives it environment via sensors and acts
rationally upon that environment with its actuators.
• Hence, an agent gets percepts one at a time, and maps this percept sequence to
actions.
• Properties
–Autonomous
–Interacts with other agents
plus the environment
–Reactive to the environment
–Pro-active (goal- directed)
Example
Rationality
• An ideal rational agent should, for each possible percept sequence,
do whatever actions that will maximize its performance measure
based on
(1) the percept sequence, and
(2) its built-in and acquired knowledge.
• Hence it includes information gathering, not "rational ignorance."
• Rationality => Need a performance measure to say how well a task
has been achieved.
• Types of performance measures: payoffs, false alarm and false
dismissal rates, speed, resources required, effect on environment,
etc.
Autonomy
• A system is autonomous to the extent that its own behavior
is determined by its own experience and knowledge.
• Therefore, a system is not autonomous if it is guided by its
designer according to a priori decisions.
• To survive agents must have:
–Enough built- in knowledge to survive.
–Ability to learn.
What do you mean,
sensors/percepts and effectors/actions?
• Humans
– Sensors: Eyes (vision), ears (hearing), skin (touch), tongue
(gustation), nose (olfaction), neuromuscular system
(proprioception)
– Percepts:
• At the lowest level – electrical signals from these sensors
• After preprocessing – objects in the visual field (location,
textures, colors, …), auditory streams (pitch, loudness, direction),
…
– Actuators: limbs, digits, eyes, tongue, …
– Actions: lift a finger, turn left, walk, run, carry an object, …
• The Point: percepts and actions need to be carefully
defined, possibly at different levels of abstraction
Behavior and performance of IAs
CS 460, Lecture 2
A more specific example:
Automated taxi driving system
• Performance Measure: Maintain safety, reach destination,
maximize profits (fuel, tire wear), obey laws, provide
passenger comfort, …
• Environment: U.S. urban streets, freeways, traffic,
pedestrians, weather, customers, …
• Actuators: Steer, accelerate, brake, horn, speak/display, …
• Sensors: Video, sonar, speedometer, odometer, engine
sensors, keyboard input, microphone, GPS, …
• Different aspects of driving may require different types of
agent programs!
Examples of Agent Types and their Descriptions
Environment Types
• Characteristics
– Fully observable vs. partially observable
• Sensors give access to complete state of the environment.
CS 460, Lecture 2
Environment Types
• Characteristics
– Single agent vs. multiagent
CS 460, Lecture 2
Characteristics of environments
Taxi driving No No No No No
Internet No No No No No
shopping
Medical No No No No No
diagnosis
Operating
System
Virtual
Reality
Office
Environment
Mars
CS 460, Lecture 2
Environment types
Environment Accessible Deterministic Episodic Static Discrete
CS 460, Lecture 2
Environment types
Environment Accessible Deterministic Episodic Static Discrete
CS 460, Lecture 2
Environment types
Environment Accessible Deterministic Episodic Static Discrete
CS 460, Lecture 2
Environment types
Environment Accessible Deterministic Episodic Static Discrete
CS 460, Lecture 2
Structure of Intelligent Agents
• Agent = architecture + program
• Agent program: the implementation of f : P* A, the
agent’s perception-action mapping
function Skeleton-Agent(Percept) returns Action
memory UpdateMemory(memory, Percept)
Action ChooseBestAction(memory)
memory UpdateMemory(memory, Action)
return Action
Agent Sensors
Environment
What the world
is like now
What action I
Condition-action rules should do now
Effectors
Reflex Agent with Internal State
• Encode "internal state" of the world to remember the
past as contained in earlier percepts
• Needed because sensors do not usually give the entire
state of the world at each input, so perception of the
environment is captured over time. "State" used to
encode different "world states" that generate the same
immediate percept.
• Requires ability to represent change in the world; one
possibility is to represent just the latest state, but then
can't reason about hypothetical courses of action
Agents that Keep Track of the World
Goal- Based Agent
Sensors
Environment
How the world evolves
What action I
should do now
Effectors
Summary
• An agent perceives and acts in an environment, has an architecture
and is implemented by an agent program.
• An ideal agent always chooses the action which maximizes its
expected performance, given percept sequence received so far.
• An autonomous agent uses its own experience rather than built- in
knowledge of the environment by the designer.
• An agent program maps from percept to action & updates its
internal state.
– Reflex agents respond immediately to percpets.
– Model based Reflex agents maintain internal state to track aspect of
the world
– Goal-based agents act in order to achieve their goal( s).
– Utility-based agents maximize their own utility function.
• Representing knowledge is important for successful agent design.
• Some environments are more difficult for agents than others. The
most challenging environments are inaccessible, non-deterministic,
non-episodic, dynamic, and continuous.
What is NLP?
• Natural Language
– Refer to the language spoken by people eg: English,
Japanese, Hindi as opposed to artificial language like C+
+, java etc.
• Natural Language Processing
– Application that deal with natural language in a way or
another
• Computational Linguistics (CL)
– Computational aspects of the human language faculty
– More theoretical
• Huge amount of data is available
• Applications for processing large amount of text
– Text classification
– Index and search large text
– Machine Translation
– Speech Technology
– Information extraction
– Automatic Summarization
– Question Answering
– Knowledge Acquisition
– Text generation / Dialog generation
Artificial Intelligence
Semantics Parsing
Natural Language Processing
Linguistics Levels of Analysis
• Speech
• Written language
– Phonology: sounds / letters / pronunciation
– Morphology: the structure of words
– Syntax: how these sequences are structured
– Semantics: meaning of the strings
– Pragmatics: how context affects the meaning
• Interaction between levels
Issues in Syntax
“the dog ate my homework” - Who did what?
1. Identify the part of speech (POS)
Dog = noun ; ate = verb ; homework = noun
English POS tagging: 95%
2. Identify collocations
mother in law, hot dog
Compositional versus non-compositional
collocates
Issues in Syntax
• Shallow parsing:
“the dog chased the bear”
“the dog” “chased the bear”
subject - predicate
Identify basic structures
NP-[the dog] VP-[chased the bear]
Issues in Syntax
• Full parsing: John loves Mary
• Preposition Attachment
“I saw the man in the park with a telescope”
Issues in Semantics
• Understand language! How?
• “plant” = industrial plant
• “plant” = living organism
• Words are ambiguous
• Importance of semantics?
– Machine Translation: wrong translations
– Information Retrieval: wrong information
– Anaphora Resolution: wrong referents
Issues in Semantics
• How to learn the meaning of words?
• From dictionaries:
plant, works, industrial plant -- (buildings for carrying on
industrial labor; "they built a large plant to manufacture
automobiles")
plant, flora, plant life -- (a living organism lacking the power of
locomotion)
They are producing about 1,000 automobiles in the new plant
The sea flora consists in 1,000 different plant species
The plant was close to the farm of animals.
Issues in Semantics
• Learn from annotated examples:
– Assume 100 examples containing “plant”
previously tagged by a human
– Train a learning algorithm
– How to choose the learning algorithm?
– How to obtain the 100 tagged examples?
Issues in Learning Semantics
• Learning?
– Assume a large amount of annotated data for
training
– Assume a new text not annotated for testing
• Learn from previous experience to classify
new data
• Decision trees, memory based learning, neural
network
– Machine learning
Issues in Information Extraction
• There was a group of 8-9 people close to the
entrance on Highway 24
• Who? 8-9 people
• Where highway24
• Extract information
• Detect new patterns
Issues in Information Retrieval
• General Model
– A huge collection of texts
– A query
• Task: find the document relevant to the given
query
• How? Create an index, like the index in a book
• Examples: Google, Yahoo, Altavista
Issues in Information Retrieval
• Index meaning
• Search for plant (= living organism) should not
retrieve texts with plant (= industrial plant)
• But should retrieve documents including flora
or other related terms
Natural Language Understanding
• All natural languages are as complex as each other.
– No language is best suited towards modeling or easier
to process
– Social factors influence the vocabulary of languages
• Relatively easy to drive natural language parsers
– Grammar for constrained English easy to write
– Can use lexicon of words and their grammatical usage
– Grammar can both recognize and generate sentences
Natural Language Understanding
• Making computers react intelligently to
human speech
• purpose:
– The most natural interface to computers
• Database query
• Problem specification
• Insight into human speech acquisition & use
Natural Language Generation
• It is the process of producing meaningful phrases and
sentences in the form of natural language from some
internal representation.
• It involves −
– Text planning : It includes retrieving the relevant content
from knowledge base.
– Sentence planning : It includes choosing required words,
forming meaningful phrases, setting tone of the sentence.
– Text Realization : It is mapping sentence plan into
sentence structure.
Applications
• speech processing: get flight information or book a
hotel over the phone
• information extraction: discover names of people and
events they participate in, from a document
• machine translation: translate a document from one
human language into another
• question answering: find answers to natural
language questions in a text collection or database
• summarization: generate a short biography of Noam
Chomsky from one or more news articles
Computer Vision
What is Computer Vision
• To do with seeing
• Finding shape:
Computer Vision Operations
• Image formation, sensing and digitization
• Local processing and image segmentation
• Shape formation and interpretation
• Semantic analysis and description
Low level vision Processing
• Only local processing is performed on the
numbers to reduce noise and other unwanted
picture elements, and to accentuate object
boundaries.
– Transforming light energy to numbers
– Processing the quantized arrays
– Texture and color
– Stereo and optic flow
Intermediate level Processing
• Graphical Edge Finding
• Region segmentation through splitting and merging
• Describing and labeling objects
High level Processing
• Knowledge structures for inference program
• Describing objects & interrelating an image
• Scene description
The “bottom-up” approach
• Work bottom-up to find structure
– Start from a grey-level array (the image, in effect)
– colour is usually ignored: not important for finding structure
– Primal sketch: edges, groupings of edges
– 2-D sketch: surface depth and orientations
– 3-D model: object shapes and relationships
• In some sense, the 3-D model is taken as the goal of the
visual processing.
• It can be used for matching against a database of object
shapes to achieve object identification.
Computer Vision Goals
• The bottom-up approach
– ‘traditional’ but still useful for framework for understanding what vision
programs do
• Better goal:
– Produce systems that enable successful interaction with the
environment (rather than aiming at a particular representation)
• navigating an autonomous vehicle along a road and past obstacles
• recognising human gestures and movements for computer control etc
– Work top-down and hypothesis-driven: start with an assumption of
what the system (e.g. robot) sees, and test whether the image matches
the hypothesis
– Dynamic vision: change and motion (‘optical flow’) are often more
important than recognising shape or inferring the 3rd dimension
Comparision
Computer Vision Natural Language Processing
• Sensing image • Speech recognition
• Low level processing • Syntactic language
processing
• Intermediate level • Semantic langugage
processing processing
• High level processing • Buiding and interpreting
high level knowledge
structures
Computer Vision vs. Image Processing
• Image processing studies image-to-image
transformation. The input and output of
image processing are both images. Typical
image processing operations include
• image compression
• image restoration
• image enhancement
Computer Vision vs. Image Processing
• Computer vision is the construction of explicit,
meaningful descriptions of physical objects from
their images.
• The output of computer vision are a description
or an interpretation or some quantitative
measurements of the structures in the 3D scene.
• Image processing and pattern recognition are
among many techniques computer vision
employs to achieve its goals.