EXAONE Path 2.5 is a biologically informed multimodal framework that enriches histopathology representations by aligning whole-slide images with
genomic, epigenetic, and transcriptomic data
. By enabling all-pairwise cross-modal alignment across multiple layers of tumor biology, the model captures coherent genotype-to-phenotype relationships within a unified embedding space. This domain-informed design improves resource efficiency, enabling the model to achieve competitive performance across diverse tasks while using substantially fewer training samples and parameters than existing approaches.
Figure 1. Overall scheme of EXAONE Path 2.5.
Quickstart
Load EXAONE Path 2.5 and extract features.
1. Hardware Requirements
NVIDIA GPU with 12GB+ VRAM
NVIDIA driver version >= 525.60.13 required
Note: This implementation requires NVIDIA GPU and drivers. The provided environment setup specifically uses CUDA-enabled PyTorch, making NVIDIA GPU mandatory for running the model.
2. Environment Setup
First, install Micromamba if you haven't already. You can find installation instructions
here
.
Then create and activate the environment using the provided configuration:
EXAONE Path 2.5 inference follows a two-stage pipeline.
(1) Patch-level feature extraction
: extract pretrained patch embeddings from either image patches or full WSIs.
(2) Slide-level feature extraction
: aggregate patch embeddings into slide representations aligned with genomics data. Sections 3.1 and 3.2 describe these steps in detail.
3.1. Patch Feature Extraction
You can extract the pretained patch features (without multimodal alignment) in two ways.
3.1.1 (Tensor output)
: for rapid prototyping or custom pipelines
3.1.2 (HDF5 file output)
: for full WSI processing, visualization, and downstream slide encoding
3.1.1. Tensor output
Assuming you have an image, you can run the following code snippet to extract pretrained patch features.
coords_h5_path
must be the H5 produced by
patchfy
(
save_h5=True
). Future slide encoder requires
coords
, ideally with
contour_index
.
The output file (
out_h5_path
) will contain:
features
[N, C],
coords
[N, 2],
contour_index
[N].
3.2. Slide Feature Extraction
Patch features, coordinates, (contour index) must be available. Use the below code snippet if patch feature extraction was conducted with 3.1.2.
patch_features_h5_path
should be identical as
out_h5_path
from the previous step.
import h5py
import torch
from transformers import AutoModel
device = "cuda"# Load slide encoder (HF)
repo_id = "LGAI-EXAONE/EXAONE-Path-2.5"
slide_encoder = AutoModel.from_pretrained(
repo_id,
subfolder="slide-encoder",
trust_remote_code=True,
).to(device).eval()
# Load patch-level features exported as an HDF5 file# Expected keys: features [N, C], coords [N, 2], contour_index [N]
patch_features_h5_path = "<out_dir>/patches/<slide_id>_features.h5"with h5py.File(patch_features_h5_path, "r") as f:
patch_features = torch.from_numpy(f["features"][:]).float() # [N, C]
patch_coords = torch.from_numpy(f["coords"][:]).long() # [N, 2]
patch_contour_index = torch.from_numpy(f["contour_index"][:]).long() # [N]
patch_features = patch_features.unsqueeze(0).to(device) # [B=1, N, C]
patch_coords = patch_coords.unsqueeze(0).to(device) # [B=1, N, 2]
patch_contour_index = patch_contour_index.unsqueeze(0).to(device) # [B=1, N]# All patches are valid (if you use padding later, set False for padded tokens)
patch_mask = torch.ones(
(patch_features.shape[0], patch_features.shape[1]),
dtype=torch.bool,
device=device,
)
with torch.no_grad():
outputs = slide_encoder(
patch_features=patch_features,
patch_mask=patch_mask,
patch_coords=patch_coords,
patch_contour_index=patch_contour_index,
)
patch_embedding = outputs["patch_embedding"]
slide_embedding = outputs["slide_embedding"]
If you padded patches and want to keep
only valid
patch embeddings (ragged), use the mask to index.
(This returns a Python list because $N_{valid}$ can differ per slide.)
valid_patch_embeddings = [
patch_embedding[b, patch_mask[b]] for b inrange(patch_embedding.size(0))
]
Output
patch_embedding
:
[B, N, C]
updated patch-level embeddings after multi-modal alignment
slide_embedding
:
[B, C]
slide-level embeddings to be used for downstream tasks
Model Performance Comparison
Experiments on internal multi-institutional clinical datasets and the 80-task Patho-Bench benchmark show that EXAONE Path 2.5 matches or surpasses state-of-the-art pathology foundation models while requiring significantly fewer parameters and less pretraining data.
EXAONE-Path-2.5 huggingface.co is an AI model on huggingface.co that provides EXAONE-Path-2.5's model effect (), which can be used instantly with this LGAI-EXAONE EXAONE-Path-2.5 model. huggingface.co supports a free trial of the EXAONE-Path-2.5 model, and also provides paid use of the EXAONE-Path-2.5. Support call EXAONE-Path-2.5 model through api, including Node.js, Python, http.
EXAONE-Path-2.5 huggingface.co is an online trial and call api platform, which integrates EXAONE-Path-2.5's modeling effects, including api services, and provides a free online trial of EXAONE-Path-2.5, you can try EXAONE-Path-2.5 online for free by clicking the link below.
LGAI-EXAONE EXAONE-Path-2.5 online free url in huggingface.co:
EXAONE-Path-2.5 is an open source model from GitHub that offers a free installation service, and any user can find EXAONE-Path-2.5 on GitHub to install. At the same time, huggingface.co provides the effect of EXAONE-Path-2.5 install, users can directly use EXAONE-Path-2.5 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.