MEDA: Metric-Conditioned Decision Adaptation for Multi-Target CT Recognition
Metric-Conditioned Decision Adaptation (MEDA) selects a classifier and an operating threshold for each clinical finding while keeping the pretrained CT encoder fixed. It compares classifiers and thresholds using labeled training data and keeps the combination with the highest balanced accuracy. New findings can be added without retraining the encoder.
This repository holds the trained MEDA heads behind the paper by Dharini Raghavan, Amritpal Singh and Anant Madabhushi: one classifier and threshold for each of the 17 findings, for each of two encoders (Merlin and CT-NEXUS), 34 heads in total. The code and results are on GitHub. MEDA received the Meritorious Winner Award in the Embedding Aggregation Optimization (Task 2 EAO), Vision-Language track of the CVPR 2026 Foundation Models for General CT Image Diagnosis challenge (team dharini24).
The heads take CT embeddings, not CT volumes. The encoders are not included, so extract features with Merlin or CT-NEXUS first.
How it works
- A frozen encoder (Merlin, 2,048-d, or CT-NEXUS, 1,120-d) turns each CT study into one embedding.
- A bank of 23 classifier settings is fitted on three inner folds of the training cases: balanced logistic regression, sparse logistic regression, PCA followed by logistic regression, ExtraTrees, random forest, histogram boosting and XGBoost.
- For every candidate, the threshold that maximizes balanced accuracy on its out-of-fold scores is found. The candidate and threshold pair with the highest balanced accuracy is kept.
- The chosen classifier is refitted on all training cases. At inference, a study is positive when its score reaches the stored threshold.
MEDA-Lite uses the same rule over the first 10 (Merlin) or 16 (CT-NEXUS) candidates. It was defined after looking at held-out folds, so its numbers are exploratory, and it was not part of the challenge submission.
Quick start
pip install -r requirements.txt # pinned versions, the heads were saved with scikit-learn 1.2.2
import numpy as np
from predict import load_head, predict
head = load_head("merlin", "ascites") # encoder: "merlin" or "ctnexus"
embeddings = np.load("embeddings.npy") # (n_studies, 2048) for Merlin, (n_studies, 1120) for CT-NEXUS
scores, calls = predict(head, embeddings) # a study is positive when score >= head["threshold"]
print(head["name"], head["threshold"], calls)
Each .joblib file is a dictionary with model (a fitted scikit-learn or XGBoost classifier), name, threshold, backbone and target. The score is model.predict_proba(X)[:, 1]. To fit MEDA on your own features, see the GitHub repository.
models/
βββ merlin/ 17 findings, 2,048-d embeddings
β βββ adrenal_hyperplasia.joblib
β βββ ascites.joblib
β βββ ...
βββ ctnexus/ 17 findings, 1,120-d embeddings
βββ adrenal_hyperplasia.joblib
βββ ...
head_summary.csv selected classifier, threshold and validation metrics for every head
predict.py loading and scoring helper
The 17 findings are from AMOS (15 abdominal findings), COVID-19 CT and LUNA25 lung-nodule malignancy: adrenal hyperplasia, ascites, atherosclerosis, cholecystitis, colorectal cancer, COVID-19, fatty liver, gallstone, hydronephrosis, kidney stone, liver calcifications, liver cyst, liver lesion, lung nodule malignancy, lymphadenopathy, renal cyst and splenomegaly.
Results
All numbers are means over 17 findings and five outer folds. Every method uses the same features, patients and folds.
| Encoder | Decision rule | Balanced acc. | AUROC | AUPRC | Sensitivity | F2 | G-mean |
|---|---|---|---|---|---|---|---|
| Merlin | LP (0.5) | 0.611 | 0.680 | 0.410 | 0.360 | 0.366 | 0.514 |
| Merlin | Balanced LP + cutoff | 0.628 | 0.679 | 0.409 | 0.580 | 0.463 | 0.608 |
| Merlin | MEDA | 0.650 | 0.701 | 0.422 | 0.631 | 0.490 | 0.635 |
| CT-NEXUS | LP (0.5) | 0.583 | 0.642 | 0.348 | 0.318 | 0.323 | 0.474 |
| CT-NEXUS | Balanced LP + cutoff | 0.602 | 0.642 | 0.347 | 0.558 | 0.439 | 0.574 |
| CT-NEXUS | MEDA | 0.618 | 0.665 | 0.373 | 0.614 | 0.464 | 0.602 |
LP uses logistic regression with a 0.5 threshold. Balanced LP uses class-balanced logistic regression with a threshold selected from training data. The paired balanced-accuracy gain over balanced LP is 0.023 with Merlin (95% interval 0.012 to 0.033; Holm-adjusted p = 0.001) and 0.016 with CT-NEXUS (95% interval 0.005 to 0.027; Holm-adjusted p = 0.087, which does not reach 0.05).
Independent challenge cohorts
Mean balanced accuracy of the seven challenge systems on 30 finding and cohort evaluations. MEDA here is the original challenge submission.
| System | China abd. internal (15) | China abd. external (7) | China chest external (6) | Germany WB external (2) | All (30) |
|---|---|---|---|---|---|
| MEDA (Merlin) | 0.6712 | 0.6673 | 0.5466 | 0.7097 | 0.6479 |
| Merlin + LP | 0.6820 | 0.6592 | 0.5411 | 0.7594 | 0.6537 |
| Merlin + EAO | 0.6463 | 0.6600 | 0.5406 | 0.7417 | 0.6347 |
| CT-NEXUS + LP | 0.5667 | 0.5782 | 0.5213 | 0.5288 | 0.5578 |
| CT-NEXUS + EAO | 0.6378 | 0.6424 | 0.5358 | 0.6382 | 0.6185 |
| VoCo-L + LP | 0.6474 | 0.6501 | 0.5121 | 0.6223 | 0.6193 |
| VoCo-L + EAO | 0.6516 | 0.6650 | 0.5075 | 0.6089 | 0.6230 |
MEDA achieved the highest balanced accuracy among the seven systems on both external Chinese cohorts: 0.6673 for abdominal CT and 0.5466 for chest CT. On German whole-body CT, and across all 30 evaluations, the Merlin linear probe scored higher (0.7594 and 0.6537, against 0.7097 and 0.6479 for MEDA).
Per-head details
The validation columns come from the organizers' public validation sets, which were not used to train or select these heads. Those sets have balanced classes and are small, so they are not comparable with the results above. Treat them as a check on the saved files.
Merlin heads (2,048-d)
| Finding | Selected classifier | Family | Threshold | Val. BA | Val. AUROC | Sens. | Spec. |
|---|---|---|---|---|---|---|---|
| Adrenal hyperplasia | logreg_l1_C0.05 |
Sparse logistic | 0.416 | 0.657 | 0.740 | 0.771 | 0.543 |
| Ascites | logreg_l1_C0.05 |
Sparse logistic | 0.430 | 0.735 | 0.805 | 0.765 | 0.706 |
| Atherosclerosis | pca8_logreg |
PCA-logistic | 0.463 | 0.721 | 0.818 | 0.765 | 0.676 |
| Cholecystitis | logreg_l1_C0.05 |
Sparse logistic | 0.499 | 0.598 | 0.645 | 0.588 | 0.608 |
| Colorectal cancer | pca16_logreg |
PCA-logistic | 0.487 | 0.596 | 0.706 | 0.577 | 0.615 |
| COVID-19 | logreg_C2.0 |
Balanced logistic | 0.550 | 0.688 | 0.799 | 0.562 | 0.812 |
| Fatty liver | logreg_l1_C0.1 |
Sparse logistic | 0.420 | 0.833 | 0.932 | 0.821 | 0.846 |
| Gallstone | logreg_l1_C0.05 |
Sparse logistic | 0.504 | 0.681 | 0.665 | 0.707 | 0.655 |
| Hydronephrosis | xgb_d4_lr0.02_n500 |
XGBoost | 0.190 | 0.672 | 0.722 | 0.531 | 0.812 |
| Kidney stone | logreg_l1_C0.1 |
Sparse logistic | 0.508 | 0.627 | 0.657 | 0.544 | 0.709 |
| Liver calcifications | xgb_d4_lr0.02_n500 |
XGBoost | 0.059 | 0.542 | 0.507 | 0.611 | 0.472 |
| Liver cyst | xgb_d3_lr0.025_n450 |
XGBoost | 0.460 | 0.603 | 0.633 | 0.738 | 0.467 |
| Liver lesion | pca8_logreg |
PCA-logistic | 0.525 | 0.612 | 0.599 | 0.507 | 0.716 |
| Lung nodule malignancy | xgb_d4_lr0.02_n500 |
XGBoost | 0.029 | 0.580 | 0.597 | 0.620 | 0.540 |
| Lymphadenopathy | pca8_logreg |
PCA-logistic | 0.524 | 0.722 | 0.811 | 0.667 | 0.778 |
| Renal cyst | extratrees_balanced |
ExtraTrees | 0.510 | 0.647 | 0.686 | 0.639 | 0.654 |
| Splenomegaly | logreg_l1_C0.1 |
Sparse logistic | 0.380 | 0.843 | 0.900 | 0.886 | 0.800 |
| Mean (17 findings) | 0.668 | 0.719 | 0.665 | 0.671 |
CT-NEXUS heads (1,120-d)
| Finding | Selected classifier | Family | Threshold | Val. BA | Val. AUROC | Sens. | Spec. |
|---|---|---|---|---|---|---|---|
| Adrenal hyperplasia | pca8_logreg |
PCA-logistic | 0.525 | 0.529 | 0.600 | 0.400 | 0.657 |
| Ascites | xgb_d2_lr0.03_n350 |
XGBoost | 0.060 | 0.647 | 0.725 | 0.559 | 0.735 |
| Atherosclerosis | logreg_l1_C0.1 |
Sparse logistic | 0.300 | 0.647 | 0.706 | 0.706 | 0.588 |
| Cholecystitis | xgb_d3_lr0.025_n450 |
XGBoost | 0.052 | 0.559 | 0.580 | 0.824 | 0.294 |
| Colorectal cancer | pca8_logreg |
PCA-logistic | 0.445 | 0.500 | 0.564 | 0.692 | 0.308 |
| COVID-19 | histgb |
HistGradientBoosting | 0.033 | 0.812 | 0.841 | 0.906 | 0.719 |
| Fatty liver | logreg_C0.05 |
Balanced logistic | 0.459 | 0.808 | 0.838 | 0.769 | 0.846 |
| Gallstone | extratrees_balanced |
ExtraTrees | 0.260 | 0.621 | 0.710 | 0.707 | 0.534 |
| Hydronephrosis | logreg_l1_C0.25 |
Sparse logistic | 0.390 | 0.734 | 0.829 | 0.656 | 0.812 |
| Kidney stone | logreg_l1_C0.1 |
Sparse logistic | 0.530 | 0.633 | 0.698 | 0.481 | 0.785 |
| Liver calcifications | histgb |
HistGradientBoosting | 0.013 | 0.542 | 0.549 | 0.639 | 0.444 |
| Liver cyst | logreg_l1_C0.05 |
Sparse logistic | 0.515 | 0.594 | 0.617 | 0.664 | 0.525 |
| Liver lesion | xgb_d2_lr0.03_n350 |
XGBoost | 0.355 | 0.590 | 0.656 | 0.492 | 0.687 |
| Lung nodule malignancy | logreg_C0.05 |
Balanced logistic | 0.270 | 0.470 | 0.470 | 0.360 | 0.580 |
| Lymphadenopathy | logreg_l1_C0.05 |
Sparse logistic | 0.389 | 0.556 | 0.549 | 0.528 | 0.583 |
| Renal cyst | pca8_logreg |
PCA-logistic | 0.495 | 0.613 | 0.667 | 0.647 | 0.579 |
| Splenomegaly | logreg_l1_C0.05 |
Sparse logistic | 0.406 | 0.729 | 0.816 | 0.714 | 0.743 |
| Mean (17 findings) | 0.622 | 0.671 | 0.632 | 0.613 |
Some findings are hard to detect from global CT features, for example liver calcifications, gallstone and lung nodule malignancy, and several of these heads are close to chance. Check head_summary.csv before relying on a particular head.
Feature extraction
- Merlin: 2,048-dimensional pooled features from the final residual stage of the pretrained encoder, before the contrastive and phenotype prediction heads. CT volumes were oriented to RAS, resampled to 1.5 x 1.5 x 3 mm, windowed to [-1000, 1000] Hounsfield units, scaled to [0, 1], and center-cropped to 224 x 224 x 160. Organ masks were not used.
- CT-NEXUS: 1,120-dimensional features. For 11 findings (splenomegaly, adrenal hyperplasia, fatty liver, cholecystitis, liver calcifications, hydronephrosis, gallstone, liver lesion, kidney stone, liver cyst and renal cyst) a 160 x 160 x 160 crop centered on the organ mask provided by the organizers was used. The remaining six findings used a 320 x 320 x 320 whole-volume crop with 1 mm resampling and z-score normalization.
Use the heads only with embeddings made the same way.
Limitations
- Research use only. These heads are not a medical device, have not been clinically validated, and must not be used to make or support clinical decisions.
- Provenance. The heads were trained with the selection procedure in the GitHub repository, which uses inner cross-validation, on the challenge training sets only. The challenge submission selected its classifier and threshold on the validation split, so these are the same method but not the identical submitted models.
- Thresholds depend on the setting. Thresholds were selected for balanced accuracy on the development cohorts. Other prevalences, scanners or institutions can change the best operating point, and the available data did not allow threshold stability between individual hospitals to be measured.
- Library versions. The files were saved with scikit-learn 1.2.2 and XGBoost 2.1.4. Other versions may fail to load them or give different scores.
License
The heads and code in this repository are released under the MIT License. The Merlin and CT-NEXUS encoders and the training datasets have their own licenses.
Citation
@inproceedings{
raghavan2026meda,
title={{MEDA}: Metric-Conditioned Decision Adaptation for Multi-Target {CT} Recognition},
author={Dharini Raghavan and Amritpal Singh and Anant Madabhushi},
booktitle={Submitted to CVPR 2026: Foundation Models for General CT Image Diagnosis},
year={2026},
url={https://openreview.net/forum?id=jcUMMVgmUL},
note={under review}
}