In most cases enabling your IoT device with AI capabilities involves sending the data from the device to a cloud server but here this machine learning calculations would happen on your Node-RED Server and then the results sent back to the device for appropriate action
TensorFlow.js – is an open source JavaScript library to build, train, and run machine learning models in JavaScript environments such as the browser and Node.js