CN115661904A - Data labeling and domain adaptation model training method, device, equipment and medium - Google Patents

Data labeling and domain adaptation model training method, device, equipment and medium Download PDF

Info

Publication number
CN115661904A
CN115661904A CN202211404950.1A CN202211404950A CN115661904A CN 115661904 A CN115661904 A CN 115661904A CN 202211404950 A CN202211404950 A CN 202211404950A CN 115661904 A CN115661904 A CN 115661904A
Authority
CN
China
Prior art keywords
domain
data
target
domain data
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211404950.1A
Other languages
Chinese (zh)
Inventor
张晶华
文扬
张丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uisee Technologies Beijing Co Ltd
Original Assignee
Uisee Technologies Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uisee Technologies Beijing Co Ltd filed Critical Uisee Technologies Beijing Co Ltd
Priority to CN202211404950.1A priority Critical patent/CN115661904A/en
Publication of CN115661904A publication Critical patent/CN115661904A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the disclosure discloses a method, a device, equipment and a medium for training a data labeling and domain adaptation model. According to the method, the initial characteristics and the target characteristics of each target domain data are sequentially determined through the backbone network and the domain adaptation module in the domain adaptation model, and then the prediction identification label of the target domain data is determined according to the target characteristics, so that the target domain data are labeled. And the target characteristics are determined through the domain adaptation module in the domain adaptation model, so that the source domain data and the target domain data are aligned in the characteristic space through the domain adaptation module without being aligned in the characteristic space through a main network, the repeated training of the main network is avoided, and the problems that the training process of the main network is unstable and difficult to converge are solved.

Description

