A pain state prediction and early warning method and system

By using single-instruction parallel aggregation and a temporal state-space evolution model, multimodal temporal data is transformed into a unified state vector sequence to predict future pain states. This solves the problems of response lag and high resource consumption in existing technologies, achieves low-latency pain warning, and improves the quality of medical monitoring.

CN122158191APending Publication Date: 2026-06-05ZHEJIANG CANCER HOSPITAL

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG CANCER HOSPITAL
Filing Date
2026-02-02
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing pain assessment methods are slow to respond and consume a lot of computational resources, making it impossible to provide early warnings. They are also difficult to deploy in a low-power, real-time manner, especially on resource-constrained edge devices.

Method used

A single-instruction parallel aggregation operation is used to transform multimodal time-series data into a unified state vector sequence, and a time-series state-space evolution model is used to predict the probability of future pain states and trigger an early warning.

Benefits of technology

It achieves low-latency, low-computational-complexity pain state prediction, securing a valuable time window for clinical intervention and improving the quality of medical monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122158191A_ABST
    Figure CN122158191A_ABST
Patent Text Reader

Abstract

The application discloses a pain state prediction and early warning method and system, and belongs to the technical field of medical monitoring and artificial intelligence. The method comprises the following steps: synchronously collecting multi-modal time series data of a patient, and performing time window alignment on the multi-modal time series data; based on a single instruction parallelization aggregation operation, the multi-modal time series data after the time window alignment is converted into a unified state vector sequence; the unified state vector sequence is input into a preset time series state space evolution model to obtain a future state probability distribution representing a future state evolution trend of the patient; and based on the future state probability distribution, the probability of the patient entering a severe pain state within a preset time window in the future is determined, and an early warning is triggered when the probability exceeds a preset probability threshold. Through the construction of a low-delay and high-efficiency data processing and prediction link, the technical problems of lagging response and large consumption of computing resources in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a medical monitoring method and system based on artificial intelligence, and more particularly to a method and system for predicting and warning of pain states based on multimodal time-series data fusion and state evolution prediction. Background Technology

[0002] Pain, as a complex subjective experience, is a key indicator for assessing patient condition and guiding treatment plans in clinical practice. Objective and timely pain assessment is especially crucial for infants and young children, patients with cognitive or developmental disabilities, and those unable to communicate verbally. Traditional pain assessment methods primarily rely on observation by healthcare professionals or retrospective judgment based on patient behavior (such as crying, limb movements, and facial expressions). These methods are not only highly subjective and inconsistent, but more importantly, they exhibit significant lag, often responding only after the patient has already experienced considerable pain, thus missing the optimal window for early intervention.

[0003] In recent years, with the development of sensor technology and artificial intelligence, some technical solutions have attempted to utilize multimodal data (such as visual, auditory, and physiological signals) to build automated pain recognition models. However, existing technical solutions generally suffer from a core technical problem: their design paradigm remains "recognition" rather than "prediction." These methods typically follow a lengthy and computationally intensive data processing chain, first performing complex feature extraction on data from various modalities, such as extracting optical flow and facial motion units from videos, calculating Mel-frequency cepstral coefficients from audio, and calculating heart rate variability from electrocardiogram signals, and then inputting these highly abstract features into a classifier for fusion and discrimination. This process presents two major technical friction points: first, the multi-stage serial processing introduces significant computational latency, resulting in slow system response; second, complex feature engineering consumes a large amount of computational resources, making it difficult to deploy in a low-power, real-time manner on resource-constrained edge devices such as bedside monitors. Therefore, how to overcome the bottlenecks of slow response and high resource consumption in existing technologies and achieve a paradigm shift from "passive recognition" to "active prediction" is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0004] The purpose of this application is to provide a method and system for predicting and warning of pain states, aiming to solve the technical problems of delayed pain assessment response, high computational resource consumption, and inability to achieve early warning in the prior art.

[0005] To achieve the above objectives, the first aspect of this application provides a method for predicting and warning of pain states. The method includes: simultaneously collecting multimodal time-series data of a patient and aligning the multimodal time-series data with time windows; converting the time-window-aligned multimodal time-series data into a unified state vector sequence based on a single-instruction parallel aggregation operation; inputting the unified state vector sequence into a preset temporal state space evolution model to obtain a future state probability distribution characterizing the future state evolution trend of the patient; and determining, based on the future state probability distribution, the probability that the patient will enter a severe pain state within a preset time window in the future, and triggering an early warning when the probability exceeds a preset probability threshold.

[0006] Optionally, according to any of the foregoing embodiments, the multimodal time-series data includes at least two types of data selected from the group consisting of visual time-series data, audio time-series data, and physiological time-series data.

