Fingerprint indoor positioning based on user orientations and minimum computation time

Indoor Positioning System (IPS) has an important role in the field of Internet of Thing. IPS works based on many existing radio frequency technologies. One of the most popular methods is WLAN Fingerprint because this technology has been installed widely inside buildings and it provides a high level of accuracy. The performance is affected by people who hold mobile devices (user) and also people around the users. This research aimed to minimize the computation time of kNN searching process. The results showed that when the value of k in kNN was greater, the computation time increased, especially when using Cityblock and Minkowski distance function. The smallest average computation time was 2.14 ms, when using Cityblock. Then the computational time for Euclidean and Chebychev were relatively stable, i.e. 2.2 ms and 2.23 ms, respectively.


Introduction
IPS is any system that gives a precise position inside buildings, such as a smart building [1,2], hospitals [3], and airport [4].IPS has an important role in the field of Wireless Sensor Networks (WSN) and Internet of Thing (IoT) [5].One of the largest European Union project on Internet of Thing, project of FP-7 Butler, showed that information of a location is one of the important key in the IoT [6].In the health sector, IoT manages a lot of sensors mounted on a patient's body to monitor health conditions.If the health condition of patients deteriorate and they need emergency care then it is important to monitor the location of the patients, requiring IPS with a high accuracy.In addition, IPS-based service has great economic potential as well; it is estimated to reach US$ 10 billion in 2020 [7].Another report by MarketsandMarkets estimates the global indoor location market to grow to $4,424.1 million by 2019.
IPS works based on many existing radio frequencies [8] such as IEEE 802.11 or WLAN [9], Bluetooth [10], Zig Bee [11,12], RFID [13], and UWB [14].One of the most popular methods in IPS is WLAN Fingerprint because this technology has been installed widely inside buildings and it provides a high level of accuracy [15].In addition to radio frequency technology, IPS also works based on magnetic fields [16], acoustic signals [17], and thermal [18] and any other sensors that are usually installed in mobile devices.
There are three techniques used in IPS to determine the location: Proximity, Triangulation [12], and Fingerprint [19].The detected signal patterns are used in the fingerprint technique to characterize the position (e.g., a vector of Received Signal Strength Indication or RSSI).WLAN Fingerprint technique works based on the fact that each location has a unique RSSI because of path loss and multi-path effect [15].
There are many things that influence RSSI value inside building, such as doors, walls, and windows [20,21].People inside building also influence the RSSI [22].If the signal blocked by people or human body, the value of RSSI will reduce [23].Users (people who hold MDs) and people around the user will influence the accuracy of IPS because people affect the RSSI.Firdaus et al [24] proposed a method to adapt user orientation in IPS to improve the accuracy of IPS.However they did not discuss computation time in the system, even though it is a very important parameter in smartphone application because it can decrease the power consumption by minimizing the computation time.This research proposed a new method to minimize the computation time in WLAN Fingerprint IPS using many distance function in kNN positioning ISSN: 1693-6930  Fingerprint indoor positioning based on user orientations and minimum... (Firdaus) 1741 algorithm.By minimizing the computation time, it will be more reliable to implement this system in smartphone.

