<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Position Estimation at Indoors using Wi-Fi and Magnetic Field Sensors</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ganduri Chandra</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Theatro Labs India Pvt Ltd</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bangalore</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>India</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <abstract>
        <p>Indoor location estimation is important for many applications, including home automation, security, and surveillance, to name a few. This is accomplished via sensors such as cameras and passive infrared (PIR) sensors, as well as radio frequency-based technologies such as Wi-Fi, Bluetooth, and radio frequency identification (RFID). Because of its ease of implementation, Wi-Fi technology is the most extensively used. Aside from Wi-Fi, a growing number of researchers are experimenting with the sensors embedded into mobile phones. To increase the performance of the localization, deep learning, probabilistic, and statistical algorithms are applied to the raw data collected from sensors and Wi-Fi access points. In this paper, we present a sensor-based indoor localization test-bed. We feed data from magnetometer sensors and Wi-Fi access points to Machine Learning (ML) algorithms. With our proposed method, we get a very high accuracy of 98%. Performance analysis of the ML-classifiers' dependence on the size of the test data set is also explored in detail.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Extreme Gradient Boosting(XG-Boost)</kwd>
        <kwd>Indoor Localization</kwd>
        <kwd>Machine learning</kwd>
        <kwd>Magnetic Field Sensor</kwd>
        <kwd>Random forest</kwd>
        <kwd>Wi-Fi RSSI</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Various fingerprinting approaches have recently been studied and deployed in real time
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Many works [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] have demonstrated that fingerprinting-based approaches achieve
high precision. In the methods involving Wi-Fi – for instance in all of the above discussed
approaches – huge collection of data is required for calibrations, and this one of the major
drawbacks. The range-based approaches compute the distances from a user’s end device and
Wi-Fi access points, and employ geometrical models (for example, triangulation model) to
estimate the user’s location. Several Path loss models, namely Log distance Path loss model,
have been investigated in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to estimate distances based on the Received signal
strength (RSS) information. As RSS is in general not stable indoors, Channel State Information
(CSI) based ranging has been introduced.
      </p>
      <p>Notably, majority of the aforementioned approaches are not stand-alone, i.e., these cannot
be implemented independently. More precisely, Wi-Fi based localization requires the use of a
network, which raises the concerns about data security. Furthermore, when a small number
of access points are installed, using alone a Wi-Fi approach is not very efective. Also, these
approaches necessitate prior knowledge of the Geo-graphical locations of the access points
deployed indoors. Wireless fingerprinting-based localization is the most popular among all
the localization techniques, due to its ease of deployment. The Radio Frequency signals (RF
signatures) collected from the access points help in the prediction of the location accurately.
Typically, RF measurement values and the Received Signal Strength (RSS) values of WiFi or
Bluetooth or any other wireless technologies, are one and the same.</p>
      <p>
        Indoor localization methods which are based on the signatures of magnetic field generally
assume that these magnetic fields do not vary much within a smaller range of altitudes; for
example, see [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. This assumption is known to be very reasonable, and applies well to the
situation where a magnetic field sensor (to measure the magnetic field signatures) is placed
at any point between the surface of the floor and ceiling of a room; note that pillars/beams
are usually made of iron bars which are ferromagnetic. More generally, [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] considers a larger
range of altitudes for placing a magnetic field sensor, such as the altitudes of buildings; and
also other factors, for example buildings are made of multiple vertical and horizontal beams
(which are ferromagnetic and hence can influence the measurements by the sensors). One of
the purposes of his article is to critically quantify the impact of altitude on the accuracy of
traditional Machine Learning classifiers, for position estimation indoors (across the height of a
room) using magnetic field data. In particular, we devised small-scale experiments conducted in
slightly restricted environment (departmental laboratory) at two diferent altitudes (2 feet and 4
feet), that aided us in answering few questions such as:
1. Does the magnetic field at indoors vary significantly with altitude?
2. Suppose that the altitude is same for both training and testing an ML model. Then what
is the role of the device’s location height whose magnetic field intensity we measure?
The broad goal of the present paper is to provide an ML-based solution to estimate the location
information with the data extracted from a realistic embedded test bed. Our contributions in
this paper are as follows:
1. We present an eficient method for describing the user’s exact location at Indoors with
high resolution.
2. The novel aspect of our method: we used a multi-label and multi-output approach to
predict the location of the user’s end device.
3. We validate our results via training and testing the data we collect from a realistic test-bed.
4. We also investigate the impact of the sensor’s height on the prediction accuracy.
      </p>
      <p>Rest of the paper is structured as follows: Section 2 provides a synopsis of some related works.
Section 3 discusses the motivation of the paper. The Experimental setup which includes brief
description of the sensors used in this work is presented in Section 4. Section 5 presents the
experimental results. Section 6 discusses some concluding remarks.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Works</title>
      <p>
        In recent past, extensive research has been conducted towards indoor localization and the
boosting of the prediction accuracy. In this, many researches have proposed a wide range of
novel schemes for Indoor Localization/Navigation which involve the technologies, to name but
a few, RF-ID[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], Bluetooth [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and Wi-Fi [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], the authors proposed a ‘sensor by proxy’ approach that involves sensor fusion of
Radio frequency identification measurements to reduce false-of error rates in Localization
indoors. In particular, they derived a novel score function, which is used in developing distance
based algorithms, with an aim to guarantee maximum coverage using a limited number of
sensors indoors. The solutions provided in this work yielded localization with a reasonably
good accuracy. But sensor based approaches in general have some drawbacks/ limitations
in real time; for instance, limited range of the coverage area when deployed. In [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], some
device-free techniques to analyze the user’s behavior through Wi-Fi signals at shopping malls
have been employed. Usually, Received Signal Strength Information(RSSI) and Channel State
Information(CSI) data are used for localization of users indoors, see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The authors of this
paper claimed that their proposed method will work eficiently even when the user is not
connected to any of the access points. For real time deployment, the approach presented in
[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] will work eficiently only if the client devices are embedded with specific hardware: Intel
5300 802.11n Wi-Fi NIC. Device-free Localization Systems with accurate positioning have been
proposed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. The work in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] involves combining the RSSI of the user’s end device with a
ifltering technique for estimating the user’s location inside a closed environment. In the same
paper, it has been claimed that the approach does not require any additional/dedicated hardware
infrastructure.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], a Machine learning based algorithm has been proposed, and a reasonably good
accuracy of around 85% has been shown. In the same paper, the sensors utilized were
accelerometer, Wi-Fi, light, color and sound, and the approach therein involves translating the pixels
from the light sensor to Hue-Saturation-Lightness (HSL). Also, the classifier’s used therein
were: K-means clustering (distance based approach) and Support Vector Machine (SVM). Recall,
considering SVM for localization is not a best suitable solution, since it can be used only for
binary classification, i.e., one can only predict the presence or absence of the users.
      </p>
      <p>
        The work in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] proved that magnetic field strength can vary in diferent rooms within
buildings. The authors of this paper also concluded that give a place in a building, the magnetic
signatures there are unique, and hence the magnetic field data can be used for Localization using
both Machine Learning and Deep Learning (DL) frameworks. In the aforementioned paper,
the coeficients extracted after applying Fast Fourier Transform (FFT) to the magnetic field
data were fed to Convolutional Neural Networks (CNN) for real time predictions. Hybrid Deep
Learning Model (HDLM) based localization systems, which only utilize RSSI heat maps instead
of the raw RSSI signals from the access points, have been proposed in [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], resulting in a better
localization performance of the Wi-Fi RSSI signal based positioning systems. HDLM is the
combination of convolutional neural network and Long Short-Term Memory (LSTM) network.
Also, it has been claimed in this paper that HDLM achieves reasonably good accuracy prediction
with very less localization error, When compared to the existing solutions that involve the
approaches viz fingerprint, trilateration, and Wi-Fi fusion etc.
      </p>
      <p>
        A Deep Learning based approach has been introduced in [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] to predict the location of a
user indoors. Although Deep Learning approaches outperform very well, the bottleneck is that
training the network requires huge data and time. In [20], the authors used Long Short-Term
Memory. In general, LSTM networks are used for predicting time series data by learning the
data collected at previous time instances. For real time deployment, all the neural network
based models consume huge amount of time while training and processing, as well as occupy
more memory.
      </p>
      <p>In general, in any positioning approach, the evaluation of the accuracy involves the calculation
of the Euclidean distance between the true and estimated positions of the users. One major draw
back in this is that the floor transitions are being ignored. Dealing with some more challenges in
predicting an accurate position of users indoors, the work in [21] introduces a new methodology
to measure the positioning error, which considers the length of the user’s path that connects
the estimated position to the exact position using the visibility graph for the floor map, so as
to compute the shortest distance, navigational meshes for the vector maps to identify similar
paths with less computation time.</p>
      <p>To improve the user localization accuracy using RSSI and the complexity over widely used
