An information recognition method, an information recognition system, an electronic device, and a computer-readable storage medium
By combining conditional variational inference and Wasserstein distance to optimize network parameters within a meta-learning framework, the problem of performance degradation caused by differences between training and test data is solved, achieving efficient recognition across cross-domain data.
Patent Information
- Application Number
- CN202210424890.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-04-22
AI Technical Summary
When there are significant differences between training and testing data, existing technologies result in decreased recognition performance and insufficient generalization ability of machine learning models, leading to high recognition uncertainty.
We employ a meta-learning framework combined with conditional variational inference. By dividing the training sample set into a simulated training sample set and a simulated test sample set, we generate a latent spatial distribution using an encoder and a prior network, optimize network parameters to reduce cross-domain differences, and improve generalization ability by combining Wasserstein distance and cross-entropy loss functions.
When there are significant differences between training and testing data, the model's generalization performance is significantly improved, recognition uncertainty is reduced, and its adaptability to new samples is enhanced.
Smart Images

Figure CN114781511B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, specifically to an information recognition method, an information recognition system, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Research in the field of Artificial Intelligence (AI) includes robotics, speech recognition, image recognition, natural language processing, and expert systems.
[0003] The core of artificial intelligence is machine learning. In machine learning, the algorithm learns from training data (also known as learning data) with known labels, optimizes the parameters of the algorithm model, and identifies test data with unknown labels.
[0004] In machine learning, when there is a significant difference between training and test data, the training data used in machine learning is different from the test data, which leads to a decrease in recognition performance when recognizing test data, resulting in great uncertainty and affecting system performance.
[0005] Therefore, domain generalization has received increasing attention. Its aim is to address how to train a model using training data so that the model can generalize to target domains with different data distributions, reducing uncertainty when identifying test data and improving the adaptability of machine learning algorithms to new samples—that is, improving the generalization ability of machine learning. In domain generalization, the training dataset is also called the source domain, and the test dataset is also called the target domain. The training and test data for domain generalization come from different domains and have different distributions. Common domain generalization methods aim to extract domain-independent information from different domain data or learn the patterns implicit in the data from different domains, so that it can achieve reasonable performance when facing new domain data.
[0006] In existing technologies, the generalization ability of a system is mainly improved through meta-learning and variational reasoning methods.
[0007] Meta-learning uses multiple tasks as training data. It's a common method for solving the few-shot learning problem and can be used to improve domain-specific generalization capabilities. In few-shot learning, the limited number of samples leads to insufficient model learning. Meta-learning, however, treats each information recognition task as a training sample, generating many such samples for learning. The training unit includes the task itself and the corresponding data for each task. By continuously adapting to specific tasks during the learning process, the network model's parameters are optimized, giving the network abstract learning capabilities. Meta-learning improves the system's generalization ability across multiple tasks and can recognize samples not encountered during training with only a small number of samples.
[0008] In meta-learning for domain generalization, a model with strong generalization ability is learned by using several training and testing data from different domains and with different distributions. The learning process aims to learn the patterns hidden behind the data of each task, so that when encountering new tasks, it can overcome the influence of the bias caused by different domains and achieve better recognition results.
[0009] Variational inference is a data generation model algorithm used to generate distribution data with specified requirements, approximating complex target distributions. Specifically, variational inference is a deterministic approximation inference method, used to approximate a computationally complex distribution or at least obtain some statistics of the target distribution. Variational autoencoders (VAEs), commonly used in deep learning, are based on variational inference. In variational inference, the distribution of latent variables is generally inferred only from the input information, while in supervised learning systems, the guidance of label (output) information is crucial.
[0010] Conditional variational reasoning refers to using known label information of samples as input to generate a sample distribution in variational inference. Therefore, conditional variational reasoning builds upon variational reasoning by incorporating known label information into the input, guiding the generation of the distribution. Since both variational and conditional variational reasoning analyze data or parameters at the distribution level, rather than focusing on fixed numerical values, this can enhance generalization performance to some extent.
[0011] However, existing methods are insufficient in reducing the uncertainty of identifying unknown target domain datasets, and their generalization ability remains limited when the unknown target domain and the source domain have different distributions. Summary of the Invention
[0012] This invention provides an information recognition method, an information recognition system, an electronic device, and a computer-readable storage medium, which can improve generalization ability and reduce the uncertainty of information recognition.
[0013] In a first aspect, the present invention provides an information recognition method, the learning phase of which includes the following steps:
[0014] Step S11: Divide the training sample set S, which contains multiple sample categories and multiple sample domains, into a simulated training sample set DS and a simulated test sample set DT.
[0015] Step S12, take the sample data x of each category c of the simulation training sample set DS. s c Sample data x s c Category label y s c Input encoder network, encoder network generates sample data x s c The first distribution of each category c in the latent space,
[0016] Step S13, take the sample data x from the simulation test sample set DT. t Input a prior network, the prior network generates data based on sample data x t The second distribution in the potential space,
[0017] Step S14: Calculate the KL distance between the sum of the first distributions of each category c and the second distribution, so as to minimize the KL distance.
[0018] In the above invention, during the learning phase, the training sample set S with known labels is divided into a simulated training sample set DS and a simulated test sample set DT to mimic the differences between the training and test datasets. This invention uses a task such as training in the source domain and testing in the target domain (which is inconsistent with the source domain) as training samples, thus employing a meta-learning framework.
[0019] In this invention, the sample data x of each category c of the simulated training sample set DS are used. s c Perform conditional variational coding to obtain sample data x s c The distribution of each category c in the latent space (i.e., the first distribution); the sample data x of the simulated test sample set DT. t Input the prior network to obtain sample data x t The distribution in the latent space (i.e., the second distribution). That is, this invention combines a meta-learning framework with conditional variational inference, leveraging the modeling capabilities of conditional variational inference to better address the uncertainties of cross-domain modeling. Within the meta-learning framework, generalization from the source domain to the target domain is simulated, and generalization ability is obtained through cross-domain training and testing. The lower bound of conditional variational inference is re-derived within the meta-learning framework, transforming the variational inference process into a network parameter optimization process.
[0020] In this invention, the KL distance between the sum of the first distributions of each category c and the second distribution is minimized (i.e., the likelihood between the sum of the first distributions and the second distribution is maximized).
[0021] By making the distribution of the prior network in the latent space as close as possible to the distribution of the latent space generated by the encoder from the simulated training sample set DS, the span between the simulated training sample set DS and the simulated test sample set DT can be reduced, thereby enhancing generalization performance.
[0022] Therefore, this invention optimizes the prior network parameters and enhances generalization performance when there are differences between the simulated training sample set DS and the simulated test sample set DT.
[0023] Here, the prior network is a neural network used for testing. Its network parameters are determined by prior knowledge obtained during the learning process. During the learning process, the parameters of the prior network are optimized by comparing them with the results of conditional variational coding, so as to achieve the same effect as conditional variational coding.
[0024] As one embodiment, the information recognition method further includes:
[0025] Step S15, take the sample data x from the simulation test sample set DT. t And the parameters of the first distribution are input to the decoder network, which is based on the sample data x of the simulated test sample set DT. t And the parameters of the first distribution, to generate sample data x t Predicted category labels Make prediction category labels With sample data x t Known category label y t The cross-entropy is minimized.
[0026] In the above embodiments, the decoder network processes sample data x based on the simulated training sample set DS. s The obtained first distribution is decoded to obtain the sample data x of the simulated test sample set DT. t Predicted category labels Due to the sample data x of the simulation test sample set DT t Real category labels y t Given that, predict the category label With sample data x t Known category label y t The cross-entropy is minimized.
[0027] Sample data x of the simulated test sample set DT is obtained through decoding. t Predicted category labels Make it consistent with the sample data x tKnown category label y t By minimizing the cross-entropy, the learning process is completed. Thus, even when there are differences between the simulated training sample set DS and the simulated test sample set DT, the parameters of the prior network and the decoder network are optimized, thereby enhancing the generalization performance of the system.
[0028] As an example, the testing phase of the information recognition method includes the following steps:
[0029] Step S31: Input the test sample data x of the test sample set T into the prior network, and the prior network generates the third distribution of the test sample data x in the latent space;
[0030] Step S32: Input the test sample data x and the parameters of the third distribution into the decoder network. The decoder network generates the predicted class label of the test sample data x based on the parameters of the third distribution.
[0031] In the above embodiments, the category of data x in the test sample set T is unknown and needs to be identified. During the testing phase, using the optimized parameters of the prior network and decoder network obtained in the learning phase, the prior network generates the distribution of sample data x in the latent space (i.e., the third distribution), and the decoder network decodes the third distribution to obtain the predicted category label of sample data x.
[0032] Because the parameters of the optimized prior network and decoder network are obtained during the learning phase, even when there are differences between the simulated training sample set DS and the simulated test sample set DT, the system can accurately identify the category of the input sample during the testing phase, even if there are differences between the test sample set T and the training sample set S. This reduces the uncertainty of identification and enhances the generalization performance of the system.
[0033] As an example, in step S12, the sample data x of different categories are... c s Wasserstein distance L between the first distributions W maximum.
[0034] In the above embodiments, different categories of sample data x c s Wasserstein distance L between the first distributions in the potential space W The maximum constraint maximizes the distance between the first distributions of different classes in the latent space, thereby further improving the predictive performance of the system.
[0035] As an example, in step S11, among the multiple sample domains of the training sample set S, one sample domain is randomly selected as the simulation test sample set DT, and the remaining sample domains are used as the simulation training sample set DS.
[0036] In the above embodiments, when the training sample set S is divided into a simulated training sample set DS and a simulated test sample set DT, a sample domain of the training sample set S is randomly selected as the simulated test sample set DT, and the remaining sample domains are used as the simulated training sample set DS, in order to simulate the difference between the training dataset and the test dataset, optimize the prior network parameters, and enhance the generalization performance.
[0037] As an example, in step S15, the first distribution is sampled multiple times, and the multiple sampled values z are... l and sample data x t The input is fed into the decoder network to obtain multiple predicted class labels. The average of these multiple predicted class labels is then taken as the sample data x. t Predicted category labels
[0038] In the above embodiments, the decoder network samples the first distribution generated by the encoder network multiple times to obtain multiple predicted category labels; the average of these multiple predicted category labels is then used as sample data x. t Predicted category labels By sampling multiple times and averaging multiple predicted values, the impact of differences in the data domain on recognition performance can be effectively reduced, generalization ability can be improved, and the accuracy and reliability of prediction results can be enhanced.
[0039] As an example, the overall loss function is calculated according to the following equation (1).
[0040]
[0041] in, For cross-entropy, D KL For KL distance, For Wasserstein distance,
[0042] According to equation (2), the parameters of the encoder network, prior network, and decoder network are generated using the gradient descent method:
[0043]
[0044] In the above embodiments, the distance from KL to D is... KL Wasserstein is far Optimizing the parameters of the encoder network, prior network, and decoder network as constraints can improve generalization ability. In the meta-learning conditional variational inference of this invention, the objective function (loss function) of the conditional variational evidence lower bound is used for parameter optimization, transforming the inference process into parameter optimization.
[0045] As an example, in step S32, the third distribution is sampled multiple times, and the multiple sampled values z are... l The sample data x is input into the decoder network to obtain multiple predicted class labels. The average of these multiple predicted class labels is then taken as the predicted class label for the sample data x.
[0046] In the above embodiments, by sampling multiple times and averaging multiple predicted values, the impact of differences in the data domain on recognition performance can be effectively reduced, the generalization ability can be improved, and the accuracy and reliability of the prediction results can be enhanced.
[0047] In some embodiments, the sample data of the training sample set S and the test sample set T are graphic data, voice data, or text data.
[0048] The above embodiments can solve the domain generalization problem for different types of information datasets and improve system performance.
[0049] In a second aspect, the present invention provides an information identification system, comprising:
[0050] During the learning phase, the encoding network unit receives sample data x from each class c of the simulated training sample set DS, which is partitioned from the training sample set S. s c and the sample data x s c Category label y s c Generate data based on the sample data x s c The first distribution of each category c, wherein the training sample set S contains multiple sample categories and multiple sample domains, and the training sample set S is divided into the simulated training sample set DS and the simulated test sample set DT;
[0051] The prior network unit, during the learning phase, receives sample data x from the simulated test sample set DT. t And generate based on the sample data x t The second distribution, wherein the KL distance between the sum of the first distributions of each category c and the second distribution is minimized;
[0052] During the learning phase, the decoder network unit receives sample data x from the simulated test sample set DT. t And the parameters of the first distribution, to generate the sample data x t Predicted category labels Wherein, the predicted category label With the sample data x t Known category label yt The cross-entropy is minimized.
[0053] In some embodiments, the information identification system, during the testing phase,
[0054] The prior network unit receives test sample data x from the test sample set T and generates a third distribution based on the test sample data x;
[0055] The decoder network unit receives the test sample data x and the parameters of the third distribution, and generates the predicted class label for the test sample data x.
[0056] In some embodiments, the information recognition system, the encoding network unit outputs sample data x of different categories. c s Wasserstein distance L between the first distributions W maximum.
[0057] Thirdly, the present invention provides an electronic device, including one or more processors and a memory, wherein one or more computer programs are stored in the memory, and when one or more processors execute one or more computer programs, the information identification method steps of any one of the first aspects of the present invention are implemented.
[0058] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the information identification method of any aspect of the present invention. Attached Figure Description
[0059] Specific embodiments of the present invention are described below with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0060] Figure 1 This is an example diagram of the sample dataset involved in an embodiment of the present invention;
[0061] Figure 2 This is a flowchart of the learning phase of the information recognition method according to an embodiment of the present invention;
[0062] Figure 3 This is a schematic diagram illustrating the learning phase of the information recognition method according to an embodiment of the present invention;
[0063] Figure 4 This is a flowchart of the testing phase of the information recognition method according to an embodiment of the present invention;
[0064] Figure 5 This is a schematic diagram illustrating the testing phase of the information recognition method according to an embodiment of the present invention;
[0065] Figure 6 This demonstrates the recognition performance of existing recognition methods;
[0066] Figure 7 This demonstrates the recognition performance of existing recognition methods;
[0067] Figure 8 This demonstrates the recognition effect of the recognition method according to an embodiment of the present invention;
[0068] Figure 9 This is a schematic diagram of the information recognition method system according to an embodiment of the present invention. Detailed Implementation
[0069] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely for illustrative purposes and should not be construed as limiting the scope of protection of the invention. The various embodiments described in the specification are not mutually exclusive, and those skilled in the art can combine the various embodiments based on the technical concept and common knowledge of the invention. Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by those skilled in the art; the terms used herein are merely for describing specific embodiments and not for limiting the invention. The terms "comprising" and "having," and any variations thereof, in the specification, claims, and drawings of this application, constitute non-exclusive inclusion; the terms "first," "second," etc., are used only to distinguish different objects and do not indicate relative importance, quantity, specific order, or primary / secondary relationship. The term "and / or" is merely a description of the relationship between related objects, and three relationships can exist, such as A and / or B, which can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. "Multiple" refers to two or more (including two). The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0070] The information recognition method, information recognition system, electronic device, and computer-readable storage medium of the present invention can improve the domain generalization ability and can quickly adapt to and identify the category of sample data when there are large differences between the test and learning process data.
[0071] The information recognition method 100 and information recognition system 10 of this invention can be applied to recognizing graphic data, voice data, or text data. The following embodiments use the recognition of graphic data as an example for detailed description.
[0072] Figure 1 This is an example diagram of the sample dataset involved in an embodiment of the present invention.
[0073] Figure 1This is an example of the graphic sample data set 101 involved in the embodiments of the present invention, which includes multiple image samples such as Train, Tortoise, Snail, Pickup, Octopus, Duck, Cat, Car, Candle, Butterfly, Bicycle, Apple, and Airplane. These images may be Sketch, Cartoon, Art painting, or Photo. Figure 1 The dataset shown is also known as the PACS database.
[0074] Here, Train, Tortoise, Snail, Pickup, Octopus, Duck, Cat, Car, Candle, Butterfly, Bicycle, Apple, and Airplane are called categories of graphic samples, while Sketch, Cartoon, Art painting, or Photo are called domains or fields of graphic sample data.
[0075] The training samples S and test samples T of the information recognition system of the present invention have Figure 1 The data set 101 in the present invention is used to learn from such training samples, optimize the parameters of the neural network, and learn from data with... Figure 1 Sample data is selected from a dataset of 101 test samples and input into the information recognition system of this invention for identification and classification to determine the category of the input image sample. The category of the identified graphic data is called the category label, or category label value.
[0076] In actual learning and testing, training data is often unavailable. Figure 1 The dataset in question, unlike the complete dataset 101, might only contain data from a few specific domains, while the test samples could come from any domain, possibly different from the training data. In such cases, existing recognition systems may suffer from insufficient learning, leading to a significant decrease in recognition performance.
[0077] This invention improves the learning process and enhances the system's generalization performance, enabling it to quickly adapt to and identify the category of input samples even when there are significant differences between test samples and training samples.
[0078] For example, the training dataset S (also called the source domain) and the test dataset T (also called the target domain) of the information recognition system of this invention are derived from... Figure 1 The dataset consists of several domains in the dataset 101. The domains of the test dataset T may be different from those of the training dataset S, resulting in cross-domain issues. In this case, the recognition performance of existing recognition systems is significantly reduced.
[0079] In this invention, the training sample set S is divided into multiple domains into a simulated training sample set DS (also known as the meta-source domain) and a simulated test sample set DT (also known as the meta-target domain) to simulate different domains of sample data during the training and testing processes. That is, the training in the source domain and the testing in the target domain are used as training samples. A meta-learning framework is adopted, and the category c of the sample data in the simulated training sample set DS and the simulated test sample set DT is known. Through the technical solution of this embodiment described below, the learning method on the simulated training sample set DS is improved, the neural network parameters are optimized, the testing performance of the system on the simulated test sample set DT is improved, the generalization performance of the system is enhanced, and it is ensured that when testing samples in the test dataset T, even if the domain of the test dataset T may differ from the domain of the training dataset S, the system can quickly adapt to and identify the category of the input sample.
[0080] The following is for reference Figure 2 , Figure 3 , Figure 4 , Figure 5 This invention provides a specific embodiment of an information recognition method.
[0081] Figure 2 This is a flowchart of the learning phase of an information recognition method 100 according to an embodiment of the present invention.
[0082] Figure 3 This is a schematic diagram illustrating the learning phase of an information recognition method 100 according to an embodiment of the present invention.
[0083] like Figure 2 , Figure 3 As shown, the learning phase of the information recognition method 100 of one embodiment of the present invention includes the following steps.
[0084] Step S11: Divide the training sample set S into a simulated training sample set DS and a simulated test sample set DT.
[0085] For example, suppose the training sample set S (also called the source domain) is composed of Figure 1 The dataset consists of several domains in the dataset 101. Several domains in the training sample set S are defined as the simulated training sample set DS, and the remaining domains in the training sample set S are defined as the simulated test sample set DT.
[0086] For example, among the multiple sample domains of the training sample set S, one sample domain is randomly selected as the simulated test sample set DT, and the remaining sample domains are used as the simulated training sample set DS.
[0087] Step S12, refer to Figure 3 The sample data x of each class c in the simulation training sample set DS s c Sample data x s c Category label y s c Input encoder network 12. Figure 3 In the diagram, the symbol C indicates merged input. The encoding network unit 12 processes sample data x. s c Perform conditional variational coding to generate sample data x s c The distribution on the potential space z (hereinafter referred to as the first distribution).
[0088] Here, x s It is the data of the simulated training sample set DS, that is, Figure 1 The graphic samples in the image have a known category c. The category is input as known information into encoder network 12, and the sample data of category c is represented as x. s c x s c The category label is represented as y s c .
[0089] Assume sample data x s c The first distribution in the latent space z is a Gaussian distribution with mean and variance as follows: and
[0090] The categorical variable c takes values from 1 to C, where C is the number of categories in the overall task. Figure 3 In the example, sample data x for category 1 is shown. s 1 and category label y s 1. Input encoding network unit 12.
[0091] Step S13, refer to Figure 3 The sample data x of the simulated test sample set DT t Input prior network 14, prior network unit 14 on sample data x t Perform variational coding to generate sample data x t The distribution in the potential space z (hereinafter referred to as the second distribution).
[0092] Here, xt This represents the sample data in the simulated test sample set DT, i.e. Figure 1 The graph in the image. Because x t This indicates that the data is from the test sample set S, so its category is known, denoted as y. t . (Hereinafter also referred to as y) t For x t The true category label.
[0093] Assume sample data x t The second distribution in the latent space z is a Gaussian distribution with mean and variance μ. t and σ t .
[0094] Step S14: Calculate the KL distance between the sum of the first distributions of each category c and the second distribution, so as to minimize the KL distance.
[0095] KL distance, short for Kullback-Leibler Divergence, also known as relative entropy, is used to express the degree of difference between two probability distributions.
[0096] The prior network unit 14 is a neural network that identifies input samples, and its network parameters are determined based on prior knowledge acquired during the learning process. During the learning process, the first distribution output by the encoding network unit 12 is compared with the second distribution output by the prior network unit 14, making them as close as possible.
[0097] Step S15, as follows Figure 2 , Figure 3 As shown, the sample data x of the simulated test sample set DT t And the parameters of the first distribution are input to the decoder network 16, which is based on the sample data x of the simulated test sample set DT. t And the parameters of the first distribution, to generate sample data x t Predicted category labels And make the predicted category label With sample data x t Known category label y t The cross-entropy is minimized.
[0098] Cross-entropy is used to measure the difference between two probability distributions. In neural networks (machine learning), cross-entropy is used as a loss function, where p represents the distribution of the true labels and q represents the distribution of the predicted labels of the trained model. The cross-entropy loss function measures the similarity between p and q.
[0099] In this embodiment, the decoder network 16 obtains the simulated test sample set DT sample data x based on the first distribution of the samples in the latent space z of the simulated training sample set DS. t Predicted category labels And during the learning process, the predicted category label is made With sample data x t Known category label y t It minimizes cross-entropy, thus enhancing generalization performance.
[0100] Step S16, for example, using gradient descent to update the parameters of encoder network 12, prior network 14, and decoder network 16.
[0101] In the above embodiments, a meta-learning framework is employed during the learning phase. The training sample set S, with known categories, is divided into a simulated training sample set DS and a simulated test sample set DT, mimicking the differences between the training and test datasets. Training tasks in the source domain and testing tasks in the target domain are used as training samples. Under the meta-learning framework, generalization from the source domain to the target domain is simulated, and generalization ability is obtained through cross-domain training and testing processes.
[0102] Encoding network unit 12 takes sample data x from each class c of the simulated training sample set DS. s c Conditional variational coding is performed (using the known label information of the samples as input information) to obtain sample data x for each class c. s c The distribution of z in the latent space (i.e., the first distribution). That is, in this invention, the meta-learning framework and conditional variational inference are combined. Conditional variational inference has strong modeling capabilities and can better address the uncertainties of cross-domain modeling. Under the meta-learning framework, the lower bound of conditional variational inference is re-derived, transforming the variational inference process into a network parameter optimization process.
[0103] Prior network on the sample data x of the simulated test sample set DT t Perform variational coding to obtain sample data x t The distribution of z in the latent space (i.e., the second distribution) minimizes the KL distance between the sum of the first distribution and the second distribution for each class c, i.e., maximizes the likelihood between the sum of the first distribution and the second distribution. This reduces the span between the simulated training set DS and the simulated test set DT, thereby optimizing the prior network parameters and enhancing generalization performance when there are differences between the simulated training set DS and the simulated test set DT.
[0104] Figure 4 This is a flowchart of the testing phase of an information recognition method 100 according to an embodiment of the present invention.
[0105] Figure 5This is a schematic diagram illustrating the testing phase of an information recognition method 100 according to an embodiment of the present invention.
[0106] Step S31: Input the test sample data x of the test sample set T into the prior network. The prior network generates the third distribution of the test sample data x in the latent space z.
[0107] Step S32: Input the test sample data x and the parameters of the third distribution into the decoder network. The decoder network generates the predicted class label of the test sample data x based on the parameters of the third distribution.
[0108] The categories of the graphic samples in the test sample set T are unknown and need to be identified.
[0109] During the testing phase, using the optimized parameters of the prior network and decoder network obtained during the learning phase, the prior network generates the distribution of sample data x in the latent space z (i.e., the third distribution), and the decoder network decodes the third distribution to obtain the predicted class label of sample data x.
[0110] Because the parameters of the optimized prior network and decoder network are obtained during the learning phase, even when there are differences between the simulated training sample set DS and the simulated test sample set DT, the generalization ability is improved. Therefore, even if there are differences between the test sample set T and the training sample set S, the category of the input sample can be accurately identified during the testing phase, reducing the uncertainty of identification.
[0111] As an example, in Figure 2 In step S12 shown, the encoder network generates sample data x of different categories. c s Wasserstein distance L between the first distributions W maximum.
[0112] Wasserstein distance is a distance function that defines the distance between probability distributions in a metric space M. A detailed definition of Wasserstein distance will be provided below.
[0113] In this embodiment, based on meta-learning and conditional variational learning, the Wasserstein distance L is further added. W This constraint requires that sample data x of different categories... c s Wasserstein distance L between the first distributions in the potential space z W This maximizes the distance between the first distributions of different classes in the latent space z, thereby further improving the predictive performance of the system. Figure 3 The example shows sample data x of different categories.c s x l s Gaussian distribution in the potential space z Gaussian distribution The distance between them is subject to Wasserstein constraints.
[0114] An embodiment of the information recognition method of the present invention will be described in detail below.
[0115] During the learning phase, the input data to the system includes: a training sample set S containing K domains, a learning rate λ, the number of iterations Num, and a feature extraction network h(*).
[0116] The system output data includes: encoder network g θ (*), Prior network g φ (*) and decoder network g ψ The network parameters of (*) are represented by the parameter set Θ = {θ, φ, ψ}.
[0117] First, initialize the parameter set Θ = {θ, φ, ψ}.
[0118] Then, execute Figure 2 The following operations in steps S11, S12, S13, S14, S15, and S16 are performed and iterated Num times, i.e., it = 1:Num.
[0119] In step S11, the following operations S111 and S112 are performed.
[0120] Step S111: Randomly select one domain from the 1 to K domains of the training sample set S as the simulation test sample set DT, and use the other K-1 domains as the simulation training sample set DS.
[0121] Step S112: Samples are sampled from the simulated training sample set DS and the simulated test sample set DT, respectively, as follows:
[0122]
[0123] Where M is the number of samples in the simulated training sample set DS, and N is the number of samples in the simulated test sample set DT;
[0124] In step S12, the following operations S121, S122, and S123 are performed.
[0125] Step S121, the mean and variance of the first distribution (Gaussian distribution) of the simulated training sample set DS generated by the encoder network are μ. s σ s Let μ s=0 and σ s =0.
[0126] Step S122, for categories c = 1:C, where C is the total number of categories in the overall task (i.e., the total number of categories in the training sample set S and the test sample set T), perform the following operation for each category:
[0127]
[0128]
[0129] Among them, M c Let c be the total number of samples in class c. To simulate the mean of the feature representation of the c-th class sample in the training sample set DS, and Let μ represent the mean and variance of the first distribution generated by the c-th class of samples in the latent space z. s and σ s represents the mean and variance of the first distribution generated from all samples in the simulated training sample set DS.
[0130] The feature extraction network h(*) is used to extract overall and detailed features of images and other information. For example, based on the pixel data of an image, it uses a pre-designed formula to detect features of the image, including corners, contours, color gradients, etc.
[0131] Step S123, calculate the Wasserstein distance.
[0132]
[0133] Where ε is a fixed adjustment parameter determined in the experiment;
[0134] In step S13, the following steps are performed.
[0135] Step S131, calculate the parameters of the second distribution (Gaussian distribution) of the simulated test sample set DT generated by the prior network as follows:
[0136]
[0137] in, μ represents the mean of the feature representations of all samples in the simulated test sample set DT. t and σ t Let represent the mean and variance of the second distribution generated from all samples in the simulated test sample set DT, respectively.
[0138] The following operations are performed in step S14.
[0139] Step S141: Calculate the KL distance D between the first distribution generated by the simulated training sample set DS and the second distribution generated by the simulated test sample set DT. KL :
[0140]
[0141] Where d is the dimension. and Let i and d represent the i-th dimension of the mean and variance of the second distribution of the simulated test sample set DT in the latent space z, respectively. and Let represent the i-th dimension of the mean and variance of the first distribution of the simulated training sample set DS in the latent space z, respectively.
[0142] In step S15, the following steps S151 and S152 are performed.
[0143] Step S151, let the cross-entropy function The initial value is 0.
[0144] Step S152: For all samples in the simulated test sample set DT, i.e., n = 1:N, perform the following steps S1521 to S1524:
[0145] Step S1521, based on the parameter μ of the first distribution s and σ s Resampling L times, the first The resampling is as follows:
[0146]
[0147] in,
[0148] Step S1522, sample z from the potential space z. (l) and The data is combined and fed into the decoder network to obtain the prediction result. as follows:
[0149]
[0150] Step S1523, for Take the average, where Get the final predicted value
[0151]
[0152] Step S1524, calculate the cross-entropy as follows:
[0153]
[0154] in, To simulate the known class label of the nth sample in the test sample set DT, This is the predicted class label for the nth sample in the simulated test sample set DT.
[0155] The following operations are performed in step S16.
[0156] Step S161, calculate the overall loss function as follows.
[0157]
[0158] in, For cross-entropy, D KL For KL distance, This is the Wasserstein distance.
[0159] Step S162, as shown in the following equation, updates the parameters of the encoder network, prior network, and decoder network using gradient descent:
[0160]
[0161] Where Θ represents the parameters of the encoder network, prior network, and decoder network, and λ represents the learning rate or iteration step size. For gradient, This is the loss function.
[0162] During the testing phase, the data input to the system includes: test samples x from the test sample set T, and model parameters Θ = {φ, ψ}.
[0163] The system output data includes: the predicted class label of test sample x in the test sample set T.
[0164] The following steps are performed during the testing phase.
[0165] The following operations are performed in step S31.
[0166] Step S311: Generate the mean μ and variance σ of the third distribution (Gaussian distribution) in the latent space of the test sample x in the test sample set T according to the following formula: μ, σ = g φ (h(x));
[0167] In step S32, the following steps S321 to S323 are performed.
[0168] Step S321, simulate the predicted class labels of the test sample set DT.
[0169] Step S322: Based on the parameters μ and σ of the third distribution, resample L times, i.e. Perform the following operations:
[0170]
[0171]
[0172] Step S323, simulate the predicted class labels of the test sample set DT
[0173] In steps S152 and S322, the first distribution and the third distribution are sampled multiple times, and the multiple sampled values z are... l and sample data x t The input is fed into the decoder network to obtain multiple predicted class labels. The average of these multiple predicted class labels is then taken as the sample data x. t Predicted category labels By sampling multiple times, the impact of domain bias caused by cross-domain sampling on classification performance can be effectively avoided, thus improving the predicted class label. Data accuracy and reliability.
[0174] The following is for reference Figure 6 , 7 Sections 8 and 9 illustrate the recognition performance of the recognition method in this embodiment of the invention.
[0175] Figure 6 This demonstrates the recognition performance of existing recognition methods.
[0176] Figure 7 This demonstrates the recognition performance of existing recognition methods.
[0177] Figure 8 This demonstrates the recognition effect of the recognition method according to an embodiment of the present invention.
[0178] Figures 6 to 8 for Figure 1 The t-SNE representation of the 'dog' image in the graphic sample shown is for the four domains (Sketch, Cartoon, Artpainting, Photo).
[0179] t-SNE (t-distributed stochastic neighbor embedding) is a non-linear dimensionality reduction algorithm used to reduce high-dimensional data and representations to a two- or three-dimensional low-dimensional space so that they can be visualized.
[0180] Figures 6 to 8In this diagram, each point represents the feature of each sample in the high-dimensional space, which is then reduced to a two-dimensional space using the t-SNE method. The horizontal and vertical axes represent the two dimensions after dimensionality reduction, and can be any two dimensions.
[0181] Figure 6 This is a visual representation of the samples in the case of pre-trained AlexNet.
[0182] AlexNet is a network model. Pre-training refers to training on the ImageNet dataset without any parameter adjustments during training. ImageNet is a large visualization database used for research on visual object recognition software.
[0183] Figure 7 It is a visual representation of the samples when applicable to variational inference.
[0184] Figure 8 This is a visual representation of the sample for which the metaconditional variation of the present invention is applicable.
[0185] Figures 6 to 8 In this context, different icons represent different domains: circles, triangles, stars, and crosses represent the four domains of Sketch, Cartoon, Art painting, and Photo, respectively. In existing technologies, without applicable generalization algorithms, such as... Figure 6 As shown, the data distribution varies significantly across domains, and the data in each domain are uncorrelated with each other, exhibiting high clustering. After applying a certain generalization algorithm, as... Figure 7 and Figure 8 As shown, the data from different domains are intertwined, indicating improved generalization ability and enhanced recognition performance when the training and test data are different.
[0186] like Figure 6 As shown, when using the pre-trained AlexNet for recognition, the features between the four domains of Sketch, Cartoon, Art painting, and Photo are relatively clearly separated, but there are large differences in the representations between the domains, that is, the generalization ability is very low.
[0187] like Figure 7 As shown, under conditional variational inference, the feature separation among the four domains of Sketch, Cartoon, Art painting, and Photo is improved to some extent, and there is fusion between the graphic representations of the four domains. That is, the generalization ability is better than that of the pre-trained AlexNet.
[0188] like Figure 8As shown, when the recognition method of the present invention is used, the feature representations among the four domains are better integrated, indicating that the recognition method of the present invention can effectively eliminate domain bias, improve domain generalization performance, and improve cross-domain recognition capability.
[0189] Figure 9 This is a schematic diagram of the structure of an information recognition system 10 according to an embodiment of the present invention.
[0190] like Figure 9 As shown, an information recognition system 10 according to an embodiment of the present invention includes an encoding network unit 12, a priori network unit 14, and a decoder network unit 16.
[0191] During the learning phase, sample data x of each class c in the simulated training sample set DS are used. s c and the sample data x s c Category label y s c Input the input to the coding network unit 12, which performs conditional variational coding to generate sample data x. s c The distribution in the potential space z (i.e., the first distribution).
[0192] In this embodiment, the coding network unit 12 outputs sample data x of different categories c. c s Wasserstein distance L between the first distributions W maximum.
[0193] During the learning phase, the sample data x of the simulated test sample set DT are used. t Input the prior network unit 14, which performs variational coding to generate sample data x. t The distribution in the potential space z (i.e., the second distribution).
[0194] Information recognition system 10 calculates the KL distance D between the sum of the first distribution and the second distribution of each category c. KL Make KL distance D KL Minimum.
[0195] The network parameters of the prior network unit 14 are determined based on prior knowledge acquired during the learning process. During the learning process, the parameters of the prior network 14 are optimized by comparing them with the conditional variational coding results output by the coding network unit 12, achieving the same effect as the conditional variational coding of the coding network unit 12.
[0196] During the learning phase, the sample data x of the simulated test sample set DT is used. tThe parameters of the first distribution are input to the decoder network unit 16, which decodes the input data to obtain the sample data x. t Predicted category labels Here, decoder network unit 16 predicts the category label. With sample data x t Known category label y t Minimizing the cross-entropy is a condition for determining the predicted category label.
[0197] During the testing phase, prior network unit 14, whose network parameters are optimized through learning, receives test sample data x from the test sample set T and generates the distribution of test sample data x in the latent space z, hereinafter referred to as the third distribution. It is assumed that the third distribution is also a Gaussian distribution. Decoder network unit 16 receives the test sample data x and the parameters of the third distribution, and after decoding, obtains the predicted class label of the test sample data x.
[0198] An electronic device according to an embodiment of this application includes one or more processors and a memory. The memory stores one or more computer programs. When one or more processors execute one or more computer programs, they implement the information recognition method steps described in any one of the embodiments of this application.
[0199] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the information recognition method described in any one of the embodiments of this application.
[0200] The above embodiments are merely illustrative of the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no structural conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. An information identification method, characterized in that, The learning phase includes the following steps: Step S11: Divide the training sample set S, which contains multiple sample categories and multiple sample domains, into a simulated training sample set DS and a simulated test sample set DT. The sample data of the training sample set S is graphic data, voice data, or text data. Step S12, take the sample data x of each category c of the simulated training sample set DS. s c The sample data x s c Category label y s c Input encoder network, the encoder network generates the sample data x s c The first distribution of each category c in the latent space; Step S13, take the sample data x of the simulated test sample set DT. t The input is a prior network, which generates the sample data x. t The second distribution in the potential space; Step S14: Calculate the KL distance between the sum of the first distributions of each category c and the second distribution, so as to minimize the KL distance; Step S15, the sample data x of the simulated test sample set DT t and the parameter input decoder network of the first distribution, the decoder network being based on the sample data x of the simulated test sample set DT. t And the parameters of the first distribution, to generate the sample data x t Predicted category labels Make the predicted category label With the sample data x t Known category label y t The cross-entropy is minimized; In step S15, the first distribution is sampled multiple times, and the multiple sampled values z are... l and the sample data x t The decoder network is input to obtain multiple predicted class labels. The average of these multiple predicted class labels is then taken as the sample data x. t Predicted category labels Calculate the overall loss function As in equation (1): in, For cross-entropy, D KL For KL distance, For Wasserstein distance, According to equation (2), the parameters of the encoder network, the prior network, and the decoder network are updated using the gradient descent method: Where Θ represents the parameters of the encoder network, prior network, and decoder network, and λ represents the learning rate or iteration step size. For gradient, This is the loss function.
2. The information identification method according to claim 1, characterized in that, The testing phase includes the following steps: Step S31: Input the test sample data x of the test sample set T into the prior network. The prior network generates the third distribution of the test sample data x in the latent space. The sample data of the test sample set T is image data, voice data, or text data. Step S32: Input the test sample data x and the parameters of the third distribution into the decoder network. The decoder network generates the predicted class label of the test sample data x based on the parameters of the third distribution.
3. The information identification method according to claim 2, characterized in that, In step S12, the sample data x of different categories c s The Wasserstein distance L between the first distributions W maximum.
4. The information identification method according to claim 1, characterized in that, In step S11, among the multiple sample domains of the training sample set S, one sample domain is randomly selected as the simulated test sample set DT, and the remaining sample domains are used as the simulated training sample set DS.
5. The information identification method according to claim 2, characterized in that, In step S32, the third distribution is sampled multiple times, and the multiple sampled values z are... l The sample data x is input into the decoder network to obtain multiple predicted class labels. The average of these multiple predicted class labels is then taken as the predicted class label for the sample data x.
6. An information identification system, characterized in that, include: During the learning phase, the encoder network unit receives sample data x from each class c of the simulated training sample set DS, which is partitioned from the training sample set S. s c and the sample data x s c Category label y s c Generate the sample data x s c The first distribution of each category c in the latent space, wherein the training sample set S contains multiple sample categories and multiple sample domains, the training sample set S is divided into the simulated training sample set DS and the simulated test sample set DT, and the sample data of the training sample set S is graphic data, speech data, or text data. The prior network unit, during the learning phase, receives sample data x from the simulated test sample set DT. t And generate the sample data x t In the second distribution of the latent space, the KL distance between the sum of the first distributions for each class c and the second distribution is minimized; During the learning phase, the decoder network unit receives sample data x from the simulated test sample set DT. t And the parameters of the first distribution, to generate the sample data x t Predicted category labels Wherein, the predicted category label With the sample data x t Known category label y t The cross-entropy is minimized. The decoder network unit receives multiple sampled values z. l and the sample data x t Multiple predicted category labels are obtained, and the average of these multiple predicted category labels is taken as the sample data x. t Predicted category labels Calculate the overall loss function As in equation (1): in, For cross-entropy, D KL For KL distance, For Wasserstein distance, According to equation (2), the parameters of the encoder network, the prior network, and the decoder network are updated using the gradient descent method: Where Θ represents the parameters of the encoder network, prior network, and decoder network, and λ represents the learning rate or iteration step size. For gradient, This is the loss function.
7. The information identification system as described in claim 6, characterized in that, During the testing phase, The prior network unit receives test sample data x from the test sample set T and generates a third distribution based on the test sample data x. The sample data in the test sample set T is graphic data, voice data, or text data. The decoder network unit receives the test sample data x and the parameters of the third distribution, and generates the predicted category label of the test sample data x.
8. The information identification system according to claim 6, characterized in that, The encoder network unit outputs sample data x of different categories. c s The Wasserstein distance L between the first distributions W maximum.
9. An electronic device, characterized in that, It includes one or more processors and a memory, wherein one or more computer programs are stored in the memory, and when the one or more processors execute the one or more computer programs, the information recognition method steps of any one of claims 1-5 are implemented.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the information recognition method according to any one of claims 1-5.
Citation Information
Patent Citations
Training method and device for financial risk identification model, computer equipment and medium
CN111724083A
Flotation working condition cross-domain identification method
CN114373100A