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.4

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.4
File Size Uploaded
covale-0.1.4.tar.gz 4.7 MB Details

Built distribution (wheel)

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

Total release size: 9.5 MB

Release files / covale-0.1.4.tar.gz

Download URL covale-0.1.4.tar.gz
Size 4.7 MB
Tags Source
SHA-256 checksum
How to use checksums
7cf8a13abb4b8972dce19f33cebb0fa385795fd19b3b6fd252ef635c9bd90954
BLAKE2b-256 checksum
How to use checksums
4ded6ec5433fb528255a59a9f16f680d37c619320442eb4d86fa268d275a8d39
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.4-py3-none-any.whl

Download URL covale-0.1.4-py3-none-any.whl
Size 4.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9da60e61099060389b2a593130287ac9d8be6e84641dc4f7b44adabe17518730
BLAKE2b-256 checksum
How to use checksums
bb951875d8155d8e51a0b3797e0c9584786d97805d220347d4ef2a3a6ea976ad
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

This release

0.1.4 This release

2 release files

0.1.3

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