Research Method
WLAN fingerprinting works in two-step process, they are offline and online steps.In offline step, researchers collect RSSI vector at each node inside building to build a radio map database.RSSI vector can be collected manually using smartphone or automaticaly using path loss model [25,26].WLAN stands for wireless local area network; it is a standart of communication protocol based on IEEE 802.11.This technology first appeared in the market in 1999 (802.11a)based on an orthogonal frequency division multiplexing (OFDM) modulation technology.WLAN generally works on 2.4 GHz and 5 GHz [27].Then in the online step, researchers try to define the location of user.Users will collect the RSSI vector at their position using their MDs.Then, the RSSI vector in online step will match with radio map database using positioning algorithm.The whole process is shown in Figure 1.
Figure 1.Work process in WLAN finger print [28] The matching process utilizes positioning algorithm that includes deterministic [9] and probabilistic methods [29].One of the most popular methods is k Nearest Neighbour (kNN) [30,33].People's effect on wireless signal strength was investigated in [34] for 60 GHz, [35] for 868 MHz, and [36,37] for 2.4 GHz.Hamida and Chelius [35] did an experimental approach to investigate the effect of the human activity to indoor WLAN performance.They observed there is a relationship between periodic fluctuations of RSSI and people activity within WLAN coverage.Thus, this research had to carefully consider user orientation to maintain the accuracy of IPS and minimize the computation time.
Bahl [9] showed that user orientation has big impacts on RSSI and position error.The median of position error is in the range of 2 to 3 meters.It needs big memory for four orientation RM database, and time-consuming process to collect the data (RSSI vector).In the offline step, King manually collected 8 RSSI vector in each node, 8 RSSI vectors means there are 8 user orientations [31].Then in online step, they used digital compasses to detect the user orientation.Then the system chose a RM data base based on users or MD directions to determine the users' positions.The distance error was 1.65 m.King's solution, however was time consuming in offline step because it collected 8 orientation data manually at each node.This technique also spent significant memory for RM database.
Zhou [38] tried to reduce the RM database by collecting only four orientations of RM.Zhou used Bayesian positioning algorithm to find the user position.The estimation of the location can be calculated using ( 1) and ( 2) by knowing the P(Li) or the prior probability of location Li, the real time signal fingerprint at an unknown location Lx (Ex), and the real time orientation (Ox). (1) They needed 7 APs, 800 samples, and 240 second for every reference location in offline phase to achieve 84% accuracy within 4 m of error and 36% accuracy within 1m of error.The average position error was 2.89m.This solution still needed high computation and required a lot of devices and times to collect the data and calculate the estimated location.Fat [39] tried to reduce the time consuming in offline step by transforming a single-orientation radio map to a multi-orientation RM using signal attenuation model.It can reduce scanning time up to 75% to 87.5% in the offline phase.
Wang [40] proposed a novel RSS model based on OFDM in WLAN and a power bias mitigation (PM) algorithm to reduce the effect brought by the deterministic deviation.The average RSSs of the 4 orientations were different because the average path-loss varies for different orientations.However, they did not propose a solution for orientation problem.Wangs solution focused more on power-bias problem caused by diverse devices.Liu [32] collected four orientations of RM and used a k-NN positioning algorithm.The accuracy of positioning could reach 93.3% from 15 test points, but they did not mention the position error.
Firdaus [24] proposed a method to adapt user orientation in IPS to improve the accuracy of IPS.This method was based on path loss model, including the signal attenuation that comes from human budy.They used kNN algorithm to define the estimation location using Euclidian distance function.These previous studies focused on the accuracy of system.However, if this system is implemented on smartphone or mobile device, it needs a system with minimum complexity and computation time.Therefore it is necessary to develop an adaptive IPS with minimum computation time.

Research Method
There were three steps in this study to reach the target as shown in Figure 2. The first step was to create and validate the radio map.The experiments were done in the sports center of Islamic University of Indonesia as shown in Figure 3.The dimension of the experiment area was 19×30 meters.Then the RSSI value was recorded in the second step at 8 orientations (0ᵒ, 45ᵒ, 90ᵒ, 135ᵒ, 180ᵒ, 225ᵒ, 270ᵒ, and 315ᵒ).In this step, user held the MD and this RSSI was defined as the initial RSSI.This step was conducted to know the effect of user orientation on accuracy.Then the positon error was calculated using kNN algorithm with variations of k (1, 3, 5, 7) and distance functions (Euclidean, Minkowski, Cityblock, and Chebychev).This error was defined as the initial error.The kNN algorithm was chosen because it is the simplest algorithm that provides high accuracy .Based on the adapted RSSI, the location estimation process and position error calculation can be done as shown in Figure 4.  1, where d xy is distance between vector x and vector y, J is the number of variable, and p is the Minkowski distance of order.In this experiment, the value of J was 3, because there were 3 variables that came from 3 APs.Cityblock is the same as Minkowski distance when p = 1.Euclidean distance represents the shortest distance between two vectors in Cartesian coordinate system.Then Chebychev distance is the greatest of the absolute magnitude along the vector dimension.
Table 1.The Formula of Distance Functions [45] Functions Formula Functions Formula Euclidean d xy = √∑ (x j − y j ) 2

