CYB08 / MambaClinix-PyTorch

MambaClinix: Hierarchical Gated Convolution and Mamba-Structured UNet for Enhanced 3D Medical Image Segmentation
11 stars 0 forks source link

code question #2

Open Zhongrocky opened 1 month ago

Zhongrocky commented 1 month ago

This model does exactly what it was supposed to do, and the results are excellent. I have a question: What should I do if I only train one module for ablation experiments, for example, only Resmamba or only HGCN?

CYB08 commented 1 month ago

Hi @Zhongrocky ,

My apologies for the delayed response.

To perform ablation tests on different blocks, you can modify lines 351 to 375 in mambaclinix/nnunetv2/nets/MambaClinix_3d.py to isolate and run specific blocks independently, rather than within our stage-wise framework. For instance, to test the HGCN block, simply replace lines 351 to 375 with the code: encoder_layers.append( HGCN_BLOCK( conv_op=conv_op, input_channels=features_per_stage[s], output_channels=features_per_stage[s], transform_channels=features_per_stage[s]//2, #stem_channels, kernel_size=kernel_sizes[s], stride=1, conv_bias=conv_bias, norm_op=norm_op, norm_op_kwargs=norm_op_kwargs, nonlin=nonlin, nonlin_kwargs=nonlin_kwargs, layer_eps=1e-6, drop_path=dp_rates[s], hgConvs=hgConv_list[s], order=order_range[s], ) )

Additionally, since HGCN supports up to 6-order spatial interactions, make sure to adjust the order_range = [2, 3, 4, 5, 6, 6] on line 327 when testing the HGCN module.

I hope this information is helpful!

Zhongrocky commented 1 month ago

thank you for your help