The rapid deployment of AI and ML at the far edge, particularly on microcontrollers, requires efficient serialization of complex data structures. Python’s pickle module is widely used but lacks native support in MicroPython, hindering seamless data transfer. We introduce mPickle, a MicroPython-compatible library enabling memory-optimized serialization of complex Python objects, supporting TinyMLOps workflows that transfer model artifacts from CPython to MicroPython targets. mPickle implements the Pickle Protocol 4 with a module/function mapping layer that enables interoperable binary serialization and deserialization between CPython and MicroPython. The library is validated via unit tests, benchmarks, and examples covering built-in types, custom classes, numerical arrays, and model-weight dictionaries.

mPickle: Pickle for MicroPython

Mattia Antonini
;
Massimo Vecchio;Fabio Antonelli
2026-01-01

Abstract

The rapid deployment of AI and ML at the far edge, particularly on microcontrollers, requires efficient serialization of complex data structures. Python’s pickle module is widely used but lacks native support in MicroPython, hindering seamless data transfer. We introduce mPickle, a MicroPython-compatible library enabling memory-optimized serialization of complex Python objects, supporting TinyMLOps workflows that transfer model artifacts from CPython to MicroPython targets. mPickle implements the Pickle Protocol 4 with a module/function mapping layer that enables interoperable binary serialization and deserialization between CPython and MicroPython. The library is validated via unit tests, benchmarks, and examples covering built-in types, custom classes, numerical arrays, and model-weight dictionaries.
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11582/366287
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
social impact