Training Method, System, Device and Storage Medium for Multi-Domain Adaptive Model

Through the multi-domain adaptive model training method, incremental convolution network and comparison learning are used to solve the problem of only single source domain to single target domain in traditional adaptive models, and feature alignment and invariant feature learning between multiple domains are realized, which improves the robustness and generalization ability of the model.

CN114663725BActive Publication Date: 2025-07-11HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210278102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2025-07-11
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

In the prior art, the transfer learning model only focuses on feature alignment when training, and ignores the discriminant row characteristics of the sample after the migration, and can only be used for cross-domain tasks of single-source domain migration to single-target domain, and cannot learn cross-domain tasks from multi-source domain to multi-target domain.

Method used

The multi-domain adaptive model training method is adopted, and the weight sharing of the source domain classification network and the target domain classification network is used for iterative training. Combined with comparison learning and knowledge distillation, the weight of the incremental convolution layer is updated to realize feature alignment and invariant feature learning between multiple domains.

Benefits of technology

Feature alignment and invariant feature learning between multiple domains are realized, and a multi-domain adaptive model classifier that can implement classification in multiple domains is obtained, which improves the robustness and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663725B_ABST
    Figure CN114663725B_ABST
Patent Text Reader

Abstract

The present invention provides a training method, system, device and storage medium for a multi-domain adaptive model. The method includes: obtaining source domain data and target domain data, and dividing the target domain data into several groups according to different domains, each group containing target domain data of one domain; inputting the source domain data into a source domain classification network, inputting a group of target domain data into a target domain classification network for training, and updating the weights of the incremental convolutional layer according to the training results, wherein the weights of the source domain classification network and the target domain classification network are shared; loading the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network; selecting another group of target domain data for iterative training until the target domain data training is completed, and obtaining a multi-domain adaptive model. It solves the problem that in the traditional adaptive model, only a single source domain to a single target domain can be used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cross - domain models, and particularly relates to a training method, system, device and storage medium for a multi - domain adaptive model. Background Art

[0002] Image classification, as an important basic task in computer vision, has been widely applied in fields such as unmanned driving, video monitoring, and face recognition. In recent years, image classification tasks based on deep learning have been widely explored and studied. Such methods use a large number of publicly labeled samples to train convolutional neural networks with different structures to form image classification deep networks, and have achieved satisfactory results in classification accuracy and classification speed in the test of homologous data sets. It effectively reduces the incompleteness caused by manually designed features and reconciles the contradiction between feature generality and task particularity.

[0003] As is well known, the effectiveness of image classification deep networks is attributed to two basic assumptions: one is that the training samples and test samples come from a common data set or different data sets with similar distributions; the other is that there are a large number of labeled samples in the training stage. However, the above assumptions are difficult to meet in most actual situations. In related work on domain adaptation, the publicly available data sets in related scenarios are generally collectively referred to as the source domain, and the data set collected from the actual scenario of the task is called the target domain. First, due to the existence of background differences between the source domain and the target domain, when the image styles of the target domain and the source domain are very different and the data distributions are quite different, the classification model trained on the source domain will be difficult to generalize to the target domain. Second, since the supervised samples for image classification tasks need to label the object categories, it will consume a huge amount of manpower or even be impossible when there are a large number of object types. Moreover, due to the lack of a unified standard for manual annotation, human biases will inevitably be introduced.

[0004] To address problems such as scarce target - domain data and data distribution differences, the current mainstream method is to solve them through domain - adaptation methods. Domain - adaptation methods draw on the idea of transfer learning and learn the common domain - invariant features of the source domain and the target domain through the labeled data in the source domain and a small amount of labeled data or a large amount of unlabeled data in the target domain.

[0005] However, in the prior art, when training a transfer - learning model, only feature alignment is concerned, while the discriminative features of the samples after transfer are ignored, and it is only used for cross - domain tasks of single - source - domain to single - target - domain transfer, resulting in the model being unable to learn cross - domain tasks from multiple source domains to multiple target domains. Therefore, it is necessary to provide a training method, system, device and storage medium for a multi - domain adaptive model. Summary of the Invention

[0006] In view of the above disadvantages of the prior art, the purpose of the present invention is to provide a method, system, device and storage medium for automatically updating a model, so as to improve the problem in the prior art that in a traditional adaptive model, only a single source domain to a single target domain can be used.

