Disclosure of Invention
In order to solve at least one technical problem in the background art, the invention provides an electrocardiogram identity recognition method and system based on kernel bounded discriminant analysis, aiming at the nonlinear distribution of electrocardiogram signals, the kernel bounded discriminant analysis uses a polynomial kernel function, and the electrocardiogram signals are implicitly projected to a high-dimensional space with distinguishability, so that the distinguishing degree of the characteristics of the electrocardiogram signals is further improved, and the effect of electrocardiogram identity recognition is improved.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides an electrocardio identity recognition method based on bounded discriminant analysis of a kernel.
An electrocardio identity recognition method based on bounded discriminant analysis of a kernel comprises the following steps:
acquiring an electrocardiosignal and extracting a single-cycle heart beat signal;
the heart beat is implicitly projected to a high-dimensional space through a kernel function, a bounded discriminant analysis is used in the high-dimensional space to map the heart beat signal to a low-dimensional subspace, and the low-dimensional features of the single-cycle heart beat signal are extracted;
searching the most similar template from the template database based on the Euclidean distance, and outputting a user corresponding to the most similar template as a user to be identified; the template database stores a single-cycle heart beat signal template and a corresponding user thereof.
In a second aspect, the present invention provides a system for cardiac electrical identity recognition based on bounded discriminant analysis of kernels.
An electrocardiogram identity recognition system based on bounded discriminant analysis of a kernel, comprising:
the signal acquisition module is used for acquiring the electrocardiosignals and extracting the cardiac signals of a single cycle;
the characteristic extraction module is used for implicitly projecting the heart beat to a high-dimensional space through a kernel function, mapping the heart beat signal to a low-dimensional subspace in the high-dimensional space by using bounded discriminant analysis, and extracting the low-dimensional characteristic of the heart beat signal in a single period;
the identity recognition module is used for searching the most similar template from the template database based on the Euclidean distance and outputting the user corresponding to the most similar template as the user to be recognized; the template database stores a single-cycle heart beat signal template and a corresponding user thereof.
A third aspect of the invention provides a computer-readable storage medium.
A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps in the method for cardiac electrical identity recognition based on bounded discriminatory analysis of kernels as described above.
A fourth aspect of the invention provides a computer apparatus.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method for cardiac electrical identity recognition based on bounded discriminant analysis by kernel as described above when executing the program.
Compared with the prior art, the invention has the beneficial effects that:
preprocessing a electrocardiosignal by filtering and denoising, and detecting the position of the vertex of an R wave by using a Pan-Tompkins algorithm so as to extract a heart beat; obtaining a set of subspaces' bases through a kernel-based bounded discriminant analysis using a training set heartbeat; for any heart beat, the kernel function and the subspace substrate are utilized to obtain the low-dimensional electrocardio characteristic vector with more distinctiveness.
The invention discloses a method for reducing dimension by embedding graphs in a traditional method, which is characterized in that each kind of data is assumed to accord with Gaussian distribution and not accord with the real condition of electrocardiosignals, when the electrocardiosignal data do not meet the assumption, the dispersion degree between classes can not be well described through the compactness degree in the classes.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
The invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
Example one
Referring to fig. 1, the method for identifying an electrocardiogram based on bounded discriminant analysis of kernels according to the present embodiment includes:
s101: acquiring an electrocardiosignal and extracting a single-cycle heart beat signal.
In a specific implementation, some noise interference exists when the original electrocardio signal is acquired, such as myoelectric interference, contact noise, baseline drift and the like.
The frequency of normal electrocardiosignals is generally distributed between 0.5 Hz and 100Hz, wherein the main energy is concentrated between 1Hz and 40Hz, and the electrocardiosignals have weaker amplitude and are sensitive to noise. According to the frequency range of the electrocardiosignals, the scheme adopts a fourth-order band-pass Butterworth filter to carry out denoising, and the low-frequency cut-off frequency and the high-frequency cut-off frequency of the filter are set to be 1Hz and 40Hz respectively.
S102: the heart beat is implicitly projected to a high-dimensional space through a kernel function, a bounded discriminant analysis is used in the high-dimensional space to map the heart beat signal to a low-dimensional subspace, and the low-dimensional features of the single-cycle heart beat signal are extracted.
The electrocardiosignals are non-stable cycle-like signals, and one electrocardiosignal record comprises a plurality of single-cycle heart beats. A complete heart beat sequentially comprises a P wave band, a QRS wave band and a T wave band, wherein the peak amplitude of the R wave is most prominent and can be used as a basis for extracting a single heart beat.
And detecting the position of the top point of the R wave in the electrocardiosignal by using a Pan-Tompkins algorithm. Firstly, the signal is down-sampled to 200Hz sampling frequency, noise, P wave and T wave are weakened by using a filter, and QRS wave complex in the electrocardiosignal is highlighted. And enhancing the QRS complex by a difference equation to obtain a difference signal, and carrying out a series of nonlinear operations such as point-by-point squaring and window sliding integration on the difference signal to obtain an integral signal. And determining that the QRS complex is detected when the amplitudes of the points on the differential signal and the integral signal simultaneously satisfy a threshold setting. And searching the maximum value of the signal amplitude within the QRS wave group range, namely the position of the top point of the R wave. Finally, a backtracking mechanism is used for preventing missed detection and false detection.
Taking the R wave vertex position detected by a Pan-Tompkins algorithm as a reference, and taking a certain number of points forwards and backwards according to the sampling frequency of the electrocardiosignals to form a heart beat. And calculating a plurality of heartbeats segmented from each electrocardiogram record, and screening out the heartbeats with too large distance from the average heart beat by an average value threshold method.
The heart beat is implicitly projected to a high-dimensional space through a kernel function based on the bounded discriminant analysis of the kernel, and the heart beat is mapped to a low-dimensional subspace in the high-dimensional space by using the bounded discriminant analysis, so that the distances between positive samples are smaller, and the distances between negative samples are larger. To achieve this goal, kernel-based bounded discriminant analysis uses a neighbor graph to describe the degree of compactness within a class and a penalty graph to describe the degree of dispersion between classes. Meanwhile, aiming at the problem that the electrocardiosignals are inseparable in a linear space, a polynomial kernel function is introduced based on bounded discriminant analysis of kernels, and the electrocardiosignals are implicitly projected to a high-dimensional space with distinguishability
N single-cycle heart beat signals with the length of m obtained by dividing electrocardiosignals are used as training data of a learning process of a bounded discriminant analysis method based on a kernel, wherein the heart beats from the same user are similar heart beats, and otherwise, the heart beats are different heart beats. Let X be (X)1,x2,....xN) For class C heartbeats from different subjects at position C, with each column xiIs the ith heartbeat in m-dimensional space. If xiAnd xjAll from the same subject, called (x)i,xj) Positive sample pairs, otherwise called negative sample pairs。
The bounded discriminant analysis method based on kernel uses polynomial kernel function to implicitly map the heart beat to a high-dimensional space with more separability
For any x in the input space
iAnd x
jThe polynomial kernel satisfies:
k(xi,xj)=Φ(xi)TΦ(xj). (1)
where Φ is mapping the heart beat to space
Of the method in
The inner product calculation in the space is converted into the calculation in the original input space through the kernel function, so that the specific phi does not need to be calculated. The formula of the kernel function is
k(x,y)=(xTy+1)2. (2)
The distance in the high-dimensional space is calculated using a kernel function, as follows
Finding x in a high dimensional space by the distance calculated by the kernel functioniK of (a)1And (3) establishing a neighbor graph G ═ { X, W } by using neighbor heartbeats from the same class, wherein W is a mark matrix of the neighbor graph, and searching XiK of (a)2Creating a penalty map G for each neighboring heartbeat from different classesp={X,WpIn which W ispIs a mark matrix of the penalty map.
By means of G and GpThe kernel-based bounded discriminant analysis method solves a low-dimensional subspace that can simultaneously maintain the neighborhood relationship within and between classes. Solving an objective function of the subspace base as
Wherein D is a diagonal matrix defined as
Must be satisfied when the objective function is minimized
K(Dp-Wp)Kα=λK(D-W)Kα. (6)
And decomposing the generalized eigenvalues to obtain eigenvectors, and selecting the eigenvectors corresponding to the first d smallest eigenvalues to form a group of bases A of the low-dimensional subspace.
After the low-dimensional subspace substrate A obtained by using the bounded discriminant analysis based on the kernel, any electrocardiosignal x can be expressed as a low-dimensional subspace characteristic y, and the expression formula is
The dimensionality reduction process of the kernel-based bounded discriminant analysis is as follows:
inputting: training data matrix X of heartbeat, dimensionality d after dimensionality reduction, and heartbeat neighbor number k1,k2。
And (3) outputting: the low-dimensional feature y.
Step1 the inner product between the pairs of points is calculated and saved using equation (2).
Step2 calculating distance using equation (3) to find xiK of (a)1Intra-class neighbor and k2Inter-class neighbors.
Step3 establishing a neighbor graph G and a penalty graph GpCalculating diagonal matrices D and D using equation (5)p。
And Step4, performing generalized eigenvalue decomposition by using the formula (6) to calculate eigenvalues and eigenvectors.
And Step5, selecting the eigenvectors corresponding to the minimum d eigenvalues to form a group of substrates A in the subspace.
Step6, for any heart beat x, the low-dimensional feature of the heart beat is calculated by using the formula (7).
S103: searching the most similar template from the template database based on the Euclidean distance, and outputting a user corresponding to the most similar template as a user to be identified; the template database stores a single-cycle heart beat signal template and a corresponding user thereof.
In the specific implementation, when in recognition, for a newly input heart beat to be recognized, the kernel function and the subspace base are also used for obtaining the low-dimensional characteristics of the signal. And further searching the most similar template through Euclidean distance calculation, and outputting the user corresponding to the most similar template as the user to be identified.
According to the characteristics of electrocardiosignals, preprocessing the electrocardiosignals through filtering, positioning and extracting a monocycle heart beat according to the top point of an R wave, and further learning a low-dimensional subspace substrate by adopting a bounded discriminant analysis method based on a kernel. Any electrocardiosignal sample can be projected from a high-dimensional space to a low-dimensional space to obtain a low-dimensional electrocardiosignal characteristic with more distinctiveness, and finally, the similarity comparison is carried out on the extracted electrocardiosignal characteristic by using Euclidean distance measurement. A penalty graph is specially established based on bounded discriminant analysis of the kernel to describe the inter-class dispersion degree of the electrocardiosignals, so that the extracted low-dimensional electrocardio characteristics can simultaneously reserve the intra-class and inter-class neighborhood relationship of the electrocardiosignals. Meanwhile, aiming at the nonlinear distribution of the electrocardiosignals, a polynomial kernel function is used based on bounded discriminant analysis of kernels, the electrocardiosignals are implicitly projected to a high-dimensional space with more distinguishability, the distinguishing degree of the electrocardiosignal characteristics is further improved, and the effect of electrocardio identity recognition is improved.
Example two
The embodiment provides an electrocardiogram identity recognition system based on bounded discriminant analysis of a kernel, which comprises:
the signal acquisition module is used for acquiring the electrocardiosignals and extracting the cardiac signals of a single cycle;
the characteristic extraction module is used for implicitly projecting the heart beat to a high-dimensional space through a kernel function, mapping the heart beat signal to a low-dimensional subspace in the high-dimensional space by using bounded discriminant analysis, and extracting the low-dimensional characteristic of the heart beat signal in a single period;
the identity recognition module is used for searching the most similar template from the template database based on the Euclidean distance and outputting the user corresponding to the most similar template as the user to be recognized; the template database stores a single-cycle heart beat signal template and a corresponding user thereof.
Each module in the electrocardiogram identification system based on the bounded discriminant analysis of the kernel according to this embodiment corresponds to each step in the electrocardiogram identification method based on the bounded discriminant analysis of the kernel according to the first embodiment one to one, and the specific implementation process is the same, and will not be described here again.
EXAMPLE III
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method for cardiac electrical identity recognition based on bounded discriminative analysis of kernels as described above.
Example four
The embodiment provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to realize the steps in the electrocardio identity recognition method based on the bounded discrimination analysis of the kernel as described above.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.