SlideShare una empresa de Scribd logo
1 de 182
Descargar para leer sin conexión
J.ROCHAS,GE SONG, F.HUET
PROJET
SOUS LA DIRECTION :
SURVEY OF DIFFERENT APPROACHES FOR COMPUTING KNN ON TOP OF
MAP REDUCE
LEA EL BEZE
1
DEFINITIONS :
KNN = K nearest neighbors

KNN(r,S) = set KNN of r from S

KNNJ(R,S) = {r,KNN(r,S) | for all r in R}
2
Exemple
exemple pour k =3
R
s
3
Exemple
exemple pour k =3
R
s
4
R
s
Exemple
exemple pour k =3
5
Problèmes :Data deluge
Parallelisme!
6
MAP REDUCE
7
Map Reduce
MapReduce est un patron d'architecture de
développement informatique, popularisé par
Google, dans lequel sont effectués des calculs
parallèles, et souvent distribués, de données
potentiellement très volumineuses (Wikipedia)
8
Map Reduce
Idee :
Map<K1,V1> —> list <K2, V2>

Reduce<K2,list<V2>> —> list <K3, V3>
9
KNN :
DIFFERENTS ALGORITHMES
10
2 types d’Algorithmes
KNN

reel K plus proche voisins

ANN

approximatif plus proche voisins
11
KNN : REEL
1. HBKNNJ : BASIC
2. HBNLJ : BLOC NESTED
12
HBKNNJ
Hadoop Basic K
Nearest Neighbors
Join
13
HBKNNJ :
Hadoop Basic K Nearest Neighbors Join
PRINCIPE :

2 Dataset R et S

Joindre R a S

calculer les K plus proches voisins de R dans S
14
Tours
Nice
Paris
Toulouse
Reims
Quels sont les 2 plus proches voisins de R dans S ?
R
S
15
HBKNNJ : Hadoop Basic K
1 JOB

nice, <43, 7>

toulouse,<43, 1>

reims<49,4>

paris,<48,2>

tours,<47,1>,R
input
R
S
16
HBKNNJ : Hadoop Basic K
1 JOB

nice, <43, 7>

toulouse,<43, 1>

reims<49,4>

paris,<48,2>

tours,<47,1>,R tours,<47,1>,S
nice, <43, 7>,R
reims,<49,4>,S
paris, <48,2>,S
toulouse<43,1> R
input map
R
S
17
HBKNNJ : Hadoop Basic K
1 JOB

nice, <43, 7>

toulouse,<43, 1>

reims<49,4>

paris,<48,2>

tours,<47,1> tours,<47,1>,S
nice, <43, 7>,R
nice

|nice,reims| = 6.7

|nice,paris| = 7

|nice,tours| = 6

!
!
toulouse

| toulouse,reims| = 6.7 

|toulouse,paris| = 5

| toulouse,tours| = 2
reims,<49,4>,S
paris, <48,2>,S
toulouse<43,1> R
input map reduce
R
S
18
HBKNNJ : Hadoop Basic K
1 JOB

nice, <43, 7>

toulouse,<43, 1>

reims<49,4>

paris,<48,2>

tours,<47,1> tours,<47,1>,S
nice, <43, 7>,R
nice

|nice,reims| = 6.7

|nice,paris| = 7

|nice,tours| = 6

!
!
toulouse

| toulouse,reims| = 6.7 

|toulouse,paris| = 5

| toulouse,tours| = 2
reims,<49,4>,S
paris, <48,2>,S
toulouse<43,1> R
nice,tours 6
nice,reims 6.7
toulouse,paris 5
toulouse,tours 2
input map reduce output
R
S
19
Tours
Nice
Paris
Toulouse
Reims
20
HBKNNJ :
Hadoop Basic K Nearest Neighbors Join
INCONVENIENTS :

seul la phase map est mise en parallèle

AVANTAGES :
1 seul job map reduce

EN PRATIQUE :
utile pour des petits dataset mais devient très vite
cher en temps pour des plus grand dataset
21
HBNLJ
Hadoop Block
Nested Loop Join
22
"Efficient Parallel
kNN Joins for Large
HBNLJ :
Hadoop Block Nested Loop Join
But :
On veut mettre le phase reduce en parallèle en
découpant le travail

Methode :
Découper R et S en n*n reducer
23
HBNLJ :
Hadoop Block Nested Loop Join
Decoupage :
R1 R1 R1
R2 R2 R2
R3 R3 R3
s1
s1
s1
s2
s2
s2
s3
s3
s3
distribue R en ligne
distribue S en colonne
24
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

25
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

Phase map
toulouse toulouse
26
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

toulouse toulouse
nice nice
27
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

