1 Introduction
Place recognition (PR) is the broad problem of recognizing “places” based on visual inputs [26, 6]
. Recently, it has been pursued actively in autonomous driving research, where PR forms a core component in localization (i.e., estimating the vehicle pose)
[34, 21, 4, 9, 35, 5, 7] and loop closure detection [10, 13]. Many existing methods for PR require to train on a large dataset of sample images, often with ground truth positioning labels, and stateoftheart results are reported by methods that employ learning [21, 20, 7, 9].To perform convincingly, a practical PR algorithm must be robust against appearance changes in the operating environment. These can occur due to higher frequency environmental variability such as weather, time of day, and pedestrian density, as well as longer term changes such as seasons and vegetation growth. A realistic PR system must also contend with “less cyclical” changes, such as construction and roadworks, updating of signage, façades and billboards, as well as abrupt changes to traffic rules that affect traffic flow (this can have a huge impact on PR if the database contains images seen from only one particular flow [10, 13]). Such appearance changes invariably occur in real life.
To meet the challenges posed by appearance variations, one paradigm is to develop PR algorithms that are inherently robust against the changes. Methods under this paradigm attempt to extract the “visual essence” of a place that is independent of appearance changes [1]. However, such methods have mostly been demonstrated on more “natural” variations such as time of day and seasons.
Another paradigm is to equip the PR algorithm with a large image dataset that was acquired under different environmental conditions [8]. To accommodate longterm evolution in appearance, however, it is vital to continuously accumulate data and update the PR algorithm. To achieve continuous data collection costeffectively over a large region, one could opportunistically acquire data using a fleet of service vehicles (e.g., taxis, delivery vehicles) and amateur mappers. Indeed, there are street imagery datasets that grow continuously through crowdsourced videos [30, 14]. Under this approach, it is reasonable to assume that a decent sampling of the appearance variations, including the recent changes, is captured in the ever growing dataset.
Under continuous dataset growth, the key to consistently accurate PR is to “assimilate” new data quickly. This demands a PR algorithm that is scalable. Specifically, the computational cost of testing (i.e., performing PR on a query input) should not increase visibly with the increase in dataset size. Equally crucially, updating or retraining the PR algorithm on new data must also be highly efficient.
Arguably, PR algorithms based on deep learning
[7, 9] can accommodate new data by simply appending it to the dataset and finetuning the network parameters. However, as we will show later, this finetuning process is still too costly to be practical, and the lack of accurate labels in the testing sequence can be a major obstacle.Contributions
We propose a novel framework for PR on largescale datasets that continuously grow due to the incorporation of new sequences in the dataset. To ensure scalability, we develop a novel PR technique based on Hidden Markov Models (HMMs) that is lightweight in both training and testing. Importantly, our method includes a topologically sensitive compression procedure that can update the system efficiently, without using GNSS positioning information or computing visual odometry. This leads to PR that can not only improve accuracy by continuous adaption to new data, but also maintain computational efficiency. We demonstrate our technique on datasets harvested from Mapillary [30], and also show that it compares favorably against recent PR algorithms on benchmark datasets.
2 Problem setting
We first describe our adopted setting for PR for autonomous driving. Let be a dataset of videos, where each video
(1) 
is a timeordered sequence of images. In the proposed PR system, is collected in a distributed manner using a fleet of vehicles instrumented with cameras. Since the vehicles could be from amateur mappers, accurately calibrated/synchronized GNSS positioning may not be available. However, we do assume that the camera on all the vehicles face a similar direction, e.g., front facing. The query video is represented as
(2) 
which is a temporallyordered sequence of query images. The query video could be a new recording from one of the contributing vehicles (recall that our database is continuously expanded), or it could be the input from a “user” of the PR system, e.g., an autonomous vehicle.
Overall aims
For each , the goal of PR is to retrieve an image from that was taken from a similar location to , i.e., the FOV of the retrieved image overlaps to a large degree with . As mentioned above, what makes this challenging is the possible variations in image appearance.
In the envisioned PR system, when we have finished processing , it is appended to the dataset
(3) 
thus the image database could grow unboundedly. This imposes great pressure on the PR algorithm to efficiently “internalise” new data and compress the dataset. As an indication of size, a video can have up to 35,000 images.
2.1 Related works
PR has been addressed extensively in literature [26]
. Traditionally, it has been posed as an image retrieval problem using local features aggregated via a BoW representation
[10, 13, 11]. Featurebased methods fail to match correctly under appearance change. To address appearance change, SeqSLAM [28] proposed to match statistics of the current image sequence to a sequence of images seen in the past, exploiting the temporal relationship. Recent methods have also looked at appearance transfer [31][23] to explicitly deal with appearance change.The method closest in spirit to ours is [8], who maintain multiple visual “experiences” of a particular location based on localization failures. In their work, successful localization leads to discarding data, and they depend extensively on visual odometry (VO), which can be a failure point. In contrast to [8], our method does not rely on VO; only image sequences are required. Also, we update appearance in both successful and unsuccessful (new place) localization episodes, thus gaining robustness against appearance variations of the same place. Our method also has a novel mechanism for map compression leading to scalable inference.
A related problem is that of visual localization (VL): inferring the 6 DoF pose of the camera, given an image. Given a model of the environment, PnP [24] based solutions compute the pose using 2D3D correspondences [34], which becomes difficult both at large scale and under appearance change [40]. Some methods address the issue with creating a model locally using SfM against which query images are localized [35]. Given the ground truth poses and the corresponding images, VL can also be formulated as an image to pose regression problem, solving simultaneously the retrieval and pose estimation. Recently, PoseNet [21]
used a Convolution Neural Network (CNN) to learn this mapping, with further improvements using LSTMs to address overfitting
[41], uncertainty prediction [19] and inclusion of geometric constraints [20]. MapNet [7] showed that a representation of the map can be learned as a network and then used for VL. A downside of deep learning based methods is their highcomputational cost to train/update.Hidden Markov Models (HMMs) [38, 33] have been used extensively for robot localization in indoor spaces [22, 2, 37]. Hansen et al. [15] use HMM for outdoor scene, but they must maintain a similarity matrix between database and query sequences, which is unscalable when data is accumulated continuously. Therefore, we are one of the first to apply HMMs to large urbanscale PR, which requires significant innovation such as a novel efficienttoevaluate observation model based on fast image retrieval (Sec. 4.2). In addition, our method explicitly deals with temporal reasoning (Sec. 4.1), which helps to combat the confusion from perceptual aliasing problem [36]. Note also that our main contributions are in Sec. 5, which tackles PR on a continuously growing dataset .
3 Map representation
When navigating on a road network, the motion of the vehicle is restricted to the roads, and the heading of the vehicle is also constrained by the traffic direction. Hence, the variation in pose of the camera is relatively low [35, 32].
The above motivates us to represent a road network as a graph , which we also call the “map”. The set of nodes is simply the set of all images in . To reduce clutter, we “unroll” the image indices in by converting an index to a single number , hence the set of nodes are
(4) 
where is the total number of images. We call an index a “place” on the map.
We also maintain a corpus that stores the images observed at each place. For now, the corpus simply contains
(5) 
at each cell . Later in Sec. 5, we will incrementally append images to as the video datatset grows.
In , the set of edges connect images that overlap in their FOVs, i.e., is an edge in if
(6) 
Note that two images can overlap even if they derive from different videos and/or conditions. The edges are weighted by probabilities of transitioning between places, i.e.,
(7) 
for a vehicle that traverses the road network. Trivially,
(8) 
It is also clear from (7) that is undirected. Concrete definition of the transition probability will be given in Sec. 5. First, Sec. 4 discusses PR of given a fixed and map.
4 Place recognition using HMM
To perform PR on against a fixed map and corpus , we model using a HMM [33]. We regard each image to be a noisy observation (image) of an latent place state , where . The main reason for using HMM for PR is to exploit the temporal order of the images in , and the high correlation between time and place due to the restricted motion (Sec. 3).
To assign a value to , we estimate the belief
(9) 
where is a shorthand for . Note that the belief is a probability mass function, hence
(10) 
Based on the structure of the HMM, the belief (9) can be recursively defined using Bayes’ rule as
(11) 
where is the observation model, is the state transition model, and is the prior (the belief at the previous time step) [33]. The scalar is a normalizing constant to ensure that the belief sums to .
If we have the belief at time step , we can perform PR on by assigning
(12) 
as the place estimate of . Deciding the target state in this manner is called maximum a posteriori (MaxAP) estimation. See Fig. 1 for an illustration of PR using HMM.
4.1 State transition model
The state transition model gives the probability of moving to place , given that the vehicle was at place in the previous time step. The transition probability is simply given by the edge weights in , i.e.,
(13) 
Again, we defer the concrete definition of the transition probability to Sec. 5. For now, the above is sufficient to continue our description of our HMM method.
4.2 Observation model
Our observation model is based on image retrieval. Specifically, we use SIFT features [25] and VLAD [16]
to represent every image. Priority search kmeans tree
[29] is used to index the database, but it is possible to use other indexing methods [17, 12, 3].Image representation
For every image , we seek a nonlinear function
that maps the image to a single highdimensional vector. To do that, given a set of SIFT features densely extracted from image
: , where is the number of SIFT features of image . Kmeans is used to build a codebook , where is the size of codebook. The VLAD embedding function is defined as:(14) 
where, is the nearest visual word of feature vector . To obtain a single vector, we employ sum aggregation:
(15) 
To reduce the impact of background features (e.g., trees, roads, sky) within the vector , we adopt rotation and normalization (RN) [18], followed by 2 normalization. In particular, we use PCA to project from to , where . In our experiment, we set . Powerlaw normalization is then applied on rotated data:
(16) 
where, we set .
Note that different from DenseVLAD [39] which uses whitening for postprocessing, performing powerlaw normalization on rotated data is more stable.
Computing likelihood
We adopt priority search kmeans tree [29] to index every image . The idea is to partition all data points into clusters by using Kmeans, then recursively partitioning the points in each cluster. For each query , we find a set of nearest neighbor . Specifically, is mapped to vector . To search, we propagate down the tree at each cluster by comparing to cluster centers and selecting the nearest one.
The likelihood is calculated as follows:

