Ask HN: Is there a way to get notified when my cat has seizures?
Right now, when I’m not home, I check him on camera to see if he’s doing ok. This can be stressful, especially when my phone has bad coverage or if Yuri is hiding.
It would be great if we could find some way to detect his movements (or sounds maybe?) when he’s having a seizure and send a push notification to my phone.
I’m an iOS developer so I could easily do the server/app part, however I have no idea about the rest. Is there some sort of gyroscope or something we could attach to his collar? Or maybe a programmable smart watch? Or anything else that could help?
I’d really appreciate any help or advice!
Some extra information:
• Here's a youtube video showing how a seizure looks: https://www.youtube.com/watch?v=PUzJebl0464 WARNING: this can be disturbing!!
• Seizures are totally random, but usually they last around 3-5 minutes. They start slowly, and at their peak the cat lies on the floor, moving legs quickly and shaking its head.
• Yuri's heart rate goes up for 10-15' until he calms down.
• I'm open to any solution and it's not a problem if it's not perfect (but I would prefer false positives over false negatives)
79 comments
[ 3.8 ms ] story [ 149 ms ] threadIt is not that big of a hassle to wear a Holter monitor for continuous ECG monitoring for a month (w/ only 3 electrodes compared to the usual 12 lead ECG you would get in the clinic) but ambulatory EEG is a bigger deal
https://www.epilepsy.com/diagnosis/eeg/ambulatory
If the OP had an infinite budget the right way to do it would be to implant an ECG detector such as
See
https://www.hopkinsmedicine.org/health/conditions-and-diseas...
This device looks like it makes EEG a lot easier
https://www.hopkinsmedicine.org/health/conditions-and-diseas...
See also
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10563901/
I know his heart rate goes up after a seizure because I can feel it with my hands when I try to calm him down. I've been reading more about the methods you mentioned in one of your comments below and it feels like a "holter" is something that could help. I can't find any commercial solution though but I'll talk to the vet about it.
You'd need more infrastructure (like Home Assistant + a Zigbee dongle, or an always-on app listening for BLE advertisements, depending on the sensor radio) but you could apply some filtering to a vibration sensor to determine a threshold for alerts.
(despite the description saying you need the Aqara hub, the sensor works with most Zigbee coordinators, and certainly the popular ones in the Home Assistant community.)
https://tractive.com/en/pd/gps-tracker-cat
My friend had a cat that had nearly the same thing. He accidently figured out what was triggering it. It was the fabric softener he was using and the cat liked to roll around on the bed.
I had a cat that was allergic to Frontline (the anti-flea stuff that you put on their shoulders). If I put a drop on her, she would start foaming at the mouth.
I found out that there's a particular insect repellent (Permethrin), that is popular, hereabouts, as it repels ticks, that many cats have sensitivity to. It can cause seizures.
The product booklet in revolution / frontline rx is actually really comprehensive and worth a read here, it goes in to the pharmacology in detail.
... In spite of all this I still do poison my cat's bugs but try to pad the dosing schedule by a week or 2 each time, it's not like the life cycle of the critical parasites is longer than that.
[0] mostly glutamate gated chloride channel activators, and mammals don't have these receptors. but mammals do have glutamate gated cation channels (AMPAs/NMDAr) and the drugs bind activate them too, just only a little tiny bit... that adds up in an overdose. What you get from excitatory glutamate channel activation is seizures.
Perhaps a continued back-and-forth jerking can be detected, but it might be quite hard to calibrate.
Another thing I can think of is an EEG implant, but idk if that exists or is even feasible, there's probably not a whole lot of research and unsupervised seizure detection is quite hard even in humans.
Either one or two sensors, first one matbe gyroscope, second one maybe electrode or similar for muscle activation (ten to a hundred times more expensive upon googling)
Some algorithm saying if the movement is squiggly enough and if the combined sensors are activityful maybe give u a text or call or push notice with higher prediction percent displayed if both active
Or just do that with the gyroscope only, display the movement graph over time and u can use your intuition on the movement pattern to see if its a false positive or not
And obviously i forgot about bodycam People even stream their cats lives with bodycams i think u should be able to see if its having a seizure as for detection idk maybe something neural detecting the same scene shaking, worst case scenario pay amazon mturk or something
If heart rate is reliable enough indicator of seizures, perhaps a heart rate monitor could be used?
Keeping anything attached to a cat is an issue though. Even as a collar it might be a bit bulky
1. build a yolo based cat detector to detect where yuri is
2. then build an action recognition on video (there are many good action recognition approaches such as videoMAE etc that could be leveraged to detect normal cat activity vs abnormal activity.
hope that helps.
The seizures in the video are very pronounced, you can’t miss them. But that’s not Yuri, it’s a different cat named Charlie. Though from the OP’s description, their cat may be similar.
https://www.aliexpress.com/w/wholesale-Bluetooth-Acceleromet...
The BT50 claims 50m distance (open) but with a 8 hours battery life, which will shrink with time. You'd need longer battery life I guess?
I think the software would be easy.... if you know what you are doing. That might be the plumber joke of knowing where to whack the pipe. I "feel" like it wouldn't be hard.
[edit] Maybe the (Holyiot) beacon tag, it has longer battery life, need to check the specs how good the accelerometer is - https://aliexpress.com/w/wholesale--beacon-tag--acceleromete...
It supports cheap smart watches like the PineTime and BangleJS (I would not recommend a Garmin device since Garmin likes to break their API). You might not be able to use the HRM due to furr being in the way but you can hopefully still use the accelerometer data to determine if Yuri is having a seizure. You might need to change thresholds for the algorithms based on accelerometer data to better match cat seizures. OSD is developeded mainly with humans as the intended sensor wearers.
I'd wager that you can quite rapidly adapt OSD to become what you need. Maybe even upstream a nice little species selector feature perhaps?
The main OSD maintainer is a rather nice fellow. I think he'd be delighted to hear that someone found OSD and had use of it.
> though it will be a step learning curve if one has never done any embedded
For someone who has not previously worked with hardware I'd suggest to buy first a cheap Arduino-compatible board like this one [1] with BLE and WiFi instead of professional hardware. Although not as efficient, calls to hardware sensors are much simpler and well documented for example here [2, 3]. For the filtering part jononor is talking about I'd suggest this chapter 10 of this book [4] complemeted with more accessible resources like this video [5] (the book is to dig deeper into the maths, but not strictly necessary).
Then once you have this you can be as fancy as you want on the server side with ML models etc, but I suspect that since the seizures are rather long (minutes) just looking at the mean frequency about 15 ~ 30 seconds could already be a pretty good indicator.
[1]: https://www.lilygo.cc/products/t-energy-s3
(This is the first board I found, but I'm sure are also other smaller boards with ESP32 or ESP8266 using a CR2032 battery like https://hackaday.com/2019/02/22/a-coin-cell-powers-this-tiny... on AliExpress / BangGood / etc.)
[2]: https://www.arduino.cc/reference/en/libraries/arduinoble/
[3]: https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx/
[4]: http://eceweb1.rutgers.edu/~orfanidi/intro2sp/orfanidis-i2sp...
http://eceweb1.rutgers.edu/~orfanidi/intro2sp/
[5]: https://www.youtube.com/watch?v=uNNNj9AZisM
I didn't know that and it's a great start. If I get something like the MOKOSmart M1 Ultra Thin Beacon Tag [1], will I be able to send accelerometer data to let's say a Raspberry Pi, process it further, and send a push notification when needed?
[1] https://www.mokosmart.com/beacon-tag/
"The Use of Triaxial Accelerometers and Machine Learning Algorithms for Behavioural Identification in Domestic Cats (Felis catus), A Validation Study" (Smit, 2023): https://www.mdpi.com/1424-8220/23/16/7165 https://figshare.com/articles/dataset/R_dataframes_of_annote...
And I found one paper on real-world detection of seizures in dogs: "Evaluation of a collar‐mounted accelerometer for detecting seizure activity in dogs" (Muñana, 2020). They conclusion was: "Generalized seizures in dogs can be detected with a collar-mounted accelerometer, but the overall sensitivity is low." https://onlinelibrary.wiley.com/doi/full/10.1111/jvim.15760 Their methodology for the model development seems generally sound. However, it does not seem like they have spent a lot of time on it, or are ML/DSP specialists. So there might be considerable room for improvement. If one could get a hold of this dataset, it might be possible to work on improving the detection method. With the goal that this would be highly transferrable to cats.
The lack of data for cat seizures is a challenge in this endeavour. However, there seems to be quite some videos of such events on Youtube. At the very least, they can be used for qualitative insights. But an idea would be to use motion tracking on the images to simulate an accelerometer, and generate a dataset from that. I have seen a paper on this kind of approach in another setting, but I cannot quite recall where to find it.
Not so much as you might think.
The approach I'd take (from airborne geophysics) is to treat the datasets as "environmental normal" and pull out tens of thousand of (overlapping) 5 minute data runs and treat those as input vectors to an SVD (Singular Value Decomposition) reduction which becomes the kernal of monitoring going forward.
Next rig up the cat in question with accelorometers and record data just as was done in the prior datasets.
Your input now is a continuous pipeline (say every 20secs) of "the last five minutes of data" as a vector - reduce each vector to kernal (spanned by the basis for the "normal" dataset) + noise (doesn't match the normal span).
There will be a regular amout of "noise"; seizures and unusual behaviour should spike the amount of noise and deserve attention.
After a bit, you'll know what you're looking for (/cough /handwave /details).
This, more or less, is how "out of band" signal is found in 256 channel radiometric spectrometer surveys - primed with a back catalog of hours of regular boring survey data and trained to look for the abnormal.
As with many projects of this nature there's very little more to say at this point in time until there's a pile of data to start wading through :)
Maybe someone will run with it.
Have you considered keeping him only in one room while you are gone, and placing many cameras in the room, as well as having a more controlled lighting set up? Then you might be able to go down the video recognition path, although I have no idea if it's even really possible. At least you have some training data (like the YouTube video you linked).
It's getting clear to me that he's got too little space to be happy and I heard his voice for the first time last night as something between a meow and a yowl which I think was him asking for a better life so I am doing everything I have to do to let him range over the rest of the house and wish I could get it done faster than I can. Video surveillance of the house though is really out of scope.
I'd wager a combination of measures may be the most effective, though not sure how easy they'd be to measure. Overall movement, heart rate, and muscle tension could probably provide a pretty accurate indicator of a seizure. Unfortunately, muscle tension is probably the most important and (I'd guess) the hardest to measure, especially through fur.
There's a decent chance that breathing and heart rate alone will be unique enough, but I'm only speculating.
Best of luck with your kitty. For what its worth, we thought we'd lose our dog years ago (many seizures per day), but have largely been able to get things under control with medication. He started at 3 years and he's now nearly 9. We really didn't expect him to get past 4 or 5, so we're very happy. Also, ironically, his medication is supposed to make him tired, but he's still border-line insane.
OP mentioned seizures usually last at least 3 minutes so there might be enough time for corrections (e.g. weird movements for 10 seconds then stopping may not warrant an alarm).
Having some amount of false positives might be desirable, at least at first, to calibrate expectations. Certainly many false positives are worth it when you consider a single false negative could be fatal.
Yes, it's possible, but it would be difficult to do on your own if only because you can't (won't ethically) induce seizures at will so testing will be hard.
My suggestion would be to try to find research into this. There are many medical devices for humans that have found use in animal applications and I'm sure that seizure detection is a well-researched field.
It may not be difficult to copy a researcher's work. You'd be surprised to learn how simple most medical devices are at their core (I've been in the field for 20 years): it's the surrounding safety and predictability requirements that tend to make them complex and expensive.
Mount a bell on your cat. Maybe more than one, with different sounds - collar, back and (if you can get him to tolerate it) a leg. Then train an ML model to recognise the sound of a seizure.
There are a few options for electronic collar-mounted platforms. But finding one that is all three of capable, lightweight enough for the cat, and has decent battery life, is difficult. We already know that bells are light enough, and they don't have a battery life problem. My guess is that ML will easily be able to detect a seizure with high accuracy, probably even with only one bell. You might need a mic in each room.
(after watching the video) It may even be enough to just detect the bell, and have a crude threshold for the proportion of time it's been ringing in the last minute or so - which will be a lot faster to gather the data for. That would be a good MVP.
No, don’t do this. Would you like to have bells mounted on you in several different places, just jingling all day with every movement? That becomes stressful for both the cat and the humans.
My anecdotal experience is that cats adapt very quickly to ignore noises that don't have consequences, even if initially they find them extremely startling. Cats also walk extremely smoothly - there are reports of cats that manage to catch prey despite being belled. Although I admit that this wouldn't likely work for a leg bell.
Anyway, if you put a bell on your cat it's probably going to be obvious if the cat hates it.
I used to interact with a large number of veterinaries, including some with an explicit interest in cat behaviour. That is the consensus I recall. Though I have no doubt that this will be a spectrum and anxious cats will be more prone to disliking the bell, but the original comment suggest multiple bells in different body parts with each new one adding to the discomfort.
As for it being annoying to the humans as well, naturally that depends entirely on yourself.
Or, you could put Yuri in a closed area with camera monitoring. Train a YOLO5 model in Yuri vision and let it monitor the area. You would have to simulate a seizure though. You could make a fabric facsimile of the animal and place it in different areas on its side. The shape of an animal in a seizure is not the same as when it's sleeping. It would be up to you to determine the difference.
https://news.ycombinator.com/item?id=26024049 https://github.com/filipsPL/cat-localizer
Wait, I thought that's the _difficult_ part! What kind of accelerometer would that be? And is there a microcontroller small and light enough for a cat?
(and thanks for your answer of course!)
I assume there must be researchers trying to do this electronically too (See - https://newsreleases.sandia.gov/seizure_sensor/ for example.). It might not be practical yet unfortunately though, and not sure if it would translate to animals.
Good luck in finding a solution though! I would assume something like an accelerometer on their collar might be able to detect shaking.
From the 2nd link:
> The worst part of epilepsy is never knowing when you’re going to have a seizure. The psychological impact of that uncertainty is overwhelming.
..which is one of the reasons I made this post.
Thanks for your input!