Phase map
toulouse toulouse
nice nice
paris
paris
28
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

Phase map
toulouse toulouse
nice nice
paris
paris
nancy
nancy
29
nice
paris
tours
lyon
reims
nancy
lille
toulouse
R
S
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

Phase map
toulouse toulouse
nice nice
paris
paris
tours
tours nancy
nancy
reims
reims
lyon
lyon
lille
lille
30
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

Phase reduce
toulouse toulouse
nice nice
paris
paris
tours
tours nancy
nancy
reims
reims
lyon
lyon
lille
lille
31
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

toulouse toulouse
nice nice
paris
paris
tours
nancy
reims
reims
lyon
lyon
32
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

output
toulouse toulouse
nice nice
paris
paris
tours
nancy
reims
reims
lyon
lyon
toulouse,paris
toulouse,lyon
33
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

output
toulouse toulouse
nice nice
paris
paris
tours
nancy
reims
reims
lyon
lyon
toulouse,reims
toulouse,tours
toulouse,paris
toulouse,lyon
34
HBNLJ : Hadoop Block Nested Loop Join
1er JOB

output
toulouse toulouse
nice nice
paris
paris
tours
nancy
reims
reims
lyon
lyon
toulouse,reims
toulouse,tours
toulouse,paris
toulouse,lyon
nice,reims
nice,nancy
nice,paris
nice,lyon
candidats
35
HBNLJ : Hadoop Block Nested Loop Join
2eme JOB

toulouse,reims
toulouse,tours
toulouse,paris
toulouse,lyon
nice,reims
nice,nancy
nice,paris
nice,lyon
36
HBNLJ : Hadoop Block Nested Loop Join
2eme JOB

toulouse,reims
toulouse,tours
toulouse,paris
toulouse,lyon
nice,reims
nice,nancy
nice,paris
nice,lyon
<toulouse>

reims,tours,paris,lyon
<nice>

reims,nancy,paris,lyon
37
HBNLJ : Hadoop Block Nested Loop Join
2eme JOB

toulouse,reims
toulouse,tours
toulouse,paris
toulouse,lyon
nice,reims
nice,nancy
nice,paris
nice,lyon
<toulouse>

reims,tours,paris,lyon
<nice>

reims,nancy,paris,lyon
nice,lyon
nice,paris
toulouse,lyon
toulouse,tours
38
HBNLJ :
Hadoop Block Nested Loop Join
JOB 1:
calcul des
candidats
KNN( R ,S)
JOB 2:
calcul des
KNN( R ,S)
INPUT

R
INPUT

S
39
HBNLJ :
Hadoop Block Nested Loop Join
Avantage :
On découpe le travail en n*n reducer donc la phase
reduce peut être mis en parallèle.

Inconvenient :
replication de R et S n fois 

on a en sortit que les cKNN(R, S) , c’est a dire les
candidats pour les KNN(R,S)

implique un 2nd job pour les KNN(R,S)
40
HVKNNJ
Hadoop Voronoi K
Nearest Neighbors
Join
41
"Efficient
processing of k
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
Voronoi ?
c est une structure qui permet de diviser notre
espace en cellule…
42
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
43
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
selection pivots
44
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
diagrame voronoi
45
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
diagrame voronoi
46
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
Pb : la replication de S
pour k = 3
47
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
R
s
Pb : la replication de S
pour k = 3
48
HVKNNJ :
Hadoop Voronoi K Nearest Neighbors
Join
JOB 2:
selection du pivot
le plus proche
+statistique
ETAPE:
grouping
INPUT

R
INPUT

S
JOB 1:
generer les pivots
INPUT

R
JOB 3:
calcul des
KNN
49
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
strategie de pivots
Farthest :
sur un échantillon on prend le plus loin

KMeans :
sur un échantillon on prend un nombre de centroides qui seront
les pivots
50
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Probleme ?
on a n reducer et p cellule pivots comment distribuer
p dans n ?

But ?
regrouper les pivots pour minimiser la replication de S

avoir un bon balancing (temps equivalent pour les
slots)
51
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Probleme ?
on a n reducer et p cellules de pivots 

comment distribuer p dans n ?
4 reducers
52
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

But
éviter la replication de S

avoir des cellule qui prennent le meme temps:good
balancing
53
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

2 strategies
Geo

Greedy
54
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Geo
Geo : Regrouper les pivots les plus proches
1
2
3
4
5
55
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Geo
Geo : Mais les cellules non pas la meme repartion
Prendra plus
longtemps
que
les autres
56
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
Greedy :repartir suivant les scores et les
cellules qui ont le plus de replication commun
grace au stat : on peut borner les réplications
des cellules et donc la complexité en temps

c(v) = complexité d une cellule

