How to add a new classes to a pre-trained model

Apologies if this has been asked before. I have dataset 1 with classes A, B, C, D, and I trained it already, now I want to add class E to my model
How can I do that without training all A, B ,C, D ,E classes?
If I train model 2 with class E separately can I use weights best_1.pt and best_2.pt together?

actually, it is a shopping model that we want to detect existing items and items that will be added in the future without retraining all of the items

@M_rey3000 models must be trained on all classes you want to detect in deployment. If only new classes are trained only they will be detected. See Catastrophic interference - Wikipedia

1 Like

thank you for your response.
when I have several weights, how can I use them together?
(If I train model 2 with class E separately can I use weights best_1.pt and best_2.pt together?)

and one more question: since we are building a shopping system can you please tell me how we can detect if an item is removed from the shopping cart (we detect items with yolo after they are added to the cart now, we want to know when an item has been removed)
Any suggestion in DNNs fields will be helpful

@M_rey3000 you can ensemble multiple models together if they have been trained on the same dataset with the same classes.

To track individual items i.e. in a shopping cart you need a tracker. YOLOv5 :rocket: is an object detector that detect, localizes and classifies objects in a single image. It does not connect objects across multiple images, for this you need a tracking solution. A few possible tracking solutions are:

Good luck :four_leaf_clover: and let us know if you have any other questions!

1 Like