Data labeling and domain adaptation model training method, device, equipment and medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for training a data labeling and domain adaptation model.
Background
The deep neural network has good learnability and high accuracy, and is widely applied to various fields, such as the field of automatic driving perception, the field of natural language processing and the like. The deep neural network has good perception capability, a large amount of labeled data is needed for supervision and training, and the quantity and quality of the labeled data have decisive influence on the performance of the neural network.
At present, marking data required by deep neural network training mainly come from manual marking, and marking personnel mark data such as point clouds, images or texts according to established marking rules. Meanwhile, for some mature application scenarios, some manufacturers also realize automatic data annotation in a data closed-loop manner, but currently, annotation data mainly comes from manual annotation.
However, a large amount of data needs to be manually marked with high cost, and especially for 3D data such as point cloud, the marking process is more complicated and the cost is higher. In addition, manual labeling mainly depends on subjective judgment of labeling personnel, uniform labeling standards are difficult to guarantee in the labeling process, and the quality of data labeling is difficult to guarantee. The automatic labeling method is high in efficiency and uniform in labeling standard. Most of the existing automatic labeling methods can only label mature scene data, and new scene data with slight differences still need to be labeled manually, so that complete high-efficiency automatic labeling cannot be realized.
Therefore, the following technical problems exist in the prior art: the method relying on manual labeling has high cost, low efficiency and low labeling quality; the automatic labeling method cannot realize data labeling in a new scene.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, embodiments of the present disclosure provide a method, an apparatus, a device, and a medium for training a data labeling and domain adaptation model, which implement labeling of target domain data, are suitable for a data set in each new scene, do not need manual labeling, improve labeling efficiency and labeling quality, and reduce labeling cost.
In a first aspect, an embodiment of the present disclosure provides a data annotation method, where the method includes:
acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
inputting each target domain data into the domain adaptation model to obtain a prediction identification label corresponding to each target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
In a second aspect, an embodiment of the present disclosure further provides a domain adaptation model training method, where the method includes:
determining a discrimination model based on a source domain data set and a target domain data set, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
constructing a domain adaptation model based on the discrimination model, determining initial characteristics of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determining target characteristics of each data based on a domain adaptation module in the domain adaptation model and the initial characteristics of each data;
determining a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator and the prediction output module, and determining a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and adjusting parameters in the domain adaptation module based on the prediction domain classification label of each source domain data, the prediction identification label of each source domain data and the prediction domain classification label of each target domain data.
In a third aspect, an embodiment of the present disclosure further provides a data annotation device, where the device includes:
the model acquisition module is used for acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
a label determining module, configured to input each target domain data into the domain adaptation module, and obtain a predicted identification label corresponding to each target domain data output by the domain adaptation module;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
In a fourth aspect, an embodiment of the present disclosure further provides a domain adaptive model training apparatus, where the apparatus includes:
the system comprises a discrimination model determining module, a prediction output module and a domain discriminator, wherein the discrimination model comprises a backbone network, the prediction output module and the domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
a domain adaptation model building module, configured to build a domain adaptation model based on the discriminant model, determine initial features of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determine target features of each data based on the domain adaptation module in the domain adaptation model and the initial features of each data;
a label output module, configured to determine a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator, and the prediction output module, and determine a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and the domain adaptation training module is used for adjusting parameters in the domain adaptation module based on the prediction domain classification labels of the source domain data, the prediction identification labels of the source domain data and the prediction domain classification labels of the target domain data.
In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes: one or more processors; storage means for storing one or more programs; when executed by the one or more processors, cause the one or more processors to implement a data annotation process or a domain adaptation model training process as described above.
In a sixth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the data labeling method or the domain adaptive model training method as described above.
According to the data labeling method provided by the embodiment of the disclosure, the domain adaptation model constructed by the source domain data set and the target domain data set is obtained, the initial characteristics and the target characteristics of each target domain data are sequentially determined through the backbone network and the domain adaptation module in the domain adaptation model, and then the prediction identification label of the target domain data is determined according to the target characteristics, so that the labeling of each target domain data is realized, the method is suitable for the data sets in each new scene, manual labeling is not needed, the labeling efficiency and the labeling quality are improved, and the labeling cost is reduced. And the target characteristics are determined through the domain adaptation module in the domain adaptation model, so that the source domain data and the target domain data are aligned in the characteristic space through the domain adaptation module, the characteristic space alignment through a backbone network is not needed, the repeated training of the backbone network is avoided, and the problems of instability and difficulty in convergence in the training process of the backbone network are solved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow chart of a data annotation method in an embodiment of the present disclosure;
FIG. 2 is a flow chart of a domain adaptive model training method in an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a training process of a discriminant model according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a training process of a domain adaptation model according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of another domain adaptive model training method in an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a segmentation result of current source domain data and current target domain data according to an embodiment of the present disclosure;
fig. 7 is a schematic composition diagram of the concatenated data provided by the embodiments of the present disclosure;
FIG. 8 is a schematic diagram of stitching data provided by an embodiment of the present disclosure;
FIG. 9 is a schematic structural diagram of a data annotation device according to an embodiment of the disclosure;
FIG. 10 is a schematic structural diagram of a domain adaptive model training apparatus in an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Before describing the data labeling method and the domain adaptation model training method provided by the embodiment of the present disclosure in detail, the technical problems and application scenarios solved by the method provided by the embodiment of the present disclosure are explained in an exemplary manner.
The method provided by the embodiment of the disclosure mainly solves the problems of high cost of manual data labeling and poor adaptability of an automatic labeling algorithm to a new scene, and can effectively utilize the existing source domain data to learn and label the new scene data, thereby reducing the cost of data labeling and improving the adaptability of the labeling method to the new scene data.
Illustratively, the domain adaptation model training method provided by the embodiment of the present disclosure may be applied to generate domain adaptation models such as a perceptual point cloud detection model, a terrain detection model, a text classification model, a text translation model, a text abstract extraction model, a text prediction model, a keyword conversion model, a text semantic analysis model, an image style conversion model, an image classification model, an image segmentation model, an image feature extraction model, an image enhancement model, an image tag generation model, a face recognition model, a facial expression recognition model, a language recognition model, a voice recognition model, a recommendation model, and the like.
For example, the data annotation method provided by the embodiment of the present disclosure may be used for data annotation on point cloud data, text data, image data, voice data, or other data. For example, if the target domain data set includes unmanned sensing point cloud data, a target object detection frame corresponding to the sensing point cloud data can be output through the domain adaptation model to serve as a prediction identification tag; if the target data set comprises various topographic point cloud data, outputting a topographic three-dimensional model corresponding to the topographic point cloud data through the domain adaptation model to serve as a prediction identification label; if the target data set comprises each text data, outputting a text abstract, a text classification, a text translation result, a text semantic analysis result, a keyword conversion result or a text prediction result corresponding to each text data through the domain adaptation model as a prediction identification label; if the target data set comprises each voice data, outputting a voice recognition result, an audio noise reduction result, an audio synthesis result or a language recognition result corresponding to each voice data through the domain adaptation model; if the target data set includes each image data, the image classification, the image segmentation result, the image feature, the image compression result, or the image label corresponding to each image data may be output through the domain adaptation model.
The above application scenarios are only exemplary, and the present disclosure does not limit the application scenarios of the domain adaptive model training method and the data labeling method.
Fig. 1 is a flowchart of a data annotation method in the embodiment of the present disclosure. The method can be executed by a data annotation device, which can be implemented in software and/or hardware, and can be configured in an electronic device. As shown in fig. 1, the method may specifically include the following steps:
s110, a domain adaptation model determined based on a source domain data set and a target domain data set is obtained, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data.
In this embodiment, the source domain data in the source domain data set may be data having a corresponding preset identification tag; the target domain data in the target domain data set may be data that does not have a corresponding preset identification tag. Wherein the preset identification tag may be a tag corresponding to a model prediction task of the domain adaptation model. For example, taking a target object in the point cloud data detected by the model prediction task as a target, the preset identification tag corresponding to the source domain data may be a detection frame for sensing each target object included in the point cloud data.
Optionally, the target domain data is point cloud data, text data, image data, or voice data. Wherein, the point cloud data can be perception point cloud data, map point cloud data or medical image point cloud data, etc.; the text data can be articles, commodity detail pages or webpage texts and the like; the image data may be road images, facial images, medical images, or vehicle sensor captured images, etc.; the voice data can be vehicle-machine interaction voice, call voice or video audio and the like. In this embodiment, labeling of data such as point cloud, text, image, or voice may be implemented. Of course, the target domain data is not limited to the above example, and may be determined according to the actual labeling requirement.
It should be noted that the target domain data set and the source domain data set may be data sets of different data sources, that is, the target domain data set may be a data set in a new scenario different from the scenario in which the source domain data set is located. The embodiment can label the target domain data set through labeled data in other scenes different from the scene of the target domain data set.
For example, following the above example, the model prediction task is a target object in point cloud data for target detection, the target domain dataset may be highway point cloud data, and the source domain dataset may be urban road point cloud data. For another example, the model detection task is to identify a facial region, the target data set may be an animated face image, and the source domain data set may be a real face image.
Specifically, a domain adaptation model constructed from the source domain data set and the target domain data set may be obtained. The model prediction task of the domain adaptive model corresponds to a preset identification tag of the source domain data, namely the model prediction task aims at outputting each prediction identification tag.
The domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
For example, a pre-training model may be first constructed based on the source domain data set, where the pre-training model includes a backbone network and a prediction output model, and a target of the pre-training model is to output a prediction identification label consistent with a preset identification label of the source domain data. Further, on the basis of a pre-training model, a discrimination model is obtained according to a source domain data set and a target domain data set, the discrimination model comprises a pre-training model and a domain discriminator, wherein the domain discriminator is used for discriminating source domains of data; further, on the basis of the discriminant model, a domain adaptation model is obtained according to the source domain data set and the target domain data set, wherein the domain adaptation model comprises the discriminant model and a domain adaptation module, and the domain adaptation module aims to map the features of the target domain data to a feature space similar to the features of the source domain data so as to align the features of the target domain data with the features of the source domain data.
In a specific embodiment, obtaining a domain adaptation model determined based on a source domain data set and a target domain data set includes: determining a discrimination model based on the source domain data set and the target domain data set, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator; a domain adaptation model is determined based on the discriminant model.
The determining a discriminant model based on the source domain data set and the target domain data set may be: determining a pre-training model based on the source domain data set, adding a domain discriminator on the basis of the pre-training model, and training the domain discriminator based on the source domain data set and the target domain data set to obtain a discrimination model.
Specifically, the finally obtained discrimination model may output, through the domain discriminator, the currently input source domain data or the source domain corresponding to the target domain data. For example, a domain classification label may be set for each source domain data in the source domain data set, and a domain classification label may be set for each target domain data in the target domain data set, so that each source domain data, a domain classification label corresponding to each source domain data, each target domain data, and a domain classification label corresponding to each target domain data are used as samples, and the domain discriminator may be trained.
Further, a domain adaptation model is determined based on the discriminant model, a domain adaptation module may be added on the basis of the discriminant model, and the domain adaptation module is trained based on the source domain data set and the target domain data set to obtain the domain adaptation model.
Through the mode, the discriminant model is determined based on the source domain data set and the target domain data set, then the domain adaptation model is constructed according to the discriminant model, the training of the domain discriminant is completed under the condition that the domain adaptation module does not participate, and the purpose of the setting is as follows: the domain discriminator and the domain adaptation module are trained respectively, and the problems that the domain discriminator and the domain adaptation model are difficult to converge, the result is unstable and the like when being trained together are avoided.
And S120, inputting the target domain data into the domain adaptation model to obtain the predicted identification label corresponding to the target domain data output by the domain adaptation model.
After the domain adaptation model is obtained, all the target domain data can be input into the domain adaptation model, a backbone network of the domain adaptation model can determine the initial features of all the target domain data, the initial features of all the target domain data are input into the domain adaptation module, the domain adaptation module can determine the target features of all the target domain data according to the initial features of all the target domain data, the target features of all the target domain data are input into the prediction output module, and the prediction output module can determine the prediction identification tags corresponding to all the target domain data according to the target features of all the target domain data.
The domain adaptation module can be a convolution module composed of a plurality of convolution layers, and can perform feature space mapping processing on initial features output by the backbone network and map features of target domain data to feature spaces close to features of source domain data so as to achieve the purpose of aligning the features of the target domain data with the features of the source domain data, so that the prediction effect of the prediction output module trained based on the source domain data set is well represented on the target domain data set.
Through the method, the predicted identification tag corresponding to each target domain data can be obtained. All predictive identification tags may also be screened to remove false tags that are misdetected, taking into account the possible presence of misdetected tags.
In a specific embodiment, after obtaining the predicted identification tag corresponding to each target domain data output by the domain adaptation model, the method further includes: and aiming at the predicted identification tag corresponding to each target domain data, determining the identification tag characteristics corresponding to the predicted identification tag, judging whether the identification tag characteristics meet preset characteristic screening conditions or not, and if not, rejecting the predicted identification tag.
The identification tag feature may be a feature related to the predicted identification tag, such as a length of the tag, a size of the tag, a distance between two adjacent tags, and the like. For example, taking target domain data as the sensing point cloud data as an example, the detection frame of which the identification tag is the target object is predicted, and the identification tag feature may be the size of the detection frame, the number of point clouds included in the detection frame, the distance between two adjacent detection frames, the appearance shape of the detection frame, and the like.
The preset feature filtering condition may be a preset condition for filtering the pseudo tag. Specifically, when the identification tag feature corresponding to one predicted identification tag satisfies the preset feature screening condition, the predicted identification tag may be determined as an accurate tag, and when the identification tag feature corresponding to one predicted identification tag does not satisfy the preset feature screening condition, the predicted identification tag may be determined as a pseudo tag and needs to be removed.
For example, following the above example, the preset feature screening condition may be that the size of the detection frame does not exceed a preset size, or the number of point clouds included in the detection frame is not less than a preset number, or the distance between two adjacent detection frames is not less than a preset distance. Specifically, the preset feature screening condition may be determined according to a feature of the target source data, which is not limited in this disclosure.
Specifically, the predicted identification tag is removed, that is, only the predicted identification tag is removed, and then, the target domain data corresponding to the predicted identification tag is continuously identified by using a domain adaptation model, or the target domain data corresponding to the predicted identification tag is manually marked; or the prediction identification tag and the target source data corresponding to the prediction identification tag are removed together, so that the target source data are discarded together, and the influence on the whole data set under the condition that the target source data are abnormal points is avoided.
Through the method, unreasonable and wrong labels are removed from the target source data set after batch labeling is carried out on the target source data set, and after the pseudo labels are screened and removed, the residual predicted identification labels of the target source data can be regarded as labels with high reliability, so that the accuracy of data labeling is further improved, and the influence of wrong labeling on subsequent data application is avoided.
According to the data labeling method provided by the embodiment, the domain adaptation model constructed by the source domain data set and the target domain data set is obtained, the initial characteristics and the target characteristics of each target domain data are sequentially determined through the backbone network and the domain adaptation module in the domain adaptation model, and then the prediction identification label of the target domain data is determined according to the target characteristics, so that the labeling of each target domain data is realized, the method is suitable for the data set under each new scene, manual labeling is not needed, the labeling efficiency and the labeling quality are improved, and the labeling cost is reduced. And the target characteristics are determined through the domain adaptation module in the domain adaptation model, so that the source domain data and the target domain data are aligned in the characteristic space through the domain adaptation module without being aligned in the characteristic space through a main network, the repeated training of the main network is avoided, and the problems that the training process of the main network is unstable and difficult to converge are solved.
In addition, the data annotation method provided by this embodiment draws in the distribution difference between different scene data on the feature level, and does not need to perform specific preprocessing on the data, so that various types of data including but not limited to point clouds, images, texts, etc. can be compatible through a simple data interface, and meanwhile, various task scenes such as classification, detection, segmentation, etc. can be adapted. Compared with the existing labeling method, the method has the advantages of wider application range and simpler operation.
Fig. 2 is a flowchart of a domain adaptive model training method in the embodiment of the present disclosure. The method may be performed by a domain-adaptive model training apparatus, which may be implemented in software and/or hardware, and may be configured in an electronic device. As shown in fig. 2, the method may specifically include the following steps:
s210, determining a discrimination model based on a source domain data set and a target domain data set, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data.
In this embodiment, a discriminant model can be obtained by directly training the source domain data set and the target domain data set, that is, the backbone network, the prediction output module, and the domain discriminant are trained simultaneously. Or, a pre-training model can be obtained by training the source domain data set, and then a domain discriminator is added on the basis of the pre-training model, and the domain discriminator is trained by the source domain data set and the target domain data set.
In one particular embodiment, determining a discriminative model based on a source domain dataset and a target domain dataset includes: determining a pre-training model based on the source domain data set, wherein the pre-training model comprises a backbone network and a prediction output module; and constructing a discrimination model based on the pre-training model, and training a domain discriminator in the discrimination model according to the source domain data set and the target domain data set to obtain the trained discrimination model.
Namely, the trunk network and the prediction output module in the discrimination model can directly select the trunk network and the prediction output module in the pre-training model; the domain discriminators in the discriminative model may be trained based on the source domain dataset as well as the target domain dataset.
Specifically, the trunk network and the prediction output module of the pre-training model may be supervised and trained through the source domain data set, and after the training is completed, a discrimination model is constructed according to the trunk network and the prediction output module of the pre-training model and the domain discriminator, that is, parameters of the trunk network and the prediction output module of the pre-training model are loaded, and the domain discriminator is added, so as to train the domain discriminator through the source domain data set and the target domain data set.
Wherein determining the pre-training model based on the source domain dataset may include: determining initial characteristics of source domain data based on a backbone network, determining a predicted identification tag of the source domain data based on a predicted output module and the initial characteristics of the source domain data, and calculating loss according to the predicted identification tag and a preset identification tag; and adjusting parameters in the trunk network and the prediction output module according to the loss calculation result until the loss calculation result meets the convergence condition.
It should be noted that, in this embodiment, in the process of training the domain discriminator, parameters of the trunk network and the prediction output module may be frozen, and only the parameters of the domain discriminator may be adjusted.
The training of the domain discriminator in the discrimination model according to the source domain data set and the target domain data set may include: adding preset domain classification labels to the source domain data and the target domain data, wherein the preset domain classification label of the source domain data can be 1, and the preset domain classification label of the target domain data can be 0; determining initial characteristics of source domain data or target domain data based on a backbone network in the discriminant model; according to the domain discriminator and the initial characteristics in the discrimination model, determining a prediction domain classification label output by the domain discriminator, calculating loss according to a preset domain classification label and the prediction domain classification label, and adjusting parameters in the domain discriminator according to a loss calculation result until the loss calculation result meets a convergence condition.
Through above-mentioned embodiment, train out backbone network and prediction output module earlier, obtain the pre-training model, set up the domain arbiter again on the basis of pre-training model, train the domain arbiter alone, realized backbone network and prediction output module, and the independent training between the domain arbiter, the benefit that sets up like this lies in: the trunk network, the prediction output module and the domain discriminator are trained separately, so that the parameter optimization adjustment range of each training is small, convergence is easy, and the training speed is improved; in addition, the problem of unstable training process can be avoided, and the training precision is improved.
It should be noted that, based on the discriminant model obtained in the above steps, the backbone network may accurately extract the initial features for determining the corresponding predictive identification tag from the source domain data, and the domain discriminator may accurately judge the source domain of the data.
Fig. 3 is a schematic diagram of a training process of a discriminant model according to an embodiment of the present disclosure, where parameters of a trunk network and a prediction output module are frozen, and source domain data and target domain data may be input to the trunk network after being preprocessed, and then after initial features are extracted by the trunk network, a prediction domain classification label is obtained by a domain discriminant, and then parameters of the domain discriminant are adjusted according to the prediction domain classification label.
S220, constructing a domain adaptation model based on the discriminant model, determining initial characteristics of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determining target characteristics of each data based on a domain adaptation module in the domain adaptation model and the initial characteristics of each data.
In this embodiment, after the discriminant model is obtained, a domain adaptation module may be added on the basis of the discriminant model to form a domain adaptation model, and the domain adaptation module is trained separately. The domain adaptation module may be a convolution module composed of a plurality of convolution layers, and may perform feature space mapping processing on the initial features output by the backbone network.
Specifically, the domain adaptation module in the domain adaptation model needs to be trained separately using the source domain data set and the target domain data set. In the training process, each source domain data and each target domain data need to be input into a domain adaptation module, and first, the initial characteristics of each input data can be extracted through a backbone network; further, the domain adaptation module performs feature space mapping processing on the initial features of each data to obtain the target features of each data.
Exemplarily, referring to fig. 4, fig. 4 is a schematic diagram of a training process of a domain adaptation model provided by the embodiment of the present disclosure, where parameters of a backbone network, a prediction output module, and a domain discriminator are frozen, and source domain data and target domain data may be input to the backbone network after being preprocessed, and then after an initial feature is extracted by the backbone network, a target feature is extracted by a domain adaptation module.
And S230, determining a prediction domain classification label and a prediction identification label of each source domain data based on the target feature, the domain discriminator and the prediction output module of each source domain data, and determining a prediction domain classification label of each target domain data based on the target feature and the domain discriminator of each target domain data.
Specifically, in the training process of the domain adaptation module in the domain adaptation model, further, the target features of each source domain data and each target domain data may be input to the domain discriminator and the prediction output module, respectively, the prediction domain classification labels of each source domain data and each target domain data are output through the domain discriminator, and the prediction identification labels of each source domain data are output through the prediction output module.
S240, adjusting parameters in the domain adaptation module based on the prediction domain classification label of each source domain data, the prediction identification label of each source domain data and the prediction domain classification label of each target domain data.
Specifically, in the training process of the domain adaptation module in the domain adaptation model, further, the loss may be calculated according to the predicted domain classification label of each source domain data, the predicted identification label of each source domain data, and the predicted domain classification label of each target domain data, and the parameters in the domain adaptation module may be adjusted according to the loss calculation result.
For example, the loss may be calculated only according to the preset domain classification label and the predicted domain classification label of each source domain data and each target domain data, and the parameters in the domain adaptation module may be adjusted according to the loss calculation result; or, the domain classification loss can be calculated according to the preset domain classification label and the predicted domain classification label of each source domain data and each target domain data, meanwhile, the model identification loss is calculated according to the preset identification label and the predicted identification label of each source domain data, and the parameters in the whole domain adaptation module are adjusted according to the domain classification loss and the model identification loss.
In a specific embodiment, adjusting parameters in the domain adaptation module based on the predicted domain classification label of each source domain data, the predicted identification label of each source domain data, and the predicted domain classification label of each target domain data may include the following steps:
step 11, acquiring preset domain classification labels of each source domain data and each target domain data;
step 12, determining a first domain classification loss based on the preset domain classification label and the prediction domain classification label of each source domain data, and determining a second domain classification loss based on the preset domain classification label and the prediction domain classification label of each target domain data;
step 13, determining model identification loss based on preset identification tags and predicted identification tags of each source domain data;
and step 14, adjusting parameters in the domain adaptation module according to the first domain classification loss, the second domain classification loss and the model identification loss.
In step 11, the preset domain classification label of each source domain data and the preset domain classification label of each target domain data may be set to the same value, for example, the preset domain classification labels of all target domain data and source domain data are set to 1.
It should be noted that the purpose of this arrangement is: and taking the domain classification loss of the domain discriminator calculated based on the preset domain classification label as an evaluation index for the alignment of the feature spaces of the target domain and the source domain, and adjusting the parameters of the domain adaptation module according to the domain classification loss of the domain discriminator so that the feature space of the target domain processed by the domain adaptation module is aligned to the feature space of the source domain.
After the preset domain classification labels of the source domain data and the preset domain classification labels of the target domain data are set to be the same numerical value, a gradient overturning layer is not required to be arranged in front of the domain discriminator. Compared with a mode of setting a gradient overturning layer and propagating after multiplying the gradient of the domain classification loss calculation by-1 through the gradient overturning layer, the method has the advantages that the structural complexity of the domain adaptation model is reduced while the characteristic space mapping capability of the domain adaptation module is ensured.
Further, in the step 12, a first domain classification loss is calculated according to the preset domain classification label of each source domain data and the prediction domain classification label of each source domain data; and calculating the second domain classification loss according to the preset domain classification label of each target domain data and the prediction domain classification label of each target domain data.
In step 13, the model identification loss is calculated based on the preset identification label of each source domain data and the predicted identification label of each source domain data. The first domain classification loss, the second domain classification loss, and the model identification loss may be cross entropy loss, L1 norm loss, mean square error loss, or binary cross entropy loss, which is not limited in this embodiment.
Further, in step 14, the parameters in the domain adaptation module are adjusted according to the first domain classification loss, the second domain classification loss, and the model identification loss. As shown in fig. 4, a reverse gradient may be calculated according to the first domain classification loss, the second domain classification loss, and the model identification loss, and the feedback gradient is updated on the parameters in the domain adaptation module. Illustratively, the above three losses may be accumulated, and the inverse gradient may be calculated from the accumulated result.
The above-mentioned determining the target features of the target domain data and the source domain data, determining the predicted domain classification label and the predicted identification label according to the target features, calculating the loss, and adjusting the parameters in the domain adaptation module according to the loss may be regarded as an iterative process, and iterative training may be repeated until the domain classification loss and the model identification loss converge.
By the mode, the parameters in the domain adaptation module are optimized through back propagation based on the domain classification loss and the model identification loss, the domain adaptation module is ensured to be capable of continuously pulling in the feature space of the target domain data and the source domain data, and meanwhile, the feature after being mapped by the domain adaptation module is ensured to be capable of ensuring higher quality and higher model identification precision.
It should be noted that, in this embodiment, the pre-training model, the domain discriminator, and the domain adaptation module may be trained independently. In the process of pre-training model training, the domain discriminator and the domain adaptation module do not participate; in the training process of the domain discriminator, the domain adaptation module does not participate, and parameters of the backbone network and the prediction output module are frozen; in the process of training the domain adaptation module, parameters of the backbone network, the prediction output module and the domain discriminator are all frozen.
In a mode of performing feature extraction and feature space mapping by using a backbone network and performing optimization updating on parameters of the backbone network, a domain discriminator and a prediction output module based on loss, as parameter optimization adjustment relates to each module of the whole network, a training process is unstable and difficult to converge; moreover, optimization and updating of the backbone network and the domain discriminator are difficult to control, and if the capacity of one party is too high than that of the other party, the whole countermeasure system fails, and the aim of aligning features cannot be achieved.
Therefore, in order to avoid the above problems, the method provided by this embodiment may perform feature space mapping through the domain adaptation module, and the backbone network is responsible for extracting features related to the model prediction task, and does not need to be responsible for performing feature space mapping, thereby avoiding iterative training of the backbone network, and further solving the problems of instability and difficulty in convergence of the backbone network training process.
According to the domain adaptation model training method provided by the embodiment, the discrimination model comprising the backbone network, the prediction output module and the domain discriminator is obtained through the source domain data set and the target domain data set, the domain adaptation model is further constructed through the discrimination model, and the domain adaptation module is trained independently, so that the respective training of the domain discriminator and the domain adaptation model is realized, the domain adaptation module can realize the feature space alignment of the source domain data and the target domain data, the target domain data can be labeled through the domain adaptation model, the domain adaptation model is suitable for data under various scenes, artificial labeling is not needed, the labeling efficiency and the labeling quality are improved, and the labeling cost is reduced. Moreover, the feature space mapping by using the backbone network is avoided, the repeated iterative training of the backbone network is further avoided, the problem that the backbone network and the domain discriminator are difficult to optimize simultaneously is solved, the training efficiency is improved, and meanwhile, the model identification precision can be improved.
FIG. 5 is a flowchart of another domain adaptive model training method in an embodiment of the present disclosure. The method provides an exemplary illustration of the process of training the domain discriminant in the discriminant model based on the source domain dataset and the target and dataset, based on the above embodiments. As shown in fig. 5, the method may specifically include the following steps:
s510, determining a pre-training model based on the source domain data set, wherein the pre-training model comprises the backbone network and the prediction output module.
S520, constructing a discrimination model based on the pre-training model, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator.
S530, determining each splicing data and a preset domain classification label of each splicing data based on each source domain data in the source domain data set and each target domain data in the target domain data set.
The splicing data may only include the source domain data, may only include the target domain data, and may also include both the source domain data and the target domain data.
In this embodiment, one source domain data may be randomly selected from the source domain data set, one target domain data may be randomly selected from the target domain data set, and the selected data may not be selected any more; further, randomly selecting partial data from the currently selected source domain data and the currently selected target domain data to form spliced data.
In a specific embodiment, determining each splicing data and a preset domain classification label of each splicing data based on each source domain data in the source domain data set and each target domain data in the target domain data set may include the following steps:
step 21, respectively acquiring current source domain data and current target domain data from the source domain data set and the target domain data set;
step 22, respectively performing segmentation processing on the current source domain data and the current target domain data to obtain a preset number of first segmentation results corresponding to the current source domain data and a preset number of second segmentation results corresponding to the current target domain data;
step 23, determining splicing data based on a first number of first segmentation results and a second number of second segmentation results, wherein the sum of the first number and the second number is equal to a preset number;
and 24, determining the preset domain classification label of each splicing data.
In step 21, after the data in the source domain data set and the data in the target domain data set are scrambled, one source domain data set is randomly selected from the source domain data set as the current source domain data, and one target domain data set is randomly selected from the target domain data set as the current target domain data.
Further, in the above step 22, the current source domain data and the current target domain data are respectively segmented. The number of the segmentation results of the current source domain data and the current target domain number may be the same and equal to a preset number. Of course, the segmentation results of the current source domain data and the current target domain number may also be different, which is not limited in this embodiment.
Fig. 6 is a schematic diagram of a segmentation result of current source domain data and current target domain data according to an embodiment of the present disclosure. Referring to fig. 6, taking the point cloud data as an example, taking the origin of the sensor coordinate system as a center, the current source domain data and the current target domain data are divided into four parts. It is to be understood that image data may also be divided in this manner, and text data, voice data, and the like may be divided by length.
Further, a first number of first segmentation results and a second number of second segmentation results may be randomly selected, and the first number of first segmentation results and the second number of second segmentation results are combined to obtain the concatenated data. The value range of the first quantity is 0-preset quantity, the value range of the second quantity is 0-preset quantity, and the sum of the first quantity and the second quantity is equal to the preset quantity.
Exemplarily, referring to fig. 7, fig. 7 is a schematic diagram of composition of splicing data provided by an embodiment of the present disclosure, which illustrates several composition forms of splicing data; where 1 denotes the source domain and 0 denotes the target domain. Fig. 8 is a schematic diagram of the splicing data provided by the embodiment of the present disclosure, and referring to fig. 8, three types of splicing data are shown.
By the aid of the method, the determination of the spliced data based on the first segmentation result and the second segmentation result is realized, the spliced data is guaranteed to be composed of the preset number of segmentation results, the spliced data is guaranteed to be consistent with the source domain data and the target domain data in size, and the training precision of the domain discriminator is improved.
Specifically, the steps 21 to 23 may be repeated to determine a plurality of splicing data, and further, a preset domain classification label of each splicing data may be determined. The preset domain classification label of the splicing data can be determined according to the source domain of the data contained in the splicing data.
For example, if the concatenated data consists of 1 first division result and 3 second division results, the preset domain classification tag may be 1000, and if the concatenated data consists of 4 first division results and 0 second division results, the preset domain classification tag may be 1111.
For the step 24, in a specific implementation manner, the determining a preset domain classification label of each splicing datum may be: rasterizing the splicing data aiming at each splicing data to convert the splicing data into raster data contained in each raster; determining a domain code corresponding to each grid according to a source domain of the grid data contained in each grid; and determining preset domain classification labels of the splicing data based on the domain codes corresponding to the grids.
The source field of the raster data may be a field corresponding to data to which the raster data belongs. Specifically, the splicing data can be converted into the grid data of the HxW; further, for each grid, judging whether the grid data contained in the grid belongs to target domain data or source domain data, and determining a domain code corresponding to the grid, wherein if the grid data belongs to the source domain data, the domain code is 1; when the data belongs to the target domain, the domain code is 0, and when the data belongs to the source domain and the target domain (i.e. the raster data is mixed with the two kinds of data), the domain code is ignored. Further, the domain codes corresponding to all the grids are combined to obtain a preset domain classification label.
By the aid of the method, the preset domain classification labels of all the spliced data are accurately determined, training of the domain discriminator based on the spliced data can be further achieved, and domain discrimination capability of the domain discriminator is improved.
And S540, training a domain discriminator in the discrimination model according to the splicing data and the preset domain classification labels of the splicing data.
Specifically, each splicing data can be input to a discrimination model, the initial features of each splicing data are extracted through a backbone network of the discrimination model, and then the initial features of each splicing data are input to a domain discriminator to obtain a prediction domain classification label of each splicing data output by the domain discriminator, wherein the prediction domain classification label of each splicing data can be a prediction result of the domain discriminator on the domain classification of the splicing data; further, the classification loss of the domain discriminator is calculated according to the preset domain classification label and the predicted domain classification label of each splicing datum, and then the parameters of the domain discriminator are optimized and updated according to the classification loss until the convergence condition is met. The classification loss of the calculation domain discriminator may be a cross entropy classification loss of the calculation domain discriminator.
S550, constructing a domain adaptation model based on the discriminant model, determining initial characteristics of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determining target characteristics of each data based on a domain adaptation module in the domain adaptation model and the initial characteristics of each data.
And S560, determining a prediction domain classification label and a prediction identification label of each source domain data based on the target feature, the domain discriminator and the prediction output module of each source domain data, and determining a prediction domain classification label of each target domain data based on the target feature and the domain discriminator of each target domain data.
And S570, adjusting parameters in the domain adaptation module based on the prediction domain classification label of each source domain data, the prediction identification label of each source domain data and the prediction domain classification label of each target domain data.
According to the domain adaptive model training method provided by the embodiment, each spliced data is constructed through each source domain data and each target domain data, the preset domain classification label of each spliced data is determined, and then each spliced data and the preset domain classification label of each spliced data are adopted to train the domain discriminator, so that the trained domain discriminator can accurately distinguish the source domain data and the target domain data.
Fig. 9 is a schematic structural diagram of a data annotation device in an embodiment of the disclosure. As shown in fig. 9: the device includes: a model acquisition module 910 and a label determination module 920.
A model obtaining module 910, configured to obtain a domain adaptation model determined based on a source domain data set and a target domain data set, where the source domain data set includes each source domain data and a preset identification tag corresponding to each source domain data, and the target domain data set includes each target domain data;
a label determining module 920, configured to input each target domain data into the domain adaptation model, to obtain a predicted identification label corresponding to each target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
According to the data labeling device provided by the embodiment of the disclosure, the domain adaptation model constructed by the source domain data set and the target domain data set is obtained, the initial characteristics and the target characteristics of each target domain data are sequentially determined through the backbone network and the domain adaptation module in the domain adaptation model, and then the prediction identification label of the target domain data is determined according to the target characteristics, so that the labeling of each target domain data is realized, the data labeling device is suitable for the data sets in each new scene, manual labeling is not needed, the labeling efficiency and the labeling quality are improved, and the labeling cost is reduced. And the target characteristics are determined through the domain adaptation module in the domain adaptation model, so that the source domain data and the target domain data are aligned in the characteristic space through the domain adaptation module without being aligned in the characteristic space through a main network, the repeated training of the main network is avoided, and the problems that the training process of the main network is unstable and difficult to converge are solved.
On the basis of the foregoing embodiments, optionally, the model obtaining module 910 is specifically configured to: determining a discriminant model based on a source domain data set and a target domain data set, wherein the discriminant model comprises a backbone network, a prediction output module and a domain discriminator; a domain adaptation model is determined based on the discriminant model.
On the basis of the foregoing embodiments, optionally, the data labeling apparatus further includes a pseudo tag processing module, configured to determine, for a predicted identification tag corresponding to each target domain data, an identification tag feature corresponding to the predicted identification tag, determine whether the identification tag feature satisfies a preset feature screening condition, and if not, reject the predicted identification tag.
On the basis of the foregoing embodiments, optionally, the target domain data is point cloud data, text data, image data, or voice data.
The data labeling device provided in the embodiments of the present disclosure may perform the steps in the data labeling method provided in the embodiments of the present disclosure, and the steps and the beneficial effects are not repeated here.
Fig. 10 is a schematic structural diagram of a domain adaptive model training apparatus in an embodiment of the present disclosure. As shown in fig. 10: the device includes: a discriminant model determination module 1010, a domain adaptation model construction module 1020, a label determination module 1030, and a domain adaptation training module 1040.
A discriminant model determining module 1010, configured to determine a discriminant model based on a source domain data set and a target domain data set, where the discriminant model includes a backbone network, a prediction output module, and a domain discriminator, the source domain data set includes each source domain data and a preset identification tag corresponding to each source domain data, and the target domain data set includes each target domain data;
a domain adaptive model building module 1020, configured to build a domain adaptive model based on the discriminant model, determine initial features of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptive model, and determine target features of each data based on the domain adaptive model and the initial features of each data;
a label output module 1030, configured to determine a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator, and the prediction output module, and determine a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
the domain adaptation training module 1040 is configured to adjust parameters in the domain adaptation module based on the predicted domain classification label of each source domain data, the predicted identification label of each source domain data, and the predicted domain classification label of each target domain data.
The data labeling device provided by the embodiment of the disclosure obtains the discrimination models including the backbone network, the prediction output module and the domain discriminator through the source domain data set and the target domain data set, and further constructs the domain adaptation model through the discrimination models, and trains the domain adaptation module separately, thereby realizing the respective training of the domain discriminator and the domain adaptation model, the domain adaptation module can realize the feature space alignment of the source domain data and the target domain data, and can label the target domain data through the domain adaptation model, so that the data labeling device is suitable for the data under each scene, and does not need artificial labeling, thereby improving the labeling efficiency and the labeling quality, and reducing the labeling cost. Moreover, the feature space mapping by using the backbone network is avoided, the repeated iterative training of the backbone network is further avoided, the problem that the backbone network and the domain discriminator are difficult to optimize simultaneously is solved, the training efficiency is improved, and meanwhile, the model identification precision can be improved.
On the basis of the foregoing embodiments, optionally, the discriminant model determining module 1010 includes a pre-training model determining unit and a discriminant model determining unit, where;
a pre-training model determination unit, configured to determine a pre-training model based on a source domain data set, where the pre-training model includes the backbone network and the prediction output module;
and the discriminant model determining unit is used for constructing a discriminant model based on the pre-training model, and training a domain discriminant in the discriminant model according to the source domain data set and the target domain data set to obtain the trained discriminant model.
On the basis of the foregoing embodiments, optionally, the discriminant model determining unit is specifically configured to: determining splicing data and a preset domain classification label of each splicing data based on each source domain data in the source domain data set and each target domain data in the target domain data set; and training a domain discriminator in the discrimination model according to each splicing data and the preset domain classification label of each splicing data.
On the basis of the foregoing embodiments, optionally, the discriminant model determining unit is further configured to obtain current source domain data and current target domain data from the source domain data set and the target domain data set, respectively; respectively carrying out segmentation processing on the current source domain data and the current target domain data to obtain a preset number of first segmentation results corresponding to the current source domain data and a preset number of second segmentation results corresponding to the current target domain data; determining the stitching data based on a first number of the first segmentation results and a second number of the second segmentation results, wherein the sum of the first number and the second number is equal to the preset number; and determining a preset domain classification label of each splicing data.
On the basis of each of the foregoing embodiments, optionally, the discriminant model determining unit is further configured to perform rasterization processing on the splicing data for each of the splicing data, so as to convert the splicing data into raster data included in each of the grids; determining a domain code corresponding to each grid according to a source domain of the grid data contained in each grid; and determining a preset domain classification label of the splicing data based on the domain code corresponding to each grid.
On the basis of the foregoing embodiments, optionally, the domain adaptation training module 1040 is specifically configured to: acquiring preset domain classification labels of each source domain data and each target domain data; determining a first domain classification loss based on a preset domain classification label and a prediction domain classification label of each source domain data, and determining a second domain classification loss based on the preset domain classification label and the prediction domain classification label of each target domain data; determining model identification loss based on preset identification tags and predicted identification tags of each source domain data; adjusting parameters in the domain adaptation module according to the first domain classification loss, the second domain classification loss, and the model identification loss.
The domain adaptive model training device provided in the embodiments of the present disclosure may perform the steps in the domain adaptive model training method provided in the embodiments of the present disclosure, and the steps and the advantageous effects are not repeated here.
Fig. 11 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Referring now specifically to FIG. 11, a schematic diagram of a structure suitable for implementing an electronic device 1100 in an embodiment of the present disclosure is shown. The electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 11, electronic device 1100 may include a processing device (e.g., central processing unit, graphics processor, etc.) 1101, a Read Only Memory (ROM) 1102, a Random Access Memory (RAM) 1103, a bus 1104, an input/output (I/O) interface 1105, an input device 1106, an output device 1107, a storage device 1108, and a communication device 1109. A processing device may perform various suitable actions and processes to implement methods of embodiments as described in this disclosure in accordance with programs stored in Read Only Memory (ROM) 1102 or programs loaded from storage device 1108 into Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for the operation of the electronic device 1100 are also stored. The processing device 1101, the ROM1102, and the RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart, thereby implementing the data annotation method or the domain adaptation model training method as described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102. The computer program, when executed by the processing device 1101, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods of the embodiments.
Optionally, when the one or more programs are executed by the electronic device, the electronic device may further perform other steps described in the above embodiments.
Scheme 1, a data annotation method, the method comprising:
acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
inputting each target domain data into the domain adaptation model to obtain a prediction identification label corresponding to each target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
Scheme 2, the method according to scheme 1, wherein the obtaining of the domain adaptation model determined based on the source domain data set and the target domain data set includes:
determining a discriminant model based on a source domain data set and a target domain data set, wherein the discriminant model comprises a backbone network, a prediction output module and a domain discriminant;
a domain adaptation model is determined based on the discriminant model. .
In scheme 3, according to the method in scheme 1, after obtaining the predicted identification label corresponding to each target domain data output by the domain adaptation model, the method further includes:
and determining the identification tag characteristics corresponding to the predicted identification tags aiming at the predicted identification tags corresponding to each target domain data, judging whether the identification tag characteristics meet preset feature screening conditions, and if not, rejecting the predicted identification tags. .
Scheme 4, according to the method of scheme 1, the target domain data is point cloud data, text data, image data or voice data.
Scheme 5, a domain adaptive model training method, the method comprising:
determining a discrimination model based on a source domain data set and a target domain data set, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
constructing a domain adaptation model based on the discrimination model, determining initial characteristics of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determining target characteristics of each data based on a domain adaptation module in the domain adaptation model and the initial characteristics of each data;
determining a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator and the prediction output module, and determining a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and adjusting parameters in the domain adaptation module based on the prediction domain classification label of each source domain data, the prediction identification label of each source domain data and the prediction domain classification label of each target domain data.
Scheme 6, the method of scheme 5, wherein determining a discriminant model based on the source domain dataset and the target domain dataset comprises:
determining a pre-training model based on a source domain dataset, wherein the pre-training model comprises the backbone network and the prediction output module;
and constructing a discrimination model based on the pre-training model, and training a domain discriminator in the discrimination model according to the source domain data set and the target domain data set to obtain the trained discrimination model.
Scheme 7, the method of scheme 6, wherein training a domain discriminator in the discriminant model according to the source domain dataset and the target domain dataset includes:
determining splicing data and a preset domain classification label of each splicing data based on each source domain data in the source domain data set and each target domain data in the target domain data set;
and training a domain discriminator in the discrimination model according to the splicing data and the preset domain classification labels of the splicing data.
Scheme 8, the method according to scheme 7, wherein the determining, based on each of the source domain data in the source domain data set and each of the target domain data in the target domain data set, each of the splicing data and a preset domain classification label of each of the splicing data includes:
respectively acquiring current source domain data and current target domain data from the source domain data set and the target domain data set;
respectively carrying out segmentation processing on the current source domain data and the current target domain data to obtain a preset number of first segmentation results corresponding to the current source domain data and a preset number of second segmentation results corresponding to the current target domain data;
determining the stitching data based on a first number of the first segmentation results and a second number of the second segmentation results, wherein the sum of the first number and the second number is equal to the preset number;
and determining a preset domain classification label of each splicing data.
In scheme 9, the determining the preset domain classification label of each splicing data according to the method in scheme 8 includes:
rasterizing the splicing data aiming at each splicing data to convert the splicing data into raster data contained in each raster;
determining a domain code corresponding to each grid according to a source domain of the grid data contained in each grid;
and determining a preset domain classification label of the splicing data based on the domain code corresponding to each grid. .
Scheme 10, the method according to scheme 5, where the adjusting parameters in the domain adaptation module based on the predicted domain classification label of each source domain data, the predicted identification label of each source domain data, and the predicted domain classification label of each target domain data includes:
acquiring preset domain classification labels of each source domain data and each target domain data;
determining a first domain classification loss based on a preset domain classification label and a prediction domain classification label of each source domain data, and determining a second domain classification loss based on the preset domain classification label and the prediction domain classification label of each target domain data;
determining model identification loss based on preset identification tags and predicted identification tags of each source domain data;
adjusting parameters in the domain adaptation module according to the first domain classification loss, the second domain classification loss, and the model identification loss.
Scheme 11, a data annotation device, comprising:
the model acquisition module is used for acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification tag corresponding to each source domain data, and the target domain data set comprises each target domain data;
the label determining module is used for inputting the target domain data into the domain adaptation model to obtain a prediction identification label corresponding to the target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
Scheme 12, a domain adaptive model training apparatus, comprising:
the system comprises a discrimination model determining module, a prediction output module and a domain discriminator, wherein the discrimination model comprises a backbone network, the prediction output module and the domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
a domain adaptation model construction module, configured to construct a domain adaptation model based on the discrimination model, determine initial features of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determine target features of each data based on the domain adaptation module in the domain adaptation model and the initial features of each data;
a label output module, configured to determine a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator, and the prediction output module, and determine a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and the domain adaptation training module is used for adjusting parameters in the domain adaptation module based on the predicted domain classification label of each source domain data, the predicted identification label of each source domain data and the predicted domain classification label of each target domain data.
Scheme 13, an electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method as in any of scenarios 1-4 or 5-10.
Scenario 14, a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method according to any of scenarios 1-4 or 5-10.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A method of data annotation, the method comprising:
acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
inputting each target domain data into the domain adaptation model to obtain a prediction identification label corresponding to each target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
2. A method for training a domain adaptive model, the method comprising:
determining a discrimination model based on a source domain data set and a target domain data set, wherein the discrimination model comprises a backbone network, a prediction output module and a domain discriminator, the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
constructing a domain adaptation model based on the discrimination model, determining initial characteristics of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determining target characteristics of each data based on a domain adaptation module in the domain adaptation model and the initial characteristics of each data;
determining a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator and the prediction output module, and determining a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and adjusting parameters in the domain adaptation module based on the prediction domain classification label of each source domain data, the prediction identification label of each source domain data and the prediction domain classification label of each target domain data.
3. The method of claim 2, wherein determining a discriminant model based on the source domain dataset and the target domain dataset comprises:
determining a pre-training model based on a source domain dataset, wherein the pre-training model comprises the backbone network and the prediction output module;
and constructing a discrimination model based on the pre-training model, and training a domain discriminator in the discrimination model according to the source domain data set and the target domain data set to obtain the trained discrimination model.
4. The method of claim 3, wherein training a domain discriminator in the discriminant model from the source domain dataset and the target domain dataset comprises:
determining each splicing data and a preset domain classification label of each splicing data based on each source domain data in the source domain data set and each target domain data in the target domain data set;
and training a domain discriminator in the discrimination model according to the splicing data and the preset domain classification labels of the splicing data.
5. The method of claim 4, wherein determining the predetermined domain classification label for each splice data and each splice data based on each of the source domain data in the source domain data set and each of the destination domain data in the destination domain data set comprises:
respectively acquiring current source domain data and current target domain data from the source domain data set and the target domain data set;
respectively carrying out segmentation processing on the current source domain data and the current target domain data to obtain a preset number of first segmentation results corresponding to the current source domain data and a preset number of second segmentation results corresponding to the current target domain data;
determining the stitching data based on a first number of the first segmentation results and a second number of the second segmentation results, wherein the sum of the first number and the second number is equal to the preset number;
and determining a preset domain classification label of each splicing data.
6. The method of claim 5, wherein the determining a predetermined domain classification label for each of the concatenated data comprises:
rasterizing the splicing data aiming at each splicing data to convert the splicing data into raster data contained in each raster;
determining a domain code corresponding to each grid according to a source domain of the grid data contained in each grid;
and determining a preset domain classification label of the splicing data based on the domain code corresponding to each grid.
7. A data annotation device, comprising:
the model acquisition module is used for acquiring a domain adaptation model determined based on a source domain data set and a target domain data set, wherein the source domain data set comprises each source domain data and a preset identification label corresponding to each source domain data, and the target domain data set comprises each target domain data;
a label determining module, configured to input each target domain data into the domain adaptation model, and obtain a predicted identification label corresponding to each target domain data output by the domain adaptation model;
the domain adaptation model comprises a backbone network, a domain adaptation module, a domain discriminator and a prediction output module, wherein the backbone network is used for determining the initial characteristics of each target domain data, the domain adaptation module is used for determining the target characteristics of each target domain data according to the initial characteristics of each target domain data, and the prediction output module is used for determining the prediction identification label corresponding to each target domain data based on the target characteristics of each target domain data.
8. A domain adaptive model training apparatus, comprising:
the system comprises a discriminant model determining module, a domain discriminator and a data processing module, wherein the discriminant model comprises a backbone network, a prediction output module and a domain discriminator, the source domain data set comprises source domain data and preset identification tags corresponding to the source domain data, and the target domain data set comprises target domain data;
a domain adaptation model building module, configured to build a domain adaptation model based on the discriminant model, determine initial features of each data in the source domain data set and the target domain data set based on a backbone network in the domain adaptation model, and determine target features of each data based on the domain adaptation module in the domain adaptation model and the initial features of each data;
a label output module, configured to determine a prediction domain classification label and a prediction identification label of each source domain data based on the target feature of each source domain data, the domain discriminator, and the prediction output module, and determine a prediction domain classification label of each target domain data based on the target feature of each target domain data and the domain discriminator;
and the domain adaptation training module is used for adjusting parameters in the domain adaptation module based on the predicted domain classification label of each source domain data, the predicted identification label of each source domain data and the predicted domain classification label of each target domain data.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1 or 2-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 or 2-6.
CN202211404950.1A 2022-11-10 2022-11-10 Data labeling and domain adaptation model training method, device, equipment and medium Pending CN115661904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211404950.1A CN115661904A (en) 2022-11-10 2022-11-10 Data labeling and domain adaptation model training method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211404950.1A CN115661904A (en) 2022-11-10 2022-11-10 Data labeling and domain adaptation model training method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115661904A true CN115661904A (en) 2023-01-31

Family

ID=85020825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211404950.1A Pending CN115661904A (en) 2022-11-10 2022-11-10 Data labeling and domain adaptation model training method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115661904A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116403058A (en) * 2023-06-09 2023-07-07 昆明理工大学 Remote sensing cross-scene multispectral laser radar point cloud classification method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116403058A (en) * 2023-06-09 2023-07-07 昆明理工大学 Remote sensing cross-scene multispectral laser radar point cloud classification method
CN116403058B (en) * 2023-06-09 2023-09-12 昆明理工大学 Remote sensing cross-scene multispectral laser radar point cloud classification method

Similar Documents

Publication Publication Date Title
CN110379020B (en) Laser point cloud coloring method and device based on generation countermeasure network
CN110827312B (en) Learning method based on cooperative visual attention neural network
CN112132197A (en) Model training method, image processing method, device, computer equipment and storage medium
CN113657274B (en) Table generation method and device, electronic equipment and storage medium
CN107992937B (en) Unstructured data judgment method and device based on deep learning
CN112102424A (en) License plate image generation model construction method, generation method and device
CN112818951A (en) Ticket identification method
CN114329034A (en) Image text matching discrimination method and system based on fine-grained semantic feature difference
CN112668638A (en) Image aesthetic quality evaluation and semantic recognition combined classification method and system
CN114820871A (en) Font generation method, model training method, device, equipment and medium
CN114972847A (en) Image processing method and device
CN112884758A (en) Defective insulator sample generation method and system based on style migration method
CN112036514A (en) Image classification method, device, server and computer readable storage medium
CN115661904A (en) Data labeling and domain adaptation model training method, device, equipment and medium
CN114120413A (en) Model training method, image synthesis method, device, equipment and program product
CN114842524A (en) Face false distinguishing method based on irregular significant pixel cluster
CN110717068A (en) Video retrieval method based on deep learning
CN116994021A (en) Image detection method, device, computer readable medium and electronic equipment
CN113411550B (en) Video coloring method, device, equipment and storage medium
CN114037003A (en) Question-answer model training method and device and electronic equipment
CN113378723A (en) Automatic safety identification system for hidden danger of power transmission and transformation line based on depth residual error network
CN114639132A (en) Feature extraction model processing method, device and equipment in face recognition scene
CN116311275B (en) Text recognition method and system based on seq2seq language model
CN115565152B (en) Traffic sign extraction method integrating vehicle-mounted laser point cloud and panoramic image
CN114882224B (en) Model structure, model training method, singulation method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination