Hematemesis risk prediction method based on machine learning, electronic equipment and storage medium

Through the processing of the volume and image signal of vomiting blood volume and image signals and machine learning models, a hemog risk assessment report was generated, which solved the problem of inaccurate monitoring of vomiting blood volume and color changes in the prior art, and achieved accurate assessment and timely intervention of vomiting blood risk.

CN120432098APending Publication Date: 2025-08-05RUIJIN HOSPITAL AFFILIATED TO SHANGHAI JIAO TONG UNIV SCHOOL OF MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510511010.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The existing technology cannot monitor the volume and color changes of vomiting blood in real time and accurately, resulting in inaccurate assessment of vomiting blood risk and unable to meet the clinical needs for dynamic risk assessment.

Method used

By adaptive noise reduction processing and dynamic range calibration of the digitized measurement signal of the volume of vomiting blood, a first time sequence data stream was generated; color space conversion, region of interest segmentation and color histogram feature encoding were performed on the hemog RGB image frame sequence to generate a second time sequence data stream; the two were aligned and the pre-trained machine learning prediction model was input to analyze the association relationship between the hemog volume-color joint timing mode and clinical risk score, and a risk assessment report was generated.

Benefits of technology

Accurate monitoring and risk assessment of hemogloss conditions have been achieved, the accuracy and timeliness of risk prediction have been improved, the work intensity of medical staff has been reduced, misjudgment has been reduced, and the quality of medical care has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120432098A_ABST
    Figure CN120432098A_ABST
Patent Text Reader

Abstract

The invention relates to a haematemesis risk prediction method based on machine learning, electronic equipment and a storage medium, and the method comprises the steps: carrying out the adaptive noise reduction processing and dynamic range calibration of a digital measurement signal of the volume of haematemesis liquid, and generating a first time series data flow; performing color space conversion, region-of-interest segmentation and color histogram feature coding on the haematemesis RGB image frame sequence to generate a second time sequence data stream; and performing time sequence alignment on the first time sequence data stream and the second time sequence data stream, inputting the first time sequence data stream and the second time sequence data stream into a pre-trained machine learning prediction model, analyzing risk level probability distribution based on an output vector of the machine learning prediction model, and generating a risk assessment report containing a timestamp. Compared with the prior art, the haematemesis amount and color change can be accurately monitored and analyzed in real time by using the machine learning prediction model, the clinical risk is dynamically evaluated, and the accuracy and timeliness of risk prediction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical data analysis, and in particular to a method, electronic device, and storage medium for predicting hematemesis risk based on machine learning. Background Art

[0002] In the medical field, accurately assessing the amount and color of a patient's vomited blood is crucial to determining their health status.

[0003] In the prior art, for example, reference patent CN109303701A provides a vomitus receiving system, which includes a waterproof sheet and a receiving and measuring device, and can collect and measure the amount of vomited blood, thereby avoiding environmental contamination and cross infection.

[0004] However, this method only relies on the scale marks on the storage bag for estimation, which cannot provide dynamic and accurate hematemesis data, and cannot analyze the impact of hematemesis color changes on clinical risks.

[0005] Another reference patent CN205108436U proposes a hematemesis protection metering bag, which also has measurement functions and anti-cross-infection design, but also lacks the ability to analyze dynamic data and color changes.

[0006] Both technologies fail to achieve real-time, accurate monitoring and analysis of the amount and color changes of vomited blood, and cannot fully meet the clinical needs for dynamic risk assessment.

[0007] In the field of hematemesis risk assessment, existing technologies struggle to accurately measure hematemesis volume and generate valid time-series data streams. Traditional methods rely on subjective estimates of hematemesis volume by medical staff, which are susceptible to visual errors and experience differences, resulting in poor accuracy. Even studies that have attempted to utilize digitized measurement signals have not performed effective adaptive noise reduction, resulting in a significant amount of noise interference in the signal, making it difficult to reflect the actual changes in hematemesis volume.

