Vital sign prediction and anomaly detection system and method based on non-contact sensor

By combining non-contact sensors and machine learning algorithms, the limitations of contact monitoring technology have been overcome, enabling flexible, accurate, and real-time monitoring of vital signs to meet the health monitoring needs of modern life.

CN120859453APending Publication Date: 2025-10-31NANKAI UNIV

Patent Information

Application Number
CN202510725955.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing contact-based vital sign monitoring technologies are inconvenient to use, may cause discomfort, cross-infection, and are subject to environmental limitations. They are difficult to apply in dynamic scenarios and cannot meet the needs of modern life for high availability, high adaptability, and high real-time performance of health monitoring systems.

Method used

By employing non-contact sensors combined with machine learning algorithms, and through a non-contact sensor receiving subsystem, a data storage subsystem, a data preprocessing subsystem, a multi-dimensional feature extraction engineering subsystem, and a prediction and anomaly detection model subsystem, real-time monitoring and anomaly detection of vital signs data can be achieved.

Benefits of technology

It enables flexible, accurate, and real-time monitoring of vital signs, timely detection of potential health problems, provides a safe and convenient health monitoring solution, protects user privacy, and is suitable for various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120859453A_ABST
    Figure CN120859453A_ABST
Patent Text Reader

Abstract

The invention provides a vital sign prediction and anomaly detection system and method based on a non-contact sensor. The system comprises a non-contact sensor receiving subsystem used for receiving and extracting vital sign data such as respiration and heart rate; the data storage subsystem is used for constructing a database to store multiple types of data; the data preprocessing subsystem is used for extracting key information and adding noise to simulate a real environment; the multi-dimensional feature extraction subsystem is used for generating a feature sequence for model training; the prediction and anomaly detection model subsystem is used for realizing prediction and anomaly detection; and the visual user system is used for pushing health suggestions and abnormal alarm information through a WeChat applet and an AI agent. According to the method, the vital signs can be predicted in real time and the abnormal values can be detected only through a small amount of user data, and compared with a traditional method, the method has higher flexibility, accuracy, real-time performance and privacy and can serve as an effective solution for vital sign prediction and abnormal detection in the field of sensor Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-contact human vital sign monitoring technology, specifically to a method and system for predicting vital signs and detecting abnormalities using non-contact sensors. Background Technology

[0002] With the increasing demand for health monitoring, vital sign monitoring technology is playing an increasingly important role in fields such as healthcare, elderly care, smart homes, and vehicle safety. Currently, mainstream vital sign monitoring technologies primarily rely on contact sensors, such as electrocardiogram (ECG) scanners, blood oxygen saturation sensors, and breathing belts. While these sensors offer advantages in accuracy, they also have several limitations in practical applications. First, contact sensors typically require direct contact with human skin, which is not only inconvenient but can also cause discomfort, especially for the elderly, infants, or post-operative patients. Furthermore, sharing or prolonged use by multiple people can easily lead to cross-infection, posing hygiene risks. Second, contact sensors often have high requirements for the operating environment and user behavior, such as requiring stillness and avoiding movement interference, limiting their applicability in dynamic scenarios.

[0003] Compared to contact sensors, non-contact sensors offer significant advantages. They can monitor critical vital signs such as heartbeat and respiration in real time without physical contact, greatly improving ease of use and comfort. Common non-contact sensors include millimeter-wave radar, infrared thermal imaging, pressure-sensing mattresses, and Wi-Fi signal analysis. These sensors can continuously monitor a user's physiological state without interfering with their daily activities, making them suitable for various applications such as sleep monitoring, home care, smart wards, and driver fatigue detection.

[0004] The importance of non-contact methods is particularly evident in the prediction and detection of abnormalities in heart rate and respiration. Abnormalities such as tachycardia, arrhythmia, and apnea are often important precursors to sudden illnesses (such as heart disease, sudden death, and sleep apnea syndrome). By constructing predictive models based on non-contact sensors and combining them with artificial intelligence algorithms to model and analyze the collected vital sign data, early warning and intervention for potential health risks can be achieved, thereby effectively improving the efficiency and safety of health management.

[0005] In conclusion, developing a non-contact, continuous, and intelligent method and system for predicting and detecting abnormal heartbeats and respiration can not only overcome the limitations of traditional contact sensors, but also meet the demands of modern life for high availability, high adaptability, and high real-time performance in health monitoring systems, thus having broad application prospects and social value. Summary of the Invention

[0006] The present invention aims to provide a method and system for predicting vital signs and detecting abnormalities based on non-contact sensors, so as to overcome the limitations of the prior art.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] On one hand, this invention proposes a vital sign prediction and anomaly detection system based on a non-contact sensor. This system comprises a non-contact sensor and a vital sign prediction and anomaly detection system. The vital sign prediction and anomaly detection system includes a non-contact sensor receiving subsystem, a data storage subsystem, a data preprocessing subsystem, a multi-dimensional feature extraction engineering subsystem, a prediction and anomaly detection model subsystem, and a visualization user system, wherein:

[0009] Non-contact sensor receiving subsystem: includes a data message receiving module and a data parsing and sending module, used to receive data messages sent by non-contact sensors, extract vital sign data, and send them to the data storage subsystem for storage. The vital sign data includes, but is not limited to, vital sign data such as respiration and heart rate.

[0010] Data storage subsystem: Establishes a vital signs database to store received vital signs data, and processes the vital signs data to obtain datasets including but not limited to historical data, real-time data, average data, and abnormal data, which are then stored in the database; This data storage subsystem stores various types of data based on the unique user ID and transaction processing.

[0011] The data preprocessing subsystem reads data in batches from the dataset stored in the data storage subsystem and performs preliminary processing to obtain a format suitable for subsequent analysis. Specifically: data reading and merging; batch reading of CSV files in the dataset, parsing out user IDs and adding them as features to the dataset; subsequently, merging data from multiple files, removing irrelevant columns, and retaining only heart rate (HR), respiratory rate (RESP), and timestamp information; handling outliers in the merged data, removing abnormal data recorded by sensors due to users temporarily leaving; and adding Gaussian noise and impulse noise to the HR and RESP signals after outlier handling, respectively.

