Training method, prediction method, training device, and prediction device
Patent Information
- Application Number
- CN202211405685.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-11-10
AI Technical Summary
因此,虽然一些场景存在一定的相似性,但是某个场景对应的模型都无法应用于其他场景
[0028] The technical solution provided in this disclosure can include a second latent variable in the model corresponding to the target scene. Based on the second latent variable, the model can obtain the feature distribution similarity between feature data from multiple scenes. Based on the similarity of feature distribution between feature data from multiple scenes, even when training data for the target scene is missing or scarce, a model corresponding to the target scene with better performance can still be obtained based on the features of multiple scenes.
Smart Images

Figure CN115526278B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of machine learning technology, specifically to a training method, a prediction method, a training device, and a prediction device. Background Technology
[0002] In some machine learning practices, different models can be obtained through independent machine learning processes for different scenarios. These models are different from each other, and each model is only relevant to its corresponding scenario. Therefore, although some scenarios may have certain similarities, a model corresponding to one scenario cannot be applied to other scenarios. For example, for a certain scenario, if the training data is missing or insufficient, it is difficult to obtain a model adapted to that scenario based on models corresponding to other scenarios. Summary of the Invention
[0003] In view of this, the present disclosure provides a training method, a prediction method, a training device, and a prediction device. The various aspects covered by this disclosure are described below.
[0004] In a first aspect, this disclosure provides a training method, the method comprising: acquiring training data, the training data including feature data of multiple scenarios; training a model corresponding to a target scenario among the multiple scenarios based on the training data, and obtaining a training loss; updating the model corresponding to the target scenario based on the training loss; wherein the model corresponding to the target scenario includes a variational autoencoder, the variational autoencoder including an inference model and a generative model, the inference model being used to generate a first latent variable and a second latent variable, the first latent variable being generated based on the feature data of the target scenario, the second latent variable being generated based on the feature data of the multiple scenarios, the generative model being used to expand the feature data of the target scenario based on the first latent variable and the second latent variable, the second latent variable being used to determine the similarity of feature distributions among the feature data of the multiple scenarios, and the first latent variable and / or the second latent variable being used to generate a low-dimensional representation of the feature data of the target scenario.
[0005] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0006] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0007] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0008] Optionally, the training data may be one or more of image data, audio data, text data, and video data.
[0009] Secondly, this disclosure provides a prediction method, the method comprising: acquiring data to be predicted, the data to be predicted including feature data of a target scene in multiple scenarios; inputting the data to be predicted into a model corresponding to the target scene to obtain a prediction result corresponding to the data to be predicted, the model corresponding to the target scene including a variational autoencoder; wherein, the model corresponding to the target scene is trained using feature data of multiple scenarios, the variational autoencoder includes an inference model and a generative model, the inference model is used to generate a first latent variable and a second latent variable, the first latent variable is generated based on the feature data of the target scene, the second latent variable is generated based on the feature data of the multiple scenarios, the generative model is used to expand the feature data of the target scene based on the first latent variable and the second latent variable, the second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenarios, and the first latent variable and / or the second latent variable is used to generate a low-dimensional representation of the feature data of the target scene.
[0010] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0011] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0012] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0013] Optionally, the data to be predicted is one or more of image data, audio data, text data, and video data.
[0014] Thirdly, this disclosure provides a training apparatus, comprising: a first acquisition unit for acquiring training data, the training data including feature data of multiple scenes; a training unit for training a model corresponding to a target scene among the multiple scenes based on the training data, and obtaining a training loss; and an update unit for updating the model corresponding to the target scene based on the training loss; wherein the model corresponding to the target scene includes a variational autoencoder, the variational autoencoder including an inference model and a generative model, the inference model generating a first latent variable and a second latent variable, the first latent variable being generated based on the feature data of the target scene, the second latent variable being generated based on the feature data of the multiple scenes, the generative model expanding the feature data of the target scene based on the first latent variable and the second latent variable, the second latent variable being used to determine the similarity of feature distributions among the feature data of the multiple scenes, and the first latent variable and / or the second latent variable being used to generate a low-dimensional representation of the feature data of the target scene.
[0015] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0016] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0017] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0018] Optionally, the training data may be one or more of image data, audio data, text data, and video data.
[0019] Fourthly, this disclosure provides a prediction device, the device comprising: a second acquisition unit for acquiring data to be predicted, the data to be predicted including feature data of a target scene in multiple scenes; and a prediction unit for inputting the data to be predicted into a model corresponding to the target scene to obtain a prediction result corresponding to the data to be predicted, the model corresponding to the target scene including a variational autoencoder; wherein the model corresponding to the target scene is trained using feature data from multiple scenes, the variational autoencoder includes an inference model and a generation model, the inference model is used to generate a first latent variable and a second latent variable, the first latent variable being generated based on the feature data of the target scene, the second latent variable being generated based on the feature data of the multiple scenes, the generation model being used to expand the feature data of the target scene based on the first latent variable and the second latent variable, the second latent variable being used to determine the similarity of feature distributions among the feature data of the multiple scenes, and the first latent variable and / or the second latent variable being used to generate a low-dimensional representation of the feature data of the target scene.
[0020] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0021] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0022] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0023] Optionally, the data to be predicted is one or more of image data, audio data, text data, and video data.
[0024] Fifthly, a training apparatus is provided, comprising: a memory storing executable code; and a processor configured to execute the executable code to implement the method described in the first aspect.
[0025] A sixth aspect provides a prediction apparatus, comprising: a memory storing executable code; and a processor configured to execute the executable code to implement the method of the second aspect.
[0026] In a seventh aspect, a computer-readable storage medium is provided having executable code stored thereon, which, when executed, enables the implementation of the method as described in the first or second aspect.
[0027] Eighthly, a computer program product is provided, including executable code that, when executed, enables the implementation of the method as described in the first or second aspect.
[0028] The technical solution provided in this disclosure can include a second latent variable in the model corresponding to the target scene. Based on the second latent variable, the model can obtain the feature distribution similarity between feature data from multiple scenes. Based on the similarity of feature distribution between feature data from multiple scenes, even when training data for the target scene is missing or scarce, a model corresponding to the target scene with better performance can still be obtained based on the features of multiple scenes. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of a DAG for a generative model provided in an embodiment of this disclosure.
[0030] Figure 2 for Figure 1 A schematic diagram of the decomposed DAG.
[0031] Figure 3 This is a schematic flowchart of a training method provided for a disclosed embodiment.
[0032] Figure 4 This is a schematic diagram of the input and output structure corresponding to the generative model provided in the embodiments of this disclosure.
[0033] Figure 5A This is a schematic diagram of the input-output structure corresponding to the inference model provided in the embodiments of this disclosure.
[0034] Figure 5B This is a schematic diagram of the input-output structure corresponding to an inference model provided in another embodiment of this disclosure.
[0035] Figure 6 A schematic flowchart illustrating the prediction method provided in the embodiments of this disclosure.
[0036] Figure 7 This is a schematic diagram of the framework including a training module and a prediction model provided for embodiments of this disclosure.
[0037] Figure 8 This is a schematic structural diagram of a training device provided in an embodiment of this disclosure.
[0038] Figure 9 This is a schematic structural diagram of a prediction device provided in an embodiment of the present disclosure.
[0039] Figure 10 This is a schematic diagram of the structure of an apparatus provided in another embodiment of this disclosure. Detailed Implementation
[0040] The technical solutions in the embodiments of this disclosure will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments.
[0041] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0042] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0043] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.
[0044] In some machine learning practices, different scenarios can be addressed using independent machine learning processes to obtain models corresponding to those scenarios. These models are distinct from each other, each only relevant to its specific scenario. Therefore, although some scenarios may share certain similarities, a model for one scenario cannot be applied to others. For example, if training data is missing or limited for a particular scenario, it is difficult to obtain a model suitable for that scenario based on models from other scenarios.
[0045] This explanation uses one or more of the following as examples: image data, audio data, text data, and video data. The training data or prediction data can be user-related data, such as one or more of these. The scenario can be user-related. For example, scenarios could include personalized recommendation scenarios or financial scenarios. Personalized recommendation scenarios can also include various scenarios, such as personalized product recommendation scenarios, personalized advertising recommendation scenarios, and personalized music recommendation scenarios. Financial scenarios can include various scenarios, such as user credit rating assessment scenarios, loan limit assessment scenarios, and financial risk assessment scenarios. In each of these scenarios, corresponding data can be obtained by training with user-related data. It is understandable that, due to the different scenarios, even for the same user group, a model for one scenario cannot be applied to a model for another scenario. For example, a model for user credit rating assessment scenarios cannot be applied to loan limit assessment scenarios for the same user group.
[0046] To address the aforementioned issues, this disclosure provides a machine learning model.
[0047] The training data used to train this model can include data from multiple scenarios. In other words, the model provided in this disclosure can be obtained by relying on full data from multiple scenarios.
[0048] In some embodiments, the training data may include scene labels corresponding to the scenes. That is, different scenes can be distinguished by scene labels. A scene label can be represented by, for example, k, which can take values from {1, ..., K}, where K is an integer greater than 1.
[0049] In some embodiments, training data may include feature data. Feature data can correspond to input data or data to be predicted during the prediction process. Feature data can be represented by the symbol x, where x can be a d-dimensional feature vector. d can be an integer greater than 0. The set of all feature data in scene k can be represented by X. k This indicates that X... It is understandable that... k It can be in A matrix that takes values from the given values.
[0050] In some embodiments, training data may include label data corresponding to feature data. Label data may correspond to output data or prediction results during the prediction process. Label data can be represented by the symbol y. Taking a binary classification model as an example, y can be the binary classification label, and the value of y can be 0 or 1. The set of all label data in scene k can be represented by Y. k Representation. For example, for a binary classification model, Y k It can be in A vector that takes values from the given values.
[0051] As one implementation method, data from multiple scenarios can be obtained through dataset D. k =(X k Y k , k) represents. In other words, the training data for the model can include D k =(X k Y k ,k).
[0052] The machine learning model disclosed herein can be mapped to a target scenario. That is, the machine learning model can be applied to the target scenario. In some embodiments, the scenario can also be referred to as a domain.
[0053] The data used to train this machine learning model can involve multiple scenarios. The target scenario can be one of these scenarios. Alternatively, in some embodiments, the target scenario can also be called a generalized scenario. That is, the target scenario can be a scenario generalized from multiple scenarios. The model corresponding to the target scenario can generalize multiple scenarios into a single model for processing, thereby enabling one model to handle data from multiple scenarios. In other words, the model involved in this disclosure can be a multi-domain transfer learning model.
[0054] It should be noted that multiple scenarios can share certain similarities. For example, multiple scenarios may all be related to a user group. For instance, multiple scenarios may target the same or similar customer groups. It is understood that the model disclosed herein can be a homogeneous multi-domain transfer learning model.
[0055] As one implementation method, the machine learning model provided in this disclosure can be implemented based on a variational autoencoder (VAE).
[0056] VAEs are unsupervised generative models in deep learning. They can perform low-dimensional generative modeling of the data distribution p(x) of the input feature data x. VAEs can include inference models (also known as encoders) and generative models (also known as decoders).
[0057] Inference models can encode input data as latent variables. These latent variables can be variables that cannot be observed in the model. They can be random variables. In VAEs, the distribution of latent variables can be hypothesized using prior distributions. In other words, the prior distribution can be an assumption about the distribution of a latent variable without training data.
[0058] Taking a VAE including a first latent variable z as an example, the input feature data x can be encoded as the first latent variable z. The single-point latent variable z can follow a prior distribution p(z). The feature data distribution can be determined by the conditional distribution p(x|z). To introduce higher model capacity, the parameters of the conditional distribution p(x|z) can be determined by the neural network model. Given. Where μ1 can be a mean network, and θ can be the generation parameters. This can be a hyperparameter used to control the tolerance for model error. Due to the complexity of hypothesis generation in VAEs, the standard Expectation-Maximization (EM) algorithm is not available. To address this issue, VAEs parameterize the posterior distribution used for inference into an optimizable model. The variational lower bound is used as the optimization objective to optimize the variational parameter φ. Through an additional reparameterization process, the two-stage EM algorithm can be fused into a one-stage sampling-based SGVB algorithm, while simultaneously optimizing the generation parameter θ and the variational parameter φ.
[0059] It is understandable that the prior distribution of latent variables can be a low-dimensional distribution. Therefore, encoding the input data as latent variables can yield a low-dimensional representation of the input data.
[0060] During the training of the model, after observing the random variables that are correlated with the latent variables, Bayes' theorem can be used to give the conditional distribution of the latent variables, which can be called the posterior distribution of the latent variables.
[0061] Generative models allow for the selection and decoding of data that conforms to the latent variable distribution, generating data similar to the input data. Therefore, it's understandable that VAEs can introduce higher model capacity.
[0062] In some embodiments, the inference model can be used to generate one or more first latent variables. When the number of first latent variables is one, the first latent variables can also be called single-point latent variables.
[0063] In some embodiments, the model proposed in this disclosure can be implemented based on a VAE variant. For example, the model proposed in this disclosure can be implemented based on a Conditional VAE (CVAE). A CVAE is a VAE variant that combines feature data with corresponding label data. A CVAE can be adapted to a conditional distribution p(x|y), where x can represent feature data and y can represent label data.
[0064] This disclosure proposes that an inference model can be used to generate a first latent variable and a second latent variable. The second latent variable can be used to determine the similarity of feature distributions among feature data from multiple scenes. The first latent variable and / or the second latent variable can be used to generate a low-dimensional representation of feature data from a target scene. The first latent variable can be generated based on feature data and / or label data from the target scene. The second latent variable can be generated based on feature data and / or label data from multiple scenes.
[0065] Therefore, the first latent variable can be determined based on the feature data of a specific scenario from multiple scenarios. The second latent variable can be determined based on the feature data of multiple scenarios. In other words, the first latent variable can depend on the feature data of the target scenario, while the second latent variable can depend on the feature data of multiple scenarios. Optionally, the second latent variable can depend on the full data of multiple scenarios. Therefore, the first latent variable is valid in the target scenario, and the second latent variable is valid in multiple scenarios.
[0066] Understandably, the second latent variable can be a shared latent variable across multiple scenarios. In other words, the second latent variable can be scenario-independent and unaffected by scenario changes. Based on the second latent variable, different scenarios can share the same input space.
[0067] The model corresponding to the target scene may include a second latent variable. Based on the second latent variable, the model can obtain the feature distribution similarity between feature data from multiple scenes. Based on the similarity of feature distributions between feature data from multiple scenes, even when training data for the target scene is missing or scarce, a model corresponding to the target scene with good performance can still be obtained based on feature data from multiple scenes. Furthermore, the target scene can be a generalized scene adapted to multiple scenarios; that is, the model provided in this disclosure can be applied to a variety of different scenarios.
[0068] Taking the training data or prediction data of the model as one or more of image data, audio data, text data, and video data as an example, and assuming that the training data or prediction data can be user-related data, the model provided in this disclosure can be applied to various personalized recommendation scenarios or various financial scenarios. For example, data from user credit rating assessment scenarios, loan limit assessment scenarios, and financial risk assessment scenarios can all be used to train the model corresponding to the financial risk assessment scenario. This allows the model corresponding to the financial risk assessment scenario to learn from similar features of the credit rating assessment scenario and the loan limit assessment scenario, thereby improving the model's prediction performance. Alternatively, the model can be trained using data from personalized product recommendation scenarios, personalized music recommendation scenarios, and personalized advertising recommendation scenarios to obtain a generalized model applicable to personalized recommendation scenarios (including personalized product recommendation scenarios, personalized music recommendation scenarios, and personalized advertising recommendation scenarios).
[0069] The prior distribution of the first latent variable can conform to a normal distribution. The prior distribution of the second latent variable can also conform to a normal distribution. Taking the first latent variable as z and the second latent variable as c as an example, the prior distribution p(z) of the first latent variable z can satisfy p(z) = N(0, I), and the prior distribution p(c) of the second latent variable c can satisfy p(c) = N(0, I). Here, N can represent a multivariate normal distribution.
[0070] In some embodiments, the label data corresponding to the feature data may be unobservable (or missing). When some label data corresponding to the feature data in multiple scenarios is unobservable, the generative model can generate a third latent variable, which can be used to generate a low-dimensional representation of the label data.
[0071] It is understandable that, similar to the second latent variable, the third latent variable can also be scenario-independent, meaning it does not change with changes in the scenario. Therefore, in some embodiments, the second latent variable and / or the third latent variable can be referred to as scenario variables.
[0072] When the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable can conform to the Beta distribution, and the prior distribution of the label data can conform to the Bernoulli distribution. Taking the third latent variable as represented by π as an example, the prior distribution of the third latent variable π can satisfy p(π) = Beta(0,1). If the label data is represented by y, then p(y) = Bern(π). Here, Beta represents the Beta distribution, and Bern represents the Bernoulli distribution.
[0073] Taking the binary classification problem mentioned earlier as an example, the following will combine... Figure 1 This invention describes the generative model provided by the present invention. Figure 1 This is a schematic diagram of a Directed Acyclic Graph (DAG) for a generative model provided in an embodiment of this disclosure.
[0074] Figure 1 The generative model shown may include: p(z) = N(0, I); p(c) = N(0, I); p(π) = Beta(0, 1); p(y) = Bern(π), p(x|y, c, z) = N(μ1(Concat(y, c, z);θ), σ1 2 Here, p(z), p(c), and p(π) can be the prior distributions of the first latent variable z, the second latent variable c, and the third latent variable π, respectively. Beta and Bern represent the Beta distribution and the Bernoulli distribution, respectively. Concat is the vector concatenation operator, and θ can contain all the parameters of the generative model.
[0075] like Figure 1 As shown, latent variables can include (z) i y i c k , π k (). Here, k can represent the scene label, and k can take values in {1, ..., K}, where K is an integer greater than 1. z i This can represent the first hidden variable of the field. k It can represent the second hidden variable. π k It can represent a third hidden variable. y i It can represent the label data under scene k. For a binary classification model, y i The value of y can be 0 or 1. i It may be partially observable. i can belong to N. k N k It can represent the identifier of feature data in scenario k.
[0076] like Figure 1 As shown, the first hidden variable z i Located within the rectangle defined by scene k, i.e., z i It is related to scene k. The second hidden variable c k and the third hidden variable π k Located outside the rectangle defined by scene k, i.e., the second latent variable c. k and the third hidden variable π k It is independent of scene k.
[0077] According to the VAE training framework, an approximate posterior distribution needs to be constructed for all latent variables. When y i When missing, the approximate distribution of this posterior distribution is as follows: q(Y) k Z k ,c k ,π k |x i ,X k ); when y i When observed, the posterior distribution is approximately of the form q(Z). k ,c k , π k |x i ,y i ,X k ,Y k ). (X) k ,Y k The reason for introducing the posterior distribution condition is due to the scene variable (c) k ,π k Dependence on the full dataset. If some label data is missing, Y... kThis can refer to a subset of the observed label data. In the family of variational distributions used for approximate calculations, it is assumed that the above distribution can have the following decomposition structure: Given that the label data is observable, When the labeled data is unobservable Wherein, s(X k ) can be a function of the full feature data of the scene. For example, s(X) k It can be constructed to depend on X. k Quantiles of each univariate feature. Or, s(X k It can be constructed as something that directly acts on N k Pooling results along the dimension. q(z) i |x i ,c k ) can be used as the first latent variable inference model. q(c k |s(X k This can be a second latent variable inference model, i.e., a scenario variable inference model. Figure 2 for Figure 1 A schematic diagram of a DAG based on the above decomposition structure.
[0078] Figure 3 This is a schematic flowchart illustrating a training method based on the above model, provided as an embodiment of this disclosure. Figure 3 The method shown may include steps S310 to S330.
[0079] Step S310: Obtain training data.
[0080] Training data can contain feature data from multiple scenarios. Training data can also include label data corresponding to the feature data.
[0081] Step S320: Train the model corresponding to the target scene based on the training data to obtain the training loss.
[0082] The target scene can be one of multiple scenes.
[0083] The objective function for training can be, for example, the Evidence Lower Bound (ELBO). For instance, the objective function could include:
[0084]
[0085] The above objective can be achieved by reparameterizing the variational parameter φ from the expectation operator in the objective function estimated by Stochastic Gradient Variational Bayes (SGVB), allowing the gradient to be directly backpropagated. The training process can then produce a generative model p. θ(Also known as decoder) and inference model q φ (Also known as an encoder.)
[0086] Step S330: Update the model corresponding to the target scene based on the training loss.
[0087] Figure 4 The generative model p provided in the embodiments of this disclosure θ The corresponding input / output structure diagram. Figure 4 The multi-layer perceptron (MLP) shown can represent the generative model p. θ θ can contain the generative model p θ All parameters of the generated model p. θ The input can be the first hidden variable z i The second hidden variable c k and the third hidden variable y i The output of the generative model can be the feature data x i .
[0088] Figure 5A and Figure 5B The inference models q provided in the embodiments of this disclosure are respectively φ The corresponding input / output structure diagram. φ can represent the inference model q. φ All parameters. Figure 5A The neural network shown can represent an inference model q based on the observability of some or all of the labeled data. φ . Figure 5B The neural network shown can represent an inference model q for unobservable labeled data. φ .exist Figure 5A In the inference model q φ The input can be feature data x i Inference model q φ The output can be the probability distribution q of the first hidden variable z. z And the probability distribution q of the second hidden variable c c .exist Figure 5B In the inference model q φ The input can be feature data x i and tag data yi Inference model q φ The output can be the probability distribution q of the first hidden variable z. z The probability distribution q of the second hidden variable c c and the third hidden variable y probability distribution q y .
[0089] Figure 6This is a schematic flowchart illustrating a prediction method based on the above model, provided as an embodiment of this disclosure. Figure 6 The method shown may include steps S610 to S620.
[0090] Step S610: Obtain the data to be predicted.
[0091] The data to be predicted includes feature data of the target scene in multiple scenarios.
[0092] Step S620: Input the data to be predicted into the model corresponding to the target scene to obtain the prediction result corresponding to the data to be predicted.
[0093] The model corresponding to the target scene can include a Variational Autoencoder (VAE). This model is trained using feature data from multiple scenes. The VAE includes an inference model and a generative model. The inference model generates a first latent variable and a second latent variable. The generative model expands the feature data of the target scene based on the first and second latent variables. The first latent variable generates a low-dimensional representation of the target scene's feature data, and the second latent variable determines the similarity of feature distributions among the feature data from multiple scenes. The first latent variable is determined based on the feature data of the target scene, and the second latent variable is determined based on the feature data from multiple scenes. In one implementation, the VAE can be a CVAE.
[0094] The data to be predicted may include feature data, and the prediction result may include, for example, the label data corresponding to the feature data. That is, after inputting the feature data into the model, the model can predict the label data corresponding to the feature data. In one implementation, the data to be predicted may include all feature data and some label data. The prediction result corresponding to the data to be predicted may include all feature data and all label data. It is understood that the prediction method provided in this disclosure can supplement the label data corresponding to the feature data.
[0095] As mentioned above, during training, both a generative model and an inference model can be generated. During prediction, the prediction result can be obtained by mixing the trained generative and inference models.
[0096] The target scene can be (X) m Y m ). X m Y can represent the set of feature data in the target scene m. m It can represent a collection of label data in scenario m.
[0097] In some cases, the target scene m may be unlabeled data. In these cases, the prediction distribution can be:
[0098] In some cases, the target scene m may lack labeled data. When the target scene lacks labeled data, Y... m The label can represent the observables, and for missing yj, a predicted distribution can be used:
[0099] The training method described above can be implemented using a training module, and the prediction method can be implemented using a prediction module. The training module can be used to implement the training method described above, and the prediction module can be used to implement the prediction method described above. Figure 7 This is a schematic diagram of the framework including a training module and a prediction model provided for embodiments of this disclosure.
[0100] Training data from multiple scenarios {X k Y k The training data and hyperparameters can be input into the training module 710. The value of k can be {1, ..., K}, where K is an integer greater than 1. In other words, the training data can come from K scenarios.
[0101] After training is complete, the training module can output the generated model p. θ and inference model q φ Based on generative model p θ and inference model q φ The prediction module 720 can predict the data for scene m. Scene m can be one of multiple scenes. The data for scene m can include {X} m Y m}, where Y m It can be completely or partially missing. Y can be obtained through prediction module 720. m .
[0102] It should be noted that this application does not limit the software, hardware, or computer language used to implement the above methods. For example, the above methods can be implemented based on open-source frameworks (such as PyTorch, TensorFlow, etc.).
[0103] The above combination Figures 1 to 7 The method embodiments provided in this disclosure are described below. Figures 8-10 This disclosure introduces embodiments of the apparatus provided. It should be understood that the apparatus embodiments and the method embodiments correspond to each other. For any details not described in the apparatus embodiments, please refer to the corresponding descriptions in the method embodiments.
[0104] Figure 8 This is a schematic structural diagram of a training device 800 provided in an embodiment of this disclosure. The training device 800 may include a first acquisition unit 810, a training unit 820, and an update unit 830.
[0105] The first acquisition unit 810 is used to acquire training data, which includes feature data of multiple scenes; the training unit 820 is used to train a model corresponding to the target scene among the multiple scenes according to the training data, and obtain a training loss; the update unit 830 is used to update the model corresponding to the target scene according to the training loss; wherein, the model corresponding to the target scene includes a variational autoencoder, the variational autoencoder includes an inference model and a generative model, the inference model is used to generate a first latent variable and a second latent variable, the first latent variable is generated according to the feature data of the target scene, the second latent variable is generated according to the feature data of the multiple scenes, the generative model is used to expand the feature data of the target scene according to the first latent variable and the second latent variable, the second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenes, and the first latent variable and / or the second latent variable is used to generate a low-dimensional representation of the feature data of the target scene.
[0106] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0107] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0108] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0109] Optionally, the training data may be one or more of image data, audio data, text data, and video data.
[0110] Figure 9 This is a schematic structural diagram of a prediction device 900 provided in an embodiment of the present disclosure. The prediction device 900 may include a second acquisition unit 910 and a prediction unit 920.
[0111] The second acquisition unit 910 is used to acquire data to be predicted, which includes feature data of a target scene in multiple scenarios; the prediction unit 920 is used to input the data to be predicted into the model corresponding to the target scene to obtain the prediction result corresponding to the data to be predicted, wherein the model corresponding to the target scene includes a variational autoencoder; wherein the model corresponding to the target scene is trained by feature data of multiple scenarios, the variational autoencoder includes an inference model and a generation model, the inference model is used to generate a first latent variable and a second latent variable, the first latent variable is generated based on the feature data of the target scene, the second latent variable is generated based on the feature data of the multiple scenarios, the generation model is used to expand the feature data of the target scene based on the first latent variable and the second latent variable, the second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenarios, and the first latent variable and / or the second latent variable is used to generate a low-dimensional representation of the feature data of the target scene.
[0112] Optionally, when some of the label data is unobservable, the generative model is also used to generate a third latent variable, which is used to generate a low-dimensional representation of the label data.
[0113] Optionally, if the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
[0114] Optionally, the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
[0115] Optionally, the data to be predicted is one or more of image data, audio data, text data, and video data.
[0116] Figure 10 This is a schematic diagram of the structure of an apparatus provided in another embodiment of this disclosure. Figure 10 The illustrated device 1000 may be a device capable of performing the training and / or prediction methods described above. The device 1000 may, for example, be a computing device with computational capabilities. For instance, the device 1000 may be a mobile terminal or a server. The device 1000 may include a memory 1010 and a processor 1020. The memory 1010 may be used to store executable code. The processor 1020 may be used to execute the executable code stored in the memory 1010 to implement the steps in the various methods described above. In some embodiments, the device 1000 may further include a network interface 1030 through which data exchange between the processor 1020 and external devices can be achieved.
[0117] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any other combination. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).
[0118] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments of this disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0119] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0122] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A training method, comprising: Acquire training data, which includes feature data from multiple scenes, and the training data is one or more of image data, audio data, text data, and video data; Based on the training data, a model corresponding to the target scene in the multiple scenarios is trained to obtain the training loss; Update the model corresponding to the target scene based on the training loss; The model corresponding to the target scene includes a variational autoencoder, which includes an inference model and a generative model. The inference model generates a first latent variable and a second latent variable. The first latent variable is generated based on the feature data of the target scene, and the second latent variable is generated based on the feature data of the multiple scenes. The generative model expands the feature data of the target scene based on the first latent variable and the second latent variable. The second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenes. The first latent variable and / or the second latent variable are used to generate a low-dimensional representation of the feature data of the target scene.
2. The method according to claim 1, wherein the training data further includes label data corresponding to the feature data, and in the case that some of the label data is unobservable, the inference model is further used to generate a third latent variable, the third latent variable being used to generate a low-dimensional representation of the label data.
3. According to the method of claim 2, when the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
4. The method according to claim 1, wherein the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
5. A prediction method, comprising: Acquire the data to be predicted, which includes feature data of the target scene in multiple scenarios, and the data to be predicted is one or more of image data, audio data, text data, and video data; The data to be predicted is input into the model corresponding to the target scene to obtain the prediction result corresponding to the data to be predicted. The model corresponding to the target scene includes a variational autoencoder. The model corresponding to the target scene is trained using feature data from multiple scenes. The variational autoencoder includes an inference model and a generative model. The inference model generates a first latent variable and a second latent variable. The first latent variable is generated based on the feature data of the target scene, and the second latent variable is generated based on the feature data of the multiple scenes. The generative model expands the feature data of the target scene based on the first latent variable and the second latent variable. The second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenes. The first latent variable and / or the second latent variable are used to generate a low-dimensional representation of the feature data of the target scene.
6. The method according to claim 5, wherein the data to be predicted further includes label data corresponding to the feature data, and in the case that some of the label data is unobservable, the inference model is further used to generate a third latent variable, the third latent variable being used to generate a low-dimensional representation of the label data, and the prediction result includes the label data corresponding to the feature data.
7. The method according to claim 6, wherein when the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to the Beta distribution, and the prior distribution of the label data conforms to the Bernoulli distribution.
8. The method according to claim 5, wherein the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
9. A training device, comprising: The first acquisition unit is used to acquire training data, which includes feature data of multiple scenes, and the training data is one or more of image data, audio data, text data, and video data. The training unit is used to train a model corresponding to the target scene in the plurality of scenes based on the training data, and to obtain the training loss. The update unit is used to update the model corresponding to the target scene based on the training loss; The model corresponding to the target scene includes a variational autoencoder, which includes an inference model and a generative model. The inference model generates a first latent variable and a second latent variable. The first latent variable is generated based on the feature data of the target scene, and the second latent variable is generated based on the feature data of the multiple scenes. The generative model expands the feature data of the target scene based on the first latent variable and the second latent variable. The second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenes. The first latent variable and / or the second latent variable are used to generate a low-dimensional representation of the feature data of the target scene.
10. The apparatus of claim 9, wherein the training data further includes label data corresponding to the feature data, and in the case that some of the label data is unobservable, the inference model is further used to generate a third latent variable, the third latent variable being used to generate a low-dimensional representation of the label data.
11. The apparatus according to claim 10, wherein when the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to a Beta distribution, and the prior distribution of the label data conforms to a Bernoulli distribution.
12. The apparatus according to claim 9, wherein the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
13. A prediction device, comprising: The second acquisition unit is used to acquire data to be predicted, which includes feature data of a target scene in multiple scenarios, and the data to be predicted is one or more of image data, audio data, text data, and video data. The prediction unit is used to input the data to be predicted into the model corresponding to the target scene and obtain the prediction result corresponding to the data to be predicted. The model corresponding to the target scene includes a variational autoencoder. The model corresponding to the target scene is trained using feature data from multiple scenes. The variational autoencoder includes an inference model and a generative model. The inference model generates a first latent variable and a second latent variable. The first latent variable is generated based on the feature data of the target scene, and the second latent variable is generated based on the feature data of the multiple scenes. The generative model expands the feature data of the target scene based on the first latent variable and the second latent variable. The second latent variable is used to determine the similarity of feature distributions among the feature data of the multiple scenes. The first latent variable and / or the second latent variable are used to generate a low-dimensional representation of the feature data of the target scene.
14. The apparatus according to claim 13, wherein the data to be predicted further includes label data corresponding to the feature data, and in the case that some of the label data is unobservable, the inference model is further used to generate a third latent variable, the third latent variable being used to generate a low-dimensional representation of the label data, and the prediction result includes the label data corresponding to the feature data.
15. The apparatus according to claim 14, wherein when the model corresponding to the target scene is a binary classification model, the prior distribution of the third latent variable conforms to a Beta distribution, and the prior distribution of the label data conforms to a Bernoulli distribution.
16. The apparatus of claim 13, wherein the prior distribution of the first latent variable conforms to a normal distribution, and the prior distribution of the second latent variable conforms to a normal distribution.
17. A training device, comprising: Memory, which stores executable code; A processor is configured to execute the executable code to implement the method of any one of claims 1-4.
18. A prediction device, comprising: Memory, which stores executable code; A processor is configured to execute the executable code to implement the method of any one of claims 5-8.
Citation Information
Patent Citations
Training method and application method of video content description model, equipment and medium
CN114386480A
Method and device for training prediction model
CN114511152A