[0008] Moreover, there is a lack of reasonable dynamic range calibration methods for the noise-reduced signals, and the generated data cannot accurately characterize the subtle changes in the dynamic amount of vomiting blood, which poses a hidden danger to subsequent risk assessment.

[0009] Based on this, there is an urgent need to develop a method that can accurately measure the amount of vomited blood and generate a reliable time series data stream to solve the above technical defects. Summary of the Invention

[0010] The purpose of the present invention is to overcome the defects of the above-mentioned existing technologies and provide a method, electronic device, and storage medium for predicting the risk of vomiting blood based on machine learning. It can use the machine learning prediction model to accurately monitor and analyze the amount and color changes of vomiting blood in real time, dynamically evaluate clinical risks, and improve the accuracy and timeliness of risk prediction.

[0011] During the design process of this application, we believe that:

[0012] Currently, analysis of hematemesis color remains at the qualitative description stage, unable to quantify and convert it into valid data. Although a small number of studies have attempted to process relevant images, significant flaws exist in color space conversion, region of interest segmentation, and color feature encoding. On the one hand, the lack of selection of an appropriate color space for analysis results in limited discrimination and representation of color information. On the other hand, when segmenting the region of interest, it is difficult to accurately extract the hematemesis region from the complex background, and a large amount of interference information affects the accurate judgment of color. Furthermore, related research, such as color histogram feature encoding, is often imperfect and unable to fully quantify color information. The generated time series data stream is not accurate enough in representing the color changes of hematemesis, making it difficult to meet the data quality requirements of machine learning prediction models.

[0013] There are many problems with existing hematemesis risk prediction models, which limit their clinical application effects. On the one hand, traditional risk prediction models are mostly based on a few risk factors, such as the patient's basic physiological indicators, medical history, etc., ignoring key dynamic information such as the amount and color of hematemesis. The input features of the model are not comprehensive enough, resulting in insufficient prediction accuracy. On the other hand, most of these models use simple statistical analysis methods or conventional machine learning algorithms, which makes it difficult to explore the complex correlation between the joint time series pattern of hematemesis amount and color and the clinical risk score, and the prediction performance of the model is limited. Moreover, during the model training process, there is a lack of effective alignment of time series data, which causes deviations in the data input to the model, further affecting the reliability of the prediction results. At the same time, the training data collection scope of the model in the existing technology is relatively narrow, and the data diversity and representativeness are insufficient, resulting in poor generalization ability of the model and inability to adapt to the hematemesis risk prediction needs in different scenarios.

[0014] The purpose of the present invention can be achieved by the following technical solutions:

[0015] A first aspect of the present invention provides a method for predicting hematemesis risk based on machine learning, comprising the following steps:

[0016] S1: performing adaptive noise reduction processing and dynamic range calibration on the digital measurement signal of the hematemesis volume to generate a first time series data stream for representing the dynamic hematemesis volume;

[0017] S2: performing color space conversion, region of interest segmentation, and color histogram feature encoding on the hematemesis RGB image frame sequence to generate a second time series data stream representing the hematemesis color;

[0018] S3: The first time series data stream and the second time series data stream are time-series aligned and then input into a pre-trained machine learning prediction model. The machine learning prediction model establishes prediction rules by analyzing the correlation between the vomited blood volume-color joint time series pattern and the clinical risk score in historical cases, and parses the risk level probability distribution based on the output vector of the machine learning prediction model to generate a risk assessment report containing a timestamp.

[0019] Furthermore, S1 specifically includes the following processes:

[0020] Adaptive noise reduction processing is performed on the digital measurement signal of vomited blood volume to remove noise interference in the signal, retain the effective signal components that reflect the true changes in vomited blood volume, improve signal quality, and provide more accurate basic data for subsequent data processing;

[0021] The dynamic range of the signal after noise reduction processing is calibrated to adjust the value range of the signal to an appropriate interval, so that the generated first time series data stream can more accurately characterize the changes in the dynamic amount of vomiting blood.

