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.

Neverland

Early in the morning, my son had a seizure. As his body tensed and contorted, his lungs expelled air through his vocal chords. The sound it made traveled between the open door of our rooms and woke me up.

I pulled off my covers and made my way into his room. He had sat up, but he was already making his way back on to his pillow. Standing at the head of his bed, I reached my hand through the slats and stroked the top of his head. I whispered to him that he was going to be okay and that he should go back to sleep. He eventually did, so I returned to bed.

I checked the clock. There might have been enough time for me to fall back to sleep, but it was also close to the time that I needed to wake up. While I pondered what to do, I stared at the screen of our monitor. My son was asleep, with a blanket draped over him and his two fingers that he still sucks in his mouth.

My restless, exhausted brain started to drift. Someday, I thought, he’s going to grow up. Instead of the sound of a child, I will hear the deeper sound of a young man echoing through the hall. I shuddered at the eventuality and gave up on the idea of going back to sleep.

I started to think about what else was going to change but stopped myself. I see the boy on the monitor and can’t think of him being anything else. If I knew where Neverland was, I would take him there so that he would never have to grow up.

In Neverland, he could stay the boy who sleeps in our bed when he is sad or afraid. The boy who sits on my lap when he needs to be held. The boy who looks at the world with wonder and compassion. The boy who doesn’t feel the pressure of the adult world. The boy we can shield from how ugly that world can be.

I want to keep him at this age because it’s only going to get harder for him. He’s going to start questioning his value and his worth. His gentle soul and open, hopeful, dreaming nature will be tested, as will his belief in magic and possibility. I don’t want him to ever doubt that he can fly because the moment he does, he will cease to be able to do it.

I know that instead of wishing for him to not grow up, my responsibility is in preparing him for the world. Instead of trying to keep him young forever, my job is to help him grow in a way that encourages the magic inside him. Instead of losing it, it will be what helps him believe that he will always be able to fly. But I thought we would have more time before the real world penetrated our existence. Maybe I thought it would never happen.

When Peter invites Wendy to forget everything and join him to live in Neverland and to never grow up, Wendy answers “Never is an awfully long time.”

I stared at the monitor and thought that “never” was not nearly long enough.

It Can Always Get Worse

We finally got a second opinion. Not because we didn’t think the doctors at our hospital were doing everything they could. But because that’s what responsible parents do.

I wasn’t expecting a miracle. I wasn’t expecting someone to tell us we missed something that would cure my son’s epilepsy. We were looking for another perspective or treatment that we missed. We hoped that someone out there had another case like ours and could provide some insight. We wanted a little more hope. We wanted a little more of something to hold on to.

The hospital sent the report to my wife. That night, she tried to tell me what it said, but I didn’t let it in. I nodded as she spoke the words but I put my guard up and those words bounced off me and fell to the floor. For the rest of the night, I stepped over them as I distracted myself with other things until it was time to go to bed. But I didn’t sleep.

The next day, I started to feel the effects of the night before. Not only the report but how I reacted. How I tried to ignore it to make it less real. How not facing it doesn’t make it go away. And how I left my wife holding that emotional weight by herself.

When I got home from work, I hugged her and apologized for leaving her stranded. I asked her to send me the report, and I read the pages of detailed notes that the doctor had put together. It was a thorough summary of the last three years of our lives. It included confirmation that our doctors are doing the right things and that there wasn’t anything we missed. Then, towards the end, I saw what I didn’t want to see the night before.

What should we expect in the short and long term? Is there any other information you feel would be helpful for us to know?

I do worry that his clinical picture has raised suspicion for a myoclonic epilepsy that may be progressive, in which case, continued difficulty in treatment and learning decline can be seen.

It wasn’t the first time we heard that. We’re three years in without seizure freedom, and it’s feeling like a more elusive goal every day. Our doctors alluded to the possibility but kept us focused on stabilizing what we can now. The near-term goals were a welcome distraction from the long-term possibilities. But I also don’t think about it getting worse because I can’t think of anything worse than what is happening to him now.

That night I laid next to my son as I put him to bed. I told him that I loved him. That I would always be there. That I was sorry that his life was so hard. I was trying to communicate my feelings to him. But he’s eight and doesn’t understand the words we use to express those very big feelings.

Somedays, neither do I.

But I feel the need to get them out and hope that he will someday be able to understand. I worry that there will be a window between now and if things get worse where he is able to grasp the meaning in my words. I don’t want to miss that window. Even if it only cracks a little, I want to get something through. Because if things do get worse, I need to know that he will have something to hold on to.