Encoders¶
Encoder choice sets the representation space. In soma, the encoder is
selected by EncoderConfig.name and configured through runtime behavior
fields such as precision, batch size, and output variant. Geometry is handled
through preprocessing, not the encoder config itself.
Encoding methods
Single encoder — pick one preset from the model zoo below (the common case).
Composite (multi-encoder) — concatenate several presets into one richer per-position vector: details · tutorial.
The main configuration object is soma.config.EncoderConfig.
- class soma.config.EncoderConfig(name, precision=None, batch_size=32, adaptive_batching=False, output_variant=None, allow_non_recommended_settings=False, save_tile_features=False)¶
Bases:
objectFoundation-model encoder selection and model-adjacent settings.
nameselects the encoder preset.output_variantexposes preset-specific feature variants when the encoder supports them.allow_non_recommended_settingsopts into slide2vec’s warning-only mode when intentionally sweeping non-default runtime settings.
Model Zoo¶
The tile encoder zoo below is grouped by output dimension for easier scanning, with entries inside each bucket still following the existing date ordering.
Tile-level encoders¶
Preset |
Output dim |
Spacing |
Notes |
|---|---|---|---|
|
384 |
|
Kang et al. (2023) |
|
384 |
|
Grisi et al. (2026) |
|
512 |
|
Lu et al. (2024) |
|
768 |
|
Filiot et al. (2023) |
|
768 |
|
Lu et al. (2024) |
|
768 |
|
Nechaev et al. (2024) |
|
768 / 1536 |
|
Filiot et al. (2024) |
|
1024 |
|
Filiot et al. (2024) |
|
1024 |
|
Nechaev et al. (2024) |
|
1024 |
|
Chen et al. (2024) |
|
1024 / 2048 |
|
Xiang et al. (2024) |
|
1024 |
|
Ma et al. (2024) |
|
1024 |
|
Wang et al. (2024) |
|
1280 / 2560 |
|
Vorontsov et al. (2024) |
|
1280 / 2560 |
|
Zimmermann et al. (2024) |
|
1536 |
|
Chen et al. (2024) |
|
1536 |
|
Xu et al. (2024) |
|
1536 |
|
Saillard et al. (2024) |
|
1536 |
|
Saillard et al. (2024) |
|
3072 |
|
Karasikov et al. (2025) |
|
4608 |
|
GenBio AI (2024) |
Natural-image control¶
A non-pathology baseline that shares the tile-encoder interface, for measuring how much pathology pretraining actually contributes.
Preset |
Output dim |
Spacing |
Notes |
|---|---|---|---|
|
768 |
|
Oquab et al. (2024) |
Slide-level encoders¶
Preset |
Tile encoder |
Output dim |
Notes |
|---|---|---|---|
|
|
768 |
Xu et al. (2024) |
|
|
768 |
Ding et al. (2024) |
|
|
1280 |
Shaikovski et al. (2024) |
|
|
768 |
Kotp et al. (2026) |
Patient-level encoders¶
Preset |
Tile encoder |
Output dim |
Notes |
|---|---|---|---|
|
|
768 |
Kotp et al. (2026) |
Compatibility is enforced by the code and by PipelineConfig validation.
Use this page to choose a valid starting point, then let the runtime validate
the final combination. The spacing table is a reference for selecting
preprocessing geometry, not a separate encoder knob.
Discovery helpers¶
Use soma.list_models() when you want the available encoder presets in code.
Pass level="tile", "slide", or "patient" to narrow the list.