Title: Invariant Large Margin Nearest Neighbour Classifier
1Invariant Large Margin Nearest Neighbour
Classifier
- M. Pawan Kumar
- Philip Torr
- Andrew Zisserman
2Aim
- To learn a distance metric for invariant
- nearest neighbour classification
3Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Target pairs
4Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Impostor pairs
Problem Euclidean distance may not provide
correct nearest neighbours
Solution Learn a mapping to new space
5Aim
- To learn a distance metric for invariant
- nearest neighbour classification
6Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
7Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
8Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
9Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
10Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
11Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Learn a mapping to new space
12Aim
- To learn a distance metric for invariant
- nearest neighbour classification
13Aim
- To learn a distance metric for invariant
- nearest neighbour classification
Euclidean Distance
Learnt Distance
14Motivation
- Face Recognition in TV Video
Euclidean distance may not give correct nearest
neighbours
Learn a distance metric
15Motivation
- Face Recognition in TV Video
Invariance to changes in position of features
16Outline
- Large Margin Nearest Neighbour (LMNN)
- Preventing Overfitting
- Polynomial Transformations
- Invariant LMNN (ILMNN)
- Experiments
17LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Learns a distance metric for Nearest Neighbour
classification
18LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Learns a distance metric for Nearest Neighbour
classification
Distance between xi and xj D(i,j) (xi-xj)T
LTL (xi-xj)
19LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Learns a distance metric for Nearest Neighbour
classification
Distance between xi and xj D(i,j) (xi-xj)T
M (xi-xj)
M 0
Convex Semidefinite Program (SDP)
min Sij D(i,j) subject to M
0
Global minimum
20LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Learns a distance metric for Nearest Neighbour
classification
D(i,k) D(i,j) 1
- eijk
eijk 0
min Sijk eijk subject to M
0
Convex SDP
21LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Learns a distance metric for Nearest Neighbour
classification
min Sij D(i,j) ?H Sijk
eijk subject to M 0
D(i,k) D(i,j) 1- eijk
eijk 0
Solve to obtain optimum M
Complexity Polynomial in number of points
22LMNN Classifier
- Weinberger, Blitzer and Saul - NIPS 2005
Advantages
- Trivial extension to multiple classes
- Efficient polynomial time solution
23Outline
- Large Margin Nearest Neighbour (LMNN)
- Preventing Overfitting
- Polynomial Transformations
- Invariant LMNN (ILMNN)
- Experiments
24L2 Regularized LMNN Classifier
Regularize Frobenius norm of L
min Sij D(i,j) ?H Sijk eijk ?R
Si Mii subject to M 0
D(i,k) D(i,j) 1- eijk
eijk 0
L2-LMNN
25Diagonal LMNN
Learn a diagonal L matrix gt Learn a diagonal M
matrix
min Sij D(i,j) ?H Sijk
eijk subject to M 0
D(i,k) D(i,j) 1- eijk
eijk 0
Mij 0, i ? j
Linear Program
D-LMNN
26Diagonally Dominant LMNN
Minimize 1-norm of off-diagonal element of M
min Sij D(i,j) ?H Sijk eijk ?R
Sij tij subject to M 0
D(i,k) D(i,j) 1- eijk
eijk 0
tij Mij, tij -Mij , i ? j
DD-LMNN
27LMNN Classifier
What about invariance to known transformations?
Append input data with transformed versions
Inefficient
Inaccurate
Can we add invariance to LMNN?
- No Not for a general transformation
- Yes - For some types of transformations
28Outline
- Large Margin Nearest Neighbour (LMNN)
- Preventing Overfitting
- Polynomial Transformations
- Invariant LMNN (ILMNN)
- Experiments
29Polynomial Transformations
a
x
Rotate x by an angle ?
b
Taylors Series
30Polynomial Transformations
a
x
Rotate x by an angle ?
b
a
cos ?
-sin ?
cos ?
b
sin ?
1
a
b
-a/2
b/6
T(?,x) X ?
?
b
a
-b/2
-a/6
?2
?3
X
?
31Why are Polynomials Special?
SD-Representability of Polynomials
Lasserre, 2001
Sum of squares of polynomials
32Why are Polynomials Special?
?1
?2
D I S T A N C E
Sum of squares of polynomials
33Outline
- Large Margin Nearest Neighbour (LMNN)
- Preventing Overfitting
- Polynomial Transformations
- Invariant LMNN (ILMNN)
- Experiments
34ILMNN Classifier
Learns a distance metric for invariant Nearest
Neighbour classification
xi
xj
Polynomial trajectories
xk
35ILMNN Classifier
Learns a distance metric for invariant Nearest
Neighbour classification
xi
xj
Polynomial trajectories
xk
M 0
- Bring target trajectories closer
Minimize maximum distance
- Move impostor trajectories away
Maximize minimum distance
36ILMNN Classifier
Learns a distance metric for invariant Nearest
Neighbour classification
xi
xj
Polynomial trajectories
xk
- Use SD-Representability. One Semidefinite
Constraint.
- Solve for M in polynomial time.
- Add regularizers to prevent overfitting.
37Outline
- Large Margin Nearest Neighbour (LMNN)
- Preventing Overfitting
- Polynomial Transformations
- Invariant LMNN (ILMNN)
- Experiments
38Dataset
Faces from an episode of Buffy The Vampire
Slayer
11 Characters
24,244 Faces (with ground truth labelling)
Thanks to Josef Sivic and Mark Everingham
39Dataset Splits
Experiment 1
- Random permutation of dataset
- 30 training
- 30 validation (to estimate ?H and ?R)
- 40 testing
Suitable for Nearest Neighbour-type Classification
Experiment 2
- First 30 training
- Next 30 validation
- Last 40 testing
Not so suitable for Nearest Neighbour-type Classif
ication
40Incorporating Invariance
Invariance of feature position to Euclidean
Transformation
Approximated to degree 2 polynomial using
Taylors series
Derivatives approximated as image differences
Rotated Image
Image
41Incorporating Invariance
Invariance of feature position to Euclidean
Transformation
Approximated to degree 2 polynomial using
Taylors series
Derivatives approximated as image differences
-
Smooth Image
Derivative
Smooth Image
42Training the Classifiers
Problem Euclidean distance provides 0 error
Solution Cluster.
43Training the Classifiers
Problem Euclidean distance provides 0 error
Solution Cluster. Train using cluster centres.
Efficiently solve SDP using Alternative Projection
Bauschke and Borwein, 1996
44Testing the Classifiers
Map all training points using L
Map the test point using L
Find nearest neighbours. Classify.
45Timings
46Accuracy
47Accuracy
48Accuracy
49Accuracy
50True Positives
51Conclusions
- Regularizers for LMNN
- Adding invariance to LMNN
- More accurate than Nearest Neighbour
- More accurate than LMNN
52Future Research
- D-LMNN and D-ILMNN for Chi-squared distance
- D-LMNN and D-ILMNN for dot product distance
- Handling missing data
- Sivaswamy, Bhattacharya, Smola, JMLR 2006
- Learning local mappings (adaptive kNN)
53Questions ??
54(No Transcript)
55False Positives
56Precision-Recall Curves
Experiment 1
57Precision-Recall Curves
Experiment 1
58Precision-Recall Curves
Experiment 1
59Precision-Recall Curves
Experiment 2
60Precision-Recall Curves
Experiment 2
61Precision-Recall Curves
Experiment 2