{'fraction_non_alphanumeric': 0.026994278020868394, 'fraction_numerical': 0.009693705822955234, 'mean_word_length': 4.8474709702814405, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Benchmark Comparison of Visual Place Recognition Techniques for Resource-Constrained Embedded Platforms

Visual Place Recognition (VPR) has been a subject of significant research over the last 15 to 20 years. VPR is a fundamental task for autonomous navigation as it enables self-localization within an environment. Although robots are often equipped with resource-constrained hardware, the computational requirements of and effects on VPR techniques have received little attention. In this work, we present a hardware-focused benchmark evaluation of a number of state-of-the-art VPR techniques on public datasets. We consider popular single board computers, including ODroid, UP and Raspberry Pi 3, in addition to a commodity desktop and laptop for reference. We present our analysis based on several key metrics, including place-matching accuracy, image encoding time, descriptor matching time and memory needs. Key questions addressed include: (1) How does the performance accuracy of a VPR technique change with processor architecture? (2) How does power consumption vary for different VPR techniques and embedded platforms? (3) How much does descriptor size matter in comparison to today's embedded platforms' storage? (4) How does the performance of a high-end platform relate to an on-board low-end embedded platform for VPR? The extensive analysis and results in this work serve not only as a benchmark for the VPR community, but also provide useful insights for real-world adoption of VPR applications.


I. INTRODUCTION
Recalling a previously visited place using only visual information has become a subject of interest within the robotic vision community and therefore Visual Place Recognition (VPR) has developed as a dedicated field within autonomous robotics over the past 15 years [1]. VPR is a key part of many processes, including Simultaneous Localisation and Mapping (SLAM) [2]. VPR is a challenging task to perform accurately and consistently. A VPR system must be able to correctly identify whether, given an image, the location has been visited before, and be able to correctly identify and handle false positive results. In addition, to be useful in autonomous navigation, a VPR system must be able to run in real-time [3]. There are many factors that can affect VPR. External factors include various appearance and viewpoint variations. Whereas internal factors are usually due to architecture or platform, and as such can include factors such as computational power and memory capacity.
Over the years, many techniques have been developed to tackle the deficiencies of VPR. Many of these techniques were designed to address one of the individual or a combination of problems. It is often useful to compare these VPR techniques to discern which technique is most suited to a specific task or situation. Several works compare different VPR techniques [4] [5]. Hulens et al. works to produce an overview of the best CPU-based processing platforms for complex image processing on-board a UAV [6]. However, the subject of implementing and comparing VPR on resource constrained embedded platforms, which is potentially very useful for the application on VPR onboard small unmanned aerial vehicles, is relatively unexplored. This research compares the performance of several state-of-the-art VPR techniques when implemented on a number of popular embedded platforms. The effects that a resource-constrained platform can have on a variety of VPR techniques will be explored, including the clear variation discovered in board architectures and difference in CPU utilization between embedded and non-embedded platforms, which will be discussed later in this paper.
The remainder of the paper is organized as follows. In Section II, a comprehensive literature review regarding the VPR state-of-the-art and the existing evaluation-based works is presented. Section III presents the details of the experimental setup designed for the evaluation performed in this work. Section IV puts forth the results and analysis obtained by evaluating contemporary VPR techniques on public VPR datasets for a number of hardware platforms. Finally, conclusions and future directions are presented in Section V.

II. LITERATURE REVIEW A. VPR Techniques
VPR generally works by extracting feature descriptors of a reference image and a query image, either local or global depending on method type, and comparing these descriptors to determine whether a match between reference and query image is successful. The method of the comparison of feature descriptors is determined by the VPR technique in use. Some of the early techniques employed for VPR made use of handcrafted high-quality feature descriptors such as SURF [7] and SIFT [8]. These handcrafted feature descriptors are classified as either local or global feature descriptors. SIFT [8] makes use of key points extracted from an image using difference-of-gaussians. SIFT features were used for VPR in [9]. SURF [7] is a modified version of SIFT. It makes use of Hessian-based detectors as opposed to Harris detectors like traditional SIFT. SURF features were used for VPR in [10]. SIFT and SURF are examples of local image descriptors. Contrary, Gist [11] is a global feature detector that employs Gabor filters to summarise gradient information from an image. Gist was used for image matching in [12] and [13].
Histogram-of-orientated-gradients (HOG) [14] [15] is a computer vision descriptor that makes use of gradients that are stored in a histogram and is often used as global descriptors. HOG was used for VPR in [16]. More recently, CoHOG [17] was designed to make use of HOG [14] [15] descriptors to represent regions of interest. CoHOG was designed to achieve lateral viewpoint tolerance.
Much like other applications [18] [19], the use of convolutional neural networks (CNNs), convolution auto-encoders (CAEs) and deep/shallow neural nets has demonstrated superior results for VPR than those achieved by handcrafted feature-based approaches. The use of neural networks was studied in [20] where a pre-trained CNN was used to extract features from layers of an input image. These features were then used for image comparison in [21]. Following this the authors of [20] trained two CNNs for VPR on the specific places dataset (SPED) in [22]. Both of theses CNNs, AMOSNet and HybridNet, achieved state-of-theart performance. In addition, both CNNs have the same architecture as CaffeNet [23]. However, where the weights used for AMOSNet are randomised, the weights used for HybridNet are taken from CaffeNet trained on the ImageNet dataset [24].
The design of CNN layer activations is also something that has been extensively studied, specifically pooling approaches that are employed on convolution layers. Such pooling approaches include; Max-Pooling [18], Cross-Pooling [19], Sum-Pooling [25] and Spatial Max-Pooling [26].
A Vectors of Locally Aggregated Descriptors (VLAD) layer was added to CNN architecture in [27], to allow for end-to-end training specifically for use in VPR. This new VLAD layer was implemented in several different CNN models, including AlexNet [23] and VGG-16 [28].
It has been suggested using regions-based descriptions of images could increase the matching performance of VPR [29] [30] [31] [32]. A CNN-based regional approach with a VLAD layer, RegionVLAD, was implemented in [30].

B. Benchmarking
Benchmark efforts have a significant impact on the understanding of a model's usability within the target application. In terms of resource-constrained embedded platforms the most prominent benchmarks are power consumption, memory utilization and CPU utilisation.
Canziani et al. [33] conducted an analysis of several deep neural network (DNN) architectures. They recorded accuracy, power consumption and memory footprint, as well as the number of parameters and operations count for computer vision tasks. The experimentation was carried out on an NVIDIA Jetson TX1 board. Huang et al. take a similar approach in their exploration of the speed/accuracy tradeoff of full image classification in [34]. Additionally, they compare performance of an Intel Xeon CPU and a NVIDIA Titan X GPU.
TANGO [35] employs the metrics of inference time, power consumption and memory usage to access CNN models implemented on a variety of hardware platforms including an embedded GPU and a FPGA. Palit et al. [36] highlight the importance of energy usage by presenting an energy estimation model and empirical data from several CNNs.
The authors in [37] show that CPU utilization of running processes is directly related to the power consumption of a CPU. Over extended periods of time, this power consumption becomes a significant factor, especially in battery powered UAVs. This work is extended upon by Zaffar et al. [5], who investigate the accuracy, processing power consumption and projected memory requirements of several state-of-the-art VPR techniques. The range evaluated includes both CNNbased and feature-based techniques.
While accuracy, power consumption and memory requirements as studied in this paper have been looked into before, the effect of platform architecture on these measurements when performing VPR has not. In addition, little has been done in benchmarking the potential real-time usefulness of different VPR techniques, as such we work to present a benchmark for this with the introduction of Real-Time Matches Frames (RMF).

III. EXPERIMENTAL SETUP
This section details the computational platforms evaluated, the datasets that are used for the evaluation and the metrics used for evaluation.

A. VPR Techniques
The experiments in this paper are carried out on a selection of VPR techniques, as a representation of a variety of technique classes. HOG and CoHOG are trainingless handcrafted feature-based approaches. HybridNet and RegionVLAD each use a CNN as an image feature extractor. Additionally, CALC utilizes an auto-encoder to extract image features.
1) HOG: Histogram-of-orientated gradients (HOG) [14] [15] is one of the most widely used VPR techniques that uses hand-crafted feature descriptors. This technique calculates a gradient for every pixel in an image and organises these gradients into the bins of a histogram. These bins will contain the sum of the gradient magnitudes. The technique then uses the cosine function to compare the query and reference images. For our implementation of HOG, we use a cell size of 8 × 8, a block size of 16 × 16, and total of 9 histogram bins as suggested by the authors in [4]. 2) CoHOG: CoHOG [17] uses handcrafted feature-based technique that uses image-entropy to extract regions of interest. HOG [14] [15] descriptors are then assigned to represent each region and the regional descriptors are compared using cosine matching to achieve lateral viewpoint tolerance. One of the inspirations behind this technique was CNN-based techniques' ability to extract regions of interest. CoHOG was developed to achieve state-of-the-art performance without any training requirements, unlike traditional CNN-based techniques.
3) HybridNet: HybridNet was trained on the Specific Places Dataset (SPED), and the model weights of the top 5 HybridNet convolutional layers are initialised from CaffeNet trained on the ImageNet dataset. Our implementation employs a spatial pyramidal pooling on activations from conv5 layer to form feature descriptors. L1-difference is then used to match the query and reference images. 4) RegionVLAD: Region-VLAD [30] uses a lightweight CNN-based regional approach, as well as VLAD, to overcome the practical deployment limitations of traditional CNNs used for VPR, due to their computational complexity and significant memory overhead. For our implementation we employ the convolutional layer conv4 of HybridNet, along with 400 region of interests (ROIs). A 256 visual word dictionary is used to extract VLAD descriptors and cosinesimilarity is used to match query and reference images. 5) CALC: CALC was first introduced by Merrill et al. when they trained an autoencoder in an unsupervised manner for the first-time for use in VPR. The objective of the auto-encoder was to re-create the HOG descriptors of an image, when given a distorted version the image. For our implementation we use model parameters from the 100K iteration of the auto-encoder on the Places dataset [38].

B. Computational Platforms
The experiments in this paper are carried out on a selection of platforms, listed in Table III. 1) UP-CHT01-A20-0464-A11 [39]: The UP board is marketed as a high performance board with low power consumption. It has a quad-core Atom x5-z8350 processor running at up to 1.92GHz. The UP board is the only board used in this paper that has an Intel processor, like the desktop and laptop standards.
2) Raspberry Pi 3 Model B [40]: The Raspberry Pi used in this paper has a quad-core ARM processor with arm64 architecture with 1GB RAM and 100MB of swap. Swap space was increased to 2GB to satisfy the memory demands of the various VPR techniques used in our experiment. It should be noted however, that increasing the size of the swap greatly increases the time taken for computation.
3) ODROID XU4 [41]: The Odroid board used in our study had 1GB RAM and no swap as default. Similarly to the Raspberry Pi swap space was increased to 2GB. The Odroid board is the only embedded platform that has a fan. The fan fires periodically causing a surge in power consumption. While it is possible to disconnect the fan, for the sake of not damaging the board during the course of these experiments, the fan was kept attached.

4) Laptop:
This platform is a DELL XPS 13 9380. It has an Intel(R) Core i7-8565U CPU, operating at 1.99GHz, and 16GB of RAM. Due to its large size, weight and power requirements, it is not feasible to use as an embedded platform. As such, it is only included as a reference for the other embedded platforms.

