Lecture 14 -
- Fei-Fei Li
Image ¡Classifica-on ¡
Professor ¡Fei-‑Fei ¡Li ¡ Stanford ¡Vision ¡Lab ¡
15-‑May-‑13 ¡ 1 ¡
Image Classifica-on Professor Fei-Fei Li Stanford Vision - - PowerPoint PPT Presentation
Image Classifica-on Professor Fei-Fei Li Stanford Vision Lab 1 15-May-13 Lecture 14 - Fei-Fei Li What we will learn today? Introduc-on Bag
Lecture 14 -
15-‑May-‑13 ¡ 1 ¡
Lecture 14 -
15-‑May-‑13 ¡ 2 ¡
Lecture 14 -
people ¡
and ¡walking ¡
Grand ¡JaRe” ¡
15-‑May-‑13 ¡ 3 ¡ Seurat, ¡1884-‑5 ¡
Lecture 14 -
15-‑May-‑13 ¡ 4 ¡
Lecture 14 -
15-‑May-‑13 ¡ 5 ¡
Classifying ¡objects ¡ Classifying ¡natural ¡ scenes ¡ Classifying ¡human ¡ ac-ons ¡
Lecture 14 -
15-‑May-‑13 ¡ 6 ¡
Lecture 14 -
15-‑May-‑13 ¡ 7 ¡
Lecture 14 -
Biederman, ¡Science, ¡1973 ¡
15-‑May-‑13 ¡ 8 ¡
Lecture 14 -
Biederman, ¡Science, ¡1973 ¡
15-‑May-‑13 ¡ 9 ¡
Lecture 14 -
Thorpe, ¡et ¡al. ¡ ¡Nature, ¡1996 ¡ 15-‑May-‑13 ¡ 10 ¡
Lecture 14 -
Thorpe, ¡et ¡al. ¡ ¡Nature, ¡1996 ¡
15-‑May-‑13 ¡ 11 ¡
Lecture 14 -
15-‑May-‑13 ¡ 12 ¡
Lecture 14 -
Guess “beach” Test Image Training Images
Pattern Recognition Alg. (SVM)
Train
Walther, ¡Caddigan, ¡Fei-‑Fei, ¡Beck, ¡J. ¡Neurosci. ¡2009 ¡ 15-‑May-‑13 ¡ 13 ¡
Lecture 14 -
¡* ¡p ¡< ¡0.05 ¡ ** ¡p ¡< ¡0.01 ¡
15-‑May-‑13 ¡ 14 ¡
Lecture 14 -
15-‑May-‑13 ¡ 15 ¡
Lecture 14 -
This ¡segment ¡is ¡based ¡on ¡the ¡tutorial ¡“Recognizing ¡and ¡Learning ¡ ¡
Object ¡Categories: ¡Year ¡2007”, ¡by ¡Prof ¡L. ¡Fei-‑Fei, ¡A. ¡Torralba, ¡and ¡R. ¡Fergus ¡
15-‑May-‑13 ¡ 16 ¡
Lecture 14 -
15-‑May-‑13 ¡ 17 ¡
Lecture 14 -
Of all the sensory impressions proceeding to the brain, the visual experiences are the dominant ones. Our perception of the world around us is based essentially on the messages that reach the brain from our eyes. For a long time it was thought that the retinal image was transmitted point by point to visual centers in the brain; the cerebral cortex was a movie screen, so to speak, upon which the image in the eye was projected. Through the discoveries of Hubel and Wiesel we now know that behind the origin of the visual perception in the brain there is a considerably more complicated course of events. By following the visual impulses along their path to the various cell layers of the optical cortex, Hubel and Wiesel have been able to demonstrate that the message about the image falling on the retina undergoes a step- wise analysis in a system of nerve cells stored in columns. In this system each cell has its specific function and is responsible for a specific detail in the pattern of the retinal image.
sensory, brain, visual, perception, retinal, cerebral cortex, eye, cell, optical nerve, image Hubel, Wiesel
China is forecasting a trade surplus of $90bn (£51bn) to $100bn this year, a threefold increase on 2004's $32bn. The Commerce Ministry said the surplus would be created by a predicted 30% jump in exports to $750bn, compared with a 18% rise in imports to $660bn. The figures are likely to further annoy the US, which has long argued that China's exports are unfairly helped by a deliberately undervalued yuan. Beijing agrees the surplus is too high, but says the yuan is only one factor. Bank of China governor Zhou Xiaochuan said the country also needed to do more to boost domestic demand so more goods stayed within the
yuan against the dollar by 2.1% in July and permitted it to trade within a narrow band, but the US wants the yuan to be allowed to trade
it will take its time and tread carefully before allowing the yuan to rise further in value.
China, trade, surplus, commerce, exports, imports, US, yuan, bank, domestic, foreign, increase, trade, value
15-‑May-‑13 ¡ 18 ¡
Lecture 14 -
face ¡ bike ¡ violin ¡ 15-‑May-‑13 ¡ 19 ¡
Lecture 14 -
codewords ¡dic-onary ¡
15-‑May-‑13 ¡ 20 ¡
Lecture 14 -
feature detection & representation
codewords dictionary
image representation
15-‑May-‑13 ¡ 21 ¡
Lecture 14 -
15-‑May-‑13 ¡ 22 ¡
Lecture 14 -
Normalize ¡patch ¡
Detect ¡patches ¡
Compute ¡ descriptor ¡ (e.g. ¡SIFT) ¡
Slide ¡credit: ¡Josef ¡Sivic ¡
15-‑May-‑13 ¡ 23 ¡
Lecture 14 -
Slide ¡credit: ¡Josef ¡Sivic ¡
15-‑May-‑13 ¡ 24 ¡
Lecture 14 -
Slide ¡credit: ¡Josef ¡Sivic ¡
15-‑May-‑13 ¡ 25 ¡
Lecture 14 -
Clustering ¡(e.g. ¡k-‑means) ¡
Slide ¡credit: ¡Josef ¡Sivic ¡
15-‑May-‑13 ¡ 26 ¡
Lecture 14 -
Clustering ¡(e.g. ¡K-‑means) ¡
Slide ¡credit: ¡Josef ¡Sivic ¡
Visual ¡vocabulary ¡ 15-‑May-‑13 ¡ 27 ¡
Lecture 14 -
– Unsupervised ¡learning ¡process ¡ – Each ¡cluster ¡center ¡produced ¡by ¡k-‑means ¡becomes ¡a ¡ codevector ¡ – Codebook ¡can ¡be ¡learned ¡on ¡separate ¡training ¡set ¡ – Provided ¡the ¡training ¡set ¡is ¡sufficiently ¡representa-ve, ¡ the ¡codebook ¡will ¡be ¡“universal” ¡ ¡
– A ¡vector ¡quanBzer ¡takes ¡a ¡feature ¡vector ¡and ¡maps ¡it ¡ to ¡the ¡index ¡of ¡the ¡nearest ¡codevector ¡in ¡a ¡codebook ¡ – Codebook ¡= ¡visual ¡vocabulary ¡ – Codevector ¡= ¡visual ¡word ¡ ¡
15-‑May-‑13 ¡ 28 ¡
Lecture 14 -
…
Source: ¡B. ¡Leibe ¡
Appearance ¡codebook ¡
15-‑May-‑13 ¡ 29 ¡
Lecture 14 -
Appearance ¡codebook ¡
… … … … …
Source: ¡B. ¡Leibe ¡
15-‑May-‑13 ¡ 30 ¡
Lecture 14 -
Fei-‑Fei ¡et ¡al. ¡2005 ¡
15-‑May-‑13 ¡ 31 ¡
Lecture 14 -
15-‑May-‑13 ¡ 32 ¡
Lecture 14 -
Codewords ¡dic8onary ¡ ¡
15-‑May-‑13 ¡ 33 ¡
Lecture 14 -
Codewords ¡dic8onary ¡ ¡
codewords
frequency
…. ¡ 15-‑May-‑13 ¡ 34 ¡
Lecture 14 -
feature detection & representation
codewords dictionary
image representation
15-‑May-‑13 ¡ 35 ¡
Lecture 14 -
codewords dictionary
15-‑May-‑13 ¡ 36 ¡
Lecture 14 -
15-‑May-‑13 ¡ 37 ¡
Lecture 14 -
Class ¡1 ¡ Class ¡N ¡
15-‑May-‑13 ¡ 38 ¡
Lecture 14 -
: negative : positive < + ⋅ ≥ + ⋅ b b
i i i i
w x x w x x Which hyperplane is best?
w, b 15-‑May-‑13 ¡ 39 ¡
Lecture 14 -
nega-ve ¡examples ¡ Margin Support vectors Distance between point and hyperplane:
|| || | | w w x b
i
+ ⋅
Support vectors:
1 ± = + ⋅ b
i w
x
Margin = 2 / ||w||
Credit ¡slide: ¡S. ¡Lazebnik ¡
i i i i y x
i i i i
Classifica-on ¡func-on ¡ ¡(decision ¡boundary): ¡ ¡
Solution: ¡
15-‑May-‑13 ¡ 40 ¡
Lecture 14 -
Margin
i i i i
Test ¡point ¡
15-‑May-‑13 ¡ 41 ¡
Lecture 14 -
1 : 1) ( negative 1 : 1) ( positive − ≤ + ⋅ − = ≥ + ⋅ = b y b y
i i i i i i
w x x w x x
Credit ¡slide: ¡S. ¡Lazebnik ¡
15-‑May-‑13 ¡ 42 ¡
Lecture 14 -
¡
¡ ¡
¡
x x x x2
Slide credit: Andrew Moore
15-‑May-‑13 ¡ 43 ¡
Lecture 14 -
Φ: x → φ(x)
to ¡some ¡higher-‑dimensional ¡feature ¡space ¡where ¡the ¡ training ¡set ¡is ¡separable: ¡
Slide credit: Andrew Moore
liPing ¡transforma-on ¡ 15-‑May-‑13 ¡ 44 ¡
Lecture 14 -
i i i i
NOTE: ¡
¡ 15-‑May-‑13 ¡ 45 ¡
Lecture 14 -
=
=
N i
i h i h h h I
1 2 1 2 1
)) ( ), ( min( ) , (
2 2 1 2 1
Local Features and Kernels for Classifcation of Texture and Object Categories: A Comprehensive Study, IJCV 2007
15-‑May-‑13 ¡ 46 ¡
Lecture 14 -
the ¡number ¡of ¡features ¡instead ¡of ¡cubic) ¡
15-‑May-‑13 ¡ 47 ¡
Lecture 14 -
Beyond ¡Bags ¡of ¡Features: ¡Spa8al ¡Pyramid ¡Matching ¡for ¡Recognizing ¡Natural ¡Scene ¡Categories. ¡ ¡S. ¡Lazebnik, ¡C. ¡Schmid, ¡and ¡J. ¡Ponce. ¡CVPR ¡2006 ¡
15-‑May-‑13 ¡ 48 ¡
Lecture 14 -
15-‑May-‑13 ¡ 49 ¡
Lecture 14 -
Fei-‑Fei ¡& ¡Perona: ¡65.2% ¡ 15-‑May-‑13 ¡ 50 ¡
Lecture 14 -
Query ¡
15-‑May-‑13 ¡ 51 ¡
Lecture 14 -
15-‑May-‑13 ¡ 52 ¡
Lecture 14 -
discrete ¡variable: ¡
forest ¡ coast ¡ kitchen ¡ mountain ¡ c ¡
p(c|η) ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
15-‑May-‑13 ¡ 53 ¡
Lecture 14 -
1
1
=
= K k k
π
where ¡
topic ¡#13 ¡ topic ¡#15 ¡
topics ¡ ¡ propor8on ¡of ¡themes ¡ ¡
15-‑May-‑13 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
54 ¡
Lecture 14 -
) ( ~ π z Mult
discrete ¡variable: ¡
topic ¡#13 ¡ topic ¡#15 ¡
topics ¡ ¡ propor8on ¡of ¡themes ¡ ¡
15-‑May-‑13 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
55 ¡
Lecture 14 -
expected ¡value ¡of ¡β ¡given ¡‘z=13’ ¡
codeword ¡#265 ¡
) , ( ~ β z x Mult
) , ( ~ β z x p x
discrete ¡variable: ¡
15-‑May-‑13 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
56 ¡
Lecture 14 -
expected ¡value ¡of ¡β ¡given ¡‘z=15’ ¡
) , ( ~ β z x Mult
) , ( ~ β z x p x
discrete ¡variable: ¡
15-‑May-‑13 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
57 ¡
Lecture 14 -
( ) ( ) ( ) ( )
π β π θ π β θ d z x p z p c p c x p
n n z n N n
n
⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛∏ =
, , , ,
β π θ π β θ π , , , , , ,
n n n N n
z x p z p c p c z x p ∏ =
joint ¡probability ¡
15-‑May-‑13 ¡ 58 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
Lecture 14 -
= + =
N n k n ck ck
z 1 δ θ γ ( )
⎟ ⎠ ⎞ ⎜ ⎝ ⎛ Ψ − Ψ =
k ck ck ck
γ γ π log
⎭ ⎬ ⎫ ⎩ ⎨ ⎧ = + = =
T t t n kt ck k n
x z 1 log log exp 1 δ β π δ
= = + =
I i N n t n i k n i kt
x z 1 1
, ,
δ δ ζ ξ ( )
⎟ ⎠ ⎞ ⎜ ⎝ ⎛ Ψ − Ψ =
t kt kt kt
ξ ξ β log
Maximum ¡Likelihood ¡es-ma-on ¡(Minka ¡2000) ¡ ¡
15-‑May-‑13 ¡ 59 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
Lecture 14 -
codewords ¡dic8onary ¡
15-‑May-‑13 ¡ 60 ¡
Lecture 14 -
c
15-‑May-‑13 ¡ 61 ¡
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
Lecture 14 -
13 Natural Scene Categories 4 indoor + 9 outdoor
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
15-‑May-‑13 ¡ 62 ¡
Lecture 14 -
15-‑May-‑13 ¡ 63 ¡
Lecture 14 -
15-‑May-‑13 ¡ 64 ¡
Lecture 14 -
15-‑May-‑13 ¡ 65 ¡
Lecture 14 -
15-‑May-‑13 ¡ 66 ¡
Lecture 14 -
Fei-‑Fei ¡& ¡Perona ¡(CVPR ¡2005) ¡
15-‑May-‑13 ¡ 67 ¡
Lecture 14 -
15-‑May-‑13 ¡ 68 ¡