A method for constructing a deep adaptation network based on robust soft labels

Generating robust soft labels by maximizing the nuclear norm of the prediction probability matrix and reformulating the label-induced loss in a probability-weighted manner solves the problem of large deviations between hard labels and soft labels in domain adaptation and improves the reliability of feature extraction. characteristics and feature recognition capabilities, reducing distribution differences between domains.

CN114372559BActive Publication Date: 2024-10-29DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111628171.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2024-10-29
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In existing domain adaptation methods, there is a problem of excessive deviation between hard labels and soft labels when constructing label-induced losses, resulting in unreliable feature extraction and difficulty in effectively reducing distribution differences between domains.

Method used

By maximizing the nuclear norm of the prediction probability matrix, robust soft labels are generated, and the label-induced loss is reformulated in a probability-weighted manner to reduce the impact of noise and improve the reliability of feature extraction.

Benefits of technology

It achieves more reliable feature representation and stronger feature recognition capabilities, reduces inter-domain distribution shifts, and improves the effect of domain adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114372559B_ABST
    Figure CN114372559B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of computer vision, and provides a method for constructing a deep adaptive network based on robust soft labels. This method maximizes the nuclear norm of the prediction probability matrix, filters out noise probabilities while retaining important probabilities, thereby generating a new label form, and then restating the label-induced loss in a probability-weighted manner, such as CMMD, intra-class distance, and inter-class distance. The present invention proves that robust soft labels constrained by nuclear norms have more reliable representation capabilities than traditional hard labels and soft labels, and restating label-induced losses in a probability-weighted manner has also been proven to be a more interpretable and reasonable loss function modeling, thereby solving the problem of excessive deviation of traditional hard labels and soft labels when modeling label-related losses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and specifically relates to a method for constructing a deep adaptation network based on robust soft labels. Background Art

[0002] Although deep learning technology has been widely used, the performance and benefits of deep learning rely heavily on a large amount of labeled data. In practical scenarios, manually annotating sufficient training data often takes a lot of time and cost, and the domain drift problem between data from different sources is also a big obstacle. Therefore, the concept of domain adaptation (DA) was proposed, which uses the knowledge of the label-rich domain (i.e., the source domain) to help the learning of the related but unlabeled domain (i.e., the target domain).

[0003] Domain adaptation reuses a classifier trained on the source domain to annotate another unlabeled target domain, and the two domains follow different distributions. A crucial issue in domain adaptation tasks is how to reduce the distribution difference between the two domains. To solve this problem, a common approach to domain adaptation is to learn domain-invariant features through feature alignment. These methods are roughly divided into difference-based methods and adversarial-based methods: Difference-based methods align distributions by minimizing well-designed metric distances, such as Long et al. designed the maximum mean difference of multi-kernel variables (MK-MMD) in the paper "Learning Transferable Features with Deep Adaptation Networks"; adversarial-based methods use domain discriminators to distinguish between source domain samples and target domain samples, while feature extractors try to confuse domain discriminators, such as Ganine et al. first introduced the idea of ​​adversarial into the field of domain adaptation in the paper "Domain-Adversarial Training of Neural Networks". In addition, considering that the discriminative ability is conducive to the completion of classification tasks, some mainstream methods often try to design some discriminative distances to discover discriminative structures hidden in the original feature space. These discriminative distances often require the introduction of true labels to model label-induced losses. Since the true labels of the target domain are unavailable, existing methods usually use the predicted labels of the target samples instead of the true labels. For the predicted labels, there can be different forms such as hard labels and soft labels.For example, Yang et al. added the maximum mean difference of classes designed with hard labels as weights in the paper "Bi-Directional Generation for Unsupervised Domain Adaptation", and achieved better results by integrating additional metric losses in the adversarial method; Zhu et al. designed the maximum mean difference of classes with soft labels as weights in the paper "Deep Subdomain Adaptation Network for Image Classification", and calculated the average deviation between the corresponding categories in the source domain and the target domain to align their conditional distributions; Li et al. integrated the cross-domain intra-class distance with hard labels as weights, the source domain intra-class distance and the target domain intra-class distance in the paper "Joint Domain Alignment and Discriminative Feature Learning for Unsupervised Deep Domain Adaptation", and minimized the inter-domain divergence and maximized the intra-domain density by reducing the newly designed intra-class distance; Chen et al. In the paper "Adaptation", the class center is designed by combining the soft label with the sample instance as the weight. The intra-class distance and inter-class distance of the two domains are designed through the class center. The intra-class distance makes two samples from the same class close together, and the inter-class distance makes two samples from different classes far away. The above methods all use two forms of labels respectively. Specifically, the hard label divides the sample into a clear category, but when the quality of the predicted label is poor, this form will cause negative transfer due to over-certainty. For example: the probability of a horse sample prediction label in the "zebra" category is slightly greater than the probability of the "horse" category, but due to the nature of the hard label, this sample is considered to belong completely to the "zebra" category, which will cause a large deviation in the label induced loss; the soft label is to distribute the sample's contribution to each category according to probability, thereby alleviating the negative transfer problem caused by the hard label. However, due to the influence of some small probability noise, soft labels will also cause deviations in label induced loss. Therefore, both of these label forms may mislead the modeling process of label induced loss. Summary of the invention

[0004] The purpose of the present invention is to provide a method for constructing a deep adaptive network based on robust soft labels, which makes up for the shortcomings of existing methods. This method maximizes the nuclear norm of the prediction probability matrix, filters out noise probabilities while retaining important probabilities, thereby generating a form of robust soft labels, and then reformulating the label induced loss in a probability-weighted manner in the new label form, thereby solving the problem of excessive deviation between traditional hard labels and soft labels when constructing label induced losses.

[0005] The technical solution of the present invention:

[0006] A method for constructing a deep adaptation network based on robust soft labels, the steps are as follows:

[0007] (1) Obtain the prediction probability matrix of input data:

[0008] First, load the network parameters of the pre-trained ResNet and replace the settings after the last average pooling layer with a bottleneck layer f with 256 units. cb , we use the modified network as a feature extraction network to obtain a reasonable feature representation. Then we input the batch data into the feature extraction network and input the obtained features into the softmax layer to obtain the required prediction probability matrix:

[0009]

[0010]

[0011] Among them, X s is the source domain data, X t is the target domain data, G is the feature extraction network, F is the softmax function, is the prediction probability matrix of the required source domain data, is the predicted probability matrix of the required target domain data.

[0012] (2) Minimize the cross entropy loss of source domain data:

[0013] By minimizing the cross entropy loss between the predicted probability of source domain data and the true label, the feature extraction network obtains the feature representation ability of the source domain data.

[0014]

[0015] Among them, CE represents the cross entropy function (Cross Entropy), is the predicted label of the source domain data output in (1), Y s is the true label of the source domain data.

[0016] (3) Maximize the nuclear norm of the target domain prediction probability matrix

[0017] The nuclear norm of the matrix is ​​obtained by summing the singular values ​​of the matrix. First, the target domain probability matrix is ​​decomposed by singular value:

[0018]

[0019] Among them, ∑ is a B×C matrix, B is the number of batch data, C is the number of categories, each element on the main diagonal of ∑ is called a singular value, and the rest of the elements are zero.

[0020] Then the nuclear norm of the prediction probability matrix is ​​obtained by summing the singular values ​​of the target domain probability matrix:

[0021]

[0022] Among them, ∑ ii represents the main diagonal elements of the Σ matrix, and min(B,C) represents the minimum value of B and C.

[0023] (4) Re-state the label-induced loss in a probability-weighted manner:

[0024] When we obtain the new label form, we reformulate the distribution distance loss of MMD-like (CMMD) in a probability-weighted manner as follows:

[0025]

[0026]

[0027]

[0028] in, represents the Hilbert-Schmidt norm, represents the i-th source domain sample, represents the jth target domain sample, φ represents the feature map of Hilbert space (RKHS), n s Represents the number of source domain samples, n t represents the number of target domain samples, and the L3 loss is calculated by calculating the mean difference of each class between the source domain and the target domain to minimize the conditional distribution shift between the two domains. represents the contribution of the i-th sample in the source domain to the mean of the C-th class, represents the true label of the i-th sample in the source domain in category C, It means summing the true labels of all samples belonging to the Cth class in the Cth class; represents the contribution of the i-th sample in the target domain to the mean of class C, represents the robust soft label of the i-th sample in the source domain in the C-th category, It represents the sum of the robust soft labels of all samples belonging to the Cth class in the Cth class.

[0029] Similarly, we reformulate the intra-class and inter-class distances of the source domain in a probabilistic way as follows:

[0030]

[0031] Among them, the first term is the intra-class distance, the second term is the inter-class distance, ||·||2 represents the 2-norm, b1 and b2 are two given thresholds, 0 and 100 respectively, It is the various centers obtained by weighting all samples in the source domain by the true labels. The class center is obtained by all samples belonging to the i-th class in the source domain. Similarly, the goal of the intra-class distance is to minimize the distance between the class center and each sample belonging to the class, and the goal of the inter-class distance is to maximize the distance between the center points of two different classes, thereby improving the feature recognition ability.

[0032] Similarly, we give the two distances of the target domain as follows:

[0033]

[0034] It is the center of each class calculated by all samples in the target domain, and its weight is the probability that the sample belongs to this class in the robust soft label. The class center is obtained by all samples belonging to the i-th class in the source domain. Same reason.

[0035] Effects and benefits of the present invention: The present invention obtains a new label form by making maximum use of the nuclear norm constraint of the prediction probability matrix, and reformulates the label induced loss in a probability weighted manner, such as CMMD, intra-class distance and inter-class distance. The robust soft label constrained by the nuclear norm has a more reliable representation ability than the traditional hard label and soft label, and reformulating the label induced loss in a probability weighted manner has also been proven to be a more interpretable and reasonable loss function modeling. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is an algorithm framework diagram of an embodiment of the present invention.

[0037] Figure 2It is a comparison chart of feature visualization effects of embodiments of the present invention; the figure uses the t-distributed stochastic neighbor embedding (TSNE) method to visualize the target domain data features obtained by different methods. The degree of scattering of the data points in the figure also represents the strength of the feature identifiability. Among them, part (a) represents the feature visualization effect output by the standard feature extraction network (ResNet-50); part (b) represents the feature visualization effect output by the deep adaptation network combined with hard labels; part (c) represents the feature visualization effect output by the deep adaptation network combined with soft labels; part (d) represents the feature visualization effect output by the method of the present invention (deep adaptation network combined with robust soft labels).

[0038] Figure 3 This is a visualization comparison diagram of the probability distribution of the embodiment of the present invention; the horizontal axis in the figure represents the target domain sample sequence, the vertical axis represents the predicted probability value, and the scatter points under the same horizontal axis represent the predicted probability value of the sample in each category. In addition, part (a) shows the predicted probability matrix scatter plot output by the deep adaptation network combined with the soft label induced loss when the number of iterations is 120; part (b) shows the predicted probability matrix scatter plot output by the method of the present invention when the number of iterations is 120. DETAILED DESCRIPTION

[0039] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of them.

[0040] Figure 1 FIG. 1 is an algorithm framework diagram of an embodiment of the present invention. Figure 1 As shown, the embodiment of the present invention selects two sub-datasets of webcam and amazon in the "office-31" data set as the source domain and target domain respectively. The two sub-datasets have the same category, both of which are 31 categories. The present invention randomly selects 32 pictures from webcam as source domain data and 32 pictures from amazon as target domain data. These 64 pictures are cropped and converted into vector form to form the input matrix X s and X t ; First, load the pre-trained ResNet-50 network model and replace the settings after the last average pooling layer with a bottleneck layer f with 256 units cb , then X s and X t Input into the modified feature extraction network (ResNet-50) to obtain a feature matrix G (X s ) and G(X t ); then the feature matrix G(X s ) and G(X t) is input to the softmax layer, and the prediction probability matrix with a dimension of 32×31 is calculated by the softmax function and The 31 values ​​in a row of the prediction probability matrix represent the probability values ​​of a single image belonging to 31 categories after feature extraction. And the true labels Y of the 32 images in the source domain s Calculating cross entropy loss Then the obtained target domain prediction probability matrix Perform singular value decomposition to obtain a singular value matrix ∑ with a dimension of 32×31. By summing the singular values ​​on the main diagonal of the matrix, we can get Nuclear norm of a matrix By maximizing the nuclear norm To constrain the prediction probability matrix And get the robust soft label, that is, Calculate the weights of the 32 source domain data for their respective categories using the true labels Calculate the harmonic weights of the 32 data in the target domain to their respective categories using robust soft labels By weight and Constructing class maximum mean difference loss In the source domain, As G(X s ) is the feature of a single sample multiplied by the weight of the category to which the sample belongs. Get the contribution of the sample to the center of the category to which it belongs Then add up all the contributions belonging to this category to get the class center In the target domain, As G(X t ) is the feature of a single sample multiplied by the weight of the category to which the sample belongs. Get the contribution of the sample to the center of the category to which it belongs Then add up all the contributions belonging to this category to get the class center By weight and Class Center Construct the intra-class and inter-class losses in the source domain and the intra-class and inter-class losses in the target domain:

[0041]

[0042] and

[0043] Then minimize the overall loss function To train the deep adaptation network, where n s =nt =32, α=0.5, β=0.01, δ=0.6.

[0044] After this training is completed, continue to randomly select 32 pictures from the webcam as source domain data, and randomly select 32 pictures from Amazon as target domain data, repeat the above process, and finally stop the repetitive process when the set iteration stop condition is reached (the overall loss function converges), and save the obtained network model by saving the deep adaptation network parameters at this time Then crop all the images in Amazon and convert them into vector form to form a matrix Input to the final network model In the above example, we get the feature matrix Then, the feature matrix is ​​transformed into Visualize and get Figure 2 (d), the feature distribution in the figure is very low, which shows that the features extracted by the present invention have strong identification ability to a certain extent. In addition, we use the pre-trained ResNet network as one of the comparison methods. The features extracted by this comparison method are visualized and obtained. Figure 2 (a), the distribution of features in the figure is particularly scattered, which also means that the extracted features have relatively poor discriminability; we replace the robust soft labels with hard labels and soft labels to obtain the network model as a comparison method. After the features extracted by these two comparison methods are visualized, we get Figure 2 (b) and Figure 2 (c) The feature distribution in the figure is less scattered than that of the ResNet method, but higher than that of the method of the present invention, which also shows that the feature identifiability of the method of the present invention is greatly improved compared with hard labels and soft labels. Then the softmax function is used to calculate the feature matrix The predicted output matrix Then Expressed in the form of a scatter plot, we get Figure 3 (b); In addition, we obtain The predicted output matrix in the soft label comparison method is expressed in the form of a scatter plot and obtained Figure 3 (a). The horizontal axis of the scatter plot represents the target domain sample sequence, and the vertical axis represents the predicted probability. The 31 scatter points under the same horizontal axis represent the predicted probability of the same sample in 31 categories. It can be found that Figure 3 (a) There are few probability points with medium and high confidence, and most of the scattered points are distributed in the medium probability and small probability intervals, indicating that the soft label comparison method is not certain enough in predicting the category; Figure 3Most of (b) are distributed in the extremely high and extremely low ranges, indicating that the prediction certainty of the category in the embodiment of the present invention is relatively high.

Claims

1. A method for constructing a deep adaptive network based on robust soft labels, characterized in that: Here are the steps: (1) Obtain the prediction probability matrix of input data: First, load the network parameters of the pre-trained ResNet and replace the settings after the last average pooling layer with a bottleneck layer f with 256 units. cb , use the modified network as the feature extraction network; The batch data is then input into the feature extraction network, and the obtained features are input into the softmax function to obtain the required prediction probability matrix: Among them, X s is the source domain data, X t is the target domain data, G is the feature extraction network, F is the softmax function, is the prediction probability matrix of the required source domain data, is the prediction probability matrix of the required target domain data; (2) Minimize the cross entropy loss of source domain data: By minimizing the cross entropy loss between the predicted probability of source domain data and the true label, the feature extraction network obtains the feature representation ability of the source domain data; Among them, CE represents the cross entropy function, is the predicted label of the source domain data output in step (1), Y s is the true label of the source domain data; (3) Maximize the nuclear norm of the target domain prediction probability matrix The nuclear norm of the matrix is ​​obtained by summing the singular values ​​of the matrix; first, the singular value decomposition of the target domain probability matrix is ​​performed: Among them, ∑ is a B×C matrix, B is the number of batch data, C is the number of categories, each element on the main diagonal of ∑ is called a singular value, and the rest of the elements are zero; Then the nuclear norm of the prediction probability matrix is ​​obtained by summing the singular values ​​of the target domain probability matrix: Among them, ∑ ii represents the main diagonal elements of the Σ matrix, min(B,C) represents the minimum value of B and C; (4) Re-state the label-induced loss in a probability-weighted manner: When a new label form is obtained, the MMD-like distribution distance loss is restated in a probability-weighted manner as follows: in, represents the Hilbert-Schmidt norm, represents the i-th source domain sample, represents the jth target domain sample, φ represents the feature map of the Hilbert space, n s Represents the number of source domain samples, n t Represents the number of samples in the target domain. The L3 loss calculates the mean difference of each class between the source domain and the target domain to minimize the conditional distribution shift between the two domains. represents the contribution of the i-th sample in the source domain to the mean of the C-th class, represents the true label of the i-th sample in the source domain in category C, It means summing the true labels of all samples belonging to the Cth class in the Cth class; represents the contribution of the i-th sample in the target domain to the mean of the C-th class, represents the robust soft label of the i-th sample in the source domain in the C-th category, represents the sum of the robust soft labels of all samples belonging to class C in class C; Similarly, the intra-class and inter-class distances of the source domain are restated in a probabilistic way as follows: Among them, the first term is the intra-class distance, the second term is the inter-class distance, ||·||2 represents the 2-norm, b1 and b2 are two given thresholds, 0 and 100 respectively, It is the various centers obtained by weighting all samples in the source domain by the true labels. The class center is obtained by all samples belonging to the i-th class in the source domain. Similarly, the goal of intra-class distance is to minimize the distance between the class center and each sample belonging to the class, and the goal of inter-class distance is to maximize the distance between the center points of two different classes, thereby improving the feature recognition ability; Similarly, we give the two distances of the target domain as follows: It is the center of each class calculated by all samples in the target domain, and its weight is the probability that the sample belongs to this class in the robust soft label. The class center is obtained by all samples belonging to the i-th class in the source domain. Same reason.

Citation Information

Patent Citations

  • Nuclear-norm driven data classification method and system

    CN106203517A

  • Underwater acoustic target radiation noise identification method based on domain adaptation

    CN111709315A