Seizure Detection And Prediction

This post is part of the Epilepsy Blog Relay™ which will run from March 1 through March 31, 2018. Follow along and add comments to posts that inspire you!

As the parent of a child with epilepsy, I rarely sleep through the night. Instead, I periodically wake to check in on my son. We use a wireless camera that has an app that we run on an iPad that I prop up beside our bed. I can see in to his room, even at night, and hear any activity or seizures. For the most part, it’s a good setup. But occasionally a wireless issue will cause the connection to drop. I’ll wake up facing a dark screen, wondering if I missed a seizure as I fumble in the dark to restart the app.

That scenario repeats a few times a month, which is why the news that the FDA approved the Empatica Embrace as a medical device was so exciting. The Embrace is a wearable device that detects generalized tonic-clonic seizures and sends an alert to caregivers. Devices like the Embrace will provide a piece of mind to many people with seizures and those that care for them.

Unfortunately for us, we haven’t yet found a device that can reliably detect my son’s seizures. His seizures are short and without much movement, making them harder to detect. Generally, the longer a seizure is and the more activity it generates, the more likely it will be detected. But with new sensors and smarter algorithms, these devices will continue to improve. They’ll have a higher sensitivity to detect shorter and more subtle seizures. Instead of relying on my own eyes and ears to catch every seizure, I’m hopeful that these devices will work for my son someday, too.

Since the theme this week is technology and epilepsy, I thought I would spend some time talking about the magic behind these devices.

Detection versus Prediction

Detection

First, I wanted to differentiate between detection and prediction. Devices like the Embrace focus on seizure detection. Detection figures out when a seizure is happening. The device monitors activity from embedded sensors and runs it through an algorithm. The algorithm has been trained to look for patterns that look like seizure activity. Once it is confident enough that a seizure is occurring, it will send out an alert.

Prediction

Seizure prediction tries to figure out when a seizure is likely to happen. Some people have auras or other cues that let them know that a seizure is coming. Imagine a device that could provide that same warning to everyone. This is a hard but achievable goal. The clues may be more subtle and harder to see. We may need more data or new sensors, but we’re well on our way to developing them. When we figure it out, the warning it provides cold allow a person about to have a seizure to go sit down or get to a safe area. It could alert caregivers ahead of time so that they provide help before or during the seizure.

Training an Algorithm

Both seizure detection and seizure prediction use much of the same data but for different goals. The techniques used to learn the algorithm are similar, too. Data is collected from a group of people wearing different sensors. The data includes both seizure and non-seizure activity and it’s fed in to a computer with a label such as “seizure” or ”no seizure.” The computer learns the difference between the two and creates a model that can be used to look at new data to classify it as a “seizure” or ”not a seizure.” The more examples the algorithm sees, the better it gets at identifying the common traits in the data that are associated with a seizure.

The process is similar to teaching an algorithm to identify a cat. You feed the system a bunch of examples of cats and it identifies that a cat has two eyes, to ears, a nose, and whiskers. It generalizes traits using a technique called induction. Once it generalizes the traits, it can use them to identify a cat that it has never seen before using those traits. This is called deduction.

The same approach happens with seizures. People and seizures are different. If we trained a model to look for a specific heart rate, it wouldn’t be useful because that would differ for everyone. Instead, we train a model to associate common changes that happen during a seizure. Then, when it sees the data coming in from sensors in a device, it looks for those similar markers to decide how to classify the data.

No Algorithm Is Perfect

As in the cat example, there are an infinite number of combinations of data points necessary to always get it right. We can’t practically train a model by showing it every angle of every cat that might exist. And we can’t give it data reflecting every possible seizure for every person. But we don’t have to. The magic of these algorithms is that they can do a pretty good job using subsets of the data. But that does mean they can make mistakes.

There are two types of mistakes that are the most common: false positive and false negative. In the case of seizure detection, a false positive is when the algorithm said there was a seizure but there wasn’t. A false negative would be when the algorithm didn’t think there was a seizure but there was.

