Joint Lineage Decoding for Patients with Multiple Lung Tumors

When a cancer patient has two or more lung tumors, the treating team must decide whether they are separate new cancers or one cancer that has spread. The answer decides whether the patient gets curative surgery or palliative systemic therapy. Current image-based tools score each tumor alone, as if the verdict on one said nothing about the others. That assumption is wrong. If one nodule is almost certainly spread from a prior cancer, the others are more likely to be spread too. If two nodules clearly come from different cell lineages, they cannot both be spread from the same source. Per-nodule scores can therefore combine into patient-level diagnoses that no biology allows.

We propose to treat the diagnosis as a single joint decision. Each tumor picks its "parent": a founding primary cancer, another tumor in the patient, or the patient's earlier cancer. How good a choice looks to one tumor depends on which other tumors have made the same choice. Economists and wireless engineers call this dependence matching with externalities, meaning that one party's assignment changes the value of assignments for everyone else. We borrow their stability notion, swap stability: no tumor, or pair of tumors, can improve the patient-level score by changing or exchanging parents. We also borrow a tool from diagnostic meta-analysis, the bivariate random-effects model, which pools sensitivity and specificity jointly across hospitals. We extend it to three levels (lesion, patient, center) for two purposes. The first is to measure whether joint decoding truly improves diagnosis or only moves the decision threshold. The second is to account for the fact that coherent decoding makes a patient's errors arrive in bundles.

Core Claim

The claim is that errors in telling primaries from metastases are largely incoherence errors. Evidence at the level of a lineage, meaning the group of tumors that share one ancestor, can correct them. That evidence is only available when tumors are decoded together. A second claim is methodological. Without a model that separates discrimination from threshold, a joint decoder can look better in lesion-level sensitivity simply because it shifts the operating point. The three-level bivariate model is what makes any claimed gain credible.

What is new becomes clear against three bodies of prior work. Solitary radiomics, as in the AI-SONAR radiomics predictive vector, scores each nodule independently. Relational set models such as NoduleSAT share context through soft attention but still output independent per-nodule probabilities, with no structural constraint. Swap-matching work in wireless networks (Namvar et al., Pantisano et al.) has not been applied to diagnostic inference at all.

The Model

For a patient with lesions $1,\dots,n$, a diagnosis is a parent assignment $p(i)$ for each lesion $i$. The candidate parents are "root," meaning an independent primary; "prior," meaning spread from a previously treated cancer; or another lesion $j$. Together these assignments form a forest of lineages. We score a forest $F$ as

$$ E(F) = \sum_{i} s_\theta\big(i, p(i)\big) + \sum_{L \in F} g_\phi(L). $$

Here $s_\theta$ is a learned pairwise score saying how plausible it is that lesion $i$ descends from its chosen parent, computed from both lesions' imaging features and their spatial relationship. $g_\phi(L)$ is a learned score for a whole lineage $L$. It rewards internal consistency and plausible spread patterns, such as a shared texture signature across all members, lobar distribution, and the number of members.

The lineage term $g_\phi$ is the externality. A lesion's gain from joining lineage $L$ depends on who is already in $L$. The motivating biology comes from Burr et al., who used lineage tracing to show that true metastases share roughly 80% of their cell-division history. Tumors arising from embryonic mosaic cell populations share about 44%, and unrelated cancers share 0%. Relatedness is therefore graded and group-structured, not a single yes/no call per pair. This matters practically: mosaic multifocal tumors look "related" at the pairwise level yet are eligible for curative treatment.

The pairwise-only version of this problem needs no game theory. If $g_\phi = 0$, the best forest is a maximum spanning arborescence, which Chu–Liu/Edmonds finds exactly in polynomial time. That version is our key ablation. With $g_\phi \neq 0$, exact search is still feasible when $n$ is small, because the number of forests grows quickly but stays tractable up to roughly eight lesions. We use exact search as ground truth for the optimization. We run swap dynamics started from the Edmonds solution and report how often they stop at a swap-stable forest that is not the true optimum. This matters for patients with many nodules, where exact search becomes infeasible. The same issue appears in wireless swap matching, where finding the global optimum is hard and local swap search can stall.

We train the scores with a structured max-margin loss over forests, using patients whose lineage is known from sequencing. The image encoder is a 3D DenseNet pretrained on LIDC-IDRI-style malignancy labels, matching the NoduleSAT backbone so the comparison isolates the decoder. Lesions without sequencing contribute to the lineage term only through a masked loss, following Yang et al.'s treatment of ambiguous nodules.

Evaluation Statistics

Standard diagnostic meta-analysis treats every sensitivity–specificity pair as coming from independent units given the study-level random effect. That assumption fails twice here. First, lesions within a patient are correlated. Second, joint decoding deliberately correlates their errors: one wrong lineage call can mislabel three lesions at once.

We therefore fit a three-level logit-normal model. Lesion outcomes are nested in patients and patients in centers. There is a bivariate center-level random effect on logit sensitivity and logit specificity, with correlation $\rho$, and a patient-level random effect that absorbs within-patient error clustering. The bivariate model and the hierarchical summary ROC model are mathematically equivalent (Wang et al., Moraitis et al.). That equivalence lets us report each method's result as two separate quantities: an accuracy parameter, which says whether the ROC curve is lifted, and a threshold parameter, which says where on the curve the method operates.

