The science behind Hunches: Deep device embeddings

机器学习
自然语言处理
海外精选
海外精选的内容汇集了全球优质的亚马逊云科技相关技术内容。同时,内容中提到的“AWS” 是 “Amazon Web Services” 的缩写,在此网站不作为商标展示。
0
0
{"value":"Using Alexa, customers can control thousands of different smart-home devices — such as lights, plugs, switches, door locks, cameras, and thermostats — with just their voices. But the Alexa smart-home interface is more than just a voice-based remote control.\n\n![image.png](https://dev-media.amazoncloud.cn/3681ab264d1f4ae486ff74057e7d40bf_image.png)\n\nAutomatic Actions feedback page in the Alexa mobile app.\n\nIn 2018, we launched Hunches, an Alexa setting that offers reminders when Alexa thinks you forgot to turn off a light or to lock a door. Since then, we have expanded Hunches to include a proactive experience called Automatic Actions: we turn off lights and adjust thermostats when customers are asleep or leave the home. Today, thanks to predictive and proactive features like Hunches and Routines, one in four smart-home interactions is initiated by Alexa — without customers’ having to say anything.\n\nTaking proactive actions in the home is a responsibility we take seriously, and our machine learning models need to clear a high bar in order to meet customer expectations. Before initiating an action, multiple models make decisions, including estimating the light level, predicting whether customers have gone to sleep or left the home, and predicting which devices should be controlled.\n\nEach of these components is an active area of research and innovation, but in this post, I’m going to focus on how we decide which device to control. We do this by mapping customers' smart-home usage patterns to a set of archetypes.\n\n#### **Smart-home usage patterns**\n\n![image.png](https://dev-media.amazoncloud.cn/b76d3a5de26047f99a698bd420ce0e2f_image.png)\n\n![image.png](https://dev-media.amazoncloud.cn/65af1beaf949473a85b526aa170ddaf1_image.png)\n\nState data timelines showing sample usage patterns of devices in a home. Some lights are left on at night (e.g., “Porch light”). Some are typically controlled together (e.g., “Living room” and “Plug 1”). Some are named to indicate their placement and usage, while others, like “Plug 1”, do not provide this information.\n\nWe derive insights about a device by how it is named and ++[grouped](https://www.amazon.com/gp/help/customer/display.html?nodeId=201749250)++, as well as by how it is used. Consider the time periods of the “on” states of the example devices in the image of state data timelines. We see the typical bathroom-light pattern of short spans of on-state over the day and longer spans in the evening.\n\nAnother device in the living room is mostly used in the evening. A third device is just called “Plug 1”, but it is highly correlated with the usage behavior in the living room. Alexa may infer that this plug is located in the living room. It could, for example, be attached to a Christmas tree. If our model knew this for certain, it could offer the customer a ++[Routine](https://www.amazon.com/alexa-routines)++ that synchronizes the tree lights with holiday music.\n\nTwo factors make proactive routines challenging:\n\n- Sparsity: While some smart homes are fully wired, other customers may own one Echo Dot and a single smart light bulb. We want to offer them Hunches, too.\n\n- Diversity: There are hundreds of thousands of possible configurations for Echo devices, smart-home appliances, and their uses. Even if two homes are configured identically, customers may be using their devices very differently. For example, a device labeled “bedroom light” may be in the main bedroom or a guest bedroom, or it may just be a closet light.\n\n#### **Deep device embeddings model**\n\nMany of our services boil down to the question of what state customers would like their devices to be in: that’s what drives both Automatic Actions and Hunches. To answer that question, we train an encoder model that produces a device representation — an embedding — that encodes the device’s previous states and the configuration of the home, including device names, device types, and device groupings. From that embedding, a decoder model can predict the device’s future state.\n\n![image.png](https://dev-media.amazoncloud.cn/d81b458526ac41e0920c10b0c4fe5fdd_image.png)\n\nDevice embedding architecture. Green: Training path. A neural network is trained to predict the state of a device at randomly sampled times, using features such as its aggregated past usage, device names, and device groupings. Deep device embeddings are the representations that encode device usage and static device data. Yellow: Embedding path. To force devices into categories of typical usage, which reduces the required storage for each device, we cluster the embeddings. The cluster centers feed into application models that predict, say, whether we should turn off a light or send a Hunch. The application models are initialized using the weights of the state prediction model.\n\nBut predicted home state does not directly answer questions like whether a light should be turned off or a Hunch should be sent. For that purpose, we use a model trained to predict whether a given Hunch will be accepted or not. The Hunch acceptance model uses the home state prediction model’s encoder, which can compute per-home or per-device embeddings. We term the per-device embeddings the deep device embeddings.\n\nIn this model, the weights of the embedding encoder represent information collected across customers; devices with similar usage patterns yield representations that are close to one another in the embedding space. Some bathroom lights, for instance, may bear the label “bathroom light”, but others may be identified by device grouping or usage patterns. Using an embedding space allows us to abstract away these individual features.\n\n#### **From embeddings to semantics**\n\nWhile deep device embeddings are useful to predict Hunches, we also find that the embedding space has some interesting properties when visualized.\n\n![image.png](https://dev-media.amazoncloud.cn/2812577b8e1b4fdb9ecf11eb61532195_image.png)\n\nSample visualization of deep device embedding space. Each dot represents the embedding of one device in a random sample of 100,000 devices. Embeddings are projected to two dimensions using UMAP, which reduces the high-dimensional embedding space to two dimensions while preserving local clusters. Left figure: Colors indicate how long devices are typically left on. One of the dominant dimensions in the space correlates with this measure because the model was trained to predict whether a device would be on at a certain time. Right figure: Colors mark cluster assignments; labels are the dominant name given by customers to this device. We see that islands of similar device usage emerge, such as clusters of devices named “outside” and “porch”.\n\nWhat’s interesting about this space is that there are clusters to which we can attach usage semantics. In our sample visualization, we define 60 clusters using k-means and color some of them. The title of each cluster is the name in it that is most frequent when normalized by its frequency in the complete dataset. We find that clusters carry semantic information; for example, the isolated island of devices consisting of the “outside” and “porch” (blue and brown) clusters is most likely outdoor devices that are left on for long durations at a time.\n\nWhile the labels given to clusters are the dominant names, they are not the only names associated with the clusters. For instance, we also find devices labeled “First Light” in the outdoor cluster. The embeddings are able to tag devices not just by how they are named and grouped but also based on their usage.\n\nThe device embedding space thus provides an automated way to map device usage patterns in different homes into a common space that can be used to drive services such as Automatic Actions or Hunches.\n\n#### **Outlook**\n\nFor all the convenience offered by Hunches and Automatic Actions, we still see opportunities to make the smart home smarter.\n\nFor example, we project all customer device usage into common roles. While this can be helpful when data is sparse, we would also like to offer customers more personalized smart-home services. We recently implemented a new representation called deep home embeddings, which aggregates information across all devices in the home and enables us to create proactive automations that consider the state of the home holistically.\n\nMost smart homes start out with just one or two Internet-connected devices and add more over time. We are always trying to find ways to automate repetitive tasks, provide relevant reminders that increase customer convenience, and offer useful recommendations for all Alexa Smart Home customers.\n\n**Acknowledgments**: Charles Brett, Maisie Wang, Michael Dillon, Paul Savastinuk, Usman Aleem\n\n\nABOUT THE AUTHOR\n\n#### **[Sven Eberhardt](https://www.amazon.science/author/sven-eberhardt)**\nSven Eberhardt is a senior applied scientist in the Alexa Smart Home organization.\n","render":"<p>Using Alexa, customers can control thousands of different smart-home devices — such as lights, plugs, switches, door locks, cameras, and thermostats — with just their voices. But the Alexa smart-home interface is more than just a voice-based remote control.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/3681ab264d1f4ae486ff74057e7d40bf_image.png\" alt=\"image.png\" /></p>\n<p>Automatic Actions feedback page in the Alexa mobile app.</p>\n<p>In 2018, we launched Hunches, an Alexa setting that offers reminders when Alexa thinks you forgot to turn off a light or to lock a door. Since then, we have expanded Hunches to include a proactive experience called Automatic Actions: we turn off lights and adjust thermostats when customers are asleep or leave the home. Today, thanks to predictive and proactive features like Hunches and Routines, one in four smart-home interactions is initiated by Alexa — without customers’ having to say anything.</p>\n<p>Taking proactive actions in the home is a responsibility we take seriously, and our machine learning models need to clear a high bar in order to meet customer expectations. Before initiating an action, multiple models make decisions, including estimating the light level, predicting whether customers have gone to sleep or left the home, and predicting which devices should be controlled.</p>\n<p>Each of these components is an active area of research and innovation, but in this post, I’m going to focus on how we decide which device to control. We do this by mapping customers’ smart-home usage patterns to a set of archetypes.</p>\n<h4><a id=\"Smarthome_usage_patterns_12\"></a><strong>Smart-home usage patterns</strong></h4>\n<p><img src=\"https://dev-media.amazoncloud.cn/b76d3a5de26047f99a698bd420ce0e2f_image.png\" alt=\"image.png\" /></p>\n<p><img src=\"https://dev-media.amazoncloud.cn/65af1beaf949473a85b526aa170ddaf1_image.png\" alt=\"image.png\" /></p>\n<p>State data timelines showing sample usage patterns of devices in a home. Some lights are left on at night (e.g., “Porch light”). Some are typically controlled together (e.g., “Living room” and “Plug 1”). Some are named to indicate their placement and usage, while others, like “Plug 1”, do not provide this information.</p>\n<p>We derive insights about a device by how it is named and <ins><a href=\"https://www.amazon.com/gp/help/customer/display.html?nodeId=201749250\" target=\"_blank\">grouped</a></ins>, as well as by how it is used. Consider the time periods of the “on” states of the example devices in the image of state data timelines. We see the typical bathroom-light pattern of short spans of on-state over the day and longer spans in the evening.</p>\n<p>Another device in the living room is mostly used in the evening. A third device is just called “Plug 1”, but it is highly correlated with the usage behavior in the living room. Alexa may infer that this plug is located in the living room. It could, for example, be attached to a Christmas tree. If our model knew this for certain, it could offer the customer a <ins><a href=\"https://www.amazon.com/alexa-routines\" target=\"_blank\">Routine</a></ins> that synchronizes the tree lights with holiday music.</p>\n<p>Two factors make proactive routines challenging:</p>\n<ul>\n<li>\n<p>Sparsity: While some smart homes are fully wired, other customers may own one Echo Dot and a single smart light bulb. We want to offer them Hunches, too.</p>\n</li>\n<li>\n<p>Diversity: There are hundreds of thousands of possible configurations for Echo devices, smart-home appliances, and their uses. Even if two homes are configured identically, customers may be using their devices very differently. For example, a device labeled “bedroom light” may be in the main bedroom or a guest bedroom, or it may just be a closet light.</p>\n</li>\n</ul>\n<h4><a id=\"Deep_device_embeddings_model_30\"></a><strong>Deep device embeddings model</strong></h4>\n<p>Many of our services boil down to the question of what state customers would like their devices to be in: that’s what drives both Automatic Actions and Hunches. To answer that question, we train an encoder model that produces a device representation — an embedding — that encodes the device’s previous states and the configuration of the home, including device names, device types, and device groupings. From that embedding, a decoder model can predict the device’s future state.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/d81b458526ac41e0920c10b0c4fe5fdd_image.png\" alt=\"image.png\" /></p>\n<p>Device embedding architecture. Green: Training path. A neural network is trained to predict the state of a device at randomly sampled times, using features such as its aggregated past usage, device names, and device groupings. Deep device embeddings are the representations that encode device usage and static device data. Yellow: Embedding path. To force devices into categories of typical usage, which reduces the required storage for each device, we cluster the embeddings. The cluster centers feed into application models that predict, say, whether we should turn off a light or send a Hunch. The application models are initialized using the weights of the state prediction model.</p>\n<p>But predicted home state does not directly answer questions like whether a light should be turned off or a Hunch should be sent. For that purpose, we use a model trained to predict whether a given Hunch will be accepted or not. The Hunch acceptance model uses the home state prediction model’s encoder, which can compute per-home or per-device embeddings. We term the per-device embeddings the deep device embeddings.</p>\n<p>In this model, the weights of the embedding encoder represent information collected across customers; devices with similar usage patterns yield representations that are close to one another in the embedding space. Some bathroom lights, for instance, may bear the label “bathroom light”, but others may be identified by device grouping or usage patterns. Using an embedding space allows us to abstract away these individual features.</p>\n<h4><a id=\"From_embeddings_to_semantics_42\"></a><strong>From embeddings to semantics</strong></h4>\n<p>While deep device embeddings are useful to predict Hunches, we also find that the embedding space has some interesting properties when visualized.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/2812577b8e1b4fdb9ecf11eb61532195_image.png\" alt=\"image.png\" /></p>\n<p>Sample visualization of deep device embedding space. Each dot represents the embedding of one device in a random sample of 100,000 devices. Embeddings are projected to two dimensions using UMAP, which reduces the high-dimensional embedding space to two dimensions while preserving local clusters. Left figure: Colors indicate how long devices are typically left on. One of the dominant dimensions in the space correlates with this measure because the model was trained to predict whether a device would be on at a certain time. Right figure: Colors mark cluster assignments; labels are the dominant name given by customers to this device. We see that islands of similar device usage emerge, such as clusters of devices named “outside” and “porch”.</p>\n<p>What’s interesting about this space is that there are clusters to which we can attach usage semantics. In our sample visualization, we define 60 clusters using k-means and color some of them. The title of each cluster is the name in it that is most frequent when normalized by its frequency in the complete dataset. We find that clusters carry semantic information; for example, the isolated island of devices consisting of the “outside” and “porch” (blue and brown) clusters is most likely outdoor devices that are left on for long durations at a time.</p>\n<p>While the labels given to clusters are the dominant names, they are not the only names associated with the clusters. For instance, we also find devices labeled “First Light” in the outdoor cluster. The embeddings are able to tag devices not just by how they are named and grouped but also based on their usage.</p>\n<p>The device embedding space thus provides an automated way to map device usage patterns in different homes into a common space that can be used to drive services such as Automatic Actions or Hunches.</p>\n<h4><a id=\"Outlook_56\"></a><strong>Outlook</strong></h4>\n<p>For all the convenience offered by Hunches and Automatic Actions, we still see opportunities to make the smart home smarter.</p>\n<p>For example, we project all customer device usage into common roles. While this can be helpful when data is sparse, we would also like to offer customers more personalized smart-home services. We recently implemented a new representation called deep home embeddings, which aggregates information across all devices in the home and enables us to create proactive automations that consider the state of the home holistically.</p>\n<p>Most smart homes start out with just one or two Internet-connected devices and add more over time. We are always trying to find ways to automate repetitive tasks, provide relevant reminders that increase customer convenience, and offer useful recommendations for all Alexa Smart Home customers.</p>\n<p><strong>Acknowledgments</strong>: Charles Brett, Maisie Wang, Michael Dillon, Paul Savastinuk, Usman Aleem</p>\n<p>ABOUT THE AUTHOR</p>\n<h4><a id=\"Sven_Eberhardthttpswwwamazonscienceauthorsveneberhardt_69\"></a><strong><a href=\"https://www.amazon.science/author/sven-eberhardt\" target=\"_blank\">Sven Eberhardt</a></strong></h4>\n<p>Sven Eberhardt is a senior applied scientist in the Alexa Smart Home organization.</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