Initialize , , where, we set and in our experiment.

For each

Find node , where is the inverse of corpus , which finds node storing .

Calculate the probability: , where is the distance between and .

If , then .

4.3 Inference using matrix computations
The state transition model can be stored in a matrix called the transition matrix, where the element at the th row and th column of is
(17) 
Hence, is also the weighted adjacency matrix of graph . Also, each row of sums to one. The observation model can be encoded in a diagonal matrix , where
(18) 
If the belief and prior are represented as vectors respectively, operation (11) can be summarized as
(19) 
where
corresponds to uniform distribution. From this, it can be seen that the cost of PR is
.Computational cost
Note that is a very sparse matrix, due to the topology of the graph which mirrors the road network; see Fig. 3 for an example . Thus, if we assume that the max number of nonzero values per row in is , the complexity for computing is O.
Nonetheless, in the targeted scenario (Sec. 2), can grow unboundedly. Thus it is vital to avoid a proportional increase in so that the cost of PR can be maintained.
5 Scalable place recognition based on HMM
In this section, we describe a novel method that incrementally builds and compresses for a video dataset that grows continuously due to the addition of new query videos.
We emphasize again that the proposed technique functions without using GNSS positioning or visual odometry.
5.1 Map intialization
Given a dataset with one video , we initialize and as per (4) and (5). The edges (specifically, the edge weights) are initialized as
where is a normalization constant. The edges connect frames that are time steps apart with weights based on a Gaussian on the step distances. The choice of can be based on the maximum velocity of a vehicle.
Note that this simple way of creating edges will ignore complex trajectories (e.g., loops). However, the subsequent steps will rectify this issue by connecting similar places.
5.2 Map update and compression
Let be the current dataset with map and corpus . Given a query video , using our method in Sec. 4 we perform PR on based on . This produces a belief vector (19) for all .
We now wish to append to , and update to maintain computational scalability of future PR queries. First, create a subgraph for , where
(20) 
(recall that there are a total of places in ), and simply follows Sec. 5.1 for .
In preparation for map compression, we first concatenate the graphs and extend the corpus
(21) 
for . There are two main subsequent steps: culling new places, and combining old places.
Culling new places
For each , construct
(22) 
where with is a threshold on the belief. There are two possibilities:

If , then is the image of a new (unseen before) place since the PR did not match a dataset image to with sufficient confidence. No culling is done.

If , then for each ,

For each such that :

Create new edge with weight .

Delete edge from .


.

Combining old places
Performing PR on also provides a chance to connect places in that were not previously connected. For example, two dataset videos and could have traversed a common subpath under very different conditions. If travels through the subpath under a condition that is simultaneously close to the conditions of and , this can be exploited for compression.
To this end, for each where is nonempty,

.

For each where and :

For each such that , :

Create edge with weight .

Delete edge from .


.

Again, once the above is done for all for which , we remove all unconnected nodes from and delete the relevant cells in , with the corresponding index adjustments. Figs. (c)c, (a)a and (c)c illustrate this combination step.
5.3 Updating the observation model
When is appended to the dataset, i.e., , all vector need to be indexed to the kmeans tree. In particular, we find the nearest leaf node that belongs to. Assume the tree is balanced, the height of tree is , where , thus each needs to check internal nodes and one leaf node. In each node, it needs to find the closest cluster center by computing distances to all centers, the complexity of which is . Therefore, the cost for adding the query video is , where . Assume it is a complete tree, every leaf node contains points, thus it has leaf nodes. For each point , instead of exhaustedly scanning leaf nodes, it only needs to check nodes. Hence, it is a scalable operation.
5.4 Overall algorithm
Algorithm 1 summarizes the proposed scalable method for PR. A crucial benefit of performing PR with our method is that map does not grow unboundedly with the inclusion of new videos. Moreover, the map update technique is simple and efficient, which permits it to be conducted for every new video addition. This enables scalable PR on an ever growing video dataset. In Sec. 6, we will compare our technique with stateoftheart PR methods.
6 Experiments
We use a dataset sourced from Mapillary [30] which consists of streetlevel geotagged imagery; see supplementary material for examples. Benchmarking was carried out on the Oxford RobotCar [27], from which we use 8 different sequences along the same route; details are provided in supplementary material, and the sequences are abbreviated as Seq1 to Seq8. The initial database is populated with Seq1 and Seq2 from the Oxford RobotCar dataset. Seq3 to Seq8 are then sequentially used as the query videos. To report the 6DoF pose for a query image, we inherit the pose of the image matched using the MaxAP estimation. Following [35], the translation error is computed as the Euclidean distance . Orientation errors , measured in degree, is the angular difference between estimated and ground truth camera rotation matrices and . Following [21, 20, 7, 42], we compare mean and median errors.
Performance with and without updating the database



