Complexity

Volume 2018, Article ID 9671630, 12 pages

https://doi.org/10.1155/2018/9671630

## Approximately Nearest Neighborhood Image Search Using Unsupervised Hashing via Homogeneous Kernels

Shanghai Jiaotong University Electrical and Electronic Engineering College, Shanghai, China

Correspondence should be addressed to Jun-Yi Li; moc.361@6002yjeel

Received 5 April 2017; Revised 28 May 2017; Accepted 29 April 2018; Published 23 May 2018

Academic Editor: Dimitri Volchenkov

Copyright © 2018 Jun-Yi Li and Jian-Hua Li. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

We propose an approximation search algorithm that uses additive homogeneous kernel mapping to search for an image approximation based on kernelized locality-sensitive hashing. To address problems related to the unstable search accuracy of an unsupervised image hashing function and degradation of the search-time performance with increases in the number of hashing bits, we propose a method that combines additive explicit homogeneous kernel mapping and image feature histograms to construct a search algorithm based on a locality-sensitive hashing function. Moreover, to address the problem of semantic gaps caused by using image data that lack type information in semantic modeling, we describe an approximation searching algorithm based on the homogeneous kernel mapping of similarities between pairs of images and dissimilar constraint relationships. Our image search experiments confirmed that the proposed algorithm can construct a locality-sensitive hash function more accurately, thereby effectively improving the similarity search performance.

#### 1. Introduction

At present, the availability of visual data from the Internet is increasing rapidly, including scientific images, photo galleries from online communities, and news photo galleries. Thus, rapid content-based searches for images and videos in large databases are necessary. Nearest neighbor search is a prerequisite for image search, where the aim is to find examples with the highest similarity and to return the query result. In fact, query items can be obtained by brute force search based on the nearest neighbors in large databases, which is followed by similarity-based classification. However, brute force search will incur considerable costs if there are a large number of items or when the computational load of the similarity function is very large. Thus, in visual applications, the most effective method involves representing data in a structured form or mapping the data onto a high-dimensional space. However, in large-scale image search tasks, unsatisfactory results may be obtained in the high-dimensional space where the data structures are used for exact search. In addition to the conventional methods used for learning a distance metric to approximately guarantee linear time consumption, we need to develop appropriate distance metric methods based on specific constraint conditions. To address the problems of image data representation and distance metric learning methods, we must achieve a good balance between the applicability of an algorithm and its computational complexity. Thus, we propose a universal algorithm framework where nearest neighbors are searched rapidly using a homogeneous kernel map and metric learning.

Similarity search techniques have been developed to facilitate large-scale image searches, although sometimes at the expense of the accuracy of the predictions obtained [1–8], where the locality-sensitive hashing (LSH) algorithm is a typical example [9, 10]. In the LSH function, the query items must be within times the distance from the actual similar points, such as formula , and the number of queries has a linear relationship with the total number . The LSH function ensures a high probability of collision between similar examples. Several methods are now used for embedding binary hash codes into distance metric functions [1, 7], thereby allowing different types of image search, such as near-duplicate search, example-based target recognition, posture estimation, and feature matching.

Kernel functions have been used widely for image feature extraction and visualization. LSH function clusters are also important for searching similar targets. However, LSH and its variant functions cannot be embedded directly to search data with many powerful kernel functions, including those designed specifically for images. Therefore, the lack of high-performance fast search algorithms is problematic for flexible kernel functions. Some other problems that exist in LSH function clusters may be neglected. However, in image search and recognition tasks, the common problems are as follows.

(A) When kernel functions are introduced into LSH, the linear relationship between the original nearest neighbor search and LSH no longer applies. The kernel functions in video images are generally nonlinear, so it is necessary to solve the problem of applying nonlinear search to large-scale image classification. Recent studies [9] indicate that the training time for a support vector machine (SVM) has a linear relationship with the sample size. These methods can be extended to large-scale data sets, online learning, and structure learning. Nonlinear SVM can be regarded as a linear SVM operating in an appropriate feature space. Hence, at least theoretically, it is feasible to extend fast algorithms to more general models. Zheng and Ip [2] proposed sparse, intersection kernel feature maps that can increase the speed by 1000 times for an SVM classifier. Thus, we propose homogeneous kernel maps for roughly estimating all additive homogeneous kernels. In addition to the intersection kernels, Hellinger, Chi2, and Jensen-Shannon kernels are included. We combine these maps with the random Fourier features described by Xiong et al. [10], and we obtain a rough estimation of the Gaussian radial basis function (RBF) variants of the additive kernels [11]. In fact, these kernel functions are particularly suitable for data in a prior probability distribution or in the form of a normalized histogram, for example, a visual vocabulary bag [12] or spatial pyramid model [13–15].

