<!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>Smartphone Sensors Based Indoor Localization Using Deep Neural Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Imran Ashraf</string-name>
          <email>ashrafimran@live.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Soojung Hur</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yongwan Park</string-name>
          <email>ywpark@yu.ac.kr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information &amp; Communication Engineering, Yeungnam University</institution>
          ,
          <addr-line>38541</addr-line>
          ,
          <country>Republic of Korea</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This research presents the use of deep learning based ensemble classi er to perform indoor localization with heterogeneous devices. Features extracted from magnetic data of Galaxy S8 are fed into neural networks (NNs) for training. The experiments are performed with S8 and G6 smartphones to nd out the impact of device dependence on localization accuracy. Results demonstrate that NNs can play a potential role for precise indoor localization. The proposed approach is able to achieve a localization accuracy of 2.5 m at 50% on two di erent devices. Mean error for S8 and G6 is 2.61 m and 2.95 m, respectively.</p>
      </abstract>
      <kwd-group>
        <kwd>Indoor localization works</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        strength varies from 25 Tesla to 65 Tesla over the globe. On the other hand, man made
construction obstruct the magnetic eld and alter it to cause anomalies. Such magnetic anomalies
are observed to exhibit unique behavior and used as ngerprint in many research works [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ].
Despite that the techniques which utilize magnetic eld ngerprints have two major limitations.
First is the change in magnetic behavior due to heterogeneity of the smartphones. Smartphones
use the magnetometer built by various companies which lead to di erent magnetic eld intensity
even for the same place [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. This limits the wide applicability of magnetic eld based localization
systems as various smartphones show di erent localization error with the same approach. Second
limitation is the similarity of magnetic eld intensity at multiple locations, especially when the
localization space is large. We aim to solve these problems using deep neural networks (DNN).
      </p>
      <p>Deep learning has recently been utilized to solve many problems and indoor localization is
no exception. DNN and convolution neural networks (CNN) have been used for indoor scene
recognition, object detection, etc. We make the use of ensemble learning wherein more than
one DNN are trained and each DNN serves as a location classi er. The prediction from each
of these classi ers is then employed to nd the nal location of the user. Deep learning is a
data intensive technique and requires a large amount of data for training. We have collected
thousands of magnetic samples for this purpose. The key contribution of this research is the
proposal of a smartphone sensors base indoor localization approach which works with multiple
neural networks (NN) to predict user's current location. The proposed approach is tested with
heterogeneous devices including Galaxy S8 and LG G6 to evaluate the localization accuracy.</p>
      <p>The rest of the paper is organized in the following manner. Section 2 overviews few works
related to this research. Section 3 describes the proposed approach while Section 4 details the
experiment setup and analyzes the results. Finally, conclusion is given in Section 5.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        The application of magnetic eld data for indoor localization has been investigated by many
research works . Such research include the analysis of properties of magnetic eld data that can be
used for localization, as well as, the impact of various devices usage, and the orientations of these
devices [
        <xref ref-type="bibr" rid="ref5 ref6 ref7 ref8">5-8</xref>
        ]. Li et al., investigated the use of smartphone magnetometer based ngerprinting
approach to perform indoor localization in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The localization error is low if more elements of
magnetic eld are used. However, the error may become higher up to 20 m when the localization
area is large and complex. Zhang et al., reduces the survey time of building the ngerprint
database with crowd sourcing approach in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Later, a revised Monte Carlo technique is used to
locate a pedestrian indoor. The proposed approach is able to converge to a 5 m area by using 30
sec data. The research suggests the use of assistive technologies to reduce the localization error.
      </p>
      <p>
        An indoor localization system is presented in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] which combines Wi-Fi signal with magnetic