[0007] To achieve the above object and other related objects, the present invention provides a training method for a multi-domain adaptive model, the model includes a source domain classification network, a target domain classification network and an incremental convolutional network, and the method includes the following processes:

[0008] S1. Obtain source domain data and target domain data, and divide the target domain data into several groups according to different domains, and each group contains target domain data of one domain;

[0009] S2. Input the source domain data into the source domain classification network, input a group of target domain data into the target domain classification network for training, and update the weights of the incremental convolutional layer according to the training results, wherein the weights of the source domain classification network and the target domain classification network are shared;

[0010] S3. Load the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network;

[0011] S4. Select another group of target domain data, repeat steps S2 to S3 for iterative training until the target domain data training is completed, and obtain a multi-domain adaptive model.

[0012] In an embodiment of the present invention, before loading the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network, it further includes: performing knowledge distillation on the features output by the incremental convolutional network and the source domain classification network to obtain high-level semantic features.

[0013] In an embodiment of the present invention, inputting the source domain data into the source domain classification network of the model, inputting a group of target domain data into the target domain classification network of the model for training, and updating the weights of the incremental convolutional layer of the model according to the training results includes:

[0014] Input the source domain data into the source domain classification network to obtain source domain features;

[0015] Input the target domain data into the target domain classification network to obtain target domain features;

[0016] Use the source domain features and target domain features with the same label as positive sample pairs, and use the source domain features and target domain features with different labels as negative sample pairs;

[0017] Perform contrastive learning on the positive sample pairs and the negative sample pairs, and update the weights of the incremental convolutional layer based on the results of the contrastive learning.

[0018] In an embodiment of the present invention, after inputting the target domain data into the target domain classification network to obtain the target domain features, the method further includes: performing pseudo-label processing on the target domain data to obtain the target domain data with labels.

[0019] In an embodiment of the present invention, the formula for the distillation loss is: L D = ||F s (x) - F’(x’)||, where F s (x) is the output feature of the high-level semantic layer of the source domain, and F’(x’) is the output feature of the high-level semantic layer of the incremental convolutional network.

[0020] In an embodiment of the present invention, the loss function of the multi-domain adaptive model is L = L CE + αL CDC + βL D , where L is the loss function of the multi-domain adaptive model, L CE is the cross-entropy loss of the source domain classification network, L CDC is the cross-domain contrast loss between the source domain classification network and the target domain classification network, L D is the distillation loss, and α and β are the adjustment factors of the cross-domain contrast loss and the contrast loss, respectively.

[0021] In an embodiment of the present invention, the convolutional layers in the source domain classification network, the convolutional layers in the target domain classification network, and the incremental network layer have the same structure.

[0022] In an embodiment of the present invention, there is also provided a training system for a multi-domain adaptive model, and the system includes:

[0023] A data acquisition unit, configured to acquire source domain data and target domain data, and divide the target domain data into several groups according to different domains, where each group contains target domain data of one domain;

[0024] An incremental convolutional weight acquisition unit, configured to input the source domain data into the source domain classification network, input a group of target domain data into the target domain classification network for training, and update the weights of the incremental convolutional layer according to the training results, where the weights of the source domain classification network and the target domain classification network are shared;

[0025] A weight loading unit, configured to load the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network;

[0026] A model acquisition unit, configured to select another group of target domain data for iterative training until the target domain data training is completed, and obtain a multi-domain adaptive model.

[0027] In one embodiment of the present invention, there is also provided a training device for a multi-domain adaptive model, including a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the method described in any one of the above is implemented.

[0028] In one embodiment of the present invention, there is also provided a computer-readable storage medium, including a program, when the program runs on a computer, the computer is enabled to execute the method described in any one of the above.

[0029] In summary, in the present invention, after obtaining the source domain and target domain data sets, a contrast learning method is adopted. The data with the same category in the source domain and the target domain is used as a positive sample pair, and the data with different categories in the source domain and the target domain is used as a negative sample pair. By minimizing the contrast loss, the domain features are aligned. The weights of the source domain during the previous training are saved by an incremental convolutional network and loaded into the model to be trained currently. By calculating the distillation loss between the incremental convolutional network and the source domain classification network, the feature alignment achieved on the high-level semantic feature layer is ensured. Through this incremental learning method and multi-level feature alignment, finally, multiple domain-invariant features are obtained, and a multi-domain adaptive model classifier that can perform classification in multiple domains is obtained. It solves the problem that in a traditional adaptive model, only a single source domain to a single target domain can be used. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0031] Figure 1 It shows a flowchart of the training method of the multi-domain adaptive model in one embodiment of the present invention;