[0022] Furthermore, the adaptive noise reduction process includes: separating the signal frequency domain components through sliding window Fourier transform, applying a frequency domain threshold filtering algorithm to eliminate high-frequency noise components, and using a dynamic baseline correction algorithm to compensate for environmental interference;

[0023] The dynamic range calibration process includes: based on the adaptive noise reduction process, performing a linear or nonlinear transformation on the noise-reduced signal to adjust its numerical range to a more appropriate range.

[0024] Furthermore, in S1, the format of the first time series data stream is a data sequence arranged in chronological order, including a timestamp and a corresponding volume value, and the specific format is: [time 1, volume value 1; time 2, volume value 2; ...; time n, volume value n].

[0025] Furthermore, in S1, the digital measurement signal of the vomited blood volume is a digital signal sequence carrying volume information obtained by converting the vomited blood volume change in the collection container into an electrical signal and then performing analog-to-digital conversion.

[0026] Furthermore, S2 specifically includes the following steps:

[0027] Performing color space conversion on the collected hematemesis RGB image frame sequence, converting from RGB color space to a color space suitable for analysis;

[0028] Perform region of interest segmentation on the converted image, locate and extract the area containing hematemesis, and remove interference information;

[0029] The segmented region of interest is subjected to color histogram feature encoding, the color information in the image is quantified, and a second time series data stream capable of representing the color change of hematemesis is generated.

[0030] Furthermore, the color space suitable for analysis is HSV color space or LAB color space;

[0031] The specific process of segmenting the region of interest in the converted image includes: using the typical hue and saturation range of hematemesis color to separate the image from the background, using threshold segmentation or edge detection to locate and extract the area containing hematemesis, and then generating a mask or coordinate information containing the area, and finally combining the original image with the mask operation to remove the background and other interference information.

[0032] Furthermore, in S3, the machine learning prediction model is trained in the following manner:

[0033] Collect and preprocess the dynamic hematemesis quantity time series data, hematemesis color time series data, and historical hematemesis data, perform time series alignment, and label the corresponding risk level labels to form a training data set;

[0034] Select a recurrent neural network or a convolutional neural network as the model framework, input the training data set into the model for training, and adjust the model parameters through gradient descent to minimize the error between the predicted value and the true value;

[0035] At the same time, cross-validation was used to evaluate the model performance, and finally a machine learning prediction model was obtained that could accurately predict the risk level of vomiting blood.

[0036] A second aspect of the present invention provides an electronic device comprising a memory and a processor, wherein the processor is configured to execute a program in the memory, thereby implementing the above-mentioned method for predicting hematemesis risk based on machine learning.

[0037] A third aspect of the present invention provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, is used to execute the above-mentioned method for predicting hematemesis risk based on machine learning.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] 1) The present invention obtains the patient's dynamic hematemesis quantity time series data and hematemesis color time series data in real time, and uses a machine learning model to predict the risk level of hematemesis, which can achieve accurate monitoring and risk assessment of the patient's hematemesis situation. This method effectively improves the accuracy and timeliness of hematemesis risk prediction, enabling medical staff to take intervention measures in advance to prevent patients from being in danger of life due to excessive hematemesis. Compared with traditional manual observation, the present invention reduces the workload of medical staff, reduces misjudgments caused by human negligence, and improves the quality of medical care.

[0040] 2) The present invention has strong practical value and market prospects. It can meet the clinical needs for accurate monitoring and early warning of patients' risk of vomiting blood, provide medical staff with a scientific decision-making basis, effectively improve patients' medical experience and nursing quality, reduce misjudgments and missed judgments, and reduce medical risks. At the same time, it also helps in the accumulation and analysis of medical data, providing rich data support for medical research. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 Schematic diagram of the process of predicting hematemesis risk based on machine learning in the present invention. DETAILED DESCRIPTION

[0042] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. Component models, material names, connection structures, circuit structures, control methods, algorithms, and other features not explicitly described in this technical solution are considered common technical features disclosed in the prior art.

[0043] Example 1

[0044] The method for predicting hematemesis risk based on machine learning in this embodiment is described in detail in the following. Figure 1 , specifically including the following steps:

[0045] S1: performing adaptive noise reduction processing and dynamic range calibration on the digital measurement signal of the hematemesis volume to generate a first time series data stream for representing the dynamic hematemesis volume;

[0046] In the specific implementation, S1 includes the following processes:

[0047] Adaptive noise reduction processing is performed on the digital measurement signal of vomited blood volume to remove noise interference in the signal, retain the effective signal components that reflect the true changes in vomited blood volume, improve signal quality, and provide more accurate basic data for subsequent data processing;

[0048] The dynamic range of the signal after noise reduction processing is calibrated to adjust the value range of the signal to an appropriate interval, so that the generated first time series data stream can more accurately characterize the changes in the dynamic amount of vomiting blood.

[0049] In specific implementation, the process of the adaptive noise reduction processing includes: separating the frequency domain components of the signal through sliding window Fourier transform, applying the frequency domain threshold filtering algorithm to eliminate the high-frequency noise components, and using the dynamic baseline correction algorithm to compensate for environmental interference;

[0050] The dynamic range calibration process includes: based on the adaptive noise reduction process, performing a linear or nonlinear transformation on the noise-reduced signal to adjust its numerical range to a more appropriate range.

[0051] During specific implementation, in S1, the format of the first time series data stream is a data sequence arranged in chronological order, including a timestamp and a corresponding volume value, and the specific format is: [time 1, volume value 1; time 2, volume value 2; ...; time n, volume value n].

[0052] In a specific implementation, in S1, the digital measurement signal of the vomited blood volume is a digital signal sequence carrying volume information obtained by converting the vomited blood volume change in the collection container into an electrical signal and then performing analog-to-digital conversion.

[0053] From a technical perspective, step S1 first converts the volume change of hematemesis into an electrical signal, which is then converted to a digital measurement signal through analog-to-digital conversion. This is a key step in converting physical quantities into processable digital signals. The subsequent adaptive noise reduction process uses a sliding window Fourier transform to accurately separate the signal's frequency domain components. The Fourier transform converts the time domain signal into the frequency domain, allowing for clear and intuitive identification of different frequency components. A frequency domain threshold filtering algorithm then determines a threshold based on the characteristics of the hematemesis volume change signal, effectively filtering out high-frequency noise components above the threshold. The dynamic baseline correction algorithm compensates for signal baseline drift caused by environmental interference. These three processes work together to adaptively remove noise interference, retain valid signal components that reflect the true changes in hematemesis volume, and improve signal quality. In the next dynamic range calibration step, based on the signal after adaptive noise reduction processing, linear or nonlinear transformation is used to reasonably adjust the signal's numerical range according to the actual application scenario and the requirements of the subsequent data processing on the signal numerical range, so as to generate the first time series data stream that can accurately characterize the dynamic changes in the amount of vomited blood. This time series data stream records the timestamps and corresponding volume values in chronological order, and presents the dynamic changes of the amount of vomited blood over time in a complete and orderly manner, laying a solid foundation for subsequent data fusion and risk prediction related to the color of vomited blood.

[0054] S2: performing color space conversion, region of interest segmentation, and color histogram feature encoding on the hematemesis RGB image frame sequence to generate a second time series data stream representing the hematemesis color;

[0055] In the specific implementation, S2 specifically includes the following steps:

[0056] Performing color space conversion on the collected hematemesis RGB image frame sequence, converting from RGB color space to a color space suitable for analysis;

[0057] Perform region of interest segmentation on the converted image, locate and extract the area containing hematemesis, and remove interference information;

[0058] The segmented region of interest is subjected to color histogram feature encoding, the color information in the image is quantified, and a second time series data stream capable of representing the color change of hematemesis is generated.

[0059] In a specific implementation, the color space suitable for analysis is the HSV color space or the LAB color space;

[0060] The specific process of segmenting the region of interest in the converted image includes: using the typical hue and saturation range of hematemesis color to separate the image from the background, using threshold segmentation or edge detection to locate and extract the area containing hematemesis, and then generating a mask or coordinate information containing the area, and finally combining the original image with the mask operation to remove the background and other interference information.

[0061] Specifically, in S2, the collected RGB image frame sequence is first converted into a color space from the RGB color space to a color space suitable for analysis (such as the HSV or LAB color space). This is based on the limitations of the RGB color space and the color perception characteristics of the human visual system. The RGB color space is constructed based on the principle of the three primary colors of light. The color range it represents is limited and is not completely consistent with the way humans perceive color. The HSV color space decomposes color into three independent components: hue, saturation, and brightness, which is closer to the way humans perceive color; the LAB color space is a device-independent color space that can more accurately represent and distinguish colors.

[0062] Specifically, S2 performs region-of-interest segmentation on the converted image, separates the image from the background using the typical hue and saturation range of hematemesis colors, and uses techniques such as threshold segmentation or edge detection to locate and extract the region containing hematemesis, generating a mask or coordinate information containing the region. Finally, a mask operation is performed on the original image to remove the background and other interference information, thereby extracting useful image regions.

[0063] Specifically, in S2, the segmented region of interest is encoded with a color histogram feature, the color information in the image is quantified, and a second time series data stream that can characterize the color changes of vomited blood is generated. The color histogram is a method of statistically analyzing the color distribution of an image. By calculating the pixel value distribution of each color channel, the proportion and distribution of different colors in the image can be obtained, thereby converting the color information in the image into a quantifiable feature vector, which is convenient for subsequent machine learning models to analyze and process.

[0064] S3: The first time series data stream and the second time series data stream are time-series aligned and then input into a pre-trained machine learning prediction model. The machine learning prediction model establishes prediction rules by analyzing the correlation between the vomited blood volume-color joint time series pattern and the clinical risk score in historical cases, and parses the risk level probability distribution based on the output vector of the machine learning prediction model to generate a risk assessment report containing a timestamp.

[0065] In specific implementation, in S3, the machine learning prediction model is trained in the following way:

[0066] Collect and preprocess the dynamic hematemesis quantity time series data, hematemesis color time series data, and historical hematemesis data, perform time series alignment, and label the corresponding risk level labels to form a training data set;

[0067] Select a recurrent neural network or a convolutional neural network as the model framework, input the training data set into the model for training, and adjust the model parameters through gradient descent to minimize the error between the predicted value and the true value;

[0068] At the same time, cross-validation was used to evaluate the model performance, and finally a machine learning prediction model was obtained that could accurately predict the risk level of vomiting blood.

[0069] Specifically, in S2, the time dimensions of the two time series data streams are first aligned to ensure their temporal consistency and correspondence, so as to accurately reflect the dynamic relationship between the amount and color of vomited blood in time.

[0070] Specifically, S2 then feeds the aligned data into a pretrained machine learning prediction model. This model establishes prediction rules by analyzing the correlation between the temporal patterns of hematemesis volume and color in historical cases and the clinical risk score. During the model training phase, historical hematemesis data, including dynamic time series data on hematemesis volume and color, is collected and preprocessed, time-series aligned, and labeled with corresponding risk level labels to form a training dataset. A recurrent neural network (RNN) or convolutional neural network (CNN) is selected as the model framework. RNNs have excellent processing capabilities for sequential data and are particularly suitable for tasks such as time series prediction because they have a memory function and can leverage information from previous moments to influence the output at the current moment. CNNs automatically extract data features through convolution operations and are suitable for processing data with local spatial or temporal correlations. After the training dataset is fed into the model, the model parameters are adjusted using the gradient descent algorithm to minimize the error between the predicted value and the true value. Gradient descent is a commonly used optimization algorithm that calculates the gradient of the loss function with respect to the model parameters and then updates the parameters in the opposite direction of the gradient, gradually approaching the optimal solution.

[0071] Specifically, S2 simultaneously uses cross-validation to evaluate model performance. By dividing the dataset into multiple subsets and alternating between training and validation, the model's generalization ability and performance metrics, such as accuracy, recall, and F1 value, are accurately estimated. Ultimately, a machine learning prediction model capable of accurately predicting the risk level of hematemesis is obtained. The model's output vector contains the probability distribution information for different risk levels. By analyzing this output vector, a risk assessment report with a timestamp can be generated, providing decision support to clinicians and helping them more accurately assess the risk of patients with hematemesis.

[0072] Example 2

[0073] This embodiment provides an electronic device comprising a memory and a processor, wherein the processor is configured to execute a program in the memory, thereby implementing the above-described machine learning-based hematemesis risk prediction method. The electronic device may be a medical computer, a mobile medical terminal, a server, or other device. The memory utilizes a high-speed SSD solid-state drive with large storage capacity, capable of quickly reading, writing, and storing a large amount of hematemesis monitoring data and machine learning model files. The processor utilizes a high-performance multi-core CPU with powerful parallel computing capabilities, capable of efficiently executing complex machine learning algorithms, ensuring that the hematemesis risk prediction task is completed in real time and quickly. The operating system utilizes a stable, reliable system that is adapted to the needs of the medical environment, such as Windows 10 Enterprise or Linux Ubuntu. To meet the requirements of use in medical scenarios, the electronic device is also equipped with a high-resolution touch screen display, making it convenient for medical staff to intuitively view risk assessment reports. At the same time, the device has good compatibility and can seamlessly connect with the hospital's existing information system (such as the HIS system) to achieve data sharing and interaction, making it convenient for medical staff to retrieve and integrate patient information between different systems. In addition, the electronic device is also designed with a standardized interface to facilitate the external connection of various hematemesis monitoring devices (such as hematemesis volume sensors, RGB image acquisition cameras, etc.), and supports remote data transmission functions, which can send the prediction results to the mobile terminals of medical staff in real time, so that medical staff can obtain the patient's condition risk information in a timely manner and make quick responses and decisions. The core function of the electronic device is to predict the risk of hematemesis through the execution of the program in the memory by the processor. Its specific working principle is to first collect data related to hematemesis through external monitoring equipment, including digitized measurement signals of hematemesis body volume and RGB image frame sequences, etc. These data are transmitted to the memory of the electronic device via a standardized interface for storage. Subsequently, the processor calls the machine learning prediction program in the memory and processes these data in sequence. First, the digitized measurement signal of the hematemesis body volume is subjected to adaptive noise reduction processing and dynamic range calibration to generate a first time series data stream for characterizing the dynamic hematemesis volume; at the same time, the hematemesis RGB image frame sequence is subjected to color space conversion, region of interest segmentation, and color histogram feature encoding to generate a second time series data stream characterizing the color of hematemesis. The first time series data stream and the second time series data stream are then time-aligned and input into a pre-trained machine learning prediction model. The model establishes prediction rules by analyzing the correlation between the vomited blood volume-color joint time series pattern and the clinical risk score in historical cases, and analyzes the risk level probability distribution based on the output vector of the machine learning prediction model, and finally generates a risk assessment report containing a timestamp.

[0074] Example 3

[0075] This embodiment provides a storage medium containing computer-executable instructions. When executed by a computer processor, the storage medium containing computer-executable instructions is used to perform the above-mentioned machine learning-based hematemesis risk prediction method. The storage medium can be a non-volatile memory, such as a read-only memory (ROM), a programmable read-only memory (PROM), an electrically programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory, or a portable storage device such as a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, or a solid-state drive (SSD) or a hard disk (HDD). The computer program stored thereon contains a series of instructions. When the processor executes these instructions, the following steps can be performed: adaptive noise reduction and dynamic range calibration are performed on the digitized measurement signal of the hematemesis volume to generate a first time-series data stream; color space conversion, region of interest segmentation, and color histogram feature encoding are performed on the hematemesis RGB image frame sequence to generate a second time-series data stream; the two time-series data streams are aligned and input into a pre-trained machine learning prediction model, and the model output vector is parsed to generate a risk assessment report containing a timestamp. This storage medium can be widely used in the field of medical equipment, such as integrated into medical computers, mobile medical terminals or servers, to provide medical staff with accurate and efficient support for hematemesis risk prediction.

[0076] Example 4

[0077] Medical staff collect the patient's vomited blood through a collection container equipped with a volume sensor. The volume sensor converts the volume change of the vomited blood into an electrical signal, and generates a digital measurement signal through analog-to-digital conversion, which is transmitted to the terminal device in real time.

[0078] At the same time, a high-definition camera installed next to the bed collects RGB image frame sequences of vomited blood in the collection container at a frequency of 30 frames per second and transmits the data to the same terminal device.

[0079] The processor in the terminal device begins executing the machine learning-based hematemesis risk prediction program stored in memory. First, adaptive noise reduction is performed on the received digitized volume measurement signal. The program uses a sliding window Fourier transform to separate the signal's frequency domain components, identifying and filtering out high-frequency noise, such as ambient electromagnetic interference. Next, dynamic range calibration is performed, linearly transforming the signal values to a standard range of 0-100. This generates the first time-series data stream, formatted as [time 1, volume value 1; time 2, volume value 2; ...], which clearly records the dynamic changes in hematemesis volume over time.

[0080] For RGB image frames of hematemesis, the program first converts them from RGB color space to HSV color space. Using the typical hue (5-15) and saturation (0.6-0.9) ranges of gastrointestinal bleeding in HSV space, a threshold segmentation technique is used to separate the hematemesis region from the background, generating a mask. After performing a masking operation on the original image, irrelevant background is removed, and the hematemesis region is accurately extracted. The segmented region is then encoded with color histogram features to quantify the color information and generate a second time-series data stream.

[0081] The program precisely aligns the two time-series data streams to ensure consistency across the temporal dimension. This aligned data is then fed into a pretrained recurrent neural network prediction model. This model, trained on extensive historical case data, has deeply learned the correlation between the temporal pattern of hematemesis volume and color and clinical risk scores. The model analyzes the output vector, which the program uses to parse the probability distribution of patients at different risk levels: low risk (15%), medium risk (30%), and high risk (55%).

[0082] Finally, the system generates a timestamped risk assessment report, indicating that the patient's current risk level for hematemesis is high and the probability of hematemesis is 55%. The report is immediately displayed on the terminal device's screen and simultaneously sent to the medical staff's mobile device.

[0083] The above description of the embodiments is intended to facilitate understanding and use of the invention by those skilled in the art. It will be apparent that those skilled in the art can readily make various modifications to these embodiments and apply the general principles described herein to other embodiments without requiring inventive effort. Therefore, the present invention is not limited to the above-described embodiments. Improvements and modifications made by those skilled in the art based on the disclosure of the present invention, without departing from the scope of the present invention, should be within the scope of protection of the present invention.

Claims

1. A method for predicting hematemesis risk based on machine learning, characterized in that: The following steps are involved: S1: performing adaptive noise reduction processing and dynamic range calibration on the digital measurement signal of the hematemesis volume to generate a first time series data stream for representing the dynamic hematemesis volume; S2: performing color space conversion, region of interest segmentation, and color histogram feature encoding on the hematemesis RGB image frame sequence to generate a second time series data stream for representing the color of the hematemesis; S3: The first time series data stream and the second time series data stream are time-series aligned and then input into a pre-trained machine learning prediction model. The machine learning prediction model establishes prediction rules by analyzing the correlation between the vomited blood volume-color joint time series pattern and the clinical risk score in historical cases, and parses the risk level probability distribution based on the output vector of the machine learning prediction model to generate a risk assessment report containing a timestamp.

