Method and system for predicting duration of mechanical ventilation based on future clinical status guidance

By converting early multivariate time series data of mechanical ventilation into pseudo-token embeddings and guiding the language model to learn future clinical states during the training phase, the problem of inaccurate prediction of mechanical ventilation duration in existing technologies is solved, and more accurate prediction results are achieved.

CN122867964BActive Publication Date: 2026-11-24QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611307388.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-24
Estimated Expiration
2046-08-27

AI Technical Summary

Technical Problem

Existing technologies are insufficient to fully learn the implicit relationship between early clinical dynamics and subsequent ventilation evolution, and are also insufficient to reflect the relationship between different physiological systems in patients, resulting in inaccurate prediction of mechanical ventilation duration.

Method used

By converting early multivariate time series data of mechanical ventilation into pseudo-token embeddings and constructing future clinical state windows during the training phase, a time-delay-enhanced segment representation is generated using convolutional neural networks and pre-trained language models, combined with patient background information and observation masks, to predict the duration of mechanical ventilation.

Benefits of technology

It improves the ability to capture early warning signs of prolonged mechanical ventilation, enhances the ability to model complex dynamic processes, and improves the accuracy and usability of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122867964B_ABST
    Figure CN122867964B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of medical time series analysis and discloses a method and system for predicting mechanical ventilation duration based on future clinical state guidance. The method includes: acquiring monitoring data within an early observation window and generating initial fragment embeddings; forming clinical contextual cues based on patient background information; extracting temporal embeddings through a convolutional neural network, jointly modulating them with clinical variable group gating vectors and missing modulation coefficients to obtain a time-delay-enhanced fragment representation, and correcting it with contextual cues; mapping the corrected representation to a pseudo-token embedding via cross-attention mapping, concatenating it with the cues, and inputting it into a pre-trained language model to output a predicted ventilation duration value; constructing a future clinical state window during the training phase, and training the trainable network parameters using consistency loss. This invention, while avoiding the leakage of future information, utilizes subsequent clinical evolution signals to enhance the capture of early warning features, thereby improving prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical time series analysis, specifically to a method and system for predicting the duration of mechanical ventilation based on future clinical conditions. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Mechanical ventilation is a commonly used life support method in intensive care units, widely applied in clinical scenarios such as respiratory failure, shock, postoperative monitoring, and multiple organ dysfunction. The duration of mechanical ventilation is related to various factors, including the severity of the patient's condition, respiratory mechanics, oxygenation level, circulatory function, level of consciousness, infection, and metabolic status.

[0004] Existing technologies often employ pre-trained language models, using supervised training with early monitoring numerical sequences and final ventilation duration labels to predict mechanical ventilation duration. However, this prediction method often fails to fully learn the implicit relationships between early clinical dynamics and subsequent ventilation evolution, and it also struggles to fully reflect the relationships between different physiological systems in patients, the missing observation patterns commonly found in ICU data, and patient background information. Especially in mechanical ventilation scenarios, ventilation parameters, oxygenation status, circulatory status, level of consciousness, and laboratory indicators do not change in isolation; the same set of dynamic changes may have different meanings in different patient contexts. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for predicting mechanical ventilation duration based on future clinical status. This invention transforms early multivariate time series data of mechanical ventilation into pseudo-token embeddings containing medical information that can be processed by a pre-trained language model. During the training phase, a future clinical status window is constructed to guide the language model in learning prodromal features related to mechanical ventilation outcomes.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for predicting mechanical ventilation duration based on future clinical status is provided, including: Acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context cues; The initial segment embedding is input into a convolutional neural network to obtain a temporal embedding; the initial segment embedding is converted into a gating vector; missing modulation coefficients are generated through an observation mask; the temporal embedding, gating vector, and missing modulation coefficients are fused and modulated, and then fused with the initial segment embedding to obtain a time-delayed enhanced segment representation; The representation of the time-lag enhanced segment is corrected based on the clinical context cues to obtain the corrected segment representation; The corrected fragment representation is mapped to a pseudo-token embedding through a cross-attention mechanism, concatenated with the clinical context cue, and input into a pre-trained language model to extract sample-level representations and output a predicted value of mechanical ventilation duration. During training, a future clinical state window is constructed after the early observation window, and a future state prediction result is generated by a prediction neural network; the sample-level representation is mapped to an early future state estimate; and a loss function is constructed based on the future state prediction result and the early future state estimate.

[0007] Furthermore, the step of constructing a loss function based on the future state prediction results and the early future state estimates specifically involves: constructing a future guidance consistency loss based on the future state prediction results and the early future state estimates; constructing dynamic training weights based on the degree of inconsistency between the early future state and the future state prediction results; constructing a total loss function based on the mechanical ventilation duration regression loss, the future state detection loss, the future guidance consistency loss, and the dynamic training weights, and training the trainable network parameters; the model parameters of the pre-trained language model are kept frozen during the training process.

[0008] Furthermore, the early observation window is a monitoring data window within a preset time period after the start of mechanical ventilation, used to acquire early dynamic monitoring data of mechanical ventilation; the future clinical status window is a monitoring data window within a preset time period after the early observation window, constructed only during the training phase, used to characterize the patient's subsequent clinical evolution status.

