Conditional Random Field-Based Offline Map Matching for Indoor Environments

Similar documents
There is usually quite a big difference

A Genetic Algorithm for the Number Partitioning Problem

Research on PF-SLAM Indoor Pedestrian Localization Algorithm Based on Feature Point Map

Geomagnetism-Aided Indoor Wi-Fi Radio-Map Construction via Smartphone Crowdsourcing

DARGS: Dynamic AR Guiding System for Indoor Environments

Method of Semantic Web Service Discovery and Automatic Composition

On the Improvement of Weighted Page Content Rank

Loose and Tight GNSS/INS Integrations: Comparison of Performance Assessed in Real Urban Scenarios

15-451/651: Design & Analysis of Algorithms November 20, 2018 Lecture #23: Closest Pairs last changed: November 13, 2018

THE FLUX DISTRIBUTION FROM A 1.25M 2 TARGET ALIGNED HELIOSTAT: COMPARISON OF RAY TRACING AND EXPERIMENTAL RESULTS

A Consistent Design Methodology to Meet SDR Challenges

7.3.3 A Language With Nested Procedure Declarations

Localization and Map Building

Customized Content Dissemination in Peer-to-Peer Publish/Subscribe

Towards Control of Evolutionary Games on Networks

Lisbon Mobility Simulations for Performance Evaluation of Mobile Networks

Computer Science 312 Fall Prelim 2 SOLUTIONS April 18, 2006

Scheduling complex streaming applications on the Cell processor. LIP Research Report RR-LIP

Fuzzy Systems. Fuzzy Systems in Knowledge Engineering. Chapter 4. Christian Jacob. 4. Fuzzy Systems. Fuzzy Systems in Knowledge Engineering

Accelerometer Gesture Recognition

UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE

15-451/651: Design & Analysis of Algorithms April 18, 2016 Lecture #25 Closest Pairs last changed: April 18, 2016

sort items in each transaction in the same order in NL (d) B E B C B C E D C E A (c) 2nd scan B C E A D D Node-Link NL

A Low-Cost Approach to Automatically Obtain Accurate 3D Models of Woody Crops

Enhancement in Weighted PageRank Algorithm Using VOL

Construction Progress Management and Interior Work Analysis Using Kinect 3D Image Sensors

A Spatial-Temporal-Semantic Neural Network Algorithm for Location Prediction on Moving Objects

On Secure Distributed Data Storage Under Repair Dynamics

Exploration of Several Page Rank Algorithms for Link Analysis

About coding style Spring February 9, 2004

A Comparative Study of Page Ranking Algorithms for Information Retrieval

ASKNet: Creating and Evaluating Large Scale Integrated Semantic Networks

Building Reliable 2D Maps from 3D Features

Optimization of Test/Diagnosis/Rework Location(s) and Characteristics in Electronic Systems Assembly Using Real-Coded Genetic Algorithms

Global Optimization of Integrated Transformers for High Frequency Microwave Circuits Using a Gaussian Process Based Surrogate Model

Supplementary Notes on Concurrent ML

Reviewing High-Radix Signed-Digit Adders

Global System Setup. Front Desk

5. Tests and results Scan Matching Optimization Parameters Influence

Leveraging Social Networks For Effective Spam Filtering

ET 438B Sequential Control and Data Acquisition Laboratory 9 Analog Input and Output Using PLCs

Humanoid Robotics. Monte Carlo Localization. Maren Bennewitz

Improved Jitter Elimination and Topology Correction Method for the Split Line of Narrow and Long Patches

Data Aggregation Gateway Framework for CoAP Group Communications

Basic Simulation Environment for Highly Customized Connected and Autonomous Vehicle Kinematic Scenarios

Extrusion Approach Based on Non-Overlapping Footprints (EABNOF) for the Construction of Geometric Models and Topologies in 3D Cadasters

Robust Object Tracking Based on Motion Consistency

A New Framework of Human Interaction Recognition Based on Multiple Stage Probability Fusion

A Bayes Learning-based Anomaly Detection Approach in Large-scale Networks. Wei-song HE a*

On Secure Distributed Data Storage Under Repair Dynamics

Vector Spatial Big Data Storage and Optimized Query Based on the Multi-Level Hilbert Grid Index in HBase

Localization, Where am I?

Statistical Techniques in Robotics (STR, S15) Lecture#05 (Monday, January 26) Lecturer: Byron Boots

Optimisation of Statistical Feature Extraction Algorithms

Communication Link Requirements. Link Design. subsystem model descriptions. Algorithm Design. 3 Architecture Design. Circuit.

COMPARISION OF AERIAL IMAGERY AND SATELLITE IMAGERY FOR AUTONOMOUS VEHICLE PATH PLANNING

Constant-Time Approximation Algorithms for the Optimum Branching Problem on Sparse Graphs

Static Analysis for Fast and Accurate Design Space Exploration of Caches

Formal Reasoning about Communication Systems II

A Comparison of Alternative Distributed Dynamic Cluster Formation Techniques for Industrial Wireless Sensor Networks

Chapter 2 Basic Structure of High-Dimensional Spaces

A SURVEY OF WEB MINING ALGORITHMS

Implementing Routing Policy

Indexing for Moving Objects in Multi-Floor Indoor Spaces That Supports Complex Semantic Queries

COP-5555 PROGRAMMING LANGUAGEPRINCIPLES NOTES ON RPAL

3. Sequential Logic 1

Self-Organization and Self-Coordination in Welding Automation with Collaborating Teams of Industrial Robots

Lecture 5: Exact inference. Queries. Complexity of inference. Queries (continued) Bayesian networks can answer questions about the underlying

Efficient Acquisition of Human Existence Priors from Motion Trajectories

Version 4, 12 October 2004 Project handed out on 12 October. Complete Java implementation due on 2 November.

Author's personal copy ARTICLE IN PRESS. Information Systems 35 (2010) Contents lists available at ScienceDirect. Information Systems

Data Center Network Topologies using Optical Packet Switches

Institute of Electronics, Chinese Academy of Sciences, Beijing , China * Correspondence: Tel.:

Web Structure Mining: Exploring Hyperlinks and Algorithms for Information Retrieval

UJIINDOORLOC - A NEW MULTI-BUILDING AND MULTI- FLOOR DATABASE FOR WLAN FINGERPRINT-BASED INDOOR LOCALIZATION PROBLEMS

Creation of an SWMM Toolkit for Its Application in Urban Drainage Networks Optimization

HIDDEN MARKOV MODELS AND SEQUENCE ALIGNMENT

A Dynamic Graph Model for Analyzing Streaming News Documents

Tariff in EUR for postal, financial intermediation, and other services in domestic express service. 1. Delivery of advice of receipt of: 1.1.

The Traffic Adaptive Data Dissemination (TrAD) Protocol for both Urban and Highway Scenarios

Where s the Boss? : Monte Carlo Localization for an Autonomous Ground Vehicle using an Aerial Lidar Map

A Design for an Internet Router with a Digital Optical Data Plane

1 Announcements. 2 Scan Implementation Recap. Recitation 4 Scan, Reduction, MapCollectReduce

Artificial Intelligence for Robotics: A Brief Summary

Zomerlust Systems Design (CK1997/001363/23) trading as ZSD

A Linear Logic Representation for BPEL Process Protocol *

Formations in flow fields

Hazardous Object Detection by Using Kinect Sensor in a Handle-Type Electric Wheelchair

Increasing the Determinism in Real-Time Operating Systems for ERC32 Architecture

A Visualization Tool to Improve the Performance of a Classifier Based on Hidden Markov Models

An example DFA: reaching definitions

Fully Persistent Graphs Which One To Choose?

Hand Tracking and Gesture Recognition Using Lensless Smart Sensors

Thick separators. Luc Jaulin and Benoît Desrochers. Lab-STICC, ENSTA Bretagne, Brest, France

REINFORCEMENT LEARNING: MDP APPLIED TO AUTONOMOUS NAVIGATION

Monitoring Quality-of-Life Parameters in Wearable Environments

Topological Mapping. Discrete Bayes Filter

Article. Zeying Lan 1, * ID and Yang Liu 2

Performance of Integrated Wired (Token Ring) Network and Wireless (PRMA) Network

Eye Detection by Haar wavelets and cascaded Support Vector Machine

Transcription:

sensors Article Conditional Rom Field-Based Offle Map Matchg for Indoor Environments Safaa Bataeh 1, *, Alfonso Bahillo 1, Luis Enrique Díez 1, Enrique Onieva 1,2 Ikram Bataeh 3 1 Faculty Engeerg, University Deus, Av. Universidades, 24, Bilbao 487, Spa; alfonso.bahillo@deus.es (A.B.); luis.enrique.diez@deus.es (L.E.D.); enrique.onieva@deus.es (E.O.) 2 DeusTech-Fundación Deus, Fundación Deus, Av. Universidades, 24, Bilbao 487, Spa 3 Department Architecture, Jordan University Science Technology, Irbid 2211, Jordan; ikrambataeh@yahoo.com * Correspondence: safaa.bataeh@deus.es; Tel.: +34-72-27-46 Academic Edir: Vitrio M. N. Passaro Received: 1 June 16; Accepted: 12 August 16; Published: 16 August 16 Abstract: In this paper, we present an fle map matchg technique designed for door localization systems based on conditional rom fields (CRF). The proposed algorithm can refe results existg door localization systems match m map, usg loose couplg between existg localization system proposed map matchg technique. The purpose this research is vestigate efficiency usg CRF technique fle map matchg problems for scenarios para. The algorithm was applied several real simulated trajecries lengths. The results were n refed matched map usg CRF algorithm. Keywords: fle map matchg; door positiong; door localization; navigation systems; conditional rom fields; map modellg; ertial sensors; mobility pedestrians 1. Introduction The importance door navigation arises from necessity context-aware services work side buildgs, given people spend most ir time doors [1]. Although outdoor navigation appeared prior door navigation, former techniques cannot be applied directly door environment. This is firstly associated fact outdoor navigation systems mostly depend on Global Navigation Satellite Systems (GNSS) function poorly doors due multipath attenuation losses, secondly because pedestrian door movement is limited by buildg structure details are tally from those found on road maps [2]. As door environments possess spatial constrats can be used rule out certa correct localization results, door maps have become an additional data source which improve accuracy reliability door localization systems. For stance, it is unreasonable an estimated walkg trajecry passes through an area occupied by an obstacle such as a wall. The process utilizg map formation localization processes objects or persons is known as map matchg. Map matchg can be used fd correspondence between a sequence pots representg walkg trajecry obtaed via a localization system a given map. In outdoor transportation systems, map matchg techniques vary from simple geometric search methods advanced complex probabilistic models [3]. Similarly, existg door map matchg techniques can be geometric, pological, or probabilistic. The differences between door outdoor map matchg problems lie complex structure door maps compared road maps, as well as romness pedestrian behavior compared vehicles [2]. Sensors 16, 16, 132; doi:1.339/s168132 www.mdpi.com/journal/sensors

Sensors 16, 16, 132 2 16 Indoor map matchg techniques use advanced probabilistic models are usually based on recursive Bayesian models such as Hidden Marcov Models (HMMs) Particle Filters (PFs) [4 7]. However, recursive Bayesian models volve computg jot probability distribution between all states observation variables, which makes m computationally expensive. The Conditional Rom Fields (CRFs), a probabilistic model is widely employed speech recognition, can also be used map matchg [8,9]. It is a sequence-labellg algorithm employs observations context formation as features evaluate conditional probability state transitions. CRF is based on calculatg conditional probability which makes it computationally more efficient than Bayesian models, besides beg more flexible hlg arbitrary dependencies between observations [1]. However, CRF requires a backward phase order evaluate path alternatives, which delays process makes it less suitable for real-time applications. On or h, fle (Offle localization systems: In localization systems, expression fle has been used literature two meangs: (1) those localization systems are not real time, also known as global systems, which measurements are taken for whole walk an fle algorithm is n used estimate track; (2) those localization systems use local resources sensors out havg been connected any global system or central server. In this paper, we use term refer first meang.) (i.e., not real time) map matchg can allow for reduced performance favor accuracy [11]. Offle map matchg results can be used for both post-processg analysis modellg purposes. Many door applications need behavioral analysis data mg can make use fle map matched trajecries. CRF was applied for first time pedestrian door localization by Xiao et al. ir localization system MapCraft [12]. In MapCraft, CRF map matchg algorithm is tightly coupled localization system takes raw measurements directly from sensors such as Wi-Fi, Blueoth ertial sensors as puts algorithm, fuses it ger map formation. What we mean by what we call tight couplg is CRF algorithm here is used fuse all measurements spatial map formation alger at same time; both positiong map matchg are done ger one module. MapCraft aims be used as real time map matchg system; however delay produced by backward phase CRF is a real challenge affects efficiency algorithm when used for real-time trackg; In MapCraft y overcome this problem by makg compromise convertg conditional probability discrete distribution obtaed by forward phase a Gaussian distribution displayg it on map real-time [12]. This means less accuracy as it does not give optimal solution which can only be obtaed backward phase; means CRF was not implemented completely MapCraft for onle mode. We do not know exactly what degree step affected accuracy ir system when used onle. Neverless, ir step can be a good example CRF is more suitable for fle usage. As y mentioned clearly ir paper, optimal path can only be calculated case delay lerant fle trackg [12]. Regardg fle trackg trajecry detection, it is possible apply CRF can be directly raw sensors measurements estimate location match it map; however this makes map matchg dependent on environment highly cusmized, as types available sensors should be known; or we can separate map matchg part from localization; we can take location trajecries obtaed by any localization system n match it map fle; map matchg system will be dependent sensors types localization system, can be attached (coupled ) any existg localization system as an dependent module, separate from localization module; this modular structures means more flexibility. In this paper, we present an fle CRF map matchg algorithm can be easily loosely coupled any existg localization system; it uses only output estimated walkg trajecry localization system as an put refes it based on only map formation, out direct use raw sensor data. The adoption loose couplg means map matchg algorithm does not need know implementation details primary localization system; this also n allows

Sensors 16, 16, 132 3 16 map matchg algorithm be lked any localization system as a separate module use only its output. Any change localization system will not affect implementation map matchg algorithm. An example usg CRF as an fle map matchg algorithm for outdoor systems can be found work Xu et al. [13]; ir work y use GPS timestamped locations generated by vehicle as put trajecry for map matchg algorithm output is a sequence road segments traversed by vehicle. As an outdoor map matchg algorithm, map model is based on road segments. In our work door systems, map structure is from road network, we used a grid based map model divide 2D map squared cells. Our transition model is based on neighborhood between cells distribution obstacles buildg, where outdoor environments transition is dependent on road network pology. Instead usg GPS locations as put, we use locations produced by a local positiong system as put as GPS is not effective side buildgs. We will expla details Section 2.2 how CRF algorithm functions; but for purpose comparison we can say brief CRF employs observations context formation through features functions relates observation state transitions. In MapCraft, y used three feature functions dependg on observations from sensors: (1) first function uses displacement headg measurements from ertial sensors; (2) second function is hle correlations headg s ertial sensors; (3) third function uses signal strength observation conjunction fgerprt map [12]. In our map matchg CRF algorithm, we do not use observations from sensors as this supposed be done by a pre-existg localization system; we only make use spatial context provided by map as presented by model addition coordates generated by localization systems as observations. We use one feature function makes use map formation put coordates. The rest paper is organized as follows: Section 2 describes system architecture components, as well as proposed CRF model; experimental results are presented discussed Section 3; fally conclusions drawn from this research are presented Section 4. 2. Overview System In this section, global architecture system is presented, as well as implemented algorithm. First, we give a brief description system architecture, components behavior; furr details follow Sections 2.1 2.2. The system architecture is illustrated Figure 1. As can be seen from this figure, system is composed three subsystems, some terconnections between m. The three components system are: 1. The primary localization system produces first estimated trajecry. This can be any localization system produces, as its output, a walkg trajecry form a time sequence estimated location coordates. This trajecry will be put map matchg algorithm. 2. The semantic map generation system, a unit models floor plan obtaed from CAD files a semantic format can be used by map matchg algorithm. In our case, a grid-based map model was employed which floor plan map is divided square uniform-grid cells. Each cell is associated a semantic representation its contents, for example if it contas a wall or a free space. 3. The map matchg algorithm refes estimated trajecry (path) usg CRF technique semantic floor plan formation. System operation proceeds as follows: once primary estimated trajecry is obtaed by localization system, map matchg is carried out by applyg CRF model also uses formation obtaed from map produce a refed (corrected) trajecry. The goal is estimate most feasible trajecry, takg account constrats provided by map such as walls

