UNI2-h-features / README.md
HHenryD
Initial commit
1fdc2c0
---
license: cc-by-nc-nd-4.0
language:
- en
tags:
- histology
- pathology
- vision
- pytorch
- self-supervised
- vit
extra_gated_prompt: >-
The pretrained features of UNI2-h 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 pretrained features and their derivatives 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 features, you attest that all information (affiliation, research use) is correct and up-to-date.
Downloading the features requires prior registration on Hugging Face and agreeing to the terms of use.
By downloading the features, you agree not to distribute, publish or reproduce a copy of the features.
If another user within your organization wishes to use the features, 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.
extra_gated_fields:
Full name (first and last): text
Current affiliation (no abbreviations): text
Type of Affiliation:
type: select
options:
- Academia
- Industry
- label: Other
value: other
Current and official institutional email (**this must match your primary email in your Hugging Face account, @gmail/@hotmail/@qq email domains will be denied**): text
Please explain your intended research use: text
I agree to all terms outlined above: checkbox
I agree to use this model for non-commercial, academic purposes only: checkbox
I agree not to distribute the model, if another user within your organization wishes to use the released pretrained features, they must register as an individual user: checkbox
metrics:
- accuracy
pipeline_tag: image-feature-extraction
library_name: timm
---
# Dataset Card for UNI2-h Pretrained Features
This dataset card provides the UNI2-h features for TCGA, CPTAC, and PANDA datasets with patch size 256 x 256 pixels at 20x magnification.
## Requesting Access
As mentioned in the gated prompt, you must agree to the outlined terms of use, _**with the primary email for your HuggingFace account matching your institutional email**_. If your primary email is a personal email (@gmail/@hotmail/@qq) **your request will be denied**. To fix this, you can: (1) add your official institutional email to your HF account, and confirm your email address to verify, and (2) set your institutional email as your primary email in your HF account. Other reasons for your request access being denied include other mistakes in the form submitted, for example: full name includes abbreviations, affiliation is not spelled out, the described research use is not sufficient, or email domain address not recognized.
## Dataset Description
**Extracted by:** Mahmood Lab AI for Pathology @ Harvard/BWH
### UNI2-h
- **Model type:** Pretrained vision backbone (ViT-H/14 via DINOv2) for multi-purpose evaluation on histopathology images
- **Pretraining dataset:** Over 200 million image tiles sampled from over 350k diverse H&E and IHC slides sourced from Mass General Brigham.
- **Repository:** https://github.com/mahmoodlab/UNI
- **Paper:** https://www.nature.com/articles/s41591-024-02857-3
- **License:** CC-BY-NC-ND-4.0
## Usage
Following authentication, the pretrained features of a specific dataset and model can be loaded in the following ways:
### Install huggingface-cli and log into your account
```bash
pip install -U "huggingface_hub[cli]"
```
```bash
huggingface-cli login
```
### Download pretrained features
```bash
dataset_name=TCGA # or CPTAC, PANDA
project_name=TCGA-LUAD # or other projects
local_dir=UNI2-h_features # where to save downloaded features
huggingface-cli download MahmoodLab/UNI2-h-features ${dataset_name}/${project_name}.tar.gz --repo-type dataset --local-dir $local_dir
```
#### Content
- **Compressed Archives**: The dataset is distributed as tar.gz archives.
- **HDF5 Files**: Each archive contains a folder of .h5 files, where each file represents a single slide with its patch coordinates and features.
The features and the coordinates can be loaded by:
```python
import h5py
with h5py.File(h5_file,'r') as file:
features = file['features'][:] # 1 x num_patches x 1536
coords = file['coords'][:] # 1 x num_patches x 2
```
## Contact
For any additional questions or comments, contact Faisal Mahmood (`[email protected]`), Richard J. Chen (`[email protected]`), Tong Ding (`[email protected]`) or Ming Y. Lu (`[email protected]`).
## How to Cite
### Models
```
@article{chen2024uni,
title={Towards a General-Purpose Foundation Model for Computational Pathology},
author={Chen, Richard J and Ding, Tong and Lu, Ming Y and Williamson, Drew FK and Jaume, Guillaume and Chen, Bowen and Zhang, Andrew and Shao, Daniel and Song, Andrew H and Shaban, Muhammad and others},
journal={Nature Medicine},
publisher={Nature Publishing Group},
year={2024}
}
```
### Datasets
```
@article{weinstein2013cancer,
title={The cancer genome atlas pan-cancer analysis project},
author={Weinstein, John N and Collisson, Eric A and Mills, Gordon B and Shaw, Kenna R and Ozenberger, Brad A and Ellrott, Kyle and Shmulevich, Ilya and Sander, Chris and Stuart, Joshua M},
journal={Nature genetics},
volume={45},
number={10},
pages={1113--1120},
year={2013},
publisher={Nature Publishing Group}
}
@article{edwards2015cptac,
title = {{The CPTAC Data Portal: A Resource for Cancer Proteomics Research}},
author = {Edwards, Nathan J. and Oberti, Mauricio and Thangudu, Ratna R. and Cai, Shuang and McGarvey, Peter B. and Jacob, Shine and Madhavan, Subha and Ketchum, Karen A.},
journal = {Journal of Proteome Research},
volume = {14},
number = {6},
pages = {2707--2713},
year = {2015},
month = jun,
issn = {1535-3893},
publisher = {American Chemical Society},
doi = {10.1021/pr501254j}
}
@article{bulten2022artificial,
title={Artificial intelligence for diagnosis and Gleason grading of prostate cancer: the PANDA challenge},
author={Bulten, Wouter and Kartasalo, Kimmo and Chen, Po-Hsuan Cameron and Str{\"o}m, Peter and Pinckaers, Hans and Nagpal, Kunal and Cai, Yuannan and Steiner, David F and Van Boven, Hester and Vink, Robert and others},
journal={Nature medicine},
volume={28},
number={1},
pages={154--163},
year={2022},
publisher={Nature Publishing Group US New York}
}
```