[0009] Furthermore, the convolutional neural network is specifically a multi-scale convolutional neural network including local temporal convolution and extended temporal convolution; the initial segment embedding is input into the convolutional neural network to obtain the temporal embedding, specifically: short-term fluctuation features between adjacent segments are extracted by local temporal convolution, mid-range time delay change features between interval segments are extracted by extended temporal convolution, and the two types of temporal features are adaptively combined by learnable fusion coefficients to output the temporal embedding.

[0010] Furthermore, the step of acquiring monitoring data within the early observation window and obtaining multiple initial fragment embeddings through fragment embedding specifically involves: constructing an observation mask based on the monitoring data within the early observation window, concatenating the monitoring data and the observation mask into an initial input, and dividing the initial input into multiple initial fragment embeddings.

[0011] Furthermore, the step of generating missing modulation coefficients through the observation mask specifically involves: calculating the observation rate and the time since the last observation for each segment based on the observation mask, and generating missing modulation coefficients based on the observation rate and the time since the last observation to represent the influence of the observation state and observation interval within the segment on the dynamic features.

[0012] Secondly, a mechanical ventilation duration prediction system based on future clinical status guidance is provided, including: The data acquisition and preprocessing module is configured to: acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context prompts; The clinical time delay perception dynamic feature enhancement module is configured to: input the initial segment embedding into a convolutional neural network to obtain a temporal embedding; convert the initial segment embedding into a gating vector; generate missing modulation coefficients through an observation mask; fuse and modulate the temporal embedding, gating vector, and missing modulation coefficients, and then fuse them with the initial segment embedding to obtain a time delay enhanced segment representation; The clinical context cue correction module is configured to: correct the time-delay enhanced segment representation based on the clinical context cue to obtain the corrected segment representation; The large model inference and prediction output module is configured to: map the corrected fragment representation into a pseudo-token embedding through a cross-attention mechanism, concatenate it with the clinical context prompt, input it into a pre-trained language model, extract sample-level representations, and output the predicted value of mechanical ventilation duration. The future state-guided training module is configured to: construct a future clinical state window after the early observation window during training; generate future state prediction results through a prediction neural network; map the sample-level representation to an early future state estimate; and construct a loss function based on the future state prediction results and the early future state estimate.

[0013] Thirdly, an electronic device is also provided, comprising: Memory is used to store computer-readable instructions in a non-transitory manner. Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.

[0014] Fourthly, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the method described in the first aspect above.

[0015] Fifthly, a computer program product is provided, employing the following technical solution: A computer program product includes software code, wherein a program in the software code performs the steps of the method described in the first aspect of the present invention.

[0016] The above technical solution has the following advantages or beneficial effects: (1) In the training phase, the present invention uses the subsequent clinical evolution signals in the future clinical state window to guide the training phase of the language model, so that the language model can not only learn the direct correspondence between the early observation window and the final ventilation duration or the risk label of prolonged ventilation, but also learn the intermediate evolution relationship between early variable changes, missing observation patterns and patient background and subsequent ventilation process, thereby improving the ability to capture the early warning features of prolonged mechanical ventilation risk.

[0017] (2) This invention performs multidimensional clinical context co-modulation before pseudo-token generation, enabling the relationships between clinical variable groups, missing observation patterns, patient background information, and future clinical state guidance signals to work together on the dynamic segment representation. Compared with simply splicing multi-source information, this method can complete the representation correction for mechanical ventilation scenarios before entering the pre-trained language model, thereby improving the adaptability between medical numerical time series and the language model embedding space.

[0018] (3) This invention, through the combined modulation of clinical variable group gating and missing observations, can simultaneously utilize information from different physiological system variables such as ventilation settings, oxygenation status, circulatory status, neurological consciousness, and laboratory indicators, as well as missing pattern information such as observation mask, observation rate, and time since last observation in ICU data. This design helps the model distinguish between the different clinical meanings reflected by changes in variable values ​​and changes in monitoring frequency, and improves the modeling ability for complex dynamic processes in the early stages of mechanical ventilation.

[0019] (4) This invention uses patient static clinical context cues for individualized correction of dynamic fragment representations and limits the future clinical state window to use during the training phase. Thus, the same changes in ventilation parameters or oxygenation status can be interpreted in combination with different patient backgrounds; during the deployment and inference phases, only early observation window data, observation masks, and patient static clinical context information are input, which improves the model's ability to identify early clinical prodromal features and its usability in actual clinical auxiliary analysis scenarios while avoiding future information leakage. Attached Figure Description

[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0021] Figure 1 This is a flowchart of a method for predicting mechanical ventilation duration based on future clinical status, as described in a specific embodiment of the present invention. Detailed Implementation

[0022] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0023] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] In this embodiment of the invention, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of this invention, "multiple" refers to two or more.

[0025] Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0026] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0027] All data acquisition in this embodiment complies with legal and regulatory requirements and has been agreed upon by the user, and the data is used legally.