We investigate the effects of updating database on localization accuracy and inference time. After each query sequence finishes, we consider three strategies: i) No update: always contains just the initial 2 sequences, ii) Cull: Update with the query and perform culling, and iii) Cull+Combine: Full update with both culling and combining nodes. Mean and median 6DoF pose errors are reported in Table 1. In general, Cull improves the localization accuracy over No update, since culling adds appearance variation to the map. In fact, there are several cases, in which Cull+Combine produces better results over Cull. This is because we consolidate useful information in the map (combining nodes which represent the same place), and also enrich the map topology (connecting nodes close to each other through culling). Inference times per query with different update strategies are given in Table 2. Without updating, the inference time is stable at (ms/query) between sequences, since the size of graph and the database do not change. In contrast, culling operation increases the inference time by about ms/query, and Cull+Combine makes it comparable to the No update case. This shows that the proposed method is able to compress the database to an extent that the query time after assimilation of new information remains comparable to the case of not updating the database at all.
Sequences  No update  Cull  Cull+Combine 

Seq3  4.03  
Seq4  4.56  5.05  4.82 
Seq5  4.24  5.06  4.87 
Seq6  3.81  4.03  3.72 
Seq7  3.82  4.18  3.78 
Seq8  3.77  3.91  3.68 
Training sequences  VidLoc  MapNet  Our method 

Seq1,2  14.1h  11.6h  98.9s 
Seq3    6.2h  256.3s 
Seq4    6.3h  232.3s 
Seq5    6.8h  155.1s 
Seq6    5.7h  176.5s 
Seq7    6.0h  195.4s 
Map maintenance and visiting unknown regions
Figure 3 shows the results on map maintenance with and without compression. Without compression, size of map (specifically, adjacency matrix ) grows continuously when appending a new query video . In contrast, using our compression scheme, known places in are culled, and redundant nodes in (i.e., nodes representing a same place) are combined. As a result, the graph is compressed.