[0032] Figure 2 It shows the visualization feature demonstration before and after using the model in one embodiment of the present invention;

[0033] Figure 3 It shows a framework flowchart of the training method of the multi-domain adaptive model in one embodiment of the present invention;

[0034] Figure 4 It shows a flowchart of incremental training in one embodiment of the present invention.

[0035] Figure 5 It shows a flowchart of step S2 in one embodiment of the present invention;

[0036] Figure 6 It shows a schematic diagram of the principle structure of the multi-domain adaptive model system in an embodiment of the present invention.

[0037] Description of component labels:

[0038] 10. Training method system of the domain adaptive model; 11. Including a data acquisition unit; 12. Incremental convolution weight acquisition unit; 13. Weight loading unit; 14. Model acquisition unit. Specific implementation manners

[0039] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other. It should also be understood that the terms used in the embodiments of the present invention are for describing specific specific implementation manners, rather than for limiting the protection scope of the present invention. The test methods without specific conditions noted in the following embodiments are usually in accordance with conventional conditions or in accordance with the conditions recommended by each manufacturer.

[0040] Please refer to Figures 1 to 6 . It should be noted that the structures, ratios, sizes, etc. shown in the drawings of this specification are only used to cooperate with the content disclosed in the specification for those skilled in this technology to understand and read, and are not used to limit the limited conditions under which the present invention can be implemented. Therefore, they do not have technical essential significance. Any modification of the structure, change of the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope covered by the technical content disclosed in the present invention. At the same time, the terms such as "upper", "lower", "left", "right", "middle", and "one" used in this specification are only for the convenience of clear narration and are not used to limit the scope under which the present invention can be implemented. The change or adjustment of their relative relationships, without substantial change in the technical content, should also be regarded as the scope under which the present invention can be implemented.

[0041] When the embodiment gives a numerical range, it should be understood that unless otherwise specified in the present invention, any value at both ends of each numerical range and any value between the two ends can be selected. Unless otherwise defined, all technical and scientific terms used in the present invention, based on the understanding of those skilled in the art of the prior art and the description of the present invention, can also use any methods, devices, and materials similar or equivalent to the methods, devices, and materials described in the embodiments of the present invention to implement the present invention.

[0042] Please refer to Figures 1 to 4 ,Figure 1 It shows a schematic flowchart of the training method of the multi-domain adaptive model in an embodiment of the present invention. Figure 2 It shows the visualization feature demonstration before and after using the model in an embodiment of the present invention. Figure 3 It shows the framework flowchart of the training method of the multi-domain adaptive model in an embodiment of the present invention. Figure 4 It shows the incremental training flowchart in an embodiment of the present invention. The present invention provides a training method for a multi-domain adaptive model. After obtaining the source domain and target domain datasets, a contrastive learning method is adopted. The data with the same category in the source domain and the target domain is used as a positive sample pair, and the data with different categories in the source domain and the target domain is used as a negative sample pair. By minimizing the contrastive loss, the domain features are aligned. The weights of the source domain during the previous training are saved through an incremental convolutional network and loaded into the model to be trained currently. By calculating the distillation loss between the incremental convolutional network and the source domain classification network, the feature alignment achieved on the high-level semantic feature layer is ensured. Through this incremental learning method and multi-level feature alignment, finally, multiple domain-invariant features are obtained, and a multi-domain adaptive model classifier that can perform classification in multiple domains is obtained. As Figure 2 can be seen, after using this model, various classifications are clustered with clear boundaries and feature alignment. It solves the problem in the traditional adaptive model that only a single source domain to a single target domain can be used.

[0043] Please refer to Figures 1 to 4 , in an embodiment of the present invention, a training method for a multi-domain adaptive model is provided, including the following processes:

[0044] S1. Obtain source domain data and target domain data, and divide the target domain data into several groups according to different domains, and each group contains target domain data of one domain;