[0012] Furthermore, the Gaussian noise described in this invention follows a normal distribution with a mean of 0, and the standard deviation controls the noise intensity. It is used to simulate the circuit thermal noise of non-contact sensors and the Gaussian distribution of human physiological parameters. The characteristics of impulse noise are: random occurrence, significantly higher amplitude than normal signal fluctuations, and direction that can be positive or negative. It is used to simulate electromagnetic interference, malfunctions, and sudden movement of the user in sensors.

[0013] The multi-dimensional feature extraction engineering subsystem includes the following modules:

[0014] Temporal feature extraction module: Calculates the statistical characteristics of vital sign data, such as mean, standard deviation, extreme values, median, skewness, and kurtosis, using different sliding windows;

[0015] Extracting first-order difference features captures the rate of change of the signal. The first-order difference represents the difference between signal values ​​at adjacent time steps and is used to capture the rate of change of the signal, such as the speed at which the heart rate rises or falls.

[0016] Extracting second-order difference features captures the rate of change of the signal. The second-order difference represents the difference between the first-order differences and reflects the acceleration of the rate of change of the signal, which is used to detect sudden changes in trends.

[0017] Frequency domain feature extraction module: Based on the Welch algorithm, calculate the power spectral density and extract the frequency domain features of the vital signs data, including the dominant frequency (the frequency corresponding to the maximum power spectral density, reflecting the dominant period of the signal), high and low frequency power, and spectral entropy.

[0018] Time Feature Generation Module: Generates sine / cosine periodic features to simulate physiological rhythms;

[0019] Crossover and Statistical Feature Generation Module: Calculates the ratio, product, and difference between HR and RESP; generates statistical features such as cumulative sum, cumulative mean, and Z-score.

[0020] This multi-dimensional feature extraction engineering subsystem performs time-domain feature extraction, frequency-domain feature extraction, time feature generation, and cross and statistical feature generation on the data processed by the data preprocessing subsystem to generate a multi-dimensional feature dataset.

[0021] Prediction and Anomaly Detection Model Subsystem: Utilizes machine learning algorithms to train the feature value sequence of the multi-dimensional feature extraction engineering subsystem, constructs a time series dataset, selects different time steps with window lengths, inputs the feature sequence to train a random forest model, outputs the HR / RESP prediction values ​​for future time steps, monitors vital sign data in real time, and promptly issues alarms and takes corresponding measures when the data exceeds the normal range or shows abnormal changes.

[0022] Sliding window sampling module: Select different window lengths seq_length, each window contains features from the previous seq_length time steps, and uses the HR / RESP of the next time step as the label; by comparing the model performance of different window lengths seq_length, determine the optimal temporal dependency length and improve prediction accuracy;

[0023] Model training module: For the random forest model, the number of trees n_estimators is optimized through grid search, multiple training sets are generated by random sampling, multiple decision trees are constructed, the prediction results are output through a voting mechanism, and the optimal prediction model is selected through algorithm comparison and hyperparameter tuning to avoid the limitations of a single algorithm.

[0024] Model evaluation module:

[0025] Regression indicators;

[0026] (1) Mean Squared Error (MSE): This measures the average of the squared differences between the predicted and actual values. It is more sensitive to larger errors. The formula is:

[0027]

[0028] (2) Root Mean Square Error (RMSE), the square root of MSE, has the same units as the original data, making it easier to understand the magnitude of the error. The formula is:

[0029]

[0030] (3) Mean Absolute Error (MAE): This measures the average absolute difference between the predicted and actual values. It is insensitive to outliers. The formula is:

[0031]

[0032] (4) Coefficient of determination R 2 R represents the proportion of data variation that the model can explain. 2 A value close to 1 indicates a good model fit, as shown in the formula:

[0033]

[0034] Classification indicators:

[0035] (1) Accuracy, the proportion of correctly classified samples to the total number of samples, is calculated using the following formula:

[0036]

[0037] (2) Precision, which is the proportion of samples that are actually positive out of all those predicted as positive, is expressed by the formula:

[0038]

[0039] (3) Recall rate, which is the proportion of samples that are actually positive that are correctly predicted as positive, is expressed by the formula:

[0040]

[0041] (4) The F1 score, the harmonic mean of precision and recall, provides a single metric for evaluating the overall performance of the model, and is expressed as follows:

[0042]

[0043] The model was converted into a binary classification problem by using an error threshold of ±0.1 errors / minute. Accuracy, precision, recall, and F1 score were used to evaluate the model performance using visual regression and classification metrics.

[0044] Visualized User System: A WeChat Mini Program and an AIAgent intelligent agent are built to receive users' vital sign data in real time. Users can search for historical and abnormal data for a specified date. The AIAgent can provide users with health-related suggestions based on their real-time vital sign data, historical data, and predictive data. When abnormal data occurs, the WeChat Mini Program sends alarm information to users through the subscription function.

[0045] On the other hand, the present invention also proposes a method for predicting vital signs and detecting abnormalities based on non-contact sensors, implemented through the system provided in the first aspect of the present invention, comprising:

[0046] Step 1: Acquire vital sign data from non-contact sensors and perform preprocessing;

[0047] Step 2: Extract multi-dimensional features from the acquired vital sign data;

[0048] Step 3: Construct a time-series dataset based on the extracted feature data;

[0049] Step 4: Divide the dataset and train and evaluate the model;

[0050] Step 5: Visualize and analyze the results.

[0051] Furthermore, step 1 of the method of the present invention specifically includes: reading dataset CSV files in batches from the non-contact sensor receiving subsystem, parsing user IDs and adding them as features, merging data from multiple files, removing irrelevant columns, retaining HR, RESP and timestamp information, and adding noise to HR and RESP data to simulate real environmental noise;

[0052] Furthermore, step 2 of the method of the present invention specifically includes:

[0053] Extracting time-domain features: Calculating statistical and difference features using a sliding window;

