{'fraction_non_alphanumeric': 0.04046754356517228, 'fraction_numerical': 0.008423108615375225, 'mean_word_length': 4.4260639178671966, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Joint Positioning and Radio Map Generation Based on Stochastic Variational Bayesian Inference for FWIPS

Fingerprinting based WLAN indoor positioning system (FWIPS) provides a promising indoor positioning solution to meet the growing interests for indoor location-based services (e.g., indoor way finding or geo-fencing). FWIPS is preferred because it requires no additional infrastructure for deploying an FWIPS and achieving the position estimation by reusing the available WLAN and mobile devices, and capable of providing absolute position estimation. For fingerprinting based positioning (FbP), a model is created to provide reference values of observable features (e.g., signal strength from access point (AP)) as a function of location during offline stage. One widely applied method to build a complete and an accurate reference database (i.e. radio map (RM)) for FWIPS is carrying out a site survey throughout the region of interest (RoI). Along the site survey, the readings of received signal strength (RSS) from all visible APs at each reference point (RP) are collected. This site survey, however, is time-consuming and labor-intensive, especially in the case that the RoI is large (e.g., an airport or a big mall). This bottleneck hinders the wide commercial applications of FWIPS (e.g., proximity promotions in a shopping center). To diminish the cost of site survey, we propose a probabilistic model, which combines fingerprinting based positioning (FbP) and RM generation based on stochastic variational Bayesian inference (SVBI). This SVBI based position and RSS estimation has three properties: i) being able to predict the distribution of the estimated position and RSS, ii) treating each observation of RSS at each RP as an example to learn for FbP and RM generation instead of using the whole RM as an example, and iii) requiring only one time training of the SVBI model for both localization and RSS estimation. These benefits make it outperforms the previous proposed approaches.


I. INTRODUCTION
Fingerprinting based WLAN indoor positioning systems (FWIPSs) have been attracting attention [1] from both academia and industry in the last decades for their advantages in the following two aspects: they do not necessarily require special or additional infrastructure and they have limited error bounds because they yield absolute positions. While other indoor positioning systems (IPSs), such as IPS based on radio frequency identification (RFID), ultra wide band (UWB), supersonic (e.g., Crickets) or infrared signals (e.g., Active Badge), require deploying and operating dedicated infrastructure. FWIPSs use existing WLAN access points (APs) and WiFi enabled devices (e.g., mobile phones, and tablets) [2]- [5]. Other infrastructure-free IPSs (e.g., pedestrian deadreckoning based on the built-in inertial measurement units (IMUs) of the mobile devices), they provide position changes while need to be integrated and the errors of positioning grow with time. [6], [7].
Generally, an FWIPS is realized using two stages: offline and online stage. During the offline stage a reference database representing the reference values of observable features as a function of location is created. This database is often named radio map (RM)). For creating this database, a site survey throughout the region of interest (RoI) usually has to be conducted. In this paper we assume that the RM consists of a set of reference points (RPs) and the corresponding readings of received signal strengths (RSSs) from all visible APs. Because of changes of the indoor environment and configuration of the WLAN, the offline mapping process needs to be carried out frequently to keep the RM up-to-date. This time-consuming and labor-intensive site survey significantly impairs the widespread application of FWIPS apart from academic research.
To reduce the time and labor of RM collection and update, a mathematical model for both position estimation and RM generation based on stochastic variational Bayesian inference (SVBI) is proposed herein. SVBI is employed to project the RSSs from the high-dimensional RSS-space to a much lowerdimensional space of so-called latent variables ( Fig. 1c and Fig. 1d), from which the position and corresponding RSS can then be simultaneously estimated. Via training SVBI based joint position and RSS estimation model using a collected RM, it can achieve to RM generation (Fig. 1e) by implementing SVBI based position and RSS estimation model using a neural network (NN) which we train using Keras 1 , a machine learning library for deep learning.
In Section II we give an overview on selected previous work related to FWIPSs, especially on publications focusing on fingerprinting based positioning (FbP) using NNs, and on joint FbP and RM generation. Fundamentals and formulations of FbP and NNs are presented in Section III. The proposed SVBI model is analyzed in Section IV. An experimental analysis and a discussion of the proposed approach is given in Section V.

