Astaxanthin commited on
Commit
e1e3e0f
·
verified ·
1 Parent(s): 8161122

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -11
README.md CHANGED
@@ -39,8 +39,32 @@ license: mit
39
 
40
  <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
41
 
42
- [More Information Needed]
43
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ### Downstream Use [optional]
45
 
46
  <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
@@ -96,7 +120,7 @@ Use the code below to get started with the model.
96
 
97
  <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
98
 
99
- [More Information Needed]
100
 
101
  ## Evaluation
102
 
@@ -108,9 +132,9 @@ Use the code below to get started with the model.
108
 
109
  <!-- This should link to a Dataset Card if possible. -->
110
 
111
- [More Information Needed]
112
 
113
- #### Factors
114
 
115
  <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
116
 
@@ -121,15 +145,45 @@ Use the code below to get started with the model.
121
  <!-- These are the evaluation metrics being used, ideally with a description of why. -->
122
 
123
  [More Information Needed]
124
-
125
  ### Results
126
 
127
- [More Information Needed]
128
 
129
- #### Summary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
 
131
 
 
132
 
 
133
  ## Model Examination [optional]
134
 
135
  <!-- Relevant interpretability work for the model goes here -->
@@ -164,7 +218,7 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
164
 
165
  #### Software
166
 
167
- [More Information Needed]
168
 
169
  ## Citation [optional]
170
 
@@ -178,7 +232,7 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
178
  journal={arXiv preprint arXiv:2412.13126},
179
  year={2024}
180
  }
181
-
182
  **APA:**
183
 
184
  [More Information Needed]
@@ -199,4 +253,4 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
199
 
200
  ## Model Card Contact
201
 
202
- [More Information Needed]
 
39
 
40
  <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
41
 
42
+ ```python
43
+ from transformers import AutoModel, AutoTokenizer
44
+ from torchvision import transforms
45
+ from PIL import Image
46
+
47
+ model = AutoModel.from_pretrained("Astaxanthin/KEEP", trust_remote_code=True)
48
+ tokenizer = AutoTokenizer.from_pretrained("Astaxanthin/KEEP", trust_remote_code=True)
49
+ model.eval()
50
+ transform = transforms.Compose([
51
+ transforms.Resize(size=224, interpolation=transforms.InterpolationMode.BICUBIC),
52
+ transforms.CenterCrop(size=(224, 224)),
53
+ transforms.ToTensor(),
54
+ transforms.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))
55
+ ])
56
+
57
+ example_image_path = './quick_start/example.tif'
58
+ example_text = ['an H&E image of breast invasive carcinoma.', 'an H&E image of normal tissue.', 'an H&E image of lung adenocarcinoma.']
59
+
60
+ img_input = transform(Image.open(example_image_path).convert('RGB')).unsqueeze(0)
61
+ token_input = tokenizer(example_text,max_length=256,padding='max_length',truncation=True, return_tensors='pt')
62
+
63
+ img_feature = model.encode_image(img_input)
64
+ text_feature = model.encode_text(token_input)
65
+
66
+ ```
67
+ <!--
68
  ### Downstream Use [optional]
69
 
70
  <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
120
 
121
  <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
122
 
123
+ [More Information Needed] -->
124
 
125
  ## Evaluation
126
 
 
132
 
133
  <!-- This should link to a Dataset Card if possible. -->
134
 
135
+ We present benchmark results for a range of representative tasks. A complete set of benchmarks can be found in the [paper](https://arxiv.org/abs/2412.18***). These results will be updated with each new iteration of KEEP.
136
 
137
+ <!-- #### Factors
138
 
139
  <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
140
 
 
145
  <!-- These are the evaluation metrics being used, ideally with a description of why. -->
146
 
147
  [More Information Needed]
148
+ -->
149
  ### Results
150
 
 
151
 
152
+ #### Zero-shot Cancer Region Segmentation (DICE)
153
+ | Models | PLIP[[1]](https://www.nature.com/articles/s41591-023-02504-3) | QuiltNet [[2]](https://proceedings.neurips.cc/paper_files/paper/2023/hash/775ec578876fa6812c062644964b9870-Abstract-Datasets_and_Benchmarks.html) | MI-Zero (Pub) [[3]](https://openaccess.thecvf.com/content/CVPR2023/html/Lu_Visual_Language_Pretrained_Multiple_Instance_Zero-Shot_Transfer_for_Histopathology_Images_CVPR_2023_paper.html) | CONCH [[4]](https://www.nature.com/articles/s41591-024-02856-4) | **KEEP(Ours)** |
154
+ |:---------------|--------------:|---------------------:|-------------------------:|-----------------:|------------------:|
155
+ | CAMELYON16 | 0.253 | 0.157 | 0.186 | 0.292 | **0.361** |
156
+ | PANDA | 0.295 | 0.309 | 0.276 | 0.315 | **0.334** |
157
+ | AGGC22 | 0.284 | 0.282 | 0.324 | 0.449 | **0.530** |
158
+
159
+ #### Zero-shot Cancer Detection (AUROC)
160
+ | Models | CHIEF[[1]](https://www.nature.com/articles/s41586-024-07894-z) | PLIP [[2]](https://www.nature.com/articles/s41591-023-02504-3) | QuiltNet [[3]](https://proceedings.neurips.cc/paper_files/paper/2023/hash/775ec578876fa6812c062644964b9870-Abstract-Datasets_and_Benchmarks.html) | MI-Zero (Pub) [[4]](https://openaccess.thecvf.com/content/CVPR2023/html/Lu_Visual_Language_Pretrained_Multiple_Instance_Zero-Shot_Transfer_for_Histopathology_Images_CVPR_2023_paper.html) | CONCH [[5]](https://www.nature.com/articles/s41591-024-02856-4) | KEEP(Ours) |
161
+ |:---------------|--------------:|--------------------:|-----------------:|-----------------:|------------------:| -----------------:|
162
+ | CPTAC-CM | 0.915 | 0.970 | 0.972 | 0.985 | **0.994** | **0.994** |
163
+ | CPTAC-CCRCC | 0.723 | 0.330 | 0.755 | 0.886 | 0.871 | **0.999** |
164
+ | CPTAC-PDA | 0.825 | 0.391 | 0.464 | 0.796 | 0.920 | **0.929** |
165
+ | CPTAC-UCEC | 0.955 | 0.945 | 0.973 | 0.979 | 0.996 | **0.998** |
166
+ | CPTAC-LSCC | 0.901 | 0.965 | 0.966 | 0.910 | **0.987** | 0.983 |
167
+ | CPTAC-HNSCC | 0.946 | 0.898 | 0.874 | 0.918 | **0.982** | 0.976 |
168
+ | CPTAC-LUAD | 0.891 | 0.988 | 0.991 | 0.981 | 0.999 | **1.000** |
169
+
170
+ #### Zero-shot Cancer Subtyping (BACC)
171
+ | Models | PLIP [[1]](https://www.nature.com/articles/s41591-023-02504-3) | QuiltNet [[2]](https://proceedings.neurips.cc/paper_files/paper/2023/hash/775ec578876fa6812c062644964b9870-Abstract-Datasets_and_Benchmarks.html) | MI-Zero (Pub) [[3]](https://openaccess.thecvf.com/content/CVPR2023/html/Lu_Visual_Language_Pretrained_Multiple_Instance_Zero-Shot_Transfer_for_Histopathology_Images_CVPR_2023_paper.html) | CONCH [[4]](https://www.nature.com/articles/s41591-024-02856-4) | **KEEP(Ours)** |
172
+ |:---------------|--------------:|---------------------------:|-------------------------:|-----------------:|------------------:|
173
+ | TCGA-BRCA | 0.519 | 0.500 | 0.633 | 0.727 | **0.774** |
174
+ | TCGA-NSCLC | 0.699 | 0.667 | 0.753 | 0.901 | **0.902** |
175
+ | TCGA-RCC | 0.735 | 0.755 | 0.908 | 0.921 | **0.926** |
176
+ | TCGA-ESCA | 0.614 | 0.746 | 0.954 | 0.923 | **0.977** |
177
+ | TCGA-BRAIN | 0.361 | 0.346 | 0.361 | 0.453 | **0.604** |
178
+ | UBC-OCEAN | 0.343 | 0.469 | 0.652 | **0.674** | 0.661 |
179
+ | CPTAC-NSCLC | 0.647 | 0.607 | 0.643 | 0.836 | **0.863** |
180
+ | EBRAINS | 0.096 | 0.093 | 0.325 | 0.371 | **0.456** |
181
 
182
+ #### Summary
183
 
184
+ Validated on 18 diverse benchmarks with more than 14,000 whole slide images (WSIs), KEEP achieves state-of-the-art performance in zero-shot cancer diagnostic tasks. Notably, for cancer detection, KEEP demonstrates an average sensitivity of 89.8% at a specificity of 95.0% across 7 cancer types, significantly outperforming vision-only foundation models and highlighting its promising potential for clinical application. For cancer subtyping, KEEP achieves a median balanced accuracy of 0.456 in subtyping 30 rare brain cancers, indicating strong generalizability for diagnosing rare tumors.
185
 
186
+ <!--
187
  ## Model Examination [optional]
188
 
189
  <!-- Relevant interpretability work for the model goes here -->
 
218
 
219
  #### Software
220
 
221
+ [More Information Needed] -->
222
 
223
  ## Citation [optional]
224
 
 
232
  journal={arXiv preprint arXiv:2412.13126},
233
  year={2024}
234
  }
235
+ <!--
236
  **APA:**
237
 
238
  [More Information Needed]
 
253
 
254
  ## Model Card Contact
255
 
256
+ [More Information Needed] -->