1aurent commited on
Commit
5bc7ab6
1 Parent(s): 3fb517d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +109 -2
README.md CHANGED
@@ -1,8 +1,115 @@
1
  ---
2
  tags:
3
  - image-classification
 
4
  - timm
 
 
 
 
 
5
  library_name: timm
6
- license: apache-2.0
 
 
 
 
 
 
 
7
  ---
8
- # Model card for resnext101_32x8d.tiatoolbox-kather100k
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  tags:
3
  - image-classification
4
+ - feature-extraction
5
  - timm
6
+ - biology
7
+ - cancer
8
+ - histology
9
+ - TIA
10
+ - tiatoolbox
11
  library_name: timm
12
+ pipeline_tag: image-classification
13
+ license: cc-by-4.0
14
+ datasets:
15
+ - 1aurent/NCT-CRC-HE
16
+ widget:
17
+ - src: >-
18
+ https://datasets-server.huggingface.co/assets/1aurent/NCT-CRC-HE/--/default/CRC_VAL_HE_7K/0/image/image.jpg
19
+ example_title: debris
20
  ---
21
+
22
+ # Model card for resnext101_32x4d.tiatoolbox-kather100k
23
+
24
+ A ResNeXt-D image classification model. \
25
+ Trained by [Tissue Image Analytics (TIA) Centre](https://warwick.ac.uk/fac/cross_fac/tia/) on "kather100k" histology patches.
26
+
27
+ ![](https://raw.githubusercontent.com/TissueImageAnalytics/tiatoolbox/develop/docs/tiatoolbox-logo.png)
28
+
29
+ ## Model Details
30
+
31
+ - **Model Type:** Image classification / Feature backbone
32
+ - **Model Stats:**
33
+ - Params (M): 87.0
34
+ - Image size: 224 x 224 x 3
35
+ - **Dataset**: [kather100k](https://tia-toolbox.readthedocs.io/en/latest/_autosummary/tiatoolbox.models.dataset.info.KatherPatchDataset.html#tiatoolbox.models.dataset.info.KatherPatchDataset), also called NCT-CRC-HE
36
+ - **Original:** https://github.com/TissueImageAnalytics/tiatoolbox
37
+ - **License**: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/legalcode)
38
+
39
+ ## Model Usage
40
+
41
+ ### Image Classification
42
+
43
+ ```python
44
+ from urllib.request import urlopen
45
+ from PIL import Image
46
+ import timm
47
+
48
+ # get example histology image
49
+ img = Image.open(
50
+ urlopen(
51
+ "https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
52
+ )
53
+ )
54
+
55
+ # load model from the hub
56
+ model = timm.create_model(
57
+ model_name="hf-hub:1aurent/resnext101_32x4d.tiatoolbox-kather100k",
58
+ pretrained=True,
59
+ ).eval()
60
+
61
+ # get model specific transforms (normalization, resize)
62
+ data_config = timm.data.resolve_model_data_config(model)
63
+ transforms = timm.data.create_transform(**data_config, is_training=False)
64
+
65
+ data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
66
+ output = model(data) # output is a (batch_size, num_features) shaped tensor
67
+ ```
68
+
69
+ ### Image Embeddings
70
+
71
+ ```python
72
+ from urllib.request import urlopen
73
+ from PIL import Image
74
+ import timm
75
+
76
+ # get example histology image
77
+ img = Image.open(
78
+ urlopen(
79
+ "https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
80
+ )
81
+ )
82
+
83
+ # load model from the hub
84
+ model = timm.create_model(
85
+ model_name="hf-hub:1aurent/resnext101_32x4d.tiatoolbox-kather100k",
86
+ pretrained=True,
87
+ num_classes=0,
88
+ ).eval()
89
+
90
+ # get model specific transforms (normalization, resize)
91
+ data_config = timm.data.resolve_model_data_config(model)
92
+ transforms = timm.data.create_transform(**data_config, is_training=False)
93
+
94
+ data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
95
+ output = model(data) # output is a (batch_size, num_features) shaped tensor
96
+ ```
97
+
98
+ ## Citation
99
+
100
+ ```bibtex
101
+ @article{Pocock2022,
102
+ author = {Pocock, Johnathan and Graham, Simon and Vu, Quoc Dang and Jahanifar, Mostafa and Deshpande, Srijay and Hadjigeorghiou, Giorgos and Shephard, Adam and Bashir, Raja Muhammad Saad and Bilal, Mohsin and Lu, Wenqi and Epstein, David and Minhas, Fayyaz and Rajpoot, Nasir M and Raza, Shan E Ahmed},
103
+ doi = {10.1038/s43856-022-00186-5},
104
+ issn = {2730-664X},
105
+ journal = {Communications Medicine},
106
+ month = {sep},
107
+ number = {1},
108
+ pages = {120},
109
+ publisher = {Springer US},
110
+ title = {{TIAToolbox as an end-to-end library for advanced tissue image analytics}},
111
+ url = {https://www.nature.com/articles/s43856-022-00186-5},
112
+ volume = {2},
113
+ year = {2022}
114
+ }
115
+ ```