II. RELATED WORK
We give a brief review on previously published FbP approaches, especially the ones using NNs. Then methods for RM generation and update are presented focusing on those which combine FbP with RM generation.

A. Fingerprinting based positioning
There are two types of FbP approaches: deterministic ones and probabilistic ones. A typical representative of the first type is k nearest neighbors (kNN) where the estimated position of the user is obtained as the average of the RPs associated with the k nearest neighbors of the measured RSS in the RSS space of the RM [8], [9]. Probabilistic approaches [4], [10] use the likelihood of the observed RSS and a proper prior distribution of the position to compute the posterior and estimate the users location, e.g. by applying the maximum a posteriori (MAP) principle.
Here we focus on reviewing FbP methods using NNs. These are the typical FbP approaches utilizing machine learning algorithms, see e.g., [11]. In [12], [13], position estimation methods based on NNs with 1 hidden layer and nonlinear activation functions, i.e. introducing nonlinear transformation to the input of the NN, are proposed. The positioning methods presented in above publications are deterministic, and they have been shown these to perform than kNN. Apart from position estimation based on NN with a single hidden layer, Zhang et al. [14] employed a stacked denoising auto-encoder (SDAE), which is a deep neural network (DNN) consisting of multiple hidden layers, to FbP . They train SDAE model using 100 RMs which are built from manual site surveys throughout the RoI at different times and each RM is treated as one training example.
The SVBI based position estimation which we propose herein is also realized using NNs. However, it differs from 1 Keras is provided via https://github.com/fchollet/keras. There is no paper about Keras. The advantages of Keras are i) built-in parallel programming on CPU and GPU; ii) stochastic gradient descent based backpropagation algorithms included; and iii) callbacks (e.g., early stopper and dropout) available for training the deep learning model and avoid the easy-over-fitting problem. the previous work in two aspects. On the one hand, it is a probabilistic model for position estimation. On the other hand, it can be trained using individual observation, i.e. each RP with the corresponding RSS readings is used to train the NN, instead of treating the entire RM as only one training example.

B. Joint FbP and RM generation
In this part, we categorize the radio map construction approaches according to whether they combine FbP and RM generation. Herein generation of RM means that an RM is newly constructed from the already existing RM and additionally measured RSS without associated position. Most of the previous publications are focused on generating the RM without jointly estimating the position [11], [12], [15], [16]. In [15], Talvitie et al. apply interpolation and extrapolation of RSS based on the distances in the coordinate space to generate a RM which includes more RPs than the original RM. This helps to include RPs into the RM which could not be occupied during site survey, e.g. because of access restrictions. The disadvantages of this method are twofold: i) the accuracy of the interpolated/extrapolated RM depends on the number and spatial distribution of the RPs included in the collected RM, and ii) it needs a separate FbP approach for position estimation.
There are few publications addressing simultaneous FbP and RM generation. Feng et al. [17] and Majeed et al. [18] employ compressive sensing with L 1 regularization and manifold alignment with geometry perturbation to achieve both FbP and RM generation. In [12], Zhou et al. propose a method using NNs with backpropagation to realize joint position estimation and RM generation. However, the intrinsic discrepancy of the dimensionality between RSS readings and the coordinates requires to train the position estimation and RM generation models separately, i.e. there are two different training processes: one for mapping the RSS to the coordinate space to achieve FbP, and another one for transforming the coordinates to RSS space for RM generation.
The proposed approach makes use of a latent representation of the RSS readings via SVBI in order to achieve both position and RSS estimation. These two estimation processes are implemented jointly. In this way, it differs significantly from previous work.

III. FUNDAMENTALS
The goal of this paper is to propose a probabilistic model for achieving joint FbP and RM generation implemented using a DNN unifiedly. Having referred to related work above, we now introduce the notation and mathematical concepts used lateron.