Sensors 16, 16, 132 4 16 or obstacles are obtaed from a semantic map generation system, a separate unit extracts map Sensors data 16, from 16, 132 CAD files represents it a model so it can be used by algorithm. 4 16 Figure 1. System 1. System Architecture, illustratg illustratg couplg couplg between between proposed proposed map matchg map matchg algorithm algorithm localization localization semantic map semantic systems. map systems. 2.1. 2.1. The The Semantic Semantic Map Map Generation Generation System System Indoor Indoor maps maps can can be be available available formats, formats, like like images, images, PDF PDF files, files, or CAD or CAD files. files. These These formats are not suitable be directly used by map matchg algorithm; two tasks should formats are not suitable be directly used by map matchg algorithm; two tasks should be be performed, map formation should be extracted from available map files, n this performed, map formation should be extracted from available map files, n this formation formation should be represented anor format usable by map matchg algorithm. The should be represented anor format usable by map matchg algorithm. The most commonly most commonly used map models door localization are grid models graph models used map models door localization are grid models graph models [2]. In grid [2]. In grid models, space is partitioned regular cells semantics. The graph models models, space is partitioned regular cells semantics. The graph models [14] reconstruct [14] reconstruct space as a graph where nodes represent entities or places terest space as a graph where nodes represent entities or places terest buildg. In [12], for buildg. In [12], for example, y obtaed graphs from maps image formats usg stard example, edge detectg y obtaed algorithms graphs extract from maps edges from image formats image, usg n a stard grid-based edge map detectg model was algorithms used extract cell edges size from.8 m image, model nmap a grid-based formation. map In model our system, was used we preferred cell size use.8 CAD m model files because mapcad formation. is very widely In ourused system, architectural we preferreddesign, use CAD we modelled files because map CADusg is very a widely grid-based used model. architectural design, we modelled map usg a grid-based model. The The semantic map generation unit extracts mapdata datafrom from CAD CADfiles files models models it ita a semantic model suitable for map matchg algorithm. We Weuse use CAD CADdata data encoded Drawg Interchange File format (DXF). DXF files are stard ASCII text files are are feredby by CAD CAD can can be be easily easily read read by or by or programs [15,16]. [15,16]. However, map map formation obtaed obtaed from DXF from files DXF is not files suitable is not for suitable localization for localization applications, applications, as it is not as enhanced it is not enhanced semantic formation semantic formation allows computers allows computers underst underst architectural architectural structure structure buildg buildg distguish between distguish between architectural objects architectural such asobjects walls such stairs as walls [17]. Instead, stairs DXF-derived [17]. Instead, map formation DXF-derived comprises map formation only le, comprises curve, circle, only le, polyle curve, drawg circle, data, polyle whichdrawg means data, it requires which more means processg it requires order more be used processg by proposed order map-matchg be used by algorithm. proposed We map-matchg extract DXF formation algorithm. We extract represent DXF it usg formation our map model, represent whichit is usg based our onmap dividg model, which mapis based square on cells dividg determg map square possible cells transitions determg pedestrian possible fromtransitions one cell anor pedestrian dependg from on one existg cell obstacles. anor dependg We extracn simple existg entity obstacles. formation We extract from DXF simple filesentity locate formation it grid from cell representation DXF files model locate it floor grid plan. cell representation model floor plan. As we will expla Section 2.2, CRF model is classifier requires pre-defed As we will expla Section 2.2, CRF model is a classifier requires pre-defed states/labels. To this end, proposed map model is designed suit this specific purpose by states/labels. To this end, proposed map model is designed suit this specific purpose by representg map as a group square cells, each cell representg a squared area representg map as a group square cells, each cell representg a squared area buildg; algorithm, this represents a state/label can be used specify position buildg; algorithm, this represents a state/label can be used specify position pedestrian. In model, each cell has its own characteristics, be it representg a free space pedestrian. In model, each cell has its own characteristics, be it representg a free space buildg or be it occupied by an obstacle such as wall or furniture. For purpose representg buildg or be it occupied by an obstacle such as a wall or furniture. For purpose representg state transitions, each cell knows its neighbor cells neighbors neighbor cells. state A transition transitions, graph/table each cell knows is generated its neighbor such cells a way neighbors transition neighbor is only possible cells. A between transition graph/table neighbor cells is generated do not such conta a way any obstacle; transition for more is flexibility, only possible a transition between neighbor a neighbor cells a doneighbor not conta cell is any also obstacle; allowed for under more flexibility, condition a transition re are no aobstacles neighborimpedg a neighbor transition. cell is also allowed The search under region condition for next location re are from no obstacles current impedg location is known transition. as The buffer search [2], region for maximum next location transition from distance current allowed location is each known direction as buffer known [2], as buffer maximum size. Allowg transition transitions neighbor cells neighbors neighbors results a buffer size 2 cells each

Sensors 16, 16, 132 5 16 Sensors 16, 16, 132 5 16 distance allowed each direction known as buffer size. Allowg transitions neighbor cells direction, neighbors as shown neighbors Figure results 2a. Figure a buffer 2b presents size an 2 cells example each possible direction, transitions as shown based Figure on 2a. Figure existence Sensors 2b presents 16, obstacles. 16, 132 an example possible transitions based on existence obstacles. 5 16 direction, as shown Figure 2a. Figure 2b presents an example possible transitions based on existence obstacles. (a) (b) Figure Figure 2. 2. Search Search region region for for next next location, cludg allowed transitions next step (a) (a) location, cludg allowed (b) transitions next step (a) allowed steps presence obstacles (b). allowed steps presence obstacles (b). Figure 2. Search region for next location, cludg allowed transitions next step (a) 2.2. The allowed Map Matchg steps Algorithm presence obstacles (b). 2.2. The Map Matchg Algorithm 2.2. A The CRF Map model Matchg is used Algorithm as base model developed system. As undirected probabilistic A CRF model is used as base model developed system. As undirected probabilistic graphical models developed for labellg data [8], CRF models are used for an put set graphical A observations models CRF model developed is used predict for as a vecr labellg base hidden data model [8], variables CRF developed models. Unlike are system. used generative for As an undirected put models setprobabilistic such observations as HMMs x graphical predict model a models vecr jot developed probability hidden variables for labellg P, by y. data applyg Unlike [8], generative CRF models Bayes rule, models are used CRFs are such for discrimative as an HMMs put set ( models model x ) observations predict a vecr hidden variables. Unlike generative models such as HMMs jot model probability conditional P, y distribution by applygp Bayes over rule, CRFs hidden are discrimative variables given models observation model model jot probability ( vecr ; a comparison generative x P, ) by applyg Bayes rule, CRFs conditional distribution P y over discrimative hidden models variables can are discrimative models model conditional distribution P over hidden variables be y given found observation given [18]. In observation lear vecr cha x ; CRFs, a special form CRF graphs model output variable as a sequence [9], conditional a comparison vecr ; a comparison generative generative discrimative discrimative models models can be can found be found [18]. [18]. In lear In lear cha cha CRFs, probability CRFs, a special states form given CRF observations graphs P model is proportional output variable as a product sequence [9], potential conditional functions a special form CRF graphs model output variable as sequence [9], conditional probability lk observations states given consecutive observations states. ( P x Figure ) is proportional 3 shows a representation product potential lear functions cha CRF probability model. lk The observations states hidden given states observations consecutive are dependent states. P Figure y on is put proportional 3 shows observation a representation vecr product ; lear each potential hidden cha functions CRF state depends lk model. observations not The on hidden one put states consecutive value, but states. rar Figure 3 shows whole aput representation vecr. As a result, lear y cha can CRF be model. affected Theby hidden put states observations are dependent on put observation y are dependent from on put time observation steps; which is considered ; each hidden state depends not on one put value, but rar on whole put vecr. x ; As each a result, an hidden advantage y state can depends be not CRF onaffected one technique. put by put value, observations but rar from on whole put time steps; vecr. which As ais result, considered y can advantage be affected by put observations CRF technique. from time steps; which is considered an advantage CRF technique. Figure Figure 3. 3. 3. Lear Cha CRF model (adaptedfrom from [8]). [8]). In In map map matchg problem, hidden state vecr represents sequence locations In map matchg problem, hidden state vecr y represents sequence locations be be calculated, i.e., i.e., corrected walkg trajecry; our Lear Cha CRF algorithm uses uses cells cells be calculated, i.e., corrected walkg trajecry; our Lear Cha CRF algorithm uses cells map map model as as hidden states/labels. Vecr represents system put can can be be eir eir map coordates model as locations hidden states/labels. on on an an estimated Vecr trajecry x represents obtaed by by some system localization put system, can system, as be eir as coordates case case our our locations algorithm, on or or an direct estimated measurements trajecry from obtaed sensors. by some localization system, as case The our The algorithm, CRF CRF algorithm algorithm direct consists consists measurements two two phases: from sensors. forward phase phase backward backward phase. phase. Followg The Followg CRF algorithm calculation calculation consists two conditional conditional phases: probabilities forward phase all all cells cells all backward all time time steps steps phase. durg durg Followg forward phase, ference is carried out (backward phase), optimal forward calculation phase, ference conditional is carried probabilities out second all cellsphase all time (backward steps durg phase), forward optimal phase, ference trajecry chosen from among cidate trajecries. trajecry is carried chosen from out among second phase cidate (backward trajecries. phase), optimal trajecry chosen from among Durg forward phase, CRF algorithm evaluates possible transitions at each time Durg cidate forward phase, trajecries. CRF algorithm evaluates possible transitions at each time step accordg put trajecry transition graph obtaed from map model; this step accordg put trajecry transition graph obtaed from map model; this