[0028] Example 1 This embodiment provides a method for predicting mechanical ventilation duration based on future clinical status, including: S101: Acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context prompts; S102: The initial segment embedding is input into a convolutional neural network to obtain a temporal embedding; the initial segment embedding is converted into a gating vector; missing modulation coefficients are generated through an observation mask; the temporal embedding, gating vector, and missing modulation coefficients are fused and modulated and then fused with the initial segment embedding to obtain a time-delayed enhanced segment representation; S103: Correct the representation of the time-delayed enhanced segment based on the clinical context prompts to obtain the corrected segment representation; S104: The corrected fragment representation is mapped to a pseudo-token embedding through a cross-attention mechanism, concatenated with the clinical context cue, and input into a pre-trained language model to extract sample-level representations and output the predicted value of mechanical ventilation duration. S105: During training, a future clinical state window is constructed after the early observation window, and a future state prediction result is generated by a prediction neural network; the sample-level representation is mapped to an early future state estimate; and a loss function is constructed based on the future state prediction result and the early future state estimate.

[0029] In this embodiment, S101 specifically includes: S101.1: Obtain the monitoring data within the early observation window, construct an observation mask based on the monitoring data, and concatenate the monitoring data and the observation mask as the initial input.

[0030] S101.1.1: Obtain monitoring data within the early observation window.

[0031] Let the start time of the i-th mechanical ventilation event be . The end time is The mechanical ventilation duration label Defined as: ; in, The unit is hours.

[0032] For the risk assessment of extended mechanical ventilation, this embodiment sets a threshold. , The value is set based on the commonly used clinical definition of prolonged mechanical ventilation and is used to construct a binary risk label for prolonged mechanical ventilation. This threshold is only used for classifier label construction and does not affect the continuous duration prediction task. It can be adjusted according to actual needs in different application scenarios. .For example =168 hours, corresponding to 7 days, construct binary classification labels. : ; in, This indicates an indicator function that takes the value 1 when the condition is met, and 0 otherwise.

[0033] The first T hours after the start of mechanical ventilation are used as the early observation window. In some embodiments, an optional setting is T=24, that is, dynamic monitoring information within 24 hours after the start of mechanical ventilation is used to predict the duration of subsequent ventilation.

[0034] The set of monitoring data variables in the early observation window Recorded as: ; In this embodiment, C represents the number of monitored variables, which is specifically set to 15. - These correspond to inhaled oxygen concentration, positive end-expiratory pressure, set respiratory rate, spontaneous respiratory rate, total respiratory rate, tidal volume, minute ventilation, plateau pressure, blood oxygen saturation, heart rate, mean arterial pressure, Glasgow Coma Scale (GCS) score, lactate, creatinine, and white blood cell count, respectively. It should be understood that those skilled in the art may also select other monitoring data to constitute the set of monitoring data variables according to actual needs.

[0035] Construct hourly monitoring data sequences for the i-th sample. : ; Where T represents the length of the early observation window.

[0036] S101.1.2: Construct the observation mask for the i-th sample within the early observation window. : ; in, express The element corresponding to the c-th variable at hour t.

[0037] This embodiment performs forward padding or zeroing on missing values, retains the observation mask, and simultaneously receives variable values ​​and observation status.

[0038] S101.1.3: Concatenate the monitoring data sequence and the observation mask into the initial input. : ; in, This represents the monitoring data matrix for the i-th sample within the early observation window; This indicates that the monitoring data matrix will be used. With observation mask matrix The initial input obtained after concatenating the variable dimensions.

[0039] S101.2: Divide the initial input into multiple initial segments for embedding.

[0040] Initial input Sliding segmentation is performed according to a fixed segment length L and step size S to obtain... A time segment: ; in, This represents the k-th time segment of the i-th sample. This represents the starting time index of the k-th time segment, and L represents the segment length, S represents the sliding step size, and K represents the number of time segments obtained from the early observation window.

[0041] Each time segment is linearly mapped to obtain the segment embedding: ; in, This represents the k-th time segment of the i-th sample. This indicates a vectorization operation used to expand a time segment matrix into a one-dimensional vector; The segment embedding is represented by a linear mapping matrix. Indicates the fragment embedding bias term. This represents the segment embedding corresponding to the k-th time segment.

[0042] All fragment embeddings are arranged into a matrix, which serves as the initial fragment embedding. : ; in, This represents the initial fragment embedding matrix for the i-th sample. Indicates the number of time segments. This indicates the dimension of each segment embedding.

[0043] S101.3: Obtain patient background information and convert it into clinical context clues; The duration of mechanical ventilation is affected not only by dynamic monitoring data but also by the patient's static background. Obtaining patient background information and organizing it into natural language prompts is crucial. : ; in, For age, For gender, For the ICU ward, For admission type, As a source of hospital admissions, This refers to the time interval between ICU admission and the start of mechanical ventilation.

[0044] Natural language prompts, derived from the pre-trained language model and its associated word segmentation and word embedding layers, provide clinical contextual cues. : ; in, This indicates the word segmenter used with the pre-trained language model, which is used to convert natural language prompts into token sequences; This indicates the word embedding layer used in the pre-trained language model, which maps the token sequence to embedding vectors. To indicate the length, This provides the embedding dimension for the language model. In this embodiment, the pre-trained language model can be GPT, LLaMA, or other pre-trained language models. Those skilled in the art can also choose other pre-trained language models as needed.

