Code for the MICCAI paper "Ontology-Grounded Structured Prediction for Dental CBCT Reporting".
- A dental CBCT ontology for structured report labels:
ontology/ontology.ttl. - A conversion pipeline from raw Italian reports to patient-level TTL labels.
- An ontology-driven prediction model that adapts its heads to the ontology schema.
-
Put raw reports in
data/ToothFairy3/reportsTr/. -
Convert reports to structured TTL with the main script,
ontology/extract.py:OPENAI_API_KEY=... python ontology/extract.py
This combines all reports for each patient into one TTL.
ontology/extract_single.pyis only for one-report-per-TTL inter-agreement checks. -
Check outputs:
- valid TTLs:
data/ttl_reports/ - generated single-report TTLs:
data/ttl_reports_single/ - SHACL/API errors:
data/shacl_errors/ - schema files:
ontology/ontology.ttl,ontology/shapes.ttl
- valid TTLs:
-
Preprocess CBCT volumes into regional tokens:
python main.py preprocess --dataset-root data/ToothFairy3 --output-dir data/preprocessed_tokens
-
Train:
python -m src.train --wandb_name experiment_name
For a quick local run:
python -m src.train --use_kfold false --max_epochs 5 --no_wandb
- TTL filenames must match preprocessed token patient IDs.
- Training only uses samples with both
.pttokens and.ttllabels. - Inspect label distribution before training:
python -m src.scripts.histogram_ttl