luxonis / depthai-ml-training

Some Example Neural Models that we've trained along with the training scripts
MIT License
118 stars 32 forks source link

Adding new MobileNet tutorial #58

Open Mruzik1 opened 1 year ago

Mruzik1 commented 1 year ago

Added new notebook on the MobileNetV2 SSD Lite training.

tersekmatija commented 1 year ago

I reviewed it offline already, can you review please @N950 ?

N950 commented 1 year ago

@Mruzik1 Sharing some remarks after running the example

Mruzik1 commented 1 year ago

Everything is changed in the code. Now checking the blob running problem. I'll let you know when fixed.

Mruzik1 commented 1 year ago

@N950 For now I just added git checkout [working commit id] to the tutorial. I tested, and with it everything should work now.

N950 commented 1 year ago

@Mruzik1 thank you I reran the example and it works now on device.

Mruzik1 commented 1 year ago

Ok, I'll do it today.

train metrics are missing

Should I add only the precision and recall? Or maybe some other?

did you run some complete training sessions on a practical sized dataset to make sure all is good and we can reach good val mAP ?

No, just on the validation coco subset for a few epochs. But I can use the full dataset and see how it goes

N950 commented 1 year ago

Should I add only the precision and recall? Or maybe some other?

Yeah sure maybe iou also, hopefully to make it that whatever standard detection metric the user is looking for it's already there

No, just on the validation coco subset for a few epochs. But I can use the full dataset and see how it goes

No need to use the full train split, let's go with 40k for training

Mruzik1 commented 1 year ago

Sorry for the delay. For now I checked training on 30% (~35k) of data from the training COCO subset. The mAP is growing little by little, but I belive with a bigger set and fewer classes it will do better. Later I will modify the training loop and let you know when done.

Mruzik1 commented 1 year ago

@N950 Everything is done I think

N950 commented 1 year ago

@Mruzik1 Thanks for the updates

Mruzik1 commented 1 year ago

I decided to change the dataset to potentially reach higher mAP. So now it uses VOC2012 validation set for training with only 3 classes (e.g. person, vehicle, animal) and consists of 5k samples. So I trained the net for a few epochs, and mAP is now noticeably higher. Although still not so good, mAP@50 is just 0.022 after 20 epochs. Fortunately it didn't take much time to train due to a small number of samples. Maybe it's fine as just a demo?

I also now write all displaying metrics to tensorboard. Still need to add weights saving. I'll make some commits and ping you when done.

P.S. I have a few ideas how to improve mAP, but don't have much time to do it, since I will be on vacation starting from the next week (4.09). Probably the mAP is low because instances in the dataset are not similar enough (the vehicle can be either a plane or a train, etc). So it needs more epochs and more samples to train properly.

Mruzik1 commented 1 year ago

@N950 Done