[0007] Optionally, according to any of the foregoing embodiments, the step of converting the time-window aligned multimodal time-series data into a unified state vector sequence based on a single-instruction parallelized aggregation operation includes: applying a corresponding trainable projection matrix to linearly project the data of each modality in the time-window aligned multimodal time-series data to obtain multiple modal projection vectors; aggregating the multiple modal projection vectors and applying a nonlinear activation function to generate a unified state vector in the unified state vector sequence.

[0008] Optionally, according to any of the foregoing embodiments, the aggregation includes weighted summation of the plurality of modal projection vectors and superimposing a bias vector.

[0009] Optionally, according to any of the foregoing embodiments, the temporal state space evolution model is a recurrent neural network model.

[0010] Optionally, according to any of the foregoing embodiments, the recurrent neural network model is a gated recurrent unit network model or a long short-term memory network model.

[0011] Optionally, according to any of the foregoing embodiments, determining the probability that the patient will enter a state of severe pain within a preset time window based on the future state probability distribution, and triggering an early warning when the probability exceeds a preset probability threshold, includes: extracting a sequence of probability values ​​corresponding to the severe pain state within the preset time window from the future state probability distribution; determining whether there exists a continuous time period in the probability value sequence whose duration exceeds a preset duration threshold, and where all probability values ​​within that continuous time period are higher than the preset probability threshold; and triggering the early warning if the determination result is yes.

[0012] A second aspect of this application provides a pain state prediction and early warning system, the system comprising: a data synchronization acquisition module for synchronously acquiring multimodal time-series data of a patient and aligning the multimodal time-series data with time windows; a unified state vector generation module for converting the time-window aligned multimodal time-series data into a unified state vector sequence based on a single-instruction parallel aggregation operation; a time-series state space evolution module for inputting the unified state vector sequence into a preset time-series state space evolution model to obtain a future state probability distribution characterizing the future state evolution trend of the patient; and a prediction and early warning module for determining, based on the future state probability distribution, the probability that the patient will enter a severe pain state within a preset time window in the future, and triggering an early warning when the probability exceeds a preset probability threshold.

[0013] Optionally, according to any of the foregoing embodiments, the unified state vector generation module is specifically used to: apply a corresponding trainable projection matrix to linearly project the data of each modality in the multimodal time series data after the time window alignment to obtain multiple modal projection vectors; aggregate the multiple modal projection vectors and apply a nonlinear activation function to generate a unified state vector in the unified state vector sequence.

[0014] Optionally, according to any of the foregoing embodiments, the temporal state space evolution module includes a recurrent neural network model for modeling the temporal dependencies in the unified state vector sequence.

[0015] The technical solution of this application employs a single-instruction parallel aggregation operation to efficiently compress and project the original multimodal data stream into a unified state space, significantly reducing data processing latency and computational complexity. Furthermore, by learning the dynamic evolution patterns of this state space through a temporal state space evolution model, accurate prediction of future pain probabilities is achieved. This shift from "identification" to "prediction" provides a valuable time window for clinical intervention, thereby improving the quality of medical monitoring and alleviating patient suffering. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1This is a schematic diagram of the functional modules of a pain state prediction and early warning system provided in one embodiment of this application.

[0018] Figure 2 This is a flowchart illustrating a pain state prediction and early warning method provided in one embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0021] This application provides a method and system for predicting and warning of pain states. The core of this application lies in constructing an end-to-end low-latency prediction model that maps raw multimodal sensory data to a probability distribution of future states. In a specific implementation, this method employs a single-instruction parallel aggregation data fusion mechanism to directly map synchronously acquired visual, auditory, and physiological signal data streams, at the raw or near-raw data level, into a low-dimensional state vector that characterizes the patient's current comprehensive physiological and behavioral state. This method solves the technical problem in existing technologies where fusing data from different sources requires multiple independent, complex, and high-latency feature extraction modules, resulting in system response delays and high resource consumption.

[0022] After obtaining a unified vector representing the current state, the system further utilizes a temporal state-space evolution model (e.g., a recurrent neural network) to learn the time series composed of these vectors, capturing the inherent laws and dynamic patterns of the patient's state evolution over time. This model not only outputs a judgment on the current state, but more importantly, it can extrapolate to the future based on the learned evolutionary laws, generating a probability distribution of the patient's state over a future period (e.g., from "no pain" to "mild pain," and eventually migrating to "severe pain"). Finally, by analyzing this future probability distribution, the system triggers an early warning when the predicted probability of entering a severe pain state continuously exceeds a safety threshold within a defined future time window.

