# WiFi Positioning Based on User Orientation Estimation and Smartphone Carrying Position Recognition

Authors: Zhi-An Deng; Zhiyu Qu; Changbo Hou; Weijian Si; Chunjie Zhang
Journal: Wireless Communications and Mobile Computing
 (2018)

---

## Abstract

Accuracy performance of WiFi fingerprinting positioning systems deteriorates severely when signal attenuations caused by human body are not considered. Previous studies have proposed WiFi fingerprinting positioning based on user orientation using compasses built in smartphones. However, compasses always cannot provide required accuracy of user orientation estimation due to the severe indoor magnetic perturbations. More importantly, we discover that not only user orientations but also smartphone carrying positions may affect signal attenuations caused by human body greatly. Therefore, we propose a novel WiFi fingerprinting positioning approach considering both user orientations and smartphone carrying positions. For user orientation estimation, we deploy Rotation Matrix and Principal Component Analysis (RMPCA) approach. For carrying position recognition, we propose a robust Random Forest classifier based on the developed orientation invariant features. Experimental results show that the proposed WiFi positioning approach may improve positioning accuracy significantly.


---

## Body

## 1. Introduction

Location awareness [1–5] based on pervasively available devices such as smartphones has received increasing attentions for Internet of Things (IoT) applications. The Global Navigation Satellite Systems (GNSS) [6] have dominated the outdoor positioning solutions. For indoor environments, since the GNSS signal cannot penetrate man-made infrastructures, many indoor positioning technologies, such as ultra-wideband [7] and radio frequency identification [8], have been developed. Most existing indoor positioning solutions with high positioning accuracy require extra hardware and high cost. Because of the large-scale deployment of access points (APs) and pervasively available smartphones with wireless network card installed, WiFi positioning using received signal strength (RSS) has been considered as one of the most popular indoor positioning solutions.WiFi positioning systems can be divided into model based approach and fingerprinting based approach. The model based approach [9, 10] constructs the function relating RSS with the physical distance between the mobile devices and the AP. If more than three physical distances are obtained, user location estimation can be obtained by deploying a trilateration method. In contrast, the fingerprinting based approach [11–13] includes two phases: offline phase and online phase. During offline phase, RSS values from available APs are collected at predefined calibration points and stored as fingerprints to generate the so-called radio map. During online phase, the new measured RSS vectors are matched with the prestored fingerprints in the radio map. The user location is ultimately estimated by weighting locations of the matched calibration points [14, 15] or deploying some machine learning based methods [16, 17]. Due to the complex radio propagation environment, it is difficult for model based approach to construct an accurate function to estimate the distance information. As a result, the accuracy performance cannot be guaranteed by the model based approach. Therefore, we deploy WiFi fingerprinting approach in our paper.For WiFi fingerprinting approach, a key challenge is the RSS radio mismatch [18–20] phenomenon. This phenomenon occurs when radio environments between RSS radio map construction during offline phase and online positioning phase are obviously different and may deteriorate accuracy performance of WiFi fingerprinting positioning greatly. One main reason of radio mismatch is caused by the neglected user orientations [21]. Users tend to carry smartphones near to their body, which consists of more than 50% water. The human body might block WiFi signal transmission of 2.4 GHz, especially when the body is between an AP and a smartphone [22]. Previous works [23–25] have carried experiments to confirm the substantial RSS variations caused by user orientations. RSS may vary up to 15dBm [21] at a fixed location when the user facing an AP turns around. As a result, for a fingerprinting based approach, the mismatch of user orientations between offline training phase and online positioning phase may degrade the positioning accuracy greatly.In order to solve the user orientation mismatch problem, in [26] a user orientation based fingerprinting positioning approach has been proposed. A digital compass built in a smartphone is utilized to detect the user orientation. During offline phase, the user orientation information is also added to enhance the radio map. During online phase, based on the estimated user orientation information, new measured RSS vector samples are only compared with the selected fingerprints sharing a similar user orientation. Similar approaches have been proposed in [27, 28], in which the radio map is extended with user orientation information. However, two problems still need to be solved to enhance the reliability and applicability of fingerprinting based positioning. Firstly, for indoor environments, Earth’s magnetic field exploited by digital compass is always noisy and severely perturbed by man-made infrastructures, rendering the user orientation estimations using compasses unavailable. Secondly, we discover that not only user orientations but also smartphone carrying positions may affect RSS greatly due to the different human body attenuation schemes. The impact of different carrying positions on RSS patterns is not considered by previous works, which always assume that the smartphones are held in hand in front of users. However, for daily uses of a smartphone, other carrying positions [29, 30] such as in the trouser pocket or near to ear during phone calls are also widely deployed.This paper proposes a novel WiFi fingerprinting positioning approach based on user orientation estimation and smartphone carrying position recognition. To the best of our knowledge, our research is the first to consider impacts of user orientation and smartphone carrying position information on RSS patterns simultaneously. Both the user orientation and the smartphone carrying position information are added into the radio map. For user orientation estimation, rather than deploy noisy digital compasses, we deploy our previous proposed Rotation Matrix and Principal Component Analysis (RMPCA) approach [31]. The basic principle is to exploit the principal component of accelerations in the horizontal plane, which is assumed to be parallel with user walking direction. For smartphone carrying position recognition, we investigate the four most classical positions [32], including being held in hand in front of the user (hand-held), put in the trouser pocket (inpocket), near to the right ear during phone calls (phone-call), and in the swinging-hand (swinging-hand). We deploy the Random Forest classifier [33] to recognize the four carrying positions. In order to adapt the changing device orientations, we exploit several orientation invariant features as input features of the classifier.Experiments in a realistic indoor environment show that the proposed WiFi fingerprinting positioning approach may enhance reliability and applicability significantly. In summary, our work makes the main contributions as follows:(i) We propose a novel WiFi fingerprinting approach considering both user orientations and smartphone carrying positions.(ii)We discover that not only user orientations but also smartphone carrying positions may affect RSS patterns greatly.(iii) We propose a robust carrying position recognition classifier by exploiting several orientation invariant features.(iv) We report the evaluation of the proposed fingerprinting approach based on extensive experimental samples and compare it with existing approaches.The remainder of this paper is structured as follows. We present an overview of the proposed WiFi fingerprinting positioning in the following section. In Section3, we propose a robust carrying position classifier. Section 4 describes the user orientation estimation algorithm using RMPCA approach. Section 5 firstly introduces the impact of user orientations and carrying positions on RSS and then presents the proposed user orientation and carrying position based fingerprinting approach. The experimental results are reported and analyzed in detail in Section 6. In the last section, we give a conclusion and our future works.


