An optimisation approach to the design of a fast, compact and distinctive binary descriptor

The desired local feature descriptor should be distinctive, compact and fast to compute and match. Therefore, many computer vision applications use binary keypoint descriptors instead of floating-point, rich techniques. In this paper, an optimisation approach to the design of a binary descriptor is proposed, in which the detected keypoint is described using several, scale-dependent patches. Each such patch is divided into disjoint blocks of pixels, and then, binary tests between blocks’ intensities, as well as their gradients, are used to obtain the binary string. Since the number of image patches and their relative sizes influence the descriptor creation pipeline, a simulated annealing algorithm is used to determine them, optimising recall and precision of keypoint matching. The simulated annealing is also used for dimensionality reduction in long binary strings. The proposed approach is extensively evaluated and compared with SIFT, SURF and BRIEF on public benchmarks. Obtained results show that the binary descriptor created using the resulted pipeline is faster to compute and yields comparable or better performance than the state-of-the-art descriptors under different image transformations.


Introduction
Recently, many computer vision applications for object recognition, tracking or scene reconstruction, have been using local feature descriptors. Such descriptors capture an image content that surrounds the detected keypoint and express it in the form of a vector. Feature descriptors with real-valued vectors produce the highest quality results, both in terms of robustness and performance, against a variety of image transformations. Scale-Invariant Feature Transform (SIFT) [1,2] and Speeded Up Robust Features (SURF) [3] approaches are such floating-point descriptors. However, their computation time is long. Also, high dimensionality of compared vectors has negative impact on the image matching time. Therefore, binary descriptors have become more attractive in recent years, since they are compact and faster to compare using Hamming metric. In most cases, handcrafted binary descriptors are obtained using pairwise tests between intensities of predefined parts of described image patch, i.e., pixels or regions according to a sampling pattern [4][5][6][7][8]. However, binary descriptors can be long, what requires an additional procedure for their reduction. The bit selection procedures use machine learning approaches [8][9][10] or optimisation [11,12].
In this paper, an approach to the design of the binary descriptor is proposed. In the approach, 3.5 M SURF keypoints were detected on 4000 transformed images. Then, a simulated annealing (SA) algorithm [13,14] determined a solution that maximised recall, as well as precision of keypoint matching. The solution consists of a set of image patches and their sizes. The patches are divided into disjoint pixel blocks. Finally, the binary string was created as a result of pairwise tests on intensities and gradients of blocks. Such binary string can be long; therefore, the SA was run in order to determine the most important 128 or 256 bits.
The main novelty of the proposed approach is the use of the SA for optimisation of parameters of the binary descriptor creation pipeline. The dimensionality reduction approach of the binary descriptor with this optimisation technique is also novel. The details of the descriptor and experimental results showing its promising performance are presented in the paper. SURF, SIFT and BRIEF [5] descriptors are evaluated for comparison.
The remaining part of the paper is organised as follows. Section 2 provides a presentation of the state-of-the-art approaches. A detailed description of the proposed method can be found in Sect. 3. Extensive evaluation of the descriptor on widely used image datasets is reported in Sect. 4. Section 5 concludes the paper.

