Skip to content

Classifying Cough and Respiratory Sounds From Audio

10 min read · updated August 11, 2026

Cough and respiratory sound classification is an active research area with a well-documented history of results that did not replicate. This page describes how these systems are built and how they are evaluated. It is not medical advice, and nothing here should be read as suggesting that an audio model can diagnose a condition.

Models of this kind are research instruments. A system intended to inform clinical decisions is a regulated medical device in most jurisdictions and requires prospective clinical validation and regulatory clearance before it may be used that way. Interpretation of respiratory sounds belongs to qualified clinicians, and no model described here substitutes for that.

What the model actually consumes

The pipeline is the standard audio-event one, with one preliminary stage that is specific and consequential: segmentation. A recording from a phone contains speech, silence, room noise and some number of cough events, and the classifier must operate on the events rather than the recording. Segmentation is usually energy-based — a short-time RMS or onset threshold isolating bursts — with a duration filter, since a cough is typically a few hundred milliseconds and a burst of 20 ms is not one.

After segmentation, each event becomes a log-mel spectrogram or a set of MFCCs. A cough is broadband and transient, with an explosive phase followed by an intermediate and sometimes a voiced phase; the features that carry information are the shape of that envelope over time and the distribution of energy across frequency. Wheeze and crackle detection in auscultation recordings is a related but distinct task with different characteristics — a wheeze is a sustained narrowband tone, a crackle is a very short broadband click — and the window length that resolves one is wrong for the other.

Aggregation is the second consequential decision. A per-event score must become a per-recording or per-subject score, and the choices (mean, max, or a learned attention over events) have the same properties as the pooling decisions in multi-label audio tagging. Max over events makes the whole recording positive if any single event is scored high, which at a per-event false-positive rate of 5% and ten events gives a 1 − 0.95¹⁰ = 40% chance of a positive recording from a subject with no positive events at all. That multiplication is one of the most common sources of an inexplicably high false-positive rate.

The datasets and what their labels mean

The largest public corpus is COUGHVID, described by Orlandic, Teijeiro and Atienza in Scientific Data in 2021. It contains more than 25,000 crowdsourced cough recordings from around the world, of which 1,155 came from participants claiming to have COVID-19, and more than 2,800 were labelled by four experienced physicians for diagnosis, severity, and the presence of audible anomalies such as dyspnoea, wheezing and nasal congestion.

The distinction between those two label sources is the single most important thing to understand about this literature. The COVID-19 status attached to the bulk of the recordings is self-reported by the uploader, unverified by a test result. A model trained against it is learning to predict a self-report, and its reported accuracy is an accuracy against that self-report, not against a confirmed diagnosis. The expert-labelled subset is a different and much stronger kind of label — but it describes audible properties of the cough, which is a different target again.

Auscultation datasets such as the ICBHI respiratory sound database have the opposite profile: labels applied by clinicians against recordings made with electronic stethoscopes at defined chest positions, but far fewer subjects and a strong dependence on the recording device. Neither profile is better; they fail differently, and a model that transfers between them is unusual.

Shortcut learning is the default outcome

The reason so many strong published results in this area did not hold up is that the datasets almost always contain a signal that separates the classes and has nothing to do with physiology. This is not carelessness; it takes deliberate design to avoid.

  • Device and channel. If positive cases were collected at a clinic on one device and negatives were collected through a web form on assorted phones, the microphone response separates the classes perfectly. The model learns the microphone.
  • Room and background. Clinic acoustics differ from home acoustics. Reverberation time is a strong, stable, learnable feature that is entirely about where the recording was made.
  • Forced against spontaneous coughs. A participant asked to cough on cue produces something acoustically different from a spontaneous cough. If one arm of the study was prompted and the other was not, that difference is the classifier.
  • Silence and framing. Different collection protocols produce different amounts of leading silence and different normalisation. Models have been shown to key on such artefacts, and a model that scores well on trimmed audio and poorly on untrimmed audio is telling you which one it used.
  • Subject leakage. Multiple cough events from one person, split randomly, put the same person in train and test. The model recognises the person. Splits must be subject-wise, without exception.

The false-positive arithmetic

Suppose a model reports 90% sensitivity and 70% specificity — figures assumed here purely to work the arithmetic, not taken from any published system. Apply it as a screening tool to 10,000 people among whom the condition’s prevalence is 2%.

Assumptions (all three are inputs you must supply yourself):
  population    10,000
  prevalence         2%   -> 200 with, 9,800 without
  sensitivity       90%   -> P(positive | with)
  specificity       70%   -> P(negative | without)

True positives   = 200   * 0.90 = 180
False negatives  = 200   * 0.10 =  20
False positives  = 9,800 * 0.30 = 2,940
True negatives   = 9,800 * 0.70 = 6,860

Positive predictive value = 180 / (180 + 2,940)
                          = 180 / 3,120 = 5.8%

Negative predictive value = 6,860 / (6,860 + 20)
                          = 6,860 / 6,880 = 99.7%

At 0.2% prevalence, holding sensitivity and specificity fixed:
  TP = 20 * 0.90 = 18 ;  FP = 9,980 * 0.30 = 2,994
  PPV = 18 / 3,012 = 0.6%

Ninety-four of every hundred people the model flags do not have the condition, and at a tenfold lower prevalence that becomes more than ninety-nine in a hundred. Nothing is wrong with the model; this is Bayes’ rule, and it is why sensitivity and specificity quoted without a prevalence tell you almost nothing about whether a screening tool is useful. It is also why the negative predictive value is the only genuinely strong number here, and why triage applications are discussed in terms of ruling out rather than ruling in.

Work this calculation for your own intended deployment prevalence before anything else. If 2,940 false alarms per 10,000 screened is operationally unacceptable, no amount of model improvement at fixed specificity fixes it, and the specificity you would need is often implausible.

What validation has to look like

The methodological requirements that distinguish a credible result in this area from one that will not replicate are well established and largely independent of the modelling.

  • Subject-wise splits, stated explicitly. Not recording-wise, not event-wise. A paper that does not say which it used has not told you its most important methodological fact.
  • External validation on a separately collected cohort. A held-out split of the same collection shares every channel characteristic with the training data and cannot detect the shortcuts above. Only a cohort collected elsewhere, by other people, on other devices can.
  • Prospective collection where the outcome is the endpoint. Retrospective data reflects who was tested and why, which is itself a selection process correlated with symptoms.
  • Reference standard stated. A confirmed laboratory result, a clinician’s assessment and a self-report are three different targets. Performance against one says nothing about performance against another.
  • Subgroup reporting. Sensitivity and specificity by age, sex, comorbidity and device. A model with acceptable aggregate numbers can be materially worse for a subgroup, and aggregate reporting conceals that by construction.
  • Regulatory pathway acknowledged. If the intended use informs a clinical decision, the applicable medical device regime applies. That is a matter for regulatory and clinical expertise, not a modelling detail, and it should be established before deployment rather than after.

The tractable, defensible version of this work is usually narrower than the headline: detecting that a cough occurred, counting coughs over time, or characterising audible properties an expert has labelled — tasks where the ground truth is acoustic rather than diagnostic. Those are genuinely useful, they are evaluable with the methods in audio tagging and sound event detection, and they do not require a claim the data cannot support.