PrNet: A Neural Network for Correcting Pseudoranges to Improve
  Positioning with Android Raw GNSS Measurements
We present a neural network for mitigating biased errors in pseudoranges to
improve localization performance with data collected from mobile phones. A
satellite-wise Multilayer Perceptron (MLP) is designed to regress the
pseudorange bias correction from six satellite, receiver, context-related
features derived from Android raw Global Navigation Satellite System (GNSS)
measurements. To train the MLP, we carefully calculate the target values of
pseudorange bias using location ground truth and smoothing techniques and
optimize a loss function involving the estimation residuals of smartphone clock
bias. The corrected pseudoranges are then used by a model-based localization
engine to compute locations. The Google Smartphone Decimeter Challenge (GSDC)
dataset, which contains Android smartphone data collected from both rural and
urban areas, is utilized for evaluation. Both fingerprinting and cross-trace
localization results demonstrate that our proposed method outperforms
model-based and state-of-the-art data-driven approaches.
Xu Weng, Keck Voon Ling, Haochen Liu
PrNet: A Neural Network for Correcting Pseudoranges to Improve Positioning with Android Raw GNSS Measurements

###### Abstract

We present a neural network for mitigating pseudorage bias to improve localization performance with data collected from Android smartphones. We represent pseudorange bias using a pragmatic satellite-wise Multiple Layer Perceptron (MLP), the inputs of which are six satellite-receiver-context-related features derived from Android raw Global Navigation Satellite System (GNSS) measurements. To supervise the training process, we carefully calculate the target values of pseudorange bias using location ground truth and smoothing techniques and optimize a loss function containing the estimation residuals of smartphone clock bias. During the inference process, we employ model-based localization engines to compute locations with pseudoranges corrected by the neural network. Consequently, this hybrid pipeline can attend to both pseudorange bias and noise. We evaluate the framework on an open dataset and consider four application scenarios for investigating fingerprinting and cross-trace localization in rural and urban areas. Extensive experiments demonstrate that the proposed framework outperforms model-based and state-of-the-art data-driven approaches.

 Android smartphones, deep learning, localization, GPS, pseudoranges.

## I Introduction

Since the release of Android raw Global Navigation Satellite System (GNSS) measurements, precise localization using ubiquitous and portable Android smartphones has been expected to enable various exciting localization-based applications, such as precise vehicle navigation, smart management of city assets, outdoor augmented reality, and mobile health monitoring [1]. However, it is difficult to keep such promise because the inferior GNSS chips and antennas mounted in mass-market smartphones lead to large pseudorange noise and bias [2, 3, 4]. While filtering or smoothing can reduce pseudorange noise, it remains challenging to mitigate pseudorange bias that might be caused by multipath, non-line-of-sight (NLOS) propagation, modeling residuals of atmospheric delays, smartphone hardware delays, etc [5].

To address this issue, we propose PrNet, a neural network for correcting pseudoranges to improve positioning with Android raw GNSS measurements. As illustrated in Fig. 1, the underlying idea is to train a neural network by regressing from six satellite-receiver-context-related features to pseudorange bias. The squared loss is optimized for all visible satellites each time. After training the neural network, we can predict the biased errors, eliminate them from pseudoranges, and then feed the corrected pseudoranges into a classical localization engine to compute locations. However, we have to overcome two stumbling obstacles to implementing the above idea.

1) _Feature Selection_: over 30 raw GNSS measurements are logged from Android smartphones [1], and relevant features must be carefully chosen to enhance the performance of the neural network while minimizing computational costs [6].

2) _Data Labeling_: the training data should be labeled with pseudorange bias while we can only obtain the ground truth of smartphones' locations [1]. Previous research has proposed various methods to estimate the pseudorange bias for geodetic GNSS receivers but ignored the pseudorange noise [7, 8, 9, 10]. These methods degrade their own performance when transferred to Android measurements that are about one order of magnitude noisier than geodetic-quality ones.

To this end, we nominate two new features by visualizing Android measurements across various dimensions and derive the target values of pseudorange bias using location ground

Fig. 1: An overview of our PrNet-based localization pipeline. The blue solid and dashed lines represent the biased pseudoranges and unbiased pseudoranges (we assume all bias is positive here for easy illustration), respectively. The red, purple, yellow, and green segments denote the pseudorange bias of satellites SV1-SV4.
truth and the Rauch-Tung-Striebel (RTS) smoothing algorithm [11]. Besides, our experiments show that incorporating estimation residuals of smartphone clock bias into the loss function can enhance the inference ability of the neural network. To recapitulate briefly, our contributions are:

* A pipeline for learning the mapping from six satellite-receiver-context-related inputs to pseudorange bias representation, which is parameterized by a pragmatic satellite-wise MLP. This includes two new proposed inputs--unit geometry vectors and smartphone headings--and a visible satellite mask layer to enable parallel computation.
* Computation methods to derive labels for pseudorange bias and a differentiable loss function involving estimation residuals of smartphone clock bias.
* A comprehensive evaluation from perspectives of horizontal positioning errors, generalization ability, computational load, and ablation analysis. Our codes are available at [https://github.com/ailocar/prnet](https://github.com/ailocar/prnet).

We demonstrate that our proposed PrNet-based localization framework outperforms both the model-based and data-driven state-of-the-art pseudorange-based localization approaches. To the best of our knowledge, we present the first data-driven framework for pseudorange correction and localization over Android smartphone measurements.

## II Motivation

The primary motivation behind this paper is to remove the biased errors present in pseudoranges collected from Android smartphones. To investigate the pseudorange bias and its impact on horizontal positioning accuracy, we derive the pseudorange bias as detailed in Section V and adopt Weighted Least Squares (WLS), Moving Horizon Estimation (MHE), Extended Kalman Filter (EKF), and Rauch-Tung-Striebel (RTS) smoother to compute locations with the biased pseudoranges. We choose a trace of data in the Google Smartphone Decimeter Challenge (GSDC) dataset [1] and display our findings in Fig. 2. As depicted in Fig. 2(a), biased errors are pervasive across all visible satellites and can reach magnitudes up to 10 meters. Such biased errors might be attributed to multipath, NLOS, residuals in atmospheric delay modeling, smartphone hardware interference, etc. Importantly, they are hardly modeled mathematically. Furthermore, Fig. 2(b) clearly shows how the biased pseudoranges directly translate into localization errors that are challenging to mitigate using conventional filtering or smoothing techniques.

## III Related Work

This paper focuses on artificial intelligence (AI) for GNSS localization using pseudoranges, which can be categorized into five types. **(i)**_AI for Pseudorange Correction_: Recently, several learning-based methods have been proposed to predict and correct pseudorange errors using raw GNSS measurements as inputs [8, 9, 10, 12]. However, all these methods use pseudorange errors (comprising noise and bias) to label training data and cannot be transferred to Android raw GNSS measurements directly. **(ii)**_AI for Position Correction_: Various machine learning methods have been proposed to predict offsets between model-based position estimations and ground truth locations [13, 14]. Then, the model-based position estimations are compensated with the learned location offsets. **(iii)**_End-to-end Neural Networks for GNSS_: This type of work directly replaces the model-based positioning engines with deep neural networks [15, 16]. For example, authors in [15] leveraged a set transformer to replace the WLS engine to solve the pseudorange equations linearized about an initial location guess. Test results showed that the set transformer is sensitive to the initial location guess to a certain extent. Compared with the first type, these two kinds of approaches need to learn how to compute locations, but it has been robustly and mathematically well-established. **(iv)**_AI Enhanced Localization Engine_: AI has been utilized to improve the physical models employed in conventional localization engines [17, 18, 19]. For example, a parameter of a filter-based localization engine can be learned instead of being tweaked empirically [19]. **(v)**_AI for Signal Classification_: The final category involves using AI to detect and classify multipath and NLOS propagations. By identifying pseudoranges containing multipath or NLOS errors, these methods can exclude them from the further localization process [20, 21, 22].

## IV Preliminaries of GNSS

After the corrections of atmospheric delays as well as satellite clock offsets [23], the pseudorange measurement \(\rho_{c_{k}}^{(n)}\) from the \(n^{th}\) satellite to a smartphone at the \(k^{th}\) time step is shown below.

\[\rho_{c_{k}}^{(n)}=r_{k}^{(n)}+\delta t_{u_{k}}+\varepsilon_{k}^{(n)} \tag{1}\]

where the subscript \(k\) represents the \(k^{th}\) time step. \(r_{k}^{(n)}\) denotes the geometry distance from the \(n^{th}\) satellite to the smartphone. \(\delta t_{u_{k}}\) represents the clock offsets of the smartphone relative to the GNSS reference time. We wrap up multipath delays, hardware delays, pseudorange noise, and other potential errors in one item \(\varepsilon_{k}^{(n)}\) called pseudorange errors. Then, we can estimate the smartphone's location \(\mathbf{x}_{k}=\left[x_{k},y_{k},z_{k}\right]^{T}\) in the Earth-centered, Earth-fixed (ECEF) coordinate system and its clock offset \(\delta t_{u_{k}}\) by solving the following linear equation system [23] established by \(M\) visible satellites:

\[\mathbf{W}_{k}\mathbf{G}_{k}\left(\mathbf{X}_{k}-\tilde{\mathbf{X}}_{k}\right) =\mathbf{W}_{k}\Delta\mathbf{\rho}_{c_{k}} \tag{2}\]

Fig. 2: Impact of pseudorange bias (Trace “2021-04-28-US-MTV-1” by Pixel4 in GSDC dataset as an example). (a) Pseudorange bias of all visible satellites throughout the trace. (b) Horizontal errors calculated with Vincenty’s formulae using Weighted Least Squares (WLS), Moving Horizon Estimation (MHE), Extended Kalman Filter (EKF), and Rauch-Tung-Striebel Smoother (RTSS).
where \(\mathbf{X}_{k}=\left[x_{k},y_{k},z_{k},\delta t_{u_{k}}\right]^{T}\) is the unknown user state while \(\tilde{\mathbf{X}}_{k}=\left[\tilde{x}_{k},\tilde{y}_{k},\tilde{z}_{k},\delta \tilde{t}_{u_{k}}\right]^{T}\) is an approximation of the user state. \(\mathbf{W}_{k}\) is a diagonal matrix with the reciprocals of 1-\(\sigma\) pseudorange uncertainty of all visible satellites as its main diagonal to weight pseudoranges. The geometry matrix \(\mathbf{G}_{k}\) is calculated with the satellite location \(\mathbf{x}_{k}^{(n)}=\left[x_{k}^{(n)},y_{k}^{(n)},z_{k}^{(n)}\right]^{T}\) and the approximate user location \(\tilde{\mathbf{X}}_{k}\)[23]:

\[\mathbf{G}_{k}=\left[\begin{array}{cccc}a_{x_{k}}^{(1)}&a_{y_{k}}^{(1)}&a_{ z_{k}}^{(1)}&1\\ a_{x_{k}}^{(2)}&a_{y_{k}}^{(2)}&a_{z_{k}}^{(2)}&1\\ \cdots\\ a_{x_{k}}^{(M)}&a_{y_{k}}^{(M)}&a_{z_{k}}^{(M)}&1\end{array}\right] \tag{3}\]

where,

\[a_{x_{k}}^{(n)} =\frac{\tilde{x}_{k}-x_{k}^{(n)}}{\tilde{r}_{k}^{(n)}},\text{ }a_{y_{k}}^{(n)}=\frac{\tilde{y}_{k}-y_{k}^{(n)}}{\tilde{r}_{k}^{(n)}},\text{ }a_{z_{k}}^{(n)}=\frac{\tilde{z}_{k}-z_{k}^{(n)}}{\tilde{r}_{k}^{(n)}}\] \[\tilde{r}_{k}^{(n)} =\sqrt{\left(\tilde{x}_{k}-x_{k}^{(n)}\right)^{2}+\left(\tilde{y} _{k}-y_{k}^{(n)}\right)^{2}+\left(\tilde{z}_{k}-z_{k}^{(n)}\right)^{2}}\] \[n=1,2,3,\cdots,M\]

The pseudorange residual \(\Delta\boldsymbol{\rho}_{c_{k}}\) for the \(M\) visible satellites at the \(k^{th}\) time step are shown as follows.

\[\Delta\boldsymbol{\rho}_{c_{k}}=\left[\Delta\rho_{c_{k}}^{(1)},\Delta\rho_{c_ {k}}^{(2)},...,\Delta\rho_{c_{k}}^{(M)}\right]^{T}\]

where

\[\Delta\rho_{c_{k}}^{(n)} =\rho_{c_{k}}^{(n)}-\tilde{r}_{k}^{(n)}-\delta\tilde{t}_{u_{k}}- \varepsilon_{k}^{(n)}\] \[n=1,2,3,\cdots,M\]

The WLS-based solution to (2) is shown below [23].

\[\mathbf{X}_{k} =\tilde{\mathbf{X}}_{k}+\Delta\mathbf{X}_{k}\] \[=\tilde{\mathbf{X}}_{k}+\left(\mathbf{W}_{k}\mathbf{G}_{k}\right) ^{+}\mathbf{W}_{k}\Delta\boldsymbol{\rho}_{c_{k}} \tag{4}\]

where \(\Delta\mathbf{X}_{k}=\left(\mathbf{W}_{k}\mathbf{G}_{k}\right)^{+}\mathbf{W} _{k}\Delta\boldsymbol{\rho}_{c_{k}}\) is the displacement from the approximate user state \(\tilde{\mathbf{X}}_{k}\) to the true one. The approximate user state \(\tilde{\mathbf{X}}_{k}\) will be updated with the result of (4), and the computation in (4) will be iterated until the accuracy requirement is satisfied.

Note that the pseudorange error \(\varepsilon_{k}^{(n)}\) is unknown in practice. The estimated user state \(\hat{\mathbf{X}}_{k}=\left[\hat{x}_{k},\hat{y}_{k},\hat{z}_{k},\delta\hat{t}_{ u_{k}}\right]^{T}\) in the presence of pseudorange errors is:

\[\hat{\mathbf{X}}_{k}=\tilde{\mathbf{X}}_{k}+\Delta\mathbf{X}_{k}+\left( \mathbf{W}_{k}\mathbf{G}_{k}\right)^{+}\mathbf{W}_{k}\boldsymbol{\varepsilon }_{k}\]

where,

\[\boldsymbol{\varepsilon}_{k}=\left[\varepsilon_{k}^{(1)},\varepsilon_{k}^{(2)},...,\varepsilon_{k}^{(M)}\right]^{T}\]

The resulting state estimation error \(\epsilon_{\mathbf{X}_{k}}\) is:

\[\epsilon_{\mathbf{X}_{k}} =\mathbf{X}_{k}-\hat{\mathbf{X}}_{k}=-\left(\mathbf{W}_{k} \mathbf{G}_{k}\right)^{+}\mathbf{W}_{k}\boldsymbol{\varepsilon}_{k}\] \[=\left[\epsilon_{x_{k}},\epsilon_{y_{k}},\epsilon_{z_{k}}, \epsilon_{\delta t_{u_{k}}}\right]^{T} \tag{5}\]

## V Data Labeling

In this section, we set forth how to compute the target values of pseudorange bias using location ground truth and RTS smoother.

### _Estimating Pseudorange Errors_

According to (1), pseudorange errors can be calculated as:

\[\varepsilon_{k}^{(n)}=\rho_{c_{k}}^{(n)}-r_{k}^{(n)}-\delta t_{u_{k}}\]

However, we do not have the ground truth of the smartphone's clock bias \(\delta t_{u_{k}}\). Thus, we employ its WLS-based estimation \(\delta\hat{t}_{u_{k}}\) to calculate pseudorange errors:

\[\hat{\varepsilon}_{k}^{(n)}=\rho_{c_{k}}^{(n)}-r_{k}^{(n)}-\delta\hat{t}_{u_{k}} \tag{6}\]

Substituting (1) and (5) into (6) yields:

\[\hat{\varepsilon}_{k}^{(n)} =\varepsilon_{k}^{(n)}+\epsilon_{\delta t_{u_{k}}}\] \[=\varepsilon_{k}^{(n)}-\mathbf{h}_{k}^{T}\boldsymbol{\varepsilon }_{k} \tag{7}\]

where \(\mathbf{h}_{k}^{T}\) is the last row vector of \(\left(\mathbf{W}_{k}\mathbf{G}_{k}\right)^{+}\mathbf{W}_{k}\). Theoretically, we can calculate the closed form of the real pseudorange error \(\boldsymbol{\varepsilon}_{k}\) with \(M\) equations defined by (7) using the least squares (LS) algorithm. However, the coefficient matrix of the system of \(M\) equations is close to singular because only two elements are different between any two rows. Consequently, it might cause large errors in numerical computation. Therefore, we use gradient descent to estimate pseudorange errors instead, which will be detailed in Section VII.

### _Smoothing Pseudorange Errors_

The pseudorange error \(\varepsilon_{k}^{(n)}\) couples the biased error \(\mu_{k}^{(n)}\) and unbiased noise \(v_{k}^{(n)}\) together:

\[\varepsilon_{k}^{(n)}=\mu_{k}^{(n)}+v_{k}^{(n)} \tag{8}\]

where,

\[\mu_{k}^{(n)} =\mathrm{E}\left(\varepsilon_{k}^{(n)}\right)\] \[v_{k}^{(n)} =\varepsilon_{k}^{(n)}-\mu_{k}^{(n)}\]

Substituting (8) into (7) yields:

\[\hat{\varepsilon}_{k}^{(n)}=\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}+v_{k}^ {(n)}-\mathbf{h}_{k}^{T}\boldsymbol{v}_{k} \tag{9}\]

