# Real-Time and Accurate Indoor Localization with Fusion Model of Wi-Fi Fingerprint and Motion Particle Filter

Authors: Xinlong Jiang; Yiqiang Chen; Junfa Liu; Dingjun Liu; Yang Gu; Zhenyu Chen
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

As the development of Indoor Location Based Service (Indoor LBS), a timely localization and smooth tracking with high accuracy are desperately needed. Unfortunately, any single method cannot meet the requirement of both high accuracy and real-time ability at the same time. In this paper, we propose a fusion location framework with Particle Filter using Wi-Fi signals and motion sensors. In this framework, we use Extreme Learning Machine (ELM) regression algorithm to predict position based on motion sensors and use Wi-Fi fingerprint location result to solve the error accumulation of motion sensors based location occasionally with Particle Filter. The experiments show that the trajectory is smoother as the real one than the traditional Wi-Fi fingerprint method.


---

## Body

## 1. Introduction

Nowadays, indoor location and tracking are very important in our daily life. Indeed, many applications require timely and accurate location information of the mobiles (context-aware application, emergency situation…) [1, 2]. But Global Positioning System (GPS), Assisted GPS (AGPS), and Mobile Base Station (MBS) cannot be used in indoor areas, as the signals cannot reach indoor area.Fortunately, now many buildings are equipped with WLAN Access Points (APs), such as office buildings, hospitals, shopping malls, museums, and airports. It becomes easy to offer indoor location services without any other infrastructure investment. A common idea of Wi-Fi based indoor location is fingerprint method [3–8]. It is a classical classification problem where different supervised machine learning techniques have been used. A lot of researches show that Wi-Fi signal can generate good prediction for indoor localization [9], but it will spend some time to scan the Wi-Fi signal around so that it cannot offer continuous location service.Nowadays, the smartphone is the most wildly used device, in part due to its abundant inertial sensors, such as accelerometer, magnetometer and gyroscope. They can be used to measure people’s motion state, including walking speed and orientation. Based on this information, we can estimate the relative changing of position by determining a pedestrian’s movement. This kind of methods is based on the Inertial Navigation System (INS) [10] method, which can offer continuous localization. But due to its iterative process, we can only estimate the position with high accuracy in a short time. The error accumulation will lead the gap between the movement and the estimated result increases continuously.By the way, the power consumption is also important. As far as we know, the battery usage of Wi-Fi and communication module is several dozen times higher than the Inertial Measurement Unit (IMU) that consists of gyroscopes and accelerometers. Carroll and Heiser [11] also did some analysis of power consumption in smartphones and the same conclusions can be seen.Therefore, in this paper, we combine the advantages of two methods and present real-time and accurate indoor localization based on fusion model of Wi-Fi fingerprint and motion Particle Filter. We take use of the accurate Wi-Fi location result to modify the motion Particle Filter in the correction step, so to eliminate the error accumulation caused by motion sensors based location. And this system includes three main modules: sensors data based location model (ELM regression); Wi-Fi based location model (ELM +K-NN classification); and the fusion Particle Filter model.The rest of the paper is organized as follows. We firstly review some related works of indoor location and tracking in Section2. Then we give a brief introduction of proposed method in Section 3. Section 4 demonstrates the feature selection for sensors data. In Section 5, we introduce ELM algorithm. After that, we introduce Particle Filter for sensors based location in Section 6. In Section 7, we introduce the fusion model of Wi-Fi fingerprint and motion Particle Filter. Experiments and performance evaluation are given in Section 8. In the end, we make a short conclusion in Section 9.


## 2. Related Works

As the basic support of Indoor LBS application, a timely localization with high-accuracy and low power consumption is very important. At present, one of the most popular techniques is Wi-Fi fingerprint based location [3–8]. References [3–8] take use of the existing wireless network infrastructures to avoid extra deployment costs.Wi-Fi fingerprint based locations contain two phrases: offline training and online mapping. During the offline phase, a fingerprint information map will be built. In this map, there are some registered points and corresponding Received Signal Strength (RSS) from the APs around. On the online phase, people receive the Wi-Fi signals, and then some machine learning algorithms will be used to predict the position based on fingerprint dataset. It becomes a classical classification problem where different supervised machine learning techniques have been used to train classifiers, using the signal strength from different APs as the feature and providing the location estimation as their output estimation. Nearest Neighbor (K-NN), Decision Tree (DT), Bayesian, Support Vector Machine (SVM), and ELM [12] are most frequently used by location fingerprint. Among all the algorithms above, ELM is more and more widely used for its competitive fast learning speed during both offline and online phrases.Although Wi-Fi signals can generate good prediction model for indoor position estimation, it will take a while to scan the Wi-Fi signals so that it cannot offer continuous location service. As shown in Figure1, we select four different android smartphones (HTC G12, Sony LT26ii, HTC G10, and Xiaomi 1S). With each smartphone, we scan the Wi-Fi for 10 times (Test. 1–10). We can conclude that every time we collect the Wi-Fi signals, it will take more than 1 second on average. That is to say, Wi-Fi based location cannot offer immediately location result due to the time consumption of signals scanning.Figure 1
Time consumption of Wi-Fi signal scanning.According to the experiments on Wi-Fi based location system developed by our lab, shown in Figure2, we can get one location result in every 2 seconds including some other time consumption of transmission and calculation.Figure 2
Location system with C-S (Client-Server) architecture.In order to overcome the shortcoming of Wi-Fi based location, we can take other measures which can offer continuous location service. Nowadays, as a lot of sensors are integrated in smart phones, so that we can use them to measure people’s motion state, including distance and orientation. Distance estimation mainly based on pedestrian model, including step detection and a step model. Step detection typically relies on peak detection over accelerometer [13]. But the result is not good enough, because it is sensitive to noise and other irrelevant motions, producing a high rate of false positives. And there are also some other methods that rely on detecting features such as zero-cross point [14]. Orientation is relatively easier to get via magnetometer, gyroscope, and accelerometer data so that we can get user heading orientation information with high accuracy easily. The orientation of smartphones themselves can be obtained from the motion sensors Application Programming Interface (API) [15] or computed from the raw sensors data.But based on motion sensors, we can only estimate the position with high accuracy in a short time; it is difficult to locate independently for a long time period because of the error accumulation. To solve this problem, a lot of previous works have been done. Li et al. [16] not only developed an algorithm for reliable detection of steps, heading directions, and accurate estimation of step length, but also built an end-to-end location system integrating these models. But they still did not solve the problem of location error accumulation. Evennou et al. [1] applied a developed Particle Filter method to WLAN location determination technique and proposed an indoor mobile positioning system. They used the Particle Filter and its constraint on a Voronoi diagram to represent an interesting, so as to handle the variations of the signal strength measurements. It can also aggregate different information like signal strength and the map to obtain correct trajectories without wall-crossings. But in real applications, it is difficult to get the geography Information.From the related works above, we can see that Wi-Fi based location can offer high accuracy, but it needs high time and power consumptions. Inertial sensors based location estimates the position with high accuracy in a short time, but the shortage is the error accumulation. Thus, in this paper, we present real-time and accurate indoor location based on fusion model of Wi-Fi fingerprint method and motion Particle Filter.


## 3. Overview of Our Method

The architecture of our method is shown in Figure3. It contains three main parts. (1) Sensors data based short-time location with ELM regression: we can determine the orientation and velocity to tracking users, but as every location result is based on the former one, it will cause error accumulation. (2) Wi-Fi based location with ELM classification and K-NN: we can get high location accuracy with this method, but as the time consumption of Wi-Fi signals scanning and data transmission, we can only get discrete result in every several seconds. (3) Fusion Particle Filter model: in order to solve the problems in the two methods mentioned above, we add a fusion Particle Filter model to eliminate the error accumulation caused by motion sensors based location with Wi-Fi location result in the correction step and offer a smooth location trajectory.Figure 3
Architecture of our proposed method.


## 4. Feature Selection for Sensors Data

Currently, there are a lot of sensors integrated in smartphones. Some previous methods only directly use the API data, such as orientation. But sometimes, the API data cannot offer high precision. As shown in Figure4, the orientation directly offered by API has a big bias with the real one caused by the environment changing. So in this paper, we use regression learning algorithm with a variety of sensors data to determine the motion state.Figure 4
Orientation API output.In order to find the strong correlation between movement state and sensors data, we investigate the existing sensors on the smartphone [15]. Generally, there are seven sensors that can reflect motion state, shown in Table 1.Table 1
Motion sensors in smart phone.
ID
Sensor
# descriptions
# units of measure
1
Accelerometer
Acceleration force along thex,y, and z axes
m/s2
2
Magnetic field
Measures the ambient geomagnetic field for all the three physical axes (x,y, and z)
μT
3
Orientation
Measures degree of rotation that a device makes around all three physical axes (x,y, and z).
°
4
Gyroscope
Rate of rotation around thex,z, and z axes.
rad/s
5
Gravity
Force of gravity along thex,y, and z axes.
m/s2
6
Linear acceleration
Acceleration force along thex,y, and z axes.
m/s2
7
Rotation vector
Rotation vector component along thex,y, and z axes.
UnitlessWhen we mention localization, we want to get the orientation and velocity from sensors data. Among all the sensors above, the accelerometer, magnetic field, orientation, gyroscope, and gravity sensors have correlation with the orientation and velocity. We tried different combinations of them to predict the orientation and velocity. Finally, we find that velocity has a strong relationship with accelerometerx, y, and z axes and gyroscope x, y, and z axes, as seen in the following formula:(1)v~acc.x,acc.y,acc.z,gyr.x,gyr.y,gyr.z.And we use orientation x, y, and z axes, magnetic field x, y, and z axes as the features to determine orientation, as seen in the following formula:(2)o~ori.x,ori.y,ori.z,mag.x,mag.y,mag.z.The reason why we choose acc.x,acc.y,acc.z,gyr.x,gyr.y,gyr.z as the feature to predict v is that different walking speed causes different shaking degree, which can be observed from the accelerometer readings. As shown in Figure 5, we can conclude that this user walks faster and faster.Figure 5
Accelerometer and walking speed.We use the same way to chooseori.x,ori.y,ori.z,mag.x,mag.y,mag.z as the feature vector to predict orientation o. Although orientation sensor’s output cannot match the real orientation very well, it can still offer some positive effect. Magnetic field measures the ambient geomagnetic field which has strong relationship with orientation.In order to use machine learning algorithm to predict velocity and orientation, we firstly prepare training data.Firstly, experiment participants walk along a fixed route with a smart phone. Motion sensor data will be collected, and participants will label the time at given points. The frequency of sensors is different in each smartphone. In our experimentsfs≈65 Hz.Secondly, we use Cubic Spline Interpolation [17] to smooth the trajectory.Thirdly, we use slide-window to segment the trajectory with window lengthTw. The Tw will be determined in the experiment, but we must keep Tw>1/fs so that in every single slide-window there is at least one integrated data. Let us take x component of acceleration in ith window as an example; we use the average of the sensors data as the feature according to(3)acci.x=1Ni∑k=1Niaccik.x,where Ni is the data number collected by the smartphone.According to the smooth trajectory, in theith stage, we can measure the orientation oi and velocity vi, which can be treated as the label for regression algorithm.


## 5. ELM Algorithm

After feature selection, we are going to predict the motion state. Commonly, the accelerometer has been used to count the number of steps. Then estimate the distance with the user’s steps stride [18]. But it depends on the assumption that user’s steps strides are always the same, which is hard to satisfy in practical applications.To avoid this assumption, we adopt ELM to train an effective model which can offer real-time prediction of orientation and walking speed.ELM [12] is an Artificial Neutral Network (ANN), especially Single Layer Feedforward Networks (SLFN), developed by Huang et al. Given N arbitrary distinct samples xi,ti∈Rn×Rm, i=1,2,…,N. Here, xi is an n×1 input vector xi=xi1,xi2,…,xinT and ti is an m×1 target vector ti=ti1,ti2,…,timT. The network with L hidden nodes is shown in Figure 6. The output function of this network can be represented as follows:(4)fLxj=∑i=1LβiGai,bi,xj,j=1,…,N,where ai and bi are the learning parameters of hidden nodes and βi is the weight connecting the ith hidden node to the output node. Gai,bi,x is the output of the ith hidden node with respect to the input x. For additive hidden node with the activation function gx:R→R (e.g., sigmoid and threshold), Gai,bi,x is given blow:(5)Gai,bi,x=gai·x+bi,bi∈R.If an SLFN with L hidden nodes can approximate these N samples with zero errors, this then implies that there exist βi, ai, and bi such that(6)fLxj=∑i=1LβiGai,bi,xj=tj,j=1,…,N.Equation (6) can be summarized as(7)Hβ=T,where(8)Ha1,…,aL,b1,…,bL,x1,…,xL=Ga1,b1,x1⋯GaL,bL,x1⋮⋱⋮Ga1,b1,xN⋯GaL,bL,xN,(9)β=β1T⋮βLTL×m,T=t1T⋮tNTN×m.According to [12], the hidden node parameters ai and bi (input weights and biases or centers and impact factors) of SLFNs need not be tuned during training and may simply be assigned with random values. Equation (7) then becomes a linear system and the output weights β are estimated as(10)β^=H†T=HTH-1HTT,where H† is the Moore-Penrose generalizes inverse of hidden layer output matrix H. Equation (10) can be seen as a linear system; the least-squares solution of (8) is the answer of ELM.Figure 6
SLFN withL hidden neurons.By now, ELM and some other related algorithms such as OS-ELM [19, 20], SELM [21, 22], and Unsurprised-ELM [22] have been developed and wildly applied in some real applications. Huang [23] made a further insight into ELM, including some discussion about random neurons, random features, and kernels. And in [24, 25], Cao et al. made some improvement to the basic ELM and achieved a good performance. Because of the fast learning speed and good learning ability, ELM has been wildly used in ubiquitous computing applications, such as activity recognition [26–29]. That is why we use ELM model both in offline learning and in online prediction. Our lab has done a lot of Wi-Fi indoor location research based on it and achieved good performance [21, 30].From all the information above, we can see that ELM model can be used in regression and classification problems. In our application, the velocity and orientation are all continuous variable. So we use ELM as a regression model.(i) ELM Model for Velocity. For velocity, the input vector is a vector with six features:(11)xi=acci.x,acci.y,acci.z,gryi.x,gryi.y,gryi.zTand the output vector is only a scalar value ti=viT.(ii) ELM Model for Orientation. For orientation, the input is a vector with four features:(12)xi=orii.x,orii.y,orii.z,magi.x,magi.y,magi.zTand the output vector in also a scalar value ti=oiT.According to [31], we also have offline and online phases. During offline phases, we will collect the sensors data and the trajectory to train these two models mentioned above. During the online phases, we will use sensors data and models to determine v and o. Then we can use (13) to calculate the current position. Consider(13)xtyt=xt-1yt-1+Tw00Tw*vt00vt*sin⁡oicos⁡⁡oi,t>1,x0y0,it=0.As our method is based on an iterative process, so the initial position [x0y0]T should be given.By now, we can already track the trace, given the initial position, in everyTw second; we collect the sensors data and use these two ELM models to determine v and o. So that, the current position will be calculate by (13). But unfortunately, sensors on smart phone are not accurate enough to offer data with high confidence. For a short time, it is really a reliable method, but as time goes on, error accumulation will destroy the reliability.


## 6. Particle Filter for Sensors Based Location

Particle Filter [32] is an on-line posterior density estimation algorithm estimating the posterior density of the state-space by directly implementing the Bayesian recursion equations. It provides a well-established methodology for generating samples from the required distribution without requiring assumptions about the state-space model or the state distributions. The state-space model can be nonlinear and the initial state and noise distributions can take any form required. For a lot of position and navigation problems, common motion model based filters can be applied. Models that are linear in the state dynamics and nonlinear in the measurements are considered [33].State Transition Equation. Consider(14)xt+1=Axt+Buut+wt.Observation Equation. Consider(15)yt=hxt+et,where xt: state vector, ut: measured inputs, wt: process noise, yt: measurements, and et: measurement error.In our application, we turn the model, (14) and (15), into a specific one, as shown in (16)xtyt=1001xt-1yt-1+Tw00Twvxtvyt+Q,(17)XtYt=1001xtyy+R.In (16), xt,ytT denotes the state vector associated to each particle (position). Tw is the elapsed time between the t-1th and the tth measurements. Q is the process noise. Here the used process is a zero mean Gaussian noise with a 0.1 m/s2 variance which is a realistic model of pedestrian movement.Equation (17) is observation equation, which denotes the relationship between the hidden states xt,ytT and the observation states Xt,Yt. Because we directly observe the coordinate point from ELM regression algorithm, there is no measurement error in this process, so we set R to be 0.A Particle Filter approximates the position at timet by a set of N particles. Each particle contains a position zki and a weight Prxt∣zti. Prxt∣zti indicates the importance of the ith particle. In the case of an indoor movement, the following law has been retained:(18)Prxt∣zti=12πσexp⁡-Xxt-Xzti22·σ2.With Xxt the position returned by the ELM regression algorithm, Xzti the position of the ith particle at time t, and σ the measurement confidence. The smaller σ will be, the more confident the user is in the measurement. That would mean that there is very little variation in the measurements for the same position. Here, σ=50 was chosen.According to the process of Particle Filter algorithm, there are four steps in a circle: prediction, correction, particle update, and resampling. At eachTw second, we will determine a new position by the following steps.(i) Feature Selection
(1)
We collect sensors data from mobile and calculate the feature vector according to (3).
(2)
Then we use two ELM regression models to calculate the orientationoi and velocity vi.(ii) Then We Go to Particle Filter Phase
(3)
Prediction: during this step, every particle will propagate to a new one based on state transition equation (16). After that, all the particles move to new places.
(4)
Correction: now, we have all the particles and we must give them the weight; according tooi, vi, and location of last moment, we can calculate the observed value by (17). Then we can use (18), from which we can see that the more particle far away from the observed value, the less value the particle has.
(5)
Particle Update: the weight update equation is given in [33, 34]:(19)wti=wt-1i·Prxt∣zti.
To obtain the posterior density function, we have to normalize those weights. After a few iterations, only a few particles can still alive. So we should go to resampling step to avoid having few remaining particles.
(6)
Resampling: the resampling step is the critical point for the PF. The fundamental idea is to remove the particles which have too low weight. Various resampling algorithms can be chosen. We choose the Sequential Importance Resampling (SIR) for the reason that it is a simple one which is wildly used in SLAM (Simultaneous Location and Mapping) [35]. Take N samples with replacement from the set xtii=1N, where the probability to take ith sample is wti. Let wti=1/N.
(7)
Finally, we can calculate the new location result byx^t=∑i=1Nwtixti. And then go to step (1) until stop.


## 7. Fusion Model of Wi-Fi Fingerprint and Motion Particle Filter

By now, only the sensors data are used for localization. But they cannot offer long time location service with high accuracy due to the error accumulation. To solve this problem, we present a fusion Particle Filter model, combining the advantages of motion sensors based location and Wi-Fi based location.Wi-Fi fingerprint based location methods include offline learning and online prediction. During the offline phrase, we collect fingerprints, including coordinate{x,y} and Wi-Fi Received Signal Strength Indication (RSSI) {r1,r2,…,rk} measured at {x,y}. Actually, we do not know the total number of Wi-Fi Aps and their position. We firstly calibrate all the location area and then choose the several most frequent APs as the feature. After that, we change all the fingerprints to only contain these frequent APs and supplement the missing items with default value −95 dB.According to [36], during the online phase, we use ELM classification and K-NN algorithm.With ELM, we can find theK Nearest Neighbor points, but we do not know the distance because the ELM only offers the nearest points but not the weights. So we use the Euclidean distance of signal strength to determine the weight according to(20)disk=∑i=1nrsski-rssi′2,wk=∑i=1Kdisi-diskn-1∑i=1Kdisi.When we use smart phone to do Wi-Fi based indoor location, it takes a little while to collect Wi-Fi data. So we can only get a location result in every TWi-Fi second. To eliminate the error accumulation caused by sensors based location, we add the Wi-Fi location result in particle update step and resampling step of Particle Filter.As shown in Figure7, once the smartphone begins to locate, the Wi-Fi signals and motion sensors data will be collected. By using the motion sensors data, we get a location result in every 200 milliseconds. And Wi-Fi based location data will arrive in about every 2 seconds.Figure 7
Location process of the whole system.We promote the Particle Filter mentioned in last section to a fusion one by adding the Wi-Fi location result in the correction step. When we go to the correction step, we should check whether there comes a Wi-Fi location result. If yes, we use the Wi-Fi location point as the observation value to calculate all particles’ weight. And if not, we still use the result predicted by motion sensors data. With the fusion model, our system can offer a highly accurate location result with limited time.


## 8. Experiments and Performance Evaluation

In this section, we do several experiments to evaluate the performance of our method. All the experiments are running on smartphones and a computer with following configuration.Smart Mobile Phones. See Table 2.Table 2
Mobile phones’ hardware parameters.
# OS
# CPU (Hz)
# RAM
# ROM
HTC Desire S
Android, v2.3
1 G
768 MB
1 GB
Samsung Galaxy S3
Android, v4.0
1.4 G
1 GB
16 GB
HTC Desire S
Android, v2.2
1 G
768 MB
1.5 GB
SONY Lt26ii
Android, v4.0
1741 M
1 GB
32 GM
HUAWEI S8600
Android, v2.3.4
624 M
512 MB
512 MBComputer
Operation System: Windows XP Professional SP3.
CPU: Intel Pentium(R) 4 CPU.
Main frequency: 3.2 GHz.
RAM: 2 G.


### 8.1. Experimental Design and Data Preparing

In order to evaluate the performance, we build a test platform in our work space, as shown in Figure8. Including the aisle, it is about 100 m2 (8.5m*12m).Figure 8
Our working space in ICT F8.For the reason that we apply ELM algorithm in both Wi-Fi based location and senor based location, we will collect data to train the model during offline phase.Concerning sensors data, we plan a fixed route including straights and curves, shown in Figure9. People walk along this trajectory with any speed: slow, middle, fast, and even run. And they record the time at every label point by touching the volume key. As shown in Figure 10. In order that we can measure different types of motion, there are four persons doing the collection work, and each person walks five times. Every smart phone will be used once by each person.Figure 9
The presetting route.Figure 10
Collecting the sensors data.After collecting the original sensors data, we use Cubic Spline Interpolation to smooth the trajectory. Thirdly, we use slide-window to segment the trajectory with window lengthTw, shown in Figure 11. The Tw will be determined in the experiment, but we must make sure Tw>1/fs so that in every single slide-window there is independent data. In every window, we will calculate feature by (1). And measure the orientation and speed from the red points.Figure 11
The trajectory after smooth and segmented by slide-window.For the Wi-Fi based location part, we use the fingerprint method. So we also have to build a signal distribution map. We select 36 points that can cover the test area, shown in Figure12. Between every two adjacent points, it is about 1.5 m~2 m. We do not strictly require label points equally distributed in this area. We register four times at each point, collect Wi-Fi data for three times, and then use the mean value.Figure 12
Fingerprint points are in yellow color.During the online phase, people were walking along the trajectory, shown in Figure9, to collect testing data. We let a user to carry a smart phone to collect sensors data and get the Wi-Fi location result from the server. Then we will use these raws to predict the trajectory. After that, we can evaluate the performance by comparing with groundtruth.


### 8.2. Parameters Selection

#### 8.2.1. Determine the Time Window LengthTw

Firstly, we will determine the window lengthTw. For the reason that the sensors frequency is fs≈65 Hz. In order to void the influence caused by noise, we use the mean value as the features. So we should ensure that there are about ten samples in each window. That is to say the Tw should be bigger than 160 milliseconds.We use Mean Square Error (MSE) [37] to measure the accuracy in ELM regression algorithms. The results are shown in Table 3. We can see that we can get lowest MSE in both orientation and velocity. So we set Tw to be 200 ms.Table 3
MSE of orientation and velocity in different window length.
Window length
200 ms
400 ms
600 ms
800 ms
1000 ms
MSE of orientation(degree)
25.0529
27.8570
26.8727
26.5759
26.4503
MSE of velocity(m/s2)
0.3001
0.4020
0.4158
0.4642
0.4435


#### 8.2.2. Parameters of ELM Regression Models

For basic ELM, we only need to determine the number of hidden nodesL. The input weights and biases of hidden nodes can be generated randomly. We have collected 5316 training samples and divided them into 10 parts. Then we use 10-fold cross validation to select best parameter; the results are shown in Figure 13.Figure 13
10-fold cross validation to select number of hidden nodes (a) for velocity and (b) for orientation.
(a)
(b)From Figure13, we can come to conclusions that, for the ELM regression model of velocity, 500 hidden nodes are suitable and, for orientation regression, we can minimize test error when the model has 1000 hidden nodes. Finally, we set L to be 500 for velocity and 1000 for orientation. And we choseSigmoid [38] function for orientation andHardlim [39] function for velocity.


### 8.3. Experimental Performance

In this section, in order to validate the proposed method, the comparisons to the existing methods are necessary. As the proposed method contains Wi-Fi and sensors information and takes use of ELM and Particle Filter algorithms, comparison experiments with some related methods should be involved. We firstly consider the Wi-Fi based location only and tried four different methods (K-NN, ELM, ELM + Kalman filter, and ELM + Particle Filter). Then we measure the location error of some sensors based methods and proposed method. Also the error accumulation tests have been considered as it is the key factor of location accuracy. Finally, we give a statistical result of the time consumption in our experiment to state that our proposed method is real practical.


#### 8.3.1. Evaluate the Location Accuracy

Firstly, we compare the location performance ofK-NN, ELM, Kalman filter, and Particle Filter based on Wi-Fi fingerprint. As shown in Figure 14, ELM performs better than K-NN, but it is still not very good as expected. We can explain the reason as that every location process is separated with each other. They are not treated as a sequence; thus some relevant information has been missed. So we apply Kalman filter and Particle Filter to the location results of ELM. Fortunately, both of them can raise the accuracy by big percentages. But, Particle Filter performs much better as it is a nonlinear system, which is more effective to simulate the walking pattern.Figure 14
Location accuracy of four methods.Besides the Wi-Fi information, sensors data is also very useful for indoor location. It is usually used to detect gait and then use a default step length to estimate the walking distance. In proposed method, we use ELM model to build a mapping relationship of sensors data and walking pattern. Moreover, Kalman filter and Particle Filter also can be used to smooth the initial location results. To evaluate their performance, we not only compare the location mean error, but also calculate the location trajectory using Matlab. From Table4, we can conclude that, comparing to gait detection based method mentioned in [40], ELM based methods can get better results. And with the Particle Filter, mean error becomes smaller. But we can see that when we apply the Kalman filter to the ELM location result, the mean error is bigger than before. We explain it as the function of Kalman filter is to make the trajectory smoother, not to minimize the mean error, which can be seen in Figure 14. But filters can only make the trajectory smoother; they cannot solve the error accumulation problem. In order to solve the error accumulation, we combine the Wi-Fi location with the sensors data based location to come into being proposed method, which indeed can offer a small mean error.Table 4
Comparison of the performance of the different methods.
Sensors data(gait + Particle Filter) [40]
Sensors data(ELM)
Sensors data(ELM + Kalman filter)
Sensors data(ELM + Particle Filter)
Sensors data + Wi-Fi(ELM + Particle Filter)
Mean error (m)
1.542
0.609
0.829
0.633
0.150From Figure15(a), we can see that trajectory of sensors based location is not very good. As time goes on, the trajectory is getting more and more far away from groundtruth. The reason is that, within a short period of time, the sensors can offer good valuation of walking orientation and speed, but the bias also exists. The next result is based on the previous step, so the bias will cumulate to unbearable error after a period of time. Figure 15(b) shows the trajectory of sensors based location with ELM and Kalman filter. We can see it making the trajectory smoother in some turnings. But it is a little more far from the groundtruth. We explain it as that the function of Kalman filter is to smooth the trajectory, but not to minimize the location error. Figure 15(c) indicates the sensors based location with ELM and Particle Filter. From it, we can conclude that the Particle Filter can make the trajectory smoother than before, but it does not improve the error accumulation by a large scale. The proposed method can be seen in Figure 15(d). It is really better than those methods mentioned above. It can offer a timely and highly accurate location result.Figure 15
(a) Trajectory of sensors based location with ELM; (b) trajectory of sensors based location with ELM and Kalman filter; (c) trajectory of sensors based location with ELM and Particle Filter; (d) trajectory of our proposed method (INS: sensors data).
(a)
(b)
(c)
(d)


