Counting Rare Dendritic Cells Across Hospitals Without Expert Masks

Dendritic cells are the immune cells that show tumor fragments to T cells and start an anti-tumor response. How many of them sit in a tumor's surrounding tissue is among the strongest prognostic signals in the immune-oncology literature. In pleural mesothelioma, adding the density of these cells in the stroma (the connective tissue around the tumor) to a clinical model raised survival prediction AUROC from 0.67 to 0.84 (Ollila et al.). Measuring that density at scale is hard for three reasons. The cells are often under 1% of the immune infiltrate. Nobody has pixel labels for them. And any model built at one hospital meets different stains and scanners at the next.

This note argues that the right target is the cell density itself, not a per-cell label. For a cell this rare, a detector's count is dominated by its false positives, and the false-positive rate is exactly what moves when the hospital changes. A classifier with 95% sensitivity and 99% specificity, applied where the true prevalence is 1%, reports about 1.9%, nearly double the truth. If specificity drops to 98% at a new site, the same classifier reports about 2.9%. Better imbalance losses and better domain alignment shrink these errors but do not remove them. We propose two things. First, train a dendritic-cell detector on routine hematoxylin and eosin (H&E) slides using labels transferred from a chemical stain, so no expert draws masks. Second, at each new site, correct its counts with a handful of paired calibration slides, using the standard "adjusted count" estimator from the quantification literature.

Core Claim

Chemistry can replace expert annotation, and arithmetic can replace adaptation. Labels come from immunohistochemistry: an antibody stain that makes a chosen protein visible, here CD11c, which marks dendritic cells, and CD16, which marks monocytes and macrophages. We restain the same tissue section after H&E imaging and register the two scans. A cell that is CD11c-positive and CD16-negative becomes a dendritic-cell label on the H&E image, following the phenotype definition of Ollila et al.. At a new hospital, three to five paired slides estimate the detector's site-specific true-positive rate $\widehat{TPR}_t$ and false-positive rate $\widehat{FPR}_t$. The slide-level dendritic-cell fraction is then

$$\hat\pi = \frac{\hat q - \widehat{FPR}_t}{\widehat{TPR}_t - \widehat{FPR}_t},$$

where $\hat q$ is the fraction of candidate cells the detector calls dendritic. This is the adjusted classify-and-count estimator.

The false-positive rate is estimated from the tens of thousands of non-dendritic cells on each calibration slide, so it is cheap to pin down. The true-positive rate rests on far fewer cells, so its error shrinks only as $1/\sqrt{m}$ in the number $m$ of labeled dendritic cells (the binomial standard error). This asymmetry is why a few slides should suffice. The estimator also stays valid when the dendritic-cell prevalence differs between hospitals, provided the detector's error rates conditional on the true class are stable within a site. That is the compound shift that the research file notes standard domain adaptation cannot resolve. We report bootstrap intervals over calibration cells alongside every corrected density.

The claim is falsifiable at its first step. H&E may simply not contain enough contrast to separate dendritic cells from macrophages and large lymphocytes. The research file flags this as the central open problem, since existing H&E pipelines lump these cells into "lymphocyte" or "non-malignant" bins (Tan et al.; Single-Cell Spatial Analysis of HCC). If so, the counting correction still applies unchanged to cheap single-plex CD11c staining, whose thresholds need site-specific retuning (Lin et al.). The project then reports the H&E ceiling as a negative result rather than overselling it.

Relation to Prior Work

Two papers come closest, and each motivates part of the design.

SADA handles stain shift and class imbalance together for blood cells. It swaps stain matrices across centers, trains a stain-invariant encoder with contrastive learning, and then fits a class-balanced classification head. It works on pre-cropped isolated cells and optimizes per-cell F1, never the bias of the resulting counts. We reuse its stain-swap augmentation as a component and change the evaluation object to density error.

SFDA-DeP shows that unsupervised self-training on a new site drifts toward the dominant class, collapsing to near-chance accuracy on some CAMELYON17 centers. It counters the drift by "unlearning" high-entropy predictions. This constrains our design: it is direct evidence that unlabeled target data alone does not fix prevalence bias. We therefore spend a small amount of target-site labels, and we obtain them from chemistry rather than experts.

The label-efficient line also shaped the plan. Hou et al. synthesize class-agnostic nuclear masks. HistoSegNet segments tissue types from patch tags using class-activation maps, which are heatmaps of where a classifier's evidence lies. Neither resolves cell lineage, and activation maps tend to over-fire on stromal background for rare cells. That rules them out as the label source here.

