Surgical site infection early warning method and device, terminal and storage medium
By integrating structured clinical indicators with natural language processing and machine learning techniques from unstructured text, the risk of surgical site infection is identified, solving the problems of accuracy and comprehensiveness in surgical site infection monitoring in existing technologies and achieving more accurate early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies for monitoring surgical site infections rely on manual review and structured data, making it difficult to achieve efficient and accurate early warning. Furthermore, they cannot fully understand the semantic information of unstructured text, resulting in inaccurate feature extraction and incomplete evaluation.
By acquiring perioperative electronic medical record data of target patients, integrating structured clinical indicators with unstructured text, using natural language processing to identify medical entities and generate contextual semantic feature variables, and combining multiple base learners and meta-learners with dynamic selection layers for risk prediction, early identification of surgical site infections can be achieved.
It significantly enhanced the integrity of the risk characterization of surgical site infection and the robustness of the model, enabling more accurate and reliable early identification and reducing the risk of missed diagnosis.
Smart Images

Figure CN121350850B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical treatment, and in particular to a surgical site infection early warning method and device, a terminal and a storage medium. BACKGROUND
[0002] At present, the monitoring of surgical site infection (SSI) mainly relies on manual review of electronic medical records or simple rule judgment based on structured data, and it is difficult to achieve efficient and accurate early warning. In the prior art, when processing unstructured text, a keyword matching or regular expression method is usually used, which cannot fully understand the semantic information of the clinical description, is easily disturbed by factors such as expression difference and negative context, and leads to inaccurate feature extraction. In addition, the traditional model has limited fusion ability for structured indicators and text information, and cannot effectively integrate multi-source heterogeneous data to comprehensively evaluate the risk of patients. SUMMARY
[0003] Therefore, the embodiments of the present application provide a surgical site infection early warning method, device, terminal and storage medium.
[0004] In a first aspect, the embodiments of the present application provide a surgical site infection early warning method, comprising: obtaining perioperative electronic medical record data of a target patient, the electronic medical record data comprising structured clinical indicators and unstructured text records; performing standardization processing on the structured clinical indicators to generate first type feature variables, and performing natural language processing on the unstructured text records to obtain at least one medical entity related to surgical site infection, and generating second type feature variables based on the context semantic information of each medical entity; fusing the first type feature variables and the second type feature variables to form a candidate feature matrix; inputting the candidate feature matrix into a pre-trained risk prediction model to output a risk result of the target patient suffering from surgical site infection; wherein the risk prediction model comprises a plurality of base learners, a meta-learner and a dynamic selection layer, the dynamic selection layer is configured to perform weighted fusion between the output of the meta-learner and the output of a single base learner with the optimal performance determined based on comprehensive evaluation indicators in the validation phase based on the prediction confidence of the input sample, to generate a final risk assessment result.
[0005] In an optional implementation, the natural language processing on the unstructured text records to obtain at least one medical entity corresponding to surgical site infection comprises: performing normalization preprocessing on the unstructured text records to obtain preprocessed text; performing word segmentation operation on the preprocessed text by a word segmentation algorithm in combination with a medical terminology dictionary to obtain a word segmentation result; and determining at least one medical entity based on the word segmentation result in combination with a pre-defined infection vocabulary.
[0006] In an optional implementation, the generating the second type of feature variable based on the context semantic information of the medical entity comprises: obtaining the context semantic information within a preset range of the medical entity; mapping each word in each of the context semantic information to a corresponding numerical vector, and performing weighted average calculation according to an influence weight to obtain a context semantic vector corresponding to the medical entity; calculating a cosine similarity between the context semantic vector and a pre-defined infection semantic center vector; wherein the pre-defined infection semantic center vector is obtained by taking a mean value of context semantic vectors of infection description texts labeled as positive; based on the cosine similarity, and in combination with the frequency of occurrence of the medical entity, the negation recognition result, the semantic type of the adjacent modifier, and the interval days between the first occurrence time and the operation date, a structured semantic feature is generated as the second type of feature variable.
[0007] In an optional implementation, after the risk result of the target patient suffering from the surgical site infection is obtained, the risk prediction model decision process is inversely analyzed by using layer-by-layer correlation propagation to quantify the importance of each feature in the candidate feature matrix to the risk result.
[0008] In an optional implementation, the training process of the risk prediction model comprises: constructing a training sample set according to historical patient data with known infection state labels; performing stratified cross-validation by patient grouping on the training sample set to ensure that the data of the same patient is in the same training subset or the same validation subset; in each round of cross-validation, training all base learners by the training subset, and obtaining the probability prediction value of each base learner based on the corresponding validation subset; wherein, in each round of cross-validation, the probability prediction value of each base learner is calibrated; the probability prediction values of all base learners in all rounds are spliced to form a meta-feature matrix; the meta-learner is trained based on the meta-feature matrix to obtain a preliminary risk result of the risk prediction model.
[0009] In an optional implementation, the meta-learner is a deep neural network, and in the training, the input features of the meta-learner include auxiliary features reflecting prediction uncertainty in addition to the meta-feature matrix; wherein the auxiliary features include at least one of the standard deviation of the prediction probability of each base learner, the prediction entropy, and the inter-model divergence.
[0010] In an optional implementation, the training process of the risk prediction model further comprises: after the training of the meta-learner is completed, obtaining the meta-learner output result, the optimal base-learner output result and the auxiliary feature reflecting the prediction uncertainty corresponding to the target sample in each of the validation subsets; determining a target weight coefficient based on the matching degree between the meta-learner output result, the optimal base-learner output result and the true label; training the dynamic selection layer by using the auxiliary feature as input and the target weight coefficient as a supervision signal to realize the prediction of the dynamic weight coefficient, and outputting the final risk evaluation result based on the dynamic weight coefficient, the meta-learner output result and the optimal base-learner output result.
[0011] In an optional implementation, the risk prediction result is obtained based on a prediction formula; the prediction formula is: ; wherein, is the final risk evaluation result, is the output result of the meta-learner, is the optimal base-learner output result, is the dynamic weight coefficient.
[0012] In an optional implementation, the base-learner comprises at least two of a decision tree, a support vector machine, a random forest, a gradient boosting tree, a K-nearest neighbor classifier, a logistic regression model and a naive Bayes.
[0013] In an optional implementation, before the obtaining of the at least one medical entity corresponding to the surgical site infection, the method further comprises: constructing a semantic matching model based on a twin neural network to learn a semantic embedding space of the electronic medical record data.
[0014] In an optional implementation, the construction process of the semantic matching model comprises: constructing a positive sample pair and a negative sample pair; wherein the positive sample pair comprises clinically similar description texts, and the negative sample pair comprises clinically dissimilar description texts; inputting the positive sample pair or the negative sample pair in each pair of texts into two branches of a twin neural network respectively, processing by a text encoder with shared weights, obtaining corresponding low-dimensional semantic vectors, and training by using a contrastive learning loss function to generate an initial semantic matching model; wherein the twin neural network is composed of a text encoder with shared weights and a dimension reduction projection head; based on the initial semantic matching model, predicting the similarity of candidate text segments in unlabeled electronic medical record data, assigning a pseudo-label to a sample with a confidence higher than a preset threshold, adding the sample to a training set and iteratively fine-tuning the model to obtain a target semantic matching model.
[0015] In an optional implementation, the target semantic matching model is used to generate the context semantic vector of the medical entity, and a pre-defined infection semantic center vector is determined based on a high-confidence infection semantic vector mean.
[0016] In a second aspect, the embodiments of the present application provide a surgical site infection early warning device, comprising:
[0017] An acquisition module is configured to acquire perioperative electronic medical record data of a target patient, the electronic medical record data including structured clinical indicators and unstructured text records; a generation module is configured to perform standardization processing on the structured clinical indicators to generate first-type feature variables, and perform natural language processing on the unstructured text records to obtain at least one medical entity related to surgical site infection and generate second-type feature variables based on context semantic information of each medical entity; a fusion module is configured to fuse the first-type feature variables and the second-type feature variables to form a candidate feature matrix; and an output module is configured to input the candidate feature matrix into a pre-trained risk prediction model to output a risk result of surgical site infection of the target patient; wherein the risk prediction model includes multiple base learners, a meta-learner, and a dynamic selection layer, the dynamic selection layer is configured to perform weighted fusion between an output of the meta-learner and an output of a single base learner with optimal performance determined based on comprehensive evaluation indicators in a validation phase based on a prediction confidence of an input sample to generate a final risk assessment result.
[0018] In a third aspect, the embodiments of the present application provide a terminal device, comprising a processor and a memory, the memory stores a computer program, and the processor is configured to execute the computer program to implement the surgical site infection early warning method described in the foregoing embodiments.
[0019] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed on a processor to implement the surgical site infection early warning method described above.
[0020] The embodiments of the present application have the following beneficial effects: the present application obtains the perioperative electronic medical record data of the target patient, fuses the structured clinical indicators and the unstructured text records, and comprehensively integrates the multi-dimensional diagnosis and treatment information. The structured indicators are standardized, the dimensional differences are eliminated, and the feature consistency is improved; the unstructured text is processed by natural language processing, medical entities related to surgical site infection are identified, and the second type of feature variable is generated in combination with the context semantic information, effectively mining the implicit risk clues in the free text. The two types of feature variables are fused to form a candidate feature matrix, so that the model input has both quantitative indicators and deep semantic features, significantly enhancing the completeness of risk representation. Finally, the matrix is input into a pre-trained risk prediction model for risk assessment, the model includes multiple base learners, meta learners and a dynamic selection layer, which can adaptively fuse different prediction paths according to the prediction confidence and distribution characteristics of the sample, thereby improving the robustness of the model in complex scenarios. Compared with the evaluation one-sidedness caused by the prior art relying only on structured data, the present application realizes more accurate and reliable early identification of surgical site infection, and reduces the risk of missed diagnosis. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0022] Figure 1 A first flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0023] Figure 2 A second flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0024] Figure 3 A third flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0025] Figure 4 A fourth flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0026] Figure 5 A fifth flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0027] Figure 6 A sixth flowchart of a surgical site infection early warning method according to an embodiment of the present application is shown;
[0028] Figure 7A structural schematic diagram of a surgical site infection early warning device is shown. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments of the present application.
[0030] The components of the embodiments of the present application generally described and shown in the accompanying drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0031] Hereinafter, the terms "include", "have", and their synonymous words used in various embodiments of the present application are only intended to indicate that specific features, numbers, steps, operations, elements, components, or combinations thereof are present, and should not be understood as excluding the presence or addition of one or more other features, numbers, steps, operations, elements, components, or combinations thereof. In addition, the terms "first", "second", "third", and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0032] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present application belong. The terms (such as those defined in commonly used dictionaries) will be interpreted as having a meaning that is the same as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized or overly formal meaning unless clearly defined in various embodiments of the present application.
[0033] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.
[0034] With the rapid development of medical information technology, the demand for deep utilization of medical data by medical institutions is increasing, the infection prevention and control standards are becoming more stringent, and the demand for precise diagnosis and personalized intervention by clinicians and infection control personnel is increasing. Surgical site infection (SSI) is one of the major complications during the perioperative period, and it is urgent to achieve timely identification and intervention at an early stage.
[0035] However, current SSI monitoring still highly relies on manual retrospective review of electronic medical records, which is inefficient and difficult to achieve universal and real-time coverage. Existing warning models are mostly based on structured indicators such as white blood cell count and C-reactive protein, and cannot fully utilize unstructured text such as chief complaint and medical history records that contain key clinical information, resulting in incomplete risk assessment. At the same time, there are problems such as different data formats, various terminologies and uneven quality among different hospital information systems, which further exacerbate the difficulty of data integration and model generalization.
[0036] Based on this, the application proposes a surgical site infection warning method and device, terminal and storage medium that fuse structured clinical indicators and unstructured text information. The method realizes efficient integration and deep semantic modeling of multi-source heterogeneous data through Chinese natural language processing and machine learning technology, thereby improving the accuracy of surgical site infection prediction.
[0037] The surgical site infection warning method will be described below in conjunction with some specific embodiments.
[0038] Figure 1 A flowchart of the surgical site infection warning method of the embodiments of the application is shown. Exemplarily, the surgical site infection warning method includes the following steps S110-S140:
[0039] Step S110, obtaining the perioperative electronic medical record data of the target patient.
[0040] The perioperative electronic medical record data of the target patient covers the complete diagnosis and treatment information from preoperative preparation, surgical process to postoperative recovery period (usually within 90 days after surgery), and the electronic medical record data includes structured clinical indicators and unstructured text records.
[0041] The structured clinical indicators can be data from hospital information systems, laboratory information systems, order systems, etc., including but not limited to, vital signs (body temperature, heart rate), laboratory test results (white blood cell count, C-reactive protein, procalcitonin PCT), antimicrobial drug use (drug name, use time, classification), surgical related information (surgical type, incision grade), whether to change dressing, whether to be readmitted, whether to undergo secondary surgery, etc. quantifiable or coded fields.
[0042] The unstructured text records mainly come from the free text part in the electronic medical record system, including chief complaint, medical history, medical record, surgical record, nursing record, consultation opinion, etc., containing a large amount of descriptive clinical information such as redness and swelling around the incision, purulent exudation, and obvious local tenderness, although not stored in a structured form, but contains important infection risk clues.
[0043] All data can be automatically collected through the hospital's internal security interface and used for subsequent analysis after de-identification processing.
[0044] Step S120: Standardize the structured clinical indicators to generate first-class feature variables, perform natural language processing on the unstructured text records to obtain at least one medical entity related to surgical site infection, and generate second-class feature variables based on the contextual semantic information of each medical entity.
[0045] Exemplary examples show that structured clinical indicators can be standardized, transforming them into binary variables with clear clinical significance as the first category of feature variables. Specifically, continuous indicators are discretized based on preset medical thresholds or guideline standards. For example, procalcitonin (PCT) on postoperative day 3 can be transformed into a single variable. If an item is deemed abnormal, it is coded as 1; otherwise, it is 0. Antibacterial drugs are classified into high-level and non-high-level categories according to the prescribed classification catalog. Whether they are used within a specific time period after surgery is recorded and coded as 0 / 1, etc., thus forming a set of quantifiable and easily interpretable first-class characteristic variables.
[0046] For unstructured text records, natural language processing techniques can be used for semantic parsing to identify medical entities related to surgical site infection (such as redness, swelling, effusion, suppuration, cellulitis, etc.). The contextual semantic information of each medical entity is then modeled, extracting the linguistic environment in which the entity appears, and generating a second type of feature variable that includes dimensions such as semantic strength, negation, and temporal dynamics. This process comprehensively considers lexical semantics, contextual association, and modification relationships, thus enabling the transformation from free text into high-value predictive features.
[0047] In some implementations, such as Figure 2 As shown, natural language processing is performed on unstructured text records to obtain at least one medical entity corresponding to surgical site infection, including steps S210-S230:
[0048] Step S210: Perform normalization preprocessing on the unstructured text records to obtain preprocessed text.
[0049] In this step, the original unstructured text (such as medical records, surgical records, nursing documents, etc.) needs to be cleaned and standardized. The process includes: removing irrelevant symbols (such as special characters, extra spaces), correcting obvious writing errors (for example, correcting T6.5 to T36.5), unifying numerical unit expressions (such as mg / uniform to standard format), and normalizing time expressions (such as postoperative day 5 to "+5d"). At the same time, detect and mark negative context, such as negative words and their scope of action in expressions such as no obvious redness, no exudation, etc., to avoid misjudging negative descriptions as positive symptoms. After the above processing, the preprocessed text with clear semantics and uniform format can be obtained in this embodiment.
[0050] In step S220, the preprocessed text is segmented by a segmentation algorithm combined with a medical terminology dictionary to obtain a segmentation result.
[0051] Specifically, a Chinese medical field enhanced segmentation tool (such as jieba or HanLP integrated with a orthopedic infection specific dictionary) is used to segment the preprocessed text. This segmentation algorithm combined with a self-defined medical terminology dictionary can ensure that professional phrases such as incision pus, deep tissue infection, debridement, etc. are not incorrectly segmented. At the same time, the integrity of complex symptoms and modification structures can be maintained, thereby improving the accuracy of subsequent medical entity recognition, and finally generating accurate segmentation results.
[0052] In step S230, at least one medical entity is determined based on the segmentation result combined with a pre-defined infection vocabulary.
[0053] Exemplarily, the segmentation result is matched with a pre-defined infection vocabulary in this step, which covers symptoms, signs and disposal-related terms closely related to surgical site infection, including but not limited to redness, exudation, pus, pain, cellulitis, fluctuation, deep tenderness, major dressing change, drainage, debridement, etc. For successfully matched words or phrases, it is determined that they are medical entities related to SSI, and their location information in the text is recorded.
[0054] In some embodiments, as shown in Figure 3 The second type of feature variable is generated based on the context semantic information of the medical entity, including steps S310-S340:
[0055] In step S310, the context semantic information within the preset range of the current medical entity is obtained.
[0056] In this step, for each identified medical entity, the words within a certain window range before and after it are extracted from the original electronic medical record text as context semantic information. In a specific embodiment, the context window is set to ±5 words (i.e. up to 5 words before and up to 5 words after the target entity) to cover the language components that directly modify, describe or associate with the entity.
[0057] For example, in the sentence "On the 6th day after the operation, the patient had mild swelling around the incision, accompanied by light yellow exudation, with no obvious necrotic tissue", the context semantic information for the medical entity "exudation" includes the adjacent words such as accompanied, light yellow, and no obvious necrotic tissue; while for "swelling", the context includes the words such as around the incision, mild, and accompanied.
[0058] Step S320, each word in each context semantic information is mapped to a corresponding numerical vector, and weighted average calculation is performed according to the influence weight to obtain the context vector corresponding to the current medical entity.
[0059] In this step, a pre-trained Chinese word vector model (such as Word2Vec, FastText or an embedding model trained based on medical corpus) is first used to map each word in the context to a fixed-dimensional numerical vector (e.g. 200 dimensions). The vector can capture the semantic and syntactic features of the word. Then, the weighted average of these word vectors is calculated to obtain a comprehensive vector representing the semantic environment of the medical entity, i.e. the context vector.
[0060] The influence weight is determined by two factors: tf-idf value and distance decay factor.
[0061] The tf-idf value measures the importance of the word in the entire corpus. High-frequency but rare professional terms in the overall corpus (such as purulent) are given higher weights, while common function words (such as: of, was) have lower weights; the distance decay factor can be calculated by the formula , where represents the number of words between the word and the target medical entity. The closer the distance, the higher the weight.
[0062] The final weighted average formula can be: ; where is the word vector of the i-th context word, which can be obtained by pre-training the Word2Vec model, is the comprehensive weight of the word, and the comprehensive weight of the word vector can be calculated by the formula = ; where the tf-idf value can be obtained according to the hospital historical electronic medical record corpus, where df is the number of medical records containing the word, N is the total number of medical records.
[0063] The context vector in the embodiment not only contains semantic information, but also embodies the importance and spatial relationship of each word in the context semantic information, thereby effectively distinguishing different intensity or nature of the description (such as slight redness, extensive redness, etc.).
[0064] Step S330, calculate the cosine similarity between the context vector and the pre-defined infection semantic center vector.
[0065] Wherein, the pre-defined infection semantic center vector is obtained by taking the average of the context vectors of the infection description texts labeled as positive, specifically, a group of infection related text segments (such as incision pus with fever, deep tissue infection requires debridement, etc.) labeled as “positive” by the infection control doctors and clinical experts are collected; the medical entities in each text are executed by steps S310-S320 to generate their context vectors; then the context vectors of all positive samples are L2 normalized, and the arithmetic mean vector is calculated as the pre-defined infection semantic center vector.
[0066] The cosine similarity calculated in the embodiment is between -1 and 1, which is usually normalized to the range of 0-1 in actual application, as a core index to measure whether the medical entity points to the real infection risk this time.
[0067] Step S340, based on the cosine similarity, and combined with the appearance frequency of the medical entity, the negative recognition result, the semantic type of the adjacent modifier, and the interval days between the first appearance time and the operation date, generate structured semantic features as the second type of feature variable.
[0068] Wherein, the appearance frequency is the total number (integer) of times that the medical entity is mentioned in the patient's entire medical record; the negative recognition result is a binary flag (0 / 1), if the entity appears within the scope of negative words (such as no, not seen, deny, etc.), it is marked as 1 (i.e. negated), otherwise 0; the semantic type of the adjacent modifier is to classify and encode the adjectives or adverbs adjacent to the medical entity, for example, slight, mild, which can be classified as weak degree; severe, extensive, which can be classified as strong degree; yellowish, serous, which can be classified as atypical infection; purulent, bloody, which can be classified as typical infection, etc.; the interval days between the first appearance time and the operation date is the time difference (unit can be days) between the time point when the medical entity first appears in the medical record and the operation date, which is used to capture the dynamic trend of infection.
[0069] In this step, the cosine similarity, frequency of occurrence, negative recognition result, semantic type of adjacent modifier, and interval days between first occurrence time and surgery date are combined into a high-dimensional feature vector, for example: [similarity = 0.82, frequency = 1, negative flag = 0, modifier type = typical infection, time distance = 5]; the vector is a second type of feature variable, which fully expresses the comprehensive information of the medical entity in terms of semantic intensity, clinical significance, and time evolution, and can be used for subsequent construction of a candidate feature matrix.
[0070] In step S130, the first type of feature variable and the second type of feature variable are fused to form a candidate feature matrix.
[0071] In this step, the first type of feature variable and the second type of feature variable are vectorized and spliced to form a high-dimensional, structured feature vector. Multiple patient feature vectors of this type can be arranged in rows to form a candidate feature matrix for subsequent model reasoning.
[0072] The first type of feature variable is a binary classification variable after standardization, and multiple first type of feature variables can be organized in a predetermined order to form a fixed-length vector.
[0073] The second type of feature variable comes from deep semantic analysis of unstructured text, and each medical entity corresponds to a structured semantic feature containing cosine similarity, frequency of occurrence, negative flag, modifier type, and time distance. The second type of feature corresponding to all identified medical entities is expanded in a predetermined field order and compressed into a fixed-dimensional vector using an aggregation strategy (such as taking the maximum value, summing, or splicing the first occurrence record) to ensure consistency of the feature space between different patients.
[0074] Subsequently, the two types of feature vectors are horizontally spliced in the feature dimension to form the complete feature representation of the patient. For example, if the first type of feature has 20 dimensions and the second type of feature has 15 dimensions after aggregation, the final feature vector of a single sample is 35 dimensions.
[0075] The data of all patients who need to be alerted for infection risk is processed in this way, and finally an N candidate feature matrix is formed, where N is the number of samples and M is the total number of features. This matrix is the standard input format of the pre-trained risk prediction model to realize batch risk prediction tasks.
[0076] In step S140, the candidate feature matrix is input into the pre-trained risk prediction model to output the risk result of the target patient for surgery site infection.
[0077] The risk prediction model is an integrated learning model of a multi-layer fusion architecture, which includes three logical levels, i.e., a plurality of base learners, a meta-learner, and a dynamic selection layer. The model has been trained and verified on a historical patient data set with known infection status labels, and has complete risk identification capability.
[0078] Specifically, a one-dimensional feature vector (i.e., a single sample input) corresponding to the candidate feature matrix of the current target patient is input into the risk prediction model, which can also support batch processing of multi-dimensional feature vectors of multiple patients. The model first performs independent prediction through a plurality of base learners (such as at least two of decision tree, support vector machine, random forest, gradient boosting tree, K-nearest neighbor classifier, logistic regression model, and naive Bayes) in the first layer, and each base learner outputs a probability value (i.e., a risk probability score) that the sample belongs to a high-risk category.
[0079] Subsequently, the probability prediction values are spliced to form a meta-feature vector, which is input to the meta-learner in the second layer. In an embodiment, the meta-learner is a deep neural network that not only receives the meta-feature vector but also combines auxiliary features (such as standard deviation of prediction probability, prediction entropy, and model disagreement) reflecting prediction uncertainty to achieve nonlinear weighted fusion of the outputs of the base learners, thereby generating a first risk assessment result (i.e., the output result of the meta-learner).
[0080] On this basis, the third level, the dynamic selection layer, is entered. The layer receives the output from the meta-learner, the output of a single base learner with optimal performance determined in the cross-validation phase, and the auxiliary features corresponding to the current sample, and calculates a dynamic weight coefficient .
[0081] The single base learner with optimal performance is determined based on the classification performance indicators on the validation subsets in each round of cross-validation during the model training phase. Specifically, after each round of cross-validation ends, the F1 score (i.e., the harmonic mean of precision and recall) or the AUC value (Area Under the ROC Curve) of each base learner on the validation subset is calculated. After all rounds are completed, the average F1 score (or average AUC) of each base learner is calculated, and the one with the highest score is selected as the optimal base learner for the task. For example, if XGBoost has the highest average F1 score in five-fold cross-validation, it is fixed as the optimal base learner and remains unchanged after the entire system is deployed.
[0082] Finally, the system generates a final risk assessment result according to the formula wherein is the final risk assessment result, The output result of the meta-learner, The output result of the optimal base learner, The dynamic weight coefficient; when the input sample is within the training data distribution range and the prediction confidence is high (such as good consistency between models and low uncertainty), tends to 1, and the system mainly relies on the integrated judgment of the meta-learner; when the sample deviates from the training distribution or the prediction uncertainty is high (such as rare clinical manifestations or contradictory predictions), is automatically reduced, so that the system more relies on the output of the optimal base learner, which is a stable path.
[0083] The risk result is a continuous risk probability value between 0 and 1, indicating the likelihood of the patient developing a surgical site infection in the future; it can also be further divided into discrete risk levels, such as low risk (0-0.3), medium risk (0.3-0.7), and high risk (0.7). At the same time, the system can output a confidence score or a prediction reliability indicator to assist clinical judgment.
[0084] In one embodiment, all base learners have been probability calibrated (such as using Platt Scaling or Isotonic Regression) during the training phase to ensure that their output probability values have good calibration and comparability.
[0085] In addition, during model deployment, batch processing or real-time inference mode can be used to periodically or dynamically trigger the warning process according to the data update frequency of the hospital information system (HIS / LIS / EMR). When the output result reaches the preset high-risk threshold, the system automatically generates a warning signal and sends it to the attending physician workstation or the infection control management platform through pop-up reminders, SMS notifications, or message push, etc. to assist clinicians in taking timely intervention measures.
[0086] In some embodiments, as shown in FIG. 4, Figure 4 the training process of the risk prediction model includes steps S410-S450:
[0087] Step S410: Construct a training sample set according to historical patient data with known infection status labels.
[0088] In this step, first, collect historical surgical patient electronic medical record data from medical institutions (such as a certain hospital), and each patient has been confirmed by the infection control doctor and the clinical attending physician whether it has developed a surgical site infection (SSI) after surgery, forming a clear positive or negative label as the gold standard.
[0089] The data preprocessing, feature extraction, and candidate feature matrix generation operations consistent with the foregoing embodiments are performed on all cases to obtain a set of structured inputs. The input is a multi-dimensional feature vector, and the output is a binary classification label (0 = not infected, 1 = infected). At the same time, to control the influence of confounding factors, the propensity score matching method is used when constructing the sample set. For each SSI positive case, 5 times the number of control samples are matched from the negative population according to the covariates such as gender, age, comorbidity, type of surgery, department, etc., to balance the data distribution and improve the internal validity of model training. The final training sample set contains several complete sample records, which are used for subsequent modeling.
[0090] Step S420, stratified cross-validation by patient grouping is performed on the training sample set to ensure that the data of the same patient is in the same training subset or the same validation subset.
[0091] Exemplarily, to accurately evaluate the performance of the base learner and prevent data leakage, a stratified group K-fold cross-validation strategy is used for model training and validation.
[0092] Specifically, all patients are grouped individually (i.e., all time series data of each patient are considered as an independent unit), and these patient groups are randomly divided into K non-overlapping subsets (e.g., K = 5), ensuring that the proportions of positive and negative samples in each fold are basically consistent (stratification), and all data of the same patient always belong to the same subset (grouping).
[0093] In each round of cross-validation, one fold is selected as the validation subset, and the remaining K-1 folds are used as the training subset, which is rotated in turn, and K rounds of training and validation are performed. This way of the present embodiment can effectively avoid the information leakage problem caused by the dispersion of multiple time point data of the same patient into the training set and the validation set.
[0094] Step S430, in each round of cross-validation, all base learners are trained through the training subset, and the probability prediction values of each base learner are obtained based on the corresponding validation subset.
[0095] In each round of cross-validation, the probability prediction values of each base learner are calibrated.
[0096] Specifically, in each round of cross-validation, the training subset of the current round can be used to train multiple base learners respectively; then the trained individual base learners are used to infer the validation subset of the current round, and output the prediction probability of each sample belonging to the infection category (i.e. the probability prediction value). Since the probabilities output by different machine learning algorithms may be biased (such as the non-real confidence of the probability of SVM), after each round of cross-validation is completed, the probability prediction results of each base learner on the validation subset are processed for probability calibration. Common calibration methods include but are not limited to Platt Scaling or Isotonic Regression. By calibrating after each round of cross-validation is completed, the prediction probability can be closer to the real occurrence frequency. The calibrated probability prediction value is retained for subsequent construction of the meta-feature matrix.
[0097] Step S440, the probability prediction values of each base learner in all rounds are spliced to form a meta-feature matrix.
[0098] After completing K rounds of cross-validation, each training sample obtains the prediction result from each base learner in its corresponding validation round, which is an out-of-fold (OOF) prediction value, i.e. the probability output generated by a model that has not seen the sample during training, thereby effectively avoiding the data leakage problem. Subsequently, these OOF probability prediction values are rearranged in sample order, and the probability values output by each sample corresponding to multiple base learners are horizontally spliced to form a new two-dimensional matrix, a meta-feature matrix. Each row of the matrix corresponds to a training sample, and each column represents the risk probability output by a certain base learner. For example, if there are 5 base learners, the meta-feature matrix is a 5-dimensional probability vector for each row.
[0099] Step S450, training a meta-learner based on the meta-feature matrix to obtain a preliminary risk result of the risk prediction model.
[0100] In this step, a meta-learner is trained using the above meta-feature matrix as input and its corresponding infection status label as output.
[0101] The meta-learner is used to learn the optimal combination strategy among the prediction results of each base learner. By weighted fusion of the outputs of different models, it generates a more discriminative integrated prediction result. In one embodiment, the meta-learner is implemented using a deep neural network. It not only receives the meta-feature matrix as input but also introduces auxiliary features reflecting prediction uncertainty, including the standard deviation of the prediction probabilities of each base learner, prediction entropy, and the degree of divergence between models, so as to more accurately capture the confidence level and consistency changes of the model group on different samples. After training, all the base learners in the first layer and the meta-learner in the second layer are integrated and solidified to form a risk prediction model with preliminary integrated decision-making capabilities. In the deployment phase, for a newly input target patient, its candidate feature matrix first obtains probability outputs through each base learner, and then is fused by the meta-learner to output the first risk assessment result.
[0102] Furthermore, the meta-learner's network structure consists of three fully connected layers stacked sequentially, each followed by a non-linear activation function. The activation function can be either ReLU or GELU, used to introduce non-linear mapping capabilities and capture higher-order interactions between base learners. To further improve the model's generalization performance and training stability, a batch normalization layer can be configured after each fully connected layer to reduce internal covariate bias; simultaneously, a Dropout regularization mechanism is introduced to randomly discard some neuron outputs during training, preventing overfitting and enhancing robustness. The entire network uses the AdamW optimizer for parameter updates, which combines adaptive learning rate and weight decay decoupling strategies, helping to accelerate convergence and improve the final model performance. During training, an early stopping mechanism is used to monitor the AUC metric on the validation set; training is automatically terminated when there is no significant improvement after several consecutive training epochs to avoid overfitting. Through the above structural design and training strategy, the meta-learner can effectively model the complex correlations between base learners in a high-dimensional non-linear space, generating optimized fusion results for each sample.
[0103] like Figure 5 As shown, after the meta-learner is trained, the training process of the risk prediction model also includes steps S510-S530:
[0104] Step S510: Obtain the meta-learner output, the optimal base learner output, and the auxiliary features reflecting the prediction uncertainty for the target samples in each validation subset.
[0105] In this step, the meta-learner and all base learners that have completed training are used to infer the validation subset samples in each round of cross-validation, and the following three types of information are collected: first, the first risk assessment result output by the meta-learner for each sample; second, the prediction result output by the single base learner with the best performance; and third, auxiliary features reflecting the prediction uncertainty of the current sample, including prediction entropy, model output variance, and model difference degree.
[0106] Step S520, based on the matching degree between the meta-learner output result, the optimal base learner output result and the real label, the target weight coefficient is determined.
[0107] Exemplarily, for each validation sample, the error between the meta-learner output result and the real label is calculated, and the error between the optimal base learner output result and the real label is calculated. By comparing the error size, it is determined which prediction path is more accurate on the sample. If the prediction error of the meta-learner is less than the prediction error of the optimal base learner, the target weight coefficient is set to 1, indicating that the judgment of the integrated model should be preferred; otherwise, the target weight coefficient is set to 0, indicating that the output of the single model should be trusted. The target weight coefficient as a supervision signal reflects the ideal risk fusion strategy under different samples, and provides a clear learning goal for the training of the dynamic selection layer.
[0108] Step S530, using the auxiliary features as input and the target weight coefficient as supervision signal, the dynamic selection layer is trained to realize the prediction of the dynamic weight coefficient, and the final risk assessment result is output based on the dynamic weight coefficient, the meta-learner output result and the optimal base learner output result.
[0109] In this step, the auxiliary features extracted in step S510 are taken as input variables, and the target weight coefficients generated in step S520 are taken as expected outputs, and a lightweight selection model is trained to automatically predict a dynamic weight coefficient between 0 and 1 according to the uncertainty features of the input sample. The lightweight selection model constitutes the core component of the dynamic selection layer. After training, in the actual application stage, the system performs the following inference process on a new patient. First, the outputs of the base learners are obtained, and then the meta-learner generates a first risk assessment result. At the same time, the dynamic selection layer calculates a dynamic weight coefficient according to the auxiliary features of the current sample. Finally, combined with the coefficient, the output result of the meta-learner and the output result of the optimal base learner, the final risk assessment result is generated in a linear weighting manner. When the input sample is within the training data distribution range and the prediction consistency is high, the dynamic weight coefficient tends to 1, and the system mainly relies on the comprehensive judgment of the meta-learner; when the sample deviates from the training distribution or the prediction uncertainty is high, the dynamic weight coefficient automatically decreases, and the system turns to more reference to the output of the optimal base learner. Thus, a sample-level adaptive fusion mechanism is realized, and the robustness and practicality of the model in complex clinical scenarios are improved.
[0110] In some embodiments, in order to improve the adaptability of the present embodiment in different medical institution scenarios, especially to achieve high-quality medical entity semantic understanding in the case of insufficient labeled data, the present embodiment introduces a semantic matching model based on a twin neural network before identifying medical entities related to surgical site infections, which is used to learn deep semantic embedding representations of electronic medical record texts. This model can capture the semantic similarity between clinical descriptions through a contrastive learning mechanism, and can achieve accurate generation of context vectors and stable modeling of infection semantic centers.
[0111] As shown in Figure 6 The construction process of the semantic matching model includes steps S610-S630:
[0112] Step S610, construct positive sample pairs and negative sample pairs.
[0113] The positive sample pairs contain semantically similar clinical description texts, and the negative sample pairs contain semantically dissimilar clinical description texts.
[0114] In the construction of the semantic matching model, a large number of clinical description text fragments (such as incision redness with exudate, local congestion with pus, mild edema around the wound, etc.) are first extracted from historical electronic medical record data, and sample pairs for contrastive learning are constructed manually or semi-automatically.
[0115] Positive sample pairs are composed of two clinical descriptions that are highly similar in semantics or interchangeable. For example, “yellowish exudation in incision on the 5th day after surgery” and “slimy pus in drainage fluid on the 5th day after surgery”, “deep tissue infection requires debridement” and “deep incision pyosis requires debridement”, although the words are different, they express the same clinical state and belong to the same semantic category.
[0116] Negative sample pairs are composed of two descriptions that are obviously irrelevant in semantics. For example, “incision heals well without abnormalities” and “fever with leukocytosis on the 7th day after surgery”, “patient complains of pain relief” and “Staphylococcus aureus is detected in microbial culture”, such samples can be used to strengthen the model's ability to distinguish unrelated expressions.
[0117] In specific implementation, rules matching combined with expert review can be used to construct an initial sample pair library, and the proportion of positive and negative samples is balanced to support effective training.
[0118] In step S620, the positive sample pair or the negative sample pair in each pair of texts is respectively input into the two branches of the twin neural network, and after being processed by the text encoder with shared weights, the corresponding low-dimensional semantic vectors are obtained, and a contrastive learning loss function is used for training to generate an initial semantic matching model.
[0119] The twin neural network is composed of a text encoder with shared weights and a dimension reduction projection head.
[0120] A twin neural network with a double-branch structure is constructed, and the two branches are identical and share all parameters. Each branch includes a text encoder and a dimension reduction projection head.
[0121] The text encoder is used to map the input text into a semantic vector. In some embodiments, a pre-trained Chinese Transformer model (such as BERT-wwm, MacBERT) can be used as a basic encoder to capture long-distance dependencies and context semantics; the dimension reduction projection head is composed of a fully connected layer and a nonlinear activation function, which further compresses the high-dimensional encoding output into a low-dimensional (such as 128-dimensional) normalized semantic vector, facilitating similarity calculation.
[0122] In the training process, each pair of texts is input into the two branches of the twin neural network, and after being processed by the text encoder with shared weights, the corresponding low-dimensional semantic vectors are obtained and For positive sample pairs, the distance between their semantic vectors is expected to be as small as possible; for negative sample pairs, the distance is expected to be greater than a preset margin m to ensure that clinically irrelevant descriptions are effectively separated in the embedding space.
[0123] To achieve the above object, the embodiment adopts a contrastive learning loss function to optimize the model, and the loss function is: ; wherein, , is the label of the sample pair, when =1, it indicates that the text pair is a positive sample pair (i.e. the semantics of the two texts are similar), and when =0, it is a negative sample pair (the semantics are not similar); and are L2 normalized low-dimensional semantic vectors output by the encoder of the two input texts, and the dimension can be 128; represents the Euclidean distance between the two semantic vectors; m is a preset margin hyperparameter, which can be set to 1.0, used to control the minimum separation degree between negative sample pairs.
[0124] When y=1 (positive sample pair), the loss term is simplified as , and the model promotes the aggregation of clinically similar descriptions in the embedding space by minimizing this value; when y=0 (negative sample pair), only when a non-zero loss is generated, that is, only when the current distance is less than the margin, a penalty is imposed, avoiding excessive separation of irrelevant samples leading to distortion of the semantic structure.
[0125] Through multiple rounds of iterative training, the model gradually learns a discriminative semantic embedding space, so that descriptions related to surgical site infections with different expressions but similar semantics (such as incision pus and local pus with secretions) are mapped to adjacent areas, and unrelated descriptions are effectively distinguished. This process significantly improves the accuracy of subsequent context vector generation and pre-defined infection semantic center vector modeling, especially for few-shot learning scenarios under conditions of scarce labeled data.
[0126] Step S630, based on the initial semantic matching model, the similarity of the candidate text segments in the unlabeled electronic medical record data is predicted, the samples with confidence higher than the preset threshold are given pseudo-labels, added to the training set and iteratively fine-tuned the model to obtain the target semantic matching model.
[0127] Among them, the target semantic matching model is used to generate the context vector of the medical entity, and the pre-defined infection semantic center vector is determined based on the mean of the high-confidence infection semantic vector.
[0128] Exemplarily, to further improve the generalization performance of the model in real scenarios and alleviate the problem of high labeling cost, the embodiment can use a bootstrap pseudo-label expansion strategy to iteratively optimize the initial model. Specifically, first, use the trained initial semantic matching model to run on large-scale unlabeled electronic medical record data to extract all text segments containing suspected infection descriptions (such as sentences containing keywords such as redness and exudation); then calculate the semantic similarity between these texts and a set of known positive descriptions (such as typical infection template sentences); for samples with a similarity exceeding a preset high confidence threshold (such as 0.9), automatically assign a positive label; then add these high-confidence pseudo-labeled samples to the original training set to fine-tune the entire twin network model again; repeat the above process for several rounds (such as 3-5 rounds) until the model performance converges. In this process, an artificial sampling review mechanism can be introduced to randomly check some pseudo-label samples to control noise accumulation, and an integrated consensus or multi-model voting method is used to further improve the quality of pseudo-labels. The final obtained model is called the target semantic matching model, which can not only be used to generate more accurate context vector, but also be used to dynamically update the pre-defined infection semantic center vector (obtained by taking the mean of the semantic vectors of high-confidence positive samples), thereby supporting the rapid deployment of hospital customized, small sample condition intelligent early warning system.
[0129] In some embodiments, after obtaining the risk result of the target patient developing a surgical site infection, further comprising: using layer-wise relevance propagation (LRP) to reversely analyze the decision-making process of the pre-trained risk prediction model to quantify the importance of each feature in the candidate feature matrix to the risk result.
[0130] Specifically, the risk score generated by the output layer (such as a high-risk probability value) is used as the initial relevance score, which is propagated back from the output layer to the input layer along the neural network structure, decomposed to each hidden layer neuron according to the preset relevance distribution rule, and finally backtracked to each feature variable in the input layer. In the entire propagation process, the relevance conservation principle is satisfied, that is, the sum of the relevance of each layer of neurons is equal to the total sum of the relevance of the output of the next layer, so as to ensure the mathematical consistency and physical interpretability of the attribution result.
[0131] For deep learning-based learners (such as classifiers based on fully connected neural networks or Transformer structure), the back propagation calculation is performed using the rule , the general form of which can be , wherein represents the relevance score received by the jth neuron of the previous layer; represents the relevance score output by the kth neuron of the current layer; is the activation value of the jth neuron; is the connection weight; To prevent small constants with zero denominator (such as can be ).
[0132] In this embodiment, for network structures containing ReLU activation functions, LRP-γ or LRP-0 rules can be used to enhance the contribution weight of the forward connection path and improve the recognition sensitivity of key clinical features.
[0133] After layer-by-layer back propagation, each input feature (such as PCT abnormality 3 days after surgery, cosine similarity of redness keywords in disease history record, etc.) obtains a non-negative correlation score, which reflects its positive contribution to the final risk judgment. The importance scores of all features are arranged in descending order and can be presented through a visual interface, including but not limited to forceplot, waterfall chart or honeycomb heat map, to help clinicians understand the basis of model decision-making. For example, when a patient is judged as high risk, the system automatically generates an explanation report: this warning is mainly driven by the following factors: 1. Cutaneous purulent exudation occurred during the course of the disease with a semantic similarity of 0.85 (contribution +32%); 2. No high-level antibacterial drugs were used on the 7th day after surgery (+25%); 3. White blood cell count continued to rise (+18%). This individual-level explanation can enhance the trust and acceptance of doctors to the system, and is helpful for making timely intervention decisions in real clinical environment.
[0134] It should be noted that the LRP explanation process in this embodiment only acts on the deep learning component (such as neural network-based learning) in the risk prediction model, while for models with inherent explainability such as logistic regression and decision tree, their coefficients or splitting paths are directly output as the basis for explanation. The overall explanation module is integrated into the output end of the early warning system and is pushed to the doctor workstation or hospital infection management platform simultaneously with the risk prompt, forming a closed loop of prediction, explanation and intervention.
[0135] In some embodiments, the predefined infection semantic center vector is not static and unchangeable, but is configured as a dynamic updateable semantic benchmark. The system supports two triggering modes: one is periodic update, for example, automatically collecting the electronic medical record texts of patients clinically diagnosed as surgical site infections in the last period every month; the other is event-driven update, when a doctor marks a high-risk prompt as “real positive” in the early warning interface, the system will include it in the positive sample pool. Subsequently, the system performs natural language processing on the unstructured text records of such patients, identifies the medical entities related to surgical site infections therein, and generates corresponding context semantic vectors based on their context semantic information. After L2 normalization, all newly generated context semantic vectors are combined with the historical positive vectors to form an updated positive vector set. Finally, the system recalculates the arithmetic mean based on the set to update the predefined infection semantic center vector. Thereafter, in the risk prediction process of new patients, the cosine similarity will be recalculated using the updated semantic center vector, and the second type of feature variable will be adjusted accordingly to realize the continuous evolution and localized adaptation of the model knowledge.
[0136] To evaluate the actual performance of the risk prediction model constructed in this embodiment, the inventors conducted comparative tests on various mainstream machine learning algorithms and the multi-level fusion architecture proposed in this embodiment. All models are based on the same candidate feature matrix and are trained and evaluated under consistent data division, cross-validation strategy and hyperparameter optimization conditions to ensure fairness of comparison. The experiment is divided into two stages: the first stage (as shown in Table 1) evaluates the modeling ability of each base learner on the training set; the second stage (as shown in Table 2) uses an independent data set from another hospital (Hospital B) for external validation to test the generalization performance of the model. The results show that on the training set, support vector machine (SVM) achieves the highest AUC value (0.988), showing strong fitting ability; however, in the external validation set, its performance decreases significantly (AUC drops to 0.859), indicating that it has obvious overfitting tendency and cross-institution adaptability defects. In contrast, the multi-level fusion model proposed in this invention, which includes a meta-learner and a dynamic selection layer, has good discrimination ability (AUC = 0.974) in the training stage, and more importantly, in the external validation, it not only does not show significant decay, but also shows stronger stability and recognition ability (AUC as high as 0.990), significantly better than all base learners and other traditional ensemble methods. The above results show that by introducing a dynamic weighted fusion mechanism based on sample confidence, this embodiment can effectively improve the adaptability and robustness of the model across different medical institutions, solving the problem of performance decay of traditional models due to differences in data distribution.
[0137] Table 1:
[0138]
[0139]
[0140] The embodiment integrates the structured clinical indicators and the unstructured electronic medical record text, comprehensively integrates the multi-dimensional perioperative diagnosis and treatment information of the patient, and breaks through the technical limitation of the traditional early warning method which only relies on structured data to cause the risk assessment to be one-sided. For the unstructured text, the Chinese natural language processing technology is used to deeply analyze the semantic of the free text such as the medical history record and the operation record, the cosine similarity between the context vector and the pre-defined infection semantic center vector is calculated, the high-precision identification of the medical entity related to the surgical site infection and the quantitative representation of the clinical relevance are realized, and thus the key infection clues hidden in the free text are effectively mined.
[0141] To further improve the generalization ability and robustness of the model in the real clinical scene, the embodiment constructs a multi-layer fusion risk prediction model including multiple base learners, meta learners and a dynamic selection layer. The model trains each base learner through a stratified cross-validation strategy grouped by patients, and uses the cross-validation external prediction results to construct a meta feature matrix, and the meta learners complete the preliminary integration; on this basis, the dynamic selection layer is further introduced, and the lightweight selection model generates the final risk assessment result by weighting fusion between the output of the meta learner and the output of the single base learner with the best performance determined in the cross-validation stage according to the prediction confidence and distribution characteristics of the input sample. This mechanism realizes adaptive decision at the sample level and shows stronger stability when facing edge cases or out-of-distribution samples. In addition, to address the problem of labeled data scarcity in the medical field, the embodiment uses a contrastive learning method based on a twin neural network to construct a semantic matching model, and continuously expands high-quality training samples through a pseudo-label iteration strategy, thereby improving the semantic understanding ability of the model under the condition of few samples. At the same time, all base learners are subjected to probability calibration processing to ensure the reliability of the output results; and the model decision-making process is analyzed in reverse by a layer-by-layer correlation propagation method to generate individual-level risk attribution analysis reports and visual charts, thereby enhancing the transparency and clinical acceptability of the model decision-making. It can be understood that the embodiment not only improves the early warning accuracy of surgical site infections, but also reduces the cost of manual monitoring, provides interpretable and traceable auxiliary decision support, and helps clinicians identify high-risk patients and take targeted intervention measures in a timely manner.
[0142] Figure 7 A structural schematic diagram of a surgical site infection early warning device according to an embodiment of the present application is shown. Illustratively, the surgical site infection early warning device includes:
[0143] The acquisition module 100 is configured to acquire the perioperative electronic medical record data of the target patient, and the electronic medical record data includes structured clinical indicators and unstructured text records.
[0144] The generating module 200 is configured to standardize the structured clinical indicators to generate the first type of feature variables, and perform natural language processing on the unstructured text records to obtain at least one medical entity related to the surgical site infection, and generate the second type of feature variables based on context semantic information of each medical entity.
[0145] The fusing module 300 is configured to fuse the first type of feature variables and the second type of feature variables to form a candidate feature matrix.
[0146] The output module 400 is configured to input the candidate feature matrix into a pre-trained risk prediction model to output a risk result of the target patient suffering from the surgical site infection; wherein the risk prediction model comprises a plurality of base learners, a meta-learner and a dynamic selection layer, the dynamic selection layer is configured to perform weighted fusion between an output of the meta-learner and an output of a single base learner with optimal performance determined based on a comprehensive evaluation index in a verification phase based on a prediction confidence of an input sample, to generate a final risk assessment result.
[0147] It can be understood that the device of the embodiment corresponds to the surgical site infection early warning method of the above-mentioned embodiment, and the optional items in the above-mentioned embodiment are also applicable to the present embodiment, so the description is not repeated here.
[0148] The present application also provides a terminal device, which exemplarily comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the functions of each module of the above-mentioned surgical site infection early warning method or the above-mentioned surgical site infection early warning device by running the computer program.
[0149] The processor can be an integrated circuit chip with a signal processing capability. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof. The general-purpose processor can be a microprocessor, or the processor can be any conventional processor, etc., and can implement or execute the disclosed methods, steps, and logical block diagrams in the embodiments of the present application.
[0150] The memory can be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM) and the like. Among them, the memory is used to store a computer program, and the processor can execute the computer program correspondingly after receiving an execution instruction.
[0151] The application further provides a computer readable storage medium for storing the computer program used in the terminal device. For example, the computer readable storage medium can include, but is not limited to, a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk and various program code storage media.
[0152] In several embodiments provided in the application, it should be understood that the disclosed apparatus and method can also be implemented by other ways. The apparatus embodiments described above are only schematic, for example, the flow charts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the apparatus, method and computer program product according to the embodiments of the application. In this regard, each block in the flow chart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that, in alternative implementation ways, the functions noted in the block can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the structural diagram and / or flow chart, and the combination of blocks in the structural diagram and / or flow chart, can be implemented by a special hardware-based system for executing the specified functions or actions, or can be implemented by a combination of special hardware and computer instructions. In addition, the functional modules or units in each embodiment of the application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0153] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0154] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be encompassed in the protection scope of the present application.
Claims
1. A method for early warning of surgical site infection, characterized in that, include: Acquire perioperative electronic medical record data of the target patient, wherein the electronic medical record data includes structured clinical indicators and unstructured text records; The structured clinical indicators are standardized to generate a first type of feature variable, and the unstructured text records are processed by natural language to obtain at least one medical entity related to surgical site infection. A second type of feature variable is generated based on the contextual semantic information of each medical entity. The first type of feature variables and the second type of feature variables are fused to form a candidate feature matrix; The candidate feature matrix is input into a pre-trained risk prediction model to output the risk of surgical site infection in the target patient. The risk prediction model includes multiple base learners, a meta-learner, and a dynamic selection layer. The dynamic selection layer is configured to perform a weighted fusion between the prediction confidence based on the input sample and the output of the meta-learner and the single base learner output with the best performance determined based on a comprehensive evaluation index during the validation phase, so as to generate the final risk assessment result. The training process of the risk prediction model includes: constructing a training sample set based on historical patient data with known infection status labels; performing hierarchical cross-validation by patient group on the training sample set to ensure that data from the same patient are in the same training subset or the same validation subset; in each round of cross-validation, training all base learners through the training subset and obtaining the probability prediction values of each base learner based on the corresponding validation subset; wherein, in each round of cross-validation, the probability prediction values of each base learner are calibrated; concatenating the probability prediction values of each base learner in all rounds to form a meta-feature matrix; and training the meta-learner based on the meta-feature matrix to obtain the preliminary risk results of the risk prediction model. The meta-learner is a deep neural network. During training, the input features of the meta-learner, in addition to the meta-feature matrix, also include auxiliary features reflecting prediction uncertainty. The auxiliary features include at least one of the following: the standard deviation of the prediction probability of each basic learner, the prediction entropy, and the degree of divergence between models.
2. The surgical site infection early warning method according to claim 1, characterized in that, The step of performing natural language processing on the unstructured text records to obtain at least one medical entity related to surgical site infection includes: The unstructured text records are subjected to normalized preprocessing to obtain preprocessed text; The preprocessed text is segmented using a word segmentation algorithm combined with a medical terminology dictionary to obtain the segmentation results. Based on the word segmentation results and a predefined infection vocabulary, at least one medical entity is identified.
3. The surgical site infection early warning method according to claim 2, characterized in that, The generation of the second type of feature variables based on the contextual semantic information of each of the medical entities includes: Obtain the contextual semantic information within a preset range for the current medical entity; Each word in the context semantic information is mapped to a corresponding numerical vector, and a weighted average is calculated according to the influence weight to obtain the context vector corresponding to the current medical entity. Calculate the cosine similarity between the context vector and the predefined infection semantic center vector; wherein, the predefined infection semantic center vector is obtained by taking the mean of the context vectors of infection description texts labeled as positive. Based on the cosine similarity, and combined with the frequency of occurrence of the medical entity, the negation recognition result, the semantic type of adjacent modifiers, and the number of days between the first occurrence time and the surgery date, structured semantic features are generated as the second type of feature variables.
4. The surgical site infection early warning method according to claim 1, characterized in that, After outputting the risk result of surgical site infection in the target patient, the method further includes: The risk prediction model decision process is reverse-analyzed using layer-by-layer correlation propagation to quantify the importance of each feature in the candidate feature matrix to the risk outcome.
5. The surgical site infection early warning method according to claim 1, characterized in that, The training process of the risk prediction model also includes: After training the meta-learner, the meta-learner output, the optimal base learner output, and the auxiliary features reflecting the prediction uncertainty are obtained for the target samples in each of the validation subsets. The target weight coefficient is determined based on the matching degree between the meta-learner output, the optimal base learner output, and the true label. Using the auxiliary features as input and the target weight coefficient as a supervision signal, the dynamic selection layer is trained to predict the dynamic weight coefficient, and the final risk assessment result is output based on the dynamic weight coefficient, the meta-learner output, and the optimal base learner output.
6. The surgical site infection early warning method according to claim 5, characterized in that, The final risk assessment result is obtained based on a prediction formula; The prediction formula is: ;in, The final risk assessment result is as follows. The output of the meta-learner, The output result of the optimal base learner is... These are dynamic weighting coefficients.
7. The surgical site infection early warning method according to claim 1, characterized in that, The base learner includes at least two of the following: decision tree, support vector machine, random forest, gradient boosting tree, K-nearest neighbor classifier, logistic regression model, and Naive Bayes.
8. The surgical site infection early warning method according to claim 3, characterized in that, Prior to obtaining at least one medical entity associated with surgical site infection, the procedure also includes: A semantic matching model based on Siamese neural networks is constructed to learn the semantic embedding space of the electronic medical record data.
9. The surgical site infection early warning method according to claim 8, characterized in that, The construction process of the semantic matching model includes: Construct positive sample pairs and negative sample pairs; wherein, the positive sample pairs contain semantically similar clinical description texts, and the negative sample pairs contain semantically dissimilar clinical description texts; The positive or negative sample pairs in each pair of texts are input into two branches of the Siamese neural network. After processing by a text encoder with shared weights, the corresponding low-dimensional semantic vectors are obtained. The model is then trained using a contrastive learning loss function to generate an initial semantic matching model. The Siamese neural network consists of a text encoder with shared weights and a dimension reduction projection head. Based on the initial semantic matching model, similarity prediction is performed on candidate text segments in unlabeled electronic medical record data. Samples with confidence scores higher than a preset threshold are selected, assigned pseudo-labels, added to the training set, and the model is iteratively fine-tuned to obtain the target semantic matching model.
10. The surgical site infection early warning method according to claim 9, characterized in that, The target semantic matching model is used to generate the context vector of the medical entity and determine the predefined infection semantic center vector based on the mean of the semantic vectors of high-confidence infections.
11. A surgical site infection early warning device, characterized in that, include: The acquisition module is used to acquire the perioperative electronic medical record data of the target patient, the electronic medical record data including structured clinical indicators and unstructured text records; The generation module is used to standardize the structured clinical indicators to generate a first type of feature variables, and to perform natural language processing on the unstructured text records to obtain at least one medical entity related to surgical site infection, and to generate a second type of feature variables based on the contextual semantic information of each medical entity. The fusion module is used to fuse the first type of feature variables with the second type of feature variables to form a candidate feature matrix; An output module is used to input the candidate feature matrix into a pre-trained risk prediction model to output the risk result of surgical site infection in the target patient; wherein, the risk prediction model includes multiple base learners, a meta-learner, and a dynamic selection layer, the dynamic selection layer being configured to perform a weighted fusion between the prediction confidence based on the input sample and the output of the meta-learner and the single base learner output with the best performance determined based on a comprehensive evaluation index during the validation phase, to generate the final risk assessment result; The training process of the risk prediction model includes: constructing a training sample set based on historical patient data with known infection status labels; performing hierarchical cross-validation by patient group on the training sample set to ensure that data from the same patient are in the same training subset or the same validation subset; in each round of cross-validation, training all base learners through the training subset and obtaining the probability prediction values of each base learner based on the corresponding validation subset; wherein, in each round of cross-validation, the probability prediction values of each base learner are calibrated; concatenating the probability prediction values of each base learner in all rounds to form a meta-feature matrix; and training the meta-learner based on the meta-feature matrix to obtain the preliminary risk results of the risk prediction model. The meta-learner is a deep neural network. During training, the input features of the meta-learner, in addition to the meta-feature matrix, also include auxiliary features reflecting prediction uncertainty. The auxiliary features include at least one of the following: the standard deviation of the prediction probability of each basic learner, the prediction entropy, and the degree of divergence between models.
12. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the surgical site infection early warning method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed on a processor, implements the surgical site infection early warning method according to any one of claims 1-10.
Citation Information
Patent Citations
In-hospital infection early warning construction method based on hospital information system
CN109065178A
Wound infection risk assessment method and system
CN116705325A