2ms commited on
Commit
dc2074c
·
0 Parent(s):
Files changed (2) hide show
  1. .gitattributes +3 -0
  2. README.md +88 -0
.gitattributes ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *.svs filter=lfs diff=lfs merge=lfs -text
2
+ *.bin filter=lfs diff=lfs merge=lfs -text
3
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: exaonepath
4
+ license_link: LICENSE
5
+ tags:
6
+ - lg-ai
7
+ - EXAONEPath-1.5
8
+ - pathology
9
+ ---
10
+ <!--# EXAONE Path for CRCMSI – CRCMSI-centric Whole-Slide Image Classifier
11
+ *A purpose-built upgrade of **EXAONE Path 1.5***-->
12
+
13
+ ## Introduction
14
+ <!--**EXAONE Path for CRCMSI** is an **enhanced whole-slide image (WSI) classification framework** that retains the core architecture of EXAONE Path 1.5 while upgrading its internals for greater efficiency and richer multimodal integration.-->
15
+ **EXAONE Path MSI** is an **enhanced whole-slide image (WSI) classification framework** that retains the core architecture of EXAONE Path while upgrading its internals for greater efficiency and richer multimodal integration.
16
+
17
+ The pipeline still unfolds in two stages:
18
+
19
+ 1. **Patch-wise feature extraction** – Each WSI is tiled into 256 × 256 px patches, which are embedded into 768-dimensional vectors using the frozen **[EXAONE Path](https://huggingface.co/LGAI-EXAONE/EXAONEPath)** encoder.
20
+ 2. **Slide-level aggregation** – The patch embeddings are aggregated using a Vision Transformer, producing a unified slide-level representation that a lightweight classification head transforms into task-specific probabilities.
21
+
22
+ ---
23
+
24
+ ## Key Improvements
25
+
26
+ - **[FlexAttention](https://pytorch.org/blog/flexattention/) + `torch.compile`**
27
+ *What changed:* Replaced vanilla multi‑head self‑attention with IO‑aware **FlexAttention** kernels and enabled `torch.compile` to fuse the forward/backward graph at runtime. The new kernel layout dramatically improves both memory efficiency and training-and-inference throughput.
28
+
29
+ - **Coordinate‑aware Relative Bias**
30
+ *What changed:* Added an ALiBi‑style distance bias that is computed from the (x, y) patch coordinates themselves, allowing the ViT aggregator to reason about spatial proximity.
31
+
32
+ - **Scalable Mixed‑Omics Encoder (Token‑mixing Transformer)**
33
+ *What changed:* Each omics modality is first tokenised into a fixed‑length set. **All modality‑specific tokens are concatenated into a single sequence and passed through a shared multi‑head self‑attention stack**, enabling direct information exchange across modalities in one shot. The aggregated omics representation is subsequently fused with image tokens via cross‑attention. This release uses **three modalities (RNA, CNV, DNA‑methylation)**, but the design is agnostic to modality count and scales linearly with token number.
34
+
35
+ ---
36
+
37
+
38
+ ## Quick Start
39
+
40
+ ### Requirements
41
+ - NVIDIA GPU (≥ 40 GB)
42
+ - CUDA 12.8
43
+ - pytorch 2.7.0+cu128
44
+
45
+ ### Installation
46
+ ```bash
47
+ git clone https://huggingface.co/LGAI-EXAONE/{MODEL_NAME}.git
48
+ cd {MODEL_NAME}
49
+ pip install -r requirements.txt
50
+ ```
51
+
52
+ ### Quick Inference
53
+ ```python
54
+ from models.exaonepath import EXAONEPathV1p5Downstream
55
+
56
+ hf_token = "YOUR_HUGGING_FACE_ACCESS_TOKEN"
57
+ model = EXAONEPathV1p5Downstream.from_pretrained(
58
+ "LGAI-EXAONE/{MODEL_NAME}",
59
+ use_auth_token=hf_token
60
+ )
61
+ probs = model("./samples/wsis/1/1.svs")
62
+ print(f"P(CRCMSI mutant) = {probs[1]:.3f}")
63
+ ```
64
+
65
+ #### Command‑line
66
+ ```bash
67
+ python inference.py --svs_path ./samples/wsis/1/1.svs
68
+ ```
69
+
70
+
71
+ ### Model Performance Comparison
72
+
73
+ | Metric (AUC) / Task | Titan (Conch v1.5 + iBot, image-text) | PRISM (virchow + perceiver, image-text) | CHIEF (CTransPath + CLAM, image-text, WSI-contrastive) | Prov-GigaPath (GigaPath + LongNet, image-only, mask-prediction) | UNI2-h + CLAM (image-only) | EXAONE Path 1.5 | EXAONE Path MSI |
74
+ |------------------------------------|---------------------------------------|-----------------------------------------|--------------------------------------------------------|-----------------------------------------------------------------|---------------------------|------------------------|------------------------|
75
+ | **CRC-MSI** | 0.9370 | 0.9432 | 0.9273 | 0.9541 | <u>0.9808</u> | 0.9537 |**0.9844** |
76
+ <!--| LUAD-TMB (cutoff 10) | 0.6901 | 0.6445 | 0.6501 | 0.6744 | 0.6686 | 0.6846 | |
77
+ | LUAD-EGFR-mut | 0.8197 | 0.8152 | 0.7691 | 0.7623 | 0.8577 | 0.7607 | |
78
+ | LUAD-KRAS-mut | 0.5405 | 0.6299 | 0.4676 | 0.5110 | 0.4690 | 0.5480 | |
79
+ | BRCA-ER | 0.9343 | 0.8998 | 0.9115 | 0.9186 | 0.9454 | 0.9096 | |
80
+ | BRCA-PR | 0.8804 | 0.8613 | 0.8470 | 0.8595 | 0.8770 | 0.8215 | |
81
+ | BRCA-HER2 | 0.8046 | 0.8154 | 0.7822 | 0.7891 | 0.8322 | 0.7811 | |
82
+ | BRCA-TP53 | 0.7879 | 0.8415 | 0.7879 | 0.7388 | 0.8080 | 0.6607 | |
83
+ | BRCA-PIK3CA | 0.7577 | 0.8929 | 0.7015 | 0.7347 | 0.8571 | 0.7066 | |
84
+ | RCC-PBRM1 | 0.6383 | 0.5570 | 0.5129 | 0.5270 | 0.5011 | 0.4445 | |
85
+ | RCC-BAP1 | 0.7188 | 0.7690 | 0.7310 | 0.6970 | 0.7160 | 0.7337 | |
86
+ | COAD-KRAS | 0.7642 | 0.7443 | 0.6989 | 0.8153 | 0.9432 | 0.6790 | |
87
+ | COAD-TP53 | 0.8889 | 0.8160 | 0.7014 | 0.7118 | 0.7830 | 0.8785 | |
88
+ | <span style="color:red">**Average**</span> | 0.7817 | 0.7869 | 0.7299 | 0.7457 | <u>0.7876</u> | <span style="color:red">**0.7932**</span> |-->