|
| 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> |
0 commit comments