 Kurdistan Journal of Applied Research (KJAR) | Print-ISSN: 2411-7684 – Electronic-ISSN: 2411-7706 | kjar.spu.edu.iq Volume 2 | Issue 3 | August 2017 | DOI: 10.24017/science.2017.3.41 Modified WiFi-RSS Fingerprint Technique to locate Indoors-Smartphones: FENG building at Koya University as a case study Halgurd S. Maghdid Department of Software Engineering ,Koya University Koya ,Sulaimani, Iraq halgurd.maghdid@koyauniversity.org Ladeh Sardar Abdulrahman Department of Software Engineering , ,Koya University. Koya ,Sulaimani, Iraq ladeh.sardar@koyauniversity.org Mohammed H. Ahmed Department of Computer Science University of Raparin Ranyah ,Sulaimani, Iraq mohammedhussein@raparinuni .org Azhin Tahir Sabir Department of Software Engineering , ,Koya University Koya ,Sulaimani, Iraq azhin.sabir@koyauniversity.org Abstract: Positioning system used for different purposes and different services, many researches are going on to find a more accurate position with low error within high performance. There are many localization solutions with different architectures, configurations, accuracies and reliabilities for both outdoors and indoors. For example, Global Navigation Satellite System (GNSS) technology has been used for outdoors. Global Positioning System (GPS) is one of the most common outdoors tracking solutions in the world, for outdoors, however, when indoors; it could not be accurately tracked users by using a GPS system. This is because, when users enters into indoors the GPS signals will no longer available due to blocked by the roof of buildings and it is no longer considered as a viable option. WiFi Positioning System (WPS) can be used as an alternative solution to define users’ position, especially when GPS signal is not available. Further, WPS is a low cost solution, because there is no need to deploying WiFi Access Points (WAPs) in the vicinity, as they are installed to access the Internet. In this paper, specifically, WiFi-RSS Fingerprinting technique is used to locate smartphones using WAPs signals with a modified calculation. The new modified calculation is to dynamic weighting of the WAPs RSS values based on the real-live indoors structure. The achieved positioning accuracy, based on several trial experiments, is up to 6 meters via the implemented algorithm in the MALTAB. Keywords: Mobile Computing; WiFi; RSS- Fingerprinting; k-NN; Indoor positioning; Android Smartphones. 1. INTRODUCTION Existing of positioning applications on smartphones and tablets has been widened more and more during last five years. Billing via position, friend finder using social networks, gaming, patient monitoring in hospitals and discover nearest shop/petrol station/restaurant or other point of interest (POI) are the recent applicable location- based applications [1]. For positioning, many techniques have been used including proximity, received signal strength (RSS)-based, Angle-of-arrival (AOA), Time based, Map Matching (MM), Dead reckoning (DR). These techniques were utilized based on compatibilities with different environments. In this paper, RSS based technique is used to locate android-based smartphones. Beside this, smartphones and tablet companies are setting powerful processing capability including octal- core processor and several wireless chipsets and sensors to run for such positioning applications. However, positioning applications that uses only GNSS receivers will be failed to provide continuous positioning due to the blocked or weaken GNSS signals reception in high-dense urban areas and indoors [2]. Therefore, most of the current positioning services or applications use cellular, WiFi, BT, NFC and inertial-sensors on smartphones with other pre-installed infrastructure sensors or a hybrid these technologies as an alternative solution. This paper focuses on offering indoor positioning solution using WiFi technology and capitalizing on the use of existing WiFi infrastructure and onboard smartphone WiFi chipsets. WiFi-RSS technique for indoors localization has been implemented using two different methods. The First method is pseudoranges- based measurement which depends on distance between base station WAPs and smartphone [3], as shown in figure 1. Inaccuracy of measuring RSS value using pseudoranges method is depended on: a) Hardware (HW) implementation, b) mathematical method to calculate the RSS value, c) interference issue in the same band, d) and movable/static objects in the buildings. Pseudoranges based method is also known as Trilateration which uses three RSS values from three WAPs in a specific location each of them have special power of signal with this signal. Then, it can determine the distance with simple mathematical equation, which is as follow Equation (1): ( ) mailto:halgurd.maghdid@koyauniversity.org mailto:ladeh.sardar@koyauniversity.org mailto:mohammedhussein@raparinuni.org mailto:mohammedhussein@raparinuni.org Figure 1 RSS pseudoranges-based technique. Where is the distance between smartphone and WAPs, is the appraiser calibrated pseudorange at zero distance, is measured value of RSS for , RSSi is the current measured value of RSS for the received WAP/BSs signals. Then using these measured pseudoranges in Trilateration equations, the location of the smartphone can be defined. The second method is RSS-fingerprinting which is based on searching for presorted RSS values of WAPs in a database [4]. The inaccuracy of fingerprinting method is based on the quality of measuring RSS values. The main drawbacks of this method are: 1) it is used for specific building, 2) takes a long time due to connecting to the internet and searching in the location database server, then sending back the result of location calculation for the users, 3) it also generate a high cost to make a radio map because it uses dedicated HW and recalibration of the BS and/or WAPs, since the environment may be changed over time. In this paper, fingerprinting RSS-based method is implemented using a specific map-matching algorithm such as k-Nearest-Neighbor (k-NN). Initially, the third floor of Faculty of Engineering (FENG) building has been selected to test the developed solution. RSS-Fingerprinting technique consists of two stages: offline stage and online stage, as shown in figure 2. In offline stage, the values of RSS of the received beacon signals from WAPs and location information (fingerprints) of taken measurements are stored in a database (radio map). Figure 2 Fingerprinting RSS-based Technique In online stage the matching algorithm is implemented by using k-NN, neural network and markov localization (ML) technique [5]. This work uses k-NN technique which compares the current values of RSS with previous value of RSS in the offline stage which are stored in the database to determine the position of the smartphone. The structure of this paper is divided into the following sections: section (2) investigates the state of the art of positioning solutions. This is followed by the section (3) which explains the details of the proposed algorithm. Section (4) illustrates the validity of the proposed algorithm by several trail experiments. Finally section (5) concludes the main achievements and state the future works. 2. RELATED WORK The WiFi Transceivers integrated on smartphones are not only for data communication, but they are also used for estimate smartphone positing. Mainly the location based services (LBS) use this technology to define smartphone positions in buildings, where WiFi signals prevail. However, these WiFi signals will be affected by the complexities of indoors structure which include moving objects (such as walls and stairs), multi floor and dynamically changing structure of indoor components. Therefore, the dynamic structure of the indoors are BS/WAP_1 BS/WAP_2 BS/WAP_3 p0, RSS30, ᵑ3 p0, RSS20, ᵑ2 p0 ,RSS10, ᵑ1 Offline or Calibration phase Fingerprint Database RSSIm1.RSSIm2…RSSI Online or position Estimation phase (x1,y1) RSSI11.RSSI12…..RSSI1n RSSI1.RSSI2…….RSSI3 (x,y) (x2,y2) Positioning Algorithm RSSI21.RSSI22…RSSI2n (x3,y3) RSSI31.RSSI32…RSSI3n (xm,ym) RSSIm1.RSSIm2…RSSImn posing more challenges to implement the indoor positioning within obtaining high accuracy, unless those solutions install special hardware which incurs huge cost [6]. In another vain, the demand on tracking indoors people has been increased due to growing the number of services via smartphone rapidly. For this reason, in this paper a WiFi-RSS-based positioning algorithm using fingerprinting technique has been developed. To compare and investigate state of the art as well as to illustrate the recent trends of indoors positioning solutions using WiFi technology, in this section, some of these solutions are explained. In a recent solution based on WAPs signal measurements has been proposed by [7]. In the solution, a modified fingerprinting algorithm has been implemented which selects the height/strong WAPs-RSS values in the vicinity, called important access points (IAP). In the online stage current RSS value is compared with the IAP value of the offline stage using fingerprint matching algorithm. In addition, the proposal uses Nearest Neighbor (NN) matching method. The obtained accuracy via IAP algorithm based on testing difference parameter is 85%. However, the proposed IAP will not be applicable due to bad distribution of WAPs in the buildings. This is because of originally WAPs are not deployed for the positioning purposed. Therefore, such proposal might be work, with a reasonable accuracy, when there is large number of WAPs and installed within a good strategy. The other main problem of RSS-based fingerprint localization is how to effectively find the matched or approximated RSS strengths in the offline fingerprint maps and estimate the position of the current RSS value with high precision. To overcome this problem sparse representation model, namely the Spatio-Temporal Sparse Representation model (ST-SR) is used in [8]. This model integrates the Spatio-Temporal correlation in RSS fingerprint maps and the RSS measurements in the localization procedure. The results demonstrate that the proposed model achieves higher localization accuracy with good stability and robustness compared with state of the art indoor localization methods. However, the proposed ST-SR model makes implementation of work too complicate, because positioning done by smartphone, which detect the position of the person in a huge computation. Thus, such complex computation will drain the smartphone battery power quickly and this is violating the demand of the users. Indoor positioning using Wi-Fi becoming more and more ubiquitous, since it used as an alternate solution instead of GPS also which is no longer used today because of the effect of high buildings that penetrate passing the signal freely in outside. For this reason WiFi localization is proposed in [9] with two different methods; triangulation and fingerprinting. Triangulation involves by using the angle and distance for determining the specific location, while WiFi fingerprinting creates a radio map of the RSS data and match this value with the live RSS. Further, for matching process, the proposal used two methods which are the k-NN and the (ML). The results based on some testes, WiFi fingerprinting algorithm is better in terms of positioning accuracy. This is because, in triangulation, with increment in distance from the WAPs; the RSS and noise value will be collected together which produces inaccurate data. And NN method is used instead of Markov because Markov use probability distribution for fingerprint data approximated Gaussian when in reality some of RSS distribution was not Gaussian. However, the proposed RSS technique and NN matching method cannot be always suitable for specific positioning, so there are many techniques and matching methods can be used according to the related work. Our proposed work is similar to [7], but it is different in a way of selecting the WAPs RSS values based on dynamic weighting of the fingerprints. That’s mean, the dynamic weighting value will differs the WAPs signals in a real live measurements when the indoors structure will be changed. This will happen when objects are moved, such as people in the vicinity, during the smartphone position calculation. Moreover our proposal will still work with fewer WAPs signals in the area in comparison of the current solutions. 3. THE PROPOSED ALGORITHM Most of the existing systems that offer indoor localization services were used different wireless technologies like BT, Wi-Fi, signals of cellular towers and Inertial Sensors [10]. In this work, WiFi technology is used which is more preferable because WiFi networks are prevalent in most public buildings and it doesn’t require additional infrastructure and it allows determination of the location of each mobile device. Also, a modified RSS-Fingerprint technique is used as a positioning technique. For determining the position of the smartphone, in the first step, the proposed algorithm starts by gathering RSS values of the WAPs as well as the location coordinates of taken measurement points. The gathering data is done by the android smartphones and stored the data in a database (offline phase). Android-based smartphones has been used to test the algorithm; this is because Android OS is free, powerful and completed. Figure 3 shows the flowchart of proposed algorithm. Then, in online phase, the current values of the RSS of the WAPs is compared with the stored RSS values of the database using k-NN technique which implemented by MATLAB (online phase). In k-NN, the distance between current values of RSS with all stored values of RSS is calculated using Euclidean distance, as express in equation (2). √ Where, is the measured Euclidean distance between the online RSS value and the offline RSS values, is the offline RSS values and is the online RSS values? Then, these distances are arranged in an ascending mode. Then the first k distances are selected, since the real live RSS values are near to these selected pre-stored RSS records. The k-value is depending on the survey of the fingerprints of the area or points in the vicinity. Finally, the corresponding coordinates of the k-selected distances are used for calculating (x, y) coordinates of smartphone. Figure 3. Flow chart of the K-NN Algorithm. Further, the (x, y) coordinates of smartphone is calculated based on dynamic weighting of the (x, y) coordinates of the pre-stored records, as expressed on equation (3). This dynamic weighting of the location coordinates will improve the positioning accuracy, due to having measured actual RSS-multipath and noise- sources. ∑ ∑ Where, are the estimated XY coordinates of the smartphone, is the weighting values of the RSS values and are the XY coordinates of the fingerprints. Also, the value of 15 is the value of K in the K-NN technique. The idea of changing value of the weights has given the uniqueness of the work in comparison with current solutions, since it can improve the algorithm performance in difference circumstances. The value of the weight is changed based on the WAPs RSS values. When, the value of the strength of the signals of a WAP is high, is not always means is the nearest WAP to the smartphone. Therefore, this dynamic weight value will avoid the issue of the fluctuation of the RSS values which have been affected by the indoors material including steels, doors and type of walls in the area. 4. EXPERIMENTS SETUP AND RESULTS In this study, for the offline stage, we created a database which will store the RSS values during the survey of the area. The second floor of FENG building has been chosen as a survey area. To do the survey the area has been divided into several points (fingerprints). The distance between any two points in x-axis is (0.64 meter) and (2 meter) in y-axis. The total number of points that we have taken for the offline stage are (264) points and (64) points randomly for the online stage, i.e. for testing the positioning algorithm. A MATLAB-simulated graph based on real survey of the building is shown in figure 4. Figure 4. Simulated survey area of FENG-Second floor. WAPs RSS values in the vicinity have been collected by running an Android-application on the smartphone. A snapshot of the application is shown in figure 5. Then, the collected/gathered WAPs RSS values are stored in an EXCEL file. Consequently, the MATLAB is used for reading values from the EXCEL file and apply the proposed positioning algorithm to compare stored values with the values of WAPs RSS values of online stage. Figure 5 shows the collected WAPs RSS values in the offline stage which are used in this implementation. As it can be seen, there are RSS values for eight WAPs in the floor. In this work, the meaningful RSS values is started from (-60 dBm) and above because the values above of (-60 dBm) have less error which is around (1 to 7) meters while the values less than (-60 dBm) is around have error rate in (10-15) meters or more, as they have been calibrated by a set of experiments. Therefore, for this reason we have chosen RSS value when they are above (-60 dBm). Figure 5. Offline WiFi RSSI reading via SP during traveling in the floor. Figure 6 shows the received RSS values of WAPs in the online stage. In the testing (online) stage also we have chosen RSS values which are above than (-60 dBm). As it can be noted, the number of the available WAPs RSS values is around seven (7), at the tested points. This means, it is not a always that the number of the available WAPs RSS values is the same as of offline stage, this is due to dynamic indoors structure. Figure 6. Online WiFi RSSI readings via SP at random points. From now, the results of applying the proposed algorithm are illustrated. Figure 7 shows the fingerprints (survey area point) at offline stage in black circle, online points in red circle which are the points have taken randomly in the survey area to compare them with offline points to estimate the position of smartphone. The figure also presents the positions of WAPs in blue circle with filled-red color and the start point of our implementation is with red square with filled-green color. Once the measured WAPs RSS values with fingerprint information are available, the proposed algorithm is implemented to show the validity of the algorithm performance. The algorithm uses k-NN technique to do the process of matching between offline WAPs RSS values and online WAPs RSS values. The position of the smartphone is estimated based on equation 3, as mentioned in section 3. The estimated positions of the smartphone are displayed in blue circle in figure 7. Figure 7. Testbed for the implementation with the estimated smartphone position. Finally, root mean square error (RMSE) is used to calculate the positioning accuracy our implementation, as expressed equation (4). √ (( ) ( ) ) Figure 8 shows the cumulative distribute functions (CDF) of the obtained positioning accuracy (positioning error). As shown that the maximum positioning error (18 meters) and the minimum positioning error (0.5 meter) and %50 of measured positions we have approximately (5 meters) positioning error. The average error of the positioning accuracy is up to 6.4 meters, which is quite enough for tracking indoors peoples. Figure 8. Illustrate the average of error rate when locating the phone position. It will better, however achieving this accuracy needs more research and need a hybrid position technique such fingerprinting with onboard smartphone sensors or building map information. 5. CONCLUSION A modified WiFi-RSS Fingerprinting technique has been proposed and tested at FENG-building at Koya University. The obtained positioning accuracy within 6.4 meters is based on the k-NN technique. Further, in this study, different values of k are compared and the best value is 15 which has been selected based on several experiments to improve the positioning accuracy. The new modification of the WiFi-Fingerprinting is to using dynamic weighting values of the selecting RSS values, when k-NN technique is implemented. In the next step, we have planned to do the following as a future work: 1) implementing matching algorithm using smartphone instead of using MATLAB, 2) combining other technique with RSS-based fingerprinting to increase accuracy of defined smartphone such as dead-reckoning technique, and 3) reducing the error rate using building- map information of the conducted survey area. REFERENCE [1] L. Vladimir, M. Nikola, T. Milan, and others, Location-Based Applications for Smartphones., 2015. [2] J. Ryoo, H. Kim, and S.R. Das, "Geo-fencing: Geographical-fencing based energy-aware proactive framework for mobile devices," in Quality of Service (IWQoS), 2012 IEEE 20th International Workshop on, june 2012, pp. 1-9. [3] D. Park and J. Goo Park, "An enhanced ranging scheme using WiFi RSSI measurements for ubiquitous location," in Computers, Networks, Systems and Industrial Engineering (CNSI), 2011 First ACIS/JNU International Conference on.: IEEE, 2011. [4] D. Lymberopoulos et al., "A realistic evaluation and comparison of indoor location technologies: Experiences and lessons learned," in Proceedings of the 14th international conference on information processing in sensor networks.: ACM, 2015. [5] Y. Zhao, K. Liu, Yongtao Ma, and Zhuo Li, An improved k-NN algorithm for localization in multipath environments.: Springer, 2014, vol. 2014. [6] R. Mautz, "The challenges of indoor environments and specification on some alternative positioning systems," in Positioning, Navigation and Communication, 2009. WPNC 2009. 6th Workshop on.: IEEE, 2009, pp. 29--36. [7] P. Jiang, Y. Zhang, Wenyan Fu, Huiyu Liu, and Xiaolin Su, Indoor mobile localization based on Wi-Fi fingerprint's important access point., 2015. [8] X. Piao et al., "RSS Fingerprint Based Indoor Localization Using Sparse Representation with Spatio-Temporal Constraint," Sensors, vol. 16, p. 1845, 2016. [9] M. Quan, E. Navarro, and Benjamin Peuker, "Wi-fi localization using rssi fingerprinting," 2010. [10] R. Mautz, Indoor positioning technologies.: ETH Zurich, Department of Civil, Environmental and Geomatic Engineering, Institute of Geodesy and Photogrammetry Zurich, 2012.