Development of Fitbit Based Seizure Detector

OSD on Fitbit Versa

A few years ago I abandoned the Fitbit version of OpenSeizureDetector because the communications between the watch and the phone was too unreliable and it was taking too much effort to try to get it working – so I have been (and still do!) recommend a Garmin watch such as a VenuSQ if you want to use OpenSeizureDetector.

I know that Fitbit is a popular option for users for some reason and they are often disappointed when I tell them they are not suitable :).

A few days ago I received an email from a user with a Fitbit question, and was surprised that she is managing to use OpenSeizureDetector on a Versa 2 watch (her issue is that the time does not account for Daylight Savings Time / BST).

This prompted me to get my Fitbit Versa out of the drawer and have another try with it. I have made a few changes to the app so that it will run with the latest version of the Fitbit Android App, and sends data that is compatible with the Garmin seizure detector, and have published this update on the Fitbit app store.

I am still seeing reliability issues with the communications dropping out after between 10 minutes and 2 hours, so it still needs that fixing, but it is looking promising. This is because I have discovered that just opening the Fitbit Android app on the phone seems to re-synchronise the watch and the phone, and re-start the communications. If this is the solution I could have the OpenSeizureDetector app do this when it detects a fault.

If anyone has a Fitbit Versa or Versa 2 in the drawer, please will you have a try with this and feed back how it performs for you? Installation details here: https://www.openseizuredetector.org.uk/?page_id=1173.

Thanks,

Graham (graham@openseizuredetector.org.uk)

Resolved Issue with Older Garmin Watches?

We had an issue with the older Garmin Watches, such as Vivoactive HR and ForeRunner 735 crashing with V1.3.x of the Watch App.
I have just re-built the app using the latest Garmin compiler, and it seems to have resolved the issue (it runs on my Vivoactive HR now anyway) – I have called this V1.3.2 here: https://github.com/OpenSeizureDetector/Garmin_SD/releases/tag/V1.3.2.

If you have one of the older watches and had to revert to using V1.2 because of this issue, please try V1.3.2 and let me know if it has resolved the problem for you.

Thanks

Graham (graham@openseizuredetector.org.uk)

Watch Buzzing Troubles?

UPDATE 13/03/2023: This might be caused by the Garmin Connect app sending notifications to the watch from the OpenSeizureDetector phone app – open Garmin Connect and select the Settings->Notifications->App Notifications menu item, and ensure that most (if not all) apps are disabled from sending notifications to the watch.

A couple of people have been in touch recently complaining about the watch buzzing a lot when using OpenSeizureDetector, even with phone alarms switched off.

I think this is signifying a problem with the bluetooth connection between the watch and the phone – the watch will give a short buzz if it fails to send a batch of data to the phone. The phone however will only complain about not receiving data if it does not receive data for about 30 seconds (in which case it goes into a FAULT state and gives annoying fault ‘pip’ sounds).

The real solution is to investigate why there are problems with the bluetooth connection – maybe the distance between the phone and the watch, or possibly a hardware fault on either the phone or the watch itself.

A workaround is to use the special ‘ben’ build of the watch app, which does not buzz and is deliberately difficult to shutdown (to stop our Benjamin fiddling and shutting the watch app down). The latest ‘ben’ build is Version 1.2, and is available here if you want to use it: https://github.com/OpenSeizureDetector/Garmin_SD/releases/tag/v1.2

Please let me know if you have this problem though, as we could do with working out what is causing it.

Thanks, Graham (graham@openseizuredetector.org.uk)

Heart Rate Alarm Development

A query from a user has prompted me to look into the results from the Data Sharing Database of user-contributed data to see if we can make better use of the Heart Rate measurements on watches. We currently have a simple heart rate threshold alarm system which can be useful for night time monitoring, but is prone to alarm during normal daily activities when heart rate varies.

The analysis of the tonic-clonic seizure data in the database can be found here:

https://github.com/OpenSeizureDetector/Android_Pebble_SD/blob/V4.1.x/doc/Adaptive_Heart_Rate_Alarm__Assessment.pdf

We identify three different types of heart rate response to a seizure – High response, modest response and no response. Typical high and modest response heart rate plots are shown below:

The conclusion is that for some people the heart rate increases significantly enough during a seizure that an ‘adaptive threshold’ technique can give a useful additional seizure detection method in addition to motion detection. Other users though do not see a significant enough change in heart rate that if we were to set the parameters sensitive enough to detect the observed changes, we would see lots of false alarms.

We will implement this adaptive threshold heart rate algorithm into the next release of OpenSeizureDetector, as it may benefit some users.

Any comments or questions, please contact graham@openseizuredetector.org.uk

OpenSeizureDetector Reliability

Our son, Benjamin had his first ‘big’ tonic-clonic seizue for some time this morning. This was the sort that needs a few hours rest to recover afterwards – the ones he has had more recently have been smaller and he has recovered quickly.

The main OpenSeizureDetector algorithm detected it well – it woke us up just before 0400 and although I could not see any movement on his video monitor, he was having a seizure when we went to check on him – so OpenSeizureDetector did exactly what it was designed to do, which is good.

I was also running the beta test of the ‘Artificial Intelligence’ (Machine Learning) algorithm, but this did NOT detect the seizure – this is a sign that we do not have enough of these more severe seizures on the Data Sharing database to train it properly (it detects the smaller seizures well though).

I will add the data from this new seizure into the training process and see if we can get it detecting it without increasing the false alarm rate significantly.

So, if you are using the Beta test version of OpenSeizureDetector (V4.1.x), please DO NOT disable the original OpenSeizureDetector algorithm because although the machine learning version will reduce the false alarm rate significantly, I am not confident that it will detect the larger, more severe tonic-clonic seizures at the moment. This does not affect the default OpenSeizureDetector algorithm which detected this seizure very well, so should continue to be used.

The graph below shows the original algorithm going onto an ALARM state (alarmState=2) soon after the start of the seizure and generating a lot of alarms during it, which is the correct response.

OSD Algorithm Performance during ‘large’ tonic clonic seizure (Alarm State=2 is a full alarm condition)

Any questions, please let me know.

Graham (graham@openseizuredetector.org.uk).

Fixed Text Overlapping Issue on Garmin Watches

There was an issue with the newer, higher resolution watches (such as Venu 2) which meant that the text rows overlapped.

This is now fixed in V1.3 of the GarminSD watch app, which is available from Github here: https://github.com/OpenSeizureDetector/Garmin_SD/releases/tag/V1.3

Please let me know if there are any issues with this version, and whether it has fixed the issues that you reported on the newer devices.

Thanks,

Graham (graham@openseizuredetector.org.uk)

Data Sharing System Down Temporarily

I seem to have let the disk on the Data Sharing server fill up so it has crashed, sorry.

I have disabled the server temporarily while I clean out the database to delete the ‘Unknown’ data to make some more space on it – I am not keen on just buying it a bigger disk like I did last time!

I should get it back sometime over the weekend.

Graham.

V4.1.2 of OpenSeizureDetector Available for Beta Testers

A new version (V4.1.2) of OpenSeizureDetector will be available for Beta testers shortly.

The main change is that it upgrades the Artificial Intelligence (Machine Learning) seizure detection algorithm to V0.24. This version has been trained using data provided by users using the Data Sharing system and a set of ‘Normal Daily Activity’ data that we have collected in order to reduce false alarms.

The calculated performance of the new model is a seizure detection reliability of 88% with very few false alarms generated from normal daily activities – it will require further testing to check the true false alarm rate though. Technical Details are available on the OpenSeizureDatabase Github Repository.

If we can validate that the performance is as good as indicated above, this will be a very large improvement in the performance of OpenSeizureDetector.

V4.1.2 also introduces a ‘Normal Daily Activity’ (NDA) Logging feature that allows users to record all of their data to the Data Sharing systems to build up the best possible database of normal (non-seizure) activities.

If you would like to try this version of OpenSeizureDetector, please subscribe as a Beta tester here: https://play.google.com/apps/testing/uk.org.openseizuredetector.

Thanks, Graham (graham@openseizuredetector.org.uk)

V4.1.0 of OpenSeizureDetector Available for Beta Testers

Version 4.1.0 of the OpenSeizureDetector Android App is now live on Google Play store for people who have signed up to be Beta Testers.

The main change is the introduction of a Machine Learning (Artificial Intelligence) seizure detection algorithm (“CNN”). This appears to give better seizure detection performance and lower false alarm rate than the original OpenSeizureDetector Algorithm – but needs real-world testing to be sure about false alarms, and also to check that it runs ok on a variety of devices.

By default it is set to run both the original OpenSeizureDetector algorithm and the Machine Learning one – this will give the best seizure detection reliability but will not improve false alarms, as an alarm can be generated from either algorithm.

On the main screen you can see a list of the available algorithms – the ones which are not enabled will be crossed out to make it clear which ones are in use and which ones are not. This version also adds an additional menu item to the Data Sharing screen to allow you to mark all unverified events as False Alarms – please only use this if you are confident that you have not had any seizures, otherwise it will reduce the reliability of future versions as we develop the Machine Learning algorithm.

I would be grateful if users register and beta testers and try installing this version and report back on your experiences, before I make it available to everyone.

Thanks

Graham (graham@openseizuredetector.org.uk)

Machine Learning (Artificial Intelligence) Seizure Detector

Thanks to those users who have been contributing to the Data Sharing system, we have been able to develop a Machine Learning (Artificial Intelligence) based seizure detector and incorporate it into OpenSeizureDetector.

This system uses a Convolutional Neural Network (CNN) which has been trained on data provided by users that has been reported as either a genuine seizure or a false alarm. The system uses 5 seconds of accelerometer data the same as the original Seizure Detection Algorithm and calculates a probability of the data representing seizure movements. It generates warnings and alarms if the calculated probability is over 50%.

The test results of the new system are surprisingly good – it will generate alarms for 94% of the 86 seizures reported by users since we introduced the Data Sharing system (compared to 72% for the original OpenSeizureDetector algorithm). The effect on false alarm rate is more difficult to determine from the available data, but it appears to reduce false alarms by a factor of between 4 and 5. We need more real-world use of the new system to be able to really assess the false alarm rate.

We will produce a technical write-up of the system performance and test results (see here for my current notes) , but the increase in seizure detection reliability was so significant that I thought I should make this available to users early.

Does it work? One concern with these Machine Learning / Artificial Intelligence systems is always that it has been taught to recognise very specific activities as seizures, but may not detect other slightly different ones. We have tried to address this by only using 75% of the available data for training the model, and keeping back 25% (=21 seizure events) purely for testing. Therefore the achieved overall 94% detection reliability means that the system detected most of the test seizures which were not used at all in training, which gives confidence that it will work for future seizures that it has not seen before.

By default both this new CNN algorithm and the original OpenSeizureDetector algorithm are enabled by in Verson 4.1.x of the OpenSeizureDetector Android App. This is awaiting approval by Google and will then become available to users who have registered as Beta testers on Google Play Store.

At the moment I would recommend that users use both algorithms, which will increase the seizure detection reliability, but not give any improvement in false alarms (because the original algorithm will still generate alarms). But please subscribe to the Data Sharing system and mark all false alarms – this will allow us to re-train the model to reduce its false alarm rate in the future.

The main change users will see is the main app screen now contains a central section showing which agorithms are enabled (OSD, CNN, HR, O2, Fall – for the Original OpenSeizureDetector Algorithm, the new CNN Machine Learning algorithm, Heart Rate alarm, Oxygen Saturation alarm and Fall detection). There is a third horizontal bar graph which shows the calculated seizure probability – see image below.

I would be grateful if those users registered as beta testers install this version when it becomes available and feed back any issues they have. Thank you again to those users who have contributed data that have made it possible to develop this improved seizure detection system.

Graham (graham@openseizuredetector.org.uk)

The main app screen, with new central section showing which algorithms are enabled, and a third horizontal bar graph for calculated seizure probability.