Estimating Bluetooth mac scanner based pedestrian flow characteristic by taking the through pedestrian flow as a case study

The Bluetooth scanner has been widely used as vehicle traffic detector in recent years. A new solution based on the Bluetooth scanner has been deliver to detect pedestrian traffic by estimating the pedestrian flow characteristic. The equipment is tuned to scan Bluetooth devices more frequently. Consequentially, the unique Bluetooth MAC can be detected multiple times by the scanner. The numeric simulation also suggests median detection is the chosen one to calculate traveling time. In this study, Bluetooth MAC scanning, as a non-intrusive technology, is tested in a pedestrian transfer tunnel, including antenna compatibility working within buildings. The penetration rate also increases slightly. Finally, the proposed solution offers a mature technology for pedestrian study, integrating scanner configuration, antenna selection and the traveling time calculation method.


Introduction
Rapid deployment of smartphones as all-purpose mobile communication systems has led to the fast adoption of wireless communication systems such as Wi-Fi and Bluetooth.The media access control (MAC) of Bluetooth devices can be viewed as a unique identification.The Bluetooth scanner utilized as a traffic detection technology has emerged in the past decade [1].At the current time, networks of Bluetooth MAC scanners, which detect and match the MAC addresses of Bluetooth devices within wireless networks, have been widely utilized to collect vehicle traffic data [2] [3].
On the other hand, the organization of pedestrian flows in large public buildings presents a major challenge.In traffic terminals, such as railway stations and subway stations, systems with information about current crowd flows are able to support the control and management of pedestrian flows and can reduce traveling time and management cost [4].Meanwhile, shopping malls or other commercial real estate expect a higher pedestrian density and a longer dwelling time.According to Kardi Teknomo [5], pedestrian detection technology can be classified into two categories, namely, manual counting and video image processing.Recently, the Bluetooth scanner has been deployed in different locations to measure pedestrian volume and traveling time [6].
This paper aims to deliver a solution for monitoring pedestrian movements, especially in large traffic terminals, by means of stationary Bluetooth scanners.The proposed solution consists of theoretical numeric simulation, hardware configuration (including antenna selection), and Bluetooth scanner parameter tuning.In the remainder of the paper, an overview of existing efforts is presented, followed by a discussion of the methodology and a numeric simulation.Results from the study site are described and discussed, followed by concluding remarks.

Background
According to IEEE 802.15.1 protocol [7], the connection between a Bluetooth scanner and a Bluetooth device is established by the process described in Figure 1.

ICTTE 2017
The Bluetooth scanner can collect the encrypted MAC address of device and corresponding detection time.The traveling time can be calculated by using logarithmic differentiation of detection time collected by two proximate Bluetooth scanners.
(1) where T(m,1,2): the m th MAC-ID traveling time from zone 1 to zone2; t(m,k): the m th MAC-ID detection time at k th zone ; The Bluetooth scanner detects active Bluetooth devices within its scanning coverage.Due to the frequency hopping process mentioned below, the acquired traveling time is a zone-to-zone traveling time, rather than a point-to-point traveling time such that obtained by conventional automatic vehicle location (AVL) technology.
In this study, the Bluetooth data has the following three fields: -ID: a unique encrypted MAC address of the Bluetooth device detected -Time stamp: time when the scanner records the Bluetooth device -Frequency of detection: frequency of being detected by scanner to pass through the scanner coverage.
In addition to the traveling time, this paper focuses on the frequency of detection on a single MAC basis, which is highly correlated with the scanner's signal quality.This is presented in detail below in the third section of the paper.

Descriptions of Bluetooth Scanner Working Process
The Bluetooth scanner "sniffs" data packages sent by proximate Bluetooth devices.To simulate the scanner working process, a probabilistic model is established by making some assumptions regarding the operations of the scanner and Bluetooth device.Initially, the scanner is assumed to remain in its inquiry state, and it hops on each frequency and scans for 0.625 millisecond.The second assumption is that the Bluetooth device passing by the scanner enters its inquiry scan state every 1.28 s and listens on channels for 11.25 milliseconds, as described by Welsh et al. [9].By making these assumptions, when the Bluetooth device is within the range of the scanner, 18 frequencies of the total 32 frequencies that belong to the Bluetooth spread spectrum will be scanned during a single inquiry period, of which the probability is equal to 56.25% [10].