5) Desktop:
A desktop computer was included as an additional reference platform. This desktop had an AMD RYZEN 1400 Quad-Core Processor, operating at 3.20 GHz, and 32GB of RAM.

C. Evaluation Datasets
There have been many datasets created for the purpose of testing VPR. In this subsection we will introduce the datasets used to test the techniques and platforms introduced in subsection III-A and subsection III-B.
1) Garden Point Walking [42]: This dataset was created at the Queensland University of Technology and displays both illumination and viewpoint variation, as well as dynamic objects making it a challenging dataset.
2) Campus Loop [43]: The campus loop dataset was created from a sequence of indoors and outdoors images of a campus environment. Whilst the images captured indoors do not present great seasonal variation, the image captured outside present significant seasonal and some illumination variation. In addition, the images also contain viewpoint variation and dynamic objects.
3) ESSSEX3IN1 [44]: The ESSEX3IN1 dataset was created to provide both viewpoint and appearance variation. The dataset contains images that are confusing for VPR techniques, with challenging dynamic objects and uninformative scenes, causing most state-of-the-art techniques to struggle.

1) Matching Performance:
The image with the highest matching score extracted from the mapped reference dataset should correspond to the query image of the same location. As such, a match is determined as correct if, given a query image, the technique assigns the corresponding reference image the highest similarity score, determined for each technique as described in the corresponding experimental setup in section III, of every possible image. Determining the percentage of correctly matched images for each of the datasets used will give the accuracy of each VPR technique.
2) Algorithm Efficiency: In this paper we also evaluate the efficiency of each technique used is evaluated by measuring the CPU usage, memory usage and processing time of each technique. CPU usage and memory usage are reported as a percentage. Memory usage is measured as the percentage of active memory out of total memory. In addition, we record processing time, which is reported in seconds. This includes the feature encoding time for an input query image, as well as the descriptor matching time for the number of reference images in the dataset, image loading and preprocessing. In order to benchmark the platforms accurately the images were loaded from a dataset. In real-world applications, the images would be acquired from a camera in real-time.
3) Power Consumption: In addition to evaluating the precision-recall of the techniques produced by each board, the power consumption of each board was measured using a setup of a INA260 module [45] monitored by an additional Raspberry Pi, the confuguration of which is shown in figure  2. This gave an indication of the power consumption over the course of encoding and matching images. In the configurations tested, the power consumption of each technique was measured whilst encoding and matching each image in the query dataset in turn.

