Graph adversarial discrimination domain adaptation algorithm with category level alignment

By introducing graph structure and label smoothing cross-entropy loss into the graph adversarial domain adaptation algorithm, the category-level domain alignment problem in the existing technology is solved, the alignment of domains and categories is achieved, and the model performance and classification accuracy are improved.

CN118840531APending Publication Date: 2024-10-25CHONGQING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410897064.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-25

AI Technical Summary

Technical Problem

Existing technologies fail to effectively solve the domain alignment problem at the category level in the field of image recognition, resulting in performance degradation in the classification task of the target domain.

Method used

A graph adversarial domain adaptation (GADDA) algorithm is proposed. By constructing the graph structure of the target domain data and introducing graph loss, combined with label smoothing cross-entropy loss, it achieves category alignment and enhances the generalization performance of the network.

Benefits of technology

It effectively solves the domain differences at the category level, improves the model performance of each category, realizes the alignment of domains and categories, and improves the representation ability and classification accuracy of target domain data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118840531A_ABST
    Figure CN118840531A_ABST
Patent Text Reader

Abstract

The invention provides a graph adversarial discrimination domain adaptation algorithm with category level alignment, and an adversarial network based on internal retention of a data structure is introduced into a domain adaptation problem by constructing the graph structure of the data. According to the algorithm model, a source domain encoder and a classifier are pre-trained on a source domain data set, then in the encoder for training a target domain, a graph structure of data is constructed, a domain discriminator is introduced, and alignment of categories and domains of source domain data and target domain data in a feature space is realized through alternate updating of the encoder and the discriminator, so that the target domain data is obtained. Therefore, the problem of data distribution drift is solved, and domain adaptation is realized. Meanwhile, the model introduces label smooth cross entropy loss to replace cross entropy loss, so that the network has better robustness and generalization performance, and test data of a target domain can show higher classification accuracy rate in a classification network consisting of a target domain encoder and a classifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unsupervised domain adaptation for machine learning, and in particular to a category-level aligned graph adversarial discriminant domain adaptation algorithm. Background Art

[0002] In the past few years, deep neural networks have made remarkable progress in numerous application areas. However, one major limitation they encounter is the dataset bias or domain shift problem. This problem occurs when a model performs exceptionally well on a training dataset, but shows degraded performance when tested on a test dataset or real samples, such as Figure 1 (a). Such scenarios are usually attributed to different distributions between datasets and are affected by factors such as lighting conditions, image quality, and background. Although studies have shown that deep neural networks are capable of learning transferable feature representations across various datasets, the performance degradation problem due to domain shift is still prevalent when evaluating these models on different datasets. Domain adaptation has emerged as a technique to address such challenges by instructing deep neural networks to map the source and target domains to a common feature space, thereby alleviating the negative impact of domain shift or dataset bias.

[0003] Adversarial discriminative methods have become a widely adopted technology in various industries. This method involves two neural networks: an encoder and a discriminator. Their optimization goals are diametrically opposed, forming a dynamic confrontation. The encoder strives to encode images of the source domain and the target domain into a common feature space, making it difficult for the discriminator to accurately distinguish between the two domains. The discriminator strives to identify the differences in these features to distinguish between the source domain and the target domain. This adversarial learning process is iterated until a dynamic equilibrium point is reached, where both the encoder and the discriminator reach a relatively stable state. This method has been shown to achieve remarkable results in fields such as image recognition and natural language processing, providing a powerful and flexible tool for cross-domain learning.

[0004] Problems with existing technologies

[0005] Adversarial Discriminative Domain Adaptation (ADDA) has proven its effectiveness in addressing dataset bias and domain drift issues. This method optimizes the encoder and discriminator networks so that they can effectively align the data from the source and target domains. Semi-supervised Adversarial Discriminative Domain Adaptation (SADDA) is a further improvement based on ADDA, which further strengthens the function of the discriminator so that it can not only distinguish between source and target images, but also perform classification tasks. This improvement makes the feature distribution extracted by the target encoder closer to the feature distribution from the source encoder, thereby improving the representation ability of the target domain data. However, existing methods only focus on aligning the overall data distribution without considering the alignment at the category level (such as Figure 1 (b)), which may lead to degraded performance in the classification task in the target domain. Summary of the invention

[0006] This paper proposes a novel domain adaptation model, named Graph Adversarial Domain Adaptation (GADDA). In this study, we introduce a structure-preserving method to construct the graph structure of the target domain data by computing the similarities between data instances, such as Figure 1 (c) As shown. The present invention integrates graph loss into the adversarial training process to achieve category alignment. In addition, the present invention introduces label smoothing cross entropy loss to enhance the generalization performance of the network, so that the method of the present invention can not only achieve domain alignment, but also achieve category alignment, such as Figure 1 By integrating these strategies, the proposed method effectively solves the domain differences at the category level, thereby improving the model performance of each category.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] Step 1: Pre-training phase: Input the source domain data into the classification network consisting of the source domain encoder and classifier, train the target encoder and classifier by calculating the label smoothed cross entropy loss, and finally output the source domain encoder and classifier.

[0009] Step 2: Input the source domain data into the source domain encoder and the target domain data into the target domain encoder to obtain the latent space features of the source data and the target domain data respectively.

[0010] Step three, based on the feature data of the latent space of the target domain data, calculate the graph matrix of the data.

[0011] Step 4: Input the latent space feature data of the source domain and the target domain into the domain discriminator, calculate the data loss, and update the discriminator.

[0012] Step 5: Calculate the graph loss and encoder loss of the data, and update the encoder of the target domain based on the loss of the combination of graph loss and encoder loss.

[0013] Step 6: Repeat steps 2 to 5 until the given threshold is met, and output the encoder and domain discriminator of the target domain.

[0014] Step 7: Testing phase: Input the target domain test data set into the classification network composed of the target domain encoder and classifier, and calculate the classification accuracy of the network for the target domain data. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 The problems existing in the prior art and the effects achieved by the present invention.

[0016] Figure 2 This is a framework diagram of the graph adversarial discriminative domain adaptation algorithm with category-level alignment proposed in this invention.

[0017] Figure 3 This is a T-SNE visualization of the latent space features of the graph adversarial discriminant domain adaptation algorithm data with category-level alignment proposed in the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] See also Figure 2 The present invention proposes a graph adversarial discriminative domain adaptation algorithm with category-level alignment, wherein the method comprises the following steps:

[0020] Step 1: Pre-training phase: Input the source domain data into the classification network consisting of the source domain encoder and classifier, train the target encoder and classifier by calculating the label smoothed cross entropy loss, and finally output the source domain encoder and classifier.

[0021] Source domain data (X s ,Y s ) is distributed as P s (x,y), contains n samples. In the pre-training stage, the source encoder M s and the source classifier C uses s ,Y s ) is trained with labeled images, and the formula is as follows:

[0022]

[0023] in Represents supervised classification loss, usually calculated using classification cross entropy loss, and N represents the number of categories.

[0024] In order to enhance the robustness and generalization ability of the model, this paper introduces label smoothing cross entropy loss as an innovative training strategy. This method aims to alleviate overfitting and enhance the adaptability of the model to unseen data by smoothing labels during training. Specifically, this paper adopts label smoothing cross entropy loss in the adversarial domain adaptation framework, replacing the traditional cross entropy loss function. The mathematical expression of label smoothing cross entropy loss is described as follows:

[0025]

[0026] Among them, N represents the number of samples, K represents the number of categories, and C i,k represents the predicted probability that the i-th sample belongs to the k-th class, y i Represents the true category label of the i-th sample, and ε is assumed to be a small value usually between 0 and 0.1.

[0027] Step 2: Input the source domain data into the source domain encoder and the target domain data into the target domain encoder to obtain the latent space features of the source data and the target domain data respectively.

[0028] Target domain data (X t, ) does not contain labels, and its data distribution is P t (x,y), contains m samples. The source domain data is input into the source domain encoder M s Obtain the latent space features of the source domain and input the target domain data into the target domain encoder M t Obtain the latent space features of the target domain.

[0029] Step three, based on the feature data of the latent space of the target domain data, calculate the graph matrix of the data.

[0030] To enhance the robustness of knowledge transfer in the model, the present invention introduces the concept of domain-specific structure preservation. The present invention focuses on the smoothness of the model, assuming that the data resides on a manifold to avoid the risk of introducing bias from the source domain. This smoothness term naturally evolves into a geometric smoothness penalty, laying the foundation for domain-specific structure preservation.

[0031] Specifically, due to the potential changes in the manifold structure and associated risks of different domains, the present invention avoids exploiting the structural information of the source domain. Instead, the present invention specifically adds a Laplace regularization term to the target domain to preserve its domain-specific structure.

[0032] In order to maintain the domain-specific structure of the target domain data, the present invention defines a pairwise affinity matrix G = (G ij ) m×m To construct the graph. For X i ,X j ∈X t , the element G of G ij The definition is as follows:

[0033]