A. Fingerprinting based positioning
During the offline stage, a site survey is conducted to construct the fingerprinting database, namely the radio map (RM). It consists of collecting the RSS readings of signals from all APs at each RP using a suitable device (e.g., the mobile phone) with the WiFi module. The coordinates of the RPs must be either known beforehand or determined independent while collecting the RSS. Assuming that an RM consisting of N RP RPs and the RSS readings from N AP APs are available at each of these RPs, we can express the RM as the matrix of coordinates of the RPs in D dimensions (e.g., D = 2 or 3), and X N RP is the matrix of the readings of RSS. The i th row in RM , i.e. y T i , x T i , denotes the coordinates y i of the i th RP and the vector x i of RSS values associated with that RP. A fingerprinting based positioning approach (e.g., kNN) can be interpreted as a mapping ϕ RM : x → y from RSS space to coordinate space. At the online stage, ϕ RM is applied to compute the current locationŷ u of the user from currently measured RSS readings x u , i.e.ŷ u = ϕ RM (x u ).
To evaluate the positioning accuracy, a test dataset, which is not used to train the FbP model, i.e. to set up the RM in the case of kNN, is introduced. Similar to the notation used for the RM , let test dataset consist of N T P test points (TPs) and collect the corresponding coordinates and RSS values in the matrix T S = Y N T P , X N T P . The coordinates in T S are only used for performance evaluation via computing the error (e.g., mean squared error (MSE), root mean squared error (RMSE), Euclidean distance) between Y N T P and the coordinatesŶ N T P = ϕ RM (X N T P ) estimated from X N T P .

B. Neural networks and auto-encoders
We provide a short introduction to NNs and auto-encoders (AEs) here to support the further analysis. More details about NNs and AEs can be found e.g. [12], [19], and [20] respectively.