Experiments
There were 3 experiments in this study.The first experiment was conducted to realize the first step of methodology, that is to create and validate the RM.In this first experiment, there were 3 APs used to build RM database.These APs were installed on the corner of the experiment area with 5m of height from the floor as shown in Figure 5.The brand of APs was UniFi from Ubiquity Network.The experiment area was divided into 1 m² small square  ISSN: 1693-6930 TELKOMNIKA Vol.17, No. 4, August 2019: 1740-1749 1744 shape.Then 20 RSSI vectors were collected in the centre of each 1 m² area using a mobile device and WiFi Scanner android application.Xiaomi note 3 was used for mobile device.The median value of 20 RSSI was taken from each AP as fingerprint.There were 288 small squares in the experiment area, so there were 288 RSSI vectors and then these data were stored in the RM database.The collection of RSSI in the first experiment used unhold MD.The MD was simply put on a table, and there was nobody around the MD.This aimed to get a reference or initial value recorded in RM database.Then the validation was done.
The second experiment involved the collection of RSSI at 8 orientations in certain node (12.5).The orientation were north (0ᵒ), northwest (45ᵒ), west (90ᵒ), southwest (135ᵒ), south (180ᵒ), southeast (225ᵒ), east (270ᵒ), and norteast (315ᵒ).0ᵒ orientation means that the user position is on the north side of the MD position as shown in Figure 5, then 180ᵒorientation means that the user position is on the south side of MD, and so on.This experiment explore the effects of user orientation on the accuracy of the system.Then the position error and computation time were calculated in the third experiment.The kNN algorithm was used as positioning algorithm with variation of k (1, 3, 5, 7, 9, and 11) and distance function (Euclidean, Minkowski, Cityblock, and Chebychev).Matlab was used to run the simulation and get the position error and computation time.Figure 5. Experiment site plan