[0023] The specific embodiments provided in this application will now be described in detail with reference to the accompanying drawings.

[0024] Please see Figure 1 This diagram illustrates the functional modules of a pain state prediction and early warning system provided in one embodiment of this application. The system 800 can be implemented as a standalone medical monitoring device or deployed as a software system on a general-purpose computing platform or edge computing device. In one embodiment, the system 800 includes: a data synchronization acquisition module 810, a unified state vector generation module 820, a temporal state space evolution module 830, and a prediction and early warning module 840.

[0025] The data synchronization acquisition module 810 is responsible for acquiring continuous multimodal time-series data reflecting the patient's condition from multiple heterogeneous sensor sources in a time-synchronized manner. The implementation of this module aims to provide a strictly consistent original data foundation for all subsequent processing steps.

[0026] In one specific implementation, the data synchronization acquisition module 810 can integrate a hardware-level clock synchronization unit. This unit can broadcast a unified clock signal or synchronization trigger pulse to all connected sensors (e.g., cameras and microphones deployed around the bedside, and physiological sensors in direct contact with the patient), ensuring that all sensors start data acquisition at exactly the same time. Alternatively, in a distributed deployment scenario where sensors are physically separated, a software-level time synchronization protocol, such as Network Time Protocol (NTP) or Precision Time Protocol (PTP), can be used. This allows each sensor node to precisely calibrate its local clock with a central time server, thereby appending a globally consistent, high-precision timestamp to the acquired data. The module also includes a multi-channel data buffer queue for temporarily storing data streams from different sensors and performing initial alignment and packaging in preparation for subsequent unified processing.

[0027] The unified state vector generation module 820 is used to perform the critical task of efficient, low-latency multimodal data fusion. This module receives raw or lightly preprocessed multimodal data fragments, aligned to a time window, output by the data synchronization acquisition module 810, and directly and atomically transforms these high-dimensional, heterogeneous data into a unified, low-dimensional, information-condensed state vector through a "Single Instruction Parallelized Aggregation" (SIPA) operation defined in this application. This module replaces multiple serial feature extraction steps with varying algorithms in traditional techniques with a single mathematical operation that can be highly parallelized by modern processors (especially GPUs or dedicated AI chips). This fundamentally eliminates the computational latency accumulated due to multi-level processing and significantly reduces the overall demand for computing resources. In practical implementation, this module can be implemented as a set of software function libraries that call underlying linear algebra libraries (such as BLAS, cuBLAS) to perform core matrix multiplication and activation function operations. In pursuit of ultimate performance and energy efficiency, its core computing logic can also be designed and embedded in dedicated hardware circuits, such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), thus forming a dedicated multimodal fusion coprocessor.

[0028] The temporal state space evolution module 830 receives a series of time-ordered unified state vectors generated by the unified state vector generation module 820 and performs deep modeling of the temporal dependencies and dynamic evolution patterns inherent in this sequence. Essentially, this module is a time series prediction engine that learns to infer future state distributions from past state sequences. In a preferred embodiment, the core of this module is a pre-trained recurrent neural network (RNN) model. Specifically, a gated recurrent unit (GRU) or a long short-term memory (LSTM) network can be used. These models, through their internal "gating" mechanism, can selectively remember and forget historical information, thereby effectively capturing long-term dependency patterns in the patient's state evolution process, such as the gradual progression from mild pain to severe pain. The implementation of this module typically involves loading a model file trained on a large amount of labeled clinical data. During runtime, it processes the input vector sequence in a streaming manner, updates its internal hidden states at each time step, and outputs a prediction of the future state.

[0029] The prediction and early warning module 840 is responsible for real-time analysis and decision-making regarding the future state probability distribution generated by the temporal state space evolution module 830. Its core task is to determine, based on preset clinical rules, whether there is a potential, impending pain risk and trigger corresponding early warnings. This module includes a probability parser to extract probability values ​​related to the "severe pain" state from the complex probability distribution output. It also includes a threshold comparator and a logic judgment unit to execute early warning rule judgments, such as determining whether the pain probability will remain above a set safety threshold for a sufficiently long period. Furthermore, the module includes an early warning signal generator that interfaces with an external notification system. Once the early warning conditions are met, it can trigger various forms of alarms, such as audible and visual alarms on bedside monitors, sending high-priority messages to the central monitoring system at the nurses' station via the hospital's internal network, or directly pushing an early warning notification containing specific patient information to the responsible nurse's mobile communication device. The implementation of this module is usually a piece of deterministic logic control code, whose parameters (such as probability thresholds and duration thresholds) can be configured by medical staff according to clinical needs.

