A domain adaptation method and system based on data screening
The source domain data is processed through the data filtering method, data deviating from the target domain is eliminated, and a new source domain data set is constructed, which solves the problem of the existing technology failing when the domain differences are large, and improves the performance of the domain adaptation algorithm.
Patent Information
- Application Number
- CN202310461928.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2043-04-26
AI Technical Summary
The existing unsupervised domain adaptation methods fail when the domain differences are large, making it difficult to effectively narrow the differences between the source domain and the target domain.
Through the data screening method, pre-trained source domain convolution neural network and discriminator are used to extract feature and domain classification of source domain data, and eliminate data that significantly deviates from the target domain, thereby building a new source domain data set and narrowing the difference between the source domain and the target domain.
In the case of large domain differences, the performance of the domain adaptation algorithm is enhanced through data filtering, making it more robust under large domain differences.
Smart Images

Figure CN116522202B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of domain adaptation in transfer learning, and in particular relates to a domain adaptation method and system based on data screening. Background Art
[0002] Transfer learning is a research field in machine learning, and domain adaptation is a subdivision of transfer learning. In transfer learning, when the source domain and the target domain have the same tasks but different data distributions, this special type of transfer learning is called domain adaptation. In computer vision tasks, domain adaptation is a common requirement, because we often have a dataset A with sufficient labels, but we want to apply our model on an unlabeled dataset B. At this time, unsupervised domain adaptation technology is needed to solve this problem.
[0003] The technology of unsupervised domain adaptation is used to deal with the problem of mismatch between labeled source domain data and unlabeled target and sample domains. The adversarial scheme performs adaptation operations in feature space or pixel space; the moment matching scheme reduces distribution differences by matching moments of different orders; and there are also schemes that weaken domain differences based on reconstruction and normalization schemes. The core idea of these schemes is basically the same, projecting the data of the target domain and the source domain into a common space, where the data distribution difference between the source domain and the target domain will be significantly reduced, so that they can be treated as the same data set, so that the classifier can be trained on this space. Although these schemes have achieved certain success, their schemes all assume that the difference between the target domain and the source domain cannot be too large. When the domain difference is small, the above scheme can solve the problem well. However, as the domain difference increases, it is difficult to find a suitable projection space, and the above scheme fails. At this time, there is already a large difference between the data in the source domain and the data in the target domain. The invention aims to delete the data that deviates significantly from the target domain through a data screening scheme to reduce the difference between the source domain and the target domain, thereby enhancing the performance of the domain adaptation algorithm under large domain differences. Summary of the invention
[0004] In order to solve the problem that the existing domain adaptation method fails when the domain difference is large, the present invention proposes a domain adaptation method and system based on data screening.
[0005] The present invention is achieved through the following technical solutions:
[0006] In a first aspect, the present invention provides a domain adaptation method based on data screening, comprising the following steps:
[0007] Step 1: Obtain a labeled source domain dataset and an unlabeled target domain dataset with the same task but different data distribution;
[0008] Step 2: Use the labeled source domain data to pre-train the source domain convolutional neural network and source domain classifier;
[0009] Step 3, using the pre-trained source domain convolutional neural network parameters to initialize the target domain neural network, and construct an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; fixing the source domain convolutional neural network parameters, using the source domain data and the target domain data to train the adversarial network based on domain classification, and updating the target domain neural network and discriminator parameters;
[0010] Step 4: Use the pre-trained source domain convolutional neural network to extract features from the source domain dataset, use the trained discriminator to perform domain classification on the source domain dataset, remove some data from the data subset classified as the source domain, and merge the data subset classified as the target domain with the remaining data subset classified as the source domain after removal into a new source domain dataset;
[0011] Step 5: Use the new source domain dataset and the original target domain dataset to perform domain adaptation.
[0012] Furthermore, the task consistency refers to that both the source domain dataset and the target domain dataset belong to classification tasks and have the same categories, and the different data distribution refers to that there are differences in data features of the same category in the source domain dataset and the target domain dataset.
[0013] Furthermore, the step 3 comprises:
[0014] 3.1) constructing an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator, wherein the initialization parameters of the target domain neural network are the pre-trained source domain convolutional neural network parameters, and the source domain convolutional neural network parameters are fixed;
[0015] 3.2) The source domain data and the target domain data are input in batches, and are respectively input into the discriminator after the features are extracted by the source domain convolutional neural network and the target domain neural network. The discriminator predicts the domain label of the input data, and the domain label includes the source domain and the target domain. The discriminator outputs 0 to indicate that the predicted result is the target domain, and outputs 1 to indicate that the predicted result is the source domain.
[0016] 3.3) Update the discriminator parameters by the cross entropy loss between the discriminator prediction value and the true domain label, and update the target domain neural network parameters by optimizing the domain label prediction value of the target domain data to a cross entropy loss of 1. The two compete with each other until the training converges.
[0017] Furthermore, the proportion of some data eliminated from the data subset classified as the source domain is 10%-30%.
[0018] Furthermore, the step 5 comprises:
[0019] 5.1) Pre-training source domain convolutional neural network and source domain classifier based on the new source domain dataset;
[0020] 5.2) Initializing the target domain neural network using the pre-trained source domain convolutional neural network parameters, and constructing an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and the discriminator; fixing the source domain convolutional neural network parameters, and training the adversarial network based on domain classification using the new source domain dataset and the original target domain dataset, and updating the target domain neural network and discriminator parameters;
[0021] 5.3) Use the target domain neural network to extract the target domain data features, and then use the source domain classifier to classify the target domain data features.
[0022] In a second aspect, the present invention further provides a domain adaptation system based on data screening, comprising:
[0023] A data acquisition module, which is used to acquire a labeled source domain dataset and an unlabeled target domain dataset with the same task but different data distribution;
[0024] A pre-training module, which is used to use labeled source domain data to pre-train a source domain convolutional neural network and a source domain classifier;
[0025] An adversarial training module is used to initialize the target domain neural network using the pre-trained source domain convolutional neural network parameters, and construct an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; the source domain convolutional neural network parameters are fixed, and the adversarial network is trained based on domain classification using source domain data and target domain data, and the target domain neural network and discriminator parameters are updated;
[0026] The source domain data screening module is used to extract features from the source domain data set using the pre-trained source domain convolutional neural network, perform domain classification on the source domain data set using the trained discriminator, remove some data from the data subset classified as the source domain, and merge the data subset classified as the target domain with the remaining data subset classified as the source domain after the removal into a new source domain data set;
[0027] The domain adaptation operation module is used to perform a domain adaptation operation using a new source domain dataset and an original target domain dataset.
[0028] Compared with the existing unsupervised domain adaptation scheme, when the domain difference is large, the data screening process of the present invention can make the performance of the algorithm more robust to the change of domain difference. In addition, the use of the scheme of the present invention to screen data does not conflict with other domain adaptation schemes. Our scheme can be integrated into other schemes by simply replacing steps 4 and 5 with other domain adaptation schemes, thereby further improving the performance of the algorithm under large domain differences. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a flowchart of a domain adaptation method based on data screening proposed in an embodiment of the present invention;
[0030] Figure 2 is a schematic diagram of an adversarial network in a domain adaptation method based on data screening proposed in an embodiment of the present invention;
[0031] Figure 3 It is a schematic diagram of a training method for a source domain convolutional neural network and a source domain classifier in a domain adaptation method based on data screening proposed in an embodiment of the present invention;
[0032] Figure 4 It is a schematic diagram of the inference process of the target domain data by the domain adaptation method based on data screening proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The preferred embodiments of the present invention are described in detail below.
[0034] The present invention proposes a domain adaptation method based on data screening. When the domain difference is large, it does not choose to directly use the convolutional neural network and classifier of the target domain for prediction, because at this time the target domain and source domain data cannot overlap well in the same projection space, and there are certain differences between the two. The discriminator can filter out the data belonging to the source domain with high confidence and delete it. The remaining filtered source domain data is closer to the target domain than the original source domain data. Therefore, it only needs to replace the original source domain data with the filtered source domain data of the present invention, and it can be applied to a variety of existing domain adaptation schemes.
[0035] like Figure 1 As shown in Figure 2, domain adaptation methods based on data screening mainly include:
[0036] Step 1: Obtain a labeled source domain dataset and an unlabeled target domain dataset with consistent tasks but different data distributions. In this embodiment, consistent tasks refer to data that all belong to classification tasks and the number and types of categories are exactly the same, and different data distributions refer to image features that are somewhat different for the same category, such as dataset A is a collection of car images from temperate climate countries, while dataset B is a collection of car images from cold climate countries, so there will be certain systematic differences in data distribution between the two datasets.
[0037] Step 2: Pre-train the source domain convolutional neural network and source domain classifier on the labeled source domain data.
[0038] Step 3: Initialize the target domain neural network using the pre-trained source domain convolutional neural network parameters, and construct an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator. The source domain convolutional neural network parameters are fixed, and the adversarial network is trained based on domain classification using source domain data and target domain data, and the target domain neural network and discriminator parameters are updated. In this embodiment, when the domain is classified, the domain label of the target domain data is set to 0, and the domain label of the source domain data is set to 1.
[0039] Step 4: Use the pre-trained source domain convolutional neural network to extract features from the source domain dataset, use the trained discriminator to perform domain classification on the source domain dataset, remove some data from the data subset classified as the source domain, and merge the remaining data subset with the data subset classified as the target domain into a new source domain dataset.
[0040] Step 5: Perform domain adaptation using the new source domain dataset and the original target domain dataset.
[0041] In a specific implementation of the present invention, the labeled source domain data and the unlabeled target domain data in step 1 can be selected from public datasets, including MNIST→USPS, Office-31, Office-Home, DomainNet and other datasets. On the Office-31 and Office-Home datasets, the existing domain adaptation methods perform well because the domain differences of the datasets are small and the complexity is low. On the DomainNet dataset, the existing methods perform poorly because the DomainNet dataset is a more difficult dataset with more categories and larger domain differences. The dataset contains 6 domains, namely clip art, physical pictures, sketches, infographics, paintings, and quick doodles, including 345 categories and 600,000 images.
[0042] This example constructs labeled source domain data and unlabeled target domain data based on the MNIST→USPS dataset. The dataset uses the labeled MNIST dataset as the source domain data and the unlabeled USPS dataset as the target domain data. The MNIST dataset consists of 70,000 images and the USPS dataset consists of 20,000 images. Both are tasks for classifying 10 digits, but the data features of different datasets are somewhat different.
[0043] In a specific implementation of the present invention, Figure 3As shown, in the pre-training process of step 2, only the source domain convolutional neural network and the source domain classifier are pre-trained on the labeled source domain data, and the source domain convolutional neural network is trained by the standard classification scheme (Adam optimizer, batchsize=50, learning rate 1e-4, training 100 rounds), and the source domain convolutional neural network is composed of a two-dimensional convolutional layer (the number of convolution kernels is 20, the convolution kernel size is 5*5, and the step length is 1*1), a maximum pooling layer (the kernel size is 2*2, the step length is 2*2), a ReLU activation function layer, a two-dimensional convolutional layer (the number of convolution kernels is 50, the convolution kernel size is 5*5, and the step length is 1*1), a regularization layer (a dropout layer with p=0.5), a maximum pooling layer (the kernel size is 2*2, the step length is 2*2), a ReLU activation function layer, and a fully connected layer (the number of neurons is 500). The source domain classifier network is composed of a fully connected layer (the number of neurons is 10). The source domain convolutional neural network and source domain classifier network are used for data feature extraction and category classification, respectively.
[0044] In step 3, the discriminator module consists of a fully connected layer (the number of neurons is 500), a ReLU activation function layer, a fully connected layer (the number of neurons is 500), a ReLU activation function layer, a connection layer (the number of neurons is 2), and a LogSoftmax activation function layer.
[0045] In a specific implementation of the present invention, a target domain neural network is initialized using the parameters of the source domain neural network trained in step 2 to construct Figure 2 The adversarial network structure shown consists of a source domain neural network, a target domain neural network, and a discriminator. The parameters of the source domain neural network are fixed so that they are not updated with the training of this step. The domain label of the target domain data is set to 0, the domain label of the source domain data is set to 1, and the discriminator and the target domain neural network are trained.
[0046] In this embodiment, the structure of the discriminator is a three-layer fully connected network, the first two fully connected networks are followed by a ReLU activation function layer, and the last fully connected network is followed by a LogSoftmax layer. The task of the discriminator is to determine which domain the features extracted by the convolutional neural network belong to, thereby bringing the data distribution of the two domains closer in the feature space. During the training process, the source domain data and the target domain data are input in batches, and each batch extracts features from the source domain data through the source domain convolutional neural network, and extracts features from the target domain data through the target domain neural network. The two features are input into the discriminator respectively, and the domain label of the source domain data is 1, and the domain label of the target domain data is 0. The discriminator outputs 0 to represent that the data belongs to the target domain, and outputs 1 to represent that the data belongs to the source domain. The cross entropy loss of the discriminator prediction value and the domain label is used to update the discriminator parameters. In addition, the parameters of the target domain convolutional neural network are obtained by training the domain label of the target domain data to a cross entropy loss of 1, which is in conflict with the training of the discriminator until the training converges.
[0047] In a specific implementation of the present invention, in step 4, the source domain convolutional neural network trained in step 2 is used to extract features from the source domain data, and then the discriminator is used to perform domain classification inference on all the source domain data, and 20% of the data inferred as the source domain are deleted. For example, if there are m data in the source domain data set that are identified as the source domain by the discriminator, then 20% of the data are deleted from the m data, and the remaining data identified as the source domain by the discriminator and other data identified as the target domain by the discriminator constitute the updated source domain data set.
[0048] Compared with the original source domain data, the domain difference between the filtered source domain data and the original target domain data is smaller, which eliminates difficult samples that cannot align feature distribution even after domain adaptation operations to a certain extent. The filtered source domain data and the original target domain data can be directly applied to any domain adaptation algorithm, thereby improving the performance of the domain adaptation algorithm.
[0049] In a specific implementation of the present invention, the new source domain dataset and the original target domain dataset can be used for domain adaptation operations, for example, pre-training a source domain convolutional neural network and a source domain classifier according to the new source domain dataset; initializing the target domain neural network using the pre-trained source domain convolutional neural network parameters, constructing an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator, wherein the source domain convolutional neural network parameters are fixed, and the adversarial network is trained based on domain classification using the source domain data and the target domain data, and the target domain neural network and the discriminator parameters are updated; Figure 4 As shown, the target domain neural network is used to extract the target domain data features, and then the source domain classifier is used to classify the target domain data features.
[0050] The method of the present invention for screening data does not conflict with other domain adaptation methods. The new source domain dataset and the original target domain dataset can be used for other domain adaptation methods, thereby further improving the performance of the algorithm under larger domain differences.
[0051] In order to verify the effect of the present invention, this paper is based on the MNIST→USPS dataset, using the MNIST dataset containing labels as the original source domain dataset, and the USPS dataset with labels deleted as the original target domain dataset. The labels of the USPS dataset are only used for model effect evaluation. It is worth noting that in this embodiment, the screened new source domain dataset and the original target domain dataset are used in the domain adaptation solution based on ADDA.
[0052] As shown in Table 1, the following four solutions are compared:
[0053] Comparison 1 "Source domain convolutional neural network + classifier": Use the original source domain dataset to train the source domain convolutional neural network and source domain classifier, and directly classify the target domain dataset.
[0054] Comparison 2 "target domain convolutional neural network + classifier": Use the method of steps 2-3 to train the source domain neural network, source domain classifier and target domain neural network, use the target domain neural network to extract the target domain data features, and then use the source domain classifier to classify the target domain data features.
[0055] Compared with 3 "data screening + source domain convolutional neural network + classifier", the method of steps 2-4 is used to update the source domain dataset, and then the new source domain dataset is used to train the source domain convolutional neural network and source domain classifier, and the target domain dataset is directly classified.
[0056] Compared with 4 "data screening + target domain convolutional neural network + classifier", the method of steps 2-4 is used to update the source domain dataset, and then based on the new source domain dataset and the original target domain dataset, the method of steps 2-3 is used to train the source domain neural network, source domain classifier and target domain neural network, use the target domain neural network to extract the target domain data features, and then use the source domain classifier to classify the target domain data features.
[0057] The source domain convolutional neural network and classifier trained only with the original source domain dataset perform poorly in feature extraction and classification of the target domain dataset due to domain differences. Through the domain adaptation operation proposed in the present invention, the feature representation of the target domain and the source domain in the same feature space is brought closer by adversarial training, and data closer to the target domain data is selected for domain adaptation operation. Both operations improve the performance of the adaptation scheme.
[0058] The experimental results show that the method of comparison 3 obtains higher performance (95.53%) and is close to the performance of the method of comparison 2 (96.77%), which is much higher than the performance of the method of comparison 1 (71.24%). The method of comparison 4 obtains the highest performance (97.37%).
[0059] Table 1 Experimental results of domain adaptation method based on data screening
[0060] MNIST (source domain) / % USPS (target domain) / % Source domain convolutional neural network + classifier 99.15 71.24 Target domain convolutional neural network + classifier - 96.77 Data screening + source domain convolutional neural network + classifier 99.19 95.53 Data screening + target domain convolutional neural network + classifier - 97.37
[0061] The present invention scores the source domain data through adversarial training to obtain a screened source domain data set, which can be applied to all domain adaptation scenarios. Therefore, in addition to the above-mentioned comparison method, it can also be used for other existing domain adaptation algorithms.
[0062] In this embodiment, a domain adaptation system based on data screening is also provided, which is used to implement the above embodiment. The terms "module", "unit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the system described in the following embodiments is preferably implemented in software, it is also possible to implement hardware, or a combination of software and hardware.
[0063] This embodiment provides a domain adaptation system based on data screening, including:
[0064] A data acquisition module, which is used to acquire a labeled source domain dataset and an unlabeled target domain dataset with the same task but different data distribution;
[0065] A pre-training module, which is used to use labeled source domain data to pre-train a source domain convolutional neural network and a source domain classifier;
[0066] An adversarial training module is used to initialize the target domain neural network using the pre-trained source domain convolutional neural network parameters, and construct an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; the source domain convolutional neural network parameters are fixed, and the adversarial network is trained based on domain classification using source domain data and target domain data, and the target domain neural network and discriminator parameters are updated;
[0067] The source domain data screening module is used to extract features from the source domain data set using the pre-trained source domain convolutional neural network, perform domain classification on the source domain data set using the trained discriminator, remove some data from the data subset classified as the source domain, and merge the data subset classified as the target domain with the remaining data subset classified as the source domain after the removal into a new source domain data set;
[0068] The domain adaptation operation module is used to perform a domain adaptation operation using a new source domain dataset and an original target domain dataset.
[0069] In a specific implementation of the present invention, in the data acquisition module, task consistency means that both the source domain dataset and the target domain dataset belong to classification tasks and have the same category, and different data distribution means that there are differences in data features of the same category in the source domain dataset and the target domain dataset.
[0070] In a specific implementation of the present invention, the adversarial training module includes:
[0071] An adversarial network module is used to construct an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator. The initialization parameters of the target domain neural network are the pre-trained source domain convolutional neural network parameters, and the source domain convolutional neural network parameters are fixed; and, is used to input source domain data and target domain data in batches, respectively, and then input the features after being extracted by the source domain convolutional neural network and the target domain neural network, and respectively input them into the discriminator, and the discriminator predicts the domain label of the input data, and the domain label includes the source domain and the target domain. The discriminator outputs 0 to represent the predicted result as the target domain, and outputs 1 to represent the predicted result as the source domain;
[0072] The loss calculation module updates the discriminator parameters by the cross entropy loss between the discriminator prediction value and the true domain label, and updates the target domain neural network parameters by optimizing the domain label prediction value of the target domain data to a cross entropy loss of 1. The two compete with each other until the training converges.
[0073] In a specific implementation of the present invention, in the source domain data screening module, the proportion of the partial data removed from the data subset classified as the source domain is 10%-30%.
[0074] In a specific implementation of the present invention, in the source domain data screening module and the domain adaptation operation module, a source domain convolutional neural network and a source domain classifier are pre-trained according to a new source domain data set; the parameters of the pre-trained source domain convolutional neural network are used to initialize the target domain neural network, and an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator is constructed; the parameters of the source domain convolutional neural network are fixed, and the adversarial network is trained based on domain classification using the new source domain data set and the original target domain data set, and the parameters of the target domain neural network and the discriminator are updated; the target domain data features are extracted using the target domain neural network, and the target domain data features are classified using the source domain classifier.
[0075] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment, and the implementation methods of the remaining modules will not be repeated here. The system embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0076] The embodiments of the system of the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The system embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the corresponding computer program instructions in the non-volatile memory are read into the memory by the processor of any device with data processing capabilities and run.
[0077] Please note that the technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of this application, which all belong to the protection scope of this application.
Claims
1. A domain adaptation method based on data screening, characterized in that: The following steps are involved: Step 1: Obtain a labeled source domain dataset and an unlabeled target domain dataset with the same task but different data distribution; the source domain dataset and the target domain dataset are image data; Step 2: Use the labeled source domain data to pre-train the source domain convolutional neural network and source domain classifier; Step 3, using the pre-trained source domain convolutional neural network parameters to initialize the target domain neural network, and construct an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; fixing the source domain convolutional neural network parameters, using the source domain data and the target domain data to train the adversarial network based on domain classification, and updating the target domain neural network and discriminator parameters; Step 4: Use the pre-trained source domain convolutional neural network to extract features from the source domain dataset, use the trained discriminator to perform domain classification on the source domain dataset, remove some data from the data subset classified as the source domain, and merge the data subset classified as the target domain with the remaining data subset classified as the source domain after removal into a new source domain dataset; Step 5: Use the new source domain dataset and the original target domain dataset to perform domain adaptation. The step 5 comprises: 5.1) Pre-train the source domain convolutional neural network and source domain classifier based on the new source domain dataset; 5.2) Initializing the target domain neural network using the pre-trained source domain convolutional neural network parameters, and constructing an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator; fixing the source domain convolutional neural network parameters, training the adversarial network based on domain classification using a new source domain dataset and the original target domain dataset, and updating the target domain neural network and discriminator parameters; 5.3) Use the target domain neural network to extract the target domain data features, and then use the source domain classifier to classify the target domain data features.
2. A domain adaptation method based on data screening according to claim 1, characterized in that: The task consistency mentioned above means that both the source domain dataset and the target domain dataset belong to classification tasks and have the same categories, and the data distribution difference means that there are differences in data features of the same category in the source domain dataset and the target domain dataset.
3. The domain adaptation method based on data screening according to claim 1, characterized in that: The step 3 comprises: 3.1) Constructing an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator, wherein the initialization parameters of the target domain neural network are the pre-trained source domain convolutional neural network parameters, and the source domain convolutional neural network parameters are fixed; 3.2) The source domain data and the target domain data are input in batches, and are respectively input into the discriminator after the features are extracted by the source domain convolutional neural network and the target domain neural network. The discriminator predicts the domain label of the input data, and the domain label includes the source domain and the target domain. The discriminator outputs 0 to indicate that the predicted result is the target domain, and outputs 1 to indicate that the predicted result is the source domain. 3.3) Update the discriminator parameters by the cross entropy loss between the discriminator prediction value and the true domain label, and update the target domain neural network parameters by optimizing the domain label prediction value of the target domain data to a cross entropy loss of 1. The two compete with each other until the training converges.
4. The domain adaptation method based on data screening according to claim 1, characterized in that: The proportion of data eliminated from the data subset classified as the source domain is 10%-30%.
5. A domain adaptation system based on data screening, characterized in that: include: A data acquisition module, which is used to acquire a labeled source domain dataset and an unlabeled target domain dataset with the same task but different data distribution; the source domain dataset and the target domain dataset are image data; A pre-training module, which is used to use labeled source domain data to pre-train a source domain convolutional neural network and a source domain classifier; An adversarial training module is used to initialize the target domain neural network using the pre-trained source domain convolutional neural network parameters, and construct an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; the source domain convolutional neural network parameters are fixed, and the adversarial network is trained based on domain classification using source domain data and target domain data, and the target domain neural network and discriminator parameters are updated; The source domain data screening module is used to extract features from the source domain data set using the pre-trained source domain convolutional neural network, perform domain classification on the source domain data set using the trained discriminator, remove some data from the data subset classified as the source domain, and merge the data subset classified as the target domain with the remaining data subset classified as the source domain after the removal into a new source domain data set; The domain adaptation operation module is used to perform domain adaptation operations using the new source domain dataset and the original target domain dataset, including: Pre-train source domain convolutional neural network and source domain classifier based on new source domain dataset; Initializing the target domain neural network using the pre-trained source domain convolutional neural network parameters, and constructing an adversarial network consisting of the source domain convolutional neural network, the target domain neural network, and a discriminator; fixing the source domain convolutional neural network parameters, training the adversarial network based on domain classification using a new source domain dataset and the original target domain dataset, and updating the target domain neural network and discriminator parameters; The target domain neural network is used to extract the target domain data features, and then the source domain classifier is used to classify the target domain data features.
6. A domain adaptation system based on data screening according to claim 5, characterized in that: In the data acquisition module, task consistency means that both the source domain dataset and the target domain dataset belong to classification tasks and have the same category, and different data distribution means that there are differences in data features of the same category in the source domain dataset and the target domain dataset.
7. A domain adaptation system based on data screening according to claim 5, characterized in that: The adversarial training module includes: An adversarial network module is used to construct an adversarial network consisting of a source domain convolutional neural network, a target domain neural network, and a discriminator. The initialization parameters of the target domain neural network are the pre-trained source domain convolutional neural network parameters, and the source domain convolutional neural network parameters are fixed; and, is used to input source domain data and target domain data in batches, respectively, and then input the features after being extracted by the source domain convolutional neural network and the target domain neural network, and respectively input them into the discriminator, and the discriminator predicts the domain label of the input data, and the domain label includes the source domain and the target domain. The discriminator outputs 0 to represent the predicted result as the target domain, and outputs 1 to represent the predicted result as the source domain; The loss calculation module updates the discriminator parameters by the cross entropy loss between the discriminator prediction value and the true domain label, and updates the target domain neural network parameters by optimizing the domain label prediction value of the target domain data to a cross entropy loss of 1. The two compete with each other until the training converges.
8. The domain adaptation system based on data screening according to claim 5, characterized in that: In the source domain data screening module, the proportion of data eliminated from the data subset classified as the source domain is 10%-30%.
Citation Information
Patent Citations
New fault diagnosis method for rotating machinery based on deep confrontation convolutional neural network
CN114358124A
Training method, device and storage medium for neural network
JP2023029238A