## Main Design of ERF-IMCS
### Image-Based Monte Carlo Localization  
For image-based topological localization, the top retrieved images in above image retrieval process are likely to present the possible locations of the mobile robot. Conventional methods mainly perform the topological localization by means of maximum likelihood, directly taking the result of image matching in image retrieval as the location of the robot. These methods may be affected by noise or occlusion in indistinctive environment, resulting in perceptual aliasing. To tackle above challenge, an image-based Monte Carlo localization is introduced to estimate the maximum a posterior over the topological space via Bayesian Filtering in this paper. By computing the posterior distribution of sample set, the data association between the current observation, and the corresponding topological node is determined to provide the most general solution for perceptual aliasing. The place of the topological map is defined as \(x\in X\). \(Z\) denotes the collection of observed images \(z\)s and \(Z(x)\) corresponds to the observation at place \(x\). According to Bayesian Filtering theory, for a new image captured by the robot at time \(t\), the localization process that is responsible for determining the place of the robot \(x_{t}\) is cast as estimating the posterior probability distribution \(p(x_{t}|z_{t},u_{t})\) based on the control sequence of the robot \(u_{t}\) and the observation \(z_{t}\). The image-based Monte Carlo localization consists of the following two phases:  
1. Prediction Phase  
In prediction phase, a set of particles \(s_{t}=\{(x_{t}^{i},\omega_{t}^{i}),\ i=1,\ 2\,\ \cdots\ N\}\) is randomly injected around most possible topological nodes estimated by image retrieval at time \(t\), where \(\omega_{t}^{i}\) represents the weight of each particle. Each particle contains similarities corresponding to different topological nodes. The motion model \(p(x_{t}|x_{t-1},\ u_{t})\) is employed to estimate the current state of the robot that exhibits the probability of the transition from place \(x_{t-1}\) to place \(x_{t}\). 2. Update Phase  
In update phase, the probability distribution of the robot in the environment is represented by a series of samples randomly selected based on posterior probability \(\text{bel}(x_{0\,:\,t})\), where \(x_{0\,:\,t}\) denotes the distribution of \(x\) from time 0 to time \(t\). The samples are updated through the steps of sampling, importance weight calculation, and resampling, iteratively estimating the pose probability of the robot as follows:  
\[ \begin{array}{l}\text{bel}(x_{0\,:\,t})=p(x_{0\,:\,t}|z_{1\,:\,t},u_{1\,:\,t })=\\ \eta p(z_{t}|x_{t})\int p(x_{t}|x_{t-1},u_{t})p(x_{0\,:\,t-1}|z_{1\,:\,t-1},u_{ 1\,:\,t-1})dx_{t-1}\ \,\\ =\eta p(z_{t}|x_{t})\int p(x_{t}|x_{t-1},u_{t})\text{bel}(x_{0\,:\,t-1})dx_{t -1}\end{array}  \tag{4}\]  
where \(\eta\) is the normalized coefficient. At each iteration, samples are taken from the posterior probability distribution of the robot according to proposal distribution \(p(x_{t}|x_{t-1},u_{t})\). Then, the importance weight \(\omega_{t}^{i}=\eta p(z_{t}|x_{t})\), representing the probability of the robot at the particle position, is estimated for each particle based on the observation model, where \(p(z_{t}|x_{t})\) represents the observation model of the robot. In the image-based Monte Carlo localization, the observation model \(p(z_{t}|x_{t})\) is related to the similarity \(S(I_{t},\ I_{j})\) between the current view image \(I_{t}\) and the keyframe image \(I_{j}\) in topological node \(j\). The similarity \(S(I_{t},\ I_{j})\) is generated by means of comparing the current view image of the robot with all the keyframe images in topological nodes, as shown in Figure 5. Then, the similarity \(S(I_{t},\ I_{j})\) is fed into the process of calculating the importance weight.