[0030] Please see Figure 2 This illustrates a flowchart of a pain state prediction and early warning method provided in one embodiment of this application. The method 200 can be executed by the aforementioned system 800, and specifically includes the following steps: S100: Synchronously acquire multimodal time-series data of patients and perform time window alignment on the multimodal time-series data.

[0031] In this step, the system activates its perception layer, initiating a parallel and uninterrupted acquisition of data streams from multiple sensors deployed in the patient's environment. These data streams form the basis for a comprehensive assessment of the patient's condition. The multimodal temporal data, designed to capture subtle cues reflecting pain status from multiple dimensions, may, in a preferred embodiment, include, but is not limited to, three main types: visual temporal data, acoustic temporal data, and physiological temporal data. Visual temporal data can be acquired using one or more cameras with night vision capabilities and a resolution of at least one megapixel, consisting of a sequence of continuous video frames containing the patient (particularly the face and limbs). To reduce the burden of data processing, a region of interest (ROI) can be pre-defined, for example, acquiring only the video stream containing the patient's head, face, and upper body. Acoustic temporal data can be acquired using a high signal-to-noise ratio microphone array to record sounds from the patient's surroundings, particularly the patient's own vocal signals, such as the raw audio waveforms of breathing sounds, groans, or cries. Physiological timing data are acquired through a series of non-invasive sensors that come into contact with the patient's body and meet medical safety standards. For example, cardiac electrical activity signals are collected through three- or five-lead electrocardiogram (ECG) electrodes, minute changes in skin conductivity are measured through skin conductance (EDA) sensors attached to the fingertips or palms, and respiratory rate and amplitude are monitored through piezoelectric breathing bands strapped to the chest or abdomen.

[0032] After acquiring these raw data streams, it's crucial to ensure their strict temporal alignment. The system uses a unified time base to assign a high-precision timestamp (µs) to each acquired data point (e.g., a video frame, an audio sample, an ECG signal reading). Subsequently, the system defines a fixed, rolling analysis time window with a length... It is a key parameter, for example, it can be set to Milliseconds (ms). At each analysis time... The system then precisely extracts data within a specific time interval from each of the original data streams. All data points within this set form a collection of multimodal data segments. This collection... This represents what has just passed This provides a complete snapshot of the patient's state within a given timeframe. Optionally, to smooth the time series analysis, an overlapping window strategy can be employed. For example, setting the time window hop length to 100 milliseconds means that every 100 milliseconds, the system generates a new set of data segments that overlaps with the previous time window by 400 milliseconds. This time window alignment is a prerequisite for ensuring that subsequent fusion processing can be performed within a common temporal context, ensuring that information from different modalities can be meaningfully correlated. Before sending the data segments to the next module, some lightweight preprocessing operations can also be performed, such as grayscale conversion and size normalization of images, denoising filtering of audio signals, and baseline drift correction of physiological signals, to improve signal quality.

[0033] For example, assume the system is configured with an analysis time window length of... The time window step is 100 ms. The visual acquisition module uses a camera with a frame rate of 30 frames per second (fps), the audio acquisition module has an audio sampling rate of 16000 Hz, and the physiological acquisition module uses an electrocardiogram signal sampling rate of 500 Hz. At any given analysis time... The data synchronization acquisition module will perform the following operations to form an aligned set of data segments: First, it will extract data from the video stream... arrive All video frames recorded during this period, at a frame rate of 30 fps, will contain approximately [number missing] frames. Frame images. These images constitute visual data fragments. Secondly, it extracts the raw audio waveform data for the same time interval from the audio stream. Since the sampling rate is 16 kHz, this will result in a dataset containing... The audio sequence of each sampling point constitutes a sound data segment. Finally, it extracts data for the corresponding time period from the electrocardiogram signal stream, resulting in a dataset containing... A sequence of electrocardiogram (ECG) signal readings constitutes a physiological data segment. These three data fragments, , , and Although the number and format of the internal data points vary, they all describe events within the exact same time window, thus exhibiting strict time alignment. This aligned set of data segments will be input as a whole into subsequent processing modules. After 100 milliseconds, i.e., at time... The system will repeat this process to generate a new set of data fragments that overlap 80% with the aforementioned data fragments.

[0034] S200: Based on a single instruction parallelized aggregation operation, the multimodal time series data after the time window alignment is transformed into a unified state vector sequence.

[0035] In this step, the system performs a core operation: efficiently fusing and compressing each aligned multimodal data fragment generated in S100. The goal of this step is to map the diverse and high-dimensional raw data to a unified, low-dimensional mathematical representation—a unified state vector—that can be directly processed by subsequent time-series models. This process abandons the complex, multi-stage feature engineering of traditional methods, replacing it with a highly parallelizable aggregation operation designed as a single computational instruction. The essence of this operation is a combination of linear projection and nonlinear transformation performed in a high-dimensional space.

[0036] Specifically, for each input multimodal data segment, the system first performs a simple preprocessing step, "flattening," transforming it from its original format (such as a two-dimensional matrix for an image or a one-dimensional sequence for audio) into a single long vector. Then, the system applies a set of pre-learned, trainable projection matrices specific to each modality to linearly project these high-dimensional flattened vectors. Geometrically, this projection process can be understood as projecting data points from different modalities from their respective original spaces into a shared, semantically consistent, and significantly reduced-dimensional latent space. In this latent space, information from different modalities is aligned and fused. After calculating the projection vectors for all modalities, the system aggregates them. One effective approach is to element-wise sum these projection vectors and superimpose a trainable bias vector, thus integrating information from multiple sources into a single vector. Alternatively, concatenation can be used to join all projection vectors into a longer vector, which is then reduced in dimensionality by an additional fully connected layer. Finally, to introduce necessary nonlinearity and normalize the range of the output vector (e.g., restricting it to -1 to 1), the system applies a nonlinear activation function to the aggregated vector, such as the hyperbolic tangent (tanh) or a variant of the rectified linear unit (ReLU). The output of this function is a condensed, unified state vector containing modal information from all modes within the current time window. As the time window rolls, this operation will be executed continuously, generating a unified state vector sequence ordered by time. Its core mathematical expression can be defined as: ,in These are the flattened vectors for each mode. It is the corresponding projection matrix. It is the bias vector.

[0037] For example, let's continue using the example from S100. At time... The system obtained a data segment consisting of 15 frames of images, 8000 audio sampling points, and 250 electrocardiogram signal readings. First, a flattening process was performed: assuming each frame was scaled to... If the image is a grayscale image of pixels, then 15 frames of images will be flattened into one. 3D visual vector 8000 audio sampling points are themselves an 8000-dimensional sound vector. 250 ECG signal readings constitute a 250-dimensional physiological vector. Assume that this system has a uniform state vector dimension. (Dimensionless). At this point, the system will load three pre-trained projection matrices: (dimension) ), (dimension) ),and (dimension) ), and a bias vector (dimension) The specific computation process of single-instruction parallelized aggregation operations is as follows: Linear projection: The result is a 128-dimensional vector. This operation compresses 15,360 dimensions of visual information into a 128-dimensional latent space.

[0038] The result is a 128-dimensional vector. This operation compresses 8000-dimensional sound information into a single latent space.

[0039] The result is a 128-dimensional vector. This operation compresses 250 dimensions of physiological information into the same latent space.

[0040] Aggregation and Bias: The result is still a 128-dimensional vector. This addition operation fuses information from three modalities in the latent space.

[0041] Nonlinear activation: The final output is a 128-dimensional unified state vector.

[0042] This vector, for example [0.21, -0.58, 0.73, ..., -0.19], represents the time intervals. The previous 500ms data was a mathematical and condensed description of all patient modal information. The entire calculation process mainly involves matrix-vector multiplication and vector addition, which are basic operations that can be highly optimized on modern hardware (such as GPUs and DSPs) through Single Instruction Multiple Data (SIMD) technology. Therefore, the execution latency of the entire S200 step is extremely low, reaching the millisecond or even sub-millisecond level, which is crucial for achieving real-time prediction.

[0043] S300: Input the unified state vector sequence into a preset temporal state space evolution model to obtain the future state probability distribution characterizing the future state evolution trend of the patient.

[0044] In this step, the system utilizes the time series data generated by S200. This allows for in-depth time pattern analysis and future trend prediction. At the core of this process is a complex algorithmic module called the temporal state-space evolution model. The model's task is not merely to understand each individual unified state vector. More importantly, it is about understanding the underlying logic and patterns of how these vectors evolve over time. In a preferred embodiment, the model is implemented as a recurrent neural network (RNN), particularly its advanced variants such as gated recurrent unit (GRU) networks or long short-term memory (LSTM) networks.