ifngerprinting methods, an eficient compressive sensing based approach have been introduced
in [22]. Localization using Least Square Lateration(LSL) method has been introduced in[23].
This paper also discussed a comparative analysis of the accuracy with LSL against that of with
Pure lateration(PL), by utilizing diferent Gaussian noise parameters for varying number of
access points and varying distance between the access points and user’s end device. Further, it
has been proven (in the same paper) that least-square algorithm with curve fitting approach
provides significant performance improvements when compared to PL. A novel scheme for
localization based on the Angle Diference of Arrival information and triangulation using
mmwaves indoors has been proposed in [24]. Also, it has been stated that their proposed algorithm
outperforms very well at both vacant as well as ofice environments, by using a commercial
60-GHZ mm-wave test bed for their experiment. Though the results therein are promising,
deploying the same for real time usage will be the bottleneck given that their equipment is
expensive.</p>
      <p>
        To study and understand the behaviour of the Earth’s magnetic field inside a room, a novel
methodology has been introduced in [
        <xref ref-type="bibr" rid="ref17">17, 25, 26</xref>
        ]. In these, Dense and spatially referenced
samples of the magnetic vector field towards the surface of the ground as well as the free space
above, was considered for both the analysis and also the map estimation of the surroundings.
The approach followed in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] utilizes both the Rao–Blackwellized particle filter as well as kalman
iflter, to estimate the pose and calibration parameters.
      </p>
      <p>
        So far, several research papers have been published in the literature that use either RSSI [27]
and [28] or CSI data [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for Wi-Fi based localization. The bottleneck in such methods is that a
large number of access points must be deployed to monitor the user’s location, and importantly,
the user must be connected to a network when using the widely used triangulation method.
      </p>
      <p>Recent works, such as [29] and [30], to name a few, have demonstrated that using magnetic
signatures indoors, and more broadly in the corridors of even large buildings, is quite beneficial
in terms of consistency and stability. Furthermore, the sensor signatures do not change over
time. In addition, they are unafected by any changes in the objects, such as furniture in
diferent locations and moving objects such as doors, windows, and user(s), etc. However, some
extreme conditions can influence these signatures, for example large-scale reconstructions or
the relocation of heavy metallic objects.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Motivation</title>
      <p>Motivated by the findings mentioned in previous section, we developed a novel machine
learning-based approach that makes use of data from both magnetic sensors and Wi-Fi access
points. Interestingly, our approach does not require any network connectivity for localization.
Furthermore, in this work, we critically examined the dependence of ML classifiers’ location
prediction on the altitudes from the surface at which sensors are placed.</p>
      <p>We therefore aim to overcome majority of these limitations with a novel idea of combining
the utility of both the magnetic field and Wi-Fi Beacon information to describe the indoor
position.</p>
      <p>Finally, for a further eficient localization indoors, we would like to emphasize that the
following can be immensely helpful:
1. A detailed study on the magnetic field data analysis.</p>
      <p>2. A study of more recent state-of-the-art</p>
    </sec>
    <sec id="sec-4">
      <title>4. Experimental Setup</title>
      <p>To begin, we gathered data points spanning an area of 364 sq.ft. In the corridors of a building,
this area is subdivided into cells of size 4 sq.ft., resulting in a grid (matrix) of size 7× 13 (outdoors).
Similarly, while working inside a room (indoors), data points from an area of 180 sq.ft., were
divided into cells of 4 sq.ft. each, and resulting in a 5× 9 grid. The actual problem is posed as
a multi-output and multi-label classification problem, i.e., predicting the co-ordinates (of the
user’s position) on the grid based on inputs from both the magnetometer sensor (HMC5883L)
and the Beacon RSSI values of the selected Wi-Fi access points. We divided the rest of the
description of the experiment (its setup and the various elements involved) into four separate
subsections for ease of exposition.</p>
      <sec id="sec-4-1">
        <title>4.1. Magnetometer sensor</title>
        <p>Honeywell HMC5885L magnetometer sensor is used in this work. This ’low power’ module is
useful for a variety of general purposes, including measuring the magnetization of a material
(for example, ferromagnetic materials, iron bars inside concrete pillars, and so on), measuring
the field strength, and measuring the direction of the magnetic field at a point, among others.
It is intended for magnetic field sensing with a digital interface for a wide range of real-time
embedded applications at a low cost and with high resolution. Next, using the I2C interface,
you can easily establish communication between the HMC5885L and microcontrollers. This
sensor supports 3V to 5V Input-Output levels on I2C Serial Clock Line (SCL) and Serial Data
Line (SDA) pins. The sensor’s output is measured in milli-Gauss units.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Data collection procedure</title>
        <p>To collect sensor data and beacon information, we created an Embedded test bed that includes
an RF enabled Wi-Fi module and a Magnetometer sensor. Following that, we connected an SD
card module to the microcontroller to store the raw data from the sensor into files (.csv format),
and these files contain both the magnetic field data (along the x, y, and z planes in reference to
the sensor’s alignment with the test bed) and the Beacon information of three (nearest, chosen
at random) selected Wi-Fi access points. The block level representation of our experimental
setup is shown in Fig. 1. We collected magnetic field data and Wi-Fi beacon information in both
outdoor and indoor environments of our research laboratory by placing the sensor at various
altitudes.</p>
        <p>The data we collected has six attributes: the first three are the data corresponding to the X,
Y, and Z axes provided by the Magnetometer sensor, and the remaining three are provided by
the Beacon RSSI values of the three selected Wi-Fi access points. Over the 364 sq.ft. area, we
collected a total of 54,600 samples (chosen above, outdoors). Remember that this area has 7× 13
cells, each with a 4 sq.ft. area, and we collected 600 samples from each of these cells. Similarly,
we classified the indoor floor into a 5x9 grid and collected (total of 20,250 samples) 450 samples
at each cell of the grid.
4.2.1. Wi-Fi Data
During each scan, the signal strength measurements of all nearby access points can be
theoretically obtained. However, not all access points in a location are usually observed/captured
in real time. The Service Set Identifier (SSID) of any nearby Wi-Fi access point, as well as its
BSSI (MAC address) and Received signal strength Information, are immediately visible in the
database obtained by scanning the Wi-Fi network coverage area (RSSI). In our paper, we only
considered three access points that were closest to the data collection location.
4.2.2. Magnetic Field Data
The data from the Magnetic field sensor used in this work yields three column vectors each
with dimension equal to the number of samples taken:</p>
        <p>H = [︀ H, H, H]︀ number of samples× 3 .</p>
        <p>Above, H, H and H denote the position-measurements from the sensor along ,  and -axes,
respectively. Recall, these measurements are noted in mG units.</p>
        <p>In general, the raw measurements obtained from the magnetic field sensor can be used in two
diferent ways: 1) to calculate the magnitude of H, i.e., the magnitude of each row in H, which
is a point in 3-dimensional space; 2) to use H directly/explicitly. For the purpose of enhancing
the accuracy. usually way 2) in the previous line is followed. For each 1 ≤  ≤ the number of
samples, recall:</p>
        <p>Magnitude of H[] =
√︁</p>
        <p>(H[])2 + (H[])2 + (H[])2,
where H[] = (︀ H[], H[], H[])︀ ∈ R3.</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Statistical analysis</title>
        <p>The 2D-heat maps of the measurements are shown in Fig. 5. Fig. 5(a) corresponds to the
experiment outdoors; while the remaining two correspond to indoors and the two diferent
(a)
(b)
altitudes (2 feet and 4 feet) considered. Furthermore, for a better understanding, we have plotted
the 3D-heat map for the experiment outdoors, see Fig. 6.</p>
        <p>To verify the consistency of the measurements by the magnetic sensor (embedded on the test
bed), the process will be repeated to collect a large number of signatures of the magnetic field
in diferent columns of the grids in Fig. 5. From all of these sub figures, one observes:
• The signatures collected across diferent columns on the floor can be seen from Fig. 3.</p>
        <p>Clearly, there is a variation in the patterns in these two figures.
• Consistency: Evidently, the patterns in the plots in Fig. 3 are not varying with the times
at which the samples were collected (morning, afternoon and evening).
• At each location indoors, there is a small variation in the signatures as we change the
height of the sensors, see Fig. 4.</p>
        <p>The collected data at both outdoor and indoor environments is processed to obtain the mean
magnitudes – plotted as a heat maps in Fig. 5(a), 5(b) and 5(c) – at every individual cell in the
defined grid. The data is then normalised over all the cells, for a better representation of the
heat maps. Observe from Fig. 6 (for outdoor environment), the oscillations/non-uniformity in
the normalized magnitude values as we move among various cells on the grid.</p>
      </sec>
      <sec id="sec-4-4">
        <title>4.4. Machine learning approach</title>
        <p>In our paper, we employ classifiers such as Random Forest(RF) and XG-Boost, since these are
