Page 1
Similarity and Difference
Pete Barnum
January 25, 2006
Advanced Perception
Page 2
Visual Similarity
Color Texture
Page 3
Uses for Visual Similarity Measures
Classification Is it a horse?
Image Retrieval Show me pictures of horses.
Unsupervised segmentation Which parts of the image are grass?
Page 4
Histogram Example
Slides from Dave Kauchak
Page 5
Cumulative Histogram
Normal Histogram
Cumulative Histogram
Slides from Dave Kauchak
Page 6
Joint vs Marginal Histograms
Images from Dave Kauchak
Page 7
Joint vs Marginal Histograms
Images from Dave Kauchak
Page 9
Clusters (Signatures)
Page 10
Higher Dimensional Histograms
Histograms generalize to any number of features Colors Textures Gradient Depth
Page 11
Distance Metrics
x
y
x
y
-
-
-
= Euclidian distance of 5 units
= Grayvalue distance of 50 values
= ?
Page 12
Bin-by-bin
Good!
Bad!
Page 13
Cross-bin
Good!
Bad!
Page 14
Distance Measures
Heuristic Minkowski-form Weighted-Mean-Variance (WMV)
Nonparametric test statistics 2 (Chi Square) Kolmogorov-Smirnov (KS) Cramer/von Mises (CvM)
Information-theory divergences Kullback-Liebler (KL) Jeffrey-divergence (JD)
Ground distance measures Histogram intersection Quadratic form (QF) Earth Movers Distance (EMD)
Page 15
Heuristic Histogram Distances
Minkowski-form distance Lp
Special cases: L1: absolute, cityblock, or
Manhattan distance L2: Euclidian distance L: Maximum value distance
p
i
pJifIifJID
/1
),(),(),(
Slides from Dave Kauchak
Page 16
More Heuristic Distances
r
rr
r
r JIJIJID rr
),(
Slides from Dave Kauchak
Weighted-Mean-Variance Only includes minimal information about
the distribution
Page 17
Nonparametric Test Statistics
2
Measures the underlying similarity of two samples
2/;;ˆ,
ˆ
ˆ;,
2
JifIififif
ifIifJID
i
Images from Kein Folientitel
Page 18
Nonparametric Test Statistics
Kolmogorov-Smirnov distance Measures the underlying similarity of two samples Only for 1D data
Page 19
Nonparametric Test Statistics
Kramer/von Mises Euclidian distance Only for 1D data
Page 20
Information Theory
Kullback-Liebler Cost of encoding one distribution as another
Page 21
Information Theory
Jeffrey divergence Just like KL, but more numerically stable
Page 22
Ground Distance
Histogram intersection Good for partial matches
Page 23
Ground Distance
Quadratic form Heuristic
JIt
JIJID ffAff,
Images from Kein Folientitel
Page 24
Ground Distance
Earth Movers Distance
Images from Kein Folientitel
jiij
jiijij
g
dg
JID
,
,,
Page 25
Summary
Images from Kein Folientitel
Page 29
The Difference?
=
(amount moved)
Page 30
The Difference?
=
(amount moved) * (distance moved)
Page 31
Linear programming
m clusters
n clusters
P
Q All movements
(distance moved) * (amount moved)
Page 32
Linear programming
m clusters
n clusters
P
Q
(distance moved) * (amount moved)
Page 33
Linear programming
m clusters
n clusters
P
Q
* (amount moved)
Page 34
Linear programming
m clusters
n clusters
P
Q
Page 35
Constraints
m clusters
n clusters
P
Q
1. Move “earth” only from P to Q
P’
Q’
Page 36
Constraints
m clusters
n clusters
P
Q
2. Cannot send more “earth” than there is
P’
Q’
Page 37
Constraints
m clusters
n clusters
P
Q
3. Q cannot receive more “earth” than it can hold
P’
Q’
Page 38
Constraints
m clusters
n clusters
P
Q
4. As much “earth” as possible must be moved
P’
Q’
Page 39
Advantages
Uses signatures Nearness measure without
quantization Partial matching A true metric
Page 40
Disadvantage
High computational cost Not effective for unsupervised
segmentation, etc.
Page 41
Examples
Using Color (CIE Lab) Color + XY Texture (Gabor filter bank)
Page 43
Image LookupL1 distance
Jeffrey divergence
χ2 statistics
Quadratic form distance
Earth Mover Distance
Page 45
Concluding thought
-
-
-
= it depends on the application