(B) A workable distance metric learning function can accurately reflect the potential relationships between similar images, such as category tags or other hidden parameters, based on a small distance metric, whereas a larger distance metric can be used for unrelated images. However, a universal LP distance is not suitable for learning problems where the data representation is already given. Specific distance functions can be learned only by using metric learning algorithms with some given information, where they can be combined with nearest neighbor search to avoid direct exact search in a high-dimensional space.

The remainder of this paper is organized as follows.

First, we propose a kernelized LSH algorithm based on the explicit mapping of additive homogeneous kernels (HKLSH). The extracted feature histograms are then used for feature mapping in an explicit additive kernel space. After transformation, the feature vectors are used as the input feature vectors for KLSH. This method resolves the speed problem with nonlinear transformation in the kernel space using KLSH, as well as reducing the unstable performance caused by the locality sensitivity of LSH, and thus the search precision is improved.

Second, we describe a method for scalable image search based on metric learning, which uses a learned Mahalanobis distance function in approximate similarity search in order to capture the potential relationships between images. We discuss the embedding of metric learning parameters into LSH in order to guarantee the approach functions in linear time. Homogeneous feature maps are used to reduce the unstable performance caused by locality sensitivity and to increase the precision. Compared with conventional metric learning algorithms, the proposed method delivers more efficient search. Our experiments confirmed the higher precision and efficiency of the proposed method compared with other nearest neighbor search algorithms based on hash function. This method is particularly suitable for search in large databases.

#### 2. Image Classification Model Based on Homogeneous Kernel Scalable Hashing

##### 2.1. Analysis of Kernel Feature Maps

Kernel feature maps are usually constructed when processing low-dimensional, linear inseparable data. Thus, the data in a low-dimensional space are mapped onto a high-dimensional (Hilbert) space and denoted by , where represents

Bochner’s theorem (see (1)) can be used to calculate the feature maps for static kernels. In order to calculate the feature maps and obtain the feature maps for approximately homogeneous kernels, we use Bochner's theorem and extend it to a *γ*-homogeneous kernel. Moreover, all of the closed feature maps commonly used for homogeneous kernels can be obtained.

When the homogeneous kernel is a positive definite kernel [16], its signature is also an expression of a positive definite kernel. This lemma also applies to static kernels. By combining (1) and Bochner’s theorem, the approximate feature map of is constructed as given in

For most machine learning kernels, the kernel densities and approximate feature maps can be obtained in the same manner [17, 18].

Before calculating the feature maps of continuous kernels, we review Bochner’s theorem and static kernels.

* γ-Homogeneous Kernels*. For

*γ*-homogeneous kernel , a similar result is derived. Bochner's theorem is employed starting from (2):

We obtain the feature map:

##### 2.2. Feature Maps for Homogeneous Kernels

However, the feature maps described in Section 2.1 cannot be used directly because they are continuous functions where a low-dimensional or sparse approximation is required [19].

Feature maps for homogeneous/static kernels are derived from (4). The regular discrete feature maps are derived from (4). The simplified form is given and that for static kernels is as follows:

And that for a *γ*-homogeneous kernel is as follows:

##### 2.3. KLSH Based on Homogeneous Kernel Maps

KLSH is used to construct data connections. The basic principle of KLSH was introduced above [20]. In this section, we combine explicit homogeneous kernel maps with KLSH to establish the cost algorithm, as described in the following. Similar to LSH, the establishment of the hash function is also a major concern in KLSH. Thus, in order to calculate the collision probability between the input query items and database items, we must calculate the similarity between any two items in the database [20, 21].

According to previous studies [22, 23], the definition of the LSH function can be extended from (6) into the following form:

First, is constructed from a database subset. According to the central limit theorem, for some subset items chosen from the entire database , the kernel data samples must have mean and variance , which obey the normal distribution. Thus, the variable can be written as follows.

As the variable increases, the vector must obey the normal Gaussian distribution , which is obtained by the following whitening transform:

The LSH function is obtained as where

Using the formula derived for , the random hyperplane vector is obtained and it obeys the normal Gaussian distribution. After substituting (11) into , we obtain

The coefficient is omitted to obtain the simplified expression as (12), where is the unit vector in the database set . Thus, (13) is obtained for the hash function of the input kernel: where is the kernel map matrix of and in the space. After several iterations, we obtain the hash bucket.

Several iterations are performed for query matching in order to obtain the optimal parameters. Table 1 shows the algorithm known as LSH based on homogeneous kernel maps (HKLSH), where