Words & Pictures Clustering and Bag of Words Many - - PowerPoint PPT Presentation

words pictures
SMART_READER_LITE
LIVE PREVIEW

Words & Pictures Clustering and Bag of Words Many - - PowerPoint PPT Presentation

Words & Pictures Clustering and Bag of Words Many slides adapted from Svetlana Lazebnik, Fei-Fei Li, Rob Fergus, and Antonio Torralba Document


slide-1
SLIDE 1

Words ¡& ¡Pictures ¡ ¡

Clustering ¡and ¡Bag ¡of ¡Words ¡

Many ¡slides ¡adapted ¡from ¡Svetlana ¡Lazebnik, ¡Fei-­‑Fei ¡Li, ¡Rob ¡Fergus, ¡and ¡Antonio ¡Torralba ¡

slide-2
SLIDE 2

Document ¡Vectors ¡

  • Represent ¡document ¡as ¡a ¡“bag ¡of ¡words” ¡
slide-3
SLIDE 3

Bag-­‑of-­‑features ¡models ¡

Many ¡slides ¡adapted ¡from ¡Fei-­‑Fei ¡Li, ¡Rob ¡Fergus, ¡and ¡Antonio ¡Torralba ¡

slide-4
SLIDE 4

Origin: ¡Bag-­‑of-­‑words ¡models ¡

  • Orderless ¡document ¡representaJon: ¡frequencies ¡
  • f ¡words ¡from ¡a ¡dicJonary ¡ ¡Salton ¡& ¡McGill ¡(1983) ¡
slide-5
SLIDE 5

Origin: ¡Bag-­‑of-­‑words ¡models ¡

US ¡PresidenJal ¡Speeches ¡Tag ¡Cloud ¡ http://chir.ag/phernalia/preztags/

  • Orderless ¡document ¡representaJon: ¡frequencies ¡
  • f ¡words ¡from ¡a ¡dicJonary ¡ ¡Salton ¡& ¡McGill ¡(1983) ¡
slide-6
SLIDE 6

Origin: ¡Bag-­‑of-­‑words ¡models ¡

US ¡PresidenJal ¡Speeches ¡Tag ¡Cloud ¡ http://chir.ag/phernalia/preztags/

  • Orderless ¡document ¡representaJon: ¡frequencies ¡
  • f ¡words ¡from ¡a ¡dicJonary ¡ ¡Salton ¡& ¡McGill ¡(1983) ¡
slide-7
SLIDE 7

Origin: ¡Bag-­‑of-­‑words ¡models ¡

US ¡PresidenJal ¡Speeches ¡Tag ¡Cloud ¡ http://chir.ag/phernalia/preztags/

  • Orderless ¡document ¡representaJon: ¡frequencies ¡
  • f ¡words ¡from ¡a ¡dicJonary ¡ ¡Salton ¡& ¡McGill ¡(1983) ¡
slide-8
SLIDE 8

Bags ¡of ¡features ¡for ¡image ¡ classificaJon ¡

  • 1. Extract ¡features ¡
slide-9
SLIDE 9
  • 1. Extract ¡features ¡
  • 2. Learn ¡“visual ¡vocabulary” ¡

Bags ¡of ¡features ¡for ¡image ¡ classificaJon ¡

slide-10
SLIDE 10
  • 1. Extract ¡features ¡
  • 2. Learn ¡“visual ¡vocabulary” ¡
  • 3. QuanJze ¡features ¡using ¡visual ¡vocabulary ¡ ¡

Bags ¡of ¡features ¡for ¡image ¡ classificaJon ¡

slide-11
SLIDE 11
  • 1. Extract ¡features ¡
  • 2. Learn ¡“visual ¡vocabulary” ¡
  • 3. QuanJze ¡features ¡using ¡visual ¡vocabulary ¡ ¡
  • 4. Represent ¡images ¡by ¡frequencies ¡of ¡ ¡

“visual ¡words” ¡ ¡

Bags ¡of ¡features ¡for ¡image ¡ classificaJon ¡

slide-12
SLIDE 12
  • Regular ¡grid ¡

– Vogel ¡& ¡Schiele, ¡2003 ¡ – Fei-­‑Fei ¡& ¡Perona, ¡2005 ¡

  • 1. ¡Feature ¡extracJon ¡
slide-13
SLIDE 13
  • Regular ¡grid ¡

– Vogel ¡& ¡Schiele, ¡2003 ¡ – Fei-­‑Fei ¡& ¡Perona, ¡2005 ¡

  • Interest ¡point ¡detector ¡

– Csurka ¡et ¡al. ¡2004 ¡ – Fei-­‑Fei ¡& ¡Perona, ¡2005 ¡ – Sivic ¡et ¡al. ¡2005 ¡

  • 1. ¡Feature ¡extracJon ¡
slide-14
SLIDE 14
  • Regular ¡grid ¡

– Vogel ¡& ¡Schiele, ¡2003 ¡ – Fei-­‑Fei ¡& ¡Perona, ¡2005 ¡

  • Interest ¡point ¡detector ¡

– Csurka ¡et ¡al. ¡2004 ¡ – Fei-­‑Fei ¡& ¡Perona, ¡2005 ¡ – Sivic ¡et ¡al. ¡2005 ¡

  • Other ¡methods ¡

– Random ¡sampling ¡(Vidal-­‑Naquet ¡& ¡Ullman, ¡2002) ¡ – SegmentaJon-­‑based ¡patches ¡(Barnard ¡et ¡al. ¡2003) ¡

  • 1. ¡Feature ¡extracJon ¡
slide-15
SLIDE 15

Normalize ¡patch ¡

Detect ¡patches ¡

[Mikojaczyk ¡and ¡Schmid ¡’02] ¡ [Mata, ¡Chum, ¡Urban ¡& ¡Pajdla, ¡’02] ¡ ¡ [Sivic ¡& ¡Zisserman, ¡’03] ¡

Compute ¡SIFT ¡ descriptor ¡

¡ ¡ ¡ ¡ ¡ ¡[Lowe’99] ¡

Slide ¡credit: ¡Josef ¡Sivic ¡

slide-16
SLIDE 16

… ¡

slide-17
SLIDE 17

… ¡

slide-18
SLIDE 18

Clustering ¡

… ¡

Slide ¡credit: ¡Josef ¡Sivic ¡

slide-19
SLIDE 19

Clustering ¡

… ¡

Slide ¡credit: ¡Josef ¡Sivic ¡

Visual ¡vocabulary ¡

slide-20
SLIDE 20

Clustering ¡

– The ¡assignment ¡of ¡objects ¡into ¡groups ¡(called ¡clusters) ¡ so ¡that ¡objects ¡from ¡the ¡same ¡cluster ¡are ¡more ¡similar ¡ to ¡each ¡other ¡than ¡objects ¡from ¡different ¡clusters. ¡ ¡ – Ojen ¡similarity ¡is ¡assessed ¡according ¡to ¡a ¡distance ¡

  • measure. ¡ ¡

– Clustering ¡is ¡a ¡common ¡technique ¡for ¡staJsJcal ¡data ¡ analysis, ¡which ¡is ¡used ¡in ¡many ¡fields, ¡including ¡ machine ¡learning, ¡data ¡mining, ¡pakern ¡recogniJon, ¡ image ¡analysis ¡and ¡bioinformaJcs. ¡

slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23

Any ¡of ¡the ¡similarity ¡metrics ¡we ¡talked ¡about ¡before ¡(SSD, ¡angle ¡between ¡ vectors) ¡

slide-24
SLIDE 24

Feature ¡Clustering ¡

Clustering ¡is ¡the ¡process ¡of ¡grouping ¡a ¡set ¡of ¡ features ¡into ¡clusters ¡of ¡similar ¡features. ¡ Features ¡within ¡a ¡cluster ¡should ¡be ¡similar. ¡ Features ¡from ¡different ¡clusters ¡should ¡be ¡

  • dissimilar. ¡
slide-25
SLIDE 25

source: ¡Dan ¡Klein ¡ ¡

slide-26
SLIDE 26

K-­‑means ¡clustering ¡

  • Want ¡to ¡minimize ¡sum ¡of ¡

squared ¡Euclidean ¡distances ¡ between ¡points ¡xi ¡and ¡their ¡ nearest ¡cluster ¡centers ¡mk ¡

source: ¡Svetlana ¡Lazebnik ¡ ¡

slide-27
SLIDE 27

K-­‑means ¡clustering ¡

  • Want ¡to ¡minimize ¡sum ¡of ¡

squared ¡Euclidean ¡distances ¡ between ¡points ¡xi ¡and ¡their ¡ nearest ¡cluster ¡centers ¡mk ¡

source: ¡Svetlana ¡Lazebnik ¡ ¡

slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39

source: ¡Dan ¡Klein ¡ ¡

slide-40
SLIDE 40

source: ¡Dan ¡Klein ¡ ¡

slide-41
SLIDE 41

Source: ¡Hinrich ¡Schutze ¡

slide-42
SLIDE 42