[0045] In this embodiment, S102 specifically includes: S102.1: The initial segment is embedded into the convolutional neural network to obtain the temporal embedding.

[0046] To capture short-term fluctuations and mid-range delays in early monitoring sequences of mechanical ventilation, this embodiment utilizes a convolutional neural network (CNN) to extract temporal embeddings. Specifically, this CNN is a multi-scale CNN comprising local temporal convolution and extended temporal convolution. The multi-scale CNN simultaneously extracts dynamic features at different time scales using both local and extended temporal convolutions, and adaptively combines the two types of temporal features using learnable fusion coefficients.

[0047] ; ; ; ; in, This represents the local variation features obtained by local temporal convolution. This represents the mid-range time delay variation characteristics obtained by extended temporal convolution; This represents local temporal convolution, used to capture short-term changes between adjacent segments; This represents a temporal convolution operator with an expansion scale of d, used to extract mid-range time delay variation features between time interval segments; This represents the pooling operation, used to embed fragments into a matrix. Converging into sample-level vectors; and These represent the learnable weight matrix and bias term for generating the time-delay fusion coefficients, respectively; These are sample-level time-delay fusion coefficients, used to adaptively adjust the contributions of local variation features and time-delay variation features; For the activation function, ReLU or GELU can be used. This represents the Sigmoid activation operation, used to output learnable fusion weights in the 0-1 range. This represents element-wise multiplication. Let represent the time-delay-aware temporal embedding matrix of the i-th sample.

[0048] The time-delay-aware temporal embedding matrix of the i-th sample It can simultaneously express short-term fluctuations and delayed changes in early monitoring sequences of mechanical ventilation.

[0049] S102.2: Convert the initial fragment embedding into a gated vector.

[0050] S102.2.1: Based on the initial fragment embedding corresponding original dynamic variables, the dynamic variables are divided into several clinical variable groups: ; These correspond to ventilation settings, oxygenation status, circulatory status, neurological awareness, and laboratory indicators, respectively.

[0051] For any clinical variable group Extract the original dynamic variable input belonging to the variable group from the k-th time segment of the i-th sample, and generate a group-level representation through pooling operation: ; in, Indicates the index of clinical variable groups , This indicates that the i-th sample belongs to the variable group in the k-th time segment. The original dynamic variable input, Represents a group of variables The corresponding group-level representation.

[0052] Expand the group-level representations corresponding to the five clinical variable groups as follows: And concatenate them to generate a gated vector:

[0053] in, and Let these represent the learnable weight matrix and bias term of the gating map, respectively. This represents the clinical variable group gating vector corresponding to the k-th time segment of the i-th sample.

[0054] This gating vector serves as the input to the joint modulation unit, representing the modulation weights of different clinical variable groups on the time-delay perception dynamic features.

[0055] With the above design, the language model used for prediction can adaptively enhance the variable group information that is more relevant to the current task based on the clinical status of different patients within the observation window.

[0056] S102.3: Generate missing modulation coefficients by observing the mask.

[0057] Considering that missing patterns in ICU data may reflect monitoring frequency and the degree of attention paid to patients' conditions, this embodiment further extracts fragment-level missing features from the observation mask.

[0058] Let the first The observation mask matrix corresponding to each segment is: ,in, Let represent the observation mask element corresponding to the t-th time position and the c-th dynamic variable within the k-th time segment of the i-th sample. Then the segment observation rate is... for: ; Further define the time since the last observation : ; in, This represents the time interval between the c-th dynamic variable in the i-th sample and the last valid observation at hour t. This represents the time interval corresponding to the variable in the previous hour. For the k-th segment... Pooling is performed to obtain a fragment-level time interval representation. .

[0059] Generate missing modulation coefficients based on observation rate and time interval: ; in, and These represent the learnable weight matrix and bias term of the missing modulation mapping, respectively. This represents the missing observation modulation coefficient corresponding to the k-th time segment of the i-th sample.

[0060] Missing observation modulation coefficients, used as input to the joint modulation unit, represent the impact of observation state and observation interval within a segment on dynamic features. This structure, when applied to predictive language models, can distinguish between two types of information: "changes in the variable's numerical value itself" and "variables that have not been observed for a long time."

[0061] S102.4: The temporal embedding, gating vector, and missing modulation coefficients are fused and modulated, and then fused with the initial segment embedding to obtain the time-delay enhanced segment representation.

[0062] The temporal embedding, gate vector, and missing modulation coefficients are fused and modulated to obtain the modulated dynamic features: ; in, express The temporal embedding corresponding to the k-th time segment; This represents the clinical variable group gating vector corresponding to the k-th time segment of the i-th sample; This represents the missing observation modulation coefficient corresponding to the k-th time segment of the i-th sample; This represents the dynamic characteristics of the k-th time segment after being gated by clinical variables and modulated by missing observations.

[0063] By embedding and fusing dynamic features with the initial fragment, a time-delay enhanced fragment representation is obtained. : ; in, To output the mapping matrix, the corresponding time segments are... Composition of the modulated dynamic feature matrix . The layer normalization operation is used to perform layer normalization on the summed feature matrix, thus completing the standardization process of the feature scale.

