Artificial Intelligence FOR UNDERGRADS J. Berengueres
Artificial Intelligence for UndergradsVersion 2.2
EditorJose Berengueres
Edition First Edition. August 24th, 2014.
Text Copyright© Jose Berengueres 2014. All Rights Reserved.
i
©
Video, Audio & Artwork CopyrightArtwork appearing in this work is subject to their corresponding original Copyright or Creative Commons License. Except where otherwise noted a Creative Commons Attribution 3.0 License applies.
Limit of Liability
The editor makes no representations or warranties concerning the accuracy or exhaustivity of the contents and theories hereby presented and particularly disclaim any implied warranties regarding merchantability or fitness for a particular use including but not limited to educational, industrial and academic application. Neither the editor or the authors are liable for any loss or profit or any commercial damages including but not limited to incidental, consequential or other damages.
Support
This work was supported by:
UAE University Ai ii
1 | Introduction to AI
Bielefeld CITEC JUL 2014
Bielefeld University, Germany. Psychologists at CITEC study Human Robot Interaction
What makes something intelligent?
1. Saliency - The ability to focus on the important facts
2. Speed - Lack of speed has never been associated with intelligence. Sun Tzu
3. Pattern recognition - the ability to recognize situations and objects allows you to use past experience to react and predict or adapt to current and future situations... in summary, AI is like having a cheat sheet to take advantage of past events.
AI Formula, AI = 1 + 2 + 3
AI as an emerging propertyAI as an emerging property of simple components, a EC3 commodity. Examples,
1. Ant colony algorithm
2. Viola Jones face recognition
3. Norvig’s SpellChecker
To reinforce the ideas
1. Andrew Ng on Brain inspiration
2. Maja Rudinac on saliency on developmental psychology
Today,
the i in
AI is
small... yo
u are he
re
because
you want
to
change
the sm
all Cap
into a b
ig Cap.
Ant Colony
http://www.youtube.com/watch?v=SMc6UR5blS0
4
1 | Introduction to AI - Are Ants Smart?
The ants + the pheromone evaporation
turn random guesses into a superb optimization algorithm
necessary for survival of the fittest colony
------
ACO or Ant Colony Optimization was discovered by Marco Dorigo in the 90’s
------(but they never managed to sell it
commercially, too much tweaking required)
Wow! What is your IQ?
------
Universite Libre de Bruxelles. Belgium. Marco Dorigo is a pioneer in applying ant to AI.
5
1 | Introduction to AI - Are Ants Smart?
Hi I am Marco Dorigo’s pet. This is our
Lab in Brussels------
http://vimeo.com/12774628
http://www.youtube.com/watch?v=AY4ajbu_G3k
6
1 | Introduction to AI - Viola Jones
Wait! Where did I see this strategy
before!------
AI that
works is
about
aggrega
ting sim
ple
“feature
s”. The t
rick is
how to
aggrega
te large
number
of featu
resThe more features the better as long they are better than 0.0001% of 100% random. (Theorem, see Berengueres & Efimov on Etihad case)
How to Write a Spelling Corrector(Abridged from http://norvig.com/spell-correct.html by Peter Norvig)
“In the past week, two friends (Dean and Bill) independently told me they were amazed at how Google does spelling correction so well and quickly. Type in a search like [speling] and Google comes back in 0.1 seconds or so with Did you mean: spelling. (Yahoo and Microsoft are similar.) What surprised me is that I thought Dean and Bill, being highly accomplished engineers and mathematicians, would have good intuitions about statistical language processing problems such as spelling correction. But they didn't, and come to think of it, there's no reason they should: it was my expectations that were faulty, not their knowledge.
I figured they and many others could benefit from an explanation. The full details of an industrial-strength spell corrector are quite complex (you con read a little about it here or here). What I wanted to do here is to develop, in less than a page of code, a toy spelling corrector that achieves 80 or 90% accuracy at a processing speed of at l e a s t 10 words per second.”
7
1 | Introduction to AI - Spell This!
HELLO------
HELO------
PELO
CANDIDATE FREQUENCY P. ERROR
HELLO 23423 LOW
HELO Not in Dict HIGH
PELO 4 HIGH
Who is right?
I don’t know so lets minimize the
errors
? ?
(Abridged from http://norvig.com/spell-correct.html by Peter Norvig)
So here, in 21 lines of Python 2.5 code, is the complete spelling corrector:
Import re, collections
def words(text): return re.findall('[a-z]+', text.lower())
def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model
NWORDS = train(words(file('big.txt').read()))
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def edits1(word): splits = [(word[:i], word[i:]) for i in range(len(word) + 1)] deletes = [a + b[1:] for a, b in splits if b] transposes = [a + b[1] + b[0] + b[2:] for a, b in splits if len(b)>1] replaces = [a + c + b[1:] for a, b in splits for c in alphabet if b] inserts = [a + c + b for a, b in splits for c in alphabet] return set(deletes + transposes + replaces + inserts)
def known_edits2(word): return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS)
def known(words): return set(w for w in words if w in NWORDS)
def correct(word): candidates = known([word]) or known(edits1(word)) or known_edits2(word) or [word] return max(candidates, key=NWORDS.get)The code defines the function correct, which takes a word as input and returns a likely correction of that word. For example:
>>>
import re, collections
>>> correct('speling')'spelling'>>> correct('korrecter')'corrector'
8
1 | Introduction to AI - Spell This!
Oh MyPythons!
Genius!
Machine Translation
(Abridged from http://www.foreignaffairs.com/articles/139104/kenneth-neil-cukier-and-viktor-mayer-schoenberger/the-rise-of-big-data by Kenneth Neil Cukier and Viktor Mayer-Schoenberger FROM FP MAY/JUNE 2013 ISSUE )
“Consider language translation. It might seem obvious that computers would translate well, since they can store much information and retrieve it quickly.
Linguistics Models
But if one were to simply substitute words from a French-English dictionary, the translation would be atrocious. Language is complex. A breakthrough came in the 1990s, when IBM delved into statistical machine translation. It fed Canadian parliamentary transcripts in both French and English into a computer and programmed it to infer which word in one language is the best alternative for another. This process changed the task of translation into a giant problem of probability and math. But after this initial improvement, progress stalled.”
“Then Google barged in. Instead of using a relatively small number of high-quality translations, the search giant harnessed more data, but from the less orderly Internet -- “data in the wild,” so to speak. Google inhaled translations from corporate websites, documents in every language from the European Union, even translations from its giant book-
scanning project. Instead of millions of pages of texts, Google analyzed billions. The result is that its translations are quite good -- better than IBM’s were--and cover 65 languages. Large amounts of messy data trumped small amounts of cleaner data.”
Reflection
In later chapters we will see how Big Data is connected to this ideas. This case ilustrates the debate of wether modeling the world vs. taking
10
1 | Introduction to AI - The Case of Machine Translation
Hi, I am Keneth
----
the sensory input as model is better. By now it should be clear what works. In the case of humans another factor plays into play... the emotion predictor.
11
1 | Introduction to AI - The Case of Machine Translation
The Games Computers PlayIn two-player games without chance or hidden information, AIs have achieved remarkable success. However, 19-by-19 Go remains a challenge. Abridged from: http://spectrum.ieee.org/robotics/artificial-intelligence/ais-
have-mastered-chess-will-go-be-next
TIC-TAC-TOEGame positions: 104 Computer strength: PERFECT
OWAREGame positions: 1011 Computer strength: PERFECT
CHECKERSGame positions: 1020 Computer strength: PERFECT
OTHELLOGame positions: 1028 Computer strength: SUPERHUMAN
9-BY-9 GO
Game positions: 1038 Computer strength: BEST PROFESSIONAL
CHESSGame positions: 1045 Computer strength: SUPERHUMAN
XIANGQI (CHINESE CHESS)Game positions: 1048 Computer strength: BEST PROFESSIONAL
SHOGI (JAPANESE CHESS)Game positions: 1070 Computer strength: STRONG PROFESSIONAL
19-BY-19 GOGame positions: 10172 Computer strength: STRONG AMATEUR
12
1 | Introduction to AI - Monte Carlo Tree Search
13
1 | Introduction to AI - Monte Carlo Tree Search
We stopped trying to
play go
with masters’ rules and s
tarted
using Monte Carlo with back
propagation and p
runing... a
somehow brute force appro
ach”
(See also ED Shaw approach
to AI for
stock speculation v
s. Medallion fund)
Amazon book and More Money tha
n God
That’s what I call intelligence free AI
Medallion Fund made millions using
the same strategy to bet on Wall Street
-----MMTG
This reminds me of Searle’s Chinese Box
“In these four simulations of a simple Monte Carlo tree search, the program, playing as black, evaluates the winning potential of possible moves. Starting from a position to be evaluated (the leaf node), the program plays a random sequence of legal moves, playing for both black and white. It plays to the end of the game and then determines if the result is a win (1) or a loss (0). Then it discards all the information about that move sequence except for the result, which it uses to update the winning ratio for the leaf node and the nodes that came before it, back to the root of the game tree.
Algorithm1. Tree Descent: From the existing board
position (the root node of the search tree), select a candidate move (a leaf node) for evaluation. At the very beginning of the search, the leaf node is directly connected to the root. Later on, as the search deepens, the program follows a long path of branches to reach the leaf node to be evaluated.
2. Simulation: From the selected leaf node,
choose a random sequence of alternating moves until the end of the game is reached.
14
1 | Introduction to AI - Monte Carlo Tree Search
3. Evaluation and Back Propagation:
Determine whether the simulation ends in a win or loss. Use that result to update the statistics for each node on the path from the leaf back to the root. Discard the simulation sequence from memory—only the result matters.
4. Tree Expansion: Grow the game tree by
adding an extra leaf node to it.
To learn more about MCTS --> http://mcts.ai/index.htm
To learn more about how to play go:
http://www.youtube.com/watch?v=nuWuXj2V6Rk Beginner
http://www.youtube.com/watch?v=3O-lwNzN0G0 Advanced
15
1 | Introduction to AI - Monte Carlo Tree Search
16
1 | Introduction to AI - Monte Carlo Tree Search
If they can make an app that beats me at 9x9 go,
give’em an
A+deal!
(Abridged from the book by Henry Brighton and Howard
Selina, Introducing AI)
AI Goals1. Understand the man as a Machine2. Understand anything (not only humans ) that performs
actions. We refer to this as agents. Therefore agents can be human or non-human or a combination
3.Weak vs. Strong AI Weak AI: Machines can be made to behave as if they were intelligent Strong AI: Machines can have consciousness
4.Alien AI
AI that works and is not similar to human AI
17
1 | Introduction to AI - Intro to AI
In one survey AI researc
hers
were asked what discip
line they
feel the closest to
(Philosophy was the most common
answer)
5. Trans Humanism & Immortality
PBS Documentary http://www.youtube.com/watch?v=53K1dMyslJg
6. AI and Psychology(see chapter 3.1)
7. Intelligencethe computational part of achieving goals in the world.
8. Cognitive Psychology
Studying psychology by means of a computational theory of mind. To explain the human cognitive function in terms of information processing terms. “internal mental processes”, “students as primary agents of their own learning”
18
1 | Introduction to AI - Intro to AI
9. Is Elsie intelligent? (are students roaming around a campus and going to the cafeteria when they are hungry intelligent? :) )
19
1 | Introduction to AI - Intro to AI
10. ChomskyThe capacity of language seems to be due that we have a part in the brain dedicated to it (like the organ of the heart). Otherwise how can we explain that every kid learns to speak just by listening to its parents speaking? That is not plausible. Therefore, the organ of language must exist int he brain.
http://inside-the-brain.com/tag/noam-chomsky/
“According to one view the human mind is a’ general-purpose problem-solver’.” A rival view argues that the human mind contains a number of subsystems or modules –
each of which is designed to perform a very limited number of tasks and cannot do anything else. This is known as the modularity of mind hypothesis. So for example it is widely believed that there is special module for learning a language – a view deriving from the linguist Noam Chomsky. Chomsky insisted that a child does not learn to speak by overhearing adult conversation and then using ‘general intelligence’ to figure out the rules of the language being spoken; rather there is a distinct neuronal circuit – a module – which specialises in language acquisition in every human child which operates automatically and whose sole function is to enable that child to learn a language, given appropriate prompting. The fact that even those with very low ‘general intelligence’ can often learn to speak perfectly well strengthens this view. Who is right Andrew or Chomsky?
Aloha! I am Noam Chomsky
“if you have a hammer, does everything looks like a nail?”
----
20
1 | Introduction to AI - Intro to AI
11. The Touring Machine
Model for all machines by way of states and inputs.
I am Alan, Alan Touring.
12. Functionalism
The separation of mind from brain (Software from hardware)
21
1 | Introduction to AI - Intro to AI
13. Physical Symbol Systems Hypothesis
Physical Symbol Systems Hypothesis 1976 Cognition requires the manipulation of symbolic representations.
14. Touring Test
Can machines think? is an ill-defined (not very intelligent question) question. Noam Chomsky says: Thats like asking if submarines can swim. So Touring replaced it by... Can u fool a human in to believing you are as smart as a human?The Loebner prize is $100,000 for the first place. The prize was taken in June 2014 according to: https://www.youtube.com/watch?v=njmAUhUwKys
22
1 | Introduction to AI - Intro to AI
15. Searle’s Chinese Room
A man inside a room with all the Chinese books in the world. Someone can slide Chinese messages through an orifice. The man then might learn what to reply even though he does not know any Chinese symbols at all. “He can pass the touring
test”. (mark this words for later)
Would that be regarded as intelligence? Searle’s Chinese room passes the PSSH regarding manipulation of symbols!
What about,
Searle himself +
the books (!)---------------------------
Understand Chinese?
Which means: Can the whole be more that sum of its parts?
23
1 | Introduction to AI - Intro to AI
16. Complexity Theory
Self-organization occurs when high-level properties emerge from interaction of simple components. ACO is an example.
http://en.wikipedia.org/wiki/Computational_complexity_theory
“So you are saying that Intelligence is just spontaneous self organization of neural activity?”
The Brain process Experiment and the mental only realm. Replace each neuron by an artificial one. What would happen? Penrose conjectures that consciousness requires of quantum effects, that are not present in silicon based chips. ie. non computable processes (today). Microtubes.
24
1 | Introduction to AI - Intro to AI
17. Understanding, Consciousness and Thought
Intentionality and aboutness. Example: Mental states have aboutness on beliefs and desires and that requires a conscious mind. Conscious is ALWAYS about something.
18. Cognitive Modeling
Modeling is not understanding
19. Module based cognition could explain optical illusions
20. Game playing AI represent the game internally with
trees
21. Common Sense
25
1 | Introduction to AI - Intro to AI
Machines do not have common sense? Is this because of lack of background info?
22. Sense model plan act
23. Conectionism
Humans have the ability to pursue abstract intellectual feats such as science, mathematics, philosophy, and law. This is surprising, given that opportunities to exercise these talents did not exist in the hunter-gatherer societies where humans evolved. https://blogs.commons.georgetown.edu/cctp-903-summer2013/2013/06/29/trends-in-cognitive-science/
24. Symbol grounding and meaning
25. New AI Rodney Brooks. A machine does not think.
What thinks is the machine + his environment as a system. Examples: Frogs do not have planing modules. It's directed by the eye perception. Reflex.
26. Dreyfus says that AI is misguided if it thinks
disembodied intelligence is possible. If Dreyfus is
correct then agents must be used as engaged in everyday world not as disengaged.
26
1 | Introduction to AI - Intro to AI
27. Principles of Embodiment1. The constraints of having a body are important for the
AI function. Elsie recharging station.
2. “The world is the best model ;) ” - Rodney Brooks
3. Bottom-to-top construction
4. Brooks on conventional robotics, they are based on
Sense.Plan.Do 5. Brooks new AI, based on:
Behaviors by design
27
1 | Introduction to AI - Intro to AI
Hi I am Genhis! Each of my leg has a
“programmed” behavior - just like roaches are
After Genhis, we started iRobot! And we made some money (not
alot) out of it
When I first started selling
iRoombas people said iRoomba was a robot.
But now they say it is a vacuum cleaner
------MSNBC 2012
By the way, iRoomba
was poor investment.
Each vacuming averages at $3, Because the batteries die after 1
year
28
1 | Introduction to AI - Intro to AI
It was only after Colin Angle became a vacuum
salesman that iRobot took off
Ok, so by now the
smart ones must have realized that there are (at
least )two people making lots of money with vacuum
automation
in 2011 70% of IRBT profit came from the robots they sold to the US army to
fight in Afghanistan
Exercise. Ask the students to plan an optimal path for an iRoomba (remember iRoomba does not have navigation or a map of the room)
Student A (random walk)
29
1 | Introduction to AI - Intro to AI
under cleans wall
sides, can get
“trapped”
Student B ( the orderly)
30
1 | Introduction to AI - Intro to AI
This is unfeasible
for iRoomba
(tolerances)
iRoomba strategy is to combine wall following behavior with random bouncing behavior to avoid trapping
31
1 | Introduction to AI - Intro to AI
50% of the dirt is on the wall sides
50% of the dirt is not on the wall sides
50% of the dirt is on the wall sides50
% of the dirt is on the w
all sides
Filipino maid
monthly salary in Al
Ain: 250 to 330
USD$
A cautionary tale.
Samsung uses a camera to do orderly cleaning. It has very few stars on Amazon product reviews.
http://www.youtube.com/watch?v=PA_huJQOPD0
32
1 | Introduction to AI - Intro to AI
The efficiency of
the
algorithm affects t
he
value for the custo
mer
28.Mirror Neurons
http://www.ercim.eu/publication/Ercim_News/enw55/wiedermann.html
29. Evolution without biology
30. Only when interaction between humans and
their environment are more well
understood will AI begin to solve the right problem
Ants + pheromone + food to search for = Intelligence. Now I
get it. Before I was looking at the ant + pheromone only. It is the
whole system we have to consider.
------
33
1 | Introduction to AI - Intro to AI
34 1 | Introduction to AI - iRoomba Workshop
What is the way to
settle a discussion
about
what behavior is more
efficient for iRoomba?
iRoomba behavior simulation CODE#!/usr/bin/python# Copyright Jose Berengueres - @medialabae - 2011.11.29# iRoomba Vacuum cleaning algorithm (Random VS iRobot Strategy)# Ai Strategy What is best and why?
import random, math
class iRoomba: x = -1 y = -1 o = -1 d = [-1,-1] step = 0 moveseq = ["N"]
def __init__(self,x,y,o,d): self.x = x self.y = y self.o = o self.d = d self.step = 0 def pos(self): return [self.x,self.y]
def orientation(self): return self.o
def setOrientation(self,o): self.o = o
def setDirection(self,d): self.d = d
def checkWall(self): #IF BUMP TO WALL CHANGE DIRECTION RND if (self.o == "N" and self.y == 7) or (self.o == "S" and self.y == 0) or (self.o == "E" and self.x == 7) or (self.o == "W" and self.x == 0): return True else: return False
def changeDirection(self):
seq =[-3,-2,-2,-1,-1,1,1,2,4,5] self.d = [random.sample(seq,1)[0],random.sample(seq,1)[0] ] if (self.d[0] == 0 or self.d[1] == 0): self.changeDirection() return else: #make moveseq self.moveseq = [] self.step = 0 for x in range(0,int(math.fabs(self.d[0]))): if self.d[0] > 0: self.moveseq.append("E") else: self.moveseq.append("W") for y in range(0,int(math.fabs(self.d[1]))): if self.d[1] > 0: self.moveseq.append("N") else: self.moveseq.append("S") random.shuffle(self.moveseq) print "new direction is : " , self.moveseq , " - ", self.d, " - " , self.o , " --> ", self.moveseq[self.step]
# imitate iRoomba movement by change direction if bumped to wall def moveLikeRoomba(self): if self.checkWall(): self.changeDirection() self.o = self.moveseq[self.step] self.step = (self.step + 1 ) % len(self.moveseq) return self.move() # Simple random wall proof movement def move(self): if (self.o == "N" and self.y == 7): self.o = "E" return "R" if (self.o == "S" and self.y == 0): self.o = "W" return "R" if (self.o == "E" and self.x == 7): self.o = "S" return "R" if (self.o == "W" and self.x == 0): self.o = "N"
35
1 | Introduction to AI - iRoomba Workshop 35
return "R" #MOVE ONE STEP FWD ACCORDING TO ORIENTATION if self.o == "N": self.y = self.y + 1 if self.o == "S": self.y = self.y - 1 if self.o == "E": self.x = self.x + 1 if self.o == "W": self.x = self.x - 1 return "fwd"
def markvisited(visited,celltag): try: visited[celltag] = visited[celltag] + 1 except: visited[celltag] = 1
def main(): visited ={} dirt = [[1,1],[4,6],[7,7], [3,6]] items = ["N", "S", "W", "E"] print dirt print "Zooooommmmmm startin cleaning..." vc = iRoomba(4,4,"N",[1,1]) k = 0 while (len(dirt) > 0 and k < 3500 ): #RANDOM cleanning strategy #m = vc.move() #vc.setOrientation( str(random.sample(items,1)[0]) ) m = vc.moveLikeRoomba() celltag = vc.pos()[0] + 8*vc.pos()[1] markvisited(visited,celltag) print k, len(dirt),vc.pos(), vc.orientation(), m if vc.pos() in dirt: dirt.remove(vc.pos()) print "*** found dirt *** remaining dirt ", len(dirt)
k = k + 1 print "Cleaned the room in ", k print visited
mean = 0.0 var = 0.0 for k in visited: #print k, visited[k] mean = mean + visited[k] print "each cell is visited an avg = ", mean/len(visited), " times"
for k in visited: var = var + (visited[k]-mean)*(visited[k]-mean) print "measure of dispersion of visit std = ", math.sqrt(var)/len(visited) print "Number of cells visited ", len(visited) return k
if __name__ == "__main__": main()
CODE for Statistics compilation on different cleaning strategies#!/usr/bin/python# Copyright Jose Berengueres - @medialabae - 2011.11.29# iRoomba Vacuum cleaning algorithm (Random VS iRobot Strategy)# Ai Strategy What is best and why?
import iroomba2
def main(): sum = 0 L = 1000 for k in range(0,L): sum = sum + iroomba2.main() print "the average number of steps to clean all dirt is = ",sum, " ", sum/L
if __name__ == "__main__": main()
36
1 | Introduction to AI - iRoomba Workshop 36
ipad:~ ber$ python roomba.py[[1, 1], [4, 6], [7, 7], [3, 6]]Zooooommmmmm startin cleaning...0 4 [4, 5] N fwd1 4 [4, 6] N fwd*** found dirt *** remaining dirt 32 3 [4, 7] N fwdnew direction is : ['N', 'N', 'W', 'N', 'N'] - [-1, 4] - N --> N3 3 [4, 7] E R4 3 [4, 7] E R5 3 [3, 7] W fwd6 3 [3, 7] E R7 3 [3, 7] E R8 3 [3, 7] E R9 3 [3, 7] E R...*** found dirt *** remaining dirt 0Cleaned the room in 143{0: 2, 6: 1, 7: 3, 8: 3, 9: 1, 14: 3, 15: 8, 16: 2, 17: 1, 18: 1, 21: 1, 22: 3, 23: 8, 24: 2, 26: 1, 28: 1, 29: 2, 30: 2, 31: 7, 32: 2, 34: 1, 35: 1, 36: 1, 37: 1, 38: 1, 39: 10, 40: 2, 42: 2, 43: 2, 44: 2, 45: 2, 46: 3, 47: 8, 48: 2, 49: 2, 50: 1, 51: 1, 52: 4, 53: 2, 54: 3, 55: 8, 56: 1, 57: 7, 58: 6, 59: 6, 60: 5, 62: 1, 63: 4}each cell is visited an avg = 2.97916666667 timesmeasure of dispersion of visit std = 20.2133048009Number of cells visited 48ipad:~ ber$
37
1 | Introduction to AI - iRoomba Workshop 37
2 | Robotics
Photo courtesy of Elsevier http://issuu.com/beleggersbelangen/docs/previewjuist11/12
...Blip Blip ----
Maja Rudinac. ENxJ. Gymnastics & Robotics. CEO of Lerovis. TUDelft
Key Point
“Intelligence is the capacity to focus on the important things, to filter - babies are good at this since the fourth month”
“I studied how babies make sense of the world to build a low cost
robot”------
Maja Rudinac
Recorded at Building 34 TU Delft on August 21st, 2014
Baby inspired Artificial Intelligence (Saliency)
Chapter Flight Pl
an
Ford-T Thinking
Saliency
Famous Robots
39 2 | Robotics - Home Robotics
The arm motors are on the body, to
allow for low weight, low backlash movement.
Coupling2DoF---- Intuitive Control
----
40 Section 1 Robotics
Maja, lik
e Andrew
found
inspirati
on in hu
mans
This is the Ford-T of Robotics
Baby DevelopmentDevelopmental Stages for Baby: 8-10 months
http://www.youtube.com/watch?v=KzEI8z7Q0RU
Milestones
Sitting
Crawling
Object disappearing detection
hand eye coordination
Baby: 6-8 months
http://www.youtube.com/watch?v=uQmqRIR2YxA
Milestones
Moving
Rolling
Gross grasping (See video of Lea robot)
41
2 | Robotics - Saliency in Babies
4-6 months
http://www.youtube.com/watch?v=iIOPROa0BoI
Milestones
Reflexes
Visual Tracking
Use of hearing to track
Also: http://www.youtube.com/watch?v=xbyBXKiL0LU
Sensory deprivation
decreases the IQ.
A baby who is deprived
of touch dies in a
few
days
42
2 | Robotics - Saliency in Babies
Hit a WallWhen Maja hit the wall of unpractical computer vision, she turned to developmental psychologists for strategies to cope with large amounts of image pixels. This is what she found (so you don’t have to):
Visual Developmental Psychology
Basics(Abridged from Maja Rudinac PhD thesis, TUDelft)
Babies at the 4th month can already tell if a character is bad or good because we can see who they hug longer.
Infants look longer at new faces or new objects
Independent of where are born, all babies know
boundaries of objects.
Can predict collisions
Basic additive and subtractive cognition
Can identify members of own group versus non-own group
Spontaneous motor movement is not goal directed at the
onset. The baby explores the degrees of freedomGoal directed arm-grasp appears at the 4th month
The ability to engage and disengage attention on targets
appears from day 1 in babies.
Smooth visual tracking is present at birth
How baby cognition “works”Development of actions of babies is goal directed by two motives. Actions are either,
1. To discover novelty
2. To discover regularity
3. To discover the potential of their own body
Development of Perception Perception in babies is driven by two processes:
1. Detection of structure or patterns
43
2 | Robotics - Developmental Psychology
2. Discarding of irrelevant info and keeping relevant info
Cognitive Robot Shopping List
So if we want to make a minimum viable product (MVP)
that can understand the world at least (as well or as poorly) as a baby does, this are the functions that according to Mrs. Maja (pronounced Maya) we will need:
A WebCam
Object Rracking
Object Discrimination
Attraction to peoples faces
Face Recognition
Use the hand to move objects to scan them form various angles
Shades and 3DTurns out that shades have a disproportionate influence in helping us figure out 3D info from 2D retina pixels. When researchers at Univ. of Texas used fake shades in a virtual
reality world, participants got head aches (because the faking of the shades was not precise enough to fool the brain. The brain got confused by the imperceptible mismatches... that’s why smart people get head aches in 3D cinemas)
44
2 | Robotics - Developmental Psychology
http://www.youtube.com/watch?v=S5AnWzjHtWA
Asimo - Pet Man - Curiosity - Kokoro’s Actroid
Honda Asimo evolution and Michio Kaku on AI
http://www.youtube.com/watch?v=97iZY9DySws
45
2 | Robotics - Review of State-of-the-art
One goal of AI is to build robots that
are better than humans----
46
2 | Robotics - Review of State-of-the-art
Uncanny valley helps the human race to prevent the
spread of infectious diseases (such as Ebola) by heavy un-
liking the sick members of the tribe. It’s hard wired in every one of us. See also #zoombie
http://spectrum.ieee.org/automaton/robotics/
humanoids/the-uncanny-valley-revisited-a-tribute-to-
masahiro-mori
The Fog of Robotics Today
They are trying to build this They should be trying to build this:
49
2 | Robotics - Review of State-of-the-art
3 | UX - The heart of AI
Photo courtesy of Elsevier http://issuu.com/beleggersbelangen/docs/previewjuist11/12
2014 Flobi robot head. Bielefeld University, Germany.
In Japan where engineers grew up with Doraemon (a robot), Arale-chan (a robot), Gatchaman, Pathlabor (two robots), Ghost in the Shell (a robot), Mazinger-Z (a robot)... (Do you see where I am going?) - Robots are not seen as antagonistic characters. In the West, we grew up with Terminator and only recently we got Wall-e to s our primitive cavern men fears Hello
I am Flobi
Sociologists like Selma Savanovic and
Friederike Eyssel use me to do gender studies
52 3 | UX - The heart of AI - Behaviourism
People under
estimate so much the
influence of
environment upo
n
their behavior
In previ
ous sec
tion
you made
a spell
checker.
.. but did i
t
make the
user ha
ppy?
Check ch.1 of Seven
Women that changed the UX industry
for a compelling case
How design that makes you happy is easier to use simply because the fact that a happy brain has a higher IQ.
Don’t believe it? I don’t blame you. Lets do a little experiment
Which video is more serious about safety...
http://www.youtube.com/watch?v=DtyfiPIHsIg&feature=kp
or
or this one... http://www.youtube.com/watch?v=fSGaRVOLPfg
What is the purpose of the video. Which one’s safety tips do you remember most.
53
3 | UX - The heart of AI - Why Happy is Better
The point of the
exercise is
not to find a winner.
Additionally, Each
Airline
serves different
cultures and
socioeconomics. Maybe I
should compare it to Unite
d
Airlines.
More Happy, more IQ?
Isabel Myers-BriggsKnowing psychology should be a prerequisite before doing any AI at all. Anyhow, one of the best books to go up to speed on how humans “work”, is 50 Psychology Classics, a book I recommend 100% because is compact. The audio book is great. If you want to leverage human knowledge of the self my second rec. is a book by Hellen Fisher that classifies people into Builders, Explorers, Directors and Negotiators. There is a lot confusion about the personality types. The most famous is the Myers Brigs that classifies people into 16 types. I trained myself to classify people I meet in types. I am good at it. ^.^; It helps me to work with them better and to understand them better. (seek to understand, then to be understood - 7HoHEP). However, because it is popular, there is a lot of confusion on he Myers-Briggs system.
http://www.youtube.com/watch?v=aQ2QbS-EgrM
OK, I know that you are thinking. What is my personality type? http://www.humanmetrics.com/cgi-win/jtypes2.asp
You are welcome.
54
3 | UX - The heart of AI - Not every one is the same - Isabel Myers
You want to do “ai” with a captial
letter? you’d better start discerning personality
types yourself...
Because if your AI can’t
distinguish between an ISFJ vs. ENFP he will be
perceived as inept at social interactions...
via www.furthered.com
56
3 | UX - The heart of AI - Not every one is the same - Isabel Myers
4 | Advanced Topics
Big Data. Exploded circa 2007.
Big Data
“A new fashionable name for Data Mining”
Deep Learning
Deep Learning is a new area of Machine Learning research, which has been introduced with the objective of moving Machine Learning closer to one of its original goals: Artificial Intelligence.
Renaissance Technologies is an American hedge fund management company that operates three funds.[3] It operates in East Setauket, Long Island, New York, near Stony Brook University with administrative functions handled in Manhattan.
If you want to learn Big Data join the fight club
at kaggle.com------
I made billions by using AI to especulate in
Stocks. We are the Google of trading.
-----James Simons
Medallion Fund 23 Billion (2011)
Cloudera!------
J. Hammerbacher
(Check Wienner vs. Wall Street 1947)
A CaseThis case will help you understand a typical big data project at the three levels:
Corporate or How to deal with conflicts of interest inside a organization
Business logic or How to pose the right questions that make sense from a money point of view and add value
Mathematical or How to actually do the calculations
(if you can do well the above three, you can be a successful data scientist that everybody loves*)* http://hbr.org/product/big-data-the-management-revolution/an/R1210C-PDF-ENG
http://www.journalofbigdata.com/content/pdf/2196-1115-1-3.pdf
58
4 | Advanced Topics - A Real Case
CASE STUDY
Open Access
Airline new customer tier level forecasting for
real-time resource allocation of a miles program
Jose Berengueres 1* and Dmitry Efimov 2* Correspondence: [email protected]
1UAE University, 17551 Al Ain, Abu
Dhabi, UAEFull list of author information is
available at the end of the article
AbstractThis is a case study on an airline’s miles program resource optimization. The airline
had a large miles loyalty program but was not taking advantage of recent data mining
techniques. As an example, to predict whether in the coming month(s), a new passenger
would become a privileged frequent flyer or not, a linear extrapolation of the
miles earned during the past months was used. This information was then used
in CRM interactions between the airline and the passenger. The correlation of
extrapolation with whether a new user would attain a privileged miles status
was 39% when one month of data was used to make a prediction. In contrast,
when GBM and other blending techniques were used, a correlation of 70% was
achieved. This corresponded to a prediction accuracy of 87% with less than 3%
false positives. The accuracy reached 97% if three months of data instead of
one were used. An application that ranks users according to their probability to become
part of privileged miles-tier was proposed. The application performs real time allocation
of limited resources such as available upgrades on a given flight. Moreover, the airline
can assign now those resources to the passengers with the highest revenue potential
thus increasing the perceived value of the program at no extra cost.
Keywords: Airline; Customer equity; Customer profitability; Life time value; Loyalty program;
Frequent flyer; FFP; Miles program; Churn; Data miningBackgroundPreviously, several works have addressed the issue of optimizing operations of the air-
line industry. In 2003, a model that predicts no-show ratio with the purpose of opti-
mizing overbooking practice claimed to increase revenues by 0.4% to 3.2% [1]. More
recently, in 2013, Alaska Airlines in cooperation with G.E and Kaggle Inc., launched a
$250,000 prize competition with the aim of optimizing costs by modifying flight plans
[2]. However, there are very little works on miles programs or frequent flier programs
that focus on enhancing their value. One example is [3] from Taiwan, but they focused
on segmenting customers by extracting decision-rules from questionnaires. Using a
Rough Set Approach they report classification accuracies of 95%. [4] focused on seg-
menting users according to return flight and length of stays using a k-means algorithm.
A few other works such as [5], focused on predicting the future value of passengers
(Customer Equity). They attempt to predict the top 20% most valuable customers.
Using SAS software they report false positive and false negative rate of 13% and
55% respectively. None of them have applied this knowledge to increase the value-
© 2014 Berengueres and Efimov; licensee Springer. This is an Open Access article distributed under the terms of the Creative
Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and
reproduction in any medium, provided the original work is properly credited.
Berengueres and Efimov Journal of Big Data 2014, 1:3
http://www.journalofbigdata.com/content/1/1/3
The NeuroCortexJeff Hawkins (the inventor of Palm Pilot) explains how he reverse engineers the brain. Did you know that Jeff he started all these companies just to have enough money to study the brain?
memory-prediction framework
http://www.youtube.com/watch?v=IOkiFOIbTkE
59
4 | Advanced Topics - Reverse Engineering the Neuro Cortex
I invented
this, to have money for this
------J.Hawkins
Deep Learning is a new area of Machine Learning research, which has been introduced with the objective of moving Machine Learning closer to one of its original goals: Artificial Intelligence. See these course notes for a brief introduction to Machine Learning for AI and an introduction toDeep Learning algorithms. www.deeplearning.net/tutorial/
Deep Learning explained(Abridged from the original from Pete Warden | @petewarden)http://radar.oreilly.com/2014/07/what-is-deep-learning-and-why-should-you-care.html
Inside an ANN
The functions that are run inside an ANN are controlled by the memory of the neural network, arrays of numbers known as weights that define how the inputs are combined and recombined to produce the results. Dealing with real-world problems like cat-detection requires very complex functions, which mean these arrays are very large, containing around
60 million (60MBytes) numbers in the case of one of
the recent computer vision networks. The biggest obstacle to using neural networks has been figuring out how to set all these massive arrays to values that will do a good job transforming the input signals into output predictions.
Renaissance
It has always been difficult to train an ANN. But in 2012, a
breakthrough, a paper sparks a renaissance in ANN. Alex Krizhevsky, Ilya Sutskever, and Geoff Hinton bring together a
whole bunch of different ways of accelerating the
learning process, including convolutional networks, clever use of GPUs, and some novel mathematical tricks like ReLU and dropout, and showed that in a few weeks they could train a very complex network to a level that outperformed conventional approaches to computer vision.
60
4 | Advanced Topics - Deep Learning
GPU photo by Pete Warden slides (Jetpack)
Listen to the Webcast at Strata 2013http://www.oreilly.com/pub/e/3121
http://www.iro.umontreal.ca/~pift6266/H10/intro_diapos.pdf
Deep NN failed unitl 2006....
61
4 | Advanced Topics - Deep Learning
Automatic speech recognitionThe results shown in the table below are for automatic speech recognition on the popular TIMIT data set. This is a common data set used for initial evaluations of deep learning architectures. The entire set contains 630 speakers from eight major dialects of American English, with each speaker reading 10 different sentences.[48] Its small size allows many different configurations to be tried effectively with it. The error rates presented are phone error rates (PER).
http://en.wikipedia.org/wiki/Deep_learning#Fundamental_concepts
62
4 | Advanced Topics - Deep Learning
Andrew Ng on Deep Learning where AI will learn from untagged data
https://www.youtube.com/watch?v=W15K9PegQt0#t=221
To learn more about Andrew Ng on Deep Learning and the future of #AI
- http://new.livestream.com/gigaom/FutureofAI (~1:20:00)
- https://www.youtube.com/watch?v=W15K9PegQt0#t=221
-http://deeplearning.stanford.edu
A good book to learn neural networks is...
http://neuralnetworksanddeeplearning.com/chap1.html
63
4 | Advanced Topics - Deep Learning
Ray thinks that in 2029 machines will have enough processors to display consciousness. He along with Mr. Diamantis started a summer university near Palo Alto (http://singularityu.org/) for entrepreneurs who want to leverage his predictions. This m o v i e d e p i c t s R a y ’s y o u t h i n fl u e n c e s . h t t p : / /www.rottentomatoes.com/m/transcendent-man/
64
4 | Advanced Topics - The Singularity and Singularity U.
I invented the Singularity, a
univeristy and one synthesizer brand.
-----
65
4 | Advanced Topics - The Singularity and Singularity U.
Type to enter text
http://www.singularity.com/charts/page48.html
1. Among all the traits of an intelligent system lack of speed was never one of them
1. True
2. False
2. Saliency is the ability to discriminate important from not important in formation
1. T
2. F
3. Pattern recognition is useful if you want to react to something
1. T
2. F
4. ACO is an example of swarm intelligence
1. T
2. F
5. ACO is an example of an emerging property of a complex system
1. yes
2. no
3. it is not complex
4. it is not emerging
5. none of above
6. ACO is suited to optimize travel time
1. yes
2. no
3. sometimes
4. none
7. Norvig’s spell checker is based on
1. Bayes
2. Probability
3. Likelihood
4. none
5. all of above
8. A way to improve Norvig spell checker is to:
1. look at distance 2 character words
2. look at the context
3. use triplets of words
4. user more precise probability
5. none
6. all
9. Norvig's spell checker is fast because
1. Python is faster than Java
2. the probabilities are pre calculated
67
4 | Advanced Topics - Sample Questions
3. the dictionary lookup time is really fast
4. none
5. all
10. The key concept of Norvig’s spell checker is to:
1. minimize spell checking mistakes
2. maximize spell checking mistakes
3. none
4. all
11. Machine Translation has greatly benefited from Linguistics because
1. knowing the rules that govern language makes it easy to translate
2. because most translation mistakes are syntax error mistakes
3. because knowing the grammar is key to translate
4. all
5. none
12. The Monte Carlo Tree Simulation algorithm for Go game is based on:
1. select a leaf node, run a random sequence of alternating moves, run sequence to the end of game, update outcome of game for that leaf node, add a leaf to tree.
2. select two leaf nodes, selecting a random sequence of alternating moves, run sequence to the end of game, update outcome of game for that leaf node, keep the best leaf.
3. select some leaf nodes, run a random sequence of alternating moves, run sequence to the end of game, update outcome of game for that leaf node, keep the best leaves and prune the worse
4. select a leaf, run some random simulations, prune the longest branches and add some water so it does not dry
5. none
6. all are true
13. The reason computers are better at chess than at Go is that…
1. Chess has less combinations
2. Chess rules are more complex so naturally computers are better at it
3. none
4. all are true
14. The ACO can be used to solve the Traveling Salesman Problem
1. True
2. False
68
4 | Advanced Topics - Sample Questions
15. One of the Goals of AI is to understand the man as a machine
1. True
2. False
16. What is an agent in AI?
1. 007
2. anything that performs actions
3. anything that performs actions and is not human
4. all are true
5. none
17. The difference between the so called strong vs weak AI is that:
1. weak postulates about ‘emulating’ intelligent behavior
2. strong AI postulates about ‘machines’ that have consciousness
3. all above are true
4. none is correct
18. Alien AI refers to AI that
1. is not based on neurons like humans
2. that is based on silicon
3. that is based on carbon nanotubes
4. none except 3 and 5 is correct
5. all is correct
6. It is the AI of the extra terrestrial life
19. Intelligence can be defined as
1. the computations needed to achieve goals
2. anything that looks like intelligent is intelligent
3. anything that looks like intelligent is not necessarily intelligent
4. all are true
5. none is true
20. The field of cognitive psychology was born out of
1. AI
2. Psychology and AI
3. Cognitive science
4. It was born from the three of them
5. none is true
21. Cognitive Psychology tries to explain
1. the cognitive function in terms of information processing
2. How we relate as social species
3. why the baby is so smart
4. how the computer can behave like a human
69
4 | Advanced Topics - Sample Questions
5. how the human behaves as a computer
22. Is Elsie Intelligent?
1. Elsie’s intelligence depends on the environment so no it is not intelligent
2. According to weak AI yes
3. According to weak AI no
4. According to strong AI yes
5. According to strong AI no
6. if she could pass the Touring test it will be regarded as intelligent according to Strong AI
23. An Alien is watching the university campus from 5 km over the air. She observes the behavior of the students, that from that distance appear as tiny as little ants. According to this observation what can the alien conclude:
1. The students as a colony exhibit some interesting behaviors so yes they are
2. On student as an individual is not intelligent but as a group they are
3. Students are humans so yes
4. Students are do not seem to have consciousness because they just move from building to building and go to feed to a special building when they are hungry, so no they are not intelligent
5. all are true
6. none
24. Noam Chomsky’s view on AI is influenced by his views on linguistics
1. yes
2. no
3. he would never do that
4. all are true
5. none
25. Noam Chomsky view on AI,
1. is based on the poverty of stimulus hypothesis
2. is based on the fact that kids have a “natural” ability for language
3. is on the fact that the brain can learn from few examples
4. none is true
5. all are true
26. Touring Machine
1. is a virtual machine
2. touring machines exist in the World
3. it is a class of machines
4. it is not a machine, it is a concept to describe how the brain works
70
4 | Advanced Topics - Sample Questions
5. the brain is a touring machine of type I-IV
6. all touring machines are based on computers
7. all computers are touring machines
8. the iPhone 6 is a touring machine
27. Functionalism in Ai means that
1. it does not matter what kind of brain or computer u use, what matters is the “software”
2. it refers to the fact that AI functions like your brain
3. it refers to the fact that form follow function
4. Excel sheet is an example of functionalism AI
5. all are true
6. none
28. The “Physical Symbol Systems Hypothesis” states that Cognition requires the manipulation of symbolic representations.
1. True, but only for neural networks
2. False
3. It was never proved
4. Elsie is an example of AI that disproves PSSH
5. Searle’s Chinese Room is an example that disproves PSSH because The man inside the room does not understand Chinese
1. T
2. F
29. The Loebner prize is
1. a robotics prize
2. a touring test prize
3. a price for linguists
4. none
5. all
30. Searle’s Chinese rooms tells something about AI which is…
1. the whole is more than its parts
2. emerging properties come from the system
3. AI should consider the agent and the environment as a whole
4. none
5. all are true
31. If Searle’s spoke Chinese then he would pass the PSSH
1. true
2. false
3. depends on what is written in the books
32. If Searle’s spoke Chinese then according to PSSH.
1. he would be regarded as intelligent
71
4 | Advanced Topics - Sample Questions
2. No, he still would not be regarded as intelligent
3. if he spoke Chinese then it does not disprove the hypothesis
4. The hypothesis is disproved if he speaks Chinese
5. all
6. none
33. Complexity theory states that self-organization occurs when high level properties emerge from simple components, therefore
1. we can say that brain cells self-organize
2. Human Intelligence is a by product of self-organization of neuron in human brain
3. all are true
4. none are true
34. If micro-tubes are subject to quantum effects then the brain is a touring machine
1. yes
2. no
3. yes, it is a quantum touring machine
4. all are true
5. none
35. “Mental states have aboutness on beliefs and desires and that requires a conscious mind.”
1. True
2. False
36. Connectionism is inspired by the human brain
1. True
2. False
37. Model of the world vs. Ground Model. Model of the world is more accurate than Ground models.
1. T
2. F
38. Gross Grasping appears in babies since the second month
1. T
2. F
39. The uncanny valley is a legacy of a survival habit to avoid contagion by disease
1. T
2. F
40. The uncanny valley is deeper if the robot doll moves
1. T
2. F
41. A barbie doll is at the the right side of the uncanny valley
72
4 | Advanced Topics - Sample Questions
1. T
2. F
42. Pokemon is to the left of the valley:
1. T
2. F
43. Draw a flow Chart diagram of Norvig’s spell checker
44. Draw a diagram of Searle’s Chinese room
45. Draw a diagram of a touring machine
46. Code in pseudocde Norvig’s spell checker
47. Code in pseudocode a spell checker of numbers. that correct any number which is not in the following list: list_of_prime_numbers_from_1_to_7433.txt
48. Code in pseudocode the ACO. Given:
1. Space: matrix of L x L cells
2. N ants
3. pheromone evaporation rate 0.95 per turn
4. food location: (23,44) infinite
5. nest location: (122,133)
6. Pheromone: ants leave trail of pheromone
7. movement: ants move randomly to any of the surrounding 8 squares, with equal probability but if one square contains pheromone then the
probability to move to that square doubles if the pheromone there is more than 0.05
8. Ants take food from source to nest
49. iRoomba performance is best programmed and explained in terms of:
1. behaviors
2. plan action goal
3. a combination of both
4. none
5. all is true
50. Packbot perfromarnce is best explained in terms of
1. behaviors
2. plan action goal
3. a combination of both
4. none
51. According to Andrew Ng, Deep Learning is a buzz word for
1. Layered neural networks
2. Is superior to support vector machines
3. It is not only referring to layered neural networks but a whole more things
73
4 | Advanced Topics - Sample Questions
52. Big Data is phenomenon in which people model large amounts of data by using machine learning algorithms and the likes
1. True
2. False
53. The Singularity is
1. a point in time where the Earth ends
2. a point in time where machines become conscious
3. a point in time where AI surpasses the capability of human AI
4. all
5. none
6. it is a resort at the ESA in Luxembourg
7. it is a spa popular with AI
54. The Singularity is based in the exponential growth such as the sequence 1 2 4 8 16
1. False and 1 2 4 8 is not exponential growth
2. True
3. False
4. all
5. none
55. Nao robot can be considered as intelligent because
1. if it passes the Touring test yes
2. according to weak AI, if it passes the Touring test but has no consciousness then no
3. Nao can never be intelligent in it’s present form because the Intel Atom chip is very limited in processing power
4. All are true
74
4 | Advanced Topics - Sample Questions
Dr. Jose Berengueres joined UAE University as Assistant Professor in 2011. He received MEE from Polytechnic University of Catalonia in 1999 and a PhD in bio-inspired robotics from Tokyo Institute of Technology in 2007.
He has authored books on:The Toyota Production SystemDesign ThinkingHuman Computer InteractionUX women designersBusiness Models Innovation
He has given talks and workshops on Design Thinking & Business Models in Germany, Mexico, Dubai, and California.
Artificial Intelligence
Honda Development Center. Asimo project initial sketch
here!
Can Follow Youat different speeds
Stairs and floors
Carry On
Not taller than human
Not heavier than human
Can follow a human one step behind
Two leg walking
Can ask for help in case of problem
a bit slowerplease