Source: ¡Hinrich ¡Schutze ¡

slide-43
SLIDE 43

Hierarchical ¡clustering ¡strategies ¡

  • AgglomeraJve ¡clustering ¡
  • Start ¡with ¡each ¡point ¡in ¡a ¡separate ¡cluster ¡
  • At ¡each ¡iteraJon, ¡merge ¡two ¡of ¡the ¡“closest” ¡clusters ¡
  • Divisive ¡clustering ¡
  • Start ¡with ¡all ¡points ¡grouped ¡into ¡a ¡single ¡cluster ¡
  • At ¡each ¡iteraJon, ¡split ¡the ¡“largest” ¡cluster ¡

source: ¡Svetlana ¡Lazebnik ¡ ¡

slide-44
SLIDE 44

source: ¡Dan ¡Klein ¡ ¡

slide-45
SLIDE 45

source: ¡Dan ¡Klein ¡ ¡

slide-46
SLIDE 46

Divisive ¡Clustering ¡

  • Top-­‑down ¡(instead ¡of ¡bokom-­‑up ¡as ¡in ¡

AgglomeraJve ¡Clustering) ¡

  • Start ¡with ¡all ¡docs ¡in ¡one ¡big ¡cluster ¡
  • Then ¡recursively ¡split ¡clusters ¡
  • Eventually ¡each ¡node ¡forms ¡a ¡cluster ¡on ¡its ¡
  • wn. ¡

Source: ¡Hinrich ¡Schutze ¡

slide-47
SLIDE 47

Flat ¡or ¡hierarchical ¡clustering? ¡

  • For ¡high ¡efficiency, ¡use ¡flat ¡clustering ¡(e.g. ¡k ¡

means) ¡

  • For ¡determinisJc ¡results: ¡hierarchical ¡

clustering ¡

  • When ¡a ¡hierarchical ¡structure ¡is ¡desired: ¡

hierarchical ¡algorithm ¡

  • Hierarchical ¡clustering ¡can ¡also ¡be ¡applied ¡if ¡K ¡

cannot ¡be ¡predetermined ¡(can ¡start ¡without ¡ knowing ¡K) ¡

Source: ¡Hinrich ¡Schutze ¡

slide-48
SLIDE 48

Clustering ¡

… ¡

Slide ¡credit: ¡Josef ¡Sivic ¡

slide-49
SLIDE 49

Clustering ¡

… ¡

Slide ¡credit: ¡Josef ¡Sivic ¡

Visual ¡vocabulary ¡

slide-50
SLIDE 50

From ¡clustering ¡to ¡vector ¡quanJzaJon ¡

  • Clustering ¡is ¡a ¡common ¡method ¡for ¡learning ¡a ¡visual ¡

vocabulary ¡or ¡codebook ¡

– 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 ¡representaJve, ¡ the ¡codebook ¡will ¡be ¡“universal” ¡

  • The ¡codebook ¡is ¡used ¡for ¡quanJzing ¡features ¡

– A ¡vector ¡quan0zer ¡takes ¡a ¡feature ¡vector ¡and ¡maps ¡it ¡ to ¡the ¡index ¡of ¡the ¡nearest ¡codevector ¡in ¡a ¡codebook ¡ – Codebook ¡= ¡visual ¡vocabulary ¡ – Codevector ¡= ¡visual ¡word ¡

slide-51
SLIDE 51

Fei-­‑Fei ¡et ¡al. ¡2005 ¡

slide-52
SLIDE 52

Sivic ¡et ¡al. ¡2005 ¡

slide-53
SLIDE 53

Visual ¡vocabularies: ¡Issues ¡

  • How ¡to ¡choose ¡vocabulary ¡size? ¡

– Too ¡small: ¡visual ¡words ¡not ¡ representaJve ¡of ¡all ¡patches ¡ – Too ¡large: ¡quanJzaJon ¡arJfacts, ¡

  • verfisng ¡
  • GeneraJve ¡or ¡discriminaJve ¡

learning? ¡

  • ComputaJonal ¡efficiency ¡

– Vocabulary ¡trees ¡ ¡ (Nister ¡& ¡Stewenius, ¡2006) ¡

slide-54
SLIDE 54

….. ¡

frequency ¡

codewords ¡

slide-55
SLIDE 55

Image ¡classificaJon ¡(later) ¡

  • Given ¡the ¡bag-­‑of-­‑features ¡representaJons ¡of ¡

images ¡from ¡different ¡classes, ¡how ¡do ¡we ¡ learn ¡a ¡model ¡for ¡disJnguishing ¡them? ¡