Disclosure of Invention
The invention provides an electrocardiosignal analysis method and system, and mainly aims to solve the problem of low accuracy in electrocardiosignal analysis.
In order to achieve the above object, the present invention provides an electrocardiosignal analysis method, comprising:
Acquiring original electrocardiosignals of a target user through an electrocardiograph unit arranged in preset medical equipment, and synchronously acquiring physiological index data of the target user through a physiological index monitoring unit arranged in the medical equipment;
performing adaptive filtering processing on the original electrocardiosignal based on the motion perception state of the electrocardiograph unit to obtain a target electrocardiosignal;
extracting electrocardiographic waveform characteristics of the target electrocardiographic signals by using a preset multiscale morphological algorithm, and carrying out data fusion on the electrocardiographic waveform characteristics and the physiological index data to obtain characteristic fusion vectors;
generating an electrocardiosignal analysis model according to the embedded memory resource of the medical equipment and a network structure of a preset lightweight neural network model;
Training the electrocardiosignal analysis model according to the medical health training data obtained in advance, and analyzing the feature fusion vector through the trained electrocardiosignal analysis model to obtain an electrocardiosignal graph of the target user.
Optionally, the step of synchronously collecting the physiological index data of the target user by the physiological index monitoring unit built in the medical device includes:
Generating a synchronous trigger signal based on the acquisition time sequence of the electrocardiograph unit;
The synchronous trigger signal is sent to the physiological index monitoring unit, and the physiological index monitoring unit is controlled to execute data acquisition actions;
receiving the time stamp aligned physiological index feedback data of the physiological index monitoring unit according to the executed data acquisition action, and verifying the time sequence consistency of the physiological index feedback data and the original electrocardiosignal;
and when the verified result is that the time sequences are consistent, taking the physiological index feedback data as the physiological index data, and caching the physiological index data in an embedded memory of the medical equipment.
Optionally, the adaptively filtering the original electrocardiograph signal based on the motion sensing state of the electrocardiograph unit to obtain a target electrocardiograph signal, including:
acquiring triaxial acceleration data output by an acceleration sensor arranged in the electrocardiograph unit;
Determining a motion intensity index and a motion state signal of the electrocardiograph unit according to the vector amplitude of the triaxial acceleration data;
judging whether the target user is in a motion interference state according to the motion state signal;
When a target user is in a motion interference state, acquiring a mapping relation between a preset motion intensity threshold range and a filter type, and matching the motion intensity index with the mapping relation;
Extracting filter parameters corresponding to the matched filter types, reconstructing the filter parameters into a preset adaptive filter, and performing motion artifact inhibition on the original electrocardiosignal by using the reconstructed adaptive filter to obtain a target electrocardiosignal.
Optionally, the extracting the electrocardiographic waveform feature of the target electrocardiographic signal by using a preset multi-scale morphological algorithm includes:
identifying flat structural elements with different scales and morphological gradient operators in a preset multi-scale morphological algorithm;
Carrying out morphological analysis on the target electrocardiosignal by utilizing the flat structural elements with different scales to obtain a multi-scale electrocardiosignal;
enhancing waveform boundary characteristics of the multi-scale electrocardiosignal according to the morphological gradient algorithm;
extracting waveform amplitude characteristics, waveform slope characteristics and waveform duration characteristics of the enhanced multi-scale electrocardiosignal;
and determining the waveform amplitude characteristic, the waveform slope characteristic and the waveform duration characteristic as electrocardiographic waveform characteristics of a target electrocardiograph signal.
Optionally, the performing data fusion on the electrocardiographic waveform feature and the physiological index data to obtain a feature fusion vector includes:
Extracting the trend characteristics of the physiological indexes in the physiological index data;
Respectively carrying out standardization processing on the electrocardiographic waveform characteristics and the physiological index trend characteristics;
Generating a first weight coefficient and a second weight coefficient of the standardized electrocardiographic waveform characteristic and the physiological index trend characteristic respectively based on preset clinical priori knowledge;
and carrying out feature level fusion on the normalized electrocardiographic waveform features and the physiological index trend features according to the first weight coefficient and the second weight coefficient to obtain feature fusion vectors.
Optionally, the generating the electrocardiosignal analysis model according to the embedded memory resource of the medical device and the network structure of the preset lightweight neural network model includes:
Determining available storage capacity and resource computation space based on the embedded memory resources of the medical device;
Determining model parameters of a preset lightweight neural network model according to the available storage capacity and the resource calculation space;
identifying the number of neural network layers and the number of convolution kernels in a network structure of a preset lightweight neural network model;
and adjusting the number of layers of the neural network and the number of convolution kernels in the network structure according to the model parameter number, and compiling the adjusted network structure into an electrocardiosignal analysis model which can be embedded into medical equipment.
Optionally, the adjusting the number of layers of the neural network and the number of convolution kernels in the network structure according to the model parameter number includes:
Searching different configuration parameter combinations of the number of layers of the neural network and the number of convolution kernels in the network structure based on the model parameter amount by using a preset network architecture searching algorithm;
Analyzing model accuracy and reasoning speed of the lightweight neural network model under different configuration parameter combinations;
selecting the configuration parameter combination with the maximum model precision and the maximum reasoning speed as a target configuration combination;
and adjusting the number of layers of the neural network and the number of convolution kernels in the network structure based on the target configuration combination.
Optionally, the training the electrocardiosignal analysis model according to the pre-acquired medical health training data includes:
acquiring a sample combination feature vector corresponding to the historical electrocardiosignal and the physiological index data, and acquiring an electrocardiosignal abnormality type corresponding to the sample combination feature vector;
Sequencing the medical health training data acquired in advance from easy to difficult according to the complexity of the sample combination feature vector and the rareness of the electrocardio abnormality type to generate a target training data sequence;
Analyzing probability distribution of the electrocardiographic anomaly type corresponding to the target training data sequence by using the electrocardiographic signal analysis model;
Calculating a loss value of the probability distribution by using a preset cross-entropy loss function, and dynamically adjusting the learning rate and batch parameters in the electrocardiosignal analysis model training process according to the target training data sequence when the loss value is greater than or equal to a preset loss threshold value until the loss value is smaller than the preset loss threshold value;
And when the loss value is smaller than a preset loss threshold value, adjusting model parameters of the electrocardiosignal analysis model based on the adjusted learning rate and batch parameters, and determining a trained electrocardiosignal model according to the model parameters.
Optionally, the analyzing the feature fusion vector through the trained electrocardiosignal analysis model to obtain an electrocardiosignal graph of the target user includes:
Inputting the feature fusion vector to an input layer of the electrocardiosignal analysis model;
Extracting deep implicit association features of the feature fusion vector central electrical waveform features and the physiological index features respectively through a multi-branch depth separable convolution layer in the electrocardiosignal analysis model;
Fusing the deep implicit associated features to obtain fused features, and calculating feature contribution weights of the electrocardiographic waveform features and the physiological index features through a preset self-adaptive attention weighting unit;
Weighting the fusion features through the feature contribution weights to obtain weighted fusion features, and calculating through a full connection layer in a trained electrocardiosignal analysis model to obtain target probability distribution of an electrocardiosignal abnormality type corresponding to the weighted fusion features;
And generating a structured electrocardiosignal analysis report based on the target probability distribution, and visualizing the electrocardiosignal analysis report to obtain an electrocardiosignal graph of a target user.
In order to solve the above-mentioned problems, the present invention also provides an electrocardiograph signal analysis system, the system comprising:
the data acquisition module is used for acquiring original electrocardiosignals of the target user through an electrocardiograph unit arranged in the preset medical equipment and synchronously acquiring physiological index data of the target user through a physiological index monitoring unit arranged in the medical equipment;
the self-adaptive filtering processing module is used for carrying out self-adaptive filtering processing on the original electrocardiosignal based on the motion perception state of the electrocardiograph unit to obtain a target electrocardiosignal;
the data fusion module is used for extracting the electrocardiographic waveform characteristics of the target electrocardiograph signal by using a preset multi-scale morphological algorithm, and carrying out data fusion on the electrocardiographic waveform characteristics and the physiological index data to obtain a characteristic fusion vector;
The electrocardiosignal analysis model generation module is used for generating an electrocardiosignal analysis model according to the embedded memory resource of the medical equipment and a network structure of a preset lightweight neural network model;
and the electrocardiosignal image generating module is used for training the electrocardiosignal analysis model according to the medical health training data acquired in advance, and analyzing the feature fusion vector through the trained electrocardiosignal analysis model to obtain an electrocardiosignal image of the target user.
The embodiment of the invention ensures the time correlation of the original electrocardiosignal and the physiological index data by synchronously acquiring the two, provides a reliable data basis for subsequent analysis, carries out self-adaptive filtering processing on the original electrocardiosignal in a motion perception state, can dynamically adjust a filtering strategy according to the motion state of a user, effectively removes motion artifacts, improves the quality of the electrocardiosignal, extracts electrocardiosignal waveform characteristics by utilizing a multiscale morphological algorithm, can comprehensively capture complex characteristics of the electrocardiosignal, combines clinical priori knowledge to carry out characteristic fusion, ensures that the fused characteristic vector contains richer information, improves the representativeness of the characteristics, generates an electrocardiosignal analysis model according to the embedded memory resource of medical equipment, ensures that the model can operate on equipment efficiently, improves the practicability and the operation efficiency of the model, and analyzes the characteristic fusion vector to obtain a more accurate electrocardiosignal map. Therefore, the electrocardiosignal analysis method and system provided by the invention can solve the problem of lower accuracy in electrocardiosignal analysis.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides an electrocardiosignal analysis method. The main execution body of the electrocardiosignal analysis method comprises, but is not limited to, at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the electrocardiographic signal analysis method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server side comprises, but is not limited to, a single server, a server cluster, a cloud server or a cloud server cluster and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of an electrocardiograph signal analysis method according to an embodiment of the invention is shown. In this embodiment, the electrocardiograph signal analysis method includes:
S1, acquiring original electrocardiosignals of a target user through an electrocardiograph unit arranged in preset medical equipment, and synchronously acquiring physiological index data of the target user through a physiological index monitoring unit arranged in the medical equipment.
In the embodiment of the invention, the preset medical equipment is equipment integrating functional modules such as an electrocardiograph unit, a physiological index monitoring unit and the like and can collect, process and analyze the electrocardiosignals and physiological indexes of a human body. The raw electrocardiograph signals refer to raw electrical activity signals that are directly acquired from the heart of the target user by an electrocardiograph unit.
In detail, based on a user-triggered physiological monitoring instruction, the electrocardiograph unit is started, the user-triggered physiological monitoring instruction can be an operation of pressing a corresponding key on the medical equipment, clicking related options on a touch screen of the equipment and the like, when the user triggers the instruction, a control system of the medical equipment receives a signal, and then sends a starting command to the electrocardiograph unit, so that the electrocardiograph unit is converted into a working state from a standby state and is ready for data acquisition. For example, when a user feels uncomfortable and wants to monitor his heart condition and related physiological indicators, the electrocardiograph unit may be activated by pressing a start monitoring button on the device.
Specifically, the raw electrocardiographic signals are acquired by an electrocardiograph unit at a set sampling frequency. The set sampling frequency is the frequency of the acquisition signal preset according to the frequency characteristic of the electrocardiosignal and the clinical diagnosis requirement. The electrocardiograph unit senses weak electric signals generated by heart activities through electrode plates contacted with human skin according to a set sampling frequency, and converts the weak electric signals into electric signal data which can be stored and processed, namely original electrocardiosignals. For example, setting the sampling frequency to 500Hz means that the electrocardiograph unit collects 500 electrocardiograph data points per second, so that the details of the electrocardiograph can be captured more completely.
In the embodiment of the invention, the physiological index monitoring unit is a functional module used for collecting physiological index data such as blood sugar, uric acid, blood ketone and the like of a target user in medical equipment. The physiological index data is a specific numerical value reflecting each index of the physical state of the target user, such as blood glucose value, uric acid value, blood ketone value, etc.
In the embodiment of the present invention, the method for synchronously collecting the physiological index data of the target user by the physiological index monitoring unit built in the medical equipment includes:
Generating a synchronous trigger signal based on the acquisition time sequence of the electrocardiograph unit;
The synchronous trigger signal is sent to the physiological index monitoring unit, and the physiological index monitoring unit is controlled to execute data acquisition actions;
receiving the time stamp aligned physiological index feedback data of the physiological index monitoring unit according to the executed data acquisition action, and verifying the time sequence consistency of the physiological index feedback data and the original electrocardiosignal;
and when the verified result is that the time sequences are consistent, taking the physiological index feedback data as the physiological index data, and caching the physiological index data in an embedded memory of the medical equipment.
In detail, the acquisition timing of the electrocardiograph unit refers to the time sequence and time interval in which it performs the acquisition of the raw electrocardiographic signals. The control module of the medical equipment can track the acquisition time sequence of the electrocardiograph unit in real time, and generates a synchronous trigger signal according to the initial time, the interval and other information of the time sequence, wherein the signal is used for indicating when the physiological index monitoring unit starts data acquisition so as to ensure the time synchronization of the acquisition data of the electrocardiograph unit and the physiological index monitoring unit. For example, the electrocardiograph unit collects at the time points of 1 st second, 2 nd second, 3 rd second, etc., and the synchronous trigger signal is generated at the time points and sent to the physiological index monitoring unit. The synchronous trigger signal is sent to the physiological index monitoring unit through a communication line in the medical equipment, and after the physiological index monitoring unit receives the signal, the physiological index monitoring unit immediately starts a sensing module in the physiological index monitoring unit and executes data acquisition action according to the same time rhythm as the electrocardiograph unit. For example, when the synchronous trigger signal arrives, the physiological index monitoring unit starts the blood glucose sensor to collect blood glucose data of the target user.
Specifically, after the physiological index monitoring unit collects physiological index data, a corresponding time stamp is added to each piece of data, and the time stamp is consistent with the time stamp of the original electrocardiograph signal collected by the electrocardiograph unit, namely, the physiological index feedback data with aligned time stamps. After the processing module of the medical equipment receives the data, comparing the time stamp of the physiological index data with the time stamp of the original electrocardiosignal, and checking whether the time stamp of the physiological index data and the time stamp of the original electrocardiosignal correspond to each other one by one or not so as to verify the time sequence consistency. If the time stamp of the physiological index data is completely matched with the time stamp of the original electrocardiosignal, the time sequence is consistent, and if deviation exists, the time sequence is inconsistent. When the verification confirms that the physiological index feedback data is consistent with the original electrocardiosignal time sequence, the physiological index feedback data is determined to be effective physiological index data. The medical equipment temporarily stores the data in the embedded memory, and the embedded memory is a memory for temporarily storing the data in the medical equipment, has the characteristic of quick reading and writing, and is convenient for quick calling and processing of the data in subsequent steps. For example, consistent timing of blood glucose, uric acid, blood ketone data is cached in embedded memory, ready for subsequent feature extraction and fusion.
In addition, the original electrocardiosignal is transmitted to an embedded memory of the medical equipment for buffering after being collected by the electrocardiograph unit, and meanwhile, the physiological index data with consistent verification time sequence is also buffered in the embedded memory. Thus, the original electrocardiosignal and the physiological index data are stored in the same memory, so that the cooperative processing and analysis of the two are facilitated in the subsequent steps. For example, the original electrocardiosignal is stored in a specific area of the embedded memory in the form of a data sequence, the physiological index data is stored in an adjacent area, and the two can be quickly read and associated.
Furthermore, by synchronously collecting the original electrocardiosignals and the physiological index data, a reliable data basis is provided for the subsequent accurate data analysis, and only the synchronous and high-quality original electrocardiosignals are obtained, the effective filtering treatment can be carried out to obtain purer target electrocardiosignals.
And S2, performing self-adaptive filtering processing on the original electrocardiosignal based on the motion perception state of the electrocardiograph unit to obtain a target electrocardiosignal.
In the embodiment of the invention, the motion sensing state refers to the motion condition of the target user sensed by the electrocardiograph unit through the built-in sensor, and comprises whether the electrocardiograph unit moves, the intensity of the motion and the like. The adaptive filtering process is a process capable of automatically adjusting the filter parameters according to the characteristics of the input signal to achieve the optimal filtering effect. The target electrocardiosignal is a pure electrocardiosignal from which the interferences such as motion artifacts and the like are removed after the self-adaptive filtering treatment.
In the embodiment of the present invention, the performing adaptive filtering processing on the original electrocardiograph signal based on the motion sensing state of the electrocardiograph unit to obtain a target electrocardiograph signal includes:
acquiring triaxial acceleration data output by an acceleration sensor arranged in the electrocardiograph unit;
Determining a motion intensity index and a motion state signal of the electrocardiograph unit according to the vector amplitude of the triaxial acceleration data;
judging whether the target user is in a motion interference state according to the motion state signal;
When a target user is in a motion interference state, acquiring a mapping relation between a preset motion intensity threshold range and a filter type, and matching the motion intensity index with the mapping relation;
Extracting filter parameters corresponding to the matched filter types, reconstructing the filter parameters into a preset adaptive filter, and performing motion artifact inhibition on the original electrocardiosignal by using the reconstructed adaptive filter to obtain a target electrocardiosignal.
In detail, the acceleration sensor built in the electrocardiograph unit can sense acceleration changes in three mutually perpendicular directions (typically, X-axis, Y-axis, Z-axis), and the three-axis acceleration data output by the acceleration sensor is acceleration values in the three directions. For example, when the target user walks during the monitoring process, the acceleration sensor detects acceleration changes in the directions of the X axis, the Y axis and the Z axis and outputs corresponding data, such as 0.5m/s2 for the X axis, 0.3m/s2 for the Y axis and 0.2m/s2 for the Z axis. The vector magnitude is a comprehensive acceleration value calculated according to triaxial acceleration data, and can be calculated by the following formula: Calculating a vector magnitude, wherein For the magnitude of the vector,Is thatThe acceleration on the axis of the shaft,Is thatThe acceleration on the axis of the shaft,Is thatAcceleration on the shaft.
Specifically, the exercise intensity index is a quantization index reflecting the intensity of exercise, which is determined based on the vector magnitude, and the exercise state signal is a signal indicating whether the target user is in an exercise state. For example, if the vector amplitude is calculated to be 0.65m/s2, the motion state signal is motion and the motion intensity index is medium, wherein the motion threshold is determined based on three-axis acceleration data statistical analysis of a target user in a static state, three-axis acceleration data output by an electrocardiograph unit built-in acceleration sensor of a large number of target users in the static state are collected, vector amplitudes of the data are calculated, the calculated vector amplitudes are statistically processed to determine a distribution range, the maximum value or 95% split value of the vector amplitude in the static state is generally set as an initial motion threshold, or clinical experiment data are combined for adjustment, users in different age ranges and different physical conditions are selected for testing, the acceleration data are respectively collected when the users are in slight motion and the static state, the difference of the vector amplitudes in the two states is analyzed, and the motion threshold can be ensured to accurately distinguish the static state from the motion state. For example, the vector amplitude is more than 0.3m/s2 in the static state and more than 0.3m/s2 in the slight movement state through statistical analysis, so that the movement threshold is set to be 0.3m/s2, and when the calculated vector amplitude is more than the value, the target user is judged to be in a movement interference state. When the motion state signal is in motion, the motion of the target user is possibly interfered with the original electrocardiosignal, namely, the motion state is in a motion interference state, and when the motion state signal is static, the target user is not in the motion interference state. For example, if the motion state signal is in motion, it is determined that the target user is in a motion disturbance state, and the original electrocardiographic signal may include motion artifacts.
Further, the mapping relation between the preset motion intensity threshold range and the filter type is preset, different motion intensity threshold ranges correspond to different types of filters, for example, low-intensity motion corresponds to a first-order Butterworth filter, medium-intensity motion corresponds to a second-order Butterworth filter, and high-intensity motion corresponds to an adaptive Notch filter. And comparing the calculated motion intensity index with the threshold ranges to find the corresponding filter type. For example, the motion intensity index is medium, the corresponding threshold value range is 0.5-1.0m/s2, and the motion intensity index is matched with a second order Butterworth filter. And extracting filter parameters corresponding to the matched filter types, wherein the filter parameters comprise cut-off frequency, order and the like, and different types of filters have different parameters. After extracting parameters corresponding to the matched filter types, setting the parameters into a preset adaptive filter, so that the filter can adapt to the current motion interference condition. The reconstructed self-adaptive filter processes the original electrocardiosignal, removes artifacts generated by motion in the original electrocardiosignal, and obtains a pure target electrocardiosignal. For example, the cut-off frequency of the second-order Butterworth filter is set to be 35Hz, and the original electrocardiosignal containing the motion artifact is filtered to obtain the target electrocardiosignal after the artifact is removed.
Furthermore, the filtering parameters are adaptively adjusted according to the motion state, so that motion artifacts in the original electrocardiosignal are effectively removed, the problem of poor processing effect of the fixed filtering parameters is solved, and the quality of the electrocardiosignal is improved.
And S3, extracting the electrocardiographic waveform characteristics of the target electrocardiograph signal by using a preset multiscale morphological algorithm, and carrying out data fusion on the electrocardiographic waveform characteristics and the physiological index data to obtain a characteristic fusion vector.
In the embodiment of the invention, the electrocardiographic waveform features refer to various features which are extracted from the target electrocardiographic signal and can reflect the electrocardiographic waveform features, such as amplitude, slope, duration and the like.
In the embodiment of the present invention, the extracting the electrocardiographic waveform feature of the target electrocardiographic signal by using a preset multiscale morphological algorithm includes:
identifying flat structural elements with different scales and morphological gradient operators in a preset multi-scale morphological algorithm;
Carrying out morphological analysis on the target electrocardiosignal by utilizing the flat structural elements with different scales to obtain a multi-scale electrocardiosignal;
enhancing waveform boundary characteristics of the multi-scale electrocardiosignal according to the morphological gradient algorithm;
extracting waveform amplitude characteristics, waveform slope characteristics and waveform duration characteristics of the enhanced multi-scale electrocardiosignal;
and determining the waveform amplitude characteristic, the waveform slope characteristic and the waveform duration characteristic as electrocardiographic waveform characteristics of a target electrocardiograph signal.
In detail, the preset multi-scale morphological algorithm is an algorithm for performing morphological analysis and processing on signals based on structural elements with different scales, wherein the flat structural elements with different scales refer to templates with flat structures with different lengths or sizes in morphological analysis, and the templates are used for performing analysis on the signals to different degrees. The morphological gradient operator is an operator for calculating the gradient change of the boundary of the signal waveform, and can enhance the boundary characteristics of the waveform. For example, the preset multiscale morphological algorithm may include flat structural elements with lengths of 5, 10 and 15 sampling points, and corresponding morphological gradient operators. Morphological analysis comprises operations such as corrosion, expansion, open operation, closed operation and the like, and signal manifestations under different scales, namely multi-scale electrocardiosignals can be obtained by carrying out the operations on flat structural elements with different scales and target electrocardiosignals.
Illustratively, three flat structural elements with different scales are selected according to the frequency range and the waveform characteristics of the target electrocardiosignal, and can be respectively suitable for analysis requirements of different frequency components and waveform details in the signal. For example, flat structure elements with lengths of 3, 7 and 11 sampling points are selected, and the flat structure elements respectively correspond to three dimensions of small, medium and large. The noise suppression operation is performed by using the minimum-scale structural element, and the minimum-scale flat structural element can effectively identify and remove high-frequency noise in the target electrocardiosignal, because the high-frequency noise usually shows small-scale fluctuation. For example, the peak noise in the signal can be filtered out by performing an open operation on the target electrocardiographic signal using a flat structural element with a length of 3 sampling points. The waveform enhancement operation is performed by using the middle-scale structural elements, and the middle-scale flat structural elements can be used for processing main waveform components in the electrocardiosignal, so that the characteristics of the waveform are enhanced, and the waveform is clearer and more discernable. For example, the characteristics of the QRS complex are enhanced by a combined operation of dilation and erosion of the noise suppressed signal using a flat structural element of length 7 samples. And carrying out baseline extraction operation by using the maximum scale structural element. The flat structural element with the largest dimension can ignore local fluctuation in the signal, and extract the baseline trend of the electrocardiosignal, namely the integral direct current component change of the signal. For example, a flat structure element with a length of 11 sampling points is used to perform a closed operation on the signal, resulting in a smoothed baseline signal.
Specifically, the morphological gradient operator is applied to the multi-scale electrocardiosignal, and the rising edge, the falling edge and the like of the waveform are clearer by calculating gradient changes of the signal at different positions, so that the boundary characteristics of the waveform are enhanced, and the subsequent feature extraction is facilitated. For example, the boundaries of the QRS complex in the electrocardiographic signal are more pronounced after morphological gradient operator processing. Then, waveform amplitude features, waveform slope features and waveform duration features of the enhanced multi-scale electrocardiograph signal are extracted. Waveform amplitude characteristics refer to the magnitude of the peak, trough, etc. of the waveform, waveform slope characteristics refer to the degree of tilt during the rise or fall of the waveform, and waveform duration characteristics refer to the time that the waveform has elapsed from the beginning to the end. For example, the peak amplitude of the extracted QRS complex is 0.8mV, the rising slope is 0.5mV/ms, and the duration is 80ms. Finally, the waveform amplitude characteristic, the waveform slope characteristic and the waveform duration characteristic are determined as the electrocardio waveform characteristic of the target electrocardio signal, so that the waveform characteristic of the target electrocardio signal can be comprehensively reflected, the electrocardio waveform characteristic is formed, and a foundation is provided for the subsequent fusion with the physiological index data.
In the embodiment of the invention, the feature fusion vector is a comprehensive feature vector formed by fusing the electrocardiographic waveform features and the physiological index data, and contains key information of the electrocardiographic waveform features and the physiological index data.
In the embodiment of the present invention, the data fusion of the electrocardiographic waveform feature and the physiological index data is performed to obtain a feature fusion vector, which includes:
Extracting the trend characteristics of the physiological indexes in the physiological index data;
Respectively carrying out standardization processing on the electrocardiographic waveform characteristics and the physiological index trend characteristics;
Generating a first weight coefficient and a second weight coefficient of the standardized electrocardiographic waveform characteristic and the physiological index trend characteristic respectively based on preset clinical priori knowledge;
and carrying out feature level fusion on the normalized electrocardiographic waveform features and the physiological index trend features according to the first weight coefficient and the second weight coefficient to obtain feature fusion vectors.
In detail, the physiological index trend feature refers to a trend of change in physiological index data over a period of time, such as an increasing or decreasing trend of blood glucose level, a fluctuation range of uric acid level, and the like. Such as extracting from continuously collected blood glucose data, which exhibit a trend characteristic of increasing over 2 hours. And respectively carrying out standardization processing on the electrocardiographic waveform characteristics and the physiological index trend characteristics, wherein the standardization processing is a process of converting characteristics of different magnitudes and different units into uniform magnitudes, and the characteristic values are usually converted into a range of 0-1 or 1-1 so as to eliminate the influence of magnitude differences on subsequent fusion. For example, the amplitude value in the electrocardiographic waveform feature is converted from mV to a normalized value between 0-1, and the blood glucose rate of change in the physiological index trend feature is converted to a normalized value between 0-1.
Specifically, the clinical prior knowledge refers to knowledge about the importance of the electrocardiographic features and physiological indicators in disease diagnosis based on the summary of medical research and clinical experience. For example, in the case that a specific proportion is not explicitly given in a literature, a weight value is obtained through clinical case data statistical analysis, a certain amount of case data comprising two features and corresponding diagnosis results is collected, and the correlation strength of the two features and the diagnosis results is calculated by using methods such as regression analysis and the like. For example, 1000 cases are analyzed, a regression coefficient of the electrocardiographic waveform characteristic is obtained through a logistic regression model and is 0.6, a regression coefficient of the physiological index trend characteristic is 0.4, after normalization processing, a first weight coefficient is set to be 0.6, and a second weight coefficient is set to be 0.4, so that the relative importance of the electrocardiographic waveform characteristic and the physiological index trend characteristic in the disease diagnosis is reflected, wherein the first weight coefficient reflects the importance degree of the electrocardiographic waveform characteristic, and the second weight coefficient reflects the importance degree of the physiological index trend characteristic.
Further, vectorizing the standardized electrocardiographic waveform characteristics and the physiological index trend characteristics, wherein vector conversion can be performed through a BERT model, and further feature level fusion is performed on the converted vectors, wherein the feature level fusion is to combine the two characteristics in a weighting mode according to the respective weight coefficients to form a comprehensive feature vector containing information of the two characteristics. For example, the normalized electrocardiogram feature is multiplied by a first weight coefficient, the normalized physiological index trend feature is multiplied by a second weight coefficient, and the two are added to obtain a feature fusion vector.
Furthermore, comprehensive electrocardiographic waveform characteristics are extracted through a multiscale morphological algorithm, and the electrocardiographic waveform characteristics and physiological index data are fused by combining clinical priori knowledge, so that the obtained characteristic fusion vector contains richer information.
S4, generating an electrocardiosignal analysis model according to the embedded memory resource of the medical equipment and a network structure of a preset lightweight neural network model.
In the embodiment of the invention, the embedded memory resource refers to a memory resource available in the medical equipment, and the memory resource comprises available memory capacity, resource calculation space and the like. The preset lightweight neural network model is a neural network model with fewer parameters and smaller calculation amount and is suitable for running on equipment with limited resources. The electrocardiosignal analysis model is a model which is specially used for analyzing electrocardiosignal related characteristics so as to realize an electrocardiosignal analysis function.
In the embodiment of the present invention, the generating an electrocardiograph signal analysis model according to the embedded memory resource of the medical device and the network structure of the preset lightweight neural network model includes:
Determining available storage capacity and resource computation space based on the embedded memory resources of the medical device;
Determining model parameters of a preset lightweight neural network model according to the available storage capacity and the resource calculation space;
identifying the number of neural network layers and the number of convolution kernels in a network structure of a preset lightweight neural network model;
and adjusting the number of layers of the neural network and the number of convolution kernels in the network structure according to the model parameter number, and compiling the adjusted network structure into an electrocardiosignal analysis model which can be embedded into medical equipment.
In detail, the available storage capacity refers to the size of unoccupied storage space in the embedded memory of the medical device, usually in bytes, and the resource calculation space refers to the resource that the processor of the medical device can use for model calculation, such as the number of calculation units, the calculation speed, and the like. For example, the available memory capacity of the medical device is 512MB, and the computing capacity of the processor corresponding to the resource computing space is 100MIPS. The lightweight neural network classifier is a deep separable convolutional neural network suitable for embedded microcontrollers, and the model size is constrained to be less than 128KB (as directly determined according to the memory resources (SRAM/Flash) of the specific embedded microcontroller (such as STM32 series or Nordic series chips) selected by enterprises) so as to adapt to the limited memory resources of the medical detection device. The model parameter number refers to the total number of parameters such as weight, bias and the like contained in the neural network model, and the size of the model parameter number is directly related to the storage capacity occupied by the model. And calculating the upper limit of the parameter quantity of the model which can be accommodated according to the size of the available storage capacity, and ensuring that the model cannot be operated due to insufficient storage capacity. For example, if the available storage capacity is 512MB, each parameter occupies 4 bytes, and the upper limit of the model parameters is about 1.3 billion.
Specifically, the network structure of the lightweight neural network model is formed by sequentially connecting an input layer, three depth separable convolution layers, a global average pooling layer and an output layer, wherein the number of filters of the three depth separable convolution layers is gradually increased layer by layer, each layer of the three depth separable convolution layers comprises a batch normalization layer and a ReLU activation function layer, the number of the neural network layers refers to the number of hidden layers contained in the model, the number of convolution kernels refers to the number of convolution kernels contained in the convolution layers, and the two parameters directly influence the parameter quantity and the calculated quantity of the model. For example, the network structure of the preset lightweight neural network model is identified to comprise 5 layers of neural networks, wherein the number of convolution kernels of the convolution layers is 32, and the number of layers of the neural networks and the number of the convolution kernels are increased or decreased according to the determined upper limit of the number of the model parameters, so that the number of the model parameters after adjustment does not exceed the upper limit.
In the embodiment of the present invention, the adjusting the number of layers of the neural network and the number of convolution kernels in the network structure according to the model parameter number includes:
Searching different configuration parameter combinations of the number of layers of the neural network and the number of convolution kernels in the network structure based on the model parameter amount by using a preset network architecture searching algorithm;
Analyzing model accuracy and reasoning speed of the lightweight neural network model under different configuration parameter combinations;
selecting the configuration parameter combination with the maximum model precision and the maximum reasoning speed as a target configuration combination;
and adjusting the number of layers of the neural network and the number of convolution kernels in the network structure based on the target configuration combination.
In detail, the preset network architecture search algorithm is an algorithm capable of automatically searching for a neural network architecture parameter suitable for a specific condition. Based on the limitation of the model parameter quantity, the algorithm can generate a plurality of different combinations of the neural network layer number and the convolution kernel quantity, calculate the model parameter quantity corresponding to each combination, and screen out the configuration parameter combination of which the parameter quantity is in an allowable range. For example, different combinations of 4, 5 and 6 layers of the neural network and 16, 24 and 32 convolution kernels are generated, and the combinations with the parameters meeting the requirements are screened. Model accuracy refers to the prediction accuracy of the model on test data, and reasoning speed refers to the speed of the model for analyzing input data and outputting results. For each combination of configuration parameters meeting the conditions, a corresponding model is trained and tested for accuracy and reasoning speed on the verification set. For example, the analysis gives a certain configuration combination with a model accuracy of 90% and an inference speed of 0.5 seconds/time, and another combination with a model accuracy of 88% and an inference speed of 0.3 seconds/time.
Specifically, a trade-off is made between model accuracy and inference speed, and a configuration parameter combination, i.e., a target configuration combination, which comprehensively performs optimally is selected. For example, if the model accuracy of a certain combination is 89% and the inference speed is 0.4 seconds/time, the combination is comprehensively superior to other combinations, and the combination is selected as the target configuration combination. And modifying the original network structure according to the number of the neural network layers and the number of convolution kernels determined in the target configuration combination, so that the network structure accords with the target configuration. For example, the target configuration combination is that the number of the neural network layers is 5, the number of the convolution kernels is 24, the original network structure is adjusted to be 5, the number of the convolution kernels is set to be 24, after adjustment is completed, the network structure is converted into machine codes which can be identified and operated by medical equipment, namely, the machine codes are compiled into an electrocardiosignal analysis model, and the electrocardiosignal analysis model is embedded into the medical equipment. For example, if the upper limit of the model parameter is 1 hundred million, the original model parameter is 1.2 hundred million, the number of the neural network of 1 layer can be reduced, the number of convolution kernels is reduced to 24, the number of the parameters is reduced to 0.9 hundred million, and then the model parameters are compiled into an embedded model. Before the lightweight neural network classifier is deployed in the medical detection equipment, the lightweight neural network classifier is subjected to weight quantization processing, and 32-bit floating point weights in the lightweight neural network classifier are converted into 8-bit integer weights, so that the reasoning speed on an embedded processor is improved, the memory occupation and the computing load of the processor can be greatly reduced by quantization, and the final existing form (8-bit integer) of the model on the terminal equipment is protected, rather than the form (32-bit floating point) during training.
Further, the structure of the neural network model is adjusted according to the embedded memory resources of the medical equipment, an electrocardiosignal analysis model suitable for equipment operation is generated, and the problem of unsmooth operation caused by mismatching of the model and the equipment resources in the prior art is solved.
And S5, training the electrocardiosignal analysis model according to the medical health training data acquired in advance, and analyzing the feature fusion vector through the trained electrocardiosignal analysis model to obtain an electrocardiosignal image of the target user.
In the embodiment of the invention, the medical health training data refers to a data set containing historical electrocardiosignals, physiological index data and corresponding diagnosis results for training an electrocardiosignal analysis model.
In the embodiment of the present invention, the training the electrocardiograph signal analysis model according to the pre-acquired medical health training data includes:
acquiring a sample combination feature vector corresponding to the historical electrocardiosignal and the physiological index data, and acquiring an electrocardiosignal abnormality type corresponding to the sample combination feature vector;
Sequencing the medical health training data acquired in advance from easy to difficult according to the complexity of the sample combination feature vector and the rareness of the electrocardio abnormality type to generate a target training data sequence;
Analyzing probability distribution of the electrocardiographic anomaly type corresponding to the target training data sequence by using the electrocardiographic signal analysis model;
Calculating a loss value of the probability distribution by using a preset cross-entropy loss function, and dynamically adjusting the learning rate and batch parameters in the electrocardiosignal analysis model training process according to the target training data sequence when the loss value is greater than or equal to a preset loss threshold value until the loss value is smaller than the preset loss threshold value;
And when the loss value is smaller than a preset loss threshold value, adjusting model parameters of the electrocardiosignal analysis model based on the adjusted learning rate and batch parameters, and determining a trained electrocardiosignal model according to the model parameters.
In detail, the historical electrocardiosignal and the physiological index data are data which are collected in the past and used for model training, and are fused according to the same method as the step S3 to obtain a sample combination feature vector. The type of the electrocardiographic abnormality refers to the type of heart disease corresponding to the sample combination feature vector, such as myocardial infarction, arrhythmia, and the like. For example, 1000 sets of sample combination feature vectors are obtained, each set corresponding to one type of electrocardiographic abnormality, e.g., 200 sets corresponding to cardiac arrhythmias. The complexity of the sample combination feature vector refers to the complexity of information contained in the feature vector, cases corresponding to the complex feature vector are harder to diagnose, the more the feature quantity is, the more complex the association is, the larger the fluctuation range is, the higher the complexity of the sample combination feature vector is, namely, the feature quantity is determined to be the complexity, the rareness of the electrocardio abnormal type refers to the occurrence probability of the type of diseases in the crowd, and cases corresponding to the rareness of the type of diseases are harder to diagnose, wherein the rareness is determined based on the proportion of a certain type of diseases. The medical health training data are ordered in a simple to complex, common to rare order to obtain a target training data sequence. For example, samples with simple features and corresponding to common arrhythmias are arranged first, and samples with complex features and corresponding to rare myocardial infarction are arranged.
Specifically, the sample combination feature vector in the target training data sequence is input into an electrocardiosignal analysis model, and the model outputs the probability that each sample belongs to various electrocardiosignal abnormality types to form probability distribution. For example, when a certain sample is input into the model, the probability of arrhythmia is 80% and the probability of normal is 20%. The preset cross-entropy loss function is a function for measuring the difference between the model prediction probability distribution and the actual label distribution, and the smaller the loss value is, the more accurate the model prediction is. The preset loss threshold is a preset threshold for judging whether the model is trained in place, and when the loss value is greater than or equal to the preset loss threshold, the training process is optimized by adjusting the learning rate (the amplitude for controlling the updating of the model parameters) and the batch parameters (the number of samples for controlling each training input model), for example, the learning rate is increased to speed up convergence, and the batch size is adjusted to improve the training stability until the loss value is smaller than the preset loss threshold. And after the loss value reaches the preset requirement, continuing to train the model by using the adjusted learning rate and batch parameters, updating the parameters such as the weight, the bias and the like of the model until the model converges, and obtaining the model corresponding to the model parameters at the moment as the trained electrocardiosignal model.
In the embodiment of the invention, the trained electrocardiosignal analysis model is a model which can accurately analyze and predict the input characteristics after being trained by medical health training data. The electrocardiosignal graph of the target user is a visual chart containing the analysis result of the electrocardiosignal of the target user, and can assist doctors in diagnosis.
In the embodiment of the present invention, the analyzing the feature fusion vector by the trained electrocardiosignal analysis model to obtain an electrocardiosignal graph of the target user includes:
Inputting the feature fusion vector to an input layer of the electrocardiosignal analysis model;
Extracting deep implicit association features of the feature fusion vector central electrical waveform features and the physiological index features respectively through a multi-branch depth separable convolution layer in the electrocardiosignal analysis model;
Fusing the deep implicit associated features to obtain fused features, and calculating feature contribution weights of the electrocardiographic waveform features and the physiological index features through a preset self-adaptive attention weighting unit;
Weighting the fusion features through the feature contribution weights to obtain weighted fusion features, and calculating through a full connection layer in a trained electrocardiosignal analysis model to obtain target probability distribution of an electrocardiosignal abnormality type corresponding to the weighted fusion features;
And generating a structured electrocardiosignal analysis report based on the target probability distribution, and visualizing the electrocardiosignal analysis report to obtain an electrocardiosignal graph of a target user.
In detail, the input layer is the first layer of the electrocardiosignal analysis model for receiving input data, and the feature fusion vector enters the model through the input layer for processing. For example, a feature fusion vector is input to the input layer of the model, the vector containing 100 feature values. The multi-branch depth separable convolution layer is a special convolution layer structure in the model, and can respectively process different types of features (electrocardiographic waveform features and physiological index features) in the feature fusion vector, deep and implicit association features among the features are extracted, namely, different branches of the multi-branch depth separable convolution layer can pertinently pay attention to different parts in the feature fusion vector, one branch mainly processes information related to electrocardiographic waveform features, the other branch mainly processes information related to physiological index features, for the branches processing electrocardiographic waveform features, the deep convolution part can carry out independent convolution operation on each channel of electrocardiographic waveform features, capture local features in the channel, such as change rules of specific waveform segments, and the point-by-point convolution part combines the local features, so as to extract association information inside the electrocardiographic waveform features. Meanwhile, the branches can interact with related information of the physiological index features, deep association of the electrocardiographic waveform features affected by the physiological index, such as hidden association between heart rate variation and blood sugar fluctuation, local trends in the physiological index feature channels, such as ascending and descending rules of blood sugar in different time periods, are captured through deep convolution for the branches for processing the physiological index features, and the local trends are combined through point-by-point convolution to extract associated information in the physiological index features. Meanwhile, the branches can combine the information of the electrocardiographic waveform characteristics, and the deep association of the physiological index characteristics on the electrocardiographic activity is mined, for example, potential association between uric acid value abnormality and electrocardiographic rhythm disorder is realized, the two branches can continuously perform characteristic interaction in the extraction process, and the information is transmitted through interlayer connection, so that various deep implicit associations between the two characteristics can be comprehensively captured. Finally, the multi-branch depth separable convolution layer integrates the association information extracted by the two branches to obtain deep implicit association features capable of reflecting complex internal association between the electrocardiographic waveform features and the physiological index features.
The method comprises the steps of combining different associated features into a feature vector with higher dimension in sequence, or fusing information of the different associated features through element addition, multiplication and other operations, so that the fused features not only retain unique information of each deep implicit associated feature, but also reflect the synergistic relationship between the deep implicit associated features. For example, features reflecting the correlation of heart rate variation and blood glucose fluctuations and features reflecting the correlation of electrocardiographic rhythms and uric acid level abnormalities are spliced to form a fusion feature containing the two correlation information.
Furthermore, the preset adaptive attention weighting unit is a unit for automatically assigning weights according to feature importance in the model, which calculates the magnitude of the contribution of the electrocardiographic waveform features and the physiological index features in the fusion feature, i.e., the feature contribution weights. And automatically adjusting the attention degree of different characteristic components by learning the association mode between the two characteristics and the electrocardio abnormality type in the training data. The adaptive attention weighting unit assigns an attention score to each element in the fused feature, and the scores are converted into contribution weights of the corresponding feature after normalization processing such as softmax function. For example, the calculated contribution weight of the electrocardiographic waveform feature is 0.6, and the contribution weight of the physiological index feature is 0.4. And weighting the fusion features by utilizing the feature contribution weights to ensure that important features occupy larger proportion in the fusion features, thereby obtaining weighted fusion features. The full connection layer is a layer in the model responsible for mapping the weighted fusion characteristics to output results, and the probability that the target user belongs to various electrocardiographic anomaly types, namely target probability distribution, is output through calculation of the layer. For example, the probability of the output target user being normal is 70%, the probability of mild arrhythmia is 25%, and the probability of other abnormalities is 5%.
Further, the structured electrocardiosignal analysis report is a report which is organized according to a certain format and contains information such as target probability distribution, main abnormality type and the like. The report is visualized, and the data are presented in the form of a chart, a curve and the like to form an electrocardio signal diagram of the target user, so that doctors can intuitively know the heart condition of the target user. For example, the electrocardiographic signal map includes an electrocardiographic waveform curve, a physiological index change curve, and an anomaly probability label.
Furthermore, a high-precision model is obtained through a reasonable training method, and an electrocardiosignal image is obtained by analyzing the feature fusion vector by using the model, so that the problems that the model analysis effect is poor and an effective diagnosis basis cannot be provided for doctors in the prior art are solved.
Fig. 2 is a functional block diagram of an electrocardiograph signal analysis system according to an embodiment of the present invention.
The electrocardiograph signal analysis system 100 according to the present invention may be installed in an electronic device. Depending on the implementation, the electrocardiograph signal analysis system 100 may include a data acquisition module 101, an adaptive filtering processing module 102, a data fusion module 103, an electrocardiograph signal analysis model generation module 104, and an electrocardiograph signal map generation module 105. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The data acquisition module 101 is configured to acquire an original electrocardiograph signal of a target user through an electrocardiograph unit built in a preset medical device, and synchronously acquire physiological index data of the target user through a physiological index monitoring unit built in the medical device;
the adaptive filtering processing module 102 is configured to perform adaptive filtering processing on the original electrocardiograph signal based on a motion sensing state of the electrocardiograph unit, so as to obtain a target electrocardiograph signal;
the data fusion module 103 is configured to extract an electrocardiographic waveform feature of the target electrocardiographic signal by using a preset multiscale morphological algorithm, and perform data fusion on the electrocardiographic waveform feature and the physiological index data to obtain a feature fusion vector;
the electrocardiograph signal analysis model generation module 104 is configured to generate an electrocardiograph signal analysis model according to an embedded memory resource of the medical device and a network structure of a preset lightweight neural network model;
The electrocardiograph signal image generating module 105 is configured to train the electrocardiograph signal analysis model according to pre-acquired medical health training data, and analyze the feature fusion vector through the trained electrocardiograph signal analysis model to obtain an electrocardiograph signal image of the target user.
In detail, each module in the electrocardiograph signal analysis system 100 in the embodiment of the present invention adopts the same technical means as the electrocardiograph signal analysis method described in fig. 1 to 2, and can produce the same technical effects, which are not described herein.
In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the modules is merely a logical function division, and other manners of division may be implemented in practice.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the foregoing description, and all changes which come within the meaning and range of equivalency of the scope of the invention are therefore intended to be embraced therein.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. Multiple units or systems as set forth in the system claims may also be implemented by means of one unit or system in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.