Professional Documents
Culture Documents
Artificial Intelligence
here!
Carry On
Not taller
Can Follow You than human
at different speeds
Not heavier
than human
Editor
Jose Berengueres
Edition
First Edition. August 24th, 2014.
Text Copyright
© Jose Berengueres 2014. All Rights Reserved.
i
Video, Audio & Artwork Copyright
Artwork 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
Ai
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
ii
1 | Introduction to AI (in this chapter)
What makes something intelligent?
Bielefeld University, Germany.
1. Saliency - the ability to focus on the
Psychology of Human Robot interaction
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 property
AI as an emerging property of simple components, a
EC3 commodity. Examples,
1. Ant colony algorithm
2. Viola Jones face recognition
s
A I i 3. Norvig’s SpellChecker
i in
t h e here
y, are
o da o u to
T . y n t
.. wa To reinforce the ideas
all u p
sm
e y o
l Ca
s l
e cau sma 1.Andrew Ng on Brain inspiration
b he ap.
g e t C 2.Maja Rudinac on saliency on developmental
n big
cha a
o
int psychology
4
1 | Introduction to AI - Viola Jones
http://vimeo.com/12774628
ut
abo
s
r k s i le
t wo simp
tha tin
g
ck
is
AI g a tr i
gre he rge
Ag s”. T la
e
a ture re gat s
“fe a gg at ure
The more features the better as long they are better than 0.0001% of o fe
w t of
ho er
100% random. (Theorem, see Berengueres & Efimov on Etihad case) mb
nu
5
1 | Introduction to AI - Spell This!
HELLO
Who is
------
right?
6
1 | Introduction to AI - Spell This!
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
return model
NWORDS = train(words(file('big.txt').read())) Oh My
alphabet = 'abcdefghijklmnopqrstuvwxyz' Pythons!
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 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:
>>>
7
1 | Introduction to AI - Spell This!
That book is a
good reference, but is a
pedagogic of a fail as big
as dusty dictionaries get.
8
1 | Introduction to AI - The Case of Machine Translation
9
1 | Introduction to AI - Monte Carlo Tree Search
OTHELLO
Game positions: 1028
Computer strength:
TIC-TAC-TOE SUPERHUMAN 19-BY-19 GO
Game positions: 104
Game positions: 10172
Computer strength: PERFECT Computer strength: STRONG
AMATEUR
XIANGQI (CHINESE
OWARE CHESS)
Game positions: 1048
Game positions: 1011
Computer strength: BEST
Computer strength: PERFECT
9-BY-9 GO PROFESSIONAL
10
1 | Introduction to AI - Monte Carlo Tree Search
This reminds me
of Searle’s Chinese Box
to p lay g o
e d tr ying
We sto
p p
a n d s tarte d
t e r s’s rules
w ith m
a s
w it h back
M o n te Carlo
using r u n in g ... a
t io n an d p
propa ga
e a p p roach”
b r u te forc )
m eh o w a llio n fun d
so w vs. M
e d
also ED Sha
(See
Medallion Fund
That’s what I call
made millions using
intelligence free AI
the same strategy to bet
on Wall Street
-----
MMTG
11
1 | Introduction to AI - Monte Carlo Tree Search
12
1 | Introduction to AI - Monte Carlo Tree Search
13
1 | Introduction to AI - Practice Time
ACO Exercise
http://www.youtube.com/watch?v=SMc6UR5blS0
14
1 | Introduction to AI - Philosophical concepts
(Abridged from the book by Henry Brighton and Howard 5. Alien-AI = AI that works and is not similar to human AI
Selina, Introducing AI) 6. Trans humanism and Immortality
re se a rchers
e su r vey AI they
In on t disc ip lin e
d w ha
ske
were a clo se st to
e
feel th
PBS Documentary http://www.youtube.com/watch?v=53K1dMyslJg
n
m o st commo
e
o phy was th
(Philo s )
answer 7. AI and Psychology. (see chapter 3.1)
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.
9. Intelligence = the computational part of achieving goals in
AI Goals
the world.
1. Understand the man as a machine
10. Is Elsie intelligent? (are students roaming around a
2. Understand anything (not only humans ) that performs campus and going to the cafeteria when they are hungry
actions. We refer to this as agents. Therefore agents can intelligent? :) )
be human or non-human or a combination
11. Chomsky: the capacity of language seems to be due that
3. Strong AI = to build a Doraemon we have an part in the brain dedicated to it (like the organ
4. Weak AI = to understand things by building robot of the heart). Otherwise how can we explain that every kid
prototypes learns to speak just by listening to its parents speaking?
15
1 | Introduction to AI - Philosophical concepts
that is not plausible. Therefore, the organ of language must 16.The Loebner prize is $100,000 for the first place
exist int he brain. 17. Searle’s Chinese room. I can go inside a room with all the
12. Turing Machine. Model for all machines via states and Chinese books in the world and someone can slide Chinese
inputs. messages through the slide. An I might learn what to reply
even though I do not know any Chinese symbols. And pass
the touring test. Would that be regarded as intelligence?
Searle’s Chinese room passes the PSS hypotheses
e pr iva tion regarding manipulation of symbols.
yd
Sensor IQ. 18.But Searle himself + the books = understand Chinese?
ses th e
decrea which means: Can the whole be more that sum of its parts?
19. Complexity Theory. Self-organization occurs when high-
d
ho is deprive level properties emerge from interaction of simple
y w
A bab few components. ACO is an example.
s in a
o uc h die 20. The Brain process Experiment and the mental only realm.
of t
days Replace each neuron by an artificial one. What would
happen?
21. Penrose conjectures that consciousness requires of
quantum effects, that are not present in silicon based chips.
13. Functionalist separation of mind from brain (Software from ie. non computable processes. Microtubes.
hardware)
22. Understanding, Consciousness and Thought. Intentionality
14. Physical Symbol Systems Hypothesis 1976 = Cognition and aboutness. Example: Mental states have aboutness on
requires the manipulation of symbolic representations beliefs and desires and that requires a conscious mind.
15. Touring test. Can machines think is a ill-defined question. Conciouss is ALWAYS about something,
So touring replaced it by... Can u fool a human in to 23. Perception - cognition - action
believing you are as smart as a human? Noam Chomsky 24. Cognitive Modelling. Modelling is not understanding.
says: Thats like asking if submarines can swim.
16
1 | Introduction to AI - Philosophical concepts
25. Module based conginition could explain optical ilussions 33. Dreyfus says that AI is misguided if it thinks disembodied
26. Game playing AI represent the game internaly with trees intelligence is possible.
34. IF Dreyfus is correct then agents must be used as
engaged in everyday world not as disengaged.
ho le ave
tr a de rs w 35.Frist principle of embodiment:
Most t o start
Sach s 1. The constraints of having a body are important for the AI
m an
Gold p e n dent function. Elsie recharging station.
n in de
ir o w
the r p e rfor m 2. “The world is the best model ;) ” - Rodney Brooks
d un d e
fu n
he dge g solo
3. Bottom-to -top construction
y in
when fl 4. Brooks on conventional robotics
1. Based on sense plan do
5. Brooks new AI
1. Based on behaviors - Genghis - Behavior by design
36. Evolution without biology
27. Machines does not have common sesne? Is ti because
37. Only when interaction between humans and their
lack of background info?
environment are more well understood w ill AI begin to
28.Sense model plan act solve the right problem
29. Conectionists. ANN
30. Symbol grounding and menaing
31. New AI Rodney Brooks. A machine does not think. What
hinks is the machine + his environment as a system
32. Frogs do not have planing modules. It's directed by the
eye perception. Reflex.
17
1 | Introduction to AI - Philosophical concepts
------
I seen 37
before!
18
2 | Robotics
“I studied how
babies make sense of the Recorded at Building 34 TU Delft on
August 21st, 2014
world to build a low cost
robot”
------
Maja Rudinac
Key Point
h t Plan
p ter Flig
Cha
T
...Blip Ford-
Blip
s ro bots
u
---- Famo
sy
Dev. P
Coupling
2DoF
---- Intuitive Control
----
2 | Robotics - Home Robotics 21
21
2 | Robotics - Review of state-of-the-art
One goal of AI is
to build robots that
are better than humans
----
http://www.youtube.com/watch?v=S5AnWzjHtWA
22
2 | Robotics - Review of state-of-the-art
Lack of empathy, no UX
knowledge and excess of
resources. This expensive
product epitomizes silo
thinking in todays
universities around the
world. How did this happen?
This is an
example of over
engineering Pre-Ford-T
robot thinking
----
25
2 | Robotics - Review of state-of-the-art
Just to be clear
They are trying to build this They should be trying to build this:
26
2 | Robotics - Review of state-of-the-art
Sociologists like
Selma Savanovic and
F. Eyssel use me to do
gender studies
27
2 | Robotics - Adaptative Robots
Adaptative Robots
http://www.youtube.com/watch?v=13JGGbB2ctM
28
3 | UX - The heart of AI
Hello
In Japan where engineers grew up
with Doraemon (a robot), Arale- I am flobi!
chan (a robot), Gatchaman, ^.^’
Pathlabor (robots), Ghost in the
S h e l l ( a r o b o t ) , M a z i n g e r- Z
(robots) ... Robots are not seen as
antagonistic characters. In the
west, we grew up with Terminator
and only recently we got Wall-e
ple under
Peo
u c h the
ate so m
e s tim
n c e of
influ e
e n t u po n
onm
envir
be h a vior
their
ct ion Check
e
u s s
ev io
sp ell ch.1 of Seven
pr a
In ade d it Women that changed
m d i
u ut
yo .. b ppy? the UX industry
e r. a
e ck s e r h
c h u for a compelling case
t he
ke
ma
3 | UX - The heart of AI - Why Happy is Better
How design that makes you happy is easier to use simply Which video is more serious about safety...
because the fact that a happy brain has a higher IQ. http://www.youtube.com/watch?v=DtyfiPIHsIg&feature=kp
or
is
e x e rcise
the
p o int of .
The a w inner
find
not to h Airlin
e
y, E a c
ionall d
Ad d i t
u ltu res an
t c
More Happy, s d if feren I
ser ve i cs . Maybe
m
more IQ? i o econo ted
s o c
i t to Uni
re
l d compa
31 shou es.
Airlin
3 | UX - The heart of AI - Not every one is the same - Isabel Myers
Isabel Myers-Briggs
Knowing psychology should be a prerequisite before doing OK, I know that you are thinking. What is my personality type?
any AI at all. Anyhow, one of the best books to go up to speed http://www.humanmetrics.com/cgi-win/jtypes2.asp
on how humans “work”, is 50 Psychology Classics, a book I You are welcome.
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 You want to do
into Builders, Explorers, Directors and Negotiators. There “ai” with a captial
is a lot confusion about the personality types. The most letter? you’d better start
famous is the Myers Brigs that classifies people into 16 types.
discerning personality
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 types yourself...
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.
Because
if your AI can’t
distinguish between an
ISFJ vs. ENFP he will be
perceived as inept at
http://www.youtube.com/watch?v=aQ2QbS-EgrM social interactions...
32
3 | UX - The heart of AI - Not every one is the same - Isabel Myers
33
3 | UX - The heart of AI - Not every one is the same - Isabel Myers
via www.furthered.com
34
4 | Computer Vision
( in this chapter... )
Program a PC so it learn how to see
a plane
n
Reti
38
4 | Computer Vision - The Design of the Eye
Pin-hole Design
39
4 | Computer Vision - Developmental Psychology
40
4 | Computer Vision - Developmental Psychology
Discrimination
Attraction to peoples faces
Face recognition
Use the hand to move objects to scan them form various
angles
Shades and 3D
Turns 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 inperceptible
mismatches... that’s why smart people get head aches in
3D cinemas)
41
4 | Computer Vision - Number Recognition
12345
http://www.youtube.com/watch?v=D_cZBdfw-hQ
In Feb 2011 (just before the tsunami), we programmed
HRP-IV to play a game. We used the histogram method to
separate Caucasian skin from a background and then we
counted the number of valleys and mountains between
the hull vertexes. A more primitive approach is to average
67890
the area, but then it is not as robust.
Code review:
https://github.com/orioli/MAID-ROBOT
https://github.com/orioli/MAID-ROBOT/blob/master/uEyeCameraHIRO/camShiftDemo/camShiftDemo.cpp
42
4 | Computer Vision - Number Recognition
Features
The students will try to find saliency features. Good
saliency features are robust to noise, partial occlusions
Feature Redux
and confusion. Here is a typical list:
Consider the letter ‘E’, its representation a s a vector is e =
# of horizontal segments
{0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0 ,
# of pixels belonging to horizontal segments
0,0,1,1,1,1,1,1,1,0,0 0,0,1,0,0,0,0,0,0 ... } that is a a vector
length of segments of dimension 11 x 13 = +100. There is no way for the
# contains closed loops retinal nerve to have enough bandwidth to send all that
# start and end points information for processing to the brain neurons. What
happens in reality is that, already at retina level, features
relative orientation of end points
are extracted, information is compressed.
Extracting features from pixels is called feature extraction.
If we find five features that allow us to distinguish between
Salient features are the ones that are most useful in
al 10 different number shapes, then the problem becomes
classifying pixels (Information Entropy).
a dimension 5 problem, much more manageable.
43
4 | Computer Vision - Number Recognition
Cluster of Zeroes
in a 2D space
Because the problem can be complex. Students can start clusters. This helps them understand the need of more
by trying to distinguish just two numbers. Manually features when clusters overlap
extracting two features: vertical and horizontal features
(feature reduction). Then, we can map the numbers in
44
4 | Computer Vision - Number Recognition
Training Reflection
Some teams came up with valley mountain features.
Others with number of lines, or crossings. Let’s make a
competition to see which is the winning team! (this is also
a great excuse to learn openCV)
ision
te r v
m pu
So if we start with webcam photos of figures at ll co d ay
s t o
A
p p w o rk
600x400 pixels how would you design the program? a lly
nta
At this stage most students fail to recognize the need ame t his
un
d
e as Now we just need to learn
for training with lots of examples. In fact the hard part f am
s
is training (understanding what features work to the m ple how to:
exa 1. Do tracking
differentiate 0 from 1 and a 1 from a 2...)
2. Clustering methods
Morphological Ops
Closing
Morphs ops is different from linear filters in that they are not 1. Dilate (enlarge black pixel by adding black pixel next to pre
linear. Imagine you have the letter E but that the corner pixel existing black pixels using some kind of rule)
has been erased because of some noise. Your brain (Gestalt
Theory) Can reconstruct, in fact it is designed to reconstruct
intersections of lines. A computer is not. It doe snto knwo
anything about Gestalt. So how can we reconstruct this
missing corner? Otherwise the computer might think this is an
F underlined.
You can reconstruct this by use of so called http://www.youtube.com/watch?v=xO3ED27rMHs F!
E!
morhp op called “closing”
46
4 | Computer Vision - Morphological Ops
Opening
Same but in reverse order
Case uses
Closing is used to connect missing lines.
Opening is used to remove noise, that does not belong
to the largest object in the scene.
For more:
http://homepages.inf.ed.ac.uk/rbf/HIPR2/morops.htm
http://bigwww.epfl.ch/demo/jmorpho/
47
4 | Computer Vision - Feature Extraction
Feature Extraction
Most
of Kaggle’s comp.
winners are decided by
how lucky they are at
finding useful features
----
j.
http://www.youtube.com/watch?v=n1ViNeWhC24
48
4 | Computer Vision - Vision for Navigation
NT: Hoover tried to steal his idea. They lost in court with
punitive damages.
49
4 | Computer Vision - Tracking
Maja’s method
Features extracted
Use of HSV histogram (robust to ilumination changes)
Texture by Gray level co-occurrence matrix
Edge orientation histogram (6 bins)
Mean, skewness and sd for each color chanel
http://www.youtube.com/watch?v=InqV34BcheM Discard all but 25 top features. Tested on Columbia Object
Image Library. Beats previous methods.
50
4 | Computer Vision - Tracking
51
5 | Advanced Topics
Bere
ng
http:/ ueres an
/www d
.journ Efimov Jo
alofb u
igdata rnal of Big
.com Data
/con
tent/ 2014, 1:3
1/1/3
CAS
E ST
U DY
Airlin
real-t e new cu
ime r st
Jose esou omer tier
Beren
rce a
llocat level fore
guere 1*
s an
d Dm Open
* Corr
e
UAE spondenc
1
itry E
fimov ion o castin 2
Acce
ss
U
Dhab niversity e: jose@u
fam g f
iles p or
i, , 175 a
Full li UAE 51 A eu.ac.ae
This case will help you understand a typical big data project
st l Ain,
availa of autho Abu
Abst
rogra
ble a r
t the informati ract
end
of th on is
e artic
This le
is a m
at the three levels: had a case
stu
techn large mile dy on an
iques s a
would . As a loyalty pro irline’s m
n ile
miles become example, gram but s program
a to pre was n
in CR earned d privileg ot tak resource
Corporate or How to deal with conflicts of interest inside a u ed d ic t w
M o
extra interact ring the p frequen hether in ing advan ptimizat
polat ions t the c t io
was ion w betw ast mont flyer or omin age of re n. The air
39% it e e h s n o t, a li g month cent da lin
when when h whet n the was n ta min e
organization o he airli u sed ear (s), a
achie GBM and ne mont r a new u ne and th . This info extrapola new pas ing
v h s e r t se
false ed. This other ble of data er would passeng mation w ion of the nger
p co n w a e a
one w ositives. rrespond ding tech as used t ttain a p r. The co s then u
The a o rivile s
part o ere used.
e
ccura d to a p iques we make a
n ged rrelation ed
Business logic or How to pose the right questions that f A c re r pr mil of
of lim privileged n applicati y reache diction a e used, a ediction. es status
ited re m il o n tha d 97% c c uracy c orrela In co
can a sourc e s -tier w t rank if thr of 8 tion n t rast
ss
thus ign now es such as as propo s users ac ee month 7% with of 70% w ,
incre s
asing those reso available ed. The a cording to s of data less than as
make sense from a money point of view and add value Keyw
o
Frequ rds: Airlin
ent fl
the p
e
u
ed va e
u
n
p
erceiv rces to th pgrades o plication p their prob stead o %
lue o passenge a given fl rforms rea ility to be
e ab
in
f
3
http://www.journalofbigdata.com/content/pdf/2196-1115-1-3.pdf
53
5 | Advanced Topics - Reverse Engineering the Neuro Cortex
memory-prediction framework I
invented
this, to have money for
this
------
J.Hawkins
http://www.youtube.com/watch?v=IOkiFOIbTkE
54
5 | Advanced Topics - Deep Learning
Inside an ANN It has always been difficult to train an ANN. But in 2012, a
The functions that are run inside an ANN are controlled by the breakthrough, a paper sparks a renaissance in ANN. Alex
memory of the neural network, arrays of numbers known as Krizhevsky, Ilya Sutskever, and Geoff Hinton bring together a
weights that define how the inputs are combined and whole bunch of different ways of accelerating the
recombined to produce the results. Dealing with real-world
learning process, including convolutional networks, clever
problems like cat-detection requires very complex functions,
use of GPUs, and some novel mathematical tricks like ReLU
which mean these arrays are very large, containing around
and dropout, and showed that in a few weeks they could
60 million (60MBytes) numbers in the case of one of train a very complex network to a level that outperformed
the recent computer vision networks. The biggest obstacle to conventional approaches to computer vision.
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.
55
5 | Advanced Topics - Deep Learning
http://en.wikipedia.org/wiki/Deep_learning#Fundamental_concepts
57
Acknowledgments
i ng
e a rn
ep L
De
#
here! Can ask for help in case of
problem
Carry On
a bit slower
please
Not taller
Can Follow You than human
at different speeds
Not heavier
than human