Scan-Line Attention Anchored to the Pleura for Lung Ultrasound Scoring

Deep networks that score lung ultrasound frames for COVID-19 severity often cheat. They read the thickness of the fat and muscle above the lung, which tracks patient body habitus and correlates with risk, instead of the lung artifacts that clinicians actually score. The best current fix is to cut that tissue away with an edge detector and straighten the pleural line, the bright membrane at the lung surface. That fix raises AUC substantially, but it breaks in exactly the patients who matter most, those whose pleural line is fragmented by severe disease. We propose a different fix that follows the physics of the scan. An ultrasound image is built from beams fired from the probe, so every pixel belongs to one scan line. Along each scan line, the signal above the pleura is superficial tissue. The signal below the pleura is a pattern of lung artifacts whose geometry is fixed by the pleural depth: horizontal A-lines repeat at integer multiples of that depth, and vertical B-lines run from the pleura to the bottom of the screen.

The model works in scan-line coordinates. It estimates, per scan line and with an uncertainty, where the pleura is. It then applies attention along each line, measured in units of that line's own pleural depth. Above the pleura it softly suppresses features. Below it, attention windows sit at one, two and three pleural depths to match A-line reverberation, alongside a long window for B-lines. In two sentences: resample the ultrasound fan into beam coordinates, find the pleura on each beam softly rather than with a brittle hard mask, and let attention look only where lung artifacts physically appear, at depths set by the pleura. The claim is that this removes the fat-thickness shortcut, which hard masking also does, while staying robust where the pleura is broken, which hard masking does not.

Core Claim

Directional structure in lung ultrasound is defined by the acoustic beam and the pleural depth. The screen's Cartesian axes do not define it. A model built around that structure can separate lung signal from superficial tissue without a hard mask. We make three testable predictions. The first is severity-scoring AUC at least matching hard pleural masking on frames with an intact pleura. The second is a clearly smaller drop on frames with a consolidated or fragmented pleura. The third is predictions that are measurably less sensitive to superficial tissue, tested by swapping the tissue above the pleura between patients.

Relation to Prior Work

The motivating evidence comes from The Role of Pleura and Adipose in Lung Ultrasound AI. That study shows a network trained on full high-frequency linear-probe frames relies on subcutaneous fat. Masking to the pleural line plus the region below it raises AUC from 0.6553 to 0.7742, and straightening gives 0.7642. Its pleura detector is Sobel filtering plus polynomial fitting, and its backbone is an isotropic ResNet-18. We keep its insight that the pleura is the right anatomical reference. We replace the hard mask and the global warp with a per-scan-line soft estimate that can tolerate gaps. Two other works constrain the design. Mask-weighted global average pooling for CT triage applies an anatomical prior only at the final pooling layer, so earlier layers still process background. SDFN shows that context outside the organ carries signal on chest X-ray: late fusion reaches mean AUC 0.815, against 0.804 for the full image and 0.807 for the crop. Both push us toward a gate that acts throughout the network and is soft rather than binary.

Our method comes from directional attention. DwinFormer breaks attention into sequential one-dimensional passes along the horizontal, vertical and depth axes. It beats nnFormer on Synapse CT, with a DSC of 87.38% versus 86.57% and an HD95 of 8.68 versus 10.63. Its axes are those of the image grid, and a curvilinear probe's radial beams do not follow that grid. DPSDA-Net and AEDNet use axis-aligned strip or 2×2 asymmetric kernels with dilated multi-branch attention for roads and infrared targets. Their dilation rates are fixed hyperparameters. Ours are set per scan line by the estimated pleural depth, which is what makes the multi-scale component physically meaningful here. Semi-LAR handles radial lens-flare streaks with a directional module, which confirms that radial artifacts benefit from direction-aware operators. It works on photographs and does not transfer as-is.

The strongest learned competitor is MeDiVLAD. It fine-tunes a self-supervised ViT-S/8 with dual-level VLAD pooling on COVIDx-US plus CoCross curvilinear videos and reports ROC-AUC 0.936. It has no anatomical prior. We ask whether its accuracy survives disrupted pleura and superficial-tissue swaps.

Research Program

The first step is geometry. Curvilinear frames are resampled from the fan into a grid of rows by beam angle. Probe apex and fan angle are estimated once per video from the fan's outer edge. Linear-probe frames are already in this form, with vertical beams.

The second step is a light head that predicts a distribution over pleural depth for each scan line. It is trained on a small set of hand-annotated pleural traces plus the automatic traces from the Gare et al. pipeline where that pipeline is confident. A smoothness penalty across neighbouring lines lets gaps be bridged. Where the distribution is broad, as at a consolidation, the downstream gate widens instead of cutting.

The third step is attention. For each line with pleural depth $d$, features are indexed by normalized depth $u = z/d$, where $z$ is depth along the line. A soft gate $g(u) = \sigma(\alpha(u - 1))$ attenuates features above the pleura. Here $\sigma$ is the logistic function and $\alpha$ is a sharpness that shrinks with the line's depth uncertainty. Below the pleura, three kinds of attention run inside a ResNet-18 or small ViT backbone. Local attention covers the pleural line texture. Dilated attention in the depth direction queries $u \in \{1, 2, 3\}$, where A-line reverberations sit. Full-length attention down each line captures B-lines. A cross-line attention step then aggregates across the lateral axis. The gate is applied at every stage, not only at pooling.