#### 8.3.2. Experiments on Error Accumulation

In order to value the error accumulation existing in sensors based location and how our method improved the accuracy with the help of Wi-Fi based location and positive impact of Particle Filter, we calculate the distance error between the predicted position and the real one. And the result is shown in Figure16. From that, we can conclude that when we use sensors only, the location error will accumulate into unbearable distance as time goes on. When we added Kalman filter to it, the location error increases more than before, which can be explained as that Kalman filter’s function is to smooth the trajectory, not to minimize the location error. Fortunately, when we add Particle Filter, the location error decreases, but the error accumulation still leads the location accuracy divergence. When we use the Wi-Fi based location result to calibrate it within the Particle Filter framework, it will eliminate the error accumulation and keep the predicted position high precision.Figure 16
Location error of sensors based service and our proposed method (INS: sensors data).


#### 8.3.3. Evaluate the Location Time Consumption

We also did the experiment of the time consumption of Wi-Fi based location and our methods.From Figure17 we can see that when we use Wi-Fi based location method on each kind of smart phone, it will take about 4.5 seconds. We can see the point indicating the location result jumping on the map. But using our method, the time consuming is almost 200 milliseconds, so that we can get a smoothly trajectory on the map.Figure 17
Time consumption of Wi-Fi based location and our method.


## 8.1. Experimental Design and Data Preparing

In order to evaluate the performance, we build a test platform in our work space, as shown in Figure8. Including the aisle, it is about 100 m2 (8.5m*12m).Figure 8
Our working space in ICT F8.For the reason that we apply ELM algorithm in both Wi-Fi based location and senor based location, we will collect data to train the model during offline phase.Concerning sensors data, we plan a fixed route including straights and curves, shown in Figure9. People walk along this trajectory with any speed: slow, middle, fast, and even run. And they record the time at every label point by touching the volume key. As shown in Figure 10. In order that we can measure different types of motion, there are four persons doing the collection work, and each person walks five times. Every smart phone will be used once by each person.Figure 9
The presetting route.Figure 10
Collecting the sensors data.After collecting the original sensors data, we use Cubic Spline Interpolation to smooth the trajectory. Thirdly, we use slide-window to segment the trajectory with window lengthTw, shown in Figure 11. The Tw will be determined in the experiment, but we must make sure Tw>1/fs so that in every single slide-window there is independent data. In every window, we will calculate feature by (1). And measure the orientation and speed from the red points.Figure 11
The trajectory after smooth and segmented by slide-window.For the Wi-Fi based location part, we use the fingerprint method. So we also have to build a signal distribution map. We select 36 points that can cover the test area, shown in Figure12. Between every two adjacent points, it is about 1.5 m~2 m. We do not strictly require label points equally distributed in this area. We register four times at each point, collect Wi-Fi data for three times, and then use the mean value.Figure 12
Fingerprint points are in yellow color.During the online phase, people were walking along the trajectory, shown in Figure9, to collect testing data. We let a user to carry a smart phone to collect sensors data and get the Wi-Fi location result from the server. Then we will use these raws to predict the trajectory. After that, we can evaluate the performance by comparing with groundtruth.


## 8.2. Parameters Selection

### 8.2.1. Determine the Time Window LengthTw

Firstly, we will determine the window lengthTw. For the reason that the sensors frequency is fs≈65 Hz. In order to void the influence caused by noise, we use the mean value as the features. So we should ensure that there are about ten samples in each window. That is to say the Tw should be bigger than 160 milliseconds.We use Mean Square Error (MSE) [37] to measure the accuracy in ELM regression algorithms. The results are shown in Table 3. We can see that we can get lowest MSE in both orientation and velocity. So we set Tw to be 200 ms.Table 3
MSE of orientation and velocity in different window length.
Window length
200 ms
400 ms
600 ms
800 ms
1000 ms
MSE of orientation(degree)
25.0529
27.8570
26.8727
26.5759
26.4503
MSE of velocity(m/s2)
0.3001
0.4020
0.4158
0.4642
0.4435


### 8.2.2. Parameters of ELM Regression Models

For basic ELM, we only need to determine the number of hidden nodesL. The input weights and biases of hidden nodes can be generated randomly. We have collected 5316 training samples and divided them into 10 parts. Then we use 10-fold cross validation to select best parameter; the results are shown in Figure 13.Figure 13
10-fold cross validation to select number of hidden nodes (a) for velocity and (b) for orientation.
(a)
(b)From Figure13, we can come to conclusions that, for the ELM regression model of velocity, 500 hidden nodes are suitable and, for orientation regression, we can minimize test error when the model has 1000 hidden nodes. Finally, we set L to be 500 for velocity and 1000 for orientation. And we choseSigmoid [38] function for orientation andHardlim [39] function for velocity.


## 8.2.1. Determine the Time Window LengthTw

Firstly, we will determine the window lengthTw. For the reason that the sensors frequency is fs≈65 Hz. In order to void the influence caused by noise, we use the mean value as the features. So we should ensure that there are about ten samples in each window. That is to say the Tw should be bigger than 160 milliseconds.We use Mean Square Error (MSE) [37] to measure the accuracy in ELM regression algorithms. The results are shown in Table 3. We can see that we can get lowest MSE in both orientation and velocity. So we set Tw to be 200 ms.Table 3
MSE of orientation and velocity in different window length.
Window length
200 ms
400 ms
600 ms
800 ms
1000 ms
MSE of orientation(degree)
25.0529
27.8570
26.8727
26.5759
26.4503
MSE of velocity(m/s2)
0.3001
0.4020
0.4158
0.4642
0.4435


## 8.2.2. Parameters of ELM Regression Models

For basic ELM, we only need to determine the number of hidden nodesL. The input weights and biases of hidden nodes can be generated randomly. We have collected 5316 training samples and divided them into 10 parts. Then we use 10-fold cross validation to select best parameter; the results are shown in Figure 13.Figure 13
10-fold cross validation to select number of hidden nodes (a) for velocity and (b) for orientation.
(a)
(b)From Figure13, we can come to conclusions that, for the ELM regression model of velocity, 500 hidden nodes are suitable and, for orientation regression, we can minimize test error when the model has 1000 hidden nodes. Finally, we set L to be 500 for velocity and 1000 for orientation. And we choseSigmoid [38] function for orientation andHardlim [39] function for velocity.


## 8.3. Experimental Performance

In this section, in order to validate the proposed method, the comparisons to the existing methods are necessary. As the proposed method contains Wi-Fi and sensors information and takes use of ELM and Particle Filter algorithms, comparison experiments with some related methods should be involved. We firstly consider the Wi-Fi based location only and tried four different methods (K-NN, ELM, ELM + Kalman filter, and ELM + Particle Filter). Then we measure the location error of some sensors based methods and proposed method. Also the error accumulation tests have been considered as it is the key factor of location accuracy. Finally, we give a statistical result of the time consumption in our experiment to state that our proposed method is real practical.


### 8.3.1. Evaluate the Location Accuracy

Firstly, we compare the location performance ofK-NN, ELM, Kalman filter, and Particle Filter based on Wi-Fi fingerprint. As shown in Figure 14, ELM performs better than K-NN, but it is still not very good as expected. We can explain the reason as that every location process is separated with each other. They are not treated as a sequence; thus some relevant information has been missed. So we apply Kalman filter and Particle Filter to the location results of ELM. Fortunately, both of them can raise the accuracy by big percentages. But, Particle Filter performs much better as it is a nonlinear system, which is more effective to simulate the walking pattern.Figure 14
Location accuracy of four methods.Besides the Wi-Fi information, sensors data is also very useful for indoor location. It is usually used to detect gait and then use a default step length to estimate the walking distance. In proposed method, we use ELM model to build a mapping relationship of sensors data and walking pattern. Moreover, Kalman filter and Particle Filter also can be used to smooth the initial location results. To evaluate their performance, we not only compare the location mean error, but also calculate the location trajectory using Matlab. From Table4, we can conclude that, comparing to gait detection based method mentioned in [40], ELM based methods can get better results. And with the Particle Filter, mean error becomes smaller. But we can see that when we apply the Kalman filter to the ELM location result, the mean error is bigger than before. We explain it as the function of Kalman filter is to make the trajectory smoother, not to minimize the mean error, which can be seen in Figure 14. But filters can only make the trajectory smoother; they cannot solve the error accumulation problem. In order to solve the error accumulation, we combine the Wi-Fi location with the sensors data based location to come into being proposed method, which indeed can offer a small mean error.Table 4
Comparison of the performance of the different methods.
Sensors data(gait + Particle Filter) [40]
Sensors data(ELM)
Sensors data(ELM + Kalman filter)
Sensors data(ELM + Particle Filter)
Sensors data + Wi-Fi(ELM + Particle Filter)
Mean error (m)
1.542
0.609
0.829
0.633
0.150From Figure15(a), we can see that trajectory of sensors based location is not very good. As time goes on, the trajectory is getting more and more far away from groundtruth. The reason is that, within a short period of time, the sensors can offer good valuation of walking orientation and speed, but the bias also exists. The next result is based on the previous step, so the bias will cumulate to unbearable error after a period of time. Figure 15(b) shows the trajectory of sensors based location with ELM and Kalman filter. We can see it making the trajectory smoother in some turnings. But it is a little more far from the groundtruth. We explain it as that the function of Kalman filter is to smooth the trajectory, but not to minimize the location error. Figure 15(c) indicates the sensors based location with ELM and Particle Filter. From it, we can conclude that the Particle Filter can make the trajectory smoother than before, but it does not improve the error accumulation by a large scale. The proposed method can be seen in Figure 15(d). It is really better than those methods mentioned above. It can offer a timely and highly accurate location result.Figure 15
(a) Trajectory of sensors based location with ELM; (b) trajectory of sensors based location with ELM and Kalman filter; (c) trajectory of sensors based location with ELM and Particle Filter; (d) trajectory of our proposed method (INS: sensors data).
(a)
(b)
(c)
(d)


### 8.3.2. Experiments on Error Accumulation

In order to value the error accumulation existing in sensors based location and how our method improved the accuracy with the help of Wi-Fi based location and positive impact of Particle Filter, we calculate the distance error between the predicted position and the real one. And the result is shown in Figure16. From that, we can conclude that when we use sensors only, the location error will accumulate into unbearable distance as time goes on. When we added Kalman filter to it, the location error increases more than before, which can be explained as that Kalman filter’s function is to smooth the trajectory, not to minimize the location error. Fortunately, when we add Particle Filter, the location error decreases, but the error accumulation still leads the location accuracy divergence. When we use the Wi-Fi based location result to calibrate it within the Particle Filter framework, it will eliminate the error accumulation and keep the predicted position high precision.Figure 16
Location error of sensors based service and our proposed method (INS: sensors data).


