If a doctor wants to know how well a cough treatment is working, it can be useful to know exactly how frequently the patient has been coughing. However, a patient's state of mind might influence the impression they have about this: whether they are happy or sad, tired or not, the patient's estimate can never be more than a rough guess.

"So a doctor will often ask their partner, 'Were they coughing all night?'," explains Lara Orlandic, of Prof. David Atienza's Embedded Systems Lab (ESL). "We want to provide the quantitative measure of how many times people actually cough per day."

In a previous paper the same team published a framework that defined a methodology for counting coughs. In a new paper to be published in , they announce an upgrade on three levels: accuracy, energy and security.

Firstly, accuracy: "There are two sensors: a kinematic sensor, that detects movement, and an audio sensor," says Lara. "If somebody near the patient coughs, but the noise is not coupled to chest movement, the cough is not counted. Similarly, if the patient laughs, so that there is movement but no cough noise, it is not counted as a cough. Our AI algorithm has been trained to distinguish between coughing and sounds that can be confused for coughing, like laughing or throat clearing."

Secondly, low energy. To be really useful, it is important that the device should be wearable, which means that it has to run on its own batteries. "We wanted to use these sensors to achieve the highest level of detection accuracy while using as little power as possible," explains Stefano Albini, also of ESL. "In order to do this, we developed an algorithm that can be run on an embedded device at optimal rates.

"As an example, the processing of audio is quite demanding on energy. We therefore instruct the device to process the audio only if the kinematic sensor can confirm that cough movement has been detected. This saves a lot of battery power."

Thirdly, security: "We collaborate with the CHUV (the University Hospital in Lausanne)," relates Lara,"but when we spoke about a networked system that collects audio data, 24 hours per day, we were told that nobody was likely to sign up for it.

"Then we explained that we could keep that information close to the source, only storing and processing it on the device itself in an edge-AI fashion. When we assured them that no sensitive audio data leaves the device, only patients' daily cough counts, then they said that people would likely volunteer."

It is easily said, but to develop such a wearable device that is truly "on the edge", that is to say, not reliant on the cloud, is quite a feat.

"We have a lot of data to process on a constrained device," elaborates Stefano, "and this is not a smartphone or a computer. It doesn't have all those processing capabilities, yet it still needs to process all those data and provide an answer, in a fixed amount of time, using as little power as possible. That was our challenge."

"We start by developing algorithms, test it on the hardware, go back to the algorithm development for fine tuning, test it on the hardware again, and so on. This structured hardware-aware development methodology allows us to take on the challenge."

Much of the hardware was provided by SenseModi, a spin-off venture started by ESL alumnus Dr. Jérôme Thevenot, a co-author of the paper. Their VersaSens device runs on the HEEPocrates platform, which is also developed by a collaboration based in ESL. In many ways this projects epitomises the work on "the Edge" that ESL has been developing for years.

"Cough-E is a great example of what can be achieved with the latest generation of smart wearable systems in the medical context," explains Prof. David Atienza. "These new embedded, small, and low-power devices use Tiny AI approaches to achieve reliable results. What is interesting in this case is the discreet way the data is collected and processed in a privacy-preserving way: biomedical sensing data is acquired only using wearables outside the hospital context and analysed on the Edge, and it does not require being connected to the Cloud to make a diagnosis using AI.

"However, when required, these new edge AI devices can include federated learning to share the coefficients of the AI models with the Cloud and improve the model among devices thanks to the help of medical personnel, but without sharing any personal information from the person using the wearable."

Which is nothing to cough at. Well, clearly in this case it is something to cough at, but you know what I mean.

Cough-E: A multimodal, privacy-preserving cough detection algorithm for the edge
Stefano Albini, Lara Orlandic, Jonathan Dan, Jérôme Thevenot, Tomas Teijeiro, Denisa Andreea Constantinescu, David Atienza
IEEE Journal of Biomedical and Health Informatics, 2025