arXiv:2409.19432cs.LGcs.AI2024-09被引 9

用Rust打造高效嵌入式推理引擎,让8位单片机跑得动神经网络。

MicroFlow: An Efficient Rust-Based Inference Engine for TinyML

  • 基于Rust编写的编译器引擎,兼顾内存安全与运行效率。
  • 在仅2kB RAM的8位微控制器上成功部署神经网络。
  • 比现有方案更省内存,推理速度更快,适合关键场景。

近年来,嵌入式系统上的机器学习算法开发备受关注,尤其适用于物联网、机器人和工业应用中的裸金属设备,这类设备面临内存、算力和存储资源有限,且对鲁棒性要求极高。为此,我们提出MicroFlow,一个开源的TinyML框架,采用Rust编程语言实现神经网络在嵌入式系统上的部署。MicroFlow的编译器驱动推理引擎结合Rust的内存安全性,使其适用于关键环境中的TinyML应用。该框架成功在资源极度受限的设备上部署神经网络,包括仅2kB RAM的裸金属8位微控制器。此外,MicroFlow在部署基准模型(如唤醒词检测和人体检测)时,所用Flash和RAM均少于当前最先进方案,在中等规模神经网络上实现同等精度但更快的推理速度,在较大模型上表现相当。实验结果证明了MicroFlow在资源受限关键场景中部署TinyML模型的高效性和适用性。

原文摘要 · Abstract (English)

In recent years, there has been a significant interest in developing machine learning algorithms on embedded systems. This is particularly relevant for bare metal devices in Internet of Things, Robotics, and Industrial applications that face limited memory, processing power, and storage, and which require extreme robustness. To address these constraints, we present MicroFlow, an open-source TinyML framework for the deployment of Neural Networks (NNs) on embedded systems using the Rust programming language. The compiler-based inference engine of MicroFlow, coupled with Rust's memory safety, makes it suitable for TinyML applications in critical environments. The proposed framework enables the successful deployment of NNs on highly resource-constrained devices, including bare-metal 8-bit microcontrollers with only 2kB of RAM. Furthermore, MicroFlow is able to use less Flash and RAM memory than other state-of-the-art solutions for deploying NN reference models (i.e. wake-word and person detection), achieving equally accurate but faster inference compared to existing engines on medium-size NNs, and similar performance on bigger ones. The experimental results prove the efficiency and suitability of MicroFlow for the deployment of TinyML models in critical environments where resources are particularly limited.

TinyMLRust嵌入式推理引擎

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。