Google Summer of Code blog post V

Dipankar Niranjan
Aug 9, 2017 · 2 min read

So this is a continuation of the IVth blog post. The work as I’d mentioned earlier was about detecting anomalies in the respiration data. By the end of the second evaluation period, I was done with the tidal volume and the minute ventilation anomaly detections. I was left with detecting anomalies from the respiratory waveforms (A rule based classifier-the image was attached in the earlier blog post)

Respiratory data from the thoracic lead

We had two leads-thoracic and abdominal. The thoracic lead yielded better data than the abdominal one — being closer to the lungs. We thankfully also had inspiration and expiration detections (calculated using the ponderated sum of the thoracic and the abdominal leads) and also the breathing rate data along with the quality indicators.

As you can see from the figure, the mean of the signal itself varies. So it wouldn’t make sense to have hard rules for the entire signal based on the mean (center) of the whole signal. The first thing to do was online segmentation of the signal into windows with a relatively similar center-line. A non trivial task.

After getting the current window, I had to go through a lot of plots to see what rules to set-what were the high boundaries and what were the low thresholds. The classification was something as follows — if there is an inspiration or an expiration which varies by more than a certain percentage from the previous corresponding inspiration or expiration from the same window, then collect three to four further datapoints and see if the trend continues — whether they are similar to this first anomalous inspiration/expiration. If they aren’t continue with the next datapoint.

But if they indeed are similar, then collect the relevant breathing rates and breathing rate statuses (which are data quality measures) Use a combination of inspiration and expiration data and breathing rate data to classify the smaller window into one of the waveforms from the figure in the earlier blog post. Then increment the counter to the datapoint just after this smaller window.

This method seemed to be performing well and served the purpose. The main thing was that there was a lot of trial and error and graph observations to get the classification and detection right. It also helped to have inspiration and expiration detections as a given (Thanks Hexoskin!) because otherwise, detecting inspirations and expirations would itself be a task in its entirety. We could even use these datapoints to detect pauses in the respiration (which of course are anomalies) and prolonged expirations (another anomaly) With this, the respiration based anomaly detection is finally done. Next up, it’ll mostly be sleep related anomaly detection. That’s all for now.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade