Skip to main content

COVALE: Compositional Open-Vocabulary Anatomical Localization Evaluation

Text-based metrics can tell whether two anatomical descriptions use similar words, but they often miss whether the descriptions point to the same place. COVALE turns each description into a 3D region in an anatomical atlas, then measures how much the regions overlap. This makes it easy to compare generated descriptions, evaluate systems, and provide spatial feedback during model training.

Overview comparing COVALE with lexical and LLM-based evaluation

Quick start

pip install covale
import os

from covale import COVALE

os.environ["OPENAI_API_KEY"] = "your-api-key"

score = COVALE().score(
    reference="left frontal lobe",
    candidate="left frontal region",
)

Table of contents

Calculate COVALE

Create an evaluator and pass equally sized lists of reference and candidate descriptions:

from covale import COVALE

covale_evaluator = COVALE(
    method="llm",
    model="gpt-6-astra",
    concurrency=4,
)
results = covale_evaluator(
    refs=[
        "left frontal lobe",
        "right temporal lobe",
    ],
    hyps=[
        "left frontal region",
        "right temporal region",
    ],
)
print(results["dice"])

Change model to select an OpenAI model. Increase concurrency to evaluate independent pairs in parallel.

Choose an evaluation method

Set method based on how descriptions should be compared:

Method Description Uses atlas masks
llm (default) Uses OpenAI to map each description to an atlas region, then calculates Dice overlap Yes
deep_agent Uses a Deep Agent to map each description to an atlas region, then calculates Dice overlap Yes
similarity Uses OpenAI to compare the descriptions directly as a language-only baseline No

Evaluate reports

Add extract_findings=True when the inputs are sentences or reports rather than isolated anatomical locations:

report_evaluator = COVALE(
    extract_findings=True,
)
results = report_evaluator(
    refs=reference_reports,
    hyps=generated_reports,
)

Inspect detailed results

Add output_mode="detailed" to include per-sample scores, localization expressions, timings, and categorized failures:

detailed_evaluator = COVALE(
    output_mode="detailed",
)
results = detailed_evaluator(refs=refs, hyps=hyps)

Additional resources

Guide Description
Configuration Reproducible YAML settings, output modes, and error handling
Benchmarking Annotating JSONL experiments with COVALE scores and runtime
Comparing systems Statistical comparison of multiple systems against shared references
Publishing Building and publishing releases to PyPI with GitHub Actions
RL rewards Creating and timing TRL-compatible reward functions
Onboarding a new atlas Adding atlas metadata, labels, licensing, and a labeled NIfTI volume

License

COVALE is available under the MIT License.

Metadata

Release files for covale 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for covale 0.1.3
File Size Uploaded
covale-0.1.3.tar.gz 30.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for covale 0.1.3
File Interpreter ABI Platform
covale-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 75.2 kB

Release files / covale-0.1.3.tar.gz

Download URL covale-0.1.3.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d0bdbfc452579701f73ad21f8c4f4577d822d48999207f7946bbc4beb93673a2
BLAKE2b-256 checksum
How to use checksums
59d05cdfd1532cce1324433497af023993eaeebdd63113d3dd2a1b8eb424db8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / covale-0.1.3-py3-none-any.whl

Download URL covale-0.1.3-py3-none-any.whl
Size 44.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d94c9a894c86916d0ff9331735580b8a028b7361dba89396860014fb1ee7470
BLAKE2b-256 checksum
How to use checksums
71775b488e0a2174e5b8ab6bbf3b17a3498486f80bd6a47eea1b476ba6880a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page