Official selected implementation for:
**Anatomy-Guided Dual-Domain State Space Network **
AGDN is an anatomy-guided deep learning framework for preoperative prediction of deep myometrial invasion (DMI) in endometrial cancer from multi-view, multi-sequence pelvic MRI. The framework models radiological reasoning at three levels: direction-aware slice and inter-slice representation learning, cross-view feature refinement, and bidirectional cross-sequence guidance between T1CE and T2WI.
This repository currently contains selected core implementation files for the main model components described in the manuscript and supplementary appendix. Patient data, trained checkpoints, local institutional paths, and private data-governance assets are not included.
AGDN consists of three core modules:
| Module | Description | Main files |
|---|---|---|
| DDRL | Direction-aware dual-domain representation learning. It uses a dual-stream Mamba/state-space architecture to model intra-slice directional patterns and inter-slice anatomical continuity from lesion-centered ROI slices. | DDRL/DS_mamba_V3.py, DDRL/train.py, DDRL/extract_features_V3.py |
| CVA | Cross-view attention. It uses sagittal features as the anchor query and axial/coronal features as complementary keys and values for multi-view MRI feature refinement. | CVA/models/co_view_att.py, CVA/train.py |
| BCSG | Bidirectional cross-sequence guidance. It performs reciprocal feature refinement between T1CE and T2WI feature tokens before downstream prediction. | BCSG/models/sequence_fusion/sequence_network_row.py, BCSG/models/sequence_fusion/sequence_engine.py, BCSG/main.py |
AGDN/
|-- DDRL/
| |-- DS_mamba_V3.py
| |-- extract_features_V3.py
| `-- train.py
|-- CVA/
| |-- models/
| | `-- co_view_att.py
| `-- train.py
|-- BCSG/
| |-- models/
| | `-- sequence_fusion/
| | |-- sequence_engine.py
| | `-- sequence_network_row.py
| `-- main.py
`-- README.md
The experiments in the manuscript were conducted with:
- Python 3.10.19
- PyTorch 2.1.1 with CUDA 11.8
- CUDA-enabled GPU hardware, such as NVIDIA RTX A6000
Main Python dependencies used by the released scripts include:
torch
torchvision
torchmetrics
timm
einops
fvcore
numpy
pandas
scipy
scikit-learn
tqdm
tensorboard
wandb
The DDRL implementation uses selective-scan/Mamba-style CUDA operators when available. Please install the corresponding state-space model kernels required by your local environment before training DDRL.
The private multicenter MRI dataset cannot be released because of patient privacy regulations and institutional data governance policies. To run the code on your own data, prepare de-identified lesion-centered ROI inputs and feature files following the manuscript protocol:
- Export and de-identify DICOM MRI data.
- Generate lesion-centered ROIs for sagittal, axial, and coronal views.
- Resize ROI slices to 256 x 256 pixels.
- Apply image-level Z-score normalization.
- Train DDRL models for the required MRI views/sequences.
- Extract 1440-dimensional patient-level features.
- Use CVA for cross-view feature refinement.
- Use BCSG for T1CE/T2WI cross-sequence fusion.
Before running, update all local paths, dataset names, and hyperparameters in the imported configuration/data-loading files.
cd DDRL
python train.py
python extract_features_V3.pycd CVA
python train.pycd BCSG
python main.pyThis is a selected core-code release. Some local project utilities referenced by the scripts are not included in the requested file list and should be adapted or added for a fully runnable package:
- DDRL references
utils.data_loading,utils.path_hyperparameter, andutils.utils. - CVA references
data.datasetandconfig. - BCSG references
datasets.clincial_dataset,utils.*,models.sequence_fusion.util, andmodels.sequence_fusion.CBAM.
The released files are intended to document and reproduce the core model design. Users should replace private paths and data readers with their own dataset interface before training.
If you use this code in your research, please cite:
Anatomy-Guided Dual-Domain State Space Network for Multi-View Multi-Sequence MRI-Based Prediction of Deep Myometrial Invasion: A Multicenter Study.
Citation metadata will be updated after publication.
This code is provided for non-commercial research use only.