How estija/co-vegan works
Project Type and Purpose
• This project implements a complex-valued GAN for compressive sensing MRI reconstruction. It employs deep learning to both reconstruct MRI images from undersampled k-space data and handle complex data representations.
• The README clearly outlines different datasets (MICCAI 2013, MRNet, fastMRI) and points out specific training and testing procedures for real-valued versus complex-valued datasets.
File Tree and Its Implications
• The core package is found in the “complexnn” folder, which contains modules like conv.py, dense.py, bn.py, norm.py, pool.py, fft.py, init.py, and utils.py. These files define layers and utilities used to build the complex-valued neural network components.
• There are training scripts (train_model.py and train_model_complex.py) and testing scripts (test_model.py and test_model_complex.py) that dictate the training/inference process.
• Standalone scripts such as dataset_load.py and usamp_data.py are responsible for data preparation: one for loading the GT dataset and one for generating undersampled data.
• The “masks” folder includes several undersampling mask files which are used when preparing the data pipeline for undersampled reconstruction.
• Additional files like metrics.py and wvt_loss.py suggest custom evaluation metrics and loss functions used during training.
Architectural Components
• Data Preparation Layer:
• Components: dataset_load.py, usamp_data.py, and the “masks” directory.
• Function: Download datasets, create ground truth and undersampled datasets using the different masks provided.
• Model Components:
• Core library: “complexnn” package, containing custom implementations for convolutional, dense, batch normalization, pooling, FFT-based layers, and other utilities.
• Architectural patterns: Likely use of GAN architecture with distinct Generator (and possibly Discriminator) components that integrate these complex-valued neural modules.
• Training/Testing Framework:
• Scripts: Separate entry points for training (train_model.py for real-valued data and train_model_complex.py for complex data) and testing (test_model.py and test_model_complex.py).
• Interaction: These scripts call various layers from the “complexnn” package and use defined loss functions, metrics, and custom masks.
• External Dependencies/Environment:
• Dependencies such as TensorFlow, Keras, and CUDA form part of the backend execution environment.
• Hardware requirements: Use of multiple GPUs (as specified in the README).
Relationships and Interactions
• Data Flow:
• Data Preparation Phase: Raw MRI data is downloaded → processed by dataset_load.py → undersampled using usamp_data.py with reference to mask files.
• Model Training: The training scripts load the processed data, initialize the complex-valued network components from “complexnn,” and then execute training with designated loss functions (wvt_loss.py) and metrics (metrics.py).
• Model Testing: Testing scripts validate model performance on either real or complex-valued datasets.
• Control Flow:
• The entry scripts serve as the orchestration layer, invoking data preparation, model building, training loops, and evaluation in sequence.
• The various Python modules in complexnn abstract out specific functionalities (e.g., FFT-based operations for complex data) to modularize the architecture.