[0054] Extracting frequency domain features: Power spectral density is calculated based on the Welch algorithm, and the main frequency, high and low frequency power, and spectral entropy are extracted;

[0055] Generating temporal features: Generating sine / cosine periodic features to simulate physiological rhythms;

[0056] Generate crossover and statistical characteristics: Calculate the statistical characteristics of the ratio, product, and difference between HR and RESP;

[0057] Furthermore, step 3 of the method of the present invention specifically includes: defining different sequence lengths based on the crossover and statistical features obtained in step 2, converting the feature matrix into a three-dimensional tensor (number of samples × sequence length × number of features), constructing a time series dataset, and providing structured data input for subsequent model training;

[0058] Furthermore, step 4 of the method of the present invention specifically includes: dividing the training set and the test set according to a ratio, performing standardization processing, and training the regression model;

[0059] Calculate regression and classification indices to evaluate model performance;

[0060] Furthermore, step 5 of the method of the present invention specifically includes: drawing a curve and scatter plot comparing the predicted value and the actual value to intuitively show the difference and trend consistency between the model prediction result and the actual data;

[0061] Save the evaluation metrics for each model and compare and analyze the model performance.

[0062] Overall, compared with the prior art, the technical solution of the present invention, which uses a non-contact sensor for vital sign prediction and anomaly detection, has the following advantages:

[0063] Flexibility: It uses non-contact sensors for vital sign detection, which has the advantages of high flexibility, ease of use and no environmental restrictions.

[0064] Accuracy: It enables comprehensive monitoring of multiple vital signs, providing a complete picture of a person's health status. By utilizing machine learning algorithms to analyze and process the data, it can achieve real-time prediction of vital signs and anomaly detection, improving the accuracy and reliability of detection.

[0065] Real-time performance: The system has an efficient user feedback and alarm mechanism, which can promptly detect potential health problems and take corresponding measures, providing users with a safer and more convenient health monitoring solution.

[0066] Privacy: The system only collects physiological signals monitored by non-contact sensors (such as respiration and heart rate data), and does not involve the collection and storage of sensitive human features such as images and sounds. Even when deployed in private settings such as bedrooms and hospital wards, it can avoid the risk of privacy information leakage from the source, fully protecting user data security and privacy rights. Attached Figure Description

[0067] Figure 1This is a flowchart illustrating the workflow of the non-contact sensor-based vital sign prediction and anomaly detection system in the structure and embodiments of the present invention.

[0068] Figure 2 This is a flowchart of the data preprocessing process in an embodiment of the present invention;

[0069] Figure 3 This is a flowchart of the vital signs prediction and anomaly detection method based on non-contact sensors in an embodiment of the present invention. Detailed Implementation

[0070] To facilitate understanding of the technical solution of this invention, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the specific embodiments described herein are only used to explain the structure and inventive points of this invention and are not limited to the scope of protection defined in the claims of this invention.

[0071] The workflow of the vital sign prediction and anomaly detection system based on non-contact sensors provided in this embodiment of the invention is as follows: Figure 1 As shown, the entire system structure includes a non-contact sensor and a vital signs prediction and anomaly detection system. The vital signs prediction and anomaly detection system further includes the following subsystems: non-contact sensor receiving subsystem 1, data storage subsystem 2, data preprocessing subsystem 3, multi-dimensional feature extraction engineering subsystem 4, prediction and anomaly detection model subsystem 5, and visualization user system 6.

[0072] Regarding non-contact sensors, to ensure accurate data transmission during installation, they must be installed within an effective range capable of correctly identifying the user's vital signs. For data acquisition, data collection can be conducted for different genders and age groups. During data transmission, multiple non-contact sensors interact with the vital signs prediction and anomaly detection system via Ethernet, transmitting data packets to exchange monitoring data.

[0073] The vital signs prediction and abnormality detection system needs to be deployed in a computer, and the computer needs to have basic functions such as network communication, data storage and model training.

[0074] The non-contact sensor receiving subsystem 1 serves as the system's data entry point, acting as a communication bridge between the non-contact sensor and the backend data processing system. This invention's non-contact sensor receiving subsystem 1 includes a data message receiving module and a data parsing and sending module.

[0075] For the data packet receiving module, UDP protocol is used to receive data. The UDP port of the computer where the system is located is always in a listening state to receive user vital sign data sent by the sensor.

[0076] For the data parsing and sending module, the data packets are first subjected to header frame verification, data packet length verification, data packet checksum verification, and other checks. Then, vital sign data is extracted from the message, and the user's vital sign data is parsed out. Based on the unique user ID identifier, the data is sent to the computer's data storage table for storage.

[0077] For data storage subsystem 2, based on the unique user ID and transaction processing, average data and abnormal data are calculated periodically and stored in the average data table and abnormal data table respectively, while real-time data is stored in the real-time data table.

[0078] In some embodiments of the present invention, a vital signs database is established in the data storage subsystem 2 to store received vital signs data. By processing the vital signs data, datasets including, but not limited to, historical data, real-time data, average data, and abnormal data are obtained and stored in the database.

[0079] Data preprocessing subsystem 3 is used to read data in batches from the dataset and perform preliminary processing to obtain a format suitable for subsequent analysis. Specifically, regarding the data preprocessing part... Figure 2 The data preprocessing flowchart provided for embodiments of the present invention includes the following steps:

[0080] Step S31: Read the combined heart rate and respiratory vital signs data;

[0081] Step S32: Handle outliers;

[0082] Step S33: Add noise;

[0083] Specifically, in step S31, the user's vital signs data (heart rate and respiration) are downloaded from the data storage subsystem 2. Considering the large amount of data, it can be downloaded in batches, reading CSV files from the dataset in batches. The user ID is parsed and added to the dataset as a feature in subsequent processes. Then, the data from multiple files are merged, irrelevant columns are removed, and only heart rate (HR), respiratory rate (RESP), and timestamp information are retained.

[0084] Specifically, in step S32, considering that the user may temporarily leave, causing the sensor to record abnormal data, it is necessary to clear the abnormal data.

[0085] Specifically, in step S33, noise is added to the heart rate and respiration data after outlier processing to simulate real-world environmental disturbances. The added noise includes Gaussian noise and impulse noise.

[0086] Gaussian noise follows a normal distribution with a mean of 0. The standard deviation controls the noise intensity. The thermal noise of non-contact sensors and human physiological parameters such as heart rate and respiration typically exhibit Gaussian distributions; therefore, Gaussian noise can simulate these differences. This enhances the model's robustness to interference, forcing it to learn data trends rather than relying on noise-sensitive details. Aligning the data distribution with the noise distribution of real-world data makes the training data closer to actual data collection scenarios, reducing performance degradation during deployment.

[0087] In this invention, the Gaussian noise formula is as follows:

[0088] Noisy Signal=Original Signal+N(0,σ2)

[0089] Noisy Signal: This refers to the signal after adding Gaussian noise, i.e., vital sign data (such as heart rate, respiratory rate, etc.) are affected by noise.

[0090] Noisy Signal: refers to the original vital signs signal, which is the real data collected by the sensor without added noise.

[0091] N(0,σ2): Represents a normally distributed random variable with a mean of 0 and a variance of σ2, used to generate noise that conforms to a Gaussian distribution. Here, a mean of 0 means that the probability of noise fluctuation in the positive and negative directions is approximately equal; the variance σ2 is used to control the intensity of the noise. The larger σ is, the higher the noise intensity and the greater the degree of interference with the original signal.

[0092] In non-contact monitoring, sudden user movement can cause abrupt changes in sensor signals, and sensor malfunctions can lead to extreme values ​​in the collected data. Using impulse noise can avoid oversensitivity to transient outliers, improve robustness, train the model to identify outliers, and avoid prediction bias caused by occasional interference; it also enhances generalization ability by simulating extreme situations during data acquisition, ensuring that the model can still output stably under "dirty data".

[0093] In this invention, the formula for impulse noise is as follows:

[0094]

[0095] Noisy Signal: The signal after adding impulse noise, i.e., vital sign data after being subjected to sudden interference (such as motion artifacts or sensor malfunctions).

[0096] Original Signal: Vital signs signal after adding Gaussian noise.

[0097] A: The amplitude of impulse noise can be positive or negative (positive values ​​indicate a sudden increase in signal, and negative values ​​indicate a sudden decrease in signal). A positive value simulates a sensor receiving a strong signal momentarily, such as muscle tremors during exercise causing a misjudgment of an increased heart rate. A negative value simulates a signal being lost momentarily, such as a sensor malfunction causing a sudden drop in respiratory rate.

[0098] rand: A random number with a uniform probability distribution between [0,1], used to determine whether to add impulse noise point by point. It realizes the randomness of impulse noise and simulates the suddenness and irregularity of interference.

[0099] p: The probability of impulse noise occurring. For example, p = 0.01 means that 1% of the sampling points are affected by the noise. Low probability simulates occasional interference, such as sensor momentary failures several times a day. High probability simulates high-frequency interference scenarios, such as continuous motion artifacts during movement.

[0100] Specifically, the multi-dimensional feature extraction engineering subsystem 4 includes the following steps:

[0101] Step S41: Extract time-domain features from vital sign data;

[0102] Step S42: Extract frequency domain features from vital sign data;

[0103] Step S43: Generate time features from vital sign data;

[0104] Step S44: Perform cross-validation and statistical feature generation on the vital signs data;

[0105] Specifically, in step S41, the user's vital signs data exhibit regular changes over time. Therefore, a time-domain feature extraction module is used to capture the short-term trends, fluctuation amplitudes, and rates of change of the user's vital signs data. Statistical characteristics such as the mean, standard deviation, extreme values, median, skewness, and kurtosis of the vital signs data are calculated using different sliding windows.

[0106] The moving average formula is:

[0107]

[0108] RollingMean t : Represents the moving average of vital sign data (such as heart rate, respiratory rate, etc.) calculated based on a sliding window at time t. It reflects the average level of the signal within the sliding window including time t and is used to capture the short-term trend of vital sign data.

[0109] w: Represents the size of the sliding window, in seconds. It determines the time range used to calculate the moving average, that is, the time span of the signal data used in the calculation. For example, w=5 means that the average of vital signs data over the past 5 seconds is being calculated.

[0110] t: represents the current time, which is the time point of interest when calculating the moving average.

[0111] i: is the index variable in the summation formula, used to traverse each time step within the sliding window. Its value ranges from t-w+1 to t, representing different time points within the sliding window.

[0112] Signal[i]: Represents the value of the vital signs signal at the i-th time step, which is the vital signs data (such as heart rate, respiratory rate, etc.) collected at the corresponding time point.

[0113] First-order difference features are extracted to capture the rate of change of the signal. The first-order difference represents the difference between signal values ​​at adjacent time steps and is used to capture the rate of change of the signal, such as the rate of increase or decrease of heart rate. The formula is:

[0114] Diff t =Signal[t] - Signal[t-1]

[0115] Diff t : Represents the first-order difference result of vital sign signals (such as heart rate, respiratory rate, etc.) at time t. It reflects the change in vital sign signal values ​​from time t-1 to time t, and is used to capture the rate of change of signals between adjacent time steps.

[0116] Signal[t]: Represents the value of the vital signs signal at time t, that is, the vital signs data collected by the sensor at time t (such as the heart rate value, respiratory rate value, etc. at a certain time).

[0117] Signal[t-1]: Represents the value of the vital sign signal at time t-1, which is the vital sign data collected by the sensor at the previous time step. By calculating the difference between the signal value at the current time and the previous time, the rate of change of the signal is obtained.

[0118] Second-order difference features are extracted to capture the rate of change of the signal. The second-order difference represents the difference between the first-order differences and reflects the acceleration of the signal's rate of change. It is used to detect sudden changes in trends. The formula is:

[0119] Diff2 t =Diff t -Diff t-1

[0120] Diff2 t : Represents the second-order difference result of the vital signs signal at time t. It reflects the acceleration of the signal change rate and can be used to detect sudden changes in the trend of vital signs signals (such as heart rate, respiratory rate, etc.).