[0045] In one embodiment employing a GRU network, the network comprises one or more stacked GRU layers. At each time step... The current unified state vector This information is sent as input to the GRU unit. Inside the GRU unit, its unique "update gate" and "reset gate" gating mechanisms determine the extent to which memories from the previous time step (i.e., the hidden state) should be retained. ), and to what extent to accept the current input. The update gate determines how much of the previous state information is incorporated into the current state, while the reset gate controls the degree to which previous state information is ignored. This gating mechanism allows the model to learn long-term dependencies in the time series; for example, it can "remember" a patient's mild pain a few minutes ago and correlate this information with currently observed shortness of breath, thus inferring that the pain may be about to escalate. Through computation, the GRU unit outputs a new hidden state. ,this It contains both the encoding of all past information and the current state. This updated hidden state This can be viewed as a highly condensed understanding of the patient's state evolution history up to the current moment. Based on this understanding, the system then uses one or more fully connected layers (also known as feedforward networks) to process this hidden state. The mapping and decoding process transforms the data into an output with a clear physical meaning—a probability distribution of states over multiple future time steps. This output is no longer a single judgment, but a vector or matrix that describes in detail the future moments. The probability that a patient is in different predefined states such as "no pain", "mild pain", "moderate pain" and "severe pain".

[0046] For example, suppose the time series model is a network containing a GRU layer and an output fully connected layer. The number of hidden units in the GRU layer is set to 256. At time... S200 generates a 128-dimensional unified state vector. At this point, the temporal state-space evolution module performs the following operation: it first retrieves the hidden state vector from the previous time step from its internal storage. (The vector has a dimension of 256). Then, it will... and The data is simultaneously input into the GRU unit. The GRU unit then performs a series of matrix operations to calculate the update gate. and reset door The value of is used to calculate the new hidden state. This new hidden state The 256-dimensional data is then fed into the output fully connected layer. Suppose we want to predict the state 10 time steps ahead (1 second if the step size is 100ms), and four state categories are predefined (0: no pain, 1: mild pain, 2: moderate pain, 3: severe pain). Then, the task of the output fully connected layer is to process the 256-dimensional data... Transform into one A dimensional vector, and reshape it into a dimensional vector. matrix After applying the Softmax function to normalize each row of the matrix, each element in the matrix... Representing the future At this time step, the patient is in the first... The probability of each state. For example, the output matrix might be: [[0.80, 0.15, 0.04, 0.01], / / t+1: Predicted probability of painless treatment is 80% [0.60, 0.30, 0.08, 0.02], / / t+2: Predicts a decrease in the probability of painless pain and an increase in the probability of mild pain. ... [0.10, 0.20, 0.40, 0.30]] / / t+10: The predicted probability of severe pain has reached 30%. This probability distribution matrix This is the final output of this step, which provides rich, dynamic, and forward-looking information for subsequent early warning decisions and is the key to achieving "prediction" rather than "identification".

[0047] S400: Based on the probability distribution of the future state, determine the probability that the patient will enter a state of severe pain within a preset time window in the future, and trigger an early warning when the probability exceeds a preset probability threshold.

[0048] In this step, the system performs a final decision analysis on the complex future state probability distribution generated by S300 to determine whether an alert needs to be triggered. This step serves as a bridge between the predictive model and clinical practice; its core is the application of a clear, configurable set of rules to interpret the model's predictions. The system first analyzes the output future state probability distribution matrix... In the process, a probability value sequence corresponding to the "severe pain" state is specifically extracted to form a probability value sequence representing the future trend of severe pain risk evolution.

[0049] Simply observing the instantaneous probability value at a future point in time may not be sufficient to make a reliable judgment, as the model's output may fluctuate briefly. To increase the robustness of the decision, this application employs a judgment logic based on dual thresholds. This logic requires that the potential risk is not only sufficiently "high" (the probability value exceeds the probability threshold) but also sufficiently "persistent" (the duration exceeds the duration threshold). Specifically, the system sets two key parameters that can be adjusted by medical personnel: a preset probability threshold... (For example, set to 0.8, which is 80%, dimensionless), and a preset duration threshold. (For example, set to 2 seconds). Then, the system will slide across the extracted sequence of severe pain probability values ​​to check if there is a continuous time period whose duration exceeds [a certain value]. Furthermore, without exception, all probability values ​​within this time period were higher than [the expected value]. .

[0050] If the system finds a "high-risk period" that meets both conditions, it makes a positive judgment: the patient is about to enter a stable and significant pain state in the short term. At this point, the judgment result is "yes," and the prediction and early warning module is immediately activated, triggering the early warning mechanism. The form of the early warning can be varied, aiming to notify relevant medical staff in the most effective way. For example, it could be by displaying a highlighted alarm window on the screen of the central monitoring station, along with the patient's bed number and the predicted pain risk curve; or by pushing an emergency notification directly to the mobile phone of the nurse or doctor responsible for the patient via a dedicated mobile application. If the system does not find a sustained high-risk period that meets the above two conditions within the entire future prediction time window, the judgment result is "no," and the system will remain silent and continue monitoring and prediction at the next time step. Optionally, more complex early warning logic can be introduced. For example, it could not only judge the severe pain state but also the probability transition rate from "no pain" to "severe pain." When this rate exceeds a threshold, even if the instantaneous probability has not yet reached its highest level, a "trend warning" with a lower level of concern can be issued in advance.

