Improving Autonomous Nano-Drones Performance via Automated End-to-End Optimization and Deployment of DNNs

Vlad Niculescu, Lorenzo Lamberti, Francesco Conti, Luca Benini, Daniele Palossi

TL;DR

This paper presents an automated workflow for deploying deep neural networks (DNNs) for autonomous navigation on tiny, power-constrained nano-drones. By optimizing DNNs for ultra-low-power hardware and streamlining the deployment process, they achieve significantly improved flight performance, including obstacle avoidance and lane following, while drastically reducing memory footprint and inference time.

What Problem Does This Paper Address?

Nano-drones, with their sub-10cm size and minimal weight, are ideal for ubiquitous sensing and unobtrusive tasks. However, their extremely limited power budget (5-15% for computation) and onboard memory pose a significant challenge for running complex, real-time navigation algorithms. Traditional approaches like SLAM are too computationally intensive. While deep convolutional neural networks (CNNs) offer a more efficient alternative for inferring navigation information directly from sensors, deploying them on these resource-starved platforms requires a laborious, error-prone process of manual optimization, quantization, and hardware-specific tuning. This paper aims to automate and streamline this entire deployment pipeline.

Methods

The core contribution is an automated, end-to-end deployment flow for vision-based CNN navigation on nano-UAVs. This flow targets the GreenWaves Technologies GAP8 SoC, an ultra-low-power (ULP) multicore processor. The process involves two main stages:

  1. Quantization: The CNN's numerical representation is converted from floating-point to 8-bit integers. This is achieved using two toolsets: GWT's NNTOOL (part of GAPflow) and the open-source NEMO/DORY flow. Both tools perform post-training quantization, with NNTOOL also incorporating layer fusion and batch normalization folding, while NEMO/DORY uses a different approach for handling batch normalization.
  2. Hardware-aware Deployment: This stage focuses on generating efficient C code that maximizes parallel execution across GAP8 cores and minimizes data transfer overheads. This involves sophisticated tiling strategies to manage the limited L1 memory (64kB) by partitioning tensors into smaller chunks. The paper compares the proprietary AutoTiler (GAPflow) with the open-source DORY tiling solver.

The authors also introduce a refined post-processing pipeline for the CNN's output, incorporating an integral term for obstacle collision probability to improve confidence and a quadratic mapping for forward velocity to enhance obstacle avoidance.

Datasets

The paper utilizes a combination of datasets for training and evaluation:

  • Udacity Dataset: Approximately 39.1K high-resolution images labeled only with steering angles.
  • Bicycle Dataset: Approximately 32.2K high-resolution images labeled only with collision probabilities.
  • Himax Dataset: Approximately 1.3K low-resolution images collected from the drone's onboard camera, labeled only with collision probabilities.

The Original Dataset is formed by the union of Udacity and Bicycle datasets. The Original+Himax Dataset is used to evaluate the impact of incorporating data from the target drone's camera. The paper also introduces several in-field testing environments to evaluate generalization capabilities, including a corridor, an office room, a narrow tunnel, and a street, some with static and dynamic obstacles.

Key Insights and Ideas

  • Automation is Key: The manual, iterative process of optimizing DNNs for embedded systems is a major bottleneck. Automating quantization and hardware-aware deployment significantly accelerates this process and makes it more accessible.
  • 8-bit Quantization is Sufficient: The authors demonstrate that 8-bit quantization can maintain high prediction accuracy (~90%) while achieving a significant reduction in memory footprint (2x) and improving inference speed (1.6x) compared to 16-bit quantized models.
  • Toolchain Matters: The choice of deployment toolchain (GAPflow vs. NEMO/DORY) impacts performance, with GAPflow showing advantages in layer fusion and tiling for certain network structures, while NEMO/DORY excels with its HWC layout and optimized kernels.
  • Post-processing Enhances Robustness: The refined post-processing of CNN outputs, particularly the integral term for collision probability, significantly improves the drone's confidence in detecting obstacles and leads to better avoidance behavior.
  • Nano-drones are Viable for Complex Tasks: The results showcase that even with severe power and memory constraints, sophisticated autonomous navigation tasks like dynamic obstacle avoidance and lane following are achievable.

