File size: 2,831 Bytes
dbe2dd5
 
 
5576f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dbe2dd5
 
5576f54
 
4ba9e83
5576f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
library_name: peft
base_model: owkin/phikon
tags:
- feature-extraction
- image-classification
- timm
- biology
- cancer
- owkin
- histology
model-index:
- name: owkin_pancancer
  results:
  - task:
      type: image-classification
      name: Image Classification
    dataset:
      name: 1aurent/Kather-texture-2016
      type: image-classification
    metrics:
    - type: accuracy
      value: 0.99
      name: accuracy
      verified: false
license: other
license_name: owkin-non-commercial
license_link: https://github.com/owkin/HistoSSLscaling/blob/main/LICENSE.txt
pipeline_tag: image-classification
datasets:
- 1aurent/Kather-texture-2016
metrics:
- accuracy
widget:
- src: https://datasets-server.huggingface.co/assets/1aurent/Kather-texture-2016/--/default/train/0/image/image.jpg
  example_title: adipose
---

# Model card for phikon-finetuned-lora-kather2016

This model is a fine-tuned version of [owkin/phikon](https://huggingface.co/owkin/phikon) on the [1aurent/Kather-texture-2016](https://huggingface.co/datasets/1aurent/Kather-texture-2016) dataset.

## Model Usage

### Image Embeddings
```python
from transformers import AutoModelForImageClassification, AutoImageProcessor
from peft import PeftConfig, PeftModel
from urllib.request import urlopen
from PIL import Image

# get example histology image
img = Image.open(
  urlopen(
    "https://datasets-server.huggingface.co/assets/1aurent/Kather-texture-2016/--/default/train/0/image/image.jpg"
  )
)

# load config, image_processor, base_model and lora_model from the hub
model_name = "1aurent/phikon-finetuned-lora-kather2016"
config = PeftConfig.from_pretrained(
  pretrained_model_name_or_path=model_name
)
image_processor = AutoImageProcessor.from_pretrained(
  pretrained_model_name_or_path=config.base_model_name_or_path
)
model = AutoModelForImageClassification.from_pretrained(
  pretrained_model_name_or_path=config.base_model_name_or_path,
  num_labels=8,
)
lora_model = PeftModel.from_pretrained(
  model=model,
  model_id=model_name
)

inputs = image_processor(img, return_tensors="pt")
outputs = lora_model(**inputs)
```

## Citation
```bibtex
@article{Filiot2023.07.21.23292757,
  author       = {Alexandre Filiot and Ridouane Ghermi and Antoine Olivier and Paul Jacob and Lucas Fidon and Alice Mac Kain and Charlie Saillard and Jean-Baptiste Schiratti},
  title        = {Scaling Self-Supervised Learning for Histopathology with Masked Image Modeling},
  elocation-id = {2023.07.21.23292757},
  year         = {2023},
  doi          = {10.1101/2023.07.21.23292757},
  publisher    = {Cold Spring Harbor Laboratory Press},
  url          = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757},
  eprint       = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757.full.pdf},
  journal      = {medRxiv}
}
```