where,

\[\mathbf{M}_{k}=\left[\mu_{k}^{(1)},\mu_{k}^{(2)},\cdots,\mu_{k}^{(M)}\right]^{T} \tag{10}\]

\[\boldsymbol{v}_{k}=\boldsymbol{\varepsilon}_{k}-\mathbf{M}_{k}\]

Next, we try to extract the biased error items \(\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}\) from the pseudorange error estimation \(\hat{\varepsilon}_{k}^{(n)}\) to filter out the smartphone's pseudorange noise that has been proven much larger than that of geodetic receivers [4].

**Theorem 1**: _The biased error items \(\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}\) are given by \(\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}=\mathbf{g}_{k}^{(n)}\left(\tilde {\mathbf{x}}_{k}-\mathbf{x}_{k}\right)\), where \(\tilde{\mathbf{x}}_{k}=\left[\tilde{x}_{k},\tilde{y}_{k},\tilde{z}_{k}\right]^{T}\) represents the mean of the WLS-based location estimation \(\hat{\mathbf{x}}_{k}=\left[\hat{x}_{k},\hat{y}_{k},\hat{z}_{k}\right]^{T}\), and \(\mathbf{g}_{k}^{(n)}\) is the unit geometry vector:_

\[\mathbf{g}_{k}^{(n)}=\left[a_{x_{k}}^{(n)},a_{y_{k}}^{(n)},a_{z_{k}}^{(n)} \right]^{T} \tag{11}\] \[\tilde{\mathbf{X}}_{k}=\mathbf{X}_{k}\]
Proof:: Replace the approximate state \(\tilde{\mathbf{X}}_{k}\) with the real state \(\mathbf{X}_{k}\) in (2). Thus, the WLS-based state estimation \(\tilde{\mathbf{X}}_{k}\) is the optimal solution to the following optimization problem:

\[\min_{\tilde{\mathbf{X}}_{k}}||\mathbf{W}_{k}\mathbf{G}_{k}\left(\hat{\mathbf{X }}_{k}-\mathbf{X}_{k}\right)-\mathbf{W}_{k}\Delta\boldsymbol{\rho}_{c_{k}}||^ {2}\]

The optimal \(\hat{\mathbf{X}}_{k}\) satisfies

\[\mathbf{G}_{k}\left(\hat{\mathbf{X}}_{k}-\mathbf{X}_{k}\right)\approx\Delta \boldsymbol{\rho}_{c_{k}}=\boldsymbol{\rho}_{c_{k}}-\mathbf{r}_{k}-\delta t_{u _{k}}=\boldsymbol{\varepsilon}_{k} \tag{12}\]

where,

\[\mathbf{r}_{k}=\left[r_{k}^{(1)},r_{k}^{(2)},\cdots,r_{k}^{(M)} \right]^{T}\] \[\boldsymbol{\rho}_{c_{k}}=\left[\rho_{c_{k}}^{(1)},\rho_{c_{k}}^{ (2)},\cdots,\rho_{c_{k}}^{(M)}\right]^{T}\]

For the \(n^{th}\) satellite, the following equation can be obtained according to (3), (5) and (12):