eld data to build the ngerprint database. The search space restriction using Wi-Fi access points
help in reducing the localization error to 4.5 m which is 16.6 m with magnetic eld data. Recently
the use of deep learning is reported to perform localization with smartphone sensors in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. The
research uses smartphone camera, motion sensors, compass, magnetometer and Wi-Fi to do the
localization. CNN is used to identify indoor scene which helps to narrow down the search space
in magnetic database. The reported localization error is 1.32 at 95%. Similary the research [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]
proposes a multi-story localization approach based on smartphone sensors and makes the use of
deep learning. The CNN based scene recognition is used to identify a speci c oor which increases
the localization accuracy as well. The reported localization error is 1.04 m at 50 percent.
      </p>
      <p>The above mentioned research works are limited by two factors in essence. First problem is
the use of Wi-Fi signals which are vulnerable to dynamic factors. Secondly the impact of device
heterogeneity is not studied very well. Additionally the use of smartphone camera consumes
the battery very fast and is not an e cient solution. It is noteworthy to point out that deep
learning has been utilized on smartphone camera images alone. We aim to use deep learning on
the magnetic eld data to perform indoor localization.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Materials and Methods</title>
      <p>This section provides the details of the proposed approach. The rst task is to
features which are fed into the NNs.
nd suitable
3.1</p>
      <p>Features Selection
The major limitation of using the magnetic eld is the device dependence. The intensity of
collected magnetic data may be di erent depending on the sensitivity of the installed magnetometer
in various smartphones. Another shortcoming of magnetic data is its low dimensionality. We can
use only magnetic x, y, and z data as a ngerprint. These values may be very similar at multiple
locations, especially in large space. So, contrary to using the magnetic eld data, we aim to work
with important features of this data.</p>
      <p>We initially shortlisted a total of 18 features including 'minimum', 'maximum', 'mean',
'trimmed mean', 'median', 'root mean square', 'standard deviation', 'interquartile', 'percentile
(1, 50, 75, 99)', 'mean absolute deviation', 'coe cient of variance', 'kurtosis ', 'Shanon's
entropy ', and 'skewness ' for this purpose. Features including 'coe cient of variance', 'kurtosis ',
'Shanon's entropy ', and 'skewness ' are dropped due to their little correlation to the classi cation
label. The correlation of the features is shown in Figure 1.
The architecture of the proposed approach is shown in Figure 2. The features extracted from
the magnetic data are standardized and fed into neural networks. We train three di erent NN
to make the ensemble.</p>
      <p>Every NN has di erent number of layers, as well as, the containing neurons. Similarly, the