Visiting unexplored area allows us to expand the coverage of our map, as we demonstrate using Mapillary data. We set , i.e., we only accept the query frame which has the MaxAP belief . When the vehicle explores unknown roads, the probability of MaxAP is small and no localization results are accepted. Once the query sequence ends, the map coverage is also extended; see Fig. 4.
Comparison against state of the art
Our method is compared against stateoftheart localization methods: MapNet [7] and VidLoc [9]. We use the original authors’ implementation of MapNet. VidLoc implementation from MapNet is used by the recommendation of VidLoc authors. All parameters are set according to suggestion of authors.^{1}^{1}1Comparisons against [8] are not presented due to the lack of publicly available implementation.
For map updating in our method, Cull+Combine steps are used. MapNet is retrained on the new query video with the ground truth from previous predictions. Since VidLoc does not produce sufficiently accurate predictions, we do not retrain the network for subsequent query videos.
Our method outperforms MapNet and VidLoc in terms of the mean errors (see Table 4), and also has a smoother predicted trajectory than MapNet (see Fig. 5). In addition, while our method improves localization accuracy after updating the database (See Table 1), MapNet’s results is worse after retraining (See Table 4). This is because MapNet is retrained on a noisy ground truth. However, though our method is qualitatively better than MapNet, differences in median error is not obvious: this shows that median error is not a good criterion for VL, since gross errors are ignored.
Note that our method mainly performs PR; here, comparisons to VL methods are to show that a correct PR paired with simple pose inheritance can outperform VL methods in presence of appearance change. The localization error of our method can likely be improved by performing SfM on a set of images corresponding to the highest belief.
Table 3 reports training/updating time for our method and MapNet and VidLoc. Particularly, for Seq1 and Seq2, our method needs around 1.65 minute to construct the kmeans tree and build the graph, while MapNet and VidLoc respectively require 11.6 and 14.1 hours for training. For updating a new query sequence, MapNet needs about 6 hours of retraining the network, whilst our method culls the database and combine graph nodes in less than 5 minutes. This makes our method more practical in a realistic scenario, in which the training data is acquired continuously.
7 Conclusion
This paper proposes a novel method for scalable place recognition, which is lightweight in both training and testing when the data is continuously accumulated to maintain all of the appearance variation for longterm place recognition. From the results, our algorithm shows significant potential towards achieving longterm autonomy.
References
 [1] (2016) NetVLAD: cnn architecture for weakly supervised place recognition. In CVPR, Cited by: §1.
 [2] (1997) Place learning and recognition using hidden markov models. In IROS, Cited by: §2.1.
 [3] (2015) Tree quantization for largescale similarity search and classification. In CVPR, Cited by: §4.2.
 [4] (2017) DSACdifferentiable RANSAC for camera localization. In CVPR, Cited by: §1.
 [5] (2018) Learning less is more6d camera localization via 3d surface regression. In CVPR, Cited by: §1.
 [6] (2018) Visual Localization: Featurebased vs. Learned Approaches. Note: https://sites.google.com/view/visuallocalizationeccv2018/home Cited by: §1.
 [7] (2018) Geometryaware learning of maps for camera localization. In CVPR, Cited by: §1, §1, §2.1, §6, §6.
 [8] (2013) Experiencebased navigation for longterm localisation. The International Journal of Robotics Research. Cited by: §1, §2.1, footnote 1.
 [9] (2017) VidLoc: a deep spatiotemporal model for 6DoF videoclip relocalization. In CVPR, Cited by: §1, §1, §6.
 [10] (2008) FABmap: probabilistic localization and mapping in the space of appearance. The International Journal of Robotics Research. Cited by: §1, §1, §2.1.
 [11] (2011) Appearanceonly slam at large scale with fabmap 2.0. The International Journal of Robotics Research. Cited by: §2.1.
 [12] (2016) Polysemous codes. In ECCV, Cited by: §4.2.
 [13] (2012) Bags of binary words for fast place recognition in image sequences. IEEE Transactions on Robotics. Cited by: §1, §1, §2.1.
 [14] (2008) OpenStreetMap: usergenerated street maps. IEEE Pervasive Computing. Cited by: §1.
 [15] (2014) Visual place recognition using hmm sequence matching. In IROS, Cited by: §2.1.
 [16] (2010) Aggregating local descriptors into a compact image representation. In CVPR, Cited by: §4.2.
 [17] (2011) Product quantization for nearest neighbor search. TPAMI. Cited by: §4.2.
 [18] (2014) Triangulation embedding and democratic aggregation for image search. In CVPR, Cited by: §4.2.
 [19] (2016) Modelling uncertainty in deep learning for camera relocalization. In ICRA, Cited by: §2.1.