purely tree-based ensemble algorithms. Comparatively, in RF classifier, more number of Decision
Trees (DT) are applied to multiple sub-samples, so as to increase the prediction performance, to
prevent over fitting while training, and also to enhance the stability and accuracy. RF classifier
is a bootstrap ensemble for decision trees. Usually, Hyper parameters namely, number of trees
and depth etc, are tuned for better prediction performances.</p>
        <p>Where in, D denotes number of data points in node. m,n denotes number of labels (label
m and n correspond to row and column information of room, in our case). P(m,n) denotes
probability of data belonging to a label.</p>
        <p>Average entropy of a split D: {︀ }︀ =1 and Information gain() can be calculated using
below equations,
 =
[︃ 
∑︁ || H()
=1 ||</p>
        <p>]︃
 = H() −  = H() −
[︃  ]︃
∑︁ || H() .
=1 ||</p>
        <p>XG-Boost(Xgb) classifier was found efective over of-the-shelf ML classifiers with categorical
data. In simple words, Xgb is an algorithm which is an implementation of Gradient Boosted DT’s.
It is being very dominant in applied machine learning now a days. One of the objectives of Xgb
is to minimize the error of cost function ℓ(,  ()), via applying gradient descent algorithm. In
this algorithm, DT’s are created in a sequential order. Weights, which play an important role in
XGBoost, are assigned to all the independent variables, which are then fed into the DT which
predicts the outputs. The weight of the variables that is predicted wrong by the DT, is increased
and then the variables are fed to the next DT. These individual DT’s are then ensemble to give a
concrete and more eficient (in terms of accuracy) model. It can work on both the regression
and classification problems.
(1)
(2)
(3)
(a)
(b)
(c)
altitude at Indoor environment; (c) Magnetic field at 4 feet altitude at indoor environment.</p>
        <p>The training data set is D = {︀ (, )︀} =1, where  and  corresponding to the input and
output attributes (a total of 8 attributes) of data set,  = {︀ [, ]
︀} ,,=1, Note that the lengths
of  and  are same. Let the diferential loss function for our model be ℓ(,  ()), where
 () is the prediction corresponding to the input of classifier. We begin by initializing the
model with some constant value:
compute the entries of the Gradient and Hessian iteratively (using a for loop) as follows:
Let  be a positive integer. For each  ∈ {1, . . . , } and for each  ∈ {1, . . . ,  }, we
0() = arg min ∑︁ ℓ (,  )


=1
 = −
 = −
︂[ ℓ (,  ()) ]︂</p>
        <p>()
︂[ 2ℓ (,  ()) ]︂
 ()
2
 ()=-1()
 ()=(− 1)()
(4)
(5)
(6)
( is the learning rate.)
():</p>
        <sec id="sec-4-4-1">
          <title>By doing all the above, we obtain the final output:</title>
          <p>After finding   and thereby () as above, we now update (in the for loop) the parameter
(7)
(8)
(9)
(10)
  = arg min ∑︁ 1

=1</p>
          <p>︂[
2  − 

−  ()
() = − 1() + ()
 () = ()() = ∑︁ ()

=0</p>
          <p>We fit a base learner (Decision tree) for the training set {︁
optimization problem:
 }︁
, −  =1
, solving the following</p>
        </sec>
      </sec>
      <sec id="sec-4-5">
        <title>4.5. Experimental Procedure</title>
        <p>To begin with, we have collected data inside as well as outside our research laboratory building.
Next, we captured the real time data from both the Wi-Fi module and Magnetic sensor, and
then stored all of this data in an SD card for further processing. The data extracted from the
Magnetic sensor are composed of an individual reading for each Cartesian axis (x, y and z).
In real time, the data from the magnetic sensors are anomalous due to sudden changes in the
magnetic field, or erroneous sensor readings. The data stored in SD cards has been transferred
to a laptop for further data processing, that includes training and testing of ML models.</p>
        <p>We have then classified the target attributes into two outputs. The first output corresponds
to the row information of the cell in the grid, while the second to the column information. The
lfoor map of outdoor environment can be found in Fig. 5(a). The values 0–12 on the x-axis
(as in this figure) represent individual columns of the grid, while the values 0–6 on the y-axis
represent individual rows. Similarly, for indoor environment, we considered the total area into
a 5x9 grid, and the same can be seen clearly from both Fig. 5(b) and 5(c). Next, the values 0–8
on the x-axis (in both the figures in the previous line) represent individual columns of the grid,
while 0–4 on the y-axis represent individual rows.</p>
        <p>Now, we present our experimental results, comparing the performances of various ML models
used in this paper for the position estimation.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Experimental Results</title>
      <p>We observed very good testing accuracy running a series of experiments on the collected data
set, with varying test sizes.</p>
      <p>As can be seen in Fig. 8, the results obtained after training and testing the classifiers with both
magnetic field data and Wi-Fi data are depicted (collected from the embedded test bed developed
presently). Observe in the same figure that the RF classifier has a very good accuracy of around
&gt; 95%. Because we are working with a fixed number of samples, the test size increases as the
size of the training data set decreases. Our accuracy results immediately show that we are able
to predict with high appreciable accuracy, and more importantly (perhaps remarkably) with
only few samples.</p>
      <p>The following example is for a quick grasp:
• At 95% test sample size, the number of samples used for training is 2730 (which amounts
to the leftover 5%).
• All of these 2730 samples are uniformly distributed across 91 classes, i.e., 30 samples per
each class.</p>
      <p>• Our prediction accuracy (with only 5% of training data set) is &gt; 95%.</p>
      <sec id="sec-5-1">
        <title>The prediction accuracy was calculated using the formula,</title>
        <p>∑︀ (︀ Prediction(m) == Original label(m))︀
 = =1</p>
        <p>Total no. of samples used for testing
where, m is a element in a array.</p>
        <p>Motivated by the outdoor results, we considered a small number of samples at each cell in
an indoor environment at two diferent altitudes. The results shown in Fig. 9 are the result of
applying ML classifiers to two separate data sets collected at two diferent altitudes within the
room. It is clear that all of the classifiers we used performs very well.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions and Future scope</title>
      <p>In this paper, we presented a novel approach for estimating the user’s position indoors with high
accuracy (around 98%). The motivation for using statistical approaches is that deep
learningbased models are computationally expensive and require a large amount of memory for real-time
deployment. We created a machine learning-based multi-label and multi-output strategy for
indoor localization and demonstrated it using our own embedded test bed. However, the
motivation for this work is to predict the position of the user indoors as well. In our experiment,
we used industry standard sensors on our test bed to evaluate the performance of ML classifiers
with very good resolution (in terms of accuracy) for indoor localization. Changes in the size of
the training data set were also used to evaluate performance.</p>
      <p>We achieved best accuracy of around 98.6% and 97.6% with RF and XGB classifiers,
respectively, by training the models with 5% of the original data set. Furthermore, we evaluated the
efectiveness of our approach for interior location detection at various altitudes. Our method is
simple to implement, and the time required for data collection and prediction is minimal. We
mapped a small area within a large building, but given the promising accuracy, this approach
can be scaled up to larger infrastructures such as large ofice buildings and shopping malls,
among other things.</p>
      <p>Note that this paper does not focus on: materials, configurations of material, and other
properties of buildings cause our observations. Indeed, if we can understand the elements
playing a role in our observations – such as before – then we can make some predictions on the
possible magnetic field variations that might occur in future, in the same buildings worked inside/
others. Such predictions would allow for improvements in evaluation of scientific grounding
in localization techniques. To begin with, for studying possible links between variables, one
can investigate using a building information model to predict the magnetic fields inside it. This
approach could help in associating magnetic field variations with specific building elements
for instance: steel beams, heating and cooling systems such as Air coolers. In parallel, one can
extend the study of the performance of any machine learning model, via conducting the same
experiments in diferent environments in large areas like: a multi-story building constructed by
brick and concrete, a warehouse/factory building, a high-rise building made of steel. We would
like to explore the above avenues in future, in the light of a reasonable thinking that, there is
no guarantee that the results shown in this paper would hold the same for every building, with
may be similar structure etc.
[20] H. J. Bae, L. Choi, Large-scale indoor positioning using geomagnetic field with deep neural
networks, in: ICC 2019 - 2019 IEEE International Conference on Communications (ICC),
2019, pp. 1–6.
[21] G. M. Mendoza-Silva, J. Torres-Sospedra, F. Potortì, A. Moreira, S. Knauth, R. Berkvens,
J. Huerta, Beyond euclidean distance for error measurement in pedestrian indoor location,
IEEE Transactions on Instrumentation and Measurement 70 (2021) 1–11.
[22] C. Feng, W. S. A. Au, S. Valaee, Z. Tan, Received-signal-strength-based indoor positioning
using compressive sensing, IEEE Transactions on Mobile Computing 11 (2012) 1983–1993.
[23] K. Cengiz, Comprehensive analysis on least-squares lateration for indoor positioning
systems, IEEE Internet of Things Journal 8 (2021) 2842–2856.
[24] J. Palacios, G. Bielsa, P. Casari, J. Widmer, Single- and multiple-access point indoor
localization for millimeter-wave networks, IEEE Transactions on Wireless Communications 18
(2019) 1927–1942.
[25] R. Shirai, M. Hashimoto, Dc magnetic field based 3d localization with single anchor coil,</p>
      <p>IEEE Sensors Journal 20 (2020) 3902–3913.
[26] D. Hanley, A. S. D. d. Oliveira, X. Zhang, D. H. Kim, Y. Wei, T. Bretl, The impact of height
on indoor positioning with magnetic fields, IEEE Transactions on Instrumentation and
Measurement 70 (2021) 1–19.
[27] M. T. Hoang, B. Yuen, X. Dong, T. Lu, R. Westendorp, K. Reddy, Recurrent neural networks
for accurate rssi indoor localization, IEEE Internet of Things Journal 6 (2019) 10639–10651.
[28] S. Knauth, M. Storz, H. Dastageeri, A. Koukofikis, N. A. Mähser-Hipp, Fingerprint calibrated
centroid and scalar product correlation rssi positioning in large environments, in: 2015
International Conference on Indoor Positioning and Indoor Navigation (IPIN), 2015, pp.
1–6.
[29] M. Kwak, C. Hamm, S. Park, T. T. Kwon, Magnetic field based indoor localization system:
A crowdsourcing approach, in: 2019 International Conference on Indoor Positioning and
Indoor Navigation (IPIN), 2019, pp. 1–8.
[30] I. Ashraf, S. Hur, Y. Park, Enhancing performance of magnetic field based indoor localization
using magnetic patterns from multiple smartphones, Sensors 20 (2020).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>X.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Pandey</surname>
          </string-name>
          ,
          <article-title>Csi-based fingerprinting for indoor localization: A deep learning approach</article-title>
          ,
          <source>IEEE Transactions on Vehicular Technology</source>
          <volume>66</volume>
          (
          <year>2017</year>
          )
          <fpage>763</fpage>
          -
          <lpage>776</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ma</surname>
          </string-name>
          , C. Tian,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Jiang</surname>
          </string-name>
          ,
          <article-title>A multitag cooperative localization algorithm based on weighted multidimensional scaling for passive uhf rfid</article-title>
          ,
          <source>IEEE Internet of Things Journal</source>
          <volume>6</volume>
          (
          <year>2019</year>
          )
          <fpage>6548</fpage>
          -
          <lpage>6555</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>P.</given-names>
            <surname>Sthapit</surname>
          </string-name>
          , H.-S. Gang, J.-Y. Pyun,
          <article-title>Bluetooth based indoor positioning using machine learning algorithms</article-title>
          , in: 2018 IEEE International Conference on Consumer Electronics - Asia
          <string-name>
            <surname>(ICCE-Asia</surname>
            <given-names>)</given-names>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>206</fpage>
          -
          <lpage>212</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Akiyama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sugimoto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hashizume</surname>
          </string-name>
          ,
          <article-title>Time-of-arrival-based smartphone localization using visible light communication</article-title>
          ,
          <source>in: 2017 International Conference on Indoor Positioning and Indoor Navigation (IPIN)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Hilal</surname>
          </string-name>
          , I. Arai,
          <string-name>
            <given-names>S.</given-names>
            <surname>El-Tawab</surname>
          </string-name>
          ,
          <article-title>Dataloc+: A data augmentation technique for machine learning in room-level indoor localization</article-title>
          ,
          <source>in: 2021 IEEE Wireless Communications and Networking Conference (WCNC)</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>B.</given-names>
            <surname>Siebler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sand</surname>
          </string-name>
          , U. D. Hanebeck,
          <article-title>Localization with magnetic field distortions and simultaneous magnetometer calibration</article-title>
          ,
          <source>IEEE Sensors Journal</source>
          <volume>21</volume>
          (
          <year>2021</year>
          )
          <fpage>3388</fpage>
          -
          <lpage>3397</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>H.</given-names>
            <surname>Zou</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.-L. Chen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Xie</surname>
            ,
            <given-names>C. J.</given-names>
          </string-name>
          <string-name>
            <surname>Spanos</surname>
          </string-name>
          ,
          <article-title>Adversarial learningenabled automatic wifi indoor radio map construction and adaptation with mobile robot</article-title>
          ,
          <source>IEEE Internet of Things Journal</source>
          <volume>7</volume>
          (
          <year>2020</year>
          )
          <fpage>6946</fpage>
          -
          <lpage>6954</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Torres-Sospedra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Montoliu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Martínez-Usó</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Avariento</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. J.</given-names>
            <surname>Arnau</surname>
          </string-name>
          , M. BeneditoBordonau, J. Huerta,
          <article-title>Ujiindoorloc: A new multi-building and multi-floor database for wlan fingerprint-based indoor localization problems</article-title>
          , in: 2014
          <source>International Conference on Indoor Positioning and Indoor Navigation (IPIN)</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>261</fpage>
          -
          <lpage>270</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T.</given-names>
            <surname>Koike-Akino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pajovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. V.</given-names>
            <surname>Orlik</surname>
          </string-name>
          ,
          <article-title>Fingerprinting-based indoor localization with commercial mmwave wifi: A deep learning approach</article-title>
          ,
          <source>IEEE Access 8</source>
          (
          <year>2020</year>
          )
          <fpage>84879</fpage>
          -
          <lpage>84892</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , G. Han,
          <string-name>
            <given-names>N.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Shu</surname>
          </string-name>
          ,
          <article-title>Path-loss-based fingerprint localization approach for location-based services in indoor environments</article-title>
          ,
          <source>IEEE Access 5</source>
          (
          <year>2017</year>
          )
          <fpage>13756</fpage>
          -
          <lpage>13769</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H. K.</given-names>
            <surname>Rath</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Timmadasari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Panigrahi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Simha</surname>
          </string-name>
          ,
          <article-title>Realistic indoor path loss modeling for regular wifi operations in india</article-title>
          ,
          <source>in: 2017 Twenty-third National Conference on Communications (NCC)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>H.-S.</given-names>
            <surname>Kim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Seo</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.-R. Baek</surname>
          </string-name>
          ,
          <article-title>Indoor positioning system using magnetic field map navigation and an encoder system</article-title>
          ,
          <source>Sensors</source>
          <volume>17</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>D.</given-names>
            <surname>Hanley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. B.</given-names>
            <surname>Faustino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. D.</given-names>
            <surname>Zelman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. A.</given-names>
            <surname>Degenhardt</surname>
          </string-name>
          , T. Bretl,
          <article-title>Magpie: A dataset for indoor positioning with magnetic anomalies</article-title>
          ,
          <source>in: 2017 International Conference on Indoor Positioning and Indoor Navigation</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zeng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. H.</given-names>
            <surname>Pathak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Mohapatra</surname>
          </string-name>
          ,
          <article-title>Analyzing shopper's behavior through wifi signals</article-title>
          ,
          <source>in: Proceedings of the 2nd Workshop on Workshop on Physical Analytics, Association for Computing Machinery</source>
          ,
          <year>2015</year>
          , p.
          <fpage>13</fpage>
          -
          <lpage>18</lpage>
          . doi:
          <volume>10</volume>
          .1145/2753497.2753508.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>F.</given-names>
            <surname>Alam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Faulkner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Parr</surname>
          </string-name>
          ,
          <article-title>Device-free localization: A review of non-rf techniques for unobtrusive indoor positioning</article-title>
          ,
          <source>IEEE Internet of Things Journal</source>
          <volume>8</volume>
          (
          <year>2021</year>
          )
          <fpage>4228</fpage>
          -
          <lpage>4249</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>A.</given-names>
            <surname>Gadhgadhi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Hachaichi</surname>
          </string-name>
          ,
          <string-name>
            <surname>H. Zairi,</surname>
          </string-name>
          <article-title>A machine learning based indoor localization</article-title>
          ,
          <source>in: 2020 4th International Conference on Advanced Systems and Emergent Technologies (ICASET)</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>33</fpage>
          -
          <lpage>38</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>N.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ahn</surname>
          </string-name>
          , D. Han,
          <article-title>Amid: Accurate magnetic indoor localization using deep learning</article-title>
          ,
          <source>Sensors</source>
          <volume>18</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>A.</given-names>
            <surname>Poulose</surname>
          </string-name>
          , D. Han,
          <article-title>Hybrid deep learning model based indoor positioning using wi-fi rssi heat maps for autonomous applications</article-title>
          ,
          <source>Electronics</source>
          <volume>10</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>R.</given-names>
            <surname>Ayyalasomayajula</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Arun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sharma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. R.</given-names>
            <surname>Sethi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Vasisht</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Bharadia</surname>
          </string-name>
          ,
          <source>Deep Learning Based Wireless Localization for Indoor Navigation</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>