This repository provides a PyTorch encoder–decoder model for automated radiology report generation using chest X-ray images and structured medical knowledge.
The model is designed to generate clinically coherent free-text radiology reports by jointly reasoning over:
Dual-view chest X-ray images (frontal + lateral)
Knowledge graph priors encoding structured medical relationships
This work is intended for academic research and educational purposes.
Output: Token-level probability distribution over the vocabulary
Text generation uses nucleus (top-p) sampling with minimum-length constraints.
Architecture Diagram
The following diagram illustrates the overall architecture of the proposed radiology report generation framework, highlighting the integration of visual features, knowledge graph priors, and sequential text generation.
Model Architecture
3. Repository Structure
text
1.
2├── model.py # Encoder, GCN, and decoder definitions
3├── inference.py # Command-line inference & evaluation script
4├── utils.py # Dataset, collate_fn, KG utilities
5├── config.json # Model hyperparameters and paths
6├── final_model.pth # Trained model weights
7├── requirements.txt # Python dependencies
8│
9├── assets/
10│ └── adjacency_matrix.csv # Knowledge graph structure
11│
12├── notebooks/
13│ ├── model_building.ipynb # Training and experimentation notebook
14│ └── knowledge_graph_construction.ipynb # Knowledge graph construction notebook
15│
16└── README.md
4. Dataset Notice ⚠️
This repository does NOT include the MIMIC-CXR dataset.
MIMIC-CXR is subject to PhysioNet credentialed access