Model reference · open weights
OpenPhenom is an open-weight embedding model from recursionpharma. 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 | recursionpharma |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Runs with | transformers |
| Released | 2024-10-21 |
| Popularity | 2k downloads / month |
| Licence | Unknown |
About
Channel-agnostic image encoding model CA-MAE with a ViT-S/16 encoder backbone designed for microscopy image featurization. The model uses a vision transformer backbone with channelwise cross-attention over patch tokens to create contextualized representations separately for each channel.
This model is a channel-agnostic masked autoencoder trained to reconstruct microscopy images over three datasets:
Requires Python 3.10.4 or higher. From a clone of the repository:
cd /path/to/OpenPhenom
pip install -e .
NOTE: model embeddings tend to extract features only after using standard batch correction post-processing techniques. We recommend, at a minimum, after inferencing the model over your images, to do the standard PCA-CenterScale pattern or better yet Typical Variation Normalization:
return_channelwise_embeddings=True)You should be able to successfully run the below tests, which demonstrate how to use the model at inference time.
import pytest
import torch
from huggingface_mae import MAEModel
# huggingface_openphenom_model_dir = "."
huggingface_modelpath = "recursionpharma/OpenPhenom"
@pytest.fixture
def huggingface_model():
# This step downloads the model to a local cache, takes a bit to run
huggingface_model = MAEModel.from_pretrained(huggingface_modelpath)
huggingface_model.eval()
return huggingface_model
@pytest.mark.parametrize("C", [1, 4, 6, 11])
@pytest.mark.parametrize("return_channelwise_embeddings", [True, False])
def test_model_predict(huggingface_model, C, return_channelwise_embeddings):
example_input_array = torch.randint(
low=0,
high=255,
size=(2, C, 256, 256),
dtype=torch.uint8,
device=huggingface_model.device,
)
huggingface_model.return_channelwise_embeddings = return_channelwise_embeddings
embeddings = huggingface_model.predict(example_input_array)
expected_output_dim = 384 * C if return_channelwise_embeddings else 384
assert embeddings.shape == (2, expected_output_dim)
We also provide a notebook for running inference on RxRx3-core.
See paper linked above for details on model training and evaluation. Primary hyperparameters are included in the repo linked above.
BibTeX:
@inproceedings{kraus2024masked,
title={Masked Autoencoders for Microscopy are Scalable Learners of Cellular Biology},
author={Kraus, Oren and Kenyon-Dean, Kian and Saberian, Saber and Fallah, Maryam and McLean, Peter and Leung, Jess and Sharma, Vasudev and Khan, Ayla and Balakrishnan, Jia and Celik, Safiye and others},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={11757--11768},
year={2024}
}
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys openphenom for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (openphenom 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":"openphenom","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.