# Gated Recurrent Unit with RSSIs from Heterogeneous Network for Mobile Positioning

Authors: Junxiang Wang; Canyang Guo; Ling Wu
Journal: Mobile Information Systems
 (2021)

---

## Abstract

Recently, research studies on Location-Based Services (LBSs) based on networks including cellular network and Wi-Fi network have gradually become popular. Received Signal Strength Indicators (RSSIs) from the network can be detected and collected by mobile devices to estimate the locations without adopting the Global Positioning System (GPS). Previous research studies utilized the RSSIs of only cellular network or only Wi-Fi network to estimate location, which leads to a two-fold predicament involving error limits of cellular network-based methods and environmental constraints of Wi-Fi network-based methods. In addition, accommodating a highly temporal dependence of RSSI series data, this paper proposed a mobile positioning system based on Gated Recurrent Unit (GRU) with RSSIs from the heterogeneous network. GRU learns the temporal correlation of RSSIs and the relationship between RSSIs and GPS coordinates to estimate the locations of mobile devices. A large number of real experiments have been carried out to verify the performance of the proposed method, and experimental results demonstrate that the proposed method has lower errors (i.e., 5.86 m and 75% of errors within 4 m) compared with Neural Network (NN), Recurrent Neural Network (RNN), and Long Short-Term Memory (LSTM).


---

## Body

## 1. Introduction

The rapid development of the cellular network, Wi-Fi network, and mobile devices has promoted the Location-Based Services (LBSs) which can provide positioning services under the current locations of mobile devices by Global Positioning System (GPS) or network positioning method [1–3]. GPS is widely equipped in many mobile devices such as smartphones, cars, airplanes, and so on and shows excellent location performance [4]. However, there are some disadvantages with GPS for it may not work well in the situations of the indoor environment, urban roads, or multipath propagation of wireless signals [5]. In addition, higher power consumption is another reason that researchers take significant focus on other positioning methods including cellular network signal-based [1, 6] and Wi-Fi network signal-based [7–12] positioning methods.For cellular network signals, they can be analysed to estimate the locations of mobile devices and are widely employed in outdoor environments where cellular network covered. However, positioning methods adopting cellular network signals may cause larger errors compared with the methods of adopting Wi-Fi network signals [8]. Therefore, the methods based on Wi-Fi network signals are usually utilized to detect and analyse the Received Signal Strength Indicators (RSSIs) from Wi-Fi access points (APs) for accurate locations of the indoor environment [8]. They utilize machine learning algorithms including Neural Network (NN), Convolutional Neural Network (CNN), and Recurrent Neural Network (RNN) to analyse the correlation between coordinates of GPS and RSSIs to extract features to estimate the locations of mobile devices [5, 7, 9, 13]. None is perfect, although Wi-Fi-based methods can provide accurate positioning, they may be invalid in outdoor environments where there are no or rare APs [9].Considering of two-fold predicament involving error limits of the cellular network-based method and environmental constraints of the Wi-Fi network-based method, this paper adopts a positioning method based on heterogeneous network, which considers RSSIs from cellular network and Wi-Fi network. In addition, to accommodate the temporal dependence of RSSIs, the Gated Recurrent Unit (GRU) is utilized to extract the temporal characteristics of RSSI sequence and the correlation between RSSIs and GPS coordinates to estimate the locations of mobile devices. In summary, this paper aims to propose a mobile positioning system based on GRU with RSSIs from the heterogeneous network, which can provide accurate locations if there are network signals no matter cellular network signals or Wi-Fi network signals. A large number of experiments have been carried out in this paper, and experimental results show that the proposed method has better estimation performance (i.e., 5.86 m and 75% of errors within 4 m) than comparative methods.The remainder of this paper is organized as follows. Section2 represents the related work. Section 3 proposes a mobile positioning system based on GRU with RSSIs from the heterogeneous network. The practical experimental results and discussion are illustrated in Section 4. Section 5 elaborates the conclusions and future research directions.


## 2. Related Work

LBS is based on the network positioning method adopting machine learning techniques to estimate the locations of mobile devices by RSSIs from networks. Firstly, these methods utilize mobile devices to detect and collect data including coordinates of GPS and RSSIs from cellular network or Wi-Fi network and store them in the fingerprinting database [14–16]. Secondly, machine learning models are employed to capture the correlation between GPS coordinates and RSSIs. Finally, real-time RSSIs obtained by mobile devices are input to the trained model to estimate coordinates in real scenes.Positioning model plays a critical role in the above methods, and how to develop an appropriate model has been widely studied by researchers. Wang et al. proposed a Wi-Fi fingerprint positioning method, which utilized thek-nearest neighbors algorithm to choose near reference points to improve positioning performance [17]. Although this method had lower errors, it would cost a lot of computation when estimating locations. Dai et al. proposed an indoor positioning method based on NN with RSSIs from Wi-Fi network, which learned the relationship among received signal strength signals transforming section, the raw data denoising section, and the node locating section to estimate locations by multilayer NN [18]. Zhang and Yi proposed a CNN-based Wi-Fi fingerprint positioning method which utilized a convolutional layer to extract the local feature of RSSIs to estimate locations [6]. Different structures of CNN and k-nearest neighbors were performed on public datasets, and experimental results showed that CNN-based method had lower errors with the accuracy of 90.83% correct positioning.Although NN and CNN can estimate the locations effectively, they ignore the temporal characteristics of RSSIs. Therefore, researchers adopted the RNN-based method to learn the temporal dependence of RSSIs series data to improve the performance of positioning estimation [9, 13, 16]. Shi et al. proposed an indoor positioning method based on Long Short-Term Memory (LSTM) with RSSIs from Wi-Fi APs [19]. They chose appropriate APs for learning temporal features of RSSIs by LSTM, and the proposed method had been demonstrated to have better performance in experimental environments. Hoang et al. [12] compared the indoor positioning performance of multiple types of RNN with various inputs and outputs. Experimental results proved that LSTM with inputs including RSSIs and previous predicted location to predict multiple locations obtained the best performance. Although this method had estimation for the indoor environment, it would be invalid where there were no Wi-Fi signals. Therefore, this paper aims to propose a mobile positioning system based on GRU with RSSIs from the heterogeneous network, which can provide accurate locations if there are network signals no matter cellular network signals or Wi-Fi network signals.