[0121] Difft : is the first-order difference of the vital signs signal at time t, that is, the difference between the signal values ​​of adjacent time steps, which reflects the rate of change of the signal at that time.

[0122] Diff t-1 : represents the first-order difference of the vital signs signal at time t-1, signifying the rate of change of the signal at the previous time step. By calculating the difference between the first-order differences of these two adjacent time steps, the second-order difference is obtained, thereby capturing the changes in the rate of change of the signal.

[0123] Examples of using vital sign data, such as:

[0124] The average HR value within 3 seconds of the window size: HR = [70, 72, 71] → average = 71;

[0125] The standard deviation of HR within a 5-second window: HR = [70, 72, 71, 68, 70] → Standard deviation ≈ 1.5

[0126] HR_rolling_max_5 (maximum value within the window), HR_rolling_median_5 (median), HR_rolling_skew_10 (skewness), etc.

[0127] First-order difference: HR_diff = HR[t] - HR[t-1] (reflects the rate of change). HR sequence [70, 72, 71] → first-order difference [0, 2, -1].

[0128] Second-order difference: HR_diff2 = HR_diff[t] - HR_diff[t-1] (reflects the rate of change of acceleration). First-order difference [0, 2, -1] → Second-order difference [0, 2, -3].

[0129] Specifically, in step S42, the user's vital signs data, such as heart rate and respiration, exhibit periodicity, which is closely related to human physiological characteristics. Therefore, a frequency domain feature extraction module is used to analyze the frequency components of the signal and capture periodic features. Based on the Welch algorithm, the power spectral density is calculated, and frequency domain features such as the dominant frequency (the frequency corresponding to the maximum power spectral density, reflecting the dominant period of the signal), high and low frequency power, and spectral entropy are extracted from the vital signs data. The power spectral density formula is:

[0130]

[0131] PSD(f): Represents the power spectral density, which is a function of frequency f. It reflects the power distribution of vital signs signals (such as heart rate, respiratory rate, etc.) at different frequencies, and is used to analyze the frequency components of a signal to help understand the amount of energy contained in different frequency components of the signal.

[0132] N: Represents the segment length, i.e., the number of samples in each Fast Fourier Transform (FFT) analysis segment. It determines the data length selected when performing spectral analysis on the signal, affecting the spectral resolution.

[0133] t: is a time index variable used to traverse the signal at various time points within a segment, with a value range from 0 to N-1.

[0134] Signal[t]: Represents the value of the vital signs signal at time t, that is, the vital signs data collected by the sensor at the corresponding time point (such as the heart rate value, respiratory rate value, etc. at a certain time).

[0135] f: represents frequency, with the unit being Hertz (Hz). It is used to analyze the frequency component distribution of a signal, that is, to determine the specific frequency values ​​of different frequency components in the signal.

[0136] j: is the imaginary unit, satisfying j 2 =-1, used in the formula to calculate complex number operations related to the Discrete Fourier Transform.

[0137] The formulas for high and low frequency power are:

[0138]

[0139] P low : Represents low-frequency power, which is obtained by summing the power spectral density values ​​corresponding to all frequency components with frequency f less than 0.1Hz in the power spectral density PSD(f), reflecting the energy contained in the low-frequency part of the vital signs signal.

[0140] P high : Represents high-frequency power, which is obtained by summing the power spectral density values ​​corresponding to all frequency components with frequency f greater than or equal to 0.1Hz in the power spectral density PSD(f), reflecting the energy situation of the high-frequency part of the vital signs signal.

[0141] The formula for spectral entropy is:

[0142]

[0143] H: Represents spectral entropy, used to measure the disorder or complexity of the power spectrum of vital signs signals. The higher the spectral entropy value, the more complex and disordered the frequency components of the signal are; the lower the spectral entropy value, the more concentrated and regular the frequency components of the signal are.

[0144] i: is the index variable in the summation formula, used to traverse each frequency component in the power spectral density. Its value ranges from 1 to M, where M represents the total number of frequency components considered.