[0034] where sim(·,·) represents an appropriate similarity measure between two samples, such as cosine similarity, and N p Indicates point M t (x i ) is the set of p nearest neighbor points.

[0035] Step 4: Input the spatial feature data of the source domain and the target domain into the discriminator, calculate the data loss, and update the discriminator.

[0036] In the network framework proposed in this paper, a domain discriminator D is introduced to distinguish data points from the source domain and the target domain. The optimization of D is based on the standard supervision loss For guidance, the definition is:

[0037]

[0038] here, The goal is to minimize the source encoder M s and the target encoder M t The difference between the extracted feature distributions. Specifically, the loss is defined as the negative log-likelihood of the discriminator’s predictions, penalizing misclassification of source domain features and inaccurately distinguishing target domain features. Through iterative optimization, the domain discriminator effectively learns to distinguish source and target domain features, promoting domain alignment and enhancing the model’s adaptability to target domain data.

[0039] For the discriminator, the present invention minimizes the adversarial loss L D , seeking to optimize the discriminator's ability to distinguish between source domain samples and target domain samples. The loss can be expressed as:

[0040]

[0041] Step 5: Calculate the graph loss and encoder loss of the data, and update the encoder of the target domain based on the loss of the combination of graph loss and encoder loss.

[0042] In the subsequent stage, the present invention continues to train the target encoder M t , using the traditional loss function combined with inverted labels. This method revolves around using the target encoder M t The output of L D Unable to distinguish the source (X s ) and target (X t ) domain instance. D This feedback mechanism helps M t Adjust its encoding mechanism to generate representations that are very similar to the true representations in the target domain. The loss function that controls this process is The formula is as follows:

[0043]

[0044] This objective aims to minimize adversarial effects, where D acts as an unsupervised discriminator. By optimizing this loss, M tIt learns to make feature representations that confuse D, ensuring that it cannot distinguish between source domain features and target domain features. t It iteratively improves its encoding scheme to generate representations that better conform to the true distribution of the target domain.

[0045] For the encoder, our goal is to minimize the adversarial loss Combining adversarial loss and graph regularization term. The loss function is expressed as:

[0046]

[0047] Here, λ is a hyperparameter that adjusts the importance of the graph regularization term in the overall loss function and promotes effective domain adaptation.

[0048] Step 6: Repeat steps 2 to 5 until the given threshold is met, and output the encoder and domain discriminator of the target domain.

[0049] Through the adversarial network, the domain discriminator and the target encoder are updated alternately, and the feature distribution of the latent space obtained by the source domain and target domain data through the source encoder and target encoder respectively is the same, achieving the effect of domain alignment; at the same time, when training the target encoder, the graph loss is added to retain the intrinsic structure of the data to achieve category-level alignment.

[0050] Step 7: Testing phase: Input the target domain test data set into the classification network composed of the target domain encoder and classifier, and calculate the classification accuracy of the network for the target domain data.

[0051] During the test, the present invention uses the trained target encoder M t and source classifier C to predict the target image X t The present invention connects these two components and uses them together to classify target domain instances. This process is able to leverage representations learned from both the source and target domains, thereby facilitating accurate classification of target images without the need for domain-specific labels.

[0052] This paper proposes a more powerful and accurate architecture to train adversarial-based domain adaptation algorithms. It integrates structure preservation by leveraging data intrinsic information to build a graph structure between data instances. By incorporating this structure preservation into adversarial training, GADDA achieves alignment not only in domain distribution but also in category representation. In addition, label smoothed cross entropy loss is used to improve the generalization performance of the network.

[0053] In the description of this specification, the description of reference terms such as "embodiment" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment are included in at least one implementation of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments.

[0054] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A graph adversarial discriminative domain adaptation algorithm with category-level alignment, characterized by: The method comprises the following steps: Step 1: Pre-training phase: Input the source domain data into the classification network consisting of the source domain encoder and classifier, train the target encoder and classifier by calculating the label smoothed cross entropy loss, and finally output the source domain encoder and classifier. Step 2: Input the source domain data into the source domain encoder and the target domain data into the target domain encoder to obtain the latent space features of the source data and the target domain data respectively. Step three, based on the feature data of the latent space of the target domain data, calculate the graph matrix of the data. Step 4: Input the spatial feature data of the source domain and the target domain into the discriminator, calculate the data loss, and update the discriminator. Step 5: Calculate the graph loss and encoder loss of the data, and update the encoder of the target domain based on the loss of the combination of graph loss and encoder loss. Step 6: Repeat steps 2 to 5 until the given threshold is met, and output the encoder and domain discriminator of the target domain. Step 7: Testing phase: Input the target domain test data set into the classification network composed of the target domain encoder and classifier, and calculate the classification accuracy of the network for the target domain data.

2. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 1, characterized in that: In the step 1, the pre-training includes the following contents: Source domain data (X s , Y s ) is distributed as P s (x,y), contains n samples. Put the source domain data into the source domain encoder M s , and obtain the latent space features of the source domain data. Input the latent space features into the classifier C to obtain the category score; calculate the label smoothing consistency cross entropy loss through the source domain data category score and data label, and the label smoothing cross entropy loss is: Among them, N represents the number of samples, K represents the number of categories, and C i,k represents the predicted probability that the i-th sample belongs to the k-th class, y i Represents the true category label of the i-th sample, and ε assumes a small value usually between 0 and 0.1; the network parameters of the source domain encoder and classifier are updated through the loss, and the final output originates from the encoder and classifier.

3. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 2, characterized in that: The step 2 includes the following contents: Target domain data (X t’ ) does not contain labels, and its data distribution is P t (x,y), contains m samples. The source domain data is input into the source domain encoder M s Obtain the latent space features of the source domain and input the target domain data into the target domain encoder M t Obtain the latent space features of the target domain.

4. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 3, characterized in that: The step three includes the following contents: In order to maintain the domain-specific structure of the target domain data, the present invention defines a pairwise affinity matrix G = (G ij ) m×m To construct the graph. For X i , X j ∈X t , the element G of G ij The definition is as follows: where sim(·,·) represents an appropriate similarity measure between two samples, such as cosine similarity, and N p Indicates point M t (x i ) is the set of p nearest neighbor points.

5. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 4, characterized in that: The step 4, updating the domain discriminator includes the following contents: The present invention introduces an adversarial network, which inputs the latent space features from the source domain and the target domain data into the discriminator, and gives the domain label from the source domain data as 0 and the domain label from the target domain data as 1. The loss of the network is calculated by binary cross entropy: Then optimize the above loss to update the parameters of the domain discriminator. The optimization function is:

6. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 5, characterized in that: The step 5, updating the target domain encoder includes the following contents: After training the domain discriminator in the above steps, the target encoder M is trained using the strategy combining the traditional loss function with the inverted label. t This approach revolves around using a target encoder M t The output of X is used to mislead the unsupervised discriminator D, making it impossible for D to distinguish whether the data is from the source (X s ) and target (X t ) domain instance. This feedback mechanism of D helps M t Adjust its encoding mechanism to generate representations that are very similar to the true representations in the target domain. The loss function that controls this process is The formula is as follows: This objective aims to minimize adversarial effects, where D acts as an unsupervised discriminator. By optimizing this loss, M t It learns to make feature representations that confuse D, ensuring that it cannot distinguish between source domain features and target domain features. t It iteratively improves its encoding scheme to generate representations that better conform to the true distribution of the target domain. In order to enhance the robustness of knowledge transfer in the model, the present invention introduces the concept of domain-specific structure preservation. The invention focuses on the smoothness of the model, assuming that the data resides on a manifold to avoid the risk of introducing bias from the source domain. This smoothness term naturally evolves into a geometric smoothness penalty, laying the foundation for domain-specific structure preservation. Specifically, due to the potential changes in the manifold structure and associated risks of different domains, the present invention avoids exploiting the structural information of the source domain. Instead, the present invention specifically adds a Laplace regularization term to the target domain to preserve its domain-specific structure. By introducing Laplace regularization, the graph loss of the target encoder can be expressed as: For the encoder, the goal of this invention is to minimize the adversarial loss Combining adversarial loss and graph regularization term. The loss function is expressed as: Here, λ is a hyperparameter that adjusts the importance of the graph regularization term in the overall loss function and promotes effective domain adaptation.

7. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 6, characterized in that: The step six includes the following contents: Through the adversarial network, the domain discriminator and the target encoder are updated alternately, and the feature distribution of the latent space obtained by the source domain and target domain data through the source encoder and target encoder respectively is the same, achieving the effect of domain alignment; at the same time, when training the target encoder, the graph loss is added to retain the intrinsic structure of the data to achieve category-level alignment.

8. The graph adversarial discriminative domain adaptation algorithm with category-level alignment according to claim 7, characterized in that: The step seven includes the following contents: During testing, this project uses the trained target encoder M t and classifier C to predict the target image M t This project connects these two components and uses them jointly to classify target domain instances. This process enables the use of representations learned from both the source and target domains, thereby facilitating accurate classification of target images without the need for domain-specific labels.