Contrast protocol enters as a center-level covariate. This targets the "contrast paradox" reported by Kalsi et al., where discrimination fell to AUC about 0.5 on contrast-enhanced CT. Where some centers report zero false positives, we use the zero-inflated extension of ZIBGLMM rather than continuity corrections. The boundary-convergence problem with fewer than ten centers is real. We will report profile-likelihood intervals for $\rho$ and a Bayesian fit with weakly informative priors in parallel, and we will not treat either as settled if they disagree.

Research Program

The work has three parts. First, we build the data: a retrospective multi-center cohort of patients with two or more synchronous or metachronous lung tumors and a genomic lineage reference standard. The reference standard is targeted panel sequencing in the style of Mantri et al., who showed that tumors with mutations in the same genes can still have disjoint variant sites and so be separate primaries. Where multiple regions were sampled, we add clonal deconvolution with Chimæra, which estimates tumor subclones from several biopsies jointly.

No public benchmark with lineage-level labels for primary versus intrapulmonary metastasis exists in the material we have. LIDC-IDRI, LUNA16, and Tianchi supply only nodule and malignancy labels. The Burr et al. cohort of ten patients serves only as a small sanity check with high-resolution lineage truth. We will request the AI-SONAR cohort (200 patients, 100 second primaries and 100 metastases) as a single-center anchor.

Second, we build the decoder and its ablations as described above. Third, we build the three-level evaluation model and release it together with per-center summary ROC outputs.

Baselines

The naive reference point is the clinical spatial-histological rule, as described in Ono et al.. Same-histology lesions without separating normal tissue are called metastases. We also report majority-class prediction. Every learned method must beat both on the patient-level staging decision (curative-eligible versus stage IV), or it adds nothing clinically.

The strongest solitary baseline is the Kalsi et al. radiomics predictive vector. It reports test AUC 0.82, sensitivity 0.83, and specificity 0.70 on non-contrast CT, and AUC about 0.5 on contrast CT. We re-fit its feature-selection pipeline on our training centers with the same splits and the same tuning budget as our method. Beating it means a higher summary ROC accuracy parameter in the three-level model, with a credible interval excluding zero difference. A shift in sensitivity alone at a lower specificity would not count.

The strongest relational competitor is NoduleSAT. It reports LIDC-IDRI malignancy AUC of 93.17% against 91.62% for a solitary DenseNet. We found no reported result on Lacuna for NoduleSAT on primary-versus-metastasis discrimination. We will retrain it with a per-lesion three-way head (root, prior, related), using the same backbone, data, and number of hyperparameter trials as our method. It is the strongest competitor because it already shares information across a patient's nodules. Any advantage we show must come from structured decoding, not from access to context.

The key ablation is the pairwise-only arborescence: identical learned $s_\theta$, $g_\phi$ removed, exact Edmonds decoding. It isolates the externality ingredient. The lineage term earns its place only if the full model beats this ablation on mosaic-versus-metastasis cases and on patient-level partition accuracy.

Finally, we fit a hierarchical logistic classifier with a patient random intercept. This tests whether a single patient-level "tendency to spread" explains most of the benefit of joint decoding.

Why not just…?

Why not just add a patient-level random effect to a per-lesion classifier? This is the most serious threat. If most of the correlation among a patient's lesions is a shared tendency toward disseminated disease, a random intercept captures it cheaply. It cannot, however, say which lesions are related. So it cannot separate two independent primaries from one primary plus a metastasis when both patients have the same number of malignant lesions. We will stratify results by lineage structure. If the random-intercept model matches our decoder on the staging decision, including in patients with mixed lineages, we will report that the structured decoder is unnecessary.

Why not just fine-tune NoduleSAT to output primary-versus-metastasis labels? Soft attention may learn coherence implicitly. What it cannot guarantee is a consistent forest: its independent outputs can say lesion A spread from B while B is labeled an independent primary with no spread. We measure the rate of such impossible configurations and the resulting staging errors. If fine-tuned NoduleSAT has near-zero violations and equal summary ROC accuracy, the matching formulation is not justified.

Why not just learn pairwise relatedness and cluster, or run Edmonds? For patients with few lesions this is exact and fast, and it needs no swap dynamics. The pairwise-only ablation tests it directly. We expect it to fail mainly on mosaic lineages, where pairwise signals say "related" but the group pattern says "not a metastasis," following the 44% versus 80% shared-history gap in Burr et al. If it does not fail there, we drop $g_\phi$.

Why not just pool sensitivity and specificity separately across centers? Separate pooling ignores the negative correlation that threshold differences create (Takada et al.). It would also ignore within-patient error clustering, which our decoder deliberately increases. Its intervals would therefore be too narrow exactly for the method being proposed. We report the univariate pooled estimates alongside the three-level estimates to show the size of this distortion.

Decisive Checks

Three results decide the project. The first is whether the full decoder lifts the summary ROC accuracy parameter over both fine-tuned NoduleSAT and the pairwise arborescence, rather than only moving the threshold. The second is whether its gain concentrates in mixed-lineage and mosaic patients, where the externality should matter. If the gain is spread evenly, the random-intercept model probably explains it. The third concerns robustness to imaging protocol: whether center-level heterogeneity in the three-level model is smaller for joint decoding than for solitary radiomics on contrast-enhanced CT. Lineage consistency across a patient's own lesions is a comparison within one scan, so it could partly cancel protocol effects that destroy absolute texture values. A null on the first check with a positive third check would still be a useful finding. A null on all three would tell us to drop the matching formulation in favor of the simpler hierarchical model.