<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>RankReduce - Processing K-Nearest Neighbor Queries on Top of MapReduce∗</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Aleksandar Stupar</string-name>
          <email>astupar@mmci.uni-</email>
          <email>astupar@mmci.unisaarland.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sebastian Michel</string-name>
          <email>smichel@mmci.uni-</email>
          <email>smichel@mmci.unisaarland.de</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ralf Schenkel</string-name>
          <email>schenkel@mmci.uni-</email>
          <email>schenkel@mmci.unisaarland.de</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Saarland University</institution>
          ,
          <addr-line>Saarbrücken</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Saarland University</institution>
          ,
          <addr-line>Saarbrücken</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Saarland University</institution>
          ,
          <addr-line>Saarbrücken</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>13</fpage>
      <lpage>18</lpage>
      <abstract>
        <p>We consider the problem of processing K-Nearest Neighbor (KNN) queries over large datasets where the index is jointly maintained by a set of machines in a computing cluster. The proposed RankReduce approach uses locality sensitive hashing (LSH) together with a MapReduce implementation, which by design is a perfect match as the hashing principle of LSH can be smoothly integrated in the mapping phase of MapReduce. The LSH algorithm assigns similar objects to the same fragments in the distributed file system which enables a effective selection of potential candidate neighbors which get then reduced to the set of K-Nearest Neighbors. We address problems arising due to the different characteristics of MapReduce and LSH to achieve an efficient search process on the one hand and high LSH accuracy on the other hand. We discuss several pitfalls and detailed descriptions on how to circumvent these. We evaluate RankReduce using both synthetic data and a dataset obtained from Flickr.com demonstrating the suitability of the approach.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>
        With the success of the Web 2.0 and the wide spread usage