Related work
A growing number of computer vision applications, incorporating different approaches to image content description, reveal a tendency to construct faster, and still maintaining desirable properties, solutions. Many of them are focused on interest point (keypoint) description [15][16][17][18]. Here, a keypoint is a meaningful pixel group which is repetitively detected in spite of different image transformations (e.g., illumination, viewpoint change, or rotation). SIFT [2] is the keypoint detector and the descriptor. This technique produces high-quality results, both in terms of robustness and performance against common image transformations. In SIFT, keypoints are found using difference of Gaussians applied in scale space. However, the keypoint detection approach present in SIFT requires time-consuming rescaling and smoothing of the image. Furthermore, high dimensionality of the descriptor (128 values) slows keypoint matching. Another, high-dimensional, real-valued descriptor that in some cases outperforms SIFT is SURF [3]. The method is based on SIFT, but it incorporates many simplifications reducing its complexity. In SURF, the orientation of the keypoint is extracted from a circular region with scale-dependant radius. The descriptor is created by union of vectors resulted from sums of horizontal and vertical Haar wavelet responses and their absolute values calculated for a square region centred at the keypoint. Here, the descriptor consists of 64 floating-point values.
In comparison with newly developed approaches, the performance of SIFT (and SURF) has not been significantly outperformed [18]. However, in order to speed up the keypoint description and to reduce the dimensionality of the descriptor, binary descriptors have been introduced. Most of them apply pairwise tests between intensities of image regions or pixels according to some sampling pattern. Intensity comparison makes these solutions robust to photometric changes. Binary Robust Invariant Scalable Keypoints (BRISK) [4] uses AGAST [19] corner detector to find keypoints; then, a circular pattern with equally spaced points is used in binary tests. In this technique, the orientation of the keypoint is estimated using local gradients between the sampling pairs. In Binary Robust Independent Elementary Features (BRIEF) [5], the binary vector is obtained in tests between the intensities of point pairs along the same lines. Points are selected randomly from an isotropic Gaussian distribution. Since it is not rotation invariant, Oriented FAST and Rotated BRIEF (ORB) [6] was developed. The sampling pairs in ORB are determined in a learning process involving a greedy algorithm working on 300 K keypoints, maximising the amount of information carried by the descriptor. Here, FAST [20] detects keypoints. The dominant orientation in ORB is obtained using the intensity centroid approach [21]. In spite of introduced improvements, ORB performs better than BRIEF only in presence of large rotation or scale change [17]. In Fast Retina Keypoint (FREAK) [7], the sampling pattern was inspired by the human visual system. Here, the learning process is similar to ORB's with additional rejection of correlated pairs. The orientation of the keypoint is estimated using local gradients of 45 sampling pairs. FREAK seems to be outperformed by other binary descriptors according to [22,23]. In recently developed Local Difference Binary (LDB) [8,11] descriptor, in turn, the image patch of a predefined size (e.g., 45 × 45, 50 × 50 pixels [11]) is divided into 4, 9, 16 and 25 square cells. Then, binary tests between values representing cells are applied. In this binary descriptor, gradients are compared, as well as cells' mean intensities. AdaBoost-based important bit selection method, working on 400 K patches from [24], is applied to produce 256 bit binary strings. The orientation of the keypoint is estimated using the intensity moments. In works [9,10], a supervised learning framework that finds low-dimensional descriptors is proposed. Here, the content of the image patch is modelled using local nonlinear filters that are selected with boosting. Boosting also helps in selection of the most important bits. In another approach [12], the descriptor design and its dimensionality reduction are formulated as convex optimisation problems involving separation of positive and negative patches. The solutions are found using support vector machine (SVM) solvers.

The approach
In the following subsections, the proposed binary descriptor is presented. At first, its design is formulated as an optimisation problem. Then, a simulated annealing algorithm is used to determine its creation pipeline. Finally, the simulated annealing is used for dimensionality reduction in long binary strings.

