Metric Learning Applied for Automatic Large Image Classification - - PowerPoint PPT Presentation

metric learning applied for automatic large image
SMART_READER_LITE
LIVE PREVIEW

Metric Learning Applied for Automatic Large Image Classification - - PowerPoint PPT Presentation

September, 2014 UPC Metric Learning Applied for Automatic Large Image Classification Supervisors TOON CALDERS (PhD) / ULB SAHILU WENDESON / IT4BI SALIM JOUILI (PhD) /EuraNova Image Database Classification How? Using K-Nearest Neighbor (kNN)


slide-1
SLIDE 1

Metric Learning Applied for Automatic Large

September, 2014 UPC

Image Classification

SAHILU WENDESON / IT4BI

TOON CALDERS (PhD) /ULB SALIM JOUILI (PhD)/EuraNova Supervisors

slide-2
SLIDE 2

Image Database

2

Classification Using K-Nearest Neighbor (kNN) Quality of Distance Measure Depends on How?

slide-3
SLIDE 3

k Nearest Neighbor (kNN) Classifier

(k=1) (k=5) k neighbors choose based on Euclidean distance measure Depends on the distance measure

Q

(k=1) (k=5)

3

slide-4
SLIDE 4

Outline

1) METRIC LEARNING 2) INDEXING 3) OBJECTIVES and CONTRIBUTIONS 4) EXPERIMENT RESULTS 5) DISCUSSION,CONCLUSION and FUTURE WORKS 3) OBJECTIVES and CONTRIBUTIONS

slide-5
SLIDE 5
  • 1. METRIC LEARNING
  • To maximize accuracy of kNN by learning the

distance measure

  • Traditional metric space (Euclidean )lacks1:

– Consider correlation between features – Consider correlation between features – To provide curved as well as linear decision boundaries

  • Metric Learning used to solve these limitations

using Mahalanobis metric space

5

  • 1R. O. Duda, "Pattern Recognition for HCI," Department of Electrical Engineering San Jose State University, p.

http://www.cs.princeton.edu/courses/archive/fall08/cos436/Duda/PR_Mahal/PR_Mahal.htm, 1997.

slide-6
SLIDE 6

Mahalanobis Metric Space

  • Euclidean Space
  • Mahalanobis Space1

Where is the cone of symmetric PSD

6

1http://www.ias.ac.in/resonance/Volumes/04/06/0020-0026.pdf

Using Cholesky decomposition : And rewrite dM As follow:

slide-7
SLIDE 7

Euclidean Vs Mahanalobis Space

Age

Euclidean Space Mahalanalobis Space

Age

7

Weight M M=GTG Weight

slide-8
SLIDE 8

Metric Learning Algorithms

  • Metric learning algorithms approaches:

– Driven by Nearest Neighbors – Information -theoretical – Online – Etc – Etc

  • Nearest Neighbor approaches

– MMC, Xing et al. (2002) – NCA, leave-one out cross validation (LOO), Goldberger et al.(2004) – MCML, Globerson and Roweis (2005) – LMNN, Weinberger et al. (2005)

8

slide-9
SLIDE 9

LMNN

Euclidean Metric Mahanalobis Metric

G

Local neighborhood

G

Margin

9

M=GTG

Target Neighbor Impostors

slide-10
SLIDE 10

Summary

  • LMNN1

– Scales to large datasets – Has fast test-time performance – Convex optimization – Can solve efficiently Can solve efficiently – No assumption about the data – Number of target, prior assignment

  • Euclidean Space, Multi-Pass LMNN1

– Sensitive to outliers – Dimension Reduction

Principle Component Analysis (PCA)2

10 1http://www.cse.wustl.edu/~kilian/papers/jmlr08_lmnn.pdf

2http://computation.llnl.gov/casc/sapphire/pubs/148494.pdf

slide-11
SLIDE 11

Dimension Reduction

  • PCA

– In the mean-square error sense – Linear dimension reduction – Based on covariance matrix of the variables – Used to reduce computation time and avoid overfitting

11

PCA

slide-12
SLIDE 12

