Sample expansion method, electronic device, computer readable medium and product

Through the embedded fully connected layer of the target model, the transformation relationship between the source domain and the target domain is learned, the source domain categories and samples related to the target domain are screened out, and the loss function is constructed to solve the over-fitting problem of deep learning in few-sample scenarios and improve improves generalization performance.

CN118364299BActive Publication Date: 2024-09-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410796569.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-13
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

Deep learning has the problem of model overfitting in few-sample scenarios, especially in transfer learning, where the scarcity of samples leads to poor generalization performance.

Method used

The transformation relationship between the source domain and the target domain is learned through the embedded fully connected layer of the target model, and two rounds of screening are performed: first, the source domain categories related to the target domain are screened out, and then the expanded samples are screened based on the cluster center features, and the expansion is constructed. The loss function of the sample is used to reduce the introduction of noise.

Benefits of technology

It improves the correlation between the expanded samples output by the target model and the target domain, reduces model overfitting, and improves the effect of few-sample data enhancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364299B
    Figure CN118364299B
Patent Text Reader

Abstract

The present application provides a sample expansion method, an electronic device, a computer-readable medium and a product, which relate to the field of data processing technology, and include: inputting an original sample of a target domain into a target model to obtain a first source domain output and a first target domain output, wherein an embedded fully connected layer of the target model is obtained by learning a transformation relationship between a source domain and a target domain, performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain; performing cluster analysis on the first target domain output to obtain a cluster center feature of the target domain; and inputting a source domain sample of a source domain category related to the target domain into the target model, thereby improving the correlation between the expanded sample output by the target model and the target domain through two rounds of screening processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a sample expansion method, electronic device, computer-readable medium and product. Background Art

[0002] In recent years, deep learning technology has shown excellent performance in many application fields, but it is limited by the data-driven nature of neural network models and the high cost of sample acquisition or labeling in some fields, resulting in poor performance of deep learning. Deep learning in such application scenarios is usually called few-sample learning, especially transfer learning of large models in few-sample scenarios, such as migration to similar application domains and downstream task migration.

[0003] Transfer learning technology transfers knowledge from data-rich fields to data-scarce fields, solving problems such as low model training efficiency and lack of feature diversity. However, it can also easily lead to model overfitting problems due to sample scarcity, resulting in poor generalization performance in test data. Summary of the invention

[0004] In view of this, embodiments of the present application provide a sample expansion method, an electronic device, a computer-readable medium, and a product to overcome the above problems or at least partially solve the above problems.

[0005] A first aspect of an embodiment of the present application provides a sample expansion method, the method comprising:

[0006] Inputting the original sample of the target domain into the target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model;

[0007] Performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain;

[0008] Performing cluster analysis on the first target domain output to obtain cluster center features of the target domain;

[0009] Inputting a source domain sample of a source domain category related to the target domain into the target model to obtain a second target domain output, where the second target domain output is an output of an embedded fully connected layer in the target model;

[0010] Based on the cluster center features and the second target domain output, the source domain samples are screened to obtain expanded samples related to the target domain.

[0011] Optionally, inputting the original sample of the target domain into the target model to obtain the first source domain output and the first target domain output includes:

[0012] Inputting the original sample of the target domain into the target model, and processing it sequentially through the convolution hidden layer and the fully connected hidden layer of the target model to obtain the first source domain output;

[0013] Inputting the first source domain output into an embedding fully connected layer of the target model to obtain the first target domain output, wherein the embedding fully connected layer is connected to an output end of the fully connected hidden layer;

[0014] The first source domain output is a first category probability distribution vector of the original sample in the source domain, and the first target domain output is a second category probability distribution vector of the original sample in the target domain;

[0015] The method further comprises:

[0016] Calculate a first loss function based on the second category probability distribution vector and the hard label vector of the original sample in the target domain;

[0017] The parameters of the embedded fully connected layer are updated based on the first loss function.

[0018] Optionally, the source domain includes a plurality of first categories, the target domain includes a plurality of second categories, the number of the first categories is not less than the number of the second categories, and before performing category screening according to the first source domain output and the first target domain output to obtain source domain categories related to the target domain, the method further includes:

[0019] Based on the first category probability distribution vector, obtaining a first classification category of the original sample in the source domain, the first classification category being a first category corresponding to a maximum value in the first category probability distribution vector corresponding to the original sample;

[0020] Based on the second category probability distribution vector, a second classification category of the original sample in the target domain is obtained, where the second classification category is the second category corresponding to the maximum value in the second category probability distribution vector corresponding to the original sample.

[0021] Optionally, performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain includes:

[0022] For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category;

[0023] After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score;

[0024] For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories;

[0025] A first classification category whose second relevance score is greater than a relevance score threshold is screened out as a source domain category related to the target domain.

[0026] Optionally, performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain includes:

[0027] For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category;

[0028] After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score;

[0029] For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories;

[0030] Setting a preset ratio threshold, wherein the value range of the preset ratio threshold is between 0 and 1;

[0031] Sort each of the first classification categories according to the corresponding second relevance score from high to low to obtain a score list;

[0032] Accumulate the first second correlation integral in the integral list in the order of the integral list, and divide the accumulated result by the total integral of the plurality of second correlation integrals to obtain a proportional value;

[0033] During the accumulation of the second correlation scores, when the ratio value is not less than the preset ratio threshold, the first classification category corresponding to the accumulated plurality of second correlation scores is used as the source domain category related to the target domain.

[0034] Optionally, performing cluster analysis on the first target domain output to obtain cluster center features of the target domain includes:

[0035] For the plurality of original samples, counting a first set of second category probability distribution vectors of all target domains corresponding to the second classification category;

[0036] Performing cluster analysis on the second category probability distribution vectors of all target domains included in the first collection to obtain cluster center features of the second classification categories corresponding to the second category probability distribution vectors of all target domains included in the first collection;

[0037] The cluster center features include cluster center vectors and center distances.

[0038] Optionally, the second target domain output is a third category probability distribution vector of the source domain samples of the source domain category related to the target domain in the target domain, and the source domain samples are screened based on the cluster center features and the second target domain output to obtain the expanded samples related to the target domain, including:

[0039] Determine, based on the third category probability distribution vector, a third classification category of each sample included in the source domain samples of the source domain category related to the target domain;

[0040] For each sample included in the source domain samples, determine the distance between the third category probability distribution vector corresponding to the sample and the cluster center vector of the second classification category;

[0041] For each sample included in the source domain samples, determining a distance relationship between a distance corresponding to the sample and the center distance;

[0042] When the distance relationship meets a preset condition, samples corresponding to the distance that meets the preset condition among the source domain samples of the source domain category related to the target domain are added to the expanded samples.

[0043] Optionally, determining the distance relationship between the distance corresponding to the sample and the center distance includes:

[0044] Determining whether the distance is not greater than the center distance;

[0045] When the distance corresponding to the sample is not greater than the center distance, determining that the third classification category of the sample belongs to the plurality of second categories;

[0046] The samples corresponding to the distances that meet the preset conditions are added to the expanded samples.

[0047] Optionally, before screening the source domain samples based on the cluster center features and the second target domain output to obtain the expanded samples related to the target domain, the method further includes:

[0048] For the plurality of original samples, counting a second set of second category probability distribution vectors of all target domains corresponding to the first classification category;

[0049] In the second collection, obtaining a third set of second category probability distribution vectors of all target domains corresponding to source domain categories related to the target domain, wherein the first classification category includes the source domain category related to the target domain, and the second collection includes the third set;

[0050] A principal component analysis is performed on the second category probability distribution vectors of all target domains included in the third set to obtain a first principal component feature of the target domain corresponding to a source domain category related to the target domain.

[0051] Optionally, after obtaining the expanded samples related to the target domain, the method further includes:

[0052] Inputting the original sample into the target model to obtain a fourth category probability distribution vector of the original sample;

[0053] For the original sample, calculating a second loss function based on the fourth category probability distribution vector and the hard label vector of the original sample in the target domain;

[0054] The parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated based on the second loss function.

[0055] Optionally, after obtaining the expanded samples related to the target domain, the method further includes:

[0056] Inputting the expanded sample into the target model to obtain a fifth category probability distribution vector of the expanded sample;

[0057] For the expanded sample, calculating a hard label loss based on the fifth category probability distribution vector and a hard label vector of the expanded sample in the target domain;

[0058] For the expanded sample, based on the fifth category probability distribution vector and the first principal component feature, calculating the first principal component feature loss;

[0059] Based on the hard label loss and the first principal component feature loss, parameters of the fully connected hidden layer and parameters of the embedded fully connected layer of the target model are updated.

[0060] Optionally, updating parameters of a fully connected hidden layer and an embedded fully connected layer of the target model based on the hard label loss and the first principal component feature loss includes:

[0061] Set penalty hyperparameters;

[0062] Calculating a third loss function corresponding to the expanded sample based on the penalty hyperparameter, the hard label loss, and the first principal component feature loss;

[0063] Based on the third loss function, parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated.

[0064] A second aspect of an embodiment of the present application provides a sample expansion device, the device comprising:

[0065] An original sample input module is used to input the original sample of the target domain into the target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model;

[0066] a category screening module, configured to perform category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain;

[0067] A cluster analysis module, used to perform cluster analysis on the first target domain output to obtain cluster center features of the target domain;

[0068] a source domain sample input module, configured to input source domain samples of a source domain category related to the target domain into the target model to obtain a second target domain output, where the second target domain output is an output of an embedded fully connected layer in the target model;

[0069] A sample screening module is used to screen the source domain samples based on the cluster center features and the second target domain output to obtain expanded samples related to the target domain.

[0070] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the sample expansion method as described in the first aspect.

[0071] According to a fourth aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the sample expansion method as described in the first aspect.

[0072] According to a fifth aspect of the embodiments of the present application, a computer-readable medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the sample expansion method as described in the first aspect is implemented.

[0073] Beneficial effects of this application:

[0074] The embodiments of the present application provide a sample expansion method, an electronic device, a computer-readable medium and a product, comprising: inputting an original sample of a target domain into a target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model; performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain; performing cluster analysis on the first target domain output to obtain a cluster center feature of the target domain; inputting a source domain sample of a source domain category related to the target domain into the target model to obtain a second target domain output, wherein the second target domain output is the output of the embedded fully connected layer in the target model; based on the cluster center feature and the second target domain output, screening the source domain samples to obtain an expanded sample related to the target domain.

[0075] The transformation relationship between the source domain and the target domain is learned through the embedded fully connected layer of the target model to obtain the source domain category related to the target domain. The source domain samples related to the target domain are screened out based on the cluster center features obtained by cluster analysis of the first target domain output as the few-sample expansion of the target domain. Through two rounds of screening process, the correlation between the expanded samples output by the target model and the target domain is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0077] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0078] Figure 1 is an algorithm flow chart of a sample expansion method provided by an embodiment of the present application, such as Figure 1 As shown;

[0079] Figure 2 It is a flow chart of a sample expansion method provided in one embodiment of the present application;

[0080] Figure 3 It is a framework diagram of application and training of a target model in a sample expansion method provided in an embodiment of the present application;

[0081] Figure 4 It is a schematic diagram of the framework of a sample expansion device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0082] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0083] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0084] In the existing technical solutions for the problem of few-sample learning with data enhancement, samples are extracted from natural databases for data enhancement, thereby promoting the learning of sample feature diversity to improve the overfitting problem of few-sample learning.

[0085] In the related technology, sample screening and expansion and few-sample training are performed based on two models, namely the training model and the verification model. It is not suitable for few-sample transfer training on a single model, and the loss function of the expanded sample lacks an effective penalty term to reduce the label data noise, thus failing to improve the overfitting problem of few-sample model learning.

[0086] Based on the above-mentioned defects, the present application proposes a sample expansion method, an electronic device, a computer-readable medium and a product, and proposes a two-stage sample screening and expansion few-sample transfer training framework, and simultaneously learns the correlation between the transfer domains (i.e., the target domain and the source domain). First, according to the category correlation of the source domain and the target domain outputs, the source domain categories related to the target domain are screened out, and then according to the cluster center features output by the target domain, the source domain samples related to the target domain are screened out as the expanded samples of the few samples (i.e., the original samples) of the target domain. In addition, the loss function of the expanded samples can be constructed based on the first principal component features output by the target domain, so as to achieve few-sample data enhancement while reducing the introduction of data noise, thereby improving the overfitting problem of few-sample model learning.

[0087] Figure 1 is an algorithm flow chart of a sample expansion method provided by an embodiment of the present application, such as Figure 1 shown.

[0088] The technical solution of the present application is summarized below. The specific process steps of the technical solution of the present application include three stages:

[0089] First, in the first stage, the original samples of the target domain are input, and the pre-propagation and back-propagation calculations of the target model are performed in turn to obtain the domain transformation relationship between the target domain output and the source domain output. Based on this, the source domain categories of the source domain related to the target domain are screened out, and the first principal component features and cluster center features of the target domain output are obtained.

[0090] Then, in the second stage, the source domain samples corresponding to the source domain categories of the source domain related to the target domain screened in the above process are input into the target model, and through the forward propagation calculation of the target model and the clustering center features output by the target domain, the source domain samples related to the target domain are screened out from the source domain samples corresponding to the source domain categories of the source domain related to the target domain, and the screened source domain samples are used as expanded samples of the original samples.

[0091] Finally, in the third stage, the original samples and the expanded samples are input into the target model together, and the loss function is constructed based on the first component features of the target domain output. The parameters of the target model are fine-tuned through forward propagation and back propagation calculations.

[0092] The following is an explanation of the details of the technical solution of this application through various embodiments:

[0093] Figure 2 is a flow chart of a sample expansion method provided in an embodiment of the present application. Figure 3 is a framework diagram of the application and training of a target model in a sample expansion method provided in an embodiment of the present application, such as Figure 2As shown, an embodiment of the present application provides a sample expansion method, the method comprising:

[0094] In step S101, an original sample of a target domain is input into a target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning a transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model;

[0095] In step S102, category screening is performed according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain;

[0096] In step S103, cluster analysis is performed on the first target domain output to obtain cluster center features of the target domain;

[0097] In step S104, a source domain sample of a source domain category related to the target domain is input into the target model to obtain a second target domain output, where the second target domain output is an output of an embedded fully connected layer in the target model;

[0098] In step S105, based on the cluster center features and the second target domain output, the source domain samples are screened to obtain expanded samples related to the target domain.

[0099] In the embodiment of the present application, the target model is a pre-trained sample expansion model, and the target model is used to expand the original samples of the target domain. The target domain contains small batch samples in a specific application scenario. Therefore, the original samples of the target domain are samples with a sample number less than a preset threshold, that is, a small number of samples, such as Stanford's car pictures (16,185 images, 196 categories), the flower data set of the data science competition platform (4,242 images, 5 categories), the animal data set of the data science competition platform (5,400 images, 90 categories), and fine-grained bird images (11,788 images, 200 categories), etc. The source domain contains large image data sets with rich sample numbers and categories, including MS-COCO (25GB after compression, 80 categories), ImageNet (150GB, more than 20,000 categories), and Open Images (500GB after compression, more than 5,000 categories), involving a wide range of application scenarios, including but not limited to animals, plants, buildings, airplanes, cars, people, etc.

[0100] Therefore, it is not difficult to understand that the number or categories of source domain samples contained in the source domain are much larger than the number or categories of samples contained in the target domain.

[0101] In the embodiment of the present application, the technical solution of the present application is applicable to image classification, and the target model at least includes a source model and an embedded fully connected layer, wherein the source model is usually a large model with a complex structure and the last layer is a fully connected layer, and commonly used ones include ResNet152, DenseNet121, Inception-ResNet v2 of the convolutional neural network architecture, ViT-B / 16 of the VisionTransformer architecture, and the source model includes a convolutional hidden layer and a fully connected hidden layer, a convolutional hidden layer and a fully connected hidden layer structure, the convolutional hidden layer is used for feature extraction, and the fully connected hidden layer is used as a classifier. In order to establish a transformation relationship between the source domain and the target domain, the present application adds a fully connected layer after the fully connected hidden layer on the basis of the source model, that is, the embedded fully connected layer, and the input dimension of the embedded fully connected layer is the number of source domain categories, and the output dimension is the number of target domain categories. In addition, in the first stage, the parameters of the embedded fully connected layer need to be updated by the loss function, and in the third stage, the parameters of the fully connected hidden layer and the parameters of the embedded fully connected layer need to be updated by the loss function, and the specific update steps will be described later.

[0102] First, in step S101, the original sample of the target domain is input into the target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model.

[0103] Specifically, Figure 3 As shown in the figure, the target model is a pre-trained model that can be used to expand the original samples of the target domain. When sample expansion is required, the original samples of the target domain are input into the target model. The original samples are sequentially calculated by the forward propagation of the convolutional hidden layer and the fully connected hidden layer of the target model to obtain the first source domain output of each sample contained in the original sample of the target domain in the source domain, that is, ,in, is the original sample, is the convolutional hidden layer, is a fully connected hidden layer, is the first source domain output. The first source domain output can represent the category characteristics of each sample contained in the original sample within the source domain range. The first source domain output is input into the embedded fully connected layer for forward propagation calculation. Through the output of the fully connected hidden layer, the first target domain output is obtained, that is, ,in, To embed the fully connected layer, The first target domain output can represent the category characteristics of each sample contained in the original sample within the target domain range. The embedded fully connected layer has pre-learned the transformation relationship between the target domain and the source domain, so it can convert the first source domain output into the first target domain output.

[0104] Among them, Figure 3 In , the first category probability distribution vector is represented by “①”, the second category probability distribution vector is represented by “②”, the third category probability distribution vector is represented by “④”, the fourth category probability distribution vector is represented by “⑤”, and the fifth category probability distribution vector is represented by “⑥”.

[0105] Further, in step S102, category screening is performed according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain.

[0106] In the embodiments of the present application, Figure 3 As shown, after obtaining the first target domain output and the first source domain output, source domain categories related to the target domain can be filtered out from the source domain categories contained in the source domain according to the category features of the first target domain output and the category features of the first target domain output.

[0107] Further, in step S103, cluster analysis is performed on the first target domain output to obtain cluster center features of the target domain.

[0108] In the embodiments of the present application, Figure 3 As shown in the figure, a cluster analysis is performed on the first target domain output embedded in the fully connected layer output, wherein the cluster analysis is a K-means clustering algorithm, which is a typical centroid-based clustering method. The samples are divided into classes (clusters), and the classes (clusters) are represented by center vectors and center distances. According to the distance from the sample to the center vector of each class (cluster), each sample is divided into the class (cluster) closest to it, so that the cluster center features of each category contained in the target domain can be obtained.

[0109] Further, in step S104, source domain samples of a source domain category related to the target domain are input into the target model to obtain a second target domain output, where the second target domain output is the output of the embedded fully connected layer in the target model.

[0110] In the embodiments of the present application, Figure 3 As shown, after obtaining the source domain category related to the target domain, the source domain samples of the source domain category related to the target domain are obtained, and the source domain samples of the source domain category related to the target domain are input into the target model. Through the forward propagation calculation of the convolution hidden layer, the fully connected hidden layer and the embedded fully connected layer of the target model, the second target domain output embedded in the output of the fully connected layer is obtained, that is, ,in, is the second target domain output, The second target domain output may represent the category features of each sample contained in the source domain samples of the source domain category related to the target domain within the target domain range.

[0111] Finally, in step S105, based on the cluster center features and the second target domain output, the source domain samples are screened to obtain expanded samples related to the target domain.

[0112] In the embodiments of the present application, Figure 3 As shown, after obtaining the second target domain output, samples related to the target domain in the source domain samples can be determined according to the relationship between the second target domain output and the cluster center features, and samples related to the target domain in the source domain samples can be used as expanded samples.

[0113] Through the above-mentioned embodiments, the transformation relationship between the source domain and the target domain can be learned through the embedded fully connected layer of the target model to obtain the source domain category related to the target domain. By screening the source domain category, the screening range of subsequent screening of source domain samples can be reduced, and the amount of calculation for screening the source domain samples can be reduced. The source domain samples related to the target domain are screened out according to the cluster center features obtained by clustering analysis of the first target domain output of the target domain as a few-sample expansion of the target domain. Therefore, through two rounds of screening process, the expansion of the original samples of the target domain can be achieved. At the same time, based on the transfer learning of the target domain and the source domain, the noise introduced into the generated expanded samples is reduced.

[0114] Optionally, the step S101 includes:

[0115] Inputting the original sample of the target domain into the target model, and processing it sequentially through the convolution hidden layer and the fully connected hidden layer of the target model to obtain the first source domain output;

[0116] Inputting the first source domain output into an embedding fully connected layer of the target model to obtain the first target domain output, wherein the embedding fully connected layer is connected to an output end of the fully connected hidden layer;

[0117] The first source domain output is a first category probability distribution vector of the original sample in the source domain, and the first target domain output is a second category probability distribution vector of the original sample in the target domain;

[0118] The method further comprises:

[0119] Calculate a first loss function based on the second category probability distribution vector and the hard label vector of the original sample in the target domain;

[0120] The parameters of the embedded fully connected layer are updated based on the first loss function.

[0121] Specifically, in the embodiments of the present application, Figure 3 As shown, after the original sample is input into the target model, the convolution hidden layer and the fully connected hidden layer of the target model are used for forward propagation calculation processing to obtain the first source domain output, which is the first category probability distribution vector of the original sample in the source domain. The first category probability distribution vector represents the vector representation of the probability that the original sample belongs to each source domain category within the source domain. That is to say, for an original sample, the probability value of the original sample belonging to each source domain category can be obtained through the first category probability distribution vector. Further, the first source domain output is input into the embedded fully connected layer of the target model for forward propagation calculation processing to obtain the first target domain output. The embedded fully connected layer is connected to the output end of the fully connected hidden layer. The first target domain output is the second category probability distribution vector of the original sample in the target domain. The second category probability distribution vector represents the vector representation of the probability that the original sample belongs to each target domain category within the target domain. That is to say, for an original sample, the probability value of the original sample belonging to each target domain category can be obtained through the second category probability distribution vector.

[0122] It should be noted that when the sample is expanded through the target model, the parameters of the target model can also be iteratively updated to improve the performance of the target model and the generalization ability in the target domain.

[0123] Specifically, Figure 3 As shown in the figure, after obtaining the second category probability distribution vector, the first loss function can be calculated based on the second category probability distribution vector and the hard label vector of the original sample in the target domain. The hard label vector represents the true category probability distribution vector of the original sample manually labeled in the target domain. The first loss function is used to measure the difference between the second probability distribution vector and the hard label vector, and can use cross entropy, binary cross entropy, mean square error and other types of loss functions.

[0124] Among them, the following formula shows the first loss function composed of the binary cross entropy classification loss function. The calculation formula of the first loss function is:

[0125] ;

[0126] Among them, it is necessary to calculate the first loss function for each original sample. For an original sample, L1 is the loss value of the first loss function. Represents the hard label vector of this original sample, i Represents the category of this original sample in the target domain, Indicates the category of this original sample in the second category probability distribution vector, for example, it can be the category corresponding to the maximum probability value, Represents the number of target domain categories, so that the calculation formula of the first loss function can be used to calculate the loss of each category contained in the target domain, and the loss of each category contained in the target domain is accumulated to obtain the loss value of the first loss function, and then based on the loss value of the first loss function, the parameters of the embedded fully connected layer are updated through back propagation calculation.

[0127] Back propagation calculation is the process of minimizing the first loss function by using optimization methods such as gradient descent, calculating the parameter gradient of the target model from back to front and updating the parameters of the target model. The back propagation calculation here is only for the embedded fully connected layer, that is, the target model only learns the parameters of the embedded fully connected layer in the first stage.

[0128] Through the above embodiments, the probability distribution of different categories of the original samples in the source domain and the target domain can be represented by the class probability distribution vector, and the first loss function is calculated by the second category probability distribution vector and the hard label vector of the original sample in the target domain, and the parameters of the target model are updated. By continuously iteratively updating the parameters during the application of the target model, the target model can gradually improve its performance and improve its generalization ability in the target domain.

[0129] It should be noted that the training process of the embedded fully connected layer of the target model is similar to the above method, and you can refer to the above content and will not repeat it here.

[0130] Optionally, the source domain includes a plurality of first categories, the target domain includes a plurality of second categories, the number of the first categories is not less than the number of the second categories, and before step S102, the method further includes:

[0131] Based on the first category probability distribution vector, obtaining a first classification category of the original sample in the source domain, the first classification category being a first category corresponding to a maximum value in the first category probability distribution vector corresponding to the original sample;

[0132] Based on the second category probability distribution vector, a second classification category of the original sample in the target domain is obtained, where the second classification category is the second category corresponding to the maximum value in the second category probability distribution vector corresponding to the original sample.

[0133] Specifically, for ease of representation, the source domain contains multiple first categories of source domain categories, and the target domain contains multiple second categories of target domain categories. At the same time, since the source domain contains a large number of categories, and the target domain contains categories under specific application scenarios, the number of first categories is not less than the number of second categories.

[0134] Before performing category screening and obtaining the source domain category related to the target domain, the first category probability distribution vector and the second category probability distribution vector need to be further processed. From the above content, it can be seen that the first category probability distribution vector can represent the probability value of the original sample belonging to each source domain category, and the second category probability distribution vector can represent the probability value of the original sample belonging to each target domain category. Therefore, the category corresponding to the largest probability value in the first category probability distribution vector can be used as the category of the original sample in the source domain, that is, the first classification category, recorded as ; The category corresponding to the largest probability value in the second category probability distribution vector is taken as the category of the original sample in the target domain, that is, the second classification category, recorded as , the number of source domain categories in the first category probability distribution vector is , therefore, the first classification category The value range is , the number of target domain categories in the second category probability distribution vector is , therefore, the second classification category The value range is .

[0135] Through the above embodiments, the category corresponding to the largest probability value in the probability distribution vector can be used as the classification category of the original sample output by the target model in the source domain and the target domain.

[0136] Optionally, the step S102 includes:

[0137] For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category;

[0138] After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score;

[0139] For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories;

[0140] A first classification category whose second relevance score is greater than a relevance score threshold is screened out as a source domain category related to the target domain.

[0141] Specifically, in the embodiments of the present application, Figure 3As shown, in the above process, the first classification category and the second classification category are obtained, and each original sample corresponds to a first classification category and a second classification category (that is, each original sample passes through the target model to output a predicted category in the source domain and a predicted category in the target domain). Based on this, the correlation between the first classification category and the second classification category of each original sample can be further calculated to obtain the first correlation integral, that is, the first correlation integral can represent the correlation between the first classification category and the second classification category of each original sample. For example, the first correlation integral can be a value between 0 and 1, the larger the value, the greater the correlation, and the smaller the value, the smaller the correlation. Therefore, the first correlation integral of each original sample can be obtained, and the first correlation integral can be accumulated and updated.

[0142] Optionally, when the first classification category is related to the second classification category, the corresponding first correlation score is 1; when the first classification category is not related to the second classification category, the corresponding first correlation score is 0.

[0143] As an example, it is assumed that the first classification category and the second classification category of the original sample A are the same as the first classification category and the second classification category of the original sample A.

[0144] When the first classification category of the original sample A is correlated with the second classification category, the first correlation integral of the original sample A is 1. When the first classification category of the original sample B is correlated with the second classification category, the first correlation integral of the original sample B is 1. The first correlation integrals are accumulated and the resulting value is 2.

[0145] As another example, assume that the first classification category and the second classification category of the original sample C are the same as the first classification category and the second classification category of the original sample D, the first classification category and the second classification category of the original sample E are different from the first classification category and the second classification category of the original sample C, and the first classification category and the second classification category of the original sample E are different from the first classification category and the second classification category of the original sample D.

[0146] When the first classification category of the original sample C is correlated with the second classification category, the first correlation integral of the original sample C is 1. When the first classification category of the original sample D is correlated with the second classification category, the first correlation integral of the original sample D is 1. The first correlation integrals are accumulated and the value obtained is 2. When the first classification category of the original category E is correlated with the second classification category, the first correlation integral of the original sample E is 1. However, since the first classification category and the second classification category of the original category E are different from the original category C and the original category D, the correlation between the first classification category and the second classification category of the original sample C or the original category D will not be accumulated, but the correlation between the first classification category and the second classification category of the original category E will be accumulated.

[0147] The following is the accumulation formula of the first correlation integral:

[0148] ;

[0149] in, Indicates the last time for the first category and the second classification category The cumulative value of the first correlation score, if the first classification category of a certain original sample and the second classification category is relevant, then Add 1, if not relevant, then wrong Add 1.

[0150] According to the accumulation result of the first correlation score, the correlation score between the source domain category of each source domain and the target domain category of each target domain can be obtained. .

[0151] Therefore, the correlation integral between each source domain category in the source domain and all target domain categories in the target domain can be further obtained, that is, the second correlation integral.

[0152] The second correlation score is obtained by adding multiple first correlation scores. It should be noted that when the first correlation scores are added to obtain the second correlation score, only the multiple first correlation scores corresponding to the first classification category indicated by the second correlation score are accumulated.

[0153] The calculation formula for the second correlation integral is as follows:

[0154] ;

[0155] in, represents the second correlation integral for the first classification category (i.e., a source domain category), is the second correlation integral obtained by accumulating multiple first correlation integrals last time, is the first correlation score accumulated this time, and j represents the jth target domain category .

[0156] Therefore, through the above steps, the second correlation score of each source domain category can be obtained. The second correlation score of a source domain category can represent the cumulative number of target domain categories corresponding to this source domain category, that is, the degree of correlation between the source domain category and the target domain category.

[0157] Furthermore, the second correlation scores of the source domain categories corresponding to the multiple first classification categories are arranged in descending order, and the source domain categories corresponding to the first classification categories whose second correlation scores are greater than the correlation score threshold are screened out as the source domain categories related to the target domain. In other words, the source domain categories related to the target domain obtained by screening out are related to the target domain categories, and the correlation score threshold can be set based on actual conditions (such as according to the quantitative relationship between the source domain categories or the target domain categories).

[0158] It should be noted that the first classification category is equivalent to a source domain category, the second classification category is equivalent to a target domain category, and the first classification category and the second classification category are used to represent the result output by the target model.

[0159] Through the above embodiment, the source domain category related to the target domain can be determined through the first correlation integral and the second correlation integral. Through the calculation of two variables, the source domain category related to the target domain finally determined is more accurate.

[0160] Optionally, the step S102 includes:

[0161] For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category;

[0162] After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score;

[0163] For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories;

[0164] Setting a preset ratio threshold, wherein the value range of the preset ratio threshold is between 0 and 1;

[0165] Sort each of the first classification categories according to the corresponding second relevance score from high to low to obtain a score list;

[0166] Accumulate the first second correlation integral in the integral list in the order of the integral list, and divide the accumulated result by the total integral of the plurality of second correlation integrals to obtain a proportional value;

[0167] During the accumulation of the second correlation scores, when the ratio value is not less than the preset ratio threshold, the first classification category corresponding to the accumulated plurality of second correlation scores is used as the source domain category related to the target domain.

[0168] Specifically, in the embodiments of the present application, Figure 3 As shown, after obtaining the second correlation integral of the source domain category corresponding to each first classification category, considering the sparse distribution of the second correlation integral, a preset ratio threshold may be set. , , sort the source domain category corresponding to each first classification category according to the corresponding second correlation score from high to low to obtain a score list, and start accumulating from the first second correlation score in the score list according to the order of the score list, and divide the accumulated result by the total score of multiple second correlation scores to obtain a proportion value. In the process of accumulating the second correlation scores, until the proportion value is not less than the preset proportion threshold, the first classification category corresponding to the accumulated multiple second correlation scores is used as the source domain category related to the target domain, that is, after each accumulation of the second correlation scores, the proportion value is compared with the preset proportion threshold until the proportion value is not less than the preset proportion threshold, the accumulation of the second correlation scores is stopped, and the source domain category corresponding to the first classification category corresponding to the accumulated second correlation score is used as the source domain category related to the target domain, recorded as .

[0169] The ratio value is calculated as follows:

[0170]

[0171] in, represents the cumulative result of the first k second relevance scores in the score list, starting from the second relevance score of the jth source domain category, represents the cumulative result of all second correlation integrals in the integral list, represents the second relevance score of the j-th source domain category.

[0172] Through the above embodiments, it is possible to screen out source domain categories related to the target domain while taking into account the sparse distribution of the second correlation integral, thereby improving the correlation between the screened source domain categories and the target domain.

[0173] Optionally, the step S103 includes:

[0174] For the plurality of original samples, counting a first set of second category probability distribution vectors of all target domains corresponding to the second classification category;

[0175] Performing cluster analysis on the second category probability distribution vectors of all target domains included in the first collection to obtain cluster center features of the second classification categories corresponding to the second category probability distribution vectors of all target domains included in the first collection;

[0176] The cluster center features include cluster center vectors and center distances.

[0177] Specifically, in an embodiment of the present application, when cluster analysis is required, for multiple original samples, the target domain category corresponding to the second classification category of each original sample in the target domain is first determined, and based on the target domain category corresponding to the second classification category, multiple second category probability distribution vectors corresponding to the target domain category are determined to obtain a first set, wherein the first set contains multiple second category probability distribution vectors, and the first set is also obtained by union. The calculation formula of the first set is as follows:

[0178] ;

[0179] in, For a second classification category The first set is updated by means of a union method, and each second category probability distribution vector of the target domain corresponding to the second classification category is obtained by statistics.

[0180] Finally, a first set of second category probability distribution vectors of target domains corresponding to the second classification categories is obtained. , cluster analysis is performed on the second category probability distribution vectors of all target domains contained in the first set to obtain the cluster center features of each second category probability distribution vector contained in the first set.

[0181] Specifically, the cluster center features are obtained by Perform K-means clustering analysis with the number of clusters being 1, and obtain the cluster center vector of the target domain category corresponding to each second classification category Distance from center The cluster center vector represents the center point of the cluster, and the center distance represents the average value of the Euclidean distance from each original sample to the cluster center vector.

[0182] Through the above embodiments, the cluster center features corresponding to each target domain category can be obtained, which is convenient for the subsequent screening process of source domain samples.

[0183] Optionally, the second target domain output is a third category probability distribution vector of the source domain samples of the source domain category related to the target domain in the target domain, and the step S105 includes:

[0184] Determine, based on the third category probability distribution vector, a third classification category of each sample included in the source domain samples of the source domain category related to the target domain;

[0185] For each sample included in the source domain samples, determine the distance between the third category probability distribution vector corresponding to the sample and the cluster center vector of the second classification category;

[0186] For each sample included in the source domain samples, determining a distance relationship between a distance corresponding to the sample and the center distance;

[0187] When the distance relationship meets a preset condition, samples corresponding to the distance that meets the preset condition among the source domain samples of the source domain category related to the target domain are added to the expanded samples.

[0188] Specifically, the second target domain output is a third category probability distribution vector of source domain samples of source domain categories related to the target domain in the target domain, that is, each source domain sample of a source domain category related to the target domain corresponds to a third category probability distribution vector, and the third category probability distribution vector can represent the category characteristics of the source domain samples of the source domain category related to the target domain within the target domain range, that is, a vector composed of source domain samples of the source domain category related to the target domain and the probability values ​​belonging to the target domain category.

[0189] Furthermore, based on the output third category probability distribution vector, the third classification category of each sample contained in the source domain sample of the source domain category related to the target domain can be determined. Since each source domain sample of the source domain category related to the target domain corresponds to a third category probability distribution vector, the third classification category of each source domain sample of the source domain category related to the target domain is the target domain category corresponding to the largest probability value in the third category probability distribution vector.

[0190] For example, the third category probability distribution vector corresponding to a source domain sample of a source domain category related to the target domain is [0.1, 0.2, 0.5, 0.05, 0.05, 0.01, 0.02, 0.04, 0.03], then "0.5" represents the maximum probability value in the third category probability distribution vector. Therefore, the target domain category corresponding to "0.5" is obtained as the third classification category corresponding to the source domain sample of the source domain category related to the target domain. The method for determining the first classification category and the second classification category is similar and will not be repeated here.

[0191] Furthermore, for each sample included in the source domain samples of the source domain category related to the target domain, the distance between the third category probability distribution vector corresponding to these samples and the cluster center vector of the second classification category (all belonging to the target domain category) is determined, and for each sample included in the source domain samples of the source domain category related to the target domain, the distance relationship between the distance corresponding to the sample (that is, the distance between the third category probability distribution vector corresponding to the sample and the cluster center vector of the second classification category) and the center distance is judged. When the distance relationship meets the preset conditions, the samples corresponding to the distance that meets the preset conditions in the source domain samples of the source domain category related to the target domain are added to the expanded samples, until all the source domain samples of the source domain category related to the target domain complete the judgment of the distance relationship, and finally the screened expanded samples are obtained.

[0192] It should be understood that the distance can represent the similarity or difference between the sample and the category. The closer the distance, the closer the sample is to the corresponding target domain category, and the farther the distance, the farther the sample is from the corresponding target domain category.

[0193] Through the above embodiments, the source domain samples based on the source domain categories related to the target domain screened out in the first stage can be further screened, and the second screening process is performed by calculating the distance between the third category probability distribution vector corresponding to the sample and the target domain category clustering center vector, so that the category of the expanded sample is closer to the target domain.

[0194] Optionally, determining the distance relationship between the distance corresponding to the sample and the center distance includes:

[0195] Determining whether the distance is not greater than the center distance;

[0196] When the distance corresponding to the sample is not greater than the center distance, determining that the third classification category of the sample belongs to the plurality of second categories;

[0197] The preset condition is to judge the relationship between the distance and the center distance. Each target domain category corresponds to a center distance. The center distance can be used as a boundary value to determine whether a sample belongs to this target domain category. When the distance is greater than the center distance, it means that the sample is too far away from the cluster center vector of the target domain category. At this time, it is determined that the third classification category of this sample does not belong to the target domain category and will not be used as an expanded sample of the original sample. When the distance is not greater than the center distance, it means that the sample is very close to the cluster center vector of the target domain category. At this time, it is determined that the third classification category of this sample belongs to the target domain category (that is, multiple second categories), and this sample is added to the expanded sample of the original sample.

[0198] It should be noted that each target domain category corresponds to a center distance which may be the same or different. The center distance may be set according to the analysis of the target domain category and the range defined by the target domain category.

[0199] Through the above embodiment, it is possible to screen out expanded samples based on the relationship between the distance from the third category probability distribution vector of each sample in the source domain sample of the source domain category related to the target domain to the cluster center vector and the center distance.

[0200] Optionally, before S105, the method further includes:

[0201] For the plurality of original samples, counting a second set of second category probability distribution vectors of all target domains corresponding to the first classification category;

[0202] In the second collection, obtaining a third set of second category probability distribution vectors of all target domains corresponding to source domain categories related to the target domain, wherein the first classification category includes the source domain category related to the target domain, and the second collection includes the third set;

[0203] A principal component analysis is performed on the second category probability distribution vectors of all target domains included in the third set to obtain a first principal component feature of the target domain corresponding to a source domain category related to the target domain.

[0204] Principal component analysis is a widely used data dimensionality reduction method. The main idea is to map the original feature space to a new feature space with smaller dimensions and less information loss. Perform principal component analysis on the set of target domain output probability distribution vectors corresponding to each source domain category to extract the principal component features of the target domain output of each source domain category, which can be used to expand the training labels of the samples later.

[0205] Specifically, in the embodiments of the present application, Figure 3As shown, it is necessary to perform principal component analysis on the attribute features of the target domain based on the original samples. First, for the second category probability distribution vector of the target domain corresponding to the first classification category (i.e., source domain category) of each original sample in multiple original samples, a second set is obtained, wherein the second set of the first classification category (i.e., source domain category) corresponding to each original sample contains all the second category probability distribution vectors corresponding to this source domain category.

[0206] For example, the first classification category refers to category A in the source domain category, then the second category probability distribution vector corresponding to the first classification category refers to the second category probability distribution vector whose target domain category is category A and corresponds to the largest probability value in the second category probability distribution vector. It should be noted that the target domain categories are all included in the source domain categories.

[0207] The second set of a first classification category is obtained by the following formula:

[0208] ,in, Indicates that the first classification category (i.e., source domain category) is The second set of Represents the set of all second-category probability distribution vectors corresponding to each first-category category (i.e., source domain category), and The second set is obtained by union.

[0209] Furthermore, in the obtained second collection, a third set of second category probability distribution vectors of all target domains corresponding to source domain categories related to the target domain is obtained, the first classification category includes the source domain category related to the target domain, and the second collection includes the third set. That is to say, it is necessary to select the second category probability distribution vectors corresponding to the source domain category related to the target domain from the second category probability distribution vectors of the target domain corresponding to multiple first classification categories (i.e., source domain categories) included in the second set as the third set. The correspondence between the source domain category related to the target domain and the second category probability distribution vector is similar to the judgment method of the above-mentioned first classification category referring to category A in the source domain category and the second category probability distribution vector corresponding to the target domain category with the largest probability value in the second category probability distribution vector being category A, and will not be repeated here.

[0210] Finally, after obtaining the third set, principal component analysis is performed on all second category probability distribution vectors contained in the third set to obtain the first principal component features of the target domain corresponding to the source domain category related to the target domain.

[0211] In the embodiment of the present application, the source domain categories that are screened out and are related to the target domain The categories in Conduct principal component analysis to i Source domain categories Take it as an example, extract all the corresponding second category probability distribution vectors , the dimension is ,in, is the number of the second probability distribution vector, is the dimension of the probability distribution vector. By principal component analysis, the matrix The dimension of Down to ,get The first principal component feature of the target domain corresponding to all source domain categories in is output, denoted as , then The principal component eigenvectors in are normalized by softmax to obtain the normalized probability distribution.

[0212] Through the above embodiment, it is possible to first obtain the second set and the third set in sequence to obtain the second category probability distribution vectors of all target domains corresponding to the source domain categories related to the target domain, and then perform principal component analysis on all the second category probability distribution vectors of the third category, so as to accurately obtain the characteristics of the target domain.

[0213] Optionally, after step S105, the method further includes:

[0214] Inputting the original sample into the target model to obtain a fourth category probability distribution vector of the original sample;

[0215] For the original sample, calculating a second loss function based on the fourth category probability distribution vector and the hard label vector of the original sample in the target domain;

[0216] The parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated based on the second loss function.

[0217] Specifically, in the embodiments of the present application, Figure 3 As shown, after the expanded samples are obtained, the parameters of the target model can be iteratively updated based on the expanded samples and the original samples.

[0218] First, for the original sample, the original sample can be input into the target model to obtain the fourth category probability distribution vector of the original sample. One original sample corresponds to one fourth category probability distribution vector. The fourth category probability distribution vector represents the vector representation of the probability value of each second category in the target domain category that an original sample belongs to. It should be noted that the target model at this time has completed the update of the parameters of the embedded fully connected layer. Therefore, the fourth category probability distribution vector of the original sample is different from the second category probability distribution vector of the original sample, and the fourth category probability distribution vector is more accurate than the second category probability distribution vector.

[0219] The fourth category probability distribution vector The method of obtaining is as follows.

[0220]

[0221] Furthermore, for the original samples, a second loss function is calculated according to the fourth category probability distribution vector of each original sample and the hard label vector of the original sample in the target domain.

[0222] Among them, the calculation method of the second loss function is as follows:

[0223]

[0224] in, i Indicates i target domain categories, Indicates that the original sample belongs to the target domain category i The probability distribution vector of the fourth category corresponding to the second category, Indicates that the original sample belongs to the hard label vector of the second category in the target domain.

[0225] The second loss value calculated by the second loss function is used to update the parameters of the fully connected hidden layer and the parameters of the embedded fully connected layer of the target model.

[0226] Through the above embodiments, the fourth category probability distribution vector of the original sample generated after the application of the target model and the hard label vector of the original sample can be used to calculate the second loss function, thereby iteratively updating the target model to improve the accuracy of the category probability distribution vector in the target domain generated by the target model for the original sample.

[0227] Optionally, after step S105, the method further includes:

[0228] Inputting the expanded sample into the target model to obtain a fifth category probability distribution vector of the expanded sample;

[0229] For the expanded sample, calculating a hard label loss based on the fifth category probability distribution vector and a hard label vector of the expanded sample in the target domain;

[0230] For the expanded sample, based on the fifth category probability distribution vector and the first principal component feature, calculating the first principal component feature loss;

[0231] Based on the hard label loss and the first principal component feature loss, parameters of the fully connected hidden layer and parameters of the embedded fully connected layer of the target model are updated.

[0232] Specifically, in the embodiments of the present application, Figure 3 As shown, in addition to calculating the loss function for the original samples, the loss function can also be calculated for the expanded samples to update the target model.

[0233] First, for the expanded samples, the expanded samples can be input into the target model to obtain the fifth category probability distribution vector of the expanded samples. One expanded sample corresponds to one fifth category probability distribution vector. The fifth category probability distribution vector represents the vector representation of the probability value of an expanded sample belonging to each second category in the target domain category. It should be noted that the target model at this time has completed the update of the parameters of the embedded fully connected layer.

[0234] The fifth category probability distribution vector The method of obtaining is as follows.

[0235]

[0236] in, To expand the sample, is the probability distribution vector of the fifth category, and the category label of the expanded sample is recorded as .

[0237] Furthermore, for the expanded samples, the hard label loss is calculated based on the fifth category probability distribution vector of each expanded sample and the hard label vector of the expanded sample in the target domain. The hard label loss is calculated using a binary cross entropy function.

[0238] Among them, the calculation method of hard label loss is as follows:

[0239]

[0240] in, is the value of hard label loss, Indicates that the expanded sample belongs to the target domain category i The probability distribution vector of the fifth category corresponding to the second category, Indicates that the augmented sample belongs to the hard label vector of the second category in the target domain.

[0241] Furthermore, for the expanded samples, the first principal component feature loss is calculated based on the fifth category probability distribution vector and the first principal component feature, and the first principal component feature loss is calculated using the KL divergence function.

[0242] Among them, the calculation method of the first principal component feature loss is as follows:

[0243]

[0244] in, is the value of the first principal component feature loss, is the first principal component feature, Indicates the source domain category related to the target domain The corresponding i The first principal component features of the target domain categories.

[0245] Finally, according to the calculated value of the hard label loss and the value of the first principal component feature loss, the parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated, such as by back propagation calculation, similar to the previous text, to calculate the target model parameter gradient from back to front and update the parameters of the target model.

[0246] Through the above embodiments, the hard label loss and the first principal component feature loss can be calculated for the fifth category probability distribution vector of the expanded samples and the hard label vector of the expanded samples generated after the application of the target model, so as to iteratively update the target model to improve the correlation between the expanded samples generated by the target model and the target domain.

[0247] It should be noted that the embodiment of the present application describes the correlation between the category probability distribution vector output by the source domain and the category probability distribution vector output by the target domain through the first correlation integral, the second correlation integral, the first set, and the second set.

[0248] Optionally, updating parameters of a fully connected hidden layer and an embedded fully connected layer of the target model based on the hard label loss and the first principal component feature loss includes:

[0249] Set penalty hyperparameters;

[0250] Calculating a third loss function corresponding to the expanded sample based on the penalty hyperparameter, the hard label loss, and the first principal component feature loss;

[0251] Based on the third loss function, parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated.

[0252] Specifically, in order to achieve the expansion of the original sample while reducing the introduction of data noise in the expanded sample, this application introduces a penalty hyperparameter , the hard label loss and the first principal component feature loss are calculated by penalizing the hyperparameters, and the third loss function corresponding to the expanded sample is obtained. The parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated according to the third loss value.

[0253] Among them, the calculation method of the third loss value is as follows: is the third loss function.

[0254]

[0255] It should be noted that the training process of the target model is similar to the iterative update of the parameters of the target model mentioned above, which will not be repeated here.

[0256] Among them, the penalty hyperparameters in the embodiments of the present application can be set by the following factors:

[0257] Performance of the original or augmented samples: You can usually use methods such as cross-validation to select the optimal penalty hyperparameter by evaluating the performance of the target model on the original or augmented samples. Select the hyperparameter value that performs best on the validation set.

[0258] Grid search: You can use automatic parameter tuning methods such as grid search to try different penalty hyperparameter values ​​to find the optimal hyperparameter value.

[0259] Empirical knowledge: Set penalty hyperparameters based on domain knowledge or experience, and adjust hyperparameters according to different situations to obtain better results.

[0260] Learning curve: By drawing a learning curve and observing the performance trend of the target model on each sample as the penalty hyperparameter changes, the optimal range or value of the hyperparameter can be determined.

[0261] Regularization effect: Based on the understanding of regularization and the requirements for model complexity, adjust the value of the penalty hyperparameter to balance the model's fitting and generalization capabilities.

[0262] Through the above embodiments, during the iterative update of the parameters of the target model, a penalty hyperparameter can be introduced to achieve the technical effect of expanding the original samples while reducing the introduction of data noise of the expanded samples.

[0263] Figure 4 is a schematic diagram of a framework of a sample expansion device provided by an embodiment of the present application, such as Figure 4 As shown, the device comprises:

[0264] An original sample input module 11 is used to input the original sample of the target domain into the target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, and the first target domain output is the output of the embedded fully connected layer in the target model;

[0265] A category screening module 12, configured to perform category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain;

[0266] A cluster analysis module 13, configured to perform cluster analysis on the first target domain output to obtain cluster center features of the target domain;

[0267] A source domain sample input module 14 is used to input source domain samples of a source domain category related to the target domain into the target model to obtain a second target domain output, where the second target domain output is the output of the embedded fully connected layer in the target model;

[0268] The sample screening module 15 is used to screen the source domain samples based on the cluster center features and the second target domain output to obtain expanded samples related to the target domain.

[0269] Optionally, the original sample input module 11 includes:

[0270] A first input unit, configured to input the original sample of the target domain into the target model, and sequentially process the sample through the convolution hidden layer and the fully connected hidden layer of the target model to obtain the first source domain output;

[0271] A second input unit is used to input the first source domain output into the embedding fully connected layer of the target model to obtain the first target domain output, and the embedding fully connected layer is connected to the output end of the fully connected hidden layer;

[0272] The first source domain output is a first category probability distribution vector of the original sample in the source domain, and the first target domain output is a second category probability distribution vector of the original sample in the target domain;

[0273] The device also includes:

[0274] A first loss function calculation unit, configured to calculate a first loss function based on the second category probability distribution vector and a hard label vector of the original sample in the target domain;

[0275] A first updating unit is used to update the parameters of the embedded fully connected layer based on the first loss function.

[0276] Optionally, the source domain includes a plurality of first categories, the target domain includes a plurality of second categories, the number of the first categories is not less than the number of the second categories, and the apparatus further includes:

[0277] A first category acquisition module is used to obtain a first classification category of the original sample in the source domain based on the first category probability distribution vector before performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain, wherein the first classification category is a first category corresponding to a maximum value in the first category probability distribution vector corresponding to the original sample;

[0278] A second category acquisition module is used to acquire a second classification category of the original sample in the target domain based on the second category probability distribution vector, wherein the second classification category is a second category corresponding to the maximum value in the second category probability distribution vector corresponding to the original sample.

[0279] Optionally, the category screening module 12 includes:

[0280] A first correlation score calculation unit, configured to calculate, for the plurality of original samples, a first correlation score between the first classification category and the second classification category according to the first classification category and the second classification category corresponding to the original samples, wherein the first correlation score is used to represent the correlation between the first classification category and the second classification category;

[0281] A first correlation score accumulation unit, configured to accumulate the first correlation score after calculating the first correlation score between the first classification category and the second classification category each time;

[0282] A second correlation score acquisition unit, configured to sum a plurality of the first correlation scores for the first classification category to obtain a second correlation score, wherein the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories;

[0283] The source domain category screening unit is used to screen out the first classification category whose second relevance score is greater than a relevance score threshold as the source domain category related to the target domain.

[0284] Optionally, the category screening module 12 includes:

[0285] A first correlation score calculation unit, configured to calculate, for the plurality of original samples, a first correlation score between the first classification category and the second classification category according to the first classification category and the second classification category corresponding to the original samples, wherein the first correlation score is used to represent the correlation between the first classification category and the second classification category;

[0286] A first correlation score accumulation unit, configured to accumulate the first correlation score after calculating the first correlation score between the first classification category and the second classification category each time;

[0287] A second correlation score acquisition unit, configured to sum a plurality of the first correlation scores for the first classification category to obtain a second correlation score, wherein the second correlation score is used to represent a correlation between the first classification category and a plurality of second classification categories;

[0288] A preset ratio threshold setting unit, used to set a preset ratio threshold, wherein the preset ratio threshold has a value range between 0 and 1;

[0289] A score list acquisition unit, used for sorting each of the first classification categories from high to low according to the corresponding second relevance score to obtain a score list;

[0290] a proportion value acquiring unit, configured to accumulate, in the order of the integral list, the first second correlation integral in the integral list, and divide the accumulated result by the total integral of the plurality of second correlation integrals to obtain a proportion value;

[0291] The source domain category acquisition unit is used to use the first classification category corresponding to the accumulated multiple second correlation scores as the source domain category related to the target domain when the ratio value is not less than the preset ratio threshold during the accumulation of the second correlation scores.

[0292] Optionally, the cluster analysis module 13 includes:

[0293] A first collection statistics unit, configured to count, for the plurality of original samples, a first collection of second category probability distribution vectors of all target domains corresponding to the second classification category;

[0294] A cluster center feature acquisition unit, configured to perform cluster analysis on the second category probability distribution vectors of all target domains included in the first collection, and obtain cluster center features of the second classification category corresponding to the second category probability distribution vectors of all target domains included in the first collection;

[0295] The cluster center features include cluster center vectors and center distances.

[0296] Optionally, the second target domain output is a third category probability distribution vector of the source domain samples of the source domain category related to the target domain in the target domain, and the sample screening module 15 includes:

[0297] A third classification category obtaining unit, configured to determine, based on the third category probability distribution vector, a third classification category of each sample included in the source domain samples of the source domain category related to the target domain;

[0298] a distance determining unit, configured to determine, for each sample included in the source domain samples, a distance between a probability distribution vector of a third category corresponding to the sample and a cluster center vector of the second classification category;

[0299] a distance judgment unit, configured to judge, for each sample included in the source domain samples, a distance relationship between a distance corresponding to the sample and the center distance;

[0300] The expansion sample determination unit is configured to add samples corresponding to the distances that meet the preset conditions in the source domain samples of the source domain category related to the target domain to the expansion samples when the distance relationship meets the preset conditions.

[0301] Optionally, the distance judgment unit includes:

[0302] A distance judging subunit, used for judging whether the distance is not greater than the center distance;

[0303] a determining unit, configured to determine that the third classification category of the sample belongs to the plurality of second categories when the distance corresponding to the sample is not greater than the center distance;

[0304] The expanded sample determination subunit is used to add the samples corresponding to the distances that meet the preset conditions into the expanded samples.

[0305] Optionally, the device further comprises:

[0306] A second collection statistics unit is used for, before the source domain samples are screened based on the cluster center features and the second target domain output to obtain the expanded samples related to the target domain, to count a second collection of second category probability distribution vectors of all target domains corresponding to the first classification category for a plurality of the original samples;

[0307] a third set acquisition unit, configured to acquire, from the second set, a third set of second category probability distribution vectors of all target domains corresponding to source domain categories related to the target domain, wherein the first classification category includes the source domain category related to the target domain, and the second set includes the third set;

[0308] The principal component analysis unit is used to perform principal component analysis on the second category probability distribution vectors of all target domains contained in the third set to obtain the first principal component features of the target domain corresponding to the source domain category related to the target domain.

[0309] Optionally, the device further comprises:

[0310] a fourth category probability distribution vector acquisition unit, configured to, after obtaining the expanded sample related to the target domain, input the original sample into the target model to obtain a fourth category probability distribution vector of the original sample;

[0311] A second loss function calculation unit, configured to calculate a second loss function for the original sample based on the fourth category probability distribution vector and a hard label vector of the original sample in the target domain;

[0312] A second updating unit is used to update parameters of the fully connected hidden layer and the embedded fully connected layer of the target model based on the second loss function.

[0313] Optionally, the device further comprises:

[0314] a fifth category probability distribution vector acquisition unit, configured to, after obtaining an expanded sample related to the target domain, input the expanded sample into the target model to obtain a fifth category probability distribution vector of the expanded sample;

[0315] a hard label loss calculation unit, configured to calculate a hard label loss for the expanded sample based on the fifth category probability distribution vector and a hard label vector of the expanded sample in the target domain;

[0316] A first principal component feature loss calculation unit, configured to calculate a first principal component feature loss for the expanded sample based on the fifth category probability distribution vector and the first principal component feature;

[0317] A third updating unit is used to update parameters of the fully connected hidden layer and the embedded fully connected layer of the target model based on the hard label loss and the first principal component feature loss.

[0318] Optionally, the third updating unit includes:

[0319] A penalty hyperparameter setting unit is used to set penalty hyperparameters;

[0320] A third loss function acquisition unit, configured to calculate a third loss function corresponding to the expanded sample based on the penalty hyperparameter, the hard label loss, and the first principal component feature loss;

[0321] The third updating subunit is used to update the parameters of the fully connected hidden layer and the embedded fully connected layer of the target model based on the third loss function.