1) Neural networks:
A single layer neural network (SNN) consists of d out nodes (neurons) which transform the input vector f in ∈ R din into an output vector f out ∈ R dout . The elements of f in are linearly combined using weights w collected in a matrix W ∈ R din×dout , shifted using biases b ∈ R dout and then processed by an activation function f act (Fig. 2a). The free parameters of an SNN are the weights, biases and activation function. For using the SNN these free parameters need to be determined by optimization such that the error of the output is minimized for a given training data. Generally, f act is chosen, and gradient descent (e.g., BFGS, Levenberg Marquardt) is applied to back propagate the error (e.g., squared error between f out and the output of the SNN, i.e. f out −f SNN out 2 2 ) for training and optimizing the SNN w.r.t. W and b [21].
Generalizing from the SNN, we can progress to a deep neural network (DNN) that consists of L layers, whose corresponding configuration is given the weights, biases, and activation function for each layer, i.e. 2b). Herein the number of nodes in each layer is equal to the number of columns of the weight matrix of the corresponding layer. Similarly, the output of the L layers DNN can be written as:f For the subsequent analysis, we build several baseline models (BMs) for FbP using an SNN or a DNN, i.e. the feed-in and feed-out of the NNs are the readings of RSS and the corresponding coordinates of the RP. We analysis the performance of the BMs and compare to other models (See Section V).
2) Auto-encoders: A deep network with a denoising capacity is required instead of SNN and DNN if the feed-in is strongly affected by noise [20]. An auto-encoder (AE) is a self-supervised learning model whose feed-out is the same as the feed-in and it is implementable via two pipelined DNNs, i.e. an encoder, and a decoder, as shown in Fig. 2c. AEs and their improved versions (e.g., SDAE) are designed to mitigate the noisy inputs. The encoder transforms the input f in into a latent representation z AE via the first DNN, denoted as f AE , i.e.: z The decoder reconstructs f in from the latent representation using another DNN g AE , i.e.: Techniques for training an AE have been proposed by Lee et al. [22], and Hinton et al. [23]. They have been proved successful at training a DNN to learn their parameters such that minimize the difference betweenf in and f in . Above brief introduction to AE is helpful to understand the reason why SVBI based joint position and RSS estimation can be implemented using NNs (See Section IV). Stochastic variational Bayesian inference (SVBI) is applied to formulate a probabilistic model, which not only can model the posterior, i.e. p θ (y|x) (x is a vector representing the RSS and y is the associated coordinates of the RP), used for FbP, but also is capable of modeling the feed-in of the positioning model, i.e. the density p θ (x) of the readings of RSS 2 . θ is the parameters to determine the assumed distribution (e.g., mean and covariance of a Gaussian distribution). Firstly, the analysis on estimating p θ (x) using SVBI, including some fundamentals, the optimization scheme and the relationship with AEs, is presented. Then we generalize it to estimate p θ (y|x) as well as the joint distribution p θ (x, y). Finally, a unified frameworks illustrating the implementation of SVBI and its application to FWIPS, especially for joint FbP and RM generation, is analyzed A. SVBI based density estimation 1) Fundamentals of SVBI: Assume that each of the x i collected in X NRP have been drawn i.i.d. from p θ (x) by the process of collecting the readings of RSS. Based on the manifold assumption that the hyper-dimensional RSS lies on an intrinsic manifold, whose dimension is much lower than that of the RSS [24], we introduce a latent variable z ∈ R dman , where d man is the dimension of the intrinsic manifold, to represent the information content of x . The density of x can be computed via marginalization over the latent space: where p θ (x, z) is the joint distribution. By introducing a mapping distribution, i.e. q φ (z|x), where φ is the vector of parameters of the mapping distribution, (5) can be rewritten as: where E denotes th expectation operator and p θ (z) is the distribution of z. q φ (z|x) can be interpreted as an encoder similar to the one within an AE and represents the distribution of the mapping from x to z. The goal of SVBI is to maximize the estimated probability of x, which is equivalent to maximizing the logarithm of the density function of it w.r.t. to θ. Taking the logarithm of (6) and applying Jensen's Inequality 3 to it, the lower bound of (6) is: The second term on the right hand side (r.h.s) of (7) is Kullback-Leibler divergence between q φ (z|x) and p θ (z), denoted as D KL (q φ (z|x) p θ (z)) and introducing L(θ, φ) for the variational lower bound of the marginalized likelihood, we obtain: The maximization of L(θ, φ) w.r.t. θ and φ is equivalent to minimizing the second term of r.h.s of (8), because Kullback-Leibler divergence is non-negative. Often, mean-field approach is applied to approximate θ and φ [25]. However, this requires the analytical solutions of the expectations [25]. In fact, the analytical solutions of the expectation is unknown for the most cases. Instead of maximizing using mean-field approach by computing the analytical solution of the expectation, we use gradient based backpropagation to optimize L(θ, φ) w.r.t. θ, φ, i.e. step-wisely searching the optimal values of θ, φ. The step size is ∆ θ,φ : where Γ θ,φ is a diagonal matrix containing the adaptive learning rate. Herein RMSprop is used to compute it [26]. However, the indirect dependency on φ over which the expectation of the first term on r.h.s of (8) is taken, makes it difficult to compute the gradient of the expectation w.r.t. φ. To estimate the gradient of the expected reconstruction loss, i.e. the difference between the reconstructed x from z and the measured x, w.r.t. φ, Schulman et al. proposed stochastic computation graphs 4 to calculate the gradient [27], [28]. This approach solves the indirect dependency problem by applying re-parameterization trick. More details can be found in e.g. [25], [28]- [30]. The re-parameterization trick is formulated in the following way. Assume that the latent variable z can be expressed by another deterministic variable z = γ φ ( , x), where is an auxiliary variable distributed corresponding to an independent distribution, i.e.
∼ p( ), and p( ) is an arbitrary distribution (e.g., Gaussian). Under this assumption, the expected reconstruction loss, i.e. the r.h.s of (7), is independent of the dependency on φ while taking the expectation over z and can be estimated by: In (10), N MCS is the number of Monte Carlo sampling (MCS). In the case of the Kullback-Leibler divergence can be computed analytically, another equation for evaluating (7) is:L Both (10) and (11) are treated as the surrogate losses (i.e. substitute losses) of the variational lower bound. But the latter surrogation typically has lower variance than the former [25]. With the surrogate loss, it is easier to compute the gradient of the expected loss. Therefore, stochastic gradient descent approaches (e.g., RMSprop or Adam) can be applied to compute the optimal values of φ and θ.
2) AE interpretation: We can refer to q φ (z|x) as the encoder, which estimates the distribution over all z given an observation x. From the latent variable, x can be reconstructed via sampling from p θ (x|z), which is equivalent to the decoding process of the AE. Different from the AEs described in Section III-B, both the encoding and decoding procedures of SVBI are probabilistic.
3) SVBI under Gaussian assumptions: Herein we assume that there exists a transformation that transforms x ∼ p θ (x) to a latent variable z, which is standard Normally distributed, i.e. z ∼ p θ (z), p θ (z) = N (z|0, I). A DNN is employed to approximate this transformation. The variational posterior q φ (z|x), i.e. the encoder, is assumed to be a multivariate Gaussian: where Σ z can be written as Σ z := RR T , R ∈ R dman×dman , R is the Cholesky decomposition of Σ z . This decomposition is to reduce the number of parameters needed be estimated. In this case, z can be re-parametrized by a linear transformation such that z = µ z +Σ where ∼ N (0, I), ∈ R dman . Therefore, the Kullback-Leibler divergence in (11) can be analytically written as (13) under above assumptions [31].
Instead of directly estimating the distribution of x, we use maximum likelihood estimation (MLE) to estimate the values of x with the assumed intrinsic distribution of p θ (x), i.e. x = MLE(x), x ∼ p θ (x|z). The MLE can be implementable using NNs [32]. Herein we assume that p θ (x) is Gaussian distributed, MLE can be realized by a 2 layers NN, whose activation functions are tangent hyperbole and linear respectively [25], [29]. Based on the MLE, we introduce another surrogate loss of (11) given the feed-in dataset X NRP :

