Yolov5: Did anyone train without mosaic augmentation ?

Created on 14 Jun 2020  路  7Comments  路  Source: ultralytics/yolov5

I tried training yolov5s without mosaic augmentation, the training time per epoch halved, I guess the mosaic process in dataloader take up time.
Compare to training with mosaic augmentation, I found the loss is much lower while mAP is worse, I have not trained to 300 epochs to see the final result, but I guess mosaic augmentation will make training converge fast and better?

Stale

Most helpful comment

Mosaic is very important for COCO because it helps the model learn to not overemphasize activations for large objects (addressing the well known small object problem in COCO).

I'm glad you raised this issue because mosaic can really hurt custom datasets where you only have small objects to learn from. For example in an aerial dataset, one might tile images in preprocessing to get closer to the objects. You don't want mosaic there because it will zoom you back out.

All 7 comments

training@15 epoch: loss = 0.1544, [email protected]=0.267, mAP=0.1412. mAP far lower than mosaic training at same epoch

@Libaishun you can use the --rect argument to force rectangular training, which will skip the mosaic dataloader, but still use all of the augmentation hyperparamaters.:

python train.py --rect

train_batch0

@glenn-jocher yeah, the problem is: training for same epochs, the mAP of rectangular training is much lower than mosaic training.

Does this mean the mosaic augmentation trick is the key for yolov5 models to achive such high mAP on COCO?

Mosaic is very important for COCO because it helps the model learn to not overemphasize activations for large objects (addressing the well known small object problem in COCO).

I'm glad you raised this issue because mosaic can really hurt custom datasets where you only have small objects to learn from. For example in an aerial dataset, one might tile images in preprocessing to get closer to the objects. You don't want mosaic there because it will zoom you back out.

Mosaic is very important for COCO because it helps the model learn to not overemphasize activations for large objects (addressing the well known small object problem in COCO).

I'm glad you raised this issue because mosaic can really hurt custom datasets where you only have small objects to learn from. For example in an aerial dataset, one might tile images in preprocessing to get closer to the objects. You don't want mosaic there because it will zoom you back out.

Thank you! I learned a lot from your answer~

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

linhaoqi027 picture linhaoqi027  路  4Comments

we1pingyu picture we1pingyu  路  3Comments

KangHoyong picture KangHoyong  路  3Comments

DucTaiVu picture DucTaiVu  路  3Comments

jaqub-manuel picture jaqub-manuel  路  4Comments