Construction method and system of dynamic medical knowledge base
By improving the genetic program and K-BERT/DPCNN architecture and dynamically adjusting the model parameters, the adaptation problem of language models and classification models in heterogeneous medical data was solved, and fast search and high-accuracy medical knowledge base construction were achieved, which improved the adaptability and stability of the model.
Patent Information
- Application Number
- CN202510730410.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, language models and classification models find it difficult to quickly adapt to the knowledge extraction requirements of different scenarios when faced with heterogeneous medical record data, resulting in low efficiency in searching for optimal model parameters and limited generalization capabilities.
By improving the genetic program and comparing the fitness of model parameters, the mutation probability in the iterative process is dynamically adjusted, the mutation probability of high-fitness parameters is reduced to retain dominant features, and the mutation probability of medium-fitness parameters is increased to generate optimal model parameters. Combined with the K-BERT and DPCNN architectures, a dynamic medical knowledge base is constructed.
It significantly shortens the search time for optimal model parameters of language models and classification models, improves the adaptability to heterogeneous medical record data, ensures that the model maintains stable performance in multimodal scenarios, and improves the efficiency of building and expanding medical knowledge bases and the accuracy of extracting medical entities and relationships.
Smart Images

Figure CN120674092A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical knowledge base construction, and in particular to a method and system for constructing a dynamic medical knowledge base. Background Art
[0002] With the rapid development of precision medicine and smart healthcare, the medical field has placed higher demands on the dynamism, accuracy, and clinical adaptability of knowledge management. As the core foundation for clinical decision support, intelligent medical record analysis, and medical research, the construction of medical knowledge bases has become a key research focus.
[0003] In traditional medical knowledge modeling, natural language processing technologies, particularly deep learning-based models, have demonstrated strong potential in medical text analysis and processing. For example, BERT (Bidirectional Encoder Representations from Transformers), a pre-trained language model, effectively captures contextual semantics through bidirectional encoding, offering significant advantages in text representation. DPCNN (Deep Pyramid Convolutional Neural Networks for Text Categorization) excels in local feature extraction and classification. Combining BERT with DPCNN can enhance the accuracy and efficiency of medical text classification.
[0004] However, parameter optimization for key machine learning models, such as language models and classification models, often relies on grid search, random search, or fixed-learning-rate gradient descent strategies. These methods, lacking a dynamic parameter evaluation mechanism, result in inefficient optimal model parameter search and limited model generalization. This is particularly true when faced with heterogeneous medical record data, such as those containing temporal physiological indicators like blood pressure, heart rate, and temperature, along with descriptions of chief complaints, current medical histories, and tables of blood test results. These methods struggle to quickly adapt to the knowledge extraction needs of diverse scenarios.
[0005] Therefore, how to adjust the model parameters of the language model and classification model to improve their adaptability in the field of medical terminology is a technical problem that needs to be solved. Summary of the Invention
[0006] To this end, the present invention provides a method and system for constructing a dynamic medical knowledge base. By improving the genetic program and comparing the fitness of model parameters to model performance, the mutation probability in the iterative process is dynamically adjusted. For example, the mutation probability of parameters with high fitness is reduced to retain advantageous features, and the mutation probability of parameters with low fitness is increased to explore better solutions. This greatly shortens the search time for optimal model parameters of the language model and classification model, while improving the model's adaptability to heterogeneous medical record data, ensuring that the improved language model and classification model can maintain stable performance in multimodal scenarios, and improving the construction and expansion efficiency of the medical knowledge base.
[0007] To achieve the above objectives, the present invention proposes a method for constructing a dynamic medical knowledge base, comprising:
[0008] During the construction and training phase of the language model and the classification model, multiple model parameters are encoded and input into an improved genetic program. The improved genetic program adjusts the iterative mutation probability based on a comparison of multiple improved fitness values of the multiple model parameters and generates optimal model parameters.
[0009] During the use phase of the language model, the mapping annotation codes of the medical record data are generated into medical term codes through the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embedded with historical medical codes based on the medical record knowledge base;
[0010] During the use phase of the classification model, the medical terminology encoding is used to generate medical entity event relationships through the classification model with the optimal model parameters set, and the medical entity event relationships are constructed to expand the medical record knowledge base, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.
[0011] Furthermore, the process of adjusting the iterative mutation probability of the improved genetic program based on the comparison of multiple improved fitness of multiple model parameters includes:
[0012] The improved genetic program determines the important model parameters corresponding to the maximum improved fitness based on the comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the important model parameters to retain the elite model parameters in this iteration to the next iteration;
[0013] The improved genetic program determines the elite model parameters corresponding to the improved fitness within a set range based on a comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the elite model parameters based on a set attenuation coefficient, wherein the set range is smaller than the maximum improved fitness.
[0014] Furthermore, the process of adjusting the mutation probabilities corresponding to the important model parameters and the elite model parameters includes:
[0015] calculating an improved temporary fitness of each model parameter based on at least a medical entity-event relationship recognition accuracy index and a medical rule conflict index;
[0016] Adjusting the improved temporary fitness based on the historical medical entity event relationship of the medical record knowledge base to generate the improved fitness;
[0017] Calculate the ratio of the improved fitness corresponding to each model parameter to the improved fitness of the overall parameters to obtain the initial mutation probability;
[0018] Adjusting the initial mutation probability corresponding to the important model parameter to a set minimum value to generate the mutation probability corresponding to the important model parameter;
[0019] The mutation probability corresponding to the elite model parameter is determined based on the product of the negative exponential function of the set attenuation coefficient and the initial mutation probability.
[0020] Furthermore, the process of calculating the improved temporary fitness includes:
[0021] The improved temporary fitness is generated based on the weighted sum of the medical entity recognition balance loss item, the medical-medical relationship recognition balance loss item and the medical rule conflict index loss item, wherein the medical rule conflict index loss item is determined based on the number of matches between the medical rule base and the medical record data, and the medical entity-event relationship includes medical entities, medical events and medical-medical relationships.
[0022] Furthermore, the process of generating improved fitness includes:
[0023] The sample medical record data is input into the language model and classification model with set candidate model parameters to obtain a predicted medical entity event relationship set; it is determined whether the relationship between the predicted medical entity event relationship set and the historical medical entity event is an indication relationship or a contraindication relationship. If it is an indication relationship, the improved temporary fitness is increased to generate an improved fitness; if it is a contraindication relationship, the improved temporary fitness is reduced to generate an improved fitness.
[0024] In the above scheme, the mutation probability of important model parameters with high fitness is directly reduced to the minimum to ensure that they are retained in subsequent iterations. The mutation probability of elite model parameters with medium fitness is adjusted by a negative exponential function, which not only retains the stability of the advantageous parameters but also avoids local optimality. The improved fitness function significantly improves the fit between the model output and clinical practice, achieves the balance of medical entity and relationship extraction and compliance with medical rules, and improves the efficiency of converting the constructed medical knowledge base into medical scenarios.
[0025] Furthermore, the process of embedding the language model into historical medical codes based on the medical record knowledge base includes:
[0026] Retrieving associated historical medical entity event relationships in the medical record knowledge base, and encoding the historical medical entity event relationships to generate historical medical codes;
[0027] The historical medical codes are spliced with the mapping annotation codes generated based on the medical record data to generate a knowledge-enhanced code sequence, and the knowledge-enhanced code sequence is input into the language model to generate the medical term code.
[0028] Furthermore, the process of generating the mapping annotation code includes:
[0029] Build a medical term annotation dictionary based on the official medical terminology glossary;
[0030] The Word2Vec word vector model is used to determine similar words in the medical record data that are semantically close to the annotation dictionary, and the similar words are mapped to the mapping annotation code through ICD code.
[0031] Furthermore, the process of embedding the classification model into the medical course time series capture unit includes:
[0032] The medical course time series capture unit is set before the pyramid pooling layer of the classification model, and the time series convolution layer, ReLU activation function layer and pooling layer of the medical course time series capture unit are used to enhance the medical course time series sensitivity.
[0033] Furthermore, the temporal convolution layer adopts a dynamic scale convolution kernel to adapt to the length of medical terms.
[0034] The present invention also provides a system using the method for constructing a dynamic medical knowledge base, comprising:
[0035] A training module is used to encode multiple model parameters of the language model and classification model and input them into the improved genetic program during the construction and training phase. The improved genetic program adjusts the iterative mutation probability based on the comparison of the improved fitness of the multiple model parameters and generates the optimal model parameters;
[0036] a medical terminology code generation module, connected to the training module, for generating medical terminology codes from the mapping annotation codes of the medical record data using the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embeds historical medical codes from the medical record knowledge base;
[0037] A medical case knowledge base construction and expansion module is connected to the training module and the medical terminology coding generation module, and is used to generate medical entity event relationships from the medical terminology codes through the classification model with the optimal model parameters set during the use phase of the classification model, and to construct and expand the medical case knowledge base with the medical entity event relationships, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.
[0038] In the above solution, the language model and classification model are adapted to medical event descriptions of different lengths, and the accuracy of term mapping and relationship extraction is significantly higher than that of traditional methods.
[0039] Compared with the prior art, the present invention has the following advantages:
[0040] 1. By improving the genetic program and comparing the fitness of model parameters with model performance, the mutation probability in the iterative process is dynamically adjusted. For example, the mutation probability of parameters with high fitness is reduced to retain advantageous features, while the mutation probability of parameters with low fitness is increased to explore better solutions. This significantly shortens the search time for optimal model parameters of the language model and classification model, while improving the model's adaptability to heterogeneous medical record data. This ensures that the improved language model and classification model can maintain stable performance in multimodal scenarios, thereby improving the efficiency of building and expanding the medical knowledge base.
[0041] 2. For important model parameters with high fitness, the mutation probability is directly reduced to the minimum to ensure that they are retained in subsequent iterations. For elite model parameters with medium fitness, the mutation probability is adjusted using a negative exponential function, which not only retains the stability of the dominant parameters but also avoids local optimality. The improved fitness function significantly improves the fit between the model output and clinical practice, achieves the balance of medical entity and relationship extraction and compliance with medical rules, and improves the efficiency of converting the constructed medical knowledge base into medical scenarios.
[0042] 3. The language model and classification model are adapted to medical event descriptions of different lengths, and the accuracy of term mapping and relationship extraction is significantly higher than traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Schematic diagram of a flow chart of a method for constructing a dynamic medical knowledge base according to an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a mutation probability adjustment process of an improved genetic program in a method and system for constructing a dynamic medical knowledge base according to an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a flow chart of using a language model and a classification model in a method for constructing a dynamic medical knowledge base according to an embodiment of the present invention;
[0046] Figure 4 Schematic diagram of the structure of a system for constructing a dynamic medical knowledge base according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention.
[0048] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0049] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside", and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0050] Furthermore, it should be noted that, in the description of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0051] like Figures 1 to 4 As shown, the present invention provides a method and system for constructing a dynamic medical knowledge base. By improving the genetic program and comparing the fitness of model parameters to model performance, the mutation probability in the iterative process is dynamically adjusted. For example, the mutation probability of parameters with high fitness is reduced to retain advantageous features, and the mutation probability of parameters with low fitness is increased to explore better solutions. This greatly shortens the search time for optimal model parameters of the language model and classification model, and at the same time improves the model's adaptability to heterogeneous medical record data, ensuring that the improved language model and classification model can maintain stable performance in multimodal scenarios, thereby improving the construction and expansion efficiency of the medical knowledge base.
[0052] like Figures 1 to 4 As shown, this embodiment proposes a method for constructing a dynamic medical knowledge base, including:
[0053] During the construction and training phase of the language model and the classification model, multiple model parameters are encoded and input into an improved genetic program. The improved genetic program adjusts the iterative mutation probability based on a comparison of multiple improved fitness values of the multiple model parameters and generates optimal model parameters.
[0054] During the use phase of the language model, the mapping annotation codes of the medical record data are generated into medical term codes through the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embedded with historical medical codes based on the medical record knowledge base;
[0055] During the use phase of the classification model, the medical terminology encoding is used to generate medical entity event relationships through the classification model with the optimal model parameters set, and the medical entity event relationships are constructed to expand the medical record knowledge base, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.
[0056] It is understandable that the improved genetic program is used in the BERT-DPCNN model to adjust its hyperparameters and structural search parameters. Its core goal is to find the optimal model configuration, including learning rate, number of convolution kernels, number of layers, etc., rather than directly participating in the forward reasoning of the model. During the construction and training phase of the language model and classification model, the improved genetic program is first used to determine the optimal model parameters including learning rate, batch size, and number of DPCNN layers. The optimal model parameters are fixed during the training of the language model and classification model, and other model parameters (such as the CRF layer transfer matrix that directly determines the entity recognition effect and the entity classification threshold) are trained. At this time, the genetic algorithm has exited and no longer adjusts the parameters. The trained and tested language model and classification model are used to identify and classify new medical record data to generate entities, relationships, and events that conform to the format of the medical record knowledge base, and are stored in the medical record knowledge base to achieve the expansion and construction of the medical record knowledge base. Among them, the role of the improved genetic program is to balance model performance (F1 value) and clinical risk (number of matches with the medical rule base) to ensure that the knowledge base used to store medical records is adapted to the medical scenario and reliable.
[0057] like Figure 2 As shown, further, the process of adjusting the iterative mutation probability of the improved genetic program based on the comparison of multiple improved fitness of multiple model parameters includes:
[0058] The improved genetic program determines the important model parameters corresponding to the maximum improved fitness based on the comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the important model parameters to retain the elite model parameters in this iteration to the next iteration;
[0059] The improved genetic program determines the elite model parameters corresponding to the improved fitness within a set range based on a comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the elite model parameters based on a set attenuation coefficient, wherein the set range is smaller than the maximum improved fitness.
[0060] Preferably, the important model parameters are the model parameters with the greatest fitness, and the setting range of the elite model parameters is the model parameters with the second greatest fitness to the top 10%.
[0061] Therefore, the greater the improved fitness, the more significant the impact on the tasks of the language model and classification model. In turn, based on the degree of impact, the probability of mutation of the model parameters by the improved genetic program is reduced, thereby protecting the modeling ability of the language model and classification model for medical records.
[0062] like Figure 2 As shown, further, the process of adjusting the mutation probabilities corresponding to the important model parameters and the elite model parameters includes:
[0063] calculating an improved temporary fitness of each model parameter based on at least a medical entity-event relationship recognition accuracy index and a medical rule conflict index;
[0064] Adjusting the improved temporary fitness based on the historical medical entity event relationship of the medical record knowledge base to generate the improved fitness;
[0065] Calculate the ratio of the improved fitness corresponding to each model parameter to the improved fitness of the overall parameters to obtain the initial mutation probability;
[0066] Adjusting the initial mutation probability corresponding to the important model parameter to a set minimum value to generate the mutation probability corresponding to the important model parameter;
[0067] The mutation probability corresponding to the elite model parameter is determined based on the product of the negative exponential function of the set attenuation coefficient and the initial mutation probability.
[0068] Specifically, the optimization goals of the improved genetic program are medical record entity recognition (NER), temporal relationship recognition, and event recognition.
[0069] The iterative process of the improved genetic program is to encode the model parameters into a gene sequence. The model parameters and gene sequence include 8 or 12 BERT layers, 3, 5, or 7 DPCNN multi-scale convolution kernels, a learning rate of 1e-5 to 5e-5, a batch size of 5 to 7, 3 to 5 pyramid pooling layers, a weight decay coefficient of 0.01 to 0.05, a dropout probability of 0.2 to 0.4, and a time embedding dimension of 64 or 128 for the medical time series capture unit. Among them, the DPCNN multi-scale convolution kernel, the number of pyramid pooling layers, and the number of BERT layers directly affect feature extraction capabilities, the learning rate and batch size indirectly affect training stability, and the weight decay coefficient and dropout probability affect the model's generalization ability, determining whether it can fit a small number of rare disease case samples.
[0070] The process of genetic operation is as follows: randomly generate N gene individuals, N is preferably 50, covering different parameter combinations, calculate the improved mutation probability, select parent individuals according to the fitness ratio based on the mutation probability, retain high-quality genes, exchange parent gene fragments to generate offspring (crossover operation), and randomly adjust the gene value (mutation operation) with the mutation probability, and iterate the genetic operation until the number of iterations exceeds the upper limit or the improved fitness exceeds the set threshold.
[0071] Specifically, the calculation process of the initial mutation probability is:
[0072]
[0073] Where, P(gene i )base represents the gene sequence gene corresponding to the i-th model parameter i Initial mutation probability, Fitness i represents the improved fitness corresponding to the i-th model parameter, It represents the sum of the improved fitness of the model parameters of the number of training samples, that is, the overall parameter fitness.
[0074] Specifically, the process of determining the mutation probability corresponding to the elite model parameters is:
[0075]
[0076] Where, P base represents the initial mutation probability corresponding to the i-th elite model parameter, represents the mutation probability corresponding to the parameter of the elite model of item i, and λ represents the reduction coefficient, which is preferably 0.5, that is, reducing its initial mutation probability to 60% (e -0.5 ≈0.6). Therefore, the probability of random mutation of the elite model parameters can be reduced, avoiding the destruction of its optimized state.
[0077] Preferably, the set minimum value is 5%, the important model parameter is the model parameter with the largest fitness, and the setting range of the elite model parameter is the model parameter with the second largest fitness to the top 10%.
[0078] like Figure 2 As shown, further, the process of calculating the improved temporary fitness includes:
[0079] The improved temporary fitness is generated based on the weighted sum of the medical entity recognition balance loss item, the medical-medical relationship recognition balance loss item and the medical rule conflict index loss item, wherein the medical rule conflict index loss item is determined based on the number of matches between the medical rule base and the medical record data, and the medical entity-event relationship includes medical entities, medical events and medical-medical relationships.
[0080] Specifically, the improved temporary fitness is:
[0081]
[0082] Where, It represents the improved temporary fitness corresponding to the i-th model parameter, α, β, γ are three weighted coefficients, F1 NER represents the balanced loss term for medical entity recognition, F1 RE It represents the medical relationship identification balance loss item, Rule_Violation is the medical rule conflict indicator loss item, that is, the number of matches between the medical rule base and the medical record data based on the Rule loss function. For example, if the medical record data sample includes penicillin allergy patients (medical events) using (medical relationship) amoxicillin (medical entity), and the medical rule base includes amoxicillin-contraindications-penicillin, then the number of matches will be increased by one. Among them, γ is preferably 0.5, so its harm is greater, and α and β are preferably 0.25 respectively. Among them, F1 NER 、F1 RE They are the balance indicators of the precision and recall of entities / relations of language models and classification models respectively. The balance indicators are Where P is the precision rate (Precision), R is the recall rate (Recall). NER The calculation must meet the strict boundary matching of the medical entity. For example, the medical entity of non-small cell lung cancer must be completely identified. If it is partially matched, it will not be used for calculation.
[0083] like Figure 2 As shown, further, the process of generating improved fitness includes:
[0084] Inputting sample medical record data into the language model and classification model for setting candidate model parameters to obtain a predicted medical entity event relationship set;
[0085] Determine whether the relationship between the predicted medical entity event relationship set and the historical medical entity event is an indication relationship or a contraindication relationship. If it is an indication relationship, increase the improved temporary fitness to generate an improved fitness; if it is a contraindication relationship, reduce the improved temporary fitness to generate an improved fitness.
[0086] Specifically, the process of generating improved fitness is:
[0087]
[0088] In the formula, Fitness i represents the improved fitness corresponding to the i-th model parameter, It represents the improved temporary fitness corresponding to the i-th model parameter, and Score represents the adjustment score.
[0089] The calculation process of the adjusted score is:
[0090] Score=∑ 预测符合集 Score matching score -∑ 预测冲突集 Score penalty score
[0091] In the formula, Score represents the adjustment score, the predicted compliance set is the set of the predicted medical entity event relationship set that has an indication relationship with the historical medical entity event, and the predicted conflict set is the set of the predicted medical entity event relationship set that has a contraindication relationship with the historical medical entity event. Preferably, each element of the predicted compliance set adds 1 to the Score matching score, and each element of the predicted conflict set reduces the Score penalty score by 2.
[0092] In the above scheme, the mutation probability of important model parameters with high fitness is directly reduced to the minimum to ensure that they are retained in subsequent iterations. The mutation probability of elite model parameters with medium fitness is adjusted by a negative exponential function, which not only retains the stability of the advantageous parameters but also avoids local optimality. The improved fitness function significantly improves the fit between the model output and clinical practice, achieves the balance of medical entity and relationship extraction and compliance with medical rules, and improves the efficiency of converting the constructed medical knowledge base into medical scenarios.
[0093] like Figure 3 As shown, further, the process of embedding the language model into historical medical coding based on the medical record knowledge base includes:
[0094] Retrieving associated historical medical entity event relationships in the medical record knowledge base, and encoding the historical medical entity event relationships to generate historical medical codes;
[0095] The historical medical codes are spliced with the mapping annotation codes generated based on the medical record data to generate a knowledge-enhanced code sequence, and the knowledge-enhanced code sequence is input into the language model to generate the medical term code.
[0096] It can be understood that for each medical entity appearing in the text, the triple of its directly related historical medical entity event relationship is retrieved from the knowledge graph and dynamically inserted into the input sequence. For example: if the mapping annotation code is the patient allergic to penicillin, the historical medical code penicillin contraindication allergic patient is spliced with it to generate the medical term code.
[0097] like Figure 3 As shown, further, the process of generating the mapping annotation code includes:
[0098] Build a medical term annotation dictionary based on the official medical terminology glossary;
[0099] The Word2Vec word vector model is used to determine similar words in the medical record data that are semantically close to the annotation dictionary, and the similar words are mapped to the mapping annotation code through ICD code.
[0100] Specifically, the ICD code is preferably the ICD-10 / 11 code, which is also used to map historical medical entity event relationships to generate historical medical codes. The official medical terminology lists include UMLS (Unified Medical Language System) and SNOMED CT.
[0101] Furthermore, the process of embedding the classification model into the medical course time series capture unit includes:
[0102] The medical course time series capture unit is set before the pyramid pooling layer of the classification model, and the time series convolution layer, ReLU activation function layer and pooling layer of the medical course time series capture unit are used to enhance the medical course time series sensitivity.
[0103] Specifically, the medical process time series capture unit is:
[0104] X i =MaxPool1D(σ t (W t *ReLU(W c *X i-1 +b c )+b t ))
[0105] Where, X i Represents the features of the current layer of the input pyramid pooling layer, MaxPool1D represents the maximum pooling layer, pool_size is preferably 2, step size is preferably 2, ReLU represents the activation function layer, X i-1represents the features of the previous layer of the input pyramid pooling layer, σ t represents the temporal convolution layer, W t 、W c 、b c 、b t are all learnable parameters, where W c 、b c This is determined by the dynamic scale convolution kernel of the temporal convolution layer. It is understood that the temporal convolution layer adapts to medical terms of varying lengths, while the activation function layer enhances the classification model's ability to represent complex temporal sequences, such as the relationship between medical entities and medical events where medication leads to changes in test results. The pooling layer is used to retain key local features, such as the symptom keyword "persistent high fever."
[0106] Therefore, while maintaining the pyramid structure to expand the receptive field, DPCNN enhances its ability to capture sequence temporal dependencies, such as the sequential relationship between drug A and symptom B in medical texts. It is particularly suitable for text classification that requires attention to entity order.
[0107] Therefore, a medical course timing capture unit is inserted after each residual block before pyramid pooling, and feature extraction can be optimized in combination with a dynamic scale convolution kernel. The classification model of the DPCNN architecture can effectively capture the temporal dependencies and term length diversity in medical texts. The genetic algorithm further optimizes key parameters to achieve a balance between accuracy and efficiency.
[0108] Furthermore, the temporal convolution layer adopts a dynamic scale convolution kernel to adapt to the length of medical terms.
[0109] like Figure 4 As shown, this embodiment also provides a system for applying the method for constructing a dynamic medical knowledge base, including:
[0110] A training module is used to encode multiple model parameters of the language model and classification model and input them into the improved genetic program during the construction and training phase. The improved genetic program adjusts the iterative mutation probability based on the comparison of the improved fitness of the multiple model parameters and generates the optimal model parameters;
[0111] a medical terminology code generation module, connected to the training module, for generating medical terminology codes from the mapping annotation codes of the medical record data using the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embeds historical medical codes from the medical record knowledge base;
[0112] A medical case knowledge base construction and expansion module is connected to the training module and the medical terminology coding generation module, and is used to generate medical entity event relationships from the medical terminology codes through the classification model with the optimal model parameters set during the use phase of the classification model, and to construct and expand the medical case knowledge base with the medical entity event relationships, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.
[0113] It is understandable that K-BERT (Knowledge-enhanced BERT) is continued to be pre-trained on the medical record text to learn medical terms such as closed chest drainage and C-reactive protein. Add time embedding vector: Encode the examination time and medication time as vectors, and splice them with the text embedding to enhance temporal perception. The convolutional layer of DPCNN is used to introduce the time dimension convolution kernel. The size of the time dimension convolution kernel is preferably 3×1, and the adaptive mapping annotation encoding data structure can better capture the temporal pattern of the course of the disease, such as fever on the third day after surgery to the risk of infection. Dynamic pyramid pooling: Adaptively adjust the number of pooling layers according to the length of the text to avoid information loss in short texts such as examination reports.
[0114] In the above solution, the language model and classification model are adapted to medical event descriptions of different lengths, and the accuracy of term mapping and relationship extraction is significantly higher than that of traditional methods.
[0115] In this embodiment, an improved genetic program dynamically adjusts the mutation probability during the iteration process based on the fitness comparison of model parameters and model performance. For example, the mutation probability of parameters with high fitness is reduced to retain advantageous features, while the mutation probability of parameters with low fitness is increased to explore more optimal solutions. This significantly shortens the search time for optimal model parameters for the language model and classification model, while also improving the model's adaptability to heterogeneous medical record data. This ensures that the improved language model and classification model maintain stable performance in multimodal scenarios, thereby improving the efficiency of building and expanding the medical knowledge base. The mutation probability of important model parameters with high fitness is directly reduced to a minimum value to ensure their retention in subsequent iterations. A negative exponential function is used to adjust the mutation probability of elite model parameters with medium fitness, preserving the stability of advantageous parameters while avoiding local optimality. The improved fitness function significantly improves the fit between model output and clinical practice, achieving balanced extraction of medical entities and relationships and compliance with medical rules, and improving the efficiency of converting the constructed medical knowledge base into medical scenarios. The language model and classification model are adapted to medical event descriptions of varying lengths, achieving significantly higher accuracy in term mapping and relationship extraction than traditional methods.
[0116] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
[0117] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for constructing a dynamic medical knowledge base, characterized in that: include: During the construction and training phase of the language model and the classification model, multiple model parameters are encoded and input into an improved genetic program. The improved genetic program adjusts the iterative mutation probability based on a comparison of multiple improved fitness values of the multiple model parameters and generates optimal model parameters. During the use phase of the language model, the mapping annotation codes of the medical record data are generated into medical term codes through the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embedded with historical medical codes based on the medical record knowledge base; During the use phase of the classification model, the medical terminology encoding is used to generate medical entity event relationships through the classification model with the optimal model parameters set, and the medical entity event relationships are constructed to expand the medical record knowledge base, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.
2. The method for constructing a dynamic medical knowledge base according to claim 1, characterized in that: The process of adjusting the iterative mutation probability of the improved genetic program based on the comparison of multiple improved fitness of multiple model parameters includes: The improved genetic program determines the important model parameters corresponding to the maximum improved fitness based on the comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the important model parameters to retain the elite model parameters in this iteration to the next iteration; The improved genetic program determines the elite model parameters corresponding to the improved fitness within a set range based on a comparison of multiple improved fitnesses, and adjusts the mutation probability corresponding to the elite model parameters based on a set attenuation coefficient, wherein the set range is smaller than the maximum improved fitness.
3. The method for constructing a dynamic medical knowledge base according to claim 2, characterized in that: The process of adjusting the mutation probabilities corresponding to the important model parameters and the elite model parameters includes: calculating an improved temporary fitness of each model parameter based on at least a medical entity-event relationship recognition accuracy index and a medical rule conflict index; Adjusting the improved temporary fitness based on the historical medical entity event relationship of the medical record knowledge base to generate the improved fitness; Calculate the ratio of the improved fitness corresponding to each model parameter to the improved fitness of the overall parameters to obtain the initial mutation probability; Adjusting the initial mutation probability corresponding to the important model parameter to a set minimum value to generate the mutation probability corresponding to the important model parameter; The mutation probability corresponding to the elite model parameter is determined based on the product of the negative exponential function of the set attenuation coefficient and the initial mutation probability.
4. The method for constructing a dynamic medical knowledge base according to claim 3, characterized in that: The process of calculating the improved temporary fitness includes: The improved temporary fitness is generated based on the weighted sum of the medical entity recognition balance loss item, the medical-medical relationship recognition balance loss item and the medical rule conflict index loss item, wherein the medical rule conflict index loss item is determined based on the number of matches between the medical rule base and the medical record data, and the medical entity-event relationship includes medical entities, medical events and medical-medical relationships.
5. The method for constructing a dynamic medical knowledge base according to claim 4, characterized in that: The process of generating an improved fitness involves: Inputting sample medical record data into the language model and classification model for setting candidate model parameters to obtain a predicted medical entity event relationship set; Determine whether the relationship between the predicted medical entity event relationship set and the historical medical entity event is an indication relationship or a contraindication relationship. If it is an indication relationship, increase the improved temporary fitness to generate an improved fitness; if it is a contraindication relationship, reduce the improved temporary fitness to generate an improved fitness.
6. The method for constructing a dynamic medical knowledge base according to claim 1, characterized in that: The process of embedding the language model into historical medical codes based on the medical record knowledge base includes: Retrieving associated historical medical entity event relationships in the medical record knowledge base, and encoding the historical medical entity event relationships to generate historical medical codes; The historical medical codes are spliced with the mapping annotation codes generated based on the medical record data to generate a knowledge-enhanced code sequence, and the knowledge-enhanced code sequence is input into the language model to generate the medical term code.
7. The method for constructing a dynamic medical knowledge base according to claim 6, characterized in that: The process of generating a mapping annotation code includes: Build a medical term annotation dictionary based on the official medical terminology glossary; The Word2Vec word vector model is used to determine similar words in the medical record data that are semantically close to the annotation dictionary, and the similar words are mapped to the mapping annotation code through ICD code.
8. The method for constructing a dynamic medical knowledge base according to any one of claims 1 to 7, characterized in that: The process of embedding the classification model into the medical course time series capture unit includes: The medical course time series capture unit is set before the pyramid pooling layer of the classification model, and the time series convolution layer, ReLU activation function layer and pooling layer of the medical course time series capture unit are used to enhance the medical course time series sensitivity.
9. The method for constructing a dynamic medical knowledge base according to claim 8, characterized in that: The temporal convolution layer uses a dynamic scale convolution kernel to adapt to the length of medical terms.
10. A system using the method for constructing a dynamic medical knowledge base according to any one of claims 1 to 9, characterized in that: include: A training module is used to encode multiple model parameters of the language model and classification model and input them into the improved genetic program during the construction and training phase. The improved genetic program adjusts the iterative mutation probability based on the comparison of the improved fitness of the multiple model parameters and generates the optimal model parameters; a medical terminology code generation module, connected to the training module, for generating medical terminology codes from the mapping annotation codes of the medical record data using the language model with the optimal model parameters, wherein the language model is constructed based on the K-BERT architecture and embeds historical medical codes from the medical record knowledge base; A medical case knowledge base construction and expansion module is connected to the training module and the medical terminology coding generation module, and is used to generate medical entity event relationships from the medical terminology codes through the classification model with the optimal model parameters set during the use phase of the classification model, and to construct and expand the medical case knowledge base with the medical entity event relationships, wherein the classification model is constructed based on the DPCNN architecture and is embedded in a medical course time series capture unit.