## 2. Overview of the Proposed WiFi Fingerprinting Positioning Approach

Figure1 presents an overview of the proposed WiFi fingerprinting positioning approach based on user orientation estimation and carrying position recognition. The approach is divided into offline phase and online phase. During offline phase, RSS data at predefined calibration points are collected at eight orientations equally distributed in a circle with four investigated different carrying positions, respectively. As a result, an enhanced radio map, whose fingerprints are labeled with both user orientations and carrying positions, is constructed.Figure 1
Overview of the proposed WiFi fingerprinting positioning approach.During online phase, we deploy a robust Random Forest based classifier to recognize the smartphone carrying positions. The classifier exploits orientation invariant features generated by acceleration signals as input features. Furthermore, we develop RMPCA based user orientation estimation upon a continuous device attitude tracking. Using the estimated user orientations and recognized carrying positions, we select the fingerprints with similar orientation and the same carrying position, instead of all the fingerprints in the enhanced radio map. Finally, a pattern matching algorithm based on maximum likelihood [22] is used for ultimate location estimation.


## 3. Robust Smartphone Carrying Position Recognition

For daily uses of smartphones, it is more applicable to assume an unfixed carrying position. For example, it is more common for male users to put the smartphones in their trouser pockets [29]. Different RSS values will be collected with different carrying positions, even in a fixed location with the same user orientation, as will be seen later in Section 5.1. Therefore, we develop a smartphone carrying position recognition method to detect the device carrying position before pattern matching of fingerprinting based approach. For simplicity, we only investigate the four most widely used carrying positions: hand-held, inpocket, swinging-hand, and phone call.As previous works [34, 35] suggested, acceleration signals with different device carrying positions show different patterns. Previous classifiers are always founded on relatively fixed and controlled device orientations and deploy normal time domain features [34] for carrying position classifier. The statistics of raw acceleration signal samples over a sliding window, including maximum, minimum, mean, medium, and variance, are computed and deployed as input features to train the carrying position classifier. However, the device orientations may vary for different users due to different user habits. For the same user, the device orientation may also change with the user walking and the other body locomotion. If the device orientations are not fixed, the three-dimensional acceleration signals may vary a lot with unconstrained device orientations at a fixed carrying position. As a result, classification accuracy of previous carrying position classifiers may deteriorate significantly with unconstrained device orientations.In order to recognize carrying positions with unconstrained device orientations, we propose a robust classifier upon orientation invariant features. Instead of deploying raw three-dimensional accelerations, we exploit three variables, including total magnitude of accelerationMAcc, magnitude of the horizontal acceleration HAcc, and acceleration in the gravity direction GAcc,(1)MAcc=Acc2=Accx2+Accy2+Accz2(2)HAcc=Acc-Acc·gnormalgnormal2(3)GAcc=Acc·gnormalgnormal2where Acc=AccxAccyAcczT is the raw acceleration signal, ∙2 is the 2-norm operator, and gnormal is related gravity vector with normalized value. The gravity vector can be obtained by transforming standard gravity vector using tracked quaternion vector as in (4). These variables show distinct patterns at different carrying positions. Compared with raw acceleration signals, these variables remain relatively stable when the carrying positions are the same, regardless of changing device orientations.The classifier design includes three stages: data preprocessing, feature extraction, classifier training, and testing. Firstly, we collect raw acceleration signal samples from an accelerometer continuously and split them into segments by a sliding window [34]. Size of the window is two seconds and with one second overlap between neighboring windows. Then, we compute three-orientation invariant variable samples over each window. After data preprocessing, we exploit the statistics of the three variables as input features of carrying positioning classifier, including maximum, minimum, mean, medium, and variance. The input features are all useful to distinguish different carrying positions. For example, because of the higher locomotion intensity of leg than the upper user body, maximum values of HAcc for inpocket are always significantly larger than those of phone-call positions. Variance values of MAcc of the phone-call positions are always significantly smaller than those of inpocket positions. More importantly, these input features are insensitive to device orientations and almost independent with device orientations.After feature extraction, we deploy Random Forest as the classifier, which performs well in many multiclass classification problems. We collect acceleration signals over four thousand sliding windows with four investigated carrying positions. For each position, we sample acceleration signals over all possible device orientations uniformly. We use the widely used 10-fold cross-validation method to train and test the classifier. The extracted features are partitioned into ten parts randomly. Nine of the ten parts are used for training and the rest part for testing. We repeat the whole process for one hundred times by randomly selecting one part for testing. Experimental results show that the robust Radom Forest classifier may improve classification accuracy than compared previous classifiers, as will be seen in Section6.2.


## 4. User Orientation Estimation

In order to obtain and represent the absolute user orientation, we firstly define global coordinate system (GCS). GCS consists of three axesXG, YG, and ZG, which point to east, north, and the sky, respectively. To describe the raw measured signals from inertial sensors, we also define device coordinate system (DCS), which consists of three axes XDCS, YDCS, and ZDCS. The XDCS and YDCS axes point right and forward in the front face of smartphone screen, respectively, while ZDCS axis is a standard cross-product of the former two axes. We assume that the initial user orientation is known by other techniques such as landmarks [36]. The user orientation is just the user walking direction, whose value at GCS is defined as the rotation angle from the positive YG to user walking direction counterclockwise.


### 4.1. Device Attitude Tracking