B. Generalization of SVBI
In the case of fingerprinting based positioning (FbP), we try to use SVBI to maximize the conditional likelihood p θ (y|x), [x, y] ∈ RM . The variational lower bound of it can be directly extended from (7): In [33], Sohn et al. relax the dependency of z on x in (15) to be statistically independent from it, i.e. p θ (z|x) p θ (z). This relaxation makes it easier to be implemented. SVBI can also be generalized to estimate the joint distribution p θ (x, y) and its variational lower bound is [34]: C. NN based implementation of SVBI and its application to FWIPS 1) General implementation of SVBI: First, we illustrate a general implementation framework of SVBI based on NNs. As shown in Fig. 3 5 , the sum of Loss 1 and Loss 2 is the estimated value of the variational lower bound. The scenario consists of 5 To transform r f in to R, it is reshaped to a lower triangular matrix. two modules: recognition module and generative module. The former module takes f in as the input and yields the manifold representation z SVBI of the input. The generative module is fed by the manifold representation and trained to approximate the corresponding feed-out. Both of the modules can be implemented using NNs with different activation functions [25].

Fig. 3. General implementation framework of SVBI
This general implementation framework can be applied to estimate 3 types variational lower bound via changing the feedin and feed-out: i) if f in and f out are equal to x, the loss is the estimation of (14); ii) if f in and f out are a concatenation of x and y, and y respectively, the loss is an approximation of conditional variational lower bound (15); and iii) if f in and f out are both concatenation of x and y, it is the approximation of the joint variational lower bound (16). 2) SVBI based FbP and RSS estimation: We now focus on applying SVBI based density estimation model jointly with the NN based positioning approach to realize both position and RSS estimation as illustrated in Fig. 4. This joint model consists of two paths: i) the position estimation path, and ii) the RSS estimation path. Both of them has the shared recognition module but each has its own generative module for their respective purpose. In the case that there is a precollected RM consisting of RPs with associated RSS values, we can train the joint model in two ways: i) separate training, and ii) joint training. In the former case, we train the SVBI base RSS and position estimation paths separately and use it for the purpose of RSS and position estimation, respectively.
As for the latter case, both paths are trained simultaneously. This joint SVBI model can be used for both position and RSS estimation, such that it can also be employed to generate the RM by feeding the trained generative model with the arbitrary variableẑ =μ z +Σ 1/2 z , where ∈ R dman is drawn from N (0, I).
In this paper, we use Keras, a deep learning library based on Tensorflow [35], to implement all the models and the simulations.