Results and Analysis
In this section, it is explained the results of research and at the same time is given the comprehensive discussion.Results can be presented in figures, graphs, tables and others that make the reader understand easily [2,5].The discussion can be made in several sub-chapters.There were 288 RSSI vectors that stored in the RM database in the first experiment, because there were 288 small squares in the experiment area.Each vector had 3 RSSI values obtained from 3 APs, so there were 864 RSSI in the RM database.Table 2 shows the examples of RM database.Then validation of RM database was done using kNN algorithm (using Euclidean distance function and k=1) with variation of APs.The result can be seen at Table 3.The highest accuracy occurred when 3 APs were used (87.85%).So for the next experiments RM database from 3 APs (AP1, AP2, AP3) was used.
Then 8-orientation RSSI vectors were collected at the centre of the experiment area in the second experiment, coordinate (12.5).The data are shown in Figure 6.This shows that ISSN: 1693-6930  Fingerprint indoor positioning based on user orientations and minimum... (Firdaus) 1745 when the user position block the signal propagation in line of sight (LoS), the RSSI value decreased.For example, if S(12,5) was the radio map reference at point (12,5) when the user did not hold the mobile device, then S(12,5)={-45, -50, -47}.When the user held the mobile device at 0ᵒ orientation, the RM changed to {-50, -55, -46}.RSSI from AP1 and AP2 decreased significantly.When the user held the mobile device at 180ᵒ orientation, RSSI from AP3 decreased significantly.This change also occurred for the other 6 orientations, the detail is shown in Table 4.The decline in RSSI because the user's body blocked (R) was 3 to 6 dBm.Then the average (R ̅ ) was 5 dBm and this value was used for the next experiment.User orientation and R ̅ were used for RSSI adaptation calculation using (8).The comparison of initial RSSI and adapted RSSI from AP1 at 8-orientations with R ̅ = 5dBm can be seen in Figure 6.In the last step, the initiail error and adapted error were compared with the variation of distance functions (Euclidean, Minkowski, Cityblock, and Chebychev) and number of k (1,3,5, and 7) in kNN.Innitial error is position error when initial radio map is used, and adapted error is position error when adapted radio map is used.The results of error are presented in Figure 7 for Euclidean and Minkowski distances and Figure 8 for Cityblock and Chebychev distances.The position error when using Minkowski equaled the position error when using Euclidean distance.Implementation of adapted radio map on WLAN fingerprint IPS can reduce the position error.Error reduction rate using many distance functions and value of k are shown in Figure 9.A significant decrease occured when k=1, the value was 0.62 or 62%.For the values of k=3, 5, and 7 the decrease in error ranged from 10% to 30%.The worst average initial position error was 9.26 m which occurred when using Cityblock distance and k=1.After implementing the RM adaptation, the minimum average error was 2.3 m using Euclidean distance and k=7.The illustration of real and estimation position when using kNN (k=7) and Euclidean distance can be seen in Figure 10.The position error at each orientation in the minimum average error (2.3m) is shown in Figure 11.The error value at each orientation were different.Figure 11 shows that the smallest error value is 0.5meter in direction 315ᵒ and the highest error value is 3.8 meters in the direction of 180ᵒ. Figure 12 shows the computation time of kNN positioning algorithm when using four distance funtions (Euclidean, Minkowski, Chebychev, and Cityblock).This computation time was obtained from MATLAB computation.When value of k getting was greater then the computation time increased, especially when using Cityblock and Minkowski distance function.The longest compution time occurred when kNN used Minkowski, 2.73 ms for the average and 3.05 ms when k=15.Otherwise, the smallest computation is occured when kNN using cityblock, 2.14 ms for the average and 1.96ms when k=1.In fact, the computational times for Euclidean and Chebychev were relatively stable and the value were slightly different, 2.2 ms for Euclidean and 2.23 ms for Chebychev.This research proposed a new method to minimize the computation time in WLAN Fingerprint IPS using many distance functions in kNN positioning algorithm.By minimizing the computation time, it will be more reliable to implement this system in smartphone.The kNN algorithm is used to define the estimation location using many distance functions such as Minkowski, Euclidean, Chebychev, and Cityblock.The worst average initial position error is 9.26 m which occurs when using Cityblock distance and k=1.After implementing the RM adaptation, the minimum average error is 2.3 m using Euclidean distance and k=7.When value of k of kNN is greater then the computation time increases, especially when using Cityblock and Minkowski distance function.The longest of average computation time occurs when kNN uses Minkowski, 2.73 ms.The shortest average computation time is 2.14ms, when using Cityblock.Then the computational times for Euclidean and Chebychev are relatively stable, i.e. 2.2 ms for Euclidean and 2.23 ms for Chebychev.

Figure 2 .
Figure 2. The method in this study that consist of 3 steps

Figure 3 .Figure 4 .
Figure 3.The sports center as experiment location

Figure 6 .Figure 7 .
Figure 6.The comparison of initial and adapted RSSI from AP1 at 8-orientations

Figure 8 .Figure 9 .Figure 10 .
Figure 8.The comparison of initial and adapted position error using chebychev and cityblock

1747 Figure 11 .Figure 12 .
Figure 11.The position error at each orientation in the minimum average error (2.3 m)

Table 2 .
RSSI Vector in RM Database

Table 3 .
The Validation Result of RM Database

Table 4 .
APs Influenced by User Orientation.