Machine learning based drainage fluid anomaly analysis and identification method and system

By collecting the color and flow rate characteristics of drainage fluid in real time, generating individualized baseline deviation sequences and performing multimodal feature fusion, and using a temporal neural network to predict bleeding trends, the problem of insufficient accuracy in early warning of abnormal drainage fluid in existing technologies has been solved, realizing personalized monitoring and efficient early warning.

CN121862370BActive Publication Date: 2026-07-07THE FIRST MEDICAL CENT CHINESE PLA GENERAL HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
THE FIRST MEDICAL CENT CHINESE PLA GENERAL HOSPITAL
Filing Date
2025-12-31
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies are not accurate enough in early warning of abnormal drainage fluid, especially bleeding trends, fail to take into account individual patient differences, and fail to effectively capture the temporal dynamic characteristics of drainage fluid parameters.

Method used

By collecting the color and flow rate characteristics of the drainage fluid in real time, individualized baseline parameters are extracted, a baseline deviation sequence is generated, and temporal evolution features are extracted at multiple time scales. Multimodal evolution trajectory features are fused, and a pre-trained temporal neural network is used to predict bleeding trends and output early warning signals.

Benefits of technology

It enables personalized monitoring of drainage fluid abnormalities, improves the accuracy of abnormality detection, captures short-term fluctuations and long-term trend changes, and enhances the ability to identify abnormal patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121862370B_ABST
    Figure CN121862370B_ABST
Patent Text Reader

Abstract

The application provides a machine learning-based drainage fluid anomaly analysis and identification method and system, relates to the technical field of machine learning, and comprises the following steps: collecting the color and flow rate characteristics of drainage fluid in real time; extracting individualized baseline parameters to calculate baseline deviation sequences; extracting time sequence evolution characteristics and flow rate change characteristics on multiple time scales, and fusing to obtain multi-modal evolution trajectory characteristics; estimating future bleeding volume through a prediction algorithm and giving an early warning; and recording the early warning instance as a new sample to update algorithm parameters. The application can timely and accurately identify drainage fluid anomalies and improve the accuracy of bleeding early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to machine learning technology, and more particularly to a method and system for analyzing and identifying abnormal drainage fluid based on machine learning. Background Technology

[0002] Postoperative drainage is an important measure to drain fluid from the cavity after surgery. Medical staff usually need to regularly observe the color, characteristics and flow rate of the drainage fluid to assess the patient's postoperative recovery.

[0003] Existing technologies have significant shortcomings in early warning of abnormal drainage fluid, especially bleeding trends. Current systems typically use uniform standard thresholds for judgment, failing to consider individual patient differences, resulting in limited accuracy in identifying abnormal states in different patients. Most systems only focus on static characteristics at a single point in time, ignoring the temporal dynamic characteristics of changes in drainage fluid parameters, making it difficult to capture gradual trends and thus affecting the effectiveness of early warning. Summary of the Invention

[0004] This invention provides a method and system for analyzing and identifying abnormal drainage fluid based on machine learning, which can solve the problems in the prior art.

[0005] A first aspect of the present invention provides a machine learning-based method for analyzing and identifying abnormal drainage fluid, comprising:

[0006] The color and flow rate characteristics of the drainage fluid are collected in real time to obtain an optical absorption coefficient sequence and a fluid outflow volume sequence characterizing hemoglobin concentration. Statistical analysis is performed on the optical absorption coefficient sequence within a preset observation window to extract individualized baseline parameters. The deviation of the current optical absorption coefficient from the individualized baseline parameters is calculated to generate a baseline deviation sequence.

[0007] Temporal evolution features are extracted from the baseline deviation sequence at multiple time scales, and flow velocity change features are extracted from the liquid outflow volume sequence at corresponding time scales. These features are then fused to obtain multimodal evolution trajectory features.

[0008] The multimodal evolution trajectory features are input into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period. When the estimated bleeding volume exceeds a preset boundary, a warning signal is output.

[0009] The multimodal evolution trajectory features of the monitoring instances that have already issued early warning signals, along with the actual bleeding volume, are recorded as new samples to update the parameters of the prediction algorithm.

[0010] The steps of statistically analyzing the optical absorption coefficient sequence within a preset observation window, extracting individualized baseline parameters, calculating the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generating a baseline deviation sequence include:

[0011] Within a preset observation window, the optical absorption coefficient sequence is segmented into time series. The rate of change and fluctuation amplitude of the optical absorption coefficient in each segment are calculated. Stable time periods with a rate of change lower than the dynamic convergence criterion and a fluctuation amplitude within a stable range are identified. Anomaly detection is performed on the optical absorption coefficient data in the stable time periods. By calculating the degree of deviation of each data point from its neighboring data points, abnormal fluctuation points with a deviation exceeding the robustness threshold are removed.

[0012] Statistical feature values ​​are calculated based on stable period data after removing abnormal fluctuation points, and individualized baseline parameters representing physiological stability are extracted. The individualized baseline parameters include central trend benchmark value and fluctuation tolerance parameter.

[0013] At each time point after the preset observation window, the current optical absorption coefficient is obtained, the difference between the current optical absorption coefficient and the central trend baseline value is calculated, and the difference is normalized according to the fluctuation tolerance parameter to obtain a standardized deviation amplitude value; the standardized deviation amplitude values ​​obtained at each time point in chronological order are arranged sequentially to generate a baseline deviation sequence.

[0014] The steps of extracting temporal evolution features from the baseline deviation sequence at multiple time scales, extracting velocity change features from the liquid outflow volume sequence at corresponding time scales, and fusing them to obtain multimodal evolution trajectory features include:

[0015] Multiple time scales are determined based on the temporal variation characteristics of drainage fluid monitoring data, with each time scale corresponding to a different time window length;

[0016] For each time scale, within the corresponding time window length, segments of the baseline deviation sequence and segments of the liquid outflow volume sequence are simultaneously extracted. The deviation amplitude change rate is extracted from the segments of the baseline deviation sequence, and the flow velocity acceleration is extracted from the segments of the liquid outflow volume sequence. The temporal correlation between the deviation amplitude change rate and the flow velocity acceleration is analyzed, and the temporal evolution characteristics and flow velocity change characteristics characterizing the dual-modal co-evolution mode are extracted.

[0017] Cross-scale consistency evaluation is performed on the dual-modal co-evolution patterns extracted at the multiple time scales, and fusion weights are assigned to the corresponding temporal evolution features and velocity change features according to the consistency strength at each time scale.

[0018] The temporal evolution features and flow velocity change features at each time scale are weighted and combined according to the fusion weight to generate multimodal evolution trajectory features.

[0019] The steps of performing cross-scale consistency evaluation on the dual-modal co-evolutionary patterns extracted at multiple time scales, and assigning fusion weights to the corresponding temporal evolution features and velocity change features based on the consistency strength at each time scale, include:

[0020] The synchronicity of the dual-mode co-evolution is quantified by calculating the cross-relation between the rate of change of the deviation amplitude and the flow velocity acceleration at different time scales. The cross-relation coefficient characterizes the phase consistency and amplitude correlation of the two modal signals in time.

[0021] For each time scale, the time series mean and stability index of the cross-correlation coefficient are calculated within the corresponding time window, and the time series mean is used as the consistency strength benchmark value for that time scale.

[0022] A cross-scale consistency assessment matrix is ​​established, where the matrix elements represent the correlation between consistency strength benchmarks at different time scales. The dominant consistency pattern is extracted through matrix eigenvalue decomposition, where the dominant consistency pattern is an evolution pattern in which the cross-correlation coefficients at multiple time scales all exceed the consistency threshold.

[0023] The initial fusion weights are calculated based on the consistency strength benchmark values ​​at each time scale and the contribution of that time scale to the dominant consistency mode. The initial fusion weights are then adjusted for reliability weighting in conjunction with the stability index. The adjusted weights are then subjected to normalization constraints and smoothing to generate a fusion weight allocation scheme.

[0024] The step of inputting the multimodal evolution trajectory features into a pre-trained bleeding trend prediction algorithm, wherein the prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period; and outputting a warning signal when the estimated bleeding volume exceeds a preset boundary includes:

[0025] The prediction algorithm employs a temporal neural network, comprising an input layer, a temporal feature extraction layer, and a regression output layer;

[0026] During the training phase, the input layer receives multimodal evolution trajectory features of historical cases, the temporal feature extraction layer learns temporal evolution patterns and extracts deep temporal representation features that reflect bleeding trends, the regression output layer maps the deep temporal representation features to predicted bleeding volume, and updates the network parameters by minimizing the prediction loss between the predicted bleeding volume and the actual bleeding volume using a backpropagation algorithm.

[0027] During the prediction phase, the multimodal evolution trajectory features are input into the trained temporal neural network, and the estimated bleeding volume in the future time period is calculated through the temporal feature extraction layer and the regression output layer; when the estimated bleeding volume exceeds the preset boundary, an early warning signal is output.

[0028] The steps for constructing the temporal neural network include:

[0029] The temporal neural network also includes an uncertainty estimation output layer, forming a dual-output layer architecture;

[0030] During the training phase, the regression output layer outputs the predicted hemorrhage value, and the uncertainty estimation output layer outputs the prediction uncertainty parameter. By minimizing the weighted sum of the prediction loss and the uncertainty estimation loss, the backpropagation algorithm is used to optimize the network parameters, enabling the temporal neural network to simultaneously output the estimated hemorrhage value and the prediction confidence.

[0031] During the prediction phase, the temporal neural network simultaneously outputs the estimated bleeding volume, cognitive uncertainty parameters, and random uncertainty parameters for a future time period, and calculates the prediction confidence based on the cognitive uncertainty parameters and random uncertainty parameters.

[0032] Based on the relationship between the estimated bleeding volume and the preset boundary, and the relationship between the prediction confidence and the reliability threshold, early warning signals with different risk level identifiers are generated.

[0033] During the training phase, the regression output layer outputs the predicted bleeding value, and the uncertainty estimation output layer outputs the prediction uncertainty parameter. The steps of optimizing the network parameters using the backpropagation algorithm by minimizing the weighted sum of the prediction loss and the uncertainty estimation loss include:

[0034] The prediction uncertainty parameters include cognitive uncertainty parameters and random uncertainty parameters. The Monte Carlo dropout method is used to estimate the cognitive uncertainty parameters. Different network structure configurations are sampled through multiple forward propagations, and the variance of the prediction output is calculated. The uncertainty estimation output layer directly learns the random uncertainty parameters and characterizes the inherent random fluctuations of the data by outputting the variance parameter of the prediction distribution.

[0035] A joint loss function is constructed, including a prediction loss term, a cognitive uncertainty calibration loss term, and a random uncertainty calibration loss term. The prediction loss term uses mean squared error to measure the deviation between the predicted value and the actual bleeding amount. The cognitive uncertainty calibration loss term is calibrated by comparing the prediction error with the cognitive uncertainty parameter. The random uncertainty calibration loss term optimizes the random uncertainty parameter using a negative log-likelihood function. An adaptive weight adjustment strategy is used to dynamically balance the three loss terms.

[0036] A second aspect of the present invention provides a machine learning-based drainage fluid abnormality analysis and identification system, comprising:

[0037] The data acquisition module is used to collect the color and flow rate characteristics of the drainage fluid in real time, and obtain the optical absorption coefficient sequence and fluid outflow volume sequence characterizing the hemoglobin concentration;

[0038] The baseline analysis module is used to perform statistical analysis on the optical absorption coefficient sequence within a preset observation window, extract individualized baseline parameters, calculate the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generate a baseline deviation sequence.

[0039] The feature fusion module is used to extract temporal evolution features from the baseline deviation sequence at multiple time scales, extract flow velocity change features from the liquid outflow volume sequence at corresponding time scales, and fuse them to obtain multimodal evolution trajectory features;

[0040] The prediction and early warning module is used to input the multimodal evolution trajectory features into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period. When the estimated bleeding volume exceeds a preset boundary, an early warning signal is output.

[0041] The model update module is used to record the multimodal evolution trajectory features and actual bleeding volume of the monitoring instances that have output early warning signals as new samples, which are used to update the parameters of the prediction algorithm.

[0042] A third aspect of the present invention provides an electronic device, comprising:

[0043] processor;

[0044] Memory used to store processor-executable instructions;

[0045] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0046] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0047] This invention, by real-time acquisition of the color and flow velocity characteristics of drainage fluid and extraction of individualized baseline parameters, can adapt to the differences in physiological characteristics among different patients, achieving personalized monitoring of drainage fluid abnormalities and improving the accuracy of abnormality detection. Based on a multi-timescale feature extraction method, it can simultaneously capture short-term fluctuations and long-term trend changes, fusing color and flow velocity features to form multimodal evolution trajectory features, comprehensively reflecting the dynamic changes in the state of drainage fluid and enhancing the ability to identify abnormal patterns. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating the machine learning-based method for analyzing and identifying abnormal drainage fluid according to an embodiment of the present invention.

[0049] Figure 2 This is a flowchart of the bleeding prediction training and real-time early warning process based on a temporal neural network. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0051] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes will not be repeated in some embodiments.

[0052] The color and flow rate characteristics of the drainage fluid are collected in real time to obtain an optical absorption coefficient sequence and a fluid outflow volume sequence characterizing hemoglobin concentration. Statistical analysis is performed on the optical absorption coefficient sequence within a preset observation window to extract individualized baseline parameters. The deviation of the current optical absorption coefficient from the individualized baseline parameters is calculated to generate a baseline deviation sequence.

[0053] Temporal evolution features are extracted from the baseline deviation sequence at multiple time scales, and flow velocity change features are extracted from the liquid outflow volume sequence at corresponding time scales. These features are then fused to obtain multimodal evolution trajectory features.

[0054] The multimodal evolution trajectory features are input into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period. When the estimated bleeding volume exceeds a preset boundary, a warning signal is output.

[0055] The multimodal evolution trajectory features of the monitoring instances that have already issued early warning signals, along with the actual bleeding volume, are recorded as new samples to update the parameters of the prediction algorithm.

[0056] In one optional implementation, the steps of statistically analyzing the optical absorption coefficient sequence within a preset observation window, extracting individualized baseline parameters, calculating the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generating a baseline deviation sequence include:

[0057] Within a preset observation window, the optical absorption coefficient sequence is segmented into time series. The rate of change and fluctuation amplitude of the optical absorption coefficient in each segment are calculated. Stable time periods with a rate of change lower than the dynamic convergence criterion and a fluctuation amplitude within a stable range are identified. Anomaly detection is performed on the optical absorption coefficient data in the stable time periods. By calculating the degree of deviation of each data point from its neighboring data points, abnormal fluctuation points with a deviation exceeding the robustness threshold are removed.

[0058] Statistical feature values ​​are calculated based on stable period data after removing abnormal fluctuation points, and individualized baseline parameters representing physiological stability are extracted. The individualized baseline parameters include central trend benchmark value and fluctuation tolerance parameter.

[0059] At each time point after the preset observation window, the current optical absorption coefficient is obtained, the difference between the current optical absorption coefficient and the central trend baseline value is calculated, and the difference is standardized according to the fluctuation tolerance parameter to obtain the standardized deviation amplitude value; the standardized deviation amplitude values ​​obtained at each time point in chronological order are arranged sequentially to generate a baseline deviation sequence.

[0060] For example, in a drainage fluid monitoring system, the color characteristics of the drainage fluid are acquired in real time using an optical sensor. The optical sensor emits a light beam of a specific wavelength that passes through the drainage fluid, receives the transmitted or reflected light signals, and calculates the optical absorption coefficient according to the Beer-Lambert law. The higher the hemoglobin concentration, the stronger the absorption of light of a specific wavelength, and the larger the optical absorption coefficient. The acquisition frequency can be set to once per second or once every two seconds to ensure that subtle color changes can be captured.

[0061] Simultaneously, the flow rate characteristics of the drainage fluid are monitored using a flow sensor. The flow sensor can employ ultrasonic Doppler principles or volumetric measurement principles to record the volume of liquid flowing through the sensor per unit time in real time. The continuously collected volume data are accumulated to form a liquid outflow volume sequence. This sequence records the cumulative outflow change from the start of monitoring to the current moment.

[0062] The optical absorption coefficient data collected by the optical sensor are arranged in chronological order to form an optical absorption coefficient sequence. This sequence reflects the dynamic change of the color characteristics of the drainage fluid over time, providing raw data for subsequent baseline analysis.

[0063] When performing statistical analysis on the optical absorption coefficient sequence within a preset observation window, it is first necessary to determine an appropriate observation window length. In practical applications, this window can be set to 5 to 10 minutes, which is sufficient to capture stable physiological characteristics without introducing significant physiological fluctuations due to excessive length.

[0064] For the temporal segmentation of the optical absorption coefficient sequence, a sliding window method is used for analysis. Specifically, the optical absorption coefficient sequence within a preset observation window is divided into several segments in chronological order, each containing data points ranging from 30 seconds to 1 minute. Adjacent segments can have up to 50% overlap to ensure that important transitional information is not missed.

[0065] Within each segment, the rate of change and fluctuation amplitude of the optical absorption coefficient are calculated. The rate of change is obtained by dividing the difference between the first and last data points within the segment by the time interval, representing the change in the optical absorption coefficient per unit time. The fluctuation amplitude is measured by calculating the standard deviation of the data points within the segment, reflecting the degree of dispersion of the data within that segment.

[0066] Identifying stable periods requires setting dynamic convergence criteria and a stability range threshold. The dynamic convergence criterion can be set as the rate of change of the optical absorption coefficient per unit time being less than 1%; the stability range threshold can be defined as the fluctuation amplitude (standard deviation) not exceeding 3% of the baseline value. When three or more consecutive segments simultaneously meet both conditions, the time interval covered by these segments is identified as a stable period.

[0067] For identified stable periods, outlier detection is performed to further improve data quality. Specifically, the difference between each data point and the median of its five preceding and following data points is calculated. If this difference exceeds three times the standard deviation within the stable period, the point is marked as an outlier and removed. This local median-based detection method is robust and effectively identifies sudden anomalies without being affected by slow trend changes.

[0068] After outlier removal, statistical characteristic values ​​are calculated using the remaining stable period data. The central trend baseline is the median of the data after outlier removal, rather than the mean, to reduce the impact of extreme values. The specific calculation steps are as follows: sort the stable period data after outlier removal by numerical value, and take the middle value as the median. If the number of data points is even, the average of the two middle values ​​is taken. This median is the central trend baseline, representing the typical optical absorption coefficient level of the individual under physiologically stable conditions.

[0069] The volatility tolerance parameter is calculated using the modified interquartile range (IQR). The sorted stable period data is divided into four equal parts, and the difference between the third quartile (Q3, the 75th percentile) and the first quartile (Q1, the 25th percentile) is calculated; that is, the modified interquartile range IQR = Q3 - Q1. This parameter reflects the natural range of data fluctuation and is more robust than the standard deviation, less susceptible to extreme values. 1.5 times the IQR is used as the volatility tolerance parameter for subsequent standardization.

[0070] For physiological indicators with obvious fluctuation characteristics, fluctuation frequency analysis can be introduced. Periodic changes can be identified through fast Fourier transform and incorporated into individualized baseline characteristics. For example, if periodic fluctuations caused by respiration are detected, the amplitude range of these periodic fluctuations can be included in the calculation of fluctuation tolerance.

[0071] During the continuous monitoring phase following the preset observation window, the difference between each newly acquired optical absorption coefficient value and the central trend baseline value is calculated. To ensure comparability of deviations across different individuals or time periods, standardization is required. Specifically, the difference is divided by the fluctuation tolerance parameter to obtain the standardized deviation magnitude. For example, if the optical absorption coefficient at a certain moment exceeds the central trend baseline value by one fluctuation tolerance, the standardized deviation magnitude is 1.0.

[0072] The standardized deviation value can be used to set alarm thresholds. Typically, a standardized deviation value between 2.0 and 3.0 is set as a warning threshold, and above 3.0 as an alarm threshold. This means that when the optical absorption coefficient exceeds 2 to 3 times the normal fluctuation range of an individual, an anomaly is indicated.

[0073] The standardized deviation values ​​calculated at consecutive time points are arranged chronologically to form a baseline deviation sequence. This sequence reflects the degree of deviation of the optical absorption coefficient over time from the individual steady state, providing basic data for subsequent trend analysis and anomaly detection.

[0074] Baseline deviation sequences can be further smoothed through filtering to reduce the impact of short-term random fluctuations. Methods such as 5-point moving averages or exponentially weighted moving averages can be used to preserve the main trend information in the deviation sequence while reducing noise interference.

[0075] Furthermore, for long-term monitoring scenarios, a dynamic update mechanism for baseline parameters can be introduced. Individualized baseline parameters should be reassessed and updated at fixed intervals (e.g., every 4 hours) to accommodate slow changes in physiological state. During updates, a smooth transition between old and new baseline parameters should be implemented to avoid abrupt changes in monitoring results.

[0076] The baseline deviation sequence obtained by the above method can accurately reflect the changing trend of individual physiological parameters relative to their own stable baseline, improve the accuracy and individualized adaptability of abnormal signal detection, reduce the false alarm rate and false negative rate caused by individual differences, and provide a reliable data processing method for automated monitoring.

[0077] In one optional implementation, the steps of extracting temporal evolution features from the baseline deviation sequence at multiple time scales, extracting velocity change features from the liquid outflow volume sequence at corresponding time scales, and fusing them to obtain multimodal evolution trajectory features include:

[0078] Multiple time scales are determined based on the temporal variation characteristics of drainage fluid monitoring data, with each time scale corresponding to a different time window length;

[0079] For each time scale, within the corresponding time window length, segments of the baseline deviation sequence and segments of the liquid outflow volume sequence are simultaneously extracted. The deviation amplitude change rate is extracted from the segments of the baseline deviation sequence, and the flow velocity acceleration is extracted from the segments of the liquid outflow volume sequence. The temporal correlation between the deviation amplitude change rate and the flow velocity acceleration is analyzed, and the temporal evolution characteristics and flow velocity change characteristics characterizing the dual-modal co-evolution mode are extracted.

[0080] Cross-scale consistency evaluation is performed on the dual-modal co-evolution patterns extracted at the multiple time scales, and fusion weights are assigned to the corresponding temporal evolution features and velocity change features based on the consistency of dual-modal co-evolution at each time scale obtained from the evaluation.

[0081] The temporal evolution features and flow velocity change features at each time scale are weighted and combined according to the fusion weight to generate multimodal evolution trajectory features.

[0082] For example, drainage fluid monitoring data typically exhibits multi-layered temporal change patterns, such as short-term fluctuations, medium-term trends, and long-term evolution. Therefore, three time scales—short-term, medium-term, and long-term—can be set, each corresponding to a different time window length. The short-term time window can be set to 5 minutes, suitable for capturing instantaneous changes in drainage fluid parameters; the medium-term time window can be set to 30 minutes, reflecting relatively stable trends; and the long-term time window can be set to 2 hours, helping to identify the overall evolution pattern.

[0083] After determining the time scale, for each time scale, segments of the baseline deviation sequence and segments of the liquid outflow volume sequence are simultaneously extracted within the corresponding time window length. For example, for a short 5-minute time window, baseline deviation data and liquid outflow volume data within 5 minutes prior to the current moment can be extracted simultaneously; for a medium-term 30-minute time window, relevant data within 30 minutes prior to the current moment are extracted; and the same applies to a long-term 2-hour time window.

[0084] The rate of change of the deviation is obtained by dividing the difference in baseline deviation between adjacent time points by the time interval. This rate of change sequence reflects the speed at which the baseline deviation changes over time; a positive value indicates an increase in the degree of deviation, and a negative value indicates a decrease in the degree of deviation. The instantaneous flow velocity is calculated based on the difference in liquid outflow volume between adjacent time points, and then the flow velocity sequence is subjected to adjacent-point difference operations to obtain the flow velocity acceleration. The flow velocity acceleration describes how quickly the drainage fluid velocity changes; a positive value indicates an increase in flow velocity, and a negative value indicates a decrease in flow velocity.

[0085] After obtaining the rate of change of deviation and the velocity acceleration, cross-correlation analysis is used to quantify the co-evolution relationship between the two sequences. Specifically, the time delay range is set to -30 seconds to +30 seconds, and the Pearson correlation coefficient is calculated at different time delays τ with a step size of 1 second, ranging from -1 to +1. All time delay values ​​are iterated to find the time delay τmax that maximizes the absolute value of the correlation coefficient and its corresponding maximum correlation coefficient rmax. This time delay reflects the temporal relationship between the two modes of change, while the maximum correlation coefficient quantifies the strength of the co-evolution. When the absolute value of rmax is greater than 0.6, a strong co-evolution relationship is considered to exist between the two modes; when it is between 0.3 and 0.6, a moderate co-evolution relationship is considered; and below 0.3, a weak co-evolution relationship is considered. Furthermore, the covariance of the two sequences can be calculated as an absolute quantitative indicator of the degree of linear correlation, and mutual information can be used as a measure of nonlinear dependence. Mutual information is obtained by constructing a two-dimensional joint probability distribution and calculating the KL divergence of its product with the marginal distribution.

[0086] In practical applications, such as monitoring abdominal drainage, increased baseline deviation often indicates changes in the properties of the drainage fluid, while flow velocity acceleration reflects the dynamic characteristics of changes in drainage fluid volume. The synergistic pattern of these two changes can more accurately indicate changes in the patient's condition. For example, when baseline deviation increases simultaneously with increased flow velocity (i.e., the correlation coefficient is positive and large), it indicates the presence of abnormal components in the drainage fluid and an increase in drainage volume, which is an early signal of complications.

[0087] After extracting bimodal co-evolutionary patterns at multiple time scales, a cross-scale consistency assessment is performed. The consistency assessment aims to determine which time scales' features are more representative and reliable. The specific assessment method includes two dimensions:

[0088] First, feature stability assessment. The time window for each time scale is moved forward multiple times, for example, 10 times, with each movement incrementing by 10% of the window length. At each moving point, the maximum correlation coefficient rmax and the corresponding time delay τmax are recalculated, resulting in a set of rmax values ​​and a set of τmax values. The coefficient of variation (COP) of these two sets of values ​​is calculated, which is the standard deviation divided by the mean. A smaller COP indicates more stable features extracted at that time scale. Generally, time scales with a COP less than 0.15 are marked as high stability, those between 0.15 and 0.3 as moderate stability, and those greater than 0.3 as low stability.

[0089] Second, cross-scale feature similarity assessment. The difference in the maximum correlation coefficient (rmax) extracted across different time scales is calculated. If the pairwise differences in rmax values ​​across the short-term, medium-term, and long-term time scales are all less than 0.2, the cross-scale features are considered to have high consistency, indicating that the cooperative change pattern is stable across multiple time scales. If the difference in rmax between any two time scales is greater than 0.4, the consistency is considered weak, and further selection of reliable time scales based on stability indicators is needed.

[0090] Based on the cross-scale consistency assessment results, fusion weights are assigned to the extracted temporal evolution features and velocity change features at each time scale. The allocation of fusion weights comprehensively considers both stability and consistency. Specifically, the stability score for each time scale (1 minus the coefficient of variation) is mapped to a range of 0 to 1 using L1 normalization. The consistency score (similarity calculated based on the rmax difference) is also mapped to a range of 0 to 1 using L1 normalization. The weighted average of the two scores is then used to obtain the comprehensive score, where stability accounts for 60% and consistency accounts for 40%. The comprehensive scores for each time scale are then normalized using L1 normalization so that the sum of the weights for the three time scales equals 1. For example, if the comprehensive scores for the short-term, medium-term, and long-term are 0.6, 0.9, and 0.5, respectively, the L1-normalized fusion weights would be approximately 0.3, 0.45, and 0.25, respectively.

[0091] The temporal evolution characteristics and flow velocity change characteristics at each time scale are weighted and combined according to fusion weights to generate multimodal evolution trajectory features. Specifically, the maximum correlation coefficient rmax, corresponding time delay τmax, covariance, and mutual information statistics at each time scale are multiplied by the fusion weight for that time scale. The weighted results from the three time scales are then summed to obtain the fused feature value. This comprehensive feature includes the coordinated changes in baseline deviation and fluid outflow volume at different time scales, providing a more comprehensive reflection of the dynamic evolution of drainage fluid parameters.

[0092] The multimodal evolution trajectory features obtained by the above method enhance the robustness and temporal resolution of the features, and reduce the limitations of a single time scale and noise interference.

[0093] In one optional implementation, the step of performing cross-scale consistency evaluation on the dual-modal co-evolutionary patterns extracted at the multiple time scales, and assigning fusion weights to the corresponding temporal evolution features and velocity change features based on the consistency strength at each time scale, includes:

[0094] The synchronicity of the dual-mode co-evolution is quantified by calculating the cross-relation between the rate of change of the deviation amplitude and the flow velocity acceleration at different time scales. The cross-relation coefficient characterizes the phase consistency and amplitude correlation of the two modal signals in time.

[0095] For each time scale, the time series mean and stability index of the cross-correlation coefficient are calculated within the corresponding time window, and the time series mean is used as the consistency strength benchmark value for that time scale.

[0096] A cross-scale consistency assessment matrix is ​​established, where the matrix elements represent the correlation between consistency strength benchmarks at different time scales. The dominant consistency pattern is extracted through matrix eigenvalue decomposition, where the dominant consistency pattern is an evolution pattern in which the cross-correlation coefficients at multiple time scales all exceed the consistency threshold.

[0097] The initial fusion weights are calculated based on the consistency strength benchmark values ​​at each time scale and the absolute values ​​of the components in the feature vector corresponding to the dominant consistency mode at that time scale. The initial fusion weights are then adjusted for reliability weighting in conjunction with the stability index. The adjusted weights are then constrained and smoothed to generate a fusion weight allocation scheme.

[0098] For example, the cross-correlation coefficient is used as a core metric to characterize the phase consistency and amplitude correlation of two modal signals in time. During the calculation, for three time scales—short-term (5 minutes), medium-term (30 minutes), and long-term (2 hours)—deviation rate of change and velocity acceleration sequences are acquired within their respective time windows. Taking the medium-term 30-minute window as an example, assuming a sampling interval of 1 second, this window contains 1800 data points. After aligning the two sequences, the time delay scan range is set to -30 seconds to +30 seconds, with a step size of 1 second, resulting in a total of 61 delay positions. At each delay position τ, the correlation coefficient between the deviation rate of change sequence and the velocity acceleration sequence delayed by τ seconds is calculated using the Pearson correlation coefficient formula, with a value ranging from -1 to +1. All 61 delay positions are traversed, and the correlation coefficient value corresponding to each position is recorded, forming the cross-correlation function curve for that time window. The same delay scan strategy and calculation method are used for the short-term and long-term time scales to ensure cross-scale comparability.

[0099] After obtaining the cross-correlation function curves for each time scale, the statistical characteristics of these curves need to be extracted to establish a benchmark value for consistency strength. For a single time window, the arithmetic mean of all 61 correlation coefficient values ​​on the cross-correlation function curve is calculated as the time-series mean for that window. This time-series mean reflects the average degree of coordination between the two modes of signals over the entire delay range; the closer the value is to +1 or -1, the stronger the coordination. Simultaneously, the standard deviation of these 61 correlation coefficient values ​​is calculated as a stability indicator. The smaller the standard deviation, the smaller the fluctuation of the cross-correlation coefficient at different delay positions, and the more stable the coordination mode. To enhance statistical reliability, a sliding window strategy is used to sample multiple times within a continuous time period before the current moment. Taking a mid-term 30-minute window as an example, the window is slid forward 10 times, each time by 3 minutes (10% of the window length), resulting in 10 sets of cross-correlation function curves. The average of the time-series means of these 10 sets of curves is calculated as the benchmark value for consistency strength at the mid-term time scale. Simultaneously, the standard deviation of these 10 time-series means is calculated as a stability indicator for that time scale. The sliding intervals for short-term and long-term time scales were adjusted proportionally: 30 seconds per slide for short-term and 12 minutes per slide for long-term, with 10 slides for each time scale to ensure statistical consistency. After this processing, a consistency strength benchmark and a stability index were obtained for each of the three time scales.

[0100] Establishing a cross-scale consistency assessment matrix requires quantifying the correlation between consistency strength benchmarks across different time scales. A 3x3 symmetric matrix is ​​constructed, with rows and columns corresponding to short-term, medium-term, and long-term time scales, respectively. The diagonal elements represent the consistency strength benchmarks for each time scale, while the off-diagonal elements represent the correlation between these benchmarks. The correlation is calculated by taking 10 time-series mean sequences obtained from sliding windows at each of the two time scales and calculating the Pearson correlation coefficient between these sequences. For example, if the 10 time-series mean sequences for the short-term time scale are sequence A and the 10 time-series mean sequences for the medium-term time scale are sequence B, then the element in the first row and second column of the matrix represents the correlation coefficient between sequence A and sequence B. This coefficient reflects the similarity between the short-term and medium-term co-evolutionary patterns. After calculating all matrix elements, eigenvalue decomposition is performed. This decomposition yields three eigenvalues ​​and their corresponding eigenvectors, which are then sorted from largest to smallest. The eigenvector corresponding to the largest eigenvalue reflects the direction of the co-evolutionary pattern with the strongest consistency across the three time scales, i.e., the dominant consistency pattern. The three components of this feature vector represent the contributions of short-term, medium-term, and long-term time scales to the dominant pattern, respectively. The larger the absolute value of the component, the higher the weight of that time scale in the dominant pattern. A consistency threshold of 0.5 is set. If the consistency strength benchmark value of a certain time scale is greater than 0.5 and the absolute value of the corresponding feature vector component is greater than 0.3, then that time scale is considered to participate in the dominant consistency pattern.

[0101] The initial weights are calculated using a weighted product method, multiplying the baseline value of the consistency strength at a given time scale by the absolute value of its corresponding component in the dominant mode's feature vector. This yields the initial weight values ​​for that time scale. After calculation at each of the three time scales, L1 normalization is applied, dividing each initial weight by the sum of the three initial weights until the sum of the processed weights equals 1, resulting in the initial fusion weight allocation. For example, if the baseline values ​​of consistency strength for the short, medium, and long term are 0.55, 0.72, and 0.48, respectively, and the corresponding absolute values ​​of the dominant mode's feature vector components are 0.35, 0.68, and 0.25, then the initial weight values ​​are 0.1925, 0.4896, and 0.12, respectively, with a sum of 0.8021. After L1 normalization, the initial fusion weights are 0.24, 0.61, and 0.15, respectively. These initial weights only reflect the coordination strength and mode contribution and do not yet consider the stability differences of the data at each time scale.

[0102] The reliability-weighted adjustment incorporates stability indices into the weighting calculation framework. Each time scale already has a stability index, which is the standard deviation of 10 time-series means. A smaller standard deviation indicates a more stable co-evolutionary pattern at that time scale, and thus warrants a higher weight. The stability indices for the three time scales are mapped to the 0-1 interval using a maximum-minimum normalization method. This involves subtracting the minimum value from each of the three indices, dividing by the difference between the maximum and minimum values, and then subtracting the normalized value from 1 to obtain the reliability coefficient. A coefficient closer to 1 indicates greater reliability. The initial fusion weights for each time scale are multiplied by the corresponding reliability coefficients to obtain the adjusted original weight values. For example, the short-term, medium-term, and long-term stability indices are 0.08, 0.05, and 0.12, respectively, with a minimum of 0.05, a maximum of 0.12, and a difference of 0.07. The short-term normalized value is (0.08-0.05) / 0.07, which is approximately 0.43; the medium-term value is (0.05-0.05) / 0.07, which is 0; and the long-term value is (0.12-0.05) / 0.07, which is 1. The reliability coefficients are 1-0.43=0.57, 1-0=1, and 1-1=0, respectively. Multiplying the initial weights 0.24, 0.61, and 0.15 by the reliability coefficients yields 0.137, 0.61, and 0, respectively. The adjusted weights are then processed using L1 normalization, which involves dividing each value by the sum of 0.747, resulting in 0.183, 0.817, and 0.

[0103] To avoid excessive concentration of weights at individual time scales or complete neglect of certain scales, constraint and smoothing processes are required. An upper limit of 0.7 and a lower limit of 0.1 are set for the weight of a single time scale. If the weight of a time scale is below 0.1, it is increased to 0.1, and the shortfall is deducted from other time scales according to the current weight ratio. If the weight of a time scale exceeds 0.7, it is truncated to 0.7, and the excess is distributed according to the weight ratio of other time scales. After adjustment, L1 normalization is used to ensure that the weight sums to 1. The smoothing process uses a moving average strategy for the weights of adjacent time scales. The arithmetic mean of the short-term and medium-term weights is used as the new short-term weight, and the arithmetic mean of the medium-term and long-term weights is used as the new long-term weight. The medium-term weight is the weighted average of the short-term, medium-term, and long-term weights. Then, L1 normalization is used to ensure that the weight sums to 1. For example, after the adjusted weights 0.183, 0.817, and 0 are subject to lower limit constraints, the long-term weight increases from 0 to 0.1. The remaining 0.1 is deducted proportionally from the short-term and medium-term weights. The short-term weight becomes 0.183 - 0.183 × 0.1 / (0.183 + 0.817) = 0.165, and the medium-term weight becomes 0.817 - 0.817 × 0.1 / (0.183 + 0.817) = 0.735. After upper limit constraints, the medium-term weight is truncated from 0.735 to 0.7. The excess 0.035 is allocated proportionally to the short-term and long-term weights. The short-term weight becomes 0.165 + 0.035 × 0.165 / (0.165 + 0.1) = 0.187, and the long-term weight becomes 0.1 + 0.035 × 0.1 / (0.165 + 0.1) = 0.113. After L1 normalization, these are 0.187, 0.7, and 0.113. During smoothing, the new short-term weight is (0.187 + 0.7) / 2 = 0.444, the new long-term weight is (0.7 + 0.113) / 2 = 0.407, and the new medium-term weight is (0.187 + 0.7 + 0.113) / 3 × 1.0 = 0.333 (the calculation method for the medium-term weight can be adjusted according to actual needs). After L1 normalization, the final weight allocation scheme is obtained.

[0104] By extracting cross-scale dominant patterns through eigenvalue decomposition and combining them with stability constraints to generate adaptive weights, the one-sidedness and noise sensitivity of a single time scale are avoided.

[0105] In one optional implementation, the multimodal evolution trajectory features are input into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates an estimated bleeding volume for a future time period. The step of outputting a warning signal when the estimated bleeding volume exceeds a preset boundary includes:

[0106] The prediction algorithm employs a temporal neural network, comprising an input layer, a temporal feature extraction layer, and a regression output layer;

[0107] During the training phase, the input layer receives multimodal evolution trajectory features of historical cases, the temporal feature extraction layer learns temporal evolution patterns and extracts deep temporal representation features that reflect bleeding trends, the regression output layer maps the deep temporal representation features to predicted bleeding volume, and updates the network parameters by minimizing the prediction loss between the predicted bleeding volume and the actual bleeding volume using a backpropagation algorithm.

[0108] During the prediction phase, the multimodal evolution trajectory features are input into the trained temporal neural network, and the estimated bleeding volume in the future time period is calculated through the temporal feature extraction layer and the regression output layer; when the estimated bleeding volume exceeds the preset boundary, an early warning signal is output.

[0109] Combination Figure 2 The flowchart illustrating the training and real-time early warning process for bleeding prediction based on a temporal neural network is provided below. For example, the prediction algorithm is implemented using a temporal neural network structure, which includes an input layer, a temporal feature extraction layer, and a regression output layer.

[0110] The input layer receives the multimodal evolution trajectory features generated in the preceding steps. These features already contain co-evolutionary information of baseline deviation sequences and liquid outflow volume sequences at different time scales, specifically including weighted fusion results of statistics such as maximum correlation coefficient, time delay, covariance, and mutual information at each time scale. The dimension of the input layer matches the dimension of the multimodal evolution trajectory features, ensuring that all feature components can be received and processed by the network.

[0111] The temporal feature extraction layer is the core of the prediction algorithm, primarily responsible for capturing deep patterns of multimodal evolution trajectory features over time. This layer employs a Long Short-Term Memory (LSTM) network structure. Specifically, the LSTM layer contains 128 hidden units, each with three gating structures: a forget gate, an input gate, and an output gate. At time t, the LSTM unit receives the current multimodal evolution trajectory feature vector and the hidden state vector from the previous time step. The forget gate determines which information from the previous hidden state to retain, the input gate determines which information from the current input features needs to be updated in the unit state, and the output gate determines which information from the current unit state is output to the hidden state. This gating mechanism enables LSTM to effectively capture long-term dependencies, such as identifying the gradual deterioration trend of drainage fluid parameters over the past hour, even with short-term fluctuations that do not affect the overall trend judgment. The hidden state sequence output by the LSTM layer is the deep temporal representation feature, which has 128 dimensions and encodes the temporal pattern information of the drainage fluid parameter evolution. To enhance the model's generalization ability, a dropout layer is added after the LSTM layer with a dropout rate of 0.3. During training, 30% of the neuron connections are randomly dropped to prevent overfitting.

[0112] The regression output layer maps the 128-dimensional deep temporal representation features output by the temporal feature extraction layer to predicted bleeding volumes for future time periods. This layer employs a two-layer fully connected neural network. The first layer contains 64 neurons with the ReLU activation function, compressing the 128-dimensional features into a 64-dimensional intermediate representation. The second layer contains one neuron with no activation function, directly outputting the estimated cumulative bleeding volume in milliliters for the next hour.

[0113] During the training phase, historical monitoring data was used to train the network. This historical data came from monitoring records of patients who had completed treatment, including time series of multimodal evolution trajectory features collected during patient drainage fluid monitoring and the actual bleeding volume recorded within the corresponding time period. The data acquisition process did not involve active intervention or adjustment of the treatment plan for patients; it was only a retrospective analysis of routine monitoring data. The multimodal evolution trajectory features of the historical data were input into the network, and the predicted bleeding volume was calculated through forward propagation. Then, it was compared with the actual recorded bleeding volume to calculate the prediction error. The loss function used was the mean squared error (MSE), calculated as the average of the squares of the differences between the predicted and actual values. The network was optimized using the Adam algorithm to adjust the parameters of each layer, with a learning rate set to 0.001 and a batch size of 32, minimizing the prediction loss and improving prediction accuracy. The training process consisted of 100 epochs, employing an early stopping strategy: training was stopped when the validation set loss did not decrease for 10 consecutive epochs.

[0114] During the prediction phase, the multimodal evolution trajectory features of the current patient are input into a trained temporal neural network. The network calculates the estimated blood loss volume for the next hour through forward propagation. Preset boundaries are set according to different surgical types. For example, the preset boundary for laparoscopic surgery is to output a warning signal when the blood loss exceeds 50 ml in the next hour, and the preset boundary for open abdominal surgery is to output a warning signal when the blood loss exceeds 100 ml in the next hour. When the estimated value exceeds the corresponding preset boundary, the system outputs a warning signal.

[0115] The warning signal is displayed on the monitoring equipment screen with striking colors and sounds to alert medical staff. The displayed information includes the predicted blood loss for the next hour, the ratio of the current blood loss to the preset limit, and a trend graph, helping medical staff to quickly assess the situation and respond.

[0116] To improve prediction accuracy, the system uses the multimodal evolution trajectory features of monitoring instances that have already issued warning signals, along with the actual bleeding volume recorded subsequently for those instances, as new samples to periodically update network parameters. The update process employs an incremental learning method, using the new samples to fine-tune the model. The learning rate is reduced to one-tenth of the initial training rate, and the system is trained for only 10 epochs, adapting to the new data distribution while retaining previously learned knowledge.

[0117] The aforementioned prediction algorithm based on temporal neural networks can accurately capture the dynamic evolution of drainage fluid parameters, enabling reliable prediction of future bleeding trends and providing decision support for timely clinical intervention.

[0118] In one optional implementation, the step of constructing the temporal neural network includes:

[0119] The temporal neural network also includes an uncertainty estimation output layer, forming a dual-output layer architecture;

[0120] During the training phase, the regression output layer outputs the predicted hemorrhage value, and the uncertainty estimation output layer outputs the prediction uncertainty parameter. By minimizing the weighted sum of the prediction loss and the uncertainty estimation loss, the backpropagation algorithm is used to optimize the network parameters, enabling the temporal neural network to simultaneously output the estimated hemorrhage value and the prediction confidence.

[0121] During the prediction phase, the temporal neural network simultaneously outputs the estimated bleeding volume, cognitive uncertainty parameters, and random uncertainty parameters for a future time period, and calculates the prediction confidence based on the cognitive uncertainty parameters and random uncertainty parameters.

[0122] Based on the relationship between the estimated bleeding volume and the preset boundary, and the relationship between the prediction confidence and the reliability threshold, early warning signals with different risk level identifiers are generated.

[0123] As per your request, I have converted the formula into a plain text expression. The following is the modified implementation:

[0124] For example, the temporal neural network employs a dual-output layer architecture, including a regression output layer and an uncertainty estimation output layer. The regression output layer is responsible for directly outputting the predicted value of the bleeding, while the uncertainty estimation output layer is used to quantify the reliability of the prediction result.

[0125] In the basic layer structure of the network, the aforementioned LSTM temporal feature extraction layer is used, which outputs 128-dimensional deep temporal representation features. Two parallel output branches are connected above this LSTM layer, corresponding to the regression output layer and the uncertainty estimation output layer, respectively.

[0126] The regression output layer has the same structure as described above, employing a two-layer fully connected neural network. The first layer contains 64 neurons with the ReLU activation function; the second layer contains 1 neuron with no activation function, directly outputting the estimated cumulative bleeding volume in milliliters for the next hour.

[0127] The uncertainty estimation output layer also employs a two-layer fully connected neural network structure. The first layer contains 64 neurons with the ReLU activation function, and is connected in parallel to the first layer of the regression output layer to the output of the LSTM layer. The second layer contains two neurons with no activation function; the first neuron outputs auxiliary parameters for regularization constraints during the training phase, and the second neuron outputs a random uncertainty parameter. The cognitive uncertainty parameter quantifies the network's predictive ability regarding the current input, stemming from insufficient training data coverage or network parameter uncertainty. It is calculated from the prediction variance over multiple forward propagations using the Monte Carlo dropout method. A larger value indicates a greater difference between the current patient's multimodal evolution trajectory characteristics and the training data, resulting in lower prediction reliability. The random uncertainty parameter quantifies the inherent, unavoidable noise in the data itself—measurement errors and random physiological fluctuations that cannot be avoided even with perfect network training. It is directly learned by the uncertainty estimation output layer; a larger value indicates stronger inherent uncertainty in the drainage fluid parameters.

[0128] During the training phase, historical monitoring data was first collected as the training set. This data came from patient records of completed monitoring, including time series of multimodal evolution trajectory features during patient drainage fluid monitoring and the actual bleeding volume recorded within the corresponding time period. The multimodal evolution trajectory features were input into a temporal neural network, and the predicted bleeding volume was obtained through a regression output layer. Simultaneously, cognitive uncertainty parameters and accidental uncertainty parameters were obtained through an uncertainty estimation output layer.

[0129] The predicted loss is calculated using the mean squared error, which is the square of the difference between the predicted value and the actual bleeding volume. The uncertainty-based loss is calculated using the following formula:

[0130] ;

[0131] Where, σ e σ is the parameter for cognitive uncertainty. a For the parameter of random uncertainty, y pred To predict the amount of bleeding, y true This represents the actual bleeding amount. The formula consists of two parts: the first part is a penalty term, used to prevent the network from reducing loss by outputting extremely high uncertainty; the second part is a weighted prediction error term, which is weighted according to the ratio of prediction error to uncertainty. When the uncertainty is large, a larger prediction error is allowed, guiding the network to learn to reasonably estimate the uncertainty of the prediction result.

[0132] The final training objective function is a weighted sum of the prediction loss and the uncertainty estimation loss. The weight coefficients are used to balance the relative importance of the two losses, and the optimal value is determined through five-fold cross-validation, typically set to 0.6, meaning the prediction loss accounts for 60% of the weight and the uncertainty estimation loss accounts for 40%. Backpropagation is used to calculate the gradient, and the Adam optimizer is used to update the network parameters. The learning rate is set to 0.001, and the batch size is 64. During training, the model performance is evaluated on the validation set every 5 epochs. Training is stopped early if the combined loss on the validation set fails to decrease for 15 consecutive epochs to prevent overfitting.

[0133] In the prediction phase, the multimodal evolution trajectory features of the current patient are input into a trained temporal neural network to obtain three key outputs: estimated bleeding volume, cognitive uncertainty parameter, and random uncertainty parameter.

[0134] Based on these two types of uncertainty parameters, the prediction confidence is calculated. The specific method is to first calculate the total uncertainty, which is the square root of the sum of the squares of cognitive uncertainty and the squares of random uncertainty, and then map it to the interval between 0 and 1 using the sigmoid function. The confidence calculation formula is: C = 1 / [1 + exp(α × (σ_total - β))]; where C is the prediction confidence, σ_total is the total uncertainty, α is the kurtosis parameter, controlling the rate at which the confidence changes with uncertainty, set to 2.0; β is the centroid parameter, indicating that the confidence is 0.5 when the total uncertainty is this value, determined statistically based on the validation set data, and usually set to the median of the total uncertainty in the training set. For scenarios where cognitive uncertainty needs to be emphasized, the calculation method for the total uncertainty can be adjusted, using the square root of the weighted sum of squares, i.e., the square root of the sum of the squares of cognitive uncertainty multiplied by 0.7 and the squares of random uncertainty multiplied by 0.3, giving cognitive uncertainty a higher weight.

[0135] The early warning signal is generated based on a comparison of the estimated bleeding volume with preset boundaries, and a comparison of the prediction confidence level with a reliability threshold. The preset boundaries are set according to clinical standards: for laparoscopic surgery, the boundary for mild bleeding is 50 ml of blood loss within the next hour, for moderate bleeding it is 100 ml, and for severe bleeding it is 200 ml; for open abdominal surgery, the corresponding boundaries are 100 ml, 200 ml, and 500 ml, respectively. The reliability threshold is set to 0.7, meaning that a prediction confidence level of 70% is required to be considered a reliable prediction.

[0136] When the estimated bleeding volume exceeds the severe bleeding threshold and the prediction confidence is higher than the reliability threshold, the system generates a high-risk warning signal, which flashes red on the monitoring device display and emits a continuous alarm sound. When the estimated bleeding volume exceeds the moderate bleeding threshold but does not reach the severe bleeding threshold, and the prediction confidence is higher than the reliability threshold, a medium-risk warning signal is generated, which is displayed in solid yellow and emits an intermittent alarm sound. When the estimated bleeding volume exceeds the mild bleeding threshold but does not reach the moderate bleeding threshold, and the prediction confidence is higher than the reliability threshold, a low-risk warning signal is generated, which is displayed in solid orange and emits no sound. When the prediction confidence is lower than the reliability threshold, no warning signal is generated regardless of the estimated bleeding volume. Instead, the system displays a gray text message on the display stating "Insufficient prediction reliability, continued observation recommended," and marks the current monitoring data as a sample requiring further manual interpretation.

[0137] By simultaneously considering both the estimated bleeding volume and the prediction confidence level, this method can effectively reduce false alarms caused by model uncertainty while ensuring the sensitivity of the early warning system, thereby improving the overall reliability of the early warning system.

[0138] In one optional implementation, during the training phase, the regression output layer outputs a predicted hemorrhage value, and the uncertainty estimation output layer outputs a prediction uncertainty parameter. The step of optimizing the network parameters using the backpropagation algorithm by minimizing the weighted sum of the prediction loss and the uncertainty estimation loss includes:

[0139] The prediction uncertainty parameters include cognitive uncertainty parameters and random uncertainty parameters. The Monte Carlo dropout method is used to estimate the cognitive uncertainty parameters. Different network structure configurations are sampled through multiple forward propagations, and the variance of the prediction output is calculated. The uncertainty estimation output layer directly learns the random uncertainty parameters and characterizes the inherent random fluctuations of the data by outputting the variance parameter of the prediction distribution.

[0140] A joint loss function is constructed, including a prediction loss term, a cognitive uncertainty calibration loss term, and a random uncertainty calibration loss term. The prediction loss term uses mean squared error to measure the deviation between the predicted value and the actual bleeding amount. The cognitive uncertainty calibration loss term is calibrated by comparing the prediction error with the cognitive uncertainty parameter. The random uncertainty calibration loss term optimizes the random uncertainty parameter using a negative log-likelihood function. An adaptive weight adjustment strategy is used to dynamically balance the three loss terms.

[0141] For example, in a temporal neural network with a dual-output layer architecture, uncertainty estimation is implemented using a hybrid approach. The cognitive uncertainty parameter is estimated using the Monte Carlo dropout method, which maintains the activation state of the dropout layer during training and obtains different prediction results through multiple forward propagations during the inference phase. Specifically, in the dropout layer after the LSTM temporal feature extraction layer, the dropout rate is set to 0.3. During the prediction phase, 30 independent forward propagations are performed, randomly dropping different neuron connections during each propagation, generating 30 different hemorrhage prediction values. The variance of these 30 prediction values ​​is calculated; this variance reflects the prediction fluctuation caused by network parameter uncertainty, and is represented by the square of the cognitive uncertainty. The cognitive uncertainty parameter is then taken as the square root of this variance. When the distribution of the input data differs significantly from that of the training data, the difference in prediction values ​​generated by different network structure configurations increases, and the cognitive uncertainty parameter increases accordingly.

[0142] The random uncertainty parameter is directly learned by the uncertainty estimation output layer. The second layer of this output layer contains two neurons; the second neuron outputs the random uncertainty parameter, while the auxiliary parameter output by the first neuron is used for regularization constraints during training. The random uncertainty parameter characterizes the inherent noise and random fluctuations in the measurement of drainage fluid parameters, and its magnitude is automatically determined by the network through learning the difference between the prediction error and the cognitive uncertainty in the training data. When the prediction error exceeds the range that cognitive uncertainty can explain, the network learns that the data itself has significant randomness, and the random uncertainty parameter increases.

[0143] The joint loss function comprises three parts, designed to simultaneously optimize prediction accuracy and the reliability of uncertainty estimation. The prediction loss term is calculated using the mean squared error, which is the square of the difference between the predicted and actual bleeding volume. This loss term drives the network to improve prediction accuracy, and its weighting coefficient is set to 0.4.

[0144] The cognitive uncertainty calibration loss term ensures that the cognitive uncertainty parameter accurately reflects the magnitude of the prediction error. This loss term calculates the ratio of the square of the prediction error to the square of the cognitive uncertainty, then takes its natural logarithm. When the cognitive uncertainty parameter is too small and the prediction error is large, this ratio is large, increasing the loss value and prompting the network to increase the cognitive uncertainty estimate; conversely, when the cognitive uncertainty parameter is too large and the prediction error is small, the loss value also increases, prompting the network to decrease the cognitive uncertainty estimate. The weight coefficient for this loss term is set to 0.3. To avoid numerical instability, a small constant of 0.001 is added to the square of the cognitive uncertainty as a regularization term before calculating the ratio.

[0145] The random uncertainty calibration loss term is implemented using a negative log-likelihood function. This function consists of two parts: the first part is the natural logarithm of the square of the random uncertainty, used to penalize excessive uncertainty estimates; the second part is the square of the residual (prediction error minus the contribution of cognitive uncertainty) divided by twice the square of the random uncertainty, used to calibrate the random uncertainty parameter based on the residual error. When calculating the residuals, the square of the cognitive uncertainty is subtracted from the square of the prediction error to obtain the portion of error that cannot be explained by cognitive uncertainty, which should be explained by random uncertainty. When the residuals are large and the random uncertainty parameter is small, the value of the second part increases, the loss increases, and the network is prompted to increase the random uncertainty estimate. The weight coefficient of this loss term is set to 0.3.

[0146] The adaptive weight adjustment strategy dynamically adjusts the weights based on the relative magnitudes of the three loss terms during training. In the early stages of training, the predicted loss term is typically large, so the system automatically increases its weight to 0.5 to accelerate convergence. Specifically, every 10 training epochs, the average of the three loss terms on the validation set is calculated. The weight of the loss term with the largest average is increased by 0.05, while the weights of the other two terms are proportionally decreased, ensuring the sum of the three weights is 1.0. Once the total loss on the validation set remains stable for five consecutive epochs, the weights of each loss term are fixed at their current values ​​and no further adjustment is made. Through this strategy, the network can automatically balance prediction accuracy and uncertainty estimation quality at different training stages, preventing any single loss term from excessively dominating the training process.

[0147] During training, each batch contains 64 samples, and the Adam optimizer is used to update parameters with a learning rate of 0.0005. For cognitive uncertainty estimation, the dropout mask is resampled during each forward propagation, and the generated 30 predictions are used to calculate the cognitive uncertainty parameters for the current batch of samples. For random uncertainty estimation, the parameter update frequency of the uncertainty estimation output layer is set to half that of the regression output layer, i.e., once every two batches, to ensure that the random uncertainty parameters are sufficiently stable after learning.

[0148] This method separates and accurately quantifies cognitive and accidental uncertainties through Monte Carlo sampling and joint loss optimization, thereby improving the reliability of early warnings and reducing the false alarm rate.

[0149] When a monitored instance triggers an early warning signal, the system automatically records the complete multimodal evolution trajectory of that instance from the start of monitoring to the moment the warning is triggered, including the time-series change curve of color parameters, the fluctuation characteristics of flow velocity parameters, and the correlation pattern between the two. Simultaneously, the system automatically acquires the patient's actual bleeding data (such as blood loss and transfusion volumes from surgical records) through a manual input interface or electronic medical record system. The aforementioned evolution trajectory features and actual bleeding volumes are used to create labeled sample pairs, which are then stored in the training database. When the accumulated samples reach a preset number (e.g., 50 cases) or periodically (e.g., monthly), the parameter update process is automatically initiated: the feature vectors of newly added samples are extracted, merged with the original training set, and the prediction algorithm is retrained. Optimization algorithms such as gradient descent are used to adjust the neural network weights or update the threshold parameters. The updated algorithm parameters are validated and tested before being deployed to all in-use devices, thereby continuously improving early warning accuracy, reducing false alarm rates, and achieving continuous performance optimization.

[0150] The purpose of this invention is to provide objective monitoring data and early warning signals, serving as a tool to assist medical staff in clinical observation and decision-making. It does not directly implement any treatment interventions on the patient, nor does it involve diagnosing diseases or determining treatment plans; it merely converts the physical parameters (color, flow rate) of the drainage fluid into quantifiable information on the amount of bleeding and promptly informs medical staff.

[0151] A second aspect of the present invention provides a machine learning-based drainage fluid abnormality analysis and identification system, comprising:

[0152] The data acquisition module is used to collect the color and flow rate characteristics of the drainage fluid in real time, and obtain the optical absorption coefficient sequence and fluid outflow volume sequence characterizing the hemoglobin concentration;

[0153] The baseline analysis module is used to perform statistical analysis on the optical absorption coefficient sequence within a preset observation window, extract individualized baseline parameters, calculate the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generate a baseline deviation sequence.

[0154] The feature fusion module is used to extract temporal evolution features from the baseline deviation sequence at multiple time scales, extract flow velocity change features from the liquid outflow volume sequence at corresponding time scales, and fuse them to obtain multimodal evolution trajectory features;

[0155] The prediction and early warning module is used to input the multimodal evolution trajectory features into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period. When the estimated bleeding volume exceeds a preset boundary, an early warning signal is output.

[0156] The model update module is used to record the multimodal evolution trajectory features and actual bleeding volume of the monitoring instances that have output early warning signals as new samples, which are used to update the parameters of the prediction algorithm.

[0157] A third aspect of the present invention provides an electronic device, comprising:

[0158] processor;

[0159] Memory used to store processor-executable instructions;

[0160] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0161] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0162] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

Claims

1. A machine learning-based method for analyzing and identifying abnormal drainage fluid, characterized in that, include: The color and flow rate characteristics of the drainage fluid were collected in real time to obtain the optical absorption coefficient sequence and fluid outflow volume sequence characterizing hemoglobin concentration; Within a preset observation window, statistical analysis is performed on the optical absorption coefficient sequence to extract individualized baseline parameters. The deviation of the current optical absorption coefficient from the individualized baseline parameters is calculated, and a baseline deviation sequence is generated. Temporal evolution features are extracted from the baseline deviation sequence at multiple time scales, and flow velocity change features are extracted from the liquid outflow volume sequence at corresponding time scales. These features are then fused to obtain multimodal evolution trajectory features. The multimodal evolution trajectory features are input into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for future time periods. A warning signal is output when the estimated bleeding volume exceeds a preset boundary. The multimodal evolution trajectory features of the monitoring instances that have already issued early warning signals and the actual bleeding volume are recorded as new samples to update the parameters of the prediction algorithm. The steps of extracting temporal evolution features from the baseline deviation sequence at multiple time scales, extracting velocity change features from the liquid outflow volume sequence at corresponding time scales, and fusing them to obtain multimodal evolution trajectory features include: Multiple time scales are determined based on the temporal variation characteristics of drainage fluid monitoring data, with each time scale corresponding to a different time window length; For each time scale, within the corresponding time window length, segments of the baseline deviation sequence and segments of the liquid outflow volume sequence are simultaneously extracted. The deviation amplitude change rate is extracted from the segments of the baseline deviation sequence, and the flow velocity acceleration is extracted from the segments of the liquid outflow volume sequence. The temporal correlation between the deviation amplitude change rate and the flow velocity acceleration is analyzed, and the temporal evolution characteristics and flow velocity change characteristics characterizing the dual-modal co-evolution mode are extracted. Cross-scale consistency evaluation is performed on the dual-modal co-evolution patterns extracted at the multiple time scales, and fusion weights are assigned to the corresponding temporal evolution features and velocity change features according to the consistency strength at each time scale. The temporal evolution features and flow velocity change features at each time scale are weighted and combined according to the fusion weight to generate multimodal evolution trajectory features.

2. The method according to claim 1, characterized in that, The steps of statistically analyzing the optical absorption coefficient sequence within a preset observation window, extracting individualized baseline parameters, calculating the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generating a baseline deviation sequence include: Within a preset observation window, the optical absorption coefficient sequence is segmented into time series, and the rate of change and fluctuation amplitude of the optical absorption coefficient in each segment are calculated. Stable periods are identified where the rate of change is lower than the dynamic convergence criterion and the fluctuation amplitude is within a stable range in continuous time periods. Anomaly detection is performed on the optical absorption coefficient data within the stable period. By calculating the degree of deviation of each data point from its neighboring data points, abnormal fluctuation points with deviations exceeding the robustness threshold are removed. Statistical feature values ​​are calculated based on stable period data after removing abnormal fluctuation points, and individualized baseline parameters representing physiological stability are extracted. The individualized baseline parameters include central trend benchmark value and fluctuation tolerance parameter. At each time point after the preset observation window, the current optical absorption coefficient is obtained, the difference between the current optical absorption coefficient and the central trend benchmark value is calculated, and the difference is normalized according to the fluctuation tolerance parameter to obtain a standardized deviation amplitude value. The standardized deviation values ​​obtained in chronological order are arranged sequentially to generate a baseline deviation sequence.

3. The method according to claim 1, characterized in that, The steps of performing cross-scale consistency evaluation on the dual-modal co-evolutionary patterns extracted at multiple time scales, and assigning fusion weights to the corresponding temporal evolution features and velocity change features based on the consistency strength at each time scale, include: The synchronicity of the dual-mode co-evolution is quantified by calculating the cross-relation between the rate of change of the deviation amplitude and the flow velocity acceleration at different time scales. The cross-relation coefficient characterizes the phase consistency and amplitude correlation of the two modal signals in time. For each time scale, the time series mean and stability index of the cross-correlation coefficient are calculated within the corresponding time window, and the time series mean is used as the consistency strength benchmark value for that time scale. A cross-scale consistency assessment matrix is ​​established, where the matrix elements represent the correlation between consistency strength benchmarks at different time scales. The dominant consistency pattern is extracted through matrix eigenvalue decomposition, where the dominant consistency pattern is an evolution pattern in which the cross-correlation coefficients at multiple time scales all exceed the consistency threshold. The initial fusion weights are calculated based on the consistency strength benchmark values ​​at each time scale and the contribution of that time scale to the dominant consistency pattern. The initial fusion weights are adjusted for reliability weighting in conjunction with the stability index. The adjusted weights are then normalized and smoothed to generate a fusion weight allocation scheme.

4. The method according to claim 1, characterized in that, The multimodal evolution trajectory features are input into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for future time periods. The step of outputting a warning signal when the estimated bleeding volume exceeds a preset boundary includes: The prediction algorithm employs a temporal neural network, comprising an input layer, a temporal feature extraction layer, and a regression output layer; During the training phase, the input layer receives multimodal evolution trajectory features of historical cases, the temporal feature extraction layer learns temporal evolution patterns and extracts deep temporal representation features that reflect bleeding trends, the regression output layer maps the deep temporal representation features to predicted bleeding volume, and updates the network parameters by minimizing the prediction loss between the predicted bleeding volume and the actual bleeding volume using a backpropagation algorithm. In the prediction phase, the multimodal evolution trajectory features are input into the trained temporal neural network, and the estimated bleeding volume in the future time period is calculated through the temporal feature extraction layer and the regression output layer. When the estimated bleeding volume exceeds the preset boundary, an early warning signal is output.

5. The method according to claim 4, characterized in that, The steps for constructing the temporal neural network include: The temporal neural network also includes an uncertainty estimation output layer, forming a dual-output layer architecture; During the training phase, the regression output layer outputs the predicted hemorrhage value, and the uncertainty estimation output layer outputs the prediction uncertainty parameter. By minimizing the weighted sum of the prediction loss and the uncertainty estimation loss, the backpropagation algorithm is used to optimize the network parameters, enabling the temporal neural network to simultaneously output the estimated hemorrhage value and the prediction confidence. During the prediction phase, the temporal neural network simultaneously outputs the estimated bleeding volume, cognitive uncertainty parameters, and random uncertainty parameters for a future time period, and calculates the prediction confidence based on the cognitive uncertainty parameters and random uncertainty parameters. Based on the relationship between the estimated bleeding volume and the preset boundary, and the relationship between the prediction confidence and the reliability threshold, early warning signals with different risk level identifiers are generated.

6. The method according to claim 5, characterized in that, During the training phase, the regression output layer outputs the predicted bleeding value, and the uncertainty estimation output layer outputs the prediction uncertainty parameter. The steps of optimizing the network parameters using the backpropagation algorithm by minimizing the weighted sum of the prediction loss and the uncertainty estimation loss include: The prediction uncertainty parameters include cognitive uncertainty parameters and accidental uncertainty parameters; The Monte Carlo dropout method is used to estimate the cognitive uncertainty parameters. Different network structure configurations are sampled through multiple forward propagations, and the variance of the predicted output is calculated. The uncertainty estimation output layer directly learns the random uncertainty parameters and characterizes the inherent random fluctuations of the data by outputting the variance parameter of the predicted distribution. A joint loss function is constructed, including a prediction loss term, a cognitive uncertainty calibration loss term, and a random uncertainty calibration loss term. The prediction loss term uses the mean squared error to measure the deviation between the predicted value and the actual bleeding volume. The cognitive uncertainty calibration loss term is calibrated by comparing the prediction error with the cognitive uncertainty parameter. The random uncertainty calibration loss term optimizes the random uncertainty parameter through the negative log-likelihood function. An adaptive weight adjustment strategy is used to dynamically balance the three loss terms.

7. A machine learning-based drainage fluid abnormality analysis and identification system, used to implement the method of any one of claims 1-6, characterized in that, include: The data acquisition module is used to collect the color and flow rate characteristics of the drainage fluid in real time, and obtain the optical absorption coefficient sequence and fluid outflow volume sequence characterizing the hemoglobin concentration; The baseline analysis module is used to perform statistical analysis on the optical absorption coefficient sequence within a preset observation window, extract individualized baseline parameters, calculate the deviation of the current optical absorption coefficient from the individualized baseline parameters, and generate a baseline deviation sequence. The feature fusion module is used to extract temporal evolution features from the baseline deviation sequence at multiple time scales, extract flow velocity change features from the liquid outflow volume sequence at corresponding time scales, and fuse them to obtain multimodal evolution trajectory features; The prediction and early warning module is used to input the multimodal evolution trajectory features into a pre-trained bleeding trend prediction algorithm. The prediction algorithm determines its parameters by learning the mapping relationship between the multimodal evolution trajectory features and the actual bleeding volume, and calculates the estimated bleeding volume for a future time period. A warning signal is output when the estimated bleeding volume exceeds a preset boundary. The model update module is used to record the multimodal evolution trajectory features and actual bleeding volume of the monitoring instances that have output early warning signals as new samples, which are used to update the parameters of the prediction algorithm.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.