[0064] In this embodiment, S103 specifically refers to: Dynamic monitoring sequences for mechanically ventilated patients need to be understood in conjunction with patient background information. For example, the same changes in PEEP or FiO2 may correspond to different medical conditions in patients of different ages, in different ICU wards, with different admission types, and at different times of ventilation initiation. Therefore, this embodiment generates patient-level modulation vectors based on clinical context cues and uses them to correct for time-delayed enhancement segments.

[0065] First, embedding clinical context clues. Pooling is performed to obtain the sample-level context vector. : ; in, This can be accomplished through mean pooling, max pooling, or the hidden state of the last token.

[0066] Subsequently, a context modulation vector is generated using a multilayer perceptron. : ; in d is consistent with the fragment embedding dimension output by step S102.

[0067] The modulation vector is applied to the time-delay enhancement segment as follows: ; in This represents element-wise multiplication. This represents the time-delay augmentation segment corresponding to the k-th time segment under the i-th sample.

[0068] Furthermore, to avoid excessive context modulation, this embodiment introduces a learnable scaling factor to control the context modulation intensity: ; in, This represents the time-delay enhancement segment output in step S102; This represents the segment representation after being processed by the patient-level context modulation vector; For learnable scaling factors, when When smaller, it is closer to the original dynamic segment representation, when As the value gradually increases, the clinical context suggests an enhanced modulatory effect on the dynamic sequence representation; This is the corrected segment representation.

[0069] This step allows the clinical context to not only be concatenated as a natural language cue to the front end of the language model input, but also to perform individualized correction of the time series segment representation before dynamic pseudo-token generation.

[0070] This embodiment organizes gating information, missing observation modulation information, clinical context cues, and temporal embedding into a phased collaborative modulation mechanism. Instead of simply concatenating multiple types of information as independent inputs, this mechanism sequentially corrects the representation of the same dynamic segment before generating the medical pseudo-token. Specifically, temporal embedding is used to represent short-term fluctuations and mid-range time lag changes in the early monitoring sequence; gating information is used to represent the relative contribution of different clinical variable groups to the prediction task within the current observation window; missing observation modulation information is used to represent the monitoring intensity and observation interval of different variables; and clinical context cues are used to represent the patient's basic background, admission status, and ventilation initiation-related status.

[0071] The aforementioned information is first applied to the time-lag perception temporal embedding during the clinical time-lag perception dynamic feature enhancement process, through the combined action of gating vectors and missing modulation coefficients, to obtain modulated dynamic features. Subsequently, residual fusion is used to form a time-lag enhanced segment representation. Then, patient-level modulation vectors are generated based on clinical context prompts to individually correct the time-lag enhanced segment representation. Through this phased collaborative modulation, the model can simultaneously utilize dynamic changes, monitoring patterns, patient background, and future clinical evolution constraints during the training phase before generating medical pseudo-tokens. This ensures that the input received by the subsequent pre-trained language model is no longer just a direct mapping of numerical sequences, but a medical segment representation corrected for mechanical ventilation scenario constraints.

[0072] In this embodiment, S104 specifically includes: S104.1: Map the corrected fragment representation to a pseudo-token embedding through a cross-attention mechanism.

[0073] To map medical fragment representations to the language model embedding space, a cross-attention reprogramming layer is specifically used.

[0074] Let the word embedding matrix of the pre-trained language model be... for: ; in, This indicates the size of the vocabulary of the pre-trained language model. This represents the embedding dimension of the language model. The set of semantic prototypes is obtained through linear mapping. ; in, Represents the semantic prototype mapping matrix. Indicates the number of semantic prototypes. This represents the set of semantic prototypes obtained by word embedding mapping from a pre-trained language model.

[0075] by For the query, use semantic prototype R as the key and value: ; Where Q, K, and V represent the query matrix, key matrix, and value matrix in the cross-attention mechanism, respectively. , , These represent the corresponding learnable projection matrices.

[0076] Cross-attention output is: ; ; in, Represents the dimension of the key vector. Represents the cross-attention weight matrix. This indicates cross-attention output.

[0077] After output mapping, the pseudo-token embedding is obtained: ; in, This represents the output mapping matrix. This represents the embedded medical pseudo-token obtained from the mapping.

[0078] It should be understood that the pseudo token generated in this embodiment is a pseudo token that includes medical information.

[0079] S104.2: Concatenate clinical context cues with pseudo-token embeddings, input them into a pre-trained language model, extract sample-level representations, and output predicted mechanical ventilation duration values.

[0080] S104.2.1: Concatenate clinical context cues with pseudo-token embeddings and input them into the pre-trained language model.

[0081] Clinical context hints Embedded with pseudo token splicing: ; in, This represents the joint embedding sequence input to the pre-trained language model.

[0082] Will Input to a frozen or nearly frozen pre-trained language model: ; S104.2.2: The pre-trained language model extracts sample-level representations and outputs predicted values ​​for mechanical ventilation duration.

[0083] The output hidden state at the corresponding position of the pseudo-token is extracted and pooled to obtain the sample-level representation. : ; For the mechanical ventilation duration prediction task, the output is: ; in, This indicates the mechanical ventilation duration returning to the output head. This represents a sample-level representation. This represents the predicted duration of mechanical ventilation in logarithmic space. This represents the predicted duration of mechanical ventilation after being restored to an hourly scale.

[0084] The regression loss for mechanical ventilation duration was calculated using the Smooth L1 loss: ; in, Indicates the actual duration of mechanical ventilation The training labels after logarithmic transformation, i.e. .

[0085] In some embodiments, the pre-trained language model can also perform extended mechanical ventilation risk assessment. For the extended mechanical ventilation risk assessment task, the output is: ; in, This indicates the extension of the mechanical ventilation risk classification output head. This indicates the predicted probability that the sample belongs to the risk category of prolonged mechanical ventilation.

[0086] The risk classification loss for extended mechanical ventilation is calculated using a weighted binary cross-entropy method. ; Where B represents the batch size. This indicates that the risk of prolonged mechanical ventilation has been accurately labeled. This represents the positive class weight coefficient, used to alleviate class imbalance.

[0087] In this embodiment, S105 specifically refers to: S105.1: Constructing a window into future clinical states.

[0088] The future clinical status window follows the early observation window. Let the early observation window for the i-th mechanically ventilated sample be . ,in T represents the time of mechanical ventilation initiation, and T represents the length of the early observation window. Further, a future clinical status window is constructed following this observation window, for example... ,in This represents the length of the future state window. The future clinical state window is only used during the training phase.

[0089] S105.2: Generate future state prediction results through a predictive neural network.

[0090] Extracting future dynamic sequences from future clinical status windows : ; in, Indicates the length of the future clinical status window. This indicates the number of clinical variables available within the future window. Future clinical variables include future oxygenation parameters, ventilator parameters, vital signs, level of consciousness, laboratory indicators, weaning attempt records, and events indicating escalation or de-escalation of ventilation support. Accordingly, a future observation mask is constructed. : ; And form future state characteristics : ; By inputting the future state features into a prediction neural network consisting of an encoder that encodes the future state and a prediction head, a representation of the future state is obtained: First, the future state representation is obtained based on the characteristics of the future state. : ; in, The future state encoder can be implemented using any of the following: a temporal convolutional network, a Transformer encoder, a recurrent neural network, or a multilayer perceptron. In this embodiment, a Transformer encoder is used. It is used to extract a clinical evolution representation of the patient after the early observation window from the future state features.

[0091] Construct future state labels based on clinical changes within the future window. Examples of potential complications include worsening oxygenation, increased ventilatory support, difficulty weaning from mechanical ventilation, persistent high-level respiratory support, circulatory instability, or deteriorating laboratory parameters. The future state prediction head represents the future state. Output the future state prediction results: ; in, and Let these represent the learnable weight matrix and bias term of the future state prediction head, respectively. This represents the future state prediction result output by the future state detection branch.

[0092] The corresponding future state detection loss is: ; in, This represents the binary cross-entropy loss.

[0093] S105.3: Map sample-level representations to early future state estimates.

[0094] Pre-trained language models obtain early predictive representations using only early observation window data during prediction. It outputs the predicted duration of mechanical ventilation or the probability of prolonged mechanical ventilation.

[0095] To enable the pre-trained language model to learn the relationship between early information and future clinical evolution during the training phase, sample-level representations are further mapped to early future state estimates. : ; in, and Let these represent the learnable weight matrix and bias term of the early future state estimation head, respectively. This represents the early future state estimation result obtained by the main prediction branch based on the early observation window.

[0096] S105.4: Calculate the consistency loss between the future state prediction and the early future state estimate.

[0097] Based on the future state prediction results and the early future state estimates, a future-guided consistency loss is constructed: ; in, This can be achieved using mean squared error, cross-entropy, or KL divergence. This indicates that gradient backpropagation for future state detection predictions is stopped under this consistency constraint.

[0098] S105.5: Train the parameters of the trainable network.

[0099] This embodiment constructs dynamic training weights based on the degree of inconsistency between the early future state estimate and the future state prediction results: ; in, is a non-negative hyperparameter. When there is a large difference between the future state prediction and the early future state estimate, it indicates that the early language model has not fully captured the prodromal features related to subsequent clinical evolution. In this case, the contribution of this sample to the training objective should be increased.

[0100] When simultaneously performing regression of mechanical ventilation duration and prediction of risk classification for prolonged mechanical ventilation, the total loss function can be expressed as: ; in, For the regression loss of mechanical ventilation duration, To extend the risk classification loss of mechanical ventilation, Loss detection for future conditions To guide future consistency loss, , , and The weighting coefficient is used to balance the contribution of each loss term to the total loss function. Its value can be set as a hyperparameter according to the performance of the validation set or the magnitude of each loss term.

[0101] When predicting only the duration of mechanical ventilation, the total loss function can be expressed as: ; in, , and The weighting coefficient is used to balance the contribution of each loss term to the total loss function. Its value can be set as a hyperparameter according to the performance of the validation set or the magnitude of each loss term.

[0102] The pre-trained language model parameters are frozen during training, and only the network parameters involved in S101-S103, the cross-attention reprogramming layer, and the prediction neural network are trained during the training phase.

[0103] After training, the pre-trained language model only receives early observation window data, observation masks, and clinical context information, and outputs a predicted value for the duration of mechanical ventilation or a probability of prolonged mechanical ventilation. Thus, this invention transforms subsequent clinical evolution signals into representational constraints for the training phase without causing leakage of future information during the inference phase, enabling the main prediction model to recognize early clinical prodromal features.

[0104] The present invention is illustrated below with a specific implementation process based on mechanical ventilation data from the MIMIC-IV database. This specific implementation process is for illustrative purposes only and does not limit the scope of protection of the present invention.

[0105] First, records related to invasive mechanical ventilation were screened from the operational event table, and adjacent ventilation records with short time intervals during the same ICU stay were merged to obtain monitoring data. The duration in hours of each event was calculated as a regression label, and a prolonged mechanical ventilation label was constructed using 168 hours as a threshold.

[0106] Secondly, the first 24 hours after the start of mechanical ventilation were used as the early observation window. Ventilator parameters, vital signs, and laboratory test variables were extracted and aggregated hourly. For missing variables, forward imputation or zero imputation was used, while observation masks were preserved. Dynamic variables used in the project included FiO2, PEEP, set respiratory rate, spontaneous respiratory rate, total respiratory rate, tidal volume, minute ventilation, plateau pressure, SpO2, heart rate, mean arterial pressure, GCS, lactate, creatinine, and white blood cell count.

[0107] Then, patient age, gender, ICU ward, admission type, admission origin, and the time from ICU admission to the start of ventilation are organized into clinical context cues. The initial segment embedding is input into a convolutional neural network to obtain a temporal embedding; the initial segment embedding is converted into a gating vector; missing modulation coefficients are generated using an observation mask; the temporal embedding, gating vector, and missing modulation coefficients are fused and modulated, then fused with the initial segment embedding to obtain a time-delayed enhanced segment representation; the time-delayed enhanced segment representation is corrected according to the clinical context cues to obtain the corrected segment representation.

[0108] Subsequently, a future clinical status window, such as 24 to 48 hours or 24 to 72 hours, was constructed in the training samples after the start of mechanical ventilation. This future window was used to extract subsequent clinical evolution signals such as FiO2, PEEP, SpO2, mean arterial pressure, GCS, lactate, creatinine, white blood cell count, weaning attempt records, and changes in ventilation support intensity, and to form future status inputs and future status labels.

[0109] A predictive neural network is used to generate future state predictions based on a future clinical state window; a language model generates sample-level representations and mechanical ventilation duration predictions based on an early observation window. During training, the language model learns the precursor features of subsequent ventilation evolution by jointly constraining future state detection loss, future guidance consistency loss, and dynamic training weights.

[0110] Once the model is trained and deployed, in actual use, only the early observation window data after the start of mechanical ventilation, the observation mask, and the patient's clinical context information need to be input. The jointly modulated segment representation is mapped to a pseudo-token embedding through a reprogramming layer and concatenated with clinical context prompts before being input into the pre-trained language model. Finally, the predicted value of the duration of mechanical ventilation or the probability of prolonged mechanical ventilation is output.

[0111] Example 2 This embodiment provides a mechanical ventilation duration prediction system based on future clinical status guidance, including: The data acquisition and preprocessing module is configured to: acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context prompts; The clinical time delay perception dynamic feature enhancement module is configured to: input the initial segment embedding into a convolutional neural network to obtain a temporal embedding; convert the initial segment embedding into a gating vector; generate missing modulation coefficients through an observation mask; fuse and modulate the temporal embedding, gating vector, and missing modulation coefficients, and then fuse them with the initial segment embedding to obtain a time delay enhanced segment representation; The clinical context cue correction module is configured to: correct the time-delay enhanced segment representation based on the clinical context cue to obtain the corrected segment representation; The large model inference and prediction output module is configured to: map the corrected fragment representation into a pseudo-token embedding through a cross-attention mechanism, concatenate it with the clinical context prompt, input it into a pre-trained language model, extract sample-level representations, and output the predicted value of mechanical ventilation duration. The future state-guided training module is configured to: construct a future clinical state window after the early observation window during training; generate future state prediction results through a prediction neural network; map the sample-level representation to an early future state estimate; and construct a loss function based on the future state prediction results and the early future state estimate.

[0112] It should be noted that the data acquisition and preprocessing module, the clinical time delay perception dynamic feature enhancement module, the clinical context cue correction module, the large model inference and prediction output module, and the future state guided training module mentioned above correspond to steps S101 to S105 in Embodiment 1. The examples and application scenarios implemented by the above modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0113] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0114] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.

[0115] Example 3 This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1.

[0116] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0117] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0118] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0119] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0120] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0121] Example 4 Embodiment 4 of the present invention provides a computer-readable storage medium.

[0122] A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the method as described in Embodiment 1 of the present invention.

[0123] The detailed steps are the same as those provided in Example 1, and will not be repeated here.

[0124] Example 5 Embodiment 5 of the present invention provides a computer program product.

[0125] A computer program product includes software code, wherein the program in the software code performs the steps described in Embodiment 1 of the present invention.

[0126] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for predicting mechanical ventilation duration based on future clinical conditions, characterized in that, include: Acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context cues; The initial segment embedding is input into a convolutional neural network to obtain a temporal embedding; the initial segment embedding is converted into a gating vector; missing modulation coefficients are generated through an observation mask; the temporal embedding, gating vector, and missing modulation coefficients are fused and modulated, and then fused with the initial segment embedding to obtain a time-delayed enhanced segment representation; The representation of the time-lag enhanced segment is corrected based on the clinical context cues to obtain the corrected segment representation; The corrected fragment representation is mapped to a pseudo-token embedding through a cross-attention mechanism, concatenated with the clinical context cue, and input into a pre-trained language model to extract sample-level representations and output a predicted value of mechanical ventilation duration. During training, a future clinical state window is constructed after the early observation window, and a prediction neural network is used to generate future state prediction results. The sample-level representation is mapped to an early future state estimate; a loss function is constructed based on the future state prediction results and the early future state estimate.

2. The method for predicting mechanical ventilation duration based on future clinical status as described in claim 1, characterized in that, The step of constructing a loss function based on the future state prediction result and the early future state estimate specifically involves: constructing a future guidance consistency loss based on the future state prediction result and the early future state estimate; and constructing dynamic training weights based on the degree of inconsistency between the early future state and the future state prediction result. Based on the regression loss of mechanical ventilation duration, the future state detection loss, the future guidance consistency loss, and the dynamic training weights, a total loss function is constructed to train the trainable network parameters; the model parameters of the pre-trained language model are kept frozen during the training process.

3. The method for predicting mechanical ventilation duration based on future clinical status as described in claim 1, characterized in that, The early observation window is a monitoring data window within a preset time period after the start of mechanical ventilation, used to acquire early dynamic monitoring data of mechanical ventilation; the future clinical status window is a monitoring data window within a preset time period after the early observation window, constructed only during the training phase, used to characterize the patient's subsequent clinical evolution status.

4. The method for predicting mechanical ventilation duration based on future clinical status as described in claim 1, characterized in that, The convolutional neural network is specifically a multi-scale convolutional neural network including local temporal convolution and extended temporal convolution. The initial segment embedding is input into the convolutional neural network to obtain the temporal embedding. Specifically, the short-term fluctuation features between adjacent segments are extracted by local temporal convolution, the mid-range time delay change features between interval segments are extracted by extended temporal convolution, and the two types of temporal features are adaptively combined by learnable fusion coefficients to output the temporal embedding.

5. The method for predicting mechanical ventilation duration based on future clinical status as described in claim 1, characterized in that, The process of acquiring monitoring data within the early observation window and obtaining multiple initial fragment embeddings through fragment embedding specifically involves: constructing an observation mask based on the monitoring data within the early observation window, concatenating the monitoring data and the observation mask into an initial input, and dividing the initial input into multiple initial fragment embeddings.

6. The method for predicting mechanical ventilation duration based on future clinical status as described in claim 1, characterized in that, The method of generating missing modulation coefficients through observation mask is as follows: calculate the observation rate and the time since the last observation for each segment based on the observation mask, and generate missing modulation coefficients based on the observation rate and the time since the last observation to represent the influence of the observation state and observation interval within the segment on the dynamic features.

7. A mechanical ventilation duration prediction system based on future clinical status guidance, characterized in that, include: The data acquisition and preprocessing module is configured to: acquire monitoring data within the early observation window and obtain multiple initial fragment embeddings through fragment embedding; acquire patient background information and convert it into clinical context prompts; The clinical time delay perception dynamic feature enhancement module is configured to: input the initial segment embedding into a convolutional neural network to obtain a temporal embedding; convert the initial segment embedding into a gating vector; generate missing modulation coefficients through an observation mask; fuse and modulate the temporal embedding, gating vector, and missing modulation coefficients, and then fuse them with the initial segment embedding to obtain a time delay enhanced segment representation; The clinical context cue correction module is configured to: correct the time-delay enhanced segment representation based on the clinical context cue to obtain the corrected segment representation; The large model inference and prediction output module is configured to: map the corrected fragment representation into a pseudo-token embedding through a cross-attention mechanism, concatenate it with the clinical context prompt, input it into a pre-trained language model, extract sample-level representations, and output the predicted value of mechanical ventilation duration. The future state-guided training module is configured to: construct a future clinical state window after the early observation window during training; generate future state prediction results through a prediction neural network; map the sample-level representation to an early future state estimate; and construct a loss function based on the future state prediction results and the early future state estimate.

8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method for predicting mechanical ventilation duration based on future clinical state as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the steps in the method for predicting mechanical ventilation duration based on future clinical status as described in any one of claims 1-6.

10. A computer program product, comprising software code, characterized in that, The program in the software code performs the steps in the method for predicting mechanical ventilation duration based on future clinical status as described in any one of claims 1-6.

Citation Information

Patent Citations

  • ICU critical patient multi-mode risk early warning system based on deep learning

    CN121983309A

  • Method and system for detecting false news generated by large language model based on Transform

    CN122241496A