Cue Trading for Respiratory Sound Detection in Noisy, Crowded Enclosures

Microphones in a pig barn or a crowded dormitory could flag respiratory illness continuously and without touching anyone. Today's cough classifiers, however, are trained on fairly clean phone recordings, and they treat the sound as one opaque embedding. When fans, reverberation and a hundred other animals bury part of the signal, the classifier has no principled way to fall back on what survives. Linguists who study sound change already have a working account of this problem in human listeners. A speech contrast is carried by a bundle of acoustic cues, such as pitch, duration and voice quality. When context wipes out the main cue, listeners shift their reliance onto the secondary ones. In Shanghai Wu, for example, tone sandhi (pitch changes triggered by neighbouring syllables) erases pitch differences, and fricatives keep the contrast alive through consonant duration and breathiness (Contextually dependent cue weighting for a laryngeal contrast in Shanghai Wu).

This note proposes building that mechanism into a disease detector. Respiratory pathology is represented as a small set of interpretable acoustic cues taken from the phases of a cough. A gating network reads the acoustic environment and sets how much each cue is trusted. The claim is that this "cue trading" detector loses less accuracy than embedding-based detectors when an enclosure destroys specific cues, especially under kinds of degradation it never saw in training. Its learned weights also tell a farm or facility operator which part of the signal is still reliable.

Core Claim

The sound-change literature describes pathology-like signal change as re-weighting across cues, not as a single shift. Older Shengzhou Wu speakers identify checked syllables (syllables closed by a glottal stop) from the glottal closure itself, while younger speakers rely on vowel duration as that closure erodes (Age-related Differences in Acoustic Cues for the Perception of Checked Syllables in Shengzhou Wu). Younger West Central Bavarian speakers move the fortis/lenis distinction from voice onset timing to onset pitch (The emergence of obstruent-intrinsic f0 and VOT as cues to the fortis/lenis contrast in West Central Bavarian). These papers supply the conceptual model, but they do not supply training data.

The transferable lesson concerns robustness. A category survives when its cues are redundant and listeners can re-weight them depending on context. We treat the recording environment as the "context" that neutralizes cues. Steady fan hum masks low-frequency energy and the pitch of the voiced phase. Reverberation smears phase boundaries and so corrupts duration cues. Dense crowds add overlapping explosive events. The new claim is that explicit, context-conditioned cue weighting is a better inductive bias than an opaque embedding when the shift comes from the environment, and that this holds with the training augmentation held fixed.

Research Program

The detector has three parts.

The first is a bank of cue extractors defined on cough phases, following the explosive, intermediate and voiced phase decomposition of Robust Cough Feature Extraction and Classification Method for COVID-19 Cough Detection Based on Vocalization Characteristics. That paper's time-frequency differential feature (energy change between adjacent spectrogram frames) and energy-ratio feature are reused directly. We add phase durations, voiced-phase fundamental frequency, harmonic-to-noise ratio, spectral centroid and spectral flatness. The last few are among the features shown useful for separating coughs from other explosive sounds in Audio and contact microphones for cough detection. Each cue gets its own small encoder, so the cues stay separate rather than being fused early.

The second is a context estimator. It sees only the non-cough stretches of a recording and predicts the environment: noise spectrum, signal-to-noise ratio and reverberation time.

The third is a gating network that maps the context estimate to a softmax weight over cue encoders before classification. This is the computational analogue of the classification-tree finding in Shanghai Wu, where the significant predictor changes with context.

Training uses cue dropout. Degradations are sampled from a parameterized simulator of crowded enclosures, which mixes in fan and machinery noise, applies room impulse responses with long reverberation times, and overlays background explosive events. The gate therefore learns from data which cues each environment destroys.

The main build is in human respiratory audio, because that is where labelled benchmarks exist. We found no livestock respiratory audio benchmark on Lacuna. The livestock link is therefore a staged pilot: a small recording campaign in an intensive swine house with qPCR-confirmed respiratory cases. This is the setting where Seroprevalence and risk factors associated with Pseudorabies virus infection in Tibetan pigs in Tibet documents biosecurity gaps that appear as production intensifies. The pilot is reported only as a feasibility result.

Background degradation clips come from ESC-50, which Robust Cough Feature Extraction already used for pretraining. We hold out whole degradation families, for example training with fans and testing with reverberation-plus-crowd. Held-out families test whether the model generalizes or merely memorizes the augmentations.

Baselines

The naive reference point is a majority-class predictor together with an energy-threshold cough counter. The counter flags a recording as positive if its rate of high-energy transients exceeds a threshold tuned on validation data. This baseline matters because Beyond Classification: A Cough Regression Benchmark for Respiratory Acoustic Foundation Models found that frozen foundation models beat a mean predictor by only 1–8% on a clinical cohort. Gains over "nothing" cannot be assumed.