[0145] f i: Represents the i-th frequency component, which is the power spectral density PSD(f i A specific frequency value in ().

[0146] PSD(f i ): Represents the power spectral density value corresponding to the i-th frequency component, that is, the power density of the signal at that frequency.

[0147] Using vital signs data as an example, this demonstrates how to calculate the power spectral density of HR / RESP signals using a sliding window (e.g., 30 samples / window) and extract:

[0148] Main frequency: HR_dominant_freq (frequency corresponding to the maximum value of PSD, unit: Hz).

[0149] If the main period of the HR signal is 60 seconds, then the main frequency = 1 / 60 ≈ 0.0167 Hz.

[0150] High and low frequency power:

[0151] HR_power_low_freq (total power at frequencies < 0.1Hz).

[0152] HR_power_high_freq (total power at frequencies ≥ 0.1Hz).

[0153] Spectral entropy: HR_spectral_entropy (measures the degree of disorder in power distribution; a higher entropy value indicates a more complex signal).

[0154] Specifically, in step S43, the user's vital signs data exhibit clear physiological rhythms such as diurnal patterns and respiratory cycles. Therefore, the time feature generation module introduces sine and cosine functions to simulate these physiological rhythms. For the timestamp (Time), calculations are performed at different periods of 60 seconds and 120 seconds:

[0155] time_sin_60=sin(2π×Time / 60)

[0156] time_cos_60=cos(2π×Time / 60)

[0157] When Time = 30 seconds and Period = 60 seconds:

[0158] time_sin_60=sin(π)=0, time_cos_60=cos(π)=-1.

[0159] For step S44, in the crossover and statistical feature generation module:

[0160] Cross features are used to explore the collaborative relationship between a user's HR and RESP, calculating cross features such as the ratio, product, and difference between HR and RESP.

[0161] Ratio: HR_RESP_ratio = HR / RESP (replace 1 if the denominator is 0).

[0162] Example: HR=70, RESP=16 → Ratio ≈ 4.375.

[0163] Product: HR_RESP_product = HR × RESP

[0164] Example: 70 × 16 = 1120.

[0165] Difference: HR_RESP_diff = HR - RESP

[0166] Example: 70-16=54.

[0167] Statistical features are used to reflect the overall trend and relative fluctuations of users' vital signs data. These features include cumulative sum, cumulative mean, and Z-score.

[0168] Cumulative statistic: HR_cumsum (total HR up to the current time step).

[0169] Example: HR for time step 1-3 = [70, 72, 71] → cumulative sum = 213.

[0170] HR_cummean: Cumulative mean, HR_cumsum / time step index.

[0171] Example: The cumulative average of time step 3 = 213 / 3 = 71.

[0172] Z-score: HR_zscore = (HR - HR mean) / HR standard deviation (reflects the standard deviation of the data point from the mean).

[0173] Example: HR = 70, mean = 71, standard deviation = 1 → Z = -1.

[0174] In summary, the multi-dimensional feature extraction engineering subsystem 4 performs operations such as time-domain feature extraction, frequency-domain feature extraction, time feature generation, and cross-statistical feature generation on vital sign data, ultimately generating a dataset containing dozens of dimensions of features.

[0175] Subsystem 5, the prediction and anomaly detection model, utilizes machine learning algorithms to train feature value sequences, constructs time-series datasets, selects different time steps with varying window lengths, inputs feature sequences to train a random forest model, and outputs predicted HR / RESP values ​​for future time steps. It monitors vital sign data in real time, and promptly issues alerts and takes appropriate measures when data exceeds normal ranges or exhibits abnormal changes. Specifically, it includes the following steps:

[0176] Step S51: Construct a time series dataset;

[0177] Step S52: Random Forest Model Optimization;

[0178] Step S53: Quantify performance using multiple metrics;

[0179] For step S51, specifically, the sliding window sampling module is entered, and different window lengths (seq_length) are selected. Each window contains features from the previous seq_length time steps, with the HR / RESP of the next time step as the label. By comparing the model performance of different window lengths (seq_length), the optimal temporal dependency length is determined to improve prediction accuracy. Specifically, after feature extraction in steps S41, S42, S43, and S44 of the multi-dimensional feature extraction engineering subsystem 4, the extracted features, along with vital sign data (heart rate, respiration, user ID, timestamp), are used as the dataset and sorted according to the time order of the data to determine the window length. Assuming seq_length = 3, the features from the first 3 time steps are used to predict the HR of the 4th time step. The input window contains all features (such as moving average, differencing, etc.) from time steps t-2, t-1, and t. The label is the true HR value at time step t+1 (e.g., HR = 68 for the 4th time step).

[0180] The data is traversed, and samples are generated by sliding the window, continuing until the end of the data set. The 3D sequence data (number of samples × window length × number of features) is reshaped into a 2D format (number of samples × (window length × number of features)) for standardization and model input. The optimal temporal dependency length is determined by comparing different seq_lengths (e.g., 3, 5, 10). Short windows are suitable for capturing short-term fluctuations, while long windows are suitable for capturing long-term fluctuations.

[0181] Specifically, in step S52, the model training module is entered. For the random forest model, the number of trees n_estimators in the random forest is optimized through grid search. Multiple training sets are generated by random sampling, multiple decision trees are constructed, and the prediction results are output through a voting mechanism. The optimal model is selected through algorithm comparison and hyperparameter tuning to avoid the limitations of a single algorithm.

[0182] Split the dataset: 80% training set and 20% test set, X_train, X_test, y_hr_train, y_hr_test = train_test_split(..., test_size = 0.2).

[0183] Standardize features: Use StandardScaler to standardize features using Z-score to ensure consistent feature weights. X_train_scaled = scaler.fit_transform(X_train).

[0184] During training, the default number of hyperparameter trees is n_estimators = 100, which can be optimized using grid search, for example, by trying n_estimators = [50, 100, 200]. The optimal parameter configuration is found by trying different combinations of random forest parameters. The random forest generates multiple training sets using .bootstrap sampling, constructing 100 decision trees, each growing based on different samples and feature subsets. In regression problems, the final result is obtained by averaging the predictions of each tree. For example: 3 trees predict HRs of 68, 69, and 70 respectively → final predicted value = 69.

[0185] For step S53, the model evaluation module:

[0186] Regression indicators:

[0187] (1) Mean Squared Error (MSE): This measures the average of the squared differences between the predicted and actual values. It is more sensitive to larger errors. The formula is:

[0188] MSE: Mean Squared Error, measures the average of the squared differences between predicted and actual values, and is used to evaluate the prediction error of a regression model. The smaller the value, the closer the model's predictions are to the actual values, and the better the model's performance.

[0189] N: Number of samples, i.e., the total number of data points used to evaluate the model.

[0190] i: Sample index, ranging from 1 to N, used to iterate through each sample.

[0191] y i The true value of the i-th sample is the actual observed vital signs data (such as the actual heart rate, respiratory rate, etc.).

[0192] The predicted value of the i-th sample is the prediction result given by the model for the i-th sample.

[0193]

[0194] (2) Root Mean Square Error (RMSE) is the square root of the MSE. It has the same units as the original data, making it easier to understand the magnitude of the error. The formula is:

[0195]

[0196] (3) Mean Absolute Error (MAE): This measures the average absolute difference between predicted and actual values ​​and is insensitive to outliers. The formula is:

[0197]

[0198] (4) Coefficient of determination R 2 , representing the proportion of data variation that the model can explain. R 2 A value close to 1 indicates a good model fit. The formula is:

[0199]

[0200] Classification indicators:

[0201] (1) Accuracy: The proportion of correctly classified samples out of the total number of samples. The formula is:

[0202]

[0203] (2) Precision: The proportion of samples that are actually positive out of all those predicted as positive. The formula is:

[0204]

[0205] TP: True Positive, which is the number of samples that are correctly predicted as positive by the model.

[0206] FP: False Positive, which is the number of samples that are incorrectly predicted as positive by the model.

[0207] (3) Recall: The proportion of samples that are actually positive (True) out of all True and False results, i.e., the proportion correctly predicted as positive. The formula is:

[0208]

[0209] TP: TruePositive, refers to the number of samples that are actually positive and are correctly predicted as positive by the model. For example, in the detection of abnormal vital signs, it is the number of samples that actually have abnormal vital signs and are correctly identified as abnormal by the model.

[0210] FN: False Negative, refers to the number of samples that are actually positive but are incorrectly predicted as negative by the model. For example, the number of samples with actual abnormal vital signs that are misclassified as normal by the model.

[0211] (4) The F1 score, the harmonic mean of precision and recall, provides a single metric for evaluating the overall performance of the model. The formula is:

[0212]

[0213] F1: The F1 score is the harmonic mean of precision and recall, used to comprehensively evaluate the performance of a classification model. It balances the two metrics of precision and recall; a high F1 score is achieved when both precision and recall are high.

[0214] Precision: Precision is the proportion of samples that are actually positive out of all samples predicted as positive. In other words, it's the percentage of samples that the model predicts will actually be positive.

[0215] Recall: Recall rate, as above, is the proportion of actual positive samples that are correctly predicted as positive.

[0216] The problem was converted into a binary classification problem by setting an error threshold of ±0.1 errors per minute. Accuracy, precision, recall, and F1 score were measured, and a time-series comparison chart of the first 100 samples was plotted, showing the curves of the true and predicted values ​​to visually demonstrate trend consistency. A scatter plot was also created, showing the distribution of the true and predicted values, ideally closely approximating the straight line y = x. The optimal parameters and model were selected based on a comprehensive evaluation of various indicators.

[0217] In summary: The prediction and anomaly detection model subsystem 5 constructs a time-series dataset, selects the optimal parameters and model, obtains predicted user heart rate and respiration data, and imports the data into the database for users to view in the WeChat mini program.

[0218] Figure 3 The flowchart of the vital sign prediction and anomaly detection method based on non-contact sensors provided in this embodiment of the invention includes the following steps:

[0219] Step S1: Acquire vital sign data from non-contact sensors and perform preprocessing;

[0220] Step S2: Extract multi-dimensional features from the acquired vital sign data;

[0221] Step S3: Construct a time series dataset based on the extracted feature data;

[0222] Step S4: Divide the dataset and perform model training and evaluation;

[0223] Step S5: Visualize and analyze the results.

[0224] Specifically, in step S1, during vital sign prediction and anomaly detection, the dataset CSV files are read in batches from the non-contact sensor receiving subsystem 1. User IDs are parsed and added as features, multiple files are merged, irrelevant columns are removed, and heart rate (HR), respiratory rate (RESP), and timestamp information are retained. Noise is added to the HR and RESP data to simulate real-world environmental noise.

[0225] Specifically, step S2 involves multi-dimensional feature extraction from the preprocessed vital sign data, which includes the following operations:

[0226] Extracting time-domain features: Statistical and difference features are calculated using a sliding window to capture the short-term trends, fluctuations, and rates of change in the data;

[0227] Extracting frequency domain features: Based on the Welch algorithm, the power spectral density is calculated, and the main frequency, high and low frequency power, spectral entropy, etc. are extracted to analyze the frequency components of the signal and capture periodic features.

[0228] Generating time features: Based on timestamp information, sine and cosine functions are introduced to calculate time features according to different periods, simulating the physiological rhythm of the human body;

[0229] Generate cross-sectional and statistical features: Calculate cross-sectional features such as the ratio, product, and difference between heart rate (HR) and respiratory rate (RESP), as well as statistical features such as cumulative sum, cumulative mean, and Z-score to uncover the correlations and overall trends between data.

[0230] Specifically, in step S3, based on the multi-dimensional feature data extracted in step S2, different sequence lengths are defined, the feature matrix is ​​converted into a three-dimensional tensor (number of samples × sequence length × number of features), and a time series dataset is constructed to provide structured data input for subsequent model training.

[0231] Specifically, in step S4, the time-series dataset constructed in step S3 is proportionally divided into training and test sets within the data management subsystem 4. The training set data is standardized to ensure consistent feature weights. A suitable machine learning model, such as a random forest, is selected, and the model is trained using the training set data in the model training subsystem 5. The trained model is then evaluated using the test set data, and regression metrics (such as mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and coefficient of determination (R²) are calculated. 2 The model's performance is evaluated using classification metrics such as accuracy, precision, recall, and F1 score.

[0232] Specifically, in step S5, a comparison curve and scatter plot of the model prediction value and the actual value are drawn in the visualization display subsystem 6 to intuitively show the difference and trend consistency between the model prediction result and the actual data.

[0233] Specifically, for the Visual User System 6, a WeChat Mini Program is built to display real-time, average, abnormal, and predicted data from the database. An AI Agent is constructed using the Doubao 1.5pro model and workflow to receive users' vital sign data in real time and allow users to search for historical and abnormal data for specified dates. The AI ​​Agent provides users with health-related advice based on their real-time, historical, and predicted vital sign data. When abnormal data is detected, the WeChat Mini Program sends an alarm to the user via its subscription function. Upon learning that the predicted heart rate (HR) exceeds the normal threshold, the Mini Program sends an alarm, and the user can interact with the AI ​​Agent. The AI ​​Agent provides health advice based on the user's vital sign data, thus completing the prediction and anomaly detection of the user's vital signs.

[0234] The foregoing description details specific embodiments of the present invention, but the scope of protection of the present invention is not limited to these specific embodiments. Within the technical scope disclosed in the present invention, any equivalent modifications or substitutions made by those skilled in the art to the described features and principles should be included within the scope of protection of the present invention.

Claims

1. A vital sign prediction and anomaly detection system based on a non-contact sensor, comprising a non-contact sensor and a vital sign prediction and anomaly detection system, characterized in that, The vital signs prediction and anomaly detection system includes the following subsystems: a non-contact sensor receiving subsystem (1), a data storage subsystem (2), a data preprocessing subsystem (3), a multi-dimensional feature extraction engineering subsystem (4), a prediction and anomaly detection model subsystem (5), and a visualization user system (6), wherein, The non-contact sensor receiving subsystem (1) includes a data message receiving module and a data parsing and sending module, which are used to receive user vital sign data messages sent by the non-contact sensor, verify and extract data messages, and send data to the data storage subsystem (2). The data storage subsystem (2) stores various types of data based on the unique user ID and transaction processing. The data preprocessing subsystem (3) performs data reading and merging, outlier processing and noise addition on the data stored in the data storage subsystem (2). The multi-dimensional feature extraction engineering subsystem (4) performs time-domain feature extraction, frequency-domain feature extraction, time feature generation, and cross and statistical feature generation on the data processed by the data preprocessing subsystem (3) to generate a multi-dimensional feature dataset. The prediction and anomaly detection model subsystem (5) uses machine learning algorithms to train the feature value sequence of the multi-dimensional feature extraction engineering subsystem (4), constructs a time series dataset, performs model optimization and performance evaluation, and obtains the predicted user data. The aforementioned visualization user system (6) builds a visualization platform to display data and provide health advice.

2. The vital signs prediction and anomaly detection system based on non-contact sensors according to claim 1, characterized in that, The non-contact sensor receiving subsystem (1) receives user data messages sent by the non-contact sensor, verifies them, extracts vital sign data from the messages, and sends the data to the computer's data storage table.

3. The vital sign prediction and anomaly detection system based on non-contact sensors according to claim 1, characterized in that, The data storage subsystem (2) calculates average data and abnormal data periodically according to transaction processing, and stores them in the average data table and abnormal data table respectively, while real-time data is stored in the real-time data table.

4. The vital signs prediction and anomaly detection system based on a non-contact sensor according to claim 1, characterized in that, In the data preprocessing subsystem (3), the combined heart rate and respiratory vital signs data are read and merged. The user's vital signs data are downloaded from the data storage subsystem (2). Irrelevant columns are removed, and only the heart rate (HR), respiratory rate (RESP), and timestamp information are retained. Abnormal values ​​are processed, abnormal data recorded by the sensor due to the user's temporary departure are cleared, and noise is added.

5. The vital sign prediction and anomaly detection system based on a non-contact sensor according to claim 1, characterized in that, In the multi-dimensional feature extraction engineering subsystem (4), time-domain features of vital signs data are extracted. The statistical features of the mean and standard deviation of vital signs data are calculated through different sliding windows. First-order difference features are extracted to capture the rate of change of the signal, and second-order difference features are extracted to capture the acceleration of the rate of change of the signal. In the frequency-domain feature extraction of vital signs data, the power spectral density is calculated based on the Welch algorithm, and the frequency-domain features of the main frequency of vital signs data are extracted. In the time feature generation of vital signs data, sine and cosine functions are introduced to simulate the physiological rhythm of the human body, and sine and cosine values ​​are calculated for the timestamp according to different periods. In the cross and statistical feature generation of vital signs data, the cross features of the ratio, product, and difference of HR and RESP are calculated, and the statistical features of cumulative sum and Z score are generated.

6. The vital sign prediction and anomaly detection system based on a non-contact sensor according to claim 1, characterized in that, Based on the data processed in the multi-dimensional feature extraction engineering subsystem (4), a time series dataset is constructed in the prediction and anomaly detection model subsystem (5). The data enters the sliding window sampling module, and the extracted features and vital signs data such as heartbeat, respiration, user ID, and timestamp are used as the dataset. The data is sorted according to the time order, the window length is determined, the data is traversed, and samples are generated by sliding the window. The optimal time series dependency length is determined by comparing different seq_lengths. The dataset is divided into training and test sets by optimizing the random forest model. The features are standardized by Z-score. During the training process, the hyperparameters are optimized by grid search. The random forest generates multiple training sets by sampling and constructs multiple decision trees. The final result is obtained by averaging the prediction values ​​of each tree. The performance is quantified by multiple indicators, including regression indicators and classification indicators. The regression problem is converted into a binary classification problem by error threshold. Time series comparison charts and scatter plots are drawn. The optimal parameters and model are selected based on a comprehensive selection of various indicators.

7. The vital signs prediction and anomaly detection system based on non-contact sensors according to claim 1, characterized in that, The visualization platform is a WeChat mini program, which is used to display information on real-time data, average data, abnormal data, and predicted data in the database of the data storage subsystem (2). The AI ​​Agent is built using the Doubao 1.5 Pro model and workflow. It receives the user's vital sign data in real time and supports the user to search for historical data and abnormal data for a specified date. The AI ​​Agent provides health advice based on the user's vital sign data. When abnormal data occurs, the WeChat mini program sends alarm information to the user through the subscription function.

8. A method for predicting vital signs and detecting anomalies based on non-contact sensors, characterized in that, The method is implemented using the system according to any one of claims 1 to 7, and includes the following steps: Step S1: Read data in batches from the non-contact sensor receiving subsystem (1), retain HR, RESP and timestamp information, and add noise; Step S2: Extract the time domain features, frequency domain features, temporal features, cross-sectional features, and statistical features of the data; Step S3: Define different sequence lengths, convert the feature matrix into a three-dimensional tensor, construct a time series dataset, and provide structured data input for subsequent model training; Step S4: Divide the dataset into training and test sets according to the proportion, perform standardization, train the regression model, calculate regression and classification indicators to evaluate the model performance, and draw curves and scatter plots comparing the predicted and true values ​​for comparison. Step S5: In the visualization subsystem (6), draw the comparison curve and scatter plot between the model prediction value and the actual value to intuitively show the difference and trend consistency between the model prediction result and the actual data.

Citation Information

Patent Citations

  • Non-contact real-time vital sign monitoring system and method based on millimeter wave radar

    CN112401863A

  • Intelligent acquisition and analysis system and method for physical sign data of emergency patients

    CN117438024A

  • Intelligent medical management system based on neural network

    CN118013382A

  • Non-contact vital sign data monitoring method and system

    CN119073946A

  • Intelligent health data sensing platform based on Internet of Things and Internet

    CN119418919A

Cited By

  • Method and system for monitoring vital signs in whole process of defecation and pedestal pan

    CN121400789A