Data conversion unsupervised field adaptive method and system based on diffusion model
Through the data conversion method based on the diffusion model and the alternating learning strategy, the problem of limited and unlabeled target domain data in unsupervised domain adaptation is solved, and labeled data is generated to enhance feature extraction and classifier performance, reduce domain differences, and improve the classification accuracy of the model in the target domain.
Patent Information
- Application Number
- CN202510682445.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-05
Smart Images

Figure CN120599338A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an unsupervised domain adaptive method and system for data conversion based on a diffusion model. Background Art
[0002] In recent years, the rapid development of artificial intelligence has profoundly impacted various industries and our daily lives. Computer vision, a key application of AI, aims to enable computers to understand digital images and videos, thereby simulating the functions of the human visual system. Deep learning models, with their powerful representation learning capabilities, are widely used in numerous computer vision tasks, including image classification, object detection, semantic segmentation, and person re-identification. Driven by deep learning, computer vision tasks are now ubiquitous in everyday life, such as facial payment, facial recognition at transportation hubs, intelligent traffic violation monitoring, autonomous driving, and mobile phone image recognition tools.
[0003] Although deep learning has made significant progress in computer vision tasks, it still faces two major challenges in practical applications: (1) The generalization ability of the model depends largely on the distribution consistency of the training data and test data. When the distribution differs, the model performance will significantly decline. However, in real-world scenarios, different data acquisition equipment, lighting, background and other conditions often lead to data distribution shifts. (2) The excellent performance of the model in computer vision tasks is highly dependent on large-scale labeled data. However, collecting and labeling large amounts of training data is time-consuming and expensive.
[0004] To address these issues, transfer learning has emerged as a new learning framework. Its core idea is to mitigate the problem of inconsistent distributions between the source domain (labeled data) and the target domain (unlabeled data). Unsupervised domain adaptation (UDA), a key branch of transfer learning, aims to transfer knowledge from the source domain to the target domain when there is no labeled data in the target domain, narrowing the distribution gap between the two domains and thereby improving the model's predictive ability in the target domain. For image classification tasks in computer vision, traditional deep learning models typically rely on large amounts of labeled data for training. However, in real-world scenarios, images are often affected by factors such as lighting, background, and acquisition equipment, resulting in variations in data distribution and making it difficult for the model to properly classify data. Typically, adapting to different scenarios requires collecting and annotating new data based on different influencing factors to retrain the model, a time-consuming and expensive process. Unsupervised domain adaptation, however, enables models to achieve consistent and accurate predictions across multiple domains, reducing reliance on labeled data and saving the labor and time required to label data, demonstrating significant practical application value.
[0005] In their first review of transfer learning, Pan et al. categorized transfer learning into three main categories: inductive transfer learning, transductive transfer learning, and unsupervised transfer learning, based on the source domain, target domain, and task. Unsupervised domain adaptation, a type of transductive transfer learning, is applicable to scenarios where the source and target domains share the same task but differ in data distribution, and the source domain contains labels while the target domain lacks them. Early research focused on shallow domain adaptation to reduce the distributional bias between the source and target domains. Shallow domain adaptation methods can be divided into sample-based and feature-based methods. The former weights samples according to a certain weight and uses these weighted samples for training. The latter uses feature mapping to map source and target domain samples into a shared feature space to reduce domain differences. Deep learning has achieved breakthroughs in computer vision tasks. Deep neural networks can effectively mitigate domain shift issues caused by factors such as resolution and illumination variations and can learn more transferable representations. Therefore, methods combining deep learning and domain adaptation have become mainstream. Existing deep domain adaptation methods are mainly divided into two categories: methods based on explicit difference measurement and methods based on implicit adversarial learning.
[0006] Methods based on explicit difference metrics use explicit metrics to reduce the difference between the source and target domain data distributions. For example, Maximum Mean Discrepancy (MMD) is the most frequently used metric in domain adaptation. Tzeng et al. proposed a Deep Domain Confusion (DDC) architecture, introducing an MMD-based loss function and adaptation layer. The DAN method extends this to multiple kernels, using multi-kernel Maximum Mean Discrepancy (MMD) to reduce domain differences. The Multi-Representation Adaptation Network (MRAN) extends the marginal distribution difference metric MMD to Conditional MMD (CMMD). Kang et al. combined inter-class information and proposed the Contrastive Adaptation Network (CAN) based on MMD to narrow intra-class distances while widening inter-class distances. The Joint Adaptation Network (JAN) uses Joint Maximum Mean Discrepancy (Joint MMD) to achieve joint distribution alignment. Jin et al. proposed Minimum Class Confusion (MCC) to reduce prediction class confusion and make predictions clearer. DeepCORAL uses Correlation Alignment (CORAL) to narrow the difference in the covariance matrix between the source domain and the target domain.
[0007] Methods based on implicit adversarial learning learn domain-invariant features through an adversarial mechanism. Ganin et al. were the first to introduce adversarial learning in domain adaptation, introducing an additional domain discriminator to distinguish between source and target domain features, while training the feature extractor to generate transferable features that are difficult for the discriminator to distinguish. The Adversarial Discriminative Domain Adaptation method (ADDA) uses source domain labels to learn discriminative representations, and then maps the target data to the same space through a separate encoding based on domain adversarial loss. Long et al. proposed the Conditional Domain Adversarial Network (CDAN), which uses the discriminative information contained in the classifier predictions to assist adversarial adaptation and learn transferable representations. In addition to implicit adversarial learning methods that introduce additional domain discriminators, the Maximum Classifier Difference method (MCD) uses two classifiers for adversarial learning and uses the L1 norm to measure the output difference between classifiers to achieve the learning of transferable representations.
[0008] In addition to the aforementioned methods, reconstruction-based domain adaptation methods have gradually emerged with the application of generative adversarial networks in image generation. These methods achieve pixel-level distribution alignment through inter-domain style transfer. For example, the Cycle Generative Adversarial Network (CycleGAN) utilizes a cycle consistency loss to translate images from a source domain to a target domain without the need for paired samples. Numerous CycleGAN-based methods exist. The Minimizing Class Confusion Method Combined with Style Transfer (MCCSM) builds on the style transfer theory of generative adversarial networks and achieves domain adaptation by transferring the source domain's style, expanding the source domain's feature space, and minimizing class confusion.
[0009] While unsupervised domain adaptation methods have made some progress in addressing the distribution discrepancy between source and target domains, they still face numerous challenges. First, the performance of existing methods is still limited by the lack of labeled data in the target domain. Second, many methods directly perform domain alignment without considering the significant distribution discrepancy between the source and target domains. This can lead to ineffective domain adaptation and even negative transfer. Summary of the Invention
[0010] In view of the defects in the prior art, the purpose of the present invention is to provide an unsupervised domain adaptive method and system for data conversion based on a diffusion model.
[0011] According to the present invention, an unsupervised domain adaptation method for data conversion based on a diffusion model is provided, comprising:
[0012] Obtain source domain images and target domain images;
[0013] The feature extractor takes the source domain image and the target domain image as input and outputs source domain features and target domain features respectively;
[0014] Train the D3T module with the target domain features, and the source domain features are transformed through the D3T module data transformation to generate generated features;
[0015] Input the source domain features, target domain features and generated features into the classifier for subsequent adaptation to further reduce the domain difference.
[0016] Preferably, the source domain features and the generated features are labeled features, and the target domain features are unlabeled features;
[0017] Remove the D3T module in the test phase or application phase, and the target domain data passes through the feature extractor and classifier to output the classification result.
[0018] Preferably, the D3T module realizes the data transformation from the source domain to the target domain through two steps of training and data transformation;
[0019] The training step includes using the target domain feature F t for training, and the loss function formula is as follows:
[0020]
[0021] where, represents the expected value, is the original target domain feature, is the true noise, ∈ θ (F t t , t) is the noise predictor, and the output is the predicted noise on the noisy target domain feature F t t at time step t;
[0022] The data transformation step includes separating the forward process and the reverse process of the diffusion model, using the diffusion method to achieve cross-domain distribution transformation, and transforming the source domain distribution to the target domain.
[0023] Preferably, the forward process inputs the source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising;
[0024] In the data transformation process, the time step T' is less than the step T during the diffusion model training, that is, T' < T, and the data transformation process is expressed as:
[0025]
[0026] where, F s is the source domain feature, which is obtained by adding noise T' times to get α t and are hyperparameters related to the variance in the diffusion model,
[0027] The noise predictor ∈ in the D3T module θ Perform T′ iterations of denoising, and when t is 1, we get F g ;
[0028] Newly generated labeled data F g Compared with the original labeled source domain data F s Cross entropy is used to guide model training, and the loss function is defined as follows:
[0029] L CE =L cls (f C (F s ),Y s )+L cls (f C (F g ),Y s )
[0030] Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature.
[0031] Preferably, an alternating learning strategy ALS is further included to enhance the adaptability of the feature extractor and the D3T module to the target domain data distribution;
[0032] In the alternating learning strategy ALS, the feature extractor and D3T module are trained alternately in a 1:1 ratio.
[0033] Preferably, during the feature extractor training process, the data F generated by the D3T module is used. g Train the feature extractor, where the loss function includes the domain adaptation loss L of the original method UDA With cross entropy loss, the formula is as follows:
[0034] L F =L UDA +L CE
[0035] During the D3T module training process, the feature extractor G is frozen and the target domain feature F is used. t By formula L MSE At the same time, the classifier C uses the labeled source domain data F s and generate data F g Through the cross entropy loss L CE To maintain its classification ability, the loss function at this stage is defined as follows:
[0036] L D =L MSE +LCE 。
[0037] An unsupervised domain adaptation system for data conversion based on a diffusion model provided by the present invention includes: a feature extractor, a D3T module, and a classifier;
[0038] Obtain source domain images and target domain images;
[0039] The feature extractor takes the source domain images and target domain images as inputs and outputs source domain features and target domain features respectively;
[0040] Train the D3T module with the target domain features, and the source domain features are converted through the D3T module to obtain generated features;
[0041] Input the source domain features, target domain features, and generated features into the classifier for subsequent adaptation to further reduce the domain difference.
[0042] Preferably, the source domain features and the generated features are labeled features, and the target domain features are unlabeled features; <000024I>
[0043] Remove the D3T module during the test phase or application phase, and the target domain data passes through the feature extractor and the classifier to output the classification result;
[0044] The D3T module includes a training module and a data conversion module; the training module includes using the target domain feature F t for training, and the loss function formula is as follows:
[0045]
[0046] Where, represents the expected value, is the original target domain feature, is the real noise, ∈ θ (F t t , t) is the noise predictor, and the output is the predicted noise at time step t on the noisy target domain feature F t t ;
[0047] The data conversion module includes separating the forward process and the reverse process of the diffusion model, using the diffusion method to achieve cross-domain distribution conversion, and converting the source domain distribution to the target domain.
[0048] Preferably, the forward process inputs source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising; [[ID=5i]]
[0049] During the data conversion process, the time step T' is less than the step size T during the diffusion model training, that is, T'<T, and the data conversion process is expressed as:
[0050]
[0051] Among them, F s is the source domain feature, which is obtained after T′ times of noise addition α t and is a hyperparameter related to variance in the diffusion model,
[0052] The noise predictor ∈ in the D3T module θ Perform T′ iterations of denoising, and when t is 1, we get F g ;
[0053] Newly generated labeled data F g Compared with the original labeled source domain data F s Cross entropy is used to guide model training, and the loss function is defined as follows:
[0054] L CE =L cls (f C (F s ),Y s )+L cls (f C (F g ),Y s )
[0055] Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature.
[0056] Preferably, an alternating learning strategy ALS is further included to enhance the adaptability of the feature extractor and the D3T module to the target domain data distribution;
[0057] In the alternating learning strategy ALS, the feature extractor and D3T module are trained alternately in a 1:1 ratio.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] This method uses a diffusion model to convert source domain data into labeled data or intermediate domain data that aligns with the target domain distribution. This data is then combined with the original data to optimize the feature extractor and classifier. The converted data retains the source domain label information, enhancing the feature extractor's ability to extract target domain features while also enhancing the classifier's ability to discriminate in the target domain. Generating labeled target domain data or intermediate domain data close to the target domain alleviates the problem of limited and unlabeled target domain data while effectively bridging significant domain differences. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0061] Figure 1 It is a schematic flow chart of the working method of the present invention. DETAILED DESCRIPTION
[0062] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0063] Denoising Diffusion Probabilistic Models (DDPMs) are an emerging topic in computer vision and have achieved remarkable results in generative modeling. Diffusion models, through a multi-step denoising and denoising process, can gradually restore Gaussian noise to realistic images. They are highly capable of transforming data with vastly different distributions. GANs, in which the generator and discriminator compete with each other during training, are difficult to balance, making training challenging. Compared to GANs, diffusion models offer a more stable training process and improved generative diversity.
[0064] The diffusion-driven data transformation for unsupervised domain adaptation framework (D3TUDA) based on the diffusion model of the present invention introduces a diffusion-driven data transformation module (D3T) to realize the conversion of the source domain distribution to the target domain distribution. The module is first trained on the target domain so that it has the ability to generate the target domain data distribution. The D3T module then performs distribution conversion on the labeled source domain features, and gradually converts the source domain distribution to the target domain. The generated labeled data and the original data are used together in the subsequent adaptive process to further narrow the distribution difference between the source domain and the target domain. In addition, the alternate learning strategy (ALS) alternately trains the feature extractor and the D3T module, which can achieve mutual learning and improvement between the two modules. As the feature extractor iteratively extracts features closer to the target domain, it drives the D3T module to generate features that are more in line with the target domain distribution. Through alternating training, the feature extractor and the D3T module gradually enhance the ability to extract and generate target domain features. The D3T module and ALS are only used to train the classification model during the training phase and will be removed during the testing phase to ensure that no additional computational overhead is introduced.
[0065] Example 1
[0066] According to the present invention, a data conversion unsupervised domain adaptive method based on a diffusion model is provided. Figure 1 As shown, it includes: obtaining a source domain image and a target domain image. The feature extractor takes the source domain image and the target domain image as input and outputs the source domain features F s and target domain features F t . Using the target domain feature F t To train the D3T module, the source domain feature F s Generate feature F by transforming data through D3T module g . There are labeled features F s and F g and unlabeled features F t The source domain data is fed into the classifier for subsequent adaptation to further narrow the domain gap. During the testing or application phase, the D3T module is removed, and the target domain data is passed through the feature extractor and classifier to output the classification results. The source domain data is the model training data, and the target domain data is the test data. The source domain data is labeled, while the target domain data is unlabeled. For example, if a classification model is trained using labeled real animal images, hoping that the model can classify stick figure animal images, the real animal images are the source domain data, and stick figure animal images are the target domain data.
[0067] The D3T module is essentially an unconditional diffusion model, that is, a denoising diffusion probabilistic model (DDPM). The D3T module realizes the conversion of data from the source domain to the target domain through two steps: training and data transformation. For the training step, in order to enable the D3T module to have the ability to generate data conforming to the target domain data distribution, the target domain feature F t is used for training, and the loss function formula is as follows:
[0068]
[0069] where, represents the expected value, is the original target domain feature, is the real noise, ∈ θ (F t t , t) is the noise predictor, and its output is the predicted noise at time step t on the noisy target domain feature F t t .
[0070] The data transformation step includes separating the forward process and the reverse process of the diffusion model, using diffusion technology to achieve cross-domain distribution conversion, and converting the source domain distribution to the target domain. The forward process inputs the source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising. To ensure that the generated data still retains the source domain class features, the time step T' in the data transformation process is less than the step length T during the diffusion model training, that is, T' < T. The data transformation process is expressed as:
[0071]
[0072] where, F s is the source domain feature, which is obtained after T' times of adding noise α t and are hyperparameters related to the variance in the diffusion model, the noise predictor in the D3T module ∈ θ performs T' times of iterative denoising, and when t is 1, F g is obtained. Here, F g represents the feature generated after T' steps of denoising. The newly generated labeled data F g and the original labeled source domain data F s use cross-entropy to guide the model training. This process enables the feature extractor and the classifier to better adapt to the data features of the target domain, thereby improving the performance of the model on the target domain. The loss function is defined as follows:
[0073] L CE = L cls (fC (F s ),Y s )+L cls (f C (F g ),Y s )
[0074] Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature. In addition, the newly generated F g Together with the original data, it serves as training data for subsequent adaptive training, further reducing inter-domain distribution differences. The D3T module can be integrated into the existing UDA framework to further improve accuracy. Experimental work showed that adding this module to the existing unsupervised domain adaptation method MCC significantly improved accuracy. The features and labels generated by the D3T module are used to supervise the feature extractor to optimize the feature extraction process.
[0075] The present invention provides an unsupervised domain adaptation method for data conversion based on a diffusion model, further comprising an alternating learning strategy (ALS) for enhancing the adaptability of the feature extractor and the D3T module to the target domain data distribution. This strategy aims to gradually reduce domain differences through iterative mutual learning, thereby enhancing the functionality of the feature extractor and the D3T module. In the ALS, the feature extractor and the D3T module are trained alternately in a 1:1 ratio. Specifically, after each feature extractor training iteration, the D3T module is trained once, and this cycle repeats. During this process, the feature extractor learns to extract features that gradually approximate the target domain and then feeds these features back to the D3T module. This feedback process helps the D3T module generate data that better matches the target domain distribution. Furthermore, the features and labels generated by the D3T module are used to supervise the feature extractor. This supervision process improves the feature extractor's ability to learn target domain features. Through alternating training, the feature extractor's ability to extract target domain features gradually improves. Simultaneously, the D3T module's ability to generate target domain features is also enhanced. Consequently, ALS ultimately reduces the distribution difference between the source and target domains.
[0076] The training iteration of the feature extractor includes using the data F generated by the D3T module during the feature extractor training process. g Train the feature extractor to enhance its ability to extract target domain features, and ultimately improve the classification accuracy of the model on unlabeled target domain data. The D3T module can be integrated into other unsupervised domain adaptation methods to further improve accuracy. At this time, the loss function includes the domain adaptation loss L of the original method. UDA With cross entropy loss
[0077] L F=L UDA +L CE
[0078] The training iteration of the D3T module includes freezing the feature extractor G during the D3T module training process. The D3T module uses the target domain features F t By formula L MSE Train the internal noise predictor ∈ θ It can predict the noise more accurately, thus generating features that are closer to the target domain. At the same time, the classifier C uses the labeled source domain data F s and generate data F g Through the cross entropy loss L CE Maintain its classification ability. The loss function at this stage is defined as follows:
[0079] L D =L MSE +L CE
[0080] In summary, the feature extractor is continuously optimized during the alternating training process, and the features it extracts increasingly approximate the target domain distribution. These features are then fed into the D3T module at each iteration to generate data that better matches the target domain distribution. This process further enhances the capabilities of the feature extractor. This dynamic adaptation process gradually reduces the distribution differences between the source and target domains, enabling the model to more smoothly adapt to the target domain distribution.
[0081] The present invention aims to utilize the powerful distribution conversion capability of the diffusion model to complete the task of UDA.
[0082] Example 2
[0083] The present invention also provides a data conversion unsupervised domain adaptive system based on a diffusion model. The data conversion unsupervised domain adaptive system based on a diffusion model can be implemented by executing the process steps of the data conversion unsupervised domain adaptive method based on a diffusion model, that is, those skilled in the art can understand the data conversion unsupervised domain adaptive method based on a diffusion model as a preferred implementation of the data conversion unsupervised domain adaptive system based on a diffusion model.
[0084] According to the present invention, a data conversion unsupervised domain adaptive system based on a diffusion model is provided, comprising:
[0085] Obtain the source domain image and the target domain image. The feature extractor takes the source domain image and the target domain image as inputs and outputs the source domain features and the target domain features respectively. The D3T module is trained with the target domain features, and the source domain features are transformed through the D3T module to obtain the generated features. The source domain features, the target domain features, and the generated features are jointly input into the classifier for subsequent adaptation to further narrow the domain difference. The source domain features and the generated features are labeled features, and the target domain features are unlabeled features. In the test phase or the application phase, the D3T module is removed, and the target domain data passes through the feature extractor and the classifier to output the classification result.
[0086] The D3T module includes a training module and a data transformation module. The training module includes training with the target domain feature F t and the loss function formula is as follows:
[0087]
[0088] where, represents the expected value, is the original target domain feature, is the real noise, ∈ θ (F t t , t) is the noise predictor, and the output is the predicted noise at time step t on the noisy target domain feature F t t The data transformation module includes separating the forward process and the reverse process of the diffusion model, using the diffusion method to achieve cross-domain distribution transformation, and transforming the source domain distribution to the target domain. The forward process inputs the source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising. The time step T' in the data transformation process is less than the step length T during the training of the diffusion model, that is, T' < T, and the data transformation process is expressed as:
[0089]
[0090] where, F s is the source domain feature, which is obtained by adding noise T' times to get α t and are hyperparameters related to the variance in the diffusion model, the noise predictor in the D3T module ∈ θ performs T' times of iterative denoising, and when t is 1, F g is obtained. The newly generated labeled data F g and the original labeled source domain data F s use cross-entropy to guide the model training, and the loss function is defined as follows:
[0091] L CE=L cls (f C (F s ),Y s )+L cls (f C (F g ),Y s )
[0092] Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature.
[0093] The present invention also includes an alternating learning strategy ALS, which is used to enhance the adaptability of the feature extractor and the D3T module to the target domain data distribution. In the alternating learning strategy ALS, the feature extractor and the D3T module are trained alternately in a 1:1 ratio. During the feature extractor training process, the data F generated by the D3T module is used to generate the target domain data. g Train the feature extractor, where the loss function includes the domain adaptation loss L of the original method UDA With cross entropy loss, the formula is as follows:
[0094] L F =L UDA +L CE
[0095] During the D3T module training process, the feature extractor G is frozen and the target domain feature F is used. t By formula L MSE At the same time, the classifier C uses the labeled source domain data F s and generate data F g Through the cross entropy loss L CE To maintain its classification ability, the loss function at this stage is defined as follows:
[0096] L D =L MSE +L CE .
[0097] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.
[0098] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. An unsupervised domain adaptation method for data conversion based on a diffusion model, characterized in that: Comprising: Obtain source domain images and target domain images; The feature extractor takes the source domain images and target domain images as inputs and outputs source domain features and target domain features respectively; Train the D3T module with the target domain features, and the source domain features are transformed through the D3T module data conversion to obtain generated features; Jointly input the source domain features, target domain features and generated features into the classifier for subsequent adaptation to further narrow the domain difference.
2. The unsupervised domain adaptation method for data conversion based on a diffusion model according to claim 1, characterized in that: The source domain features and the generated features are labeled features, and the target domain features are unlabeled features; Remove the D3T module in the test stage or application stage, and the target domain data passes through the feature extractor and the classifier to output the classification result.
3. The unsupervised domain adaptation method for data conversion based on a diffusion model according to claim 1, characterized in that: The D3T module realizes the conversion of data from the source domain to the target domain through two steps of training and data conversion; The training step includes using the target domain features F t For training, the loss function formula is as follows: in, Indicates the expected value, is the original target domain feature, is the real noise, ∈ θ (F t t ,t) is the noise predictor, and its output is the feature F in the noisy target domain at time step t t t The prediction noise on ; The data conversion step includes separating the forward process and the reverse process of the diffusion model, using the diffusion method to achieve cross-domain distribution conversion, and converting the source domain distribution to the target domain.
4. The unsupervised domain adaptation method for data conversion based on a diffusion model according to claim 3, characterized in that: The forward process inputs source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising; The time step T' in the data conversion process is less than the step T during the diffusion model training, that is, T' < T, and the data conversion process is expressed as: Among them, F s is the source domain feature, which is obtained after T′ times of noise addition α t and is a hyperparameter related to variance in the diffusion model, The noise predictor ∈θ in the D3T module performs T′ iterations of denoising, and when t is 1, F is obtained. g ; Newly generated labeled data F g Compared with the original labeled source domain data F s Cross entropy is used to guide model training, and the loss function is defined as follows: L CE =L cls (f C (F s ),Y s )+L cls (f C (F g ),Y s ) Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature.
5. The unsupervised domain adaptation method for data conversion based on a diffusion model according to claim 1, characterized in that: It also includes an Alternating Learning Strategy ALS for enhancing the adaptability of the feature extractor and the D3T module to the target domain data distribution; In the Alternating Learning Strategy ALS, the feature extractor and the D3T module are alternately trained in a 1:1 ratio.
6. The unsupervised domain adaptation method for data conversion based on a diffusion model according to claim 5, characterized in that: During the feature extractor training process, the data F generated by the D3T module is used g Train the feature extractor, where the loss function includes the domain adaptation loss L of the original method UDA With cross entropy loss, the formula is as follows: L F =L UDA +L CE During the D3T module training process, the feature extractor G is frozen and the target domain feature F is used. t By formula L MSE At the same time, the classifier C uses the labeled source domain data F s and generate data F g Through the cross entropy loss L CE To maintain its classification ability, the loss function at this stage is defined as follows: L D =L MSE +L CE 。 7. An unsupervised domain adaptive system for data conversion based on a diffusion model, characterized in that: Comprising: A feature extractor, a D3T module and a classifier; Obtain source domain images and target domain images; The feature extractor takes the source domain images and target domain images as inputs and outputs source domain features and target domain features respectively; Train the D3T module with the target domain features, and the source domain features are transformed through the D3T module data conversion to obtain generated features; Jointly input the source domain features, target domain features and generated features into the classifier for subsequent adaptation to further narrow the domain difference.
8. The unsupervised domain adaptive system for data conversion based on a diffusion model according to claim 7, characterized in that: The source domain features and the generated features are labeled features, and the target domain features are unlabeled features; Remove the D3T module in the test stage or application stage, and the target domain data passes through the feature extractor and the classifier to output the classification result; The D3T module includes a training module and a data conversion module; the training module includes using the target domain feature F t For training, the loss function formula is as follows: in, Indicates the expected value, is the original target domain feature, is the real noise, ∈ θ (F t t ,t) is the noise predictor, and its output is the feature F in the noisy target domain at time step t t t The prediction noise on ; The data conversion module includes separating the forward process and the reverse process of the diffusion model, using the diffusion method to achieve cross-domain distribution conversion, and converting the source domain distribution to the target domain.
9. The unsupervised domain adaptive system for data conversion based on a diffusion model according to claim 8, characterized in that: The forward process inputs source domain data, and the reverse process uses the D3T module trained on the target domain data for denoising; The time step T' in the data conversion process is less than the step T during the diffusion model training, that is, T' < T, and the data conversion process is expressed as: Among them, F s is the source domain feature, which is obtained after T′ times of noise addition α t and is a hyperparameter related to variance in the diffusion model, The noise predictor ∈θ in the D3T module performs T′ iterations of denoising, and when t is 1, F is obtained. g ; Newly generated labeled data F g Compared with the original labeled source domain data F s Cross entropy is used to guide model training, and the loss function is defined as follows: L CE =L cls (f C (F s ),Y s )+L cls (f C (F g ),Y s ) Among them, L CE represents the cross entropy loss function, f C represents the classifier, Y s is the label corresponding to the feature.
10. The data conversion unsupervised domain adaptation system based on diffusion model according to claim 7, characterized in that: It also includes an Alternating Learning Strategy ALS for enhancing the adaptability of the feature extractor and the D3T module to the target domain data distribution; In the Alternating Learning Strategy ALS, the feature extractor and the D3T module are alternately trained in a 1:1 ratio.
Citation Information
Cited By
Crane rotating part fault diagnosis method, device and equipment and storage medium
CN121256576A