Online Learning for Yolo Network? - tensorflow

I want to use the Yolo Network v3 for let's say detect 5 custom object classes, for which I already have data.
So I'm going to use my train data of these classes to retrain the yolo network with pre-trained weights.
Now Imagine the case:
After some time I want to add another class to my model. Now I need to change the architecture of my model, therefore I would need to retrain my model with all 5 + 1 classes, right?
To avoid this situation I had the idea to set a maximum number of classes at the beginning, let's say 20. So I build a Yolo-architecture with 20 classes and train it with the first 5 classes for which data is available. If data of a new class is available, I will use Stochastic Gradient Descent for Online-Learning to train the model to detect the new class.
Here are my questions:
Does the model correctly learn the 5 classes at the beginning, without having data from the other 15
classes?
Is it possible by Stochastic Gradient Descent to learn new classes bit by bit?
Is there any other convenient way to handle my problem?
Thanks for any advice!

Related

How can I use pre-trained yolov3 model and retrain train it to detect more than 80 objects

I am using yolov3 model to detect the object. And it is able to detect 80 object.
But now I want to custom train existing model for 3 new classes and I don't want to loose pre-trained object. In other words, I want to incrementally train the model.
So, In final result I expecting that my new model will be able to detect total 83 objects.
I have followed AlexeyAB/Darknet. But at the end I am only able to detect last 3 object which i trained. And loose that 80 predefined classes.
How can I train model so it will add new classes after existing classes?
If you want to do this, you need to train your network on all the dataset used to train the 80 classes of Yolo. If you only train on your 3-classes dataset the network will "forget" the old classes it learns.
This dataset is probably COCO, you can find it online, but you should know that training a network from scratch takes lots of time.

is it a good practice to overfit your deep learning model on just one data instance for testing the correctness

Currently i am implementing an object detection model for face detection , and tried training my model on just one single instance of data. (Input : image , target : labels).
But after training my model for a long time, its not able to converge optimally. or in other words i should say it was achieving a saddle point from which it couldnt come out. So i was wondering whether its because the data is just one instance and model is somehow not able to learn or something is wrong with my loss function .
I am using yolo architechture and yolo like loss function to train my model.
Adam optimizer for minimizing the loss over time.
thanks,

retrain model when I am only interested of a subcategory of the existing classes

I want to use a trained model form the tensorflow object detection API, specifically I want to use faster_rcnn_inception_resnet_v2_atrous_oid_v4 trained on google open imaged. I am not interested in detecting all the 601 classes, but rather would like to detect 10 subclasses. Will I gain improvement in accuracy if I retain the last layer or is it better to filter the layers I am not interested after the model is done with prediction. If I went with retaining, is it ok to retain the model with images form google open images again or it is better to use different data.
This official example seems to help you.

Custom Object detection using tensorflow

I have trained the object detection API using ssd_mobilenet_v1_coco_2017_11_17 model to detect a custom object. But after training, the API only detects the custom object and not the objects for which the API is already trained. ssd_mobilenet_v1_coco_2017_11_17 model detect 90 objects.
Is there any way to add more classes to an existing model so that it can detect new objects along with the one it has been trained for?
This question is already asked here and some answer could be found here.
The very last layer of the networks is softmax layer. when the network is trained, the weights of the network is optimized for the exact number of classes on the training set. So, if you need to add a new class and also the classes it was trained, the easiest way is to get the original dataset it was trained on along with your new class images. Then start the training from the pre-trained model weights. The training should converge faster as it has to do relatively little adjustments.

how to make an object detector from an image classifier?

I have a tensorflow model (retrained inception model) which can classify 5 classes of vehicles. Now i need to make an object detector for all these 5 classes with this trained model. Can it be done by removing the last layer ? can any one suggest me how to proceed further
If you really need to use your pretrained network, then you can detect potential boxes of interest then apply your network on each. These boxes can be determined with an "objectness" method, such as EdgeBox.
However, on nowadays, object detection is usually obtained by a more integrated way, such those obtained with faster RCNN. Such an approach integrates a layer named Region Proposal Network (RPN), that determine the region of interest, jointly with the recognition of the classes.
to the best of my knowledge, one of the best recent approaches is Yolo, but it is natively based on Darknet.