LSP-DETR supplies a fast nucleus detector, reported at 48.2 multi-class panoptic quality on PanNuke. We use it to generate candidate cells, which form the denominator of $\hat q$.

Research Program

The work has three stages.

The first stage builds a paired-stain cohort. Mesothelioma or non-small-cell lung cancer resections are drawn from at least three hospitals with different scanners. Each H&E section is imaged, destained, restained for CD11c and CD16, and re-imaged. Cells are matched by nucleus registration. Experts spend their time only on auditing registration failures and ambiguous double-stained cells, which is a small fraction of the hours that dense tracing would require (Hou et al. report over 200 hours for 50 patches).

The second stage trains the detector. A cell-centered classifier is trained on the chemistry-derived labels with SADA-style stain augmentation and a decoupled balanced head. We report its per-cell ceiling in held-out sites.

The third stage tests the correction. On each held-out site, we vary the number of calibration slides from zero to ten and measure density error, interval coverage, and downstream prognostic value. Densities are reported separately in the stroma and tumor compartments, because the mesothelioma signal was stromal.

Baselines

The naive reference is classify-and-count with a plain cross-entropy detector trained on source sites and applied unchanged. This is what a deployed pipeline would actually do, and the prevalence arithmetic above predicts it will overcount.

The strongest existing method for imbalance under stain shift is SADA. It is the only work in the file that addresses both problems together, reporting an average F1-macro of 68.6% and F1-micro of 84.4% across four public blood-smear benchmarks (SADA). We reimplement it on the same candidate cells, backbone, and hyperparameter search budget, and count its outputs directly.

The strongest adaptation competitor is SFDA-DeP, run on unlabeled target-site slides with the same budget. For dendritic-cell detection on H&E there is no reported result found on Lacuna, so all numbers will be ours.

A fourth baseline regresses slide-level dendritic-cell density directly from H&E tiles with attention-based multiple instance learning, where a model pools many tile features into one slide prediction. It is trained on the chemistry-derived densities with the same data.

The key ablation applies the correction formula with error rates estimated on source sites only. This isolates whether target-site calibration, rather than the formula itself, does the work.

Beating the baselines means lower median absolute relative density error on held-out sites, and 90% intervals that cover the IHC density near nominal rate where the baselines' intervals do not. The final criterion is clinical: the corrected stromal density, added to clinical covariates, should recover a survival AUROC closer to the 0.84 that mfIHC achieved (Ollila et al.) than any uncorrected baseline does. The comparison is made in a cohort with long-term survival outcomes.

Why not just…?

Why not just stain CD11c and count it? This is a real threat. For prospective patients, IHC is the reference measurement, not a competitor. The H&E path matters for retrospective cohorts and trials that have only H&E archives. Even pure IHC counting has site-dependent thresholds that need manual retuning (Lin et al.), so we also evaluate the calibration correction on single-plex IHC counts. If the H&E ceiling experiment fails, that becomes the main contribution.

Why not just use a better imbalance method such as SADA? A better classifier lowers the false-positive rate, but any nonzero rate that varies by site biases counts at 1% prevalence. The prevalence arithmetic in the opening shows that a one-point specificity change shifts the estimate by about one prevalence unit. The SADA baseline with and without our correction tests this directly. If SADA's site-to-site false-positive rates turn out to be stable, the correction adds nothing, and we will report that.

Why not just adapt without labels? When stains and true prevalence shift together, unlabeled data cannot separate "more dendritic cells here" from "more false positives here." SFDA-DeP documents how self-training then drifts toward the majority class. The zero-calibration-slide arm of the experiment measures this cost.

Why not just regress density at slide level? It sidesteps per-cell errors and may match us in-distribution. However, it offers no site-specific correction, and it does not naturally separate stromal from tumoral density. The direct-regression baseline is run head-to-head on held-out sites to settle this.

Decisive Experiments

The first check uses public data. On the four public blood-smear sets (Acevedo-20, Raabin-WBC, LDWBC, Zheng-18), we hold out one site at a time and estimate the fractions of rare lineages such as basophils, with and without calibration. This tests whether adjusted counting fixes count bias that SADA-level F1 leaves behind. It needs no new data collection.

The second check is the H&E ceiling. Per-cell AUROC for IHC-defined dendritic cells on held-out sites determines which branch of the project proceeds.

The third check is the calibration curve: density error and interval coverage as the number of target slides grows from zero to ten. The project succeeds if three to five slides bring error within the measurement noise of IHC counting itself.