nnUNet icon indicating copy to clipboard operation
nnUNet copied to clipboard

Does the training command have parameters to turn off image mirror flipping?

Open goodsave opened this issue 2 years ago • 2 comments

Does the training command have parameters to turn off image flipping?

It seems that the enhancement of image flipping is turned on by default. This leads to the error of predicted organ crossover when training multi classification models. But I don't know how to turn off this configuration.

Flipping includes mirror flipping and rotation, which is caused by mirror flipping in particular.

Looking forward to your reply, thank you very much!

goodsave avatar Jul 15 '22 03:07 goodsave

I need to solve this problem urgently now,If there is a solution, please reply. thank you again!

goodsave avatar Jul 21 '22 01:07 goodsave

I found some no_mirror config in trainers, as flow:

      'nnUNetTrainerV2_lessMomentum_noMirror',
      'nnUNetTrainerV2_2_noMirror',
      'nnUNetTrainerV2_2_structSeg_noMirror',
      'nnUNetTrainerV2_lessMomentum_noMirror_structSeg',
      'nnUNetTrainerV2_FabiansResUNet_structSet_NoMirror_leakyDecoder',
      'nnUNetTrainerV2_FabiansResUNet_structSet_NoMirror'

Is it used like this:nnUNet_train 3d_fullres nnUNetTrainerV2_2_noMirror {task_id} all? Besides, I don't know which one to use. Could you explain what these trainers mean?

goodsave avatar Jul 21 '22 01:07 goodsave

Use nnUNetTrainerV2_2_noMirror For more information about each trainer I recommend you take a look at the code. Best, Fabian

FabianIsensee avatar Aug 30 '22 10:08 FabianIsensee

And beware of the all fold. I prefer running cross-validation to get an accurate validation score (whcih all does NOR provide)

FabianIsensee avatar Aug 30 '22 10:08 FabianIsensee

Thanks, Fabian I have seen the code before and tried nnUNetTrainerV2_ 2_ noMirror, But there is a problem: this trainer not only turns off the image flipping, but also turns off other data enhancement. Can I just turn off the enhancement of mirror flip? Best, Allen

goodsave avatar Oct 10 '22 08:10 goodsave

In nnunetv2 you can comment out this line of code " if mirror_axes is not None and len(mirror_axes) > 0: tr_transforms.append(MirrorTransform(mirror_axes)) " to turn off the do mirror. the source file is training/nnUNetTrainer/nnUNetTrainer.py.

BigPandaCPU avatar Jan 26 '24 04:01 BigPandaCPU