Bluetooth Inquire and Radio Scanning Cycle
In contrast to existing studies [11], the scanning cycle is set to 1.28 s which leads to a higher detection frequency.From the large number of detections for a specific Bluetooth MAC, only one is selected and used to determine traveling time.The varied methods regarding detection timing selection for differential operation in Equation 1, namely, early detection, median detection, and final detection, are compared and examined by a numeric simulation proposed in this section.For the other detections, two pieces of information are available, namely, detection time and approximate location of the detected Bluetooth device when within scanning coverage.Hence, this paper defines the redundancy of detections as ambiguity.The utility of ambiguity is presented in the following numeric simulation and analysis of the experiment's dataset.

Signal Propagation and Antenna Selection
The performance of the Bluetooth scanner, as a nonintrusive detection technology, is substantially correlated with signal quality [12].Antenna selection and signal propagation are two critical factors.The signal propagation is highly subject to the environment, especially the indoor environment.In the antenna selection criteria, two main factors are considered: polarization and antenna gain.Polarization refers to the orientation of the electric field vector in the radiated wave.Antenna gain is defined as the power output in a particular direction, compared to that produced in any direction by a perfect omnidirectional antenna (i.e., an isotropic antenna).In this research, the selected antenna needs to be polarized to enable an effective range that is as long as possible to create ideal signal coverage, as demonstrated in Figure 1.The selected antenna also needs an appropriate level of antenna gain with the scanner able to avoid capturing MACs for Bluetooth devices outside the testing fields.The study presented in this paper tested and compared two categories of antennae when working within buildings.The frequencies of cluster size are examined to see how these values may be of use in describing a particular location.The Figure 2 illustrates the probability that a Bluetooth device is detected by a Bluetooth scanner in ICTTE 2017 relation to the distance of the device from the scanner, based on assumptions of the ideal signal propagation proposed by Moghaddam and Hellinga [13].

Numeric Simulation
The Bluetooth scanning interval is 1.28 s.Based on the third assumption, the location and time of the detection are recorded when a pedestrian is traveling through the Bluetooth scanner's antenna coverage area.Through the use of the location-based probability of detection (as defined in Figure 2), it is determined whether each pedestrian had been detected.The simulation runs 100,000 times [14] [15] A simulation can be formulated by the following Pseudo-code: For each single pedestrian For each step of the scanning cycle Generate a random number If the random number < probability of being detected, the device is detected Record time step and location Else the random number >Probability of being detection Otherwise End if End End Due to the assumption 3, the location and time of the detection is recorded when pedestrian traveling through the Bluetooth scanners antenna coverage area.The high volume of MAC detections are classified into clusters.A cluster is defined as a collection of data records with the same matched MACs sorted sequentially by time, shown in Figure 3. Clusters of MACs are defined for individual Bluetooth scanner, and they represent the number of times a single unique MAC is captured as a pedestrian passes through the Bluetooth scanner's coverage area.Three typical detection timings may be chosen to calculate pedestrian traveling time, namely, initial detection, median detection, final detection.As the detection probability function is symmetric in Figure 2, two out of the three scenarios, the initial one and the median one, are compared and evaluated in terms of uncertainty.Hereby, for each scenario, two detection locations of same timing, generated by two independent simulations are selected for traveling time differentiation, shown in Figure 4.In theory, the independent detection location should be static ideally to calculate the point to point traveling time.Hence, the measurement error is the gap between the two detection locations generated by the same simulation scenario.

Simulation Findings
Due to the signal unreliability at the marginal areas of scanner coverage, the location of early detection (final detection) is highly unstable.The Figure 5 (a) illustrates that the uncertainty of early detection scenario is higher that its counterpart.According to the simulation result, the median detection location is approximate to scanner's location where the signal is the most ideal.Hence, it is promising to select the median detection out of cluster to calculate the travelling time, as shown in Figure 5 (b).

Field experiments
A series of field tests have conducted to examine the solution.The parameters are tuned up to realize the numeric simulations in section 3.

Equipment
A MAC scanner device was used to collect MAC addresses of Bluetooth devices as they passed by the scanner.Regular Bluetooth devices are normally restricted to a range of about 10 m, but an increasing number of devices are able to read MAC addresses to a range up to 300 m ( ).Such a device and antennas, shown in Figure 6, have been developed by the Smart Transportation Applications Research laboratory at the Queensland University of Technology and was used in this study.The device is used in conjunction with a 5-dBi (decibel isotropic) omnidirectional antenna to obtain a range of roughly 50 m.The scanning cycle is 1.28 s to be considered continuously present.Directional antenna diverts the signal in a particular direction to farther distances.While directional antennas can be of great value for certain indoor applications, Directional antennas used for the indoors typically have a lower gain.This results in less ability to reject or reduce the interference signals received from directions outside the primary lobe area [16].

Pre-experiment
In the Xizhimen subway interchange station Beijing, the four locations chosen for detector mounting were at both ends of a pedestrian transfer tunnel linking Route 13 with Route 2 and Route 4, shown in Figure 7.
The penetration rate was the main antenna performance measure and was computed as follows: P = N / M (2) where P -the penetration rate N -the number of MACs matched at both ends M -the number of through pedestrians collected manually One-hour manual counts were done within the range of the installed scanners to determine the approximate penetration rates at each location at peak hour during which the Xizhimen subway station has extremely high pedestrian flows of approximately 20,100 pedestrians per hour in both directions.Several similar experiments were conducted at the same spot.The dataset shows that the scanners were able to capture roughly 2% of the population travelling through the tunnel.

Field Test Data and Analysis
Four scanners were mounted at four different sites at both ends of the tunnel.Two of them were equipped with directional antennae, while the others were equipped with omnidirectional one.During peak hour from 17:40 to 18:40, test results were collected by the two pairs of scanners equipped with directional antennae and their omnidirectional counterparts, are shown and compared in Table 1.The datasets were extracted and stratified into clusters defined in section 3.The study focused on the pedestrian flow through the tunnel.Thus, only the MACs that were matched at both scanners were taken into account.
The Figure 8 demonstrates the distribution of traveling time.The distribution also demonstrates that a few MACs have been detected at extremely high frequency in Figure 8 (a) (c).Therefore, the traveling time is calculated by the differentiation of the two initial detection times collected by two scanners with omnidirectional antennae, while the median detection times are used to calculate traveling time for the dataset collected by the directional scanning antennae.As a longer tail of cluster size can be found in the dataset collected by the omnidirectional antennae rather than the dataset obtained by the directional antennae.It indicates that MACs with a high dwelling time are not likely to roam in the designated area.The reasonable explanation is that the omnidirectional one may capture some MACs continuously outside the test location, due to its open coverage.The comparison between two categories of antennas suggests the directional antenna can create a wider effective range for MAC detection.These phenomena demonstrate a methodological improvement.Both the higher penetration rate and the better shaped distribution suggest the current solution realizes the ideal condition to some extent, based on the assumptions listed in section 3.As a result, the traveling time calculated by the omnidirectional dataset seems to be biased, due to the unstable signal at marginal areas of the signal coverage.The omnidirectional data also shows that the travelling time is more dispersed than that of its directional counterpart, as shown in Table 1, Figure 8, and Figure 9.

5.Conclusions
By detecting and matching Bluetooth MAC addresses, the study presented in this paper develops and delivers a solution to measure pedestrian volume and speed.The study makes several contributions in the area of pedestrian detection, putting forward the measurement of theoretical development.It proposes a new high frequency scanning method to be used within complex structures.Meanwhile, median detection is chosen from each MAC cluster to calculate traveling time.In addition, the study improves pedestrian detection with specific antennae in an indoor environment.Therefore, the solution delivers a more accurate and reliable solution based on the use of a Bluetooth scanner to measure pedestrian flow characteristics.In the future, the penetration rate can be improved by introducing a Wi-Fi scanning module.This scanning technology can be applied extensively in different areas of pedestrian studies.Further testing in the field is also necessary to validate the data with data obtained by indoor positioning technology.

A
numeric simulation is established based on the following assumptions.-Ideal signal propagation and device detection -High frequency scanning : Scanning cycle is set to 1.28s -Uniform pedestrian speed: 5km/h (1.40 m/s ) -One Bluetooth device for each pedestrian

Figure 2 .
Figure 2. Location based detection probability Figure 3. Cluster of Bluetooth device MAC

Figure 9 .Figure 8 .
Figure 9. Traveling time distributions collected by directional antennae.(x axis represents traveling time, y axis represents frequency