4) Real-Time Matched Frames (RMF):
In a real-time scenario, cameras can provide up to 50 images per second. While this is useful, if the VPR algorithm implemented cannot process images as fast as a camera can provide them, then a decision must be made between processing the next image provided or the image provided at the time. As such an algorithm with high accuracy but also high computational time may be less effective in a real-time scenario than an algorithm with low accuracy and low computational time.
In this paper we aim to provide a benchmark allowing for the evaluation of algorithms with a view to real-world, realtime VPR. The proposal of our paper is that the critical ratio of incoming frame rate and VPR frame rate will determine if a particular VPR algorithm will perform well in a real-world environment.
Let the frames per second (FPS) sampling rate of the camera be F, which is usually a fixed value. Let the frames sample per distance be D and the platform speed be V. Then the incoming frame rate from the platforms vision sensor can be computed as: Where K is a unit-less constant that represents any further down-sampling cause by the vision pipeline. The VPR frame rate (potential place matched per second) can also be calcu- lated as shown in equation 2, where t R is the retrieval time.
The ratio is denoted as G as shown in equation 3 and the maximum possible value of G is 1. This is given that the maximum number of VPR query images matched can only must be equal to the total incoming images. Please note that our modelling of Incoming Frame Rate is one traversalspecific. In addition, the Incoming Frame Rate can also be an explicit specification from either the computer vision or a robotics VPR application.
Given the ratio G, a VPR technique will only be able to perform VPR for a query frame after some constant frame interval based on G. The total correctly matched query images in a VPR dataset at the maximum value of recall can be denoted as M q out of a total of N q query images in the dataset. Based on the prospective loss of potential place matching candidates for a slow VPR technique due to G > 1, the number of total matched query images will reduce to Real-time Matched Frames (RMF) out of a total of N q query images. This RMF can be interpreted as an active evaluation metric and we compute this RMF using Algorithm 1.

IV. RESULTS AND ANALYSIS
This section contains results based on all evaluation metrics for all computational platforms.