These two error types present different challenges. In seizure detection, a false positive means that a caregiver might have been alerted. This can be annoying, especially if it happens too much, like The Boy Who Cried Wolf. Too many false positives means people may turn off the notification feature or stop wearing the device altogether.

In seizure detection, the false negative is a much more severe problem because it means a seizure occured but the algorithm missed it. That means no notification was sent to alert a caregiver. If that is the primary purpose for the device then it can’t be relied on and won’t be used.

Making Things Better

The good news is that algorithms can learn from their mistakes and get better. We can use the times it was right and wrong to retrain the algorithm so that it can get better. That’s what Google, Facebook, and every other company that uses data does to make their products better. A popular concept in the world of machine learning and AI products is the Virtuous Circle of AI.

We create products and give them to customers. The customers use the product and generate more data. The data is used to make the product better by making the algorithms better or adding new features. This is how Alexa gets better at understanding what you’re asking for, how Google gives you better search results, and how music and movie recommendations today are many times more accurate than even a few years ago. In the same way, as more devices like the Embrace find their way on to the market and more people use them, these products will use the data to get better, too.

NEXT UP: Be sure to check out the next post tomorrow by Joe Stevenson at epilepticman.com for more on epilepsy awareness. For the full schedule of bloggers visit livingwellwithepilepsy.com.

Don’t miss your chance to connect with bloggers on the #LivingWellChat on March 31 at 7PM ET.

Trends In Wearables For Seizure Detection And Prediction

This post is part of the Epilepsy Blog Relay™ which will run from June 1 through June 30. Follow along and add comments to posts that inspire you!

Today kicks off week 3 of the Epilepsy Blog Relay when the theme changes to Tech and Innovation in Epilepsy. As a technologist and father of a child with epilepsy, this week represents the intersection of my two worlds. I am excited to be writing this week because of the promise of technology in managing epilepsy.

The Story So Far…

More than a year ago, I found a crowdfunding campaign for a wearable device that could detect seizures. At the time, we were struggling with detecting and recording my son’s seizures. It was difficult because he had many types of seizures and we knew from EEGs that we weren’t catching every one. The seizure devices already on the market didn’t work for him. Most used accelerometers and gyroscopes to capture exaggerated arm movements or falls. But his seizures often only created subtle body movements that were not detected. This new device included other seizure markers, such as galvanic skin response. I hoped the new sensors would make the difference. Since the device showed promise, I backed it and then anxiously awaited its release.

After a long delay, the device finally shipped. When we received it, I strapped it to my son’s wrist and hoped. The next night, my son had his usual handful of seizures but the device didn’t detect any of them. Initially, I thought I had configured the device wrong or that it lost connectivity to my phone. But after a few weeks of seizures with no detection, we stopped wearing the device and put it on the shelf.

Our story is one of many similar stories of unrealized expectations. But this post is not one of failure and despair but one of hope. While the device didn’t work for us, it does work for some people. Moreover, better methods of seizure detection continue to be developed. These techniques are being included in the growing number of wearable devices on the market. Soon, we’ll have clothing and accessories capturing biometric markers that will be able to detect seizures more reliably. We’ll have data captured that we’ll be able to use to predict when a seizure will occur. And this will happen in the very near future.

Devices, Data, and Machine Learning

There are three components necessary to create a device capable of detecting and predicting seizures: devices, data, and machine learning.

Devices

The devices represent the things that are collecting data. Today, we have wearables like watches and clothing that have sensors in them. These sensors measure some attribute such as heart rate, steps, or stress level. The trend towards smaller, cheaper, and more energy-efficient sensors will continue. New sensors to measure new markers will be created. Manufacturers will be putting sensors in nearly everything they create. The result will be a wealth of information streaming from us at all times.

Data

With the proliferation of sensors, the result will be a tsunami of data. Every measurement and data point we can collect will be available in near-real time. We’ll have access to data that required equipment at a hospital to measure. We’ll also be able to correlate that data with information from the world around us. The outside temperature, what our thermostat is set to, what we ate, how much television we watched. The more things we connect and make available, the larger the pool of data we will have with which to swim in and find answers.

Machine Learning