The strongest hand-engineered competitor is the vocalization-phase two-branch CNN of Robust Cough Feature Extraction. It reports an area under the ROC curve (AUC) of 0.8591 for COVID-19 detection on Coswara and 0.7423 on the external Virufy set, against a baseline of 0.6376. It is the closest competitor because it uses the same phase-based cues, but with fixed weighting.

The strongest learned competitors are CoughViT and OPERA. CoughViT (CoughViT: A Self-Supervised Vision Transformer for Cough Audio Representation Learning) is a transformer pretrained by masking spectrogram patches. It reports AUROC 73.21% on the Second DiCoVA Challenge subset of Coswara and 74.95% on COUGHVID wet-or-dry classification. OPERA-CT and OPERA-GT (Towards Open Respiratory Acoustic Foundation Models: Pretraining and Benchmarking) are respiratory foundation models that beat general audio models on 16 of 19 tasks. We probe them with the 256-unit MLP head, which beat linear probes in 23 of 30 conditions in Beyond Classification. The general-audio model M2D+RESP is included because that same paper found it reaches near-peak performance with only 50 labels. That matters when farm labels are scarce.

None of these papers reports results under enclosure-style degradation. We found no reported result on Lacuna for cough detection under controlled fan-noise or reverberation degradation, so every baseline is rerun.

Fairness rules apply to every system. All systems see identical training recordings and identical degradation-simulator samples. All systems get the same hyperparameter search budget, measured in trials on a validation split drawn only from training-family degradations. All systems use the same test splits.

Two ablations isolate the key ingredient. In the first, the gate is replaced by fixed learned cue weights, which tests whether context conditioning matters. In the second, the context estimator is fed shuffled context from another clip, which tests whether the gate uses real environmental information.

Beating the baselines has a specific meaning here. On held-out degradation families, the proposal must show higher worst-condition AUROC and a shallower AUROC-versus-SNR slope than augmented OPERA and CoughViT, with bootstrap confidence intervals that do not overlap. On clean data it must stay within two AUROC points of the best baseline.

Why not just…?

Why not just fine-tune a foundation model with heavy noise augmentation? This is the real threat. If augmented OPERA-GT matches the cue-trading model on held-out degradation families, the inductive-bias claim fails. In that case we would report the result and fall back to the interpretability contribution alone. The held-out-family design is built to settle this question. Augmentation teaches a model about the noise it sees. Explicit cue re-weighting should extend to a new degradation only if that degradation destroys cues the model has already learned to route around. We predict the gap is near zero on seen families and opens on unseen ones.

Why not just put a speech-enhancement denoiser in front of a standard classifier? Denoisers are tuned for speech and tend to suppress exactly the broadband explosive transients that carry the time-frequency differential cue. Audio and contact microphones for cough detection shows that separating coughs from throat clears and forced expirations depends on fine spectral features. We include a denoise-then-OPERA pipeline as an extra baseline under the same budget. It would win if enhancement restores the masked cues rather than erasing them.

Why not just count coughs with an energy threshold? In crowded enclosures, explosive non-cough events and overlapping animals drive false alarms. Even single-subject detection needed a two-stage network over 222 features in Audio and contact microphones for cough detection. The threshold counter is kept as the naive baseline, so its failure under crowd overlay is measured rather than assumed.

Proposed Experiments

The primary benchmark is COVID-19 detection on Coswara, the DiCoVA subset and Virufy, plus wet-or-dry classification on COUGHVID. Each is evaluated clean and under a grid of simulated enclosure conditions: SNR from 20 to −5 dB, reverberation time from 0.3 to 2 seconds, and crowd-overlay density. Metrics are AUROC per condition, worst-condition AUROC, the slope of AUROC against SNR, and calibration error.

The decisive check is a targeted cue-destruction test modelled on the Shanghai Wu neutralization result. We selectively erase one cue family at a time. Low-pass filtering removes the high-frequency transient cue. Phase-boundary smearing removes the duration cues. Pitch flattening of the voiced phase removes the fundamental-frequency cue. The proposal predicts two things. The gate should move weight onto the surviving cues in the expected direction. Performance should then degrade gracefully, as the fricatives did when pitch was neutralized. Embedding models are predicted to degrade without that structure.

If the gate's weights do not track which cue was destroyed, the mechanism is not doing what we claim, whatever the headline AUROC shows.

The livestock pilot then asks a narrower question. Does the context estimator, trained only on simulated enclosures, produce sensible cue weights on real barn audio? And do the cue scores rank qPCR-positive pens above negative pens? We will report this descriptively, with the sample size stated, not as a benchmark claim.