Placeholder Image

字幕列表 影片播放

  • welcome to Tensorflow meets.

  • I'm Pete Warden on today we're gonna be talking to Marius Erickson.

  • So I understand you're using Tensorflow to help your daughter who's a type one diabetic.

  • Maybe you could tell us a bit more about that.

  • Sure, yes.

  • So it helps have a little bit of background and what's treating Type one diabetes entails.

  • So when you're a type one diabetic, your packers, this basically nonfunctioning and not secreting insulin into your bloodstream, which is required for yourselves to take up glucose.

  • Because of this phenomenon, we basically be able to predict what glucose levels should be on based on that prediction.

  • Deliver sort of a correct amount of insulin or withhold insulin if we predict that blood glucose is going to go low, right?

  • Ah, and so because of those this reasons, we the approach that I've taken eyes to employ machine learning actually in two ways, so one.

  • It's a model that uses data that's gathered on a continual basis every five minutes.

  • Ah, and predicts future blood glucose based on you know that passed and then secondly Ah, uh, a different model or rather, model that builds on the first model tries to figure out what?

  • It's an optimal insulin delivery schedule that will effectively, ah, you know, keep blood sugar within the sort of Goldilocks zone.

  • Right?

  • And so that second model knows about these are far mako dynamics of insulin.

  • Ah, and so on and so forth.

  • Umm and ah, actually use tensorflow for both of those, right?

  • One of the really nice things about tensorflow is that it's very easy to composed these models together.

  • And that's exactly what How this works.

  • Awesome.

  • Do you want Thio?

  • Looks like you actually have pumped dead.

  • So this is Ah, the pump or ah, pump Similar to what?

  • My daughter?

  • Worse.

  • Um, and this is just something you keep in your pocket or whatever.

  • Um, and this is a little too being that comes out of others.

  • And insulin Russell War in here.

  • Ah, the tubing connects to effectively a small needle that that's inserted into some fat, hairy everybody.

  • This pump in particular can be controlled remotely.

  • Ah, And so the first thing that had to do for this project was not machine learning related eyes to effectively reverse it.

  • Reverse engineer that radio protocol that I can control it from a raspberry pi, which is the second component.

  • And so this is Ah raspberry pi zero, as we can see And this is sort of where all the magic happens on dso the raspberry pi zero through a custom I some radio with custom firmer that knows how to communicate Thio Instant pump can effectively instructions and pump what to do.

  • Deliver this much insulin or withholding son or whatever the raspberry piles uses.

  • Billy Thio communicate with the phone and that serves two purposes.

  • One is to receive, uh, blood glucose values from this continuous glucose monitoring system that integrates with the phone.

  • Ah, and the second is to receive, um, instructions from the phone as to, for example, when my daughter eats.

  • And so whenever she eats, we have to enter all you're eating this many grams of carbs s o.

  • The model can take that into account, right?

  • And without that, it wouldn't be able to predict the future very well.

  • So, um, what does your daughter think of this?

  • This is making a difference for her.

  • Oh, absolutely.

  • And so?

  • So there's There's two big ways in which makes the difference.

  • I think so.

  • One is, um, it just reduces the liver intensity of of diabetes.

  • You know, you still have to intervene on occasion.

  • There's still a lot of things to do, but you can't be a computer in terms of, you know, being able to do the same thing every five minutes over and over and over again, right?

  • And so literally every five minutes, the system just insulin delivery based on the predicted what it predicts the future.

  • The second ah, big thing is that, um typically the way diabetes is treated.

  • Uh, this was something called Basil and bullets therapy.

  • And what that means is that it's ah, it's a, you know, still fairly complex but far simplified version of what the model does.

  • Ah, and you have to sort of even with this therapy, you have to every time you eat, you know, check what your blood would goes This, uh, computes using a few ratios how much instant, deliver on, do it and then check your blood sugar again a little bit later.

  • But again, with using machine learning techniques and other things, we can do far, far better.

  • We can understand much more deeply the the evolution of insulin in the blood.

  • We can predict the evolution of carbohydrate of parents in the blood and so on and so forth.

  • And the way this model works is that it has obviously trained with a lot of historical data.

  • And so individual variants, right, is also something that the model can pick up very readily.

  • Right?

  • So, as an example, it's known that individuals respond slightly differently to insulin.

  • Right?

  • Maybe the pharma code dynamics evolve inside of different ways.

  • Maybe they Maybe it takes longer for the incident to clear.

  • Right?

  • Maybe the peak is stronger.

  • Things like that.

  • With this model, it actually learns what the farmer could.

  • Dynamics are.

  • So you mentioned data as well.

  • How did you actually go about getting the training data that you needed to train and test these mortals?

  • Right.

  • So after I reverse engineer the r F protocol of the pump Ah, I started Basically first it's observing.

  • And so every five minutes at effectively quarries to pump and ask how much will be delivered in the last five minutes, right?

  • But still doing manual therapy.

  • Right?

  • So we're still administering insulin through the remote control.

  • But we were controlling it right and then all at the same time, entering every time my daughter had a meal, we would enter our estimate of the number of carps in that meal and our estimate of the dressing make index.

  • So those things together would capturing the glucose readings from the continuous glucose monitors effectively gives us all the raw data, right?

  • So we can we can observe blood glucose levels, observed the incident that's been delivered, uh, and all the food that she, uh, vitiate.

  • And so that's that's basically how we gather the raw data we do that for, you know, a few months before he started, you know, with the exercise of modeling.

  • And at this point, my daughter's values are almost normal guy scenic meaning that, uh, from that point of view, it's almost as if she doesn't have diabetes.

  • And so that's another huge benefit of this kind of automation.

  • And again, this is possible to achieve.

  • You know, if you're willing to, you know, look at your blood sugar every five minutes and do much asking a five year old girl Thio to deal with that when she's more interested in correct running around and playing is doesn't work.

  • So, um, maybe you could tell me a bit about how you found, uh, in a decided on tensorflow.

  • And how you use that sort of on speed pie.

  • Yeah.

  • So the reason I decided on on TENSORFLOW is initially because it was very easy to sort of switch from experimentation to production, right?

  • And so I would do all that kind of modeling work and experimentation and your Jupiter notebooks and all that stuff is very, very convenient.

  • And the controller code eyes actually written and go right.

  • So all the stuff that deals with the radio transmission and the time serious databases in the last stuff Silverton and Go.

  • And so with tensorflow, I was able to take the model that a developing distributor notebook save it to protocol buffers basically and then, you know, loaded up and go, and that provides a really nice and clean interface.

  • Always never have to change the go code that loads the model.

  • It knows how the feet of the right date on everything.

  • But I can change completely the behavior of the model just, you know, sort of purely in this high level way, using pipeline, right that was one really big appealing.

  • Um, uh, thing for tensorflow.

  • The other thing obvious is that it can run in embedded systems, right?

  • And so, you know, the raspberry pies and arm based system, and I can run the inference and the retraining, uh, you know, without having to worry about the underlying architecture, anything like that.

  • Ah ah, The third thing I think iss I'm very much using this welcome possibility of the tensorflow compete that computation graphs so assume example.

  • It was very easy to take the model that predicts blood glucose and composer with a model that is going to recommend an insulin delivery schedule, right?

  • And because of the way the competition graft works, Andi automatic differentiation and everything, you know, it's very, very easy to build that second model and just letting optimize her have a go at it and you get the right results, right?

  • Without having me having to sit down and do any calculus or anything like that, we're just very, very appealing to me.

  • So I would say those are kind of main reasons.

  • Why pretend?

  • Yeah.

  • And for the listeners, we do actually now have a, um, version off tensorflow that is built already for the last three pie that we've run is part of our nightly builds on.

  • So I'm hoping as you look at upgrading tensorflow in the future way may be able to help you get up and running, using some pre built wineries so that you don't have toe build everything from scratch.

  • That's true.

  • It's awesome that you're actually able Thio, you know, pull it all together and get it up and running.

  • That's right.

  • Yeah, I I think it speaks to tensorflow that that was perhaps the most difficult part of, uh, Andi is the Is the code available for what you've actually built?

  • Yes.

  • So some of it us.

  • So for for for different reasons.

  • You know, uh, obviously, this is a system that carries some risk and you could be construed as, ah, medical device and things like that.

  • Ah, the model that I used in production.

  • I have not, um I should release publicly, but kind of most of the code around it a have right, including the radio stack for a less stuff.

  • However, I have ah made a notebook that kind of replicates the general set up.

  • Also in Tensorflow.

  • They're using a much simpler model, but it replicates precisely with the setup issue.

  • Have a model that predicts blood glucose and then a second model that composes the first in order to optimize the delivery schedule.

  • And so that's all open source is a Jupiter notebook that I published those base consider showing demonstrate how how this could be done in this in this matter.

  • So, obviously, this is a very safety critical system on dhe.

  • It poses a lot of questions and problems you wouldn't have in other machine learning systems.

  • Can you tell us a little bit about how you thought on planned and tackle that?

  • Yeah, absolutely.

  • So there's a few different aspects of that.

  • So one is obviously a model could learn the wrong thing on do something dangerous and so, you know, in order to kind of prevent that there's all sorts of their secondary safety measures in place that, you know, simpler models that perform safety checks effectively.

  • And we'll shut off the main model if it s doing the wrong thing.

  • Right?

  • Um, so sort of one aspect of it.

  • The other thing is that from a sort of systems perspective, Um, it's designed to limit the the amount of action that the model conducive Asan Example.

  • If her blood group, if your blood we was very, very high on the model wants to correct it down to the range that it that it's a sires of the set point what it does, instead of correcting down to that range, it corrects down to some maximum level beneath what ISS at the moment.

  • And so it's required to basically gradually correct down, so that in case sensitivity changes very rapidly, you don't end up over delivering your effective.

  • It's kind of throttling the action of the system.

  • And so there are a few mechanisms like that, Um and then ah, from ah sort of systems point of view any time you have data loss or, you know, even if the software crashes, for example, it's a sign so that it fails in a safe ways.

  • Shuts off insulin are our delivers on the small, very small amount.

  • Okay, well, thanks so much everyone for joining us on tensorflow meets Andi.

  • Thank you, Marius.

  • On If you want to see more like this, please hit that.

  • Subscribe.

welcome to Tensorflow meets.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

使用ML預測1型糖尿病的胰島素使用情況(TensorFlow Meets)。 (Using ML to predict insulin use for Type 1 Diabetes (TensorFlow Meets))

  • 2 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字