Alibaba DAMO Academy's RADAR repository includes an abdominal CT image, an inference script and an example score CSV. For an imaging AI researcher with a suitable CUDA system and the necessary nonclinical research rights, the useful question is narrower than whether the model can diagnose disease: can you run that supplied case yourself and identify the CSV produced by your run? This guide follows the repository and model files at the revisions checked on October 22, 2026. BIG CHANGE inspected the instructions and code but did not install the software, download the model, run inference or verify its results.
The big change
- What changed: RADAR's public repository supplies a concrete, local inference demo for one bundled NIfTI CT case and a CSV of finding scores.
- Why it matters: A researcher can check whether a fresh local run produces a labeled score file. That check says nothing by itself about diagnostic accuracy, patient risk or clinical readiness.
- What to watch: The path requires suitable CUDA hardware, the right model files and authorized use of the supplied case. The output remains a research score file, not a clinical result.
Before you start
You need a Linux shell with Git, Conda, Python package installation, sufficient disk space and a working NVIDIA CUDA GPU. The inference guide names A100 or H20 hardware and says one GPU suffices for its demo. It does not establish a minimum memory figure or that a consumer GPU will fit. The commands below use Bash. Running the script on Windows has not been verified here; its filename handling assumes / path separators.
First, establish that your institution and your own permissions allow you to download and use the bundled case for nonclinical research. The public repository and model carry CC BY-NC-SA 4.0 terms, with separate notices for third-party components. Those notices do not independently establish the bundled image's patient provenance, consent or privacy clearance. If your authorization for that case is uncertain, stop before cloning or downloading it. Do not substitute a patient scan or upload one to a service as part of this guide.
The README describes RADAR as research-only and says prospective clinical studies are still needed. This demo is not a clinical diagnostic service. Download size, installation time, inference time and cloud-compute charges will depend on your environment; the project does not provide a verified cost or minimum GPU-memory budget for this path. Check your own storage, compute allocation and network policy before starting.
1. Get the pinned code and create its environment
The following commands are the repository's documented setup, with an explicit code revision added for reproducibility. Run them only after the rights check above. Use the same Bash session for all command blocks so the run ID and start time remain available. Each failed check below stops that session; resolve the error before opening a new one and continuing.
git clone https://github.com/alibaba-damo-academy/damo-radar.git || exit 1
cd damo-radar || exit 1
git checkout 0dbf0ece209b77d722588e5e7943014d3db48f7f || exit 1
test "$(git rev-parse HEAD)" = "0dbf0ece209b77d722588e5e7943014d3db48f7f" || exit 1
conda create -n radar python=3.10 || exit 1
conda activate radar || exit 1
pip install -r requirements.txt || exit 1The code-revision check must succeed for 0dbf0ece209b77d722588e5e7943014d3db48f7f. The repository includes data/demo_cases/AC423ccbe.nii.gz and ckpt/infer_text_embedding_radar.pt; check that both exist. Installation success has not been tested by BIG CHANGE, and a package conflict should be resolved against the pinned requirements and your CUDA/PyTorch environment before proceeding.
test -s data/demo_cases/AC423ccbe.nii.gz || exit 1
test -s ckpt/infer_text_embedding_radar.pt || exit 1
python -c "import torch; assert torch.cuda.is_available(), 'CUDA unavailable'; print('CUDA available: True')" || exit 1
sha256sum data/demo_cases/AC423ccbe.nii.gz || exit 1The CUDA check must print True; keep the case hash with your run notes to identify the input. A hash records file identity, not permission or clinical validity. The script calls CUDA directly, so a CPU-only setup cannot follow this route.
2. Put the model files at the paths the script reads
The demo expects ckpt/checkpoint_radar_pretrain.pth and the contents of ckpt/bert-base-chinese/. The model repository at revision 3861f2d3e004451c77a6d3afc3e66a9c3e00bc60 lists those files. RADAR's download_checkpoints.py helper accepts a destination and include patterns, but has no model-revision argument and otherwise downloads the model repository's current default contents. For an explicitly pinned download, use the Hugging Face snapshot_download API, which supports revision, allow_patterns and local_dir:
python - <<'PY'
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="radar-generalist/RADAR",
repo_type="model",
revision="3861f2d3e004451c77a6d3afc3e66a9c3e00bc60",
local_dir="ckpt",
allow_patterns=["checkpoint_radar_pretrain.pth", "bert-base-chinese/*"],
)
PY
test "$?" -eq 0 || exit 1This is a reader command, not a download BIG CHANGE performed. It retrieves model files, and the Git and model revision hashes refer to different repositories. Check the file inventory before loading weights. File presence alone cannot prove an interrupted download is complete; if the downloader reports an error, resolve it before inference.
test -s ckpt/checkpoint_radar_pretrain.pth || exit 1
for file in config.json config_decoder.json pytorch_model.bin tokenizer.json tokenizer_config.json vocab.txt; do
test -s "ckpt/bert-base-chinese/$file" || exit 1
doneThese are the six Chinese BERT files listed at that model revision. Keep the bundled infer_text_embedding_radar.pt in ckpt/ as well. Do not use the similarly named checkpoint_radar_plus.pth or the separate MERLIN fine-tuned checkpoint for this demo.
3. Run the supplied case and distinguish the fresh CSV
The repository already contains results/RADAR_infer_results_demo.csv as an example. Its presence is not evidence that your run worked. From the repository root, preserve any file at the default output path, record the start time and the supplied case's hash, then run the demo script from RADAR_inference with its documented defaults:
mkdir -p results || exit 1
run_id=$(date -u +%Y%m%dT%H%M%SZ) || exit 1
if test -e results/RADAR_infer_results_demo.csv; then
test ! -e "results/RADAR_infer_results_demo.pre-run-$run_id.csv" || exit 1
mv results/RADAR_infer_results_demo.csv "results/RADAR_infer_results_demo.pre-run-$run_id.csv" || exit 1
fi
sha256sum data/demo_cases/AC423ccbe.nii.gz || exit 1
start_epoch=$(date +%s) || exit 1
cd RADAR_inference || exit 1
python inference_demo.py 2>&1 | tee "../results/radar-demo-$run_id.log"
run_statuses=("${PIPESTATUS[@]}")
run_status=${run_statuses[0]}
log_status=${run_statuses[1]}
cd .. || exit 1
printf 'Inference exit status: %s; log exit status: %s\n' "$run_status" "$log_status"
test "$run_status" -eq 0 && test "$log_status" -eq 0 && test -s "results/radar-demo-$run_id.log" || exit 1The defaults read ../data/demo_cases, write into ../results, and use the demo output tag. The expected output is results/RADAR_infer_results_demo.csv. Keep the terminal log and exit status. If the process fails, a CSV left behind by a different attempt, or an incomplete file, cannot establish success.
4. Inspect the CSV as model output
Run this check from the repository root after successful inference and log capture. It checks the new file's modification time against the recorded start time, hashes it, requires the supplied filename, and compares the full ordered header with the pinned repository example while ignoring that example's scores. The script writes a UTF-8 CSV with a file_name column and Chinese finding labels followed by English mappings; its per-finding number is the positive-class value averaged over the available windows.
START_EPOCH="$start_epoch" python - <<'PY'
import csv
import hashlib
import io
import math
import os
from pathlib import Path
import subprocess
path = Path("results/RADAR_infer_results_demo.csv")
assert path.is_file(), "No new result CSV"
assert path.stat().st_mtime >= int(os.environ["START_EPOCH"]), "CSV predates this run"
with path.open(encoding="utf-8-sig", newline="") as handle:
reader = csv.DictReader(handle)
columns = reader.fieldnames or []
rows = list(reader)
reference = subprocess.run(
["git", "show", "0dbf0ece209b77d722588e5e7943014d3db48f7f:results/RADAR_infer_results_demo.csv"],
check=True, capture_output=True, text=True, encoding="utf-8-sig",
)
expected = next(csv.reader(io.StringIO(reference.stdout)))
assert columns == expected and len(columns) == len(set(columns)), "Incomplete or altered finding header"
assert columns[0] == "file_name" and len(columns) > 1, "Unexpected CSV header"
assert len(rows) == 1 and rows[0]["file_name"] == "AC423ccbe.nii.gz", "Unexpected case row"
for label in columns[1:]:
value = rows[0][label]
assert value is not None and value.strip(), f"Blank value: {label}"
score = float(value)
assert math.isfinite(score) and 0 <= score <= 1, f"Invalid positive-class value: {label}"
print("Checked fresh CSV:", path)
print("Finding columns:", len(columns) - 1)
print("SHA-256:", hashlib.sha256(path.read_bytes()).hexdigest())
PY
test "$?" -eq 0 || exit 1Keep that hash, the case hash and the process log together. The checked-in example CSV supplies the expected header only; equal scores are not a required success test. A blank value or missing row is a failure to complete this guide's task, even if the process wrote a CSV. Do not fill blanks or present a partial output as a finding.
If the run fails
If initialization stops, confirm that the active environment can import the listed dependencies, CUDA is available, and the checkpoint, Chinese BERT directory and bundled text embedding all sit in the paths above. If inference stops or the CSV check fails, retain the log, exit status, input hash and any partial output while investigating the exact error. Check that the supplied case is the only intended file in data/demo_cases; the demo script reads that directory. Do not retry with patient data to work around a setup problem.
The output scores are model values for this supplied research example. They are neither diagnoses nor calibrated probabilities of disease for a person. The case comes with no verified clinical ground truth in this guide, so this run cannot measure diagnostic accuracy. The repository's separate MERLIN evaluation path, paper results and any proposed use on arbitrary patient scans require their own evidence, rights and validation. The research-only notice remains in force even when the CSV passes every file check here.
Sources & further reading
- RADAR README and setup — Documents Python setup, included demo material and the research-only boundary; it does not certify installation in a reader's environment.
- RADAR inference guide — Names the required model paths, GPU examples, run command and CSV; its separate MERLIN section is not part of this walkthrough.
- Demo implementation — Establishes default directories, CUDA use, CSV headers and positive-class score aggregation; code inspection is not a successful execution test.
- Model repository and Hugging Face download API — Identify the model's research terms and document revision-aware file downloads; neither establishes rights to the CT case.
- Project license and third-party notices — Set out code and model licensing context, without proving case provenance or consent.