A. Testbed
To evaluate the performance of the proposed approaches, an FWIPS is deployed in the building where the Institute of Geodesy and Photogrammetry, ETH Zürich is located [36]. This FWIPS requires no additional installation of new APs because enough signals are available throughout the RoI. These APs are deployed for the purpose to provide the Internet access services. Though we cannot control the configurations of the WLAN and APs, we assume that the settings of them are stable. A site survey was conducted throughout the RoI using a mobile phone, Nexus 6P, with a custom made Android application in order to collect a RM. The RP position are determined during the site survey using a total station (TS), Leica MS60.
Fifteen prisms permanently mounted on the ceiling represent the coordinates frame and allow the TS to determine its position any where within the RoI by resection. A custom made frame holding the smart phone and a 360 • mini prism allows the TS to automatically track the smart phone and thus synchronously measuring RSS and position. The position data collected by TS have an accuracy on the mm-level and are thus considered as ground truth during the later analysis.

B. Simulation results of the models without variational inference
Three baseline models (BMs), illustrated in Fig. 5, for comparison are presented and analyzed, including the training and parameter setups of the NNs, and the evaluation criterion. Instead of training the NNs with the original RSS readings and coordinates, we start with pre-processing of the data. i) The RSS value are normalized to the range of [0, 1] N AP . x is therefore a vector of normalized values; and ii) the coordinates are standardized to have zero mean and unit standard deviation. We denote this process stdScaler() and the result y std [21]. An example of standardized RM is shown in Fig. 1b. Regarding the BMs, the first two BMs, shown in Fig. 5a and Fig. 5b respectively, are based on a SNN, whose activation function are chosen linear. The difference between the first two BMs is the way of inverse transformation (stdScaler −1 ()).
The former transforms the output of the SNN to the original coordinate space after output from the SNN, and the latter realizes the inverse transformation directly within the NN. The third BM is a deep learning based positioning models (DLPM) consisting of a L layers DNN pipelined with the SNN. Thus DLPM is a L + 1 layers NN. The activation functions of the L layers DNN and SNN are set as rectified linear unit (ReLu) 6 and linear, respectively. Because we implement all the models using Keras and Tensorflow, there are two more parameters: i) batch size to fit the model, and ii) maximum number of failures of the early stopper, denoted as patience of the early stopper (PoE). They are introduced to improve the training efficiency and avoid the over-fitting 7 . To evaluate and compare the performance of the models, we calculate the RMSE from the Euclidean distances between the estimated coordinatesŷ and their ground truth y together with the 95% confidence interval [38] 8 .  The results are shown in Table I. We evaluated each model 36 times with the same configuration of the NNs and the same training data. Since the NNs are randomly initialized each of the 36 evaluation yielded different parameter values of the NNs and thus slightly different results. The batch size and PoE of the BMs were chosen as 50 and 25, respectively. The DNN consists of 3 layers, whose number of nodes is 128, 64, 32 for the 3 layers, respectively. The performance of the BMs with built-in and separate inverse standardization is comparable. The performance of the latter is slightly better than that of the former. DLPM performs approximately 50% better than that of the BM with post inverse standardization with the data used herein. The reduction of RMSE of DLPM is almost 0.9 m comparing to that of kNN 9 .

