ifzhang / FairMOT

[IJCV-2021] FairMOT: On the Fairness of Detection and Re-Identification in Multi-Object Tracking
MIT License
3.99k stars 935 forks source link

TrackId switching on custom dataset #169

Closed apekshapriya closed 4 years ago

apekshapriya commented 4 years ago

Hi @ifzhang Thanks for sharing the great work that you have done!

I have tried training the pre-trained model all_dla34.pth on my custom dataset which is a person based dataset. I want to keep the encoder and decoder weights fixed but only train the last layers of the model. The change that I did in the code (in src/lib/models/model.py) is:

for param in model.parameters(): param.requires_grad = False

for param in model.hm.parameters(): param.requires_grad = True for param in model.id.parameters(): param.requires_grad = True for param in model.reg.parameters(): param.requires_grad = True for param in model.wh.parameters(): param.requires_grad = True

I did this change on the basis that they are 4 heads of the model and I wanted to train just those layers. Can you let me know if it is correct approach? I have attached my train log which seems right to me. But the result which I am getting on the trained model, there is a lot of switching of ids.

logs

Thanks for the help in advance!

ifzhang commented 4 years ago

First, I think it is better to train all the parameters including the backbone network with a smaller lr and it may lead to better results. Second, you can uncomment this line to learn better id features and it may have smaller id switches: https://github.com/ifzhang/FairMOT/blob/ca78d3f01d1953c3d72ee8b01f24a5ddec2689c3/src/lib/trains/base_trainer.py#L30

apekshapriya commented 4 years ago

Thanks for the quick reply. Reply appreciate it!

I will try as you said.

apekshapriya commented 4 years ago

Hey @ifzhang, Thanks for the advice. It actually helped.

ifzhang commented 4 years ago

Glad to hear that!

faruknane commented 4 years ago

@apekshapriya Hi, I'm actually working on a different task. However, I wonder about what data you want to fine-tune the model. Can you share with me a little bit? I'd like to know if I can detect a different object (other than human) without having to train the whole model. For cars, if I only train heads (not the backbone), does it work? Or fine-tuning works only on humans because that's what it is trained for.

apekshapriya commented 4 years ago

Hey @faruknane I had actually fine-tuned on humans only, so cannot really tell about different objects.

faruknane commented 4 years ago

Hey @faruknane I had actually fine-tuned on humans only, so cannot really tell about different objects.

Hi again @apekshapriya , I and my friend thought that this backbone network produces enough information about the genders of detected people. So we created a new head for gender classification. However, we are stuck at its performance. We have been doing cross-validation with a variety of gender heads. Based on your experience which resulted in a lot of id switches, I infer that it can't learn with training only the heads. Should we try to train all the network with backbone? We have a small amount of data, and we wouldn't want to distort the model itself, HM ID heads etc. Would have any ideas about this?

arvindchandel commented 3 years ago

@apekshapriya Hi, I am also working on tracking Humans/person, and trying to eliminate id switching in my use case. last week i started with FairMOT, in default i run the model on my video and got some switching and new id assignment for same person. seek your help how to tweak or improve this FairMOT model to eliminate this issue.