A. Accuracy
This sub-section reports the findings of the matching performance of each technique on all three datasets used for testing as shown in figure 3.
As part of our findings, we discovered that the Raspberry Pi and Odroid produced the same results in terms of accuracy for each VPR technique. Conversely, the UP board, laptop and desktop platforms all produced the same results in terms of accuracy as well. This is likely due to the fact that both the Odroid and Raspberry Pi platforms use ARM processors, having arm64 or armhf architecture, and the UP board, laptop and desktop use Intel Atom, Intel i7 and AMD Ryzen 5 processors respectively, all sharing the x86_64 architecture. Ubuntu 18 operating system was used across all platforms. Apart from architecture type, the only difference in OS is that the raspberry Pi uses a 32-bit OS, however it produced they same accuracy as the Odroid board which used a 64bit OS and had the same ARM architecture suggesting that the difference in 32-bit, 64-bit systems does not have a significant affect on the accuracy of the techniques. The running environments were kept the same for each platform using the same version of Python and additional libraries, with the only difference being when a specific version had to be built for ARM architecture as opposed to the standard x86_64 architecture.

B. Algorithm Efficiency
This sub-section reports the findings of the algorithm efficiency of each platform and technique as performed on all three datasets used for testing.
1) CPU Usage: In terms of CPU usage each platform and technique combination only displayed slight variation between datasets as shown in table II.
The laptop displayed the highest CPU utilisation by far, using roughly 100% of the CPU's capacity for all techniques. In comparison, the Ordoid and Raspberry Pi platforms had very low CPU utilisation for all techniques, using between 15-30% of their respective CPU's capacity. In addition, the UP board has relatively low CPU utilisation for all techniques except for CoHOG, which uses an average of 80% of its CPU's capacity to perform. The desktop also displayed a high CPU usage when running CoHOG and CALC, but had a relatively low CPU usage for the remaining techniques.
The embedded platforms demonstrated low CPU utilisation at times. This is likely due to their limited memory and consequent need to page to relatively slow SD card storage. This was not exhibited by the non-embedded platforms, that had enough memory to not require paging. Whilst the need to page caused a slight increase in the computational time, it suggests that potentially a more computationally complex algorithm could be run on the embedded platforms with similar success, given a larger memory capacity.
2) Memory Usage: Trends in memory utilization are difficult to identify due to variation in image resolution between datasets, the amount of memory each board has and the technique used, as shown by the results in table II. During the experiments in this paper the images were loaded one at a time for processing to cut down on memory consumption given the limited memory capacity of the embedded platforms. As such, no more than one image from the dataset is stored in memory at any given time. Memory utilisation appears also to be affected by platform architecture.
The ARM architecture platforms utilised the least memory, however this is likely due to the resized and compressed nature of the datasets, required to make the algorithms run on those platforms. It can be speculated that the memory utilisation of the x86 platforms would be similarly low if given the same compressed images.
3) Processing Time: As expected, the laptop and desktop had a much shorter processing time than any of the embedded platforms. In general, all platforms and techniques took slightly longer when tested with the ESSEX3IN1 dataset, as shown in table II, likely due to the uninformative images in this dataset. However, the results are similar across all datasets.
The Raspberry Pi took the longest on all three datasets to complete RegionVLAD, taking over double the time of the next platform. However, in contrast, the Pi had the shortest processing time for HybridNet across all datasets. Despite this the processing time for HybridNet was significantly longer than the other techniques regardless of platform. UP had by far the shortest processing time using CoHOG, greatly out-performing the other embedded platforms in terms of processing time.
All platforms perform well using both CALC and HOG with the shortest processing times of all the techniques.