There is a real tension here. The pleural depth $d$ is the subcutaneous tissue thickness, which is the very shortcut we want to remove. We therefore stop gradients through $d$ into the classifier. We give the classifier only normalized coordinates, never $d$ itself. After training, we test a linear probe that tries to read $d$ from the pooled features. If the probe succeeds well above a matched baseline, the design has leaked the shortcut and we report that.

Baselines

The naive reference is the full-frame isotropic network used by Gare et al., a temporal-shift ResNet-18. It reports AUC 0.6553, accuracy 0.4565 and F1 0.4381 on their high-frequency linear-probe dataset. We rerun it on every dataset we use.

The strongest anatomical competitor is Gare et al.'s hard pleural-plus-below mask, with and without straightening, which reports AUC 0.7742 and 0.7642. We add a stronger version of it. There, a learned segmenter trained on the same pleural annotations as our depth head produces the hard mask. That removes the objection that only the Sobel pipeline is brittle. We found no reported result on Lacuna for a learned-segmenter hard mask in lung ultrasound.

A soft pooling baseline follows the CT mask-weighted pooling design. It applies the predicted pleural gate only before global pooling. This isolates whether gating throughout the network matters.

A directional-attention baseline uses DwinFormer-style axial attention on the Cartesian image. We also run a variant in scan-line space with fixed dilations. This isolates the pleura-anchored dilation.

The strongest overall competitor is MeDiVLAD, reported at ROC-AUC 0.936 and video accuracy 82.60% on COVIDx-US plus CoCross. We reimplement it on our splits.

For fairness, all methods share the same patient-level splits, backbone size within 10% in parameters, pretraining source, a fixed hyperparameter search of 20 trials each, and the same pleural annotations wherever a method can use them.

Ablations remove, one at a time, the scan-line resampling, the soft gate (replaced by a hard threshold), the uncertainty-dependent sharpness, and the pleura-anchored dilation.

Beating the anatomical baselines means matching them within confidence intervals on intact-pleura frames and exceeding them on disrupted-pleura frames. Beating MeDiVLAD means matching its overall AUC while showing clearly lower sensitivity to swapped superficial tissue.

Why not just…?

Why not just use a good learned segmenter and hard-mask the tissue above the pleura? This is the most serious threat. On mild cases it may do as well as our method. The weakness predicted by Gare et al. is that a hard mask removes lesion signal wherever the pleura boundary is wrong, and a better segmenter reduces but does not remove that risk on consolidations. Our severity-stratified evaluation settles it directly. If the learned hard mask loses no more than our method on disrupted-pleura frames, the soft gate is unnecessary, and we would report that the contribution reduces to scan-line attention.

Why not just fine-tune a strong self-supervised ViT, as MeDiVLAD does? Its 0.936 AUC shows raw accuracy is not the bottleneck on curated curvilinear data. Accuracy alone does not reveal shortcut use, however. Gare et al. and the weakly supervised contrastive study both found, via Grad-CAM, that well-performing models attend to superficial tissue. In the contrastive study, frame AUC moved only from 0.898 to 0.903. The superficial-tissue swap test tells us whether MeDiVLAD's accuracy depends on non-lung tissue. If it does not, our argument weakens to robustness on disrupted pleura alone.

Why not just straighten the pleura and run standard axial attention? Straightening followed by DwinFormer-style attention approximates our geometry when the pleura is detected cleanly. It inherits the brittleness of the global polynomial fit, though, and it uses fixed dilations. The Cartesian-versus-scan-line and fixed-versus-anchored ablations measure what each piece adds. If straightening plus axial attention matches us, the pleura-anchored dilation claim fails.

Why not just augment away the shortcut? Fat thickness is a physiological correlate of risk, not a nuisance texture. Gare et al.'s unmasked model at 0.6553 AUC shows standard training does not escape it. Still, we include one augmentation baseline that randomly rescales and swaps the region above the pleura during training. This is a cheap targeted intervention that could close much of the gap, and it deserves a fair test.

Proposed Experiments

We use three data sources. The first is COVIDx-US, which is open, spans convex and linear probes, and has had its interface overlays removed by inpainting. The second is the COVIDx-US plus CoCross four-level severity annotations used by MeDiVLAD. The third is the POCOVID videos used in the contrastive severity study, where frame AUC for cross-entropy training is 0.898 and for contrastive training 0.903. We also seek access to Gare et al.'s high-frequency linear-probe cohort so that their hard-mask numbers can be compared directly. Primary metrics are frame- and video-level ROC-AUC, accuracy and macro-F1 on four-level severity, with patient-level bootstrap confidence intervals.

The first decisive check is severity-stratified robustness. Frames are labeled intact or disrupted pleura by a reader blind to model outputs. We report the AUC drop from intact to disrupted for every method, and our claim requires the smallest drop.

The second is the superficial-tissue swap. In scan-line space, we replace everything above the pleura with the corresponding region from a random patient of a different severity. We measure how much predicted severity changes and the partial correlation between prediction and subcutaneous thickness given the true label. Our claim requires both to be near zero and lower than for the full-frame baseline and MeDiVLAD.

The third is the leakage probe on pleural depth described above.

The fourth is cross-probe transfer: train on convex frames and test on linear-probe frames. Scan-line coordinates should make this transfer easier than Cartesian attention does.

The approach fails if a learned hard mask matches it on disrupted frames, and fails on the anchored-dilation claim if fixed dilations match it. In either case we would report the simpler method as sufficient.