c(v)=#r*(#s+#rep)
57
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
2
2
2
2
1
6
1
8
10
3
pivots rep score
A E,B 28
B A,E,D,C 40
C B,D 15
D E,B,C 25
E A,B,D 44
1
A
B
C
D
E
2 reducers
groupe score
58
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
2
2
2
2
1
6
1
8
10
3
pivots rep score
A E,B 28
B A,E,D,C 40
C B,D 15
D E,B,C 25
E A,B,D 44
1
A
B
C
D
E
2 reducers
groupe score
28
15
A
C
59
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
2
2
2
2
1
6
1
8
10
3
pivots rep score
A E,B 28
B A,E,D,C 40
C B,D 15
D E,B,C 25
E A,B,D 44
1
A
B
C
D
E
2 reducers
groupe score
28
55
A
C B
60
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
2
2
2
2
1
6
1
8
10
3
pivots rep score
A E,B 28
B A,E,D,C 40
C B,D 15
D E,B,C 25
E A,B,D 44
1
A
B
C
D
E
2 reducers
groupe score
72
55
A
C B
E
61
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
Grouping ???

Greedy
2
2
2
2
1
6
1
8
10
3
pivots rep score
A E,B 28
B A,E,D,C 40
C B,D 15
D E,B,C 25
E A,B,D 44
1
A
B
C
D
E
2 reducers
groupe score
72
80
A
C B
E
D
62
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
etape 3: grouping

Resultat :
Greedy meilleur
avec plus de reducer
63
ANN : APPROXIMATIVE
1. HZKNNJ : Z-VALUE
2. LSH : LOCALITY
64
HZKNNJ
Hadoop Z-Value K
Nearest Neighbors
Join
65
"Efficient Parallel
kNN Joins for Large
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Idee : 

Transformer d-dimension
en 1 dimension grace au
Z value

On mappe les 1
dimension pour trouver
les KNNJ
66
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
depart creation des copies
transformation basé
sur le space filling
= mappe sur 1-D
67
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-value
z_q
z+(z_q)z-(z_q)
candidats de q
68
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
Comment faire la partition ?
69
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
70
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
71
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
2-NNcopy
72
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
2-NNcopy
73
HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
Z-S
Z-R
2-NN
BTree BTree BTree
cKNN cKNNcKNN
74
JOB 1:
copies
+z_value

————-

statistiques
INPUT

S
etape 0:
creation des vectors
INPUT

R
JOB 2:
calcul des
candidats
JOB 3:

calcul des
KNN

HZKNNJ :
Hadoop Z-Value K Nearest Neighbors
Join
75
HLSH
Hadoop Locality
Sensitive Hashing
76
"Parallel Similarity
Join »
HLSH :
Hadoop Locality Sensitive Hashing
1,0,-4
6,-8,7
9,0,-8
Idee :
• hash nos objets
• les objets qui ont le meme
hashing sont dans le meme
bucket
• =cherche de collision
77
HLSH :
Hadoop Locality Sensitive Hashing
1,0,-4
6,-8,7
9,0,-8
calcul des KNN des objets R
avec les objets S, du meme bucket
bucket vide (pas de R) = eliminé
78
La fonction de hashing
g est une famille de hash de longueur M

L famille de g
HLSH :
Hadoop Locality Sensitive Hashing
longueur M
objet
h1,h2…,hm
h1,h2…,hm
hash L fois
79
La fonction de hashing
!
!
!
a = random gaussian vector

b in [0,W]

W = définit la taille du bucket
HLSH :
Hadoop Locality Sensitive Hashing
h(v) =
a• v + b
W
⎢
⎣⎢
⎥
⎦⎥
80
La fonction de hashing
3 parametres
L = augmente la precision, mais augmente le temps
M = augmente probabilité que les elements proches sont dans le
meme bucket

W = la taille de la fenêtre
HLSH :
Hadoop Locality Sensitive Hashing
81
JOB 1:
générer les
hash et calcul
statistique
ETAPE 2:
définir la
partition grace
aux statistiques
INPUT

S
etape 0:
definir les hash value
INPUT

R JOB 2:
calcul des
KNN

des buckets

=candidats
JOB 3:

calcul des
KNN

HLSH :
Hadoop Locality Sensitive Hashing
82
Partition
on a plus de buckets que de reducers

Hadoop fait mal sa partition 

Définir une partition pour que chaque reducer ait
la meme complexité en temps