\[\mathbf{g}_{k}^{(n)}\left(\hat{\mathbf{x}}_{k}-\mathbf{x}_{k}\right)+\mathbf{ h}_{k}^{T}\boldsymbol{\varepsilon}_{k}=\varepsilon_{k}^{(n)} \tag{13}\]

After calculating the expected values of both sides of (13) and rearranging the result, we have

\[\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}=\mathbf{g}_{k}^{(n)}\left( \tilde{\mathbf{x}}_{k}-\mathbf{x}_{k}\right)\]

**Corollary 1.1**: _The biased error items \(\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}\) are given by \(\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}=\bar{r}_{k}^{(n)}-r_{k}^{(n)}\), where \(\bar{r}_{k}^{(n)}=||\mathbf{x}_{k}-\mathbf{x}_{k}^{(n)}||_{2}\)._

Proof:: Using Taylor expansion at \(\mathbf{x}_{k}\), we have

\[\bar{r}_{k}^{(n)} =||\tilde{\mathbf{x}}_{k}-\mathbf{x}_{k}^{(n)}||_{2}\] \[\approx||\mathbf{x}_{k}-\mathbf{x}_{k}^{(n)}||_{2}+\mathbf{g}_{k }^{(n)}\left(\tilde{\mathbf{x}}_{k}-\mathbf{x}_{k}\right)\] \[=r_{k}^{(n)}+\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}\]

This paper uses \(\bar{\varepsilon}_{k}^{(n)}=\bar{r}_{k}^{(n)}-r_{k}^{(n)}\) to label training data. We consider the RTS smoother-based positioning solution as \(\tilde{\mathbf{x}}_{k}\). The smoothing process of RTS smoother for Android raw GNSS measurements is detailed in [24]. Fig. 3 displays the pseudorange errors of four visible satellites before and after smoothing, indicating that the smoothed pseudorange errors are much smoother than the original ones and can represent the biased components. Note that the RTS smoother needs about 120 epochs for convergence. Therefore, during the training process, the data of the first 120 observation epochs are discarded.

## VI Feature Selection

To enable better representation and higher efficiency of the neural network, we meticulously select input features, including the commonly utilized ones in the community and some novel features tailored specifically for Android smartphones.

### _Carrier-to-noise Density Ratio \(C/N_{0}\)_

\(C/N_{0}\) has been proven related to pseudorange errors [8, 9, 10]. The \(C/N_{0}\) of an Android smartphone is generally smaller than 50 dB-Hz and can be normalized accordingly:

\[F_{1_{k}}^{(n)}=\frac{\mathrm{Cn0DbHz}}{50}\]

where "Cn0DbHz" is one Android raw GNSS measurement.

### _Elevation Angles of Satellites_

Satellite elevation angles are also closely correlated with pseudorange errors [8, 9, 10]. We estimate the elevation angle \(E_{k}^{(n)}\) of the \(n^{th}\) satellite using the WLS-based positioning solution \(\hat{\mathbf{x}}_{k}\) and the satellite location \(\mathbf{x}_{k}^{(n)}\)[23]. And it is standardized to \([-1,1]\) as follows:

\[F_{2_{k}}^{(n)}=\left[\sin E_{k}^{(n)},\cos E_{k}^{(n)}\right]\]

### _Satellite ID_

We try to predict pseudorange errors of different visible satellites indexed by "Svid". In this work, we only consider GPS L1 signals, and the corresponding satellite ID (PRN index) ranges from 1 to 32, so we normalize it by 32.

\[F_{3_{k}}^{(n)}=\frac{\mathrm{Svid}}{32}\]

where "Svid" is one Android raw GNSS measurement.

### _Position Estimations_

The surrounding environment of each location possesses unique terrain characteristics, such as the distribution of buildings, mountains, tunnels, and skyways, determining the multipath/NLOS context at the site. Thus, it is reasonable to include position estimation in the input features [10, 12]. We can use the WLS-based position estimations that is provided as knowns in the GSDC dataset. To distinguish between closely located sites, we utilize latitude and longitude with fine-grained units, i.e., degree (\(\varphi_{deg_{b}}\)), minute (\(\varphi_{min_{k}}\)), and second

