SlideShare a Scribd company logo
1 of 42
Download to read offline
Large-scale visual recognition
Efficient matching
Florent Perronnin, XRCE
Hervé Jégou, INRIA
CVPR tutorial
June 16, 2012
Outline
!! Preliminary
!! Locality Sensitive Hashing: the two modes
!! Hashing
!! Embedding
!! Searching with Product Quantization
Finding neighbors
!! Nearest neighbor search is a critical step in object recognition
!! To compute the image descriptor itself
E.g., assignment with k-means to a large vocabulary
!! To find the most similar images/patches in a database
!! For instance, the closest one w.r.t to Euclidean distance:
!! Problems:
!! costly operation of exact exhaustive search: O(n*d)
!! High-dimensional vectors: for exact search the best approach is the
naïve exhaustive comparison
The cost of (efficient) exact matching
!! But what about the actual timings ? With an efficient implementation!
!! Finding the 10-NN of 1000 distinct queries in 1 million vectors
!! Assuming 128-D Euclidean descriptors
!! i.e., 1 billion distances, computed on a 8-core machine
Poll: How much time?
The cost of (efficient) exact matching
!! But what about the actual timings ? With an efficient implementation!
!! Finding the 10-NN of 1000 distinct queries in 1 million vectors
!! Assuming 128-D Euclidean descriptors
!! i.e., 1 billion distances, computed on a 8-core machine
5.5 seconds
!! Assigning 2000 SIFTs to a visual vocabulary of size k=100,000
!! 1.2 second
!! Hamming distance: 1000 queries, 1M database vectors
!! Computing the 1 billion distances: 0.6 second
Need for approximate nearest neighbors
!! 1 million images, 1000 descriptors per image
!! 1 billion distances per local descriptor
!! 1012 distances in total
!! 1 hour 30 minutes to perform the query for Euclidean vectors
!! To improve the scalability:
!! We allow to find the nearest neighbors in probability only:
Approximate nearest neighbor (ANN) search
!! Three (contradictory) performance criteria for ANN schemes
!! search quality (retrieved vectors are actual nearest neighbors)
!! speed
!! memory usage
Outline
!! Preliminary
!! Locality Sensitive Hashing: the two modes
!! Hashing
!! Embedding
!! Searching with Product Quantization
Locality Sensitive Hashing (LSH)
!! Most known ANN technique [Charikar 98, Gionis 99, Datar 04,…]
!! But “LSH” is associated with two distinct search algorithms
!! As an indexing technique involving several hash functions
!! As a binarization technique
000 001
100
110 111
011
101
010
Outline
!! Preliminary
!! Locality Sensitive Hashing: the two modes
!! Hashing
!! Embedding
!! Searching with Product Quantization
LSH – partitioning technique
!! General idea:
!! Define m hash functions in parallel
!! Each vector: associated with m distinct hash keys
!! Each hash key is associated with a hash table
!! At query time:
!! Compute the hash keys associated with the query
!! For each hash function, retrieve all the database vectors
assigned to the same key (for this hash function)
!! Compute the exact distance on this short-list
E2LSH: hash function for Euclidean vectors
1) Projection on i=1…m random
directions
2) Construction of l hash functions:
concatenate m indexes hi per hash
function
3) For each gj, compute two hash values
universal hash functions: u1(.), u2(.)
4) store the vector id in a hash table, as
for an inverted file
[Datar 04]
E2LSH: hash function for Euclidean vectors
1) Projection on i=1…m random
directions
2) Construction of l hash functions:
concatenate m indexes hi per hash
function
3) For each gj, compute two hash values
universal hash functions: u1(.), u2(.)
4) store the vector id in a hash table, as
for an inverted file
0
1
1
1
1
2
2
2
bi
w
O
a1
[Datar 04]
E2LSH: hash function for Euclidean vectors
1) Projection on i=1…m random
directions
2) Construction of l hash functions:
concatenate m indexes hi per hash
function
3) For each gj, compute two hash values
universal hash functions: u1(.), u2(.)
4) store the vector id in a hash table, as
for an inverted file
(1,0) (2,0) (3,0)
(0,0)
(3,1)
(2,1)
(1,1)(0,1)
(0,-1) (1,-1)
(2,-1)
[Datar 04]
Alternative hash functions
!! Instead of using random projections
!! Why not directly using a structured quantizer?
!! Vector quantizers: better compression performance than scalar ones
!! Structured vector quantizer: Lattice quantizers [Andoni 06]
!! Hexagonal (d=2), E8 (d=8), Leech (d=24)
!! But still: lack of adaptation to the data
Alternative hash functions – Learned
!! Any hash function can be used in LSH
!! Just need a set of functions
!! Therefore, could be learned on sample examples
!! In particular: k-means, Hierarchical k-means, KD-trees
!! Better data adaptation than with structured quantizers
From [Pauleve 10]
Alternative hash functions – Learned
!! Significantly better than structured quantizers
!! Example of search: quality for a single hash function
!! BOV: k-means!
!! HKM: loss compared with k-means [Nister 06]
Multi-probe LSH
!! But multiple hash functions use a lot of memory
!! Per vector and per hash table: at least an id
!! Multi-probe LSH [Lv 07]
!! Use less hash functions (possibly 1)
!! But probe several (closest) cells per hash function
" save a lot of memory
!! Similar in spirit to Multiple-assignment with BOV
FLANN
!! ANN package described in Muja’s VISAPP paper [Muja 09]
!! Multiple kd-tree or k-means tree
!! With auto-tuning under given constraints
Remark: self-tuned LSH proposed in [Dong 07]
!! Still high memory requirement for large vector sets
!! Excellent package: high integration quality and interface!
!! See http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN
Issue for large scale: final verification
!! For this second (“re-ranking”) stage, we need raw descriptors, i.e.,
!! either huge amount of memory ! 128GB for 1 billion SIFTs
!! either to perform disk accesses ! severely impacts efficiency
Issue for large scale: final verification
!! Some techniques –like BOV– keep all vectors (no verification)
!! Better: use very short codes for the filtering stage
!! Hamming Embedding [Jegou 08] or Product Quantization [Jegou 11]
NOT ON A
LARGE
SCALE
Outline
!! Preliminary
!! Locality Sensitive Hashing: the two modes
!! Hashing
!! Embedding
!! Searching with Product Quantization
LSH for binarization [Charikar’ 98, J.’08, Weiss’09, etc]
!! Idea: design/learn a function mapping the original space into the
compact Hamming space:
!! Objective: neighborhood in the Hamming space try to reflect original
neighborhood
!! Advantages: compact descriptor, fast comparison
000 001
100
110 111
011
101
010
LSH for binarization [Charikar’ 98, J.’08, Weiss’09, etc]
!! Given B random projection direction ai
!! Compute a binary code from a vector x as
!! Spectral Hashing: theoretical framework for finding hash functions
!! In practice: PCA + binarization on the different axis (based on variance)
000 001
100
110 111
011
101
010
LSH: the two modes – approximate guidelines
Partitioning technique
!! Sublinear search
!! Several hash indexes (integer)
!! Large memory overhead
!! Hash table overhead (store ids)
!! Need original vectors for re-ranking
!! Need a lot of memory
!! Or to access the disk
!! Interesting when (e.g., FLANN)
!! Not too large dimensionality
!! Dataset small enough (memory)
!! Very good variants/software
(FLANN)
Binarization technique
!! Linear search
!! Produce a binary code per vector
!! Very compact
!! bit-vectors, concatenated (no ids)
!! Very fast comparison
!! Hamming distance (popcnt SSE4)
!! 1 billion comparisons/second
!! Interesting
!! For very high-dimensional vectors
!! When memory is critical
!! Simple to implement. Very active
problems with many variants
Other topics on LSH
!! More general metrics: Kernelized LSH [Kulis 09], RMMH [Joly 11], …
!! Binary LSH (=searching binary vectors)
!! Like E2LSH but: random subset of bits instead of projections
!! In this CVPR: [Nourouzi 12]. Exact binary search variant!
!! Optimized jointly with dimensionality reduction
!! PCA+random rotation or PCA+variance balancing [Jegou 10]
!! ITQ [Gong 11]
!! Asymmetric distances
!! Idea: do not approximate the query – only the database is binarized
!! Proposed with sketches [Dong 08]
!! Significant improvement for any binarization technique [Gordo 11]
Hamming Embedding
!! Introduced as an extension of BOV [Jegou 08]
!! Combination of
!! A partitioning technique (k-means)
!! A binary code that refine the descriptor
Representation of a descriptor x
!! Vector-quantized to q(x) as in standard BOV
+ short binary vector b(x) for an additional localization in the Voronoi cell
!! Two descriptors x and y match iif
Where h(.,.) denotes the Hamming distance
ANN evaluation of Hamming Embedding
0.7
NNrecall
0
0.1
0.2
0.3
0.4
0.5
0.6
1e-08 1e-07 1e-06 1e-05 0.0001 0.001 0.01 0.1
rate of points retrieved
k=100
200
500
1000
2000
5000
10000
20000
30000
50000
ht=16
18
20
22
HE+BOW
BOW
3228
24 compared to BOW: at least
10 times less points in the
short-list for the same level
of accuracy
Hamming Embedding
provides a much better
trade-off between recall
and remove false positives
Matching points - 20k word vocabulary
201 matches 240 matches
Many matches with the non-corresponding image!
Matching points - 200k word vocabulary
69 matches 35 matches
Still many matches with the non-corresponding one
Matching points - 20k word vocabulary + HE
83 matches 8 matches
10x more matches with the corresponding image!
Outline
!! Preliminary
!! Locality Sensitive Hashing: the two modes
!! Hashing
!! Embedding
!! Searching with Product Quantization
A typical source coding system
!! Simple source coding system:
!! Decorrelation, e.g., PCA
!! Quantization
!! Entropy coding
!! To a code e(x) is associated a unique
reconstruction value q(x)
" i.e., the visual word
!! Focus on quantization (lossy step)
quantization
entropy
coding
decorrelation
rate-distortion
optimization
Relationship between Reconstruction and
Distance estimation
!! Assume y quantized to qc(y)
x is a query vector
!! If we estimate the distance by
!! Then we can show that:
i.e., the error on the square distance is statistically bounded by the
quantization error
c
c
Searching with quantization [Jegou 11]
!! Main idea: compressed representation of the database vectors
!! Each database vector y is represented by qc(y)
where qc(.) is a product quantizer
!! Search = distance approximation problem
!! The key: Estimate the distances in the compressed domain
such that
!! Quantization is fast enough
!! Quantization is precise, i.e., many different possible indexes (ex: 264)
!! Regular k-means is not appropriate: not for k=264 centroids
c c
q1
Product Quantizer
!! Vector split into m subvectors:
!! Subvectors are quantized separately
!! Example: y = 16-dim vector split in 8 subvectors of dimension 16
!! In practice: 8 bits/subquantizer (256 centroids),
!! SIFT: m=4-16
!! VLAD/Fisher: 4-128 bytes per indexed vector
3 bits
y1: 2 components
24-bit quantization index
q2 q3 q4 q5 q6 q7 q8
q1(y1) q2(y2) q3(y3) q4(y4) q5(y5) q6(y6) q7(y7) q8(y8)
Asymmetric distance computation (ADC)
!! Compute the square distance approximation in the compressed domain
!! To compute distance between query and many codes
!! compute for each subvector and all possible centroids
! stored in look-up tables
! fixed cost for quantization
!! for each database code: sum the elementary square distances
!! Each 8x8=64-bits code requires only m=8 additions per distance
!! IVFADC: combination with an inverted file to avoid exhaustive search
c
Combination with an inverted file system
ALGORITHM
! Coarse k-means hash function
Select k’ closest centroids ci
and corresponding cells
! Compute the residual
vector x-ci of the query vector
! Encode the residual vector by PQ
! Apply the PQ search method.
Distance is approximated by
d(x,y) = d(x-ci,q(y-ci))
Example timing: 3.5 ms per vector for a search in 2 billion vectors
Performance evaluation
!! Comparison with other memory efficient approximate neighbor search
techniques, i.e., binarization techniques
!! Spectral Hashing [Weiss 09] – exhaustive search
!! Hamming Embedding [Jegou 08] – non exhaustive search
!! Performance measured by searching 1M vector (recall@R, varying R)
Searching in 1M SIFT descriptors Searching in 1M GIST descriptors
Variants
!! Adapted codebook for residual vectors [Uchida 11]
!! Learn the product quantizer separately in the different cells
!! Re-ranking with source coding [Jegou 11]
!! Exploit the explicit reconstruction of PQ
!! Refine the database vector by a short code
!! In this CVPR:
!! The “multiple inverted index” [Babenko 12]
!! Replace the coarse k-means by a product quantizer
!! + priority selection of cells
!! Then apply PQ distance estimation
Product Quantization: some applications
!! PQ search was first proposed for searching local descriptors [J’09-11],
i.e., to replace bag-of-words or Hamming Embedding
!! [J’10]: Encoding a global image representation (Vlad/Fisher)
!! [Gammeter et al’10]: Fast geometrical re-ranking with local descriptors
!! [Perronnin et al.’11]: Large scale classification (Imagenet)
!! Combined with Stochastic Gradient Descent SVM
!! Decompression on-the-fly when feeding the classifier
!! Won the ILSVRC competition in 2011
!! [Vedaldi and Zisserman’12] – CVPR
!! Learning in the PQ-compressed domain
!! Typically *10 acceleration with no loss
Nearest neighbor search is a key component of image indexing systems
Product quantization-based approach offers
o! Competitive search accuracy
o! Compact footprint: few bytes per indexed vector
Tested on 220 million video frames, 100 million still images
extrapolation for 1 billion images: 20GB RAM, query < 1s on 8 cores
Tested on audio, text descriptors, etc
Toy Matlab package available on my web page
10 million images indexed on my laptop:
21 bytes per indexed image
Conclusion
Estimated distances versus true distances
!! The estimator d(X,q(Y))2 of d(X,Y)2 is biased:
!! The bias can removed by quantization error terms
!! but does not improve the NN search quality

