Skip to content
/ GCAN Public

Code for CFC GAN: enhanced explainability and diagnostic performance for cognitive decline by counterfactual generative adversarial network based on fMRI Functional Connectivity

Notifications You must be signed in to change notification settings

SXR3015/GCAN

Repository files navigation

AFBT-GAN

Code for AFBT GAN: enhanced explainability and diagnostic performance for cognitive decline by counterfactual generative adversarial network

Environment

torch ==1.13.1
numpy == 1.22.3  
nibabel == 1.10.2  
torchcam == 0.3.2  
torchvision == 0.14.1  
einops == 0.6.0  
python == 3.9.0  
imageio == 2.31.1

extract the imaging features

To run the model, you need to extract the dfc by Matlab. You can use the batch operation of spm12 to finish this. Additionally, the input data shape might influence the kernel size of avgpooling in ResNet, you need to change the kernel size, if has bugs.

run the model

1. Create k fold csv file

generate_csv.py

2. pretrain classifier model

set the mode_net as pretrained classifier in opt.py

run
main.py

3. get counterfactual attention

set the mode_net as image_generator in opt.py

run
main.py

4. train final classifier

set the mode_net as region-specific in opt.py

run
main.py

About

Code for CFC GAN: enhanced explainability and diagnostic performance for cognitive decline by counterfactual generative adversarial network based on fMRI Functional Connectivity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages