TensorFlow Lite for Microcontrollers: Predicting with missing values and categorical variables

I work on a project where sensor data have categorical variables and missing values.
Preprocessing sensor data with, for example, tfp.sts.impute_missing_values and tf.keras.layers.CategoryEncoding alows to train the model with good enough quality.

Yet at inference time, when new (test) data comes directly to the microcontroller that has no resources nor information to do preprocessing similar to the one done on the train data. As a result prediction at the microcontroller fails.

How to solve this?

1 Like