2
votes

I have a dataset of 300*300 images together with boxes and labels of objects in them. I want to use the SSD network to detect these objects on images. I also want to do it on mobile devices, so I need the final model to be compatible with TF Mobile/Lite. The question is: where should I start from?

I know that SSD is supported by TF Mobile/Lite (see https://github.com/tensorflow/tensorflow/issues/15633 for example). And I believe that there should be not trained SSD model for TF, which I just need to train on my own dataset. But I could only find the pre-trained ones. I also couldn't find any tutorial, which explains how one should train the existing models on his own dataset.

So, to be more precise:

  1. Is my assumption, that I should get the non-trained model and train it on my own dataset with some simple script, correct?
  2. If yes then where can I get this model and a training script?
  3. Do I need to train it using the desktop TF and then convert to Mobile/Lite models?
1
did you succeed in training such model? I'm trying to train ssd mobilenet first but it fails: github.com/EdjeElectronics/… - user924

1 Answers

3
votes

1) Unless you have a massive amount of data, no, your assumption is wrong. Most applications today start from a model pretrained on Imagenet and then fine-tune it to whatever your dataset might be. The reason for this is that while the dataset is different, many features learned from Imagenet are useful for the new dataset too, so you can fine tune to it avoiding the need to have huge amounts of data (and a lot of time/computational power).

2) The tensorflow models repository is the place to look at. Please note, the graph architecture and the weights are separate so if you do decide to start from scratch, just don't load the weights when you start the training.

3) Yes, tflite is a mobile-oriented optimized runtime, the graph is still trained ondesktops with the normal Tensorflow, frozen and then you can use the frozen graph's .pb file in your application built with tflite. For more details on how to do all of that, you should check Tensorflow's website, they have many guides covering each step (and going in detail over all of them here is just impossible).