LEMON ViT: cell morphology analysis model for pathology
1 min readupdated
LEMON is a Vision Transformer (ViT, neural network architecture for image processing using attention mechanisms) trained specifically for nuclear cell morphology analysis in computational pathology. It was trained using the MoCo v3 (self-supervised learning approach) method on millions of single-cell microscopic images from the TCGA dataset. The model generates high-quality vector representations (embeddings) for downstream classification and research. It is useful for researchers and engineers working in biomedical image analysis using the timm library.
Key features
- Vision Transformer architecture with about 85.8M parameters
- Trained on 10 million cell images from 10 thousand TCGA slides
- Optimized for low-resolution images and 8x8 patches
- MIT license for open use
What you can do
- Extract vector features from microscopic cell images for further analysis
- Integrate the model into computational pathology pipelines via the timm library
- Use embeddings for cell structure classification tasks
Example
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(
urlopen("[https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif](https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif)")
).convert('RGB')
model = timm.create_model(
model_name="hf-hub:1aurent/vit_base_patch8_224.lemon",
pretrained=True,
).eval()
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
data = transforms(img).unsqueeze(0)
output = model(data)
Read more
DetailsBase model: LEMON (vit_base_patch8_224)
Task: Feature Extraction
Library: timm
Image size: 40 x 40 x 3 pixels
Original training method: MoCo v3










Comments