Add XGLASS checkpoint, pipeline figure, and model card
Browse files- .gitattributes +1 -0
- Final_pipeline.svg +3 -0
- README.md +104 -0
- checkpoint_info.json +11 -0
- xglass.ckpt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Final_pipeline.svg filter=lfs diff=lfs merge=lfs -text
|
Final_pipeline.svg
ADDED
|
|
Git LFS Details
|
README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
library_name: pytorch
|
| 5 |
+
tags:
|
| 6 |
+
- medical-imaging
|
| 7 |
+
- computed-tomography
|
| 8 |
+
- slice-ranking
|
| 9 |
+
- gaze
|
| 10 |
+
- xglass
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# XGLASS: X-Ray, Gaze and Language Assisted Slice Sequencing for CT Volumes
|
| 14 |
+
|
| 15 |
+
By Michael Glöckler and Timo Ropinski, Ulm University.
|
| 16 |
+
|
| 17 |
+
XGLASS ranks axial CT slices for a selected finding using a CT projection
|
| 18 |
+
combined with a disease-conditioned radiologist gaze prior.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
## Abstract
|
| 23 |
+
|
| 24 |
+
Vision-language models(VLMs) achieve remarkable performance on 2D medical images, such as X-rays or pathology images, while 3D VLMs that directly process CT/MRI volumes lag behind due to limited 3D training data and the predominance of 2D foundation architectures. To leverage powerful 2D VLMs for analyzing medical volumes, which contain hundreds of slices, it is therefore necessary to focus only on those few slices, which are diagnostically relevant. To enable such a prioritization, we propose XGLASS, a method that transfers medical expertise from 2D X-rays to 3D CT for task-aware slice prioritization. XGLASS uses disease-conditioned importance maps derived from language-aligned radiologist gaze on X-rays and spatially aligns them with coronal CT projections, bringing gaze priors and CT content into a shared 2D representation. The fused gaze-prior/CT projection is then used to predict a disease-specific ordering of axial slices, prioritizing diagnostically relevant slices. XGLASS significantly improves budgeted retrieval over 2D and 3D-native baselines, achieving a top-10 hit rate up to 75.9% for the best-performing disease. In practice, this means that after inspecting only the top 10 slices (4.17% of a 240-slice scan), XGLASS identifies a diagnostically relevant slice in more than 75% of cases. For downstream slice-wise finding classification, an XGLASS-selected 30-slice candidate set reduces model calls by 87.5% while improving F1 by 11.3 percentage points over all-slice inference, 4.2 points over the strongest 2D selector, and remains competitive with 3D-native selectors while requiring up to 130.8× less time and 10.9× less GPU memory per finding, supporting its use as a lightweight preselector for volumetric CT analysis.
|
| 25 |
+
|
| 26 |
+
## Checkpoint
|
| 27 |
+
|
| 28 |
+
| Setting | Value |
|
| 29 |
+
| --- | --- |
|
| 30 |
+
| File | `xglass.ckpt` |
|
| 31 |
+
| Backbone | `vit_base_patch16_224.augreg_in21k` |
|
| 32 |
+
| Projection | AIP, wide window (`aip_wide`) |
|
| 33 |
+
| Gaze blending alpha | 0.75 |
|
| 34 |
+
| Prepared image size | 256 × 256 (resized to 224 × 224 by the model) |
|
| 35 |
+
| Output | 240 slice-relevance scores per CT–finding pair |
|
| 36 |
+
| Training epoch | 6 (zero-based checkpoint value) |
|
| 37 |
+
| Format | PyTorch Lightning checkpoint, including training state |
|
| 38 |
+
|
| 39 |
+
The six findings used in the paper are atelectasis, consolidation,
|
| 40 |
+
groundglass opacity, high lung volume/emphysema, lung nodule or mass,
|
| 41 |
+
and pleural abnormality. Rankings refer to the normalized 240-slice CT block,
|
| 42 |
+
not directly to original-volume slice indices.
|
| 43 |
+
|
| 44 |
+
## Use with the GitHub code
|
| 45 |
+
|
| 46 |
+
[Code, data preparation, and inference notebook](https://github.com/michaelgloeckler/XGLASS)
|
| 47 |
+
|
| 48 |
+
In an activated Python 3.11 environment, install a PyTorch build suitable for
|
| 49 |
+
your hardware, then run:
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
git clone https://github.com/michaelgloeckler/XGLASS.git
|
| 53 |
+
cd XGLASS
|
| 54 |
+
pip install -r requirements.txt
|
| 55 |
+
pip install huggingface_hub
|
| 56 |
+
hf download MichaelGlo/XGLASS xglass.ckpt --local-dir checkpoints
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
While this repository is private, authenticate first with `hf auth login` using
|
| 60 |
+
an account with access. The GitHub repository also requires access while private.
|
| 61 |
+
|
| 62 |
+
Prepare the projection dataset using `data/README.md`. Use the supplied gaze
|
| 63 |
+
priors, AIP-wide projections, and alpha 0.75. Open `demo/infer_demo.ipynb`, set
|
| 64 |
+
the dataset paths and checkpoint path to `checkpoints/xglass.ckpt`, and run it.
|
| 65 |
+
The notebook performs gaze fusion, normalization, scoring, and visualization.
|
| 66 |
+
|
| 67 |
+
For model loading in existing code:
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
import sys
|
| 71 |
+
from pathlib import Path
|
| 72 |
+
import torch
|
| 73 |
+
|
| 74 |
+
# Run from the cloned GitHub repository root.
|
| 75 |
+
sys.path.insert(0, str(Path("src").resolve()))
|
| 76 |
+
from xglass.model import SlicePredictor
|
| 77 |
+
|
| 78 |
+
model = SlicePredictor.load_from_checkpoint(
|
| 79 |
+
"checkpoints/xglass.ckpt", map_location="cpu",
|
| 80 |
+
cache_dir=None, pretrained=False,
|
| 81 |
+
).eval()
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
This checkpoint uses the repository's Lightning model; it is not a Transformers
|
| 85 |
+
model. Raw CT files require the documented preprocessing and gaze-fusion pipeline.
|
| 86 |
+
Raw medical datasets are not included and must be obtained from their official sources.
|
| 87 |
+
|
| 88 |
+
## Results and limitations
|
| 89 |
+
|
| 90 |
+
The paper reports a best-finding Hit@10 of 75.9%. These are paper-reported
|
| 91 |
+
results, not a fresh evaluation of this uploaded checkpoint. This checkpoint
|
| 92 |
+
has passed a loading and synthetic forward-pass smoke test; full paper-result
|
| 93 |
+
reproduction has not been independently rerun for this release.
|
| 94 |
+
|
| 95 |
+
XGLASS is a research slice selector. Scores express slice relevance, not
|
| 96 |
+
calibrated diagnostic probabilities. Performance depends on the finding,
|
| 97 |
+
scan coverage, normalization, and preprocessing. No clinical deployment
|
| 98 |
+
validation is established by this release.
|
| 99 |
+
|
| 100 |
+
## License
|
| 101 |
+
|
| 102 |
+
The linked GitHub code is MIT-licensed. A license for redistribution and reuse
|
| 103 |
+
of these checkpoint weights has not yet been assigned. Dataset and base-model
|
| 104 |
+
terms are separate; the code license does not automatically apply to the weights.
|
checkpoint_info.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"filename": "xglass.ckpt",
|
| 3 |
+
"sha256": "b40b9a59b4dc69ef02e9dd9e0367a7ed65981d192cb46e10ae8f5e34484d318c",
|
| 4 |
+
"bytes": 1035976221,
|
| 5 |
+
"backbone": "vit_base_patch16_224.augreg_in21k",
|
| 6 |
+
"num_slices": 240,
|
| 7 |
+
"data_image_size": 256,
|
| 8 |
+
"projection_type": "aip_wide",
|
| 9 |
+
"blend_alpha": 0.75,
|
| 10 |
+
"epoch": 6
|
| 11 |
+
}
|
xglass.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b40b9a59b4dc69ef02e9dd9e0367a7ed65981d192cb46e10ae8f5e34484d318c
|
| 3 |
+
size 1035976221
|