### 8.3.3. Evaluate the Location Time Consumption

We also did the experiment of the time consumption of Wi-Fi based location and our methods.From Figure17 we can see that when we use Wi-Fi based location method on each kind of smart phone, it will take about 4.5 seconds. We can see the point indicating the location result jumping on the map. But using our method, the time consuming is almost 200 milliseconds, so that we can get a smoothly trajectory on the map.Figure 17
Time consumption of Wi-Fi based location and our method.


## 8.3.1. Evaluate the Location Accuracy

Firstly, we compare the location performance ofK-NN, ELM, Kalman filter, and Particle Filter based on Wi-Fi fingerprint. As shown in Figure 14, ELM performs better than K-NN, but it is still not very good as expected. We can explain the reason as that every location process is separated with each other. They are not treated as a sequence; thus some relevant information has been missed. So we apply Kalman filter and Particle Filter to the location results of ELM. Fortunately, both of them can raise the accuracy by big percentages. But, Particle Filter performs much better as it is a nonlinear system, which is more effective to simulate the walking pattern.Figure 14
Location accuracy of four methods.Besides the Wi-Fi information, sensors data is also very useful for indoor location. It is usually used to detect gait and then use a default step length to estimate the walking distance. In proposed method, we use ELM model to build a mapping relationship of sensors data and walking pattern. Moreover, Kalman filter and Particle Filter also can be used to smooth the initial location results. To evaluate their performance, we not only compare the location mean error, but also calculate the location trajectory using Matlab. From Table4, we can conclude that, comparing to gait detection based method mentioned in [40], ELM based methods can get better results. And with the Particle Filter, mean error becomes smaller. But we can see that when we apply the Kalman filter to the ELM location result, the mean error is bigger than before. We explain it as the function of Kalman filter is to make the trajectory smoother, not to minimize the mean error, which can be seen in Figure 14. But filters can only make the trajectory smoother; they cannot solve the error accumulation problem. In order to solve the error accumulation, we combine the Wi-Fi location with the sensors data based location to come into being proposed method, which indeed can offer a small mean error.Table 4
Comparison of the performance of the different methods.
Sensors data(gait + Particle Filter) [40]
Sensors data(ELM)
Sensors data(ELM + Kalman filter)
Sensors data(ELM + Particle Filter)
Sensors data + Wi-Fi(ELM + Particle Filter)
Mean error (m)
1.542
0.609
0.829
0.633
0.150From Figure15(a), we can see that trajectory of sensors based location is not very good. As time goes on, the trajectory is getting more and more far away from groundtruth. The reason is that, within a short period of time, the sensors can offer good valuation of walking orientation and speed, but the bias also exists. The next result is based on the previous step, so the bias will cumulate to unbearable error after a period of time. Figure 15(b) shows the trajectory of sensors based location with ELM and Kalman filter. We can see it making the trajectory smoother in some turnings. But it is a little more far from the groundtruth. We explain it as that the function of Kalman filter is to smooth the trajectory, but not to minimize the location error. Figure 15(c) indicates the sensors based location with ELM and Particle Filter. From it, we can conclude that the Particle Filter can make the trajectory smoother than before, but it does not improve the error accumulation by a large scale. The proposed method can be seen in Figure 15(d). It is really better than those methods mentioned above. It can offer a timely and highly accurate location result.Figure 15
(a) Trajectory of sensors based location with ELM; (b) trajectory of sensors based location with ELM and Kalman filter; (c) trajectory of sensors based location with ELM and Particle Filter; (d) trajectory of our proposed method (INS: sensors data).
(a)
(b)
(c)
(d)


## 8.3.2. Experiments on Error Accumulation

In order to value the error accumulation existing in sensors based location and how our method improved the accuracy with the help of Wi-Fi based location and positive impact of Particle Filter, we calculate the distance error between the predicted position and the real one. And the result is shown in Figure16. From that, we can conclude that when we use sensors only, the location error will accumulate into unbearable distance as time goes on. When we added Kalman filter to it, the location error increases more than before, which can be explained as that Kalman filter’s function is to smooth the trajectory, not to minimize the location error. Fortunately, when we add Particle Filter, the location error decreases, but the error accumulation still leads the location accuracy divergence. When we use the Wi-Fi based location result to calibrate it within the Particle Filter framework, it will eliminate the error accumulation and keep the predicted position high precision.Figure 16
Location error of sensors based service and our proposed method (INS: sensors data).


## 8.3.3. Evaluate the Location Time Consumption

We also did the experiment of the time consumption of Wi-Fi based location and our methods.From Figure17 we can see that when we use Wi-Fi based location method on each kind of smart phone, it will take about 4.5 seconds. We can see the point indicating the location result jumping on the map. But using our method, the time consuming is almost 200 milliseconds, so that we can get a smoothly trajectory on the map.Figure 17
Time consumption of Wi-Fi based location and our method.


## 9. Conclusion and Future Work

In this paper, we have presented a real-time and accurate indoor localization based on fusion model of Wi-Fi fingerprint and motion Particle Filter. The reason we raised this problem is that: a lot of sensors are integrated in smart phones, so we can easily get sensors data and Wi-Fi signals which can be used for indoor localization. But any single method cannot get satisfactory result. So we combine Wi-Fi based location and sensors based inertial navigation. And we also use Particle Filter and ELM algorithm to improve the location accuracy. From the experiments result, we can see that our method has achieved a good performance. But to get a better accuracy, we think that another technology should be taken into account. RFID may be the suitable candidate. On the other hand, in order to speed up the localization service, maybe MapReduce framework [41] or Parallel Framework [42–46] can be involved.



---

*Source: 545792-2015-05-27.xml*