C. Power Consumption
This sub-section reports the findings of the power consumption of each technique on all three of the embedded platforms used for testing as shown in figure 4.
The Raspberry Pi showed a clear superiority with both low power consumption and relatively low computation time despite being constrained by RAM limitations and having to use swap space on the micro-SD card. This low power consumption is likely due to having an ARM processor and no active cooling unit. In comparison the Odroid board consistently demonstrated the highest power consumption per unit time of the three embedded platforms at least partially due to its active cooling unit. This comparatively high-power consumption makes for an unfavourable tradeoff between computation time and power consumption. The Odroid board also suffered from RAM limitations, resulting in paging to the micro-SD. The UP board had a relatively low power consumption per unit time but took the longest on most techniques. Despite taking the longest time for most methods, this is not significant, giving the board an acceptable trade-off between computation time and power consumption. Despite the slightly longer computation time, the UP board was less constrained by RAM than the other embedded platforms.

D. Real-Time Matched Frames (RMF)
Overall, CALC managed to successful match the most frames across all platforms and datasets, as presented by the graphs in figure 1, often greatly out-performing the other techniques. Out of all platforms, the laptop demonstrated the highest number of successfully matched frames within the real-time constraints, above that of the Desktop described in this paper, despite a supposedly inferior CPU and Memory capacity.
1) Campus Loop: Across all platforms, CALC correctly matched the most frames within the real-time constraints greatly out-performing all the other techniques. Region-VLAD and CoHOG perform relatively consistently across all platforms, albeit quite poorly. The remaining techniques also perform relatively poorly on the Desktop and Laptop platforms however their performance drops when performed on the embedded platforms.
2) ESSEX3IN1: Similarly, to the campus dataset, CALC performs the best on the Desktop, Laptop and Odroid platforms, however on the remaining two platforms CALC has a similar performance as all the other VPR techniques. The other techniques all perform similarly poorly across all platforms.
3) GardensPointWalking: Similar to the other two datasets, CALC again performs the best on all platforms, save for the Raspberry Pi. Aside from RegionVLAD which demonstrates a relatively consistent performance, the remaining techniques struggle greatly on the embedded platforms, unable to successfully match any frames within the real-time constraints.
V. CONCLUSIONS AND FUTURE WORK As expected, the overall performance of the high-end platforms was greater than those of the embedded platforms. However, the embedded platforms' ability to match the accuracy of the high-end platforms indicates good potential for future use in the field of VPR. Out of the three embedded platforms assessed the Raspberry Pi showed clear superiority, with the lowest power consumption, good processing time and similar accuracy to the high-end platforms. Apart from the UP platform, the embedded platforms struggled with descriptor size until additional swap space was added, when performance was acceptable. Descriptor size will become less of a problem as embedded platform's memory capacity increases.
In terms of power consumption, the Raspberry Pi and Odroid platforms showed the same trends in power consumption per technique, with the most power consumed when using CALC and the least when using RegionVLAD. On the other hand, when the techniques were run on the UP board, CoHOG had the highest power consumption. This is likely due to the UP board utilizing up to 4 cores when performing CoHOG, whereas the Odroid and Pi did not use more than 2 when running the same algorithm. This is potentially due to architectural differences between the x86_64 architecture of the UP board and the ARM architecture of the Odroid and Pi.
In terms of RMF it should be noted that a clear limitation is the assumption that the platform performing VPR is moving at a constant velocity. This is not always the case in a real-time real-world scenario. However, for benchmarking purposes, this can be largely mitigated by partitioning the dataset sequence into sub-sequences of near-consistent velocities. In addition, RMF will inherently favour techniques that have their true-positive results distributed throughout the trajectory, as opposed to true-positives concentrated in certain areas, due to distance-based sampling. A better analysis could be obtained by combining RMF with the truepositives (loop-closures) distribution over a dataset trajectory as proposed by Porav et al. [46]. For applications that require a loop-closure every few meters, as otherwise the localisation error drift becomes too large to handle, the metric proposed in [46] compliments the value proposed by RMF.
This analysis could be continued as new platforms and platform versions are released, such as the Raspberry Pi 4, with more onboard RAM to help avoid paging to the micro-SD card. Another extension to consider would be a system that selectively applies a high performance VPR algorithm to frames as they come in, combined with a lower performance VPR system that is computationally lightweight and can be applied to every frame.