C. Results with variational inference
The DNN of the shared recognition module is set up like the DLPM used in the previous subsection. The RSS are mapped to a 4 dimensional latent space 10 (i.e. d man = 4). To simplify the model, the number of nodes of the Gaussian coder (depicted in Fig. 3) is the same as the dimension of the latent space. Herein we present the results under the assumption that the covariance matrix of q φ (z|x) is diagonal to reduce the computational burden.  Table I (SVBI (Sep.))). It is 40% lower than that of BM(post). Compared to DLPM, RMSE of SVBI (Sep.) is slightly higher, however, from Fig. 6, the cumulative positioning accuracy (CPA), defined as the cumulative density function of the positioning errors, for both models are almost the same until 2 m.
2) SVBI based RM generation: To train NNs for the purpose of RM generation, joint training of both paths (Fig.  4) is required. The configuration of the joint training is as follows: i) the set up of the shared recognition module and the position generative module are identical; ii) the DNN for RSS generative module consists also of 3 layers, but with 32, 64 and 128 nodes, respectively; iii) the number of nodes of the Gaussian coder in the RSS generative module is equal to the number of APs (it is 399 herein); and iv) to train both paths simultaneously, we use the weighted sum of the loss of both paths.
We present the results of joint training in Table I (SVBI(Joint)) and Fig. 6. The RMSE of the positioning error of SVBI(Joint) is slightly lower than that of DLPM. Also the CPA of it within 2.5 m is 2% higher than that of DLPM.
The result of positioning error analysis of the generated RM is illustrated in Fig. 7. To compare the generated RM to the original RM, we evaluate independently using the same test dataset with kNN (k = 3, Fig. 1f). The CPA of them within 2 m are comparable, and the gap between them is less than 2%. Also, with the generated RM, the CPA within 6 m and 10 m are over 70% and 90% respectively. This level of positioning accuracy is adequate for many applications requiring room level positioning accuracy (e.g., telling apart different shops in a big mall). The benefits of RM generation method are in two aspects: i) it smooths the changes of RSS values caused by the temporal and spatial changes of the RoI (Fig. 1e) 11 The definition of RSS estimation error is as follows. Supposed the generated RSSx, the error comparing to its ground truth x is: | x −x 2 2 /N AP 12 Because the proposed RMgeneration algorithm in [15] cannot achieve FbP, they use kNN (k = 3) to evaluate the performance. 13 In [17], they employ affinity propagation based clustering and AP selection methods before applying compressive sensing to FbP and RM generation. The result shown in Table II is the case that no clustering and AP selection.
Comparing our results to the ones reported in [15], [17] and [18], the proposed joint FbP and RM generation seems to provide better results in terms of both positioning and RSS estimation error (Table II). Regarding the positioning error, the mean error of the proposed approach is three times lower than that of distance based inter/extrapolation method in [15] and more than two times lower than that of manifold alignment based method in [18]. The mean positioning error is 20% lower than that of the compressive sensing based approach in [17]. For the RSS estimation error, SVBI based and distance based inter/extrapolation methods obtain comparable performance regarding the mean error. Comparing to the manifold alignment based method, the proposed method herein achieves approximately 25% reduction of RMSE. However, The comparison summarized in Table II is just an indication, since each of the results is based on different data and a different indoor environment.

VI. CONCLUSION
Stochastic variational Bayesian inference (SVBI) is employed herein to accomplish joint fingerprinting based positioning (FbP) and radio map (RM) generation. The performance in terms of both positioning and RSS estimation error of the proposed method is better than that of previous work. The proposed probabilistic model can be implemented based on deep neural networks (DNNs) and trained jointly for both FbP and RM generation. Compared to the FbP approaches based on the single layer neural network (SNN), DNN and k nearest neighbors (kNN), the proposed SVBI based position estimation outperforms them. The reduction of root mean squared error (RMSE) of the localization is up to 40% comparing to that of SNN based FbP. And the cumulative positioning accuracy within 4 m of the proposed FbP method is up to 92% w.r.t. the positioning error, which is approximately 8% higher than of kNN within 4 m. Regarding the performance of SVBI based RM generation, it is comparable to that of the manually collect RM and adequate for the applications, which require room level positioning accuracy.

ACKNOWLEDGMENT
The China Scholarship Council (CSC) supports the first author during this doctoral studies and the second author as a visiting student at ETH Zürich.