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,
)

COVALE extracts anatomically localized findings, aligns compatible findings one to one, evaluates each matched location, and gives no credit for missing or extra findings. Location strings remain the default and skip finding extraction.

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

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.1
File Size Uploaded
covale-0.1.1.tar.gz 30.9 kB Details

Built distribution (wheel)

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

Total release size: 75.5 kB

Release files / covale-0.1.1.tar.gz

Download URL covale-0.1.1.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7ecc2162f0e5fdfa7517b224c15e34e139e5f1cd21d915d9279bd1e73e826aef
BLAKE2b-256 checksum
How to use checksums
327798146996b63fb0d2203bc8330e1bc462e469eaf121b8020a45c66ce8dd30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

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

Download URL covale-0.1.1-py3-none-any.whl
Size 44.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
544298fa72627e69c9951f24e6121d886f6665c9ab22bf5712c59933f39b611c
BLAKE2b-256 checksum
How to use checksums
03deb951e2cf15cd4d7f9f4276fc13a7ac7370af3fef26d27fbb97de78739492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

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