Summary of the invention
In view of this, the embodiment of the present application provides a kind of atrial fibrillation detection method, device and equipment, to solve the prior art
In due to heart-rate variability limitation of the method by its information content, the problem of precision is generally difficult to meet demand.
The first aspect of the embodiment of the present application provides a kind of atrial fibrillation detection method, and the atrial fibrillation detection method includes:
Extract heartbeat waveform relevant to RR interphase;
Continuous wavelet transform is carried out to the heartbeat waveform, reconstructs the time-frequency spectrum tensor of heartbeat waveform;
The depth convolutional neural networks completed by training carry out feature learning to the time-frequency spectrum system structure of heartbeat waveform
And classification, obtain the testing result of the heartbeat waveform.
With reference to first aspect, in the first possible implementation of first aspect, the extraction is relevant to RR interphase
The step of heartbeat waveform includes:
The R wave wave crest in electrocardiosignal is detected by Pan's Tompkins Pan-Tompkins algorithm;
According to R wave crest location, heartbeat waveform list is intercepted.
The possible implementation of with reference to first aspect the first, in second of possible implementation of first aspect, institute
In the step of stating according to R wave crest location, intercepting heartbeat waveform list, for i-th heartbeat, the initial position (S of waveformi)
With final position (Ei) calculation formula it is as follows:
Ri indicates the position (sampled point) of i-th of the R wave wave crest detected in the signal, and the value range of i is 2 to N-1,
N is the R wave wave crest sum detected.
With reference to first aspect, described that the heartbeat waveform is carried out in the third possible implementation of first aspect
Continuous wavelet transform, the step of reconstructing the time-frequency spectrum tensor of heartbeat waveform include:
Utilize continuous wavelet transform formulaObtain each heartbeat
The two-dimentional time-frequency spectrum of waveform, wherein a and b is respectively scale factor and shift factor, and f (t) is the signal of output, and Ψ is small echo
Basic function;
The time-frequency spectrum of acquisition is zoomed into uniform sizes;
The time-frequency spectrum of continuous multiple heartbeat waveforms is superposed to a three-dimensional tensor in order, three of them dimension is followed successively by frequency
Rate, time and heart sequence.
With reference to first aspect, related to RR interphase in the extraction in the 4th kind of possible implementation of first aspect
Heartbeat waveform the step of before, the method also includes:
Signal is smoothed using rolling average counting method, removes the baseline drift signal in electrocardiosignal;
Utilize the noise in soft-threshold Wavelet noise-eliminating method removal electrocardiosignal.
The second aspect of the embodiment of the present application provides a kind of atrial fibrillation detection device, and the atrial fibrillation detection device includes:
Heartbeat waveform extraction unit, for extracting heartbeat waveform relevant to RR interphase;
Time-frequency spectrum tensor reconfiguration unit reconstructs heartbeat waveform for carrying out continuous wavelet transform to the heartbeat waveform
Time-frequency spectrum tensor;
Learning classification unit, for the depth convolutional neural networks by training completion to the time-frequency spectra system of heartbeat waveform
Structure carries out feature learning and classification, obtains the testing result of the heartbeat waveform.
In conjunction with second aspect, in the first possible implementation of second aspect, the heartbeat waveform extraction unit packet
It includes:
Wave crest detection sub-unit, for detecting the R wave in electrocardiosignal by Pan's Tompkins Pan-Tompkins algorithm
Wave crest;
Waveform list interception unit, for intercepting heartbeat waveform list according to R wave crest location.
In conjunction with second aspect, in second of possible implementation of second aspect, the time-frequency spectrum tensor reconfiguration unit
Include:
Subelement is converted, for utilizing continuous wavelet transform formula
The two-dimentional time-frequency spectrum of each heartbeat waveform is obtained,
In, a and b are respectively scale factor and shift factor, and f (t) is the signal of output, and Ψ is wavelet basis function;
Subelement is scaled, for the time-frequency spectrum of acquisition to be zoomed to uniform sizes;
It is superimposed subelement, for the time-frequency spectrum of continuous multiple heartbeat waveforms to be superposed to a three-dimensional tensor in order,
Three dimensions are followed successively by frequency, time and heart sequence.
The third aspect of the embodiment of the present application provides a kind of atrial fibrillation detection device, including memory, processor and deposits
Store up the computer program that can be run in the memory and on the processor, which is characterized in that the processor executes
It is realized when the computer program as described in any one of first aspect the step of atrial fibrillation detection method.
The fourth aspect of the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage
Media storage has computer program, and the atrial fibrillation as described in any one of first aspect is realized when the computer program is executed by processor
The step of detection method.
Existing beneficial effect is the embodiment of the present application compared with prior art: the application utilizes related to adjacent R R interphase
Heartbeat waveform so that the heartbeat waveform of interception can not only embody the morphological feature of electrocardiogram, but also also reflect between RR
The changing rule of phase, thus can reflect the movable correlation properties of atrium and ventricle simultaneously;Using continuous wavelet transform to heartbeat
Waveform processing obtains time-frequency spectrum tensor, can significantly more embody signal characteristic compared to one-dimensional electrocardiosignal;Using depth
Convolutional neural networks carry out feature learning and classification to heartbeat waveform time-frequency spectrum tensor, avoid conventional method in feature extraction
Workload and one-sidedness, for new type training sample have stronger adaptability, thus facilitate promoted nicety of grading.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific
The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
In order to illustrate technical solution described herein, the following is a description of specific embodiments.
It is as shown in Figure 1 the implementation process schematic diagram of atrial fibrillation detection method described in the embodiment of the present application, details are as follows:
In step s101, heartbeat waveform relevant to RR interphase is extracted;
Specifically, the step of extraction heartbeat waveform relevant to RR interphase, may include:
1011, it can use the R wave wave crest in Pan's Tompkins Pan-Tompkins algorithm detection signal.If signal heads
There is the huge spike for being significantly higher than normal R wave wave crest in portion, then will lead to subsequent wave crest can not be detected.It is asked to solve this
Topic, the R wave wave crest number that can be will test is compared with scheduled a certain threshold value, if it is greater than or equal to this threshold value,
Then show to detect successfully;If it is less than this threshold value, then show to receive the interference of head spike, then the starting point that will test to
After put off a distance and repeat above-mentioned detection and judgement, until the R wave wave crest number detected reaches threshold value, or detection rises
Point is postponed to signal end.
1012, according to R wave crest location, intercept heartbeat waveform list.For detecting i-th heartbeat in a bars,
Its waveform initial position (Si) and final position (Ei) calculation formula it is as follows:
Wherein, Ri indicates the position (sampled point) of i-th of the R wave wave crest detected in the signal, and the value range of i is 2
It is the R wave wave crest sum detected to N-1, N.
It follows that the range of heartbeat waveform is determined by the numerical value of two RR interphases adjacent thereto.If previous RR
Interphase is less than the latter RR interphase, then the position of R wave wave crest will be located at its preceding 1/3 part in the heartbeat waveform;Conversely, then R
It the position of wave wave crest will be positioned at thereafter 1/3 part.If the numerical value of two RR interphases is equal, R wave wave crest is located at heartbeat wave
On first 1/3 cut-point of shape.Therefore, which can reflect the change information of RR interphase in signal.
It is as shown in Figure 2 that heartbeat waveform intercepts effect.
Certainly, as in the application preferably a kind of embodiment, in the step for extracting heartbeat waveform relevant to RR interphase
Before rapid, it can also include the steps that being filtered electrocardiosignal, specifically include:
1001, signal is smoothed using rolling average counting method, removes the baseline drift letter in electrocardiosignal
Number;
1002, utilize the noise in soft-threshold Wavelet noise-eliminating method removal electrocardiosignal.
Wherein, using in the baseline drift signal in method of moving average removal electrocardiosignal, it is 0.5 second that floating window, which can be used,
Rolling average counting method signal be smoothed.Then, the signal after subtracting smoothing processing with original signal is removed
The signal of baseline drift.
It can use the noise in soft-threshold Wavelet noise-eliminating method removal electrocardiosignal, the wavelet basis function used can be
Sym8 (small wave system's small echo of serial number 8), the number of plies of decomposition are 5 layers.
By the baseline drift in removal electrocardiosignal, and use making an uproar in Wavelet noise-eliminating method removal electrocardiosignal
Sound, available smooth electrocardiosignal.
In step s 102, continuous wavelet transform is carried out to the heartbeat waveform, reconstructs the time-frequency spectrum tensor of heartbeat waveform;
Specifically, can use the two-dimentional time-frequency spectrum that continuous wavelet transform formula obtains each jete waveform, wavelet transformation
Formula is as follows:
Wherein, a and b is respectively scale factor and shift factor, and f (t) is the signal of output, and Ψ is wavelet basis function.Two
Signal characteristic may preferably be reflected compared to 1 dimensional signal by tieing up time-frequency spectrum.Heartbeat waveform and continuous wavelet transform as shown in Figure 3
Effect diagram.
It, can be by acquisition in order to reduce time-frequency spectrum size to reduce the calculation amount of model training process and EMS memory occupation amount
Time-frequency spectrum zooms to uniform sizes, such as 64 × 64.
Furthermore it is also possible to the time-frequency spectrum of continuous multiple heartbeat waveforms is superposed to a three-dimensional tensor in sequence, than
The time-frequency spectrum of continuous 5 heartbeat waveforms is such as superposed to a three-dimensional tensor in sequence.Three of them dimension can be successively frequency
Rate, time and heart sequence.Using such tensor as the input of subsequent classifier, it can detecte the tensor and correspond to time interval
Inside whether atrial fibrillation has occurred.
In step s 103, by the depth convolutional neural networks of training completion to the time-frequency spectrum system structure of heartbeat waveform
Feature learning and classification are carried out, the testing result of the heartbeat waveform is obtained.
Specifically, deep neural network provided by the embodiment of the present application, as shown in figure 4, it may include by 4 layers of convolution
The tagsort part that the characteristic extraction part and 2 layers of full articulamentum that neural network is constituted are constituted, network structure can be such as figures
Shown in 4.Each convolutional layer can respectively include 32 convolution kernels, and the convolution kernel size of the first two convolutional layer can be 10 × 10, the
The convolution kernel size of three convolutional layers can be 8 × 8, and the convolution kernel size of the 4th convolutional layer can be 4 × 4;2nd and the 3rd
Between convolutional layer, comprising a maximum pond layer between the 4th convolutional layer and the 1st full articulamentum (it is 2 × 2 that pondization, which reduces multiple)
With one Dropout layers (loss ratio 0.2);1st full articulamentum includes 256 neurons, and the second full articulamentum includes 1 mind
Through member.Activation primitive after each convolutional layer uses ReLu function, and the activation primitive of the second full articulamentum is sigmoid function (S
Shape growth curve).The objective function of model training is to intersect entropy function, and formula is as follows:
Wherein, m is the sample number in training set, and x is the input data of sample, and y is sample labeling, and θ is model parameter.Mould
Type training can use Stochastic Gradient Descent (stochastic gradient descent) optimization method, and learning rate can be
0.001, momentum can be 0.8, and weight decaying (Weight Decay) rate can be 10-6.The neural network model utilizes Keras
It is realized and is trained based on TensorFlow (tensor stream) engine.
Trained and test data may come from MIT-BIH atrial fibrillation data set.The data set is dedicated for verifying atrial fibrillation inspection
The performance of method of determining and calculating, the main electrocardiogram (ECG) data acquired from atrial fibrillation patient and normal person including 25 about 10 small durations,
Sample rate is 250Hz.Wherein, " 00735 " and " 03665 " two data is due to lacking original ECG data thus not adopted
With " 04936 " and " 05091 " two data is not also used due to the mistake existed on mark.Remaining every electrocardiographic recording
Comprising the data acquired from two leads, it only used the data of wherein the first lead during realization of the invention.Instruction
Practice collection and be taken from different electrocardiographic recordings from ecg wave form time-frequency spectrum tensor used in test set, to avoid model for few
Number case generates over-fitting.The performance of this method by its enterprising having sexual intercourse of test set quiver detection sensibility (Se) and spy
Anisotropic (Sp) is evaluated, and calculation formula is as follows:
Wherein, TP indicates that atrial fibrillation just examines sample number, and TN indicates that non-atrial fibrillation just examines sample number, and FP indicates atrial fibrillation erroneous detection sample
Number, FN indicate non-atrial fibrillation erroneous detection sample number.Test result shows that the sensibility of herein described atrial fibrillation detection method is
99.41%, specificity is 98.91%.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit
It is fixed.
Fig. 5 is a kind of structural schematic diagram of atrial fibrillation detection device provided by the embodiments of the present application, and details are as follows:
The atrial fibrillation detection device, comprising:
Heartbeat waveform extraction unit 501, for extracting heartbeat waveform relevant to RR interphase;
Time-frequency spectrum tensor reconfiguration unit 502 reconstructs heartbeat waveform for carrying out continuous wavelet transform to the heartbeat waveform
Time-frequency spectrum tensor;
Learning classification unit 503, for the depth convolutional neural networks by training completion to the time-frequency spectrum of heartbeat waveform
System structure carries out feature learning and classification, obtains the testing result of the heartbeat waveform.
Preferably, the heartbeat waveform extraction unit includes:
Wave crest detection sub-unit, for detecting the R wave in electrocardiosignal by Pan's Tompkins Pan-Tompkins algorithm
Wave crest;
Waveform list interception unit, for intercepting heartbeat waveform list according to R wave crest location.
Preferably, the time-frequency spectrum tensor reconfiguration unit includes:
Subelement is converted, for utilizing continuous wavelet transform formula
The two-dimentional time-frequency spectrum of each heartbeat waveform is obtained,
In, a and b are respectively scale factor and shift factor, and f (t) is the signal of output, and Ψ is wavelet basis function;
Subelement is scaled, for the time-frequency spectrum of acquisition to be zoomed to uniform sizes;
It is superimposed subelement, for the time-frequency spectrum of continuous multiple heartbeat waveforms to be superposed to a three-dimensional tensor in order,
Three dimensions are followed successively by frequency, time and heart sequence.
Atrial fibrillation detection device described in Fig. 5, it is corresponding with atrial fibrillation detection method described in Fig. 1.
Fig. 6 is the schematic diagram for the atrial fibrillation detection device that one embodiment of the application provides.As shown in fig. 6, the room of the embodiment
The detection device 6 that quivers includes: processor 60, memory 61 and is stored in the memory 61 and can be on the processor 60
The computer program 62 of operation, such as atrial fibrillation detect program.The processor 60 is realized when executing the computer program 62
State the step in each atrial fibrillation detection method embodiment, such as step 101 shown in FIG. 1 is to 103.Alternatively, the processor 60
The function of each module/unit in above-mentioned each Installation practice, such as module shown in Fig. 5 are realized when executing the computer program 62
501 to 503 function.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 61, and are executed by the processor 60, to complete the application.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 62 in the atrial fibrillation detection device 6 is described.For example, the computer program 62 can be with
It is divided into heartbeat waveform extraction unit, time-frequency spectrum tensor reconfiguration unit and learning classification unit, each unit concrete function is as follows:
Heartbeat waveform extraction unit, for extracting heartbeat waveform relevant to RR interphase;
Time-frequency spectrum tensor reconfiguration unit reconstructs heartbeat waveform for carrying out continuous wavelet transform to the heartbeat waveform
Time-frequency spectrum tensor;
Learning classification unit, for the depth convolutional neural networks by training completion to the time-frequency spectra system of heartbeat waveform
Structure carries out feature learning and classification, obtains the testing result of the heartbeat waveform.
The atrial fibrillation detection device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server
Equipment.The atrial fibrillation detection device may include, but be not limited only to, processor 60, memory 61.Those skilled in the art can manage
Solution, Fig. 6 is only the example of atrial fibrillation detection device 6, does not constitute the restriction to atrial fibrillation detection device 6, may include than diagram
More or fewer components perhaps combine certain components or different components, such as the atrial fibrillation detection device can also wrap
Include input-output equipment, network access equipment, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 61 can be the internal storage unit of the atrial fibrillation detection device 6, such as atrial fibrillation detection device 6
Hard disk or memory.The memory 61 is also possible to the External memory equipment of the atrial fibrillation detection device 6, such as atrial fibrillation inspection
The plug-in type hard disk being equipped on measurement equipment 6, intelligent memory card (Smart Media Card, SMC), secure digital (Secure
Digital, SD) card, flash card (Flash Card) etc..Further, the memory 61 can also both include the atrial fibrillation
The internal storage unit of detection device 6 also includes External memory equipment.The memory 61 is for storing the computer program
And other programs and data needed for the atrial fibrillation detection device.The memory 61 can be also used for temporarily storing
Output or the data that will be exported.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
In embodiment provided herein, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device
Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the application realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie
Matter may include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and
Telecommunication signal.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality
Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all
Comprising within the scope of protection of this application.