## 3. Positioning System

### 3.1. Positioning Server

This paper proposes a mobile positioning system (shown in Figure1) based on GRU with RSSIs from the heterogeneous network (i.e., cellular network and Wi-Fi network). The system consists of a mobile station, positioning server, database server, and model server, which will be introduced in the following.Figure 1
Proposed positioning system.


#### 3.1.1. Mobile Station

In the training stage, the function of the mobile station is to detect and receive the coordinates from GPS and RSSIs from cellular network and Wi-Fi network, and the received data are transmitted to the positioning server for positioning model training. In the testing stage, the function of the mobile station is to detect and receive RSSIs from the cellular network and Wi-Fi network and transmit the received data to the positioning server to estimate the positioning coordinates.


#### 3.1.2. Positioning Server

In the training stage, the positioning system transmits the received data to the database server for storage. The estimation model will be trained by these data stored in the model server. In the testing stage, the positioning system can download the trained model from the model server to provide location estimation.


#### 3.1.3. Database Server

The function of the database server is to keep the data including coordinates of GPS and RSSIs from the cellular network and Wi-Fi network for the training of the estimation model.


#### 3.1.4. Model Server

The function of the database of the model server is to store the trained model. When positioning, the positioning server can download the trained model from the model server.


### 3.2. Positioning Model

#### 3.2.1. Data Preprocessing

The dataset collected by the mobile station is divided into the training setD1 and testing set D2. D1 and D2 are made up of m and n labeled samples, which are expressed as Ri,lii=1m and Ri,lii=1n. Among them, Ridenotes i-th RSSI (expressed as equation (1)), which consists of cellular network signals Rci (expressed as equation (2)) and Wi-Fi network signals Rwi (expressed as equation (3)). li is the i-th coordinate of GPS including longitude lxi and latitude lyi (expressed as equation (4)).(1)Ri=Rci,Rwi,(2)Rci=rc,1i,rc,2i,...,rc,pi,(3)Rwi=rw,1i,rw,2i,...,rw,qi,(4)li=lxi,lyi,where p and q denote the number of base stations and APs.Considering that some road segments are not covered by Wi-Fi network signals, the corresponding encodings of these network signals are expressed with 0. Also, this paper adopts the max-min function to normalize the RSSI data and coordinates of GPS, which is expressed as follows:(5)normalizedi=observei−observe−observe+−observe−,ifobservei≠0,0,otherwise,where observei is the observed value (e.g., longitude, latitude, and RSSIs) in the ith record and normalizedi is the normalized value of observed values. observe+ and observe− represent the maximum and minimum of corresponding data category, respectively.


#### 3.2.2. Positioning Model Based on Gated Recurrent Unit with Heterogeneous Network

Considering that the outputs of NN are only related to the current inputs, this mechanism makes NN unable to process time-series data. RNN is a kind of variant of NN, which is usually employed in the scene of processing time-series data. Accommodating the gradient disappearance of RNN, LSTM is proposed by researchers to extract the long-term time-series data [19, 20]. GRU is a variant of LSTM, which is provided with the capability of dealing with long-term dependency and cheaper structure compared with LSTM (about a third of the parameters reduced) [18, 21–23].This paper embeds the RSSIs data from the cellular network or Wi-Fi network and coordinates of GPS in the input layer and the output layer of the GRU model, respectively, and develops an effective positioning method whose structure is shown in Figure2.Figure 2
Proposed positioning model.The input of the proposed method is a two-dimensional matrix, and each of the dimensions denotes memory lengtht and RSSIs data, which is expressed as follows:(6)xi=rc,1,1i,rc,2,1i,…,rc,p,1i,rw,1,1i,rw,2,1i,…,rw,p,1irc,1,2i,rc,2,2i,…,rc,p,2i,rw,1,2i,rw,2,2i,…,rw,p,2i⋮⋮⋮⋮⋮⋮rc,1,ti,rc,2,ti,…,rc,p,ti,rw,1,ti,rw,2,ti,…,rw,p,ti.GRU contains a reset gaterjand an update gate zj to deal with past, present, and future information. The calculation formula of the reset gate is expressed as follows:(7)rj=σWrxj+Urht−1j,where Wr and Ur are the weights of the reset gate, which will be optimized in the training stage, x and ht−1 denote the current input and previous hidden state, respectively, j is the j-th element of vectors, and σ denotes activation function, namely, sigmoid, which is computed as follows:(8)σa=11−ea.The calculation formula of the update gate is expressed as follows:(9)zj=σWzxj+Uzht−1j.The hidden unit of timet is computed as follows:(10)hjt=zjhjt−1+1−zjh˜jt.The formula ofh˜jt is expressed as follows:(11)h˜jt=ϕWxj+Ur⊙ht−1j,where ϕ denotes tanh function as shown in the following equation:(12)ϕa=ea−e−aea+e−a.In equation (11), the reset gate is utilized to weigh the impacts of previously hidden layer information and current input layer information on the current hidden layer. The greater the reset gate rj, the greater the influence of previously hidden layer information. In equation (10), the update gate zj controls the effect of previously hidden layer information on the current hidden layer.The output of the proposed method is a one-dimensional matrix containing a set of latitude and longitude coordinates. After denormalization, it can be expressed as follows:(13)yi=lx,ti,ly,ti.In addition, the loss function of the proposed method adopts quadratic loss, which is expressed as follows:(14)JW,b=1m∑i=1mLW,b;x^i,y^i=1m∑i=1my^i−yi2,where x^i and y^i are the i-th observed values of RSSIs and coordinates of GPS.The purpose of training is to obtain the parametersW and b which can minimize the value of the loss function. This paper utilizes the backpropagation algorithm to optimize the proposed model, and the optimization process is shown in Algorithm 1.Algorithm 1:Training of GRU.
(1)
Require: loss function J(W,b), initial parameter W, b(2)
Normalize the features of input: equation (5)(3)
WhileJ not converged Do(4)
Selectk samples from the training set randomly(5)
For each sample Do(6)
Input layer: equation (6)(7)
Hidden layer: equations (7)–(12)(8)
Output layer: equation (13)(9)
Compute the loss function: equation (14)(10)
End For(11)
Compute the gradients of weights(12)
Update the weights(13)
End While(14)
ReturnW, b