soit P reducer tmps(P) = Sum(#ri*#si) i=bucket
HLSH :
Hadoop Locality Sensitive Hashing
83
HLSH :
Hadoop Locality Sensitive Hashing
Pros
rapide et moins de calcul

Cons
la fonction de hash est dataset dépendant

mais il a été prouvée que ce type de fonctions étaient plus efficace

on n a pas l’idée de replication des buckets si
pas assez d'éléments.

peut être améliorer (Multi probe, LSH forest, ….)
84
RESUME
1. KNN
1. HBKNNJ : BASIC
2. HBNLJ : BLOC NESTED
LOOP
3. HVKNNJ : VORONOI
85
RESUME
HBKNNJ:Basic
HBNLJ:

bloc nested loop
HVKNNJ: Voronoi
HZKNNJ:zvalue
HLSH:locality
sensitve hashing
pivots
fct hash
shifts,reduction
dimension

Preprocessing
calcul du
partitionement/grouping
calcul
KNN
calcul des
candidats
partition candidats
86
EXPERIMENTATIONS
87
Contexte
Réalisé Hadoop 1.3

Sur Grid5000
88
Datasets
2 datasets
Open street map : OSM
SURF
89
Mesures
90
Temps
Precision
#data #nodes
#plus proches
voisins
Precision
recall =
| A(q)∩ I(q)|
| I(q)|
A = Actual dataset

I = Ideal dataset
91
GEOGRAPHIC DATA…
92
OSM DATA
Donnée géographiques

XML

latitude,longitude

2 dimensions
93
IMPACT SUR NOMBRE DE
NODES
94
4x10ˆ3m data
time(sec)
110
115
120
125
130
#nodes
3 10 15 18
HBKNNJ
Impact du nombre de nodes …
95
4x10ˆ3m data
time(sec)
0
37,5
75
112,5
150
#nodes
3 10 15 18
HBKNNJ : Basic HBNLJ: Bloc nested loop
Impact du nombre de nodes …
96
4x10ˆ3m data
time(sec)
0
125
250
375
500
#nodes
3 10 15 18
HBKNNJ : Basic HBNLJ: Bloc nested loop HVKNNJ: Voronoi
4x10ˆ3m data
0
2000
4000
6000
8000
#nodes
3 10 15 18
Impact du nombre de nodes …
97
4x10ˆ3 data
time(sec)
0
275
550
825
1100
#nodes
3 10 15 18
HBKNNJ : Basic HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue
200x10ˆ3 data
0
2000
4000
6000
8000
#nodes
3 10 15 18
4000x10ˆ3 data
0
2000
4000
6000
8000
#nodes
3 10 15 18
Impact du nombre de nodes …
98
4x10ˆ3 data
time(sec)
0
275
550
825
1100
#nodes
3 10 15 18
HBKNNJ : Basic HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue
HLSH : LSH
200x10ˆ3 data
0
2000
4000
6000
8000
#nodes
3 10 15 18
4000x10ˆ3 data
0
2000
4000
6000
8000
#nodes
3 10 15 18
Impact du nombre de nodes …
99
IMPACT SUR NOMBRE DE
DONNEES
100
CONFIGURATION
20 nodes

1 slots/node

K = 20 trouver K voisins le plus proches

change taille des données

mesure le temps
Impact du nombre de données … : temps
101
Impact du nombre de données
4x10ˆ3 data
time(sec)
0
3500
7000
10500
14000
#data
50 100 200 400 800 1600
HBNLJ: bloc nested loop
102
Impact du nombre de données
4x10ˆ3 data
time(sec)
0
10000
20000
30000
40000
#data
50 100 200 400 800 1600
HBNLJ: Bloc nested loop HVKNNJ: Voronoi
103
Impact du nombre de données
4x10ˆ3 data
time(sec)
0
10000
20000
30000
40000
#data
50 100 200 400 800 1600
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HLSH : LSH
104
Impact du nombre de données
4x10ˆ3 data
time(sec)
0
10000
20000
30000
40000
#data
50 100 200 400 800 1600
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HLSH : LSH HZKNNJ : Zvalue
105
Impact du nombre de données
4x10ˆ3 data
time(sec)
0
1250
2500
3750
5000
#data
50 100 200 400 800 1600
HLSH : LSH HZKNNJ : Zvalue
106
Impact du nombre de données
accuracy(%)
0,8
0,85
0,9
0,95
1
#data
50 200 400 800 1600
HLSH : LSH HZKNNJ : Zvalue
107
IMPACT SUR 'K'
K = LE NOMBRE DE VOISINS
SOUHAITES
108
4x10ˆ3 data
time(sec)
0
52,5
105
157,5
210
K
2 20 200 400
HBNLJ: Bloc nested loop
Impact du nombre de K … - temps
109
4x10ˆ3 data
time(sec)
0
275
550
825
1100
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi
Impact du nombre de K … - temps
110
4x10ˆ3 data
time(sec)
0
275
550
825
1100
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue
Impact du nombre de K … - temps
111
4x10ˆ3 data
time(sec)
0
275
550
825
1100
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
Impact du nombre de K … - temps
112
Mais, la précision …
113
4x10ˆ3 data
accuracy
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
Impact du nombre de K … - précision
114
4x10ˆ3 data
time(sec)
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
Impact du nombre de K … - précision
115
4x10ˆ3 data
time(sec)
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1
K
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
Impact du nombre de K … - précision
116
Mais si on modifie les paramètres
de la fonction de hash …
117
4x10ˆ3 data
accuracy
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1
#nodes
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
HLSH
Impact du nombre de K … - précision
118
4x10ˆ3 data
accuracy
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1
#nodes
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue
HLSH : LSH HLSH HLSH : avec params changes
Impact du nombre de nodes …
119
et par rapport au temps…
120
4x10ˆ3 data
time(sec)
0
275
550
825
1100
#nodes
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue HLSH : LSH
HLSH
Impact du nombre de K … - temps
121
4x10ˆ3 data
time(sec)
0
275
550
825
1100
#nodes
2 20 200 400
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HZKNNJ : Zvalue
HLSH : LSH HLSH HLSH : avec params changes
Impact du nombre de K … - temps
122
4x10ˆ3 data
time(sec)
0
62,5
125
187,5
250
#nodes
2 20 200 400
HLSH : LSH HLSH : avec params changes
Impact du nombre de K … - temps
123
DATA SURF…
124
DONÉE SURF
descriptor générés par l'algorithme de Speeded
Up Robust Features (SURF)

dimension 128
125
2 algorithmes partent
HBKNNJ - Basic : trop lent

HZKNNJ - Z-Value : une precision < 5% pour un
dataset de haute dimension(>30)
126
IMPACT SUR NOMBRE DE
DONNEES
127
Impact du nombre de données
!
1;49724;1186657;1.0;0h19min46sec
2;100039;2276780;1.0;0h37min56sec
4;207402;4665689;1.0;1h17min45sec
8;409052;9273714;1.0;2h34min33sec
time(sec)
0
4500
9000
13500
18000
images
100 200 400 800 1600
HVKNNJ: Voronoi
128
Impact du nombre de données
!
1;49724;1186657;1.0;0h19min46sec
2;100039;2276780;1.0;0h37min56sec
4;207402;4665689;1.0;1h17min45sec
8;409052;9273714;1.0;2h34min33sec
time(sec)
0
7500
15000
22500
30000
images
100 200 400 800 1600
HVKNNJ: Voronoi HBNLJ: Bloc nested loop
129
Impact du nombre de données
!
1;49724;1186657;1.0;0h19min46sec
2;100039;2276780;1.0;0h37min56sec
4;207402;4665689;1.0;1h17min45sec
8;409052;9273714;1.0;2h34min33sec
time(sec)
0
7500
15000
22500
30000
images
100 200 400 800 1600
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH
130
Impact du nombre de données
!
1;49724;1186657;1.0;0h19min46sec
2;100039;2276780;1.0;0h37min56sec
4;207402;4665689;1.0;1h17min45sec
8;409052;9273714;1.0;2h34min33sec
4x10ˆ3 data
accuracy
0
0,25
0,5
0,75
1
images
100 200 400 800
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH
131
IMPACT SUR LE NOMBRE DE
NODES
132
Impact du nombre de nodes
!
1;49724;1186657;1.0;0h19min46sec
2;100039;2276780;1.0;0h37min56sec
4;207402;4665689;1.0;1h17min45sec
8;409052;9273714;1.0;2h34min33sec
time(sec)
0
1500
3000
4500
6000
#nodes
10 20 30 40
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH
133
IMPACT SUR 'K'
K = LE NOMBRE DE VOISINS
SOUHAITES
134
100x100 images : 49724 descriptors
time(sec)
0
2000
4000
6000
8000
K
2 20 200 2000
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH
Impact du nombre de K … - temps
Contexte : 20 nodes, 1 slot/nodes
135
100x100 images : 49724 descriptors
accuracy
0
0,25
0,5
0,75
1
K
2 20 200 2000
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HLSH : LSH
Impact du nombre de K … - temps
Contexte : 20 nodes, 1 slot/nodes
136
100x100 images : 49724 descriptors
accuracy
0
0,25
0,5
0,75
1
K
2 20 200 2000
HBNLJ: Bloc nested loop HVKNNJ: Voronoi HLSH : LSH HLSH with best acc
Impact du nombre de K … - temps
Contexte : 20 nodes, 1 slot/nodes
137
100x100 images : 49724 descriptors
time(sec)
0
2000
4000
6000
8000
K
2 20 200 2000
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH
Impact du nombre de K … - temps
Contexte : 20 nodes, 1 slot/nodes
138
100x100 images : 49724 descriptors
time(sec)
0
2000
4000
6000
8000
K
2 20 200 2000
HVKNNJ: Voronoi HBNLJ: Bloc nested loop HLSH : LSH HLSH with best acc
Impact du nombre de K … - temps
Contexte : 20 nodes, 1 slot/nodes
139
DIFFICULTES DE TROUVER LES
PARAMETRES POUR CHAQUE
ALGORITHME …
140
HBKNNJ : BASIC
• NOMBRE DE SLOTS
141
4x10ˆ3 data
time(sec)
110
115
120
125
130
#nodes
3 10 15 18
HBKNNJ
HBKNNJ - BASIC : I.NombreContexte : K=20, 20 nodes, 1 slot/nodes,dimension=2
142
HBNNLJ : BLOC NESTED LOOP
• CHOIX DU NOMBRE DE
REDUCER
• BALANCING
143
HBNNLJ : BLOC NESTEDtime(sec)
0
400
800
1200
1600
2000
2400
2800
3200
3600
4000
nombre de reducers
5x5 6x6 7x7 8x8 9x9
5m 50m 100m
Contexte : K=20, 15 nodes, 1 slot/nodes
min
min
min
144
on découpe en n*n reducers le travail

optimiser le parallélisme le plus possible , en découpant
le travail suivant le nombre de slots disponibles :

on a 15 nodes : 

choisir 5x5 est pas optimal car on fait travailler 15 nodes puis 10
nodes , 5 resteront inactif

choisir 7x7 est mieux 49 : 15+15+15 juste 4 reste inactif

8x8 = 64 = 15 *4 +4 mieux pr good balancing

mais plus de reducer = moins de travail par case
HBNNLJ : BLOC NESTED
145
time(sec)
0
400
800
1200
1600
2000
2400
2800
3200
3600
4000
nombre de reducers
5x5 6x6 7x7 8x8 9x9
5m 50m 100m
Contexte : K=20, 15 nodes, 1 slot/nodes
min
min
min
HBNNLJ : BLOC NESTED
146
Contexte : K=20, 15 nodes, 1 slot/nodes, 100000 données
HBNNLJ : BLOC NESTED
147
HVKNNJ : VORONOI
• STRATEGIE DE PIVOT
• NOMBRE DE PIVOT
• STRATEGIE DE GROUPING
148
1.CHOIX DE LA STRATEGIE DE PIVOTS
149
Contexte : K=20, 15 nodes, 1 slot/nodes, dimension=2
farthest kmeans
HVKNNJ : VORONOI:
150
2.IMPACT DU NOMBRE DE PIVOTS
151
time(sec)
200
360
520
680
840
1000
#pivots
6 30 300 500 1500 3000 4000
5M 50M 100M
+depivots=javaheapspace
min
min
min
Contexte : K=5, 3 nodes, 1 slot/nodes
HVKNNJ : VORONOI:
152
3.CHOIX DE LA STRATEGIE DE GROUPING
GEO VS GREEDY
153
HVKNNJ : VORONOI:
154
geo avec 20
reducers
HVKNNJ : VORONOI:
155
greedy avec 20
reducers
HVKNNJ : VORONOI:
156
greedy avec 50
reducers
HVKNNJ : VORONOI:
157
HZKNNJ : ZVALUE
• #DONNÉES VS PRECISION
• DIMENSION VS PRECISION
158
1.#Données vs PRECISION
159
accuracy
0,72
0,79
0,86
0,93
1
time(sec)
0
65
130
195
260
#data*1000
50 100 400 800 1600
time (sec) accurancy
Contexte : K=20, 15 nodes, 1 slot/nodes, dimension=2, 1 copie
160
HZKNNJ : ZVALUE
accuracy
0,6
0,7
0,8
0,9
1
time(sec)
0
150
300
450
600
#copy
1 2 3 4
time (sec) accurancy
161
Contexte : K=20, 15 nodes, 1 slot/nodes, dimension=2, 1 copie
HZKNNJ : ZVALUE
2.Dimension vs PRECISION
162
accuracy(%)
4,68
4,693
4,705
4,718
4,73
time(s)
0
80
160
240
#copy
1 4 Sans titre 1 8 10
time (s) accurancy(%)
Contexte : K=20, 15 nodes, 1 slot/nodes, file surf , dimension=128,#donnés=50000
nombre limité de
copie
<5%
163
HZKNNJ : ZVALUE
HLSH : LOCALITY SENSITIVE
HASHING
• FONCTION DE HASHING
164
1.Partition
165
Contexte : K=20, 20 nodes, 1 slot/nodes, file osm , dimension=2,#donnés=100000
166
HLSH : Locality Sensitive
2.La fonction de hashing
167
La fonction
de Hashing
Difficulté:

trouver
une
bonne
precision

un bon
temps
Contexte : K=20, 20 nodes, 1 slot/nodes, file osm , dimension=2,#donnés=400000
168
HLSH : Locality Sensitive
La fonction de
Hashing
change W
impact sur la
nombre des
bucket

- buckets => +
elements/buckets
Contexte : K=20, 20 nodes, 1 slot/nodes, file osm , dimension=2,#donnés=400000
169
HLSH : Locality Sensitive
L=1,M=2
accuracy(%)
0
12,5
25
37,5
50
time(s)
0
3000
6000
9000
12000
W
5000000 15000000
M=7,W=
5000000
accuracy(%)0
15
30
45
60
time(s)
0
1000
2000
3000
4000
L
1 2 4 6
L=1,W=
5000000
accuracy(%)
0
12,5
25
37,5
50
time(s)
0
2250
4500
6750
9000
M
2 6 14
Contexte : K=20, 8 nodes, 1 slot/nodes, file surf , dimension=128,#donnés=400000
170
HLSH : Locality Sensitive
RESUMONS
171
A chacun ses problèmes
HBKNNJ :

Basic
pas assez de parallèles,

trop de calcul
HBNLJ :

Bloc Nested
Loop
trop de replications,	 

trop de calcul inutiles
HVKNNJ:

Voronoi
beaucoup de
calcul,

et long pour HD
peut etre risqué si mauvais choix
de pivots
Mieux pr data disperse
HZKNNJ

Z-Value
precision pas stable pour #data	
très bon pour petite dimension
< 30

très mauvais pour HD
HLSH

Locality
Sensitive
Hashing
precision pas
stable pour K
grand
• difficultés des choix des
paramètres:

• depend de K
• depend du dataset
tres utile pour l'use case des
matching, car debase de
beaucoup de candidats
172
CONCLUSION
Expérimentations très difficiles, 

beaucoup de paramètres.

Aucun algorithme est meilleur que tous les
autres

dépendent du dataset
173
USE CASE
SIMILARITE ENTRE DES IMAGES
ALGORITHME : NEAREST NEIGHBORS RATIO
174
Les descripteurs ?
175
Calculer la similarité
176
Exemple :
177
Similarité entre les images
ETAPE 1:
calcul des des

matching

grace a nos
différents
algorithmes
ETAPE 2:
calcul des K
plus hauts
scores
images

S
Images

R
OUTPUT

les K images
similaires pour
chaque
images
178
Impact du nombre de données
time(sec)
0
3500
7000
10500
14000
#image/category
1 2 4 6 8 16
HBNLJ HVKNNJ HLSH
179
input
map reduce output
HVKNNJ : Hadoop Voronoi K Nearest Neighbors
JOB 3: KNN

assignation a
son groupe
KNN(r2,S)
p_r,r
g_r2,[r2, s1,s2…]
KNN(r5,S)
p_s,s
decide a quel
groupe de r s
doit etre
répliqu'e
ETAPE:
grouping
g_r1,[r5, s1,s2…]
180
hash,r1
hash,r2
S
R
hash,s3
hash,s2
hash,s1
statistique des 

buckets,

et suppression
des buckets
input map reduce output
hash,s1
hash,r1
hash,r2
hash,s2
hash,s3
HLSH : Hadoop Locality sensitive
JOB 1: hash et statistique

181
hash,r1
hash,r2
hash,s3
hash,s2
hash,s1
calcul du
partitionnement

des buckets
input map reduce output
knn
definit a quel
reducer le
hash va
calcul des
cKNN
HLSH : Hadoop Locality sensitive
JOB 1: calul des candidats

JOB 2 : calcul des KNN
calcul

knn
map reduce
cknn
output
182

Más contenido relacionado

La actualidad más candente

Lecture 24 support vector machine kernel
Lecture 24  support vector machine kernelLecture 24  support vector machine kernel
Lecture 24 support vector machine kernelMostafa El-Hosseini
 
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...Asma Ben Abacha
 
hg19 (GRCh37) vs. hg38 (GRCh38)
hg19 (GRCh37) vs. hg38 (GRCh38)hg19 (GRCh37) vs. hg38 (GRCh38)
hg19 (GRCh37) vs. hg38 (GRCh38)Shaojun Xie
 
データサイエンス概論第一=1-1 データとは
データサイエンス概論第一=1-1 データとはデータサイエンス概論第一=1-1 データとは
データサイエンス概論第一=1-1 データとはSeiichi Uchida
 
PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説弘毅 露崎
 
Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Grigory Sapunov
 
Intro to Biomedical Informatics 701
Intro to Biomedical Informatics 701 Intro to Biomedical Informatics 701
Intro to Biomedical Informatics 701 Chirag Patel
 
3D Gaussian Splatting
3D Gaussian Splatting3D Gaussian Splatting
3D Gaussian Splattingtaeseon ryu
 
大規模ネットワーク分析 篠田
大規模ネットワーク分析 篠田大規模ネットワーク分析 篠田
大規模ネットワーク分析 篠田Kosuke Shinoda
 
Trust and Recommender Systems
Trust and  Recommender SystemsTrust and  Recommender Systems
Trust and Recommender Systemszhayefei
 
14 データ収集とバイアス
14 データ収集とバイアス14 データ収集とバイアス
14 データ収集とバイアスSeiichi Uchida
 
Normalization of microarray
Normalization of microarrayNormalization of microarray
Normalization of microarray弘毅 露崎
 
Machine Learning in Chemistry: Part I
Machine Learning in Chemistry: Part IMachine Learning in Chemistry: Part I
Machine Learning in Chemistry: Part IJon Paul Janet
 
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learning
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learningベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learning
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learningssuserca2822
 
Semantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesSemantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesFellowship at Vodafone FutureLab
 
Geospatial Data Analysis and Visualization in Python
Geospatial Data Analysis and Visualization in PythonGeospatial Data Analysis and Visualization in Python
Geospatial Data Analysis and Visualization in PythonHalfdan Rump
 
MCMCと正規分布の推測
MCMCと正規分布の推測MCMCと正規分布の推測
MCMCと正規分布の推測Gen Fujita
 
GAN with Mathematics
GAN with MathematicsGAN with Mathematics
GAN with MathematicsHyeongmin Lee
 

La actualidad más candente (20)

Lecture 24 support vector machine kernel
Lecture 24  support vector machine kernelLecture 24  support vector machine kernel
Lecture 24 support vector machine kernel
 
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...
Multimodal Question Answering in the Medical Domain (CMU/LTI 2020) | Dr. Asma...
 
Network Science: Theory, Modeling and Applications
Network Science: Theory, Modeling and ApplicationsNetwork Science: Theory, Modeling and Applications
Network Science: Theory, Modeling and Applications
 
hg19 (GRCh37) vs. hg38 (GRCh38)
hg19 (GRCh37) vs. hg38 (GRCh38)hg19 (GRCh37) vs. hg38 (GRCh38)
hg19 (GRCh37) vs. hg38 (GRCh38)
 
データサイエンス概論第一=1-1 データとは
データサイエンス概論第一=1-1 データとはデータサイエンス概論第一=1-1 データとは
データサイエンス概論第一=1-1 データとは
 
PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説
 
Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016
 
Intro to Biomedical Informatics 701
Intro to Biomedical Informatics 701 Intro to Biomedical Informatics 701
Intro to Biomedical Informatics 701
 
3D Gaussian Splatting
3D Gaussian Splatting3D Gaussian Splatting
3D Gaussian Splatting
 
大規模ネットワーク分析 篠田
大規模ネットワーク分析 篠田大規模ネットワーク分析 篠田
大規模ネットワーク分析 篠田
 
Trust and Recommender Systems
Trust and  Recommender SystemsTrust and  Recommender Systems
Trust and Recommender Systems
 
14 データ収集とバイアス
14 データ収集とバイアス14 データ収集とバイアス
14 データ収集とバイアス
 
Normalization of microarray
Normalization of microarrayNormalization of microarray
Normalization of microarray
 
R seminar on igraph
R seminar on igraphR seminar on igraph
R seminar on igraph
 
Machine Learning in Chemistry: Part I
Machine Learning in Chemistry: Part IMachine Learning in Chemistry: Part I
Machine Learning in Chemistry: Part I
 
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learning
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learningベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learning
ベイズ深層学習5章 ニューラルネットワークのベイズ推論 Bayesian deep learning
 
Semantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network ApproachesSemantic segmentation with Convolutional Neural Network Approaches
Semantic segmentation with Convolutional Neural Network Approaches
 
Geospatial Data Analysis and Visualization in Python
Geospatial Data Analysis and Visualization in PythonGeospatial Data Analysis and Visualization in Python
Geospatial Data Analysis and Visualization in Python
 
MCMCと正規分布の推測
MCMCと正規分布の推測MCMCと正規分布の推測
MCMCと正規分布の推測
 
GAN with Mathematics
GAN with MathematicsGAN with Mathematics
GAN with Mathematics
 

Survey of different approaches for computing KNN on top of Map Reduce