Can On-Device Personalization Models be used with Cloud Deployment of ML Models?

I have a custom Core ML model built with Keras that has a couple of updatable layers. I was wondering if I switched this model to be deployed from the cloud rather than packaged with the app, would the on-device personalized changes transfer whenever I deploy a model over the cloud or would a user have to start with a fresh, new model every time?

Similarly, do on-device personalized models work with model encryption? Thanks!

Replies

Good questions, @SAIK1065.

I have a custom Core ML model built with Keras that has a couple of updatable layers. I was wondering if I switched this model to be deployed from the cloud rather than packaged with the app, would the on-device personalized changes transfer whenever I deploy a model over the cloud or would a user have to start with a fresh, new model every time?

There is no easy way to transfer over changes from a personalized model to a new model. There are a couple of things you could try here:
  1. Hold on to the personalization data from the user (note that you can serialize MLFeatureValue. It conforms to NSSecureCoding) and retrain the new model that was deployed over cloud.

  2. Use model fusion at the time of prediction. That is, keep a static model M1 that is updated off device and deployed over cloud and another personalized model M2 that is updated on device. At the time of prediction, run prediction on M1 and M2 and make a final decision based on output of these.

Let us know if you run into any issues with this. We will be happy to assist.

Similarly, do on-device personalized models work with model encryption? Thanks!

Encrypted models are supported via cloud deployment but, cannot be personalized on device. Sorry.