## 3.1. Positioning Server

This paper proposes a mobile positioning system (shown in Figure1) based on GRU with RSSIs from the heterogeneous network (i.e., cellular network and Wi-Fi network). The system consists of a mobile station, positioning server, database server, and model server, which will be introduced in the following.Figure 1
Proposed positioning system.


### 3.1.1. Mobile Station

In the training stage, the function of the mobile station is to detect and receive the coordinates from GPS and RSSIs from cellular network and Wi-Fi network, and the received data are transmitted to the positioning server for positioning model training. In the testing stage, the function of the mobile station is to detect and receive RSSIs from the cellular network and Wi-Fi network and transmit the received data to the positioning server to estimate the positioning coordinates.


### 3.1.2. Positioning Server

In the training stage, the positioning system transmits the received data to the database server for storage. The estimation model will be trained by these data stored in the model server. In the testing stage, the positioning system can download the trained model from the model server to provide location estimation.


### 3.1.3. Database Server

The function of the database server is to keep the data including coordinates of GPS and RSSIs from the cellular network and Wi-Fi network for the training of the estimation model.


### 3.1.4. Model Server

The function of the database of the model server is to store the trained model. When positioning, the positioning server can download the trained model from the model server.


## 3.1.1. Mobile Station

In the training stage, the function of the mobile station is to detect and receive the coordinates from GPS and RSSIs from cellular network and Wi-Fi network, and the received data are transmitted to the positioning server for positioning model training. In the testing stage, the function of the mobile station is to detect and receive RSSIs from the cellular network and Wi-Fi network and transmit the received data to the positioning server to estimate the positioning coordinates.


## 3.1.2. Positioning Server

In the training stage, the positioning system transmits the received data to the database server for storage. The estimation model will be trained by these data stored in the model server. In the testing stage, the positioning system can download the trained model from the model server to provide location estimation.


## 3.1.3. Database Server

The function of the database server is to keep the data including coordinates of GPS and RSSIs from the cellular network and Wi-Fi network for the training of the estimation model.


## 3.1.4. Model Server

The function of the database of the model server is to store the trained model. When positioning, the positioning server can download the trained model from the model server.


## 3.2. Positioning Model

### 3.2.1. Data Preprocessing

The dataset collected by the mobile station is divided into the training setD1 and testing set D2. D1 and D2 are made up of m and n labeled samples, which are expressed as Ri,lii=1m and Ri,lii=1n. Among them, Ridenotes i-th RSSI (expressed as equation (1)), which consists of cellular network signals Rci (expressed as equation (2)) and Wi-Fi network signals Rwi (expressed as equation (3)). li is the i-th coordinate of GPS including longitude lxi and latitude lyi (expressed as equation (4)).(1)Ri=Rci,Rwi,(2)Rci=rc,1i,rc,2i,...,rc,pi,(3)Rwi=rw,1i,rw,2i,...,rw,qi,(4)li=lxi,lyi,where p and q denote the number of base stations and APs.Considering that some road segments are not covered by Wi-Fi network signals, the corresponding encodings of these network signals are expressed with 0. Also, this paper adopts the max-min function to normalize the RSSI data and coordinates of GPS, which is expressed as follows:(5)normalizedi=observei−observe−observe+−observe−,ifobservei≠0,0,otherwise,where observei is the observed value (e.g., longitude, latitude, and RSSIs) in the ith record and normalizedi is the normalized value of observed values. observe+ and observe− represent the maximum and minimum of corresponding data category, respectively.


### 3.2.2. Positioning Model Based on Gated Recurrent Unit with Heterogeneous Network

Considering that the outputs of NN are only related to the current inputs, this mechanism makes NN unable to process time-series data. RNN is a kind of variant of NN, which is usually employed in the scene of processing time-series data. Accommodating the gradient disappearance of RNN, LSTM is proposed by researchers to extract the long-term time-series data [19, 20]. GRU is a variant of LSTM, which is provided with the capability of dealing with long-term dependency and cheaper structure compared with LSTM (about a third of the parameters reduced) [18, 21–23].This paper embeds the RSSIs data from the cellular network or Wi-Fi network and coordinates of GPS in the input layer and the output layer of the GRU model, respectively, and develops an effective positioning method whose structure is shown in Figure2.Figure 2
Proposed positioning model.The input of the proposed method is a two-dimensional matrix, and each of the dimensions denotes memory lengtht and RSSIs data, which is expressed as follows:(6)xi=rc,1,1i,rc,2,1i,…,rc,p,1i,rw,1,1i,rw,2,1i,…,rw,p,1irc,1,2i,rc,2,2i,…,rc,p,2i,rw,1,2i,rw,2,2i,…,rw,p,2i⋮⋮⋮⋮⋮⋮rc,1,ti,rc,2,ti,…,rc,p,ti,rw,1,ti,rw,2,ti,…,rw,p,ti.GRU contains a reset gaterjand an update gate zj to deal with past, present, and future information. The calculation formula of the reset gate is expressed as follows:(7)rj=σWrxj+Urht−1j,where Wr and Ur are the weights of the reset gate, which will be optimized in the training stage, x and ht−1 denote the current input and previous hidden state, respectively, j is the j-th element of vectors, and σ denotes activation function, namely, sigmoid, which is computed as follows:(8)σa=11−ea.The calculation formula of the update gate is expressed as follows:(9)zj=σWzxj+Uzht−1j.The hidden unit of timet is computed as follows:(10)hjt=zjhjt−1+1−zjh˜jt.The formula ofh˜jt is expressed as follows:(11)h˜jt=ϕWxj+Ur⊙ht−1j,where ϕ denotes tanh function as shown in the following equation:(12)ϕa=ea−e−aea+e−a.In equation (11), the reset gate is utilized to weigh the impacts of previously hidden layer information and current input layer information on the current hidden layer. The greater the reset gate rj, the greater the influence of previously hidden layer information. In equation (10), the update gate zj controls the effect of previously hidden layer information on the current hidden layer.The output of the proposed method is a one-dimensional matrix containing a set of latitude and longitude coordinates. After denormalization, it can be expressed as follows:(13)yi=lx,ti,ly,ti.In addition, the loss function of the proposed method adopts quadratic loss, which is expressed as follows:(14)JW,b=1m∑i=1mLW,b;x^i,y^i=1m∑i=1my^i−yi2,where x^i and y^i are the i-th observed values of RSSIs and coordinates of GPS.The purpose of training is to obtain the parametersW and b which can minimize the value of the loss function. This paper utilizes the backpropagation algorithm to optimize the proposed model, and the optimization process is shown in Algorithm 1.Algorithm 1:Training of GRU.
(1)
Require: loss function J(W,b), initial parameter W, b(2)
Normalize the features of input: equation (5)(3)
WhileJ not converged Do(4)
Selectk samples from the training set randomly(5)
For each sample Do(6)
Input layer: equation (6)(7)
Hidden layer: equations (7)–(12)(8)
Output layer: equation (13)(9)
Compute the loss function: equation (14)(10)
End For(11)
Compute the gradients of weights(12)
Update the weights(13)
End While(14)
ReturnW, b


## 3.2.1. Data Preprocessing

The dataset collected by the mobile station is divided into the training setD1 and testing set D2. D1 and D2 are made up of m and n labeled samples, which are expressed as Ri,lii=1m and Ri,lii=1n. Among them, Ridenotes i-th RSSI (expressed as equation (1)), which consists of cellular network signals Rci (expressed as equation (2)) and Wi-Fi network signals Rwi (expressed as equation (3)). li is the i-th coordinate of GPS including longitude lxi and latitude lyi (expressed as equation (4)).(1)Ri=Rci,Rwi,(2)Rci=rc,1i,rc,2i,...,rc,pi,(3)Rwi=rw,1i,rw,2i,...,rw,qi,(4)li=lxi,lyi,where p and q denote the number of base stations and APs.Considering that some road segments are not covered by Wi-Fi network signals, the corresponding encodings of these network signals are expressed with 0. Also, this paper adopts the max-min function to normalize the RSSI data and coordinates of GPS, which is expressed as follows:(5)normalizedi=observei−observe−observe+−observe−,ifobservei≠0,0,otherwise,where observei is the observed value (e.g., longitude, latitude, and RSSIs) in the ith record and normalizedi is the normalized value of observed values. observe+ and observe− represent the maximum and minimum of corresponding data category, respectively.


## 3.2.2. Positioning Model Based on Gated Recurrent Unit with Heterogeneous Network