internal structure of fully connected layers is di erent. The structure of NNs is shown in Figure
3. During the localization phase, the features extracted from user collected magnetic data are
used by trained NNs to predict user current location. For this purpose, we use three consecutive
frames of 2 sec each which are considered as T1, T2, and T3. For T1, the predictions from three
NNs are taken to form the location candidates (Lc).</p>
      <p>Lc = 9(PNN1T 1 [ PNN2T 1 ) [ (PNN1T 1 [ PNN3T 1 ) [ (PNN2T 1 [ PNN3T 1 )
(1)
where P shows the prediction made by NN and 9 shows that unique predictions are considered
alone. We take top 10 predicted locations from each NN to formulate Lc. NNs predictions at T2
and T3 help to re ne Lc. So, if the predictions for T2 are in the area as shown in Figure 4, they
are added in Lc for T3, else, they are discarded. The encircled area is estimated user traveled
distance at a medium speed.</p>
      <p>Algorithm 1 Find user location
1: Lc</p>
      <p>f indLocCandidates(PNN1T1 ; PNN2T1 ; PNN3T1 )
2: for T 2 to 3 do
3: Lc ref ineLocCandidates(Lc; PNN1T ; PNN2T ; PNN3T );
4: (xT ; yT ) calApproxP os(SlT ; T );
5: end for</p>
      <p>calCenteroid(Lc);</p>
      <p>
        With each T , Lc are updated as user moves to another location. We use accelerometer and
gyroscope data for this purpose. Step detection is performed using the algorithm proposed in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
while step length estimation is done wSigtdhnn
      </p>
      <p>
        Wemigobdeerlg model [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]:
      </p>
      <p>p
Sl = k 4 amax
amin
where amax, and amin shows the maximum and minimum acceleration.</p>
      <p>Softmax</p>
      <p>Softmax</p>
      <p>Loss
Val. loss
Accuracy
Val. accuracy
Loss
Val. loss
Accuracy
Val. accuracy</p>
      <p>Loss
Val. loss
Accuracy
Val. accuracy
(2)
(3)
(4)
ReLU1</p>
      <p>ReLU2</p>
      <p>ReLU3 AdReaLUm4 nnReLUm5odReeLUl6</p>
      <p>ReLU7</p>
      <p>ReLU8</p>
      <p>ReLU9
F.connected1 F.connected2 F.connected3 F.connected4 F.connected5 F.connected6 F.connected7 F.connected8 F.connected9 F.connected10
regularization regularization regularization regularization regularization regularization regularization regularization regularization
xT and yT are calculated using SlT and heading estimation</p>
      <p>T as follows:
xi = xi 1 + Sli 1
yi = yi 1 + Sli 1
cos( i 1)
sin( i 1)</p>
      <p>The same process is repeated for T2 and T3. During this process, the predicted locations
converge to a small area. We calculate the centroid of these re ned locations which represent the
user's predicted location Lp.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Experiment and Results</title>
      <p>The experiments are conducted using Samsung Galaxy S8 (SM-G950N), and LG G6
(LGMG600L) devices. The features for training are extracted using Galaxy S8 collected data, while
testing is done with two smartphones. The path used for the experiments is shown in Figure
5. The area of experiment building is 92 36 m2. Experiments are performed with people of
di erent heights to evaluate the proposed approach.</p>
      <p>Estimated locations at T1
Estimated locations at T2</p>
      <p>Results are shown in Figure 6. Results demonstrate that the proposed approach can locate a
person within 2.5 m, irrespective of the used device. Maximum errors are 13.33 m and 13.57 m
for S8 and G6, respectively. However, the cumulative probability of maximum error is only 0.02.
The mean error at 75% is 3.7 m and 4.1 m for S8 and G6. Even though the training is performed
with S8 data, the localization errors are very similar for two smartphones. The underlying reason
is the usage of features extracted from magnetic data than the magnetic data themselves. It also
shows the usefulness of deep learning to assist in reliable indoor localization. We conducted
additional experiments with less features also excluding 'interquartile', 'standard deviation', and
'mean absolute deviation'. Removing these features degrades the localization performance.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>This research aims at using deep learning based ensemble classi er to solve indoor localization
with heterogeneous devices. Three NNs are trained on magnetic data features from S8
smartphone. The experiments are performed with S8 and G6 smartphones. Results demonstrate that
the use of features extracted from magnetic data are very fruitful to train NN. The localization
accuracy is 2.5 m at 50% on two di erent devices. Mean error for S8 and G6 is 2.61 m and
2.95 m, respectively. Data collection is a laborious task which we intend to overcome with crowd
sourcing data collection in future. How the larger indoor area may a ect the performance of the
proposed approach is an intended future work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bruno</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Delmastro</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Design and analysis of a bluetooth-based indoor localization system</article-title>
          .
          <source>In: IFIP International Conference on Personal Wireless Communications</source>
          . pp.
          <volume>711</volume>
          {
          <fpage>725</fpage>
          . Springer (
          <year>2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bahl</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Padmanabhan</surname>
            ,
            <given-names>V.N.: RADAR</given-names>
          </string-name>
          :
          <article-title>An in-building RF-based user location and tracking system</article-title>
          .
          <source>In: INFOCOM 2000. Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies. Proceedings. IEEE</source>
          . pp.
          <volume>775</volume>
          {
          <fpage>784</fpage>
          .
          <string-name>
            <surname>Ieee</surname>
          </string-name>
          (
          <year>2000</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Shu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shen</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Magicol: Indoor localization using pervasive magnetic eld and opportunistic WiFi sensing</article-title>
          .
          <source>IEEE Journal on Selected Areas in Communications</source>
          .
          <volume>33</volume>
          ,
          <issue>1443</issue>
          {
          <fpage>1457</fpage>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ashraf</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hur</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Park</surname>
          </string-name>
          , Y.:
          <article-title>mPILOT-magnetic eld strength based pedestrian indoor localization</article-title>
          .
          <source>Sensors</source>
          (Basel, Switzerland).
          <volume>18</volume>
          , (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yin</surname>
          </string-name>
          , Y., Cheng, L.,
          <string-name>
            <surname>Zimmermann</surname>
          </string-name>
          , R.:
          <article-title>Fusion of magnetic and visual sensors for indoor localization: Infrastructure-free and more e ective</article-title>
          .
          <source>IEEE Transactions on Multimedia</source>
          .
          <volume>19</volume>
          ,
          <issue>874</issue>
          {
          <fpage>888</fpage>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gallagher</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rizos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dempster</surname>
            ,
            <given-names>A.G.</given-names>
          </string-name>
          :
          <article-title>Using geomagnetic eld for indoor positioning</article-title>
          .
          <source>Journal of Applied Geodesy</source>
          .
          <volume>7</volume>
          ,
          <issue>299</issue>
          {
          <fpage>308</fpage>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ashraf</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hur</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Park</surname>
          </string-name>
          , Y.:
          <article-title>MDIRECT-Magnetic eld strength and peDestrIan dead RECkoning based indoor localizaTion</article-title>
          .
          <source>In: Proceedings of the 2018 International Conference on Indoor Positioning and Indoor Navigation (IPIN)</source>
          , Nantes, France. pp.
          <volume>24</volume>
          {
          <issue>27</issue>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ashraf</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hur</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Park</surname>
          </string-name>
          , Y.:
          <article-title>MagIO: Magnetic Field Strength Based Indoor- Outdoor Detection with a Commercial Smartphone</article-title>
          .
          <source>Micromachines</source>
          .
          <volume>9</volume>
          (
          <issue>10</issue>
          ),
          <volume>534</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gallagher</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dempster</surname>
            ,
            <given-names>A.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rizos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>How feasible is the use of magnetic eld alone for indoor positioning? In: Indoor positioning and indoor navigation (ipin</article-title>
          ),
          <source>2012 international conference on</source>
          . pp.
          <volume>1</volume>
          {
          <issue>9</issue>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Subbu</surname>
            ,
            <given-names>K.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luo</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>GROPING: Geomagnetism and crowdsensing powered indoor navigation</article-title>
          .
          <source>IEEE Transactions on Mobile Computing</source>
          .
          <volume>14</volume>
          ,
          <issue>387</issue>
          {
          <fpage>400</fpage>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhuang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , Zhang,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Niu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            ,
            <surname>El-Sheimy</surname>
          </string-name>
          , N.:
          <article-title>WiFi-aided magnetic matching for indoor navigation with consumer portable devices</article-title>
          .
          <source>Micromachines</source>
          .
          <volume>6</volume>
          ,
          <issue>747</issue>
          {
          <fpage>764</fpage>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cao</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Scene recognition for indoor localization using a multi-sensor fusion approach</article-title>
          .
          <source>Sensors</source>
          .
          <volume>17</volume>
          ,
          <issue>2847</issue>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Ashraf</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hur</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Park</surname>
          </string-name>
          , Y.:
          <article-title>Application of Deep Convolutional Neural Networks and Smartphone Sensors in Indoor Localization</article-title>
          .
          <source>Sensors</source>
          .
          <volume>9</volume>
          (
          <issue>11</issue>
          ),
          <volume>2337</volume>
          (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Weinberg</surname>
          </string-name>
          , H.:
          <article-title>Using the ADXL202 in pedometer and personal navigation applications</article-title>
          .
          <source>Analog Devices AN-602 application note. 2</source>
          ,
          <issue>1</issue>
          {
          <issue>6</issue>
          (
          <year>2002</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>