<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>TinyOdom: Hardware-Aware Efficient Neural Inertial Navigation</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>07/04/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10385251</idno>
					<idno type="doi">10.1145/3534594</idno>
					<title level='j'>Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies</title>
<idno>2474-9567</idno>
<biblScope unit="volume">6</biblScope>
<biblScope unit="issue">2</biblScope>					

					<author>Swapnil Sayan Saha</author><author>Sandeep Singh Sandha</author><author>Luis Antonio Garcia</author><author>Mani Srivastava</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Deep inertial sequence learning has shown promising odometric resolution over model-based approaches for trajectory estimation in GPS-denied environments. However, existing neural inertial dead-reckoning frameworks are not suitable for real-time deployment on ultra-resource-constrained (URC) devices due to substantial memory, power, and compute bounds. Current deep inertial odometry techniques also suffer from gravity pollution, high-frequency inertial disturbances, varying sensor orientation, heading rate singularity, and failure in altitude estimation. In this paper, we introduce TinyOdom, a framework for training and deploying neural inertial models on URC hardware. TinyOdom exploits hardware and quantization-aware Bayesian neural architecture search (NAS) and a temporal convolutional network (TCN) backbone to train lightweight models targetted towards URC devices. In addition, we propose a magnetometer, physics, and velocity-centric sequence learning formulation robust to preceding inertial perturbations. We also expand 2D sequence learning to 3D using a model-free barometric g-h filter robust to inertial and environmental variations. We evaluate TinyOdom for a wide spectrum of inertial odometry applications and target hardware against competing methods. Specifically, we consider four applications: pedestrian, animal, aerial, and underwater vehicle dead-reckoning. Across different applications, TinyOdom reduces the size of neural inertial models by 31× to 134× with 2.5m to 12m error in 60 seconds, enabling the direct deployment of models on URC devices while still maintaining or exceeding the localization resolution over the state-of-the-art. The proposed barometric filter tracks altitude within ±0.1m and is robust to inertial disturbances and ambient dynamics. Finally, our ablation study shows that the introduced magnetometer, physics, and velocity-centric sequence learning formulation significantly improve localization performance even with notably lightweight models.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Odometry is the fusion of onboard sensors for indirect estimation of an object's position and attitude under absence or in conjunction with infrastructure-dependent localization services <ref type="bibr">[5]</ref>. Given the widespread ubiquity of inertial measurement units (IMU), inertial odometry <ref type="bibr">[18,</ref><ref type="bibr">44,</ref><ref type="bibr">46,</ref><ref type="bibr">53,</ref><ref type="bibr">77]</ref> is a viable alternative available to localization applications demanding small footprint, low-access delay, low-power pathway, and operating in GPS or network-denied environments. Examples of such applications include terrestrial and marine "search and rescue" missions <ref type="bibr">[82]</ref>, underwater sensor networks <ref type="bibr">[15]</ref>, oceanic biodiversity and marine health tracking <ref type="bibr">[88]</ref>, wildlife monitoring <ref type="bibr">[89]</ref>, deep-space small satellite localization <ref type="bibr">[73]</ref>, and localizing micro unmanned vehicles and robots <ref type="bibr">[10,</ref><ref type="bibr">29,</ref><ref type="bibr">96]</ref>. For example, marine search and rescue missions <ref type="bibr">[82]</ref> limit the compute device payload and resource availability (e.g., rescuers can only carry limited weight), and cannot assume continuous access to GPS or network infrastructure (e.g., the rescue operation can happen underground). The use-case of marine health tracking <ref type="bibr">[88]</ref> and wildlife monitoring <ref type="bibr">[89]</ref> necessitate odometry solutions that can operate in the absence of infrastructure and have a light payload of deployment hardware not impacting the normal animal behavior. Further, localizing micro unmanned vehicles and robots <ref type="bibr">[10,</ref><ref type="bibr">29,</ref><ref type="bibr">96]</ref> demand a small footprint solution due to compute and energy constraints. These environments represent scenarios where compute devices are ultra-resource constrained, thus necessitating the need to develop lightweight approaches where the smartphone or cloud-based solutions are unusable. However, adopting internal odometry for resource-constrained hardware and across different use-cases is challenging, as discussed next.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.1">Challenges</head><p>To handle the error explosion inherent in inertial navigation, inertial odometry on URC microcontroller-class hardware is heavily hard-coded through application-specific heuristics, Bayesian statistics, and human-engineered system models. These techniques, although lightweight, are not robust to domain shifts or inertial perturbations <ref type="bibr">[10,</ref><ref type="bibr">16,</ref><ref type="bibr">46]</ref>. Recently, several data-driven techniques based on sequence learning have been used in the attempt to alleviate the constraints in model-based approaches for various applications <ref type="bibr">[10,</ref><ref type="bibr">29,</ref><ref type="bibr">35,</ref><ref type="bibr">74,</ref><ref type="bibr">96]</ref>. However, enabling accurate yet lightweight and real-time neural-inertial methods for resource-constrained environments faces the following challenges &#8226; The Real-time Deployment on URC devices: While neural-inertial methods have been shown to provide superior long-term resolution over classical techniques <ref type="bibr">[16,</ref><ref type="bibr">46,</ref><ref type="bibr">74]</ref>, they are unsuitable for realtime deployment <ref type="bibr">[18,</ref><ref type="bibr">35]</ref> on URC hardware due to memory, power, and compute constraints. Consequently, no prior work has shown neural-inertial architectures running in real-time under extremely resourceconstrained settings (e.g., 128 kB RAM, 1 MB flash). &#8226; The Run-Time Robustness of Existing Approaches: Existing neural-inertial methods suffer from gravity pollution, high-frequency inertial artifacts, varying device attitude, heading-rate singularity, and 3D estimation failure. The current solutions come at the cost of larger neural network models, auxiliary ML operations, or the addition of model-based filters <ref type="bibr">[29,</ref><ref type="bibr">46,</ref><ref type="bibr">59,</ref><ref type="bibr">74,</ref><ref type="bibr">96]</ref>. &#8226; The Realization of 3-D Odometry: While classical methods can perform 3D odometry via sensor fusion without significant compute overhead, the data-driven neural-inertial methods thus far have been mostly limited to 2D tracking only <ref type="bibr">[59]</ref>. Data-driven methods which attempt to perform 3D tracking with inertial sensors suffer from the curse of inertial drift and gravity pollution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.2">Contributions</head><p>We introduce TinyOdom, a systematic and practical framework for deploying lightweight yet robust 3D inertial odometry models on URC hardware. TinyOdom leverages advances in NAS to optimize inertial sequence learning models based on hardware constraints, accuracy, and latency goals via direct communication with target hardware. In addition, TinyOdom uses a magnetometer, physics, and velocity-centric sequence learning formulation with a TCN backbone, allowing tiny models to perform accurate inference even under inertial disturbances while maintaining the simplicity of models. To expand 2D tracking to 3D, we perform sensor fusion using barometric g-h filters robust to inertial and environmental variations. To showcase the generalizability of TinyOdom, we evaluate pedestrian, animal, aerial, and underwater vehicle dead-reckoning on four different URC hardware platforms. TinyOdom reduces the neural network model size between 31&#215; to 134&#215; with 2.5m to 12m error in 60 seconds over the state-of-the-art (SOTA), thereby enabling the direct deployment of neural-inertial odometry using the onboard compute resources of URC hardware platforms. Even though our neural network models are notably lightweight, the introduced magnetometer, physics, and velocity-centric sequence learning formulation still maintain or exceed the tracking performance compared to the existing state-of-the-art. We evaluate the proposed barometric g-h filter showing it outperforms the baselines and is robust to pressure sensor noises in real data. The superior and lightweight real-time inertial tracking enabled by TinyOdom holds the key to improving the tracking performance of applications deployed in challenging GPS/network denied environments. Our work not only enables always-on and lightweight neural-inertial navigation, but also improves the cost and the energy footprint of embedded odometry while being expandable to any reduced footprint hardware.</p><p>Our contributions are summarized as follows:</p><p>&#8226; We propose a magnetometer, physics, and velocity-centric inertial sequence formulation to generate models robust to gravity pollution, high-frequency inertial perturbations, varying sensor attitude, and heading rate singularity, without adding significant compute overhead. &#8226; We develop a hardware-in-the-loop (HIL) AutoML framework based on Bayesian Optimization (BO) to generate lightweight inertial odometry models without sacrificing resolution significantly. We use a TCN backbone as the basis for NAS and TensorFlow Lite Micro (TFLM) as model runtime interpreter. &#8226; We exploit the omnipresence of barometers to expand 2D dead-reckoning to 3D using lightweight barometric &#120572; -&#120573; filters that are robust to inertial and environmental variations. The filter can perform altitude tracking within &#177;0.1m. &#8226; We extensively benchmark TinyOdom for pedestrian, animal, aerial, and underwater vehicle dead-reckoning on four different URC hardware platforms against competing inertial odometry baselines, based on accuracy and resource usage. &#8226; To the best of our knowledge, we are the first to showcase a real-world evaluation of neural-inertial navigation and discuss challenges and solutions of transferring pre-trained odometry models in the real world.</p><p>TinyOdom is available open-source<ref type="foot">foot_2</ref> to promote development and benchmarking of lightweight yet robust neural inertial odometry that is generalizable across different applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.3">Organization</head><p>The rest of the paper is organized as follows: Section 2 mathematically motivates the challenges of localization using an inertial sensor. Section 3 presents the related work that attempts to mitigate the challenges in inertial tracking, as well as recent advances in lightweight deep-learning. Section 4 details the robust 3D inertial sequence learning formulation. Section 5 delineates the model architecture and the hardware-aware NAS formulation. Section 6 presents the experimental setup, baseline algorithms, and datasets used for evaluation. Section 7 presents extensive experimental evaluation of the models generated by the TinyOdom framework. Finally, Section 8 provides concluding remarks and future directions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">BACKGROUND</head><p>MEMS inertial sensors are usually equipped with a 3DoF accelerometer, a 3DoF gyroscope, and a 3DoF magnetometer <ref type="bibr">[50]</ref>. Firstly, when the gyroscope is mounted on an immobile platform w.r.t Earth frame close to the Earth's surface, the gyroscope within a MEMS inertial sensor is modeled as follows <ref type="bibr">[50]</ref>:</p><p>where, &#119887; &#119892; &#8764; N (0, &#119876; &#119892; ) = bias gradient, &#119899; &#119892; &#8764; N (0, &#931; &#120596; ) = additive white Gaussian noise (AWGN), and &#120596; &#119899;&#119887; = latent and uncorrupted angular velocity. Secondly, assuming negligible effects centrifugal or Coriolis components of Earth's rotation, the accelerometer model is defined as <ref type="bibr">[50]</ref>:</p><p>where, &#119886; &#119899;&#119899; = latent linear acceleration of body, &#119892; = gravity vector, &#119887; &#119886; &#8764; N (0, &#119876; &#119886; ) = bias gradient, and &#119899; &#119886; &#8764; N (0, &#931; &#119886; ) = AWGN. Lastly, the compass can be modeled as <ref type="bibr">[50]</ref>:</p><p>where, &#119899; &#119887; &#8764; N (0, &#931; &#119898; ) = AWGN, and &#120575; = magnetic inclination due to Earth's magnetic dip. Under ideal geomagnetic conditions void of magnetic disturbances, non-uniform magnetic field, or sensor noise, and for slow movements, the heading &#119867; can be estimated directly from the magnetometer <ref type="bibr">[88]</ref> in the body frame &#119868; :</p><p>The latitude (&#120601;) and longitude (&#120582;) can be hypothetically obtained via double integration of accelerometer readings (&#119886; &#119868; &#119909; , &#119886; &#119868; &#119910; , &#119886; &#119868; &#119911; ) under empirical accelerometer vector sum threshold &#120572; <ref type="bibr">[88]</ref> to reject noise:</p><p>While magnetometers are unpolluted by device motion <ref type="bibr">[70]</ref>, magnetic disturbances coupled with sensor placement offset can affect the seemingly simple estimation of &#119867; and lead to errors as much as 100 &#8226; <ref type="bibr">[94]</ref>. Furthermore, naive double integration (NDI) of accelerometer readings cumulatively accumulates the effects of time-varying bias (&#119887; &#119886; ), gravity pollution (&#119892;), and AWGN (&#119899; &#119886; ), causing errors in &#120601; and &#120582; to explode in a cubic manner <ref type="bibr">[46,</ref><ref type="bibr">62,</ref><ref type="bibr">70,</ref><ref type="bibr">93]</ref>, illustrated in Fig. <ref type="figure">1</ref>. The gyroscope suffers from time-varying drift (&#119887; &#119892; ) in the long term because of bias instability (BI) and angular random walk (ARW) resulting from AWGN (&#119899; &#119892; ), pink noise and thermal effects <ref type="bibr">[62]</ref>. The cubic explosion of error in position estimate, &#120590; &#119909; (&#119905;), due to gyroscope drift can be modelled as:</p><p>The goal of inertial odometry is to address the cumulative error in naive double integration of accelerometer readings. Conventional approaches use model-based methods that are dependent on application-specific heuristics and demand expert domain knowledge. More recently, learning-enabled approaches are proposed that either work in combination with model-based methods or work in an end-to-end manner, completely replacing modelbased methods. In the next section, we present the existing state-of-the-art in both model-based methods and learning-enabled approaches. We also briefly discuss recent advances in lightweight deep learning.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">RELATED WORK</head><p>In this section, we provide a comprehensive review of the recent advances in inertial odometry and efficient DL for URC devices, outlining their strengths and weaknesses. Inertial localization can be categorized into model-based systems using Bayesian filters and heuristics, or learning-enabled systems exploiting recent advances in DL <ref type="bibr">[46]</ref>. Software advances in TinyML include the use of pruning, quantization and model compression, lightweight neural blocks, hardware-aware NAS and the rise of commercial off-the-shelf (COTS) tools <ref type="bibr">[64,</ref><ref type="bibr">67]</ref> </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Model-Based Inertial Odometry</head><p>Model-based inertial dead-reckoning frameworks typically employ multimodal fusion via physics-based and heuristic priors with occasional support from infrastructure-dependent position fixes, along with the application of Bayesian filters for error handling <ref type="bibr">[46]</ref>. These approaches are commonly hard-coded for specific applications.</p><p>3.1.1 Vehicular, Robotic and Animal Localization. Depending on the target application and topography, heuristic drift reduction, magnetic anomaly detection, opportunistic calibration, quasi-static moment detection, particle filters, magnetic map matching, and inertial signature verification are used to counteract heading estimation error <ref type="bibr">[47,</ref><ref type="bibr">70,</ref><ref type="bibr">91,</ref><ref type="bibr">94,</ref><ref type="bibr">99]</ref>, typically fused through an error-tracking indirect Kalman filter (KF). For displacement estimation, unmanned aerial, ground, and underwater vehicles (UAV, UGV, and UUV) typically fuse inertial sensors with GPS, LIDAR, camera, and RADAR via KF variants for localization, complemented via map information from known localization space <ref type="bibr">[3,</ref><ref type="bibr">53]</ref>. Typical aid includes magnetic map matching, flow-sensors, and wheel odometers, with nonholonomic constraints on the motion. Satellites and spacecraft perform non-linear Bayesian fusion of physics-based kinematics models with inertial sensor measurements for attitude estimation <ref type="bibr">[22]</ref>, coupled with position information from GPS, kinematics models (e.g. ephemeris and almanac), relative angle measurements (e.g. parallax) or ground control <ref type="bibr">[38,</ref><ref type="bibr">61]</ref>. For slow and predictable motion profiles such as in wildlife tracking, ecologists formulate animal-specific belief-based constraints on velocity, transportation modes, and Boolean decision-trees to mitigate drifts and sensor errors, occasionally fusing GPS through KF variants when available <ref type="bibr">[87]</ref><ref type="bibr">[88]</ref><ref type="bibr">[89]</ref>.</p><p>3.1.2 Pedestrian Dead Reckoning (PDR). PDR systems typically decompose position estimation problems into direction estimation and stride length estimation <ref type="bibr">[94]</ref>, the latter of which is further partitioned into transportation mode classification, gait cycle segmentation, and step length estimation (SLE) subject to environmental constraints and iterative updates <ref type="bibr">[44,</ref><ref type="bibr">47,</ref><ref type="bibr">91]</ref>. For dead-reckoning via foot-mounted IMU, information about the linear and angular velocities of the foot during the swing and stance phases for various motion primitives can be exploited to constrain the explosion of errors in step counting <ref type="bibr">[33,</ref><ref type="bibr">47,</ref><ref type="bibr">91]</ref>. This is referred to as zero velocity update (ZUPT) or zero angular rate update (ZARU) pseudo-measurements <ref type="bibr">[49]</ref>, segregating the gait cycle into identifiable chunks either coarsely or granularly <ref type="bibr">[47]</ref>. Temporal and frequency-domain analysis (e.g., wavelet and Fourier transforms, level crossing detection, extrema detection, autocorrelation, Hidden Markov Models (HMM), and local variance detection) are used to extract recurrent and temporal contextual dynamics in the gait cycle to improve the robustness of gait phase identification against AWGN for various activity modes <ref type="bibr">[2,</ref><ref type="bibr">47,</ref><ref type="bibr">91,</ref><ref type="bibr">94]</ref>. Typical SLE approaches include physiological knowledge injection (e.g., Weinberg SLE), linear regression upon step frequency with aiding covariance heuristics, global acceleration extrema difference, knowledge of virtual landmarks, and floor plans or use of KF variants <ref type="bibr">[44,</ref><ref type="bibr">47,</ref><ref type="bibr">56,</ref><ref type="bibr">83,</ref><ref type="bibr">91,</ref><ref type="bibr">94]</ref>.</p><p>While model-based inertial localization systems are computationally efficient, designing generalizable heuristics poses a significant hurdle in the deployment of real-time inertial dead-reckoning systems, with no "one size fits all" analytical solution to the problem. The system models used by model-based approaches are linear approximations of the state evolution in the real world, which do not translate accurately in the long run for eclectic scenarios due to non-optimal parametrization. In contrast, in TinyOdom, we propose an end-to-end learning-based framework that is generalizable across different applications. We show that TinyOdom develops machine learning models that are superior to model-based methods and are deployable on resource constraint devices. We outline existing data-driven techniques in the next subsection.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Data-Driven Inertial Odometry</head><p>To handle the shortcoming of model-based methods, researchers have recently proposed several ML approaches capable of capturing high-dimensional contextual dynamics in the non-linear domain void of human knowledge. Next, we categorize existing approaches based on the role of data-driven components. They are either used in combination with model-based methods or are completely replacing them in an end-to-end manner.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.1">Aiding</head><p>Model-Based Systems. Deep neural networks (DNN) are adept at filtering out noise and irrelevant information while extracting useful features from sensors in the wild <ref type="bibr">[66]</ref>. Intuitively, a hands-off generalizable solution for the curse of drift in inertial odometry involves eliminating the root of sensing uncertainty on the fly before the model-based position estimation step using DL models. Affixing a neural network block dedicated to denoising in the Bayesian state estimation framework yields real-time and on-the-fly noise reduction while being invariant to random gyrations and actuator micro-vibrations, exhibiting generalizability under unseen trajectory projections and robustness to training data anomalies and domain shift <ref type="bibr">[1,</ref><ref type="bibr">11,</ref><ref type="bibr">12,</ref><ref type="bibr">98</ref>]. An alternative approach involves using DNN or reinforcement-learning (RL) agents to dynamically and tightly update KF noise covariance parameters instead of sensor errors <ref type="bibr">[10,</ref><ref type="bibr">36,</ref><ref type="bibr">90]</ref>. In this case, the filter is non-agnostic to the corrections being made by the DNN, leading to estimates that are statistically Pareto-optimal under non-ideal gradient descent convergence. A parallel technique uses DNN as tightly coupled state advisors, providing indirect momentary pseudo-measurements about position and orientation (such as velocity and heading) from a finite window of raw inertial readings to physics-based filters to aid decision making under a broad spectrum of motion primitives, topography, environment, sensor-placement and test subjects <ref type="bibr">[20,</ref><ref type="bibr">59,</ref><ref type="bibr">72]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.2">Velocity-Profile Heuristics.</head><p>For non-Bayesian filters such as in PDR, DL-based velocity profile detectors (ZUPT and ZARU) and SLE can extract coveted velocity intervals for step detection and adapt stride length based upon discerned motion patterns <ref type="bibr">[80,</ref><ref type="bibr">81]</ref> for varying gait patterns and sensor placements. In the case of wheeled robots, DL-based ZUPT and ZARU allow attitude and bias corrections, with priors on lateral and vertical velocity to improve long-term position estimation accuracy <ref type="bibr">[9]</ref>. RIDI <ref type="bibr">[93]</ref> used classical ML to detect sensor placement and regress velocity and direction to correct accelerometer readings for usable double integration within a stabilized-inertial frame for various transportation modes.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>3.2.3</head><p>End-to-End Frameworks. Model-based filters require an accurate representation of the evolution of sensor errors and state estimates in terms of the incoming measurements. Such system models are only linear approximations and are unable to optimally control error explosion from naive double integration due to deviations from mathematical abstractions for non-linear complex motions or deployment in different domains <ref type="bibr">[16,</ref><ref type="bibr">46]</ref>. IONet <ref type="bibr">[16]</ref> introduced the concept of sequence learning for dead-reckoning, resulting in the first end-to-end neural-inertial model capable of trajectory estimation in presence of non-linearities associated with inertial localization which are otherwise hard to model mathematically, including effects of unrestricted sensor orientation and position, different test subjects, diverse motion primitives and abnormalities, decoupling individual sensor errors and biases, sampling rate jitter and physical characteristics of the sensors. Notable successors of IONet include RoNIN <ref type="bibr">[46]</ref>, IDOL <ref type="bibr">[74]</ref> and L-IONet <ref type="bibr">[18]</ref> for PDR, AbolDeepIO for aerial vehicle localization <ref type="bibr">[29]</ref>, VeTorch for UGV localization <ref type="bibr">[35]</ref> and NavNet <ref type="bibr">[96]</ref> for UUV positioning. MotionTransformer uses a transformer network to generate domain invariant inertial sequences from raw sensor data from various sensor placements, rotations, or motion types in a completely unsupervised fashion, without requiring the exhaustive collection of labeled domain-specific datasets <ref type="bibr">[17]</ref>.</p><p>Out of the proposed data-driven methods, data-driven end-to-end frameworks are preferred, as they are not dependent on any domain heuristics and have shown superior performance <ref type="bibr">[16,</ref><ref type="bibr">18,</ref><ref type="bibr">46]</ref> over model-based techniques. However, currently, none of the data-driven methods are suitable for real-time deployment on URC devices. Among all of the data-driven techniques, only L-IONet <ref type="bibr">[18]</ref>, VeTorch <ref type="bibr">[35]</ref> and the two frameworks by Brossard et al. <ref type="bibr">[10,</ref><ref type="bibr">12]</ref> were designed with efficiency in mind to run in real-time on smartphones. The constraints of URC devices (e.g., a typical microcontroller has 128 KB RAM and 1 MB of flash) demand extremely lightweight machine learning models in comparison to a smartphone, which can have 4 GB of RAM and 64 GB of storage <ref type="bibr">[57]</ref>. TinyOdom is designed to address the gap of enabling neural inertial odometry on ultra-resource-constrained devices. TinyOdom reduces the model size between 31&#215; to 134&#215; in comparison to the existing data-driven methods. Even though our models are lightweight, TinyOdom either maintains or exceeds the tracking performance in comparison to the existing SOTA due to a novel magnetometer, physics, and velocity-centric inertial sequence formulation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Deep-Learning for URC devices</head><p>Several libraries exist that enable the transfer of trained machine learning models generated by well-known libraries (such as Tensorflow) to microcontrollers. These libraries include TensorFlow Lite Micro <ref type="bibr">[23,</ref><ref type="bibr">84]</ref>, CMSIS-NN <ref type="bibr">[54]</ref>, uTensor <ref type="bibr">[75]</ref>, and Microsoft EdgeML <ref type="bibr">[24,</ref><ref type="bibr">25,</ref><ref type="bibr">39,</ref><ref type="bibr">40,</ref><ref type="bibr">42,</ref><ref type="bibr">51,</ref><ref type="bibr">52,</ref><ref type="bibr">65]</ref>. Such libraries provide comprehensive sets of optimized ML operators, algorithms, and tools, perform pruning, quantization (fixed and mixed precision), and model compression <ref type="bibr">[43]</ref> and convert models to deployable C code. However, these libraries assume that the trained model can fit within the device resource constraints. To satisfy the tighter hardware constraints of URC devices, neural architecture search (NAS) needs to be optimized by target hardware specifications to strike a balance between accuracy and efficiency <ref type="bibr">[30,</ref><ref type="bibr">57]</ref> tradeoff.</p><p>Several NAS frameworks have been proposed for microcontroller-class devices. SpArSe <ref type="bibr">[30]</ref> treats NAS as a gradient-driven multi-objective BO problem, treating hardware attributes via proxies and coupling pruning with NAS. MicroNets <ref type="bibr">[6]</ref> uses a quantization-aware gradient-driven approach to optimize task-aware DNN backbones. MCUNet <ref type="bibr">[57]</ref> tailors Once-for-All (OFA) NAS <ref type="bibr">[14]</ref> for microcontrollers, using a two-stage evolutionary NAS to train a single OFA network in an optimized search space for a broad spectrum of target hardware. Adopting MCUNet is a challenge as it uses a custom inference engine and its latency/resource measurements rely on a closed-source software stack. In TinyOdom, we perform hardware-aware NAS using multi-objective BO, where the acquisition function is optimized using Monte Carlo sampling. We adopt BO due to the following reasons: (i) BO provides a state-of-the-art approach to optimize expensive objective functions in a few evaluations <ref type="bibr">[69]</ref>, (ii) BO allows explicit inclusion of non-gradient-friendly constraints of the model size and accuracy tradeoffs during the training process <ref type="bibr">[30]</ref>. The choice of Monte Carlo sampling instead of the gradient-driven approach of SpArSe <ref type="bibr">[30]</ref> is based on the fact that neural architecture search space consists of categorical variables where the sampling approach evaluates the acquisition function only at valid configurations only <ref type="bibr">[37,</ref><ref type="bibr">68]</ref>. TinyOdom includes the hardware-aware training where the resource utilization of a model is computed at runtime by its real deployment on the target hardware, instead of just using proxies as done by SpArSe <ref type="bibr">[30]</ref>. Our evaluation shows that proxies are only approximations of the real hardware constraints, which are noisy for extremely resource-constrained devices. To break the cycle of continuous integration and error propagation, IONet <ref type="bibr">[16]</ref> proposed inertial sequence learning based on Newtonian physics. The goal is to estimate the change in navigation state over pseudoindependent inertial windows rather than absolute coordinates, constraining the ball of outputs for a neural network &#119891; to model. Under loose nonholonomic constraints and in polar coordinates, &#119891; is given as:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">ROBUST 3D INERTIAL SEQUENCE LEARNING</head><p>where, &#916;&#119905; = &#119905; : &#119905; -&#119899;, referring to a window of accelerometer &#226;&#119868; and gyroscope &#373;&#119868; samples of length &#119899;. The task involves estimating the initial velocity v &#119868; (0) and gravity g &#119868; 0 in each window, which are treated as latent states. Instead, &#119891; outputs heading rate &#916;&#120595; &#119905; and displacement &#916;&#119897; &#119905; in the azimuthal plane. However, as we will showcase, the vanilla inertial sequence learning formulation suffers from gravity pollution, high-frequency inertial perturbations, varying sensor attitude, and heading rate singularity. We introduce a magnetometer, physics, and velocity-centric inertial sequence formulation robust to aforementioned problems, summarized in Fig. <ref type="figure">2</ref>. 4.0.1 Latent Heading Information. Gravity-aligned coordinate frames <ref type="bibr">[46]</ref> are polluted by continuous translational motion due to the mixture of linear and gravitational acceleration. Gravity pollution can induce short-term offsets in the estimated orientation, leading to large velocity projection errors <ref type="bibr">[70]</ref>. In addition, gyroscope BI and ARW generate long-term drift in the latent attitude estimate, further degenerating coordinate frame normalization in sensor fusion. As a result, we feed &#119891; with local magnetometer measurements &#119868; m to provide additional latent information about device attitude and body heading, globally anchored by the 3D magnetic North N &#119866; . Magnetometers are motion-agnostic and do not suffer from long-term drift <ref type="bibr">[70]</ref>. &#119868; m provides an additional anchor N &#119868; 0 to correct and constrain implicit estimation of g &#119868; 0 and v &#119868; (0) for each window, robust to varying sensor orientation, gravity pollution and continuous movements (e.g., circular trajectories). Furthermore, to emulate unrestricted sensor attitude and noise characteristics, we perform data augmentation during training via controlled random rotation R of inertial channels and addition of multivariate Gaussian noise N <ref type="bibr">[81]</ref>:</p><p>4.0.2 Physics Metadata Channel. Changes in sensor orientation and placement, hardware noise, ferromagnetic disturbances and body heading without linear movements can induce high-frequency inertial signatures, which can falsely trigger &#119891; to output invalid displacements. We supply &#119891; with latent valid motion metadata &#119888; &#119905; (&#8226;) based on Newtonian kinematics to suppress the effects of high-frequency inertial artifacts. Specifically, we want &#119891; to be activated only when significant positional transitions have occurred. For humans, legged robots and terrestrial animals, &#119888; &#119905; (&#8226;) corresponds to a local-variance step detector binary mask <ref type="bibr">[71]</ref>:</p><p>where, &#226;&#119868;</p><p>, &#120577; is a tunable parameter and &#119866; 5,&#119891; &#119888; (&#8226;) represents a 5th order low-pass filter with cutoff &#119891; &#119888; . For vehicles, &#119888; &#119905; (&#8226;) signifies one of four transportation modes (stationary, accelerating, decelerating and constant speed) inferred through the discrete Fourier transform of | &#119868; &#226;&#916;&#119905; | <ref type="bibr">[63]</ref>:</p><p>where &#120574; &#119896; represents predefined threshold for &#119896;th transportation mode. The transportation mode metadata is important particularly to aid &#119891; better differentiate between constant velocity and stationary period inertial signatures.</p><p>4.0.3 Heading Rate Singularity. The ground truth heading rate &#916;&#120595; &#119905;,&#119892; is given as:</p><p>where,</p><p>&#119871; &#119894;,&#119892; represents ground truth location. As &#916;&#119871; &#119910;,&#119892; &#8743; &#916;&#119871; &#119909;,&#119892; &#8594; 0, &#916;&#120595; &#119905;,&#119892; &#8593;, leading to large spikes in heading rate. These outliers can severely degrade the performance of deep neural architectures <ref type="bibr">[45]</ref> using mean squared error (MSE) loss. As a result, we modify the inertial sequence learning problem to regress &#119909; and &#119910; velocities rather than displacements and heading rates. Combined with latent heading and physics metadata channel, &#119891; is given as:</p><p>We use strided velocity loss <ref type="bibr">[46]</ref> for optimizing the parameters &#120579; of &#119891; :</p><p>The location at time &#119905; for sliding window with stride &#119904; and length &#119899; is given by:</p><p>4.0.4 Z-axis Dead-Reckoning. Barometric sensors share many common coveted characteristics with inertial sensors <ref type="bibr">[76]</ref>, resulting in their widespread availability in current electronic systems <ref type="bibr">[58]</ref>. We complement 2D sequence learning with altitude estimate by exploiting existing barometric chips to provide 3D dead-reckoning. We designed a model-free barometric &#120572; -&#120573; filter <ref type="bibr">[8]</ref>[86] with thermocline, salinity, noise and timestamp jitter mitigation <ref type="bibr">[32]</ref>. The altitude measurements &#119871; &#119911;,&#119898; at timestep &#119905; are given by:</p><p>where, &#119875; &#119905;,m = pressure measurement, &#119872; = air molar mass, &#119892; = gravitational acceleration, &#119877; = gas constant, &#119879; &#119888;,&#119905; = temperature in Celsius (from barometer) and &#119875; 0 = average sea level pressure (kPa). Furthermore:</p><p>where, &#119873; (&#119879; &#119888;,&#119905; ) &#8592; &#120574;10 &#119895; &#119879; &#119896; &#119888;,&#119905; , &#119872; (&#119879; &#119888;,&#119905; , &#119904;) &#8592; &#120583;10 &#119897; &#119879; &#119899; &#119888;,&#119905; &#119904; &#119902; + &#119873; (&#119879; &#119888;,&#119905; ), &#119904; = salinity of fluid and &#120583;, &#120574;, &#119895;, &#119896;, &#119897;, &#119899; and &#119902; are constants. The filter prediction steps are given by:</p><p>The update steps are given by:</p><p>&#119871; &#119911;,&#119905;,&#119901; altitude = &#119871; &#119911;,&#119905;,&#119901; + &#120572; (&#119871; &#119911;,&#119905;,&#119898; -&#119871; &#119911;,&#119905;,&#119901; )</p><p>&#119871; &#119911;,&#119905;,&#119901; refers to the vertical velocity of the object, &#916;&#119879; is the difference between current and previous timestamps and (&#120572;, &#120573;) are filter coefficients. Large values of &#120572; favor measurements over prediction, while large values of &#120573; increase the transient sensitivity of the filter. The barometric approach does not suffer from the effects of varying inertial sensor orientation and placement, gravity pollution, and unusual movements common in approaches using inertial sensors to regress height <ref type="bibr">[59]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">HARDWARE-AWARE INERTIAL NAVIGATION</head><p>In this section, we present the details of the neural network architecture adopted by TinyOdom (Section 5.0.1) and our NAS approach to enable deployments on URC devices (Section 5.0.2) 5.0.1 Backbone Neural Architecture. We use a TCN <ref type="bibr">[55,</ref><ref type="bibr">78]</ref> to model &#119891; <ref type="bibr">[10,</ref><ref type="bibr">18,</ref><ref type="bibr">35]</ref>, which can jointly handle spatial and temporal features hierarchically. The receptive field &#119865; &#119894; of each unit in the &#119894;th layer in a TCN dilated causal kernel of size &#119896; &#215; &#119896; with dilation factor &#119897; is given by:</p><p>&#119865; &#119894;,TCN is larger than &#119865; &#119894;,CNN , which is &#119894; &#215; (&#119896; -1) + &#119896;. Without explosion of parameter, memory footprint, layer count or overfitting, TCN kernels allow the network discover global context in long inertial sequences while maintaining input resolution and coverage. Causal convolutions maintain temporal ordering without requiring computationally intensive recurrent units, supporting out-of-order parallelization during training. In addition, two stacks of dilated causal convolution layers are fused through gated residual blocks z for expressive yet bounded non-linearity, complex interactions and temporal correlation modeling in the input sequence:</p><p>5.0.2 Neural Architecture Search. To find the ideal neural inertial candidate from the backbone TCN for limited flash, RAM, and latency requirements, we model the search as a parallelizable black-box BO problem. The search space &#937; consists of neural network weights &#119908;, hyperparameters &#120579; , network structure denoted as a directed acyclic graph (DAG) &#119892; with edges &#119864; and vertices &#119881; representing activation maps and common ML operations &#119907; (e.g., convolution, batch normalization, pooling, etc.) respectively, which act on &#119881; . The goal is to find a neural network that maximizes the hardware SRAM and flash usage within the device capabilities while minimizing latency and validation RMSE.</p><p>where</p><p>&#8734;, &#119891; flash (&#937;) &gt; flash max <ref type="bibr">(28)</ref> &#119891; latency (&#937;) = FLOPS FLOPS target FLOPS &#8744; HIL information Latency target latency (29)</p><p>The objective function &#119891; opt can be thought of as seeking a Pareto-optimal configuration of parameters &#937; * under competing objectives <ref type="bibr">[30]</ref> such that:</p><p>We use Gaussian process as the surrogate model to approximate &#119891; opt , which allows priors on the distribution of moments to propagate forward as the search progresses. In addition, the domain of random scalarizations &#120582; can be specified by the user to guide the parallel search acquisition functions (hallucination or K-means clustering) into the promising Pareto-optimal regions of the gradient plane. The acquisition function decides the next set of &#937; &#119899; to sample from the design space using Monte Carlo sampling with Bayesian Upper-Confidence Bounds (UCB), also known Thompson sampling, which balances exploration and exploitation <ref type="bibr">[68]</ref>. Apart from speeding up the NAS, parallel search ensures that NAS is not being performed on network morphs early on (exploitation) and information gain is maximized in the search process (exploration), yielding a stage-wise "coarse-to-fine" search space:</p><p>Firstly, validation RMSE serves as a proxy for the error characteristics &#119891; error (&#937;) of the model candidate. Secondly, when real hardware is absent, we use the size of the flatbuffer model schema &#8462; FB (&#8226;) <ref type="bibr">[23]</ref> as a proxy for flash usage. Thirdly, we use the standard RAM usage model as a proxy for SRAM usage &#119891; SRAM (&#937;), with intermediate layer-wise activation maps and tensors being stored in SRAM <ref type="bibr">[30]</ref>. Lastly, since model latency is linearly proportional to the FLOPS count for a variety of convolutional models for microcontrollers, we use FLOPS as a proxy for runtime latency &#119891; latency (&#937;) <ref type="bibr">[6]</ref>. When HIL is available, we obtain the SRAM, flash, and latency parameters directly from the target compiler and real-time operating system (RTOS). All hardware parameters are normalized by device capacity or target metrics. The entire NAS pipeline is summarized in Fig. <ref type="figure">3</ref>. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">EXPERIMENTAL SETUP</head><p>In this section, we provide details on the implementation of our hardware-aware robust 3D sequence learning framework. We list the domain space of the TCN backbone (Section 6.1) to be optimized by NAS. Next, we provide details on how we setup BO in Python (Section 6.2). Then, we outline the datasets (Section 6.3) used to train and benchmark the performance TinyOdom models and competing baselines (Section 6.4). Afterward, we list the performance metrics used for benchmarking (Section 6.5). Next, we provide details on the target hardware, host machine, and software specifications (Section 6.6). Finally, we provide details on our real-world experimental setup (Section 6.7).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1">NAS Search Space</head><p>Our TCN model consists of an input layer, followed by the TCN backbone. The hyperparameters to be optimized by the NAS framework for the TCN backbone are as follows:</p><p>&#8226; Number of filters: 2-64 &#8226; Dropout: 0.0-1.0</p><p>&#8226; Normalization: Weight, Layer, Batch The fixed parameters for the TCN backbone are as follows:</p><p>The outputs of the TCN backbone are reshaped, pooled, and flattened. The flattened vectors are fed to a 32 unit fully-connected layer. The final output of the TCN model is x and y velocities.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.2">NAS Implementation</head><p>Our NAS implementation is based on the state-of-the-art open-source BO library called Mango <ref type="bibr">[68]</ref> <ref type="bibr">[69]</ref>. Our NAS implementation consists of three steps: (i) NAS search space definition, (ii) multi-objective function specifications, and (iii) hardware-in-the-loop or proxy constraints computation. Our NAS search space is a combination of categorical, integer, and continuous variables as shown in Section 6.1. This search space is realized using python constructs (lists, dictionaries) and SciPy <ref type="bibr">[79]</ref> distributions which are directly supported in Mango <ref type="bibr">[69]</ref>. We create &#119891; opt (Equation <ref type="formula">26</ref>) in Python, where the hardware metrics are computed either using proxies or hardware-inthe-loop. For training TCN models for each application, we run the BO search strategy for 50 iterations. The internal surrogate model used by our implementation is based on the Gaussian process <ref type="bibr">[69]</ref> which uses the upper confidence bound as the acquisition function. The surrogate model approximates the hyperparameter decision boundary learning the best regions that minimize the &#119891; opt . The next sampled hyperparameter is selected based on the predicted mean (exploitation) and the corresponding variance (exploration) which are included as part of the acquisition function. In our implementation, we use the adaptive exploitation versus exploitation trade-off and automatic domain size explorations from Mango <ref type="bibr">[68]</ref>[69].</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.3">Benchmark Datasets</head><p>To train the TCN models and evaluate the performance of TinyOdom against competing proposals, we selected five inertial odometry datasets that have been widely used to benchmark existing inertial dead-reckoning techniques for various applications <ref type="bibr">[16,</ref><ref type="bibr">18,</ref><ref type="bibr">29,</ref><ref type="bibr">31,</ref><ref type="bibr">46,</ref><ref type="bibr">88]</ref>. Table <ref type="table">1</ref> summarizes the representative characteristics of the five datasets. For PDR, we selected the OxIOD <ref type="bibr">[18]</ref> and the RoNIN <ref type="bibr">[46]</ref> dataset, the two largest publicly available inertial odometry datasets for human localization. Both OxIOD and RoNIN use smartphone inertial sensors to collect 9DoF IMU data. However, the RoNIN dataset assumes unrestricted phone orientation and phone placement to support natural day-to-day smartphone usage and provides a more challenging task of developing inertial models invariant to device placement or orientation. Furthermore, the trajectories in the RoNIN dataset have a larger spatial span compared to the trajectories in the OxIOD dataset. The OxIOD dataset, on the other hand, has a higher ground truth resolution (sub-mm) thanks to the use of a Vicon motion capture setup. For UUV, UAV, and animal localization, we chose the AQUALOC <ref type="bibr">[31]</ref>, the EuRoC MAV <ref type="bibr">[13]</ref>, and the GunDog [41] dataset, the only publicly available datasets for benchmarking dead-reckoning algorithms for UAV, UUV, and animals. The EuRoC MAV, AQUALOC, and the GunDog datasets collect IMU data from sensor tags fixed to quadrotors, underwater probes, and penguins, respectively. The size of these datasets is much smaller than the OxIOD and RoNIN datasets. We used the AQUALOC dataset to evaluate the performance of the barometric altitude estimator besides 2D inertial tracking, as it includes underwater pressure sensor data. The only caveats in these three datasets are the lack of magnetometer and gyroscope readings in the EuRoC MAV and the GunDog dataset, respectively. We adapted our TCN input layers to work with the available sensors in these two datasets. Table <ref type="table">2</ref> lists the window size, stride, data splits, and epochs that we used in the training pipeline for our TCN model for each dataset. We split the datasets by sequences (separate files). We did not use any validation during the training phase of each candidate model but rather used the validation split to compute the error metric &#119891; error (&#937;) in the outer loop of the NAS. The test split was used in the final evaluation of the best-performing model found via NAS against baseline techniques. For the OxIOD and RoNIN dataset, we used the same window size and stride used by IONet <ref type="bibr">[16]</ref>, L-IONet <ref type="bibr">[18]</ref>, and RoNIN <ref type="bibr">[46]</ref> on the two datasets. For the EuRoC MAV and GunDog dataset, we chose a window size of 0.25 seconds to account for the faster maneuverability of drones and penguins over humans. On the contrary, since underwater vehicles move slowly, we used a window size of 2 seconds for the AQUALOC dataset. Note that the dataset splits are different from each other because the datasets were split by sequences/files and not samples to preserve continuous trajectories. For the RoNIN dataset, we used splits provided by the dataset makers <ref type="bibr">[46]</ref>. For the OxIOD, the AQUALOC, and the EuRoC MAV datasets, we split the files such that the training set, the validation set, and the test set roughly have 80%, 5%, and 15% of the total dataset samples respectively. Since there are only two complete trajectories in the GunDog dataset, we split the training trajectory into a training and validation split, while using the other trajectory as a test split.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.4">Baseline Algorithms</head><p>To evaluate the utility of TinyOdom, we use several SOTA inertial odometry techniques as baselines for the four applications. For tracking humans via the OxIOD and the RoNIN datasets, we use the following baselines:</p><p>Step Detector with Weinberg SLE (PDR): We used one of the PDR algorithms proposed by Jimenez et al. <ref type="bibr">[48]</ref>. The algorithm uses a threshold-based step detector based on accelerometer peaks and updates the displacement via Weinberg Stride Length Estimation (SLE) <ref type="bibr">[85]</ref>, which models step length in terms of vertical movement of the pelvis during each step. The heading is computed from the gyroscope. PDR is one of the most widely used classical inertial localization method <ref type="bibr">[44,</ref><ref type="bibr">91]</ref>. We used a publicly available implementation the PDR <ref type="foot">2</ref>Naive Double Integration (NDI): We use the ideal formula for dead-reckoning (Equations (5-7)), where we simply integrate the linear accelerometer readings to get the position after coordinate transformation <ref type="bibr">[88]</ref>. We used a publicly available implementation of the NDI 2 .</p><p>IONet: IONet <ref type="bibr">[16]</ref> is the first deep inertial sequence learning model. The LSTM model uses the original headingdisplacement formulation of neural inertial localization and takes in gyroscope and accelerometer readings as input. IONet was shown to outperform PDR and strap-down inertial navigation system (SINS) on the OxIOD dataset. We implemented our own version of IONet using the same architectural encodings mentioned in <ref type="bibr">[16]</ref>, as the code is not publicly available.</p><p>L-IONet: L-IONet <ref type="bibr">[18]</ref> improves the computational efficiency over IONet by using a TCN in place of LSTM, without significantly sacrificing localization performance. We implemented our own version of L-IONet, as the code is not publicly available.</p><p>RoNIN TCN: RoNIN TCN <ref type="bibr">[46]</ref> uses robust velocity loss and a heading-agnostic coordinate frame to account for unrestricted sensor orientation and placement. RoNIN TCN outperformed NDI, PDR, and IONet on the RoNIN and OxIOD datasets. We used the publicly available implementation of RoNIN TCN <ref type="foot">3</ref> for retraining and benchmarking.</p><p>For UUV localization using the AQUALOC dataset, we use the following baseline: NavNet: NavNet <ref type="bibr">[96]</ref> asynchronously combines inertial sensor and doppler velocity log (DVL) through separate LSTM networks, followed by attention layers to capture relevant long-term contextual information across timesteps and regress x and y velocities. NavNet was shown to outperform EKF and UKF for underwater localization. We implemented our own version of NavNet, as the code is not publicly available.</p><p>For UAV localization using the EuRoC MAV dataset, we use two baselines: AbolDeepIO: AbolDeepIO <ref type="bibr">[29]</ref> uses two separate LSTM channels to map accelerometer and gyroscope readings to different latent representations while feeding the sampling rate of the inertial sensor through a third LSTM channel to make the displacement and heading regressor robust to sampling rate jitter. The high-level correlated features are then fused using slow fusion. AbolDeepIO was shown to outperform VINet <ref type="bibr">[19]</ref>, SINS, and IONet. We implemented our own version of AbolDeepIO, as the code is not publicly available.</p><p>VeTorch: VeTorch <ref type="bibr">[35]</ref> uses two TCN to compute the heading and displacement of autonomous vehicles from smartphone accelerometer and gyroscope readings. It also transforms inertial dynamics from the phone to the car. VeTorch was shown to outperform EKF and IONet. We implemented our own version of VeTorch, as the code is not publicly available.</p><p>Finally, for animal tracking, we use the following baseline: GunDog: GunDog <ref type="bibr">[41]</ref> complements the ideal formula for dead-reckoning (Equations (5-7)) with a step detector and compass calibration to constrain error explosion during animal tracking. We used the publicly available implementation of GunDog<ref type="foot">foot_7</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.5">Performance Metrics</head><p>We adopt two widely used <ref type="bibr">[46,</ref><ref type="bibr">59,</ref><ref type="bibr">97]</ref> metrics to quantify the localization performance:</p><p>&#8226; Absolute Trajectory Error (ATE): ATE is defined as the average root-mean-squared-error (RMSE) between the actual and the predicted locations for the entire trajectory <ref type="bibr">[46]</ref>:</p><p>The lower the ATE, the better. &#8226; Relative Trajectory Error (RTE): RTE is defined as the average root-mean-squared-error (RMSE) between the actual and the predicted locations for a specific time interval. Inspired from <ref type="bibr">[46]</ref>, we use a time interval of 1 minute to calculate RTE. The lower the RTE, the better. To quantify the resource usage of the proposed dead-reckoning techniques, we use either the size (flash usage) of the TFLM flatbuffer serialized model schema for neural-inertial models or use the flash usage of the compiled embedded C code for classical techniques.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.6">Hardware and Software Specifications</head><p>For benchmarking HIL NAS, we use three real ARM Cortex-M target boards and one virtual hardware model (proxy) with varying resource constraints. The target hardware specifications are summarized in Table <ref type="table">3</ref>. The processor runs Mbed RTOS and TFLM interpreter on-board. To communicate with the target hardware via system commands from the host machine, we used the Mbed command-line interface (CLI). The TinyOdom models were implemented in Jupyter Notebook (Python), using Keras via a Tensorflow and TFLM <ref type="bibr">[23]</ref> backend. All the publicly-unavailable baselines were also implemented similarly. To benchmark PDR, NDI, and GunDog's resource usage, we rewrote their MATLAB and R code in C++. Table <ref type="table">4</ref> lists the specifications of the host machines on which we ran the NAS and model training. Our NAS framework supports training on machines with a wide range of processor, GPU, and RAM configurations. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.7">Real-World Setup</head><p>To showcase how TinyOdom can support real-world applications, we retrofitted an agricultural robot intended for precision farming <ref type="bibr">[27]</ref>[28] with neural-inertial tracking hardware and software. The setup is shown in Fig. <ref type="figure">4</ref>.</p><p>The robot is intended for autonomous inter-row weed control in flaxseed and canola fields, where the spacing between adjacent crop lines can be as small as 30 cm. Thereby, the robot requires a high-sampling rate cm level precision localization <ref type="bibr">[27]</ref>[28], which is not possible to achieve with commodity GPS alone. We attached a 9DoF Razor IMU board to the robot to perform inertial data logging as well as on-board neural-inertial tracking. The board features a MEMS accelerometer (ADXL345), a gyroscope (ITG-3200), and a magnetometer (HMC5883L). The data is logged onto an SD card. The board features 32kB of SRAM and 256 KB flash. To log sub-mm ground truth position, we used several OptiTrack Prime 17W <ref type="foot">5</ref> MoCap infrared markers <ref type="bibr">[34]</ref> mounted in a rigid body configuration. The motion data of the rigid body were tracked using Motive:Tracker<ref type="foot">foot_9</ref>  <ref type="bibr">[4]</ref>. To synchronize the ground truth data and the IMU data, we harmonized the local system clocks to the Network Time Protocol and also performed graphically identifiable special movements with the robot before collecting position data. We had two experimental phases with the robot:</p><p>&#8226; Data Collection Phase: In this phase, we drove the robot within a 2&#215;2 m arena using a remote controller to collect inertial sensor data and ground truth position data. We collected 3 hours of IMU and ground truth position data at a 100 Hz sampling rate. &#8226; Evaluation Phase: In this phase, we ported a neural-inertial model on the Razor IMU platform. Instead of logging IMU data this time, the board logged the estimated position of the robot. The driving patterns and ground truth collection setup remained the same.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">EVALUATION, COMPARISON AND DISCUSSION</head><p>In this section, first, we showcase the localization performance and resource usage of TinyOdom models against competing baselines (Section 7.1). Next, we illustrate how our HIL NAS adapts models based on hardware capability (Section 7.2). Third, we show the performance of our depth filter for altitude estimation (Section 7.3). Fourth, we perform an ablation study to show how the individual components in our physics, velocity, and magnetometer-centric sequence learning formulation affect localization performance (Section 7.4). Finally, we transferability and evaluation of (Section 7.5).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1">Localization Performance and Resource Usage</head><p>Table <ref type="table">5</ref> and Fig. <ref type="figure">5</ref> showcase the performance of TinyOdom TCN models against competing methods for all four applications in terms of ATE, RTE, and resource usage. From Table <ref type="table">5</ref> and Fig. <ref type="figure">5</ref>, we can see that TinyOdom models, despite being a fraction of the size of competing baselines, are always among the top two best performing models in terms of ATE and RTE. Specifically, TinyOdom outperforms the SOTA for UAV, and animal tracking by reducing the ATE by 1.14&#215; to 5&#215;, while being 52&#215; to 134&#215; lighter. Classical approaches such as PDR, NDI, and Gundog are outperformed not only by TinyOdom but other deep-learning neural inertial models. Notice how our best performing models are within 27-72 kB, while the best performing baselines are 33-2200 kB. For human localization, TinyOdom competes with RoNIN TCN while outperforming NDI, PDR, IONet, and L-IONet.</p><p>Compared to the RoNIN TCN, the top-performing TinyOdom models are 31&#215; to 34&#215; smaller, while overall, the framework provides 31&#215; to 134&#215; reduction in model size over the SOTA. We can make several important inferences from Table <ref type="table">5</ref> and Fig. <ref type="figure">5</ref>:</p><p>&#8226; Baselines which regress heading and displacement (e.g., IONet, L-IONet, AbolDeepIO, and VeTorch) have high ATE and RTE. We observed that the errors build up when sharp turns occur in the trajectory. Given that objects in these datasets mostly travel in straight lines, the singularities in the heading rates are ignored by the neural network during training, leading to large errors in the final position estimate. &#8226; Note that the ATE and RTE for all techniques are much higher than RoNIN TCN for the RoNIN dataset.</p><p>We hypothesize that this happened because the pre-trained RoNIN TCN was trained on the entire RoNIN dataset, while we only had access to 50% of the data (which is challenging due to unrestricted sensor configuration). In fact, the performance of RoNIN TCN is similar to TinyOdom on the OxIOD dataset, with TinyOdom lagging RoNIN TCN by 0.85 m. The performance gain comes from the 34&#215; more weights available to the RoNIN TCN. RoNIN TCN also relies on device orientation, which itself is polluted. &#8226; The robust sequence learning and hardware-aware formulation of TinyOdom generalize across heterogeneous applications, continuously maintaining superior localization resolution while keeping a low resource overhead. TinyOdom attempts to lower the ATE and RTE based on available resources. Observe from Fig. <ref type="figure">5</ref> that with more available memory, the ATE and RTE generally go down. &#8226; Excluding PDR, NDI and GunDog and L-IONet, none of the baselines are suitable for deployment on URC devices due to memory constraints. All 4 of these baselines are outperformed in localization resolution.</p><p>Fig. <ref type="figure">6</ref> shows selected trajectory reconstructions of varying lengths by TinyOdom models against competing methods for PDR, UUV, and animal tracking. From Fig. <ref type="figure">6</ref>, we can see that TinyOdom can perform dead-reckoning for varying trajectory lengths without explosion of position estimation error. Due to heading rate singularity, IONet and L-IONet struggle to constrain the errors generated by sharp turns, evident in Fig. <ref type="figure">6(b)</ref>, where IONet and L-IONet tend to over-smooth the turns in the trajectory. PDR has a large error radius and completely fails on the RoNIN dataset, where the heading cannot be inferred via model-based techniques because of unrestricted phone placements. TinyOdom models are more closely able to replicate the trajectories generated by RoNIN TCN with 31&#215;-34&#215; lower model size. For UUV and animal tracking, TinyOdom generates trajectories that closely mimic the ground truth, while baselines either fail or are further apart from the ground truth.</p><p>For small trajectories, the average ATE and RTE metric does not completely state how the error evolves with time <ref type="bibr">[97]</ref>. For example, if a trajectory is circular with a radius of a few meters (common in the OxIOD dataset <ref type="bibr">[18]</ref>), the average ATE and RTE would be unable to showcase how the location estimation varied with time. As a result, we evaluated how the position estimation error evolves with time for PDR, UUV, and animal tracking for all methods, shown in Fig. <ref type="figure">7</ref>. From Fig. <ref type="figure">7</ref>, we can observe that the position estimation error of TinyOdom grows much more slowly with time compared to baseline techniques. TinyOdom provides position estimate within 2.5m to 12m for trajectories of length 12m to 1160m spanning 60 seconds. Notice how the error of the PDR, IONet, and L-IONet is sinusoidal with time in the OxIOD dataset while growing linearly in the case of the RoNIN dataset. Since movement is constricted in a limited space for circular trajectories, ATE of these three baselines fluctuates for the OxIOD dataset even as they provide poor position estimation. On the other hand, the error of RoNIN-TCN, NavNet, GunDog, and TinyOdom grow linearly with time.</p><p>7.2 Evaluation of Hardware-in-the-Loop Bayesian Neural Architecture Search Fig. <ref type="figure">8</ref> showcases how our hardware-aware NAS adapts architectural encodings of the TCN backbone for hardware with different compute constraints for the RoNIN dataset. Instead of simply providing small models every time, our NAS framework optimizes the TCN model to maximize resource usage, thereby lowering ATE and RTE, when more resources are available. For example, in Fig. <ref type="figure">8</ref>, as the SRAM capacity increases, the NAS framework also increases the number of layers, filters, and the kernel size of the TCN models. The framework even adds skip connections to prevent exploding and vanishing gradient problems for deeper networks. In addition, to capture both local and long-term inter-dependencies in the temporal sequence within a limited computing budget, our NAS framework assigns small dilation factors to lower layers and large dilation factors to higher layers. This is counter-intuitive, as human designers would normally assign dilation factors that grow by a constant factor with each successive layer instead of intelligent assignment performed by NAS. We also performed an ablation study to see how proxyless (with real-hardware) and proxied versions (with proxy to simulate hardware metric) of our NAS framework differ in performance with three real hardware devices for PDR and UAV localization. The results are showcased in Fig. <ref type="figure">9</ref> (a)(b)(c). From Fig. <ref type="figure">9</ref> (a)(b)(c), we can see that the proxy generally tends to provide models which need a higher SRAM compared to HIL NAS. This is because the HIL NAS can take into account the model runtime interpreter and RTOS overhead, which the proxy for SRAM and flash fails to account for. Thus, some well-performing models (models with low ATE) found by proxied NAS may not fit on the real hardware. Thus, HIL is especially important for URC devices, where all overheads need to be accounted for. Besides quantifying the difference between proxyless and proxied NAS for memory and RTE modeling, we also studied the relationship between FLOPS and model latency (from real hardware) for all five datasets, with the results summarized in Fig. <ref type="figure">9(d)</ref>. From Fig. <ref type="figure">9</ref>(d), we can observe that even though the models were trained on widely different datasets, there is still a strong positive correlation (Pearson Coefficient, &#120588; = 0.933) between FLOPS and model latency in the log-log scale, indicating that it is possible to develop an analytical model correlating FLOPS and model latency without requiring HIL for explicit latency modeling. This would save time as the models do not need to be run on real hardware to benchmark latency but would only require compilation to get the SRAM and flash, which can be achieved on the host machine.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3">Performance of Robust Depth Filter</head><p>Fig. <ref type="figure">10</ref> shows sample trajectory reconstruction in the z-axis provided by the barometric &#120572; -&#120573; filter on the AQUALOC dataset. As a baseline, we convert the raw pressure sensor readings to depth using the formula &#119875; &#119905; = &#120588;&#119892;&#119871; &#119911;,&#119905; , where &#119875; &#119905; is the raw pressure reading at time &#119905;, &#120588; is the density of seawater and &#119892; = 9.81. From Fig. <ref type="figure">10</ref>, we can see that our filter is robust to sensor noise caused by environmental variations, with the sum of gradients of the reconstructed trajectory much closer to the ground truth trajectories. Compared to 3D-RoNIN and TLIO, which estimate height from IMU and have errors of up to &#177;1.0&#119898;, the barometric filter provides altitude estimates within &#177;0.1&#119898;. Moreover, 3D-RoNIN and TLIO use neural networks in the pipeline much larger than TinyOdom models to regress height. Our filter, on the other hand, is lightweight, requiring only 10 KB SRAM and 51.4 kB flash on the target hardware. In addition, our approach for regressing altitude is immune to the curse of drift associated with inertial sensors. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4">Ablation Study for Sequence Learning Formulation</head><p>We performed an ablation study to highlight the importance of the individual components (i.e., velocity, magnetometer, and physics module) in our robust sequence learning formulation. We took a model, kept the same architectural encodings, and retrained the model without one or two of the three components. Fig. <ref type="figure">11</ref> summarizes the study performed on the OxIOD and AQUALOC dataset for the best performing models on STM32F446RE and STM32F746ZG hardware, respectively. From the ablation study, it is clear that the velocity formulation, magnetometer readings, and physics channels all work together to reduce the ATE and RTE of the same model. ATE and RTE are lowest when all three components are present in both datasets. In particular, the velocity-formulation and the inclusion of magnetometer seem to have the greatest effect in reducing the position estimation error. The velocity formulation solves the heading rate singularity issue associated with heading-displacement formulation, while the magnetometer provides an additional anchor for inferring body heading minus the effects of gravity pollution, varying sensor attitude, translational movements, and drift associated with accelerometers and gyroscopes. The physics channel, on the other hand, helps the neural network decide whether valid translational movements have occurred or not, thereby constraining the output of the network when the object to be localized is static.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.5">Transferability and Real-World Evaluation</head><p>In this section, we first showcase how pre-trained models perform when they are tested on an entirely different dataset, which may or may not come from the same underlying application (Section 7.5.1). We then show how very small amounts of data in the new domain can fine-tune the weights of a pre-trained model trained on an entirely different underlying application and dataset to operate reasonably well in the real-world (Section 7.5.2).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.5.1">Transferability Across Applications and Datasets (No Fine-Tuning)</head><p>. Table <ref type="table">6</ref> provides an example of the performance of neural inertial models on new datasets and applications without fine-tuning. For testing the transferability across the same application but different datasets, we tested PDR models across the OxIOD and RoNIN datasets. For testing the transferability across different applications, we tested PDR (trained on the OxIOD dataset) models and UUV localization models (trained on the AQUALOC dataset). From Table <ref type="table">6</ref>, it is evident that while neural-inertial models (both TinyOdom and large models) perform well within the trained data distribution, they are not directly transferable to another dataset or application without fine-tuning. Apart from having different data distribution, these odometry datasets have different sampling rates as well as different motion primitives (e.g., a UUV's motion patterns would be different from that of a person walking). Thereby, the ideal sizes and learned physical embeddings would be significantly different across datasets and applications. In addition, the TinyOdom models perform slightly worse than the large models on different datasets and applications. This is because the lightweight models do not have enough redundant weights or parameters to model globally significant attributes that may be common across datasets or applications, but instead overfit the dataset-specific characteristics in the temporal sequences, sacrificing generalizability over accuracy. Thus, it is necessary to perform domain adaption when transferring pre-trained models to different applications.</p><p>7.5.2 Fine-Tuning and Real-World Usage. Before fine-tuning pre-trained models, we ran NAS using the entire 3-hour dataset to find TinyOdom models that can run in real-time on the target hardware listed in Table <ref type="table">3</ref>, as well as on the Razor IMU retrofitted to the robot. Table <ref type="table">7</ref> lists the hardware and performance metrics of the best performing model for each hardware. Note that the ATE and RTE metrics shown for the Razor IMU are from the evaluation phase performed in real-time with the robot. From Table <ref type="table">7</ref>, we can observe that the RTE over 60 seconds is around 1 meter. This is acceptable for precision agriculture, as the robot can intermittently correct its location by fusing GPS with TinyOdom, while TinyOdom takes care of a high sampling rate and high-resolution cm-level localization. Having empirical gurantees of TinyOdom capable of operating on real-world data in real-time on real hardware, next, we explored whether pretrained models trained on an entirely different application (hence dataset) can be fine tuned to operate in the real-world with limited labelled data from the new domain using transfer learning. Fig. <ref type="figure">12(a)</ref> showcases how the localization error of a pretrained model (pretrained on the OxIOD dataset) evolve with the amount of labelled data in the new domain (agricultural robot positioning) available to the model. We compared the error evolution against a model trained from scratch using the same amount of limited data. We observed that the RTE of a pre-trained model with no fine-tuning reduces by 8&#215; with only 1 minute of labeled data in the new domain. Moreover, from the graph, we can observe that a model being trained from scratch needs around 100 minutes of data in the new domain to match the RTE of the pre-trained model. Intuitively, pre-trained models bring in stability in error evolution which models trained from scratch cannot bring with limited data, even if the pre-trained model was trained on a different application.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8">CONCLUSION AND FUTURE WORK</head><p>Inertial odometry extends the applicability of odometry to GPS and network-denied environments. Although the conventional model-based inertial odometry approaches are computationally feasible, they demand expert heuristics impacting their generalizability. Further, the current data-driven approaches for inertial odometry models, at best, work on smartphone class devices and are not transferable to the URC devices. We show that the proposed TinyOdom framework introduces a robust 3D inertial sequence learning formulation and a hardwareaware NAS framework to train inertial odometry models. TinyOdom extends the neural-inertial odometry across heterogeneous applications while achieving up to 134&#215; smaller size than the current SOTA while maintaining or exceeding localization resolution. Our evaluation shows that the performance of existing data-driven inertial odometry is susceptible to the vanilla sequence learning formulation. The widely adopted heading displacementbased formulation is adversely impacted by heading-rate singularity (e.g., during share turns in the trajectory). In contrast, the introduced magnetometer, physics, and velocity-centric inertial sequence formulation of TinyOdom maintain or exceed the tracking performance over the SOTA, even though the model sizes are significantly smaller. Finally, we showcased the challenges that arise when trying to transfer pre-trained neural-inertial models in the real world and showcased transfer learning as a potential solution. There are several avenues of future work. Firstly, we observed that in the absence of GPS or infrastructure-provided location fixes, the errors in TinyOdom and other SOTA inertial odometry approaches are cumulative with time. This suggests for long-term usage, inertial odometry necessitates intermittent error correction from the infrastructure within the available resource budget. Secondly, we saw that complementing neural-inertial models with heuristics and physics improves the robustness dramatically. Our physics metadata module is not trainable so far and uses domain knowledge. Possible use of neurosymbolic reasoning <ref type="bibr">[92]</ref>, physics-aware embeddings <ref type="bibr">[21]</ref>[95], or signal temporal logic <ref type="bibr">[60]</ref> may help improve neural network robustness without domain expertise. Thirdly, neural-inertial models trained on one dataset do not directly transfer to another dataset even when the application is the same, let alone different applications. While our transfer learning approach with a few minutes of labeled data fine-tunes pre-trained models for real-world usage, more work needs to be done for on-device fine-tuning <ref type="bibr">[26]</ref> and possible use of unsupervised pre-trained embeddings <ref type="bibr">[7]</ref>. Finally, the resolution achieved by neural-inertial odometry models depends on the best possible resolution of the ground truth hardware. However, developers may not have access to high-resolution sub-mm accuracy motion capture systems, particularly when operating over a large geographical region. Therefore, efficient ways to log high-resolution ground-truth data need to be explored.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_1"><p>Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022. TinyOdom: Hardware-Aware Efficient Neural Inertial Navigation &#8226; 71:3</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_2"><p>https://github.com/nesl/tinyodom Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_3"><p>2, Article 71. Publication date: June 2022.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_4"><p>Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022. TinyOdom: Hardware-Aware Efficient Neural Inertial Navigation &#8226; 71:11</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_5"><p>https://lopsi.weebly.com/teaching.html</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_6"><p>https://github.com/Sachini/ronin Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_7"><p>https://github.com/Richard6195/Dead-reckoning-animal-movements-in-R Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_8"><p>https://optitrack.com/cameras/prime-17w/</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_9"><p>https://optitrack.com/software/motive/</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_10"><p>Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., Vol. 6, No. 2, Article 71. Publication date: June 2022. TinyOdom: Hardware-Aware Efficient Neural Inertial Navigation &#8226; 71:21</p></note>
		</body>
		</text>
</TEI>