For RMPCA based user orientation approach, it is important to obtain the device attitude continuously. We deploy Extended Kalman Filter (EKF) to model the device attitude tracking. Before designing EKF, we describe device attitude by quaternion vector as given,(4)hDCSt=CGCSDCSqtThGCStwhere CGCSDCSqt is the rotation matrix from DCS to GCS, hGCSt and hDCSt are the vectors represented at GCS and DCS, and argument t represents the time, which will be omitted in the following equations, rotation matrix can be given as(5)CGCSDCSq=q02+q12-q22-q322q1q2-q0q32q1q3+q0q22q1q2+q0q3q02-q12+q22-q322q2q3-q0q12q1q3-q0q22q0q1+q2q3q02-q12-q22+q32where q=q0q1q2q3T is the quaternion vector with normalized magnitude.Secondly, following the kinematic law of rigid body [37], the discrete time evolution model of rotation quaternion vector is given as follows:(6)qk+1=exp0.5×ΩwkTsqk=Icos⁡0.5×Δθk+ΩwkTssin⁡0.5×ΔθkΔθkqkwhere Ts is the time interval, k and k+1 represent time instants kTs and k+1Ts, qk and qk+1 are the related time evolution quaternion vectors, wk=wkxwkywkzT is three-dimensional angular velocity at DCS, I is an 3×3 identity matrix, Δθk=Tswkx2+wky2+wkz2, and ΩwkTs is given by(7)ΩwkTs=Ts0-wkx-wky-wkzwkx0wkz-wkywky-wkz0wkxwkzwky-wkx0The quaternion qk+1 is determined once the initial quaternion vector q0 is known. Therefore, state model of EKF is given by(8)qk+1=Fkqk+wkqwhere the state transition matrix Fk=exp⁡0.5∗ΩwkTs and (9)wkq=Ξkwkgyro=-Ts2ek×+q0kI-ekTwkgyroqk=q0kq1kq2kq3kT is the rotation quaternion vector at time instants kTs with vector part ek=q1kq2kq3kT, wkgyro is the Gaussian measurement noise variable of angular velocity, and [ek×] is a standard vector cross-product operator.The measurement model of EKF is given by(10)zk+1=ak+1mk+1=ϕqk+1+vk+1=CGCSDCSqk+1T00CGCSDCSqk+1Tg0h0+vk+1avk+1mwhere ak+1 and mk+1 are the raw measured acceleration and magnetic vectors at DCS, respectively; vk+1a and vk+1m are the related measurement noise variables; g0 and h0 are the local gravity and magnetic vectors at GCS, respectively. The measurement noise covariance matrix Rk+1 is given by(11)Rk+1=Rk+1a00Rk+1m=σa2RI300σm2RI3where σa2R and σm2R are set adaptively as follows:(12)σa2R=σa2,ak+12-g02<εa1∩varak+1-Na/22:ak+1+Na/22<εa2∞,otherwise(13)σm2R=σm2,mk+12-h02<εm1∩varmk+1-Nm/22:mk+1+Nm/22<εm2∞,otherwisewhere εa1 is the allowed maximum difference between magnitude of new measured acceleration signal and that of the local gravity vector, var· calculates the variance of signals within a centered window, εa2 is the allowed maximum variance of Na acceleration signals, εm1 is the allowed maximum difference between magnitude of new measured magnetic signal and that of the local magnetic signal, and εm2 is the allowed maximum variance of Nm magnetic signals.Based on the state model in (8) and the measurement model in (10), the state vector qk+1 can be iteratively updated by EKF model.


### 4.2. RMPCA Based User Orientation Estimation

Many works [38] assume that the user orientation is the same as the device forward direction or the angle difference between them is fixed. Therefore, they can directly estimate the user orientation using the device attitude tracking model described in Section 4.1. However, the angle difference between user orientation and device forward direction always varies rapidly with highly dynamic body locomotion, rendering attitude estimation inapplicable for user orientation estimation. Therefore, we deploy RMPCA approach [31] for user orientation estimation. During pedestrian walking period, we assume that the user orientation is just the walking direction. The basic principle of RMPCA is that walking direction is parallel to the principal component of the acceleration signals in the horizontal plane, which dominates most of the horizontal acceleration signal energy.In detail, RMPCA firstly transforms all raw measured RSS signals during a walking step at DCS into GCS, as follows:(14)aGCSi=CGCSDCSqaDCSi,i=1,…,Nstepwhere aGCSi=aGCSixaGCSiyaGCSizT is the i-th acceleration signal represented at GCS, Nstep is the number of acceleration signals within the walking step, and q is the tracked quaternion vector. Each walking step is detected by a widely used peak detection algorithm [39], which relates the heel strike of each step to an acceleration peak value. The acceleration signals in the horizontal plane are in fact the former two acceleration components of aGCSi. Then, we perform PCA over horizontal acceleration signals within a walking step to extract the walking direction WDglobal=WDglobalxWDglobalyT. The user orientation Ouser can be estimated as follows:(15)Ouser=arctanWDglobalyWDglobalx-π2


## 4.1. Device Attitude Tracking

For RMPCA based user orientation approach, it is important to obtain the device attitude continuously. We deploy Extended Kalman Filter (EKF) to model the device attitude tracking. Before designing EKF, we describe device attitude by quaternion vector as given,(4)hDCSt=CGCSDCSqtThGCStwhere CGCSDCSqt is the rotation matrix from DCS to GCS, hGCSt and hDCSt are the vectors represented at GCS and DCS, and argument t represents the time, which will be omitted in the following equations, rotation matrix can be given as(5)CGCSDCSq=q02+q12-q22-q322q1q2-q0q32q1q3+q0q22q1q2+q0q3q02-q12+q22-q322q2q3-q0q12q1q3-q0q22q0q1+q2q3q02-q12-q22+q32where q=q0q1q2q3T is the quaternion vector with normalized magnitude.Secondly, following the kinematic law of rigid body [37], the discrete time evolution model of rotation quaternion vector is given as follows:(6)qk+1=exp0.5×ΩwkTsqk=Icos⁡0.5×Δθk+ΩwkTssin⁡0.5×ΔθkΔθkqkwhere Ts is the time interval, k and k+1 represent time instants kTs and k+1Ts, qk and qk+1 are the related time evolution quaternion vectors, wk=wkxwkywkzT is three-dimensional angular velocity at DCS, I is an 3×3 identity matrix, Δθk=Tswkx2+wky2+wkz2, and ΩwkTs is given by(7)ΩwkTs=Ts0-wkx-wky-wkzwkx0wkz-wkywky-wkz0wkxwkzwky-wkx0The quaternion qk+1 is determined once the initial quaternion vector q0 is known. Therefore, state model of EKF is given by(8)qk+1=Fkqk+wkqwhere the state transition matrix Fk=exp⁡0.5∗ΩwkTs and (9)wkq=Ξkwkgyro=-Ts2ek×+q0kI-ekTwkgyroqk=q0kq1kq2kq3kT is the rotation quaternion vector at time instants kTs with vector part ek=q1kq2kq3kT, wkgyro is the Gaussian measurement noise variable of angular velocity, and [ek×] is a standard vector cross-product operator.The measurement model of EKF is given by(10)zk+1=ak+1mk+1=ϕqk+1+vk+1=CGCSDCSqk+1T00CGCSDCSqk+1Tg0h0+vk+1avk+1mwhere ak+1 and mk+1 are the raw measured acceleration and magnetic vectors at DCS, respectively; vk+1a and vk+1m are the related measurement noise variables; g0 and h0 are the local gravity and magnetic vectors at GCS, respectively. The measurement noise covariance matrix Rk+1 is given by(11)Rk+1=Rk+1a00Rk+1m=σa2RI300σm2RI3where σa2R and σm2R are set adaptively as follows:(12)σa2R=σa2,ak+12-g02<εa1∩varak+1-Na/22:ak+1+Na/22<εa2∞,otherwise(13)σm2R=σm2,mk+12-h02<εm1∩varmk+1-Nm/22:mk+1+Nm/22<εm2∞,otherwisewhere εa1 is the allowed maximum difference between magnitude of new measured acceleration signal and that of the local gravity vector, var· calculates the variance of signals within a centered window, εa2 is the allowed maximum variance of Na acceleration signals, εm1 is the allowed maximum difference between magnitude of new measured magnetic signal and that of the local magnetic signal, and εm2 is the allowed maximum variance of Nm magnetic signals.Based on the state model in (8) and the measurement model in (10), the state vector qk+1 can be iteratively updated by EKF model.


## 4.2. RMPCA Based User Orientation Estimation

Many works [38] assume that the user orientation is the same as the device forward direction or the angle difference between them is fixed. Therefore, they can directly estimate the user orientation using the device attitude tracking model described in Section 4.1. However, the angle difference between user orientation and device forward direction always varies rapidly with highly dynamic body locomotion, rendering attitude estimation inapplicable for user orientation estimation. Therefore, we deploy RMPCA approach [31] for user orientation estimation. During pedestrian walking period, we assume that the user orientation is just the walking direction. The basic principle of RMPCA is that walking direction is parallel to the principal component of the acceleration signals in the horizontal plane, which dominates most of the horizontal acceleration signal energy.In detail, RMPCA firstly transforms all raw measured RSS signals during a walking step at DCS into GCS, as follows:(14)aGCSi=CGCSDCSqaDCSi,i=1,…,Nstepwhere aGCSi=aGCSixaGCSiyaGCSizT is the i-th acceleration signal represented at GCS, Nstep is the number of acceleration signals within the walking step, and q is the tracked quaternion vector. Each walking step is detected by a widely used peak detection algorithm [39], which relates the heel strike of each step to an acceleration peak value. The acceleration signals in the horizontal plane are in fact the former two acceleration components of aGCSi. Then, we perform PCA over horizontal acceleration signals within a walking step to extract the walking direction WDglobal=WDglobalxWDglobalyT. The user orientation Ouser can be estimated as follows:(15)Ouser=arctanWDglobalyWDglobalx-π2


## 5. Proposed WiFi Fingerprinting Positioning Approach

This section firstly describes the impact of user orientations and carrying positions on RSS, which may directly indicate the motivation of the proposed approach. Then, we describe the proposed fingerprinting approach based on an enhanced radio map considering both user orientations and carrying positions. The user location is ultimately estimated by a maximum likelihood based pattern matching algorithm.


### 5.1. Impact of User Orientations and Carrying Positions on RSS

We have carried four experiments to evaluate the impact of user orientations and carrying positions on RSS: line-of-sight (LOS) environment near to AP, LOS environment far away from AP, none-line-of-sight (NLOS) environment near to AP, and NLOS environment far away from AP. We program a smartphone to collect RSS readings every 500 milliseconds from an AP with a total 200 samples for each fixed user orientation and carrying position. The experimental user rotates its orientation by an interval of 45 degrees for a total number of eight orientations. For near and far environments, the distances between AP and user are four and twelve meters, respectively. For user orientation of 90 degrees and 180 degrees, the user is faced with and points away from the AP, respectively.Figure2 shows the mean RSS of different user orientations with four carrying positions under the LOS environment near to AP. For hand-held position, RSS values of the user just facing to AP or with the adjacent orientations are greatly larger than those of back toward AP. In particular, compared with user orientation of 180 degrees (back toward AP), the mean RSS values with user orientation of 90 degrees (facing to AP) increase about 20 dB. This is because a user holding the smartphone in hand may block the LOS WiFi signal totally when he stands between the AP and the smartphone. Similarly, for hand-held position under LOS environment far away from AP, RSS values of the user just faced with AP or with the adjacent orientations are also significantly larger than those of back toward AP, while the increments are a little smaller than those of the near to AP environment.Figure 2
Impact of user orientations and carrying positions on mean RSS under the LOS environment near to AP.For the other three carrying positions, there are also significant RSS variations caused by varied user orientations. However, the maximum and minimum RSS values may occur in a very different user orientation. For the phone-call position, the minimum RSS value occurs in the user orientation of 0 degrees instead of 270 degrees for the hand-held position, since the side of user body rather than the whole user body blocks the LOS WiFi signal. As a result, RSS patterns of the same user orientation and different carrying positions are also distinct due to the different signal blocking scheme of user body. It is necessary to add both user orientations and carrying positions to enhance the radio map.Figure3 shows the mean RSS of different user orientations with four carrying positions under the NLOS environments near to AP. We can see that, for hand-held position, RSS values of the user just facing to AP increase about 8 dB than those of back toward AP. Since there is no direct path between AP and the smartphone, the blocking effect of user body under NLOS environment is significantly smaller than that of LOS environment. Furthermore, for NLOS environment far away from AP, the signal blocking effect of user body can be neglected, due to the more complex multipath and NLOS propagation environments. However, for different user orientations and carrying positions, RSS patterns are also different due to different radio propagation environments, though there are no obvious effects of signal absorptions caused by user body. Therefore, in order to avoid introducing the radio mismatch during pattern matching process, both user orientations and carrying positions should be considered in the WiFi fingerprinting approach.Figure 3
Impact of user orientations and carrying positions on mean RSS under the NLOS environment near to AP.


### 5.2. Enhanced Radio Map Based Location Estimation Using Maximum Likelihood

The proposed WiFi fingerprinting positioning approach consists of two stages: offline enhanced radio map construction and online location estimation. During the offline stage, RSS readings from multiple available APs are collected to build the radio map. The raw RSS value is denoted asψi,jo,cτ, which indicates RSS from the i-th AP at the j-th calibration point, with user orientation o and carrying position c. For each calibration point, we collect RSS data at eight orientations O=0°,45°,…,315° with four different carrying positions C=hand-held,in-pocket,swinging-hand,phone-call. Then, the enhanced radio map can be represented by ψ as(16)ψo,cτ=ψ1,1o,cτψ1,2o,cτ⋯ψ1,No,cτψ2,1o,cτψ2,2o,cτ⋯ψ2,No,cτ⋮⋮⋱⋮ψM,1o,cτψM,2o,cτ⋯ψM,No,cτwhere M is the number of APs, N is the number of calibration points, τ=1,…,Q is time index of temporal RSS samples, and Q is the number of RSS samples. The row vector of ψ represents the RSS data of one AP over N calibration points with Q temporal length. The column vector of ψ represents the M-dimensional RSS samples at the j-th calibration point.During online stage, a maximum likelihood based pattern matching algorithm is used for location estimation. Maximum likelihood algorithm estimates the likelihood value of new measured RSS observations for all candidate calibration points and weights the points having maximum likelihood as the positioning result. The new measured RSS vectors can be represented as(17)ψnewo~,c~=ψ1,newo~,c~ψ2,newo~,c~…ψM,newo~,c~Twhere o~ is the estimated user orientation as in (15) and c~ is the recognized carrying position of the four investigated positions. Based on the estimated user orientation and recognized carrying position, we select the fingerprints with similar orientations and the same positions for pattern matching. Particularly, we obtain the two orientations o1,o2 in the set O, which have the smallest absolute differences with the estimated user orientation o~. The selected radio map can be generated by selecting fingerprints ψo1,c~τ and ψo2,c~τ. For each calibration point, RSS values collected at two orientations o1,o2 are merged into one group.Maximum likelihood algorithm treats the statistical distribution of RSS from one AP at each calibration point as Gaussian distribution. For new RSS vectors, the likelihood at calibration pointLi is calculated by the product of likelihood of all available APs:(18)fψnewo~,c~Li=∏j=1Mfψj,newo~,c~Liwhere fψj,newo~,c~Li is the likelihood of calibration point Li for the j-th AP. The Gaussian function is deployed as likelihood function for RSS statistical distribution:(19)fψj,newo~,c~Li=12πσexp⁡-ψj,newo~,c~-μij22σ2where μij is the mean RSS value for the j-th AP at calibration point Li with carrying position c~ and the user orientations o1,o2 and σ is the parameter relating with standard variance. The user location is ultimately estimated by averaging the K calibration points, (20)Luser=1K∑i=1KL~iwhere L~i are the locations of K calibration points with the maximum likelihood value.


## 5.1. Impact of User Orientations and Carrying Positions on RSS

We have carried four experiments to evaluate the impact of user orientations and carrying positions on RSS: line-of-sight (LOS) environment near to AP, LOS environment far away from AP, none-line-of-sight (NLOS) environment near to AP, and NLOS environment far away from AP. We program a smartphone to collect RSS readings every 500 milliseconds from an AP with a total 200 samples for each fixed user orientation and carrying position. The experimental user rotates its orientation by an interval of 45 degrees for a total number of eight orientations. For near and far environments, the distances between AP and user are four and twelve meters, respectively. For user orientation of 90 degrees and 180 degrees, the user is faced with and points away from the AP, respectively.Figure2 shows the mean RSS of different user orientations with four carrying positions under the LOS environment near to AP. For hand-held position, RSS values of the user just facing to AP or with the adjacent orientations are greatly larger than those of back toward AP. In particular, compared with user orientation of 180 degrees (back toward AP), the mean RSS values with user orientation of 90 degrees (facing to AP) increase about 20 dB. This is because a user holding the smartphone in hand may block the LOS WiFi signal totally when he stands between the AP and the smartphone. Similarly, for hand-held position under LOS environment far away from AP, RSS values of the user just faced with AP or with the adjacent orientations are also significantly larger than those of back toward AP, while the increments are a little smaller than those of the near to AP environment.Figure 2
Impact of user orientations and carrying positions on mean RSS under the LOS environment near to AP.For the other three carrying positions, there are also significant RSS variations caused by varied user orientations. However, the maximum and minimum RSS values may occur in a very different user orientation. For the phone-call position, the minimum RSS value occurs in the user orientation of 0 degrees instead of 270 degrees for the hand-held position, since the side of user body rather than the whole user body blocks the LOS WiFi signal. As a result, RSS patterns of the same user orientation and different carrying positions are also distinct due to the different signal blocking scheme of user body. It is necessary to add both user orientations and carrying positions to enhance the radio map.Figure3 shows the mean RSS of different user orientations with four carrying positions under the NLOS environments near to AP. We can see that, for hand-held position, RSS values of the user just facing to AP increase about 8 dB than those of back toward AP. Since there is no direct path between AP and the smartphone, the blocking effect of user body under NLOS environment is significantly smaller than that of LOS environment. Furthermore, for NLOS environment far away from AP, the signal blocking effect of user body can be neglected, due to the more complex multipath and NLOS propagation environments. However, for different user orientations and carrying positions, RSS patterns are also different due to different radio propagation environments, though there are no obvious effects of signal absorptions caused by user body. Therefore, in order to avoid introducing the radio mismatch during pattern matching process, both user orientations and carrying positions should be considered in the WiFi fingerprinting approach.Figure 3
Impact of user orientations and carrying positions on mean RSS under the NLOS environment near to AP.


## 5.2. Enhanced Radio Map Based Location Estimation Using Maximum Likelihood

The proposed WiFi fingerprinting positioning approach consists of two stages: offline enhanced radio map construction and online location estimation. During the offline stage, RSS readings from multiple available APs are collected to build the radio map. The raw RSS value is denoted asψi,jo,cτ, which indicates RSS from the i-th AP at the j-th calibration point, with user orientation o and carrying position c. For each calibration point, we collect RSS data at eight orientations O=0°,45°,…,315° with four different carrying positions C=hand-held,in-pocket,swinging-hand,phone-call. Then, the enhanced radio map can be represented by ψ as(16)ψo,cτ=ψ1,1o,cτψ1,2o,cτ⋯ψ1,No,cτψ2,1o,cτψ2,2o,cτ⋯ψ2,No,cτ⋮⋮⋱⋮ψM,1o,cτψM,2o,cτ⋯ψM,No,cτwhere M is the number of APs, N is the number of calibration points, τ=1,…,Q is time index of temporal RSS samples, and Q is the number of RSS samples. The row vector of ψ represents the RSS data of one AP over N calibration points with Q temporal length. The column vector of ψ represents the M-dimensional RSS samples at the j-th calibration point.During online stage, a maximum likelihood based pattern matching algorithm is used for location estimation. Maximum likelihood algorithm estimates the likelihood value of new measured RSS observations for all candidate calibration points and weights the points having maximum likelihood as the positioning result. The new measured RSS vectors can be represented as(17)ψnewo~,c~=ψ1,newo~,c~ψ2,newo~,c~…ψM,newo~,c~Twhere o~ is the estimated user orientation as in (15) and c~ is the recognized carrying position of the four investigated positions. Based on the estimated user orientation and recognized carrying position, we select the fingerprints with similar orientations and the same positions for pattern matching. Particularly, we obtain the two orientations o1,o2 in the set O, which have the smallest absolute differences with the estimated user orientation o~. The selected radio map can be generated by selecting fingerprints ψo1,c~τ and ψo2,c~τ. For each calibration point, RSS values collected at two orientations o1,o2 are merged into one group.Maximum likelihood algorithm treats the statistical distribution of RSS from one AP at each calibration point as Gaussian distribution. For new RSS vectors, the likelihood at calibration pointLi is calculated by the product of likelihood of all available APs:(18)fψnewo~,c~Li=∏j=1Mfψj,newo~,c~Liwhere fψj,newo~,c~Li is the likelihood of calibration point Li for the j-th AP. The Gaussian function is deployed as likelihood function for RSS statistical distribution:(19)fψj,newo~,c~Li=12πσexp⁡-ψj,newo~,c~-μij22σ2where μij is the mean RSS value for the j-th AP at calibration point Li with carrying position c~ and the user orientations o1,o2 and σ is the parameter relating with standard variance. The user location is ultimately estimated by averaging the K calibration points, (20)Luser=1K∑i=1KL~iwhere L~i are the locations of K calibration points with the maximum likelihood value.


## 6. Evaluation

### 6.1. Experimental Setup

We performed experiments in a typical realistic indoor environment, whose size is 27.4 m × 11.2 m, as shown in Figure4. We deploy a Samsung Galaxy S4 smartphone as experimental device with wireless network card, gyroscope, accelerometer, and magnetometer installed. For offline radio map construction, we collect RSS vector samples from all available APs at 82 calibration points with eight user orientations and four investigated carrying positions. The eight user orientations are set along the four coordinate axes directions and four middle directions of them. For each calibration point, 3200 samples are collected with 100 samples per user orientation and carrying position. The calibration points are approximately uniformly distributed in the target environment with a distance of about one meter along the x-axis direction. A total number of eight APs are available, with six APs seen in the target environment and the rest ones in the adjacent area. For testing points, the participant walked along a path with one of the four investigated carrying positions reaching almost all coverage area of the calibration points. Six different walking paths with relatively different user orientations were carried. Each walking path is about one hundred meters long reaching most of the target environment and repeated ten times for each carrying position. The user true locations are obtained by placing multiple tags on the floor and deploying a video to record the walking path. For each experimental run, we assumed that the initial user orientation was known and the inertial sensors were already well calibrated [31].Figure 4
Realistic indoor experimental environments for WiFi positioning.


### 6.2. Carrying Position Recognition Results

We collect one thousand sliding window samples for each carrying position and a total number of four thousand samples are used to train and test the classifiers. In order to make the classifier more robust to the changing device orientation, we collect acceleration signals under all possible device orientations as uniformly as possible. To avoid introducing noisy acceleration signals, we deploy a five-point average filter to smooth them.Table1 compares the classification accuracy performance of the proposed orientation invariant features and normal time domain features. The results show that the proposed robust carrying position classifier shows an average accuracy reaching 98.5%, which is high enough for recognizing the carrying position accurately. Therefore, the subsequent experiments assume that the used carrying position information is correctly recognized initially. Compared with the traditional normal time domain features, the proposed classifier achieves a significant accuracy improvement from 90.9% to 98.5%. The improvement can be contributed to the higher discrimination and generalization ability of the extracted orientation invariant features. Rather than previous normal time domain features vary greatly with the changing device orientation, the extracted features keep relatively stable. Besides, the probabilities of confusing between swinging-hand and inpocket pairs, hand-held, and phone-call pairs are higher than the other pairs, since the acceleration patterns within these pairs are more confused than the other pairs, due to their more similar patterns of body locomotion.Table 1
Confusion table of Random Forest classifier with orientation invariant and normal features.
(Orientation Invariant/Normal Features) Hand-Held Phone-Call Swinging-Hand In-Pocket Hand-Held 0.982/0.904 0.018/0.063 0/0.033 0/0 Phone-Call 0.01/0.064 0.990/0.915 0/0.004 0/0.017 Swinging-Hand 0/0.018 0/0.001 0.986/0.896 0.014/0.085 In-Pocket 0/0 0/0 0.028/0.081 0.972/0.919


### 6.3. User Orientation Estimation Results

Figure5 compares mean absolute user orientation estimation error and the standard deviation values between RMPCA, uDirect [40], and compass [26] approaches. The deployed RMPCA approach decreases the mean absolute estimation error by 33.8 percent (5.3 degrees) and 70.2 percent (24.4 degrees) more than those of the compared uDirect and compass approaches, respectively. For standard deviation, RMPCA approach decreases by 22.6 percent (1.6 degrees) and 66.1 percent (10.4 degrees) more than those of the compared uDirect and compass approaches, respectively. Clearly, the deployed RMPCA approach achieves the best user heading estimation accuracy.Figure 5
Mean absolute user orientation estimation error and the standard deviation comparisons between RMPCA, uDirect, and compass approaches.For the uDirect approach, the user orientation during a walking period is extracted at the moment when acceleration signals along the waling direction dominate the accelerations in the horizontal plane. Unfortunately, such a moment is susceptible to noisy acceleration signals. Instead of exploiting some specific acceleration samples by uDirect approach, the RMPCA approach exploits all acceleration samples during a walking period by performing PCA over the horizontal acceleration signals. Therefore, the RMPCA approach is more robust and achieves smaller user orientation estimation error and standard deviation than the uDirect approach. For user orientation using a compass, since the indoor magnetic perturbations are severe and is difficult to be calibrated, the accuracy performance of user orientation is much worse than the two other approaches.


### 6.4. Location Estimation Results

This section compares the proposed WiFi positioning approaches considering user orientations and carrying positions; WiFi positioning approach based on user orientation estimation using a compass and traditional WiFi positioning approach do not consider these information. We perform traditional WiFi positioning approach by selecting fingerprints with random user orientations and carrying positions to construct the radio map. The pattern matching algorithm deploys the widely used maximum likelihood method. The positioning error is defined as the Euclidean distance between the estimated coordinates per step and the labeled coordinates per step along the true path. Positioning accuracy is mainly evaluated by the accumulative probability distribution of positioning errors.As seen in Figure6, accumulative error distribution within 1 m of the proposed approach is 35.1%, while those of approach (compass) and traditional approach are 20.1% and 17.1%, respectively. Accumulative error distribution within 3 m of the proposed approach is 88.9%, while those of approach (compass) and traditional approach are 63.6% and 57.9%, respectively. Table 2 also indicates error reduction of the proposed approach than the other two compared approaches. Compared with approach (compass) and traditional approach, the proposed approach decreases mean positioning errors by 41.7% (1.15 m) and 46.7% (1.41 m), respectively.Table 2
Positioning error (meters) comparisons.
Compared Approaches Proposed approach Approach (Compass) Traditional Approach Mean error 1.61 2.76 3.02 75 percentile 2.35 3.87 4.42 90 percentile 3.11 5.68 6.05 Standard variance 0.40 0.48 0.53Figure 6
Accuracy comparisons between the proposed approach, approach (compass), and traditional approach.Compared with approach (compass) and traditional approach, the proposed approach obtains significant positioning accuracy improvement. This is because the proposed positioning approach may exploit the user orientation and carrying position information to enhance the radio map and thus the radio mismatch can be avoided effectively. For approach (compass), user orientation information is estimated by a compass and exploited in the fingerprinting pattern matching. However, the user orientation estimation accuracy is rather poor due to serve indoor magnetic perturbations. Therefore, the selected fingerprints may differ from the right fingerprints with similar orientations greatly. Therefore, the approach (compass) achieves small accuracy improvement than the traditional approach.


## 6.1. Experimental Setup

We performed experiments in a typical realistic indoor environment, whose size is 27.4 m × 11.2 m, as shown in Figure4. We deploy a Samsung Galaxy S4 smartphone as experimental device with wireless network card, gyroscope, accelerometer, and magnetometer installed. For offline radio map construction, we collect RSS vector samples from all available APs at 82 calibration points with eight user orientations and four investigated carrying positions. The eight user orientations are set along the four coordinate axes directions and four middle directions of them. For each calibration point, 3200 samples are collected with 100 samples per user orientation and carrying position. The calibration points are approximately uniformly distributed in the target environment with a distance of about one meter along the x-axis direction. A total number of eight APs are available, with six APs seen in the target environment and the rest ones in the adjacent area. For testing points, the participant walked along a path with one of the four investigated carrying positions reaching almost all coverage area of the calibration points. Six different walking paths with relatively different user orientations were carried. Each walking path is about one hundred meters long reaching most of the target environment and repeated ten times for each carrying position. The user true locations are obtained by placing multiple tags on the floor and deploying a video to record the walking path. For each experimental run, we assumed that the initial user orientation was known and the inertial sensors were already well calibrated [31].Figure 4
Realistic indoor experimental environments for WiFi positioning.


## 6.2. Carrying Position Recognition Results

