H&E section CRC01
18-plex immunofluorescence · 2.2×
ORION-CRC · section CRC01

An AI agent writes
spatial biomarkers.
H&E reads them.

Inside the lens, the same section imaged for 18 proteins. XMARK's agent writes biomarkers as code over these cells, measures each one here, and keeps only those it can read back from routine H&E.

↓
How XMARK works

One biomarker,
four rounds in the making.

  1. agent ·

    01

    Propose

    The agent writes a hypothesis about cells.

  2. BiomarkerSpec
    02

    Formalize

    It becomes executable code.

  3. mIFmeasured
    03

    Quantify

    Measured on every cell of 18-plex mIF.

  4. H&E only
    04

    Supervise H&E

    H&E learns to read the same value.

  5. H&E fidelity
    Survival signal
    ✓ Kept
    05

    Feedback

    Scores go back to the agent.

H&E only

After the loop

Deploy

The kept panel runs on H&E alone, in unseen patients.

Scores go back to the agent, and the next round answers them. C in training patients · click a round

    H&E, 768 µm field Immunofluorescence, same field Biomarker read from H&E Biomarker measured on immunofluorescence
    ⟷
    H&E
    Immunofluorescence
    100 µm

    Biomarker · written by the agent

    CD8 T cells with a regulatory T cell within 30 µm

    proximity(CD8 T, Treg, r = 30 µm)
    read out in the tumour core and at the tumour–stroma interface

    H&E fidelity
    patch-level ρ
    folds that found it
    independently
    times chosen for
    a final panel
    Measured on immunofluorescence
    Read from H&E by XMARK
    low → high
    Explore

    From a pattern of cells
    to a patient's risk.

    The biomarker above is one of hundreds the agent wrote. Four ways in, each built from one run of the released code.

    01 · Biomarkers

    See them on real tissue

    32 of the agent's biomarkers, each on the fluorescence it was measured from and the H&E it is read from.

    02 · Slides

    Follow a patient

    Six TCGA patients the model never saw: where each biomarker sits on the slide, and what moved the predicted risk.

    Treg cells near CD8 T cells within 30 µmH&E fidelity 0.71
    03 · Compose

    Write your own

    Build a biomarker in the agent's grammar, watch it on cells, and see whether H&E can read it.

    04 · Atlas

    Watch the agent search

    Five rounds of hypotheses in each fold: what it tried, what it kept, and what H&E could not read.

    9 of 11cohort–endpoint evaluations where XMARK ranked first
    +0.08–0.09C-index gained when added to clinical risk models
    13–31×fewer GPU-hours than virtual-staining pipelines
    Does it work? Evidence from the paper →
    Run it yourself

    Open source, end to end.

    The repository runs the colorectal task of this site: the agent proposes, ORION-CRC measures, a ridge reader learns to read each biomarker from H&E, and a survival panel is fitted inside every training fold. A replay mode reinstalls our run's proposals, so it needs no language-model access.

    # install
    conda create -n xmark python=3.10 -y && conda activate xmark
    pip install -e ".[test]"
    
    # replay our run, no language model needed
    for s in prepare folds panel; do
      python -m xmark experiments/tcga_crc_dss_replay/config.json --stage $s
    done
    
    # or let the agent write new biomarkers
    python -m xmark experiments/tcga_crc_dss/config.json --stage prepare
    python -m xmark experiments/tcga_crc_dss/config.json --stage folds --workers 5
    python -m xmark experiments/tcga_crc_dss/config.json --stage panel