6 ms·
Ask HN: Is there a way to get notified when my cat has seizures?
My cat Yuri has epilepsy since birth and even if he’s on medication, he has random seizures from time to time. Generally these are not very dangerous, but sometimes they won’t stop and I need to get him to the vet as soon as possible, or else he might die.
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 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)
- PaulHoule 2y agoWould the heart rate monitor be useful on its own?
- interludead 2y agoI think heart rate spikes might not always correlate with seizures yet I think it can be the answer
- alan-hn 2y agoEEG is more useful for seizure detection, but figuring out the electrodes is the tough part
- PaulHoule 2y agoYeah, EEG is much harder than pulse detection, myography, GSR, ECG, etc. because the electrical fields from the brain are weak compared to electrical noise in the environment. It 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 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-diseases/epilepsy/intracranial-monitoring-for-epilepsy 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-diseases/epilepsy/intracranial-monitoring-for-epilepsy https://www.hopkinsmedicine.org/health/conditions-and-diseas... See also https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10563901/ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10563901/
- alan-hn 2y agoIn the lab we are able to see EEG waves when doing ABR in a non-electrically isolated environment pretty easily. I think that if the electrodes can be implanted under the skin next to the skull in a way that the animal wouldn't be trying to remove them all the time that some reasonable data can be gleaned and separated from intermittent environmental noise. We do use filters after all.
- phi161 2y agoHi, and thanks a lot for the help! 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.
- spdustin 2y agoVibration sensors usually emit X/Y/Z magnitudes, and are small enough to attach to a collar or possibly vetwrapped to a leg (if he'd tolerate that). I haven't used any of the Bluetooth LE ones, but I do use a Zigbee vibration sensor from Aqara (https://www.amazon.com/dp/B07PJT939B https://www.amazon.com/dp/B07PJT939B) 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.)
- floxy 2y agoLooks like some of the GPS trackers have activity and sleep monitoring. Probably an accelerometer. Maybe something worth looking into, contacting the manufacturer about, or hacking? https://tractive.com/en/pd/gps-tracker-cat https://tractive.com/en/pd/gps-tracker-cat
- phi161 2y agoRight, I'm already compiling a list and contacting customer support - things look better for dog owners but there are a few options for cats as well. Thanks a lot for the help!
- bheadmaster 2y ago> Yuri's heart rate goes up for 10-15' until he calms down. If heart rate is reliable enough indicator of seizures, perhaps a heart rate monitor could be used?
- wongarsu 2y agoMaybe a cheap $20 smart watch can be repurposed for that. You would need to shave the fur at one spot and fix the smart watch there. Then either use the normal smart tracker integrations or a custom firmware (e.g. there are at least two competing custom firmwares for the Colmi P8, one of them python-based). If you go with a custom firmware you also have access to the raw acceleration and gyroscope data which might be useful for detection. Keeping anything attached to a cat is an issue though. Even as a collar it might be a bit bulky
- phi161 2y agoThis is useful! Someone else mentioned PineTime which is pretty similar to the P8 and writing custom firmware in Python definitely sounds less daunting. I'll buy one since it's pretty cheap and see if Yuri can tolerate it on his collar. Thanks a lot!
- phi161 2y agoAll the solutions I found online seem pretty bulky and mostly used during surgery or for short-time monitoring. However, thanks to your comment, I found PetPace and I've already contacted them to see if their collar could help. Thanks a lot for your answer!
- interludead 2y agoYour care for Yuri is commendable, and your proactive approach to using technology to monitor his health reflects a deep love and commitment to his well-being. You can attach small motion sensors or accelerometers to Yuri's collar or harness. These devices can detect sudden movements or changes in position.
- sumtechguy 2y agoCould also use it to figure out where it is happening. 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.
- ChrisMarshallNY 2y agoCats have a lot of chemical sensitivities. 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.
- xkcd-sucks 2y agoThe systemic bug killers are fucking terrifying. They're not approved for human use, so there's some baseline concern. They're neurotoxins which are "specific" to bugs [0], but, all living things are remarkably similar and no drug is 100% specific to its target. Finally, it's formulated to persist in a body for a month, which means it's really hard to flush out an overdose!!!!!! 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.
- Frummy 2y agoMaybe some bluetooth sensor to a raspberry pi to your phone 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
- phi161 2y agoThe bodycam is a very interesting idea, but I need to find one that could possibly stream video instead of just storing it for later viewing. Adding this to my growing googling backlog :) Thanks a lot for the help!
- jnorthrop 2y agoHave you looked into Whistle (https://www.whistle.com/ https://www.whistle.com/)? It is intended for dogs but it might have the functionality you are looking for. Good luck!
- phi161 2y agoI didn't know about Whistle! Just contacted their support, asking if it would be possible to detect seizures. Thanks a lot!
- Euphorbium 2y agoCould probably attach some watch to his collar and write an app.
- phi161 2y agoYes, this sounds like a good solution - someone else mentioned the PineTime which looks very promising.
- deleted 2y ago[deleted]
- bobosha 2y agoyou could do the following, use a webcam : 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.
- 3D30497420 2y agoVideo recognition may be tough. My dog has epilepsy and some of his seizures are basically him laying very stiffly on the ground for 3 to 6 minutes with relatively minimal shaking. Yuri's seizures may be much more pronounced (I didn't watch the video...), but I'd wager physical measures will be less failure prone. Though both together may provide the best coverage.
- latexr 2y ago> Yuri's seizures may be much more pronounced (I didn't watch the video...) 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.
- phi161 2y agoThey are similar, yes, but they might happen if he's under a table or a bed which makes video tracking really difficult. Someone suggested using a bodycam and that might be an interesting solution, if I can find one that streams video instead of just storing it in an SD card.
- aaron695 2y agoSpitballing - there are Bluetooth Accelerometers - https://www.aliexpress.com/w/wholesale-Bluetooth-Accelerometer.html 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--accelerometer-.html https://aliexpress.com/w/wholesale--beacon-tag--acceleromete...
- jononor 2y agoThe WT9011 should be able to send sufficient data. Practical in that it has iOS SDK, so very familiar territory for the author. However the battery life is very bad at 8 hours, the cost of transmitting continuously the raw samples... It would be a rather simple hack to increase that by 3-4x, at the expense of added bulk. As it is a standard LiPo cell inside. Device itself is very small, and has charger integrated. I did a quick mechanical review of this device last week. Have not checked the software yet.
- phi161 2y agoVery useful links! In the end, seems like my best option is to use a BLE sensor of some sort (others mentioned vibration sensors which also look interesting). Thanks a lot for your help!
- lundstrj 2y agoYou might benefit from taking a look at https://www.openseizuredetector.org.uk/ https://www.openseizuredetector.org.uk/ 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.
- phi161 2y agoThis is amazing and very very promising. I was looking for something like PineTime but apparently my google skills weren't good enough.. Thanks a lot for the help!
- lundstrj 2y agoI personally have gotten better stability out of a BangleJS with OSD than I got with a PineTime. OSD isn't perfect but the source is open and it wasn't too difficult to build locally (you mention you are an iOS dev, and OSD is a Java Android app, I bet there are still many similarities). 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.
- deleted 2y ago[deleted]
- demondemidi 2y agoUnless you can get home instantly and actually do something about it I think you will just be antagonizing yourself and be stressed all the time. :(
- phi161 2y agoI agree, but going from polling to push notifications will give me some peace of mind :)
- jononor 2y agoThe use of accelerometer/gyro/IMU for activity tracking is quite well researched, including for animals. I found some papers on seizure detection for dogs using collar mounted accelerometer, though nothing for cat/feline. Based on the linked video, I think the phenomenona would be quite detectable. It might be that overall vibration every N seconds would be sufficient, but ideally you would have the energies at various frequency bands - like 0.5-1hz,2-4hz etc, as the near periodic motion is likely very characteristic - and easier to separate from regular activity. As mentioned you will need some sensor on the cat, and a gateway to get the data online. There is a bunch of DIY options, but it can be quite overwhelming and one can easily get stuck on seemingly minor things...
- jononor 2y agoThere exists ready made BLE beacon hardware with accelerometer, which is excellent for an application like this. Many with NRF52 and LIS2/LIS3, for example. A well documented option is RuuviTag. May others from Moko, Minew, HolyIot etc. CR2032 battery would be great for small size. However one would have to write custom firmware, as the stock firmware just extracts orientation from the accelerometer, or notifies on any movement, which is not useful in this case. Zephyr RTOS has excellent support for the typical accelerometers and NRF52 - though it will be a step learning curve if one has never done any embedded. Conceptually the firmware is simple. Initialize accelerometer, say to 20 Hz sample rate, using FIFO. Sleep for 1 seconds, wake up, fetch accelerometer data from FIFO. High pass filter the samples, compute FFT to get energy at different frequencies. Stuff the FFT coefficients into a BLE advertisement packet, send N=4 times. Go back to sleep, repeat.
- nihzm 2y agoI also think this is a better solution compared to the other suggesions. ML for audio and computer vision are both very interesting but absolutely not easy / short projects, from my limited experience it was never as straightforward as you'd expect. Reflections, inconsistent lighting conditions, echo, multipath propagation are all very unpredicatble factors that require a ton of math and signal (pre)processing to solve. Compared to this, I think one can boge together an ugly prototype to send data to a server over wifi / BLE in a few days even with close to zero electronics experience. > 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 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-esp32-dev-board/ 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/ https://www.arduino.cc/reference/en/libraries/arduinoble/ [3]: https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx/ https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx/ [4]: http://eceweb1.rutgers.edu/~orfanidi/intro2sp/orfanidis-i2sp.pdf http://eceweb1.rutgers.edu/~orfanidi/intro2sp/orfanidis-i2sp... http://eceweb1.rutgers.edu/~orfanidi/intro2sp/ http://eceweb1.rutgers.edu/~orfanidi/intro2sp/ [5]: https://www.youtube.com/watch?v=uNNNj9AZisM https://www.youtube.com/watch?v=uNNNj9AZisM
- CitrusFruits 2y agoMy thought process is that any on-cat device is going to have a lot of false positives since cats' movements can be so unpredictable. 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).
- PaulHoule 2y agoThis is funny to me because I have been gentling a feral cat lately and have it in a "cat room" which has an Amcrest camera in it. He's on the threshold of feeling ready to go down to the floor when I am around so I'll see him walking around on the floor on the computer at the main house and then hear him climb up to his shelf when he hears my footsteps. 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.
- 3D30497420 2y agoThe difference between typical movements and a seizure will probably be pretty clear with the right data. I have a dog with epilepsy and his movements during a seizure are extremely different than anything else he does. 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.
- HeyLaughingBoy 2y agoA lot of speculation in this thread! 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.
- ajb 2y agoSomeone else suggested the whistle, which looks a plausible off the shelf solution. But otherwise: 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.
- latexr 2y ago> 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. 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.
- sph 2y agoI know it would be torture to tie a bell around a cat's neck (as they are by nature a stealthy predator) but I have always wondered how cows can grow accustomed to having a loud bell around their neck at all times.
- ajb 2y agoDo you have any evidence for this, or is it from intuition? People have been putting bells on cats for generations, so if it was an issue someone probably investigated it by now . 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.
- xzXZJAsQ4 2y agoThis may not apply, but I think it's worth trying. The Keto diet was originally used to treat seizures. My cat developed seizures when she was about 1 and had them for years. Medication took care of most of it, but she still had them occasionally. I didn't go full Keto with her, but got her a different food with no grains and that helped to the point where she was able to get off medicine and still had no seizures. It's possible she aged out of the seizures too - but a diet change is an easy thing to test.
- phi161 2y agoInteresting! Do you know what caused your cat's seizures? And how did you come up with the Keto diet idea?
- xzXZJAsQ4 2y agoNo idea on the cause and no family history for her, she was from the local rescue. Keto was in the zeitgeist at the time. I had looked at it for weight loss, but in learning about it, found that it has been advocated for epilepsy well before insulin was readily available. I thought I was using a decent cat food before, but it had a bunch of grain in it, which cats obviously wouldn't eat in the wild. So it was essentially a cheap experiment that worked out. I consulted with my vet on it first and they basically said, why not give it a try?
- deleted 2y ago[deleted]
- ogou 2y agoThe most useful indicator seems to be rapid leg movement combined with no change in position. That's not typical cat criteria. Rapid legs usually mean position change (running). I would use a very small accelerometer on a front paw connected to BLE enabled microcontroller on a collar. That's the easy part. Triangulating position is harder. GPS would be too heavy, but you could use BLE signal strength from 3 different receivers around the house. I imagine someone has solved that problem before. 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.
- robotsliketea 2y agoSomeone has indeed solved this problem before! Your comment reminded me that a project triangulating a cat via BLE was posted to HN a few years ago: https://news.ycombinator.com/item?id=26024049 https://news.ycombinator.com/item?id=26024049 https://github.com/filipsPL/cat-localizer https://github.com/filipsPL/cat-localizer
- phi161 2y ago> That's the easy part 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!)
- RadixDLT 2y ago[flagged]
- deleted 2y ago[deleted]
- anfractuosity 2y agoThis sounds rather fascinating - https://www.scientificamerican.com/article/dogs-detect-the-scent-of-seizures/ https://www.scientificamerican.com/article/dogs-detect-the-s... using trained dogs to detect seizures via smell. I assume there must be researchers trying to do this electronically too (See - https://newsreleases.sandia.gov/seizure_sensor/ 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.
- phi161 2y agoThis is fascinating indeed! 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!