Considering that the outputs of NN are only related to the current inputs, this mechanism makes NN unable to process time-series data. RNN is a kind of variant of NN, which is usually employed in the scene of processing time-series data. Accommodating the gradient disappearance of RNN, LSTM is proposed by researchers to extract the long-term time-series data [19, 20]. GRU is a variant of LSTM, which is provided with the capability of dealing with long-term dependency and cheaper structure compared with LSTM (about a third of the parameters reduced) [18, 21–23].This paper embeds the RSSIs data from the cellular network or Wi-Fi network and coordinates of GPS in the input layer and the output layer of the GRU model, respectively, and develops an effective positioning method whose structure is shown in Figure2.Figure 2
Proposed positioning model.The input of the proposed method is a two-dimensional matrix, and each of the dimensions denotes memory lengtht and RSSIs data, which is expressed as follows:(6)xi=rc,1,1i,rc,2,1i,…,rc,p,1i,rw,1,1i,rw,2,1i,…,rw,p,1irc,1,2i,rc,2,2i,…,rc,p,2i,rw,1,2i,rw,2,2i,…,rw,p,2i⋮⋮⋮⋮⋮⋮rc,1,ti,rc,2,ti,…,rc,p,ti,rw,1,ti,rw,2,ti,…,rw,p,ti.GRU contains a reset gaterjand an update gate zj to deal with past, present, and future information. The calculation formula of the reset gate is expressed as follows:(7)rj=σWrxj+Urht−1j,where Wr and Ur are the weights of the reset gate, which will be optimized in the training stage, x and ht−1 denote the current input and previous hidden state, respectively, j is the j-th element of vectors, and σ denotes activation function, namely, sigmoid, which is computed as follows:(8)σa=11−ea.The calculation formula of the update gate is expressed as follows:(9)zj=σWzxj+Uzht−1j.The hidden unit of timet is computed as follows:(10)hjt=zjhjt−1+1−zjh˜jt.The formula ofh˜jt is expressed as follows:(11)h˜jt=ϕWxj+Ur⊙ht−1j,where ϕ denotes tanh function as shown in the following equation:(12)ϕa=ea−e−aea+e−a.In equation (11), the reset gate is utilized to weigh the impacts of previously hidden layer information and current input layer information on the current hidden layer. The greater the reset gate rj, the greater the influence of previously hidden layer information. In equation (10), the update gate zj controls the effect of previously hidden layer information on the current hidden layer.The output of the proposed method is a one-dimensional matrix containing a set of latitude and longitude coordinates. After denormalization, it can be expressed as follows:(13)yi=lx,ti,ly,ti.In addition, the loss function of the proposed method adopts quadratic loss, which is expressed as follows:(14)JW,b=1m∑i=1mLW,b;x^i,y^i=1m∑i=1my^i−yi2,where x^i and y^i are the i-th observed values of RSSIs and coordinates of GPS.The purpose of training is to obtain the parametersW and b which can minimize the value of the loss function. This paper utilizes the backpropagation algorithm to optimize the proposed model, and the optimization process is shown in Algorithm 1.Algorithm 1:Training of GRU.
(1)
Require: loss function J(W,b), initial parameter W, b(2)
Normalize the features of input: equation (5)(3)
WhileJ not converged Do(4)
Selectk samples from the training set randomly(5)
For each sample Do(6)
Input layer: equation (6)(7)
Hidden layer: equations (7)–(12)(8)
Output layer: equation (13)(9)
Compute the loss function: equation (14)(10)
End For(11)
Compute the gradients of weights(12)
Update the weights(13)
End While(14)
ReturnW, b


## 4. Practical Experimental Results and Discussion

### 4.1. Practical Experimental Environments

The dataset including GPS coordinates and RSSIs from cellular and Wi-Fi network utilized in this study is collected by an Android application installed on a mobile station (i.e., Redmi 5 running Android platform 7.1.2). The researcher carried the mobile station eight times across a 5.6 km road at Fuzhou University in China and collected data each second. Finally, 4525 records are collected, and each record consists of 59 RSSIs from base stations in a long-term evolution network, 582 RSSIs from Wi-Fi APs, and a set of longitude and latitude coordinates from GPS. Among them, 2263 records are selected as the training set and the others are regarded as the testing set. For cellular network-based methods or Wi-Fi network-based methods, only cellular network signals and GPS data or Wi-Fi network signals and GPS data are utilized to estimate the locations of the mobile device. For heterogeneous network-based method, two types of network signals and GPS data are utilized for the experiments. Among them, the availability of cellular network signals is 100%, while for Wi-Fi signals, the availability is 96% because some road segments are not covered by Wi-Fi signals.For evaluating the effectiveness of the proposed method, other deep learning models (e.g., NN, RNN, LSTM, Triple RNN, Triple LSTM, Triple GRU, and Ensemble method) are regarded as comparative models. Among them, Triple RNN denotes an ensemble model, which integrates three RNNs by a weighted average method, so do Triple LSTM and Triple GRU. Moreover, the ensemble model consists of RNN, LSTM, and GRU. Both the proposed method and comparative methods are trained on Keras framework with TensorFlow backend, and the trained models are employed in the real scene to estimate the location. Keras is an advanced neural network API written in Python. It can run with TensorFlow, CNTK, or Theano as the backend. Keras’s development focus is to support fast experiments, which can convert your ideas into experimental results with minimal delay. The distance between observed coordinates and estimated coordinates is utilized as evaluation index, whose unit is meter, and the formula is expressed as follows:(15)errori=R∗arccoscosy^i∗arccosyi∗cosx^i−xi+siny^i∗sinyi,where R is the radius of the Earth. For the sake of fairness, the study sets the same training parameters as shown in Table 1.Table 1
Training parameters.
ParametersValueMemory length2Number of hidden layers1Number of neurons of hidden layer30OptimizerAdamLearning rate0.001Decay rates0.9, 0.999Training epoch20000Batch size5Loss functionQuadratic loss


### 4.2. Discussion

#### 4.2.1. Memory Length Comparison

