A method and system for analyzing abnormal physiological indicators of smart bracelets based on improved GDN algorithm
Through the improved GDN algorithm and graph neural network, combined with the medical knowledge graph database, the problem of multi-dimensional data fusion analysis and real-time monitoring analysis is solved, the real-time abnormal detection and alarm system of physiological indicators is realized, and the computing resource usage is reduced.
Patent Information
- Application Number
- CN202210464430.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has gaps in the fusion analysis and real-time monitoring analysis of multi-dimensional data, and consumes a large amount of computing resources, making it unable to bear the real-time monitoring and analysis of a large number of people.
Using the improved GDN algorithm, by constructing an improved GDN network model, combined with the graph neural network and medical knowledge graph database, we conduct end-to-end training, analyze the physiological index data of the smart bracelet in real time, establish the data relationship between sensors, and classify abnormal behaviors. , and call the medical knowledge graph database to specify response measures.
It realizes real-time abnormal reasoning and judgment of physiological indicator time series, can comprehensively analyze different types of physiological indicator data, establishes a complete abnormality detection system, generates alarm information from mobile terminals, and reduces computing resource usage.
Smart Images

Figure CN114743678B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for analyzing abnormality of physiological indicators of a smart bracelet based on an improved GDN algorithm, and belongs to the technical field of long time series abnormality detection. Background Art
[0002] With the advancement of science and technology and the development of society, there is an increasing demand for real-time monitoring of the physiological status of specific people in specific places, such as nursing homes, mental hospitals, etc. At present, the monitoring of such specific places is still mainly based on video camera monitoring, but with the expansion of the monitoring scope, it is inevitable that higher requirements are placed on the energy and number of monitoring personnel, and labor costs are also increased. At present, many researchers have proposed the use of smart devices to solve this problem, that is, using portable smart devices such as bracelets to perform real-time detection of the physiological status of specific people and timely alarm people in abnormal conditions. Therefore, the use of smart devices to analyze physiological indicators of specific people is currently an analysis technology that meets the monitoring needs of specific places.
[0003] Traditional long time series anomaly detection (TAD) algorithms are mainly based on recurrent neural network (RNN) algorithms and machine learning algorithms. The recurrent neural network algorithm is mainly represented by the long short-term memory network (LSTM), which has the problem of gradient explosion and has very high hardware requirements for training; the machine learning-based algorithms include clustering and time series forest, but the same recurrent neural network still cannot be combined with multi-dimensional data for time series anomaly detection.
[0004] Compared with traditional time series anomaly detection algorithms, time series anomaly detection algorithms based on graph neural networks can well combine multi-dimensional time series, establish topological relationships between different types of data, and realize comprehensive analysis of abnormal situations with multi-dimensional data while ensuring accuracy, while consuming less computing resources.
[0005] In summary, the main problem with existing technologies is that there is still a large gap in the fusion analysis of multidimensional data, that is, only a single time series can be analyzed. The secondary problem is that the computing resources occupied are still relatively large and cannot bear the real-time monitoring and analysis of a large number of people. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a method and system for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm.
[0007] Terminology explanation:
[0008] 1. PAM dataset: PAM (PAMAP2 physical activity monitoring) measures the daily living activities of 9 subjects using 3 inertial measurement units. The present invention has modified it to adapt to the scenario of irregular time series classification. The ninth subject was excluded due to the short length of sensor readings. The continuous signal was segmented into samples with a time window of 600 and an overlap rate of 50%. PAM originally had 18 daily living activities. Samples associated with less than 500 samples were excluded, and the remaining 8 activities. After modification, the PAM dataset contains 5333 sensory signal segments (samples). Each sample is measured by 17 sensors, contains 600 continuous observations, and the sampling frequency is 100Hz. Only the sensor data such as body temperature and heart rate are taken here.
[0009] 2. Self-made data set: Human physiological data recorded by smart bracelets. Here, 5 subjects were found to collect their heart rate, pulse, body temperature and other physiological indicators in daily activities. The physiological indicator information of each subject during the day and night was recorded, and then the invalid data was processed. The sampling frequency was 1Hz.
[0010] 3. Geometric: A deep learning library built on PyTorch for processing irregular structured input data (such as graphs, point clouds, manifolds). In addition to general graph data structures and processing methods, it also contains a variety of newly released methods in fields ranging from relational learning to 3D data processing. PyTorch Geometric achieves high data throughput by leveraging sparse GPU acceleration, providing dedicated CUDA kernels, and introducing efficient mini-batch processing for input samples of different sizes.
[0011] 4. Graph database: A tool used to process graph data structures. Unlike traditional relational databases that use two-dimensional tables to store data, graph databases are traditionally classified as a type of NoSQL (Not Only SQL) database, which means that graph databases are non-relational databases. General graph databases include at least three functions: graph storage, graph query, and graph analysis.
[0012] 5. Medical knowledge graph database: Each disease, symptom, treatment measure, etc. is taken as the node of the graph, and the relationship between the nodes is taken as the edge. For example, there is such an edge relationship between the symptom of high temperature and the symptom of fever.
[0013] 6. Topk algorithm: This function is used to find the top k largest or top k smallest values of a dim in the tensor and the corresponding index.
[0014] The technical solution of the present invention is:
[0015] A method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm includes the following steps:
[0016] Step 1: Obtain the data set, i.e., physiological indicator data, and perform preprocessing;
[0017] Step 2: Build an improved GDN network model;
[0018] Step 3: Use the data set obtained after preprocessing in step 1 to perform end-to-end training on the improved GDN network model constructed in step 2;
[0019] Step 4: After the real-time data, i.e., the physiological index data of the smart bracelet, is preprocessed as described in step 1, it is transmitted to the improved GDN network model trained in step 3, and the trained weight file is used to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result;
[0020] Step 5: Based on the abnormal classification results, call the medical knowledge graph database to specify corresponding response measures for relevant personnel.
[0021] Preferably according to the present invention, the data set includes a PAM data set and a self-made data set.
[0022] Preferably, according to the present invention, preprocessing the data set or real-time data includes:
[0023] First, the multidimensional physiological index data is normalized using MinMaxScaler, and the multidimensional physiological index data is obtained through sensors; the physiological index data is changed into the input form of the improved GDN network model, that is, the physiological index data of the same type are arranged according to the timestamp, and the obtained series of data, namely the physiological index data time series, is changed into the tensor A[T,L], where T is the timestamp and L is the length of the physiological index data time series;
[0024] Then, the tensor A[T,L] is processed by sliding window to generate a tensor of size [T-W+1,L,W], where W is the sliding window length. At the same time, a directed graph [2,L*(L-1)] is established between all sensor nodes and other sensors. The directed graph [2,L*(L-1)] does not contain itself and has only L*(L-1) edges.
[0025] Finally, the tensor [T-W+1,L,W] and the established directed graph [2,L*(L-1)] are encapsulated using the Dataloader class of pytorch to generate a tensor [B,L,W] and a directed graph [B,2,L*(L-1)] of the set batch size, where B represents the batch size, L represents the sensor node, and W represents the node feature, which becomes the input data for the improved GDN network model.
[0026] Preferably, according to the present invention, the improved GDN network model includes a sensor embedding layer, a graph structure learning layer, a graph attention prediction layer, an output adjustment layer, an anomaly classification layer, and a graph deviation scoring layer which are connected in sequence.
[0027] The sensor embedding layer is used to: take the preprocessed sensor data as input and represent the similarity of different sensor data; embedding, that is, after the weights are randomly initialized, the parameter size is set to [L, N], where N is the number of channels, and the sensor node [1, L] is input and then [L, N] is learned, thereby realizing the vector embedding of the sensor;
[0028] The graph structure learning layer is used to: learn the relationship between different sensors, where the relationship is represented by a directed graph, where an edge from one sensor to another indicates that the first sensor is used to simulate the behavior of the second sensor; the adjacency matrix A is used to represent this directed graph; the embedding vector [L, N] obtained in the sensor embedding layer is normalized, resized to ensure the format of the embedded sensor data, and v[L*B, N] and w[L, N] are obtained, and then the cosine distance is calculated to obtain the similarity relationship between different sensors;
[0029] The graph attention prediction layer is used to: use a prediction-based approach, that is, predict the expected behavior of each sensor based on its past behavior;
[0030] The graph deviation scoring layer predicts the expected behavior of each sensor at each time based on the past;
[0031] The anomaly classification layer is used to: compare the expected behavior at time t with the observed behavior based on the anomaly score of the graph deviation scoring layer, calculate the error value Err of sensor i at time t, and simply classify the abnormal sensor anomalies to make them conform to the characteristics of the input into the medical knowledge graph database.
[0032] Preferably, according to the present invention, the cosine distance is calculated to obtain the similarity relationship between different sensors, as shown in formula (I) and formula (II):
[0033]
[0034] A ji =1{j∈TopK({e ki :k∈v})} (II)
[0035] In formula (I) and formula (II), e ji is the similarity between the current sensor node and other sensor nodes; i is the current sensor node; j is other sensor nodes; v i is the embedding vector of the current sensor node; vj is the embedding vector of other sensor nodes; A ji is the adjacency matrix of the sensor; K is the first K nodes with the highest similarity, and the value of K is selected by the user according to the required sparsity; e ki is the similarity between a node and other nodes;
[0036] After completing the calculation of similarity e ji After that, we get an adjacency matrix A[L-1,L-1] of the similarity relationship of all sensors as a whole. We use the Topk method to sort the similarities of different sensors and select the sensors with greater influence as edge information output. Finally, we get the adjacency matrix A with a size of [K,K]. Then, we arrange the sensor numbers from large to small according to the size of the influencing data value to get [2,K]. According to the batch size, we repeatedly enlarge and extend the adjacency matrix, that is, enlarge it to [2,B*K].
[0037] Preferably, in the graph attention prediction layer, at time t, according to a sliding window of size w, that is, a historical time series of length w before time t is defined to improve the input of the GDN network model, the graph attention prediction layer includes a feature extractor based on graph attention, which fuses the information of a node with its adjacent nodes based on the learned graph structure, i.e., the adjacency matrix A of different sensor relationships;
[0038] The feature extractor contains sensor embedding vectors, which describe the different behaviors of different types of sensors. It also introduces a multi-head attention mechanism for graph neural networks. It uses the properties of the graph structure, that is, changing the position of the nodes while keeping the connection relationship unchanged. The positions of different sensors are randomly sorted when solving the multi-head attention, and then the adjacency weight matrix is calculated multiple times. Finally, the weight matrices learned multiple times are arranged into Topk, and their weighted average is taken as the actual prediction value.
[0039] Through this feature extractor, the output layer in the graph attention prediction layer obtains the representation of all N nodes, multiplies the representation of all N nodes by the corresponding time series embedding element by element, and uses the stacked results calculated by all nodes as the input of the output adjustment layer with an output dimension of N, thereby predicting the value of the time vector sensor at time t.
[0040] Preferably, according to the present invention, in the output adjustment layer, the output [B*K,1,N] of the graph attention prediction layer is received, input into the output adjustment layer, adjusted to [B,K,N], first enters a BatchNorm layer and a relu layer for activation, and obtains [B,K,N], then enters a dropout layer with a parameter set to 0.3 to prevent overfitting, and obtains [B,K,N]; then enters an out_layer layer to obtain [B,K,1], and finally obtains the prediction matrix [B,K].
[0041] Preferably, according to the present invention, in the graph deviation scoring layer, according to the input [L+1,L,N] of the graph attention prediction layer, a dot multiplication operation is performed with the learned attention weight [L+1,L,N] to obtain an output [L+1,L,N], and the result is adjusted using the linear layer Linear to obtain [L+1,L,N].
[0042] Preferably, according to the present invention, in the abnormal classification layer, the abnormal classification layer includes a Linear layer, a BatchNorm layer, and a ReLU layer;
[0043] After the anomaly classification layer, the final output result is [L+1,L]. Based on the output result of [L+1,L], each sensor calculates its individual anomaly score, and uses the max function to aggregate the anomaly scores of each sensor to obtain the aggregated result. A threshold is set, and if the aggregated result exceeds the threshold, it is marked as an anomaly.
[0044] Preferably, according to the present invention, in the abnormality classification layer, the abnormality of a specific sensor is judged, and the calculation formula is shown in formula (III) and formula (IV):
[0045]
[0046]
[0047] In formula (III) and formula (IV), Err i (t) is the error of the i-th sensor, is the predicted value of the sensor data at time t obtained by using the improved GDN algorithm, is the true value of the sensor data at time t, a i (t) is the normalized error score, is the median in the w time interval, is the interquartile range in the time interval w.
[0048] Preferably, according to the present invention, the data set obtained after preprocessing in step 1 is used to perform end-to-end training on the improved GDN network model constructed in step 2 using an unsupervised learning method. The specific training process is as follows:
[0049] The input is the physiological indicator data of the sensor without abnormality and the type of sensor, and the input data set is divided into a training set and a validation set;
[0050] During training, the sensor physiological index data and sensor types are pre-processed and input into the improved GDN network. After sensor embedding, graph relationship learning layer, and graph attention prediction layer, the predicted value and actual value of the sliding window are calculated by the loss function MSE to obtain the loss value, and then back-propagation is performed to optimize the embedding weight size and attention parameters, and then the weight file is updated;
[0051] Input sensor time series data without abnormality and sensor type relationship;
[0052] During training, the predicted value of the sliding window is compared with the actual value, the loss value is calculated using the mean square error of the loss function, and backpropagation is performed to update the weight parameters in the improved GDN network model, thereby updating the relationship adjacency matrix.
[0053] Preferably, according to the present invention, first, real-time human body data is acquired through a physiological indicator data measurement sensor, then, the human body data is stored in a physiological indicator database in real time, and at the same time, the human body data is read from the physiological indicator database in real time, and finally, the human body data read in real time is processed and predicted in real time through step 4 to obtain an abnormal classification result.
[0054] Preferably, according to the present invention, in step 5, based on the abnormal classification result obtained in step 4, if there is no abnormality, continue to predict, otherwise, enter the physiological indicator database to query relevant information according to the type of abnormal classification result, and send an alarm message to provide specific abnormal information and relevant personnel location information.
[0055] A smart bracelet physiological index abnormality analysis system based on an improved GDN algorithm, comprising:
[0056] The data set acquisition and preprocessing module is configured to acquire the data set, i.e., the physiological indicator data, and perform preprocessing;
[0057] The improved GDN network model building module is configured to build an improved GDN network model;
[0058] The training module is configured to perform end-to-end training on the constructed improved GDN network model using the preprocessed data set;
[0059] The prediction module is configured to transmit the real-time data, i.e., the physiological index data of the smart bracelet, to the trained improved GDN network model after the preprocessing, and use the trained weight file to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result;
[0060] The countermeasure acquisition module is configured to call the medical knowledge graph database to specify corresponding countermeasures for relevant personnel based on the abnormal classification results.
[0061] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm are implemented.
[0062] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm.
[0063] The beneficial effects of the present invention are:
[0064] 1. The present invention can perform real-time reasoning and judgment on the abnormality of physiological index time series.
[0065] 2. The present invention can establish connections between different types of physiological indicator data based on graph neural networks and make comprehensive judgments.
[0066] 3. The present invention establishes a complete physiological index abnormality detection system, which can start from a mobile terminal (smart bracelet), and then undergo algorithm processing to finally generate alarm information. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 The overall flow chart of the method for analyzing abnormal physiological indicators of a smart bracelet based on the improved GDN algorithm of the present invention is as follows;
[0068] Figure 2 A schematic diagram of the network structure of the improved GDN network model of the present invention;
[0069] Figure 3 This is a schematic diagram of the data preprocessing process;
[0070] Figure 4 It is a schematic diagram of the network structure of the graph structure relationship layer;
[0071] Figure 5 This is a schematic diagram of the network structure of the graph attention prediction layer;
[0072] Figure 6 Schematic diagram of the network structure of the output adjustment layer;
[0073] Figure 7 is the connection graph of related nodes;
[0074] Figure 8 Schematic diagram of training loss for improving the GDN network model;
[0075] Fig. 9 This is a schematic diagram of the predicted data;
[0076] Fig.10 This is a schematic diagram of actual data;
[0077] Fig.11 This is a specific application diagram of the abnormal analysis method of physiological indicators of smart bracelets based on the improved GDN algorithm. DETAILED DESCRIPTION
[0078] The present invention will be further defined below in conjunction with the accompanying drawings and embodiments, but is not limited thereto.
[0079] Example 1
[0080] A method for analyzing abnormal physiological indicators of smart bracelets based on the improved GDN algorithm, such as Figure 1 As shown, the steps include:
[0081] Step 1: Obtain the data set, i.e., physiological indicator data, and preprocess it; the data set includes the PAM data set and the self-made data set.
[0082] Step 2: Build an improved GDN network model;
[0083] Step 3: Use the data set obtained after preprocessing in step 1 to perform end-to-end training on the improved GDN network model constructed in step 2;
[0084] Step 4: After the real-time data, i.e., the physiological index data of the smart bracelet, is preprocessed as described in step 1, it is transmitted to the improved GDN network model trained in step 3, and the trained weight file is used to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result;
[0085] Step 5: Based on the abnormal classification results, call the medical knowledge graph database to specify corresponding response measures for relevant personnel.
[0086] Example 2
[0087] The difference between the method for analyzing abnormal physiological indicators of a smart bracelet based on the improved GDN algorithm described in Example 1 is that:
[0088] Preprocess the data set or real-time data, such as Figure 3As shown, including:
[0089] First, the multi-dimensional physiological indicator data is normalized using MinMaxScaler. The multi-dimensional physiological indicator data includes heart rate, pulse, body temperature, respiratory rate, etc. These data are obtained using relevant sensors, such as temperature sensors, heart rate sensors, etc. The multi-dimensional physiological indicator data is obtained through sensors; the physiological indicator data is changed into the input form of the improved GDN network model, that is, the same type of physiological indicator data is arranged according to the timestamp, and the obtained series of data, namely the physiological indicator data time series, is changed into a tensor A[T,L], where T is the timestamp and L is the length (type) of the physiological indicator data time series;
[0090] Then, the tensor A[T,L] is processed by sliding window to generate a tensor of size [T-W+1,L,W], where W is the sliding window length; at the same time, a directed graph [2,L*(L-1)] is established between all sensor nodes and other sensors. The directed graph [2,L*(L-1)] does not contain itself and has only L*(L-1) edges. Figure 7 As shown, one dimension is the sensor node itself, and the other dimension is other sensors. There are L types of sensors in total, so there are L-1 dimensions of other sensors, and therefore there are L*(L-1) connections established in total.
[0091] Finally, the tensor [T-W+1,L,W] and the established directed graph [2,L*(L-1)] are encapsulated using the Dataloader class of pytorch to generate a tensor [B,L,W] and a directed graph [B,2,L*(L-1)] of the set batch size, where B represents the batch size, L represents the sensor node, and W represents the node feature, which becomes the input data for the improved GDN network model.
[0092] like Figure 2 As shown in the figure, the improved GDN (Graph Neural Network-Based Anomaly Detection) network model includes a sensor embedding layer (Sensor Embedding), a graph structure learning layer (Graph Structure Learning), a graph attention prediction layer (Graph Attention-Based Forecasting), an output adjustment layer, an abnormal classification layer (Abnormal Classification), and a graph deviation scoring layer (Graph Deviation Scoring) which are connected in sequence.
[0093] The sensor embedding layer is used to: take the preprocessed sensor data as input and represent the similarity of different sensor data; embedding, i.e., vector embedding, is initialized randomly with weights, and the parameter size is set to [L, N], where N is the number of channels. After inputting the sensor node [1, L], [L, N] is learned, thereby realizing the vector embedding of the sensor; the similarity between the embeddings is used to represent the similarity of the behaviors of several sensors. The latter is mainly used for structural learning to determine which sensors are related to each other and in the attention mechanism, which allows different types of sensors to produce different effects.
[0094] The graph structure learning layer is used to learn the relationship between different sensors, which is represented by a directed graph, where the edge from one sensor to another indicates that the first sensor is used to simulate the behavior of the second sensor; a directed graph is used here because the dependency pattern between sensors does not need to be symmetric. The adjacency matrix A is used to represent this directed graph; the embedded vector [L, N] obtained in the sensor embedding layer is normalized and resized to ensure the format of the embedded sensor data, and v[L*B, N] and w[L, N] are obtained, and then the cosine distance is calculated to obtain the similarity relationship between different sensors;
[0095] The graph attention prediction layer is used to: use a prediction-based approach, that is, predict the expected behavior of each sensor based on its past behavior;
[0096] The graph deviation scoring layer predicts the expected behavior of each sensor at each time based on past predictions; this allows users to easily identify sensors that deviate significantly from their expected behavior. Additionally, the expected and observed behavior of each sensor can be compared to understand why the model considers a sensor to be anomalous.
[0097] The anomaly classification layer is used to: compare the expected behavior at time t with the observed behavior (actual behavior) based on the anomaly score of the graph deviation scoring layer, calculate the error value Err of sensor i at time t, and simply classify the abnormal sensor anomalies to make them conform to the characteristics of the input into the medical knowledge graph database.
[0098] like Figure 4 As shown in the figure, in the graph structure learning layer, the input is node information [B, L, W], and the edge connection relationship has been transformed into an embedding vector [L, N] after the previous sensor embedding layer. The first dimension is repeatedly operated to expand [B*L, N], and the cosine distance is calculated to obtain the similarity relationship between different sensors, as shown in formula (I) and formula (II) (product operation and norm calculation are required):
[0099]
[0100] A ji =1{j∈TopK({e ki :k∈v})} (II)
[0101] In formula (I) and formula (II), e ji is the similarity between the current sensor node and other sensor nodes; i is the current sensor node; j is other sensor nodes; v i is the embedding vector of the current sensor node; v j is the embedding vector of other sensor nodes; A ji is the adjacency matrix of the sensor; K is the first K nodes with the highest similarity, and the value of K is selected by the user according to the required sparsity; e ki is the similarity between a node and other nodes;
[0102] After completing the calculation of similarity e ji After that, we get an adjacency matrix A[L-1,L-1] of the similarity relationship of all sensors as a whole. We use the Topk method to sort the similarities of different sensors and select the sensors with greater influence as edge information output. Finally, we get the adjacency matrix A with a size of [K,K]. Then, we arrange the sensor numbers from large to small according to the size of the influencing data value to get [2,K]. According to the batch size, we repeatedly enlarge and extend the adjacency matrix, that is, enlarge it to [2,B*K].
[0103] like Figure 5 As shown, in the graph attention prediction layer, at time t, according to the sliding window of size w, that is, the historical time series of length w before time t is defined as the input of the improved GDN network model, feature extraction In order to capture the relationship between sensors, the graph attention prediction layer includes a feature extractor based on graph attention, which fuses the information of the node with its adjacent nodes based on the learned graph structure, that is, the adjacency matrix A of the relationship between different sensors;
[0104] Different from the existing graph attention mechanism, this feature extractor contains sensor embedding vectors, which describe the different behaviors of different types of sensors. At the same time, it also introduces a multi-head attention mechanism for graph neural networks. The traditional multi-head attention mechanism concatenates or averages the weight matrices learned multiple times. In the improved GDN model, we use the properties of the graph structure, that is, changing the position of the nodes while keeping the connection relationship unchanged. When solving the multi-head attention, the positions of different sensors are randomly sorted (but the position order is recorded), and then the adjacent weight matrix is calculated multiple times. Finally, the weight matrices learned multiple times are arranged Topk, and the weighted average is taken as the actual prediction value. This avoids the change in the influence of other sensors on the target sensor due to reasons such as the specific arrangement order of the sensors, and finally achieves more stable and accurate predictions.
[0105] Through this feature extractor, the output layer in the graph attention prediction layer obtains the representation of all N nodes, multiplies the representation of all N nodes with the corresponding time series embedding element by element (representation), and uses the stacked results calculated for all nodes as the input of the output adjustment layer with an output dimension of N, thereby predicting the value of the time t vector sensor.
[0106] In the graph attention prediction layer, first, the graph relationship connection data established by different sensor nodes is processed. According to the input graph relationship [2, B*K], self-loops are removed first to avoid the impact when establishing a simple graph structure. Then, self-loops are added to complete it (each node completes an edge from itself to itself), and [2, B*K] is obtained again. The data information [B,] enters the Geometric message propagation module (Message-Passing) for interaction and prediction of different node information. At the same time, a multi-head attention mechanism is also added, that is, the weight matrix learned multiple times is arranged Topk, and the weighted average is taken as the actual prediction value, so as to avoid reducing other possible impacts on the current sensor due to specific reasons. In which x_i[B*K*L,H,N] is set as the starting node of the directed graph, x_j[B*K*L,H,N] is set as the influencing node of the directed graph, H is the number of multi-head attention, and then the embedded node information is set to embedding_i[B*K*L,H,N], embedding_j[B*K*L,H,N], and the same node information is combined.
[0107] Add the initialized attention parameters att_i[1,H,N] and att_j[1,H,N] to the obtained combined matrix for multiplication and summation to obtain the flattened weight parameter [B*K*L,1,1]. Then input it into the leaky_relu layer, set the coefficient to 0.2, activate it, and obtain [B*K*L]. Then input it into the softmax layer for normalization to obtain [B*K*L]. Then, the dropout layer coefficient is set to 0.2 for certain discarding to obtain the final relationship weight matrix A[B*K*L,H,1], multiply it with the node information x_j[B*K*L,H,N] to obtain [B*K*L,H,N]. After aggregate in the message passing module, it becomes [B*K,H,N]. Finally, add a BatchNorm layer for normalization to obtain [B*K,H,N]. Finally, take the average value of the second H to obtain [B*K,N].
[0108] like Figure 6 As shown, in the output adjustment layer, the output [B*K,1,N] of the receiving graph attention prediction layer is input into the output adjustment layer and adjusted to [B,K,N]. It first enters a BatchNorm layer and a relu layer for activation to obtain [B,K,N], and then enters a dropout layer with a parameter set to 0.3 to prevent overfitting, and obtains [B,K,N]; then it enters an out_layer layer, which is essentially a linear layer with multiple parameters, and the number can be adjusted to obtain [B,K,1], and finally obtains the prediction matrix [B,K].
[0109] In the graph bias scoring layer, according to the input [L+1,L,N] of the graph attention prediction layer, a dot multiplication operation is performed with the learned attention weight [L+1,L,N] to obtain the output [L+1,L,N], and the linear layer is used to adjust the result to [L+1,L,N].
[0110] In the abnormal classification layer, the abnormal classification layer includes Linear layer, BatchNorm layer, and ReLU layer;
[0111] After the anomaly classification layer, the output result of [L+1,L] is finally obtained. According to the output result of [L+1,L], each sensor calculates an individual anomaly score and merges them into a single anomaly score for each time point, allowing the location of which sensors are abnormal, that is, determining the abnormal physiological indicators. Then, the overall anomaly of all sensors at time point t is calculated, and the max function is used to aggregate the anomaly score of each sensor to obtain the aggregated result, and a threshold is set. If the aggregated result exceeds the threshold, it is marked as an anomaly.
[0112] Once the sensor is identified as abnormal, the abnormal physiological index is determined. The type of abnormality, such as abnormal body temperature, is encoded and passed to the physiological index database for querying related information. The error is set as the overall error based on the abnormal classification layer. The max function is used here to aggregate the sensors. In order to suppress the sudden change of values, it is often not perfectly predicted and leads to a spike in the error value. That is, this behavior is normal. A simple moving average (SMA) is used to generate a smooth score.
[0113] In the abnormal classification layer, the abnormality of a specific sensor is judged, and the calculation formula is shown in formula (III) and formula (IV):
[0114]
[0115]
[0116] In formula (III) and formula (IV), Err i (t) is the error of the i-th sensor, is the predicted value of the sensor data at time t obtained by using the improved GDN algorithm, is the true value of the sensor data at time t, a i (t) is the normalized error score, is the median in the w time interval, is the interquartile range in the time interval w.
[0117] The dataset obtained after preprocessing in step 1 is used to perform end-to-end training on the improved GDN network model constructed in step 2 using an unsupervised learning method. The specific training process is as follows:
[0118] The input is the physiological indicator data of the sensor without abnormality and the type of sensor, and the input data set is divided into a training set and a validation set according to a certain ratio;
[0119] During training, the sensor physiological index data and sensor types are pre-processed and input into the improved GDN network. After sensor embedding, graph relationship learning layer, and graph attention prediction layer, the predicted value and actual value of the sliding window are calculated by the loss function MSE to obtain the loss value, and then back-propagation is performed to optimize the embedding weight size and attention parameters, and then the weight file is updated;
[0120] Input sensor time series data without abnormality and sensor type relationship;
[0121] During training, the predicted value of the sliding window is compared with the actual value, and the loss value is calculated using the mean square error (MSE) loss function. Backpropagation is performed to update the weight parameters in the improved GDN network model, thereby updating the relationship adjacency matrix.
[0122] First, real-time human body data is acquired through physiological indicator data measurement sensors such as temperature and heart rate sensors. Then, the human body data is stored in a physiological indicator database in real time, and the human body data is read from the physiological indicator database in real time. Finally, the real-time read human body data is processed and predicted in real time through step 4 to obtain abnormal classification results.
[0123] In step 5, according to the abnormal classification results obtained in step 4, such as abnormal temperature index sensor and pulse index sensor, if there is no abnormality, continue to predict, otherwise, enter the physiological index database to query relevant information according to the type of abnormal classification results, and send alarm information, provide specific abnormal information and relevant personnel location information. If the body temperature is too high, breathing is slow and related treatment measures are taken, the personnel location is sent and real-time video data is provided.
[0124] In this embodiment, the data acquired by the bracelet include daily physiological data such as body temperature, heart rate, respiratory rate, pulse, and positioning, and the UWB system is used to communicate real-time data with the background.
[0125] The relevant results are shown in Table 1:
[0126] Table 1
[0127]
[0128] The training configuration used is as follows:
[0129] Hardware environment:
[0130] CPU: Intel(R) Core(TM) i5-10400F
[0131] GPU: NVIDA GeForce RTX 3060 (12G)
[0132] Memory: 16G
[0133] The software environment is as follows:
[0134] OS: windows
[0135] Python: Anaconda3 python3.8
[0136] CUDA: 11.1
[0137] Torch: 1.8.0
[0138] Figure 8 Schematic diagram of training loss for improving the GDN network model; the horizontal axis is the training cycle, and the vertical axis is the training loss during training; Fig. 9 It is a prediction data diagram; the horizontal axis is time, and the vertical axis is the prediction data of the physiological indicators of the relevant sensors; Fig.10 is an actual data graph; the horizontal axis is time, and the vertical axis is actual sensor physiological index data. The present invention can perform real-time reasoning and judgment on the abnormality of the physiological index time series. Fig.11 This is a specific application diagram of the abnormal analysis method of physiological indicators of smart bracelets based on the improved GDN algorithm.
[0139] Example 3
[0140] A smart bracelet physiological index abnormality analysis system based on an improved GDN algorithm, comprising:
[0141] The data set acquisition and preprocessing module is configured to acquire the data set, i.e., the physiological indicator data, and perform preprocessing;
[0142] The improved GDN network model building module is configured to build an improved GDN network model;
[0143] The training module is configured to perform end-to-end training on the constructed improved GDN network model using the preprocessed data set;
[0144] The prediction module is configured to transmit the real-time data, i.e., the physiological index data of the smart bracelet, to the trained improved GDN network model after the preprocessing, and use the trained weight file to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result;
[0145] The countermeasure acquisition module is configured to call the medical knowledge graph database to specify corresponding countermeasures for relevant personnel based on the abnormal classification results.
[0146] Example 4
[0147] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm in embodiment 1 or 2 are implemented.
[0148] Example 5
[0149] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm in embodiment 1 or 2.
Claims
1. A method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm, characterized in that: The steps include: Step 1: Obtain the data set, i.e., physiological indicator data, and perform preprocessing; Step 2: Build an improved GDN network model; Step 3: Use the data set obtained after preprocessing in step 1 to perform end-to-end training on the improved GDN network model constructed in step 2; Step 4: After the real-time data, i.e., the physiological index data of the smart bracelet, is preprocessed as described in step 1, it is transmitted to the improved GDN network model trained in step 3, and the trained weight file is used to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result; Step 5: Based on the abnormal classification results, call the medical knowledge graph database to specify corresponding response measures for relevant personnel; The improved GDN network model includes a sensor embedding layer, a graph structure learning layer, a graph attention prediction layer, an output adjustment layer, an anomaly classification layer, and a graph deviation scoring layer connected in sequence; The sensor embedding layer is used to: take the preprocessed sensor data as input and represent the similarity of different sensor data; Embedding, that is, vector embedding, is randomly initialized with weights, and the parameter size is set to [L, N], where N is the number of channels. After the sensor node [1, L] is input, [L, N] is learned, thereby realizing the vector embedding of the sensor; The graph structure learning layer is used to: learn the relationship between different sensors, where the relationship is represented by a directed graph, where an edge from one sensor to another indicates that the first sensor is used to simulate the behavior of the second sensor; the adjacency matrix A is used to represent this directed graph; the embedding vector [L, N] obtained in the sensor embedding layer is normalized, resized to ensure the format of the embedded sensor data, and v[L*B, N] and w[L, N] are obtained, and then the cosine distance is calculated to obtain the similarity relationship between different sensors; The graph attention prediction layer is used to: use a prediction-based approach, that is, predict the expected behavior of each sensor based on its past behavior; The graph deviation scoring layer predicts the expected behavior of each sensor at each time based on the past; The anomaly classification layer is used to: compare the expected behavior at time t with the observed behavior based on the anomaly score of the graph deviation scoring layer, calculate the error value Err of sensor i at time t, and simply classify the abnormal sensor anomalies to make them conform to the characteristics of the input into the medical knowledge graph database; The cosine distance is calculated to obtain the similarity relationship between different sensors, as shown in formula (I) and formula (II): A ji =1{j∈TopK({e ki :k∈v})} (II) In formula (I) and formula (II), e ji is the similarity between the current sensor node and other sensor nodes; i is the current sensor node; j is other sensor nodes; v i is the embedding vector of the current sensor node; v j is the embedding vector of other sensor nodes; A ji is the adjacency matrix of the sensor; K is the first K nodes with the highest similarity, and the value of K is selected by the user according to the required sparsity; e ki is the similarity between a node and other nodes; After completing the calculation of similarity e ji After that, we get an adjacency matrix A[L-1, L-1] of the similarity relationship of all sensors. We use the Topk method to sort the similarities of different sensors, select the sensors with greater influence, and output them as edge information. Finally, we get the adjacency matrix A with a size of [K, K]. Then, we arrange the sensor numbers from large to small according to the size of the influencing data value to get [2, K]. According to the batch size, we repeatedly enlarge and extend the adjacency matrix, that is, to [2, B*K]. In the output adjustment layer, the output [B*K, 1, N] of the graph attention prediction layer is received, input into the output adjustment layer, and adjusted to [B, K, N]. It first enters a BatchNorm layer and a relu layer for activation to obtain [B, K, N]. Then it enters a dropout layer with a parameter set to 0.3 to prevent overfitting and obtains [B, K, N]. Then it enters an out_layer layer to obtain [B, K, 1], and finally obtains the prediction matrix [B, K]. In the graph bias scoring layer, the input [L+l, L, N] of the graph attention prediction layer is multiplied by the learned attention weight [L+1, L, N] to obtain the output [L+1, L, N], and the linear layer is used to adjust the result to [L+1, L, N]; In the abnormal classification layer, the abnormal classification layer includes Linear layer, BatchNorm layer, and ReLU layer; After the anomaly classification layer, the output result of [L+1, L] is finally obtained. According to the output result of [L+1, L], each sensor calculates its own anomaly score, and uses the max function to aggregate the anomaly scores of each sensor to obtain the aggregated result, and sets a threshold. If the aggregated result exceeds the threshold, it is marked as an anomaly. In the abnormal classification layer, the abnormality of a specific sensor is judged, and the calculation formula is shown in formula (III) and formula (IV): In formula (III) and formula (IV), Err i (t) is the error of the i-th sensor, is the predicted value of the sensor data at time t obtained by using the improved GDN algorithm, is the true value of the sensor data at time t, a i (t) is the normalized error score, is the median in the w time interval, is the interquartile range in the time interval w.
2. According to claim 1, a method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm is characterized in that: Preprocess the data set or real-time data, including: First, the multidimensional physiological index data is normalized using MinMaxScaler, and the multidimensional physiological index data is obtained through sensors; the physiological index data is changed into the input form of the improved GDN network model, that is, the same type of physiological index data is arranged according to the timestamp, and the obtained series of data, namely the physiological index data time series, is changed into a tensor A[T, L], where T is the timestamp and L is the length of the physiological index data time series; Then, the tensor A[T,L] is processed by sliding window to generate a tensor of size [T-W+1,L,W], where W is the sliding window length. At the same time, a directed graph [2,L*(L-1)] is established between all sensor nodes and other sensors. The directed graph [2,L*(L-1)] does not contain itself and has only L*(L-1) edges. Finally, the tensor [T-W+1,L,W] and the established directed graph [2,L*(L-1)] are encapsulated using the Dataloader class of pytorch to generate a tensor [B,L,W] and a directed graph [B,2,L*(L-1)] of the set batch size, where B represents the batch size, L represents the sensor node, and W represents the node feature, which becomes the input data for the improved GDN network model.
3. According to claim 1, a method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm is characterized in that: In the graph attention prediction layer, at time t, the input of the improved GDN network model is defined according to the sliding window of size w, that is, the historical time series of length w before time t. The graph attention prediction layer includes a feature extractor based on graph attention, which fuses the information of a node with its adjacent nodes based on the learned graph structure, that is, the adjacency matrix A of the relationship between different sensors; The feature extractor contains sensor embedding vectors, which describe the different behaviors of different types of sensors. It also introduces a multi-head attention mechanism for graph neural networks. It uses the properties of the graph structure, that is, changing the position of the nodes while keeping the connection relationship unchanged. The positions of different sensors are randomly sorted when solving the multi-head attention, and then the adjacency weight matrix is calculated multiple times. Finally, the weight matrices learned multiple times are arranged into Topk, and their weighted average is taken as the actual prediction value. Through this feature extractor, the output layer in the graph attention prediction layer obtains the representation of all N nodes, multiplies the representation of all N nodes by the corresponding time series embedding element by element, and uses the stacked results calculated by all nodes as the input of the output adjustment layer with an output dimension of N, thereby predicting the value of the time vector sensor at time t.
4. According to claim 1, a method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm is characterized in that: The dataset obtained after preprocessing in step 1 is used to perform end-to-end training on the improved GDN network model constructed in step 2 using an unsupervised learning method. The specific training process is as follows: The input is the physiological indicator data of the sensor without abnormality and the type of sensor, and the input data set is divided into a training set and a validation set; During training, the sensor physiological index data and sensor types are pre-processed and input into the improved GDN network. After sensor embedding, graph relationship learning layer, and graph attention prediction layer, the predicted value and actual value of the sliding window are calculated by the loss function MSE to obtain the loss value, and then back-propagation is performed to optimize the embedding weight size and attention parameters, and then the weight file is updated; Input sensor time series data without abnormality and sensor type relationship; During training, the predicted value of the sliding window is compared with the actual value, and the loss value is calculated using the mean square error of the loss function. Back propagation is performed to update and improve the weight parameters in the GDN network model, thereby updating the relationship adjacency matrix. First, real-time human body data is acquired through a physiological indicator data measurement sensor, and then the human body data is stored in a physiological indicator database in real time, and the human body data is read from the physiological indicator database in real time. Finally, the human body data read in real time is processed and predicted in real time through step 4 to obtain an abnormal classification result.
5. A method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm according to any one of claims 1 to 4, characterized in that: In step 5, according to the abnormal classification result obtained in step 4, if there is no abnormality, continue to predict, otherwise, enter the physiological indicator database to query relevant information according to the type of abnormal classification result, and send an alarm message to provide specific abnormal information and relevant personnel location information.
6. A smart bracelet physiological index abnormality analysis system based on improved GDN algorithm, characterized in that: include: The data set acquisition and preprocessing module is configured to acquire the data set, i.e., the physiological indicator data, and perform preprocessing; The improved GDN network model building module is configured to build an improved GDN network model; The training module is configured to perform end-to-end training on the constructed improved GDN network model using the preprocessed data set; The prediction module is configured to transmit the real-time data, i.e., the physiological index data of the smart bracelet, to the trained improved GDN network model after the preprocessing, and use the trained weight file to perform real-time analysis on the time series of the sensor data, build the data relationship between each sensor, and classify the abnormal behavior information to obtain the abnormal classification result; The countermeasure acquisition module is configured to call the medical knowledge graph database to specify corresponding countermeasures for relevant personnel according to the abnormal classification results; The improved GDN network model includes a sensor embedding layer, a graph structure learning layer, a graph attention prediction layer, an output adjustment layer, an anomaly classification layer, and a graph deviation scoring layer connected in sequence; The sensor embedding layer is used to: take the preprocessed sensor data as input and represent the similarity of different sensor data; Embedding, that is, vector embedding, is randomly initialized with weights, and the parameter size is set to [L, N], where N is the number of channels. After the sensor node [1, L] is input, [L, N] is learned, thereby realizing the vector embedding of the sensor; The graph structure learning layer is used to: learn the relationship between different sensors, where the relationship is represented by a directed graph, where an edge from one sensor to another indicates that the first sensor is used to simulate the behavior of the second sensor; the adjacency matrix A is used to represent this directed graph; the embedding vector [L, N] obtained in the sensor embedding layer is normalized, resized to ensure the format of the embedded sensor data, and v[L*B, N] and w[L, N] are obtained, and then the cosine distance is calculated to obtain the similarity relationship between different sensors; The graph attention prediction layer is used to: use a prediction-based approach, that is, predict the expected behavior of each sensor based on its past behavior; The graph deviation scoring layer predicts the expected behavior of each sensor at each time based on the past; The anomaly classification layer is used to: compare the expected behavior at time t with the observed behavior based on the anomaly score of the graph deviation scoring layer, calculate the error value Err of sensor i at time t, and simply classify the abnormal sensor anomalies to make them conform to the characteristics of the input into the medical knowledge graph database; The cosine distance is calculated to obtain the similarity relationship between different sensors, as shown in formula (I) and formula (II): In formula (I) and formula (II), e ji is the similarity between the current sensor node and other sensor nodes; i is the current sensor node; j is other sensor nodes; v i is the embedding vector of the current sensor node; v j is the embedding vector of other sensor nodes; A ji is the adjacency matrix of the sensor; K is the first K nodes with the highest similarity, and the value of K is selected by the user according to the required sparsity; e ki is the similarity between a node and other nodes; After completing the calculation of similarity e ji After that, we get an adjacency matrix A[L-1, L-1] of the similarity relationship of all sensors. We use the Topk method to sort the similarities of different sensors, select the sensors with greater influence, and output them as edge information. Finally, we get the adjacency matrix A with a size of [K, K]. Then, we arrange the sensor numbers from large to small according to the size of the influencing data value to get [2, K]. According to the batch size, we repeatedly enlarge and extend the adjacency matrix, that is, to [2, B*K]. In the output adjustment layer, the output [B*K, l, N] of the graph attention prediction layer is received, input into the output adjustment layer, and adjusted to [B, K, N]. It first enters a BatchNorm layer and a relu layer for activation to obtain [B, K, N]. Then it enters a dropout layer with a parameter set to 0.3 to prevent overfitting and obtains [B, K, N]. Then it enters an out_layer layer to obtain [B, K, 1], and finally obtains the prediction matrix [B, K]. In the graph bias scoring layer, the input [L+1, L, N] of the graph attention prediction layer is multiplied by the learned attention weight [L+1, L, N] to obtain the output [L+1, L, N], and the linear layer is used to adjust the result to [L+1, L, N]; In the abnormal classification layer, the abnormal classification layer includes Linear layer, BatchNorm layer, and ReLU layer; After the anomaly classification layer, the output result of [L+1, L] is finally obtained. According to the output result of [L+1, L], each sensor calculates its own anomaly score, and uses the max function to aggregate the anomaly scores of each sensor to obtain the aggregated result, and sets a threshold. If the aggregated result exceeds the threshold, it is marked as an anomaly. In the abnormal classification layer, the abnormality of a specific sensor is judged, and the calculation formula is shown in formula (III) and formula (IV): In formula (III) and formula (IV), Err i (t) is the error of the i-th sensor, is the predicted value of the sensor data at time t obtained by using the improved GDN algorithm, is the true value of the sensor data at time t, a i (t) is the normalized error score, is the median in the w time interval, is the interquartile range in the time interval w.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method for analyzing abnormal physiological indicators of a smart bracelet based on the improved GDN algorithm described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for analyzing abnormal physiological indicators of a smart bracelet based on an improved GDN algorithm described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Abnormality detection method based on attribute graph representation learning
CN113961759A
Abnormity detection method based on heterogeneous information network element learning architecture
CN114239712A
