Luffy03 / VoCo

[CVPR 2024] VoCo: A Simple-yet-Effective Volume Contrastive Learning Framework for 3D Medical Image Analysis
Apache License 2.0
145 stars 12 forks source link

A question regarding the testing on BTCV #25

Open wwzjer opened 1 month ago

wwzjer commented 1 month ago

Hi author,

I was a little bit confusing about the test configuration for BTCV. I found in your code when you load the test data, you used the following augmentation/transforms:

    val_transform = transforms.Compose(
        [
            transforms.LoadImaged(keys=["image", "label"]),
            transforms.EnsureChannelFirstd(keys=["image", "label"]),
            transforms.Orientationd(keys=["image", "label"], axcodes="RAS"),
            transforms.Spacingd(
                keys=["image", "label"], pixdim=(args.space_x, args.space_y, args.space_z), mode=("bilinear", "nearest")
            ),
            transforms.ScaleIntensityRanged(
                keys=["image"], a_min=args.a_min, a_max=args.a_max, b_min=args.b_min, b_max=args.b_max, clip=True
            ),
            transforms.CropForegroundd(keys=["image", "label"], source_key="image"),
            # transforms.ToTensord(keys=["image", "label"]),
        ]
    )

When I check the code of SwinUNETR, their transform seems different:

    test_transform = transforms.Compose(
        [
            transforms.LoadImaged(keys=["image", "label"]),
            transforms.AddChanneld(keys=["image", "label"]),
            # transforms.Orientationd(keys=["image"], axcodes="RAS"),
            transforms.Spacingd(keys="image", pixdim=(args.space_x, args.space_y, args.space_z), mode="bilinear"),
            transforms.ScaleIntensityRanged(
                keys=["image"], a_min=args.a_min, a_max=args.a_max, b_min=args.b_min, b_max=args.b_max, clip=True
            ),
            transforms.ToTensord(keys=["image", "label"]),
        ]
    )

I found it may induce an unignorable performance difference. I was wondering if "transforms.Orientationd(keys=["image", "label"], axcodes="RAS")" or "transforms.CropForegroundd(keys=["image", "label"], source_key="image")" can be used for test data as the label information should be unknown. I would appreciate it if you could help me with this. Thanks!

Luffy03 commented 1 month ago

Hi, many thanks for your attention to our work. It is a pity that the BTCV test leaderboard is no longer updating now. So in this repo we only provide the codes for validation. The test_transform is actually "val_transform". If you want to conduct test on some other datasets, you only need to remove the key "label".

wwzjer commented 1 month ago

Thanks for your reply. I was wondering in your paper, are you using val_transform (same as you did) or test_transform for the comparison methods. Thanks.

Luffy03 commented 1 month ago

Hi, sorry, I am a little confused with your question. Val_transform is used for val set and test transform is used for test sets (e.g., AMOS with test learderboard). Does this response align with what you were looking for?

Luffy03 commented 1 month ago

Dear researcher, our work is now available at Large-Scale-Medical, if you are still interested in this topic. Thank you very much for your attention to our work, it does encourage me a lot!