Dataset (labeled ) Dataset (labeled ) Training set Training set Testing set Testing set Normalize and dimension reduction Normalize and dimension reduction Metric Learning LMNN LMNN Best PSD, M=GTG Best PSD, M=GTG

Test, 30% Build, 70% Plug

12

Evaluation

  • Intra/Inter distance ratio
  • kNN Error ratio

Build Model

Test model Model Build model using LMNN Model

slide-13
SLIDE 13

Intra/Inter Distance Ratio

0.15 0.2 0.25 0.3

intra/inter ratio

Mahalanobis

13

  • 3.89E-1

0.05 0.1 0.15

1 2 3 4 5 6 7 8 9 10

ratio

Class

Mahalanobis Euclidean

Mnist, has 10 classes, intra/inter ratio, number of target = 3

slide-14
SLIDE 14

Dataset (labeled ) Dataset (labeled ) Training set Training set Testing set Testing set Normalize and dimension reduction Normalize and dimension reduction Metric Learning LMNN LMNN Best PSD, M=GTG Best PSD, M=GTG

Test, 30% Build, 70% Plug

14

Evaluation

  • Intra/Inter distance ratio
  • kNN Error ratio

Build Model

Test model Model Build model using LMNN Model

slide-15
SLIDE 15

kNN Error Ratio

7.4 9.6 2.5 4.3 4.7 1.5

Bal ISOLET Mnist

atasets

15

4.3 5.9 7.4 3.2 2.6

2 4 6 8 10 12

Iris Faces

Error rate Data

Mahanalobis Euclidean Error rate LMNN Vs Euclidean Metrics, (k =5), number of target = 3

slide-16
SLIDE 16

Statistics Mnist Letters Isolet Bal Wines Iris

#inputs 70000 20000 7797 535 152 128 #features 784 16 617 4 13 4 #reduced dimensions 164 16 172 4 13 4 #training examples 60000 14000 6238 375 106 90 #testing examples 10000 6000 1559 161 46 38 #classes 10 26 26 3 3 3

kNN

Comparison

16

kNN

Euclidean 2,12 4.68 8.98 18.33 25.00 4.87 PCA 2.43 4.68 8.60 18.33 25.00 4.87 RCA 5.93 4.34 5.71 12.31 2.28 3.71 MMC N/A N/A N/A 15.66 30.96 3.55 NCA N/A N/A N/A 5.33 28.67 4.32 LMNN

PCA

1.72 3.60 4.36 11.16 8.72 4.37

Multiple Passes

1.69 2.80 4.30 5.86 7.59 4.26

Weinberger, K. Q. and L. K. Saul (2009). "Distance metric learning for large margin nearest neighbor classification." The Journal of Machine Learning Research 10: 207-244.

slide-17
SLIDE 17

Classification using

kNN

Image Database

17

kNN

Time Complexity

Intractable Approximate Nearest Neighbor (ANN) Solution

http://www.cs.utexas.edu/~grauman/courses/spring2008/datasets.htm

slide-18
SLIDE 18

Out-line

1) METRIC LEARNING 2) INDEXING 3) OBJECTIVES and CONTRIBUTIONS 4) EXPERIMENT RESULTS 5) DISCUSSION,CONCLUSION and FUTURE WORKS 3) OBJECTIVES and CONTRIBUTIONS

slide-19
SLIDE 19
  • 2. Locality Sensitive Hashing
  • Idea: hash functions that similar objects are more likely

to have the same hash1, Sub-linear time search

  • Hashing methods to do fast Approximate Nearest

Neighbor (ANN) Search,

19

1[Indyk-Motwani’98] http://people.csail.mit.edu/indyk/mmds.pdf

Q

P=4,

:-approximation ratio, r, radius

  • LSHs have been designed for

Cosine Similarity LP Distance Measure Hamming distance Jaccard index for set similarity ……

slide-20
SLIDE 20

Example, LSH

  • Take random projections of data
  • Quantize each projection with few bits

1 1 0 0

1100

1 1

Feature vector

1100

