nn4mp
FreeDeploy neural networks on microcontrollers for online inference
About nn4mp
nn4mc (Neural Networks for Microcontrollers) is an open-source library from the Correll Lab at the University of Colorado Boulder that converts neural network models trained offline in Keras, TensorFlow, or other frameworks into C code for deployment on microcontrollers. It enables online predictions (regression or classification) on resource-constrained devices such as ESP32, Arduino, and any system running FreeRTOS. The library reads model parameters from an HDF5 file and generates portable C code, allowing embedded systems to perform real-time inference. nn4mc was presented at the International Symposium of Robotics Research (ISRR 2019) and supports cross-platform development with Linux setup scripts.
Key Features
Pros & Cons
- Enables neural network inference on resource-constrained microcontrollers
- Compatible with widely-used deep learning frameworks (Keras, TensorFlow) and hardware platforms (ESP32, Arduino, FreeRTOS)
- Open source with MIT license, free to use and modify
- Backed by academic research and citation support for scholarly use
- Primarily supports feedforward neural networks; advanced architectures (CNN, RNN) may require additional conversion steps
- Requires offline training on a powerful computer and parameter export to HDF5 format
- Limited to microcontrollers that support C code; not for general-purpose desktop deployment
- Community support via Stack Overflow and email; no dedicated commercial support