This section presents a detailed research of selecting appropriate memory for RNN, LSTM, and GRU with RSSIs from different networks (i.e., cellular network, Wi-Fi network, and heterogeneous network) as shown in Table2. Remarkably, when RSSIs consist of only cellular network, the positioning performance of RNN, LSTM, and GRU improves with the increase of memory length, and the errors are far greater than that of Wi-Fi network and heterogeneous network. In addition, the positioning error can reach the level of 5 to 7 m with the memory length increased when the RSSIs contain Wi-Fi network signals. Among them, the proposed method obtains minimum positioning error (5.58 m) while memory length is 2 s.Table 2
Positioning error comparison of deep learning techniques with different memory lengths and RSSIs from different networks.
Memory length (s)RNNLSTMGRUCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-Fi112.438.007.6311.427.239.0611.187.107.16214.167.169.4315.007.8510.2213.596.285.86324.669.7510.8924.619.6912.9820.009.147.12513.137.167.3611.557.147.3011.247.187.081011.767.487.766.887.187.2810.016.787.061511.686.777.736.746.766.806.866.736.74


#### 4.2.2. Model Comparison

Table3 presents the experimental results of each deep learning technique with RSSIs from different networks when the memory length is equal to 2 s. Clearly, when the network signals are heterogeneous, the GRU model obtains superior performance compared with NN, RNN, LSTM, Triple RNN, Triple LSTM, Triple GRU, and the Ensemble model. When the RSSIs consist of only cellular network signals, the Triple LSTM model obtains the best performance. Moreover, the Ensemble model has superior positioning error than other models when the RSSIs consist of only Wi-Fi network signals. In the experimental results, GRU with RSSIs from heterogeneous networks obtains the average error of 5.86 m and 75% of errors within 4 m, which is better than other methods. Therefore, the proposed method is selected as the positioning model of the proposed positioning system for further research.Table 3
Positioning error of deep learning techniques with RSSIs from different networks when memory length is equal to 2 s.
NetworkRNNLSTMGRUTriple RNNTriple LSTMTriple GRUEnsembleCell14.1615.0013.5914.3614.5212.3612.69Wi-Fi7.167.856.497.096.907.736.04Cell + Wi-Fi9.4310.225.858.417.467.616.93


#### 4.2.3. Optimizer Comparison

This section presents a detailed study of optimizer comparison among Stochastic Gradient Descent (SGD), Adaptive Moment Estimation (Adam), and Nesterov-Accelerated Adaptive Moment Estimation (Nadam) [24, 25] for GRU with RSSIs from different network signals, and the experimental results are shown in Table 4. The learning rates of these optimizers are set to default values. Generally, GRU optimized by Adam obtains lower positioning errors than that of others when the compositions of the RSSIs are only Wi-Fi network or heterogeneous (i.e., Wi-Fi: 6.28 m and Cell + Wi-Fi: 5.86 m), and 5.86 m is the best performance of all. In addition, Nadam obtains the lowest errors if RSSIs are made up of only cellular network (i.e., 12.96 m). Among these optimizers, SGD gets the worst performance in the experiments. Therefore, Adam is selected as the optimizer in this paper.Table 4
Performance comparison of SGD and Adam optimizing GRU with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiOptimizerSGDADAMNadamSGDADAMNadamSGDADAMNadamError (m)22.5413.5912.969.676.286.919.285.866.44


#### 4.2.4. Activation Function Comparison

For selecting the appropriate activation function to transfer information between layers, this paper compares the performance of three activation functions, and Table5 shows the experimental results of activation function comparison among relu, sigmoid, and tanh for GRU with RSSI from different networks. Clearly, sigmoid obtains superior performance compared with relu and tanh when RSSIs are collected through Wi-Fi network and heterogeneous network (i.e., Wi-Fi: 6.28 m and heterogeneous: 5.86 m). 5.86 m is the best positioning result of all, and sigmoid is selected as the activation function.Table 5
Positioning error comparison of activation functions with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiActivationReluSigmoidtanhReluSigmoidtanhReluSigmoidtanhError (m)12.7813.5911.938.716.287.237.545.866.51


## 4.1. Practical Experimental Environments

The dataset including GPS coordinates and RSSIs from cellular and Wi-Fi network utilized in this study is collected by an Android application installed on a mobile station (i.e., Redmi 5 running Android platform 7.1.2). The researcher carried the mobile station eight times across a 5.6 km road at Fuzhou University in China and collected data each second. Finally, 4525 records are collected, and each record consists of 59 RSSIs from base stations in a long-term evolution network, 582 RSSIs from Wi-Fi APs, and a set of longitude and latitude coordinates from GPS. Among them, 2263 records are selected as the training set and the others are regarded as the testing set. For cellular network-based methods or Wi-Fi network-based methods, only cellular network signals and GPS data or Wi-Fi network signals and GPS data are utilized to estimate the locations of the mobile device. For heterogeneous network-based method, two types of network signals and GPS data are utilized for the experiments. Among them, the availability of cellular network signals is 100%, while for Wi-Fi signals, the availability is 96% because some road segments are not covered by Wi-Fi signals.For evaluating the effectiveness of the proposed method, other deep learning models (e.g., NN, RNN, LSTM, Triple RNN, Triple LSTM, Triple GRU, and Ensemble method) are regarded as comparative models. Among them, Triple RNN denotes an ensemble model, which integrates three RNNs by a weighted average method, so do Triple LSTM and Triple GRU. Moreover, the ensemble model consists of RNN, LSTM, and GRU. Both the proposed method and comparative methods are trained on Keras framework with TensorFlow backend, and the trained models are employed in the real scene to estimate the location. Keras is an advanced neural network API written in Python. It can run with TensorFlow, CNTK, or Theano as the backend. Keras’s development focus is to support fast experiments, which can convert your ideas into experimental results with minimal delay. The distance between observed coordinates and estimated coordinates is utilized as evaluation index, whose unit is meter, and the formula is expressed as follows:(15)errori=R∗arccoscosy^i∗arccosyi∗cosx^i−xi+siny^i∗sinyi,where R is the radius of the Earth. For the sake of fairness, the study sets the same training parameters as shown in Table 1.Table 1
Training parameters.
ParametersValueMemory length2Number of hidden layers1Number of neurons of hidden layer30OptimizerAdamLearning rate0.001Decay rates0.9, 0.999Training epoch20000Batch size5Loss functionQuadratic loss