We collect one thousand sliding window samples for each carrying position and a total number of four thousand samples are used to train and test the classifiers. In order to make the classifier more robust to the changing device orientation, we collect acceleration signals under all possible device orientations as uniformly as possible. To avoid introducing noisy acceleration signals, we deploy a five-point average filter to smooth them.Table1 compares the classification accuracy performance of the proposed orientation invariant features and normal time domain features. The results show that the proposed robust carrying position classifier shows an average accuracy reaching 98.5%, which is high enough for recognizing the carrying position accurately. Therefore, the subsequent experiments assume that the used carrying position information is correctly recognized initially. Compared with the traditional normal time domain features, the proposed classifier achieves a significant accuracy improvement from 90.9% to 98.5%. The improvement can be contributed to the higher discrimination and generalization ability of the extracted orientation invariant features. Rather than previous normal time domain features vary greatly with the changing device orientation, the extracted features keep relatively stable. Besides, the probabilities of confusing between swinging-hand and inpocket pairs, hand-held, and phone-call pairs are higher than the other pairs, since the acceleration patterns within these pairs are more confused than the other pairs, due to their more similar patterns of body locomotion.Table 1
Confusion table of Random Forest classifier with orientation invariant and normal features.
(Orientation Invariant/Normal Features) Hand-Held Phone-Call Swinging-Hand In-Pocket Hand-Held 0.982/0.904 0.018/0.063 0/0.033 0/0 Phone-Call 0.01/0.064 0.990/0.915 0/0.004 0/0.017 Swinging-Hand 0/0.018 0/0.001 0.986/0.896 0.014/0.085 In-Pocket 0/0 0/0 0.028/0.081 0.972/0.919


## 6.3. User Orientation Estimation Results

Figure5 compares mean absolute user orientation estimation error and the standard deviation values between RMPCA, uDirect [40], and compass [26] approaches. The deployed RMPCA approach decreases the mean absolute estimation error by 33.8 percent (5.3 degrees) and 70.2 percent (24.4 degrees) more than those of the compared uDirect and compass approaches, respectively. For standard deviation, RMPCA approach decreases by 22.6 percent (1.6 degrees) and 66.1 percent (10.4 degrees) more than those of the compared uDirect and compass approaches, respectively. Clearly, the deployed RMPCA approach achieves the best user heading estimation accuracy.Figure 5
Mean absolute user orientation estimation error and the standard deviation comparisons between RMPCA, uDirect, and compass approaches.For the uDirect approach, the user orientation during a walking period is extracted at the moment when acceleration signals along the waling direction dominate the accelerations in the horizontal plane. Unfortunately, such a moment is susceptible to noisy acceleration signals. Instead of exploiting some specific acceleration samples by uDirect approach, the RMPCA approach exploits all acceleration samples during a walking period by performing PCA over the horizontal acceleration signals. Therefore, the RMPCA approach is more robust and achieves smaller user orientation estimation error and standard deviation than the uDirect approach. For user orientation using a compass, since the indoor magnetic perturbations are severe and is difficult to be calibrated, the accuracy performance of user orientation is much worse than the two other approaches.


## 6.4. Location Estimation Results

This section compares the proposed WiFi positioning approaches considering user orientations and carrying positions; WiFi positioning approach based on user orientation estimation using a compass and traditional WiFi positioning approach do not consider these information. We perform traditional WiFi positioning approach by selecting fingerprints with random user orientations and carrying positions to construct the radio map. The pattern matching algorithm deploys the widely used maximum likelihood method. The positioning error is defined as the Euclidean distance between the estimated coordinates per step and the labeled coordinates per step along the true path. Positioning accuracy is mainly evaluated by the accumulative probability distribution of positioning errors.As seen in Figure6, accumulative error distribution within 1 m of the proposed approach is 35.1%, while those of approach (compass) and traditional approach are 20.1% and 17.1%, respectively. Accumulative error distribution within 3 m of the proposed approach is 88.9%, while those of approach (compass) and traditional approach are 63.6% and 57.9%, respectively. Table 2 also indicates error reduction of the proposed approach than the other two compared approaches. Compared with approach (compass) and traditional approach, the proposed approach decreases mean positioning errors by 41.7% (1.15 m) and 46.7% (1.41 m), respectively.Table 2
Positioning error (meters) comparisons.
Compared Approaches Proposed approach Approach (Compass) Traditional Approach Mean error 1.61 2.76 3.02 75 percentile 2.35 3.87 4.42 90 percentile 3.11 5.68 6.05 Standard variance 0.40 0.48 0.53Figure 6
Accuracy comparisons between the proposed approach, approach (compass), and traditional approach.Compared with approach (compass) and traditional approach, the proposed approach obtains significant positioning accuracy improvement. This is because the proposed positioning approach may exploit the user orientation and carrying position information to enhance the radio map and thus the radio mismatch can be avoided effectively. For approach (compass), user orientation information is estimated by a compass and exploited in the fingerprinting pattern matching. However, the user orientation estimation accuracy is rather poor due to serve indoor magnetic perturbations. Therefore, the selected fingerprints may differ from the right fingerprints with similar orientations greatly. Therefore, the approach (compass) achieves small accuracy improvement than the traditional approach.


## 7. Conclusions

In this paper, we propose a novel WiFi fingerprinting positioning approach by considering both user orientations and carrying positions. Since the compass incurs large user orientation estimation errors due to indoor magnetic perturbations, we deploy RMPCA approach. For carrying position recognition, we propose a robust Random Forest classifier based on orientation invariant features, which may better adapt the changing device orientations. Under both LOS and NLOS environments, RSS patterns with different user orientations and smartphone carrying positions are distinct from one another. Therefore, the proposed WiFi fingerprinting approach may effectively avoid the radio mismatch during pattern matching. Experimental results show that compared with WiFi fingerprinting positioning approach only considering user orientation estimation using a compass and the approach considering neither user orientation nor carrying position information, our approach decreases mean positioning errors by 41.7% (1.15 m) and 46.7% (1.41 m), respectively. In our future works, we will further integrate pedestrian dead reckoning approach to improve the positioning performance.



---

*Source: 5243893-2018-09-27.xml*