of cell phones and digital cameras, millions of pictures are
being taken and uploaded to portals like Facebook or Flickr
every day1, accumulating to billions of images2. Searching
in these huge amounts of images becomes a challenging task.
While there is an increasing trend to use social annotations,
so-called tags, for image retrieval, next to the traditional
image search `a la Google/Bing/Yahoo which inspects the text
around the web site holding the picture, there is a vital need
to process similarity queries, where for a given query
picture, the K most similar pictures are returned based on low
level features such as color, texture, and shape [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The big
advantage of such low level features is that they are always
Copyright c 2010 for the individual papers by the papers’ authors.
Copying permitted only for private and academic purposes. This volume is
published and copyrighted by its editors.
      </p>
      <p>
        LSDS-IR Workshop, July 2010. Geneva, Switzerland.
available, whereas tags are usually extremely scarce and text
around images can often be misleading. Approaches like the
work by Taneva et al. [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ] use both textual and low level
image descriptors to increase the diversity of returned query
results. There exist plenty of fundamental prior works [
        <xref ref-type="bibr" rid="ref16 ref4 ref5">16,
5, 4</xref>
        ] on how to index feature based representations of
pictures or, more generally, high dimensional vectors in a way
that allows for inspecting only a small subset of all vectors
to find the most similar ones.
      </p>
      <p>
        The increasing volume of high dimensional data, however,
poses novel problems to traditional indexing mechanisms
which usually assume an in-memory index or optimize for
local disk access. As a promising approach to process huge
amounts of data on a multitude of machines in a cluster,
MapReduce [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] has been proposed and continuously
explored for many interesting application classes. In this
paper, we investigate the usage of MapReduce for searching in
high dimensional data. Although MapReduce was initially
described in a generic and rather imprecise way in terms
of implementation, implementations like Apache’s Hadoop
have proven to provide salient properties such as scalability,
ease of use, and most notably robustness to node failures.
This provides an excellent base to explore MapReduce for its
suitability for large scale management of high dimensional
data.
      </p>
      <p>
        In this work, we propose RankReduce, an approach to
implement locality sensitive hashing (LSH) [
        <xref ref-type="bibr" rid="ref1 ref16 ref8">1, 8, 16</xref>
        ], an
established method for similarity search on high dimensional
data, on top of the highly reliable and scalable MapReduce
infrastructure. While this may seem to be straight forward
at first glance, it poses interesting challenges to the
integration: most of the time, we face different characteristics
of MapReduce and LSH which need to be harnessed both
at the same time to achieve both high accuracy and good
performance. As MapReduce is usually used only to process
large amounts of data in an offline fashion and not for query
processing, we carefully investigate its suitability to handle
user defined queries effectively demonstrating interesting
insights on how to tune LSH on top of MapReduce.
      </p>
      <p>The remainder of the paper is structured as follows.
Section 2 gives an overview of related work, Section 3 presents
our framework and gives a brief introduction to LSH and
MapReduce, Section 4 describes the way queries are
processed, Section 5 presents an experimental evaluation, and
Section 6 concludes the paper and gives an outlook on
ongoing work.</p>
    </sec>
    <sec id="sec-2">
      <title>RELATED WORK</title>
      <p>
        Processing K-Nearest Neighbor queries in high
dimensional data has received a lot of attention by researchers
in recent years. When the dimensionality increases the
distance between the closest and the farthest neighbor decreases
rapidly, for most of the datasets [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which is also known as
the ’curse of dimensionality’. This problem has a direct
impact on exact KNN queries processing based on tree
structures, such as X-Tree [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and K-D tree [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], rendering these
approaches applicable only to a rather small number of
dimensions. A better suitable approach for KNN processing
in high dimensions is Locality Sensitive Hashing (LSH) [
        <xref ref-type="bibr" rid="ref1 ref16 ref8">1,
8, 16</xref>
        ]. It is based on the application of locality
preserving hash functions which map, with high probability, close
points from the high dimensional space to the same hash
value (i.e., hash bucket). Being an approximate method,
the performance of LSH highly depends on accurate
parameter tuning [
        <xref ref-type="bibr" rid="ref12 ref3">12, 3</xref>
        ]. Work has also been done on decreasing
the number of hash tables used for LSH, while preserving
the precision, by probing multiple buckets per hash table
[
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. In recent years, a number of distributed solutions where
the main emphasis was put on exploring loosly coupled
distributed systems in form of Peer-to-Peer networks (P2P)
such as [
        <xref ref-type="bibr" rid="ref11 ref13 ref14 ref17 ref23">11, 13, 14, 17, 23</xref>
        ]) have been proposed, cf. the
work by Batko et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for a discussion on the suitablity of
different P2P approaches to distributed similarity search.
      </p>
      <p>
        MapReduce is a framework for efficient and fault tolerant
workload distribution in large clusters [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The
motivation behind the design and development of MapReduce has
been found in Information Retrieval with its many
computationally expensive, but embarrassingly parallel problems
on large datasets. One of the most basic of those
problems is the inverted index construction, described in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ].
MapReduce has not yet been utilized for distributed
processing of KNN queries. Some similarities with KNN processing
can be found in recent work by Rares et al. [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] which
describes a couple of approaches for computing set similarities
on textual documents, but it does not address the issue of
KNN query processing. The pairwise similarity is calculated
only for documents with the same prefixes (prefix filtering),
which can be considered as the LSH min-hashing technique.
Lin [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] describes a MapReduce based implementation of
pairwise similarity comparisons of text documents based on
an inverted index.
      </p>
    </sec>
    <sec id="sec-3">
      <title>RANKREDUCE FRAMEWORK</title>
      <p>We address the problem of processing K-Nearest Neighbor
queries in large datasets by implementing a distributed LSH
based index within the MapReduce Framework.</p>
      <p>An LSH based index uses locality sensitive hash functions
for indexing data. The salient property of these functions is
that they map, with high probability, similar objects
(represented in the d -dimensional vector space) to the same hash
bucket, i.e., related objects are more probable to have the
same hash value than distant ones. The actual indexing
builds several hash tables with different LSH functions to
increase the probability of collision for close points. At query
time, the KNN search is performed by hashing the query
point to one bucket per hash table and then to rank all
discovered objects in any of these buckets by their distance to
the query point. The closest K points are returned as the
final result.</p>
      <p>
        In this work, we consider the family of LSH functions
based on p-stable distributions [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] which are most suitable
for lp norms. In this case, for each data point v, the hashing
scheme considers k independent hash functions of the form
ha,B(v) = b
a · v + B
      </p>
      <p>W
c
(1)
where a is a d -dimensional vector whose elements are chosen
independently from a p-stable distribution, W ∈ IR, and B
is chosen uniformly from [0, W ]. Each hash function maps
a d-dimensional data point onto the set of integers. With k
such hash functions, the final result is a vector of length k
of the form g(v) = (ha1,B1 (v), ..., hak,Bk (v)).</p>
      <p>
        In order to achieve high search accuracy, multiple hash
tables need to be constructed. The work by Lv et al. [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]
presents an approach to probe multiple buckets per hash
table which, however, leads to either sampling a larger fraction
of the dataset or to many fine grained accesses to small
buckets. The latter causes a larger number of expensive random
accesses to the underlying infrastructure, as we deal with
file based indexes as opposed to in-memory accesses. Hence,
we opted for using a single probe per hash table.
      </p>
      <p>
        For maintaining the hash tables over a set of machines in a
cluster, we employ MapReduce [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] which is designed to be
used for large data processing in parallel. It is built on top of
the Distributed File System [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], which enables distributing
the data over the cluster machines in a scalable and fault
tolerant way. This tight integration of MapReduce with the
distributed file system enables it to move calculations where
the data resides, eliminating network bandwidth bottlenecks
caused by data shipping during query processing. Our
implementation uses the open source software Hadoop 3,
maintained by the Apache Foundation, which provides a Java
based implementation of both the MapReduce framework
and the Distributed File System (coined HDFS for Hadoop
Distributed File System). In the last years, Hadoop gained
a lot of popularity in the open source community and is
also part of many research efforts investigating large data
processing.
3http://hadoop.apache.org/
MapReduce is a fairly simple programming model, based
on two developer supplied functions: Map and Reduce. Both
functions are based on key-value pairs. The Map function
receives a key-value pair as input and emits multiple (or
none) key-value pairs as output. The output from all Map
functions is grouped by key, and for each such key, all values
are fed to the Reduce function, which then produces the final
output from these values.
      </p>
      <p>In the Hadoop implementation, the input data is grouped
in so-called input splits (which often correspond to blocks
in the distributed file system), and a number of so-called
mapper processes call the Map function for each key-value
pair in such an input split. A number of mappers can run
concurrently on each node in the cluster, and the mapper
processes are in addition distributed over all nodes in the
cluster. Ideally, a mapper is run on the same node where
the input block resides, but this is not always possible due
to workload imbalance. Similarly, after all mappers have
finished, dedicated reducer processes are run on nodes int
the cluster. Each reducer handles a fraction of the output
key space, copies those key-value pairs from all mappers’
outputs (in the so-called shuffle phase), sorts them by key,
and feeds the to the Reduce function. The output of the
reducers is usually considered the final result but can also
be used as input for following MapReduce jobs.</p>
      <p>Figure 1 shows an illustration of our LSH integration with
MapReduce. Each hash table in the LSH index is mapped
to one folder in HDFS. For each bucket in such a hash table,
a corresponding file is created in this folder, where the file
name is created by concatenating hash values into a string,
with ’ ’ as separator. This mapping of buckets to HDFS
files enables fast lookup at query time and ensures that only
data that is to be probed is read from the HDFS. Placing the
bucket in one file also enables block based sequential access
to all vectors in one bucket, which is very important as the
MapReduce framework is optimized for such block based
rather than random access processing. Each of the buckets
stores the complete feature vectors of all objects mapped to
this bucket in a binary encoding.</p>
      <p>Indexing of new feature vectors to the LSH index in HDFS
is easily done by appending them to the end of the
appropriate bucket file. This can also be done in parallel with
query processing as long as different buckets are affected; as
HDFS does not include a transaction mechanism, appending
entries to buckets that are being queried would be possible,
but with unclear semantics for running queries. As HDFS
scales well with increasing cluster size, the resulting growth
of the LSH index can easily be supported by adding more
machines to the cluster.</p>
      <p>While an LSH index stored in-memory has no
limitation on the number of buckets, too many files in HDFS
can downgrade its performance, especially if these files are
much smaller than the block size (which defaults to 64MB).
The number of buckets, and therefore the number of files in
HDFS for the LSH index, is highly dependent on the set up
of LSH parameters as choosing a bad combination of
parameters can result in a large number of small files.</p>
      <p>Inspired by in-memory indexes which can have references
from buckets to materialized feature vectors, we considered
storing only feature vector ids in the buckets instead of the
actual feature vectors, and retrieving the full vectors only
on demand at query time. However, this approach would
result in poor performance due to many random accesses to
the HDFS when retrieving the full vectors, so we decided
to store complete feature vectors. This fact also needs to
be addressed when setting up LSH parameters, while too
many LSH hash tables can dramatically increase index size,
as each feature vector is materialized for each hash table.
4.</p>
    </sec>
    <sec id="sec-4">
      <title>QUERY PROCESSING</title>
      <p>We implemented KNN query processing as a MapReduce
job. Before starting this MapReduce job, the hash values for
the query documents are calculated. These values are then
used for selecting the buckets from the LSH index, which are
to be probed. The selected buckets are provided as input to
the query processing MapReduce job, generating multiple
input splits. The generated input splits are read by a
custom implementation of the InputFormat class, which reads
feature vectors stored in a binary format and provides them
as the key part of the Map function input. Queries are being
distributed to mappers either by putting them in the
Distributed Cache or by putting them in HDFS file with high
number of replicas. They are read once by the
InputFormat implementation and reused as value part of the Map
function input between the function invocations.</p>
      <p>The input to the Map function consists therefore of the
feature vector to be probed as the key and the list of queries
as the value. The Map function computes the similarity
of the feature vector with all query vectors. While a
standard MapReduce implementation would now emit a result
pair for each combination of feature vector and query
vector, we employ an optimization that delays emitting results
until all feature vectors in the input split have been
processed. We then eventually emit the final K-Nearest
Neighbor for each query vector from this input split in the form
of key-value pairs. Here, the query is the key and a nearest
neighbor together with its distance to the query vector is the
value. To implement this delayed emitting, we store the
currently best K-Nearest Neighbor for each query in-memory,
together with their distances from the query points. The
results are emitted at the end of processing the input split in
Hadoop’s cleanup method4. The Reduce method then reads,
for each query, the K-Nearest Neighbor from each mapper,
sorts them by increasing distance, and emits the best K of
them as the final result for this query.</p>
      <p>The final sort in the reducer can even be executed within
Hadoop instead of inside the Reduce method, as a subtask of
sorting keys in the reducer. It is possible to apply a so-called
Secondary Sort that allows, in our application, to sort not
just the keys, but also the values for the same key.
Technically, this is implemented by replacing, for each (query,
(neighbor, distance)) tuple that is emitted by a mapper, the
key by a combined key consisting of the query and the
distance. Keys are then sorted lexicographically first by query
and then by distance. For assigning tuples to a Reduce
method, however, only the query part of the key is taken
into account. The reducer then only needs to read the first K
values for each key, which then correspond to the K-Nearest
Neighbor for that query.</p>
      <p>It is worth mentioning that because one feature vector
is placed in multiple hash tables, the same vector can be
evaluated twice for the same query during processing. An
4This feature was introduced in the most recent version 0.20;
before, it was only possible to emit directly from the Map
function
alternative approach would be to have two MapReduce jobs
for query processing instead of one, which would eliminate
this kind of redundancy. The first MapReduce job would
create a union between buckets that need to be probed, and
the second job would use the union as an input to similarity
search. However, while this would possibly save redundant
computations, it has the major drawback that the results
from the first job need to be written to the HDFS before
starting the second job. As the overhead from multiple
evaluations of the same feature vector has not been too large in
our experimental evaluation (see Figure 4), we decided that
it is better to probe slightly more data rather than to pay
the additional I/O cost incurred by using two Map Reduce
jobs.</p>
      <p>
        The approach can handle multiple queries at the same
time in one MapReduce job. But it is not suitable for the
cases when the number of queries becomes too large, as
problem of KNN queries processing becomes the problem of set
similarity joins [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
      </p>
    </sec>
    <sec id="sec-5">
      <title>EXPERIMENTAL EVALUATION</title>
      <p>For our experiments we have used Hadoop version 0.20.2
installed on three virtual machines with Debian GNU/Linux
5.0 (Kernel version: 2.6.30.10.1) as operating system. Each
of the virtual machines has been configured to have 200GB
hard drive, 5 GB main memory and two processors. VMware
Server version 2.0.2 was used for virtualization of all
machines. The virtual machines were run on a single machine
with Intel Xeon CPU E5530 @2.4 GHz, 48 GB main memory,
4 TB of hard drive and Microsoft Windows Server 2008 R2
x64 as operating system. We used a single machine Hadoop
installation on these virtual machines as described later on.</p>
    </sec>
    <sec id="sec-6">
      <title>Datasets</title>
      <p>
        As the performance of the LSH based index is highly
dependent on the data characteristics [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], we conducted an
experimental evaluation both on randomly generated
(Synthetic Dataset) and real world image data (Flickr Dataset):
      </p>
      <p>Synthetic Dataset:
For the synthetic dataset we used 32-dimensional randomly
generated vectors. The synthetic dataset was built by first
creating N independently generated vector instances drawn
from the normal distribution N (0, 1) (independently for each
dimension). Subsequently, we created m near duplicates for
each of the N vectors, leading to an overall dataset size of
m∗N vectors. The rational behind using the near duplicates
is that we make sure that the KNN retrieval is meaninful at
all. We set m to 10 in the experiments and adapt N to
the desired dataset size depending on the experiment. We
generated 50 queries by using the same procedure as the
original vectors were generated.</p>
      <p>
        Flickr Dataset:
We used the 64-dimensional color structure feature vectors
from crawled Flickr images provided by the CoPhIR data
collection [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] as our real image dataset. We extracted the
color structure feature vectors from the available MPEG-7
features and stored them in a binary format suitable for the
experiments. As the queries, we have randomly selected 50
images from the rest of the CoPhIR data collection
      </p>
      <p>As LSH is an approximate method, we measure the
effectiveness of the nearest neighbor search by its precision,
which is the relative overlap of the true K-Nearest
Neighbor with the K-Nearest Neighbor computed by our method.</p>
      <p>And for the proximity measure we used Euclidean distance.
5.1</p>
    </sec>
    <sec id="sec-7">
      <title>LSH Setup</title>
      <p>
        Before starting the evaluation we needed to understand
how to set up LSH and what consequence it may have on
the index size and query performance. In our setup we
consider the number of hash tables and the bucket size as LSH
parameters to be tuned. The bucket size can be changed
either by changing the number of concatenated hash values or
by changing the parameter W in Formula 1. Because W is a
continuous variable and provides a subtle control over bucket
size, we first fix the number of concatenated hash values and
then vary parameter W [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. These two parameters together
determine which subset of the data needs to be accessed to
answer a query (one bucket per hash table). We varied the
bucket size by varying parameter W for a different number
of hash tables and then measured data subset probed and
precision, shown in Figure 2 for synthetic dataset and in
Figure 3 for the Flickr dataset. These measurements were
done using 50 KNN queries for k = 20 on both datasets,
but with reduced sizes to 100,000 feature vectors indexed.
The results show that increasing the number of hash tables
can decrease the data subset that needs to be probed to
achieve a certain precision, resulting in less time needed for
the query execution.
      </p>
      <p>Realizing that each new table creates another copy of data
and we may have only limited storage available, we need to
tradeoff storage cost vs. execution time. Additionally, when
only a fixed subset of the data should be accessed, a larger
number of hash tables results in a large number of small
sized buckets, which is not a good scenario for HDFS (it
puts additional pressure on Hadoop’s data node that
manages all files). On one hand, we would like to increase the
number of hash tables and to decrease the probed data
subset. On the other hand, we would like to use less storage
space and a smaller number of files for storage and probing.
Figure 3 shows that the number of hash tables has smaller
impact on precision in case of real image data. Thus, as a
general rule we suggest a smaller number of hash tables with
larger bucket sizes, still set to satisfy the precision
threshold. Therefore we settle for a setup of four hash tables and
a bucket size that allow us to get at least 70% precision.
5.2</p>
    </sec>
    <sec id="sec-8">
      <title>Evaluation</title>
      <p>
        We evaluate our approach and compare it to the linear
scan over all data, also implemented as a MapReduce job.
As we did not have a real compute cluster at hand for
running the experiments, we simulate the execution in a large
cluster by running the mappers and reducers sequentially
on our small machine. We measure run times of their
executions and the number of mappers started for each query
job. To avoid the possible bottleneck of a shared hard drive
between virtual machines [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], we run each experiment on
a single machine Hadoop installation with one map task
allowed per task tracker. This results in sequential execution
of map tasks so there is no concurrent access to a shared
hard drive by multiple virtual machines.
      </p>
      <p>Considering that the workload for the reducers is really
small for both linear scan and LSH, we only evaluate map
execution times and the number of mappers run per query
job. We measured the map execution times for all jobs and
found that they are approximately constant, with average
value per mapper being 3.256 seconds and standard
deviaLSH characteristics [Generated Data]
LSH characteristics [Real Image Data]
tion of 1.702 seconds. Taking into account that each mapper
has an approximately same data input size, defined by the
HDFS’ block size, approximately constant mapper execution
time is well expected.</p>
    </sec>
    <sec id="sec-9">
      <title>Measures of Interest</title>
      <p>Because the execution time of the mappers is almost
constant, the load of a query execution can be represented as
number of mappers per query. We measured the number of
mappers per query and precision for 50 KNN queries, with
K=20, for both datasets, with 2GB, 4GB, and 8GB of
indexed data (∼4000, ∼8000, and ∼16000 feature vectors for
the real image dataset and ∼8000, ∼16000, and ∼32000
feature vectors for the synthetic dataset, respectively). The
number of mappers per query for synthetic dataset is shown
in Figure 5. And as we can see the number of mappers is
about 3 times smaller for LSH than for linear scan. Also we
can see in Figure 6, which shows the number of mappers per
query for the Flickr dataset, that the difference in the
number of mappers between LSH and linear scan is even bigger.
The number of mappers per query is 4 to 5 times smaller
for LSH than for linear scan in this case. The precision,
shown in Figure 7, for generated data is over the threshold
of 70% for 2GB and 4GB of indexed data, but drops down to
63.8% for 8GB. For real image data, the precision is almost
constant, varying slightly around 86%.</p>
    </sec>
    <sec id="sec-10">
      <title>CONCLUSION</title>
      <p>In this work we described RankReduce, an approach for
processing large amounts of data for K-Nearest Neighbor
(KNN) queries. Instead of dealing with standard issues in
distributed systems such as scalability and fault tolerance,
we implement our solution with MapReduce, which provides
these salient properties out of the box. The key idea of
the presented approach is to use Locality Sensitive Hashing
(LSH) in the Map phase of MapReduce to assign similar
objects to the same files in the underlying distributed file
system. While this seemed to be straight forward at first glance,
there was a nontrivial conflict of opposing criteria and
constraints caused by LSH and MapReduce which we had to
solve to achieve accurate results with an acceptable query
response time. We have demonstrated the suitability of our
approach using both a synthetic and a real world dataset.
100
90
80</p>
      <p>Our presented approach on large scale data processing is,
however, not limited to KNN search over images, but can
be extended to a variety of other interesting applications,
such as near duplicate detection, document classification, or
document clustering.</p>
      <p>As a first step in our future work plan to evaluate our
approach on a real compute cluster, which we are currently
building up, with large scale data in the order of several TB.
We furthermore plan to extend our approach to video and
music retrieval.
Map tasks per query [Generated Data]
LSH precision [Generated and Real Image Data]
140
120</p>
      <p>0
140
120
0</p>
      <p>LSH
Linear scan
2</p>
      <p>4
Indexed data size GB</p>
      <p>8
Map tasks per query [Real Image Data]</p>
      <p>LSH</p>
      <p>Linear scan
Generated data</p>
      <p>Picture data
4 5 6 7</p>
      <p>Indexed data size GB
Figure 7: LSH precision on generated and picture
data.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Alexandr</given-names>
            <surname>Andoni</surname>
          </string-name>
          and
          <string-name>
            <given-names>Piotr</given-names>
            <surname>Indyk</surname>
          </string-name>
          .
          <article-title>Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions</article-title>
          .
          <source>In FOCS</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Michal</given-names>
            <surname>Batko</surname>
          </string-name>
          , David Novak,
          <string-name>
            <given-names>Fabrizio</given-names>
            <surname>Falchi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Pavel</given-names>
            <surname>Zezula</surname>
          </string-name>
          .
          <article-title>Scalability comparison of peer-to-peer similarity search structures</article-title>
          .
          <source>Future Generation Comp. Syst.</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Mayank</given-names>
            <surname>Bawa</surname>
          </string-name>
          , Tyson Condie, and
          <string-name>
            <given-names>Prasanna</given-names>
            <surname>Ganesan</surname>
          </string-name>
          .
          <article-title>Lsh forest: self-tuning indexes for similarity search</article-title>
          .
          <source>In WWW</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Jon</given-names>
            <surname>Louis Bentley</surname>
          </string-name>
          .
          <article-title>K-d trees for semidynamic point sets</article-title>
          .
          <source>In Symposium on Computational Geometry</source>
          ,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Stefan</given-names>
            <surname>Berchtold</surname>
          </string-name>
          , Daniel A. Keim, and
          <string-name>
            <surname>Hans-Peter Kriegel</surname>
          </string-name>
          .
          <article-title>The x-tree : An index structure for high-dimensional data</article-title>
          .
          <source>In VLDB</source>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Kevin</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Beyer</surname>
            , Jonathan Goldstein, Raghu Ramakrishnan, and
            <given-names>Uri</given-names>
          </string-name>
          <string-name>
            <surname>Shaft</surname>
          </string-name>
          .
          <article-title>When is ”nearest neighbor” meaningful?</article-title>
          <source>In ICDT</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Paolo</given-names>
            <surname>Bolettieri</surname>
          </string-name>
          , Andrea Esuli, Fabrizio Falchi, Claudio Lucchese, Raffaele Perego, Tommaso Piccioli, and Fausto Rabitti.
          <article-title>CoPhIR: a test collection for content-based image retrieval</article-title>
          .
          <source>CoRR</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Mayur</given-names>
            <surname>Datar</surname>
          </string-name>
          , Nicole Immorlica, Piotr Indyk, and
          <string-name>
            <surname>Vahab</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Mirrokni</surname>
          </string-name>
          .
          <article-title>Locality-sensitive hashing scheme based on p-stable distributions</article-title>
          .
          <source>In Symposium on Computational Geometry</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Ritendra</given-names>
            <surname>Datta</surname>
          </string-name>
          , Dhiraj Joshi,
          <string-name>
            <given-names>Jia</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <article-title>and James Ze Wang</article-title>
          .
          <article-title>Image retrieval: Ideas, influences, and trends of the new age</article-title>
          .
          <source>ACM Comput. Surv.</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Jeffrey</given-names>
            <surname>Dean</surname>
          </string-name>
          and
          <string-name>
            <given-names>Sanjay</given-names>
            <surname>Ghemawat</surname>
          </string-name>
          . Mapreduce:
          <article-title>Simplified data processing on large clusters</article-title>
          .
          <source>In OSDI</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Vlastislav</given-names>
            <surname>Dohnal</surname>
          </string-name>
          and
          <string-name>
            <given-names>Pavel</given-names>
            <surname>Zezula</surname>
          </string-name>
          .
          <article-title>Similarity searching in structured and unstructured p2p networks</article-title>
          .
          <source>In QSHINE</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Wei</surname>
            <given-names>Dong</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Zhe</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>William</given-names>
            <surname>Josephson</surname>
          </string-name>
          ,
          <article-title>Moses 3 8 9 Charikar,</article-title>
          and
          <string-name>
            <given-names>Kai</given-names>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Modeling lsh for performance tuning</article-title>
          .
          <source>In CIKM</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Christos</surname>
            <given-names>Doulkeridis</given-names>
          </string-name>
          , Kjetil Nørv˚ag, and Michalis Vazirgiannis.
          <article-title>Peer-to-peer similarity search over widely distributed document collections</article-title>
          .
          <source>In LSDS-IR</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Fabrizio</surname>
            <given-names>Falchi</given-names>
          </string-name>
          , Claudio Gennaro, and
          <string-name>
            <given-names>Pavel</given-names>
            <surname>Zezula</surname>
          </string-name>
          .
          <article-title>A content-addressable network for similarity search in metric spaces</article-title>
          .
          <source>In DBISP2P</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Sanjay</surname>
            <given-names>Ghemawat</given-names>
          </string-name>
          , Howard Gobioff, and
          <string-name>
            <surname>Shun-Tak Leung</surname>
          </string-name>
          .
          <article-title>The google file system</article-title>
          .
          <source>SIGOPS Oper. Syst. Rev.</source>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Aristides</surname>
            <given-names>Gionis</given-names>
          </string-name>
          , Piotr Indyk, and
          <string-name>
            <given-names>Rajeev</given-names>
            <surname>Motwani</surname>
          </string-name>
          .
          <article-title>Similarity search in high dimensions via hashing</article-title>
          .
          <source>In VLDB</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Parisa</surname>
            <given-names>Haghani</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Michel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Karl</given-names>
            <surname>Aberer</surname>
          </string-name>
          .
          <article-title>Distributed similarity search in high dimensions using locality sensitive hashing</article-title>
          .
          <source>In EDBT</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Shadi</surname>
            <given-names>Ibrahim</given-names>
          </string-name>
          , Hai Jin, Lu Lu, Li Qi,
          <string-name>
            <surname>Song Wu</surname>
            , and
            <given-names>Xuanhua</given-names>
          </string-name>
          <string-name>
            <surname>Shi</surname>
          </string-name>
          .
          <article-title>Evaluating mapreduce on virtual machines: The hadoop case</article-title>
          .
          <source>In CloudCom</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Jimmy</surname>
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Lin</surname>
          </string-name>
          .
          <article-title>Brute force and indexed approaches to pairwise document similarity comparisons with mapreduce</article-title>
          .
          <source>In SIGIR</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>Qin</given-names>
            <surname>Lv</surname>
          </string-name>
          ,
          <string-name>
            <given-names>William</given-names>
            <surname>Josephson</surname>
          </string-name>
          , Zhe Wang,
          <string-name>
            <surname>Moses Charikar</surname>
            , and
            <given-names>Kai</given-names>
          </string-name>
          <string-name>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Multi-probe lsh: Efficient indexing for high-dimensional similarity search</article-title>
          .
          <source>In VLDB</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>Richard M. C. McCreadie</surname>
          </string-name>
          ,
          <string-name>
            <surname>Craig Macdonald</surname>
            , and
            <given-names>Iadh</given-names>
          </string-name>
          <string-name>
            <surname>Ounis</surname>
          </string-name>
          .
          <article-title>On single-pass indexing with mapreduce</article-title>
          .
          <source>In SIGIR</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <surname>Vernica</surname>
            <given-names>Rares</given-names>
          </string-name>
          , Carey Michael J.,
          <string-name>
            <given-names>and Li</given-names>
            <surname>Chen</surname>
          </string-name>
          .
          <article-title>Efficient parallel set-similarity joins using mapreduce</article-title>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <surname>Ozgur</surname>
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Sahin</surname>
          </string-name>
          , Fatih Emekc¸i, Divyakant Agrawal, and Amr El Abbadi.
          <article-title>Content-based similarity search over peer-to-peer systems</article-title>
          .
          <source>In DBISP2P</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <surname>Bilyana</surname>
            <given-names>Taneva</given-names>
          </string-name>
          , Mouna Kacimi, and
          <string-name>
            <given-names>Gerhard</given-names>
            <surname>Weikum</surname>
          </string-name>
          .
          <article-title>Gathering and ranking photos of named entities with high precision, high recall, and diversity</article-title>
          .
          <source>In WSDM</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>