Optimisation problem
The proposed approach is partially inspired by Multiscale Block Local Binary Pattern (MBLBP) [25], in which authors propose to compare average intensities of neighbouring blocks of pixels in order to create a binary string. In MBLBP, three patches with 3×3, 9×9, and 15×15 pixels are divided into nine blocks (cells). MBLBP is a dense descriptor typically applied to all pixels in the image. Here, the binary string is created by concatenation of strings obtained for three patches. The pairwise tests are performed only between some cells. It is worth mentioning that BRISK descriptor was also inspired by the dense approach (DAISY [26]). MBLBP uses only three image patches, and their sizes are given in pixels. The similar limitation can be seen in [11]. The approach proposed in this paper follows the idea of nine cells (pixel blocks) for the image patch. Moreover, the number of image patches and their sizes for the pipeline of creation of the descriptor are found in optimisation experiments. The proposed solution also uses intensity gradients inspired by SURF.
The variability in the pipeline of the creation of the descriptor caused by the number of used patches and their size expressed in terms of relation between the length of patch's side and the kyepoint's scale, has led to the formulation of the following optimisation problem. In the problem, precision and recall of keypoint matching were maximised. At the beginning, a keypoint detector generates M i keypoints for an input image i, i = 1, . . . , N , where N denotes the number of input images. The keypoint K k i (K k i = 1, . . . , K M i i ) is described with the help of P image patches. Each patch p ( p = 1, . . . , P) has its keypoint's scale multiplier S p and nine square pixel blocks B j p , j = 1, . . . , 9. The S p determines the size of the patch, i.e., the patch's side in pixels is equal to S p multiplied by the keypoint's scale. The B 5 p -th block is centred at the keypoint's location (x, y). In order to create the binary descriptor, pairwise tests are performed between blocks' intensities. Such test returns true (1) if a difference of values is smaller than 0, and false (0), otherwise. Since blocks for the p-th patch have the same number of pixels, sums of their intensities (I (B j p )) can be compared. This solution is motivated by efficient calculation of such sums using the integral image technique [3,27]. Also, the firstorder intensity gradients in the x and y directions (D x (B j p ) and D y (B j p )) are computed using Haar-like box filters and the integral image, as in SURF [3]. Gradients for B j p -th block are obtained for its central pixel. The results of pairwise tests performed on gradients, in a form of the binary vector, are added to binary strings obtained for intensity I . Finally, for the p-th patch 108 binary tests are performed, and for the K k i -th keypoint 108P-bit string is obtained. Exemplary image patches and their division are presented on Fig. 1. The number of image patches P and multipliers S can be seen as decision variables in the optimisation problem.
Since precision and recall measures [17] reflect the quality of performance of a given local feature descriptor in image matching tests, they can be used as an objective function. Precision counts correctly matched pairs out of all returned matches, while recall, in turn, counts such pairs out of corresponding pairs. Higher values of both metrics are considered better; therefore, their multiplication was used as the objective function in the proposed approach.

Descriptor design using simulated annealing
The simulated annealing algorithm (SA) [13,14] F A is calculated as follows: where F C T expresses the difference between values of F C (x) and F C (x ). T is iteratively decreased, at the beginning causing that weaker solutions to have a higher chance to be accepted, i.e., if F A is larger than a randomly selected number in the range [0, 1), the solution x is accepted.
The problem of determination of the descriptor creation pipeline is solved using the SA, x in this case refers to finding P and S. For the important bit selection problem, or dimensionality reduction, the solution x takes a form of a binary vector indicating which bits are used while maximising F C (x) and reducing the descriptor's binary string to a given length (e.g., 128, 256 bits). F C is given as where P denotes precision, R recall, and i is the input image.
The G(x) function changes values in S p and adds or rejects the patch p. In the dimensionality reduction problem, G(x) selects a predefined number of the most important bits randomly changing information carried by x.
The choice of the SA was motivated by its simplicity, in terms of implementation, and the small number of parameters. Furthermore, the proposed objective function does not require a process of preparation of negative examples, as in approaches with SVM or boosting. Population-based optimisation algorithms (e.g., genetic, immune, or swarm) were also taken into consideration. They evaluate and reject many solutions in iterations, since each solution requires time (and memory)-consuming computation of the objective function; the SA seems to be a reasonable approach, providing acceptable results with fewer objective function calls.
Once P and S are obtained, K k i keypoints are generated by a keypoint detector on the input image i. It is assumed that the detector provides keypoints with scales. Then, the keypoints are described in the following manner:

Experiments
In the following subsections, experiments on the design of the pipeline for the creation of the descriptor and the most important bit selection are presented. Then, the resulting descriptor family is evaluated on public benchmarks.

Optimisation
For the design of the descriptor's pipeline, 1K images were randomly selected from 25 K MIRFLICKR dataset [28]. The dataset consists of images downloaded from the social photography site Flickr. They were rotated (90 • and 45 • ) and scaled (1/2 and 2/3). Then, 225 images from Phos dataset [29] were added to the resulting dataset. Phos contains 15 scenes captured under different illumination conditions (i.e., uniform and nonuniform). Each scene has selected one base image. It can be seen that the number of images being under different illumination changes is significantly smaller than rotated or scaled images. Since constructed binary descriptor uses pairwise intensity tests, it is, like other binary descriptors, robust against illumination changes. Therefore, this part of the learning dataset was smaller.
3,519,420 keypoints were detected by SURF on 5225 images, prior to the optimisation experiments. Integral images for the learning dataset, as well as lists of keypoints have large memory requirements, thus only one solution, x, was evaluated at a time, i.e., in terms of calculation of the objective function F c on used CPU with 16 GB RAM. The SA maximises F C (see Eq. (2)) which uses precision and recall metrics. For a given input image, precision was calculated as the number of correct matches, i.e., the number of corresponding pairs of keypoints between the base image and the distorted one, to the number of all returned pairs. The match was accepted if a distance ratio between the first and the second close described keypoint on the second image was below or equal a threshold of 0.8 [2,17] and the location of the keypoint on the second image was within three pixels from the expected location. The expected location of the keypoint was inferred using homography [17]. 4 K distorted images from MIRFLICKR were matched with the original 1 K images, and 15 reference images were selected from Phos for the same purpose. Since the dataset consists of 4210 pairs of images and used metrics have maximum value equal 1, the best (maximal) possible objective function value is 4210. This would indicate the case in which each detected keypoint was successfully matched. Due to image transformations, such large F c value was not likely to be found. The SA was run 30 times with T start = 1. The T was decreased using T next = 0.9T old in 100 iterations of the algorithm. The maximal possible number of patches P was set to 15, values of scale multipliers S p were selected in range 1 to 150 with step 1. Scale multipliers could be floating-point values but the use of integers significantly reduced the search space of the SA algorithm. Table 1 contains mean, maximal, minimal and standard deviation of the objective function of solutions obtained in experiments. The best binary descriptor was the input to the second optimisation problem of finding the most 128 or 256 important bits. The dimensionality of the binary vector was reduced since it affects the matching time and the storage cost. Parameters of the SA for the second problem remained unchanged. It can be seen, the obtained mean values are promising, and the results are characterised by small standard deviations. The best result (F C (x best ) = 2119.1) was obtained for the set of P = 12 patches with the following multipliers S p = [7,10,16,19,23,28,30,34,44,56,69,89]. This gives the descriptor with 1296 bits. For comparison, objective function calculated for SURF approach was equal to 1642.2; BRIEF obtained F C = 136.7 and SIFT 2889.6. SIFT used its own detector to generate keypoints, thus about half of the number of SURF keypoints were detected. The proposed descriptor using SIFT keypoints yielded F C = 2744.3. They seem to be more suitable, but in experiments previously detected SURF points remained, since their number was larger, making F C optimisation more difficult.
The creation of the descriptor using twelve patches can be time-consuming. Therefore, a simplified version of the descriptor was used. It contains only four patches (432 bits) with S p = [5,10,15,20], and obtained F C = 1683.9 with SURF keypoints.
SURF, SIFT and BRIEF were selected for comparison due to their high performance reported in many works. BRIEF (512 bit) is representative of binary descriptors, and its performance was confirmed in work [17], despite being not fully rotation and scale invariant. The proposed descriptor, since then called Optimised Binary Robust fAst Features (OBRAF), is represented by its three versions, with 1296, 256, 128-bit vectors (twelve patches) and simple 432-bit version with four patches (nonoptimised BRAF). For each image pair, about 1 K SURF keypoints were detected and described. SIFT generated similar number of keypoints and described them, since, in the spirit of fairness, SIFT descriptor should be coupled with its own detector. Keypoints were matched using the same protocol as in the experiments with the optimisation. For comparative analysis, precision and putative match ratio [17] were used. Precision of matching has a practical significance, since all returned pairs often undergo further processing, e.g., using RANSAC [30]. Putative match ratio (PMR) counts how many detected keypoints were returned as matched. This measure is influenced by the descriptor's ability to differentiate similar image regions, and could be understood as a measure of distinctiveness of the descriptor. In some cases, the keypoints can be detected close to each other. Figure 2 shows mean values of the precision and PMR results obtained for both datasets. For all 13 image sequences, OBRAF family of descriptors was better, in terms of precision values, than one of the compared floating-point descriptors. For the PMR metric, OBRAF descriptors were better than one of the floating-point counterparts for seven image sequences. BRIEF was outperformed by the other methods, even in tests without rotation and scale changes. The simplified version of the proposed descriptor, BRAF, in some cases performed better than SIFT or SURF. Since mean values were presented, the behaviour of the descriptors cannot be seen in the most difficult tests, i.e., when the metrics are evaluated for the last images in the sequences. Therefore, Recall versus 1-Precision curves obtained for the last images in sequences, considered as the most challenging, are shown on Fig. 3. Here, the proposed descriptor family achieved comparative or better performance than floatingpoint descriptors. In the Night and day sequence, BRIEF performed quite well, since it was designed for such transformation. Table 2 contains comparison of descriptor computation time. Since most descriptors in original works were computed on similar or faster machines using different numbers of keypoints, the table contains timings per keypoint. OBRAF is implemented in Java as a single-threaded appli-SIViP (2016) 10:1401-1408   [15] and Heinly et al. [17] datasets. Curves were obtained using the last image in a given image sequence. The name of the sequence is given above the curve, the pair of images is denoted as 1 : t, where t is the number of the last image, and 1 indicates the number of the reference image Results with were obtained in experiments reported in this paper (Java implementations), denotes an approach, in which the orientation of the keypoint is not estimated cation, and all presented experiments were run on Intel Core i7-2720QM 2.2 GHz, 16 GB of RAM, Microsoft Windows 7, and Java 8.0. Therefore, BoofCV [31] (Java) implementations of SIFT, SURF and BRIEF were used. SURF in BoofCV library is faster and produce better results than many widely used SURF implementations, e.g., OpenSurf, ETH or OpenCV [31]. It can be seen that OBRAF descriptor family obtained similar or better computation time than other descriptors. A simplified OBRAF version (BRAF), in which the dominant orientation is not estimated, is computed in 0.011 ms, 0.5 times faster than BRIEF that also does not incorporate this operation. It significantly outperforms other compared approaches. Cited descriptors were implemented in C++, and their computation time was mostly optimised. OBRAF's computation consists of many steps which are independent, e.g., each patch and each block within the patch can be processed independently what makes the descriptor easy to parallel. Therefore, some further improvements in shortening the computation time are expected. The matching time is strongly affected by the descriptor length, and binary vectors can be efficiently compared (Hamming distance) on modern CPUs using binary XOR and population count instructions. The state-of-the-art sparse binary descriptors are seldom shorter than 128 bits. Since 128 and 256-bit OBRAF versions yielded promising performance results, they would also offer the state-of-the-art matching time.

Conclusions
In this paper, a novel descriptor, OBRAF, is proposed as a result of an optimisation approach to the design of the descriptor creation pipeline. The SA algorithm was used to solve two problems. At first, it determined the number of patches and their sizes used for the description of the inter-est point. Then, the solution of the dimensionality reduction problem was found. In both cases, recall and precision of keypoint matching were used as the objective function. The obtained descriptor family was evaluated on two popular image datasets. Experimental results showed that OBRAF is faster than the state-of-the-art descriptors while maintaining comparable or better performance under different image transformations.