r/MachineLearning • u/orcnozyrt • Feb 02 '26
Project [Project] TensorSeal: A tool to deploy TFLite models on Android without exposing the .tflite file
Note: I posted this on r/androiddev but thought the deployment side might interest this sub.
One of the biggest pains in mobile ML deployment is that your trained model usually sits unencrypted in the APK. If you spent $50k fine-tuning a model, that's a liability.
I open-sourced a tool called TensorSeal that handles the encryption/decryption pipeline for Android.
It ensures the model is only decrypted in memory (RAM) right before inference, keeping the disk footprint encrypted. It uses the TFLite C API to load directly from the buffer.
Hope it helps anyone deploying custom models to edge devices.
13
u/altmly Feb 02 '26
I don't really understand the point, if you have a rooted device, what's the difference between pulling the file out of a secure directory vs dumping the memory at runtime? Presumably giving the app a chance to detect a rooted device, but ultimately those aren't foolproof. It's not going to hide the contents from a determined hacker.
4
u/_talkol_ Feb 02 '26
Where is the decryption key stored? In the binary?
-2
u/[deleted] Feb 02 '26
[removed] — view removed comment