HACKER Q&A
📣 phi161

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 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)


  👤 jononor Accepted Answer ✓
The 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...

👤 ajb
Someone 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.


👤 spdustin
Vibration 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)

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.)


👤 lundstrj
You might benefit from taking a look at 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.


👤 ogou
The 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.


👤 jnorthrop
Have you looked into Whistle (https://www.whistle.com/)? It is intended for dogs but it might have the functionality you are looking for. Good luck!

👤 bheadmaster
> 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?


👤 CitrusFruits
My 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).


👤 demondemidi
Unless 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. :(

👤 interludead
Your 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.

👤 floxy
Looks 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


👤 Frummy
Maybe 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


👤 anfractuosity
This sounds rather fascinating - 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/ 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.


👤 HeyLaughingBoy
A 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.


👤 PaulHoule
Would the heart rate monitor be useful on its own?

👤 bobosha
you 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.


👤 Euphorbium
Could probably attach some watch to his collar and write an app.

👤 xzXZJAsQ4
This 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.

👤 aaron695
Spitballing - there are Bluetooth Accelerometers -

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...