www.cs.utexas.edu/~grauman/.../jain_et_al_cvpr2008.ppt 20

slide-21
SLIDE 21

Cosine Similarity LSH

Basic Hashing Function1 Learned Hashing Function

hr1…rb series of b randomized 10010

hr1…r4 G

Image database

r is d-dimensional random hyperplane, Gaussian distribution

21

1Jain, B. Kulis, and K. Grauman. Fast Image Search for Learned Metrics. In CVPR, 2008

10010 10110 10100 10011

Q

b randomized LSH functions

hr1…r4

10110 10101 10100

Q

Both cases

Colliding instances are searched <<n

slide-22
SLIDE 22

Euclidean Space Hashing

  • Basic Euclidean Space • Learned Euclidean Space
  • Where a is a d-dimensional vector chosen independently

22

  • Where a is a d-dimensional vector chosen independently

from a p-stable distribution ,

  • Chose

random line and partition into equi-width segments w, and

  • b is a real number chosen randomly from range [0,w]
  • To guarantee accuracy, L hash table(s) are used to probe

near neighbors in each Buckets, under K hash functions.

slide-23
SLIDE 23

Image Database

Euclidean Space Hashing

L = 3, number of hash Table

K, number of hash function

No indexing involved

L2 Hash Table L1 Hash Table L3 Hash Table

Key Values X Y W R S Key Values X’ Y’ R’ S’ key Values Y’’ W’’ R’’

Q

23

slide-24
SLIDE 24

Out-line

1) METRIC LEARNING 2) INDEXING 3) OBJECTIVES and CONTRIBUTIONS 4) EXPERIMENT RESULTS 5) DISCUSSION,CONCLUSION and FUTURE WORKS 3) OBJECTIVES and CONTRIBUTIONS

slide-25
SLIDE 25
  • 3. OBJECTIVES and CONTRIBUTIONS
  • The main objectives of this thesis are:-

– To study and implement

metric learning algorithm dimension reduction technique LSH in different metric space LSH in different metric space – To establish and implement machine learning evaluation techniques

  • The original contribution of the thesis are

– Formulate a fresh learned approach for both Cosine similarity and Euclidean metric space hashing

25

slide-26
SLIDE 26

Out-line

1) METRIC LEARNING 2) INDEXING 3) OBJECTIVES and CONTRIBUTIONS 4) EXPERIMENTAL RESULTS 5) DISCUSSION,CONCLUSION and FUTURE WORKS 3) OBJECTIVES and CONTRIBUTIONS

slide-27
SLIDE 27

Dataset (labeled ) Dataset (labeled ) Training set Training set Query set Query set Normalize and dimension reduction Normalize and dimension reduction Transform, M=GTG Transform, M=GTG Metric Learning LMNN LMNN Best PSD, M Best PSD, M

Test, 10% Build, 90% Plug Decompose, M

Hashing (LSH)

27

M=GTG M=GTG

Cosine Similarity Hashing Euclidean Space Hashing

Learned Basic Learned Original

Evaluation

  • Time Complexity
  • Computational Complexity
  • Query Accuracy

Test model

Hashing (LSH)

Model

slide-28
SLIDE 28

Time Complexity

Exhaustive Vs Euclidean Space Hashing, 3NN

189 49

80 100 120 140 160 180 200

time (Msecond) Exhaustive Euclidean Hashing

28

Dataset

LetterRecognitioon Isolet Mnist

Instances

20,000 7796 70,000

Dimension

16 617 784 24 22 8 4 49

20 40 60 80

LetterRecognition Isolet Mnist

Datasets

slide-29
SLIDE 29

Computation Complexity

Steps CosineLSH CosineLSH +LMNN E2LSH LMNN + E2LSH Euclidean LMNN

Metric learning projection (offline)

O(d) O(d2)

O(d)

O(d2) O(d) O(d2)

We use to guarantee searching of NN

29

(offline) Hash functions

O(b) O(b) O(Lk) O(Lk) O(0) O(0)

Signature (to represent the data point)

O(1) O(1) O(L) O(L) O(1) O(1)

Hashing: compute

O(bd) O(bd) O(dLk) O(dLk) O(0) O(0)

Search: identity the query's ANNs

O(Md) O(Md) O(LMd) O(LMd) O(dN) O(dN)

  • M. S. Charikar, "Similarity estimation techniques from rounding algorithms," in Proceedings of the thiry-fourth annual ACM symposium on Theory of

computing, 2002, pp. 380-388. http://www.cs.utexas.edu/~ai-lab/pubs/jain_kulis_grauman_cvpr2008.pdf

slide-30
SLIDE 30

Dataset (labeled ) Dataset (labeled ) Training set Training set Query set Query set Normalize and dimension reduction Normalize and dimension reduction Transform, M=GTG Transform, M=GTG Metric Learning LMNN LMNN Best PSD, M Best PSD, M

Test, 10% Build, 90% Plug Decompose, M

Hashing (LSH)

30

M=GTG M=GTG

Cosine Similarity Hashing Euclidean Space Hashing

Learned Randomized Learned Original

Evaluation

  • Time Complexity
  • Computational Complexity
  • Query Accuracy

Test model

Hashing (LSH)

Model K = 10

slide-31
SLIDE 31

Accuracy Rate(Cosine Similarity Hashing)

0.6 0.8 1 ISOLET

31

0.2 0.4 0.6

4 8 16 32 64 128

Accuracy Rate

Bit

Randomized Learned

slide-32
SLIDE 32

Accuracy Rate(Cosine Similarity Hashing)

0.6 0.8 1 MNIST

32

0.2 0.4 0.6 4 8 16 32 64 128

Accuracy Rate Bit

Randomized Learned

slide-33
SLIDE 33

Accuracy Rate(Cosine Similarity Hashing)

0.6 0.8

Accuracy

Cifer100

33

0.2 0.4 4 8 16 32 64 128

Accuracy Rate Bit

Randomized Learned

slide-34
SLIDE 34

Accuracy Rate(Euclidean Space Hashing)

0.901 0.682 0.882 0.937 0.812

Letter cifar-100

Accuracy Rate: E2LSH Vs LMNN+E2LSH Datasets

34

0.660 0.891 0.844 0.816 0.916 0.882 0.000 0.200 0.400 0.600 0.800 1.000

OliverFaces ISOLET Mnist

LMNN+E2LSH E2LSH

Accuracy rate

slide-35
SLIDE 35

Summary

Time LMNN Euclidean Exhaustive techniques

35

Accuracy LMNN + E2LSH E2LSH kNN classification accuracy Euclidean space hashing Learned Cosine Basic Cosine Cosine space hashing

slide-36
SLIDE 36

Out-line

1) METRIC LEARNING 2) INDEXING 3) OBJECTIVES and CONTRIBUTIONS 4) EXPERIMENTAL RESULTS 5) DISCUSSION,CONCLUSION and FUTURE WORKS 3) OBJECTIVES and CONTRIBUTIONS

slide-37
SLIDE 37
  • 5. DISCUSSION and CONCLUSION

Metric Learning, is used to learn metric distance using Mahanalobis metric space, LMNN E2LSH outperforms both unlearned and learned Cosine similarity hashing. similarity hashing. Incorporating metric learning algorithm (LMNN) into both metric space hashing (Cosine and Euclidean, E2LSH) has a competence to improve the performance significantly. LMNN into E2LSH (LMNN +E2LSH), improves E2LSH

37

slide-38
SLIDE 38
  • 5. DISCUSSION and CONCLUSION

The main goal of this research is to devise classifier by breeding metric learning algorithm and hashing technique in the context of large-scale image classification. Java, Eclipse IDE used to implement

38

slide-39
SLIDE 39

FUTURE WORKS

Future work(s)

Extend this research work by adding feature extraction technique on top, to set up input data

Future Future

Use

  • ther

LMNN extension algorithms and compare results of this thesis. Propose to advance this study using unsupervised (clustering) metric learning algorithms.

39

slide-40
SLIDE 40

THANK YOU!!!

40

Q A