Method and apparatus for training medical model using data of multiple medical institutions
By desensitizing and implicitly encoding data among medical institutions, unique IDs are generated and medical knowledge is aggregated, solving the problem of medical data sharing and enabling efficient medical model training.
Patent Information
- Application Number
- CN202510287532.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-03-11
AI Technical Summary
Due to privacy concerns, medical data is difficult to share and utilize among multiple medical institutions, making federated learning model training complex and ineffective.
By anonymizing data from various medical institutions to generate unique patient IDs, and using a unified latent space coding model to convert plaintext medical record data into latent space medical knowledge, the medical model is finally aggregated and trained according to the patient dimension.
By effectively utilizing data from various medical institutions, the model training process was simplified, and the effectiveness of model training was improved.
Smart Images

Figure CN120221112B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer models and artificial intelligence, and particularly relates to a method and device for training a medical model using data from multiple medical institutions. BACKGROUND
[0002] Artificial intelligence technology is widely used in the medical field, covering diagnosis assistance, personalized treatment, drug development, patient monitoring, and other aspects. By analyzing medical images, patient genetic information, and lifestyle, personalized treatment plans can be provided for patients, accelerating the development of new drugs, and improving the efficiency and accuracy of patient monitoring.
[0003] Medical data contains rich disease and medical knowledge, but because medical data involves patient privacy information such as patient name, mobile phone number, and ID number, it is generally only retained in each medical institution and cannot be obtained through public channels. Moreover, since patients may visit multiple medical institutions, the medical data of the same patient may be distributed in multiple different medical institutions. Therefore, medical data is difficult to effectively utilize in model training.
[0004] Currently, the method of federated learning is usually used to train models using medical data, that is, first train models using respective medical data in different medical institutions, and then fuse all models. However, practice has proved that this technical solution not only has high complexity, but also has poor model training effect, which affects the development and application in the medical field. SUMMARY
[0005] In order to solve the problems in the prior art, the present application provides the following technical solutions.
[0006] The first aspect of the present application provides a method for training a medical model using data from multiple medical institutions, comprising:
[0007] Each medical institution performs desensitization processing on the medical data it saves respectively;
[0008] Each medical institution uses a unified latent space encoding model to encode the desensitized medical data, converting plaintext medical record data into medical knowledge in the latent space;
[0009] Gather the medical knowledge in the latent space of each medical institution and aggregate them, so that the data of the same patient in different medical institutions can be aggregated together;
[0010] Use the aggregated medical knowledge in the latent space to train a medical model.
[0011] Preferably, the de-identification of the respective saved medical data comprises generating a consistent and unique ID for each patient in each medical institution by a unified and irreversible encryption method, and replacing the patient's privacy information with the patient ID.
[0012] Preferably, the generating a consistent and unique ID for each patient in each medical institution by a unified and irreversible encryption method comprises:
[0013] Hash encoding the patient's ID number to generate a unique ID; for children without an ID number, Hash encoding the string of the mother's ID number plus the birth date to generate a unique ID.
[0014] Preferably, the aggregating the medical knowledge in the latent space of each medical institution and performing aggregation comprises: aggregating the medical knowledge in the latent space of each medical institution and performing aggregation according to the patient's ID.
[0015] Preferably, the latent space encoding model, when training, multiplies the output of each layer by a learnable parameter and sums it up before outputting on the basis of the residual connection between the layers of the Transformer model.
[0016] Preferably, the latent space encoding model, when training, the total loss function is:
[0017]
[0018] wherein:
[0019]
[0020]
[0021] wherein, L is the total number of layers of the latent space encoding model, l is a certain layer in the latent space encoding model, l = 1, 2,... L, a l is the weight of the sentence similarity loss of the lth layer, b l is the weight of the semantic similarity loss of the lth layer, is the total loss function, is the sentence similarity loss of the lth layer, is the semantic similarity loss of the lth layer, and g is the weight of is a global regularization term for controlling the distribution of the latent space representation, and l ij is the weight of the positive sample pair, l ik is the weight of the negative sample pair, i is the index of the current sample, j is the index of another sample that forms a positive sample pair with sample i, and k is the index of the negative sample, is the sentence representation of sample i at the lth layer, is a semantic representation of sample i at the l-th layer, is a sentence representation of sample j at the l-th layer, is a sentence representation of sample k at the l-th layer, is a semantic representation of sample j at the l-th layer, is a semantic representation of sample k at the l-th layer, τ is a temperature parameter, is a similarity of sample i and sample j at the sentence level of the l-th layer, is a similarity of sample i and sample k at the sentence level of the l-th layer, is a similarity of sample i and sample j at the semantic level of the l-th layer, is a similarity of sample i and sample k at the semantic level of the l-th layer, h is a set of embedding representation vectors of all samples, h i is an embedding representation of sample i; is a regularization term for controlling the distribution of semantic embeddings; λ is a weight of.
[0022] Preferably, the medical model is a medical text model, a medical image model, or a medical multi-modal model.
[0023] The second aspect of the present application provides a device for training a medical model using data of multiple medical institutions, comprising:
[0024] a data desensitization module configured to desensitize the medical data saved by each medical institution respectively;
[0025] a data encoding module configured to encode the desensitized medical data using a unified latent space encoding model by each medical institution, so as to convert the plaintext medical record data into medical knowledge in the latent space;
[0026] a knowledge aggregation module configured to aggregate and aggregate the medical knowledge in the latent space of each medical institution, so that the data of the same patient in different medical institutions can be aggregated together;
[0027] a medical model training module configured to train a medical model using the aggregated medical knowledge in the latent space.
[0028] The third aspect of the present application provides a memory storing a plurality of instructions, the instructions being used to implement the method for training a medical model using data of multiple medical institutions according to the first aspect.
[0029] The fourth aspect of the present application provides an electronic device comprising a processor and a memory connected to the processor, the memory storing a plurality of instructions, the instructions being loadable and executable by the processor to enable the processor to perform the method for training a medical model using data of multiple medical institutions according to the first aspect.
[0030] The beneficial effects of the present application are: the method and device for training a medical model using data from multiple medical institutions provided by the present application first desensitizes medical data from each medical institution, then extracts and encodes knowledge from the desensitized data of each medical institution through a unified latent space encoding model, converts plaintext medical record data into highly condensed, encoded medical knowledge in the latent space, and finally aggregates medical knowledge in the latent space according to the patient dimension, and uses the aggregated medical knowledge in the latent space to train the medical model. Therefore, by using the technical solutions of the present application, the medical data saved by each medical institution can be effectively utilized to complete the training of the medical model, and the problem of overall complexity and poor effect caused by training models separately by each medical institution and then fusing the models in the prior art is effectively solved. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 A flowchart of the method for training a medical model using data from multiple medical institutions according to the present application is shown.
[0032] Figure 2 A functional structure diagram of the device for training a medical model using data from multiple medical institutions according to the present application is shown. DETAILED DESCRIPTION
[0033] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the drawings in the specification and specific embodiments.
[0034] The method provided by the present application can be implemented in a terminal environment, which can include one or more of the following components: a processor, a memory, and a display screen. The memory stores at least one instruction, which is loaded and executed by the processor to implement the method described in the embodiments below.
[0035] The processor can include one or more processing cores. The processor connects various parts of the entire terminal through various interfaces and lines, executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory.
[0036] The memory can include random access memory (RAM) and read-only memory (ROM). The memory can be used to store instructions, programs, codes, code sets or instructions.
[0037] The display screen is used to display the user interface of each application program.
[0038] In addition, those skilled in the art can understand that the structure of the terminal described above does not constitute a limitation on the terminal, and the terminal can include more or fewer components, or combine certain components, or different component arrangements. For example, the terminal also includes radio frequency circuitry, input units, sensors, audio circuitry, power supplies, and the like, which are not described here.
[0039] Embodiment one
[0040] As Figure 1 shown, the embodiment of the present application provides a method for training a medical model using data of multiple medical institutions, comprising:
[0041] S101, each medical institution respectively performs desensitization processing on the medical data saved by itself;
[0042] S102, each medical institution respectively uses a unified latent space encoding model to encode the desensitized medical data, and converts the plaintext medical record data into medical knowledge in the latent space;
[0043] S103, the medical knowledge in the latent space of each medical institution is collected and aggregated, so that the data of the same patient in different medical institutions can be aggregated together;
[0044] S104, the medical model is trained using the aggregated medical knowledge in the latent space.
[0045] Since the medical data contains a huge amount of medical knowledge, the effective use of medical data is the key to training a medical model. However, the medical data contains private information such as the patient's name, mobile phone number, and ID number, which cannot be easily obtained. In the present application, in order to effectively use the medical data, first, each medical institution respectively performs desensitization processing on the medical data saved by itself, which can be specifically implemented as follows: a consistent and unique ID (Identity document, identity number) is generated for each patient in each medical institution through a unified and irreversible encryption method, and the patient ID is used to replace the patient's private information. More specifically, the patient's ID number can be encoded by Hash to generate a unique ID; for children without an ID number, the mother's ID number plus the birth date string is Hash encoded to generate a unique ID. Wherein, the patient's private information in the medical data is desensitized, and the desensitization rules include but are not limited to: using the patient ID to replace the patient's name, ID number, and other information.
[0046] In step S102, each medical institution respectively encodes the desensitization processed medical data using a unified latent space encoding model, converts the plaintext medical record data into medical knowledge in the latent space, and the converted medical knowledge is highly compressed and encoded, and the conversion process is irreversible, that is, the original medical record data cannot be restored from the medical knowledge in the latent space. Specifically, the following method can be used: the medical knowledge in the latent space of each medical institution is collected and aggregated according to the ID of the patient, so that the data of the same patient in different medical institutions can be aggregated together. The latent space encoding model used in the training can multiply the output of each layer by a learnable parameter and sum the outputs to output.
[0047] In the present application, the latent space encoding model is trained using the contrastive learning method, which maximizes the similarity between positive sample pairs and minimizes the similarity between negative sample pairs to learn the latent space. Since the target task of the latent space encoding model is to extract, compress and encode the knowledge contained in the text, in order to prevent the knowledge from being compressed too much, which makes it difficult for the subsequent medical model training to converge, the present application innovates and improves based on the Transformer architecture, using a new model layer linking method, that is, on the basis of the existing residual connection between layers, the output of each layer is multiplied by a learnable parameter and summed to output, so that the final output of the latent space encoding can utilize the characteristics of the shallow word sense level.
[0048] In a preferred embodiment of the present application, the latent space encoding model in training, the total loss function The following formula can be used for calculation:
[0049]
[0050] Wherein:
[0051]
[0052]
[0053] In the formula, L is the total number of layers of the latent space encoding model, l is a layer in the latent space encoding model, l = 1, 2,..., L, a l is the weight of the sentence similarity loss of the lth layer, b l is the weight of the semantic similarity loss of the lth layer, is the total loss function, is the sentence similarity loss of the lth layer, is the semantic similarity loss of the lth layer, and g is the weight of , is a global regularization term for controlling the distribution of the latent space representation, and l ij is the weight of the positive sample pair, and lik is the weight of the negative sample pair, i is the index of the current sample, j is the index of another sample that forms a positive sample pair with sample i, k is the index of the negative sample, is the sentence representation of sample i at the l-th layer, is the semantic representation of sample i at the l-th layer, is the sentence representation of sample j at the l-th layer, is the sentence representation of sample k at the l-th layer, is the semantic representation of sample j at the l-th layer, is the semantic representation of sample k at the l-th layer, τ is a temperature parameter, is the similarity of sample i and sample j at the sentence level of the l-th layer, is the similarity of sample i and sample k at the sentence level of the l-th layer, represents the similarity of sample i and sample j at the semantic level of the l-th layer, represents the similarity of sample i and sample k at the semantic level of the l-th layer, h is a set of embedding representation vectors of all samples, h i is the embedding representation of sample i; is a regularization term for controlling the distribution of semantic embeddings; λ is is the weight of the positive sample pair.
[0054] In the above method, by introducing different levels of sentence representations and semantic representations of samples, features of sentences and semantics can be extracted from different levels; by using the weight of the sentence similarity loss and the weight of the semantic similarity loss of different levels, the influence of different level features can be controlled, ensuring that the model can capture useful feature information at different levels; by introducing the weight of the positive sample pair and the weight of the negative sample pair, the contribution of different sample pairs can be flexibly adjusted. During training, the weight of the positive sample pair and the weight of the negative sample pair can be dynamically adjusted according to the distance or other metrics between samples, thereby increasing the learning ability of the model for difficult-to-distinguish samples. The regularization term is used to constrain the embedding representation in the hidden space, prevent the embedding representation from being too complex, and ensure the stability and rationality of the hidden space. Through the regularization term, the model can learn a more uniform and controllable hidden space representation. By calculating the similarity at the sentence level and the semantic level at the same time, it is ensured that the model can not only capture surface sentence information (such as word order and syntax), but also capture deep semantic information. It helps the model to better understand and process complex natural language tasks. By introducing the temperature parameter τ, the smoothness of the similarity distribution between positive and negative samples can be controlled, thereby adjusting the learning speed and difficulty of the model. A smaller τ can strengthen the learning of difficult-to-distinguish samples and increase the discriminative ability of the model.
[0055] In the present application, the medical model can be a medical text model, a medical image model or a medical multi-modal model.
[0056] Embodiment Two
[0057] As Figure 2 shown, another aspect of the present application also includes a functional module architecture completely consistent with the foregoing method flow, that is, the present application embodiment also provides an apparatus for training a medical model using data of multiple medical institutions, comprising:
[0058] a data desensitization module 201 for each medical institution to respectively desensitize the medical data saved by itself;
[0059] a data encoding module 202 for each medical institution to respectively encode the desensitized medical data using a unified latent space encoding model, converting plaintext medical record data into medical knowledge in a latent space;
[0060] a knowledge aggregation module 203 for aggregating and aggregating the medical knowledge in the latent space of each medical institution, so that the data of the same patient in different medical institutions can be aggregated together;
[0061] a medical model training module 204 for training a medical model using the aggregated medical knowledge in the latent space.
[0062] Further, in the data desensitization module, the desensitization processing of the medical data saved by itself includes: generating a consistent and unique ID for each patient in each medical institution through a unified and irreversible encryption method, and replacing the patient's privacy information with the patient ID.
[0063] Wherein, the consistent and unique ID for each patient in each medical institution is generated by a unified and irreversible encryption method, comprising:
[0064] Hash encoding the patient's ID number to generate a unique ID; for children without an ID number, use the mother's ID number plus the birth date string to generate a unique ID by Hash encoding.
[0065] Further, in the knowledge aggregation module, the aggregation of the medical knowledge in the latent space of each medical institution includes: aggregating the medical knowledge in the latent space of each medical institution and aggregating according to the patient's ID.
[0066] Wherein, the latent space encoding model, when training, multiplies the output of each layer by a learnable parameter and sums it up before outputting.
[0067] Further, the total loss function of the latent space encoding model when training is:
[0068]
[0069] wherein:
[0070]
[0071] wherein, L is the total number of layers of the latent space encoding model, l is a certain layer in the latent space encoding model, l = 1, 2, … L, a l is the weight of the sentence similarity loss of the l-th layer, b l is the weight of the semantic similarity loss of the l-th layer, is the total loss function, is the sentence similarity loss of the l-th layer, is the semantic similarity loss of the l-th layer, g is the weight of, is a regularization term for controlling the distribution of the latent space representation, l ij is the weight of the positive sample pair, l ik is the weight of the negative sample pair, i is the index of the current sample, j is the index of another sample that forms a positive sample pair with sample i, k is the index of the negative sample, is the sentence representation of sample i at the l-th layer, is the semantic representation of sample i at the l-th layer, is the sentence representation of sample j at the l-th layer, is the sentence representation of sample k at the l-th layer, is the semantic representation of sample j at the l-th layer, is the semantic representation of sample k at the l-th layer, t is a temperature parameter, is the similarity of sample i and sample j at the sentence level of the l-th layer, is the similarity of sample i and sample k at the sentence level of the l-th layer, represents the similarity of sample i and sample j at the semantic level of the l-th layer, represents the similarity of sample i and sample k at the semantic level of the l-th layer, h is a set of embedding representation vectors of all samples, h i is the embedding representation of sample i; is a regularization term for controlling the distribution of the semantic embedding; l is the weight of.
[0072] Further, in the medical model training module, the medical model is a medical text model, a medical image model, or a medical multi-modal model.
[0073] The device can be implemented by the method of training a medical model using data of multiple medical institutions provided in the above embodiment one. For specific implementation methods, refer to the description in embodiment one, which will not be repeated here.
[0074] The application further provides a memory storing a plurality of instructions for implementing the method for training a medical model by using data of multiple medical institutions according to the first embodiment.
[0075] The application further provides an electronic device comprising a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions which can be loaded and executed by the processor to enable the processor to perform the method for training a medical model by using data of multiple medical institutions according to the first embodiment.
[0076] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the embodiments by those skilled in the art once they learn of the basic inventive concepts. Therefore, the appended claims are intended to encompass within their scope all possible variations and modifications of the preferred embodiments. It is apparent that those skilled in the art can modify and adapt the present application in various ways without departing from the spirit and scope of the present application. It is therefore intended that the present application encompass all such modifications and variations as fall within the scope of the claims and their equivalents.
Claims
1. A method for training a medical model using data from multiple medical institutions, characterized in that, include: Each medical institution performs anonymization processing on its own stored medical data; Each medical institution uses a unified latent space coding model to encode the de-identified medical data, converting plaintext medical record data into latent space medical knowledge; By aggregating and integrating the hidden medical knowledge from various medical institutions, data on the same patient from different medical institutions can be combined. Train medical models using medical knowledge from the aggregated latent space; During training, the latent space coding model multiplies the output of each layer by learnable parameters and sums them up before outputting the result, based on the residual connections between the layers of the Transformer model. The latent space coding model, during training, has a total loss function. for: ; in: ; ; ; In the formula, This represents the total number of layers in the latent space coding model. This refers to a layer in the latent space coding model. , For the first Weights of layer sentence similarity loss. For the first The weights of the layer semantic similarity loss, For the total loss function, For the first Layer sentence similarity loss, For the first Layer semantic similarity loss, for The weight, This is a global regularization term used to control the distribution of the latent space representation. The weights of positive sample pairs, The weights for negative sample pairs, This is the index of the current sample. To be consistent with the sample The index of the other sample that forms a positive sample pair. Index for negative samples For the sample In the Sentence representation of layers, For the sample In the Semantic representation of layers, For the sample In the Sentence representation of layers, For the sample In the Sentence representation of layers, For the sample In the Semantic representation of layers For the sample In the Semantic representation of layers For temperature parameters, For the sample and samples In the Sentence-level similarity of layers For the sample and samples In the Sentence-level similarity of layers Indicates sample and samples In the Semantic similarity at the layer level Indicates sample and samples In the Semantic similarity at the layer level h Let be the set of embedding representation vectors for all samples. For the sample Embedded representation; This is a regularization term used to control the distribution of semantic embeddings; for The weight.
2. The method for training a medical model using data from multiple medical institutions as described in claim 1, characterized in that, The process of desensitizing the medical data stored by each institution includes: generating a consistent and unique ID for each patient in each medical institution using a unified and irreversible encryption method, and replacing the patient's privacy information with the patient ID.
3. The method for training a medical model using data from multiple medical institutions as described in claim 2, characterized in that, The method of generating a consistent and unique ID for each patient across all medical institutions using a unified and irreversible encryption method includes: The patient's ID number is hashed to generate a unique ID; for children without ID numbers, their mother's ID number plus the string of their birth date is hashed to generate a unique ID.
4. The method for training a medical model using data from multiple medical institutions as described in claim 2, characterized in that, The aggregation of medical knowledge from the hidden spaces of various medical institutions includes: aggregating medical knowledge from the hidden spaces of various medical institutions according to the patient's ID.
5. The method for training a medical model using data from multiple medical institutions as described in claim 1, characterized in that, The medical model can be a medical text model, a medical image model, or a medical multimodal model.
6. An apparatus for training a medical model using data from multiple medical institutions, the apparatus being used to perform the method for training a medical model using data from multiple medical institutions as described in any one of claims 1-5, characterized in that, include: The data anonymization module is used by each medical institution to anonymize its own stored medical data. The data encoding module is used by various medical institutions to encode the desensitized medical data using a unified latent space encoding model, converting plaintext medical record data into latent space medical knowledge. The knowledge aggregation module is used to collect and aggregate medical knowledge from the hidden space of various medical institutions, so that the data of the same patient in different medical institutions can be aggregated together. The medical model training module is used to train medical models using medical knowledge from the aggregated latent space.
7. A memory, characterized in that, The system stores multiple instructions for implementing the method for training a medical model using data from multiple medical institutions as described in any one of claims 1-5.
8. An electronic device, characterized in that, The device includes a processor and a memory connected to the processor, the memory storing a plurality of instructions that can be loaded and executed by the processor to enable the processor to perform the method for training a medical model using data from multiple medical institutions as described in any one of claims 1-5.
Citation Information
Patent Citations
Data decryption sharing method and device, equipment and medium
CN114611143A
Knowledge question and answer model training method, knowledge question and answer method and related device
CN118520294A