More Related Content

Viewers also liked

Research Works of Jonghoon seo
Research Works of Jonghoon seoResearch Works of Jonghoon seo
Research Works of Jonghoon seoJonghoon Seo
 
Cuckoo search algorithm
Cuckoo search algorithmCuckoo search algorithm
Cuckoo search algorithmRitesh Kumar
 
Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)J Singh
 
[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?NAVER D2
 

Viewers also liked (6)

Research Works of Jonghoon seo
Research Works of Jonghoon seoResearch Works of Jonghoon seo
Research Works of Jonghoon seo
 
vector QUANTIZATION
vector QUANTIZATIONvector QUANTIZATION
vector QUANTIZATION
 
Cuckoo search algorithm
Cuckoo search algorithmCuckoo search algorithm
Cuckoo search algorithm
 
Vector quantization
Vector quantizationVector quantization
Vector quantization
 
Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)
 
[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?
 

Similar to 5 efficient-matching.ppt

Hash Functions FTW
Hash Functions FTWHash Functions FTW
Hash Functions FTWsunnygleason
 
[241]large scale search with polysemous codes
[241]large scale search with polysemous codes[241]large scale search with polysemous codes
[241]large scale search with polysemous codesNAVER D2
 
D01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmD01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmevaminerva
 
D01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmD01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmevaminerva
 
Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Regularised Cross-Modal Hashing (SIGIR'15 Poster)Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Regularised Cross-Modal Hashing (SIGIR'15 Poster)Sean Moran
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Spark Summit
 
Engineering fast indexes
Engineering fast indexesEngineering fast indexes
Engineering fast indexesDaniel Lemire
 
Webinar: Deep Learning with H2O
Webinar: Deep Learning with H2OWebinar: Deep Learning with H2O
Webinar: Deep Learning with H2OSri Ambati
 
2 imagedescription.ppt
2 imagedescription.ppt2 imagedescription.ppt
2 imagedescription.pptmustafa sarac
 
C Interview Questions for Fresher
C Interview Questions for FresherC Interview Questions for Fresher
C Interview Questions for FresherJaved Ahmad
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationsonu sharma
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationKgr Sushmitha
 
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationDon't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationLeo Meyerovich
 
large_scale_search.pdf
large_scale_search.pdflarge_scale_search.pdf
large_scale_search.pdfEmerald72
 
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...DECK36
 
FPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODERFPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODERIJCSEA Journal
 
Project - Deep Locality Sensitive Hashing
Project - Deep Locality Sensitive HashingProject - Deep Locality Sensitive Hashing
Project - Deep Locality Sensitive HashingGabriele Angeletti
 

Similar to 5 efficient-matching.ppt (20)

3 bagofwords.ppt
3 bagofwords.ppt3 bagofwords.ppt
3 bagofwords.ppt
 
Hash Functions FTW
Hash Functions FTWHash Functions FTW
Hash Functions FTW
 
[241]large scale search with polysemous codes
[241]large scale search with polysemous codes[241]large scale search with polysemous codes
[241]large scale search with polysemous codes
 
D01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmD01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithm
 
D01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithmD01 choueka dershowitz_word_spotting_algorithm
D01 choueka dershowitz_word_spotting_algorithm
 
Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Regularised Cross-Modal Hashing (SIGIR'15 Poster)Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Regularised Cross-Modal Hashing (SIGIR'15 Poster)
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
 
Engineering fast indexes
Engineering fast indexesEngineering fast indexes
Engineering fast indexes
 
Webinar: Deep Learning with H2O
Webinar: Deep Learning with H2OWebinar: Deep Learning with H2O
Webinar: Deep Learning with H2O
 
2 imagedescription.ppt
2 imagedescription.ppt2 imagedescription.ppt
2 imagedescription.ppt
 
C Interview Questions for Fresher
C Interview Questions for FresherC Interview Questions for Fresher
C Interview Questions for Fresher
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C interview Question and Answer
C interview Question and AnswerC interview Question and Answer
C interview Question and Answer
 
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationDon't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
large_scale_search.pdf
large_scale_search.pdflarge_scale_search.pdf
large_scale_search.pdf
 
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
 
FPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODERFPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODER
 
Project - Deep Locality Sensitive Hashing
Project - Deep Locality Sensitive HashingProject - Deep Locality Sensitive Hashing
Project - Deep Locality Sensitive Hashing
 

More from mustafa sarac

Uluslararasilasma son
Uluslararasilasma sonUluslararasilasma son
Uluslararasilasma sonmustafa sarac
 
Real time machine learning proposers day v3
Real time machine learning proposers day v3Real time machine learning proposers day v3
Real time machine learning proposers day v3mustafa sarac
 
Latka december digital
Latka december digitalLatka december digital
Latka december digitalmustafa sarac
 
Axial RC SCX10 AE2 ESC user manual
Axial RC SCX10 AE2 ESC user manualAxial RC SCX10 AE2 ESC user manual
Axial RC SCX10 AE2 ESC user manualmustafa sarac
 
Array programming with Numpy
Array programming with NumpyArray programming with Numpy
Array programming with Numpymustafa sarac
 
Math for programmers
Math for programmersMath for programmers
Math for programmersmustafa sarac
 
TEGV 2020 Bireysel bagiscilarimiz
TEGV 2020 Bireysel bagiscilarimizTEGV 2020 Bireysel bagiscilarimiz
TEGV 2020 Bireysel bagiscilarimizmustafa sarac
 
How to make and manage a bee hotel?
How to make and manage a bee hotel?How to make and manage a bee hotel?
How to make and manage a bee hotel?mustafa sarac
 
Cahit arf makineler dusunebilir mi
Cahit arf makineler dusunebilir miCahit arf makineler dusunebilir mi
Cahit arf makineler dusunebilir mimustafa sarac
 
How did Software Got So Reliable Without Proof?
How did Software Got So Reliable Without Proof?How did Software Got So Reliable Without Proof?
How did Software Got So Reliable Without Proof?mustafa sarac
 
Staff Report on Algorithmic Trading in US Capital Markets
Staff Report on Algorithmic Trading in US Capital MarketsStaff Report on Algorithmic Trading in US Capital Markets
Staff Report on Algorithmic Trading in US Capital Marketsmustafa sarac
 
Yetiskinler icin okuma yazma egitimi
Yetiskinler icin okuma yazma egitimiYetiskinler icin okuma yazma egitimi
Yetiskinler icin okuma yazma egitimimustafa sarac
 
Consumer centric api design v0.4.0
Consumer centric api design v0.4.0Consumer centric api design v0.4.0
Consumer centric api design v0.4.0mustafa sarac
 
State of microservices 2020 by tsh
State of microservices 2020 by tshState of microservices 2020 by tsh
State of microservices 2020 by tshmustafa sarac
 
Uber pitch deck 2008
Uber pitch deck 2008Uber pitch deck 2008
Uber pitch deck 2008mustafa sarac
 
Wireless solar keyboard k760 quickstart guide
Wireless solar keyboard k760 quickstart guideWireless solar keyboard k760 quickstart guide
Wireless solar keyboard k760 quickstart guidemustafa sarac
 
State of Serverless Report 2020
State of Serverless Report 2020State of Serverless Report 2020
State of Serverless Report 2020mustafa sarac
 
Dont just roll the dice
Dont just roll the diceDont just roll the dice
Dont just roll the dicemustafa sarac
 

More from mustafa sarac (20)

Uluslararasilasma son
Uluslararasilasma sonUluslararasilasma son
Uluslararasilasma son
 
Real time machine learning proposers day v3
Real time machine learning proposers day v3Real time machine learning proposers day v3
Real time machine learning proposers day v3
 
Latka december digital
Latka december digitalLatka december digital
Latka december digital
 
Axial RC SCX10 AE2 ESC user manual
Axial RC SCX10 AE2 ESC user manualAxial RC SCX10 AE2 ESC user manual
Axial RC SCX10 AE2 ESC user manual
 
Array programming with Numpy
Array programming with NumpyArray programming with Numpy
Array programming with Numpy
 
Math for programmers
Math for programmersMath for programmers
Math for programmers
 
The book of Why
The book of WhyThe book of Why
The book of Why
 
BM sgk meslek kodu
BM sgk meslek koduBM sgk meslek kodu
BM sgk meslek kodu
 
TEGV 2020 Bireysel bagiscilarimiz
TEGV 2020 Bireysel bagiscilarimizTEGV 2020 Bireysel bagiscilarimiz
TEGV 2020 Bireysel bagiscilarimiz
 
How to make and manage a bee hotel?
How to make and manage a bee hotel?How to make and manage a bee hotel?
How to make and manage a bee hotel?
 
Cahit arf makineler dusunebilir mi
Cahit arf makineler dusunebilir miCahit arf makineler dusunebilir mi
Cahit arf makineler dusunebilir mi
 
How did Software Got So Reliable Without Proof?
How did Software Got So Reliable Without Proof?How did Software Got So Reliable Without Proof?
How did Software Got So Reliable Without Proof?
 
Staff Report on Algorithmic Trading in US Capital Markets
Staff Report on Algorithmic Trading in US Capital MarketsStaff Report on Algorithmic Trading in US Capital Markets
Staff Report on Algorithmic Trading in US Capital Markets
 
Yetiskinler icin okuma yazma egitimi
Yetiskinler icin okuma yazma egitimiYetiskinler icin okuma yazma egitimi
Yetiskinler icin okuma yazma egitimi
 
Consumer centric api design v0.4.0
Consumer centric api design v0.4.0Consumer centric api design v0.4.0
Consumer centric api design v0.4.0
 
State of microservices 2020 by tsh
State of microservices 2020 by tshState of microservices 2020 by tsh
State of microservices 2020 by tsh
 
Uber pitch deck 2008
Uber pitch deck 2008Uber pitch deck 2008
Uber pitch deck 2008
 
Wireless solar keyboard k760 quickstart guide
Wireless solar keyboard k760 quickstart guideWireless solar keyboard k760 quickstart guide
Wireless solar keyboard k760 quickstart guide
 
State of Serverless Report 2020
State of Serverless Report 2020State of Serverless Report 2020
State of Serverless Report 2020
 
Dont just roll the dice
Dont just roll the diceDont just roll the dice
Dont just roll the dice
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

5 efficient-matching.ppt

  • 1. Large-scale visual recognition Efficient matching Florent Perronnin, XRCE Hervé Jégou, INRIA CVPR tutorial June 16, 2012
  • 2. Outline !! Preliminary !! Locality Sensitive Hashing: the two modes !! Hashing !! Embedding !! Searching with Product Quantization
  • 3. Finding neighbors !! Nearest neighbor search is a critical step in object recognition !! To compute the image descriptor itself E.g., assignment with k-means to a large vocabulary !! To find the most similar images/patches in a database !! For instance, the closest one w.r.t to Euclidean distance: !! Problems: !! costly operation of exact exhaustive search: O(n*d) !! High-dimensional vectors: for exact search the best approach is the naïve exhaustive comparison
  • 4. The cost of (efficient) exact matching !! But what about the actual timings ? With an efficient implementation! !! Finding the 10-NN of 1000 distinct queries in 1 million vectors !! Assuming 128-D Euclidean descriptors !! i.e., 1 billion distances, computed on a 8-core machine Poll: How much time?
  • 5. The cost of (efficient) exact matching !! But what about the actual timings ? With an efficient implementation! !! Finding the 10-NN of 1000 distinct queries in 1 million vectors !! Assuming 128-D Euclidean descriptors !! i.e., 1 billion distances, computed on a 8-core machine 5.5 seconds !! Assigning 2000 SIFTs to a visual vocabulary of size k=100,000 !! 1.2 second !! Hamming distance: 1000 queries, 1M database vectors !! Computing the 1 billion distances: 0.6 second
  • 6. Need for approximate nearest neighbors !! 1 million images, 1000 descriptors per image !! 1 billion distances per local descriptor !! 1012 distances in total !! 1 hour 30 minutes to perform the query for Euclidean vectors !! To improve the scalability: !! We allow to find the nearest neighbors in probability only: Approximate nearest neighbor (ANN) search !! Three (contradictory) performance criteria for ANN schemes !! search quality (retrieved vectors are actual nearest neighbors) !! speed !! memory usage
  • 7. Outline !! Preliminary !! Locality Sensitive Hashing: the two modes !! Hashing !! Embedding !! Searching with Product Quantization
  • 8. Locality Sensitive Hashing (LSH) !! Most known ANN technique [Charikar 98, Gionis 99, Datar 04,…] !! But “LSH” is associated with two distinct search algorithms !! As an indexing technique involving several hash functions !! As a binarization technique 000 001 100 110 111 011 101 010
  • 9. Outline !! Preliminary !! Locality Sensitive Hashing: the two modes !! Hashing !! Embedding !! Searching with Product Quantization
  • 10. LSH – partitioning technique !! General idea: !! Define m hash functions in parallel !! Each vector: associated with m distinct hash keys !! Each hash key is associated with a hash table !! At query time: !! Compute the hash keys associated with the query !! For each hash function, retrieve all the database vectors assigned to the same key (for this hash function) !! Compute the exact distance on this short-list
  • 11. E2LSH: hash function for Euclidean vectors 1) Projection on i=1…m random directions 2) Construction of l hash functions: concatenate m indexes hi per hash function 3) For each gj, compute two hash values universal hash functions: u1(.), u2(.) 4) store the vector id in a hash table, as for an inverted file [Datar 04]
  • 12. E2LSH: hash function for Euclidean vectors 1) Projection on i=1…m random directions 2) Construction of l hash functions: concatenate m indexes hi per hash function 3) For each gj, compute two hash values universal hash functions: u1(.), u2(.) 4) store the vector id in a hash table, as for an inverted file 0 1 1 1 1 2 2 2 bi w O a1 [Datar 04]
  • 13. E2LSH: hash function for Euclidean vectors 1) Projection on i=1…m random directions 2) Construction of l hash functions: concatenate m indexes hi per hash function 3) For each gj, compute two hash values universal hash functions: u1(.), u2(.) 4) store the vector id in a hash table, as for an inverted file (1,0) (2,0) (3,0) (0,0) (3,1) (2,1) (1,1)(0,1) (0,-1) (1,-1) (2,-1) [Datar 04]
  • 14. Alternative hash functions !! Instead of using random projections !! Why not directly using a structured quantizer? !! Vector quantizers: better compression performance than scalar ones !! Structured vector quantizer: Lattice quantizers [Andoni 06] !! Hexagonal (d=2), E8 (d=8), Leech (d=24) !! But still: lack of adaptation to the data
  • 15. Alternative hash functions – Learned !! Any hash function can be used in LSH !! Just need a set of functions !! Therefore, could be learned on sample examples !! In particular: k-means, Hierarchical k-means, KD-trees !! Better data adaptation than with structured quantizers From [Pauleve 10]
  • 16. Alternative hash functions – Learned !! Significantly better than structured quantizers !! Example of search: quality for a single hash function !! BOV: k-means! !! HKM: loss compared with k-means [Nister 06]
  • 17. Multi-probe LSH !! But multiple hash functions use a lot of memory !! Per vector and per hash table: at least an id !! Multi-probe LSH [Lv 07] !! Use less hash functions (possibly 1) !! But probe several (closest) cells per hash function " save a lot of memory !! Similar in spirit to Multiple-assignment with BOV
  • 18. FLANN !! ANN package described in Muja’s VISAPP paper [Muja 09] !! Multiple kd-tree or k-means tree !! With auto-tuning under given constraints Remark: self-tuned LSH proposed in [Dong 07] !! Still high memory requirement for large vector sets !! Excellent package: high integration quality and interface! !! See http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN
  • 19. Issue for large scale: final verification !! For this second (“re-ranking”) stage, we need raw descriptors, i.e., !! either huge amount of memory ! 128GB for 1 billion SIFTs !! either to perform disk accesses ! severely impacts efficiency
  • 20. Issue for large scale: final verification !! Some techniques –like BOV– keep all vectors (no verification) !! Better: use very short codes for the filtering stage !! Hamming Embedding [Jegou 08] or Product Quantization [Jegou 11] NOT ON A LARGE SCALE
  • 21. Outline !! Preliminary !! Locality Sensitive Hashing: the two modes !! Hashing !! Embedding !! Searching with Product Quantization
  • 22. LSH for binarization [Charikar’ 98, J.’08, Weiss’09, etc] !! Idea: design/learn a function mapping the original space into the compact Hamming space: !! Objective: neighborhood in the Hamming space try to reflect original neighborhood !! Advantages: compact descriptor, fast comparison 000 001 100 110 111 011 101 010
  • 23. LSH for binarization [Charikar’ 98, J.’08, Weiss’09, etc] !! Given B random projection direction ai !! Compute a binary code from a vector x as !! Spectral Hashing: theoretical framework for finding hash functions !! In practice: PCA + binarization on the different axis (based on variance) 000 001 100 110 111 011 101 010
  • 24. LSH: the two modes – approximate guidelines Partitioning technique !! Sublinear search !! Several hash indexes (integer) !! Large memory overhead !! Hash table overhead (store ids) !! Need original vectors for re-ranking !! Need a lot of memory !! Or to access the disk !! Interesting when (e.g., FLANN) !! Not too large dimensionality !! Dataset small enough (memory) !! Very good variants/software (FLANN) Binarization technique !! Linear search !! Produce a binary code per vector !! Very compact !! bit-vectors, concatenated (no ids) !! Very fast comparison !! Hamming distance (popcnt SSE4) !! 1 billion comparisons/second !! Interesting !! For very high-dimensional vectors !! When memory is critical !! Simple to implement. Very active problems with many variants
  • 25. Other topics on LSH !! More general metrics: Kernelized LSH [Kulis 09], RMMH [Joly 11], … !! Binary LSH (=searching binary vectors) !! Like E2LSH but: random subset of bits instead of projections !! In this CVPR: [Nourouzi 12]. Exact binary search variant! !! Optimized jointly with dimensionality reduction !! PCA+random rotation or PCA+variance balancing [Jegou 10] !! ITQ [Gong 11] !! Asymmetric distances !! Idea: do not approximate the query – only the database is binarized !! Proposed with sketches [Dong 08] !! Significant improvement for any binarization technique [Gordo 11]
  • 26. Hamming Embedding !! Introduced as an extension of BOV [Jegou 08] !! Combination of !! A partitioning technique (k-means) !! A binary code that refine the descriptor Representation of a descriptor x !! Vector-quantized to q(x) as in standard BOV + short binary vector b(x) for an additional localization in the Voronoi cell !! Two descriptors x and y match iif Where h(.,.) denotes the Hamming distance
  • 27. ANN evaluation of Hamming Embedding 0.7 NNrecall 0 0.1 0.2 0.3 0.4 0.5 0.6 1e-08 1e-07 1e-06 1e-05 0.0001 0.001 0.01 0.1 rate of points retrieved k=100 200 500 1000 2000 5000 10000 20000 30000 50000 ht=16 18 20 22 HE+BOW BOW 3228 24 compared to BOW: at least 10 times less points in the short-list for the same level of accuracy Hamming Embedding provides a much better trade-off between recall and remove false positives
  • 28. Matching points - 20k word vocabulary 201 matches 240 matches Many matches with the non-corresponding image!
  • 29. Matching points - 200k word vocabulary 69 matches 35 matches Still many matches with the non-corresponding one
  • 30. Matching points - 20k word vocabulary + HE 83 matches 8 matches 10x more matches with the corresponding image!
  • 31. Outline !! Preliminary !! Locality Sensitive Hashing: the two modes !! Hashing !! Embedding !! Searching with Product Quantization
  • 32. A typical source coding system !! Simple source coding system: !! Decorrelation, e.g., PCA !! Quantization !! Entropy coding !! To a code e(x) is associated a unique reconstruction value q(x) " i.e., the visual word !! Focus on quantization (lossy step) quantization entropy coding decorrelation rate-distortion optimization
  • 33. Relationship between Reconstruction and Distance estimation !! Assume y quantized to qc(y) x is a query vector !! If we estimate the distance by !! Then we can show that: i.e., the error on the square distance is statistically bounded by the quantization error c c
  • 34. Searching with quantization [Jegou 11] !! Main idea: compressed representation of the database vectors !! Each database vector y is represented by qc(y) where qc(.) is a product quantizer !! Search = distance approximation problem !! The key: Estimate the distances in the compressed domain such that !! Quantization is fast enough !! Quantization is precise, i.e., many different possible indexes (ex: 264) !! Regular k-means is not appropriate: not for k=264 centroids c c
  • 35. q1 Product Quantizer !! Vector split into m subvectors: !! Subvectors are quantized separately !! Example: y = 16-dim vector split in 8 subvectors of dimension 16 !! In practice: 8 bits/subquantizer (256 centroids), !! SIFT: m=4-16 !! VLAD/Fisher: 4-128 bytes per indexed vector 3 bits y1: 2 components 24-bit quantization index q2 q3 q4 q5 q6 q7 q8 q1(y1) q2(y2) q3(y3) q4(y4) q5(y5) q6(y6) q7(y7) q8(y8)
  • 36. Asymmetric distance computation (ADC) !! Compute the square distance approximation in the compressed domain !! To compute distance between query and many codes !! compute for each subvector and all possible centroids ! stored in look-up tables ! fixed cost for quantization !! for each database code: sum the elementary square distances !! Each 8x8=64-bits code requires only m=8 additions per distance !! IVFADC: combination with an inverted file to avoid exhaustive search
  • 37. c Combination with an inverted file system ALGORITHM ! Coarse k-means hash function Select k’ closest centroids ci and corresponding cells ! Compute the residual vector x-ci of the query vector ! Encode the residual vector by PQ ! Apply the PQ search method. Distance is approximated by d(x,y) = d(x-ci,q(y-ci)) Example timing: 3.5 ms per vector for a search in 2 billion vectors
  • 38. Performance evaluation !! Comparison with other memory efficient approximate neighbor search techniques, i.e., binarization techniques !! Spectral Hashing [Weiss 09] – exhaustive search !! Hamming Embedding [Jegou 08] – non exhaustive search !! Performance measured by searching 1M vector (recall@R, varying R) Searching in 1M SIFT descriptors Searching in 1M GIST descriptors
  • 39. Variants !! Adapted codebook for residual vectors [Uchida 11] !! Learn the product quantizer separately in the different cells !! Re-ranking with source coding [Jegou 11] !! Exploit the explicit reconstruction of PQ !! Refine the database vector by a short code !! In this CVPR: !! The “multiple inverted index” [Babenko 12] !! Replace the coarse k-means by a product quantizer !! + priority selection of cells !! Then apply PQ distance estimation
  • 40. Product Quantization: some applications !! PQ search was first proposed for searching local descriptors [J’09-11], i.e., to replace bag-of-words or Hamming Embedding !! [J’10]: Encoding a global image representation (Vlad/Fisher) !! [Gammeter et al’10]: Fast geometrical re-ranking with local descriptors !! [Perronnin et al.’11]: Large scale classification (Imagenet) !! Combined with Stochastic Gradient Descent SVM !! Decompression on-the-fly when feeding the classifier !! Won the ILSVRC competition in 2011 !! [Vedaldi and Zisserman’12] – CVPR !! Learning in the PQ-compressed domain !! Typically *10 acceleration with no loss
  • 41. Nearest neighbor search is a key component of image indexing systems Product quantization-based approach offers o! Competitive search accuracy o! Compact footprint: few bytes per indexed vector Tested on 220 million video frames, 100 million still images extrapolation for 1 billion images: 20GB RAM, query < 1s on 8 cores Tested on audio, text descriptors, etc Toy Matlab package available on my web page 10 million images indexed on my laptop: 21 bytes per indexed image Conclusion
  • 42. Estimated distances versus true distances !! The estimator d(X,q(Y))2 of d(X,Y)2 is biased: !! The bias can removed by quantization error terms !! but does not improve the NN search quality