OSCR

Label tree semantic losses for rich multi-class medical image segmentation.

Code ↔ Paper

8 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 8 matches
  1. [1] § Results › Analysis of error types (confusion matrices) ↔ scripts/generate_wbp_paper_assets.py, lines 59–148 · score 0.98 · ctx lh unknown, ctx rh unknown, Right choroid plexus, Left choroid plexus, Left Inf Lat, Optic Chiasm
  2. [2] § Results › Analysis of error types (confusion matrices) ↔ scripts/generate_wbp_subject_metrics.py, lines 1–88 · score 0.88 · Left Inf Lat, Optic Chiasm, WM hypointensities, Right vessel, Left vessel, small classes
  3. [3] § Results › WBP with dense reference masks ↔ scripts/generate_wbp_subject_metrics.py, lines 1–88 · score 0.69 · Surface Dice, baseline losses, Dice loss, tolerance, IXI, MB42
  4. [4] § Methodology › Wasserstein distance in label space ↔ training/loss/treewasserstein.py, lines 8–53 · score 0.67 · Wasserstein distance, distance matrix, ground distance, leaf nodes, edges
  5. [5] § Experimental setup › Implementation details › HSI ↔ training/nnUNetTrainer/network_training/nnUNetTrainerTreeWeightedCE_plus_DiceLoss.py, lines 40–86 · score 0.60 · tree weighted CE, Dice loss, batch, node, training, classes
  6. [6] § Experimental setup › Implementation details › HSI ↔ training/nnUNetTrainer/network_training/nnUNetTrainerWassersteinLoss.py, lines 44–123 · score 0.59 · weighted CE loss, Dice loss, EfficientNet, Wasserstein, batch, node
  7. [7] § Conclusion and discussion ↔ training/loss/treewasserstein.py, lines 8–53 · score 0.56 · distance matrix, Wasserstein distance, CE loss, node, class
  8. [8] § Results › Surgical HSI with sparse positive-only annotations ↔ segmentation_models_pytorch/metrics/functional.py, lines 722–799 · score 0.56 · Balanced Accuracy, F1 scores, IoU, metric, pixels, classes

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 437 lines · 16 KB · Apache-2.0 · 2 matches

  1. #!/usr/bin/env python3
  2. """Generate subject-level WBP metrics from retained nnU-Net predictions."""
  3. from __future__ import annotations
  4. import argparse
  5. import concurrent.futures
  6. import csv
  7. import importlib
  8. import json
  9. import math
  10. from pathlib import Path
  11. from typing import Any
  12. import numpy as np
  13. MISSING_NIBABEL: ModuleNotFoundError | None = None
  14. MISSING_SURFACE_DISTANCE: ModuleNotFoundError | None = None
  15. nib: Any = None
  16. compute_surface_distances: Any = None
  17. compute_surface_dice_at_tolerance: Any = None
  18. try:
  19. nib = importlib.import_module("nibabel")
  20. except ModuleNotFoundError as exc:
  21. MISSING_NIBABEL = exc
  22. try:
  23. surface_distance: Any = importlib.import_module("surface_distance")
  24. compute_surface_distances = surface_distance.compute_surface_distances
  25. compute_surface_dice_at_tolerance = surface_distance.compute_surface_dice_at_tolerance
  26. except ModuleNotFoundError as exc:
  27. MISSING_SURFACE_DISTANCE = exc
  28. DATASETS = {
  29. "2154": "Dataset2154_mind_remap",
  30. "3062": "Dataset3062_mindaomic_remap",
  31. "3072": "Dataset3072_mindixi_remap",
  32. }
  33. REPO_ROOT = Path(__file__).resolve().parents[1]
  34. DEFAULT_NNUNET_ROOT = Path("/mnt/g/model_and_data_backup/nnunet/nnunet_data")
  35. DEFAULT_OUTPUT_DIR = REPO_ROOT / "outputs"
  36. TRAIN_LABELS = {
  37. "Dataset2154_mind_remap": "MB59",
  38. "Dataset3062_mindaomic_remap": "AOMIC",
  39. "Dataset3072_mindixi_remap": "IXI",
  40. }
  41. TEST_LABELS = {
  42. "Dataset2154_mind_remap": "MB42",
  43. "Dataset3062_mindaomic_remap": "AOMIC",
  44. "Dataset3072_mindixi_remap": "IXI",
  45. }
  46. TRAINER_ORDER = [
  47. "nnUNetTrainerBaselineLossNoMirroring",
  48. "nnUNetTrainerTreeWeightedCE_plus_DiceLoss_6LevelHierarchy_NoMirroring",
  49. "nnUNetTrainerWassersteinLoss_5LevelHierarchy_NoMirroring",
  50. ]
  51. KNOWN_TRAINER_ORDER = TRAINER_ORDER
  52. METHOD_LABELS = {
  53. "nnUNetTrainerBaselineLossNoMirroring": "L_seg",
  54. "nnUNetTrainerTreeWeightedCE_plus_DiceLoss_6LevelHierarchy_NoMirroring": "L_twce+seg",
  55. "nnUNetTrainerWassersteinLoss_5LevelHierarchy_NoMirroring": "L_wass+seg",
  56. }
  57. PLAN_SUFFIX = "__nnUNetPlans__3d_fullres"
  58. SMALL_CLASS_NAMES = [
  59. "5th-Ventricle",
  60. "non-WM-hypointensities",
  61. "Right-vessel",
  62. "Left-vessel",
  63. "Left-Inf-Lat-Vent",
  64. "Optic-Chiasm",
  65. "Right-Inf-Lat-Vent",
  66. "CC_Mid_Posterior",
  67. "CC_Central",
  68. "CC_Mid_Anterior",
  69. ]
  70. ORIGINAL_EVALUATOR_SPACING = [1.5, 1.5, 1.5]
  71. def parse_args() -> argparse.Namespace:
  72. parser = argparse.ArgumentParser(description=__doc__)
  73. parser.add_argument("--nnunet-root", default=str(DEFAULT_NNUNET_ROOT))
  74. parser.add_argument("--output-dir", default=str(DEFAULT_OUTPUT_DIR))
  75. parser.add_argument("--nsd-tolerance", type=float, default=3.0, help="NSD surface tolerance in millimetres.")
  76. parser.add_argument("--max-cases", type=int, default=None)
  77. parser.add_argument("--workers", type=int, default=1)
  78. return parser.parse_args()
  79. def load_json(path: Path) -> dict:
  80. with path.open("r", encoding="utf-8") as f:
  81. return json.load(f)
  82. def require_metric_dependencies() -> None:
  83. if MISSING_NIBABEL is not None:
  84. raise ModuleNotFoundError(
  85. f"missing Python dependency for subject metric generation: {MISSING_NIBABEL.name}. "
  86. "Run this script inside the nnU-Net environment."
  87. ) from MISSING_NIBABEL
  88. if MISSING_SURFACE_DISTANCE is not None:
  89. raise ModuleNotFoundError(
  90. "missing Python dependency for original NSD evaluation: surface-distance. "
  91. "Install it with `pip install surface-distance`."
  92. ) from MISSING_SURFACE_DISTANCE
  93. def read_score_file(path: Path) -> list[dict[str, float | str]]:
  94. rows: list[dict[str, float | str]] = []
  95. with path.open("r", encoding="utf-8") as f:
  96. for line in f:
  97. class_name, metric, score = line.split(" ")
  98. rows.append({"class_name": class_name, "metric": metric.rstrip(":"), "score": float(score)})
  99. return rows
  100. def mean_score(rows: list[dict[str, float | str]], metric: str, class_names: set[str] | None = None) -> float:
  101. values = [
  102. float(row["score"])
  103. for row in rows
  104. if row["metric"] == metric and (class_names is None or row["class_name"] in class_names)
  105. ]
  106. if not values:
  107. return float("nan")
  108. return float(np.mean(values) * 100.0)
  109. def case_id(path: Path) -> str:
  110. if path.name.endswith(".nii.gz"):
  111. return path.name.removesuffix(".nii.gz")
  112. return path.stem
  113. def label_mapping(dataset_json_path: Path) -> dict[str, int]:
  114. labels = load_json(dataset_json_path)["labels"]
  115. return {name: int(value) for name, value in labels.items()}
  116. def load_segmentation(path: Path) -> tuple[np.ndarray, tuple[float, ...]]:
  117. image = nib.load(str(path))
  118. data = image.get_fdata()
  119. spacing = tuple(float(value) for value in image.header.get_zooms()[: data.ndim])
  120. return data, spacing
  121. def dice_score(reference: np.ndarray, prediction: np.ndarray, label: int) -> float:
  122. ref_mask = reference == label
  123. pred_mask = prediction == label
  124. if not ref_mask.any():
  125. return float("nan")
  126. if not pred_mask.any():
  127. return 0.0
  128. intersection = float(np.sum(ref_mask * pred_mask))
  129. denominator = float(np.sum(ref_mask) + np.sum(pred_mask))
  130. return float((2 * intersection) / (denominator + 1e-6))
  131. def normalised_surface_dice(reference: np.ndarray, prediction: np.ndarray, label: int, tolerance: float) -> float:
  132. ref_mask = reference == label
  133. pred_mask = prediction == label
  134. if not ref_mask.any():
  135. return float("nan")
  136. if not pred_mask.any():
  137. return 0.0
  138. surface_distances = compute_surface_distances(ref_mask, pred_mask, ORIGINAL_EVALUATOR_SPACING)
  139. return float(compute_surface_dice_at_tolerance(surface_distances, tolerance))
  140. def nanmean(values: list[float]) -> float:
  141. valid = [value for value in values if not math.isnan(value)]
  142. if not valid:
  143. return float("nan")
  144. return float(np.mean(valid))
  145. def csv_value(value: float) -> str:
  146. if math.isnan(value):
  147. return "nan"
  148. return f"{value:.10g}"
  149. def find_score_file(nnunet_results: Path, test_dataset: str, trainer: str, train_id: str) -> Path:
  150. score_path = nnunet_results / test_dataset / f"{trainer}{PLAN_SUFFIX}" / f"score_{train_id}.txt"
  151. if not score_path.exists():
  152. raise FileNotFoundError(f"missing aggregate score file: {score_path}")
  153. return score_path
  154. def output_paths(output_dir: Path, seed_label: str) -> tuple[Path, Path, Path]:
  155. if seed_label == "single":
  156. suffix = ""
  157. else:
  158. suffix = f"_seed_{seed_label}"
  159. return (
  160. output_dir / f"wbp_subject_metrics{suffix}.csv",
  161. output_dir / f"wbp_subject_class_metrics{suffix}.csv",
  162. output_dir / f"wbp_subject_metric_validation{suffix}.csv",
  163. )
  164. def prediction_dir(dataset_dir: Path, train_id: str, trainer: str) -> Path:
  165. return dataset_dir / f"labelsTs_predicted_{train_id}" / trainer
  166. def validate_case_sets(label_dir: Path, prediction_dir: Path, max_cases: int | None = None) -> list[str]:
  167. cases = [case_id(path) for path in sorted(label_dir.glob("*.nii.gz"))]
  168. return cases[:max_cases] if max_cases is not None else cases
  169. def write_csv(path: Path, fields: list[str], rows: list[dict[str, str]]) -> None:
  170. with path.open("w", newline="", encoding="utf-8") as f:
  171. writer = csv.DictWriter(f, fieldnames=fields)
  172. writer.writeheader()
  173. writer.writerows(rows)
  174. def compute_subject_metric_rows(
  175. subject_id: str,
  176. label_path: Path,
  177. prediction_path: Path,
  178. labels: dict[str, int],
  179. small_classes: set[str],
  180. tolerance: float,
  181. ) -> tuple[list[tuple[str, float]], list[tuple[str, str, float]]]:
  182. reference, spacing = load_segmentation(label_path)
  183. prediction, _ = load_segmentation(prediction_path)
  184. if reference.shape != prediction.shape:
  185. raise ValueError(f"shape mismatch for {subject_id}: reference={reference.shape}, prediction={prediction.shape}")
  186. subject_dice: list[float] = []
  187. subject_nsd: list[float] = []
  188. subject_small_dice: list[float] = []
  189. subject_small_nsd: list[float] = []
  190. class_metric_rows: list[tuple[str, str, float]] = []
  191. for class_name, label in labels.items():
  192. dice = dice_score(reference, prediction, label)
  193. nsd = normalised_surface_dice(reference, prediction, label, tolerance)
  194. class_metric_rows.extend([(class_name, "Dice", dice), (class_name, "NSD", nsd)])
  195. subject_dice.append(dice)
  196. subject_nsd.append(nsd)
  197. if class_name in small_classes:
  198. subject_small_dice.append(dice)
  199. subject_small_nsd.append(nsd)
  200. subject_metric_rows = [
  201. ("Dice", nanmean(subject_dice)),
  202. ("NSD", nanmean(subject_nsd)),
  203. ("Dice_small", nanmean(subject_small_dice)),
  204. ("NSD_small", nanmean(subject_small_nsd)),
  205. ]
  206. return subject_metric_rows, class_metric_rows
  207. def compute_case_metrics(
  208. case_args: tuple[str, Path, Path, dict[str, int], set[str], float],
  209. ) -> tuple[str, list[tuple[str, float]], list[tuple[str, str, float]]]:
  210. subject_id, label_path, prediction_path, labels, small_classes, tolerance = case_args
  211. subject_metric_rows, class_metric_rows = compute_subject_metric_rows(
  212. subject_id=subject_id,
  213. label_path=label_path,
  214. prediction_path=prediction_path,
  215. labels=labels,
  216. small_classes=small_classes,
  217. tolerance=tolerance,
  218. )
  219. return subject_id, subject_metric_rows, class_metric_rows
  220. def write_subject_metrics(
  221. nnunet_raw: Path,
  222. nnunet_results: Path,
  223. output_dir: Path,
  224. tolerance: float,
  225. max_cases: int | None = None,
  226. workers: int = 1,
  227. seed_label: str = "single",
  228. ) -> tuple[Path, Path, Path]:
  229. require_metric_dependencies()
  230. output_dir.mkdir(parents=True, exist_ok=True)
  231. subject_csv, class_csv, validation_csv = output_paths(output_dir, seed_label)
  232. subject_rows: list[dict[str, str]] = []
  233. class_rows: list[dict[str, str]] = []
  234. validation_rows: list[dict[str, str]] = []
  235. small_classes = set(SMALL_CLASS_NAMES)
  236. for train_id, train_dataset in DATASETS.items():
  237. train_label = TRAIN_LABELS[train_dataset]
  238. for test_dataset, test_label in TEST_LABELS.items():
  239. dataset_dir = nnunet_raw / test_dataset
  240. label_dir = dataset_dir / "labelsTs"
  241. labels = label_mapping(dataset_dir / "dataset.json")
  242. class_names = list(labels)
  243. for trainer in TRAINER_ORDER:
  244. method = METHOD_LABELS[trainer]
  245. pred_dir = prediction_dir(dataset_dir, train_id, trainer)
  246. cases = validate_case_sets(label_dir, pred_dir, max_cases)
  247. print(
  248. f"computing subject metrics: train={train_label} test={test_label} "
  249. f"method={method} cases={len(cases)} workers={workers}",
  250. flush=True,
  251. )
  252. per_class_values: dict[str, dict[str, list[float]]] = {
  253. class_name: {"Dice": [], "NSD": []} for class_name in class_names
  254. }
  255. case_args = [
  256. (
  257. subject_id,
  258. label_dir / f"{subject_id}.nii.gz",
  259. pred_dir / f"{subject_id}.nii.gz",
  260. labels,
  261. small_classes,
  262. tolerance,
  263. )
  264. for subject_id in cases
  265. ]
  266. if workers == 1:
  267. case_results = [compute_case_metrics(args) for args in case_args]
  268. else:
  269. with concurrent.futures.ProcessPoolExecutor(max_workers=workers) as executor:
  270. case_results = list(executor.map(compute_case_metrics, case_args))
  271. for subject_id, subject_metric_values, class_metric_values in case_results:
  272. for class_name, metric, value in class_metric_values:
  273. per_class_values[class_name][metric].append(value)
  274. class_rows.append(
  275. {
  276. "train_dataset": train_label,
  277. "test_dataset": test_label,
  278. "subject_id": subject_id,
  279. "seed": seed_label,
  280. "method": method,
  281. "class_name": class_name,
  282. "metric": metric,
  283. "value": csv_value(value),
  284. }
  285. )
  286. for metric, value in subject_metric_values:
  287. subject_rows.append(
  288. {
  289. "train_dataset": train_label,
  290. "test_dataset": test_label,
  291. "subject_id": subject_id,
  292. "seed": seed_label,
  293. "method": method,
  294. "metric": metric,
  295. "value": csv_value(value),
  296. }
  297. )
  298. computed: dict[str, float] = {}
  299. computed["Dice"] = nanmean([nanmean(per_class_values[name]["Dice"]) for name in class_names]) * 100.0
  300. computed["NSD"] = nanmean([nanmean(per_class_values[name]["NSD"]) for name in class_names]) * 100.0
  301. computed["Dice_small"] = (
  302. nanmean([nanmean(per_class_values[name]["Dice"]) for name in class_names if name in small_classes])
  303. * 100.0
  304. )
  305. computed["NSD_small"] = (
  306. nanmean([nanmean(per_class_values[name]["NSD"]) for name in class_names if name in small_classes])
  307. * 100.0
  308. )
  309. score_rows = read_score_file(find_score_file(nnunet_results, test_dataset, trainer, train_id))
  310. expected = {
  311. "Dice": mean_score(score_rows, "dice"),
  312. "NSD": mean_score(score_rows, "surface_dice_3"),
  313. "Dice_small": mean_score(score_rows, "dice", small_classes),
  314. "NSD_small": mean_score(score_rows, "surface_dice_3", small_classes),
  315. }
  316. for metric in computed:
  317. validation_rows.append(
  318. {
  319. "train_dataset": train_label,
  320. "test_dataset": test_label,
  321. "method": method,
  322. "metric": metric,
  323. "computed_value": csv_value(computed[metric]),
  324. "score_file_value": csv_value(expected[metric]),
  325. "absolute_difference": csv_value(abs(computed[metric] - expected[metric])),
  326. }
  327. )
  328. write_csv(
  329. subject_csv,
  330. ["train_dataset", "test_dataset", "subject_id", "seed", "method", "metric", "value"],
  331. subject_rows,
  332. )
  333. write_csv(
  334. class_csv,
  335. ["train_dataset", "test_dataset", "subject_id", "seed", "method", "class_name", "metric", "value"],
  336. class_rows,
  337. )
  338. write_csv(
  339. validation_csv,
  340. ["train_dataset", "test_dataset", "method", "metric", "computed_value", "score_file_value", "absolute_difference"],
  341. validation_rows,
  342. )
  343. return subject_csv, class_csv, validation_csv
  344. def main() -> None:
  345. args = parse_args()
  346. root = Path(args.nnunet_root).expanduser()
  347. nnunet_raw = root / "nnUNet_raw"
  348. nnunet_results = root / "nnUNet_results"
  349. print(f"nnUNet_raw: {nnunet_raw}")
  350. print(f"nnUNet_results: {nnunet_results}")
  351. subject_csv, class_csv, validation_csv = write_subject_metrics(
  352. nnunet_raw=nnunet_raw,
  353. nnunet_results=nnunet_results,
  354. output_dir=Path(args.output_dir).expanduser(),
  355. tolerance=args.nsd_tolerance,
  356. max_cases=args.max_cases,
  357. workers=args.workers,
  358. )
  359. print(f"wrote {subject_csv}")
  360. print(f"wrote {class_csv}")
  361. print(f"wrote {validation_csv}")
  362. print("done")
  363. if __name__ == "__main__":
  364. main()

generate_wbp_subject_metrics.py at commit ecc75c0, under Apache-2.0 · at the source

Overview

Authors: Junwen Wang1, Oscar MacCormac1,2, William Rochford1,2, Aaron Kujawa1, Jonathan Shapey1,2, Tom Vercauteren1
  1. School of Biomedical Engineering and Imaging Sciences, King's College London, London, United Kingdom
  2. Department of Neurosurgery, King's College Hospital, London, United Kingdom
Institutions: King's College London (United Kingdom)
Journal: Frontiers in artificial intelligence, volume 9, article 1841639
Dates: received 28 March 2026; accepted 21 May 2026; published online 16 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/frai.2026.1841639 · PMID 42382852 · PMCID PMC13315184 · OpenAlex W4417286815
Open access: gold, a free copy (OpenAlex)
Status: code verified
Methods: Graphs
Keywords: hyperspectral imaging, label hierarchy, semantic segmentation, sparse annotations, whole brain parcellation
Topic: Advanced Neural Network Applications (Computer Vision and Pattern Recognition, Computer Science), according to OpenAlex
Citations: not cited yet (Europe PMC); 72 references in the paper

Abstract

Rich and accurate medical image segmentation is poised to underpin the next generation of AI-defined clinical practice by delineating critical anatomy for pre-operative planning, guiding real-time intra-operative navigation, and supporting precise post-operative assessment. However, commonly used learning methods for medical and surgical imaging segmentation tasks penalize all errors equivalently and thus fail to exploit any inter-class semantics in the label space. This becomes particularly problematic as the cardinality and richness of labels increases to include subtly different classes. In this work, we propose two tree-based semantic loss functions which take advantage of a hierarchical organization of the labels. We further incorporate our losses in a recently proposed approach for training with sparse, background-free annotations to extend the applicability of our proposed losses. Extensive experiments are reported on two medical and surgical imaging segmentation tasks, namely head MRI for whole brain parcellation with full supervision and neurosurgical hyperspectral imaging for scene understanding with sparse annotations. Results demonstrate consistent improvements over the evaluated task-specific baselines, with the strongest support for the Wasserstein-based compound loss in whole-brain parcellation and for hierarchy-weighted top-level supervision in the sparse hyperspectral imaging (HSI) setting.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 8 matches between paragraphs and lines of code.

