CONCURRENCY AND COMPUTATION: PRACTICE AND EXPERIENCE Concurrency Computat.: Pract. Exper. (2016) Published online in Wiley Online Library (wileyonlinelibrary.com). DOI: 10.1002/cpe.3962 SPECIAL ISSUE PAPER Contextual Spaces Re-Ranking: accelerating the Re-sort Ranked Lists step on heterogeneous systems Flávia Pisani 1, * ,† , Daniel C. G. Pedronette 2 , Ricardo da S. Torres 1 and Edson Borin 1 1 Institute of Computing (IC), University of Campinas (UNICAMP), Campinas, SP, Brazil 2 Institute of Geosciences and Exact Sciences (IGCE), São Paulo State University (UNESP), Rio Claro, SP, Brazil SUMMARY Re-ranking algorithms have been proposed to improve the effectiveness of content-based image retrieval systems by exploiting contextual information encoded in distance measures and ranked lists. In this paper, we show how we improved the efficiency of one of these algorithms, called Contextual Spaces Re- Ranking (CSRR). One of our approaches consists in parallelizing the algorithm with OpenCL to use the central and graphics processing units of an accelerated processing unit. The other is to modify the algo- rithm to a version that, when compared with the original CSRR, not only reduces the total running time of our implementations by a median of 1:6but also increases the accuracy score in most of our test cases. Combining both parallelization and algorithm modification results in a median speedup of 5:4 from the original serial CSRR to the parallelized modified version. Different implementations for CSRR’s Re-sort Ranked Lists step were explored as well, providing insights into graphics processing unit sort- ing, the performance impact of image descriptors, and the trade-offs between effectiveness and efficiency. Copyright © 2016 John Wiley & Sons, Ltd. Received 12 February 2016; Revised 15 June 2016; Accepted 16 August 2016 KEY WORDS: parallelization; OpenCL; heterogeneous; CBIR; re-ranking; sorting algorithms 1. INTRODUCTION Due to a reduction in price of storage devices and the new technological advances that are being made in the field of data acquisition and sharing, we can observe a considerable increase in the size of image collections. As a result of that, the adoption of search systems becomes very impor- tant for users to be able to find images in these huge collections. Widespread retrieval approaches, such as the ones based on keywords and textual metadata, face serious challenges caused by the inherent difficulty in describing an image in words [1]. Furthermore, textual image description is an intrinsically time-consuming and laborious task, and it also depends on the subjective, and usually inconsistent, evaluation of annotators. Content-based image retrieval (CBIR) is a technology that mitigates this problem by providing automatic mechanisms for searching based on image visual properties (e.g., color, shape, and tex- ture). Given a query image, a CBIR system intends to retrieve similar items from the collection by using one or more content descriptors, which encode the visual properties of the images into feature *Correspondence to: Flávia Pisani, Institute of Computing (IC), University of Campinas (UNICAMP), Campinas, SP, Brazil. E-mail: fpisani@ic.unicamp.br This is an extended version of the paper ‘Improving the Performance of the Contextual Spaces Re-Ranking Algorithm on Heterogeneous Systems’, presented at the XVI Brazilian Symposium on High Performance Computational Systems (WSCAD’15). Copyright © 2016 John Wiley & Sons, Ltd.