luc-vocab / gc

Grind Control device
15 stars 6 forks source link

Building a lightweight classifier for detecting clenching #1

Open machow opened 8 years ago

machow commented 8 years ago

Hey, I'm building a grinding control device with a photon and similar components. I was thinking of trying initially to run it using the code here (it looks like you already have working firmware, server, and an extremely well fleshed out angular frontend!).

I couldn't find in the code where you detect clenches. Is that done on the server, or on the device? I was planning on building a lightweight classifier to detect clenching and thought it could be useful to join forces. If you have data (raw or smoothed) and timestamps for when you are clenching, then I'd be happy to try a few different classifiers. It seems like good training data could be made by mixing up some blocks where every N seconds you either clench briefly or relax. So it might look like,

0 seconds (relaxed) 10 seconds (clench briefly) 20 seconds (clench briefly) 30 seconds (relaxed) etc..

Data that would be useful as a next step wouldn't have events at set intervals, but I'm happy to work on whatever is available. I'll fit classifiers initially in R or python, but can write a working version in javascript or c++ if it's useful.

Edit: Oh, I noticed on the arduino you do it on the device using a threshold--does that work pretty well?

luc-vocab commented 8 years ago

Hey first off, please join the bruxhackers@googlegroups.com mailing list, we discuss stuff like that on there.

My plan is to build a device that logs to an influx DB instance initially. This will allow us to visualize EMG activity using the Grafana front-end. At this point I haven't yet tackled detection or alarms. This will come later. I did add something called "bruxism score" to the front end but that's about it for now.

In terms of hardware, I have a pretty good idea of what the final solution looks like. I hired a PCB designer and we submitted version 1 for manufacturing. What hardware do you use? This is what my solution is going to look like: https://github.com/lucwastiaux/gc/blob/dev/gc2_specs/SPECS.md

All of this is going to be open source so you could just reuse it, or I could sell you a board.

I'll have data as soon as I can wear my prototype. It all hinges on whether the PCB works correctly. The data's going to be in Influx DB, so we can use the querying language there, but eventually the device itself will have to start detecting clenching, to implement a biofeedback mechanism.

Ultimately my goal is to build a hackable platform so that people like you could experiment with their own algo and see what works.

Let's have a call if you're interested in discussing more.

On January 7, 2016 11:31:16 AM EST, Michael Chow notifications@github.com wrote:

Hey, I'm building a grinding control device with a photon and similar components. I was thinking of trying initially to run it using the code here (it looks like you already have working firmware, server, and an extremely well fleshed out angular frontend!).

I couldn't find in the code where you detect clenches. Is that done on the server, or on the device? I was planning on building a lightweight classifier to detect clenching and thought it could be useful to join forces. If you have data (raw or smoothed) and timestamps for when you are clenching, then I'd be happy to try a few different classifiers. It seems like good training data could be made by mixing up some blocks where every N seconds you either clench briefly or relax. So it might look like,

0 seconds (relaxed) 10 seconds (clench briefly) 20 seconds (clench briefly) 30 seconds (relaxed) etc..

Data that would be useful after this wouldn't have events at set intervals, but I'm happy to work on whatever is available. I'll fit classifiers initially in R or python, but can write a working version in javascript or c++ if it's useful.


Reply to this email directly or view it on GitHub: https://github.com/lucwastiaux/gc/issues/1

Luc - +852 9384 3042

machow commented 8 years ago

Great! Applied to the group.

I saw that the server looked like it was built for multiple users, and wondered what was going on there. That you're planning on manufacturing something and have a website (sleeptrack.io?) makes a lot more sense to me!

I'm using the version of the photon with headers, with the battery shield, and have ordered the most recent myoware muscle sensor (it's on backorder for another week or two). My hardware skills are lamentable, so I was planning to flag down some electrical engineering grad student friends to sanity check things.

I'm much more familiar with the software / statistical side of things, though, so was hoping to set up the server in the meantime. My gmail is on my github profile, and I'm happy to pass along my phone number or skype info if you get in touch there.

luc-vocab commented 8 years ago

Approved your request to join the ML, if you don't mind can you send an intro email describing your project? Also the archives might be interesting to read.

On January 7, 2016 11:31:16 AM EST, Michael Chow notifications@github.com wrote:

Hey, I'm building a grinding control device with a photon and similar components. I was thinking of trying initially to run it using the code here (it looks like you already have working firmware, server, and an extremely well fleshed out angular frontend!).

I couldn't find in the code where you detect clenches. Is that done on the server, or on the device? I was planning on building a lightweight classifier to detect clenching and thought it could be useful to join forces. If you have data (raw or smoothed) and timestamps for when you are clenching, then I'd be happy to try a few different classifiers. It seems like good training data could be made by mixing up some blocks where every N seconds you either clench briefly or relax. So it might look like,

0 seconds (relaxed) 10 seconds (clench briefly) 20 seconds (clench briefly) 30 seconds (relaxed) etc..

Data that would be useful after this wouldn't have events at set intervals, but I'm happy to work on whatever is available. I'll fit classifiers initially in R or python, but can write a working version in javascript or c++ if it's useful.


Reply to this email directly or view it on GitHub: https://github.com/lucwastiaux/gc/issues/1

Luc - +852 9384 3042

luc-vocab commented 8 years ago

Do you have a bit of time now? If so send over your Skype ID and I can give you a brief call.

On January 7, 2016 1:18:57 PM EST, Michael Chow notifications@github.com wrote:

Great! Applied to the group.

I saw that the server looked like it was built for multiple users, and wondered what was going on there. That you're planning on manufacturing something and have a website (sleeptrack.io?) makes a lot more sense to me!

I'm using the version of the photon with headers, with the battery shield, and have ordered the most recent myoware muscle sensor (it's on backorder for another week or two). My hardware skills are lamentable, so I was planning to flag down some electrical engineering grad student friends to sanity check things.

I'm much more familiar with the software / statistical side of things, though, so was hoping to set up the server in the meantime. My gmail is on my github profile, and I'm happy to pass along my phone number or skype info if you get in touch there.


Reply to this email directly or view it on GitHub: https://github.com/lucwastiaux/gc/issues/1#issuecomment-169761711

Luc - +852 9384 3042

machow commented 8 years ago

I'm free in a couple hours and sent my Skype ID to your ML email. I'll send a quick message to the mailing list!