Smartphones-Based Crowdsourcing Approach for Installing Indoor Wi-Fi Access Points

This study provides a new Crowdsourcing-based approach to identify the most crowded places in an indoor environment. The Crowdsourcing Indoor Localization system (CSI) has been one of the most used techniques in locationbased applications. However, many applications suffer from the inability to locate the most crowded locations for various purposes such as advertising. These applications usually need to perform a survey before identifying target places, which require additional cost and time consuming. For example, Access Points (APs) installation can rely on an automated system to identify the best places where these APs should be placed without the need to use primitive ways to determine the best locations. In this work, we present a new approach for Wi-Fi designers and advertising companies to recognize the proper positions for placing APs and advertisement activities in indoor buildings. The recorded data of the accelerometer sensors are analyzed and processed to detect user’s steps and thereby predict the most crowded places in a building. Our experiments show promising results in terms of the most widely used metrics in the subject as the accuracy for detecting users’ steps reaches 95.8% and the accuracy for detecting the crowded places is 90.4%. Keywords—Crowdsourcing; indoor localization system; accelerometer sensors; Wi-Fi access point; smartphones


I. INTRODUCTION
The extensive utilization of Smartphones and wireless network have magnified the importance of Indoor Positioning Service (IPS).Therefore, many approaches have been designed for providing users location services in a room or building level [1].These approaches rely on off-the-shelf WiFi infrastructure and sensor mobiles.However, deploying Wi-Fi access points (WAP) are done on geographic base, which needs manpower and extra cost, rather relying on the crowded areas to determine the best places for installing them.Moreover, identifying crowded places help promotion companies to choose the best places to display their ads by most of the building visitors [1] [2].
Positioning system can be divided into two categories [3]: indoor positioning and outdoor positioning.The indoor positioning precision requirements are higher than that for outdoors.Global Positioning System (GPS) is the most popular system that establishes outdoor Positioning.However, GPS is not suitable for indoor localization, since the satellite signal cannot penetrate buildings walls or their roofs [4].Indoor positioning system (IPS) is very useful to locate people or required objects within the building and in closed areas.In addition, indoor location-based services (ILBSs) have become an essential part of people's activities in living, working, studying and shopping [5].Indoor localization depends on infrastructures, such as ultra-wideband radio, Bluetooth and wireless access point [3] [6].
One of the most common methods that use IPS approach is Crowdsourcing indoor positioning system [7].Crowdsourcing is the most promising solution for solving the site survey problem in fingerprint technique.Crowdsourcing becomes a viable solution for collecting a large amount of data required to support location-based services (e.g., acceleration, a gyroscope and Received Signal Strength (RSS)).
Wi-Fi (Wireless Fidelity) is the most commonly used approach for indoor positioning.Wi-Fi is a good option for indoor positioning technology.This is due to the ubiquity of WAPs and embedded Wi-Fi connectivity in Smartphones.Indoor localization using Smartphones has been generally investigated; and its significance is consistently expanding as an after effect of the various applications that require indoor localization systems.Modern Smartphones have multiple sensors, which can be combined to obtain more precise indoor positioning results.These sensors are used to detect user phone proximity, for user activities such as, recognition, or indoor tracking and indoor localization.In general, the most popular approaches for indoor positioning are: cell of origin, triangulation, trilateration, and fingerprint.One of the most common methods that use the IPS approach is Crowdsourcing indoor positioning system.The main idea of the Crowdsourcing technique is to retrieve data from users in an indoor environment and store it in a database for future use.The larger the volume of data collected, the better the performance of the approach in terms of accuracy and efficiency [8].
One major issue in indoor environments is how to install Wi-Fi access points and where they should be placed.Typically, in any indoor environment, there are uncrowded places; hence, it would be helpful to have an approach that recognizes crowded areas for installing Wi-Fi access points to guarantee the best distribution of the network [9].People spend most of their time indoors so indoor localization becomes an important issue.As the Wi-Fi spreads widely indoors, the network designers do not have some clear criteria on how to place the Wi-Fi access points.Thus, we proposed a new approach based on Smartphones and Crowdsourcing technique to automatically detect the best places where the access points must be placed inside the target building.Based on this base, our proposed approach collects acceleration values of the building's visitors, which depend on their movements in the target building.These values are then smoothed to remove the noise and outliers' values, which resulted from irrelevant movements as well as the sensor sensitivity.Afterward, smartphones are exploited to detect user steps, time and stop location.These data are entered in the machine learning phase, Crowded Algorithm (CA), to label the most crowded places within the target building using KNN classifier, Naive Bayes and Random Tree.
To validate our approach, we carried out real experiments in the building of Information Technology faculty of 2291.04m 2 .Our results show that our approach achieves high accuracy to detect crowded places in the target building.The average accuracy level for detecting crowded places is 96%; and the average accuracy levels for detecting user step and stopping time are (95.8%)and (90.3%), respectively.
The rest of the article is organized as follows.Section II presents the most recent and relevant research work in the subject.The proposed approach steps are detailed in Section III.In Sections IV and V, experimental results are presented and discussed, respectively.Finally, we conclude the article in Section VI.