Sensors 16, 16, 132 6 16 Durg forward phase, CRF algorithm evaluates possible transitions at each time step accordg put trajecry transition graph obtaed from map model; this volves calculatg probabilities transition from all cells current time step all cells next time step. A probability value is assigned each cell map at each time step; this value represents how probable it is pedestrian is located cell at time step (for example, probability pedestrian movement a cell occupied by a wall is zero). This probability is also a conditional probability calculated usg so-called feature functions compute what degree put observations support choice a cell be on trajecry at time step. However, cell selection depends not only on its probability value at current time step, but also on previous time steps, i.e., path hisry, how this cell is related ors path. Hence, choosg cell highest probability is not enough; probability a whole trajecry should be calculated. The feature functions specify how transition between two states is supported by set observations x. The potential function a cell is calculated at each time step by calculatg exponential summation all feature functions support selection this cell multiplied by transition probability movg this cell from current cell at current time step. The higher potential function value, higher probability cell be next cell. At each time step, j potential function is exponential summation all feature functions f i at time step, can be written as: ψ j ( x, y ) = exp( m i=1 λ i f i (y j 1, y j, ) x ) (1) where m is number features ( λ i is feature weight can be determed by trag x ) model. The conditional probability P y each cell is calculated by normalizg potential function as follows: ( x ) P y = 1 Z ( x ) n j=1 ( x ) ψ j, y = ( 1 x ) exp( Z n m j=1 i=1 where n is number output states/cells Z is normalization facr, λ i f i (y j 1, y j, ) x ) (2) ( x ) Z = x n j=1 ψ j ( x, y ) (3) If N is number cells, n at every time step potential functions should be calculated N N times; however, knowg transition can only happen between neighbor cells, one need only calculate potential function those neighbors. Thus, calculation number at each step is O(N) complexity whole procedure is O(NT), where T is number time step observations. For each observation, each cell sres only one conditional probability value ( highest), while previous cell gave this value is also sred as best parent. This is necessary for followg ference step. Durg backward phase, ference is implemented order estimate location over time, most likely sequence hidden states calculated by maximisg sum conditional probability function. After potential function for all cells is calculated for each observation, optimal path is determed. This is carried out via a backward process usg dynamic programmg Viterbi algorithm [19]. The optimal path is obtaed by maximizg sum conditional probabilities along path: ( y x ) = argmax P y. (4) y