Key Results

  • Memory Footprint Reduction: 2x reduction in memory footprint compared to the original hand-crafted CNN.
  • Inference Speedup: 1.6x speedup in inference time.
  • Obstacle Avoidance: Achieved peak braking speeds of 1.65 m/s and improved the speed/braking-space ratio by 25.3% compared to the baseline.
  • Free Flight: Demonstrated free flight in a familiar environment up to 1.96 m/s (a 4x improvement over the baseline).
  • Lane Following: Successfully navigated a path with a 90-degree turn.
  • Power Efficiency: Computation consumed less than 1.6% of the drone's total power budget.
  • Accuracy Maintained: Prediction accuracy was preserved at approximately 90% for classification tasks despite quantization.
  • Longest Flight: Recorded a longest flight time of 171 seconds in an urban street scenario.

Limitations and Future Work

  • CNN Topology Limitations: The Dronet CNN, even in its V2 iteration, has limitations in explicitly learning to prevent collisions, as its training datasets have disjoint labels for steering and collision. This could be addressed by new training datasets or an additional intelligence layer.
  • Generalization in Novel Environments: While the system shows good generalization, performance can degrade in highly novel environments, especially in narrow tunnels with static obstacles where the drone can get stuck.
  • Further Quantization: The paper mentions that memory footprint could be further reduced with stronger quantization (e.g., 4/2/1-bit), but this is not guaranteed to maintain full precision performance.
  • Future Work: The authors suggest exploring more complex tasks by leveraging the freed-up resources, such as integrating localization, detection, and tracking. They also highlight the potential for improving CNNs with new training datasets or additional intelligence layers to address the collision prevention limitation. The open-sourcing of their code and models aims to foster further research in this area.

Summary updated

Abstract

The evolution of energy-efficient ultra-low-power (ULP) parallel processors and the diffusion of convolutional neural networks (CNNs) are fueling the advent of autonomous driving nano-sized unmanned aerial vehicles (UAVs). These sub-10cm robotic platforms are envisioned as next-generation ubiquitous smart-sensors and unobtrusive robotic-helpers. However, the limited computational/memory resources available aboard nano-UAVs introduce the challenge of minimizing and optimizing vision-based CNNs – which to date require error-prone, labor-intensive iterative development flows. This work explores methodologies and software tools to streamline and automate all the deployment of vision-based CNN navigation on a ULP multicore system-on-chip acting as a mission computer on a Crazyflie 2.1 nano-UAV. We focus on the deployment of PULP-Dronet (Palossi <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">et al.</i> , 2019), a state-of-the-art CNN for autonomous navigation of nano-UAVs, from the initial training to the final closed-loop evaluation. Compared to the original hand-crafted CNN, our results show a <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$2\times $ </tex-math></inline-formula> reduction of memory footprint and a speedup of <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$1.6\times $ </tex-math></inline-formula> in inference time while guaranteeing the same prediction accuracy and significantly improving the behavior in the field, achieving: <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">i</i> ) obstacle avoidance with a peak braking-speed of 1.65m/s and improving the speed/braking-space ratio of the baseline, <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">ii</i> ) free flight in a familiar environment up to 1.96m/s (0.5m/s for the baseline), and <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">iii</i> ) lane following on a path featuring a 90deg turn – all while using for computation less than 1.6% of the drone’s power budget. To foster new applications and future research, we open-source all the software design in a ready-to-run project compatible with the Crazyflie 2.1.
BibTeX
@article{niculescu2021improving,
  author = {Vlad Niculescu and Lorenzo Lamberti and Francesco Conti and Luca Benini and Daniele Palossi},
  title = {{Improving Autonomous Nano-Drones Performance via Automated End-to-End Optimization and Deployment of DNNs}},
  journal = {IEEE J. Emerg. Sel. Topics Circuits Syst.},
  year = {2021},
  url = {https://openreview.net/forum?id=lkluqoSq2i8},
}
Figure