II. RELATED WORK
GPS is the most effective positioning system for an outdoor environment.However, GPS is incapable of providing positioning services with sufficient localization accuracy in indoor environments due to the lack of Line of Sight(LOS) transmission channels between satellites and an indoor receiver [4].In addition, it offers accurate positioning of the location for mobile device [3].Wi-Fi technology is used to track and position the signal strength received by the end user's device.Smartphones, tablets and mobile devices have become more popular for outdoor and indoor seamless tracking and positioning [10].In [11], Teuber increased the accuracy to 3m by applying minimal Euclidian Distance (ED) and fuzzy inference systems to determine the positions based on WLAN signal to noise ratio measurements.In [12], Chaudhary et al. proposed a system for indoor positioning based on RSSI values from AP's using RMSE algorithm (the number and positions of AP's play a major role in the tracking process the accuracy increases when the number of AP's is increased).The tracking and positioning are affected by the environmental factors and the acceptable error range, which gives importance for a crowded enclosed environment.

A. Indoor Positioning System Techniques
Indoor positioning system techniques have been developed rapidly throughout the last years.Multiple positioning methods can be applied for people's mobility tracking and positioning.CoO [13], Trilateration [14], Triangulation [15] and Fingerprinting [16] are typical and wide-spread methods.Indoor positioning localization techniques use signal metrics (e.g.AOA, TOA, TDOA, and RSS) and readings of Smartphone sensors to locate the position using either angle estimation or distance.Below, we present the indoor positioning techniques, the discussion of the limitations of these techniques and motions estimation in positioning systems [17].
CoO methods are used for people's tracking and positioning [13].Each beacon (e.g. an AP or RFID reader) represents a cell/ polygon according to its RSSI distribution.The cell's size depends on the density of the beacons.The device held by the user can be detected by the closest beacon while the user walks through the area covered by the beacons.The hooked beacon locate the user's current position.The CoO is simple and less prone to environmental effects.In general, CoO is not used as other methods.This is because its low accuracy [13].
Triangulation depends on geometric properties of triangles to estimate the target location.Each direction is formed by the circular radius from a station to the mobile target.AOA methods should know the reference points and measured angles to derive the 2D of target location [15] [14].One of these systems is Infrared Indoor Scout Local Positioning System (IRIS LPS) developed by [18].The accuracy of the system about 8cm in near range and about 16 cm when covering 100m [18].
One of the advantages of the AOA-based technique is that the location estimation can be determined using fewer points.For finding direction, it requires directional antennas which means there is no need for time synchronization between measuring points [19].Although AOA provides good accuracy, but it requires complex hardware and software, which increases the cost of the entire system.
The trilateration locates the object position by measuring its distance from multiple reference points.In trilateration, the "tri" says that at least three fixed points determine a position [14].
The main idea of fingerprint techniques is to collect a unique signature for each place in the interested area from a fingerprint database [16].The location is determined by matching the measured fingerprint with those in the fingerprint database.Wi-Fi location of fingerprinting technique consists of two phases: the training phase and the positioning phase.To generate the database in a conventional way, (some reference points RPs) in the interested area are determined; and then locates a Smartphone at the location of one RP.Afterwards, RSS metrics in those RPs are measured for all Aps; and then RP characteristic feature is selected from these measurements and recorded in the database.A localization algorithm retrieves the fingerprint database and returns the matched fingerprints as well as the corresponding locations.The considerable manual cost, time-consuming, labor-intensive and vulnerable to environmental dynamics are the main drawbacks of fingerprintingbased methods; which can be solved by Crowdsourcing based approaches.
An IPS using RADAR signal was proposed in [10].They provided a high degree of accuracy for locating and tracking users, which is about the size of a typical office room range 2 to 3 meters.An indoor positioning system with 0.45m of accuracy was developed by [20].However, this approach requires a site survey at every location of interest to build a fingerprint database.
Crowdsourcing is an emerging field that allows solving difficult problems by collecting real data rather than trained set of data.Crowdsourcing stands as the only viable solution for collecting a large amount of data for individual's locations that are required to support location-based services; for instance, RSS acceleration and gyroscope [21].In Crowdsourcing, ordinary individuals and users benefit from the constructed localization systems by sharing their data with others to achieve a globally localization in indoor environment [7].In UnLoc approach proposed by [22], the mobile sensors that sense the landmarks can recalibrate their location.They achieved higher than 95% of accuracy level in supporting room.In [23], Wu et al. proposed LiFS indoor localization system based on off-theshelf Wi-Fi infrastructure and Smartphones.The calibration process of fingerprints in LiFS is crowdsourced and automatic.They conducted an empirical investigation to the suitability of Wi-Fi localization in order to get highly accurate indoor localization of Smartphones.

B. Motions Estimation
There are many investigations available to step detection for people movement.Various tools can be used for motion detection events such as, pedometer, gyroscope, and accelerometer.Pedometer or step counter is a portable device that counts each by detecting the motion of the person's hand or hips.This technology includes a mechanical sensor and software to count steps.The accuracy of step counters varies between devices since it depends on a fixed step length.The accuracy of the pedometer has error of 5% [24].
The Gyroscope is a device for measuring orientation based on the angular momentum principle.The spatial orientation of a solid object is based on three parameters: pitch, rotation around the x axis; roll, rotation around the y axis; azimuth rotation around the z axis [25].Accelerometer is an electromechanical device that measures acceleration forces.Modern Smartphones have an accelerometer sensor that can be combined to measure the acceleration forces applied to the device on three axes (x, y, and z), as well as the force of gravity.The acceleration on (x, y) axes represents the change due to rotating or tilting the Smartphone; while the acceleration on z-axis represents the change due to vertical movements [26].
In indoor positioning using a Smartphone, built-in Smartphone accelerometer sensor offers the ability to physically measure the features dynamic motion, including the distance moved, orientation, steps, and the step length based on the periodic acceleration pattern of the user's gait.The proposed work in [27] used an inertial sensor to improve dead reckoning algorithm to help firefighters based on their location in the scene of fire accident.Accelerometers and gyros are applied to determine step, stride and heading.In [28], Hansson et al. used accelerometer and gyroscope to determine the users' motion.In their work, the accelerometer was used to count steps, and the gyroscope was used to detect the heading change.Their approach assumes that the step length, the initial position and heading are known.Moreover, they taken in account the step length and the error in counting the peaks.In this article, the proposed approach stored the Smartphone sensor data from the buildings visitors.The data from the accelerometer sensor will be used for detecting users' steps to address the most crowded places in a building.
Compared to the previous techniques, when we reassess our approach, we find that our method does not require any extra hardware or software.it is only based on the built-in sensors in the Smartphones.However, the previous methods require the presence of Wi-Fi access points and some additional hardware and software requirements.Therefore, the current study achieves the objectives of detecting user steps; stopping time and identifying the crowded places in which Wifi access points can be best deployed in the target building without any additional costs.Our proposed approach uses Crowdsourcing indoor localization for providing guidelines for Wi-Fi designers, which saves manpower and cost, and enables promotion companies to display their ads in the right place and at the right time.

III. THE PROPOSED APPROACH
Based on users' steps and time intervals, the stored data are clustered and classified using a machine learning algorithm.We made the flowing assumptions.Firstly, the mobile phone is at a static position placed in user's hand throughout the movement.Secondly, users must use a device equipped with some sensors such as accelerometer, which is rational since all the modern Smartphone are equipped with numerous sensors.Fig. 1 shows the block diagram of our proposed approach.It comprises of four stages.First, Crowdsourcing stage, preprocessing stage, step detection stage and crowded algorithm stage.Also, we rely on well-known classifiers to find the most crowded places.

A. Crowdsourcing Stage
The proposed approach uses Crowdsourcing method to collect acceleration values from buildings visitors Smartphones.An accelerometer is a sensor that measures user acceleration, which is the change rate in velocity of Smartphone.The measured acceleration includes gravity and the physical acceleration change of velocity.The acceleration on x, y axes represents the change due to rotating or tilting the Smartphone, while the acceleration on z-axis represent the change due to vertical movements [29].The raw data from the accelerometer are represented in a set of vectors: Acc i =< X i , Y i , Z i >.

B. Pre-processing Stage
The magnitude value represents the vibration on the three axes coordinates calculated by Equation 1.To exclude the gravity force from the magnitude value, the average of magnitude for all values are computed.Then the average magnitude is subtracted from the magnitude value using Equation 2. During this stage a high pass filter is used to exclude the outliers' values and the Earth's gravity [30].
where X, Y and Z represent acceleration force along the x axis (including gravity) m/s 2 , y axis (including gravity) m/s 2 and z axis (including gravity) m/s 2 , respectively.

C. Step Detection Stage
In this approach, a new algorithm is proposed to detect the real peak that represents user steps and the stop time using an empirical threshold, since user visits different places in the environment.Our step detection algorithm involves the values of X, Y and Z measurement values as well as the time from the accelerometer sensor.Equation 1 is used to find the magnitude value of these readings.Afterwards, we calculate the threshold value by dividing the magnitude values into dynamic time windows and we find the average of (St.D) of each dynamic time window.When the value of the resulted St.D, for each time window, is greater than the grand St.D, it means a new step is detected.Algorithm 1 shows our proposed algorithm's steps.

D. Crowded Algorithm Stage
The Crowded Algorithm (CA) is proposed to classify the data collected from step detection stage to make a model for the data that can be understood and analyzed and thus be able to determine the most crowded places.Then, it randomly splits the dataset into training data and test data.Firstly, the test data are created to test model's prediction on this subset.Secondly, the training data is used for algorithm training whereas test data are to evaluate the efficiency of the algorithm.Finally, the classifier builds a model based on the training data in which it can predict a new test data.These data are entered to machine learning phase to label the most crowded places within the target building using KNN classifier [31], Naive Bayes [32] and Random Tree [33].
The accuracy of the learning algorithm is examined using the test data.It builds a model to calculate the distance between training data and input data, then predicts the class of the input data.This process is repeated on each derived subset to check whether all the data in the subset belong to the same class.Fig. 2 shows the block diagram for the CA.

IV. EXPERIMENTS AND RESULTS
The real experiments have been conducted in the faculty of Information Technology (IT) building at Mut'ah University.The layout of the environment setting is shown in Fig. 3, which represents an area of 2291.04m 2 , 51.6m length by width of 44.4m, including more than 25 rooms.
To collect data from Smartphone sensor, we utilized two Android software applications equipped with accelerometer sensors, Samsung Galaxy J7Prime and Samsung Prime Plus, to conduct the real experiments.In addition, we used sensor manager.Most android devices have a built-in sensor that measure motion, orientation, and environmental conditions.Some of these sensors are hardware-based and some are software-based sensors.Whatever the sensor base is, android allows obtaining raw data from these sensors to be used in various applications.

A. Crowdsourcing Results
This experiment has been conducted in IT faculty corridors where untrained people of 56 volunteers were assigned to do their normal activities and movements while holding their smartphones.Their Smartphones collect accelerometer values along with user movement path.Fig. 4 shows an example of collected crowdsourcing data on 3-axis.
Values in Fig. 4 represents the movement dimensions of (x, y and z) measurements.During participant's tours, the accelerometer meter application records the acceleration values of their movements.Afterward, the collected data is examined to determine changing acceleration.

B. Pre-processing Results
This step, as mentioned earlier, aims to purify the data collected from accelerometer using a high pass filter, based on Equations 1 and 2. Fig. 5 shows the results of our real experiments after applying the smoothing filter.Also, Fig. 5 shows the magnitude values.However, it needs to be purified to move to the next important stage, Step-Detection, which needs high purity data by removing gravity force using Equation 2.