cai4cai/nnunet-tree-semantic-extension

License: Apache-2.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: ecc75c06b0bb66d9bc73bafe6083ed852b0b2210, 18 May 2026
Languages: Python (13), Shell (5)
Size: 23 files, 18 scripts
Software Heritage: not archived
Found in: the text, “Introduction”
Holds: README, license file, environment (Dockerfile)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: nnU-Net (6 files), NumPy (6 files), PyTorch (6 files), NiBabel (3 files), Matplotlib (1 file), pandas (1 file), SciPy (1 file), seaborn (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
20 files

qubvel/segmentation_models.pytorch

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 405cdc56d866b079a191a5193b6dfdd1c6411a2c, 15 September 2026
Languages: Python (130), Jupyter (8)
Size: 176 files, 138 scripts
Software Heritage: archived
Found in: the text
Holds: README, license file, environment (pyproject.toml, .devcontainer/devcontainer.json, requirements/docs.txt, requirements/required.txt, requirements/test.txt), tests, continuous integration, documentation, 8 notebooks
Not found: CITATION.cff
Tools: PyTorch (82 files), NumPy (14 files), Matplotlib (8 files), Pillow (5 files), OpenCV (4 files), PyTorch Lightning (3 files)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
140 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 156 scripts, each with its path and the digest of its content;
  • 8 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability statement

The original contributions presented in the study are included in the article/Supplementary material, further inquiries can be directed to the corresponding author.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 2, 28 September 2026

  • Funding: added National Institute for Health and Care Research: NIHR202114; Wellcome / EPSRC Centre for Interventional and Surgical Sciences

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 6 authors, 5 keywords, 60 references.

Cite

This paper

Wang, J., MacCormac, O., Rochford, W., Kujawa, A., Shapey, J., & Vercauteren, T. (2026). Label tree semantic losses for rich multi-class medical image segmentation. Frontiers in artificial intelligence, 9, 1841639. https://doi.org/10.3389/frai.2026.1841639

BibTeX

@article{wang2026label,
author = {Wang, Junwen and MacCormac, Oscar and Rochford, William and Kujawa, Aaron and Shapey, Jonathan and Vercauteren, Tom},
title = {{Label tree semantic losses for rich multi-class medical image segmentation}},
journal = {Frontiers in artificial intelligence},
year = {2026},
month = jun,
volume = {9},
pages = {1841639},
publisher = {Frontiers Media SA},
issn = {2624-8212},
doi = {10.3389/frai.2026.1841639},
url = {https://doi.org/10.3389/frai.2026.1841639},
pmid = {42382852},
pmcid = {PMC13315184}
}

RIS

TY - JOUR
AU - Wang, Junwen
AU - MacCormac, Oscar
AU - Rochford, William
AU - Kujawa, Aaron
AU - Shapey, Jonathan
AU - Vercauteren, Tom
TI - Label tree semantic losses for rich multi-class medical image segmentation
T2 - Frontiers in artificial intelligence
J2 - Front Artif Intell
PY - 2026
DA - 2026/06/16
VL - 9
SP - 1841639
SN - 2624-8212
PB - Frontiers Media SA
DO - 10.3389/frai.2026.1841639
UR - https://doi.org/10.3389/frai.2026.1841639
LA - en
ER -

CSL-JSON

{
"id": "10.3389/frai.2026.1841639",
"type": "article-journal",
"title": "Label tree semantic losses for rich multi-class medical image segmentation",
"container-title": "Frontiers in artificial intelligence",
"author": [
{
"family": "Wang",
"given": "Junwen"
},
{
"family": "MacCormac",
"given": "Oscar"
},
{
"family": "Rochford",
"given": "William"
},
{
"family": "Kujawa",
"given": "Aaron"
},
{
"family": "Shapey",
"given": "Jonathan"
},
{
"family": "Vercauteren",
"given": "Tom"
}
],
"container-title-short": "Front Artif Intell",
"volume": "9",
"page": "1841639",
"DOI": "10.3389/frai.2026.1841639",
"PMID": "42382852",
"PMCID": "PMC13315184",
"ISSN": "2624-8212",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/frai.2026.1841639",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
16
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.21037/qims-2026-0792 [code]
An nnU-Net-based framework with adaptive feature representation for 3D brain tumor segmentation.
Journal: Quantitative imaging in medicine and surgery
In common: nnU-Net, OpenCV, NiBabel, 6 other tools, 4 references
[2] doi:10.3389/frai.2026.1771088 [code]
Few-shot deployment of pretrained MRI transformers in brain imaging tasks.
Journal: Frontiers in artificial intelligence
In common: nnU-Net, OpenCV, Pillow, 7 other tools, 1 reference
[3] doi:10.1007/s12021-026-09817-x [code]
Circle of Willis-Guided Localization for Simultaneous Detection and Classification of Large Vessel Occlusions in Brain CTA.
Journal: Neuroinformatics
In common: nnU-Net, PyTorch Lightning, NiBabel, 6 other tools, 1 reference
[4] doi:10.1002/epi.70296 [code]
Fully automated three-dimensional deep learning-based magnetic resonance imaging segmentation of brain cavities in epilepsy surgery.
Journal: Epilepsia
In common: nnU-Net, OpenCV, Pillow, 5 other tools, 2 references
[5] doi:10.1162/imag.a.1326 [code]
RAVEN: Robust, generalizable, multi-resolution structural MRI upsampling using autoencoders.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: PyTorch Lightning, OpenCV, Pillow, 6 other tools, 1 reference
[6] doi:10.1002/alz.71649 [code]
Postmortem brain MRI reveals differential associations of subcortical and limbic volumes with cortical thinning and neurodegenerative pathologies.
Journal: Alzheimer's & dementia : the journal of the Alzheimer's Association
In common: nnU-Net, OpenCV, Pillow, 7 other tools
[7] doi:10.1016/j.phro.2026.101056 [code]
Toward uncertainty-aware manual delineation of brain tumours using eye-tracking and image-derived features.
Journal: Physics and imaging in radiation oncology
In common: OpenCV, Pillow, NiBabel, 6 other tools, 2 references
[8] doi:10.3390/jimaging12070276 [code]
Hyperelastic Regularization for Near-Diffeomorphic Transformer-Based Brain MRI Registration.
Journal: Journal of imaging
In common: nnU-Net, Pillow, NiBabel, 5 other tools, 2 references
[9] doi:10.3389/fnins.2026.1870124 [code]
An end-to-end pipeline for automated fetal brain segmentation and biometry from 3D SSFP MRI.
Journal: Frontiers in neuroscience
In common: nnU-Net, OpenCV, NiBabel, 6 other tools, 1 reference
[10] doi:10.1371/journal.pone.0354511 [code]
TokenUNet: A new case for transformers integration in efficient and interpretable 3D UNets for brain imaging segmentation.
Journal: PloS one
In common: nnU-Net, NiBabel, PyTorch, 5 other tools, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.