1aurent commited on
Commit
6498e27
1 Parent(s): 1ec9bbb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +75 -1
README.md CHANGED
@@ -1,8 +1,82 @@
1
  ---
2
  tags:
 
3
  - image-classification
4
  - timm
 
 
 
5
  library_name: timm
6
- license: apache-2.0
 
 
 
 
7
  ---
 
8
  # Model card for vit_small_patch16_224.mocov3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  tags:
3
+ - feature-extraction
4
  - image-classification
5
  - timm
6
+ - biology
7
+ - cancer
8
+ - histology
9
  library_name: timm
10
+ license: gpl-3.0
11
+ pipeline_tag: feature-extraction
12
+ inference: false
13
+ metrics:
14
+ - accuracy
15
  ---
16
+
17
  # Model card for vit_small_patch16_224.mocov3
18
+
19
+ A Vision Transformer (ViT) image classification model. \
20
+ Trained on 15M histology patches from PAIP and TCGA. \
21
+ Used the MoCo v3 self supervised learning method.
22
+
23
+ ![](https://ars.els-cdn.com/content/image/1-s2.0-S1361841522002043-ga1_lrg.jpg)
24
+
25
+ ## Model Details
26
+
27
+ - **Model Type:** Feature backbone
28
+ - **Model Stats:**
29
+ - Params (M): 21.7
30
+ - Image size: 224 x 224 x 3
31
+ - **Papers:**
32
+ - Transformer-based unsupervised contrastive learning for histopathological image classification: https://www.sciencedirect.com/science/article/abs/pii/S1361841522002043
33
+ - **Dataset:** TCGA: https://portal.gdc.cancer.gov/
34
+ - **Original:** https://github.com/Xiyue-Wang/TransPath
35
+ - **License:** [GPLv3](https://github.com/Xiyue-Wang/TransPath/blob/main/LICENSE.md)
36
+
37
+ ## Model Usage
38
+
39
+ ### Image Embeddings
40
+ ```python
41
+ from urllib.request import urlopen
42
+ from PIL import Image
43
+ import timm
44
+
45
+ # get example histology image
46
+ img = Image.open(
47
+ urlopen(
48
+ "https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
49
+ )
50
+ )
51
+
52
+ # load model from the hub
53
+ model = timm.create_model(
54
+ model_name="hf-hub:1aurent/vit_small_patch16_224.mocov3",
55
+ pretrained=True,
56
+ num_heads=12,
57
+ ).eval()
58
+
59
+ # get model specific transforms (normalization, resize)
60
+ data_config = timm.data.resolve_model_data_config(model)
61
+ transforms = timm.data.create_transform(**data_config, is_training=False)
62
+
63
+ data = transforms(img).unsqueeze(0) # input is (batch_size, num_channels, img_size, img_size) shaped tensor
64
+ output = model(data) # output is (batch_size, num_features) shaped tensor
65
+ ```
66
+
67
+ ## Citation
68
+ ```bibtex
69
+ @article{WANG2022102559,
70
+ title = {Transformer-based unsupervised contrastive learning for histopathological image classification},
71
+ journal = {Medical Image Analysis},
72
+ volume = {81},
73
+ pages = {102559},
74
+ year = {2022},
75
+ issn = {1361-8415},
76
+ doi = {https://doi.org/10.1016/j.media.2022.102559},
77
+ url = {https://www.sciencedirect.com/science/article/pii/S1361841522002043},
78
+ author = {Xiyue Wang and Sen Yang and Jun Zhang and Minghui Wang and Jing Zhang and Wei Yang and Junzhou Huang and Xiao Han},
79
+ keywords = {Histopathology, Transformer, Self-supervised learning, Feature extraction},
80
+ abstract = {A large-scale and well-annotated dataset is a key factor for the success of deep learning in medical image analysis. However, assembling such large annotations is very challenging, especially for histopathological images with unique characteristics (e.g., gigapixel image size, multiple cancer types, and wide staining variations). To alleviate this issue, self-supervised learning (SSL) could be a promising solution that relies only on unlabeled data to generate informative representations and generalizes well to various downstream tasks even with limited annotations. In this work, we propose a novel SSL strategy called semantically-relevant contrastive learning (SRCL), which compares relevance between instances to mine more positive pairs. Compared to the two views from an instance in traditional contrastive learning, our SRCL aligns multiple positive instances with similar visual concepts, which increases the diversity of positives and then results in more informative representations. We employ a hybrid model (CTransPath) as the backbone, which is designed by integrating a convolutional neural network (CNN) and a multi-scale Swin Transformer architecture. The CTransPath is pretrained on massively unlabeled histopathological images that could serve as a collaborative local–global feature extractor to learn universal feature representations more suitable for tasks in the histopathology image domain. The effectiveness of our SRCL-pretrained CTransPath is investigated on five types of downstream tasks (patch retrieval, patch classification, weakly-supervised whole-slide image classification, mitosis detection, and colorectal adenocarcinoma gland segmentation), covering nine public datasets. The results show that our SRCL-based visual representations not only achieve state-of-the-art performance in each dataset, but are also more robust and transferable than other SSL methods and ImageNet pretraining (both supervised and self-supervised methods). Our code and pretrained model are available at https://github.com/Xiyue-Wang/TransPath.}
81
+ }
82
+ ```