Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Virchow2 and minor model card fixes #3475

Merged
merged 10 commits into from
Oct 10, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extra_config: model.yaml
spec: spec.yaml
type: model
categories: ["Foundation Models"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

[BiomedCLIP](https://aka.ms/biomedclip-paper) is a biomedical vision-language foundation model that is pretrained on [PMC-15M](https://aka.ms/biomedclip-paper), a dataset of 15 million figure-caption pairs extracted from biomedical research articles in PubMed Central, using contrastive learning.
It uses PubMedBERT as the text encoder and Vision Transformer as the image encoder, with domain-specific adaptations.
It can perform various vision-language processing (VLP) tasks such as cross-modal retrieval, image classification, and visual question answering.

## Citation

```bibtex
@misc{https://doi.org/10.48550/arXiv.2303.00915,
doi = {10.48550/ARXIV.2303.00915},
url = {https://arxiv.org/abs/2303.00915},
author = {Zhang, Sheng and Xu, Yanbo and Usuyama, Naoto and Bagga, Jaspreet and Tinn, Robert and Preston, Sam and Rao, Rajesh and Wei, Mu and Valluri, Naveen and Wong, Cliff and Lungren, Matthew and Naumann, Tristan and Poon, Hoifung},
title = {Large-Scale Domain-Specific Pretraining for Biomedical Vision-Language Processing},
publisher = {arXiv},
year = {2023},
}
```

## Model Use

### Sample Input

```json
{
"input_data": {
"columns": [
"image",
"text"
],
"index":[0, 1, 2],
"data": [
["image1", "labe1, label2, label3"],
["image2", "labe1, label2, label3"],
["image3", "labe1, label2, label3"],
]
}
}
```
### Sample Output
```json
[
{
"probs": [0.95, 0.03, 0.02],
"labels": ["label1", "label2", "label3"]
},
{
"probs": [0.04, 0.93, 0.03],
"labels": ["label1", "label2", "label3"]
}
]
```

### Intended Use

This model is intended to be used solely for (I) future research on visual-language processing and (II) reproducibility of the experimental results reported in the reference paper.

#### Primary Intended Use

The primary intended use is to support AI researchers building on top of this work. BiomedCLIP and its associated models should be helpful for exploring various biomedical VLP research questions, especially in the radiology domain.

#### Out-of-Scope Use

**Any** deployed use case of the model --- commercial or otherwise --- is currently out of scope. Although we evaluated the models using a broad set of publicly-available research benchmarks, the models and evaluations are not intended for deployed use cases. Please refer to [the associated paper](https://aka.ms/biomedclip-paper) for more details.

## Data

This model builds upon [PMC-15M dataset](https://aka.ms/biomedclip-paper), which is a large-scale parallel image-text dataset for biomedical vision-language processing. It contains 15 million figure-caption pairs extracted from biomedical research articles in PubMed Central. It covers a diverse range of biomedical image types, such as microscopy, radiography, histology, and more.

## Limitations

This model was developed using English corpora, and thus can be considered English-only.

## Further information

Please refer to the corresponding paper, ["Large-Scale Domain-Specific Pretraining for Biomedical Vision-Language Processing"](https://aka.ms/biomedclip-paper) for additional details on the model training and evaluation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
path:
container_name: models
container_path: huggingface/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224/mlflow_model_folder
storage_name: automlcesdkdataresources
type: azureblob
publish:
description: description.md
type: mlflow_model
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json

name: BiomedCLIP-PubMedBERT_256-vit_base_patch16_224
path: ./

properties:
inference-min-sku-spec: 6|1|112|64
inference-recommended-sku: Standard_NC6s_v3, Standard_NC12s_v3, Standard_NC24s_v3, Standard_NC24ads_A100_v4, Standard_NC48ads_A100_v4, Standard_NC96ads_A100_v4, Standard_ND96asr_v4, Standard_ND96amsr_A100_v4, Standard_ND40rs_v2
languages: en
SharedComputeCapacityEnabled: true

tags:
task: zero-shot-image-classification
industry: health-and-life-sciences
Preview: ""
inference_supported_envs:
- hf
license: mit
author: Microsoft
hiddenlayerscanned: ""
SharedComputeCapacityEnabled: ""
inference_compute_allow_list:
[
Standard_NC6s_v3,
Standard_NC12s_v3,
Standard_NC24s_v3,
Standard_NC24ads_A100_v4,
Standard_NC48ads_A100_v4,
Standard_NC96ads_A100_v4,
Standard_ND96asr_v4,
Standard_ND96amsr_A100_v4,
Standard_ND40rs_v2,
]
version: 1
4 changes: 4 additions & 0 deletions assets/models/system/Virchow/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extra_config: model.yaml
spec: spec.yaml
type: model
categories: ["Foundation Models"]
102 changes: 102 additions & 0 deletions assets/models/system/Virchow/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Virchow is a self-supervised vision transformer pretrained using 1.5M whole slide histopathology images. The model can be used as a tile-level feature extractor (frozen or finetuned) to achieve state-of-the-art results for a wide variety of downstream computational pathology use cases.

## Model Details
- **Developed by:** Paige, NYC, USA and Microsoft Research, Cambridge, MA USA
- **Model Type:** Image feature backbone
- **Model Stats:**
- Params (M): 632
- Image size: 224 x 224
- **Model Architecture:**
- Architecture: ViT-H/14
- Patch size: 14
- Layers: 32
- Embedding dimension: 1280
- Activation function: SwiGLU
- Attention heads: 16
- LayerScale: true
- **Training Details:**:
- Precision: Mixed precision (`fp16`)
- Objective: DINOv2 (https://doi.org/10.48550/arXiv.2304.07193)
- **Paper:**
- A foundation model for clinical-grade computational pathology and rare cancers detection: https://www.nature.com/articles/s41591-024-03141-0
- **Pretraining Dataset:** Internal dataset of 1.5 million whole slide images from Memorial Sloan Kettering Cancer Center, tiles sampled at 0.5 microns per pixel resolution (20x magnification).
- **License:** Apache 2.0

## Model Usage

### Sample Input

```json
{
"input_data": {
"columns": [
"image"
],
"index":[0],
"data": [
["image1"]
]
}
}
```
Note:
- "image1" and "image2" should be publicly accessible urls or strings in base64 format.

### Sample Output
```json
[
{
"output": [
0.0, 0.0, 0.0, 0.0
]
}
]
```
Output will be image embeddings.

## Use
### Direct use
Virchow intended to be used as a frozen feature extractor as the foundation for tile-level and whole slide-level classifiers.
### Downstream use
Virchow can be finetuned to adapt to specific tasks and/or datasets.
## Terms of use
The Virchow Model and associated code are released under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Additional Terms
Please note that the primary email used to sign up for your Hugging Face account must match your institutional email to receive approval. By downloading the Virchow Model, you attest that all information (affiliation, research use) is correct and up-to-date. Downloading the Virchow Model requires prior registration on Hugging Face and agreeing to the terms of use.

While the Apache 2.0 License grants broad permissions, we kindly request that users adhere to the following guidelines:

1. Attribution: We encourage proper attribution when using or redistributing the Virchow Model or its derivatives. Please include a reference to the original source and creators.

2. Responsible Use: Users are expected to use the Virchow Model responsibly and ethically. Please consider the potential impacts of your use on individuals and society.

3. Medical or Clinical Use: The Virchow Model is not intended for use in medical diagnosis, treatment, or prevention of disease of real patients. It should not be used as a substitute for professional medical advice.

4. Privacy and Data Protection: Users should respect privacy rights and comply with applicable data protection laws when using the Virchow Model.

5. No Malicious Use: The Virchow Model should not be used to create malicious code, malware, or to interfere with the proper functioning of computer systems.

6. Transparency: If you use the Virchow Model in a product or service, we encourage you to disclose this fact to your end users.

7. Feedback and Contributions: We welcome feedback and contributions to improve the Virchow Model. Please consider sharing your improvements with the community.

These additional terms are not intended to restrict your rights under the Apache 2.0 License but to promote responsible and ethical use of the Virchow Model.

By using the Virchow Model, you acknowledge that you have read and understood these terms.
## Citation
Please cite the following work if you used this model in your research.
Vorontsov, E., Bozkurt, A., Casson, A. et al. A foundation model for clinical-grade computational pathology and rare cancers detection. Nat Med (2024). https://doi.org/10.1038/s41591-024-03141-0
```
@article{vorontsov2024virchow,
title={A foundation model for clinical-grade computational pathology and rare cancers detection},
author={Vorontsov, Eugene and Bozkurt, Alican and Casson, Adam and Shaikovski, George and Zelechowski, Michal and Severson, Kristen and Zimmermann, Eric and Hall, James and Tenenholtz, Neil and Fusi, Nicolo and Yang, Ellen and Mathieu, Philippe and van Eck, Alexander and Lee, Donghun and Viret, Julian and Robert, Eric and Wang, Yi Kan and Kunz, Jeremy D. and Lee, Matthew C. H. and Bernhard, Jan H. and Godrich, Ran A. and Oakley, Gerard and Millar, Ewan and Hanna, Matthew and Wen, Hannah and Retamero, Juan A. and Moye, William A. and Yousfi, Razik and Kanan, Christopher and Klimstra, David S. and Rothrock, Brandon and Liu, Siqi and Fuchs, Thomas J.},
journal={Nature Medicine},
year={2024},
publisher={Nature Publishing Group}
}
```
8 changes: 8 additions & 0 deletions assets/models/system/Virchow/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
path:
container_name: models
container_path: huggingface/Virchow/mlflow_model_folder
storage_name: automlcesdkdataresources
type: azureblob
publish:
description: description.md
type: mlflow_model
34 changes: 34 additions & 0 deletions assets/models/system/Virchow/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json

name: Virchow
path: ./

properties:
inference-min-sku-spec: 6|1|112|64
inference-recommended-sku: Standard_NC6s_v3, Standard_NC12s_v3, Standard_NC24s_v3, Standard_NC24ads_A100_v4, Standard_NC48ads_A100_v4, Standard_NC96ads_A100_v4, Standard_ND96asr_v4, Standard_ND96amsr_A100_v4, Standard_ND40rs_v2
languages: en
SharedComputeCapacityEnabled: true

tags:
task: image-feature-extraction
industry: health-and-life-sciences
Preview: ""
inference_supported_envs:
- hf
license: apache-2.0
author: Paige
hiddenlayerscanned: ""
SharedComputeCapacityEnabled: ""
inference_compute_allow_list:
[
Standard_NC6s_v3,
Standard_NC12s_v3,
Standard_NC24s_v3,
Standard_NC24ads_A100_v4,
Standard_NC48ads_A100_v4,
Standard_NC96ads_A100_v4,
Standard_ND96asr_v4,
Standard_ND96amsr_A100_v4,
Standard_ND40rs_v2,
]
version: 1
4 changes: 4 additions & 0 deletions assets/models/system/Virchow2/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extra_config: model.yaml
spec: spec.yaml
type: model
categories: ["Foundation Models"]
105 changes: 105 additions & 0 deletions assets/models/system/Virchow2/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Virchow2 is a self-supervised vision transformer pretrained using 3.1M whole slide histopathology images. The model can be used as a tile-level feature extractor (frozen or finetuned) to achieve state-of-the-art results for a wide variety of downstream computational pathology use cases.

## Model Details
- **Developed by:** Paige, NYC, USA and Microsoft Research, Cambridge, MA USA
- **Model Type:** Image feature backbone
- **Model Stats:**
- Params (M): 632
- Image size: 224 x 224
- **Model Architecture:**
- Architecture: ViT-H/14
- Patch size: 14
- Layers: 32
- Embedding dimension: 1280
- Activation function: SwiGLU
- Attention heads: 16
- LayerScale: true
- Register tokens: 4
- **Training Details:**
- Precision: Mixed precision (`fp16`)
- Objective: Modified DINOv2 (https://doi.org/10.48550/arXiv.2304.07193)
- KoLeo regularizer replaced with kernel density estimator
- Crop-and-resize augmentation replaced with extended context translation
- **Paper:**
- Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology https://arxiv.org/pdf/2408.00738
- **Pretraining Dataset:** Internal dataset of 3.1 million whole slide images from Memorial Sloan Kettering Cancer Center, tiles sampled at 2.0, 1.0, 0.5 and 0.25 microns per pixel resolution (5x, 10x, 20x, and 40x magnification).
- **License:** CC-BY-NC-ND-4.0

## Model Usage

### Sample Input

```json
{
"input_data": {
"columns": [
"image"
],
"index":[0],
"data": [
["image1"]
]
}
}
```
Note:
- "image1" and "image2" should be publicly accessible urls or strings in base64 format.

### Sample Output
```json
[
{
"output": [
0.0, 0.0, 0.0, 0.0
]
}
]
```
Output will be image embeddings.

## Use
### Direct use
Virchow2 intended to be used as a frozen feature extractor as the foundation for tile-level and whole slide-level classifiers.
### Downstream use
Virchow2 can be finetuned to adapt to specific tasks and/or datasets.
## Terms of use
This model and associated code are released under the CC-BY-NC-ND 4.0 license and may only be used for non-commercial, academic research purposes with proper attribution. Any commercial use, sale, or other monetization of the Virchow2 Model and its derivatives, which include models trained on outputs from the Virchow2 Model or datasets created from the Virchow2 Model, is prohibited and requires prior approval. Please note that the primary email used to sign up for your Hugging Face account must match your institutional email to receive approval. By downloading the Virchow2 Model, you attest that all information (affiliation, research use) is correct and up-to-date. Downloading the Virchow2 Model requires prior registration on Hugging Face and agreeing to the terms of use. By downloading the Virchow2 model, you agree not to distribute, publish or reproduce a copy of the Virchow2 Model. If another user within your organization wishes to use the Virchow2 Model, they must register as an individual user and agree to comply with the terms of use. If you are a commercial entity, please contact the corresponding author.
Further, by downloading the Virchow2 model, you agree you will only use the Virchow2 model for academic research purposes and will not use, or allow others to use, the Virchow2 model to:

1. Diagnose, cure, mitigate, treat, or prevent disease or any other conditions, including for Investigational Use Only (“IUO”), Research Use Only (“RUO”), commercial, clinical or other similar use, and including as a substitute for professional medical advice, a healthcare opinion, a diagnosis, treatment, or the clinical judgment of a healthcare professional, as no license or right is granted for any such purposes.

2. Re-identify the deidentified data used to develop the Virchow2 Model;

3. Violate the law or others’ rights, including to:
a. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content;

b. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals;

c. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services;

d. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices;

e. Collect, process, disclose, generate, or infer the identity of individuals or the health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws;

f. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Virchow2 Model or any related materials; and

g. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system.

5. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including the use of the Virchow2 Model as a medical device, clinical support, diagnostic tool, or other technology intended to be used in the diagnosis, cure, mitigation, treatment, or prevention of disease or other conditions, including for Investigational Use Only (“IUO”), Research Use Only (“RUO”), commercial, clinical or similar use; and

6. Intentionally deceive or mislead others, including representing that the use of the Virchow2 Model or its outputs is human-generated.
Further, you agree that you will appropriately disclose to end users any known dangers of your AI system.
## Citation
Please cite the following work if you used this model in your research.
Zimmermann, E., Vorontsov, E., Viret, J. et al. Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology. arXiv preprint arXiv:2408.00738 (2024).
```
@article{zimmermann2024virchow2,
title={Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology},
author={Eric Zimmermann and Eugene Vorontsov and Julian Viret and Adam Casson and Michal Zelechowski and George Shaikovski and Neil Tenenholtz and James Hall and Thomas Fuchs and Nicolo Fusi and Siqi Liu and Kristen Severson},
journal={arXiv preprint arXiv:2408.00738},
year={2024},
}
```
## Disclaimer
Virchow2 has been developed for research purposes and is not intended for diagnosis of real patients or projection/prediction of future disease possibilities.
Fairness evaluation cannot be completed due to limitations in the metadata. Underlying biases of the training datasets may not be well characterized and may not be representative of all demographics.
Loading
Loading