Sensors 16, 16, 132 7 16 Sensors 16, 16, 132 7 16 previous time step, before summg se conditional probabilities along path until reachg Although this process might be assumed be high complexity, as we need choose between first parent Sensors path. 16, The 16, path 132 highest sum is n chosen. The forward backward 7 16 phases map all matchg possiblecrf trajecries, algorithm it are isshown actually Algorithm lear because 1. for each time step we only save one value conditional previous probability time step, for before eachsummg cell. Hence, se conditional numberprobabilities cidate along paths equals path until reachg number cells Algorithm 1. CRF (N). Algorithm The first backward parent for Map process Matchg path. The isproblem O path (NT), as wehighest start a sum backward is n process chosen. The for forward each cell bybackward determg best phases parent, which map is matchg neighbor CRF algorithm cell are shown highest Algorithm conditional 1. probability at previous time 1 Input : Observation = a vecr coordates put estimated trajecry step, before summg se conditional probabilities along path until reachg first parent 2 Output: CorrectedPath = a vecr coordates output corrected trajecry path. Algorithm The1. path CRF Algorithm highest for Map summatchg is nproblem chosen. The forward backward phases map 3 Forward Phase: matchg 1 Input CRF: Observation algorithm= are a vecr shown coordates Algorithm 1. put estimated trajecry 4 For each observation (Observationj) %Observation j = coordates put at time step j 2 Output: CorrectedPath = a vecr coordates output corrected trajecry 5 For all cells (i) Algorithm 3 Forward 1. CRF Phase: Algorithm for Map Matchg Problem 6 For all neighbor cells i (k) 1 4 Input For each : Observation observation = (Observationj) a vecr coordates %Observation j = put coordates estimated put trajecry at time step j 7 fdis = T(i,k)/Distance (k,observationj)%t(i,k): transition possibility from cell i cell k {,1} 2 5 Output: For all cells CorrectedPath (i) = a vecr coordates output corrected trajecry 8 Potential(k,Observationj) = exp(fdis); 3 6 Forward For Phase: all neighbor cells i (k) 9 4 Z For = sum(potential(:,j)) each observation (Observation % normalization j ) %Observation facr j = coordates put at time step j 7 fdis = T(i,k)/Distance (k,observationj)%t(i,k): transition possibility from cell i cell k {,1} 1 ConditionalProbabilty 5 For all cells (i) (k,observationj) = Potential(k,Observationj)/Z 8 Potential(k,Observationj) = exp(fdis); 11 If (ConditionalProbabilty 6 For all (i,observationj-1) neighbor cells> ConditionalProbabilty i (k) (bestparent (k)) 12 n CorrectedParent(k) 7 9 = i f dis = Z T(i,k)/Distance = sum(potential(:,j)) (k,observation % normalization j )%T(i,k): transition facr possibility from cell i cell k {,1} 8 1 ConditionalProbabilty Potential(k,Observation (k,observationj) j ) = exp(f dis ); = Potential(k,Observationj)/Z 13 End 9 11 If (ConditionalProbabilty Z = sum(potential(:,j)) (i,observationj-1) % > normalization ConditionalProbabilty facr (bestparent (k)) 14 End 1 12 n CorrectedParent(k) ConditionalProbabilty = i (k,observation j ) = Potential(k,Observation j )/Z 15 End 11 If (ConditionalProbabilty (i,observation j-1 ) > ConditionalProbabilty (bestparent (k)) 13 End 16 End 12 n CorrectedParent(k) = i 14 End 17 Backward Phase 13 End 18 #CidatePaths 14 15 End = #Cells End 15 16 End 19 For p = 1 #CidatePaths % p is last cell CidatePaths 16 17 End Backward Phase k = p % k is current cell CidatePath 17 18 Backward #CidatePaths Phase = #Cells 21 Construct 18 each #CidatePaths CidatePath: = #Cells 19 For p = 1 #CidatePaths % p is last cell CidatePaths 22 For all 19observations For p = 1(j 1) #CidatePaths % p is last cell CidatePaths k = p % k is current cell CidatePath 23 CidatePath(j) k = p = k; %add cell K path % at ktime is step current j cell CidatePath 24 21 21 sum(cidatepath) Construct = sum(cidatepath) each CidatePath: + ConditionalProbabilty(k,j) 22 22 For For all all observations (j 1) 1) 25 k = BestParent(k,j) % choose best parent k be next cell path 23 23 CidatePath(j) = k; k; %addcell cell K K path path time at time step step j j 26 End 24 24 sum(cidatepath) sum(cidatepath) = sum(cidatepath) sum(cidatepath) + ConditionalProbabilty(k,j) + ConditionalProbabilty(k,j) 27 End 25 k = BestParent(k,j) % choose best parent k be next cell path 25 k = BestParent(k,j) choose best parent k be next cell path 28 CorrectedPath 26= CidatePath End highest sum ConditionalProbabilities 26 End 27 End The ma feature 28 27 CorrectedPath End we use our = CidatePath CRF map matchg highest algorithm sum is ConditionalProbabilities Euclidean distance ( ) between 28 centre CorrectedPath cidate = CidatePath cell highest estimated sum position ConditionalProbabilities derived from primary localization system; The ma a smaller feature distance means we usea higher ourvalue CRF map potential matchgfunction algorithm given is Euclidean distance transition this cell is possible, as determed by transition graph obtaed from ( ) The ma between feature centre we use our cidate CRF map cell matchg algorithm estimated is position Euclidean derived distance from map model. The proposed ( ) feature between function can centre thus be defed cidate as follows: cell estimated position derived from primary localization system; a smaller distance means a higher value potential function given primary localization system; a smaller distance means a higher value potential function given transition this cell is possible,, as determed by transition graph obtaed from map transition this = cell is possible, as determed by transition graph obtaed from model., (5) map model. The proposed The proposed feature feature function function can can thus thus be be defed defed as as follows: follows: Mimum distance = cell size/2 where is a function dicates transition possibility from current, cell cidate f= cell, dependg on transition table, which can be eir dis = T(y j 1,y j) or 1, Distance (x, time j,y j) step is (5) (5) current observation, which is current location estimated Mimum by distance primary = localization cell = cell size/2 size/2 system. This feature means cells where close is a function current put dicates locations have transition higher possibility probabilities from than current far cells, cell cidate where cell, dependg T is a function transition dicates table, transition which can be possibility eir or from 1, is current time step cell is cidate cell, current dependg observation, on which transition is current table, location which estimated can by be eir primary orlocalization 1, j is system. time step This x is feature current means observation, cells close which is current put locations estimated have higher by probabilities primary than localization far cells, system. This feature means cells close current put locations have higher probabilities than far cells,

Sensors 16, 16, 132 16 Sensors 16, 16, 132 8 16 on on condition condition transition transition cell cell is is possible possible from from its its neighbor neighbor cells cells no no obstacle obstacle forbids forbids this this transition. transition. 3. Results Discussion The algorithm was tested usg both simulations data obtaed from real measurements. Map formation for 4th floor DeusTech buildg at University Deus (Spa) was extracted from AuCAD files modelled as a grid-based map model. Section 3.1 presents results conducted simulations, while results obtaed usg real measurements are presented Section 3.2. 3.1. Simulations A base trajecry (shown Figure 4) was constructed as ground truth, unmatched trajecries n created romly as put (observations) map matchg algorithm. In real-life applications, put put trajecry is is output output an existg an existg localization localization system system represents represents primary primary estimations estimations (as we will (as show we will Section show 3.2). Section The map 3.2). matchg The map matchg system is applied system is applied refe estimated refe trajecry estimated by trajecry avoidgby crossg avoidg obstacles; crossg obstacles; most feasible most trajecry feasible is trajecry sequence is positions sequence positions violates fewest violates constrats fewest [12]. constrats After matchg [12]. After put matchg trajecry put map trajecry usg CRFmap algorithm, usg matched CRF algorithm, (corrected) trajecry matched was (corrected) comparedtrajecry ground was truth compared order measure ground truth precision, order usg measure Cumulative precision, Distribution usg Function Cumulative (CDF) Distribution s obtaed Function by (CDF) calculatg s Euclidean obtaed distance by calculatg between actual Euclidean position distance ground between tru actual correspondg position corrected ground truth position. correspondg corrected position. Figure 4. The Ground Truth, arrows dicate direction walkg. To To simulate simulate possible possible put put trajecries trajecries qualities, qualities, s s were were added added base base track track by by allowg allowg degrees degrees deviation deviation (distances) (distances) romness romness around around ground ground truth. truth. A low low was was used used represent represent a primary primary estimation estimation (put) (put) trajecry trajecry low low (mean (mean about about 1.3 1.3 m stard stard deviation deviation about about 1 m for for 1); 1); a simulated simulated put put a high high was was used used represent represent an an put put trajecry trajecry high high (mean (mean about about 2.5 2.5 m m stard stard deviation deviation about about 1.8 m 1.8 for m for 4). Table 4). 1 Table shows 1 approximate shows approximate values values mean mean stard deviations stard deviations four four s obtaed s by simulatg obtaed by 25 simulatg rom samples 25 rom each samples s. each Examples s. Examples simulated trajecries simulated trajecries s are shown s Figure are 5. shown Figure 5.

Sensors 16, 16, 132 9 16 Sensors 16, 16, 132 9 16 Table 1. Means stard deviations for used simulations. Table 1. Means stard deviations for used simulations. Noise Level Mean (m) Stard Deviation (m) 1 Noise Level 1.3 Mean (m) Stard Deviation 1 (m) 2 1 1.6 1.3 1 1.1 3 2 2. 1.6 1.1 1.3 3 2. 1.3 4 2.5 1.8 4 2.5 1.8 Figure 5. Trajecries s. The results matchg put trajecries map are shown Table 2. We can The results matchg put trajecries map are shown Table 2. We can see all 3 samples we have run number obstacles crossed by map matched see all 3 samples we have run number obstacles crossed by map matched trajecry is zero. This is an important pro efficiency algorithm. Mamatically, trajecry is zero. This is an important pro efficiency algorithm. Mamatically, best best path is path highest some scores, path might have highest sum score while path is path highest some scores, path might have highest sum score while one one se scores is zero; one sgle zero score might not affect much whole sum. If at some se scores is zero; one sgle zero score might not affect much whole sum. If at some pot, pot, score cell was zero because re is an encounter an obstacle, it still can be score cell was zero because re is an encounter an obstacle, it still can be path if path if sum all pots on path is still high. However, such situation is very rare as our sum all pots on path is still high. However, such situation is very rare as our algorithm algorithm features are designed mimize chance crossg obstacles; what prevents features are designed mimize chance crossg obstacles; what prevents crossg obstacles is crossg obstacles is normally re are or free cells higher potential scores choose normally re are or free cells higher potential scores choose stead occupied cells. stead occupied cells. That s why probability cross obstacles is almost zero. No encounter That s why probability cross obstacles is almost zero. No encounter obstacles will happen obstacles will happen unless it is necessary re is no or choice; odd cases like unless it is necessary re is no or choice; odd cases like case divergence case divergence (stuck) problem happens when trajecry is trapped a small (stuck) problem happens when trajecry is trapped a small area; path might cross area; path might cross wall get out trap. To expla, some cases divergence, wall get out trap. To expla, some cases divergence, put location becomes so put location becomes so far from current cell be evaluated (big distance), when we far from current cell be evaluated (big distance), when we calculate feature (1/distance), calculate feature (1/distance), probability (Equation (2)) it will be very small value probability (Equation (2)) it will be very small value (near zero). That means no big difference (near zero). That means no big difference probability between free cells blocked cells; both probability between free cells blocked cells; both would have very low scores because all are would have very low scores because all are distant from real place. In this case, it is possible distant from real place. In this case, it is possible path will cross an obstacle get out path will cross an obstacle get out from trap, as aga at end path is evaluated from trap, as aga at end path is evaluated sum probability along it not on a sum probability along it not on a sgle obstacle cross. Accordg our observations, this case sgle obstacle cross. Accordg our observations, this case crossg obstacles happens very rarely crossg obstacles happens very rarely does not happen most divergence problem cases, does not happen most divergence problem cases, but few m. The divergence problem but few m. The divergence problem itself happens rarely as we will see below. To study itself happens rarely as we will see below. To study effect cell sizes, Table 2 was effect cell sizes, Table 2 was constructed parameter combations. constructed parameter combations. To measure precision, cumulative for To measure precision, cumulative for 5% 9% positions on trajecry was 5% 9% positions on trajecry was calculated for parameter values, this case, calculated for parameter values, this case, cell size. For each parameter cell size. For each parameter combation, algorithm was run on 25 rom put combation, algorithm was run on 25 rom put trajecries average cumulative trajecries average cumulative registered for 5% 9% positions. registered for 5% 9% positions.

Sensors 16, 16, 132 1 16 Table 2. Simulated trajecry results usg feature f dis. Path length = 352 m. Cell Size (m).8 1 1.5 Noise Level Number Crossed Obstacles Cumulative Error (m) 5% 9% 1.9867 2.6699 2 2.682 19.78 3 5.7945 32.464 4 6.5158 32.3861 1 1.1574 3.78 2 1.2463 3.8172 3 1.4853 5.1879 4 2.19 11.161 1 19.43 7.73 2 16.6941 61.6751 3 17.7461 68.5491 4.473 71.8129 It is clear from Table 2 a cell size 1m provides good results, even when addg high s put results still acceptable. At a low (equal 1), for 5% trajecry average cumulative is 1.16 m for 9% average cumulative is 3.78 m, based on a tal track length 352 m. Usg a larger cell size 1.5 m length results more cells occupied by obstacles thus blocked movement; this explas high observed respective results, as illustrated by example shown Figure 6a. Figure 6b illustrates how corridor is blocked because it contas cells occupied by side walls. Besides beg high we also notice results this cell size are also tally rom relation, higher low is just due rom put samples, usg samples would result numbers, explas available results 7.73 m usg 1 while smaller 61.6751 m is obtaed usg 2, which might look strange but it is normal; this specific situation is irrelevant does not have a significant impact on results as results from blocked corridors is much higher than results from. We have run or samples we got results which looks normal (smaller for less ) but we kept current result illustrate irrelevance this case. Although use a cell size.8 m would be expected lead more precise results, obtaed results show this is correct only for low put; at higher s was high, likely due what we call stuck or divergence problem. This particular problem occurs when corrected trajecry enters a room or small area cannot leave; an example such a situation is shown Figure 7. Although smaller cells it is more likely certa cells will conta no obstacles, some se empty cells could form entrances small areas, allowg trajecry pass through m become trapped. The stuck problem recorded.8 m cell size simulations resulted high values about 16% samples, remader achievg good results (average cumulative 4.2522 m for 9% observations at a 2). It should be noted values shown Table 2 dicate average cumulative s all samples, cludg those experiencg stuck problem, which explas high value some se averages. Figure 8 displays examples results obtaed for cell sizes s.

Sensors 16, 16, 132 Sensors 16, Sensors 16,16, 16,132 132 11 16 11 16 16 11 Sensors 16, 16, 132 11 16 (a) (a) (b) (b) Figure 6.Large Large cellsresult result more cells cells beg occupied by obstacles blocked movement, Figure movement, Figure 6. 6. Large cells cells result more more cells beg beg occupied occupied by by obstacles obstacles blocked blocked movement, (a) (a) (b) corridors can be blocked. shows a map matched trajecry for a cell size equal 1.5 m; occupied corridors (a) shows corridors can can be be blocked. blocked. (a) shows aa map map matched matched trajecry trajecry for for aa cell cell size size equal equal 1.5 1.5 m; m; occupied occupied cells are marked blue circles (b)cells where weoccupied can see how corridor is marked by red Figure 6. Large cells result more beg by obstacles blocked movement, cells cells are are marked marked blue blue circles circles (b) (b) where where we we can can see see how how corridor corridor is is marked marked by by red red circle is blocked by obstacles. corridors can be blocked. (a) shows a map matched trajecry for a cell size equal 1.5 m; occupied circle circle is is blocked blocked by by obstacles. obstacles. cells are marked blue circles (b) where we can see how corridor is marked by red 7 circle is blocked by obstacles. 7 6 7 6 5 6 5 3 stuck problem stuck problem stuck problem 5 3 3 1 1 1 Figure 7. Stuck problem 65 6 6 6 5 5 5 5 5 3 1 7 7 6 76 7 3 3 estimated trajecry corrected Trajecry estimated trajecry estimated trajecry corrected Trajecry corrected 6 Trajecry8 1 1 1 1 1 1 1 1 m, = 4. Figure 7. 7. Stuck problem scenario, cell size ==.8 m, = = 4. Figure 7. Stuck size Figure Stuckproblem problemscenario, scenario, cell cell 7 size =.8 m, = 4. 7 actual trajecry estimated trajecry actual trajecry corrected trajecry actual trajecry estimated trajecry start end pots estimated trajecry trajecry corrected corrected trajecry start end pots 6end pots8 start 6 8 6 8 scenario, cell size =.8 6 6 (a) (a) (a) 8 8 3 3 3 1 1 1 1 1 1 1 1 1 Figure 8. Cont. Figure 8. Cont. Figure Figure 8. 8. Cont. Cont. estimated trajecry corrected Trajecry estimated trajecry estimated trajecry corrected Trajecry 6 Trajecry 8 corrected 6 8 6 8 (b) (b) (b) 1 1 1 1 1 1

Sensors 16, 16, 132 12 16 Sensors 16, 16, 132 12 16 7 7 6 6 5 5 3 3 1 estimated trajecry corrected Trajecry 1 estimated trajecry corrected trajecry 7 6 8 1 1 (c) 6 8 1 1 7 (d) 6 6 5 5 3 3 1 estimated trajecry corrected trajecry 1 estimated trajecry corrected trajecry 6 8 1 1 (e) 6 8 1 1 (f) Figure 8. Ground truth, estimated corrected trajecries obtaed usg cell sizes Figure 8. Ground s. truth, (a) estimated Cell size = 1 corrected m, trajecries = 2; obtaed (b) Cell usg size = 1 m, cell sizes = 3; s. (c) Cell (a) Cell size = size 1 m, = 1 m, = 4; (d) Cell = size 2; (b) =.8 Cell m, size = 1 m, = 1; (e) Cell size =.8m, 3; (c) Cell size = 1 m, 2; (f) Cell = 4; size (d) =.8 Cell m, size =.8= 3. m, = 1; (e) Cell size =.8 m, = 2; (f) Cell size =.8 m, = 3. A moderate walkg speed is thought be around 1.67 steps/s (1.67 Hz) [], an average step length.7 m for women.78 m for men [21], resultg a movement speed A moderate walkg speed is thought be around 1.67 steps/s (1.67 Hz) [], an average around 1.3 m/s. Assumg a frequency put 1 estimation/s (1 Hz), i.e., a time step equal 1 step s, length subject.7 would m for move women 1.3 m every.78 time m for step, men 2.6 [21], m resultg 2 steps, etc. As a movement proposed speed map model around 1.3 m/s. employs Assumg discrete a frequency values for movement put (cell 1 estimation/s units), allowg (1 Hz), only i.e., one a cell timetransition, step equal for example, 1 s, subject would each move time 1.3 step m(buffer every time size equal step, 2.61 mcell) would 2 steps, mean etc. As proposed system would mapnot model be able employs capture discrete values for movement a (cell pedestrian units), walkg allowgat only moderate one cell speed; transition, is refore example, more suitable each time have step (buffer flexibility size equal movement 1 cell) would by allowg mean, 1, or 2 cell system moves would each notime be able step by capture allowg transition movement a pedestrian neighbor walkg cells at moderate neighbors speed; neighbors it is refore (buffer size more equal suitable 2), which have is necessary flexibility order movement by allowg obta a, correct 1, 2trajecry cell moves assumg eacha time cell size step by1 allowg m. If transition put frequency neighbor was 2 cells Hz (2 neighbors estimations/s), neighbors this would (buffer mean size an equal estimation 2), which every is half-second necessary time order step. Durg obta this a correct time period, trajecry a pedestrian movg at moderate speed moves around.65 m each time step, a distance smaller assumg a cell size 1 m. If put frequency was 2 Hz (2 estimations/s), this would mean an than cell size (1 m). In this case, if only one cell transition was allowed re should not be a estimation every half-second time step. Durg this time period, a pedestrian movg at moderate problem, while allowg more possibilities (1 or 2 cells) should also work. In some systems re is speed no moves fixed frequency around.65 for m estimations, each time step, a location distance registered smaller than at each cell step size whatever (1 m). In this speed. case, if onlyin one cell present transition case, if was we allowed assume a re moderate should walkg not bespeed a problem, average whilefrequency allowgwill more be possibilities around (1 or1.67 2 cells) Hz, should meang also work. a buffer Insize some 1 systems cell would re be suitable. is no fixed However, frequency all for cases estimations, a buffer size location 2 cells registered still more at each flexible step whatever capturg any speed. variations In present case, dealg if we assume or types a moderate walkg movement speed such average as runng. frequency will be around 1.67 Hz, meang a buffer size 1 cell would be suitable. The However, results shown all cases Table a buffer 2 are those size for 2 cells a buffer is still size more 2 flexible cells assumg capturg any speed variations estimations dealg primary or localization types system movement are such registered as runng. at a frequency 1 Hz. To The results shown Table 2 are those for a buffer size 2 cells assumg estimations primary localization system are registered at a frequency 1 Hz. To experimentally test

Sensors 16, 16, 132 Sensors 16, 16, 132 13 16 13 16 experimentally effect buffer size test effect estimation buffer frequency size on estimation proposed frequency algorithm, on furr proposed simulations algorithm, were furr carried simulations out usg a cell were size carried equal out 1 usg a cell size equal equal 1 1; results se equal simulations 1; results are shown se simulations Table 3. It is are clear shown from this Table table 3. It is clear results from this were table worse when results usg a were small worse buffer when size usg (1 cell) a small 1Hz buffer frequency, size (1 cell) 33.154 1Hz m frequency, for 9% 33.154 data compared m for 9% 3.78 data m compared recorded for a buffer 3.78 size m recorded 2 cells for a buffer same size 1 Hz 2 frequency. cells This same discrepancy 1 Hz frequency. is due This ability discrepancy is due trajecry ability reach correct trajecry destation usg reach small correct steps, as destation estimated usg trajecry small steps, was movg as estimated faster. Furrmore, trajecry was adoption movg a faster. 2 Hz measurement Furrmore, frequency adoption achieved better a 2 results, Hz measurement even when frequency usg a small achieved buffer. better Neverless, results, even a high when buffer usg size always a small provides buffer. Neverless, more flexibility. a high buffer size always provides more flexibility. Table 3. Simulated trajecry results for step lengths measurement frequencies usg cell Table size = 13. msimulated trajecry = 1. Path results length for = 352 m. step lengths measurement frequencies usg cell size = 1 m = 1. Path length = 352 m. Estimation Frequency Estimation Frequency Buffer Size Buffer Size Cumulative Error (Meters) Cumulative Error (Meters) 5% 5% 9% 1 Hz 1 Hz 1 cell 1 cell 12.4931 33.154 2 Hz 2 Hz 1 cell 1 cell 1.1348 1.1348 2.4989 1 Hz 2 cells 1.1574 3.78 1 Hz 2 Hz 2 cells 2 cells 1.1574 1.3639 3.44 3.78 2 Hz 2 cells 1.3639 3.44 3.2. Real Measurements 3.2. Real Measurements Testg was carried out on 4th floor DeusTech buildg at University Testg was carried out on 4th floor DeusTech buildg at University Deus Deus (Bilbao, Spa). Primary results were estimated via a step--headg based Pedestrian (Bilbao, Spa). Primary results were estimated via a step--headg based Pedestrian Dead Dead Reckong (PDR) system usg a wrist-worn ertial measurement unit composed three Reckong (PDR) system usg a wrist-worn ertial measurement unit composed three accelero three gyroscopes. Headg drift was reduced by applyg method known as accelero three gyroscopes. Headg drift was reduced by applyg method known as improved Heuristic Drift Elimation (ihde) [22], developed map matchg algorithm n improved Heuristic Drift Elimation (ihde) [22], developed map matchg algorithm n applied fle. Estimation frequency was not constant but depended on step, as employed applied fle. Estimation frequency was not constant but depended on step, as employed PDR system calculated location at each step. For map model a cell size 1m a buffer size PDR system calculated location at each step. For map model a cell size 1m a buffer size 2 cells were used. The estimated results primary localization system results corrected 2 cells were used. The estimated results primary localization system results by CRF map matchg for one round walk DeusTech area are shown Figure 9b. Figure 9c corrected by CRF map matchg for one round walk DeusTech area are shown Figure 9b. displays estimated trajecry for two rounds, corrected trajecry for this estimated Figure 9c displays estimated trajecry for two rounds, corrected trajecry for this trajecry shown Figure 9d; ground truth is shown Figure 9a. estimated trajecry shown Figure 9d; ground truth is shown Figure 9a. (a) (b) Figure 9. Cont. Figure 9. Cont.

Sensors 16, 16, 132 14 16 Sensors 16, 16, 132 14 16 7 7 6 6 5 5 3 3 1 1 6 8 1 1 (c) 6 8 1 1 (d) Figure 9. Ground Truth, estimated trajecry obtaed from real measurements usg ihde Figure trajecry 9. Ground corrected Truth, usg estimated CRF. (a) trajecry Ground obtaed truth; (b) fromestimated real measurements corrected usg trajecries; ihde trajecry (c) Estimated corrected trajecry usg CRF. for two (a) circuits; Ground(d) truth; Corrected (b) Estimated trajecry for corrected two circuits. trajecries; (c) Estimated trajecry for two circuits; (d) Corrected trajecry for two circuits. Analysis Figure 9 reveals although primary estimated trajecry crosses a number walls Analysis obstacles, Figurethis 9 reveals was corrected although successfully primary usg estimated map matchg trajecry algorithm crosses a number zero walls obstacles was obstacles, crossed this by was map corrected matched successfully trajecry, see usg Table 4. As map a consequence matchg algorithm matchg zero trajecry map, accuracy was also improved; even though accuracy ihde obstacles was crossed by map matched trajecry, see Table 4. As a consequence matchg trajecry was already good, map matchg usg CRF has furr improved accuracy trajecry map, accuracy was also improved; even though accuracy ihde cumulative was decrease as shown Table 4. Before applyg map matchg, usg trajecry was already good, map matchg usg CRF has furr improved accuracy only primary localization system (ihde), average cumulative was 1.2861 m for cumulative 5% trajecry was decrease 2.6858 m as for shown 9% Table trajecry. 4. Before The applyg cumulative map matchg, was reduced usg by only applyg primary localization CRF map system matchg (ihde), algorithm average be 1.634 cumulative m for 5% was trajecry, 1.2861 m 2.2316 for 5% m for trajecry 9% 2.6858 trajecry; m for 9% which means trajecry. improvement The cumulative 17.5% 19.8%, was respectively. reduced by applyg CRF map matchg algorithm be 1.634 m for 5% trajecry, 2.2316 m for 9% trajecry; which Table 4. means Real measurement improvement results 17.5% usg feature 19.8%, fdis respectively. cell size = 1 m. Path length = 347 m. Cumulative Error (m) TableAlgorithm 4. Real measurement Number results Crossed usg feature Obstacles f dis cell size = 1 m. Path length = 347 m. 5% 9% ihde 15 1.2861 2.6858 Cumulative Error (m) ihde Algorithm + CRF Number Crossed Obstacles 1.634 2.2316 5% 9% 4. Conclusions ihde 15 1.2861 2.6858 ihde + CRF 1.634 2.2316 The presented research has demonstrated successful use CRF as a model fle map matchg process. Our CRF algorithm is able correct trajecries produced by localization 4. Conclusions systems when given appropriate map formation. Grid cells fixed length were used for map Therepresentation, presented research a has cell size demonstrated 1 m producg successful acceptable use results. CRF The as use a model a larger cell size fle mapachieved matchg less process. accurate Our results, CRF maly algorithm due isobstacles able blockg correct trajecries entire cells, produced a feature unsuitable by localization for systems sites when narrow given areas appropriate such as corridors. map formation. On or h, Grid although cells fixed smaller length cells were should used provide for more accurate results, y also potentially crease occurrence divergence problem map representation, a cell size 1 m producg acceptable results. The use a larger cell size occurs when trajecries are stuck side small semi-enclosed areas. Even though experiments achieved less accurate results, maly due obstacles blockg entire cells, a feature unsuitable for were carried out pedestrians md, same algorithm can be applied any object movg sites narrow areas such as corridors. On or h, although smaller cells should provide normal pedestrian speed range; this is because algorithm can be loosely coupled more any accurate localization results, system y also is potentially dependent crease system occurrence implementation, divergence stead dealg problem occurs only when its output trajecries coordates. are stuck side small semi-enclosed areas. Even though experiments were carried Our future out work pedestrians will first volve md, fdg same methods algorithm can which be applied solve any stuck object problem, movg possibly normal by addg pedestrian more semantic speed range; formation this is because such as rooms algorithm doors can be loosely map coupled model. In anyaddition, localization usg system more context is dependent formation addg systemore implementation, algorithm features stead can dealg help furr only its output improve coordates. results; people behavior related buildg structure can be anor source Our future work will first volve fdg methods which solve stuck problem, possibly by addg more semantic formation such as rooms doors map model. In addition, usg

Sensors 16, 16, 132 15 16 more context formation addg more algorithm features can help furr improve results; people behavior related buildg structure can be anor source formation we tend employ order improve accuracy. Explorg ways which use CRF model efficiently for onle applications is anor future task we will work on. Acknowledgments: This work was supported by Spanish Mistry Economy Competitiveness as part ESPHIA project (TIN14-5642-JIN), as well as by Erasmus Mundus Avempace II project (12-2622/1-1-EMA2). Author Contributions: Safaa Bataeh wrote paper, designed system, developed CRF algorithm map model, performed experiments analyzed data; Alfonso Bahillo supervised coordated overall process, contributed development testg algorithm reviewed paper; Luis E. Díez developed PDR localization system, provided put data, reviewed paper; Enrique Onieva reviewed paper; Ikram Bataeh helped aucad drew buildg map usg AuCAD. Conflicts Interest: The authors declare no conflict terest. Abbreviations GNSS CRF HMM PDR DXF CDF ihde Global Navigation Satellite System Conditional Rom Fields Hidden Marcov Models Pedestrian Dead-Reckong Drawg Interchange file format Cumulative Distribution Function improved Heuristic Drift Elimation References 1. Klepeis, N.E.; Nelson, W.C.; Ott, W.R.; Robson, J.P.; Tsang, A.M.; Switzer, P.; Behar, J.V.; Hern, S.C.; Engelmann, W.H. The National Human Activity Pattern Survey (NHAPS): A resource for assessg exposure environmental pollutants. J. Expo. Anal. Environ. Epidemiol. 1, 11, 231 252. [CrossRef] [PubMed] 2. Shang, J.; Hu, X.; Gu, F.; Wang, D.; Yu, S. Improvement Schemes for Indoor Mobile Location Estimation: A Survey. Math. Probl. Eng. 15, 15, 397298. [CrossRef] 3. Quddus, M.A.; Ochieng, W.Y.; Nol, R.B. Current map matchg algorithms for transport applications: State-- art future research directions. Transp. Res. C Emerg. Technol. 7, 15, 312 328. [CrossRef] 4. Arulampalam, M.S.; Maskell, S.; Gordon, N.; Clapp, T. A turial on particle filters for onle nonlear/non-gaussian Bayesian trackg. IEEE Trans. Signal Process. 2, 5, 174 188. [CrossRef] 5. Davidson, P.; Coll, J.; Takala, J. Application particle filters for door positiong usg floor plans. In Ubiquius Positiong Indoor Navigation Location Based Service (UPINLBS); IEEE: New York, NY, USA, 1; pp. 1 4. 6. Klepal, M.; Pesch, D. A bayesian approach for rf-based door localization. In Proceedgs 4th International Symposium on Wireless Communication Systems ISWCS, Trondheim, Norway, 17 19 Ocber 7; pp. 133 137. 7. Klepal, M.; Beauregard, S. A backtrackg particle filter for fusg buildg plans PDR displacement estimates. In Proceedgs 5th Workshop on Positiong, Navigation Communication WPNC, Hannover, Germany, 27 March 8; pp. 7 212. 8. Klger, R.; Tomanek, K. Classical Probabilistic Models Conditional Rom Fields; Algorithm Engeerg TU: North Rhe-Westphalia, Germany, 7. 9. Lafferty, J.; McCallum, A.; Pereira, F.C. Conditional rom fields: Probabilistic models for segmentg labelg sequence data. In Proceedgs 18th International Conference on Mache Learng, Williamswn, MA, USA, 28 June 1 July 1. 1. Ramos, F.T.; Fox, D.; Durrant-Whyte, H.F. CRF-Matchg: Conditional Rom Fields for Feature-Based Scan Matchg. In Robotics: Science Systems III; MIT Press: Cambridge, MA, USA, 7. 11. Pereira, F.C.; Costa, H.; Pereira, N.M. An f-le map matchg algorithm for complete map databases. Eur. Tranp. Res. Rev. 9, 1, 17 124. [CrossRef]

Sensors 16, 16, 132 16 16 12. Xiao, Z.; Wen, H.; Markham, A.; Trigoni, N. Lightweight map matchg for door localization usg conditional rom fields. In Proceedgs 13th International Symposium on Information Processg Sensor Networks IPSN-14, Berl, Germany, 15 17 April 14; pp. 131 142. 13. Xu, M.; Du, Y.; Wu, J.; Zhou, Y. Map Matchg Based on Conditional Rom Fields Route Preference Mg for Uncerta Trajecries. Math. Probl. Eng. 15, 15, 71795. [CrossRef] 14. Lamarche, F.; Donikian, S. Crowd virtual humans: A new approach for real time navigation complex structured environments. In Computer Graphics Forum; Blackwell Publishg, Inc.: Oxford, UK, 14; pp. 59 518. 15. Drawg Interchange File Formats, Release 12. Available onle: http://cnc25.free.fr/documentation/ format_dxf/dxf.pdf (accessed on 22 March 16). 16. Audesk, Inc. (n.d.) Drawg Interchange File Formats. Available onle: http://www.audesk.com/ techpubs/aucad/acadr14/dxf/drawg_terchange_file_formats.htm (accessed on 22 March 16). 17. Schäfer, M.; Knapp, C.; Chakraborty, S. Aumatic generation pological door maps for real-time map-based localization trackg. In Proceedgs 11 International Conference on Indoor Positiong Indoor Navigation (IPIN), Guimaraes, Portugal, 21 23 September 11; pp. 1 8. 18. Jordan, A. On discrimative vs. generative classifiers: A comparison logistic regression naive bayes. Adv. Neural Inform. Process. Syst. 2, 14, 841. 19. Forney, G.D., Jr. The viterbi algorithm. In Proceedgs IEEE; IEEE: New York, NY, USA, 1973; Volume 61, pp. 268 278.. Elsevier Health Sciences. Moderate Intensity Walkg Means 1 Steps Per Mute. ScienceDaily 21 March 9. Available onle: www.sciencedaily.com/releases/9/3/931794719.htm (accessed on 22 April 16). 21. Determe Your Stride. Available onle: https://cdn.shopify.com/s/files/1/196/4616/files/soleusdetermg_your_stride.pdf (accessed on 23 April 16). 22. Diez, L.E.; Bahillo, A.; Bataeh, S.; Masegosa, A.D. Enhancg Improved Heuristic Drift Elimation for Wrist-Worn PDR Systems Buildgs. In Proceedgs IEEE Vehicular Technology Conference, Nanjg, Cha, 15 18 May 16. 16 by authors; licensee MDPI, Basel, Switzerl. This article is an open access article distributed under terms conditions Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4./).