Fig. 3: Pseudorange errors before and after smoothing (using four satellites from Trace “2021-04-28-US-MTV-1” by Pixel 4 in GSDC dataset as examples)
(\(\varphi_{sec_{k}}\)) for latitude, and degree (\(\lambda_{deg_{k}}\)), minute (\(\lambda_{min_{k}}\)), and second (\(\lambda_{sec_{k}}\)) for longitude, which can be standardized as follows:

\[F_{4_{k}}=\left[\frac{\varphi_{deg_{k}}}{90},\frac{\varphi_{min_{k}}}{60},\frac {\varphi_{sec_{k}}}{60},\frac{\lambda_{deg_{k}}}{180},\frac{\lambda_{min_{k}}}{ 60},\frac{\lambda_{sec_{k}}}{60}\right]\]

### _Unit Geometry Vectors_

The direction of signal propagation can be depicted by the unit geometry vector from the satellite to the smartphone, which is periodic at each site [12]. We visualize the unit geometry vectors in Fig. 4(c). Fig. 4(b) shows that the blue, yellow, and green traces were captured along similar routes and directions, but Fig. 4(a) indicates that only the yellow and green traces share similar patterns of pseudorange bias. It is on the grounds that the unit geometry vectors of yellow and green traces are close to each other but far away from the blue one, as displayed in Fig. 4(c). Hence, pseudorange bias are tightly correlated to unit geometry vectors.

We convert the unit geometry vector \(\mathbf{g}_{k}^{(n)}\) from the ECEF coordinate system to the north-east-down (NED) coordinate system to couple it to the location information (WLS-based). Each item in the unit vector falls within \([-1,1]\) and can be directly used as input features:

\[F_{5_{k}}^{(n)}=\mathbf{g}_{\mathrm{NED}_{k}}^{(n)}{}^{T}\]

### _Heading Estimations_

Fig. 4(b) shows that the blue and orange traces were collected along similar routes. And Fig. 4(c) indicates that their unit geometry vectors are also close to each other. Their pseudorange bias, however, are quite different, as shown in Fig. 4(a). It might be caused by the opposite moving directions along which the two data files are collected. According to the setup of Android smartphones [1], the moving direction determines the heading of smartphones' antennas, which may affect the GNSS signal reception. Therefore, we include smartphone headings \(\theta_{k}\) into the input features, which can be approximately represented by the unit vector pointing from the current smartphone's location to the next one:

\[\theta_{k}=\frac{\hat{\mathbf{x}}_{k+1}-\hat{\mathbf{x}}_{k}}{||\hat{\mathbf{ x}}_{k+1}-\hat{\mathbf{x}}_{k}||_{2}}\]

Next, we convert the smartphone heading \(\theta_{k}\) from the ECEF coordinate system to the NED coordinate system constructed at the current location \(\hat{\mathbf{x}}_{k}\) and get \(\theta_{\mathrm{NED}_{k}}\). Each item in the unit vector \(\theta_{\mathrm{NED}_{k}}\) falls within \([-1,1]\). Thus, it can be directly included as an input feature.

\[F_{6_{k}}=\theta_{\mathrm{NED}_{k}}{}^{T}\]

To sum up, we choose the following input features:

\[\mathbf{F}_{k}^{(n)}=\left[F_{1_{k}}^{(n)},F_{2_{k}}^{(n)},F_{3_{k}}^{(n)},F_{ 4_{k}},F_{5_{k}}^{(n)},F_{6_{k}}\right]^{T}\]

where \(F_{1_{k}}^{(n)}\), \(F_{2_{k}}^{(n)}\), \(F_{3_{k}}^{(n)}\), and \(F_{5_{k}}^{(n)}\) vary across different satellites while \(F_{4_{k}}\) and \(F_{6_{k}}\) are common features that are shared among all visible satellites at a given observation epoch.

## VII PrNet

The MLP has proved itself in learning high-dimensional representation for regression or classification as a single network [25] or a sublayer module [26]. The proposed PrNet

Fig. 4: (a) Pseudorange bias of satellite PRN 2 along the traces collected by Pixel 4 in GSDC dataset. Different traces are plotted in a single figure to facilitate easy comparison while the time axis does not correspond to the exact moments when the data were collected; (b) Traces and directions along which each data file is collected; (c) Trajectories of terminal points of the unit geometry vectors from satellite PRN 2 to Pixel 4 on the unit sphere centered at Pixel 4.

Fig. 5: Diagram of PrNet. PrNet comprises a satellite-wise MLP and a visible satellite mask; \(B\) represents the batch size; \(F\) denotes the dimension of input features; \(H\) is the number of hidden neurons.
is based on a deep MLP that learns the mapping from six satellite-receiver-context-related features to pseudorange bias, i.e., \(\mu_{k}^{(n)}=f\left(\mathbf{F}_{k}^{(n)}\right)\). The diagram of PrNet is shown in Fig. 5. Our approach involves passing a batch of inputs through the neural network to compute the corresponding pseudorange bias. Each sample in the batch represents all visible satellites at a given time step, and all the satellites are processed by the same MLP, called satellite-wise MLP.

To address the challenge of varying-number satellites at different time steps, we compute the pseudorange bias of all 32 satellites in the GPS constellation each time, where the inputs of non-visible satellites are set to zero. After the output layer, we add a "visible satellite mask" to filter out the meaningless output of non-visible satellites and retain the information of only visible satellites. This approach allows us to execute parallel computation on inputs of varying quantities.

PrNet is designed to learn the representation of the pseudorange bias \(\mu_{k}^{(n)}\). However, the training data are labeled by \(\bar{\varepsilon}_{k}^{(n)}=\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\mathbf{M}_{k}\). To account for this, we add the estimation residual of smartphone clock bias \(-\mathbf{h}_{k}^{T}\hat{\mathbf{M}}_{k}\) in the loss function to align the output of PrNet and the target value \(\bar{\varepsilon}_{k}^{(n)}=\mu_{k}^{(n)}-\mathbf{h}_{k}^{T}\hat{\mathbf{M}}_ {k}\):

\[\mathcal{L}=\sum_{n=1}^{M}||f\left(\mathbf{F}_{k}^{(n)}\right)-\mathbf{h}_{k} ^{T}\hat{\mathbf{M}}_{k}-\bar{\varepsilon}_{k}^{(n)}||^{2}\]

where,

\[\hat{\mathbf{M}}_{k}=\left[\hat{\mu}_{k}^{(1)},\hat{\mu}_{k}^{(2) },\cdots,\hat{\mu}_{k}^{(M)}\right]^{T}\] \[\hat{\mu}_{k}^{(n)}=f\left(\mathbf{F}_{k}^{(n)}\right)\]

## VIII Implementation Details

### _Dataset_

We conduct extensive evaluations on the GSDC 2021 dataset [1]1. Most of the GSDC 2021 dataset was collected in rural areas, and only a few traces were located in urban areas. As illustrated in Fig. 6, we use the dataset to design four scenarios that encompass rural fingerprinting, rural cross-trace, urban fingerprinting, and urban cross-trace localization. Scenario I and Scenario II share the same training data, totaling 12 traces. Scenario III and Scenario IV share the same training data, totaling 2 traces. The training data was all collected using Pixel 4. The testing datasets for the four scenarios consist of 2, 1, 1, and 1 trace, respectively.

Footnote 1: We opted not to utilize the GSDC 2022 dataset due to the absence of ground truth altitude information in most of its traces, which is essential for computing the target values of pseudorange bias.

### _Baseline Methods_

#### V-B1 Model-based methods

We implement the vanilla WLS-based, two filtering-based (MHE and EKF), and one smoothing-based (RTS smoother) localization engines as baseline methods. More details about them can be referred to [24].

#### V-B2 Pbc-Rf

Point-based Correction Random Forest (PBC-RF) represents a state-of-the-art _machine learning_ approach for predicting pseudorange errors in _specialized GNSS receivers_, as detailed in [10].

#### V-B3 Fcnn-Lstm

Fully Connected Neural Network with Long Short-term Memory (FCNN-LSTM) stands as a state-of-the-art _deep learning_ model designed for the prediction of pseudorange errors in _specialized GNSS receivers_, as detailed in [9]. PBC-RF and FCNN-LSTM have not been made available as open-source software at this time. We implement them as baseline methods according to [9, 10]. Our implementations are available at [https://github.com/Aaron-WengXu](https://github.com/Aaron-WengXu).

#### V-B4 Set Transformer

To the best of our knowledge, it is the only open-source state-of-the-art work that performs the data-driven art on Android raw GNSS measurements [15]. We trained the neural network as one baseline method. Note that its inference performance is tightly related to the initial locations of smartphones that are measured by the "magnitude of initialization ranges" \(\mu\)[15]. We determine the value of \(\mu\) by calculating the \(95^{th}\) percentile of the horizontal localization errors obtained from the model-based approaches. The set transformer we trained are available at [https://github.com/ailocar/deep_gnsss](https://github.com/ailocar/deep_gnsss).

### _PrNet Implementation_

The proposed neural network is implemented using PyTorch and d2l libraries [27]. After hyper-parameter tuning, we set the number of hidden neurons \(H\) to 40 and the number of hidden layers \(L\) to 20. We use the Adam optimizer with a learning rate decaying from \(1\times 10^{-2}\) to \(1\times 10^{-7}\) for optimizing its weights. No regularization techniques are employed in the training process. In Scenario I and Scenario II (rural areas), the optimization of PrNet can converge within 0.5k iterations. In Scenario III and Scenario IV (urban areas), it takes about 3-5k iterations to polish up the neural network. We utilize WLS, MHE, EKF, and RTS smoother to process the pseudoranges corrected by PrNet for localization.

## IX Experiments

### _Horizontal Localization_

The primary focus of smartphone-based localization is on horizontal positioning errors. Therefore, we quantitatively compare our proposed frameworks against the baseline methods across four scenarios by computing their horizontal errors with Vincenty's formulae. Fig. 7 displays the empirical cumulative distribution function (ECDF) of horizontal errors. The corresponding horizontal scores are summarized in Table I.

The proposed PrNet+RTS smoother thoroughly outperforms all the baseline methods that employ classical model-based localization engines or sophisticated data-driven models. Additionally, by comparing the vanilla model-based approaches against their PrNet-enhanced versions, PrNet can reduce the horizontal scores by up to 74% (PrNet+RTS smoother in Scenario I). The set transformer is tied to the "magnitude of initialization ranges" \(\mu\) and tends to yield horizontal scores around this particular value, which explains its bad performance in urban areas where \(\mu\) is initialized with large magnitudes. The original intention of PBC-RF and FCNN-LSTM to process data captured from geodetic GNSS receivers limits their ability to correct pseudoranges for smartphones. Nevertheless, they outperform PrNet+WLS and PrNet+MHE
in Scenario II and III. It is due to the fact that we equip them with our best localization engine (RTS smoother) that already surpasses PrNet+WLS and PrNet+MHE in these scenarios.

### _Computational Load_

Deep learning promises supreme performance at the cost of substantial computational load. We summarize the computational complexity of PrNet and the other two deep learning models, i.e., set transformer and FCNN-LSTM, in Table II. In this round of competition, the set transformer outperforms the other two deep learning models even though its computational complexity is \(\mathcal{O}(M^{2})\). Such efficiency is credited to the transformer's parallel computation [27] and fewer sequential operations [15] than the other two methods.

Fig. 6: (a) Scenario I: rural fingerprinting. (b) Scenario II: rural cross-trace. (c) Scenario III: urban fingerprinting. (d) Scenario IV: urban cross-trace.

Fig. 7: ECDF of horizontal errors in 4 scenarios. (a) Scenario I. (b) Scenario II. (c) Scenario III. (d) Scenario IV.
### _Ablation Studies_

In Table III, we conduct an extensive ablation study to investigate the reliance of PrNet on our design choices, including two novel input features, loss function design, and label computation. We also assess the impact of position estimations, an input feature recently introduced in [10], on the resulting horizontal positioning errors. Furthermore, we analyze the scalability of PrNet by comparing models of different sizes. We present the results of PrNet+RTS smoother averaged over the four scenarios. Our best model is considered a baseline (Row 9).

The results verify that all our design choices are reasonable. Specifically, through a stepwise removal of individual features (Rows 1-3), we observe that the two novel input features (unit geometry vectors and heading estimations) significantly impact the localization performance. In contrast, the position estimation has a trivial impact. Row 5-6 shows how the localization performance degrades if we don't involve the estimation residuals of smartphone clock bias or smoothed pseudorange errors in the loss function. Row 7 tells that PeNet can be scaled down to a smaller size with negligible performance loss, suggesting its potential for deployment on the smartphone or edge sides. Row 8 indicates that increasing the size of PrNet cannot improve its performance; in fact, it diminishes performance due to overfitting, which arises from an excessive number of learnable weights in PrNet.

### _Cross-phone Evaluation_

To investigate the generalization ability of PrNet on various mass-market smartphones, we perform cross-phone evaluations using PrNet+RTS smoother and summarize our results in Fig. 8 (other PrNet-based methods share similar results). The training data in the four scenarios are collected by Pixel 4. During the inference process, besides the data collected by Pixel 4, we also use data from other smartphones for evaluation. Note that Google used various combinations of smartphones to collect data along different traces2.

Footnote 2: In Scenario I, the data collected by Mi 8 is abnormal so that we exclude it from our analysis.

The results suggest that PrNet can be robustly adopted across various smartphones in rural areas (Scenario I and II), but its performance degrades when utilized on Samsung S20 Ultra in urban settings (Scenarios III and IV). Fig. 8 indicates that, in the urban areas, Samsung S20 Ultra obtains better localization performance using the standard RTS smoother compared to the performance of Pixel 4 enhanced by PrNet. Therefore, the performance gap between these two phones in urban environments leads to large data heterogeneity, which could be a potential factor behind the adaptation failures.

## X Conclusion

The proposed PrNet-based framework can regress the biased errors in pseudoranges collected by Android smartphones from six satellite-receiver-context-related inputs and eliminate them for better localization performance. We introduce two novel input features and meticulously calculate the target values of pseudorange bias to guide a satellite-wise MLP in learning a better representation of pseudorange bias than prior work. The comprehensive evaluation demonstrates its exceptional performance compared to the state-of-the-art approaches.

Our future work includes: 1) more advanced deep learning models can be explored to learn the satellite and temporal correlation; 2) the pseudorange-correction neural network can be trained using location ground truth in an end-to-end way; 3) more open datasets will be collected using other modalities of sensors as ground truth; 4) data augmentation strategies can be leveraged to enhance the generalization ability across heterogeneous data.

Fig. 8: Cross-phone Evaluation.