## 4.2. Discussion

### 4.2.1. Memory Length Comparison

This section presents a detailed research of selecting appropriate memory for RNN, LSTM, and GRU with RSSIs from different networks (i.e., cellular network, Wi-Fi network, and heterogeneous network) as shown in Table2. Remarkably, when RSSIs consist of only cellular network, the positioning performance of RNN, LSTM, and GRU improves with the increase of memory length, and the errors are far greater than that of Wi-Fi network and heterogeneous network. In addition, the positioning error can reach the level of 5 to 7 m with the memory length increased when the RSSIs contain Wi-Fi network signals. Among them, the proposed method obtains minimum positioning error (5.58 m) while memory length is 2 s.Table 2
Positioning error comparison of deep learning techniques with different memory lengths and RSSIs from different networks.
Memory length (s)RNNLSTMGRUCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-Fi112.438.007.6311.427.239.0611.187.107.16214.167.169.4315.007.8510.2213.596.285.86324.669.7510.8924.619.6912.9820.009.147.12513.137.167.3611.557.147.3011.247.187.081011.767.487.766.887.187.2810.016.787.061511.686.777.736.746.766.806.866.736.74


### 4.2.2. Model Comparison

Table3 presents the experimental results of each deep learning technique with RSSIs from different networks when the memory length is equal to 2 s. Clearly, when the network signals are heterogeneous, the GRU model obtains superior performance compared with NN, RNN, LSTM, Triple RNN, Triple LSTM, Triple GRU, and the Ensemble model. When the RSSIs consist of only cellular network signals, the Triple LSTM model obtains the best performance. Moreover, the Ensemble model has superior positioning error than other models when the RSSIs consist of only Wi-Fi network signals. In the experimental results, GRU with RSSIs from heterogeneous networks obtains the average error of 5.86 m and 75% of errors within 4 m, which is better than other methods. Therefore, the proposed method is selected as the positioning model of the proposed positioning system for further research.Table 3
Positioning error of deep learning techniques with RSSIs from different networks when memory length is equal to 2 s.
NetworkRNNLSTMGRUTriple RNNTriple LSTMTriple GRUEnsembleCell14.1615.0013.5914.3614.5212.3612.69Wi-Fi7.167.856.497.096.907.736.04Cell + Wi-Fi9.4310.225.858.417.467.616.93


### 4.2.3. Optimizer Comparison

This section presents a detailed study of optimizer comparison among Stochastic Gradient Descent (SGD), Adaptive Moment Estimation (Adam), and Nesterov-Accelerated Adaptive Moment Estimation (Nadam) [24, 25] for GRU with RSSIs from different network signals, and the experimental results are shown in Table 4. The learning rates of these optimizers are set to default values. Generally, GRU optimized by Adam obtains lower positioning errors than that of others when the compositions of the RSSIs are only Wi-Fi network or heterogeneous (i.e., Wi-Fi: 6.28 m and Cell + Wi-Fi: 5.86 m), and 5.86 m is the best performance of all. In addition, Nadam obtains the lowest errors if RSSIs are made up of only cellular network (i.e., 12.96 m). Among these optimizers, SGD gets the worst performance in the experiments. Therefore, Adam is selected as the optimizer in this paper.Table 4
Performance comparison of SGD and Adam optimizing GRU with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiOptimizerSGDADAMNadamSGDADAMNadamSGDADAMNadamError (m)22.5413.5912.969.676.286.919.285.866.44


### 4.2.4. Activation Function Comparison

For selecting the appropriate activation function to transfer information between layers, this paper compares the performance of three activation functions, and Table5 shows the experimental results of activation function comparison among relu, sigmoid, and tanh for GRU with RSSI from different networks. Clearly, sigmoid obtains superior performance compared with relu and tanh when RSSIs are collected through Wi-Fi network and heterogeneous network (i.e., Wi-Fi: 6.28 m and heterogeneous: 5.86 m). 5.86 m is the best positioning result of all, and sigmoid is selected as the activation function.Table 5
Positioning error comparison of activation functions with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiActivationReluSigmoidtanhReluSigmoidtanhReluSigmoidtanhError (m)12.7813.5911.938.716.287.237.545.866.51


## 4.2.1. Memory Length Comparison