The component that I am most excited about is machine learning. Now that we have all of this data, what do we do with it? It’s too much data coming in too fast for a human to make sense out of. So we use machine learning to try to make sense out of it for us. We can train a system using real data so that, over time, it can use what it learned to predict better than a human can. It can find patterns in data that are invisible to us and make connections that we can’t. It can figure out when the data is aligning in a way that previously resulted in a seizure and notify us. It can help adjust our behavior in a way that reduces our risk of a seizure. And it will never stop learning and will continue to make more accurate predictions.

epilepsy dad seizure data machine learning sensors devices

As depicted in the image about, machine learning isn’t the final stop. Instead, we will use the algorithms we develop to feed back into the devices. We’ll create new sensors to fill in our gaps in data. We’ll push the intelligence further down to the device to allow it to make smarter decisions closer to the person wearing it. The updates to the devices will result in more data, or better, more refined and reliable data. That, in turn, will make our predictions better. The cycle will continue to a point where many devices will be able to detect and predict seizures. It won’t be the job of one specialized device but, instead, a collaboration of things we wear everyday.

Challenges

There are challenges ahead. Securing the data and privacy are two top concerns. Battery life and powering the devices and sensors follow closely behind. These are huge problems and concerns. But just as there are trends impacting the components above, these challenges are not unique to wearables. Advancements in encryption and identify management will make their way into wearables. New battery and wireless charging technologies will keep our devices powered longer and without us thinking about it. A rising tide lifts all boats, and wearables will benefit from much of the same innovations as other technologies.

Conclusion

Even though our current experience with wearable devices to predict seizures has been disappointing, I am still optimistic. The trends in devices, data, and machine learning will continue to result in more reliable detection and prediction of seizures. In the near future, we’ll have these capabilities in everyday wearables, not just in specialized devices. The result will be a dramatic increase in peace of mind and in overall quality of life.

NEXT UP: Be sure to check out the next post tomorrow by Leila Zorzie at livingwellwithepilepsy.com for more on epilepsy awareness. For the full schedule of bloggers visit livingwellwithepilepsy.com.

Don’t miss your chance to connect with bloggers on the #LivingWellChat on June 30 at 7PM ET.

The Lonely Record – A Story Of Data In Epilepsy Diagnosis

Somewhere in a cluster of servers in windowless rooms spread around the world, there is a Great Machine. On that machine, there lives a database. In that database, there is a table, and in that table, there is a record about my son. The 1s and 0s in that record contain an anonymous listing of a six-year-old boy. Those bits and bytes also contain data of expressed genes captured during an exome sequencing.

In the same database, there are records of thousands of other children that have had their exome sequenced, too. Each individual record has at least one common attribute with all the other records…the child that the record represents has epilepsy.

The goal of the exome sequencing is to identify one of the known genetic variations that is known to cause seizures. If that happens, patients can benefit from those that came before. A potential treatment plan identified by other patients with the same genetic condition might provide a more targeted approach for the newly matched patient. It might also offer some insight in to prognosis. For better or worse, it may at least give some answers.

For the new records that are placed in to the database that are not matched to a known genetic cause, they sit unattached and alone. These records lack causation and, in their unjoined state, they also lack correlation. There are no patients that came before, no best practices or lessons learned. There is no prognosis. There are no answers.

My son’s record is that way. It rests alone in a database, somewhere in the world, on a cold, metal server in a windowless room, waiting to be called. Waiting to be joined with another record. Waiting for correlation. Because with correlation, there can be association. With association, there can be coordination. With coordination, there can be answers.

Every six months, the Great Machine tries to use new discoveries, new cases, to find patterns that were previously unseen or unknowable. It calls out to each record, looking to find those that it may bestow the gift of correlation. For most, there is no correlation, no gift, and they return to their lonely state until they are once again called upon.

Maybe someday, my son’s record will find a partner. A commonality between another record in a database. A non-uniqueness in the universe. In all likelihood, the result of a match will not produce a cause for the seizures. It may, however, start to provide correlation between cases that can be studied further.

To a lonely record, it’s at least something.