A new device cold start method for smart home portrait construction
By combining Tsformer and MAML models and using meta-learning methods to process historical data of smart home devices, the difficulty of building user profiles caused by the small amount of data for new devices is solved, and rapid iterative convergence and accurate classification are achieved in small sample scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YANGTZE DELTA REGION INST OF UNIV OF ELECTRONICS SCI & TECH OF CHINE (HUZHOU)
- Filing Date
- 2023-04-03
- Publication Date
- 2026-05-08
AI Technical Summary
In the field of smart homes, new devices, due to their limited data volume, cannot effectively build user profiles, resulting in poor fitting and classification performance.
This paper adopts a method combining Tsformer and MAML models to partition the historical data dataset of home devices. The optimal initial parameter set is obtained through meta-training. The time series and channel features are extracted using the Tsformer model. Meta-learning is performed on the training task using the MAML model to generate a test task set for meta-testing, thereby achieving label classification.
When new devices are added, rapid iterative convergence with a small amount of data achieves good classification results, solving the cold start problem of new devices in small sample scenarios and improving the accuracy of user profile construction.
Smart Images

Figure CN116467639B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and in particular to a novel device cold start method for constructing smart home profiles. Background Technology
[0002] With the development of the social economy, the technological content of home furnishing products is constantly improving, and more and more intelligent devices are entering households, making people's home life more comfortable and convenient. Against this backdrop, analyzing and understanding users in smart home scenarios has gradually become a significant and indispensable task. With the rapid development of deep learning theory, the use of deep learning algorithms to analyze user behavior habits in home scenarios and build user portraits is attracting researchers' interest. Through user portrait technology, researchers can extract rich user tags, combine them with clear data to analyze and understand users, and then provide personalized and customized services, truly enabling home devices to become intelligent.
[0003] In recent years, user profiling has been applied in many fields. For example, Webert and Syskill analyzed user satisfaction with websites using statistical analysis and built user interest models. With the development of machine learning and deep learning theories, Rahimi et al. used Logistic Regression and LPA algorithms to build a user geographic tag prediction model based on friend relationships by crawling interactive information from Weibo text. Bhtacharyya et al. used NLP technology to analyze keyword text in Facebook and explore the influence of friendship relationships in social interactions. However, existing user profiling technologies also have some shortcomings, mainly as follows:
[0004] (1) User profiling technology has been widely used in e-commerce, libraries and tourism, but it started later in healthcare, smart home and other fields, and there is less related research and practice.
[0005] (2) Traditional profiling methods are built on the premise of a large amount of sufficient data. However, in real-world applications, there are often situations where the amount of data is small, and there is a lack of solutions for the cold start problem.
[0006] In constructing household user profiles, researchers often need to start with device usage records to describe user behavior habits from as many angles as possible, extracting hidden information such as users' habitual preferences for specific devices. For devices that have been on the market for a long time, furniture manufacturers can obtain a large amount of usage record data from different users, feeding this data into a specific network for training to obtain meaningful classification results. However, for newly launched devices, due to the smaller amount of data, it is not possible to fully train the label classification network, resulting in poor fit and classification performance. Summary of the Invention
[0007] The purpose of this invention is to provide a new device cold start method for building smart home profiles, aiming to solve the problem of being unable to correctly label and classify the usage records of new devices used to build user profiles in small sample scenarios.
[0008] To achieve the above objectives, the present invention provides a novel device cold start method for constructing a smart home profile, comprising the following steps:
[0009] S1 partitions the historical data dataset of home appliances to obtain the input dataset;
[0010] S2 combines the label classification model and the meta-learning model and performs meta-training on the training task set to obtain the optimal initialization parameter set.
[0011] S3 generates a set of test tasks from the input dataset, performs meta-testing based on the optimal initialization parameter set, and obtains the label classification results;
[0012] S4 performs a cold start based on the label classification results.
[0013] The step of partitioning the historical data set of home appliances to obtain the input dataset includes:
[0014] The device's historical data dataset is divided into tasks to obtain the input dataset.
[0015] The label classification model is a Tsformer model, and the meta-learning model is a MAML model.
[0016] The Tsformer model includes a time series feature processing module and a channel feature extraction module.
[0017] The time series feature processing module includes a location encoding module, a multi-head attention module, two Add & LayerNorm modules, a fully connected neural network module, a merging module, a GRU gated recurrent neural network unit, a fully connected network, and a softmax classifier.
[0018] The step of combining the label classification model and the meta-learning model and then performing meta-training on the training task set to obtain the optimal initialization parameter set includes:
[0019] S21 combines the Tsformer model and the MAML model to obtain a meta-learning model;
[0020] S22 splits any Task sample in the training task set to obtain the first support set and the first query set;
[0021] S23 In the meta-learning model, the original initialization parameters are updated by one or more backpropagations through the first support set to obtain the parameters;
[0022] S24 In the meta-learning model, the parameters are fed into the first query set for testing, the loss is calculated, and the original initialization parameters are updated to obtain the optimal initialization parameters.
[0023] S25 repeats steps S22 to S24, training the preset number of Task samples to obtain the optimal initialization parameter set.
[0024] The step of generating a test task set from the input dataset and performing meta-testing based on the optimal initialization parameter set to obtain label classification results includes:
[0025] S31 generates a set of test tasks from the input dataset;
[0026] S32 splits the test task set to obtain a second support set and a second query set;
[0027] S33 Iterates the optimal initialization parameter set on the second support set once or several times to obtain the label classification result;
[0028] S34 evaluates the label classification results using the second query set to obtain the evaluation result.
[0029] This invention discloses a novel device cold-start method for constructing smart home profiles. It involves partitioning a historical data set of home devices to obtain an input dataset; combining a label classification model and a meta-learning model for meta-training on a training task set to obtain an optimal initialization parameter set; generating a test task set from the input dataset and performing meta-testing based on the optimal initialization parameter set to obtain label classification results; and performing a cold start based on these label classification results. The model of this invention can learn a set of universally applicable initialization parameters from historical data of other devices of the same type, enabling rapid iterative convergence and achieving good classification results even with limited new data. This solves the problem of correctly labeling and classifying the usage records of new devices used to construct user profiles in small sample scenarios. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a diagram showing the overall structure of the tag classification.
[0032] Figure 2 This is the structure diagram of the TSformer label classification model.
[0033] Figure 3 This is a diagram of the overall structure of the meta-learning model.
[0034] Figure 4 This is a flowchart of the meta-training process.
[0035] Figure 5 This is a flowchart of a new device cold start method for constructing a smart home profile, provided by the present invention. Detailed Implementation
[0036] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0037] Please see Figures 1 to 5 This invention provides a novel device cold start method for building smart home profiles, comprising the following steps:
[0038] S1 partitions the historical record dataset of home appliances to obtain an input dataset;
[0039] Specifically, the historical record dataset of the device is partitioned by task to obtain an input dataset.
[0040] Before meta-training, it is necessary to first partition the dataset by task. We first define various device historical record datasets D in the smart home scenario. This set contains the historical records of multiple devices, that is, D = {d1, d2, d3... d m}, where m is the number of device types. Next, randomly select s categories from it as the training task set, that is, D train = {d1, d2,... d s}, and the remaining m - s categories are used as the test task set, that is, D test = {d m-s+1 , d m-s+2 ,... d m}, where m - s < s. We also define the number of label categories as c, that is, the label set L = {l1, l2... l c}.
[0041] During the training process, we mainly use the training task set D train to update the initial parameters of the model by gradient descent. We process D train into several tasks, that is, D train = {task1, task2,..., task j}, where j is the number of tasks in the training phase. For each task, the internal records are of the same type of device, so that the model can have the knowledge transfer ability between different devices. Taking task1 as an example, its support set contains a total of k × n training data of k-way n-shot, where k ≤ c, as shown below:
[0042]
[0043] Among them For the k types included in the support set, they should be the same in the query set Queryset of task1. The partitioning method and device categories are the same as those of the support set. Through the above process, the partitioned D train and D testTo enable the model to learn from small sample data, since the test set after partitioning contains only a small number of labeled samples, TSformer learns a set of initialization parameters by performing multiple rounds of iterative updates on the training task set. These initialization parameters have strong adaptability and can achieve better results in classification tasks of other types of devices with only a small number of updates.
[0044] S2 combines the label classification model and the meta-learning model and performs meta-training on the training task set to obtain the optimal initialization parameter set.
[0045] Specifically, the label classification model is a Tsformer model, and the meta-learning model is a MAML model. The Tsformer model includes a time series feature processing module and a channel feature extraction module; the time series feature processing module includes a position encoding module, a Multi-Head Attention module, two Add & LayerNorm modules, a fully connected neural network module, a merging module, a GRU gated recurrent neural network unit, a fully connected network, and a softmax classifier.
[0046] Label classification model
[0047] The purpose of this invention is to use deep learning and meta-learning technologies to classify and label the historical usage records of home devices, and to solve the cold start problem caused by insufficient data when adding new devices. Considering the large variety of home devices, we provide different classifiers for each category. Each classifier can classify and label the corresponding device's historical data. The overall structure is as follows: Figure 1 As shown:
[0048] The historical records of home appliances can be viewed as a time series composed of various state information, i.e., input∈R C×T The data is organized in matrix form. The length of the matrix represents the time span, and the width represents the types of state information. Taking a curtain motor as an example, its processed matrix input can represent multi-dimensional information such as changes in opening and closing degree, on / off status, and power consumption within a certain time range. From a temporal perspective, the information represented by different channels influences each other as time changes. From a channel perspective, there is also a sequential order among data at different time points within the same channel. Fully extracting these dimensional features helps improve the model's classification performance. Our designed classification model, TSformer, has the following structure: Figure 2 As shown:
[0049] After collecting historical usage records for a single type of home appliance, the data is cleaned and filtered to select meaningful parameter records, forming a matrix. A sliding window method is then used to crop the data into a fixed size C×T, where C is the channel dimension and T is the time span of the segment. The time spans of the device usage records cropped by the sliding window are consistent. Next, the cropped C×T hourly segments are fed into the TSformer model for training. The left side primarily extracts time-series features, while the right side primarily extracts channel features. Since the processing modules on both sides are essentially the same, the following explanation uses the time-series feature processing module as an example:
[0050] We first preprocess the input data using positional encoding. The data segments after positional encoding contain sequential features, which helps the model extract features and obtain the output P. Then, it is fed into the Multi-HeadAttention module to extract the correlation between various time points in the complete time segment. The final output calculation of the multi-head attention layer is shown below:
[0051] Attention=,head1;head2;…head h W O
[0052] The calculation for each head is as follows:
[0053]
[0054]
[0055]
[0056]
[0057] in W O These are all parameter matrices that the model needs to learn. P is the input to the previous layer, i.e., P∈R. C×T .
[0058] After passing through two Add&LayerNorm modules and a fully connected neural network module, the output f of the left half is obtained. t Similarly, the right half of the module obtains the output f. c The two are then concatenated to obtain the total output F of the feature extraction stage. The calculation of F is as follows:
[0059] F = concat(f) t ,f c )
[0060] Next, the merged data is fed into the GRU gated recurrent neural network unit, as shown below, where F t The data at time point t in the output of the previous stage, i.e., F t ∈R 1×C H t-1 H is the output of the GRU unit at the previous time step. t This represents the output of the GRU unit at the current time. σ and tanh are both activation functions. r W z and These represent the matrix parameters used in the calculation process.
[0061] R t =σ(W r ·,H t-1 ,F t ])
[0062] Z t =σ(W z ·[H t-1 ,F t ])
[0063]
[0064] The output of each unit is shown below:
[0065]
[0066] Thus, we obtain the output G of each unit. t ∈R 1×hidden Where `hidden` represents the number of nodes in the hidden layer of the recurrent neural network, and `t = {1, 2, 3…T}`. The output is then fed into a fully connected network and a softmax classifier to obtain the final classification result.
[0067] Meta-learning model
[0068] In the field of meta-learning, a typical model based on optimization methods is MAML. MAML is a meta-learning approach, independent of the specific model used. Its main goal is to enable the model to learn a set of excellent initial parameters through one round of training on a training task, achieving good fitting ability on several tasks in the test set with only a few iterations. We constructed MAML-TSformer, with the overall structure as follows... Figure 3 As shown;
[0069] Figure 3In this model, all data is divided into training tasks and testing tasks, sharing the same base classifier model. During the training phase of MAML-TSformer, for a task in the training task set, the samples are further split into a support set for training and a query set for testing, with initial parameters Θ... init The parameters can be randomly initialized and then updated through one or more backpropagation steps in the support set. Will The query set is fed into the test, the loss is calculated, and then the original initialization parameter Θ is updated. init After several rounds of updates and iterations on the training set task, the model generalized to a good set of initialization parameters Θ. init This parameter can converge quickly in the test phase task with only one or a few iterations, enabling the model to achieve high performance on new tasks.
[0070] The process of combining the label classification model and the meta-learning model and then performing meta-training on the training task set to obtain the optimal initial parameter set includes:
[0071] S21 combines the Tsformer model and the MAML model to obtain the meta-learning (MAML-TSformer) model;
[0072] S22 splits any Task sample in the training task set to obtain the first support set and the first query set;
[0073] S23 In the MAML-TSforme model, the original initialization parameters are updated through one or more backpropagation steps via the first support set to obtain the parameters;
[0074] Specifically, when the model is trained on the training task set, the error we calculate is the error on the query set after several rounds of gradient descent updates, as shown below:
[0075]
[0076] Where Θ init For initialization parameters, For Θ init The parameters obtained after one round of gradient descent and backpropagation update on the support set of the j-th task. for The error obtained on the query set of the j-th task, where J is the number of tasks in the entire training task set, is summed to obtain the total error L. init ).
[0077] Next, consider how to determine the total error L(Θ) init ) to Θ init For the update, we still use gradient descent and backpropagation, as shown below:
[0078]
[0079] Where η is the learning rate used in the meta-training phase, since It is composed of Θ init The result is as follows:
[0080]
[0081] S24 In the MAML-TSforme model, the parameters are fed into the first query set for testing, the loss is calculated, and the original initialization parameters are updated to obtain the optimal initialization parameters.
[0082] Specifically, ε is Θ init The learning rate used when learning the support set for the current task. We consider how to adjust Θ. init Update as follows:
[0083]
[0084] Some of its structural components are shown below:
[0085]
[0086] Let's take the i-th parameter in the original TSformer model as an example and calculate its partial derivative, as shown below:
[0087]
[0088]
[0089] When i ≠ k:
[0090]
[0091] When i = k:
[0092]
[0093] Therefore, the following formula is obtained:
[0094]
[0095] That is, according to L(Θ) init ) for Θ init When updating, it is necessary to Differentiate it with itself, then use Θ init Simply update in the corresponding direction.
[0096] After training is complete, we obtain an initialization parameter Θ with good generalization performance. init This parameter can achieve good performance on the query set after a single gradient descent update across multiple task support sets. The meta-training process is as follows: Figure 4 As shown.
[0097] S25 repeats steps S22 to S24, training the preset number of Task samples to obtain the optimal initialization parameter set.
[0098] S3 generates a set of test tasks from the input dataset, performs meta-testing based on the optimal initialization parameter set, and obtains the label classification results;
[0099] The specific method is as follows:
[0100] S31 generates a set of test tasks from the input dataset;
[0101] S32 splits the test task set to obtain a second support set and a second query set;
[0102] S33 Iterates the optimal initialization parameter set on the second support set once or several times to obtain the label classification result;
[0103] S34 evaluates the label classification results using the second query set to obtain the evaluation result.
[0104] Specifically, in the meta-testing phase, we start from D test ={d m-s+1 ,d m-s+2 ,…d m Several task sets are generated in the process, and after the meta-training phase, the model finds initialization parameters Θ with good generalization performance. init We use this parameter as the initialization parameter during meta-testing. For the support set in the testing phase, which consists of only a small number of samples, we use Θ. init Perform one or more iterations on the support set, followed by evaluation using the query set.
[0105] S4 performs a cold start based on the label classification results.
[0106] This invention proposes a novel device cold-start method for constructing user profiles in smart homes. First, a basic time-series classification model is proposed, employing a multi-head self-attention mechanism, a fully connected network, and gating units to fuse extracted time-dimensional and channel-dimensional features, improving the classification performance of time-series segments. Next, a framework suitable for the small-sample cold-start problem is proposed. First, the dataset is combined according to certain rules during data preprocessing. Then, a small-sample time-series classification model is constructed by combining MAML and model-independent meta-learning methods. The model can learn a set of universally applicable initialization parameters from historical data of other devices of the same type, enabling rapid iterative convergence and achieving good classification results even with only a small amount of new data.
[0107] Beneficial effects
[0108] A foundational model for temporal segment classification, TSformer, is proposed. This model can fuse temporal and channel-dimensional features, thereby improving classification accuracy.
[0109] The MAML-TSformer model is proposed. The model can learn a set of well-adaptive initialization parameters and can quickly converge and iterate on new tasks, achieving good results in temporal segment classification.
[0110] A novel device cold start method for building smart home profiles is proposed. This method can quickly train and iterate on a small amount of data when a new device is added, and quickly label and classify the historical usage data fragments of the device.
[0111] The technical innovations of this invention are described below:
[0112] (1) The proposed basic model TSformer for time segment classification processes the device using recorded segments separately. The left side is processed by position encoding to extract time dimension features, and the right side is processed by a multi-investment attention mechanism and a fully connected network to extract channel axis features. After merging, the features are fed into the GRU gating unit, which improves the model classification accuracy.
[0113] (2) The MAML-TSformer model is proposed. Based on the meta-learning method, the basic model is integrated with MAML, and the dataset is pre-processed to process the data in a Task into fragments of the same device, so that the model can learn a set of initialization parameters with good generalization performance during the meta-training stage.
[0114] (3) A new device cold start method for constructing smart home profiles is proposed. In the meta-testing stage, when faced with a small number of fragment samples of new devices, the initial parameters with good generalization performance after learning can quickly converge iteratively and achieve good label classification results.
[0115] The above-disclosed embodiments are merely preferred embodiments of a novel device cold start method for constructing smart home profiles according to the present invention. They should not be construed as limiting the scope of the present invention. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A novel device cold start method for constructing smart home profiles, characterized in that, Includes the following steps: S1 partitions the historical data dataset of home appliances to obtain the input dataset; S2 combines the label classification model and the meta-learning model and performs meta-training on the training task set to obtain the optimal initialization parameter set. The label classification model is the TSformer model, and the meta-learning model is the MAML model; S3 generates a set of test tasks from the input dataset, performs meta-testing based on the optimal initialization parameter set, and obtains the label classification results; S4 performs a cold start based on the label classification results; The process of combining the label classification model and the meta-learning model and then performing meta-training on the training task set to obtain the optimal initial parameter set includes: S21 combines the Tsformer model and the MAML model to obtain a meta-learning model; S22 splits any Task sample in the training task set to obtain the first support set and the first query set; S23 In the meta-learning model, the original initialization parameters are updated by one or more backpropagations through the first support set to obtain the parameters; S24 In the meta-learning model, the parameters are fed into the first query set for testing, the loss is calculated, and the original initialization parameters are updated to obtain the optimal initialization parameters. S25 repeats steps S22 to S24, training the preset number of Task samples to obtain the optimal initialization parameter set.
2. The novel device cold start method for constructing a smart home profile as described in claim 1, characterized in that, The historical data dataset of home appliances is partitioned to obtain the input dataset, which includes: The device's historical data dataset is divided into tasks to obtain the input dataset.
3. The novel device cold start method for constructing a smart home profile as described in claim 1, characterized in that, The TSformer model includes a time series feature processing module and a channel feature extraction module. The time-series feature processing module includes a location encoding module, a Multi-Head Attention module, and two... Modules, fully connected neural network modules, merging modules, GRU gated recurrent neural network units, fully connected networks, and softmax classifiers.
4. The novel device cold start method for constructing a smart home profile as described in claim 1, characterized in that, The step of generating a test task set from the input dataset and performing meta-testing based on the optimal initialization parameter set to obtain label classification results includes: S31 generates a set of test tasks from the input dataset; S32 splits the test task set to obtain a second support set and a second query set; S33 Iterates the optimal initialization parameter set on the second support set once or several times to obtain the label classification result; S34 evaluates the label classification results using the second query set to obtain the evaluation result.
Citation Information
Patent Citations
Few-sample image sentiment classification method based on meta-learning
CN112613556A
Deep-learning-based public opinion hotspot category classification method
WO2018218708A1