Skip to content

Commit fa651d8

Browse files
author
Stephen Aylward
committed
Add LG AI's EXAONEPath-CRC-MSI-Predictor model
Model is on Hugging Face. This links to that model.
1 parent 51c398c commit fa651d8

File tree

4 files changed

+190
-0
lines changed

4 files changed

+190
-0
lines changed

hf_models/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ These models must be accessed directly from Hugging Face using the `huggingface_
1717
| Model | Description | HF Repository |
1818
|-------|-------------|--------------|
1919
| exaonepath | EXAONEPath is a patch-level pathology pretrained model with 86 million parameters | [LGAI-EXAONE/EXAONEPath](https://huggingface.co/LGAI-EXAONE/EXAONEPath) |
20+
| exaonepath-crc-msi-predictor | MSI classification of CRC tumors using EXAONEPath 1.0.0 Patch-level Foundation Model for Pathology | [LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor](https://huggingface.co/LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor) |
2021
| llama3_vila_m3_3b | Lightweight medical vision language model that enhances VLMs with medical expert knowledge (3B parameters) | [MONAI/Llama3-VILA-M3-3B](https://huggingface.co/MONAI/Llama3-VILA-M3-3B) |
2122
| llama3_vila_m3_8b | Medical vision language model that utilizes domain-expert models to improve precision in medical imaging tasks (8B parameters) | [MONAI/Llama3-VILA-M3-8B](https://huggingface.co/MONAI/Llama3-VILA-M3-8B) |
2223
| llama3_vila_m3_13b | Enhanced medical vision language model with improved capabilities for various medical imaging tasks (13B parameters) | [MONAI/Llama3-VILA-M3-13B](https://huggingface.co/MONAI/Llama3-VILA-M3-13B) |
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
EXAONEPath AI Model License Agreement 1.0 - NC
2+
3+
This EXAONEPath AI Model License Agreement (the "Agreement") is entered into by and between LG AI Research ("Licensor") and the individual or entity exercising the rights under this Agreement ("Licensee").
4+
5+
1. Definitions
6+
a. "Model" means the EXAONEPath AI Model, a machine learning model, including all associated weights, parameters, and other components.
7+
b. "Commercial Use" means any use of the Model primarily intended for or directed toward commercial advantage or monetary compensation.
8+
9+
2. License Grant
10+
Subject to the terms and conditions of this Agreement, Licensor hereby grants to Licensee a worldwide, non-exclusive, non-transferable, non-sublicensable, royalty-free license to use, reproduce, and create derivative works of the Model for non-commercial purposes only.
11+
12+
3. Restrictions
13+
a. Commercial Use is not permitted under this license.
14+
b. Licensee shall not use the Model in connection with any illegal, harmful, fraudulent, infringing, or offensive use.
15+
c. Licensee shall not use the Model to create, train, or improve any foundation models.
16+
d. Licensee shall not rent, lease, lend, sell, redistribute, or sublicense the Model.
17+
18+
4. Disclaimer of Warranties
19+
THE MODEL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
20+
21+
5. Limitation of Liability
22+
IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE MODEL OR THE USE OR OTHER DEALINGS IN THE MODEL.
23+
24+
6. Attribution
25+
Any use of the Model shall include appropriate attribution to LG AI Research and reference to the research paper: "EXAONEPath 1.0 Patch-level Foundation Model for Pathology" (https://arxiv.org/abs/2408.00380).
26+
27+
7. Termination
28+
This Agreement will terminate automatically if Licensee breaches any of its terms.
29+
30+
8. Governing Law
31+
This Agreement shall be governed by and construed in accordance with the laws of South Korea, without regard to its conflict of law provisions.
32+
33+
9. Entire Agreement
34+
This Agreement constitutes the entire agreement between the parties with respect to the use of the Model.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
license: other
3+
license_name: exaonepath
4+
license_link: LICENSE
5+
tags:
6+
- lg-ai
7+
- EXAONEPath-1.0
8+
- pathology
9+
- lg-ai
10+
---
11+
12+
# EXAONEPath-CRC-MSI-Predictor
13+
14+
## MSI classification of CRC tumors
15+
MSI classification of CRC tumors using EXAONEPath 1.0.0 Patch-level Foundation Model for Pathology.
16+
17+
[[`Paper`](https://arxiv.org/abs/2408.00380)] [[`Model`](https://huggingface.co/LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor/tree/main)] [[`BibTeX`](#citation)]
18+
19+
## Introduction
20+
This model serves as a reference for predicting MSI status using CRC (colorectal cancer) tumor images as input. When the model receives an H&E-stained whole slide image as input, it removes artifacts observed in the image and extracts only tissue-related objects. These objects are then reconstructed into a set of tiles with a size of 256 by 256 pixels at an mpp (micron per pixel) of 0.5.
21+
22+
The tiles pass through the EXAONEPath v1.0 patch-level foundation model (https://huggingface.co/LGAI-EXAONE/EXAONEPath), which converts them into a set of features. These features are then integrated into a slide-level feature representation through an aggregator(see the figure below). Finally, a linear classifier predicts the MSI status (MSS or MSI-H/L).
23+
24+
The model achieves an average performance of AUROC 0.93 on TCGA-COAD + TCGA-READ data and 0.84 on in-house data.
25+
26+
27+
## Quickstart
28+
29+
### Summary
30+
31+
1. Copy your WSI files in '''.svs''' format into the '''samples''' directory
32+
2. Run inference
33+
34+
### 1. Hardware Requirements
35+
- NVIDIA GPU is required
36+
- Minimum 8GB GPU memory recommended
37+
- NVIDIA driver version >= 450.80.02 required
38+
39+
### 2. Environment Setup
40+
Create and activate a virutal environment.
41+
```bash
42+
python -m venv venv
43+
source ./venv/bin/activate
44+
```
45+
46+
Install huggingface_cli and download files
47+
```bash
48+
pip install "huggingface_hub[cli]"
49+
huggingface-cli download LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor --local-dir .
50+
```
51+
52+
Install requirements
53+
```bash
54+
pip install -r requirements.txt
55+
```
56+
57+
Verify pytorch with GPU support
58+
```bash
59+
python -c "import torch; print(torch.cuda.is_available())"
60+
```
61+
62+
### 3. Data Preparation
63+
Copy your WSI files into the `samples` directory.
64+
65+
The program accepts ```.svs``` formatted files. This format is used,
66+
for example, for diagnostic slides as part of the TCGA-COAD project. An
67+
image from that project is available at the following link:
68+
69+
https://portal.gdc.cancer.gov/files/17cfcc8c-49a4-48ce-a5e1-4a3c582ce198
70+
71+
Download that data, extract the svs file from that compressed tar file, and
72+
copy the svs file to the top level of the `samples` directory.
73+
74+
### 4. Inference
75+
```bash
76+
python -m monai.bundle run inference --meta_file configs/metadata.json --config_file configs/inference.yaml
77+
```
78+
79+
### 5. Run-time errors
80+
81+
Particularly on Windows, if you receive the error
82+
```
83+
RuntimeError: Failed to evaluate ConfigExpression:
84+
"$scripts.inference.infer(__local_refs['model'], __local_refs['input_files'])"
85+
```
86+
and references line 71 in the file "scripts/exaonepath.py"
87+
```
88+
for count, patches in enumerate(patch_loader):
89+
```
90+
then you may have set the number of workers for the dataloader to 0. This is
91+
accomplished by changing line 65 of "scripts/exaonepath.py" to
92+
```
93+
num_workers=0,
94+
```
95+
and removing lines 66 and 67, such that lines 62-67 become
96+
```
97+
patch_loader = DataLoader(
98+
dataset=patch_dataset,
99+
batch_size=feature_extractor_batch_size,
100+
num_workers=0,
101+
pin_memory=self.device.type == "cuda",
102+
)
103+
```
104+
105+
## License
106+
The model is licensed under [EXAONEPath AI Model License Agreement 1.0 - NC](./LICENSE)
107+
108+
## Citation <a name="citation"></a>
109+
If you find EXAONEPath useful, please cite it using this BibTeX:
110+
```
111+
@article{yun2024exaonepath,
112+
title={EXAONEPath 1.0 Patch-level Foundation Model for Pathology},
113+
author={Yun, Juseung and Hu, Yi and Kim, Jinhyung and Jang, Jongseong and Lee, Soonyoung},
114+
journal={arXiv preprint arXiv:2408.00380},
115+
year={2024}
116+
}
117+
```
118+
119+
## Contact
120+
LG AI Research Technical Support: <a href="mailto:[email protected]">[email protected]</a>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_hf_20250321.json",
3+
"version": "1.0.0",
4+
"changelog": {
5+
"1.0.0": "initial release of EXAONEPath CRC MSI Predictor"
6+
},
7+
"monai_version": "1.4.0",
8+
"pytorch_version": "2.4.0",
9+
"numpy_version": "1.24.4",
10+
"required_packages_version": {
11+
"torch": "2.4.0",
12+
"torchvision": "0.15.0",
13+
"torchstain": "1.3.0",
14+
"pillow": "10.0.0",
15+
"huggingface_hub": "0.24.2",
16+
"transformers": "4.43.3"
17+
},
18+
"supported_apps": {
19+
"exaonepath-crc-msi-predictor": ""
20+
},
21+
"name": "EXAONEPath-CRC-MSI-Predictor",
22+
"task": "MSI classification of CRC tumors using EXAONEPath model",
23+
"description": "MSI classification of CRC tumors using EXAONEPath - a patch-level foundation model for pathology.",
24+
"authors": "LG AI Research",
25+
"copyright": "LG AI Research",
26+
"data_source": "LG AI Research",
27+
"data_type": "WSI patches",
28+
"image_classes": "RGB pathology image patches",
29+
"huggingface_model_id": "LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor",
30+
"huggingface_url": "https://huggingface.co/LGAI-EXAONE/EXAONEPath-CRC-MSI-Predictor",
31+
"intended_use": "Research and clinical support for pathology image analysis",
32+
"references": [
33+
"Yun, Juseung, et al. 'EXAONEPath 1.0 Patch-level Foundation Model for Pathology', arXiv preprint arXiv:2408.00380 (2024)."
34+
]
35+
}

0 commit comments

Comments
 (0)