Devreal

Finding Your Audience In The Internet of...

Event: Data by the Bay

data.bythebay.io: Dhruv Choudhary, Finding Your Audience In The Internet of Things

Recording: data.bythebay.io: Dhruv Choudhary, Finding Your Audience In The Internet of Things

um good morning everybody uh my name is aren and this is Dro and we are from the data team at automatic and um you know as data scientists uh one of the things we're often asked to do is find out or explain how data relates to a customer or explain uh what are the factors that distinguish customers from each other but we sort of rarely have the luxury of uh getting to ask the customer themselves and we feel that this problem is sort of Amplified in the iot space because for the most part you are getting a lot of your signal from a device and you have thousands or millions of such identical devices all almost kind of speaking the same kind of language if you will uh of the data um and that's what you have to work with so we're going to kind of cover uh some of the work we've done in that environment and sort of bring in iot perspective to sort of uh finding your audience or audience segmentation so at automatic our mission is to you know connect every car out there to the cloud and use the data that we collect to essentially build products to enrich the overall car ownership experience uh how we do this is we build our own OBD Hardware that connects to your car and um essentially plugs into your car connects to your smartphone and through this connection we're able to to gather high frequency very granular data and uh forward it to our servers uh we're able to actually collect a wide variety of data from vehicles um for example this uh graph here represents a Time series which is uh representing the velocity of a vehicle during a trip and with a little bit of cleanup it's a noisy time series but with a little bit of cleanup we can start to say a lot of interesting things about a trip for example uh one of the things that our device actively detects is hard breaking uh which is represented here by these um sharp drops in velocity uh but you know we want to sort of go beyond a trip uh to actually discovering interesting things about the entities that are involved in generating um a trip so the user and the driver and the vehicles um so how do we sort of um you know I spoke about the abstraction that exists between the device and the actual user in iot so given that and the fact that we're sort of looking at millions of points like this on a daily basis how do we discover something deeper about our drivers and vehicles involved in this process so there's you know various sorts of drivers out there uh we've all you know been driving and have our personal experiences and we end up sort of bucketing these drivers into various types depending on um how easy they make life for us on the road or more which is more often the case how they diverge from our personal rule of the road um and you've all seen sort of the BuzzFeed type of articles about you know here are the 14 types of drivers we all should know about and um there are those driver personality quizzes but uh at automatic you know having access to all this historical data and highly granular data we felt that it was sort of our duty to have the data itself reveal to us what are these types of drivers that are out there and can we actually segment them um and sort of what would also be the factor that differentiate these various types of drivers that we discover and it's not just the drivers that um are of various types um vehicles on the road um are also you know differ vastly in their characteristics and um we also have strong opinions about those so once again uh we felt that having all this data we wanted to really um validate or disprove some of these preconceived notions about cars that are out there and um to make this more challenging you know we add all these different driving styles to the equation and you end up with a situation which we see a lot in our data where we have an identical vehicle sort of being driven in three different ways so you have a Honda Civic which is known sort of to be a um fuel sipping economy vehicle but how do we consistently validate that across um you know very three very different um styles of driving as displayed here um and sort of to add another dimension to this problem uh The Identical an identical vehicle uh basically a make model in year configuration driven in sort of similar manner uh can exist uh can exhibit uh various different characteristics depending on factors like how it's being maintained um its aerodynamics or you know if it was accidentally programmed to report lower emissions that are actually being emitted by the engine and the vehicle um that one never happens so you know the next obvious question is we're talking about all these entities that are behind the device so how do we model um you know users and vehicles and essentially these entities at automatic uh so what we have here is a velocity acceleration frequency histogram and the x-axis uh represents velocity the y axis has acceleration and the intensity of the color at various positions indicates um the time that the user has spend accelerating and decelerating at various velocities and if you think about it um accelerating and braking are basically like make up a large part of what we do when we're driving out there and controlling a vehicle and that's what goes into determining our um driving behavior essentially or our driving style so this representation um sort of is a good way to capture um essentially the driving uh profile of a user or uh behavior of a car if you will and it sort of instantly confirms a lot of things that we know about how people normally drive so for example um the width of the colors at any point indicates how the extent to which they are accelerating and decelerating so the fact that you know most normal drivers do not wildly accelerate or decelerate at higher velocities is something that's instantly confirmed by uh the representation in this data model another thing that's great about representing um sort of entities this way is that um it offers a great uh visual or the ability to you know visually compare uh two different profiles or behaviors very easily so here we you know sort of compare and contrast on the left you can see a profile where there's a lot of sudden acceleration and deceleration at the lower um uh velocities and the spread is much wider out there uh but then on we have another driver who is sort of more um smooth in how they get up to certain speeds but then they um stay sort of at those high speeds and uh don't really deviate from that pattern and this data model is is also very expressive because it allows us to sort of go be beyond the basic sort of physical analysis of how much acceleration and at what velocities that is happening but also sort of infer some latent factors about the entities involved in generating um this histogram so for example this is uh dru's um velocity acceleration histogram and he commutes from the South Bay uh every day uh but if you look at sort of the Velocity um in that histogram you can tell that he's uh not coming into to the office at 9:00 a.m. in the morning in order to achieve those velocities but basically we've taken sort of the histogram and uh with the ability sort of correlate trips with that we can say a lot more um and sort of start getting into this area of latent factors that affect driving so here we can say that this histogram belongs to sort of a highway driver who consistently stays at pretty high speeds and doesn't accelerate or decelerate much uh similarly you can contrast this with another one of our um um staff members in the office who is more of a city driver and they are mostly restricted to lower velocities while driving in the city and the width of uh how much time they're spending accelerating and decelerating um sort of indicates their impatience while uh they are traveling so it's kind of apparent that you know City Driving versus highway driving could be a major latent factor while analyzing different uh driving behavior and profiles and the RO is going to kind of go a little deeper into into what some of those other latent factors are and how we determine them thanks AR so U one of the objectives of this whole study was that we wanted to come up with simple relatable attributes uh which we can take and understand who our customers are and possibly take the same attributes to our customers and educate them about what sort of driving Styles they have and what are the other types of driving styles that other users have um so um fundamentally this is a dimensionality reduction problem but before I get into you know the spefic specifics of how we get to those latent factors from this descriptive velocity acceleration curve uh there's a there's a more important step before that that's data cleanup so um we found that um it is useful to actually formulate this problem as an image processing problem and in the image processing world you have this uh traditional handwriting uh digit recognition problem uh which has similar D noising requirements so in this case uh there's an algorithm called stack D noising Auto encoder where you take the image and kind of train neural net of the image against itself and you come up with this uh compressed representation uh which is the blue dots in between which essentially is a is a measure of how how robust your model is uh and we felt that uh our kind of formulation fell fell in the same bracket so we did the same thing and let me talk about some of the sort of errors that we have so for example a user who probably doesn't clock as many miles his velocity frequency velocity acceleration frequency histogram doesn't saturate fast enough so when we take just the raw histogram the the cluster formation is very uh non-separable um so that's kind of if you can see the histograms on the left they are the raw histograms and the ones on the right are the ones that go through the robust representation and when we actually train the uh deep encoders uh we actually use the more saturated histograms instead of like histograms just across a week or across one trip okay so um for the actual clustering we use non negative Matrix vectorization which actually works very well for um uh histogram kind of data which is essentially counts or frequencies uh especially when it's coupled with K Divergence and at the base it's essentially a a fact Matrix factorization algorithm with non- negative constraints on the two matrices W and H H is the Matrix of cluster centroids and W is the Matrix of factor membership across the different latent factors great so we applied nmf to our cleaned up velocity frequency histograms and these are the sort of latent factors we discovered uh as you can see uh there's sort of like nice separation across this uh these clusters so it might be worth to just go into some of these clusters and see like what do they actually mean and uh what can we learn from them so for example this one um this is a driver who probably gets at very high speeds but has a very calm Behavior at those high speeds uh probably someone who would invest in a radar detector this driver um is pretty aggressive if you see his U vertical spread uh he doesn't stop for much else but is uh usually at much higher speeds um this one there there's a lot of breaking and acceleration Behavior at low City and neighborhood spe someone like a taxi capab driver who will get you there uh in time but probably not in one piece um and the last one so I think you can get get a sense of where I'm kind of going with this uh looking at these kind of flaten fact factors uh we can actually relate them to certain personas and that's at the core of the study where we want to take these Laten factors and understand what they really mean and how we can represent these factors to our users um and we can go further actually to simplify understanding and kind of look at different hidden variables which kind of can can explain these um latent factors so we um we kind of came up with three variables um the behavior of drivers at city and neighborhood velocities just kind of a measure of their impatience um their behavior at Highway and Expressway velocities which is sort of a measure of their aggression uh and then kind of local conditions which is a fact which is the combined factor of traffic weather terrain temperature um usually this these are things which are outside of the control of a driver but uh affects the velocity distribution significantly okay so we took these clusters and then we looked at correlating drives and kind of made this Matrix of uh the different factors that I just mentioned so it might be worth just going into a couple of them and seeing what they actually mean so we saw the one above U we kind of call this the Serene Sage uh he's a guy who's pretty patient doesn't drive too much in traffic he consistently at high speeds and you can see the kind of the attributes are accordingly um written on the right side um the one below uh is more like a race car driver he's pretty aggressive uh sees moderate moderate amount of traffic and and drives mostly on the highway and the expressway and we have we actually successfully turned this um you know non- negative Matrix factorization clusters into a data product where our users could actually go and and play around with this data and kind of see what kind of driving style they fall into and we would love for you guys also to go there and play with this demo data you don't necessarily need an automatic for this and kind of see like how we've taken these latent factors and uh the attributes that we have used to uh describe these latent factors okay but entally driving behavior is is very very complex so um this is a very simplistic approach that we've taken where we've taken like a dominant quality of a laden factor and we've kind of assigned it to a user but users don't always kind of fall into one particular dominant quality and there are many things that the simplistic thing doesn't account for things like length of the trip time of day mood urgency uh and so this I think the first attempt that we've tried to made is kind of make it simpler for users to digest the information about what is the dominant quality and kind of the attributes that describe the dominant quality okay so this kind of brings us back to the same concept about uh you know what uh uh what are we trying to do out here we're trying to all these devices in iot that we're connecting uh they're essentially proxies to the actual entities we're trying to learn about and that's why this kind of is is a much harder problem than many other spaces where you have more explicit engagement between the entities and the product um in the iot space uh we are we have a lot of these devices which are sort of sending very similar looking data and there is uh we need machine learning to actually color these things and kind of find meaningful representations uh from this data and and the thing that we want you to take away from this talk is sort of the data methodology that we've built and the audience segmentation um algorithms that we've used uh and and we kind of used this to build many different data products for example here uh we've taken um the same methodology with sparse Auto encoders and non negative Matrix factorization and we've applied it to the two-dimensional curve of velocity and revolutions per minute and you can immediately see some quantifiable patterns um which pertain to Gears of the vehicles and the slope of these patterns is actually directly correlated with the torque that your car is generating at each of these different gears and and the the Laten factors where you do not see patterns probably uh pertain to hybrid vehicles and CVT vehicles and you can clearly see that this kind of morphs very well into let's say a vehicle maintenance product that we make and autom manufacturers can consume such products directly from the automatic Cloud so uh that kind of brings us to the end of the talk uh we would uh love for you to go and check out automatic and if you would want to buy an automatic uh that's a promo code and you can go and see more things about about your driving Styles and characteristics of your car [Applause] cool gation like making the driver uh play a game so he consumes less fuel like right yeah you're profiling him this is a driver absolutely absolutely so yeah so this is kind of like the first step of that right so we had like a web dashboard where users could go and play with the data kind of understand you know what even for us to answer questions like which are the users that can benefit from fuel savings if they change their behavior so some of these clusters obviously have more benefit than the others uh and and part of this whole thing about you know building this data pipeline is to you know have that thing where a user takes a trip and this kind of Icon pops up and says okay you know this is your profile for this drive even uh suggest what kind of music you should listen to if you can see oh this stressed person right so that's or you could have a voice saying should I call psychiatrist something you're thinking Next Level you want to like bring Spotify the mix no that's interesting because a part of this is already build into our product so the question that you know this can help answer is which users would this benefit the most so um you know our device for example has audio feedback to help you or to help warn you when you're doing behaviors while driving t would be detrimental to your Fu stat so if you're accelerating really hard ring really hard or speeding you kind of get this a feedback but you can turn on or offending on your preference but um you know in this case we would know which users you know probably significantly benefit from this and Target them specifically that he this is something you should use while you're driving yeah could you actually detect the driver is switching lanes very often so you you say oh this is a dangerous driver it's speeding and it's switching l you should go so I think there's a distinction to be made the point is not to judge the drivers uh we kind of giving constructive criticism to the drivers yeah yeah absolutely uh so usually Lane changing behavior is a very complex topic and we've kind of Taken um we we're trying to solve that problem as well but uh it's very difficult to actually U see you know what is an actual Lane change and uh you know whether it was justified that lane change was justified or not so there are many subjective factors that go into it and some of the data is actually missing for us to actually make that like if you had like video cameras it would be much easier to actually make that assertation rather than just looking at Drive data so yeah thanks for we we don't have enough time for onl questions but hopefully you guys be around sure y [Applause] a