2. The method for predicting hematemesis risk based on machine learning according to claim 1, characterized in that: In S1, specific The following processes are included: Adaptive noise reduction processing is performed on the digital measurement signal of vomited blood volume to remove noise interference in the signal, retain the effective signal components that reflect the true changes in vomited blood volume, improve signal quality, and provide more accurate basic data for subsequent data processing; The dynamic range of the signal after noise reduction processing is calibrated to adjust the value range of the signal to an appropriate interval, so that the generated first time series data stream can more accurately characterize the changes in the dynamic amount of vomiting blood.

3. The method for predicting hematemesis risk based on machine learning according to claim 2, characterized in that: The adaptive noise reduction process includes: separating the signal frequency domain components through sliding window Fourier transform, applying a frequency domain threshold filtering algorithm to eliminate high-frequency noise components, and using a dynamic baseline correction algorithm to compensate for environmental interference; The dynamic range calibration process includes: based on the adaptive noise reduction process, performing a linear or nonlinear transformation on the noise-reduced signal to adjust its numerical range to a more appropriate range.

4. The method for predicting hematemesis risk based on machine learning according to claim 1, characterized in that: In S1, the format of the first time series data stream is a data sequence arranged in chronological order, containing a timestamp and a corresponding volume value, and the specific format is: time 1, volume value 1; time 2, volume value 2; ...; time n, volume value n.

5. The method for predicting hematemesis risk based on machine learning according to claim 1, characterized in that: In S1, the digital measurement signal of the vomited blood volume is a digital signal sequence carrying volume information obtained by converting the volume change of the vomited blood in the collection container into an electrical signal and then performing analog-to-digital conversion.

6. The method for predicting hematemesis risk based on machine learning according to claim 1, characterized in that: S2 specifically includes the following steps: Performing color space conversion on the collected hematemesis RGB image frame sequence, converting from RGB color space to a color space suitable for analysis; Perform region of interest segmentation on the converted image, locate and extract the area containing hematemesis, and remove interference information; The segmented region of interest is subjected to color histogram feature encoding, the color information in the image is quantified, and a second time series data stream capable of representing the color change of hematemesis is generated.

7. The method for predicting hematemesis risk based on machine learning according to claim 6, characterized in that: The color space suitable for analysis is HSV color space or LAB color space; The specific process of segmenting the region of interest in the converted image includes: using the typical hue and saturation range of hematemesis color to separate the image from the background, using threshold segmentation or edge detection to locate and extract the area containing hematemesis, and then generating a mask or coordinate information containing the area, and finally combining the original image with the mask operation to remove the background and other interference information.

8. The method for predicting hematemesis risk based on machine learning according to claim 1, characterized in that: In S3, the machine learning prediction model is trained in the following way: Collect and preprocess the dynamic hematemesis quantity time series data, hematemesis color time series data, and historical hematemesis data, perform time series alignment, and label the corresponding risk level labels to form a training data set; Select a recurrent neural network or a convolutional neural network as the model framework, input the training data set into the model for training, and adjust the model parameters through gradient descent to minimize the error between the predicted value and the true value; At the same time, cross-validation was used to evaluate the model performance, and finally a machine learning prediction model was obtained that could accurately predict the risk level of hematemesis.

9. An electronic device comprising a memory and a processor, characterized in that: The processor is used to execute the program in the memory to implement the machine learning-based hematemesis risk prediction method as described in any one of claims 1 to 8.

10. A storage medium containing computer-executable instructions, characterized in that: The storage medium of the computer executable instructions is used to execute the hematemesis risk prediction method based on machine learning as described in any one of claims 1 to 8 when executed by a computer processor.

Citation Information

Patent Citations

  • Vomitus holding system

    CN109303701A

  • Spitting blood protection measurement bag

    CN205108436U