Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dual-View SLaVA-CXR
|
| 2 |
+
|
| 3 |
+
**Dual-View SLaVA-CXR** is a vision-language model for structured radiology report generation from frontal and lateral chest X-rays. Built on the ReΒ³ (RecognizeβReasonβReport) paradigm and extending the original SLaVA-CXR model, this project integrates dual-view vision fusion and leverages CLIP, BiomedCLIP, and Phi-2 for enhanced anatomical reasoning.
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## π Directory Structure
|
| 8 |
+
|
| 9 |
+
```bash
|
| 10 |
+
βββ Data Collection and Preprocessing/
|
| 11 |
+
β βββ Data_collection_Mimic.ipynb
|
| 12 |
+
β βββ Data_preprocess.ipynb
|
| 13 |
+
β βββ Radgraph Based Report Cleaning.ipynb
|
| 14 |
+
β βββ train_data_json_gen.ipynb
|
| 15 |
+
β
|
| 16 |
+
βββ Evaluate/
|
| 17 |
+
β βββ Evaluate.ipynb
|
| 18 |
+
β βββ Results_IU_Xray/ # Contains evaluation results on IU X-ray dataset
|
| 19 |
+
β
|
| 20 |
+
βββ llava_phi/
|
| 21 |
+
β βββ Dual Slava train.ipynb # Training pipeline
|
| 22 |
+
β βββ generation.ipynb # Inference/report generation
|
| 23 |
+
β
|
| 24 |
+
βββ requirements.txt
|
| 25 |
+
βββ README.md
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## π§ Key Contributions
|
| 31 |
+
|
| 32 |
+
- **Dual-Encoder Fusion**: Combines CLIP and BiomedCLIP for each view with learnable weight Ξ±:
|
| 33 |
+
|
| 34 |
+
- **Cross-View Attention**: Enables anatomical reasoning across views:
|
| 35 |
+
|
| 36 |
+
- **Gated Feature Fusion**:
|
| 37 |
+
|
| 38 |
+
- **ReΒ³ Pipeline**:
|
| 39 |
+
1. **Recognize**: Generate Findings from images
|
| 40 |
+
2. **Reason**: Infer Impression from Findings
|
| 41 |
+
3. **Report**: Output structured radiology reports
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## π Evaluation Metrics
|
| 46 |
+
|
| 47 |
+
| Dataset | BLEU | ROUGE-L | METEOR | BERT | RadGraph F1 | CheXbert F1 |
|
| 48 |
+
| --------- | ---- | ------- | ------ | ---- | ----------- | ----------- |
|
| 49 |
+
| MIMIC-CXR | β
| β
| β
| β
| β
| β
|
|
| 50 |
+
| IU X-Ray | β
| β
| β
| β
| β
| β
|
|
| 51 |
+
|
| 52 |
+
_(Results in `/Evaluate/Results_IU_Xray`)_
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## π οΈ Setup
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
# Clone repo
|
| 60 |
+
git clone https://github.com/Clintonkjkj/Dual-View-Slava-CXR.git
|
| 61 |
+
cd Dual-View-Slava-CXR
|
| 62 |
+
|
| 63 |
+
# Set up virtual environment
|
| 64 |
+
python -m venv venv
|
| 65 |
+
source venv/bin/activate # or venv\Scripts\activate
|
| 66 |
+
|
| 67 |
+
# Install dependencies
|
| 68 |
+
pip install -r requirements.txt
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## π Usage
|
| 74 |
+
|
| 75 |
+
### Download the model
|
| 76 |
+
|
| 77 |
+
Huggingface - https://huggingface.co/CKJ26/Dual-View-Slava-Final
|
| 78 |
+
|
| 79 |
+
### ποΈ Train the Model
|
| 80 |
+
|
| 81 |
+
Use `llava_phi/Dual Slava train.ipynb` after preparing data using:
|
| 82 |
+
|
| 83 |
+
- `Data_collection_Mimic.ipynb`
|
| 84 |
+
- `Data_preprocess.ipynb`
|
| 85 |
+
- `Radgraph Based Report Cleaning.ipynb`
|
| 86 |
+
- `train_data_json_gen.ipynb`
|
| 87 |
+
|
| 88 |
+
### π Generate Reports
|
| 89 |
+
|
| 90 |
+
Use `llava_phi/generation.ipynb` with both frontal and lateral views, plus a prompt (e.g., "Generate a radiology report").
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## πΌοΈ Model Architecture
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
+
|
| 100 |
+
## π Citation
|
| 101 |
+
|
| 102 |
+
```bibtex
|
| 103 |
+
@misc{dualviewslava2025,
|
| 104 |
+
title={Dual View SLaVA-CXR: Structured Radiology Reporting via Multi-View Chest X-rays},
|
| 105 |
+
author={Clinton KJ et al.},
|
| 106 |
+
year={2025},
|
| 107 |
+
note={Capstone Project}
|
| 108 |
+
}
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## π§βπ» Author
|
| 114 |
+
|
| 115 |
+
- **Clinton KJ** β [Hugging Face Profile](https://huggingface.co/CKJ26)
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## π License
|
| 120 |
+
|
| 121 |
+
This repository is provided for academic research purposes only.
|