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.

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.

Windows, Light and Hope

The last few months have been all about change. After a long search, I found and started a new job. We sold the house that we lived in when my son was born back in Colorado. And next month, we’re leaving the apartment we landed in when we moved to Philadelphia.

This is the apartment we lived in when my son’s seizures and side effects were at their worst. The couch by the front window is where we held him for hours during his mood and behavior. I would sit on this couch and stare out the window at the street as he spat, and hit, and screamed terrible things. I would watch the people walk by, normal families with normal lives doing normal things. I wondered if that would ever be us again.

I felt like the world was watching us from the other side of that window, too. We were in full view of the passersby who could see how ill-equipped and unprepared we were for what was in front of us. They saw us sitting on the couch reacting out of fear and desperation. They saw every mistake my wife and I made dealing with our son and with each other.

The way our apartment is laid out, the window by the couch is the only source of natural light. In an otherwise dark apartment during a very dark time, there was no other place to go. So we sat in view of the world outside so that we could see it and let in whatever light we could. We traded agony and exposure for light.

But sitting on that couch and in that light also gave us hope. No matter how dark our apartment and our life got, we could see that there was more. As our son fought against us, we could close our eyes and feel the light on our face and hope.

After a seemingly endless struggle, hope won out. Our son came back to us. He was weathered, as we all were, and different, and stunted in some ways, but he was our boy. Instead of holding my son on that couch to protect him, he would sit next to me reading or playing on his tablet. Instead of me staring at the people walking by with envy or feeling judged by them, I felt like we could join them.

Eventually, we did join them. And now, we’re taking the next step in our journey. We’re not moving to a new place with a blank slate. Our son still has seizures. He still suffers from the side effects of his medicine and the damage that they and his seizures did. We’re bringing our scars with us. But we’re bringing his progress, too. We’re bringing the lessons we learned and the closeness we feel from having survived it. And we’re moving into a place that is full of windows, and light, and hope.