## Main Design of ERF-IMCS
### Image Retrieval  
Image-based topological localization is usually cast as an image retrieval process, searching for the keyframes closest to the current image captured by the robot in the geo-tagged topological map based on feature matching. These keyframes described by visual features represent different nodes of the topological map in the environment. As one of the transfer learning methods, fine-tuning based on pre-trained model that transforms the general features into special features has been proven to achieve state of the art performance in feature representation. To obtain better feature representation, an effective way is to explicitly learn weights suited for specific image retrieval task based on pre-trained models. Inspired by Reference [29], we adopted a pre-trained object detection CNN to extract the high dimensional convolution features of query image for image retrieval. However, complementing the works in Reference [29], we addressed the efficiency problem in real-time image retrieval by introducing the hash index technology for performing the process of image matching quickly. In the image retrieval, we presented a coarse-to-fine mechanism consisting of two stages, i.e., coarse filtering based on global feature and fine retrieval based on local feature, as depicted in Figure 4.  
Figure 3: Schematic diagram of the topological map. Figure 2: The flowchart of the topological mapping. 1. Coarse Filtering According to Reference [36], the features extracted from top semantic layers are not suitable for image retrieval because of lack of spatial information of objects. In contrast, the activations pooled from convolutional layers exhibit powerful ability to generalize images. Additionally, extensive works demonstrate that the activations from convolutional layers significantly outperform the activations from fully connected layers in image retrieval because the fully connected layer is highly related to classification tasks, which is less effective than the convolution layers at image retrieval tasks. To this end, we adopted the conv5 layer of ZF [37] to extract the global feature of images in which the dimension is 256 in the coarse filtering stage. According to the results in Reference [38], ZF architecture, which has 5 shareable conv layers, is significantly more efficient than VGG-16 architectures in real-time image retrieval although the performance of ZF architectures in Faster R-CNN is slightly inferior to VGG16 architectures in accuracy. After feature extraction layer, we adopt Image-wise Pooling of Activations (IPA) strategy to generate the compact global descriptors for both query images and keyframe images in topological map based on sum pooling. Sum pooling has proven to achieve competitive performance in aggregating feature activations [39]. However, quickly searching the top-N keyframe images closest to query image is a non-trivial work in real-time image retrieval, especially for large scale dataset. Therefore, we introduce a hash index technology to accelerate the image matching process. After obtaining the compact global features from the pooling layer, we employ iterative quantization (ITQ) [40] to transform the 256-dimensional CNN features to 64-bit binary hash codes. ITQ is an efficient image matching method that can encode high-dimensional CNN features into a discriminative binary code. This method transforms the features into low-dimensional codes while maintaining the adjacent relationship of data in the original space, thereby minimizing the loss of information. In the coarse retrieval stage, the Hamming distance of the hash code is computed. Then, we search for the top-N keyframes in each topological node closest to the current query image captured by the robot based on the similarity measurement of Hamming distance. 2. Fine Retrieval Perceptive aliasing may occur in an indoor environment with similar layouts and geometric structure if the top-N keyframes obtained by the coarse filtering based on global features is taken as the final result of image retrieval.