[0051] For example, continuing with the S300 example, and assuming that S300 outputs the probability distribution for the next 50 time steps (corresponding to the next 5 seconds), where the probability value sequence corresponding to the "severe pain" state is {P1, P2, ..., P_{50}}. Assume a preset probability threshold. Preset duration threshold Seconds (corresponding to 20 time steps). The system begins to examine this probability sequence. It finds that from the 25th time step to the 48th time step, i.e. arrive All probability values ​​are greater than 0.80. For example, the sequence could be ..., 0.78, [0.81, 0.83, 0.85, ..., 0.91, 0.88], 0.79, .... The system then calculates the duration of this continuous high-probability segment. This time period includes a total of 25 to 48. There are 24 time steps. Since each time step is 100ms long, the total duration of 24 time steps is... Seconds. Now, the system performs a dual conditional check: First, whether all probability values ​​(all greater than 0.80) within this time period are higher than the probability threshold. (0.80)? Yes. Second, does the duration of this time period (2.4 seconds) exceed the duration threshold? (2 seconds)? Yes. Since both conditions are met, the system immediately determines that this is a valid warning event. The prediction and warning module then triggers an alarm, sending a message to the nurses' station: "Patient in bed 302, ward B, is expected to enter a state of severe pain in 2.5 seconds (predicted probability of lasting 2.4 seconds or higher than 80%), please pay attention." In this way, medical staff gain valuable reaction time, allowing them to check on the patient and take appropriate comforting or treatment measures before the pain behavior fully manifests.

[0052] To enable those skilled in the art to implement this application, the training process of the model involved in this embodiment is now described. The trainable projection matrix in the unified state vector generation module disclosed in this application ( ) and bias vector ( Both the system and the recurrent neural network model in the temporal state-space evolution module are trained through a unified, end-to-end supervised learning process. The goal of the training is to enable the entire system to accurately predict the state label sequence for a future period of time given a historical multimodal data set.

[0053] The construction of the training dataset is fundamental to this approach. An exemplary dataset can be collected from a clinical study that recruited hundreds of patients of different ages and conditions. During collection, the system continuously records multimodal temporal data (visual, auditory, and physiological signals) from the patients. Simultaneously, 2-3 professionally trained clinical experts continuously and synchronously label the patients' states according to a recognized pain assessment scale. The labeling results are a series of time-stamped state labels. These raw data and labels are sliced ​​and aligned to form a large number of training samples. Each training sample contains a segment of length [length missing]. Historical multimodal data, and the subsequent length of The future state label sequence. The states 'no pain', 'mild pain', 'moderate pain', and 'severe pain' are a pre-defined, discrete set of states. Their definitions and distinction criteria are determined during the training data labeling phase based on a recognized clinical pain assessment scale (e.g., the FLACC scale or the CPOT scale).

[0054] To ensure the generalization ability and prediction accuracy of the model, the training dataset should meet one or more of the following technical characteristics: 1) In terms of sample size, it should cover no fewer than 100 independent patients, with a cumulative effective monitoring time of no less than 1000 hours; 2) In terms of data diversity, it should evenly cover patients of different age groups (e.g., infants, adults, and the elderly) and different disease types (e.g., postoperative pain, neuropathic pain); 3) In terms of label quality, the pain assessment scale used for labeling should be uniform, and the labeling process should be cross-validated by at least two independent clinical experts; 4) In terms of data balance, for samples of severe pain states with low natural occurrence frequency, resampling techniques or assigning higher weights to their categories in the loss function (e.g., setting weight values ​​to 5.0 to 10.0) can be used during training to ensure that the model has sufficient learning ability for such key events.

[0055] The training process employs a specific loss function to quantify the gap between the model's predictions and the true labels. Since the frequency of different pain states may be uneven, a weighted classification cross-entropy loss function can be used. For each time step within the future prediction window, the loss function calculates the cross-entropy between the probability distribution of the model's output and the true state label at that moment, assigning different weights to the losses of different categories to force the model to focus more on predicting key events. The total loss over the entire prediction window is the weighted average of the losses at all time steps.

[0056] Model parameter updates are performed using an optimizer based on the backpropagation algorithm. A preferred optimizer is Adam (Adaptive Moment Estimation), which combines the advantages of momentum and RMSProp, adaptively adjusting the learning rate of each parameter during training. Training is performed in mini-batch mode. In each iteration, a small batch of training samples is randomly drawn from the training set and fed into the model for forward propagation, calculating the prediction results and total loss. Then, backpropagation is performed using the gradient of the loss function to calculate the gradients of all trainable parameters (including all projection matrices, bias vectors, and weights within the GRU network). Finally, the Adam optimizer updates the parameters based on these gradients. The entire training process is repeated multiple times (epochs) until the model's performance (e.g., prediction accuracy, recall) on independent validation sets saturates and no longer improves significantly.

[0057] For example, the length of the input data can be set. Each time step (corresponding to 5 seconds of historical data), prediction length Each time step (corresponding to 1 second of future data). In the loss function, the weight for the "severe pain" category is set to 5.0, while the weight for the "no pain" category is set to 0.5. The initial learning rate of the Adam optimizer can be set to... The batch size is 64. On a dataset containing tens of thousands of samples, it typically takes 50-100 training iterations to obtain a robust prediction model.

[0058] Those skilled in the art should understand that the above embodiments are merely exemplary, and various changes, modifications, and substitutions can be made without departing from the principles and spirit of this application. For example, the aggregation method of the SIPA module can be not only addition, but also concatenation or other learnable combination functions. The time series model can be not only GRU, but also LSTM or other more advanced Transformer architectures. The warning logic can also be designed to be more complex and adaptive according to clinical needs. All these changes should fall within the protection scope of this application.

[0059] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware.

[0060] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for predicting and warning of pain states, characterized in that, include: Simultaneously collect multimodal time-series data of patients and align the multimodal time-series data with time windows; Based on a single instruction parallel aggregation operation, the multimodal time series data after the time window is aligned is transformed into a unified state vector sequence. The unified state vector sequence is input into a preset temporal state space evolution model to obtain a future state probability distribution that characterizes the future state evolution trend of the patient. as well as Based on the probability distribution of the future state, the probability that the patient will enter a state of severe pain within a preset time window in the future is determined, and an early warning is triggered when the probability exceeds a preset probability threshold.

2. The method according to claim 1, characterized in that, The multimodal temporal data includes at least two types of data selected from the group consisting of visual temporal data, audio temporal data, and physiological temporal data.

3. The method according to claim 1, characterized in that, The method of converting the time-window-aligned multimodal time-series data into a unified state vector sequence based on a single-instruction parallel aggregation operation includes: For each modality of the multimodal time series data after the time window alignment, a corresponding trainable projection matrix is ​​applied for linear projection to obtain multiple modal projection vectors. The multiple modal projection vectors are aggregated, and a nonlinear activation function is applied to generate a unified state vector in the unified state vector sequence.

4. The method according to claim 3, characterized in that, The aggregation includes weighted summation of the multiple modal projection vectors and superimposing a bias vector.

5. The method according to claim 1, characterized in that, The temporal state space evolution model is a recurrent neural network model.

6. The method according to claim 5, characterized in that, The recurrent neural network model is either a gated recurrent unit network model or a long short-term memory network model.

7. The method according to claim 1, characterized in that, The method of determining the probability that the patient will enter a state of severe pain within a preset time window based on the future state probability distribution, and triggering an early warning when the probability exceeds a preset probability threshold, includes: From the probability distribution of the future states, extract the sequence of probability values ​​corresponding to the severe pain state within a preset time window in the future; Determine whether, within the probability value sequence, there exists a continuous time period whose duration exceeds a preset duration threshold, and within this continuous time period, all probability values ​​are higher than the preset probability threshold; and If the judgment result is yes, then the warning will be triggered.

8. A pain state prediction and early warning system, characterized in that, include: A data synchronization acquisition module is used to synchronously acquire multimodal time-series data of patients and perform time window alignment on the multimodal time-series data; A unified state vector generation module is used to convert the multimodal time series data after time window alignment into a unified state vector sequence based on a single instruction parallel aggregation operation. A temporal state space evolution module is used to input the unified state vector sequence into a preset temporal state space evolution model to obtain a future state probability distribution that characterizes the future state evolution trend of the patient. as well as A prediction and early warning module is used to determine the probability that the patient will enter a state of severe pain within a preset time window in the future based on the probability distribution of the future state, and to trigger an early warning when the probability exceeds a preset probability threshold.

9. The system according to claim 8, characterized in that, The unified state vector generation module is specifically used for: For each modality of the multimodal time series data after the time window alignment, a corresponding trainable projection matrix is ​​applied for linear projection to obtain multiple modal projection vectors. The multiple modal projection vectors are aggregated, and a nonlinear activation function is applied to generate a unified state vector in the unified state vector sequence.

10. The system according to claim 8, characterized in that, The temporal state space evolution module includes a recurrent neural network model for modeling the temporal dependencies in the unified state vector sequence.