Domain adaptation method and device based on disease hierarchical coding
Through the domain adaptation method based on disease-level coding, a text classification model adapted to different data sources is generated, which solves the problem of inconsistent label space in the existing technology, and improves the migration ability and classification accuracy of the model.
Patent Information
- Application Number
- CN202210038894.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-01-13
AI Technical Summary
The existing text classification method encounters the problem of inconsistent label space in transfer learning, which leads to poor performance of the model on different data sources, limiting its application in the field of medical big data.
The domain adaptation method based on disease-level coding is adopted, and by obtaining text data of the source domain and the target domain, a classification loss function, a spatial distance minimization loss function and a domain discriminant loss function are generated, and an artificial intelligence model is established to adapt to the target domain.
It improves the accuracy of text classification, solves the limitation of label space consistency, and realizes the maximum utilization of text data when multiple data sources jointly train models, obtains a model with good migration capabilities, and reduces the need for retraining the model on other data sources.
Smart Images

Figure CN114386517B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the medical field, and in particular to a domain adaptation method and device based on disease hierarchical coding. Background Art
[0002] In recent years, deep learning algorithms have achieved remarkable results in the fields of natural language processing, image processing, and speech recognition. Compared with traditional machine learning methods, deep learning algorithms can capture the semantic information of texts, and do not require tedious feature engineering. As long as there is enough training data, good results can be achieved. At present, some technicians have tried to use deep learning methods to classify diseases in medical texts. Deep learning is widely used in the medical field, among which text classification methods for medical record data are crucial for clinical auxiliary diagnosis. Existing text classification methods first vectorize the text information in medical record data, and then learn the relationship between the vectorized representation of the text and the disease label to obtain a classification model. However, the model obtained in this way has poor transfer ability, that is, the model trained based on a certain source data often performs poorly on other source data. Various methods have been proposed to address this problem, among which the most commonly used is the domain adaptation method in transfer learning.
[0003] The existing method is to transfer the knowledge learned from a certain dataset to another dataset with different data distribution to complete the same task.
[0004] Although this method can effectively solve the problem of text classification of data from different sources, it requires that the category labels of the source domain and the target domain must be the same. This requires the model to be retrained after a new data source is added. Moreover, as data from different data sources are added, the number of overlapping disease categories becomes smaller and smaller, which greatly limits the application of transfer learning in the field of medical big data. Summary of the invention
[0005] In view of the above problems, the present application is proposed to provide a domain adaptation method and device based on disease hierarchical coding that overcomes the limitation problem of label space consistency when using data from different sources or at least partially solves the above problems, including:
[0006] A domain adaptation method based on disease hierarchical coding, comprising: the method is applied in the medical field to adapt a source domain to a target domain, wherein the source domain and the target domain are disease hierarchical codings of different label types, the method comprising:
[0007] Acquire source domain text data and target domain text data, and respectively determine a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data;
[0008] Generate a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector;
[0009] Establishing an artificial intelligence model according to the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function;
[0010] The source domain adapted to the target domain is determined by the artificial intelligence model.
[0011] Preferably, the step of generating the source domain feature and the target domain feature based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain feature and the target domain feature comprises:
[0012] Generating the classification loss function by classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes;
[0013] Generating the source domain feature and the target domain feature according to the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function according to the source domain feature and the target domain feature;
[0014] The domain discrimination loss function is generated according to the feature space data of the source domain text vector and the feature space data of the target domain text vector.
[0015] Preferably, the step of generating the classification loss function by classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes comprises:
[0016] Classifying the source domain text vector by using the disease level coding label corresponding to the source domain text vector to generate a text vector with a source domain label;
[0017] Classifying the target domain text vector by using the disease level coding label corresponding to the target domain text vector to generate a text vector with a target domain label;
[0018] Substitute the text vector with the source domain label and the text vector with the target domain label into a preset formula to obtain a classification loss function.
[0019] Preferably, the step of generating the source domain feature and the target domain feature based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain feature and the target domain feature comprises:
[0020] Converting the source domain text vector into a source domain overall feature space, and converting the target domain text vector into a target domain overall feature space;
[0021] The overall feature space of the source domain and the overall feature space of the target domain are calculated using the maximum mean difference to obtain an overall space distance minimization loss function;
[0022] Convert each category vector in the source domain text vector into a source domain local feature space, and convert each category vector in the target domain text vector into a target domain local feature space;
[0023] The local feature space of the source domain and the local feature space of the target domain are calculated using the maximum mean difference to obtain a local space distance minimization loss function;
[0024] The overall spatial distance minimization loss function and the local spatial distance minimization loss function are adjusted in proportion to obtain the spatial distance minimization loss function.
[0025] Preferably, the step of generating the domain discrimination loss function according to the feature space data of the source domain text vector and the feature space data of the target domain text vector comprises:
[0026] Classification is performed based on the feature space data of the source domain text vector and the feature space data of the target domain text vector to generate a domain discrimination loss function.
[0027] Preferably, the step of generating a domain discrimination loss function by classifying the feature space data of the source domain text vector and the feature space data of the target domain text vector comprises:
[0028] Substituting the feature space data of the source domain text vector and the feature space data of the target domain text vector into a preset domain discrimination formula for classification to obtain a domain label;
[0029] Substituting the domain label into the preset loss formula, a domain discrimination loss function is obtained.
[0030] Preferably, the step of establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function comprises:
[0031] Determining a model target loss function according to the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function;
[0032] The artificial intelligence model is generated according to the model objective loss function and the preset network structure.
[0033] To implement a domain adaptation device based on disease hierarchical coding of the present application, the device is applied to adapt a source domain to a target source in the medical field, wherein the source domain and the target domain are disease hierarchical codings of different label types, and the device includes:
[0034] A text vector generation module, used to obtain source domain text data and target domain text data, and respectively determine a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data;
[0035] A domain discrimination loss function generating module, used to generate a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector;
[0036] An artificial intelligence model building module, used to build an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function;
[0037] A correspondence determination module is used to determine the source domain that is adapted to the target domain through the artificial intelligence model.
[0038] To implement the present application, a computer device is also included, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the domain adaptation method based on disease hierarchy coding is implemented.
[0039] To implement the present application, a computer-readable storage medium is also included, on which a computer program is stored. When the computer program is executed by a processor, the steps of the domain adaptation method based on disease hierarchy coding are implemented.
[0040] This application has the following advantages:
[0041] In an embodiment of the present application, by acquiring source domain text data and target domain text data, and respectively determining the source domain text vector corresponding to the source domain text data, and the target domain text vector corresponding to the target domain text data; generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function; determining the source domain adapted to the target domain through the artificial intelligence model. The accuracy of text classification can be improved by disease level coding classification; and the application of domain adaptation of disease level coding solves the limitation of label space consistency when using data from different sources, so when multiple data sources jointly train the model, the text data can be used to the maximum extent to obtain a model with good migration ability; since the present application breaks through the limitation of label space consistency, when the model is migrated to other data sources for the second time, there is no need to retrain the model, which improves the efficiency of developing auxiliary diagnosis systems and reduces development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 is a flowchart of a domain adaptation method based on disease hierarchical coding provided by an embodiment of the present application;
[0044] Figure 2 It is a structural block diagram of a domain adaptation device based on disease hierarchical coding provided by an embodiment of the present application;
[0045] Figure 3 It is a structural diagram of a domain adaptation method based on disease hierarchical coding provided in one embodiment of the present application;
[0046] Figure 4 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the objects, features and advantages of the present application more obvious and understandable, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0048] It should be noted that in any embodiment of the present invention, the source domain is adapted to the target domain in the medical field, wherein the source domain and the target domain are disease hierarchical codes of different label types.
[0049] Reference Figure 1 , shows a domain adaptation method based on disease hierarchical coding provided by an embodiment of the present application, the method comprising:
[0050] S110, acquiring source domain text data and target domain text data, and respectively determining a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data;
[0051] S120, generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector;
[0052] S130, establishing an artificial intelligence model according to the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function;
[0053] S140: Determine the source domain adapted to the target domain through the artificial intelligence model.
[0054] In an embodiment of the present application, by acquiring source domain text data and target domain text data, and respectively determining the source domain text vector corresponding to the source domain text data, and the target domain text vector corresponding to the target domain text data; generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function; determining the source domain adapted to the target domain through the artificial intelligence model. The accuracy of text classification can be improved by disease level coding classification; and the application of domain adaptation of disease level coding solves the limitation of label space consistency when using data from different sources, so when multiple data sources jointly train the model, the text data can be used to the maximum extent to obtain a model with good migration ability; since the present application breaks through the limitation of label space consistency, when the model is migrated to other data sources for the second time, there is no need to retrain the model, which improves the efficiency of developing auxiliary diagnosis systems and reduces development costs.
[0055] Next, a domain adaptation method based on disease level coding in this exemplary embodiment will be further described.
[0056] As described in step S110, source domain text data and target domain text data are acquired, and a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data are determined respectively.
[0057] In one embodiment of the present invention, the specific process of "obtaining source domain text data and target domain text data, and respectively determining a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data" in step S110 can be further explained in combination with the following description.
[0058] As described in the following steps, the source domain text data and the target domain text data are converted into vector representations, that is, the input source domain text data and the target domain text data are mapped to a specific feature space, and then the source domain text vector and the target domain text vector are respectively classified by the disease level coding label, and the source domain text vector and the target domain text vector are domain discriminated to distinguish which domain the data comes from. This step corresponds to the text vector generation module, through which the text data can convert the input text into a vector representation, that is, the input data is mapped to a specific feature space.
[0059] As described in step S120, a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance are generated based on the source domain text vector and the target domain text vector.
[0060] In one embodiment of the present invention, the specific process of "generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector in step S120" can be further explained in combination with the following description.
[0061] As described in the following steps, the classification loss function is generated by classifying the source domain text vector and the target domain text vector respectively through corresponding disease hierarchy codes; the source domain features and the target domain features are generated based on the source domain text vector and the target domain text vector, and the spatial distance minimization loss function is generated based on the source domain features and the target domain features; the domain discrimination loss function is generated based on the feature space data of the source domain text vector and the feature space data of the target domain text vector.
[0062] In one embodiment of the present invention, the specific process of the step of "generating the classification loss function by classifying the source domain text vector and the target domain text vector according to the corresponding disease level encoding" can be further explained in combination with the following description.
[0063] As described in the following steps, the source domain text vector is labeled and classified by the disease level coding label corresponding to the source domain text vector to generate a text vector with the source domain label; the target domain text vector is labeled and classified by the disease level coding label corresponding to the target domain text vector to generate a text vector with the target domain label; the text vector with the source domain label and the text vector with the target domain label are substituted into a preset formula to obtain a classification loss function.
[0064] As an example, based on the source domain text vector, the disease level coding label corresponding to the source domain text vector, the target domain text vector and the disease level coding label corresponding to the target domain text vector, the source domain and the target domain are generated with the same disease level coding label; and a classification loss function is established based on the disease level coding label that is the same as the source domain and the target domain.
[0065] In a specific embodiment, the data from the source domain text vector and the target domain text vector are classified respectively and predicted as accurately as possible. The characteristic of this step is that disease hierarchical coding is used, that is, multi-layer disease coding labels. The data obtained from the hospital will classify the diseases according to certain characteristics of the disease and the rules, and express them in a coded manner. The data coding of different hospitals will be different. The more coding bits, the more detailed the classification of the disease. For example, when the name of the disease is "acute bacillary dysentery", the corresponding six-digit code "A03.901" is used, and when the name of the disease is "bacillary dysentery", the corresponding six-digit code "A03.900" is used. Their six-digit codes are obviously different, and their four-digit codes are all "A03.9", and the section codes are all "A03", all of which belong to the section named "Intestinal Infectious Diseases". In order to avoid the problem of inconsistent category labels of the source domain text vector and the target domain text vector, the present application selects different levels of coding labels to calculate the classification loss. The preset formula is as follows, and the classification loss function is obtained:
[0066]
[0067] Among them, N is the number of samples, C is the total number of categories, and M is the total number of encoded labels. represents the weight of the i-th sample of the c-th category under the m-th encoding label, represents the actual output of the sample under the mth encoding label, Represents the probability of the sample in each category predicted by the model under the mth encoding label.
[0068] In a specific embodiment, the source domain text vector and the target domain text vector are predicted through disease hierarchical coding, and the one with the highest probability under a certain level of coding label is selected, thereby solving the problem of inconsistent category labels of the domain text vector and the target domain text vector.
[0069] In one embodiment of the present invention, the specific process of the step of "generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features" can be further explained in combination with the following description.
[0070] As described in the following steps, the source domain text vector is converted into the source domain overall feature space, and the target domain text vector is converted into the target domain overall feature space; the source domain overall feature space and the target domain overall feature space are calculated using the maximum mean difference to obtain the overall space distance minimization loss function.
[0071] As described in the following steps, a source domain overall feature and a target domain overall feature are generated based on the source domain text vector and the target domain text vector; and an overall spatial distance minimization loss function is generated based on the source domain overall feature and the target domain overall feature.
[0072] In a specific embodiment, the main purpose is to reduce the distance between the overall features learned by the source domain text vector and the target domain text vector, that is, to maximize domain confusion and make the distribution of the source domain and the target domain in the feature space as close as possible. Common methods use the maximum mean discrepancy (MMD) when calculating the distance in the domain space, that is, the overall space distance minimization loss function:
[0073]
[0074] Among them, M is the total number of encoded labels, is the source domain data under the mth encoding label, is the target domain data under the mth encoding label, G(·) is the mapping function, and is the text vector generation module in the present invention.
[0075] In one embodiment of the present invention, the specific process of the step of "generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features" can be further explained in combination with the following description.
[0076] As described in the following steps, each category vector in the source domain text vector is converted into a source domain local feature space, and each category vector in the target domain text vector is converted into a target domain local feature space; the source domain local feature space and the target domain local feature space are calculated using the maximum mean difference to obtain a local space distance minimization loss function.
[0077] As described in the following steps, a source domain local feature and a target domain local feature are generated according to the source domain text vector and the target domain text vector; a local space distance minimization loss function is generated according to the source domain local feature and the target domain local feature;
[0078] In a specific embodiment, this calculation method does not consider the category information when minimizing the domain difference. In addition to adopting the above-mentioned overall difference minimization method, the present application also minimizes the difference of subdomains in each category and assigns different weights to each class, that is, the source domain local features and the target domain local features are generated based on the source domain text vector and the target domain text vector; the local space distance minimization loss function is generated based on the source domain local features and the target domain local features. Reduce the distance between the local features learned by the source domain text vector and the target domain text vector, and the local space distance minimization loss function is as follows:
[0079]
[0080] Among them, C is the total number of categories, M is the total number of encoded labels, is the source domain data of the cth category under the mth encoding label, is the target domain data of the cth category under the mth encoding label.
[0081] In one embodiment of the present invention, the specific process of the step of "generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features" can be further explained in combination with the following description.
[0082] As described in the following steps, the overall spatial distance minimization loss function and the local spatial distance minimization loss function are proportionally adjusted to obtain the spatial distance minimization loss function.
[0083] As described in the following steps, the spatial distance minimization loss function is generated according to the global spatial distance minimization loss function and the local spatial distance minimization loss function.
[0084] In a specific embodiment, the spatial distance minimization loss function is:
[0085]
[0086] Among them, α is a hyperparameter that adjusts the proportion of overall and local losses.
[0087] In one embodiment of the present invention, the specific process of "generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector in step S120" can be further explained in combination with the following description.
[0088] As described in the following steps, the domain discrimination loss function is generated according to the feature space data of the source domain text vector and the feature space data of the target domain text vector. The domain discrimination loss function is generated by classifying the feature space data of the source domain text vector and the feature space data of the target domain text vector.
[0089] In one embodiment of the present invention, the specific process of the step of "generating a domain discrimination loss function by classifying according to the feature space data of the source domain text vector and the feature space data of the target domain text vector" can be further explained in combination with the following description.
[0090] As described in the following steps, the feature space data of the source domain text vector and the feature space data of the target domain text vector are substituted into a preset domain discrimination formula for classification to obtain domain labels; and the domain labels are substituted into a preset loss formula to obtain a domain discrimination loss function.
[0091] As described in the following steps, classification is performed based on the feature space data of the source domain text vector and the feature space data in the target domain text vector to generate domain labels; and a domain discrimination loss function is generated based on the domain labels.
[0092] In a specific embodiment, the input of this module is the text representation of the source domain and the target domain after the text representation module, and the main purpose is to classify the data in the feature space and to distinguish which domain the data comes from as much as possible. The preset loss formula is as follows, and the domain discrimination loss function is obtained:
[0093]
[0094] Among them, d i represents the i-th sample X i The binary label is used to indicate whether the sample comes from the source domain or the target domain, and G is the text representation module. The total domain discrimination loss function of this module is:
[0095]
[0096] Among them, n=1,…,n are source domain samples, and n=n+1,…,N are target domain samples.
[0097] As described in step S130, an artificial intelligence model is established based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function.
[0098] In one embodiment of the present invention, the specific process of "establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function" in step S130 can be further explained in combination with the following description.
[0099] As described in the following steps, the model target loss function is determined based on the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function; and the artificial intelligence model is generated based on the model target loss function and a preset network structure.
[0100] In a specific embodiment, the model objective loss function is:
[0101]
[0102] Among them, β is a model hyperparameter, which represents the proportion of domain discrimination loss in the model objective loss function, and also determines the strength of the desired domain confusion.
[0103] In a specific embodiment, if Figure 3 As shown, first obtain the source domain text data and the target domain text data, input the source domain text data and the target domain text data into the text vector generation module, and convert the source domain text data and the target domain text data into the source domain text vector corresponding to the source domain text data and the target domain text vector corresponding to the target domain text data. The source domain text vector and the target domain text vector are input into the classification loss function submodule, and the classification loss function is generated by the corresponding disease level coding. The source domain text vector and the target domain text vector are input into the domain discrimination loss function module to generate the domain discrimination loss function. The source domain text vector and the target domain text vector are input into the spatial distance minimization loss function submodule to generate the spatial distance minimization loss function, and finally the model target loss function is generated, and then the artificial intelligence model is generated in combination with the preset network structure. The preset network structure is an existing technology, that is, a commonly used network structure in this field, which will not be repeated here. As a result, the present application breaks through the limitation of consistent label space, so when the model is migrated to other data sources for the second time, there is no need to retrain the model, which improves the efficiency of developing auxiliary diagnosis systems and reduces development costs.
[0104] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0105] Reference Figure 2 , showing a domain adaptation device based on disease hierarchical coding provided by an embodiment of the present application;
[0106] Specifically include:
[0107] A text vector generation module 210, configured to obtain source domain text data and target domain text data, and to respectively determine a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data;
[0108] A domain discrimination loss function generating module 220 is used to generate a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector;
[0109] An artificial intelligence model building module 230, used to build an artificial intelligence model according to the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function;
[0110] The correspondence determination module 240 is used to determine the source domain that is adapted to the target domain through the artificial intelligence model.
[0111] In one embodiment of the present invention, the domain discrimination loss function generating module 220 includes:
[0112] A classification loss function submodule, used to generate the classification loss function by classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes;
[0113] A spatial distance minimization loss function submodule, used to generate the source domain feature and the target domain feature according to the source domain text vector and the target domain text vector, and to generate the spatial distance minimization loss function according to the source domain feature and the target domain feature;
[0114] The domain discrimination loss function module is used to generate the domain discrimination loss function according to the feature space data of the source domain text vector and the feature space data of the target domain text vector.
[0115] In one embodiment of the present invention, the classification loss function submodule includes:
[0116] A text vector module with source domain labels, used for classifying the source domain text vector by using the disease level coding label corresponding to the source domain text vector to generate a text vector with source domain labels;
[0117] A text vector module with a target domain label, used for classifying the target domain text vector by a disease level coding label corresponding to the target domain text vector to generate a text vector with a target domain label;
[0118] The classification loss function establishment submodule is used to substitute the text vector with the source domain label and the text vector with the target domain label into a preset formula to obtain a classification loss function.
[0119] In one embodiment of the present invention, the spatial distance minimization loss function submodule includes:
[0120] An overall feature submodule, used to convert the source domain text vector into a source domain overall feature space, and convert the target domain text vector into a target domain overall feature space;
[0121] An overall loss function submodule, used to calculate the overall feature space of the source domain and the overall feature space of the target domain using the maximum mean difference to obtain an overall space distance minimization loss function;
[0122] A local feature submodule, used to convert each category vector in the source domain text vector into a source domain local feature space, and convert each category vector in the target domain text vector into a target domain local feature space;
[0123] A local loss function submodule, used to calculate the local feature space of the source domain and the local feature space of the target domain using the maximum mean difference to obtain a local space distance minimization loss function;
[0124] The spatial distance minimization loss function submodule is used to adjust the proportion of the overall spatial distance minimization loss function and the local spatial distance minimization loss function to obtain the spatial distance minimization loss function.
[0125] In one embodiment of the present invention, the domain discrimination loss function module includes:
[0126] The domain discrimination loss function submodule is used to generate a domain discrimination loss function by classifying the feature space data of the source domain text vector and the feature space data of the target domain text vector.
[0127] A classification domain generation module is used to substitute the feature space data of the source domain text vector and the feature space data of the target domain text vector into a preset domain discrimination formula for classification to obtain a domain label;
[0128] The domain discrimination loss function submodule is used to substitute the domain label into a preset loss formula to obtain a domain discrimination loss function.
[0129] In one embodiment of the present invention, the artificial intelligence model building module 230 includes:
[0130] A model objective loss function module, used to determine a model objective loss function according to the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function;
[0131] The artificial intelligence model submodule is used to generate the artificial intelligence model based on the model target loss function and the preset network structure.
[0132] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0133] There are repeated operation steps in this specific embodiment and the above specific embodiment, and this specific embodiment is only briefly described. For other solutions, refer to the description of the above specific embodiment.
[0134] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0135] Reference Figure 4 , showing a computer device of a domain adaptation method based on disease hierarchical coding of the present application, which may specifically include the following:
[0136] The computer device 12 is in the form of a general-purpose computing device, and the components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processing unit 16).
[0137] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, an Audio Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0138] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0139] Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, which are configured to perform the functions of the various embodiments of the present application.
[0140] A program / utility 40 having a set (at least one) of program modules 42 may be stored in, for example, a memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0141] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, cameras, etc.), one or more devices that enable an operator to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through the I / O interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs)), wide area networks (WANs), and / or public networks (e.g., the Internet) through a network adapter 20. Figure 4 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.
[0142] The processing unit 16 executes various functional applications and data processing by running the program stored in the memory 28, for example, to implement the following steps provided in the embodiment of the present application: obtaining source domain text data and target domain text data, and respectively determining a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data; generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function; and determining the source domain adapted to the target domain through the artificial intelligence model.
[0143] That is, when the processing unit 16 executes the program, it realizes: acquiring source domain text data and target domain text data, and respectively determining a source domain text vector corresponding to the source domain text data, and a target domain text vector corresponding to the target domain text data; generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function; and determining the source domain adapted to the target domain through the artificial intelligence model.
[0144] In an embodiment of the present application, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a domain adaptation method based on disease level coding as provided in all embodiments of the present application.
[0145] That is, when the program is executed by the processor, it is implemented as follows: obtaining the current state data of the target insulation node, wherein the current state data includes the current image of the target insulation node, the acquisition time point of the current state data, and the location information of the current state data; determining the image segmentation path corresponding to the target insulation node based on the location information, and determining to generate the current segmented image set based on the image segmentation path of the target insulation node and the current image of the target insulation node; determining the first difference between each segmented image in the current segmented image set and each segmented image corresponding to the historical segmented image set closest to the current acquisition time point; wherein the historical segmented image set closest to the current acquisition time point is the segmented image set corresponding to the previous acquisition time point. A current segmented image set; and / or; a second difference situation determination module, used to determine the second difference situation of each segmented image in the current segmented image set and each corresponding segmented image in all historical segmented image sets; and / or; a third difference situation determination module, used to determine the third difference situation of each segmented image in the current segmented image set and each corresponding segmented image in each historical segmented image set within a preset number of times; confirming the current deformation situation of the target insulation joint based on the first difference situation and / or the second difference situation and / or the third difference situation; specifically, when the first difference situation and / or the second difference situation and / or the third difference situation exceeds a preset threshold, setting the current deformation situation of the target insulation joint to be repaired.
[0146] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0147] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0148] The computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the operator's computer, partially on the operator's computer, as an independent software package, partially on the operator's computer, partially on the remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the operator's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
[0149] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0150] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0151] The above is a detailed introduction to the domain adaptation method and device based on disease hierarchical coding provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A domain adaptation method based on disease hierarchical encoding, the method is applied to adapt a source domain to a target domain in the medical field, wherein: The source domain and the target domain are disease hierarchical codes of different label types, and the method includes: Acquire source domain text data and target domain text data, and respectively determine a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data; Generate a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; The step of generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector comprises: classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes to generate the classification loss function; generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features; classifying and generating a domain discrimination loss function based on the feature space data of the source domain text vector and the feature space data of the target domain text vector; The step of generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features, comprises: converting the source domain text vector into the source domain overall feature space, converting the target domain text vector into the target domain overall feature space; calculating the overall spatial distance minimization loss function using the maximum mean difference between the source domain overall feature space and the target domain overall feature space; converting each category vector in the source domain text vector into the source domain local feature space, converting each category vector in the target domain text vector into the target domain local feature space; calculating the local spatial distance minimization loss function using the maximum mean difference between the source domain local feature space and the target domain local feature space; adjusting the overall spatial distance minimization loss function and the local spatial distance minimization loss function to obtain the spatial distance minimization loss function; Establishing an artificial intelligence model according to the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function; The source domain adapted to the target domain is determined by the artificial intelligence model.
2. The domain adaptation method based on disease level coding according to claim 1, characterized in that: The step of generating the classification loss function by classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes comprises: Classifying the source domain text vector by using the disease level coding label corresponding to the source domain text vector to generate a text vector with a source domain label; Classifying the target domain text vector by using the disease level coding label corresponding to the target domain text vector to generate a text vector with a target domain label; Substitute the text vector with the source domain label and the text vector with the target domain label into a preset formula to obtain a classification loss function.
3. The domain adaptation method based on disease level coding according to claim 1, characterized in that: The step of classifying and generating a domain discrimination loss function based on the feature space data of the source domain text vector and the feature space data of the target domain text vector comprises: Substituting the feature space data of the source domain text vector and the feature space data of the target domain text vector into a preset domain discrimination formula for classification to obtain a domain label; Substituting the domain label into the preset loss formula, a domain discrimination loss function is obtained.
4. The domain adaptation method based on disease level coding according to claim 1, characterized in that: The step of establishing an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function comprises: Determining a model target loss function according to the classification loss function, the spatial distance minimization loss function, and the domain discrimination loss function; The artificial intelligence model is generated according to the model objective loss function and a preset network structure.
5. A domain adaptation device based on disease hierarchical coding, the device is used in the medical field to adapt a source domain to a target source, wherein: The source domain and the target domain are disease level codes of different label types, and the device comprises: A text vector generation module, used to obtain source domain text data and target domain text data, and respectively determine a source domain text vector corresponding to the source domain text data and a target domain text vector corresponding to the target domain text data; A domain discrimination loss function generating module, used to generate a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector; The step of generating a classification loss function corresponding to text relevance, a spatial distance minimization loss function corresponding to label type relevance, and a domain discrimination loss function corresponding to domain relevance based on the source domain text vector and the target domain text vector comprises: classifying the source domain text vector and the target domain text vector respectively through corresponding disease level codes to generate the classification loss function; generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features; classifying and generating a domain discrimination loss function based on the feature space data of the source domain text vector and the feature space data of the target domain text vector; The step of generating the source domain features and the target domain features based on the source domain text vector and the target domain text vector, and generating the spatial distance minimization loss function based on the source domain features and the target domain features, comprises: converting the source domain text vector into the source domain overall feature space, converting the target domain text vector into the target domain overall feature space; calculating the overall spatial distance minimization loss function using the maximum mean difference between the source domain overall feature space and the target domain overall feature space; converting each category vector in the source domain text vector into the source domain local feature space, converting each category vector in the target domain text vector into the target domain local feature space; calculating the local spatial distance minimization loss function using the maximum mean difference between the source domain local feature space and the target domain local feature space; adjusting the overall spatial distance minimization loss function and the local spatial distance minimization loss function to obtain the spatial distance minimization loss function; An artificial intelligence model building module, used to build an artificial intelligence model based on the classification loss function, the spatial distance minimization loss function and the domain discrimination loss function; A correspondence determination module is used to determine the source domain that is adapted to the target domain through the artificial intelligence model.
6. A computer device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the domain adaptation method based on disease level coding as described in any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the domain adaptation method based on disease level coding as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
method, device, system and medium for text information extraction based on Domain adaptation
CN108664589A
Medical record structured network cross-disease migration training method and device, medium and equipment
CN112927806A