words pictures
play

Words & Pictures Tamara Berg Features Announcements - PowerPoint PPT Presentation

Words & Pictures Tamara Berg Features Announcements HW1 out on Tues Look over paper list and select a paper you want to present in


  1. Characterizing ¡edges ¡ • An ¡edge ¡is ¡a ¡place ¡of ¡rapid ¡change ¡in ¡the ¡ image ¡intensity ¡funcJon ¡ intensity ¡funcJon ¡ image ¡ (along ¡horizontal ¡scanline) ¡ first ¡derivaJve ¡ edges ¡correspond ¡to ¡ extrema ¡of ¡derivaJve ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  2. Finite ¡difference ¡filters ¡ • Other ¡approximaJons ¡of ¡derivaJve ¡filters ¡ exist: ¡ Source: ¡K. ¡Grauman ¡

  3. Finite ¡differences: ¡example ¡ • Which ¡one ¡is ¡the ¡gradient ¡in ¡the ¡x-­‑direcJon ¡(resp. ¡y-­‑direcJon)? ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  4. How ¡to ¡achieve ¡illuminaJon ¡invariance ¡ • Use ¡edges ¡instead ¡of ¡raw ¡ values ¡ ¡ Slide ¡source: ¡Tom ¡Duerig ¡

  5. Local ¡Features ¡ Feature ¡points ¡(locaJons) ¡+ ¡feature ¡descriptors ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  6. Local ¡Features ¡ Feature ¡points ¡(locaJons) ¡+ ¡feature ¡descriptors ¡ Where ¡should ¡we ¡put ¡features? ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  7. Local ¡Features ¡ Feature ¡points ¡(locaJons) ¡+ ¡feature ¡descriptors ¡ How ¡should ¡we ¡describe ¡them? ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  8. Where ¡to ¡put ¡features? ¡ ¡ Edges ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  9. Finding ¡Corners ¡ • Key ¡property: ¡in ¡the ¡region ¡around ¡a ¡ corner, ¡image ¡gradient ¡has ¡two ¡or ¡more ¡ dominant ¡direcJons ¡ • Corners ¡are ¡repeatable ¡and ¡disJncJve ¡ C.Harris ¡and ¡M.Stephens. ¡"A ¡Combined ¡Corner ¡and ¡Edge ¡Detector.“ ¡ Proceedings ¡of ¡the ¡4th ¡Alvey ¡Vision ¡Conference : ¡pages ¡147-­‑-­‑151. ¡ ¡ ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  10. Corner ¡DetecJon: ¡Basic ¡Idea ¡ • We ¡should ¡easily ¡recognize ¡the ¡point ¡by ¡ looking ¡through ¡a ¡small ¡window ¡ • Shiving ¡a ¡window ¡in ¡ any ¡ direc:on ¡should ¡ give ¡ a ¡large ¡change ¡in ¡intensity ¡ “flat” region: 
 “edge”: 
 “corner”: 
 no change in no change along significant all directions the edge change in all direction directions Source: ¡A. ¡Efros ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  11. Harris ¡Detector: ¡Steps ¡ Compute ¡corner ¡response ¡ R ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  12. Harris ¡Detector: ¡Steps ¡ Find ¡points ¡with ¡large ¡corner ¡response: ¡ R> threshold ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  13. Harris ¡Detector: ¡Steps ¡ Take ¡only ¡the ¡points ¡of ¡local ¡maxima ¡of ¡ R ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  14. Harris ¡Detector: ¡Steps ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  15. Local ¡Features ¡ Feature ¡points ¡(locaJons) ¡+ ¡feature ¡descriptors ¡ How ¡should ¡we ¡describe ¡them? ¡ source: ¡Svetlana ¡Lazebnik ¡ ¡

  16. Shape ¡Context ¡ (a) ¡and ¡(b) ¡are ¡the ¡sampled ¡edge ¡points ¡of ¡the ¡two ¡shapes. ¡(c) ¡is ¡the ¡diagram ¡of ¡the ¡ • log-­‑polar ¡bins ¡used ¡to ¡compute ¡the ¡shape ¡context. ¡(d) ¡is ¡the ¡shape ¡context ¡for ¡the ¡ circle, ¡(e) ¡is ¡that ¡for ¡the ¡diamond, ¡and ¡(f) ¡is ¡that ¡for ¡the ¡triangle. ¡As ¡can ¡be ¡seen, ¡ since ¡(d) ¡and ¡(e) ¡are ¡the ¡shape ¡contexts ¡for ¡two ¡closely ¡related ¡points, ¡they ¡are ¡ quite ¡similar, ¡while ¡the ¡shape ¡context ¡in ¡(f) ¡is ¡very ¡different. ¡

  17. Geometric ¡Blur ¡

  18. Geometric ¡Blur ¡

  19. Geometric ¡Blur ¡

  20. SIFT ¡ • SIFT ¡(Scale ¡Invariant ¡Feature ¡Transform) ¡-­‑ ¡ stable ¡robust ¡and ¡disJncJve ¡local ¡features ¡ • Current ¡most ¡popular ¡shape ¡based ¡feature ¡– ¡ descripJon ¡of ¡local ¡shape ¡(oriented ¡edges) ¡ around ¡a ¡keypoint ¡

  21. Scale Invariance • Find the points, whose surrounding patches (with some scale) are distinctive find points that are distinctive in both position (x,y) and scale look for maxima/minima in DoG pyramid

  22. Maxima ¡and ¡minima ¡in ¡a ¡ ¡ 3*3*3 ¡neighborhood ¡

  23. Maxima ¡and ¡minima ¡in ¡a ¡ ¡ 3*3*3 ¡neighborhood ¡

  24. Differences ¡Of ¡Gaussians ¡ Slide ¡source: ¡Tom ¡Duerig ¡

  25. RotaJon ¡Invariance ¡ • Rotate ¡all ¡features ¡to ¡go ¡the ¡same ¡way ¡in ¡a ¡ determined ¡manner ¡ • A histogram is formed by quantizing the orientations into 36 bins; • Peaks in the histogram correspond to the orientations of the patch;

  26. EliminaJng ¡rotaJon ¡ambiguity ¡ • To ¡assign ¡a ¡unique ¡orientaJon ¡to ¡circular ¡ image ¡windows: ¡ Create ¡histogram ¡of ¡local ¡gradient ¡direcJons ¡in ¡ – the ¡patch ¡ Assign ¡canonical ¡orientaJon ¡at ¡peak ¡of ¡ – smoothed ¡histogram ¡ 2 ¡ π ¡ 0 ¡

  27. RotaJon ¡Invariance ¡ Slide ¡source: ¡Tom ¡Duerig ¡

  28. Feature ¡descriptor ¡

  29. Feature ¡descriptor ¡ • Based ¡on ¡16*16 ¡patches ¡ • 4*4 ¡subregions ¡ • 8 ¡bins ¡in ¡each ¡subregion ¡ • 4*4*8=128 ¡dimensions ¡in ¡total ¡

  30. Actual ¡SIFT ¡stage ¡output ¡

  31. ApplicaJon: ¡object ¡recogniJon ¡ The ¡SIFT ¡features ¡of ¡training ¡images ¡are ¡ • extracted ¡and ¡stored ¡ For ¡a ¡query ¡image ¡ • 1. Extract ¡SIFT ¡feature ¡ 2. Efficient ¡nearest ¡neighbor ¡indexing ¡ 3. 3 ¡keypoints, ¡Geometry ¡verificaJon ¡

  32. Text ¡Features ¡

  33. Features ¡== ¡Words! ¡

  34. RepresentaJon ¡quesJons ¡ • Model ¡whole ¡document ¡or ¡subparts ¡of ¡ documents ¡-­‑ ¡global ¡vs ¡local ¡ • Words ¡vs ¡strings ¡ ¡-­‑ ¡do ¡you ¡want ¡to ¡allow ¡for ¡ strings ¡not ¡in ¡the ¡dicJonary/lexicon ¡common ¡ in ¡folksonomies ¡ • Noise ¡words ¡– ¡some ¡words ¡may ¡not ¡be ¡related ¡ to ¡content ¡(e.g. ¡stop ¡words: ¡a, ¡and, ¡the) ¡ • Orderless ¡(bag ¡of ¡words) ¡vs ¡representaJons ¡ that ¡care ¡about ¡order/syntax ¡etc. ¡

  35. Document ¡Vectors ¡

  36. Document ¡Vectors ¡ • Represent ¡document ¡as ¡a ¡“bag ¡of ¡words” ¡

  37. Example ¡ • Doc1 ¡= ¡“the ¡quick ¡brown ¡fox ¡jumped” ¡ • Doc2 ¡= ¡“brown ¡quick ¡jumped ¡fox ¡the” ¡

  38. Example ¡ • Doc1 ¡= ¡“the ¡quick ¡brown ¡fox ¡jumped” ¡ • Doc2 ¡= ¡“brown ¡quick ¡jumped ¡fox ¡the” ¡ Would ¡a ¡bag ¡of ¡words ¡model ¡represent ¡these ¡ two ¡documents ¡differently? ¡ ¡

  39. Document ¡Vectors ¡ • Documents ¡are ¡represented ¡as ¡“bags ¡of ¡words” ¡ • Represented ¡as ¡vectors ¡when ¡used ¡computa4onally ¡ • Each ¡vector ¡holds ¡a ¡place ¡for ¡every ¡term ¡in ¡the ¡collecJon ¡ • Therefore, ¡most ¡vectors ¡are ¡sparse ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  40. Document ¡Vectors ¡ • Documents ¡are ¡represented ¡as ¡“bags ¡of ¡words” ¡ • Represented ¡as ¡vectors ¡when ¡used ¡computa4onally ¡ • Each ¡vector ¡holds ¡a ¡place ¡for ¡every ¡term ¡in ¡the ¡collecJon ¡ • Therefore, ¡most ¡vectors ¡are ¡sparse ¡ Lexicon ¡– ¡the ¡vocabulary ¡set ¡that ¡you ¡consider ¡to ¡be ¡valid ¡ words ¡in ¡your ¡documents. ¡ ¡ ¡Usually ¡stemmed ¡(e.g. ¡running-­‑>run) ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  41. Document ¡Vectors: ¡ One ¡locaJon ¡for ¡each ¡word. ¡ ¡ nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 “Nova” ¡occurs ¡10 ¡Jmes ¡in ¡text ¡A ¡ E E 10 10 “Galaxy” ¡occurs ¡5 ¡Jmes ¡in ¡text ¡A ¡ “Heat” ¡occurs ¡3 ¡Jmes ¡in ¡text ¡A ¡ F F 9 10 (Blank ¡means ¡0 ¡occurrences.) ¡ G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  42. Document ¡Vectors: ¡ One ¡locaJon ¡for ¡each ¡word. ¡ ¡ nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 “Nova” ¡occurs ¡10 ¡Jmes ¡in ¡text ¡A ¡ E E 10 10 “Galaxy” ¡occurs ¡5 ¡Jmes ¡in ¡text ¡A ¡ “Heat” ¡occurs ¡3 ¡Jmes ¡in ¡text ¡A ¡ F F 9 10 (Blank ¡means ¡0 ¡occurrences.) ¡ G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  43. Document ¡Vectors ¡ ¡ Document ids nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 E E 10 10 F F 9 10 G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  44. Vector ¡Space ¡Model ¡ • Documents ¡are ¡represented ¡as ¡ vectors ¡in ¡term ¡space ¡ • Terms ¡are ¡usually ¡stems ¡ • Documents ¡represented ¡by ¡vectors ¡of ¡terms ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  45. Vector ¡Space ¡Model ¡ • Documents ¡are ¡represented ¡as ¡ vectors ¡in ¡term ¡space ¡ • Terms ¡are ¡usually ¡stems ¡ • Documents ¡represented ¡by ¡vectors ¡of ¡terms ¡ • A ¡vector ¡distance ¡measure ¡between ¡documents ¡is ¡used ¡to ¡ measure ¡document ¡similarity ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  46. Document ¡Vectors ¡ ¡ Document ids nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 E E 10 10 F F 9 10 G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  47. Similarity ¡between ¡documents ¡ A ¡= ¡[10 ¡5 ¡3 ¡0 ¡0 ¡0 ¡0 ¡0]; ¡ G ¡= ¡[5 ¡0 ¡7 ¡0 ¡0 ¡9 ¡0 ¡0]; ¡ E ¡= ¡[0 ¡0 ¡0 ¡0 ¡0 ¡10 ¡10 ¡0]; ¡

  48. Similarity ¡between ¡documents ¡ A ¡= ¡[10 ¡ ¡5 ¡ ¡3 ¡ ¡0 ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡0]; ¡ G ¡= ¡[ ¡ ¡5 ¡ ¡0 ¡ ¡7 ¡ ¡0 ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡9 ¡ ¡ ¡ ¡0 ¡ ¡ ¡0]; ¡ E ¡= ¡ ¡[ ¡ ¡0 ¡ ¡0 ¡ ¡0 ¡ ¡0 ¡ ¡ ¡0 ¡ ¡10 ¡ ¡10 ¡ ¡ ¡0]; ¡ Treat ¡the ¡vectors ¡as ¡binary ¡= ¡number ¡of ¡words ¡in ¡ common. ¡ ¡ Sb(A,G) ¡= ¡? ¡ Sb(A,E) ¡= ¡? ¡ Sb(G,E) ¡= ¡? ¡ Which ¡pair ¡of ¡documents ¡are ¡the ¡most ¡similar? ¡

  49. Similarity ¡between ¡documents ¡ A ¡= ¡[10 ¡5 ¡3 ¡0 ¡0 ¡0 ¡0 ¡0]; ¡ G ¡= ¡[5 ¡0 ¡7 ¡0 ¡0 ¡9 ¡0 ¡0]; ¡ E ¡= ¡[0 ¡0 ¡0 ¡0 ¡0 ¡10 ¡10 ¡0]; ¡ n Sum ¡of ¡Squared ¡Distances ¡(SSD) ¡= ¡ ¡ ∑ − Y i ) 2 ( X i i = 1 SSD(A,G) ¡= ¡? ¡ SSD(A,E) ¡= ¡? ¡ SSD(G,E) ¡= ¡? ¡

  50. Similarity ¡between ¡documents ¡ A ¡= ¡[10 ¡5 ¡3 ¡0 ¡0 ¡0 ¡0 ¡0]; ¡ G ¡= ¡[5 ¡0 ¡7 ¡0 ¡0 ¡9 ¡0 ¡0]; ¡ E ¡= ¡[0 ¡0 ¡0 ¡0 ¡0 ¡10 ¡10 ¡0]; ¡ a ⋅ b Angle ¡between ¡vectors: ¡Cos(θ) ¡= ¡ ¡ a b Dot ¡Product: ¡ a 2 1 + a 2 2 + ... + a 2 Length ¡(Euclidean ¡norm): ¡ a = n

  51. Some ¡words ¡give ¡more ¡informaJon ¡than ¡ others ¡ • Does ¡the ¡fact ¡that ¡two ¡documents ¡both ¡ contain ¡the ¡word ¡“the” ¡tell ¡us ¡anything? ¡How ¡ about ¡“and”? ¡Stop ¡words ¡(noise ¡words): ¡ Words ¡that ¡are ¡probably ¡not ¡useful ¡for ¡ processing. ¡Filtered ¡out ¡before ¡natural ¡ language ¡is ¡applied. ¡ • Other ¡words ¡can ¡be ¡more ¡or ¡less ¡informaJve. ¡ ¡ No ¡definiJve ¡list ¡but ¡might ¡include ¡things ¡like: ¡ ¡ hgp://www.dcs.gla.ac.uk/idom/ir_resources/linguisJc_uJls/stop_words ¡

  52. Vector ¡Space ¡Model ¡ • Documents ¡are ¡represented ¡as ¡ vectors ¡in ¡term ¡space ¡ • Terms ¡are ¡usually ¡stems ¡ • Documents ¡represented ¡by ¡vectors ¡of ¡terms ¡ • A ¡vector ¡distance ¡measure ¡between ¡documents ¡is ¡used ¡to ¡ measure ¡document ¡similarity ¡ • Terms ¡in ¡a ¡vector ¡can ¡be ¡“weighted” ¡in ¡many ¡ways ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  53. Assigning ¡Weights ¡to ¡Terms ¡  Binary ¡Weights ¡  Raw ¡term ¡frequency ¡ ¡  J ¡x ¡idf ¡ • Want ¡to ¡weight ¡terms ¡highly ¡if ¡they ¡are ¡ — frequent ¡in ¡relevant ¡documents ¡… ¡BUT ¡ — infrequent ¡in ¡the ¡collecJon ¡as ¡a ¡whole ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  54. TF ¡x ¡IDF ¡Weights ¡ • J ¡x ¡idf ¡measure: ¡ • Term ¡Frequency ¡(X) ¡– ¡how ¡oven ¡a ¡term ¡appears ¡in ¡a ¡document ¡ • Inverse ¡Document ¡Frequency ¡(idf) ¡-­‑-­‑ ¡a ¡way ¡to ¡deal ¡with ¡terms ¡that ¡ are ¡frequent ¡across ¡many ¡documents ¡ • Goal: ¡Assign ¡a ¡J ¡* ¡idf ¡weight ¡to ¡each ¡term ¡in ¡each ¡ document ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  55. TF ¡x ¡IDF ¡CalculaJon ¡ T k = term k in document D i tf ik = frequency of term T k in document D i idf k = inverse document frequency of term T k in C N = total number of documents in the collection C n k = the number of documents in C that contain T k ( ) idf k = log N n k Slide ¡from ¡Mitch ¡Marcus ¡

  56. TF ¡x ¡IDF ¡CalculaJon ¡ T k = term k in document D i tf ik = frequency of term T k in document D i idf k = inverse document frequency of term T k in C N = total number of documents in the collection C n k = the number of documents in C that contain T k ( ) idf k = log N n k Slide ¡from ¡Mitch ¡Marcus ¡

  57. TF ¡x ¡IDF ¡CalculaJon ¡ T k = term k in document D i tf ik = frequency of term T k in document D i idf k = inverse document frequency of term T k in C N = total number of documents in the collection C n k = the number of documents in C that contain T k ( ) idf k = log N n k Slide ¡from ¡Mitch ¡Marcus ¡

  58. Inverse ¡Document ¡Frequency ¡ • IDF ¡provides ¡high ¡values ¡for ¡rare ¡words ¡and ¡low ¡values ¡ for ¡common ¡words ¡ For ¡a ¡collecJon ¡ of ¡10000 ¡ documents ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  59. TF ¡x ¡IDF ¡NormalizaJon ¡ • Normalize ¡the ¡term ¡weights ¡(so ¡longer ¡documents ¡are ¡ not ¡unfairly ¡given ¡more ¡weight) ¡ • The ¡longer ¡the ¡document, ¡the ¡more ¡likely ¡it ¡is ¡for ¡a ¡given ¡term ¡to ¡ appear ¡in ¡it, ¡and ¡the ¡more ¡oven ¡a ¡given ¡term ¡is ¡likely ¡to ¡appear ¡in ¡ it. ¡So, ¡we ¡want ¡to ¡reduce ¡the ¡importance ¡agached ¡to ¡a ¡term ¡ appearing ¡in ¡a ¡document ¡based ¡on ¡the ¡length ¡of ¡the ¡document. ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  60. Pair-­‑wise ¡Document ¡Similarity ¡ Documents ¡now ¡represented ¡as ¡vectors ¡of ¡TFxIDF ¡weights ¡ D 1 = w 11 , w 12, ..., w 1 n D 2 = w 21 , w 22, ..., w 2 n n ∑ Similarity ¡can ¡be ¡ w 1 i ∗ w 2 i nova galaxy heat h’wood film role diet fur computed ¡as ¡usual ¡ A 1 3 1 i = 1 sim ( D 1 , D 2 ) = on ¡these ¡new ¡ B n n 5 2 ( w 1 i ) 2 ∗ weight ¡vectors ¡ ∑ ∑ ( w 2 i ) 2 C 2 1 5 (e.g. ¡cos(θ) ¡here) ¡ i = 1 i = 1 D 4 1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Slide ¡from ¡Mitch ¡Marcus ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend