Model reference · open weights
vit_large_patch14_reg4_224.kaiko_ai_towards_large_pathology_fms is an open-weight embedding model from 1aurent. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | 1aurent |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 304M |
| Runs with | timm |
| Released | 2024-06-07 |
| Popularity | 620 downloads / month |
| Licence | Commercial licence needed |
About
from torchvision.transforms import v2
from PIL import Image
import requests
import torch
import timm
import io
# get example histology image
url = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQc7_xZpGOfQT7sxKwf2w5lL4GAq6IX_CbTzP1NGeenzA&s"
image = Image.open(io.BytesIO(requests.get(url).content))
# load model from the hub
model = timm.create_model(
model_name="hf-hub:1aurent/vit_large_patch14_reg4_224.kaiko_ai_towards_large_pathology_fms",
dynamic_img_size=True,
pretrained=True,
).eval()
# get image transform
preprocessing = v2.Compose(
[
v2.ToImage(),
v2.Resize(size=224),
v2.CenterCrop(size=224),
v2.ToDtype(torch.float32, scale=True),
v2.Normalize(
mean=(0.5, 0.5, 0.5),
std=(0.5, 0.5, 0.5),
),
]
)
data = preprocessing(image).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
output = model(data) # output is a (batch_size, num_features) shaped tensor
@misc{ai2024largescale,
title = {Towards Large-Scale Training of Pathology Foundation Models},
author = {kaiko.ai and Nanne Aben and Edwin D. de Jong and Ioannis Gatopoulos and Nicolas Känzig and Mikhail Karasikov and Axel Lagré and Roman Moser and Joost van Doorn and Fei Tang},
year = {2024},
eprint = {2404.15217},
archivePrefix = {arXiv},
primaryClass = {cs.CV}
}
From the published model card. Full card on the HuggingFace links in the sidebar.
How it works
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Image Classification | BACH | Accuracy | 0.870 |
| Image Classification | CRC-NCT-HE | Accuracy | 0.930 |
| Image Classification | MHIST | Accuracy | 0.809 |
| Image Classification | PCam | Accuracy | 0.898 |
| Image Classification | TP53 | Accuracy | 0.656 |
| Image Classification | CoNSeP | Accuracy | 0.679 |
Using it via the API
Once AxForge deploys vit-large-patch14-reg4-224-kaiko-ai-towards-large-pathology-fms for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (vit-large-patch14-reg4-224-kaiko-ai-towards-large-pathology-fms below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"vit-large-patch14-reg4-224-kaiko-ai-towards-large-pathology-fms","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.