Pleura-Referenced Acoustic Confidence as a Soft Anatomical Mask for Cross-Source Lung Ultrasound

Lung ultrasound classifiers tend to learn the wrong things. Two kinds of image content do most of the damage. The first is the dark stripes cast by ribs, called acoustic shadows: bone reflects nearly all of the sound, so nothing behind it is imaged. The second is the layer of fat and muscle above the lung, whose thickness tracks body habitus rather than disease. One study showed that masking out everything except the pleural line and the region just beneath it raised severity-classification area under the ROC curve (AUC) from 0.655 to 0.774. That mask, however, was built with edge filters on a single probe type from one hospital, and it breaks when disease or shadow disrupts the pleural line. Multi-source systems do the opposite: they drop the mask entirely and trust self-attention to ignore ribs. Nobody has tested which choice holds up when a model is moved to data from a hospital, scanner, or labeling culture it never saw.

We propose to build the mask from the physics of the image rather than from its edges. The tool is an ultrasound confidence map, a per-pixel estimate in $[0,1]$ of how much transmitted signal reaches each point, computed by simulating sound propagation as a random walk. Used naively, it gives exactly the wrong answer for lung. The diagnostic artifacts, the horizontal A-lines and vertical B-lines, are reverberations below a strongly reflecting pleura, so the map marks them as low confidence along with the rib shadows. Our core idea is to read confidence in a different place. We measure it just above the pleural line, which separates rib columns from intercostal columns. We then use that column-wise score, together with a soft depth mask anchored at the pleura, as a continuous weight when pooling features. The test is whether this soft, physically grounded mask transfers across data sources better than both hard masks and unmasked self-attention. We run that test with evaluation designs that do not assume any one source's labels are correct.

Core Claim

A pooling weight built from confidence measured just above the pleura, multiplied by a soft sub-pleural depth window, will retain the diagnostic sub-pleural region, discard rib shadows and subcutaneous tissue, and survive pleural disruption. On held-out data sources it will match or exceed both a hard edge-based mask and an unmasked self-supervised transformer. The model's predictions will also depend measurably less on non-lung image content, and its features will carry less information about which source an image came from. A secondary claim is diagnostic: raw confidence weighting should hurt lung classifiers, because it suppresses the very reverberation artifacts clinicians read. If raw confidence weighting helps as much as our version, the physical argument is wrong, and the proposal says so.

The four research directions play unequal roles here. Acoustic shadowing supplies the mechanism. Region-of-interest segmentation is the design being replaced. Single-center bias defines the evaluation regime. Subjective diagnostic reliance is a constraint on how results are judged, because source-level labels in public lung ultrasound collections are clinical impressions that differ between contributors.

Research Program

The motivating evidence comes from two papers that point in opposite directions. The Role of Pleura and Adipose in Lung Ultrasound AI found pleura with Gaussian blurring, Sobel filters, and polynomial fitting. It split each frame into subcutaneous, pleural, and sub-pleural zones (the sub-pleural zone is called Merlin's space) and showed with Grad-CAM that unmasked networks read fat thickness. It used only high-frequency linear probes and 93 patients from one site, and it notes that its segmentation fails under consolidation and heavy shadowing. Efficient Lung Ultrasound Severity Scoring Using Dedicated Feature Extractor pretrained a vision transformer with DINO, a self-supervised student–teacher method, and pooled frames with a two-level VLAD aggregator, a pooling layer that sums feature residuals to learned cluster centers. Trained on pooled multi-source curvilinear data with no explicit mask, it reached 0.936 AUC. We keep the zone logic of the first paper and the self-supervised backbone of the second, and we replace the brittle mask with a physical one.

The confidence computation comes from Optimization of ultrasound image quality via visual servoing. That paper used random-walk confidence maps to steer a robotic probe around ribs by moving the confidence-weighted barycenter of the image. It never fed confidence into a diagnostic model, and we do not use it for control. Mask-weighted pooling comes from Computed tomography–based COVID–19 triage through a deep neural network using mask–weighted global average pooling and Lesion-Centric Latent Phenotypes from Segmentation Encoders for Breast Ultrasound Interpretability. Both pool features under a binary predicted mask. In ultrasound, shadowing produces gradual signal dropout with no crisp edge, so we make the weight continuous.

The weight is computed in beam coordinates, with depth $r$ along each scan line and scan-line angle or lateral position $\theta$. For curvilinear clips this requires undoing scan conversion using the fan geometry estimated from the cropped frame. Let $c(r,\theta)$ be the confidence map and $p(\theta)$ the pleural depth. We estimate $p(\theta)$ as the depth of the steepest confidence drop in columns where confidence stays high down to that drop. A smooth curve is fit across those columns and interpolated under rib columns. The pooling weight is

$$w(r,\theta) = \bar c(\theta)\,\sigma\!\left(\frac{r - p(\theta) + \delta}{\tau}\right),\qquad \bar c(\theta) = \frac{1}{\delta}\int_{p(\theta)-\delta}^{p(\theta)} c(r,\theta)\,dr,$$

where $\bar c(\theta)$ is the mean confidence in a band of thickness $\delta$ just above the pleura, $\sigma$ is the logistic function, and $\tau$ sets how softly the window turns on at depth $p(\theta)-\delta$. Rib cortex sits at or above pleural depth, so in rib columns that band is already dark and $\bar c$ falls toward zero. In intercostal columns the band is intercostal muscle and $\bar c$ stays high. Everything below the pleura in those columns is retained regardless of its own confidence. Two further cases work out. When consolidation turns the lung tissue-like, transmission continues and the column is kept. When fat is thick, the depth window suppresses it. Frame features from the DINO backbone are pooled under $w$, and frames are aggregated by the VLAD module, so the only thing that changes between arms is the spatial weight.

Transcranial sonography for Parkinson's disease is the natural second domain. There the skull window causes the shadowing, and the midbrain is the region of interest, as in Midbrain Segmentation in Transcranial 3D Ultrasound for Parkinson Diagnosis and Detection of Substantia Nigra Echogenicities in 3D Transcranial Ultrasound for Early Diagnosis of Parkinson Disease. The largest deep model there, Automatic Transcranial Sonography-Based Classification of Parkinson's Disease Using a Novel Dual-Channel CNXV2-DANet, is itself single-center and single-vendor, and the file lists no multi-center transcranial dataset. We therefore treat that domain as out of scope for decisive claims and keep lung ultrasound as the test bed.

Baselines

The naive reference is the same DINO-pretrained transformer and VLAD aggregator with uniform spatial weights over the probe-cropped frame. This is the "do nothing" arm, and every other arm differs from it only in the weight map. The strongest existing method is MeDiVLAD from Efficient Lung Ultrasound Severity Scoring Using Dedicated Feature Extractor. That paper reports video-level ROC-AUC of 0.936 and accuracy of 82.60% on COVIDx-US pooled with the private CoCross set. That is a within-distribution number on a protocol we cannot reproduce, and we found no leave-one-source-out result for it on Lacuna. We will retrain it under our exact splits, with the same unlabeled pretraining pool, the same labeled data, and the same hyperparameter search budget. The pretraining pool must exclude the held-out source to avoid leakage. Beating it means a higher macro AUC averaged over held-out sources, with a paired bootstrap interval over videos that excludes zero.

The second strong competitor is the hard mask of The Role of Pleura and Adipose in Lung Ultrasound AI, both unstraightened and pleura-straightened, reimplemented on the same backbone. That paper reports AUC 0.7742 for the pleural-plus-Merlin mask against 0.6553 unmasked on its single-center linear-probe cohort. For context we also report POCOVID-Net's published 92% video accuracy and 0.55 healthy-class sensitivity on its own dataset from POCOVID-Net: Automatic Detection of COVID-19 From a New Lung Ultrasound Imaging Dataset (POCUS). We do not treat it as a matched comparison.

Three ablations isolate the key ingredient. The first uses raw confidence as the weight, $w=c$. We predict this is worse than the naive reference, because it suppresses A-lines and B-lines. The second uses lateral confidence $\bar c(\theta)$ without the depth window, which tests the fat-suppression half. The third uses the depth window without lateral confidence, which tests the rib-suppression half. A fourth control swaps the random-walk map for a cheap intensity-based shadow detector. It uses the same geometry but marks a column shadowed when mean intensity in the band above the pleura falls below a threshold.

Why not just…?

Why not just trust self-attention, as MeDiVLAD does? This is the most serious threat. The 0.936 AUC in Efficient Lung Ultrasound Severity Scoring Using Dedicated Feature Extractor shows that attention alone can score well when training and test data are pooled. The fat-thickness shortcut documented in The Role of Pleura and Adipose in Lung Ultrasound AI is exactly the kind of cue that pays off inside a source and fails across sources, so a high pooled score does not settle the question. The leave-one-source-out comparison and the counterfactual swap test below will. If the unmasked model ties on held-out AUC and is equally insensitive to swapped subcutaneous content, we will report that explicit masking is unnecessary for this data.

Why not just use a hard mask, or crop to the pleura? Hard masks are brittle in the regime that matters. Gare et al. state that their Sobel-and-polynomial segmentation fails when consolidation or shadowing disrupts the pleura, and consolidation is where severe cases live. We will stratify held-out results by clinician-visible consolidation, flagged during a light review of test clips. We expect the soft mask's advantage over the hard mask to be concentrated in that stratum. If it is not, the soft mask adds cost without benefit there.

Why not just threshold image darkness to find rib shadows? A column-intensity threshold may find ribs about as well as a random-walk map, at a fraction of the cost. The intensity-detector ablation tests this directly. If it matches the confidence-map version on held-out sources, we adopt it. The contribution then becomes the pleura-referenced geometry rather than the propagation model. We would expect confidence maps to help mainly with low-gain or heavily compressed clips, where dark does not mean shadowed.

Why not just augment heavily or train with a domain-adversarial loss? Augmentation cannot synthesize vendor-level differences in beamforming and probe type. Adversarial removal of source information risks also stripping real case-mix differences between sources. We include a standard augmentation stack in all arms, so any gain must come on top of it.

Proposed Experiments

The main benchmark is COVIDx-US, described in COVIDx-US - An open-access benchmark dataset of ultrasound imaging data for AI-driven COVID-19 analytics. It mixes convex and linear probes from several vendors, drawn from four contributing platforms: The POCUS Atlas, GrepMed, Butterfly Network, and Life in the Fast Lane. Clip counts differ across versions: the dataset paper lists 150 videos, while MeDiVLAD used 177. We will fix one release and report its counts. We use its probe-specific cropping and inpainting pipeline for all arms. The primary protocol holds out one contributing source at a time, trains on the rest, and reports macro AUC and per-class sensitivity across the four diagnostic classes. The POCOVID-Net collection overlaps several of the same platforms. After deduplicating clips against COVIDx-US, it provides a second held-out check.

Class labels in these collections are clinical impressions whose thresholds vary by contributor; POCOVID-Net's 0.55 healthy-class sensitivity is one symptom. We therefore add two decisive checks that do not rely on labels. The first is a counterfactual swap. For each test clip we replace the region above the pleura, and separately the rib-shadow columns, with the corresponding regions from a clip of a different class and source. We then measure how often and how much the prediction changes. The ideal is no change, and a model reading fat or ribs will flip. The second is source decodability. We train a linear probe on frozen pooled features to predict the contributing source, and we expect lower accuracy under our weight than under uniform pooling. Lower accuracy is meaningful only if class AUC is preserved, since discarding all signal would also lower it. So the two are reported together.

The single most decisive result is the raw-confidence ablation. The physical argument predicts that $w=c$ performs worse than uniform pooling while the pleura-referenced weight performs better. Seeing both on held-out sources would support the mechanism, not just the empirical gain. Seeing neither would mean confidence maps carry no useful spatial prior for lung diagnosis.