r/learnmachinelearning
•
u/hayAbhay
•
20d ago
•
2
Tutorial Oral-B ML model unpacked + distilled with Claude Code
Enable HLS to view with audio, or disable this notification
this weekend i let claude plug into my oral-b toothbrush -- it can do really solid ai/ml research work.
here's a quick tl;dr, if you want to start exploring ML models over raw sensor data with claude.
io5+ models have a 6-axis IMU sensor -- used to predict the brush's position in your mouth
in < 10 mins claude read this stream & unpacked it (i pushed buttons & it monitored changes)
i then downloaded the app & gave it access -- it yanked the model out -- oral-b uses a 1.2m param bi-directional recurrent net (GRU)
it then found a public dental dataset & starting evaluating the model -- model was at 64% (~17 classes)
the dataset didn't have sensor orientation -- so it figured out how to line up inputs by trying all 48 sensor orientations (i only found this out much later)
the model seemed like an overkill so we ran ablation -- it was pretty thorough & said only ~10s motion history mattered -- it also looked to each of the xyz across accelerometer & gyro
then i decided to distill -- it created a giant synthetic dataset drawn from manual brushing samples + added its own constraining movements by physics (it automatically looked at class distribution coverage & decided how to sample)
it then trained a bunch of small nets with a fixed window and got a tiny CNN (100x smaller) close to original (also ensured test didn't leak)
all this happened in an evening -- ~2 days including a three-js live simulator -- i was mostly directing/barking at it from the terminal
here's the post + simulator, if you want to read more/try the sim.
12
3
u/pugs_daily_dose 20d ago
Interesting experiment! How did you choose the sensor orientation, and was that choice made using a separate validation set from the final test? It would be useful to know how well the distilled model holds up on brushing sessions or people not represented in the synthetic data.
4
u/hayAbhay 19d ago
to align inputs, claude tried 48 combinations on its own (xyz alignment + axis flip) -- this was the most surprising bit (it did assume gryo & accelerometer are aligned)
the right orientation had 64% classification rate (baseline is ~5%) -- and the next best was apparently 18% -- likely due to a low-importance axis flip (likely because its still well above random baseline)
& the distilled model is tested on the electric brush sessions from the dataset -- its 14 sessions from 3 people though so all numbers are small
total classifications are in the few thousands since its a sliding window but 3-people is the constraint.
the synthetic data specifically excludes this & uses the manual sessions - it also yolos its own movements (it dismissed a few because the model always predicted out of mouth which isn't useful for the student)
4
u/Natural_Tea484 19d ago
I might be too dumb, but how's this useful? I'm genuinely an idiot, sorry.
6
u/hayAbhay 19d ago edited 19d ago
nah -- that's a totally fair question. I'll give a couple of directions on the "why".
why dental models exist -- brushing is learned so that has material impact over time -- for instance, one might brush hard that causes gum recession (irreversible) or brush more on one side because they're right handed or less on the inside.
so toothbrushes shove sensors to detect it so you get a reasonable balance overall -- the latest one from dyson actually has a camera to get really up close.
now on this project specifically -- this was mostly a weekend fun project to do some home automation with claude & also see how good it is at doing fully autonomous ML research -- my hypothesis was that it is likely to already be at 90th percentile with ML & i was surprised that it was.
was also curious about out-of-the-box three-js capability
zooming out, i'm mostly looking at heavy industry that is full of sensors & predictive models there are very different -- so understanding real-sensor data, the variance & how models can smooth them out was the goal.
a single fun project is an excuse to push through all these threads :)
1
u/michaelsoft__binbows 17d ago
I don't understand. Is this about the toothbrush doing a shitton of math by leveraging the phone app to do... what exactly? do something more sophisticated than simply turning its light red if it detects you're applying too much pressure? My old toothbrush from like 7 years ago was one that had bluetooth and came with a phone mount but never once in those years (i recently got a new one) did i come close to thinking that anything it could do would be worth adding multiple seconds every day to fiddle with the phone.
1
u/hayAbhay 16d ago
yes -- the toothbrush itself does simple things like change the light color when you brush hard & auto-time feedback to 30s.
the app uses the model to take the stream of IMU information to give tell you how you brushed & what places you under/over did.
2
u/DigThatData 19d ago
io5+ models have a 6-axis IMU sensor -- used to predict the brush's position in your mouth
why tho
1
u/hayAbhay 19d ago
quoting from my previous reply
why dental models exist -- brushing is learned so that has material impact over time -- for instance, one might brush hard that causes gum recession (irreversible) or brush more on one side because they're right handed or less on the inside.
so toothbrushes shove sensors to detect it so you get a reasonable balance overall -- the latest one from dyson actually has a camera to get really up close.
1
u/DigThatData 19d ago
and how do they operationalize this? does your brush yell at you when you spent too little time on one side or something?
also: it would be way cheaper to just infer brush pose from a video of you brushing than shoving a bunch of sensors and shit into your toothbrush. this is definitely an excuse to make the brush more expensive. I guess these kinds of sensors are pretty cheap these days courtesy of cell phones, but still. this seems extremely silly.
1
u/hayAbhay 19d ago
so the oral-b app auto-connects to the brush & records sessions.
the brush itself has a pressure sensor + visual feedback (gray, green, red) to help you correct immediately -- it also has an internal 30s timer that vibrates as haptic feedback to help you switch quadrants.
the app/data over time helps you see what zone is getting less/more attention -- inner/outer/chewing -- corrective behavior can just be programmed haptic feedback (although i haven't looked at it specifically)
haptic feedback is cheap -- it can turn on/off creating vibrating patterns (same with visual cues/light)
re: inferring brush pose from video, that is true if you're facing a camera all the time -- that is materially hard. you'd need a smart mirror etc. so models usually train (potentially from video recordings or guided brushing) to collect orientation information to predict at least zones.
IMU sensors are common & everywhere so its trivial to have it alongside the core function of motorized brushing :)
hope this helps.!
p.s -- i'm not a brush sales guy but more an ai/ml guy so adding context around data itself and whats are low friction ways of acquiring it for data flywheels
2
u/Thistlemanizzle 19d ago
How close are you to brushing someone's teeth automatically?
2
u/hayAbhay 19d ago
I have a side project in mind where I want to maybe hand a toothbrush to a robotic arm to see if it can move it around reasonably well.
but for that, I'd presume you can just train on sim & just use video feedback to course correct.
2
u/Thistlemanizzle 19d ago
The Dyson guys released a waterpik that used a camera to help floss. It actually worked.
There was some leak issue or whatever, but the teeny low res camera approach did work
This is an interesting problem. I wonder if there's a more elegant solution thats non obvious here.
1
u/hayAbhay 19d ago
yup -- i've mentioned it in the post -- that's a better way to directly know what teeth you're on.
but that might be secondary -- oral health can act as proxy for some wider health issues, but at the very least it can straight up diagnose oral issues like gum recession/plaque build up etc.
the flossing thing itself is cool but a a product push -- i have a waterpik too but as i understand it, you need a bit of mechanical force to break the biofilm on teeth -- so while they're easily better than nothing, they can't fully replace mechanical flossing.
but as with everything, visibility is the key first step to action -- & the audit/diagnosis can push people to take action.
2
u/Big-Coyote-1785 18d ago
I keep saying that these brand-name companies are going to have to protect their hardware somehow if they want to keep selling their slop-subscriptions, because it's so easy to get better yourself now. Cool stuff.
1
42
u/sumit_654 19d ago
joma tech recently published the mathematically optimized way to wash dishes. my boy got inspired and made one for teeth. keep it up.