This section presents a detailed research of selecting appropriate memory for RNN, LSTM, and GRU with RSSIs from different networks (i.e., cellular network, Wi-Fi network, and heterogeneous network) as shown in Table2. Remarkably, when RSSIs consist of only cellular network, the positioning performance of RNN, LSTM, and GRU improves with the increase of memory length, and the errors are far greater than that of Wi-Fi network and heterogeneous network. In addition, the positioning error can reach the level of 5 to 7 m with the memory length increased when the RSSIs contain Wi-Fi network signals. Among them, the proposed method obtains minimum positioning error (5.58 m) while memory length is 2 s.Table 2
Positioning error comparison of deep learning techniques with different memory lengths and RSSIs from different networks.
Memory length (s)RNNLSTMGRUCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-FiCellWi-FiCell + Wi-Fi112.438.007.6311.427.239.0611.187.107.16214.167.169.4315.007.8510.2213.596.285.86324.669.7510.8924.619.6912.9820.009.147.12513.137.167.3611.557.147.3011.247.187.081011.767.487.766.887.187.2810.016.787.061511.686.777.736.746.766.806.866.736.74


## 4.2.2. Model Comparison

Table3 presents the experimental results of each deep learning technique with RSSIs from different networks when the memory length is equal to 2 s. Clearly, when the network signals are heterogeneous, the GRU model obtains superior performance compared with NN, RNN, LSTM, Triple RNN, Triple LSTM, Triple GRU, and the Ensemble model. When the RSSIs consist of only cellular network signals, the Triple LSTM model obtains the best performance. Moreover, the Ensemble model has superior positioning error than other models when the RSSIs consist of only Wi-Fi network signals. In the experimental results, GRU with RSSIs from heterogeneous networks obtains the average error of 5.86 m and 75% of errors within 4 m, which is better than other methods. Therefore, the proposed method is selected as the positioning model of the proposed positioning system for further research.Table 3
Positioning error of deep learning techniques with RSSIs from different networks when memory length is equal to 2 s.
NetworkRNNLSTMGRUTriple RNNTriple LSTMTriple GRUEnsembleCell14.1615.0013.5914.3614.5212.3612.69Wi-Fi7.167.856.497.096.907.736.04Cell + Wi-Fi9.4310.225.858.417.467.616.93


## 4.2.3. Optimizer Comparison

This section presents a detailed study of optimizer comparison among Stochastic Gradient Descent (SGD), Adaptive Moment Estimation (Adam), and Nesterov-Accelerated Adaptive Moment Estimation (Nadam) [24, 25] for GRU with RSSIs from different network signals, and the experimental results are shown in Table 4. The learning rates of these optimizers are set to default values. Generally, GRU optimized by Adam obtains lower positioning errors than that of others when the compositions of the RSSIs are only Wi-Fi network or heterogeneous (i.e., Wi-Fi: 6.28 m and Cell + Wi-Fi: 5.86 m), and 5.86 m is the best performance of all. In addition, Nadam obtains the lowest errors if RSSIs are made up of only cellular network (i.e., 12.96 m). Among these optimizers, SGD gets the worst performance in the experiments. Therefore, Adam is selected as the optimizer in this paper.Table 4
Performance comparison of SGD and Adam optimizing GRU with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiOptimizerSGDADAMNadamSGDADAMNadamSGDADAMNadamError (m)22.5413.5912.969.676.286.919.285.866.44


## 4.2.4. Activation Function Comparison

For selecting the appropriate activation function to transfer information between layers, this paper compares the performance of three activation functions, and Table5 shows the experimental results of activation function comparison among relu, sigmoid, and tanh for GRU with RSSI from different networks. Clearly, sigmoid obtains superior performance compared with relu and tanh when RSSIs are collected through Wi-Fi network and heterogeneous network (i.e., Wi-Fi: 6.28 m and heterogeneous: 5.86 m). 5.86 m is the best positioning result of all, and sigmoid is selected as the activation function.Table 5
Positioning error comparison of activation functions with RSSIs from different networks.
NetworkCellWi-FiCell + Wi-FiActivationReluSigmoidtanhReluSigmoidtanhReluSigmoidtanhError (m)12.7813.5911.938.716.287.237.545.866.51


## 5. Conclusions

LBSs based on network positioning method adopting machine learning techniques estimate the locations of mobile devices by RSSIs from networks. For positioning method based on the cellular network, it can provide location estimation where there exist base stations. However, larger errors will be obtained when considering only cellular network signals. Compared with this method, the positioning method based on Wi-Fi network has lower location errors, but it can be employed where Wi-Fi signals can be accessed. In addition, due to the highly temporal dependence of RSSI series data, this paper proposed a mobile positioning system based on GRU with RSSIs from the heterogeneous network. Mobile devices detect and collect GPS coordinates and RSSIs from both cellular network and Wi-Fi network for the training of the GRU model. A large number of real experiments have been carried out to verify the performance of the proposed method, and experimental results demonstrate that the proposed method has lower errors (i.e., 5.86 m and 75% of errors within 4 m) compared with NN, RNN, and LSTM. Furthermore, important parameters including optimizer, activation function, and memory length of the proposed model have been discussed in detail.This paper takes all RSSIs of cellular network and Wi-Fi network into account, which not only costs a lot of computing power but also easily leads to overfitting. In the future, feature selection based on knowledge engineering [26] can be applied in RSSIs to reduce training costs and improve location performance. Furthermore, distributed computing [27] and cloud computing [28] can be applied to improve the effectiveness of the mobile positioning method. For optimization, more optimization methods [29] can be considered and adopted to reduce the errors of estimated locations.



---

*Source: 6679398-2021-04-13.xml*