[0322] Based on the same inventive concept, another embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the sample expansion method as described in any of the above embodiments.

[0323] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to perform the sample expansion method described in any of the above embodiments.

[0324] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the sample expansion method as described in any of the above embodiments is implemented.

[0325] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0326] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0327] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0328] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0329] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0330] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0331] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0332] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0333] The above is a detailed introduction to a sample expansion method, electronic device, computer-readable medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A sample expansion method, characterized in that: The method comprises: Inputting the original samples of the target domain into the target model to obtain a first source domain output and a first target domain output, wherein the embedded fully connected layer of the target model is obtained by learning the transformation relationship between the source domain and the target domain, the first source domain output is the output of the fully connected hidden layer in the target model, the first target domain output is the output of the embedded fully connected layer in the target model, and the target model is used for image classification; the original samples of the target domain are image datasets whose sample number is less than a preset threshold; Performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain; Performing cluster analysis on the first target domain output to obtain cluster center features of the target domain; Inputting source domain samples of source domain categories related to the target domain into the target model to obtain a second target domain output, where the second target domain output is the output of the embedded fully connected layer in the target model, and the source domain samples are image datasets whose sample number or category number is greater than the sample number or category number of original samples of the target domain; Based on the cluster center features and the second target domain output, the source domain samples are screened to obtain expanded samples related to the target domain; The step of inputting the original sample of the target domain into the target model to obtain a first source domain output and a first target domain output includes: Inputting the original sample of the target domain into the target model, and processing it sequentially through the convolution hidden layer and the fully connected hidden layer of the target model to obtain the first source domain output; Inputting the first source domain output into an embedding fully connected layer of the target model to obtain the first target domain output, wherein the embedding fully connected layer is connected to an output end of the fully connected hidden layer; Among them, the first source domain output is the first category probability distribution vector of the original sample in the source domain, and the first target domain output is the second category probability distribution vector of the original sample in the target domain.

2. The sample expansion method according to claim 1, characterized in that: The method further comprises: Calculate a first loss function based on the second category probability distribution vector and the hard label vector of the original sample in the target domain; The parameters of the embedded fully connected layer are updated based on the first loss function.

3. The sample expansion method according to claim 1, characterized in that: The source domain includes a plurality of first categories, the target domain includes a plurality of second categories, the number of the first categories is not less than the number of the second categories, and before performing category screening according to the first source domain output and the first target domain output to obtain source domain categories related to the target domain, the method further includes: Based on the first category probability distribution vector, obtaining a first classification category of the original sample in the source domain, the first classification category being a first category corresponding to a maximum value in the first category probability distribution vector corresponding to the original sample; Based on the second category probability distribution vector, a second classification category of the original sample in the target domain is obtained, where the second classification category is the second category corresponding to the maximum value in the second category probability distribution vector corresponding to the original sample.

4. The sample expansion method according to claim 3, characterized in that: The performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain includes: For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category; After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score; For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories; A first classification category whose second relevance score is greater than a relevance score threshold is screened out as a source domain category related to the target domain.

5. The sample expansion method according to claim 4, characterized in that: The performing category screening according to the first source domain output and the first target domain output to obtain a source domain category related to the target domain includes: For the plurality of original samples, according to the first classification category and the second classification category corresponding to the original samples, calculate a first correlation integral between the first classification category and the second classification category, wherein the first correlation integral is used to represent the correlation between the first classification category and the second classification category; After each calculation of the first correlation score between the first classification category and the second classification category, accumulating the first correlation score; For the first classification category, summing up a plurality of the first correlation scores to obtain a second correlation score, where the second correlation score is used to represent the correlation between the first classification category and a plurality of second classification categories; Setting a preset ratio threshold, wherein the value range of the preset ratio threshold is between 0 and 1; Sort each of the first classification categories according to the corresponding second relevance score from high to low to obtain a score list; Accumulate the first second correlation integral in the integral list in the order of the integral list, and divide the accumulated result by the total integral of the plurality of second correlation integrals to obtain a proportional value; During the accumulation of the second correlation scores, when the ratio value is not less than the preset ratio threshold, the first classification category corresponding to the accumulated plurality of second correlation scores is used as the source domain category related to the target domain.

6. The sample expansion method according to claim 3, characterized in that: The performing cluster analysis on the first target domain output to obtain the cluster center features of the target domain includes: For the plurality of original samples, counting a first set of second category probability distribution vectors of all target domains corresponding to the second classification category; Performing cluster analysis on the second category probability distribution vectors of all target domains included in the first collection to obtain cluster center features of the second classification categories corresponding to the second category probability distribution vectors of all target domains included in the first collection; The cluster center features include cluster center vectors and center distances.

7. The sample expansion method according to claim 6, characterized in that: The second target domain output is a third category probability distribution vector of the source domain samples of the source domain category related to the target domain in the target domain, and the source domain samples are screened based on the cluster center features and the second target domain output to obtain the expanded samples related to the target domain, including: Determine, based on the third category probability distribution vector, a third classification category of each sample included in the source domain samples of the source domain category related to the target domain; For each sample included in the source domain samples, determine the distance between the third category probability distribution vector corresponding to the sample and the cluster center vector of the second classification category; For each sample included in the source domain samples, determining a distance relationship between a distance corresponding to the sample and the center distance; When the distance relationship meets a preset condition, samples corresponding to the distance that meets the preset condition among the source domain samples of the source domain category related to the target domain are added to the expanded samples.

8. The sample expansion method according to claim 7, characterized in that: The determining the distance relationship between the distance corresponding to the sample and the center distance includes: Determining whether the distance is not greater than the center distance; When the distance corresponding to the sample is not greater than the center distance, determining that the third classification category of the sample belongs to the plurality of second categories; The samples corresponding to the distances that meet the preset conditions are added to the expanded samples.

9. The sample expansion method according to claim 3, characterized in that: Before the source domain samples are screened based on the cluster center features and the second target domain output to obtain the expanded samples related to the target domain, the method further includes: For the plurality of original samples, counting a second set of second category probability distribution vectors of all target domains corresponding to the first classification category; In the second collection, obtaining a third set of second category probability distribution vectors of all target domains corresponding to source domain categories related to the target domain, wherein the first classification category includes the source domain category related to the target domain, and the second collection includes the third set; A principal component analysis is performed on the second category probability distribution vectors of all target domains included in the third set to obtain a first principal component feature of the target domain corresponding to a source domain category related to the target domain.

10. The sample expansion method according to claim 9, characterized in that: After obtaining the expanded samples related to the target domain, the method further includes: Inputting the original sample into the target model to obtain a fourth category probability distribution vector of the original sample; For the original sample, calculating a second loss function based on the fourth category probability distribution vector and the hard label vector of the original sample in the target domain; The parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated based on the second loss function.

11. The sample expansion method according to claim 9, characterized in that: After obtaining the expanded samples related to the target domain, the method further includes: Inputting the expanded sample into the target model to obtain a fifth category probability distribution vector of the expanded sample; For the expanded sample, calculating a hard label loss based on the fifth category probability distribution vector and a hard label vector of the expanded sample in the target domain; For the expanded sample, calculating a first principal component feature loss based on the fifth category probability distribution vector and the first principal component feature; Based on the hard label loss and the first principal component feature loss, parameters of the fully connected hidden layer and parameters of the embedded fully connected layer of the target model are updated.

12. The sample expansion method according to claim 11, characterized in that: The updating of parameters of the fully connected hidden layer and the embedded fully connected layer of the target model based on the hard label loss and the first principal component feature loss includes: Set penalty hyperparameters; Calculating a third loss function corresponding to the expanded sample based on the penalty hyperparameter, the hard label loss, and the first principal component feature loss; Based on the third loss function, parameters of the fully connected hidden layer and the embedded fully connected layer of the target model are updated.

13. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the sample expansion method according to any one of claims 1 to 12.

14. A computer readable medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the sample expansion method as described in any one of claims 1 to 12 is implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the sample expansion method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Unsupervised pedestrian re-identification method for enhancing sample data

    CN111832511A

  • Cross-domain facial expression recognition method irrelevant to source domain data

    CN114973350A

  • Complex working condition gear fault diagnosis method based on matching element learning under few samples

    CN116593157A

  • Method for realizing migration fault diagnosis among different domains by data enhancement of small sample problem data

    CN117609757A

  • Data augmentation device, learning device, data augmentation method, and recording medium

    US20230252765A1