[0045] S2. Input the source domain data into the source domain classification network, input a group of target domain data into the target domain classification network for training, and update the weights of the incremental convolutional layer according to the training results, wherein the weights of the source domain classification network and the target domain classification network are shared;

[0046] S3. Load the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network;

[0047] S4. Select another group of target domain data, and repeat steps S2 to S3 for iterative training until the target domain data training is completed to obtain a multi-domain adaptive model.

[0048] After obtaining the source domain data and the target domain data, group the target domain data based on different categories, with each group containing the target domain data of one category. Input the source domain data into the source domain classification network, and input one group of the target domain data into the target domain classification network. Train the above two networks simultaneously, align the domain features by minimizing the contrastive loss, and save the weights of the source domain classification network at the current layer to the incremental convolutional layer. Through incremental learning, on the basis of retaining old knowledge, learn the invariant features among multiple domains to enhance the robustness of the model. After the training of the target domain data in the current group is completed, load the weights of the incremental convolutional layer into the source domain classification network. Since the incremental convolutional layer does not participate in training and the source domain classification network and the target domain classification network share weights, the weights of the source domain classification network and the target domain classification network at this time are the weights of the previous incremental convolutional layer. Input the source domain data and another group of target domain data, and repeat the above steps for iterative training until all the target domain data participates in training, and at this time, a multi-domain adaptive model is obtained.

[0049] Further, in an embodiment of the present invention, labeled source domain data and multiple unlabeled target domain data are used as training data. Among them, the source domain data contains a large amount of data with labeled tags, that is Among them, D s is the data of the source domain s, X s is the numerical set of the source domain data, Y s is the label set of the source domain data, is the value of the i-th source domain data, is the label of the i-th source domain data, n s is the type of the source domain data. For multiple unlabeled target domain data, according to different target domain categories, divide the multiple target domain data into several groups, and each group of target domain data has its own feature space, that is Among them, is the k-th group of target domain data t, X t is the numerical set of the target domain data, is the i-th group of target domain data, m is the number of target domain data in the current group, n s is the number of groups of the target domain data, is the k-th target domain data in the i-th group of target domain data. Assume that there are k groups of target domain data in total. According to the basic assumption of unsupervised domain adaptation, the source domain data and the target domain data follow different distributions, and the feature distributions between each target domain are also different. The multi-domain adaptive model trained in this embodiment can make the output feature distribution of the source domain data approximate the output feature distribution of the target domain data.

[0050] Please refer to Figure 5 , Figure 5It is a schematic flowchart showing step S2 in an embodiment of the present invention. In an embodiment of the present invention, step S2 includes the following processes:

[0051] S21. Input the source domain data into the source domain classification network to obtain source domain features;

[0052] S22. Input the target domain data into the target domain classification network to obtain target domain features;

[0053] S23. Use the source domain features and target domain features with the same label as positive sample pairs, and use the source domain features and target domain features with different labels as negative sample pairs;

[0054] S24. Compare and learn the positive sample pairs and negative sample pairs, and update the weights of the incremental convolutional layer of the model based on the results of the contrast learning.

[0055] Since the samples from the source domain and the target domain belong to the same set of classes in the current environment setting, that is, the domain classes are consistent, based on this assumption, the domain shift is reduced. Input the source domain data into the source domain classification network, extract features through the convolutional layer to obtain source domain features, and input a set of target domain data into the target domain classification network, extract features through the convolutional layer to obtain target domain features. Adopt the way of contrast learning, assuming that samples with the same label (the same class) are close to each other, and samples with different labels (different classes) are far apart. Therefore, regardless of which domain the data comes from, the source domain data and target domain data with the same label are used as positive sample pairs, and the source domain data and target domain data with different labels are used as negative sample pairs. After regularizing the source domain features and target domain features, align the domain features by minimizing the contrast loss. In an embodiment of the present invention, the contrast loss is:

[0056]

[0057] Among them, is the contrast loss of the target domain when the i-th group of target domain data is input, is the positive sample set where the source domain and the target anchor share the same label, τ is an adjustable parameter factor, is the regularized feature of the i-th target domain, is the regularized feature of the samples in the source domain with the same label as the target domain, is the regularized feature of the samples in the source domain with different labels from the target domain, I s represents a set of mini-batch from the source domain.

