Create a tflite model and expand its capabilities

Greetings!

I’m relatively new to tensorflowlite and I’m working on a project in which I’d like someone to point me to the right direction.

I am trying to use a pretrained model to use on tflite (MobileNetv2 for now) as the body and expand its capabilities by adding a latent replay buffer with a fully connected layer as the head which will allow me to perform continual learning. I want to perform object detection but instead of a specific image, I want to be able to have classes within my app and take pictures for those classes live within the app and perform on-device training and see how much I can minimize forgetting when adding a new class or new samples of the classes.

I would like some assistance on the following so I can go towards the right direction:

  1. How can I load my tflite model? Is there a way to do it directly on android studio or I should create it in TensorFlow and then convert it? If yes, what do I use? (I only saw something about TF task library)

  2. When I load the model, how can I add my replay buffer and perform on device training for the scenario mentioned above? (Is there any resource, or tf api/library that can help me achieve this?) I’ve seen on the tflite website a tutorial for object detection but I don’t know how I can alter it so I can be able to add my own classes and image samples live from the application and use those for object detection.

Any help or guidance is greatly appreciated. Thanks!

Hi @Nikolas_Stavrou ,

TFLite primarily for inferencing TF models on edge devices. As of now, there’s no readily available library to address your usecase, there are ongoing efforts on On-device training with continual learning.

Yes, You can directly load your tflite model or pretrained tflite model into your android studio and can run on your android device. Please refer this tutorial for complete guidance(Pretrained tflite models are also available).

TFLite TaskLibrary contains pre-built interfaces and easy-to-use task-specific libraries for app developers to create ML experiences with TFLite. Check here.

Thank You