[20]
(2017)
Geometric loss functions for camera pose regression with deep learning
. In CVPR, Cited by: §1, §2.1, §6.  [21] (2015) Posenet: a convolutional network for realtime 6dof camera relocalization. In CVPR, Cited by: §1, §2.1, §6.
 [22] (2004) Vision based topological markov localization. In ICRA, Cited by: §2.1.
 [23] (2018) Addressing challenging place recognition tasks using generative adversarial networks. In ICRA, Cited by: §2.1.
 [24] (2009) Epnp: an accurate o (n) solution to the pnp problem. IJCV. Cited by: §2.1.
 [25] (2004) Distinctive image features from scaleinvariant keypoints. IJCV. Cited by: §4.2.
 [26] (2016) Visual place recognition: a survey. IEEE Transactions on Robotics. Cited by: §1, §2.1.
 [27] (2017) 1 year, 1000 km: the oxford robotcar dataset. The International Journal of Robotics Research. Cited by: §6, §8.1.
 [28] (2012) SeqSLAM: Visual routebased navigation for sunny summer days and stormy winter nights. In ICRA, Cited by: §2.1.

[29]
(2014)
Scalable nearest neighbor algorithms for high dimensional data
. TPAMI. Cited by: §4.2, §4.2.  [30] (2017) The mapillary vistas dataset for semantic understanding of street scenes.. In ICCV, Cited by: §1, §1, §6.
 [31] (2018) Adversarial training for adverse conditions: robust metric localisation using appearance transfer. In ICRA, Cited by: §2.1.
 [32] (2018) Practical motion segmentation for urban street view scenes. In ICRA, Cited by: §3.
 [33] (2016) Artificial intelligence: a modern approach. Malaysia; Pearson Education Limited,. Cited by: §2.1, §4, §4.
 [34] (2017) Efficient & effective prioritized matching for largescale imagebased localization. TPAMI. Cited by: §1, §2.1.
 [35] (2018) Benchmarking 6DOF outdoor visual localization in changing conditions. In CVPR, Cited by: §1, §2.1, §3, §6.
 [36] (2018) Semiparametric topological memory for navigation. In ICLR, Cited by: §2.1.
 [37] (1998) A probabilistic approach to concurrent mapping and localization for mobile robots. Autonomous Robots. Cited by: §2.1.
 [38] (2005) Probabilistic robotics. Cited by: §2.1.
 [39] (2015) 24/7 place recognition by view synthesis. In CVPR, Cited by: §4.2.
 [40] (2015) 24/7 place recognition by view synthesis. In CVPR, Cited by: §2.1.
 [41] (2017) Imagebased localization using lstms for structured feature correlation. In ICCV, Cited by: §2.1.
 [42] (2018) DeLS3d: deep localization and segmentation with a 3d semantic map. In CVPR, Cited by: §6.
8 Supplementary Material
Abbreviation  Recorded  Condition  Sequence length 

Seq1  26/06/2014, 09:24:58  overcast  3164 
Seq2  26/06/2014, 08:53:56  overcast  3040 
Seq3  23/06/2014, 15:41:25  sun  3356 
Seq4  23/06/2014, 15:36:04  sun  3438 
Seq5  23/06/2014, 15:14:44  sun  3690 
Seq6  24/06/2014, 14:15:17  sun  3065 
Seq7  24/06/2014, 14:09:07  sun  3285 
Seq8  24/06/2014, 14:20:41  sun  3678 
8.1 Statistics of Oxford RobotCar dataset
8.2 Sample images of Mapillary
Sample images from our Mapillary dataset are shown in Figure 6
Comments
There are no comments yet.