C. Step-Detection Results
To validate our approach, different initial path points with three different scenarios have been experimented as follows: • First scenario (specific path): Users were asked to move in a specific corridor, the initial point and the endpoints are known.• Second scenario (random path): Users were asked to choose any corridor to move in.
• Third scenario (landscape): Users were asked to be presented in 10 different locations, which have a landscape blueprint to determine the ability of our step detection algorithm at identifying the crowded places.
In the first scenario (specific path), at different speeds; users walked in a predetermined corridor, the starting point and the end point are known.This helps to detect the feasibility of the algorithm to identify crowded places through a path.Users are asked to start from interchangeable initial and endpoints, P1, P2 and P3, as shown in Fig. 6.Through the path shown in Fig. 6, the real steps, estimated steps and error ratio are obtained, as shown in Table I.Table I shows the results of each user after he has made three attempts to cross the corridor.The results show a good approximation between real and estimated steps.Such results indicate the accuracy of the algorithm in detecting the steps at an error rate of 5.6 for all users even when the distance is too long.
As for scenario 2 (random scenario), user picks his/her path starting from initial to endpoint.Fig. 7 shows the random scenario setting.In this scenario, users walk in a random path of their choice.However, we track their movement to determine the walking path.The result of this scenario is shown in the   Moreover, in this scenario, we have identified four random paths, C1, C2, C3 and C4, as well as the number of real steps to cross each corridor.Hence, the estimated steps in conjunction with real steps and the random path can determine the most crowded corridor.Therefore, the number of steps on each corridor gives the number of users.Table III shows the result of the step detection algorithms in terms of random paths.
As the step detection algorithm gives a high level of accuracy in both scenario 1 and scenario 2, the last scenario (i.e., landscape scenario) aims to examine the efficiency of our  proposal under investigation in determining the most crowded sites.This is performed by asking user to spend some time nearby 10 landmarks, which have been identified in the target building blueprint (as shown in Fig. 8).Fig. 8 shows 10 locations, which have been identified in the different corridors of the target building.Many users are usually presenting in these places for certain activities.Based on the step detection algorithm and empirical stopping threshold, we can determine the duration of users stop.Tables III and IV show the results of landscape scenario.Tables III and IV represent the features that have been used in machine learning algorithms to identify the crowd places.Locations in Table IV are sorted ascending based on the number of users and the total time spent there.It shows that P9 is the most crowded location as the number of users is the most; while P6 is least crowded location as the number of users is the least.

D. Crowd Algorithm Results
In the proposed approach, a dataset from the experimental data is created comprising the features of points, Locations, users, stopping time, and labeled of required AP of YES /NO class for learning.Afterward, Weka tool has been used as a machine learning tool for this experiment using several classifying techniques, including k-Nearest Neighbor, Decision trees and Bayesian.The accuracy of the learning algorithm is examined using the test data as shown in Fig. 9.

V. ERROR ANALYSIS AND SYSTEM ACCURACY
To investigate the error rates and its effects in the challenge of the step-detection as well as for stationary detection, which is the ability of the approach to stationary detecting user estimated steps with the minimal error rate; we calculate the error rate for both the step-detection and stationary detection using Equation 3. In addition, Equation 4 finds the error rate (Er) of step detection algorithm.
After determining the empirical threshold for the user movement, the error rate is calculated based on values that are not meeting the empirical threshold condition.Based on the empirical thresholds and Equation 3, the error rate is 4.2%.As for the accuracy of crowded places detection, the error rate is calculated based on values that are not satisfying the empirical threshold condition and Equation 4. Therefore, based on the empirical thresholds, the error rate is 9.6%, which implies that the accuracy of the system reached 90.4%.
StepAvgErr = AV G(RSs) − AV G(ESs) (3) VI. CONCLUSION In this article, we have proposed an automatic approach to detect the most crowded places inside a building.The proposed system utilizes accelerometer sensor data to detect user steps and predicts the most crowded places.Crowdsourcing methods are used to collect the acceleration data of Smartphone sensors.The experimental results show that the proposed approach achieves promising results by providing an accurate users steps detection reached (95.8%); and the accuracy of determining stopping time for user movement, which determines the most crowded places is 90.4%.
In the future work, we are going to extend the proposed approach to support more buildings such as circular buildings where the corners are not clear.More classifiers will be used as well as extensive experiments.

Algorithm 1 :
Step Detection Algorithm 1 Collect accelerometer data including time: X, Y, and Z values. 2 Calculate the magnitude value for each reading (x, y, z) using Equation 1. 3 Divide into dynamic time window.4 Calculate standard deviation (St.D) of each time window.5 Calculate the threshold value, which is the average of standard deviation for each list of time windows.6 The step is detected if the standard deviation for a time window is greater than the overall standard deviation.
Table II which shows that our step detection algorithm proves accurate user step detection even if users

TABLE I .
RESULTS OF SCENARIO 1.
move in random paths; since the error ratio is not exceeded (4.1) on average.

TABLE II .
RESULTS OF RANDOM SCENARIO.

TABLE III .
THE NUMBER OF STEPS IN EACH CORRIDOR.

TABLE IV .
THE NUMBER OF STEPS IN EACH CORRIDOR.