[0058] In an embodiment of the present invention, use the data in the source domain as the anchor point, by setting the source domain and the target anchor to share the same label, obtain Combine with to obtain the cross-domain contrast loss LCDC As shown in formula (2):

[0059]

[0060] wherein is the contrastive loss of the target domain when the i-th group of target domain data is input, is the contrastive loss of the source domain when the j-th group of source domain data is input, and n s is the number of classes of the target domain data, and n t is the number of classes of the source domain data. By using the anchor points in the target domain and the source domain, the cross-domain contrastive loss aligns the features in a bidirectional manner, thereby improving the performance of the model.

[0061] Furthermore, considering that the target domain is data without labels and the labels of the data in the target domain cannot be accessed. To solve this problem, in an embodiment of the present invention, after inputting the target domain data into the target domain classification network to obtain the target domain features, it further includes: performing pseudo-label processing on the target domain data to obtain the target domain data with labels. Summing the mini-batch samples from the source domain that belong to the same class as the anchor points, thereby reducing the sampling variance. Specifically, by setting the number of clusters to the number of classes in the target domain, calculating the centroid of the source samples in each class as the corresponding class prototype, and using the class prototypes of the source domain as the initial clusters. Initializing the cluster centers with the class prototypes has two advantages: on the one hand, the class prototypes in the source domain can be regarded as approximations of the class prototypes in the target domain because the features used are high-level and contain semantic information; on the other hand, by aligning the samples of the same class through the CDC loss, this approximation will become more accurate as the training continues. Given the features of the target domain, then perform spherical K-means clustering using these initialized centers. Once the clustering is completed, each target domain sample is given a pseudo-label. By comparing the consistency between the pseudo-label and the data label in the source domain, positive sample pairs or negative sample pairs are selected.

[0062] In an embodiment of the present invention, before loading the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network, the following steps are further included: performing knowledge distillation on the features output by the incremental convolutional network and the source domain classification network to obtain high-level semantic features. Knowledge distillation is one of the important methods for incremental learning. To ensure the consistency of the semantic information output by the high-level network, a knowledge distillation function is added to the high-level semantic layer convolutional network. To retain the domain information obtained after multi-domain learning of several previous groups of target domain data and source domain data, the incremental convolutional network does not participate in the training process, thereby being able to retain the domain information in the previous learning. By adding a distillation loss, the forgetting of the domain classification information in the source domain and the previous k - 1 target domains is alleviated, preventing a significant decrease in the detection accuracy of the newly trained network on the data of the previous k - 1 target domains, and minimizing the difference in the output responses of the high-level semantic layers between the newly trained model and the old trained model. This distillation loss uses the distance between the high-level semantic layer responses of samples to update and train the multi-domain adaptive model, thereby making the model universal. The classical L2 loss is used as the distillation loss to reduce the response gap between the outputs of the two high-level semantic layers. The specific distillation loss L D is shown in Equation (3) as follows:

[0063] L D = ||F s (x) - F’(x’)|| (3)

[0064] where F s (x) is the output feature of the high-level semantic layer of the source domain, and F’(x’) is the output feature of the high-level semantic layer of the incremental convolutional network. According to the distillation loss, the convolutional classifiers of the source domain classification network and the target domain classification network are fine-tuned using the gradient descent method. Different groups of target domain data are repeatedly selected for iterative training until N domain-invariant features are learned. The number of domain-invariant features is the same as the number of groups of the target domain.

[0065] In an embodiment of the present invention, the loss function of the multi-domain adaptive model is: L = L CE + αL CDC + βL D , where L is the loss function of the multi-domain adaptive model, L CE is the cross-entropy loss of the source domain classification network, L CDC is the cross-domain contrast loss between the source domain classification network and the target domain classification network, L D is the contrast loss, and α and β are the adjustment factors for the cross-domain contrast loss and the contrast loss respectively. During training, the previous training parameters saved in the incremental convolutional network are passed to the current training model. By storing the weights of the old domain model and passing them to the new model, incremental learning is achieved, obtaining multiple inter-domain invariant features, and thus obtaining a classifier that can perform classification in multiple domains.

[0066] In an embodiment of the present invention, the convolutional layers in the source domain classification network, the convolutional layers in the target domain classification network, and the incremental network layer have the same structure, which is the ResNet101 network. The ResNet101 network consists of 1 conv1 convolutional layer, 3 conv2_x (3 convolutional layers), 4 conv3_x (3 convolutional layers), 23 conv4_x (3 convolutional layers), 3 conv5_x (3 convolutional layers), and 1 average pooling layer. The first layer is a convolutional layer with a stride of 2, and the last layer is a fully connected layer. Among them, there are four different sizes of residual blocks, namely conv2_x (convolution kernel, number 64; convolution kernel, number 64; convolution kernel, number 256), conv3_x (convolution kernel, number 128; convolution kernel, number 128; convolution kernel, number 512), conv4_x (convolution kernel, number 256; convolution kernel, number 256; convolution kernel, number 1024), conv5_x (convolution kernel, number 512; convolution kernel, number 512; convolution kernel, number 2048).

[0067] The step division of the above method is only for clear description. When implemented, it can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, it is within the protection scope of the present invention; adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of its algorithm and process, are all within the protection scope of the invention.

[0068] Please refer to Figure 6 , Figure 6 which shows a schematic diagram of the principle structure of the training system of the multi-domain adaptive model in an embodiment of the present invention. The training method system 10 of the multi-domain adaptive model includes a data acquisition unit 11, an incremental convolution weight acquisition unit 12, a weight loading unit 13, and a model acquisition unit 14. Among them, the data acquisition unit 11 is used to acquire source domain data and target domain data, and divide the target domain data into several groups according to different domains, and each group contains target domain data of one domain. The incremental convolution weight acquisition unit 12 is used to input the source domain data into the source domain classification network, input a group of target domain data into the target domain classification network for training, and update the weights of the incremental convolutional layer according to the training results. Among them, the weights of the source domain classification network and the target domain classification network are shared. The weight loading unit 13 is used to load the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network. The model acquisition unit 14 is used to select another group of target domain data for iterative training until the target domain data training is completed, and obtain the multi-domain adaptive model.

[0069] It should be noted that, in order to highlight the innovative part of the present invention, modules that are not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment. However, this does not mean that there are no other modules in this embodiment.

[0070] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the foregoing method embodiment, and will not be elaborated herein. In the embodiments provided by the present invention, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be an indirect coupling or communication connection through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0071] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they can be located in one place, or can be distributed to multiple network modules. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0072] In addition, the functional modules in each embodiment of the present invention can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional units.

[0073] This embodiment also provides a training device for a multi-domain adaptive model. The device includes a processor and a memory, which are coupled. The memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned task management method is implemented. The processor can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components; the memory may include a random access memory (RAM for short), and may also include a non-volatile memory, such as at least one disk memory. The memory can be an internal memory of the random access memory (RAM) type, and the processor and the memory can be integrated into one or more independent circuits or hardware, such as: an application specific integrated circuit (ASIC). It should be noted that when the computer program in the above-mentioned memory is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present invention.

[0074] This embodiment also provides a computer-readable storage medium storing computer instructions for causing a computer to execute the above task management method. The storage medium may be an electronic medium, a magnetic medium, an optical medium, an electromagnetic medium, an infrared medium, or a semiconductor system or a propagation medium. The storage medium may also include semiconductor or solid-state memories, magnetic tapes, removable computer disks, random access memories (RAMs), read-only memories (ROMs), hard disks, and optical disks. The optical disks may include compact disk read-only memories (CD-ROMs), compact disk read / write (CD-RWs), and digital versatile disks (DVDs).

[0075] In summary, after obtaining the source domain and target domain datasets, a contrastive learning method is adopted. The data with the same category in the source domain and the target domain are used as positive sample pairs, and the data with different categories in the source domain and the target domain are used as negative sample pairs. By minimizing the contrastive loss, the domain features are aligned. The weights of the source domain during the previous training are saved by the incremental convolutional network and loaded into the model to be trained currently. By calculating the distillation loss between the incremental convolutional network and the source domain classification network, the feature alignment achieved on the high-level semantic feature layer is ensured. Through this incremental learning method and multi-level feature alignment, multiple domain-invariant features are finally obtained, and a multi-domain adaptive model classifier that can perform classification in multiple domains is obtained. The problem that only a single source domain to a single target domain can be used in the traditional adaptive model is solved.

[0076] The above embodiments are only illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.

Claims

1. A training method for a multi-domain adaptive model, characterized in that Applied to the field of images, the model includes a source domain classification network, a target domain classification network, and an incremental convolutional network. The method includes the following processes: Obtain source domain data and target domain data, and divide the target domain data into several groups according to different domains. Each group contains target domain data of one domain; Input the source domain data into the source domain classification network, input a group of target domain data into the target domain classification network for training, and update the weights of the incremental convolutional layer according to the training results. Among them, the weights of the source domain classification network and the target domain classification network are shared; Load the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network; Select another group of target domain data for iterative training until the target domain data training is completed to obtain a multi-domain adaptive model; The process of inputting the source domain data into the source domain classification network of the model, inputting a group of target domain data into the target domain classification network of the model for training, and updating the weights of the incremental convolutional layer of the model according to the training results includes: Input the source domain data into the source domain classification network to obtain source domain features; Input a group of target domain data into the target domain classification network to obtain target domain features; Use the source domain features and target domain features with the same label as positive sample pairs, and use the source domain features and target domain features with different labels as negative sample pairs; Perform contrastive learning on the positive sample pairs and the negative sample pairs, and update the weights of the incremental convolutional layer based on the results of the contrastive learning.

2. The training method of the multi-domain adaptive model according to claim 1, characterized in that After inputting a group of target domain data into the target domain classification network to obtain target domain features, it further includes: Perform pseudo-label processing on the target domain data of the current group to obtain the current group of target domain data with labels.

3. The training method of the multi-domain adaptive model according to claim 1, characterized in that Before loading the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network, it further includes: Perform knowledge distillation on the features output by the incremental convolutional network and the source domain classification network to obtain high-level semantic features.

4. The training method of the multi-domain adaptive model according to claim 1, characterized in that The convolutional layers in the source domain classification network, the convolutional layers in the target domain classification network, and the incremental network layer have the same structure.

5. The training method of the multi-domain adaptive model according to claim 1, characterized in that The multi-domain adaptive model loss function is \(L = L CE +\alpha L CDC +\beta L D , where \(L\) is the multi-domain adaptive model loss function, \(L CE \) is the cross-entropy loss of the source domain classification network, \(L CDC \) is the cross-domain contrast loss between the source domain classification network and the target domain classification network, \(L D \) is the distillation loss, and \(\alpha\) and \(\beta\) are the adjustment factors for the cross-domain contrast loss and the contrast loss, respectively.

6. The training method of the multi-domain adaptive model according to claim 5, wherein The formula for the said distillation loss is: L D =‖F s (x) - F’(x’)‖, where F s (x) is the output feature of the source domain high-level semantic layer, and F’(x’) is the output feature of the incremental convolutional network high-level semantic layer.

7. A training system for a multi-domain adaptive model, characterized in that Applied to the field of images, the model includes a source domain classification network, a target domain classification network, and an incremental convolutional network. The system includes: A data acquisition unit for obtaining source domain data and target domain data, and dividing the target domain data into several groups according to different domains. Each group contains target domain data of one domain; An incremental convolutional weight acquisition unit for inputting the source domain data into the source domain classification network, inputting a group of target domain data into the target domain classification network for training, and updating the weights of the incremental convolutional layer according to the training results. Among them, the weights of the source domain classification network and the target domain classification network are shared; A weight loading unit for loading the weights of the incremental convolutional layer into the source domain classification network and the target domain classification network; A model acquisition unit for selecting another group of target domain data for iterative training until the target domain data training is completed to obtain a multi-domain adaptive model; Inputting the source domain data into the source domain classification network of the model, inputting a set of target domain data into the target domain classification network of the model for training, and updating the weights of the incremental convolutional layer of the model according to the training results includes: Inputting the source domain data into the source domain classification network to obtain source domain features; Inputting a set of target domain data into the target domain classification network to obtain target domain features; Regarding the source domain features and target domain features with the same label as a positive sample pair, and regarding the source domain features and target domain features with different labels as a negative sample pair; Performing contrastive learning on the positive sample pair and the negative sample pair, and updating the weights of the incremental convolutional layer based on the results of the contrastive learning.

8. A training device for a multi-domain adaptive model, characterized in that: Including a processor, the processor is coupled to a memory, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the method described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: Including a program, when the program runs on a computer, the method described in any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Method for training target domain classification model through unsupervised domain adaptation

    CN110880019A

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

    CN111709315A