WO2020228420A1 - Denoising autoencoder training method, electrocardiography signal denoising method, and apparatuses - Google Patents

Denoising autoencoder training method, electrocardiography signal denoising method, and apparatuses Download PDF

Info

Publication number
WO2020228420A1
WO2020228420A1 PCT/CN2020/080880 CN2020080880W WO2020228420A1 WO 2020228420 A1 WO2020228420 A1 WO 2020228420A1 CN 2020080880 W CN2020080880 W CN 2020080880W WO 2020228420 A1 WO2020228420 A1 WO 2020228420A1
Authority
WO
WIPO (PCT)
Prior art keywords
ecg signal
noise
beat
signal
ecg
Prior art date
Application number
PCT/CN2020/080880
Other languages
French (fr)
Chinese (zh)
Inventor
王贵锦
黄勇锋
丁子建
张宇
Original Assignee
清华大学
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 清华大学, 华为技术有限公司 filed Critical 清华大学
Publication of WO2020228420A1 publication Critical patent/WO2020228420A1/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • A61B5/346Analysis of electrocardiograms
    • A61B5/349Detecting specific parameters of the electrocardiograph cycle
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/68Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient
    • A61B5/6801Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient specially adapted to be attached to or worn on the body surface
    • A61B5/6802Sensor mounted on worn items
    • A61B5/681Wristwatch-type devices
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7203Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7253Details of waveform analysis characterised by using transforms
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device

Definitions

  • the present invention relates to the technical field of artificial intelligence, and in particular to a method for training a noise reduction autoencoder, a method for noise reduction of an electrocardiogram signal and a device thereof.
  • ECG signals directly affects the accuracy of ECG signal diagnosis.
  • the collection of ECG signals is usually obtained through electrodes attached to the surface of the skin. Since the ECG signal on the skin is relatively weak and easily interfered by noise, the collected ECG signal contains a lot of noise, which reduces the accuracy and reliability of the ECG diagnosis.
  • the ECG collected by the wearable ECG device when the user is in a non-stationary state contains a large amount of myoelectric noise. At this time, the noise reduction processing of the ECG signal is particularly important.
  • the denoising of the ECG signal can be achieved by training a convolutional autoencoder (CAE).
  • CAE convolutional autoencoder
  • the specific training method is: a convolutional autoencoder that inputs noisy ECG signals, The convolution autoencoder processes the input noisy information signal and then outputs the predicted ECG signal, and adjusts the deconvolution auto-encoder according to the error between the predicted ECG signal and the noise-reduced ECG signal corresponding to the noisy ECG signal.
  • the parameters of the encoder cause the error to converge, and a target autoencoder capable of reducing the noise of the ECG signal is obtained, and further, the target autoencoder is used to reduce the noise of the ECG signal to be noise-reduced.
  • an embodiment of the present application provides a method for training a noise-reducing autoencoder, including: a training device superimposes a noise-free ECG signal and an EMG noise signal to obtain a synthetic ECG signal, the noise-free ECG signal including H beat ECG signal, each beat ECG signal contains a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold; using average beat subtraction Decompose the synthesized ECG signal into a reference ECG signal and a noise-containing residual ECG signal; remove the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal; further, according to the noise The residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal training noise-reducing autoencoder, where the noise-containing residual ECG signal is the training input, and the noise-free residual ECG signal corresponds to the noise-free The remaining ECG signal is the
  • the R peak position of the reference ECG signal obtained by decomposing the synthetic ECG signal using the average beat subtraction method is the same as the R peak position of the synthetic ECG signal.
  • the obtained noisy residual ECG signal and the noisy residual ECG signal corresponding to the noisy residual ECG signal form a training sample, and the specific realization of generating the training sample can also be completed by other equipment or devices before the training device.
  • the training device may receive training samples sent by the device or device that generates the training samples, which is not limited here.
  • the training equipment uses the noisy residual ECG signal as the input of the noise reduction autoencoder, and uses the noise-free residual ECG signal as the label to train the noise reduction autoencoder.
  • the training input noisy residual ECG signal is removed
  • the noise reduction autoencoder only needs to extract the encoding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the entire synthesized ECG signal.
  • Encoding representation reduces the difficulty of training, so that the trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder .
  • the training device uses average beat subtraction to decompose the synthesized ECG signal into the reference ECG signal and the noisy residual ECG signal:
  • the training device averages the W beat ECG signal in the target ECG signal to obtain the second average ECG signal.
  • the signal averaging method can remove noise. Therefore, the reference ECG signal formed above retains the obvious characteristics of the R peak position and R-R distance in the synthesized ECG signal, and does not contain noise.
  • the specific implementation of the above-mentioned second average ECG signal may be:
  • Second average ECG signal It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
  • Ak represents the ECG signal in the interval of ⁇ t taken from the left and right sides of the W-beat ECG signal with R k as the center
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1,2 whilW.
  • the second average ECG signal and the ECG signal in the ⁇ t interval may include V sampling points, where V is a positive integer greater than 1, and the signal average can be determined by the formula To calculate, Is the second average ECG signal
  • the value of the v-th sampling point in the W beat ECG signal segment, A k (v) is the value of the v-th sampling point in the ECG signal in the ⁇ t interval in the W beat ECG signal segment with R k as the center, 1 ⁇ v ⁇ V, 1 ⁇ k ⁇ W, v and k are positive integers.
  • the second average ECG signal It is obtained by averaging the W beat ECG signal in the synthetic ECG signal, for different synthetic ECG signals, the obtained second average ECG signal is different, and then obtained by the second average ECG signal
  • the reference ECG signal is also different.
  • the reference ECG signal is adaptively selected for different synthetic ECG signals, and the obtained reference ECG signal can extract the obvious characteristics of the synthetic ECG signal, so that the target noise reduction autoencoder obtained by training It can adapt to different ECG signals, thereby improving the noise reduction performance of the target noise reduction autoencoder.
  • signal averaging can reduce the noise of the ECG signal.
  • the second average ECG signal is a one-beat ECG signal after noise reduction processing.
  • the reference ECG signal obtained from the second average ECG signal can be considered to contain no EMG noise, and the average amplitude of the R peak of the target ECG signal is retained, and the reference ECG signal obtained above is for a specific
  • the synthetic ECG signal is generated, which can more accurately represent the obvious characteristics of the synthetic ECG signal.
  • Average ECG signal in the second It is obtained by averaging the W beat ECG signal in the noiseless ECG signal. Since the synthetic ECG signal is synthesized by the noise-free ECG signal and the noise signal, the noise-free ECG signal has the same characteristics as the R peak position and RR distance of the synthesized ECG signal, so it is combined with the synthesized ECG signal. Compared with the second average ECG signal obtained by averaging, the second average ECG signal obtained by averaging the noiseless ECG signal has less noise and EMG noise, and then more EMG noise is retained to contain noise In the remaining ECG signal, the trained target noise reduction autoencoder can learn the noise reduction function for this part of the EMG noise.
  • Average ECG signal in the second It is obtained by averaging the W-beat ECG signals from the historically collected ECG signals of the first user. For the ECG signal of the same user, the same second average ECG signal is used.
  • the reference ECG signal generated by the second average ECG signal obtained in this way takes into account individual differences, so that the reference ECG signal can more accurately represent the obvious characteristics of the synthesized ECG signal. For the reference ECG signal obtained by the same user, only A calculation is required to improve calculation efficiency.
  • the training equipment can detect the R peak of each beat of the ECG signal in the target ECG signal (that is, the apex of the R wave) in the W beat ECG signal, and the R peak is the sampling point with the largest energy value in the one beat ECG signal ; Perform average processing on the W-beat ECG signal in the target ECG signal to obtain the second average ECG signal, W ⁇ H, W is a positive integer; Replace the H-beat ECG signal in the synthesized ECG signal with the second average ECG signal A j corresponding to the signal, the reference ECG signal is obtained, A j represents the ECG signal in the interval obtained by taking R j as the reference in the H-beat ECG signal, taking ⁇ t1 on the left and taking ⁇ t2 on the right, and R j is the W-beat ECG
  • the apex of the QRS complex in the signal, j 1, 2...H, and then remove the reference ECG signal to be noise-reduced from the synthesized ECG signal to obtain the noisy residual ECG
  • the R peak of the second average ECG signal obtained includes the ECG signal of ⁇ t1 on the left and the ECG signal of ⁇ t2 on the right.
  • the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, Or the historically collected ECG signals from the first user (that is, the user whose noise-free ECG signals are collected).
  • a specific implementation of the second average ECG signal may be to select the ECG signal in the interval obtained by taking the left ⁇ t1 and the right taking ⁇ t2 based on the R peak for each beat of the W beat ECG signal, and obtain W ECG signal segments. Furthermore, the W ECG signal segments are averaged to obtain a second average ECG signal.
  • each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, W ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure that the W ECG signal segments are aligned.
  • the selected W ECG signal segments all include V sampling points, where the R peaks are all located at the Z-th sampling point, V and Z are integers greater than 1, and Z is less than V.
  • C k represents the ECG signal in the interval obtained by taking R k as the reference ⁇ t1 and ⁇ t2 in the W-beat ECG signal
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1, 2 ...W.
  • Ak represents the ECG signal in the interval of ⁇ t taken from the left and right sides of the W-beat ECG signal with R k as the center
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1,2 whilW.
  • the second average ECG signal and the ECG signal in the ⁇ t interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
  • C k (v) is the value of the v-th sampling point in the ECG signal in the interval obtained by taking R k as the reference ⁇ t1 in the W beat ECG signal, 1 ⁇ v ⁇ V, 1 ⁇ k ⁇ W, v and k are positive integers.
  • the training device can divide the W-beat ECG signal from the target ECG signal, and then detect the R peak of each beat of the ECG signal in the W-beat ECG signal,
  • the R peak is the sampling point with the largest amplitude in the one-beat ECG signal; furthermore, the W-beat ECG signal is aligned based on the R peak.
  • the number of sampling points at each position is not Is greater than W, and then the aligned W beat ECG signals are averaged to obtain a second average ECG signal.
  • the position of the R peak in the divided N-beat ECG signal may be different, and the length of the N-beat ECG signal may be the same or different.
  • Average ECG signal The value of the v-th sampling point in can be expressed as: among them, Average ECG signal
  • D k (v) is the value of the sampling point at position v in the W-beat ECG signal with R k as the location, 1 ⁇ v ⁇ V, 1 ⁇ k ⁇ W, v and k are positive integers. If there is no sampling point distribution at position v in the ECG signal D k , then D k (v) is zero.
  • the embodiment of the present application also provides an ECG signal noise reduction method, including: the training device superimposes the noiseless ECG signal and the EMG noise signal to obtain a synthetic ECG signal, wherein the noiseless ECG signal
  • the signal-to-noise ratio (SNR) of the medium myoelectric noise is not less than the first threshold.
  • the noise-free ECG signal may include multi-beat ECG signals, H-beat ECG signals, and each ECG signal includes a QRS Wave group, H is an integer greater than 1; use average beat subtraction to decompose the noiseless ECG signal into the reference ECG signal and the noiseless residual ECG signal; remove the reference ECG signal from the synthesized ECG signal to obtain the noise The residual ECG signal; further, the noise-reducing autoencoder is trained according to the noisy residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal, wherein the noisy residual ECG signal is the training input, the The noise-free residual ECG signal corresponding to the noisy residual ECG signal is the training label.
  • the R peak position of the reference ECG signal obtained by decomposing the synthetic ECG signal using the average beat subtraction method is the same as the R peak position of the synthetic ECG signal.
  • the obtained noisy residual ECG signal and the noisy residual ECG signal corresponding to the noisy residual ECG signal form a training sample, and the specific realization of generating the training sample can also be completed by other equipment or devices before the training device.
  • the training device may receive training samples sent by the device or device that generates the training samples, which is not limited here.
  • the training equipment uses the noisy residual ECG signal as the input of the noise reduction autoencoder, and uses the noise-free residual ECG signal as the label to train the noise reduction autoencoder.
  • the training input noisy residual ECG signal is removed
  • the noise reduction autoencoder only needs to extract the encoding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the entire synthesized ECG signal.
  • Encoding representation reduces the difficulty of training, so that the trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder .
  • the specific implementation method of decomposing the noise-free ECG signal into the reference ECG signal and the noise-free residual ECG signal using the average beat subtraction method can be referred to in the first aspect above, using the average beat subtraction method to decompose the noise-free ECG signal into the reference ECG signal.
  • the related description in the signal and the noise-free residual ECG signal will not be repeated here.
  • an embodiment of the present application also provides an ECG signal denoising method, including: executing a device to obtain an ECG signal to be denoised.
  • the ECG signal to be denoised includes M beats of the ECG signal.
  • the signal contains a QRS complex, and M is a positive integer greater than 1.
  • Use average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised;
  • the remaining ECG signal to be denoised is input into the target noise reduction autoencoder to obtain the denoised residual ECG signal; the denoised reference ECG signal and the denoised residual ECG signal are superimposed to obtain the denoised heart electric signal.
  • calculation method of the reference ECG signal to be denoised is the same as the calculation method of the reference ECG signal involved in the target denoising autoencoder obtained by training.
  • execution device may specifically be a wearable device such as a smart bracelet or a smart watch, a terminal such as a mobile phone, a tablet computer, and a personal computer, or a server, a cloud, and the like.
  • the reference ECG signal and the residual ECG signal after noise reduction are superimposed to obtain the noise-reduced ECG signal, which can better retain the obvious characteristics of the R peak position and RR interval in the ECG signal to be noise-reduced, and reduce the noise after noise reduction. Distortion of the ECG signal.
  • the above-mentioned target noise reduction autoencoder may be obtained through the training method of the noise reduction autoencoder in the first aspect or the second aspect.
  • the specific training method refer to the related description in the above-mentioned first aspect, which is not repeated in the embodiment of the present application.
  • the target noise reduction autoencoder used for noise reduction uses the noisy residual ECG signal obtained after removing the reference ECG signal from the synthetic ECG signal as the input of the noise reduction autoencoder, and the noiseless ECG signal The noise-free residual ECG signal obtained after the reference ECG signal is removed is used as the label, and the noise reduction autoencoder is trained.
  • the noisy residual ECG signal input for training removes the obvious features in the synthetic ECG signal ( For example, R peak position, RR interval)
  • the noise reduction autoencoder only needs to extract the coding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the coding representation of the entire synthesized ECG signal, thereby reducing the difficulty of training, making
  • the trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder.
  • the execution device may be a wearable device or terminal equipped with an ECG sensor, such as a smart bracelet, smart watch, etc. At this time, the execution device obtains a specific realization of the ECG signal to be noise-reduced It may be: the execution device collects the analog ECG signal on the surface of the user's skin through the ECG sensor; further, the analog ECG signal is processed through the digital-to-analog conversion module to obtain the digital ECG signal to be denoised.
  • the execution device may be a server or a terminal, etc.
  • a specific implementation for the execution device to obtain the ECG signal to be noise-reduced may be: the execution device receives the noise-reduction sent by the ECG acquisition device ECG signal.
  • the ECG acquisition device may be a wearable device or a terminal equipped with an ECG sensor.
  • the execution device uses average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the first realization of the remaining ECG signal to be denoised.
  • the signal averaging method can remove noise. Therefore, the above-mentioned reference ECG signal to be denoised retains the R peak position and R-R distance in the ECG signal to be denoised and does not contain noise.
  • First average ECG signal It is obtained by averaging the N-beat ECG signal in the ECG signal to be noise-reduced, namely:
  • the obtained first average ECG signals are different, and the reference ECG signals obtained from the first average ECG signals are also different.
  • the reference ECG signal is adaptively selected for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, thereby reducing
  • the noisy ECG signal can better retain the obvious features of the ECG signal to be denoised, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
  • First average ECG signal It is obtained by averaging the N-beat ECG signals from the historically collected ECG signals of the second user (the user whose ECG signals to be denoised is collected).
  • the specific calculation method is the same as that of the above-mentioned first average electrocardiogram signal implementation manner 1, please refer to the related description in the above-mentioned implementation manner 1, which will not be repeated here.
  • the same first average ECG signal is used.
  • the implementation manner 5 obtains the reference ECG signal to be denoised generated by the first average ECG signal, taking into account individual differences, so that the reference ECG signal to be denoised can more accurately represent the obvious characteristics of the ECG signal to be denoised, relatively
  • the reference ECG signal to be noise-reduced obtained by the same user only one calculation is required, which improves the calculation efficiency.
  • the execution device uses average beat subtraction to decompose the ECG signal to be noise-reduced into the reference ECG signal to be noise-reduced and the second implementation of the remaining ECG signal to be noise-reduced Can be:
  • the above-mentioned method uses the average beat subtraction method to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised.
  • B i represents the M beat ECG signal with R j as the reference ⁇ t1 Take the ECG signal in the interval obtained by ⁇ t2 on the right
  • Ak represents the ECG signal in the interval obtained by taking R k as the reference in the W beat ECG signal, ⁇ t1 and take the ECG signal in the interval obtained by taking ⁇ t2 on the right
  • R k is the QRS wave in the W beat ECG signal
  • k 1, 2...W.
  • the specific calculation method of the second average electrocardiogram signal is the same as the calculation method of the second average electrocardiogram signal described in the first implementation. You can refer to the related description in the first implementation above, and will not be repeated here.
  • an embodiment of the present application also provides a training device for noise reduction and self-encoding, and the device includes a module for executing the method in the first aspect.
  • a training device for noise reduction and self-encoding includes: a memory for storing a program; a processor for executing a program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute The method in the first aspect.
  • an embodiment of the present application also provides a training device for noise reduction and self-encoding, which includes a module for executing the method in the second aspect.
  • a training device for noise reduction and self-encoding includes: a memory for storing programs; a processor for executing programs stored in the memory, and when the programs stored in the memory are executed, the processor is configured to execute The method in the second aspect.
  • an embodiment of the present application also provides an electrocardiographic signal noise reduction device, which includes a module for executing the method in the third aspect.
  • an electrocardiographic signal noise reduction device in a ninth aspect, includes: a memory for storing a program; a processor for executing a program stored in the memory. When the program stored in the memory is executed, the processor is configured to execute the first The method in three aspects.
  • a computer-readable medium stores program code for device execution, and the program code includes the method for executing the method in the first aspect.
  • a computer program product containing instructions is provided, when the computer program product runs on a computer, the computer executes the method in the first aspect.
  • a computer-readable medium stores program code for device execution, and the program code includes a method for executing the method in the second aspect.
  • a computer program product containing instructions which when the computer program product runs on a computer, causes the computer to execute the method in the above second aspect.
  • a computer-readable medium stores program code for device execution, and the program code includes the method for executing the method in the third aspect.
  • a computer program product containing instructions which when the computer program product runs on a computer, causes the computer to execute the method in the third aspect.
  • a chip in a sixteenth aspect, includes a processor and a data interface.
  • the processor reads instructions stored in a memory through the data interface, and executes the method in the first aspect.
  • the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory.
  • the processor is used to execute the method in the first aspect.
  • a chip in a seventeenth aspect, includes a processor and a data interface.
  • the processor reads instructions stored in a memory through the data interface and executes the method in the second aspect.
  • the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory.
  • the processor is used to execute the method in the second aspect.
  • a chip in an eighteenth aspect, includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface, and executes the method in the third aspect.
  • the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory.
  • the processor is used to execute the method in the third aspect.
  • an electronic device which includes the noise reduction self-encoding training device in any one of the foregoing fourth to fifth aspects.
  • an electronic device including the noise reduction self-encoding training device in any one of the above-mentioned sixth to seventh aspects.
  • an electronic device which includes the electrocardiographic signal noise reduction device in any one of the eighth to ninth aspects.
  • FIG. 1A is a schematic flowchart of an automatic analysis process of an ECG signal provided by an embodiment of the present invention
  • Fig. 3 is a schematic diagram of the principle of a self-encoder provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a system framework provided by an embodiment of the present invention.
  • Figure 5 is a network structure diagram of a noise reduction autoencoder provided by an embodiment of the present invention.
  • Figure 6 is a schematic diagram of a chip hardware structure provided by an embodiment of the present invention.
  • FIG. 7A is a schematic flowchart of a training method for a noise reduction autoencoder according to an embodiment of the present invention.
  • FIG. 7C is a schematic diagram of the principle of calculating a reference ECG signal according to an embodiment of the present invention.
  • FIG. 7D is a schematic flowchart of another method for training a noise reduction autoencoder according to an embodiment of the present invention.
  • FIG. 8A is a schematic flowchart of a method for reducing noise of an ECG signal according to an embodiment of the present invention.
  • FIG. 8B is a schematic explanatory diagram of an ECG signal noise reduction method provided by an embodiment of the present invention.
  • FIG. 8C is a schematic diagram of a principle of calculating a reference ECG signal to be denoised according to an embodiment of the present invention.
  • 8D is a schematic explanatory diagram of a noise reduction result of an ECG signal of a target noise reduction autoencoder according to an embodiment of the present invention.
  • FIG. 9A is a schematic block diagram of a training device for a noise reduction autoencoder according to an embodiment of the present invention.
  • FIG. 9B is a schematic block diagram of another apparatus for training a noise reduction autoencoder according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of the hardware structure of a training device for a noise reduction autoencoder provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of the hardware structure of an electrocardiographic signal noise reduction device provided by an embodiment of the present application.
  • the ECG signal noise reduction method provided in the embodiments of the present application can be applied to scenarios such as ECG signal analysis, identification, and diagnosis.
  • the ECG signal noise reduction method of the embodiment of the present application can be applied in the following scenarios:
  • FIG. 1A a schematic flow diagram of the automatic analysis process of the ECG signal.
  • the automatic analysis of the ECG signal mainly includes two processing processes, namely the noise reduction of the ECG signal and the analysis of the ECG signal after the noise reduction.
  • the ECG signal noise reduction method provided in the embodiments of the present application can be applied to the noise reduction process of the ECG signal.
  • the ECG noise reduction method provided by the embodiments of the present application first uses the average beat subtraction method to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the noise-containing residual ECG signal, that is, first according to the ECG to be denoised
  • the signal obtains a reference ECG signal that retains obvious features such as the R peak position and RR interval of the ECG signal to be denoised (that is, the reference ECG signal to be denoised in the embodiment of this application), and then obtains the reference ECG signal to be denoised
  • the reference ECG signal is removed from the system to obtain the remaining ECG signal to be denoised.
  • the remaining ECG signal to be denoised is input to the target noise reduction autoencoder, and the target noise reduction autoencoder
  • the ECG signal undergoes noise reduction processing to obtain the noise-reduced residual ECG signal, and then the noise-reduced residual ECG signal is added to the reference ECG signal to be noise-reduced (also referred to as "superposition" in this article)
  • the obtained ECG signal is the ECG signal after the noise reduction of the ECG signal to be reduced.
  • the target denoising autoencoder is a trained neural network.
  • the target denoising autoencoder is obtained by training an initialized denoising autoencoder through multiple training samples.
  • the training samples include noisy residual ECG signals and The noise-free residual ECG signal corresponding to the noisy residual ECG signal, where the noise-containing residual ECG signal is the signal obtained after removing the reference ECG signal from the synthesized ECG signal, and the synthesized ECG signal is the noise-free residual ECG signal.
  • the signal superimposed with the EMG noise signal, the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal is the signal obtained by removing the reference ECG signal from the noise-free ECG signal.
  • the reference ECG signal is extracted from the synthetic ECG signal or the noise-free ECG signal, and the obvious features such as the R peak position and R-R interval of the synthetic ECG signal are retained.
  • the denoised ECG signal can be analyzed.
  • the specific analysis process can be: Identify the characteristic points of the denoised ECG signal, and then identify the Input the feature points of the into the feature diagnosis model, and predict the diagnosis result of the denoised ECG signal through the feature diagnosis model based on the identified feature points.
  • the feature diagnosis model is a trained machine learning model, and the feature diagnosis The model takes the characteristic points of the ECG signal as input, and the true diagnosis result of the ECG signal is the machine learning model obtained by label training. It should be understood that the identification of the characteristic points of the ECG signal is not a necessary step in the analysis process of the ECG signal.
  • the ECG signal can also be input to the signal diagnosis model, and the signal diagnosis model Directly predict the diagnosis result for the ECG signal.
  • the signal diagnosis model is a trained machine learning model.
  • the signal diagnosis model takes the ECG signal as input, and the true diagnosis result of the ECG signal is the label for training. Machine learning model.
  • ECG sensors such as smart bracelets and smart watches
  • the smart bracelet and smart watch can be equipped with an ECG sensor to collect the user's ECG data.
  • the smart watch in the first embodiment of the present application is described as an example.
  • an ECG sensor includes two electrodes for collecting ECG signals.
  • the smart watch 11 may include one electrode 111 of the electrocardiogram sensor disposed on the back of the smart watch 11, and the other electrode 112 is disposed on the side of the smart watch 11.
  • the smart watch 11 may include a digital-to-analog conversion module 113.
  • the digital-to-analog conversion module 113 can perform analog-to-digital conversion on the analog ECG signals collected through the electrodes 111 and 112 to obtain discrete digital ECG signals.
  • the processing module inside the smart watch 11 can use the digitized ECG signal as the ECG signal to be noise-reduced by applying the ECG noise reduction method in the embodiment of the present application for noise reduction processing to obtain the noise-reduced ECG signal.
  • the smart watch 11 or the smart bracelet 12 can also analyze the noise-reduced ECG signal to obtain the analysis result. Further, the smart watch 11 or the smart bracelet 12 can also output the analysis result through an output device, such as a display, a loudspeaker, and the like.
  • an output device such as a display, a loudspeaker, and the like.
  • the smart watch 11 or smart bracelet 12 can also send the ECG signal to be noise-reduced to the terminal or server bound to it, and the terminal or server applies the ECG noise-reduction method in the embodiments of this application to perform the noise-reduction ECG signal Noise reduction processing to obtain the ECG signal after noise reduction.
  • the terminal or the server can send the noise-reduced ECG signal to the smart watch 11 or the smart bracelet 12, or send an analysis result obtained by analyzing the noise-reduced ECG signal.
  • the smart watch 11 or smart bracelet 12 equipped with an ECG sensor can monitor the wearer's ECG data in real time to monitor the wearer's physical condition.
  • the training method of the noise-reducing autoencoder provided by the embodiment of the application involves data processing, and can be specifically applied to data processing methods such as data training, machine rest, and deep learning.
  • data processing methods such as data training, machine rest, and deep learning.
  • the noise-free residual ECG signal corresponding to the noisy residual ECG signal performs symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc., and finally obtains the target noise reduction autoencoder; and, this application
  • the ECG signal noise reduction method provided by the embodiment can use the above-mentioned target noise reduction autoencoder to convert the input data (such as the residual ECG signal to be denoised obtained after removing the reference ECG signal from the ECG signal to be denoised in this application) ) Is input to the target noise reduction autoencoder to obtain output data (such as the residual ECG signal after noise reduction in this application).
  • the training method for the denoising autoencoder and the method for denoising the ECG signal provided by the embodiments of this application are inventions based on the same concept, and can also be understood as two parts in a system, or a whole Two stages of the process: such as model training stage and model application stage.
  • Electrocardiography also known as electrocardiogram, records the bioelectric signals generated during the contraction and relaxation of the heart. Each time the heart completes a complete electrical activity, it corresponds to an ECG waveform as shown in Figure 2, including P wave, QRS wave group (including Q wave, R wave and S wave) and T wave. Among them, the first wave on the ECG that deviates from the baseline in the positive direction is the P wave, and the second waveband is the QRS complex.
  • the QRS complex consists of a series of 3 deviations, reflecting the currents related to the depolarization of the left and right ventricles.
  • the first negative deviation in the QRS complex is called the Q wave
  • the first positive deviation in the QRS complex is called the R wave
  • the negative deviation after the R wave is called the S wave.
  • the round and blunt waveform at the top that appears after the QRS complex is the T wave, which represents the state of ventricular repolarization.
  • a complete waveform including the above-mentioned waves is called a beat.
  • the reference ECG signal includes obvious features such as the R peak position and RR interval in the ECG signal.
  • the reference ECG signal may include at least QRS complex. It is understandable that the reference ECG signal includes the characteristics of the part of the ECG signal, usually Obvious features that are easier to extract, such as R peak position, average R peak amplitude, etc. In the embodiment of the present application, the R peak position in the ECG signal is the same as the R peak position in the reference ECG signal corresponding to the ECG signal.
  • the remaining ECG signal After removing the reference ECG signal corresponding to the ECG signal from the ECG signal, the remaining ECG signal is obtained. Since the reference ECG signal includes the obvious features of the ECG signal, the remaining ECG signal includes the hidden features that are not easy to extract from the ECG signal, also known as the detailed features.
  • EMG noise also known as EMG noise signal
  • MUAP motor unit action potential
  • Signal averaging is a method to eliminate random interference by using the determinism (repeatability) of the signal and the randomness of noise.
  • Signal averaging refers to the technology of superimposing signals and then averaging them. In order to avoid signal distortion after superposition, the signals must be strictly aligned during superposition.
  • the averaged multiple ECG signals or multiple ECG signal segments are aligned based on the R peak, that is, the average multiple ECG signals or multiple ECG signal segments are based on the R peak Aligned.
  • a neural network can be composed of neural units.
  • a neural unit can refer to an arithmetic unit that takes xs and intercept 1 as inputs.
  • the output of the arithmetic unit can be:
  • s 1, 2,...n, n is a natural number greater than 1
  • W s is the weight of x s
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal.
  • the output signal of the activation function can be used as the input of the next convolutional layer.
  • the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected with the local receptive field of the previous layer to extract the characteristics of the local receptive field.
  • the local receptive field can be a region composed of several neural units.
  • Deep neural network deep neural network, DNN
  • Deep neural network also called multilayer neural network
  • DNN can be understood as a neural network with many hidden layers. There is no special metric for "many" here.
  • the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer.
  • the first layer is the input layer
  • the last layer is the output layer
  • the number of layers in the middle are all hidden layers.
  • the layers are fully connected, that is to say, any neuron in the i-th layer must be connected to any neuron in the i+1th layer.
  • DNN looks complicated, it is not complicated in terms of the work of each layer.
  • the coefficient from the kth neuron of the L-1th layer to the jth neuron of the Lth layer is defined as It should be noted that the input layer has no W parameter.
  • more hidden layers make the network more capable of portraying complex situations in the real world. Theoretically speaking, a model with more parameters is more complex and has a greater "capacity", which means it can complete more complex learning tasks.
  • Training a deep neural network is also a process of learning a weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (a weight matrix formed by vectors W of many layers).
  • Autoencoders are a type of neural network designed to copy their input to the output. It is used to do such a thing, that is to make the output as much as possible to simulate the input, so as to find the compressed representation of the input.
  • the schematic diagram of the self-encoder shown in Figure 3 the self-encoder includes an encoder and a decoder, that is, the mapping between the input layer and the intermediate layer is called encoding, and the intermediate layer and the output layer (also called the reconstruction layer) The mapping between is called decoding.
  • the encoder compresses the input into a latent space representation (also referred to as an encoding representation in this application), and the encoding function can be used
  • W is The weight of
  • b is the bias of the neural unit
  • f( ⁇ ) is the activation function of the encoder
  • the decoder aims to reconstruct the input from the latent space representation, you can use the decoding function Get it for the decoder.
  • W′ is The weight of
  • b′ is the bias of the neural unit
  • g( ⁇ ) is the activation function of the neural unit of the decoder
  • the decoder reconstructs
  • the training of the autoencoder reduces the reconstruction error of the autoencoder by optimizing the parameters W, W′, b, b′, that is, reducing with The difference between.
  • the parameters are optimized, if the output is reconstructed With input Very close, then it can be considered that the latent space represents Caught
  • the effective characteristics of is The effective compression representation can achieve the purpose of data dimensionality reduction and feature extraction. Data visualization and data noise reduction are two main application scenarios of autoencoders.
  • the noise-reducing autoencoder For the autoencoder, optimization and training can only make the output of the autoencoder close to the input, and for lossy input (input containing noise), it cannot be reconstructed to obtain a lossless input.
  • the noise-reducing autoencoder is introduced.
  • the network structure of the noise-reducing autoencoder is the same as that of the autoencoder, but the training method is improved, through the damaged input ( Also called noise-containing input) to train the autoencoder to reconstruct the input.
  • Convolutional neural networks can use backpropagation (BP) algorithms to modify the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, forwarding the input signal to the output will cause error loss, and the parameters in the initial super-resolution model are updated by backpropagating the error loss information, so that the error loss is converged.
  • the backpropagation algorithm is a backpropagation motion dominated by error loss, and aims to obtain the optimal super-resolution model parameters, such as a weight matrix.
  • the ECG signal is usually a body surface bioelectric signal extracted by an ECG device through electrodes, and the acquired ECG signal is composed of multiple sampling points sorted in time.
  • the value of the sampling point is the intensity or energy value of the bioelectric signal on the body surface at the time of collection.
  • the multiple sampling points are arranged in the order of sampling time to form a data matrix (usually a row vector) to facilitate data processing of the ECG signal.
  • the ECG acquisition device is a device that collects ECG signals and analyzes ECG signals equal to the acquisition and processing of ECG signals. It can be an ECG acquisition device, an ECG machine, etc., or it can be equipped with an ECG signal. Sensors such as wearable devices or terminals.
  • an embodiment of the present invention provides a system architecture 100.
  • the data collection device 160 is used to collect data (for example, noise-free ECG signals, noise signals, etc.), and can also generate training data (also referred to as training samples in this application) based on the collected data
  • the training data includes the noisy residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal, where the noisy residual ECG signal is the result of the synthetic ECG signal removing the reference ECG signal
  • the obtained signal, the synthetic ECG signal is obtained by superimposing the noiseless ECG signal and the EMG noise signal, the noiseless ECG signal is the ECG signal without EMG noise; the noiseless residual ECG signal is the noiseless heart
  • the electrical signal is obtained by removing the reference ECG signal; the reference ECG signal is obtained by the average beat subtraction, which retains the obvious characteristics of the composite ECG signal such as the R peak position of the composite ECG signal.
  • noise-free ECG signal refers to an ECG signal that contains no or almost no EMG noise, which can be collected by an ECG acquisition device in a stationary state, but it is not excluded that the noise-free ECG signal includes such as power frequency noise. , Baseline drift or other noise, etc.
  • the data acquisition device 160 may store the training data in the database 130, and the training device 120 obtains the target noise reduction autoencoder 101 by training based on the training data maintained in the database 130.
  • the following will describe in more detail how the training device 120 obtains the target denoising autoencoder 101 based on the training data with the first embodiment.
  • the target denoising autoencoder 101 can be used to implement the ECG signal denoising method provided in the embodiments of the present application. , That is, the ECG signal to be denoised is obtained, the reference ECG signal to be denoised is obtained by the average beat subtraction method, and the reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
  • the reference ECG signal to be denoised includes the R peak position of the ECG signal to be denoised, the RR interval and the obvious characteristics of the ECG signal to be denoised.
  • the remaining ECG signal to be denoised is input to the target noise reduction autoencoder 101,
  • the residual ECG signal after noise reduction can be obtained, and the residual ECG signal after noise reduction is superimposed with the reference ECG signal to be noise-reduced to obtain the noise-reduced ECG signal.
  • the target noise reduction autoencoder 101 in the embodiment of this application may specifically be an autoencoder.
  • the target noise reduction autoencoder 101 is obtained by training an initialized noise reduction autoencoder.
  • the training data maintained in the database 130 may not all come from the collection or generation of the data collection device 160, and may also be received from other devices (for example, training devices).
  • the training device 120 may not necessarily train the target noise reduction autoencoder 101 based on the training data maintained by the database 130. It may also obtain training data from the cloud or other places for model training. The above description should not be used as Limitations of the embodiments of this application.
  • the training device 120 may also generate training data based on the noise-free ECG signal and the noise signal, and the training data may be stored in the database 130 by the training device 120, which is not limited in the embodiment of the present application.
  • the training device 120 trains the target denoising autoencoder 101 obtained by the denoising autoencoder 121 according to the training samples.
  • the target denoising autoencoder 101 can be applied to different systems or devices, as shown in FIG. 4 Device 110.
  • the execution device 110 may be a terminal, such as a mobile phone terminal, a tablet computer, a notebook computer, AR/VR, a vehicle-mounted unit, a wearable device, such as a smart bracelet, a smart watch, etc., or a server or a cloud.
  • the execution device 110 may be configured with an I/O interface 112 for data interaction with external devices.
  • the user may input data to the I/O interface 112 through the user device 140, and the input data is implemented in this application. Examples can include: ECG signal to be noise-reduced.
  • the preprocessing module 113 is configured to perform preprocessing according to the input data (such as the ECG signal to be denoised) received by the I/O interface 112. In the embodiment of the present application, the preprocessing module 113 can be used to generate the to be denoised The reference ECG signal and the reference ECG signal to be denoised from the residual ECG signal to be denoised are removed to obtain the residual ECG signal to be denoised.
  • the signal superposition module 114 is used to add the noise-reduced reference ECG signal obtained by the preprocessing module 113 and the noise-reduced residual ECG signal output by the target noise-reduction autoencoder 101 to obtain the noise-reduced ECG signal.
  • the execution device 110 may call data, codes, etc. in the data storage system 150 for corresponding processing .
  • the data, instructions, etc. obtained by corresponding processing may also be stored in the data storage system 150.
  • the I/O interface 112 returns the processing result, such as the target ECG signal obtained above, to the user equipment 140, so as to provide it to the user.
  • the training device 120 can generate the corresponding target noise reduction autoencoder 101 based on different training data for different targets or different tasks, and the corresponding target noise reduction autoencoder 101 can be used to achieve The above goals or completion of the above tasks, so as to provide users with the desired results.
  • the user can manually set input data, and the manual setting can be operated through the interface provided by the I/O interface 112.
  • the user equipment 140 can automatically send input data to the I/O interface 112. If the user equipment 140 is required to automatically send input data and the user's authorization is required, the user can set the corresponding authority in the user equipment 140.
  • the user can view the result output by the execution device 110 on the user device 140, and the specific presentation form may be a specific manner such as display and sound.
  • the user equipment 140 may specifically be a terminal equipped with an ECG sensor, such as a mobile phone, a smart bracelet, a smart watch, etc., and the terminal may send an ECG signal to be noise-reduced to the executing device, and the executing device may respond to the signal to be reduced. Noise reduction is performed on the noisy ECG signal, and the noise-reduced ECG signal is obtained.
  • the execution device can send the noise-reduction ECG signal to the terminal, and the terminal can receive the noise-reduction ECG signal sent by the execution device, or according to The ECG signal after noise reduction is diagnosed and analyzed.
  • the execution device 110 can be a terminal such as a mobile phone, a tablet computer, or a server, a cloud, etc. After the execution device obtains the noise-reduced ECG signal, it can be based on the noise-reduced ECG signal Perform diagnostic analysis. The execution device may send the diagnosis result to the user device 140.
  • FIG. 4 is only a schematic diagram of a system architecture provided by an embodiment of the present invention, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110.
  • the target noise reduction autoencoder 101 is trained according to the training device 120.
  • the target noise reduction autoencoder 101 provided in the embodiment of the present application may include an encoder and a decoder.
  • both the encoder and the decoder may be a neural network, a convolutional neural network, or a deep neural network.
  • the denoising autoencoder 200 may include an input layer 21, an encoder 22, a decoder 23, and an output layer 24.
  • the encoder 22 may include one or more sets of convolutional layers/pooling layers 220.
  • the decoder 23 may include one or more sets of convolutional layers/upsampling layers 230.
  • the pooling layer in the encoder 22 is used for dimensionality reduction
  • the decoder 23 is used for dimensionality reduction.
  • the sampling layer is used for dimension upgrading.
  • the convolutional layer/pooling layer 220 may include layers 221-226, for example: in an implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, and layer 223 is a convolutional layer. Layers, 224 is the pooling layer, 225 is the convolutional layer, and 226 is the pooling layer; in another implementation, 221 and 222 are the convolutional layers, 223 is the pooling layer, and 224 and 225 are the convolutional layers. Layer, 226 is the pooling layer. That is, the output of the convolutional layer can be used as the input of the subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
  • the convolutional layer/upsampling layer 230 may include layers such as 231-236.
  • layer 231 is a convolutional layer
  • layer 232 is an upsampling layer
  • layer 233 is a convolutional layer
  • Layers, 234 is an upsampling layer
  • 235 is a convolutional layer
  • 236 is an upsampling layer
  • 231 and 232 are convolutional layers
  • 233 is an upsampling layer
  • 234 and 235 are convolutional layers.
  • Layer, 236 is the up-sampling layer. That is, the output of the convolution layer can be used as the input of the subsequent upsampling layer, or as the input of another convolution layer to continue the convolution operation.
  • the convolution layer 221 can include many convolution operators.
  • the convolution operator is also called a kernel. Its role in the processing of the ECG signal is equivalent to a filter that extracts specific information from the input data matrix.
  • the essence of the convolution operator is The above can be a weight matrix.
  • This weight matrix is usually predefined. In the process of convolution on the ECG signal, the weight matrix is usually one sample point after another sample point (or Two sampling points followed by two sampling points... it depends on the value of stride) to complete the work of extracting specific features from the ECG signal.
  • the size of the weight matrix should be related to the number of sampling points in the ECG signal. It should be noted that the depth dimension of the weight matrix and the horizontal depth dimension of the input ECG signal are the same. Different weight matrices can be used to extract different features in the data matrix.
  • weight values in these weight matrices need to be obtained through a lot of training in practical applications.
  • Each weight matrix formed by the weight values obtained through training can be used to extract information from the input ECG signal, so that the noise reduction autoencoder 20 is Input the ECG signal for correct noise reduction.
  • the initial convolutional layer (such as 221) often extracts more general features, which can also be called low-level features;
  • the features extracted by the subsequent convolutional layers (for example, 226) become more and more complex, such as high-level semantic features.
  • the features with higher semantics are more suitable for the problem to be solved. .
  • pooling layer After it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolutional layer.
  • it can be a convolutional layer followed by a layer
  • the pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
  • the purpose of the pooling layer is to reduce the dimensionality of the input data.
  • the pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling the input data to obtain data with smaller dimensions.
  • the average pooling operator can calculate the input data within a specific range to generate an average value as the result of average pooling.
  • the maximum pooling operator can take the data with the largest value in a specific range as the result of maximum pooling.
  • the operators in the pooling layer should also be related to the dimension of the input data.
  • the dimensionality of the data output after processing by the pooling layer can be smaller than the dimensionality of the data input to the pooling layer.
  • Each sampling point in the data output by the pooling layer represents the average or maximum value of the corresponding subregion of the data input to the pooling layer. .
  • the purpose of the upsampling layer is to increase the dimensionality of the input data.
  • the principle of upsampling is to insert new elements between the elements based on the original input data.
  • the output layer 240 can have a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error of the denoising autoencoder.
  • the denoising autoencoder 200 shown in FIG. 2 is only used as an example of a denoising autoencoder. In specific applications, the denoising autoencoder may also exist in the form of other network models.
  • FIG. 6 is a hardware structure of a chip provided by an embodiment of the present invention.
  • the chip includes a neural network processor 30.
  • the chip can be set in the execution device 110 as shown in FIG. 4 to complete the calculation work of the calculation module 171.
  • the chip may also be set in the training device 120 shown in FIG. 4 to complete the training work of the training device 120 and output the target noise reduction autoencoder 101.
  • the algorithms of each layer in the noise reduction autoencoder as shown in FIG. 5 can be implemented in the chip as shown in FIG. 6.
  • the neural network processor 30 may be any processor suitable for large-scale XOR operation processing such as NPU, TPU, or GPU.
  • NPU can be mounted on the host CPU (Host CPU) as a coprocessor, and the host CPU assigns tasks to it.
  • the core part of the NPU is the arithmetic circuit 303.
  • the arithmetic circuit 303 is controlled by the controller 304 to extract matrix data in the memory (301 and 302) and perform multiplication and addition operations.
  • the arithmetic circuit 303 includes multiple processing units (Process Engine, PE). In some implementations, the arithmetic circuit 303 is a two-dimensional systolic array. The arithmetic circuit 303 may also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 303 is a general-purpose matrix processor.
  • the arithmetic circuit 303 fetches the weight data of the matrix B from the weight memory 302 and caches it on each PE in the arithmetic circuit 303.
  • the arithmetic circuit 303 fetches the input data of matrix A from the input memory 301, and performs matrix operations based on the input data of matrix A and the weight data of matrix B, and the partial or final result of the obtained matrix is stored in the accumulator 308 .
  • the unified memory 306 is used to store input data and output data.
  • the weight data is directly transferred to the weight memory 302 through the direct memory access controller (DMAC, Direct Memory Access Controller) 305 of the storage unit.
  • the input data is also transferred to the unified memory 306 through the DMAC.
  • DMAC Direct Memory Access Controller
  • the bus interface unit (BIU, Bus Interface Unit) 310 is used for the interaction between the DMAC and the instruction fetch buffer (Instruction Fetch Buffer) 309; the bus interface unit 301 is also used for the instruction fetch memory 309 to obtain instructions from the external memory; the bus interface unit 301 also The storage unit access controller 305 obtains the original data of the input matrix A or the weight matrix B from the external memory.
  • the DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 306, or to transfer the weight data to the weight memory 302, or to transfer the input data to the input memory 301.
  • the vector calculation unit 307 has multiple arithmetic processing units, if necessary, further processing the output of the arithmetic circuit 303, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on.
  • the vector calculation unit 307 is mainly used for calculation of non-convolutional layers or fully connected layers (FC, fully connected layers) in the neural network. Specifically, it can process: Pooling (pooling), Normalization (normalization), etc. calculations.
  • the vector calculation unit 307 may apply a nonlinear function to the output of the arithmetic circuit 303, such as a vector of accumulated values, to generate the activation value.
  • the vector calculation unit 307 generates a normalized value, a combined value, or both.
  • the vector calculation unit 307 stores the processed vector to the unified memory 306.
  • the vector processed by the vector calculation unit 307 can be used as the activation input of the arithmetic circuit 303, for example, for use in subsequent layers in a neural network, as shown in FIG. 2, if the current processing layer is a hidden layer 1 (231), the vector processed by the vector calculation unit 307 can also be used for calculation in the hidden layer 2 (232).
  • the instruction fetch buffer 309 connected to the controller 304 is used to store instructions used by the controller 304;
  • the unified memory 306, the input memory 301, the weight memory 302, and the fetch memory 309 are all On-Chip memories.
  • the external memory is independent of the NPU hardware architecture.
  • the calculation of each layer in the noise reduction autoencoder shown in FIG. 5 can be executed by the arithmetic circuit 303 or the vector calculation unit 307.
  • FIG. 7A is a schematic flowchart of a method for training a noise-reducing autoencoder according to Embodiment 1 of the present invention
  • FIG. 7B is a schematic explanatory diagram of a method for training a noise-reducing autoencoder according to Embodiment 1 of the present invention.
  • the method can be specifically executed by the training device 120 shown in FIG. 3.
  • steps S702-S706 in the method may also be pre-executed by other functional modules before the training device 120, that is, the data of the original samples received or obtained from the database 130 is preprocessed to obtain training samples
  • the training device executes S708 and S710 through the training samples to train the noise-reducing autoencoder.
  • the method may be processed by the CPU, or may be processed by the CPU and a processor suitable for neural network calculations (the neural network processor 30 shown in FIG. 6) together to process the neural network processor shown in FIG. 6 30.
  • a processor suitable for neural network calculations the neural network processor 30 shown in FIG. 6 -6 together to process the neural network processor shown in FIG. 6 30.
  • This application is not restricted.
  • the method may include some or all of the following steps:
  • S702 Superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal, where the signal-to-noise ratio (SNR) of the noise-free ECG signal is not less than the first Threshold, noise-free ECG signal includes M beat ECG signal, each beat ECG signal contains a QRS complex, H is an integer greater than 1.
  • SNR signal-to-noise ratio
  • the noise-free ECG signal may be an ECG signal collected by an ECG acquisition device when the person is in a static state.
  • the noise-free ECG signal may include the H-beat ECG signal, which is a series of sampling points sorted by time, and the value of the sampling point represents the intensity of the electrical signal on the surface of the organism when the sampling point is collected.
  • the noise-free ECG signal in the embodiments of the present application refers to the ECG signal that contains no or almost no EMG noise, but it is not excluded that the noise-free ECG signal includes such as power frequency noise, baseline drift or other noise, etc. .
  • the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold, and the first threshold can be a fixed value greater than 10db, such as 10db, 15db, 20db or 40db, etc., or it can be based on the power of the noise-free ECG signal It is determined, for example, that the first threshold is such that the signal-to-noise ratio of the noise-free ECG signal is equal to the second threshold.
  • the signal-to-noise ratio may specifically be the ratio of the power of the noise-free ECG signal to the power of myoelectric noise, or the ratio of the power of the noise-free ECG signal to the power of the noise.
  • the noise-free ECG signal and the EMG noise signal have the same sampling frequency and length.
  • One way to generate a synthetic ECG signal may be to superimpose the EMG noise signal and the noise-free ECG signal, that is, to synthesize
  • the amplitude of the ECG signal is the sum of the amplitude of the noise-free ECG signal and the amplitude of the EMG noise signal, or the weighted sum of the amplitude of the noise-free ECG signal and the amplitude of the EMG noise signal, also There may be other superposition methods, which are not limited in the embodiment of the present application. In specific calculations, the value of the k-th sampling point in the synthesized ECG signal is equal to the sum of the value of the k-th sampling point in the noise-free ECG signal and the value of the k-th sampling point in the noise signal.
  • a sample composed of a synthetic ECG signal and a noise-free ECG signal corresponding to the synthetic ECG signal is called an original sample, and multiple original samples constitute an original sample set.
  • the noise signals used in the synthesized ECG signals superimposed on different original samples may be different or the same, and there is no limitation on this.
  • the length of an ECG signal refers to the duration of the ECG signal. In the embodiment of the present application, the length of the ECG signal may be 5-10 minutes or longer. Or shorter, not limited here.
  • the number of sampling points in the ECG signal is related to the sampling frequency and the length of the ECG signal. Two signals with the same length at the same sampling frequency have the same number of sampling points.
  • the noise-free ECG signal may be preprocessed before superimposing and generating the synthesized ECG signal.
  • the preprocessing process may include wavelet transform (wavelet transform, WT) to remove the central electrical signal of the noiseless ECG signal. Noise outside the signal band. It is also possible to perform wavelet transformation on the synthesized ECG signal after superposing and generating the synthesized ECG signal, which is not limited in the embodiment of the present application. It should be understood that the frequency band of the ECG signal is generally between 0.05-60Hz, and the frequency of myoelectric noise is mainly concentrated in 0.01-100Hz.
  • Wavelet transform can be used to remove the noise signal outside the ECG signal band (0-0.05Hz and above 60H) In order to reduce the difficulty of the later noise reduction process, the specific implementation of wavelet transform is the prior art, which will not be repeated here.
  • the synthetic ECG signal in the original sample may be the ECG signal processed by wavelet transform, and meanwhile, the noise-free ECG signal corresponding to the synthetic ECG signal may be the ECG signal processed by the wavelet transformation.
  • S704 Decompose the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using an average beat subtraction method.
  • the first implementation of S704 may specifically include the following steps:
  • S7041 Perform average processing on the W beat ECG signal in the target ECG signal to obtain the second average ECG signal, where the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal or from the first user (That is, users who have been collected to obtain a noise-free ECG signal) historically collected ECG signals, etc., W ⁇ H, W is a positive integer.
  • the W beat ECG signal used to generate the second average ECG signal in S7041 can be derived from a synthetic ECG signal, a noise-free ECG signal, or from the first user (that is, a noise-free ECG signal that is collected) User) historically collected ECG signals, etc.
  • the W-beat ECG signal may be a continuous W-beat ECG signal, or a discontinuous or partially continuous multi-beat ECG signal.
  • the training device performs signal averaging on the W-beat ECG signal, it is necessary to ensure that the position of the W-beat ECG signal is aligned, and further, the aligned W-beat ECG signal is superimposed and averaged.
  • the electrical signal is illustrated by taking the average processing of the W beat ECG signal to obtain the second average ECG signal as an example.
  • the specific implementation of the above-mentioned second average ECG signal may be:
  • Second average ECG signal It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
  • Ak represents the ECG signal in the interval of ⁇ t taken from the left and right sides of the W-beat ECG signal with R k as the center
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1,2 whilW.
  • the second average ECG signal and the ECG signal in the ⁇ t interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
  • a k (v) is the value of the v-th sampling point in the ECG signal in the ⁇ t interval with R k as the center in the W beat ECG signal, 1 ⁇ v ⁇ V,1 ⁇ k ⁇ W, v,k are positive integers.
  • the second average ECG signal obtained by the implementation method 1 is different, and the reference ECG signal obtained by the second average ECG signal in the implementation method 1 is also different.
  • This implementation method 1 adaptively selects the reference ECG signal for different synthetic ECG signals, and the obtained reference ECG signal can extract the obvious characteristics of the synthetic ECG signal, so that the target noise reduction autoencoder obtained by training can be adapted Different ECG signals, thereby improving the noise reduction performance of the target noise reduction autoencoder.
  • signal averaging can reduce the noise of the ECG signal.
  • the second average ECG signal is a one-beat ECG signal after noise reduction processing.
  • the reference ECG signal obtained from the second average ECG signal can be considered to contain no EMG noise, and the average amplitude of the R peak of the target ECG signal is retained, and the reference ECG signal obtained above is for a specific
  • the synthetic ECG signal is generated, which can more accurately represent the obvious characteristics of the synthetic ECG signal.
  • Average ECG signal in the second It is obtained by averaging the W beat ECG signal in the noiseless ECG signal. Since the synthetic ECG signal is synthesized by the noise-free ECG signal and the noise signal, the noise-free ECG signal has the same characteristics as the R peak position and RR distance of the synthesized ECG signal, so it is combined with the synthesized ECG signal. Compared with the second average ECG signal obtained by averaging, the second average ECG signal obtained by averaging the noiseless ECG signal has less noise and EMG noise, and then more EMG noise is retained to contain noise In the remaining ECG signal, the trained target noise reduction autoencoder can learn the noise reduction function for this part of the EMG noise.
  • Average ECG signal in the second It is obtained by averaging the W-beat ECG signals from the historically collected ECG signals of the first user. For the ECG signal of the same user, the same second average ECG signal is used.
  • the reference ECG signal generated by the second average ECG signal obtained in this way takes into account individual differences, so that the reference ECG signal can more accurately represent the obvious characteristics of the synthesized ECG signal. For the reference ECG signal obtained by the same user, only A calculation is required to improve calculation efficiency.
  • the training device can detect the R peak of each beat of the ECG signal in the W beat ECG signal in the target ECG signal (that is, the apex of the R wave), and the R peak is the highest energy value in the beat of the ECG signal Sampling point.
  • S7045 Perform average processing on the W beat ECG signal in the target ECG signal to obtain the second average ECG signal.
  • the R peak of the second average ECG signal includes the ECG signal of ⁇ t1 on the left side and the ECG signal of ⁇ t2 on the right side.
  • the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, or a historically collected ECG signal from the first user (that is, the user who has been collected to obtain the noiseless ECG signal), etc.
  • W ⁇ H and W are positive integers.
  • a specific implementation of S7045 can be to select the ECG signal in the interval obtained by taking the R peak as the reference to the left and right taking ⁇ t2 for each beat of the W beat ECG signal to obtain W ECG signals Fragment. Furthermore, the W ECG signal segments are averaged to obtain a second average ECG signal.
  • each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, W ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure that the W ECG signal segments are aligned.
  • the selected W ECG signal segments of length L may also include P waves, QRS complexes, and T waves; or include P waves, QRS complexes, and so on.
  • the selected W ECG signal segments all include V sampling points, where the R peaks are all located at the Z-th sampling point, V and Z are integers greater than 1, and Z is less than V.
  • C k represents the ECG signal in the interval obtained by taking R k as the reference ⁇ t1 and ⁇ t2 in the W-beat ECG signal
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1, 2 ...W.
  • Ak represents the ECG signal in the interval of ⁇ t taken from the left and right sides of the W-beat ECG signal with R k as the center
  • R k is the apex of the QRS complex in the W-beat ECG signal
  • k 1,2 whilW.
  • the second average ECG signal and the ECG signal in the ⁇ t interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
  • C k (v) is the value of the v-th sampling point in the ECG signal in the interval obtained by taking R k as the reference ⁇ t1 in the W beat ECG signal, 1 ⁇ v ⁇ V, 1 ⁇ k ⁇ W, v and k are positive integers.
  • the training device can divide the W-beat ECG signal from the target ECG signal, and then detect the R peak of each beat of the ECG signal in the W-beat ECG signal,
  • the R peak is the sampling point with the largest amplitude in the one-beat ECG signal; furthermore, the W-beat ECG signal is aligned based on the R peak.
  • the number of sampling points at each position is not Is greater than W, and then the aligned W beat ECG signals are averaged to obtain a second average ECG signal.
  • the average amplitude of one or more sampling points at each position can be calculated, the average amplitude of each position can be calculated, and the average ECG signal can be obtained, and then the average ECG signal is selected based on R k ⁇ t1 takes the ECG signal in the interval obtained by ⁇ t2 to the right to obtain the second average ECG signal.
  • the position of the R peak in the divided N-beat ECG signal may be different, and the length of the N-beat ECG signal may be the same or different.
  • Average ECG signal The value of the v-th sampling point in can be expressed as: among them, Average ECG signal
  • D k (v) is the value of the sampling point at position v in the W-beat ECG signal with R k as the location, 1 ⁇ v ⁇ V, 1 ⁇ k ⁇ W, v and k are positive integers. If there is no sampling point distribution at position v in the ECG signal D k , then D k (v) is zero.
  • the first implementation described above is a special case of the second implementation.
  • signal averaging can reduce the noise of the ECG signal.
  • the second average ECG signal is a one-beat ECG signal after noise reduction processing.
  • the reference ECG signal generated by the second average ECG signal can be considered to contain no EMG noise, and the reference ECG signal obtained above is generated for a specific synthetic ECG signal, which can more accurately represent the synthetic ECG The distinctive feature of the signal.
  • the synthetic ECG signal is obtained by synthesizing the noise-free ECG signal and the noise signal.
  • the first average ECG signal obtained by averaging the noise-free ECG signal The two-average ECG signal has less EMG noise, and more EMG noise is retained in the noisy residual ECG signal, so that the trained target noise reduction autoencoder can learn to deal with this part of EMG noise The noise reduction function.
  • the R peak position of the reference ECG signal obtained by the average beat subtraction is the same as the R peak position of the synthesized ECG signal.
  • the reference ECG signal has the same R peak position and R-R interval as the synthetic ECG signal.
  • the embodiment of the present application takes a specific implementation of S7046 as an example for description. It should be understood that the above-mentioned first implementation is a special case of the second implementation, and the specific implementation of S7042 can refer to the implementation of S7046, which will not be repeated here. Please also refer to the schematic diagram of the principle of calculating the reference ECG signal shown in FIG. 7C.
  • a specific implementation of S7046 may include but is not limited to the following steps:
  • S70461 Detect the R peak position of the synthetic ECG signal and the R peak position of the second average ECG signal.
  • S70462 Obtain H signal segments according to the second average ECG signal, the R peak position in the synthesized ECG signal, and the R peak position of the second average ECG signal, and the H signal segments are the same as the second average ECG signal And the R peak position of the h-th signal segment in the H signal segments is equal to the h-th R peak position in the synthesized ECG signal, h is a positive integer, and h is not greater than the total R peak in the synthesized ECG signal Number.
  • the second average ECG signal is aligned with each beat of the composite ECG signal, and the second average ECG signal aligned with the R peak position in the composite ECG signal is called It should be understood that, relative to the second average ECG signal, the position of each sampling point in the signal segment moves as a whole, but its waveform remains unchanged.
  • the interval between any two adjacent R peaks in the synthetic ECG signal may be different, and the length of the second average ECG signal may be greater than the length of an RR interval, or may be less than the length of an RR interval. length. At this time, two adjacent signal segments may partially overlap or have a certain distance.
  • S70463 Generate a reference ECG signal according to the H signal segments, where the value of the sampling point of the reference ECG signal at the third position is the value of the sampling point of the third signal segment at the third position and the value of the fourth signal segment at the third position.
  • the average of the value of the sampling point at the position, the third position is the position where there are multiple sampling points in the H signal fragments, the third signal fragment and the fourth signal fragment are the H signal fragments with the sampling point at the third position
  • Two signal segments; the value of the sampling point of the reference ECG signal at the fourth position is obtained by interpolating the values of the two closest sampling points to the fourth position in the multiple signal segments, and the third position is H signals Where the segments overlap, the fourth position is the position between H signal segments.
  • the interpolation algorithm is an existing technology, and will not be repeated here.
  • the value of the sampling point of the reference ECG signal at the third position may be the value of the sampling point of the third signal segment at the third position or the value of the sampling point of the fourth signal segment at the third position.
  • the value of the sampling point of the reference ECG signal at the fourth position can also be set to 0, which is not limited here.
  • S7043 and S7047 remove the reference ECG signal from the synthesized ECG signal to obtain the noisy residual ECG signal.
  • the synthesized ECG signal, the noise-free ECG signal, the reference ECG signal, the noise-containing residual ECG signal, and the noise-free residual ECG signal all include the same number of sampling points.
  • Remove the reference ECG signal from the synthetic ECG signal, that is, the value of the sample point in the synthetic ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the residual ECG signal with noise
  • the value of the xth sampling point is equal to the difference between the value of the xth sampling point in the synthetic ECG signal and the value of the xth sampling point in the reference ECG signal.
  • removing the reference ECG signal from the noise-free ECG signal means that the value of the sample point in the noise-free ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the noise-free ECG signal
  • the value of the xth sample point in the remaining ECG signal is equal to the difference between the value of the xth sample point in the noise-free ECG signal and the value of the xth sample point in the reference ECG signal.
  • x is the index of the sampling point
  • x is a positive integer
  • x is not greater than the total number of sampling points in the synthesized ECG signal.
  • Synthetic ECG signal X q The noisy residual ECG signal obtained after removing the reference ECG signal The length meets the length requirement of the input data of the noise reduction autoencoder. At this time, the noisy residual ECG signal And noiseless residual ECG signal The formed samples are called training samples, among which, the synthetic ECG signal X q is obtained by superimposing the noise-free ECG signal Y q with the EMG noise signal, and the noise-free residual ECG signal It is the signal obtained after the noise-free ECG signal Y q is removed from the reference ECG signal.
  • the original sample corresponds to the training sample one to one. Multiple training samples constitute a training sample set. This training sample set is used to train the noise reduction autoencoder.
  • a training sample in the training sample set can be expressed as Among them, q is the index of the original sample in the original sample set, which is also the index of the training sample in the training sample set in this implementation; the training sample set includes Q training samples, q and Q are positive integers, and q ⁇ Q.
  • the noisy residual ECG signal in the training sample may be obtained by normalizing the noisy residual ECG signal obtained by decomposition, and the normalization method may be maximum-minimum normalization , Or other normalization methods, here, take the maximum and minimum value normalization as an example to illustrate:
  • Is the noisy residual ECG signal in the training sample To decompose the noisy residual ECG signal, Is the minimum signal strength of the noisy residual ECG signal in the training sample, Is the maximum signal strength in the noisy residual ECG signal in the training sample.
  • the noise-free residual ECG signal in the training sample is obtained by normalizing the noise-free residual ECG signal obtained by decomposition.
  • the maximum and minimum value normalization as an example to illustrate:
  • Is the noise-free residual ECG signal in the training sample Is the minimum signal strength of the noise-free residual ECG signal in the training sample, Is the maximum signal strength of the noise-free residual ECG signal in the training sample.
  • a training sample in the training sample set can be expressed as
  • the training device may also preprocess the training samples before inputting the training samples to the denoising autoencoder.
  • the preprocessing process may include normalization. Operations can also include other operations, which are not limited here.
  • Synthetic ECG signal X q The noisy residual ECG signal obtained after removing the reference ECG signal The length of is far greater than the length of the input data required by the noise reduction autoencoder. At this point, the noisy residual ECG signal in the original sample can be And noiseless residual ECG signal Carry out cutting, and cut the noisy residual ECG signal slices Meet the length of the input data required by the noise reduction autoencoder.
  • the synthesized ECG signal X q is obtained by superimposing the noise-free ECG signal Y q with the EMG noise signal, and the noise-free residual ECG signal It is the signal obtained by removing the reference ECG signal from the noise-free ECG signal Y q , and e is the noise-free residual ECG signal slice obtained from Q noise-free residual ECG signal slices.
  • Index, e and E are positive integers, e ⁇ E. It should be understood that noisy residual ECG signal Multiple slices of noisy residual ECG signal and noiseless residual ECG signal obtained by cutting The multiple noiseless residual ECG signals obtained by cutting correspond one to one.
  • the formed samples are called training samples.
  • E training samples form the training sample set.
  • one training sample in the training sample set can be expressed as Among them, e is also called the index of the training sample in the training sample set.
  • one original sample can correspond to multiple training samples.
  • Multiple training samples constitute a training sample set.
  • the training sample set is used to train the noise reduction autoencoder to obtain the target noise reduction autoencoder.
  • steps S702-S706 may also be executed by other equipment before the training device, or may be executed by the training device.
  • the training device can generate multiple training samples.
  • the multiple training samples can be divided into a training sample set and a test sample set.
  • the training device can use the training sample set to train the noise-reducing autoencoder, where the noisy residual ECG signal is Training input, the noise-free residual ECG signal corresponding to the noisy residual ECG signal is the training label, and finally the target noise reduction autoencoder is obtained.
  • the training device can use the test sample set to test the trained target denoising autoencoder to evaluate the robustness and generalization ability of the target denoising autoencoder.
  • the embodiment of the present application takes the training sample set described in the foregoing implementation (1) as an example for illustration.
  • step S708 may also be in the form in the foregoing implementation (2) or other forms, which will not be repeated here.
  • specific implementation of the training device using the training samples to train the noise reduction autoencoder may include the following steps:
  • S708 Input the noisy residual ECG signal into the noise reduction autoencoder to obtain the predicted residual ECG signal.
  • the denoising autoencoder is the initialized neural network or the denoising autoencoder updated during the training process.
  • the embodiment of this application takes the training sample as As an example, the residual ECG signal with noise Input to the noise reduction autoencoder, and the noise reduction autoencoder Process to get predicted residual ECG signal
  • S710 Update the parameters of the noise reduction autoencoder according to the error between the predicted residual ECG signal and the noise-free residual ECG signal to obtain the target noise reduction autoencoder.
  • one training sample may be used in one training process of the noise reduction autoencoder, or multiple training samples or all training samples may be used, which is not limited in the embodiment of the present application.
  • the target denoising autoencoder is a denoising autoencoder trained through the training sample set.
  • the embodiment of this application takes Q training samples as an example, where U is a positive integer not greater than Q, and the training device can determine Q according to the error between the predicted residual ECG signal and the noise-free residual ECG signal of each training sample
  • the parameters of the denoising autoencoder are updated through the optimization algorithm, so that the loss becomes smaller and smaller.
  • the optimization algorithm may be gradient descent, Adam algorithm or other optimization algorithms, which are not limited in the embodiment of the present application.
  • the loss function is used to calculate the loss corresponding to Q training samples.
  • the loss function can be the error between the predicted residual ECG signal and the noise-free residual ECG signal, where the predicted residual ECG signal and the noise-free residual ECG signal.
  • the error of the electrical signal can be the mean absolute error (MAE), mean squared error (MSE), or root mean squared error between the predicted residual ECG signal and the noise-free residual ECG signal. Error, RMSE), etc., can also be used to predict the cross entropy of the residual ECG signal and the noise-free residual ECG signal, and can also have other forms, which are not limited in this application.
  • the loss function L can be expressed by predicting the average absolute error between the residual ECG signal and the noise-free residual ECG signal, then:
  • the above method does not directly use the synthetic ECG signal for the training of the noise reduction autoencoder, but first removes the reference ECG signal including the R peak position and other obvious features from the synthetic ECG signal, and the reference ECG signal remains The obvious characteristics of the synthesized ECG signal, such as the R peak position, the average amplitude of the R peak, etc., are used to avoid the distortion of the ECG signal; the noisy residual ECG signal obtained after the synthetic ECG signal is removed from the reference ECG signal.
  • the noise reduction autoencoder in the embodiment of the present application only needs to extract the encoding representation of the detailed information of the ECG signal.
  • FIG. 7D is a schematic flowchart of another method for training a noise reduction autoencoder according to Embodiment 2 of the present invention.
  • the method can be specifically executed by the training device 120 shown in FIG. 3.
  • steps S712-S716 in the method may also be pre-executed by other functional modules before the training device 120, that is, the data of the original samples received or obtained from the database 130 is preprocessed to obtain training samples
  • the training device executes S718 and S720 through the training samples to train the noise reduction autoencoder.
  • the method may be processed by the CPU, or may be processed by the CPU and a processor suitable for neural network calculations (the neural network processor 30 shown in FIG. 6) together to process the neural network processor shown in FIG. 6 30.
  • This application is not restricted.
  • the method may include some or all of the following steps:
  • the noise-free ECG signal may include a multi-beat ECG signal H-beat ECG signal, each beat ECG signal contains a QRS complex, and H is an integer greater than 1.
  • S714 Decompose the noise-free ECG signal into a reference ECG signal and a noise-free residual ECG signal by using an average beat subtraction method.
  • S7141 Perform average processing on the W beat ECG signal in the target ECG signal to obtain a second average ECG signal, where the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal or from the first user (That is, users who have been collected to obtain a noise-free ECG signal) historically collected ECG signals, etc., W ⁇ H, W is a positive integer.
  • S7142 Replace the second average ECG signal with A j corresponding to the H-beat ECG signal in the noise-free ECG signal to obtain the reference ECG signal.
  • a j represents the H-beat ECG signal with ⁇ t as the center of R j.
  • the second implementation of S714 may specifically include but is not limited to the following steps:
  • the training device can detect the R peak of each beat of the ECG signal in the W beat ECG signal in the target ECG signal (that is, the apex of the R wave), and the R peak is the maximum energy value in the beat of the ECG signal Sampling point.
  • the synthesized ECG signal, the noise-free ECG signal, the reference ECG signal, the noise-containing residual ECG signal, and the noise-free residual ECG signal all include the same number of sampling points.
  • Remove the reference ECG signal from the synthetic ECG signal, that is, the value of the sample point in the synthetic ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the residual ECG signal with noise
  • the value of the xth sampling point is equal to the difference between the value of the xth sampling point in the synthetic ECG signal and the value of the xth sampling point in the reference ECG signal.
  • S718 Input the noisy residual ECG signal into the noise reduction autoencoder to obtain the predicted residual ECG signal.
  • S720 Update the parameters of the noise reduction autoencoder according to the error between the predicted residual ECG signal and the noise-free residual ECG signal to obtain the target noise reduction autoencoder.
  • FIG. 8A is a schematic flowchart of an ECG signal noise reduction method according to Embodiment 2 of the present invention
  • FIG. 8B is a schematic explanatory diagram of an ECG signal noise reduction method according to Embodiment 2 of the present invention.
  • the target noise reduction autoencoder obtained by training in the first embodiment realizes the noise reduction of the ECG signal to be denoised.
  • the method may be specifically executed by the execution device 110 shown in FIG. 3, and the ECG signal to be denoised in the method may be the input data given by the user device 140 shown in FIG.
  • the preprocessing module 113 can be used to execute the signal superimposing module 114 in the execution device 110 in S802-S804 of the method 800 to execute S808 in the method 800, and the calculation module 111 in the execution device 110 can Used to execute the S806.
  • the method 800 may be processed by a CPU, or a CPU and a processor suitable for neural network calculation (for example, the neural network processor 30 shown in FIG. 6), which is not limited in this application.
  • the ECG signal noise reduction method 800 may include but is not limited to some or all of the following processes:
  • the user equipment may send the ECG signal to be noise-reduced to the execution device, requesting the execution device to reduce the noise of the ECG signal to be noise-reduced.
  • the execution device may also collect the user's ECG signal in real time through the ECG device, and the ECG signal of the preset length collected in real time is the ECG signal to be noise-reduced.
  • the preset length is the length required by the noise reduction autoencoder for input data.
  • the ECG signal to be denoised can be preprocessed.
  • the preprocessing can include but is not limited to operations such as wavelet transform.
  • the ECG signal to be denoised in the following steps is the preprocessed ECG signal.
  • the execution device can perform wavelet transform on the ECG signal to be denoised to remove the noise outside the frequency band of the central electrical signal of the ECG signal to be denoised, so as to reduce the difficulty of the later noise reduction process.
  • the specific implementation of wavelet transform is the existing technology, here No longer.
  • the execution device may be a wearable device or terminal equipped with an ECG sensor, such as a smart bracelet, smart watch, etc.
  • an ECG sensor such as a smart bracelet, smart watch, etc.
  • S802 a specific implementation of S802 may be: The sensor collects the analog ECG signal on the surface of the user's skin; further, the analog ECG signal is processed through the digital-to-analog conversion module to obtain a digital ECG signal to be denoised.
  • the execution device may be a server or a terminal, etc.
  • a specific implementation of S802 may be: the execution device receives the ECG signal to be noise-reduced sent by the ECG acquisition device.
  • the ECG acquisition device may be a wearable device or a terminal equipped with an ECG sensor.
  • a wearable device collects the ECG signal of the wearer, and the ECG signal is the ECG signal to be noise-reduced.
  • the smart watch can send the signal to the terminal (such as a mobile phone) bound to it through Bluetooth.
  • Noise reduction ECG signal the mobile phone receives the ECG signal to be noise reduction.
  • the mobile phone After the mobile phone receives the ECG signal to be noise-reduced, it can perform noise reduction processing on the ECG signal to be noise-reduced; it can also send the ECG signal to be noise-reduced to the server, and the server implements the ECG signal to be noise-reduced Perform noise reduction processing.
  • S804 Decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised by using the average beat subtraction method.
  • the first implementation of S804 may specifically include the following steps:
  • S8041 Perform averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer.
  • the N-beat ECG signal used to generate the first average ECG signal in S8041 may be a continuous N-beat ECG signal in the ECG signal to be denoised, or it may be a discontinuous or partially continuous N-beat ECG signal. electric signal.
  • the N-beat ECG signal needs to be aligned, and then the aligned multi-beat ECG signal is superimposed and averaged, and the specific implementation is the same as that described in S704 above.
  • the specific implementation principles of the two average electrocardiogram signals are similar, and can refer to the related descriptions in the foregoing implementation 1 and implementation 2, which will not be repeated here.
  • implementation 1 of the first average ECG signal may be:
  • Second average ECG signal It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
  • the first average ECG signal and the ECG signal in the ⁇ t interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
  • the first average ECG signals obtained through implementation 4 are different, and the reference ECG signals obtained through the first average ECG signal in implementation 1 are also different.
  • This implementation manner 4 adaptively selects the reference ECG signal for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, and then the denoised ECG signal
  • the ECG signal can better retain the obvious features of the ECG signal to be noise-reduced, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
  • the obtained first average ECG signals are different, and the reference ECG signals obtained from the first average ECG signals are also different.
  • the reference ECG signal is adaptively selected for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, thereby reducing
  • the noisy ECG signal can better retain the obvious features of the ECG signal to be denoised, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
  • Implementation mode 2 of the first average ECG signal may be:
  • First average ECG signal It is obtained by averaging the N-beat ECG signals from the historically collected ECG signals of the second user (the user whose ECG signals to be denoised is collected).
  • the specific calculation method is the same as that of the above-mentioned first average electrocardiogram signal implementation manner 1, please refer to the related description in the above-mentioned implementation manner 1, which will not be repeated here.
  • the same first average ECG signal is used.
  • the implementation manner 5 obtains the reference ECG signal to be denoised generated by the first average ECG signal, taking into account individual differences, so that the reference ECG signal to be denoised can more accurately represent the obvious characteristics of the ECG signal to be denoised, relatively
  • the reference ECG signal to be noise-reduced obtained by the same user only one calculation is required, which improves the calculation efficiency.
  • the second implementation of S804 may specifically include but not limited to the following steps:
  • S8044 Detect the R peak of each beat of the ECG signal in the N-beat ECG signal in the ECG signal to be noise-reduced (that is, the apex of the R wave), and the R peak is the sample with the largest energy value in one beat of the ECG signal point.
  • S8045 Perform averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal.
  • the R peak of the first average ECG signal includes the ECG signal of ⁇ t3 on the left side and the heart signal of ⁇ t4 on the right side.
  • Electric signal, N ⁇ M, N is a positive integer.
  • a specific implementation of S8045 can be to select the ECG signal in the interval obtained by taking the R peak as the reference to the left and right taking ⁇ t4 for each beat of the N-beat ECG signal to obtain N ECG signals Fragment. Furthermore, the N ECG signal segments are averaged to obtain the first average ECG signal. Among them, each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, N ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure alignment of N ECG signal segments.
  • ⁇ t1 may be equal to ⁇ t3 in the first embodiment, and ⁇ t2 may be equal to ⁇ t4 in the first embodiment.
  • ⁇ t1 in the first embodiment may not be equal to ⁇ t3, and ⁇ t2 in the first embodiment may not be equal to ⁇ t4, which is not limited.
  • the R peak position of the reference ECG signal obtained by the average beat subtraction is the same as the R peak position of the synthesized ECG signal.
  • the reference ECG signal has the same R peak position and R-R interval as the synthetic ECG signal.
  • the embodiment of the present application takes a specific implementation of S8046 as an example for illustration. It should be understood that the above-mentioned first implementation is a special case of the second implementation. For the specific implementation of S8042, refer to the implementation of S8046, which will not be repeated here.
  • the principle of calculating the reference ECG signal is the same as in the first embodiment above. Please also refer to the schematic diagram of the principle of calculating the reference ECG signal to be denoised shown in Figure 8C.
  • a specific implementation of S8046 may include but is not limited to the following step:
  • S80461 Detect the R peak position of the ECG signal to be noise-reduced and the R peak position of the first average ECG signal.
  • S80462 Obtain M signal segments according to the first average ECG signal, the R peak position in the ECG signal to be noise-reduced, and the R peak position of the first average ECG signal, and the M signal segments have the same value as the first average ECG signal.
  • the signal has the same waveform, and the R peak position of the h-th signal segment in the M signal segments is equal to the h-th R peak position in the ECG signal to be denoised, h is a positive integer, and h is not greater than the ECG to be denoised The total number of R peaks in the signal.
  • the first average ECG signal is aligned with each beat of the ECG signal to be denoised, and the first average ECG signal is aligned with the R peak position in the ECG signal to be denoised.
  • the average ECG signal is called a signal segment. It should be understood that, relative to the first average ECG signal, the position of each sampling point in the signal segment moves as a whole, but its waveform remains unchanged.
  • the interval between any two adjacent R peaks in the ECG signal to be noise-reduced may be different, and the length of the first average ECG signal may be greater than the length of one RR interval, or may be less than one RR interval. The length of the interval. At this time, two adjacent signal segments may partially overlap or have a certain distance.
  • S80463 Generate a reference ECG signal to be denoised according to the M signal segments, where the value of the sampling point of the reference ECG signal to be denoised at the first position is the value of the sampling point of the first signal segment at the first position and the The average value of the sampling points of the two signal segments at the first position.
  • the first position is the position where there are multiple sampling points in the M signal segments.
  • the first signal segment and the second signal segment are the M signal segments in the first position.
  • the value of the sampling point of the reference ECG signal to be denoised at the second position is interpolated based on the value of the two most adjacent sampling points in the M signal segments It is obtained that the first position is the position including the overlap on the M signal segments, and the second position is the position between the M signal segments.
  • the interpolation algorithm is an existing technology, and will not be repeated here.
  • the value of the sampling point of the reference ECG signal to be denoised at the first position may be the value of the sampling point of the first signal segment at the first position or the second signal segment The value of the sampling point at the first position.
  • the value of the sampling point of the reference ECG signal to be denoised at the second position can also be set to 0, which is not limited here.
  • the method of generating the reference ECG signal to be denoised used by the trained target denoising autoencoder may be consistent with the method of generating the reference ECG signal to be denoised.
  • S8043 or S8047 can be:
  • the ECG signal to be denoised, the reference ECG signal to be denoised, and the remaining ECG signal to be denoised all include the same number of sampling points.
  • the reference ECG signal to be denoised is removed from the ECG signal to be denoised, that is, the value of the sample point in the ECG signal to be denoised is subtracted from the value of the sample point in the reference ECG signal to be denoised. That is, the value of the yth sampling point in the remaining ECG signal to be denoised is equal to the value of the yth sampling point in the ECG signal to be denoised and the value of the yth sampling point in the reference ECG signal to be denoised difference.
  • y is the index of the sampling point
  • y is a positive integer
  • y is not greater than the total number of sampling points in the synthesized ECG signal.
  • a normalization operation may be performed on the remaining ECG signal to be denoised. Whether the normalization operation is required and the target noise reduction autoencoder's requirements for input data are determined.
  • the noisy residual ECG signal in the training sample of the target noise reduction autoencoder is normalized data
  • the residual ECG signal to be denoised is input to the target noise reduction autoencoder.
  • the normalization operation is performed on the remaining ECG signal to be denoised; otherwise, the normalization operation is not required to be performed on the remaining ECG signal to be denoised, which will not be repeated in this embodiment of the application.
  • S806 Input the residual ECG signal to be noise-reduced into the target noise-reduction autoencoder to obtain the residual ECG signal after noise reduction.
  • the ECG signal after noise reduction is the ECG signal to be noise-reduced after noise reduction processing After the ECG signal.
  • the ECG signal obtained by superimposing the reference ECG signal to be noise-reduced and the residual ECG signal after noise reduction that is, the value of the sampling point in the reference ECG signal and the value of the sampling point in the residual ECG signal after noise reduction
  • the value corresponds to the addition, that is, the value of the zth sample point in the denoised ECG signal is equal to the value of the zth sample point in the reference ECG signal to be denoised and the residual ECG signal after noise reduction
  • the value of the zth sampling point in, z is the index of the sampling point, and z is not greater than the total number of sampling points in the ECG signal to be denoised.
  • the reference ECG signal to be denoised including obvious features such as the R peak position of the ECG signal to be denoised, and use the target denoising autoencoder to treat the denoised ECG signal
  • the remaining ECG signal to be de-noised is denoised, avoiding the noise reduction processing of the target denoising autoencoder on the obvious features of the de-noising ECG signal, so that the reference ECG signal to be denoised is
  • the residual ECG signal after noise is superimposed to obtain the noise-reduced ECG signal, which can better retain the R peak position in the ECG signal to be noise-reduced, and reduce the distortion of the ECG signal after noise reduction.
  • FIG. 8D shows the ECG signal to be denoised, the ideal ECG signal (that is, the ECG signal that the ECG signal to be denoised is expected to obtain through noise reduction processing), and the convolutional autoencoder in the prior art
  • the denoised ECG signal obtained after the noise reduction process is performed on the noisy ECG signal, the denoised ECG signal is reduced by the target denoising autoencoder in the embodiment of the present application and the ECG signal denoising method provided in the present application
  • the denoised ECG signal obtained after noise processing It can be seen from FIG.
  • the method of the embodiment of the present application better extracts the detailed features of the ECG signal to be denoised, and reduces the denoised ECG signal. Distortion, improve noise reduction performance.
  • the first embodiment is the training stage of the denoising autoencoder (the stage performed by the training device 120 as shown in FIG. 4), and the specific training adopts any one of the possibilities based on the first embodiment and the first embodiment.
  • the noise reduction autoencoder provided in the implementation manner is performed; and the second embodiment can be understood as the application stage of the target noise reduction autoencoder obtained by training (the stage executed by the execution device 110 as shown in FIG. 4). It can be embodied as adopting the target noise reduction autoencoder trained in the first embodiment, and obtaining the output signal according to the input residual ECG signal to be denoised, that is, the residual ECG signal after noise reduction in the second embodiment. Finally, the remaining ECG signal after noise reduction and the reference ECG signal to be noise-reduced are superimposed to obtain the noise-reduced ECG signal.
  • Fig. 9A is a schematic block diagram of a training device for noise reduction and self-encoding in an embodiment of the present invention.
  • the noise reduction self-encoding training device 90 shown in FIG. 9A (the device 90 may specifically be the training device 120 of FIG. 4), which may include:
  • the superimposing unit 901 is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthetic ECG signal.
  • the noise-free ECG signal includes an H-beat ECG signal, and each beat of the ECG signal includes a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
  • a decomposition unit 902 configured to decompose the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction;
  • the removing unit 903 is configured to remove the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
  • the training unit 904 is configured to train the noise-reducing autoencoder according to the noise-containing residual ECG signal and the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal, wherein the noise-containing residual ECG signal is Training input, and the noise-free residual ECG signal corresponding to the noisy residual ECG signal is a training label.
  • the decomposition unit 902 is specifically configured to:
  • the reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
  • the decomposing unit 902 performing the averaging processing of the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically includes:
  • Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right ⁇ t intervals
  • R k is the QRS wave in the W-beat ECG signal
  • k 1, 2...W.
  • Fig. 9B is a schematic block diagram of a training device for noise reduction and self-encoding in an embodiment of the present invention.
  • the training device 92 for noise reduction and self-encoding shown in FIG. 9B (the device 92 may specifically be the training device 120 of FIG. 4), which may include:
  • the superimposing unit 921 is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal.
  • the noise-free ECG signal includes an H-beat ECG signal, and each beat of the ECG signal includes a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
  • the decomposition unit 922 is configured to decompose the noise-free ECG signal into a reference ECG signal and a noise-free residual ECG signal by using average beat subtraction;
  • the removing unit 923 is configured to remove the reference ECG signal from the synthesized ECG signal to obtain a noisy residual ECG signal
  • the training unit 924 is configured to train the noise-reducing autoencoder according to the noise-containing residual ECG signal and the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal, wherein the noise-containing residual ECG signal is Training input, and the noise-free residual ECG signal corresponding to the noisy residual ECG signal is a training label.
  • FIG. 10 is a schematic block diagram of an ECG signal noise reduction device provided by an embodiment of the present invention.
  • the ECG signal noise reduction device 1000 shown in FIG. 10 (the device 1000 may specifically be the execution device 110 of FIG. 4), which may include :
  • the obtaining unit 1001 is configured to obtain an ECG signal to be noise-reduced, where the ECG signal to be noise-reduced includes M beats of the ECG signal, each beat of the ECG signal includes a QRS complex, and M is a positive integer greater than 1;
  • the first decomposition unit 1002 uses average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised;
  • the noise reduction unit 1003 is configured to input the residual ECG signal to be noise-reduced into the target noise reduction autoencoder to obtain the residual ECG signal after noise reduction;
  • the superimposing unit 1004 is configured to superimpose the reference ECG signal to be noise-reduced and the remaining ECG signal after noise reduction to obtain the ECG signal after noise reduction.
  • the first decomposition unit 1002 is specifically configured to:
  • N is less than M, and N is a positive integer
  • the reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
  • the first decomposition unit 1002 performing the averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal specifically includes:
  • B i represents the N ECG beat to about the center R i in the ECG signal from each interval ⁇ t, R i beat from the ECG QRS wave of the N
  • the vertices of the group, i 1, 2...N.
  • the device 1000 may further include some or all of the units in the noise reduction and self-encoding training device 90, 92 shown in FIG. 9A or FIG. 9B, and details are not described herein again.
  • FIG. 11 is a schematic diagram of the hardware structure of a training device for a noise reduction autoencoder provided by an embodiment of the present application.
  • the training device 1100 of the noise reduction autoencoder shown in FIG. 11 includes a memory 1101, a processor 1102, a communication interface 1103, and a bus 1104.
  • the memory 1101, the processor 1102, and the communication interface 1103 implement communication connections between each other through the bus 1104.
  • the memory 1101 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM).
  • the memory 1101 may store a program.
  • the processor 1102 and the communication interface 1103 are used to execute the training method of the noise reduction autoencoder described in Embodiment 1 or Embodiment 2 of this application The various steps.
  • the processor 1102 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), graphics processing unit (graphics processing unit, GPU), or one or more
  • the integrated circuit is used to execute related programs to realize the functions required by the units in the training device of the noise reduction autoencoder in this embodiment of the application, or to execute the noise reduction self in the first or second embodiment of the method of this application. Encoder training method.
  • the processor 1102 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the training method of the noise reduction autoencoder of this application can be completed by the integrated logic circuit of the hardware in the processor 1102 or instructions in the form of software.
  • the aforementioned processor 1102 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processing
  • ASIC application specific integrated circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 1101, and the processor 1102 reads the information in the memory 1101, and combines its hardware to complete the functions required by the units included in the training device for the noise reduction autoencoder in this embodiment of the application, or execute the method of the application The training method of the noise reduction autoencoder of the first embodiment or the second embodiment.
  • the communication interface 1103 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 1100 and other devices or communication networks.
  • a transceiver device such as but not limited to a transceiver to implement communication between the device 1100 and other devices or communication networks.
  • training data (such as the training samples described in Embodiment 1 of the present application) can be obtained through the communication interface 1103.
  • the bus 1104 may include a path for transferring information between various components of the device 1100 (for example, the memory 1101, the processor 1102, and the communication interface 1103).
  • the superimposing units 901 and 921, the decomposing units 902 and 922, the removing units 903 and 923, and the training units 904 and 924 in the training device 90 or 92 of the noise reduction autoencoder may be equivalent to the processor 1102.
  • FIG. 12 is a schematic diagram of the hardware structure of an electrocardiographic signal noise reduction device provided by an embodiment of the present application.
  • the electrocardiographic signal noise reduction device 1200 shown in FIG. 12 includes a memory 1201, a processor 1202, an electrocardiographic sensor 1203, a communication interface 1204, and a bus 1205.
  • the memory 1201, the processor 1202, and the communication interface 1204 implement communication connections between each other through the bus 1205.
  • the memory 1201 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM).
  • the memory 1201 may store a program. When the program stored in the memory 1201 is executed by the processor 1202, the processor 1202 and the communication interface 1204 are used to execute the steps of the method for reducing the noise of the ECG signal in the third embodiment of the present application.
  • the processor 1202 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a graphics processing unit (graphics processing unit, GPU), or one or more
  • the integrated circuit is used to execute related programs to realize the functions required by the units in the electrocardiographic signal noise reduction device 1200 in this embodiment of the present application, or to implement the electrocardiographic signal noise reduction method in the third method embodiment of this application.
  • the processor 1202 may also be an integrated circuit chip with signal processing capability. In the implementation process, the various steps of the method for reducing the noise of the electrocardiogram signal of the present application can be completed by the integrated logic circuit of hardware in the processor 1202 or instructions in the form of software.
  • the aforementioned processor 1202 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processing
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • FPGA Field Programmable Gate Array
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 1201, and the processor 1202 reads the information in the memory 1201, and combines its hardware to complete the functions required by the units included in the electrocardiographic signal noise reduction device of the embodiment of the present application, or execute the method embodiment of the present application The noise reduction method of the ECG signal.
  • the ECG sensor 1203 includes two electrodes and an analog-to-digital conversion module.
  • the two electrodes decompose and contact the skin surface of different parts of the user to collect the user's ECG signal.
  • the digital-to-analog conversion module is used to collect The obtained ECG signal is converted into a digitized ECG signal, which is the ECG signal to be noise-reduced in this embodiment of the application.
  • the ECG sensor 1203 is not a necessary part of the ECG signal noise reduction device 1200.
  • the ECG signal noise reduction device 1200 is specifically a wearable device such as a smart bracelet or a smart watch, and the ECG signal noise reduction device 1200 may include the ECG sensor 1203.
  • the ECG signal noise reduction device 1200 is specifically a mobile phone or server, etc.
  • the ECG signal noise reduction device 1200 may not include the ECG sensor 1203, and the ECG signal noise reduction device 1200 can receive ECG collection
  • the ECG signal to be noise-reduced sent by the device may be a wearable device such as a smart bracelet or a smart watch equipped with an ECG sensor. It should be understood that the embodiments of the present application may also include other application scenarios.
  • the communication interface 1204 uses a transceiving device such as but not limited to a transceiver to implement communication between the device 1200 and other devices or a communication network.
  • a transceiving device such as but not limited to a transceiver to implement communication between the device 1200 and other devices or a communication network.
  • training data (such as the ECG signal to be noise-reduced as described in the second embodiment of the present application) can be obtained through the communication interface 1204.
  • the bus 1205 may include a path for transferring information between various components of the device 1200 (for example, the memory 1201, the processor 1202, and the communication interface 1204).
  • the acquisition unit 1001 in the ECG signal noise reduction device 1000 is equivalent to the communication interface 1204 or the ECG sensor 1203 in the ECG signal noise reduction device 1200; the first decomposition unit 1002 in the ECG signal noise reduction device 1000
  • the noise reduction unit 1003 and the superposition unit 1004 may be equivalent to the processor 1202.
  • the devices 1100 and 1200 shown in FIG. 11 and FIG. 12 only show a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the devices 1100 and 1200 also include implementations. Other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the devices 1100 and 1200 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the apparatuses 1100 and 1200 may also only include the necessary devices for implementing the embodiments of the present application, and not necessarily all the devices shown in FIG. 11 or FIG. 12.
  • the device 1100 is equivalent to the training device 120 in FIG. 4, and the device 1200 is equivalent to the execution device 110 in FIG. 4.
  • a person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed in this document can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

A denoising autoencoder training method, an electrocardiography signal denoising method, and related apparatuses and devices, which use artificial intelligence to perform electrocardiography signal denoising, and may be applied to fields such as smart electrocardiogram detection. A reference electrocardiography signal to be denoised comprising significant features such as R peak positions and R-R distances of an electrocardiography signal to be denoised is extracted from said electrocardiography signal, and denoising is performed on a remaining electrocardiography signal to be denoised by means of a target denoising autoencoder after said reference electrocardiography signal has been removed from said electrocardiography signal, to prevent the target denoising autoencoder from performing denoising processing on the significant features in said electrocardiography signal, so that said reference electrocardiography signal and the denoised remaining electrocardiography signal are superimposed to obtain a denoised electrocardiography signal, wherein the R peak positions in said electrocardiography signal are better maintained, and distortion of the denoised electrocardiography signal is reduced.

Description

降噪自编码器的训练方法、心电信号的降噪方法及其装置Training method of denoising autoencoder, denoising method and device of electrocardiogram signal
本申请要求于2019年05月14日提交中国国家知识产权局、申请号为201910399830.9、申请名称为“降噪自编码器的训练方法、心电信号的降噪方法及相关装置、设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires that it be submitted to the State Intellectual Property Office of China on May 14, 2019, the application number is 201910399830.9, and the application name is "Training method of noise reduction autoencoder, method of noise reduction of ECG signal and related devices and equipment" China The priority of the patent application, the entire content of which is incorporated in this application by reference.
技术领域Technical field
本发明涉及人工智能技术领域,尤其涉及一种降噪自编码器的训练方法、心电信号的降噪方法及其装置。The present invention relates to the technical field of artificial intelligence, and in particular to a method for training a noise reduction autoencoder, a method for noise reduction of an electrocardiogram signal and a device thereof.
背景技术Background technique
随着人工智能技术的发展,通过人工智能技术帮助医生进行心电图诊断逐渐成为可能。而心电信号的质量直接影响心电信号诊断的准确率。心电信号的采集通常是通过贴附在皮肤表面的电极得到的。由于皮肤上的心电信号比较弱,且容易受噪声干扰,导致采集到的心电信号中有很多噪声,降低了心电诊断的准确性和可靠性。尤其是,通过可穿戴心电设备采集到的用户处于非静止状态时的心电图包含大量的肌电噪声,此时,心电信号的降噪处理尤为重要。With the development of artificial intelligence technology, it has gradually become possible to help doctors perform ECG diagnosis through artificial intelligence technology. The quality of ECG signals directly affects the accuracy of ECG signal diagnosis. The collection of ECG signals is usually obtained through electrodes attached to the surface of the skin. Since the ECG signal on the skin is relatively weak and easily interfered by noise, the collected ECG signal contains a lot of noise, which reduces the accuracy and reliability of the ECG diagnosis. In particular, the ECG collected by the wearable ECG device when the user is in a non-stationary state contains a large amount of myoelectric noise. At this time, the noise reduction processing of the ECG signal is particularly important.
现有技术中,可以通过训练一卷积自编码器(convolutional auto encoder,CAE)来实现心电信号的降噪,具体的训练方法为:将含噪心电信号输入的卷积自编码器,卷积自编码器对输入的含噪信息信号进行处理后输出预测心电信号,根据预测心电信号与该含噪心电信号对应的降噪后的心电信号的误差来调整去卷积自编码器的参数,使得该误差收敛,得到具备对心电信号进行降噪功能的目标自编码器,进而,通过该目标自编码器对待降噪心电信号进行降噪。然而,由于卷积自编码器训练过程中直接以心电信号作为输入,自编码器获取完整心电信号的编码表示存在较大困难,导致通过上述目标自编码器进行降噪后的心电信号丢失心电信号中的细节信息,出现波形失真。如何在不损失心电信号的细节信息的情况下进行消除噪声是当前亟待解决的技术问题。In the prior art, the denoising of the ECG signal can be achieved by training a convolutional autoencoder (CAE). The specific training method is: a convolutional autoencoder that inputs noisy ECG signals, The convolution autoencoder processes the input noisy information signal and then outputs the predicted ECG signal, and adjusts the deconvolution auto-encoder according to the error between the predicted ECG signal and the noise-reduced ECG signal corresponding to the noisy ECG signal The parameters of the encoder cause the error to converge, and a target autoencoder capable of reducing the noise of the ECG signal is obtained, and further, the target autoencoder is used to reduce the noise of the ECG signal to be noise-reduced. However, since the ECG signal is directly used as input during the training process of the convolutional autoencoder, it is difficult for the autoencoder to obtain the encoding representation of the complete ECG signal, which leads to the denoised ECG signal through the target autoencoder. The detailed information in the ECG signal is lost, and the waveform is distorted. How to eliminate noise without losing the detailed information of the ECG signal is a technical problem that needs to be solved urgently.
发明内容Summary of the invention
本发明实施例所要解决的技术问题在于,提供一种降噪自编码器的训练方法、心电信号的降噪方法及其装置,避免自编码器学习难度大,预测波形失真的技术问题。The technical problem to be solved by the embodiments of the present invention is to provide a method for training a noise-reducing autoencoder, a method for reducing noise of an electrocardiogram signal, and a device thereof, so as to avoid the technical problems of difficult learning of the autoencoder and distortion of the predicted waveform.
第一方面,本申请实施例提供了一种降噪自编码器的训练方法,包括:训练设备将无噪心电信号和肌电噪声信号叠加得到合成心电信号,该无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,且无噪心电信号的信噪比不小于第一阈值;利用平均节拍减法(average beat subtraction)将合成心电信号分解为基准心电信号和含噪剩余心电信号;从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;进而,根据含噪剩余心电信号和该含噪剩余心电信号对应的无噪剩余心电信号训练降噪自编码器,其中,含噪剩余心电信号为训练输入,该含噪剩余心电信号对应的无 噪剩余心电信号为训练标签。In the first aspect, an embodiment of the present application provides a method for training a noise-reducing autoencoder, including: a training device superimposes a noise-free ECG signal and an EMG noise signal to obtain a synthetic ECG signal, the noise-free ECG signal including H beat ECG signal, each beat ECG signal contains a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold; using average beat subtraction Decompose the synthesized ECG signal into a reference ECG signal and a noise-containing residual ECG signal; remove the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal; further, according to the noise The residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal training noise-reducing autoencoder, where the noise-containing residual ECG signal is the training input, and the noise-free residual ECG signal corresponds to the noise-free The remaining ECG signal is the training label.
应理解,利用平均节拍减法将合成心电信号分解得到的基准心电信号的R峰位置与合成心电信号的R峰位置相同。It should be understood that the R peak position of the reference ECG signal obtained by decomposing the synthetic ECG signal using the average beat subtraction method is the same as the R peak position of the synthetic ECG signal.
应理解,上述得到含噪剩余心电信号和该含噪剩余心电信号对应的噪剩余心电信号组成一个训练样本,生成训练样本的具体实现也可以通过训练设备之前的其他设备或装置完成,训练设备可以接收生成训练样本的设备或装置发送的训练样本,此处,不作限定。It should be understood that the obtained noisy residual ECG signal and the noisy residual ECG signal corresponding to the noisy residual ECG signal form a training sample, and the specific realization of generating the training sample can also be completed by other equipment or devices before the training device. The training device may receive training samples sent by the device or device that generates the training samples, which is not limited here.
上述方法训练设备通过含噪剩余心电信号作为降噪自编码器的输入,以无噪剩余心电信号作为标签,训练降噪自编码器,此时,训练输入的含噪剩余心电信号剔除了合成心电信号中明显特征(比如,R峰位置、R-R间距等),该降噪自编码器只需要提取合成心电信号的细节信息的编码表示,而不需要获取整个合成心电信号的编码表示,进而,降低训练难度,使得训练得到的目标降噪自编码器可以更好地提取到含噪剩余心电信号中的细节特征,从而提高得到的目标降噪自编码器的降噪性能。In the above method, the training equipment uses the noisy residual ECG signal as the input of the noise reduction autoencoder, and uses the noise-free residual ECG signal as the label to train the noise reduction autoencoder. At this time, the training input noisy residual ECG signal is removed In addition to the obvious features in the synthesized ECG signal (such as R peak position, RR interval, etc.), the noise reduction autoencoder only needs to extract the encoding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the entire synthesized ECG signal. Encoding representation, in turn, reduces the difficulty of training, so that the trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder .
在训练设备利用平均节拍减法(average beat subtraction)将合成心电信号分解为基准心电信号和含噪剩余心电信号的第一种实现中:In the first implementation in which the training device uses average beat subtraction to decompose the synthesized ECG signal into the reference ECG signal and the noisy residual ECG signal:
训练设备对目标心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,该目标心电信号可以是合成心电信号、无噪心电信号、或者从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等,W≤H,W为正整数;将第二平均心电信号替换合成心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H;进而,从合成心电信号中移除待降噪基准心电信号,得到含噪剩余心电信号。 The training device averages the W beat ECG signal in the target ECG signal to obtain the second average ECG signal. The target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, or from the first user (also That is, the user who has been collected to obtain noise-free ECG signals) historically collected ECG signals, etc., W≤H, W is a positive integer; replace the second average ECG signal with the H beat ECG signal in the synthetic ECG signal A j , the reference ECG signal is obtained, A j represents the ECG signal in the interval of Δt taken around R j as the center in the H-beat ECG signal, and R j is the apex of the QRS complex in the W-beat ECG signal , J=1,2...H; further, remove the reference ECG signal to be noise-reduced from the synthesized ECG signal to obtain the noise-containing residual ECG signal.
信号平均的方法可以去除噪声,因此,上述形成的基准心电信号保留了合成心电信号中的R峰位置、R-R间距等明显特征,且不含噪声。The signal averaging method can remove noise. Therefore, the reference ECG signal formed above retains the obvious characteristics of the R peak position and R-R distance in the synthesized ECG signal, and does not contain noise.
上述第二平均心电信号的具体实现可以是:The specific implementation of the above-mentioned second average ECG signal may be:
第二平均心电信号
Figure PCTCN2020080880-appb-000001
是通过对目标心电信号中W拍心电信号进行平均处理得到的。即:
Second average ECG signal
Figure PCTCN2020080880-appb-000001
It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
Figure PCTCN2020080880-appb-000002
Figure PCTCN2020080880-appb-000002
其中,
Figure PCTCN2020080880-appb-000003
表示第二平均心电信号,A k表示W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
among them,
Figure PCTCN2020080880-appb-000003
Represents the second average ECG signal, Ak represents the ECG signal in the interval of Δt taken from the left and right sides of the W-beat ECG signal with R k as the center, R k is the apex of the QRS complex in the W-beat ECG signal, k= 1,2……W.
进一步地,第二平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式
Figure PCTCN2020080880-appb-000004
来计算,
Figure PCTCN2020080880-appb-000005
为第二平均心电信号
Figure PCTCN2020080880-appb-000006
中第v个采样点的值,A k(v)为W拍心电信号片段中以R k为中心左右各取Δt区间内的心电信号中的第v个采样点的值,1≤v≤V,1≤k≤W,v,k为正整数。
Further, the second average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average can be determined by the formula
Figure PCTCN2020080880-appb-000004
To calculate,
Figure PCTCN2020080880-appb-000005
Is the second average ECG signal
Figure PCTCN2020080880-appb-000006
The value of the v-th sampling point in the W beat ECG signal segment, A k (v) is the value of the v-th sampling point in the ECG signal in the Δt interval in the W beat ECG signal segment with R k as the center, 1≤v ≤V, 1≤k≤W, v and k are positive integers.
应理解,在将第二平均心电信号替换合成心电信号中H拍心电信号对应的A j,得到基准心电信号时,必须保证第二平均心电信号的R峰的位置与心电信号A j的R峰位置对齐。 It should be understood that when the second average ECG signal is replaced by A j corresponding to the H beat ECG signal in the synthesized ECG signal to obtain the reference ECG signal, it must be ensured that the position of the R peak of the second average ECG signal is consistent with the ECG signal. The R peak positions of the signal A j are aligned.
可见,在第二平均心电信号
Figure PCTCN2020080880-appb-000007
是通过对合成心电信号中W拍心电信号进行平均处理得到的情况下,针对不同的合成心电信号,得到的第二平均心电信号不同,进而通过该第二 平均心电信号得到的基准心电信号也不同。本申请实施例中,针对不同的合成心电信号自适应地选择基准心电信号,得到的基准心电信号可以提取出了合成心电信号的明显特征,使得训练得到的目标降噪自编码器可以适应不同的心电信号,从而提高目标降噪自编码器的降噪性能。
It can be seen that in the second average ECG signal
Figure PCTCN2020080880-appb-000007
It is obtained by averaging the W beat ECG signal in the synthetic ECG signal, for different synthetic ECG signals, the obtained second average ECG signal is different, and then obtained by the second average ECG signal The reference ECG signal is also different. In the embodiment of this application, the reference ECG signal is adaptively selected for different synthetic ECG signals, and the obtained reference ECG signal can extract the obvious characteristics of the synthetic ECG signal, so that the target noise reduction autoencoder obtained by training It can adapt to different ECG signals, thereby improving the noise reduction performance of the target noise reduction autoencoder.
还应理解,信号平均可以降低心电信号的噪声,通过对合成心电信号或无噪心电信号进行信号平均得到第二平均心电信号是经过降噪处理后的一拍心电信号,进而,由第二平均心电信号得到的基准心电信号,可以认为不含肌电噪声,还保留了和目标心电信号的R峰的平均幅值,且上述得到的基准心电信号是针对特定的合成心电信号生成的,更能准确地表示合成心电信号的明显特征。It should also be understood that signal averaging can reduce the noise of the ECG signal. By averaging the synthesized ECG signal or the noise-free ECG signal, the second average ECG signal is a one-beat ECG signal after noise reduction processing. , The reference ECG signal obtained from the second average ECG signal can be considered to contain no EMG noise, and the average amplitude of the R peak of the target ECG signal is retained, and the reference ECG signal obtained above is for a specific The synthetic ECG signal is generated, which can more accurately represent the obvious characteristics of the synthetic ECG signal.
在第二平均心电信号
Figure PCTCN2020080880-appb-000008
是通过对无噪心电信号中W拍心电信号进行平均处理得到的情况下。由于,合成心电信号是由无噪心电信号与噪声信号合成得到,无噪心电信号具有与合成心电信号相同的R峰位置、R-R间距等特征,因此,与合成心电信号进行信号平均得到的第二平均心电信号相比,由无噪心电信号进行平均得到的第二平均心电信号具有更少的噪声和肌电噪声,进而将更多的肌电噪声保留到含噪剩余心电信号中,使得训练得到的目标降噪自编码器可以学习到针对该部分肌电噪声的降噪功能。
Average ECG signal in the second
Figure PCTCN2020080880-appb-000008
It is obtained by averaging the W beat ECG signal in the noiseless ECG signal. Since the synthetic ECG signal is synthesized by the noise-free ECG signal and the noise signal, the noise-free ECG signal has the same characteristics as the R peak position and RR distance of the synthesized ECG signal, so it is combined with the synthesized ECG signal. Compared with the second average ECG signal obtained by averaging, the second average ECG signal obtained by averaging the noiseless ECG signal has less noise and EMG noise, and then more EMG noise is retained to contain noise In the remaining ECG signal, the trained target noise reduction autoencoder can learn the noise reduction function for this part of the EMG noise.
在第二平均心电信号
Figure PCTCN2020080880-appb-000009
是通过对第一用户上历史采集的心电信号中W拍心电信号进行平均处理得到的情况下。针对同一用户的心电信号,采用同一第二平均心电信号。该方式得到第二平均心电信号生成的基准心电信号考虑到个人的差异,使得基准心电信号可以更准确地表示合成心电信号的明显特征,对于同一用户得到的基准心电信号,仅需要进行一次计算,提高计算效率。
Average ECG signal in the second
Figure PCTCN2020080880-appb-000009
It is obtained by averaging the W-beat ECG signals from the historically collected ECG signals of the first user. For the ECG signal of the same user, the same second average ECG signal is used. The reference ECG signal generated by the second average ECG signal obtained in this way takes into account individual differences, so that the reference ECG signal can more accurately represent the obvious characteristics of the synthesized ECG signal. For the reference ECG signal obtained by the same user, only A calculation is required to improve calculation efficiency.
在利用平均节拍减法(average beat subtraction)将合成心电信号分解为基准心电信号和含噪剩余心电信号的第二种实现中:In the second implementation that uses average beat subtraction to decompose the synthesized ECG signal into the reference ECG signal and the noisy residual ECG signal:
训练设备可以检测目标心电信号中的W拍心电信号中每一拍心电信号的R峰(即R波的顶点),该R峰即为一拍心电信号中能量值最大的采样点;对目标心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W≤H,W为正整数;将第二平均心电信号替换合成心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示H拍心电信号中以R j为基准左取Δt1右取Δt2得到的区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H,进而,从合成心电信号中移除待降噪基准心电信号,得到含噪剩余心电信号。 The training equipment can detect the R peak of each beat of the ECG signal in the target ECG signal (that is, the apex of the R wave) in the W beat ECG signal, and the R peak is the sampling point with the largest energy value in the one beat ECG signal ; Perform average processing on the W-beat ECG signal in the target ECG signal to obtain the second average ECG signal, W≤H, W is a positive integer; Replace the H-beat ECG signal in the synthesized ECG signal with the second average ECG signal A j corresponding to the signal, the reference ECG signal is obtained, A j represents the ECG signal in the interval obtained by taking R j as the reference in the H-beat ECG signal, taking Δt1 on the left and taking Δt2 on the right, and R j is the W-beat ECG The apex of the QRS complex in the signal, j = 1, 2...H, and then remove the reference ECG signal to be noise-reduced from the synthesized ECG signal to obtain the noisy residual ECG signal.
此时,得到的第二平均心电信号的R峰左侧包括Δt1的心电信号,右侧包括Δt2的心电信号,该目标心电信号可以是合成心电信号、无噪心电信号、或者从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等。At this time, the R peak of the second average ECG signal obtained includes the ECG signal of Δt1 on the left and the ECG signal of Δt2 on the right. The target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, Or the historically collected ECG signals from the first user (that is, the user whose noise-free ECG signals are collected).
第二平均心电信号的一种具体实现可以是针对W拍心电信号中的每一拍心电信号,选取以R峰为基准左取Δt1右取Δt2得到的区间内的心电信号,得到W个心电信号片段。进而,对该W个心电信号片段进行平均处理,得到第二平均心电信号。其中,每一个心电信号片段包括一个QRS波群,且所有心电信号片段中R峰位置相对于其所在心电信号片段的起点位置的距离相同,即W个心电信号片段在R峰同一侧的采样点个数都相同,以保证W个心电信号片段对齐。A specific implementation of the second average ECG signal may be to select the ECG signal in the interval obtained by taking the left Δt1 and the right taking Δt2 based on the R peak for each beat of the W beat ECG signal, and obtain W ECG signal segments. Furthermore, the W ECG signal segments are averaged to obtain a second average ECG signal. Among them, each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, W ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure that the W ECG signal segments are aligned.
例如,被选取的W个心电信号片段都包括V个采样点,其中,R峰都位于第Z个采样点,V、Z为大于1的整数,Z小于V。For example, the selected W ECG signal segments all include V sampling points, where the R peaks are all located at the Z-th sampling point, V and Z are integers greater than 1, and Z is less than V.
第二平均心电信号
Figure PCTCN2020080880-appb-000010
是通过对W个心电信号片段C k(k=1,2……W)进行平均处理得到的。此时,C k表示W拍心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
Second average ECG signal
Figure PCTCN2020080880-appb-000010
It is obtained by averaging W ECG signal segments C k (k=1, 2...W). At this time, C k represents the ECG signal in the interval obtained by taking R k as the reference Δt1 and Δt2 in the W-beat ECG signal, R k is the apex of the QRS complex in the W-beat ECG signal, k=1, 2 ...W.
Figure PCTCN2020080880-appb-000011
Figure PCTCN2020080880-appb-000011
其中,
Figure PCTCN2020080880-appb-000012
表示第二平均心电信号,A k表示W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
among them,
Figure PCTCN2020080880-appb-000012
Represents the second average ECG signal, Ak represents the ECG signal in the interval of Δt taken from the left and right sides of the W-beat ECG signal with R k as the center, R k is the apex of the QRS complex in the W-beat ECG signal, k= 1,2……W.
进一步地,第二平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式:Further, the second average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
Figure PCTCN2020080880-appb-000013
Figure PCTCN2020080880-appb-000013
其中,
Figure PCTCN2020080880-appb-000014
为第二平均心电信号
Figure PCTCN2020080880-appb-000015
中第v个采样点的值,C k(v)为W拍心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号中的第v个采样点的值,1≤v≤V,1≤k≤W,v,k为正整数。
among them,
Figure PCTCN2020080880-appb-000014
Is the second average ECG signal
Figure PCTCN2020080880-appb-000015
The value of the v-th sampling point in the W beat ECG signal, C k (v) is the value of the v-th sampling point in the ECG signal in the interval obtained by taking R k as the reference Δt1 in the W beat ECG signal, 1≤ v≤V, 1≤k≤W, v and k are positive integers.
在第二平均心电信号的另一种实现中,训练设备可以从目标心电信号中划分出W拍心电信号,进而,检测W拍心电信号中每一拍心电信号的R峰,该R峰即为一拍心电信号中幅值最大的采样点;进而,以R峰为基准将W拍心电信号进行对齐,此时,对齐后,每一个位置的采样点的个数不大于W,进而,将对齐后的W拍心电信号进行平均,得到第二平均心电信号。具体的,可以计算每一个位置上的一个或多个采样点的平均幅值,计算的得到各个位置的平均幅值,得到平均心电信号,进而选取该平均心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号,得到第二平均心电信号。 In another implementation of the second average ECG signal, the training device can divide the W-beat ECG signal from the target ECG signal, and then detect the R peak of each beat of the ECG signal in the W-beat ECG signal, The R peak is the sampling point with the largest amplitude in the one-beat ECG signal; furthermore, the W-beat ECG signal is aligned based on the R peak. At this time, after the alignment, the number of sampling points at each position is not Is greater than W, and then the aligned W beat ECG signals are averaged to obtain a second average ECG signal. Specifically, the average amplitude of one or more sampling points at each position can be calculated, the average amplitude of each position can be calculated, and the average ECG signal can be obtained, and then the average ECG signal is selected based on R k Δt1 takes the ECG signal in the interval obtained by Δt2 to the right to obtain the second average ECG signal.
此时,R峰在被划分得到的N拍心电信号中的位置可能各不相同,该N拍心电信号的长度可以相同或不同。将W拍心电信号对齐后得到的位置进行编号,k表示该W拍心电信号对齐后得到的位置的索引。At this time, the position of the R peak in the divided N-beat ECG signal may be different, and the length of the N-beat ECG signal may be the same or different. Number the positions obtained after the W-beat ECG signal is aligned, and k represents the index of the position obtained after the W-beat ECG signal is aligned.
此时,
Figure PCTCN2020080880-appb-000016
为平均心电信号
Figure PCTCN2020080880-appb-000017
中第v个采样点的值,可以表示为:
Figure PCTCN2020080880-appb-000018
其中,
Figure PCTCN2020080880-appb-000019
为平均心电信号
Figure PCTCN2020080880-appb-000020
中第v个采样点的值,D k(v)为W拍心电信号中以R k为所在的一拍心电信号中位置v处采样点的值,1≤v≤V,1≤k≤W,v,k为正整数。若心电信号D k中位置v处无采样点分布,则D k(v)为0。
at this time,
Figure PCTCN2020080880-appb-000016
Average ECG signal
Figure PCTCN2020080880-appb-000017
The value of the v-th sampling point in can be expressed as:
Figure PCTCN2020080880-appb-000018
among them,
Figure PCTCN2020080880-appb-000019
Average ECG signal
Figure PCTCN2020080880-appb-000020
The value of the v-th sampling point in the W-beat ECG signal, D k (v) is the value of the sampling point at position v in the W-beat ECG signal with R k as the location, 1≤v≤V, 1≤k ≤W, v and k are positive integers. If there is no sampling point distribution at position v in the ECG signal D k , then D k (v) is zero.
进一步地,选取平均心电信号
Figure PCTCN2020080880-appb-000021
以R k为基准Δt1右取Δt2得到的区间内的心电信号,得到第二平均心电信号
Figure PCTCN2020080880-appb-000022
Further, select the average ECG signal
Figure PCTCN2020080880-appb-000021
Take R k as the reference Δt1 and take the ECG signal in the interval obtained by Δt2 to get the second average ECG signal
Figure PCTCN2020080880-appb-000022
第二方面,本申请实施例还提供了一种心电信号降噪方法,包括:训练设备将无噪心电信号与肌电噪声信号叠加,得到合成心电信号,其中,无噪心电信号中肌电噪声的信噪比(signal-to-noise ratio,SNR)不小于第一阈值,无噪心电信号可以包括多拍心电信号H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的整数;利用平均节拍减法将无噪心电信号分解为基准心电信号和无噪剩余心电信号;从合成心电信号中移除基准心电信号,得到含噪剩余心电信号;进而,根据含噪剩余心电信号和该含噪剩余心电信号对应的无噪剩余心电信号训练降噪自编码器,其中,含噪剩余心电信号为训练输入,该含噪剩余心电信号对应的无噪剩余心电信号为训练标签。In the second aspect, the embodiment of the present application also provides an ECG signal noise reduction method, including: the training device superimposes the noiseless ECG signal and the EMG noise signal to obtain a synthetic ECG signal, wherein the noiseless ECG signal The signal-to-noise ratio (SNR) of the medium myoelectric noise is not less than the first threshold. The noise-free ECG signal may include multi-beat ECG signals, H-beat ECG signals, and each ECG signal includes a QRS Wave group, H is an integer greater than 1; use average beat subtraction to decompose the noiseless ECG signal into the reference ECG signal and the noiseless residual ECG signal; remove the reference ECG signal from the synthesized ECG signal to obtain the noise The residual ECG signal; further, the noise-reducing autoencoder is trained according to the noisy residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal, wherein the noisy residual ECG signal is the training input, the The noise-free residual ECG signal corresponding to the noisy residual ECG signal is the training label.
应理解,利用平均节拍减法将合成心电信号分解得到的基准心电信号的R峰位置与合成心电信号的R峰位置相同。It should be understood that the R peak position of the reference ECG signal obtained by decomposing the synthetic ECG signal using the average beat subtraction method is the same as the R peak position of the synthetic ECG signal.
应理解,上述得到含噪剩余心电信号和该含噪剩余心电信号对应的噪剩余心电信号组成一个训练样本,生成训练样本的具体实现也可以通过训练设备之前的其他设备或装置完成,训练设备可以接收生成训练样本的设备或装置发送的训练样本,此处,不作限定。It should be understood that the obtained noisy residual ECG signal and the noisy residual ECG signal corresponding to the noisy residual ECG signal form a training sample, and the specific realization of generating the training sample can also be completed by other equipment or devices before the training device. The training device may receive training samples sent by the device or device that generates the training samples, which is not limited here.
上述方法训练设备通过含噪剩余心电信号作为降噪自编码器的输入,以无噪剩余心电信号作为标签,训练降噪自编码器,此时,训练输入的含噪剩余心电信号剔除了合成心电信号中明显特征(比如,R峰位置、R-R间距等),该降噪自编码器只需要提取合成心电信号的细节信息的编码表示,而不需要获取整个合成心电信号的编码表示,进而,降低训练难度,使得训练得到的目标降噪自编码器可以更好地提取到含噪剩余心电信号中的细节特征,从而提高得到的目标降噪自编码器的降噪性能。In the above method, the training equipment uses the noisy residual ECG signal as the input of the noise reduction autoencoder, and uses the noise-free residual ECG signal as the label to train the noise reduction autoencoder. At this time, the training input noisy residual ECG signal is removed In addition to the obvious features in the synthesized ECG signal (such as R peak position, RR interval, etc.), the noise reduction autoencoder only needs to extract the encoding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the entire synthesized ECG signal. Encoding representation, in turn, reduces the difficulty of training, so that the trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder .
利用平均节拍减法将无噪心电信号分解为基准心电信号和无噪剩余心电信号的具体实现方法同可以参见上述第一方面中利用平均节拍减法将无噪心电信号分解为基准心电信号和无噪剩余心电信号中相关描述,此处不再赘述。The specific implementation method of decomposing the noise-free ECG signal into the reference ECG signal and the noise-free residual ECG signal using the average beat subtraction method can be referred to in the first aspect above, using the average beat subtraction method to decompose the noise-free ECG signal into the reference ECG signal. The related description in the signal and the noise-free residual ECG signal will not be repeated here.
第三方面,本申请实施例还提供了一种心电信号降噪方法,包括:执行设备获取待降噪心电信号,该待降噪心电信号包含M拍心电信号,每拍心电信号包含一个QRS波群,M为大于1的正整数;利用平均节拍减法(average beat subtraction)将待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号;将待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号;将待降噪基准心电信号和降噪后的剩余心电信号叠加,得到降噪后的心电信号。In a third aspect, an embodiment of the present application also provides an ECG signal denoising method, including: executing a device to obtain an ECG signal to be denoised. The ECG signal to be denoised includes M beats of the ECG signal. The signal contains a QRS complex, and M is a positive integer greater than 1. Use average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised; The remaining ECG signal to be denoised is input into the target noise reduction autoencoder to obtain the denoised residual ECG signal; the denoised reference ECG signal and the denoised residual ECG signal are superimposed to obtain the denoised heart electric signal.
应理解,待降噪基准心电信号计算方法与训练得到目标降噪自编码器涉及的基准心电信号的计算方法相同。It should be understood that the calculation method of the reference ECG signal to be denoised is the same as the calculation method of the reference ECG signal involved in the target denoising autoencoder obtained by training.
还应理解,上述执行设备具体可以是智能手环、智能手表等可穿戴设备,也可以是手机、平板电脑、个人计算机等终端,还可以是服务器、云端等。It should also be understood that the above-mentioned execution device may specifically be a wearable device such as a smart bracelet or a smart watch, a terminal such as a mobile phone, a tablet computer, and a personal computer, or a server, a cloud, and the like.
执行上述方法,从待降噪心电信号中移除包括该待降噪心电信号的R峰位置、R-R间距等明显特征的待降噪基准心电信号,通过目标降噪自编码器对待降噪心电信号去除待降噪基准心电信号之后的待降噪剩余心电信号进行降噪,避免目标降噪自编码器对待降噪心电信号中明显特征的降噪处理,使得待降噪基准心电信号和降噪后的剩余心电信号叠加得 到降噪后的心电信号可以更好地保留待降噪心电信号中的R峰位置、R-R间距等明显特征,减少降噪后的心电信号的失真。Perform the above method, remove from the ECG signal to be denoised, including the R peak position of the ECG signal to be denoised, the RR interval and other obvious characteristics of the reference ECG signal to be denoised, and use the target noise reduction autoencoder to be denoised. The residual ECG signal to be denoised after the denoising reference ECG signal is removed from the denoising ECG signal, to avoid the target denoising autoencoder from denoising the obvious features in the denoising ECG signal, making the denoising The reference ECG signal and the residual ECG signal after noise reduction are superimposed to obtain the noise-reduced ECG signal, which can better retain the obvious characteristics of the R peak position and RR interval in the ECG signal to be noise-reduced, and reduce the noise after noise reduction. Distortion of the ECG signal.
可选地,上述目标降噪自编码器可以是通过第一方面或第二方面中降噪自编码器的训练方法得到的。具体训练方法可以参见上述第一方面中相关描述,本申请实施例不再赘述。Optionally, the above-mentioned target noise reduction autoencoder may be obtained through the training method of the noise reduction autoencoder in the first aspect or the second aspect. For the specific training method, refer to the related description in the above-mentioned first aspect, which is not repeated in the embodiment of the present application.
进一步地,降噪所采用的目标降噪自编码器是以合成心电信号移除基准心电信号后得到的含噪剩余心电信号作为降噪自编码器的输入,以无噪心电信号移除基准心电信号后得到的无噪剩余心电信号作为标签,训练降噪自编码器器得到的,此时,训练输入的含噪剩余心电信号剔除了合成心电信号中明显特征(比如,R峰位置、R-R间距),该降噪自编码器只需要提取合成心电信号的细节信息的编码表示,而不需要获取整个合成心电信号的编码表示,进而,降低训练难度,使得训练得到的目标降噪自编码器可以更好地提取到含噪剩余心电信号中的细节特征,从而提高得到的目标降噪自编码器的降噪性能。Furthermore, the target noise reduction autoencoder used for noise reduction uses the noisy residual ECG signal obtained after removing the reference ECG signal from the synthetic ECG signal as the input of the noise reduction autoencoder, and the noiseless ECG signal The noise-free residual ECG signal obtained after the reference ECG signal is removed is used as the label, and the noise reduction autoencoder is trained. At this time, the noisy residual ECG signal input for training removes the obvious features in the synthetic ECG signal ( For example, R peak position, RR interval), the noise reduction autoencoder only needs to extract the coding representation of the detailed information of the synthesized ECG signal, and does not need to obtain the coding representation of the entire synthesized ECG signal, thereby reducing the difficulty of training, making The trained target denoising autoencoder can better extract the detailed features in the noisy residual ECG signal, thereby improving the noise reduction performance of the obtained target denoising autoencoder.
在一种可能的实现中,执行设备可以是配置了心电传感器的可穿戴设备或终端,如智能手环、智能手表等,此时,执行设备获取待降噪心电信号的一种具体实现可以是:执行设备通过心电传感器采集用户皮肤表面的模拟心电信号;进而,通过数模转换模块对该模拟心电信号进行处理,得到数字化的待降噪心电信号。In a possible implementation, the execution device may be a wearable device or terminal equipped with an ECG sensor, such as a smart bracelet, smart watch, etc. At this time, the execution device obtains a specific realization of the ECG signal to be noise-reduced It may be: the execution device collects the analog ECG signal on the surface of the user's skin through the ECG sensor; further, the analog ECG signal is processed through the digital-to-analog conversion module to obtain the digital ECG signal to be denoised.
在另一种可能的实现中,执行设备可以是服务器或终端等,此时,执行设备获取待降噪心电信号的一种具体实现可以是:执行设备接收心电采集设备发送的待降噪心电信号。其中,心电采集设备可以是配置了心电传感器的可穿戴设备或终端等。In another possible implementation, the execution device may be a server or a terminal, etc. At this time, a specific implementation for the execution device to obtain the ECG signal to be noise-reduced may be: the execution device receives the noise-reduction sent by the ECG acquisition device ECG signal. Among them, the ECG acquisition device may be a wearable device or a terminal equipped with an ECG sensor.
在又一种可能的实现中,执行设备利用平均节拍减法(average beat subtraction)将待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号的第一种实现可以是:In another possible implementation, the execution device uses average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the first realization of the remaining ECG signal to be denoised. Yes:
执行设备对待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,N小于M,N为正整数;将第一平均心电信号替换待降噪心电信号中M拍心电信号对应的B j,得到待降噪基准心电信号,B j表示所述M拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为M拍心电信号中QRS波群的顶点,j=1,2……M;进而,从待降噪心电信号中移除待降噪基准心电信号,得到待降噪剩余心电信号。 The execution device averages the N beats of the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer; replace the first average ECG signal in the ECG signal to be noise-reduced B j corresponding to the M beat ECG signal, obtain the reference ECG signal to be noise-reduced, B j represents the ECG signal in the interval of Δt taken from the left and right sides of the M beat ECG signal with R j as the center, and R j is M Snap the apex of the QRS complex in the ECG signal, j=1, 2...M; then, remove the reference ECG signal to be denoised from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
信号平均的方法可以去除噪声,因此,上述形成的待降噪基准心电信号保留了待降噪心电信号中的R峰位置、R-R间距等明显特征,且不含噪声。The signal averaging method can remove noise. Therefore, the above-mentioned reference ECG signal to be denoised retains the R peak position and R-R distance in the ECG signal to be denoised and does not contain noise.
在第一平均心电信号的实现方式1中:In the first average ECG signal realization method 1:
第一平均心电信号
Figure PCTCN2020080880-appb-000023
是通过对待降噪心电信号中N拍心电信号进行平均处理得到的,即:
First average ECG signal
Figure PCTCN2020080880-appb-000023
It is obtained by averaging the N-beat ECG signal in the ECG signal to be noise-reduced, namely:
Figure PCTCN2020080880-appb-000024
Figure PCTCN2020080880-appb-000024
其中,
Figure PCTCN2020080880-appb-000025
表示第一平均心电信号,B i表示N拍心电信号中以R i为中心左右各取Δt区间内的心电信号,R i为所述N拍心电信号中QRS波群的顶点,i=1,2……N。
among them,
Figure PCTCN2020080880-appb-000025
Represents a first average ECG, B i represents N ECG beat to about the center R i in the ECG signal from each interval Δt, R i shot vertex ECG QRS complex to the N, i=1, 2……N.
进一步地,第一平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式
Figure PCTCN2020080880-appb-000026
来计算,
Figure PCTCN2020080880-appb-000027
为第一平均心电信号
Figure PCTCN2020080880-appb-000028
中第v个采样点的值,B i(v)为W拍心电信号片段中以R i为中心左右各取Δt区间内 的心电信号中的第v个采样点的值,v=1,2……V,i=1,2……N。
Further, the first average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average can be determined by the formula
Figure PCTCN2020080880-appb-000026
To calculate,
Figure PCTCN2020080880-appb-000027
Is the first average ECG signal
Figure PCTCN2020080880-appb-000028
In the v-th sampling point values, B i (v) about the center from each of W Sign v-th sampling point in the ECG interval Δt electrical signals to heart fragment is the value R i, v = 1 ,2……V,i=1,2……N.
可见,针对不同的待降噪心电信号,得到的第一平均心电信号不同,进而通过该第一平均心电信号得到的基准心电信号也不同。在本申请实施例中,针对不同的待降噪心电信号自适应地选择基准心电信号,得到的基准心电信号可以更准确地提取出了待降噪心电信号的明显特征,进而降噪后的心电信号可以更好地保留待降噪心电信号中的明显特征,减少降噪后的心电信号的失真,提高降噪后的心电信号的质量。It can be seen that for different ECG signals to be denoised, the obtained first average ECG signals are different, and the reference ECG signals obtained from the first average ECG signals are also different. In the embodiment of the present application, the reference ECG signal is adaptively selected for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, thereby reducing The noisy ECG signal can better retain the obvious features of the ECG signal to be denoised, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
在第一平均心电信号的实现方式2中:In the implementation of the first average ECG signal:
第一平均心电信号
Figure PCTCN2020080880-appb-000029
是通过对第二用户(被采集得到待降噪心电信号的用户)上历史采集的心电信号中N拍心电信号进行平均处理得到的。具体计算方法同可以上述第一平均心电信号的实现方式1,可参见上述实现方式1中相关描述,此处不再赘述。
First average ECG signal
Figure PCTCN2020080880-appb-000029
It is obtained by averaging the N-beat ECG signals from the historically collected ECG signals of the second user (the user whose ECG signals to be denoised is collected). The specific calculation method is the same as that of the above-mentioned first average electrocardiogram signal implementation manner 1, please refer to the related description in the above-mentioned implementation manner 1, which will not be repeated here.
此时,针对同一用户的心电信号,采用同一第一平均心电信号。该实现方式5得到第一平均心电信号生成的待降噪基准心电信号考虑到个人的差异,使得待降噪基准心电信号可以更准确地表示待降噪心电信号的明显特征,相对于第一平均心电信号的实现方式4来说,对于同一用户得到的待降噪基准心电信号,仅需要进行一次计算,提高计算效率。At this time, for the ECG signals of the same user, the same first average ECG signal is used. The implementation manner 5 obtains the reference ECG signal to be denoised generated by the first average ECG signal, taking into account individual differences, so that the reference ECG signal to be denoised can more accurately represent the obvious characteristics of the ECG signal to be denoised, relatively For the implementation of the first average ECG signal 4, for the reference ECG signal to be noise-reduced obtained by the same user, only one calculation is required, which improves the calculation efficiency.
在又一种可能的实现中,执行设备对利用平均节拍减法(average beat subtraction)将待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号的第二种实现可以是:In another possible implementation, the execution device uses average beat subtraction to decompose the ECG signal to be noise-reduced into the reference ECG signal to be noise-reduced and the second implementation of the remaining ECG signal to be noise-reduced Can be:
上述利用平均节拍减法将待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号的第一种实现中B i表示M拍心电信号中以R j为基准Δt1右取Δt2得到的区间内的心电信号,A k表示W拍心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。 The above-mentioned method uses the average beat subtraction method to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised. In the first implementation, B i represents the M beat ECG signal with R j as the reference Δt1 Take the ECG signal in the interval obtained by Δt2 on the right, Ak represents the ECG signal in the interval obtained by taking R k as the reference in the W beat ECG signal, Δt1 and take the ECG signal in the interval obtained by taking Δt2 on the right, R k is the QRS wave in the W beat ECG signal For the vertices of the group, k = 1, 2...W.
第二平均心电信号的具体的计算方式同第一种实现中描述的第二平均心电信号的计算方式,可以参见上述第一种实现中相关描述,此处不再赘述。The specific calculation method of the second average electrocardiogram signal is the same as the calculation method of the second average electrocardiogram signal described in the first implementation. You can refer to the related description in the first implementation above, and will not be repeated here.
第四方面,本申请实施例还提供一种降噪自编码的训练装置,该装置包括用于执行如第一方面中的方法的模块。In a fourth aspect, an embodiment of the present application also provides a training device for noise reduction and self-encoding, and the device includes a module for executing the method in the first aspect.
第五方面,提供一种降噪自编码的训练装置,该装置包括:存储器,用于存储程序;处理器,用于执行存储器存储的程序,当存储器存储的程序被执行时,处理器用于执行第一方面中的方法。In a fifth aspect, a training device for noise reduction and self-encoding is provided. The device includes: a memory for storing a program; a processor for executing a program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute The method in the first aspect.
第六方面,本申请实施例还提供一种降噪自编码的训练装置,该装置包括用于执行如第二方面中的方法的模块。In a sixth aspect, an embodiment of the present application also provides a training device for noise reduction and self-encoding, which includes a module for executing the method in the second aspect.
第七方面,提供一种降噪自编码的训练装置,该装置包括:存储器,用于存储程序;处理器,用于执行存储器存储的程序,当存储器存储的程序被执行时,处理器用于执行第二方面中的方法。In a seventh aspect, a training device for noise reduction and self-encoding is provided. The device includes: a memory for storing programs; a processor for executing programs stored in the memory, and when the programs stored in the memory are executed, the processor is configured to execute The method in the second aspect.
第八方面,本申请实施例还提供一种心电信号降噪装置,该装置包括用于执行如第三方面中的方法的模块。In an eighth aspect, an embodiment of the present application also provides an electrocardiographic signal noise reduction device, which includes a module for executing the method in the third aspect.
第九方面,提供一种心电信号降噪装置,该装置包括:存储器,用于存储程序;处理器,用于执行存储器存储的程序,当存储器存储的程序被执行时,处理器用于执行第三方 面中的方法。In a ninth aspect, an electrocardiographic signal noise reduction device is provided. The device includes: a memory for storing a program; a processor for executing a program stored in the memory. When the program stored in the memory is executed, the processor is configured to execute the first The method in three aspects.
第十方面,提供一种计算机可读介质,该计算机可读介质存储用于设备执行的程序代码,该程序代码包括用于执行第一方面中的方法。In a tenth aspect, a computer-readable medium is provided, and the computer-readable medium stores program code for device execution, and the program code includes the method for executing the method in the first aspect.
第十一方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第一方面中的方法。In an eleventh aspect, a computer program product containing instructions is provided, when the computer program product runs on a computer, the computer executes the method in the first aspect.
第十二方面,提供一种计算机可读介质,该计算机可读介质存储用于设备执行的程序代码,该程序代码包括用于执行第二方面中的方法。In a twelfth aspect, a computer-readable medium is provided, and the computer-readable medium stores program code for device execution, and the program code includes a method for executing the method in the second aspect.
第十三方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第二方面中的方法。In a thirteenth aspect, a computer program product containing instructions is provided, which when the computer program product runs on a computer, causes the computer to execute the method in the above second aspect.
第十四方面,提供一种计算机可读介质,该计算机可读介质存储用于设备执行的程序代码,该程序代码包括用于执行第三方面中的方法。In a fourteenth aspect, a computer-readable medium is provided, and the computer-readable medium stores program code for device execution, and the program code includes the method for executing the method in the third aspect.
第十五方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第三方面中的方法。In a fifteenth aspect, a computer program product containing instructions is provided, which when the computer program product runs on a computer, causes the computer to execute the method in the third aspect.
第十六方面,提供一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上存储的指令,执行第一方面中的方法。In a sixteenth aspect, a chip is provided. The chip includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface, and executes the method in the first aspect.
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行第一方面中的方法。Optionally, as an implementation manner, the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory. When the instructions are executed, the The processor is used to execute the method in the first aspect.
第十七方面,提供一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上存储的指令,执行第二方面中的方法。In a seventeenth aspect, a chip is provided. The chip includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface and executes the method in the second aspect.
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行第二方面中的方法。Optionally, as an implementation manner, the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory. When the instructions are executed, the The processor is used to execute the method in the second aspect.
第十八方面,提供一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上存储的指令,执行第三方面中的方法。In an eighteenth aspect, a chip is provided. The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface, and executes the method in the third aspect.
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行第三方面中的方法。Optionally, as an implementation manner, the chip may further include a memory in which instructions are stored, and the processor is configured to execute instructions stored on the memory. When the instructions are executed, the The processor is used to execute the method in the third aspect.
第十九方面,提供一种电子设备,该电子设备包括上述第四方面至第五方面中的任意一个方面中的降噪自编码的训练装置。In a nineteenth aspect, an electronic device is provided, which includes the noise reduction self-encoding training device in any one of the foregoing fourth to fifth aspects.
第二十方面,提供一种电子设备,该电子设备包括上述第六方面至第七方面中的任意一个方面中的降噪自编码的训练装置。According to a twentieth aspect, an electronic device is provided, the electronic device including the noise reduction self-encoding training device in any one of the above-mentioned sixth to seventh aspects.
第二十一方面,提供一种电子设备,该电子设备包括上述第八方面至第九方面中的任意一个方面中的心电信号降噪装置。In a twenty-first aspect, there is provided an electronic device, which includes the electrocardiographic signal noise reduction device in any one of the eighth to ninth aspects.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或背景技术中的技术方案,下面将对本发明实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background art, the following will describe the drawings that need to be used in the embodiments of the present invention or the background art.
图1A是本发明实施例提供的一种心电信号自动分析过程的流程示意图;FIG. 1A is a schematic flowchart of an automatic analysis process of an ECG signal provided by an embodiment of the present invention;
图1B是本发明实施例提供的一种智能手表的结构示意图;FIG. 1B is a schematic structural diagram of a smart watch provided by an embodiment of the present invention;
图2是本发明实施例提供的一种ECG波形的示意性说明图;2 is a schematic explanatory diagram of an ECG waveform provided by an embodiment of the present invention;
图3是本发明实施例提供的一种自编码器的原理示意图;Fig. 3 is a schematic diagram of the principle of a self-encoder provided by an embodiment of the present invention;
图4是本发明实施例提供的一种系统框架的示意图;4 is a schematic diagram of a system framework provided by an embodiment of the present invention;
图5是本发明实施例提供的一种降噪自编码器的网络结构图;Figure 5 is a network structure diagram of a noise reduction autoencoder provided by an embodiment of the present invention;
图6是本发明实施例提供的一种芯片硬件结构的示意图;Figure 6 is a schematic diagram of a chip hardware structure provided by an embodiment of the present invention;
图7A是本发明实施例提供的一种降噪自编码器的训练方法的流程示意图;FIG. 7A is a schematic flowchart of a training method for a noise reduction autoencoder according to an embodiment of the present invention;
图7B是本发明实施例提供的一种降噪自编码器的训练方法的示意性说明图;FIG. 7B is a schematic explanatory diagram of a method for training a noise reduction autoencoder according to an embodiment of the present invention;
图7C是本发明实施例提供的一种计算基准心电信号的原理示意图;FIG. 7C is a schematic diagram of the principle of calculating a reference ECG signal according to an embodiment of the present invention;
图7D是本发明实施例提供的另一种降噪自编码器的训练方法的流程示意图;7D is a schematic flowchart of another method for training a noise reduction autoencoder according to an embodiment of the present invention;
图8A是本发明实施例提供的一种心电信号降噪方法的流程示意图;FIG. 8A is a schematic flowchart of a method for reducing noise of an ECG signal according to an embodiment of the present invention;
图8B是本发明实施例提供的一种心电信号降噪方法的示意性说明图;8B is a schematic explanatory diagram of an ECG signal noise reduction method provided by an embodiment of the present invention;
图8C是本发明实施例提供的一种计算待降噪基准心电信号的原理示意图;FIG. 8C is a schematic diagram of a principle of calculating a reference ECG signal to be denoised according to an embodiment of the present invention;
图8D是本发明实施例提供的一种目标降噪自编码器的心电信号的降噪结果的示意性说明图;8D is a schematic explanatory diagram of a noise reduction result of an ECG signal of a target noise reduction autoencoder according to an embodiment of the present invention;
图9A是本发明实施例提供的一种降噪自编码器的训练装置的示意性框图;FIG. 9A is a schematic block diagram of a training device for a noise reduction autoencoder according to an embodiment of the present invention;
图9B是本发明实施例提供的另一种降噪自编码器的训练装置的示意性框图;FIG. 9B is a schematic block diagram of another apparatus for training a noise reduction autoencoder according to an embodiment of the present invention;
图10是本发明实施例提供的一种心电信号降噪装置的示意性框图;10 is a schematic block diagram of an electrocardiographic signal noise reduction device provided by an embodiment of the present invention;
图11是本申请实施例提供的一种降噪自编码器的训练装置的硬件结构示意图;FIG. 11 is a schematic diagram of the hardware structure of a training device for a noise reduction autoencoder provided by an embodiment of the present application;
图12是本申请实施例提供的心电信号降噪装置的硬件结构示意图。FIG. 12 is a schematic diagram of the hardware structure of an electrocardiographic signal noise reduction device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below in conjunction with the drawings.
本申请实施例提供的心电信号降噪方法能够应用在心电信号分析、识别、诊断等场景。具体而言,本申请实施例的心电信号降噪方法可以应用如下场景中:The ECG signal noise reduction method provided in the embodiments of the present application can be applied to scenarios such as ECG signal analysis, identification, and diagnosis. Specifically, the ECG signal noise reduction method of the embodiment of the present application can be applied in the following scenarios:
应用场景AApplication scenario A
通过机器学习技术可以帮助医生进行心电图的诊断,心电信号的质量直接影响对心电信号分析的准确率。如图1A所示的心电信号自动分析过程的流程示意图,对心电信号自动分析主要包括两个处理过程,分别是心电信号的降噪和针对降噪后的心电信号的分析。本申请实施例提供的心电信号降噪方法可以应用于心电信号的降噪处理过程中。Machine learning technology can help doctors perform ECG diagnosis, and the quality of ECG signals directly affects the accuracy of ECG signal analysis. As shown in Fig. 1A, a schematic flow diagram of the automatic analysis process of the ECG signal. The automatic analysis of the ECG signal mainly includes two processing processes, namely the noise reduction of the ECG signal and the analysis of the ECG signal after the noise reduction. The ECG signal noise reduction method provided in the embodiments of the present application can be applied to the noise reduction process of the ECG signal.
本申请实施例提供的心电降噪方法首先利用平均节拍减法将待降噪心电信号分解为待降噪基准心电信号和含噪剩余心电信号,即,首先根据该待降噪心电信号得到保留该待降噪心电信号的R峰位置、R-R间距等明显特征的基准心电信号(也即本申请实施例中待降噪基准心电信号),进而从待降噪心电信号中移除基准心电信号,得到待降噪剩余心电信号,进一步地,将待降噪剩余心电信号输入到目标降噪自编码器,通过目标降噪自编码器对该待降噪剩余心电信号进行降噪处理,得到降噪后的剩余心电信号,进而,将降噪后的剩余心电信号和基待降噪基准心电信号相加(本文中也称为“叠加”)得到的心电信号即为该待降噪心电信号降噪后的心电信号。The ECG noise reduction method provided by the embodiments of the present application first uses the average beat subtraction method to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the noise-containing residual ECG signal, that is, first according to the ECG to be denoised The signal obtains a reference ECG signal that retains obvious features such as the R peak position and RR interval of the ECG signal to be denoised (that is, the reference ECG signal to be denoised in the embodiment of this application), and then obtains the reference ECG signal to be denoised The reference ECG signal is removed from the system to obtain the remaining ECG signal to be denoised. Further, the remaining ECG signal to be denoised is input to the target noise reduction autoencoder, and the target noise reduction autoencoder The ECG signal undergoes noise reduction processing to obtain the noise-reduced residual ECG signal, and then the noise-reduced residual ECG signal is added to the reference ECG signal to be noise-reduced (also referred to as "superposition" in this article) The obtained ECG signal is the ECG signal after the noise reduction of the ECG signal to be reduced.
其中,目标降噪自编码器为训练好的神经网络,该目标降噪自编码器是通过多个训练样本训练一个初始化的降噪自编码器得到,该训练样本包括含噪剩余心电信号和该含噪剩余心电信号对应的无噪剩余心电信号,其中,该含噪剩余心电信号是合成心电信号去除基准心电信号后得到的信号,合成心电信号为无噪剩余心电信号与肌电噪声信号叠加后的信号,含噪剩余心电信号对应的无噪剩余心电信号即为无噪心电信号去除基准心电信号得到的信号。其中,基准心电信号是从合成心电信号或该无噪心电信号中提取得到的,保留了合成心电信号的R峰位置、R-R间距等明显特征。Among them, the target denoising autoencoder is a trained neural network. The target denoising autoencoder is obtained by training an initialized denoising autoencoder through multiple training samples. The training samples include noisy residual ECG signals and The noise-free residual ECG signal corresponding to the noisy residual ECG signal, where the noise-containing residual ECG signal is the signal obtained after removing the reference ECG signal from the synthesized ECG signal, and the synthesized ECG signal is the noise-free residual ECG signal The signal superimposed with the EMG noise signal, the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal is the signal obtained by removing the reference ECG signal from the noise-free ECG signal. Among them, the reference ECG signal is extracted from the synthetic ECG signal or the noise-free ECG signal, and the obvious features such as the R peak position and R-R interval of the synthetic ECG signal are retained.
在得到降噪后的心电信号后,可以对该降噪后的心电信号进行分析,具体的分析过程可以是:对降噪后的心电信号进行特征点的识别,进而,将识别到的特征点输入到特征诊断模型,根据识别到的特征点通过特征诊断模型预测针对得该降噪后的心电信号的诊断结果,其中,特征诊断模型为训练好的机器学习模型,该特征诊断模型是以心电信号的特征点为输入,该心电信号的真实诊断结果为标签训练得到的机器学习模型。应理解,对心电信号进行特征点的识别不是心电信号的分析过程中必须的步骤,在本申请另一种实现中,也可以将心电信号输入到信号诊断模型,通过该信号诊断模型直接预测针对该心电信号的诊断结果,其中,信号诊断模型为训练好的机器学习模型,该信号诊断模型是以心电信号为输入,该心电信号的真实诊断结果为标签进行训练得到的机器学习模型。After the denoised ECG signal is obtained, the denoised ECG signal can be analyzed. The specific analysis process can be: Identify the characteristic points of the denoised ECG signal, and then identify the Input the feature points of the into the feature diagnosis model, and predict the diagnosis result of the denoised ECG signal through the feature diagnosis model based on the identified feature points. The feature diagnosis model is a trained machine learning model, and the feature diagnosis The model takes the characteristic points of the ECG signal as input, and the true diagnosis result of the ECG signal is the machine learning model obtained by label training. It should be understood that the identification of the characteristic points of the ECG signal is not a necessary step in the analysis process of the ECG signal. In another implementation of this application, the ECG signal can also be input to the signal diagnosis model, and the signal diagnosis model Directly predict the diagnosis result for the ECG signal. Among them, the signal diagnosis model is a trained machine learning model. The signal diagnosis model takes the ECG signal as input, and the true diagnosis result of the ECG signal is the label for training. Machine learning model.
应用场景B:Application scenario B:
具备心电传感器的可穿戴设备,例如智能手环、智能手表等可以佩戴在用户手腕,该智能手环和智能手表上可以设置有心电传感器,以采集用户的心电数据。本申请实施例一智能手表为例来说明。通常心电传感器包括两个电极,用于采集心电信号。请参阅图1B所示的智能手表的示意图。智能手表11可以包括心电传感器的一个电极111设置于智能手表11的背面,另一个电极112设置于智能手表11的侧面。智能手表11内部可以包括数模转换模块113,数模转换模块113可以对通过电极111和112采集的模拟心电信号进行模数转换,得到离散的数字化的心电信号。智能手表11内部的处理模块可以将该数字化的心电信号作为待降噪心电信号应用本申请实施例中的心电降噪方法进行降噪处理,得到降噪后的心电信号。Wearable devices with ECG sensors, such as smart bracelets and smart watches, can be worn on the user's wrist. The smart bracelet and smart watch can be equipped with an ECG sensor to collect the user's ECG data. The smart watch in the first embodiment of the present application is described as an example. Usually an ECG sensor includes two electrodes for collecting ECG signals. Please refer to the schematic diagram of the smart watch shown in Figure 1B. The smart watch 11 may include one electrode 111 of the electrocardiogram sensor disposed on the back of the smart watch 11, and the other electrode 112 is disposed on the side of the smart watch 11. The smart watch 11 may include a digital-to-analog conversion module 113. The digital-to-analog conversion module 113 can perform analog-to-digital conversion on the analog ECG signals collected through the electrodes 111 and 112 to obtain discrete digital ECG signals. The processing module inside the smart watch 11 can use the digitized ECG signal as the ECG signal to be noise-reduced by applying the ECG noise reduction method in the embodiment of the present application for noise reduction processing to obtain the noise-reduced ECG signal.
应理解,用户使用智能手表11在采集心电信号时,可以将手指按压电极112,电极111则接触用户的手臂。It should be understood that when the user uses the smart watch 11 to collect the ECG signal, he can press his finger on the electrode 112, and the electrode 111 contacts the user's arm.
智能手表11或智能手环12也可以对该降噪后的心电信号进行分析,得到分析结果。进一步地,智能手表11或智能手环12还可以通过输出装置,比如显示器、扩音器等输出分析结果。The smart watch 11 or the smart bracelet 12 can also analyze the noise-reduced ECG signal to obtain the analysis result. Further, the smart watch 11 or the smart bracelet 12 can also output the analysis result through an output device, such as a display, a loudspeaker, and the like.
智能手表11或智能手环12也可以将待降噪心电信号发送给其绑定的终端或者服务器,由终端或服务器应用本申请实施例中的心电降噪方法对待降噪心电信号进行降噪处理,得到降噪后的心电信号。终端或者服务器可以向智能手表11或智能手环12发送该降噪后的心电信号,或者发送通过对该降噪后的心电信号进行分析得到的分析结果。The smart watch 11 or smart bracelet 12 can also send the ECG signal to be noise-reduced to the terminal or server bound to it, and the terminal or server applies the ECG noise-reduction method in the embodiments of this application to perform the noise-reduction ECG signal Noise reduction processing to obtain the ECG signal after noise reduction. The terminal or the server can send the noise-reduced ECG signal to the smart watch 11 or the smart bracelet 12, or send an analysis result obtained by analyzing the noise-reduced ECG signal.
配置了心电传感器的智能手表11或智能手环12可以实时监测佩戴者的心电数据,以监控佩戴者的身体状况。The smart watch 11 or smart bracelet 12 equipped with an ECG sensor can monitor the wearer's ECG data in real time to monitor the wearer's physical condition.
本申请实施例提供的降噪自编码器的训练方法涉及数据处理,具体可以应用于数据训 练、机器歇息、深度学习等数据处理方法,对训练样本(如本申请中的含噪剩余心电信号和该含噪剩余心电信号对应的无噪剩余心电信号)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到目标降噪自编码器;并且,本申请实施例提供的心电信号降噪方法可以运用上述目标降噪自编码器,将输入数据(如本申请中的待降噪心电信号去除基准心电信号后得到的待降噪剩余心电信号)输入到所述目标降噪自编码器中,得到输出数据(如本申请中的降噪后的剩余心电信号)。需要说明的是,本申请实施例提供的降噪自编码器的训练方法和心电信号降噪方法是基于同一个构思产生的发明,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。The training method of the noise-reducing autoencoder provided by the embodiment of the application involves data processing, and can be specifically applied to data processing methods such as data training, machine rest, and deep learning. For training samples (such as the noisy residual ECG signal in this application) The noise-free residual ECG signal corresponding to the noisy residual ECG signal) performs symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc., and finally obtains the target noise reduction autoencoder; and, this application The ECG signal noise reduction method provided by the embodiment can use the above-mentioned target noise reduction autoencoder to convert the input data (such as the residual ECG signal to be denoised obtained after removing the reference ECG signal from the ECG signal to be denoised in this application) ) Is input to the target noise reduction autoencoder to obtain output data (such as the residual ECG signal after noise reduction in this application). It should be noted that the training method for the denoising autoencoder and the method for denoising the ECG signal provided by the embodiments of this application are inventions based on the same concept, and can also be understood as two parts in a system, or a whole Two stages of the process: such as model training stage and model application stage.
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。Since the embodiments of this application involve a large number of applications of neural networks, in order to facilitate understanding, the following first introduces related terms and neural networks and other related concepts involved in the embodiments of this application.
(1)节拍(beat)(1) Beat
心电图(electrocardiography,ECG或EKG),也称为心电信号,记录了心脏收缩和舒张过程中产生的生物电信号。每次心脏完成一个完整的电活动,都对应如图2所示的一个ECG波形,包含P波、QRS波群(包含Q波,R波和S波)和T波。其中,心电图上第一个正向偏离基线的波形即为P波,第二个波段为QRS波群。QRS波群由一系列的3个偏离组成,反映了与左右心室除极相关的电流。QRS波群中的第一个负向的偏离称为Q波,QRS波群中第一个正向的偏离称为R波,R波后负向的偏离称为S波。QRS波群之后出现的顶部圆钝的波形为T波,表征心室复极的状态。包括上述各个波的一个完整的波形,被称为一个节拍(Beat)。Electrocardiography (ECG or EKG), also known as electrocardiogram, records the bioelectric signals generated during the contraction and relaxation of the heart. Each time the heart completes a complete electrical activity, it corresponds to an ECG waveform as shown in Figure 2, including P wave, QRS wave group (including Q wave, R wave and S wave) and T wave. Among them, the first wave on the ECG that deviates from the baseline in the positive direction is the P wave, and the second waveband is the QRS complex. The QRS complex consists of a series of 3 deviations, reflecting the currents related to the depolarization of the left and right ventricles. The first negative deviation in the QRS complex is called the Q wave, the first positive deviation in the QRS complex is called the R wave, and the negative deviation after the R wave is called the S wave. The round and blunt waveform at the top that appears after the QRS complex is the T wave, which represents the state of ventricular repolarization. A complete waveform including the above-mentioned waves is called a beat.
(2)基准心电信号(basic ECG)(2) Basic ECG (basic ECG)
基准心电信号包括心电信号中R峰位置、R-R间距等明显特征,基准心电信号可以至少包括QRS波群,可以理解,该基准心电信号包括了心电信号的部分的特征,通常是比较容易提取的明显的特征,例如R峰位置,R峰的平均幅值等。本申请实施例中,心电信号中的R峰位置与该心电心信号对应的基准心电信号中的R峰位置相同。The reference ECG signal includes obvious features such as the R peak position and RR interval in the ECG signal. The reference ECG signal may include at least QRS complex. It is understandable that the reference ECG signal includes the characteristics of the part of the ECG signal, usually Obvious features that are easier to extract, such as R peak position, average R peak amplitude, etc. In the embodiment of the present application, the R peak position in the ECG signal is the same as the R peak position in the reference ECG signal corresponding to the ECG signal.
(3)剩余心电信号(residual ECG)(3) Residual ECG (residual ECG)
从心电信号中移除该心电信号对应的基准心电信号之后,得到剩余心电信号。由于基准心电信号包括了心电信号明显特征,剩余心电信号中则包括了心电心信号中不容易提取的隐含特征,也称为细节特征。After removing the reference ECG signal corresponding to the ECG signal from the ECG signal, the remaining ECG signal is obtained. Since the reference ECG signal includes the obvious features of the ECG signal, the remaining ECG signal includes the hidden features that are not easy to extract from the ECG signal, also known as the detailed features.
(4)肌电噪声(electromyography,EMG)(4) Electromyography (EMG)
肌电噪声,也称肌电噪声信号,是肌肉纤维在人体中运动单元动作电位(MUAP)在时间和空间上的叠加。肌电噪声是由于人体活动、肌肉紧张引起的噪声。肌电噪声的频率主要集中在0.01-100Hz。EMG noise, also known as EMG noise signal, is the superposition of muscle fibers in the body's motor unit action potential (MUAP) in time and space. EMG noise is caused by human activity and muscle tension. The frequency of EMG noise is mainly concentrated in 0.01-100Hz.
(5)信号平均(signal-averaged)(5) Signal-averaged
信号平均是利用信号的确定性(重复性)和噪声的随机性来消除随机干扰的方法。信号平均指将信号叠加后再进行平均的技术,其中,为避免叠加后信号的失真,信号叠加时必须严格对齐。在本申请实施例中,被平均的多个心电信号或多个心电信号片段以R峰为基准对齐,即被平均的多个心电信号或多个心电信号片段以R峰为基准对齐。Signal averaging is a method to eliminate random interference by using the determinism (repeatability) of the signal and the randomness of noise. Signal averaging refers to the technology of superimposing signals and then averaging them. In order to avoid signal distortion after superposition, the signals must be strictly aligned during superposition. In the embodiment of the present application, the averaged multiple ECG signals or multiple ECG signal segments are aligned based on the R peak, that is, the average multiple ECG signals or multiple ECG signal segments are based on the R peak Aligned.
(6)神经网络(neural network,NN)(6) Neural network (NN)
神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:A neural network can be composed of neural units. A neural unit can refer to an arithmetic unit that takes xs and intercept 1 as inputs. The output of the arithmetic unit can be:
Figure PCTCN2020080880-appb-000030
Figure PCTCN2020080880-appb-000030
其中,s=1、2、……n,n为大于1的自然数,W s为x s的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。 Among them, s=1, 2,...n, n is a natural number greater than 1, W s is the weight of x s , and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of the activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected with the local receptive field of the previous layer to extract the characteristics of the local receptive field. The local receptive field can be a region composed of several neural units.
(7)深度神经网络(deep neural network,DNN)(7) Deep neural network (deep neural network, DNN)
深度神经网络,也称多层神经网络,可以理解为具有很多层隐含层的神经网络,这里的“很多”并没有特别的度量标准。从DNN按不同层的位置划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
Figure PCTCN2020080880-appb-000031
其中,
Figure PCTCN2020080880-appb-000032
是输入向量,
Figure PCTCN2020080880-appb-000033
是输出向量,b是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
Figure PCTCN2020080880-appb-000034
经过如此简单的操作得到输出向量
Figure PCTCN2020080880-appb-000035
由于DNN层数多,则系数W和偏移向量b的数量也就很多了。这些参数在DNN中的定义如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
Figure PCTCN2020080880-appb-000036
上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。总结就是:第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
Figure PCTCN2020080880-appb-000037
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。
Deep neural network, also called multilayer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. According to the location of different layers of DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the number of layers in the middle are all hidden layers. The layers are fully connected, that is to say, any neuron in the i-th layer must be connected to any neuron in the i+1th layer. Although DNN looks complicated, it is not complicated in terms of the work of each layer. Simply put, it is the following linear relationship expression:
Figure PCTCN2020080880-appb-000031
among them,
Figure PCTCN2020080880-appb-000032
Is the input vector,
Figure PCTCN2020080880-appb-000033
Is the output vector, b is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just the input vector
Figure PCTCN2020080880-appb-000034
After such a simple operation, the output vector is obtained
Figure PCTCN2020080880-appb-000035
Due to the large number of DNN layers, the number of coefficients W and offset vectors b is also large. The definition of these parameters in the DNN is as follows: Take the coefficient W as an example: Suppose that in a three-layer DNN, the linear coefficients from the fourth neuron in the second layer to the second neuron in the third layer are defined as
Figure PCTCN2020080880-appb-000036
The superscript 3 represents the number of layers where the coefficient W is located, and the subscript corresponds to the output third layer index 2 and the input second layer index 4. The summary is: the coefficient from the kth neuron of the L-1th layer to the jth neuron of the Lth layer is defined as
Figure PCTCN2020080880-appb-000037
It should be noted that the input layer has no W parameter. In deep neural networks, more hidden layers make the network more capable of portraying complex situations in the real world. Theoretically speaking, a model with more parameters is more complex and has a greater "capacity", which means it can complete more complex learning tasks. Training a deep neural network is also a process of learning a weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (a weight matrix formed by vectors W of many layers).
(8)自编码器(autoencoder)(8) Autoencoder
自编码器是一种旨在将它们的输入复制到的输出的神经网络。它被用来做这样一件事情,那就是让输出尽可能的去模拟输入,从而找到输入的压缩表示。如图3所示的自编码器的原理示意图,自编码器包括编码器和解码器,即将输入层到中间层之间的映射称为编码,将中间层和输出层(也称重构层)之间的映射称为解码。其中,编码器将输入压缩为潜在空间表示(本申请中也称编码表示),可以用编码函数
Figure PCTCN2020080880-appb-000038
其中,W为
Figure PCTCN2020080880-appb-000039
的 权重,b为神经单元的偏置,f(·)为编码器的激活函数,
Figure PCTCN2020080880-appb-000040
为编码器的输出(也称为输入
Figure PCTCN2020080880-appb-000041
的潜在空间表示);解码器旨在重构来自潜在空间表示的输入,可以用解码函数
Figure PCTCN2020080880-appb-000042
为解码器得到的。其中,W′为
Figure PCTCN2020080880-appb-000043
的权重,b′为神经单元的偏置,g(·)为解码器神经单元的激活函数,解码器重构得到
Figure PCTCN2020080880-appb-000044
自编码器的训练通过优化参数W、W′、b、b′来减少自编码器的重构误差,即减少
Figure PCTCN2020080880-appb-000045
Figure PCTCN2020080880-appb-000046
之间的不同。在自编码器中,隐藏层中神经元的数量小于输入层和输出层(也称重构层)时,即
Figure PCTCN2020080880-appb-000047
的维度小于
Figure PCTCN2020080880-appb-000048
这时对参数进行优化,如果重建输出
Figure PCTCN2020080880-appb-000049
与输入
Figure PCTCN2020080880-appb-000050
很接近,那么就可以认为潜在空间表示
Figure PCTCN2020080880-appb-000051
捕捉到了
Figure PCTCN2020080880-appb-000052
的有效特征,是
Figure PCTCN2020080880-appb-000053
的有效压缩表示,就可以达到数据降维和特征提取的目的。数据可视化和数据降噪是自编码器的两种主要应用场景。
Autoencoders are a type of neural network designed to copy their input to the output. It is used to do such a thing, that is to make the output as much as possible to simulate the input, so as to find the compressed representation of the input. The schematic diagram of the self-encoder shown in Figure 3, the self-encoder includes an encoder and a decoder, that is, the mapping between the input layer and the intermediate layer is called encoding, and the intermediate layer and the output layer (also called the reconstruction layer) The mapping between is called decoding. Among them, the encoder compresses the input into a latent space representation (also referred to as an encoding representation in this application), and the encoding function can be used
Figure PCTCN2020080880-appb-000038
Where W is
Figure PCTCN2020080880-appb-000039
The weight of, b is the bias of the neural unit, f(·) is the activation function of the encoder,
Figure PCTCN2020080880-appb-000040
Is the output of the encoder (also called input
Figure PCTCN2020080880-appb-000041
Latent space representation); the decoder aims to reconstruct the input from the latent space representation, you can use the decoding function
Figure PCTCN2020080880-appb-000042
Get it for the decoder. Where W′ is
Figure PCTCN2020080880-appb-000043
The weight of, b′ is the bias of the neural unit, g(·) is the activation function of the neural unit of the decoder, and the decoder reconstructs
Figure PCTCN2020080880-appb-000044
The training of the autoencoder reduces the reconstruction error of the autoencoder by optimizing the parameters W, W′, b, b′, that is, reducing
Figure PCTCN2020080880-appb-000045
with
Figure PCTCN2020080880-appb-000046
The difference between. In the autoencoder, when the number of neurons in the hidden layer is smaller than the input layer and output layer (also called reconstruction layer), that is
Figure PCTCN2020080880-appb-000047
Is less than
Figure PCTCN2020080880-appb-000048
At this time, the parameters are optimized, if the output is reconstructed
Figure PCTCN2020080880-appb-000049
With input
Figure PCTCN2020080880-appb-000050
Very close, then it can be considered that the latent space represents
Figure PCTCN2020080880-appb-000051
Caught
Figure PCTCN2020080880-appb-000052
The effective characteristics of is
Figure PCTCN2020080880-appb-000053
The effective compression representation can achieve the purpose of data dimensionality reduction and feature extraction. Data visualization and data noise reduction are two main application scenarios of autoencoders.
(9)降噪自编码器(denoising autoencoder)(9) Denoising autoencoder (denoising autoencoder)
对于自编码器来说,优化和训练只能让自编码器的输出接近于输入,对于有损的输入(包含噪声的输入)不能重构得到无损的输入。为了增加隐含的特征表示的鲁棒性和泛化能力,引入降噪自编码器,降噪自编码器的网络结构与自编码器相同,只是对训练方法进行改进,通过受损的输入(也称包含噪声的输入)来训练自编码器重构输入。For the autoencoder, optimization and training can only make the output of the autoencoder close to the input, and for lossy input (input containing noise), it cannot be reconstructed to obtain a lossless input. In order to increase the robustness and generalization ability of the implicit feature representation, the noise-reducing autoencoder is introduced. The network structure of the noise-reducing autoencoder is the same as that of the autoencoder, but the training method is improved, through the damaged input ( Also called noise-containing input) to train the autoencoder to reconstruct the input.
(10)损失函数(10) Loss function
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的误差情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的误差”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的误差的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示误差越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。In the process of training a deep neural network, because it is hoped that the output of the deep neural network is as close as possible to the value that you really want to predict, you can compare the predicted value of the current network with the target value you really want, and then based on the difference between the two To update the weight vector of each layer of neural network (of course, there is usually an initialization process before the first update, that is, pre-configured parameters for each layer in the deep neural network), for example, if the predicted value of the network If it is high, adjust the weight vector to make its prediction lower, and keep adjusting until the deep neural network can predict the really wanted target value or a value very close to the really wanted target value. Therefore, it is necessary to predefine "how to compare the error between the predicted value and the target value". This is the loss function or objective function, which is used to measure the error between the predicted value and the target value. Important equation. Among them, take the loss function as an example. The higher the output value (loss) of the loss function, the greater the error. Then the training of the deep neural network becomes a process of reducing this loss as much as possible.
(11)反向传播算法(11) Backpropagation algorithm
卷积神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的超分辨率模型中参数的大小,使得超分辨率模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。Convolutional neural networks can use backpropagation (BP) algorithms to modify the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, forwarding the input signal to the output will cause error loss, and the parameters in the initial super-resolution model are updated by backpropagating the error loss information, so that the error loss is converged. The backpropagation algorithm is a backpropagation motion dominated by error loss, and aims to obtain the optimal super-resolution model parameters, such as a weight matrix.
(12)采样点(12) Sampling point
本申请实施例中,心电信号通常是心电设备通过电极提取的体表生物电信号,采集得到的心电信号以时间排序的多个采样点组成。采样点的值即为采集时体表生物电信号的强度或能量值。该多个采样点按照采样时间的顺序排列形成数据矩阵(通常为行向量),以便于对心电信号进行数据处理。In the embodiments of the present application, the ECG signal is usually a body surface bioelectric signal extracted by an ECG device through electrodes, and the acquired ECG signal is composed of multiple sampling points sorted in time. The value of the sampling point is the intensity or energy value of the bioelectric signal on the body surface at the time of collection. The multiple sampling points are arranged in the order of sampling time to form a data matrix (usually a row vector) to facilitate data processing of the ECG signal.
(13)心电采集设备(13) ECG acquisition equipment
本申请实施例中,心电采集设备为具备采集心电信号、分析心电信号等于心电信号的 采集、处理等相关的设备,可以是心电图采集设备、心电图机等,也可以是具备心电传感器的可穿戴设备或终端等。In the embodiments of the present application, the ECG acquisition device is a device that collects ECG signals and analyzes ECG signals equal to the acquisition and processing of ECG signals. It can be an ECG acquisition device, an ECG machine, etc., or it can be equipped with an ECG signal. Sensors such as wearable devices or terminals.
下面介绍本申请实施例提供的系统架构。The following describes the system architecture provided by the embodiments of the present application.
参见附图4,本发明实施例提供了一种系统架构100。Referring to FIG. 4, an embodiment of the present invention provides a system architecture 100.
如所述系统架构100所示,数据采集设备160用于采集数据(例如,无噪心电信号、噪声信号等),也可以根据采集到的数据生成训练数据(本申请中也称训练样本),本申请实施例中训练数据包括含噪剩余心电信号和含噪剩余心电信号对应的无噪剩余心电信号,其中,含噪剩余心电信号是合成心电信号去除基准心电信号后得到的信号,合成心电信号是由无噪心电信号与肌电噪声信号叠加得到的,无噪心电信号为不含肌电噪声的心电信号;无噪剩余心电信号为无噪心电信号去除基准心电信号得到;基准心电信号是利用平均节拍减法得到的,保留了合成心电信号的R峰位置等合成心电信号的明显特征。应理解,无噪心电信号是指不含或几乎不含肌电噪声的心电信号,可以通过心电采集设备在人静止状态下采集但不排除该无噪心电信号包括如工频噪声、基线漂移或其他噪声等。As shown in the system architecture 100, the data collection device 160 is used to collect data (for example, noise-free ECG signals, noise signals, etc.), and can also generate training data (also referred to as training samples in this application) based on the collected data In the embodiment of the application, the training data includes the noisy residual ECG signal and the noise-free residual ECG signal corresponding to the noisy residual ECG signal, where the noisy residual ECG signal is the result of the synthetic ECG signal removing the reference ECG signal The obtained signal, the synthetic ECG signal is obtained by superimposing the noiseless ECG signal and the EMG noise signal, the noiseless ECG signal is the ECG signal without EMG noise; the noiseless residual ECG signal is the noiseless heart The electrical signal is obtained by removing the reference ECG signal; the reference ECG signal is obtained by the average beat subtraction, which retains the obvious characteristics of the composite ECG signal such as the R peak position of the composite ECG signal. It should be understood that a noise-free ECG signal refers to an ECG signal that contains no or almost no EMG noise, which can be collected by an ECG acquisition device in a stationary state, but it is not excluded that the noise-free ECG signal includes such as power frequency noise. , Baseline drift or other noise, etc.
数据采集设备160可以将训练数据存入数据库130,训练设备120基于数据库130中维护的训练数据训练得到目标降噪自编码器101。下面将以实施例一更详细地描述训练设备120如何基于训练数据得到目标降噪自编码器101该目标降噪自编码器101能够用于实现本申请实施例提供的心电信号降噪的方法,即,获取待降噪心电信号,利用平均节拍减法得到待降噪基准心电信号,去除待降噪心电信号中的待降噪基准心电信号得到待降噪剩余心电信号,该待降噪基准心电信号包括待降噪心电信号的R峰位置、R-R间距等待降噪心电信号的明显特征,将该待降噪剩余心电信号输入该目标降噪自编码器101,即可得到降噪后的剩余心电信号,将降噪后的剩余心电信号与待降噪基准心电信号叠加,得到降噪后的心电信号。本申请实施例中的目标降噪自编码器101具体可以为自编码器,在本申请提供的实施例中,该目标降噪自编码器101是通过训练初始化的降噪自编码器得到的。需要说明的是,在实际的应用中,所述数据库130中维护的训练数据不一定都来自于数据采集设备160的采集或生成,也有可能是从其他设备(例如训练设备)接收得到的。另外需要说明的是,训练设备120也不一定完全基于数据库130维护的训练数据进行目标降噪自编码器101的训练,也有可能从云端或其他地方获取训练数据进行模型训练,上述描述不应该作为对本申请实施例的限定。可选地也可以由训练设备120根据无噪心电信号和噪声信号生成训练数据,并由训练设备120训练数据存入数据库130,本申请实施例不作限定。The data acquisition device 160 may store the training data in the database 130, and the training device 120 obtains the target noise reduction autoencoder 101 by training based on the training data maintained in the database 130. The following will describe in more detail how the training device 120 obtains the target denoising autoencoder 101 based on the training data with the first embodiment. The target denoising autoencoder 101 can be used to implement the ECG signal denoising method provided in the embodiments of the present application. , That is, the ECG signal to be denoised is obtained, the reference ECG signal to be denoised is obtained by the average beat subtraction method, and the reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised. The reference ECG signal to be denoised includes the R peak position of the ECG signal to be denoised, the RR interval and the obvious characteristics of the ECG signal to be denoised. The remaining ECG signal to be denoised is input to the target noise reduction autoencoder 101, The residual ECG signal after noise reduction can be obtained, and the residual ECG signal after noise reduction is superimposed with the reference ECG signal to be noise-reduced to obtain the noise-reduced ECG signal. The target noise reduction autoencoder 101 in the embodiment of this application may specifically be an autoencoder. In the embodiment provided in this application, the target noise reduction autoencoder 101 is obtained by training an initialized noise reduction autoencoder. It should be noted that in actual applications, the training data maintained in the database 130 may not all come from the collection or generation of the data collection device 160, and may also be received from other devices (for example, training devices). In addition, it should be noted that the training device 120 may not necessarily train the target noise reduction autoencoder 101 based on the training data maintained by the database 130. It may also obtain training data from the cloud or other places for model training. The above description should not be used as Limitations of the embodiments of this application. Optionally, the training device 120 may also generate training data based on the noise-free ECG signal and the noise signal, and the training data may be stored in the database 130 by the training device 120, which is not limited in the embodiment of the present application.
训练设备120根据训练样本训练降噪自编码器121得到的目标降噪自编码器101,该目标降噪自编码器101可以应用于不同的系统或设备中,如应用于图4所示的执行设备110,所述执行设备110可以是终端,如手机终端、平板电脑、笔记本电脑、AR/VR、车载单元,可穿戴设备,如智能手环、智能手表等,还可以是服务器或者云端等。在附图4中,执行设备110可以配置有I/O接口112,用于与外部设备进行数据交互,用户可以通过用户设备140向I/O接口112输入数据,所述输入数据在本申请实施例中可以包括:待降噪心电信号。The training device 120 trains the target denoising autoencoder 101 obtained by the denoising autoencoder 121 according to the training samples. The target denoising autoencoder 101 can be applied to different systems or devices, as shown in FIG. 4 Device 110. The execution device 110 may be a terminal, such as a mobile phone terminal, a tablet computer, a notebook computer, AR/VR, a vehicle-mounted unit, a wearable device, such as a smart bracelet, a smart watch, etc., or a server or a cloud. In FIG. 4, the execution device 110 may be configured with an I/O interface 112 for data interaction with external devices. The user may input data to the I/O interface 112 through the user device 140, and the input data is implemented in this application. Examples can include: ECG signal to be noise-reduced.
预处理模块113用于根据I/O接口112接收到的输入数据(如所述待降噪心电信号) 进行预处理,在本申请实施例中,预处理模块113可以用于生成待降噪基准心电信号以及去除待降噪剩余心电信号中的待降噪基准心电信号得到待降噪剩余心电信号。The preprocessing module 113 is configured to perform preprocessing according to the input data (such as the ECG signal to be denoised) received by the I/O interface 112. In the embodiment of the present application, the preprocessing module 113 can be used to generate the to be denoised The reference ECG signal and the reference ECG signal to be denoised from the residual ECG signal to be denoised are removed to obtain the residual ECG signal to be denoised.
信号叠加模块114用于将预处理模块113得到的待降噪基准心电信号和通过目标降噪自编码器101输出的降噪后的剩余心电信号相加得到降噪后的心电信号。The signal superposition module 114 is used to add the noise-reduced reference ECG signal obtained by the preprocessing module 113 and the noise-reduced residual ECG signal output by the target noise-reduction autoencoder 101 to obtain the noise-reduced ECG signal.
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理过程中,执行设备110可以调用数据存储系统150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统150中。When the execution device 110 preprocesses input data, or when the calculation module 111 of the execution device 110 performs calculations and other related processing, the execution device 110 may call data, codes, etc. in the data storage system 150 for corresponding processing , The data, instructions, etc. obtained by corresponding processing may also be stored in the data storage system 150.
最后,I/O接口112将处理结果,如上述得到的目标心电信号返回给用户设备140,从而提供给用户。Finally, the I/O interface 112 returns the processing result, such as the target ECG signal obtained above, to the user equipment 140, so as to provide it to the user.
值得说明的是,训练设备120可以针对不同的目标或称不同的任务,基于不同的训练数据生成相应的目标降噪自编码器101,该相应的目标降噪自编码器101即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。It is worth noting that the training device 120 can generate the corresponding target noise reduction autoencoder 101 based on different training data for different targets or different tasks, and the corresponding target noise reduction autoencoder 101 can be used to achieve The above goals or completion of the above tasks, so as to provide users with the desired results.
在附图4中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112提供的界面进行操作。另一种情况下,用户设备140可以自动地向I/O接口112发送输入数据,如果要求用户设备140自动发送输入数据需要获得用户的授权,则用户可以在用户设备140中设置相应权限。用户可以在用户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音等具体方式。In the case shown in FIG. 4, the user can manually set input data, and the manual setting can be operated through the interface provided by the I/O interface 112. In another case, the user equipment 140 can automatically send input data to the I/O interface 112. If the user equipment 140 is required to automatically send input data and the user's authorization is required, the user can set the corresponding authority in the user equipment 140. The user can view the result output by the execution device 110 on the user device 140, and the specific presentation form may be a specific manner such as display and sound.
在一种实现中,用户设备140具体可以是具备心电传感器的终端,例如手机、智能手环、智能手表等,该终端可以向执行设备发送待降噪心电信号,执行设备对该待降噪心电信号进行降噪,得到降噪后的心电信号,执行设备可以将降噪后的心电信号发送给终端,终端可以接收执行设备发送的降噪后的心电信号,也可以根据该降噪后的心电信号进行诊断分析。In one implementation, the user equipment 140 may specifically be a terminal equipped with an ECG sensor, such as a mobile phone, a smart bracelet, a smart watch, etc., and the terminal may send an ECG signal to be noise-reduced to the executing device, and the executing device may respond to the signal to be reduced. Noise reduction is performed on the noisy ECG signal, and the noise-reduced ECG signal is obtained. The execution device can send the noise-reduction ECG signal to the terminal, and the terminal can receive the noise-reduction ECG signal sent by the execution device, or according to The ECG signal after noise reduction is diagnosed and analyzed.
在另一种实现中,执行设备110具体可以是手机、平板电脑等终端,也可以是服务器、云端等,执行设备在得到降噪后的心电信号之后,可以根据降噪后的心电信号进行诊断分析。执行设备可以将诊断结果发送给用户设备140。In another implementation, the execution device 110 can be a terminal such as a mobile phone, a tablet computer, or a server, a cloud, etc. After the execution device obtains the noise-reduced ECG signal, it can be based on the noise-reduced ECG signal Perform diagnostic analysis. The execution device may send the diagnosis result to the user device 140.
值得注意的是,附图4仅是本发明实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在附图4中,数据存储系统150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储系统150置于执行设备110中。It is worth noting that FIG. 4 is only a schematic diagram of a system architecture provided by an embodiment of the present invention, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation. For example, in FIG. 4 The data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110.
如图4所示,根据训练设备120训练得到目标降噪自编码器101,具体的,本申请实施例提供的目标降噪自编码器101可以包括:编码器和解码器。在本申请实施例提供的该目标降噪自编码器101中,所述编码器和解码器都可以是神经网络、卷积神经网络或深度神经网络。As shown in FIG. 4, the target noise reduction autoencoder 101 is trained according to the training device 120. Specifically, the target noise reduction autoencoder 101 provided in the embodiment of the present application may include an encoder and a decoder. In the target noise reduction autoencoder 101 provided in the embodiment of the present application, both the encoder and the decoder may be a neural network, a convolutional neural network, or a deep neural network.
如图5所示,降噪自编码器200可以包括输入层21,编码器22、解码器23和输出层24,其中,编码器22可以包括一组或多组卷积层/池化层220(其中池化层为可选的),解码器23可以包括一组或多组卷积层/上采样层230,通常,编码器22中池化层用于降维,而解码器23中上采样层用于升维。As shown in FIG. 5, the denoising autoencoder 200 may include an input layer 21, an encoder 22, a decoder 23, and an output layer 24. The encoder 22 may include one or more sets of convolutional layers/pooling layers 220. (The pooling layer is optional), the decoder 23 may include one or more sets of convolutional layers/upsampling layers 230. Generally, the pooling layer in the encoder 22 is used for dimensionality reduction, and the decoder 23 is used for dimensionality reduction. The sampling layer is used for dimension upgrading.
卷积层/池化层220:Convolutional layer/pooling layer 220:
卷积层:Convolutional layer:
如图5所示卷积层/池化层220可以包括如示例221-226层,举例来说:在一种实现中,221层为卷积层,222层为池化层,223层为卷积层,224层为池化层,225为卷积层,226为池化层;在另一种实现方式中,221、222为卷积层,223为池化层,224、225为卷积层,226为池化层。即卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。As shown in FIG. 5, the convolutional layer/pooling layer 220 may include layers 221-226, for example: in an implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, and layer 223 is a convolutional layer. Layers, 224 is the pooling layer, 225 is the convolutional layer, and 226 is the pooling layer; in another implementation, 221 and 222 are the convolutional layers, 223 is the pooling layer, and 224 and 225 are the convolutional layers. Layer, 226 is the pooling layer. That is, the output of the convolutional layer can be used as the input of the subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
如图5所示卷积层/上采样层230可以包括如示例231-236层,举例来说:在一种实现中,231层为卷积层,232层为上采样层,233层为卷积层,234层为上采样层,235为卷积层,236为上采样层;在另一种实现方式中,231、232为卷积层,233为上采样层,234、235为卷积层,236为上采样层。即卷积层的输出可以作为随后的上采样层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。As shown in FIG. 5, the convolutional layer/upsampling layer 230 may include layers such as 231-236. For example, in an implementation, layer 231 is a convolutional layer, layer 232 is an upsampling layer, and layer 233 is a convolutional layer. Layers, 234 is an upsampling layer, 235 is a convolutional layer, and 236 is an upsampling layer; in another implementation, 231 and 232 are convolutional layers, 233 is an upsampling layer, and 234 and 235 are convolutional layers. Layer, 236 is the up-sampling layer. That is, the output of the convolution layer can be used as the input of the subsequent upsampling layer, or as the input of another convolution layer to continue the convolution operation.
下面将以卷积层221为例,介绍一层卷积层的内部工作原理。The following will take the convolutional layer 221 as an example to introduce the internal working principle of a convolutional layer.
卷积层221可以包括很多个卷积算子,卷积算子也称为核,其在心电信号处理中的作用相当于一个从输入数据矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对心电信号进行卷积操作的过程中,权重矩阵通常在输入心电信号上沿着水平方向一个采样点接着一个采样点(或两个采样点接着两个采样点……这取决于步长stride的取值)的进行处理,从而完成从心电信号中提取特定特征的工作。该权重矩阵的大小应该与心电信号中采样点的个数相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入心电信号的横深维度是相同的。不同的权重矩阵可以用来提取数据矩阵中不同的特征。The convolution layer 221 can include many convolution operators. The convolution operator is also called a kernel. Its role in the processing of the ECG signal is equivalent to a filter that extracts specific information from the input data matrix. The essence of the convolution operator is The above can be a weight matrix. This weight matrix is usually predefined. In the process of convolution on the ECG signal, the weight matrix is usually one sample point after another sample point (or Two sampling points followed by two sampling points... it depends on the value of stride) to complete the work of extracting specific features from the ECG signal. The size of the weight matrix should be related to the number of sampling points in the ECG signal. It should be noted that the depth dimension of the weight matrix and the horizontal depth dimension of the input ECG signal are the same. Different weight matrices can be used to extract different features in the data matrix.
这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入心电信号中提取信息,从而使得降噪自编码器20对输入心电信号进行正确的降噪。The weight values in these weight matrices need to be obtained through a lot of training in practical applications. Each weight matrix formed by the weight values obtained through training can be used to extract information from the input ECG signal, so that the noise reduction autoencoder 20 is Input the ECG signal for correct noise reduction.
当降噪自编码器200有多个卷积层的时候,初始的卷积层(例如221)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着降噪自编码器200深度的加深,越往后的卷积层(例如226)提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。When the noise reduction autoencoder 200 has multiple convolutional layers, the initial convolutional layer (such as 221) often extracts more general features, which can also be called low-level features; With the deepening of the depth of the self-encoder 200, the features extracted by the subsequent convolutional layers (for example, 226) become more and more complex, such as high-level semantic features. The features with higher semantics are more suitable for the problem to be solved. .
池化层:Pooling layer:
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,在如图2中220所示例的221-226各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolutional layer. In the 221-226 layers as illustrated by 220 in Figure 2, it can be a convolutional layer followed by a layer The pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
在编码器中,池化层的目的就是降低输入数据的维度。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入数据进行采样得到较小维度的数据。平均池化算子可以在特定范围内对输入的数据进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的数据作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与输入数据的维度相关一样,池化层中的运算符也应该与输入数据的维度相关。通过池化层处理后输出的数据的维度可以小于输入池化层的数据的维度,池化层输 出的数据中每个采样点表示输入池化层的数据的对应子区域的平均值或最大值。In the encoder, the purpose of the pooling layer is to reduce the dimensionality of the input data. The pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling the input data to obtain data with smaller dimensions. The average pooling operator can calculate the input data within a specific range to generate an average value as the result of average pooling. The maximum pooling operator can take the data with the largest value in a specific range as the result of maximum pooling. In addition, just as the size of the weight matrix used in the convolutional layer should be related to the dimension of the input data, the operators in the pooling layer should also be related to the dimension of the input data. The dimensionality of the data output after processing by the pooling layer can be smaller than the dimensionality of the data input to the pooling layer. Each sampling point in the data output by the pooling layer represents the average or maximum value of the corresponding subregion of the data input to the pooling layer. .
上采样层(up sampling):Up sampling layer (up sampling):
在解码器中,上采样层的目的就是增大输入数据的维度。通常,上采样的原理是在原有输入数据的基础上在元素之间采用合适的插值算法插入新的元素。In the decoder, the purpose of the upsampling layer is to increase the dimensionality of the input data. Generally, the principle of upsampling is to insert new elements between the elements based on the original input data.
输出层:Output layer:
该输出层240可以具有类似分类交叉熵的损失函数,具体用于计算降噪自编码器的预测误差,一旦整个降噪自编码器200的前向传播(如图2由210至240方向的传播为前向传播)完成,反向传播(如图2由240至210方向的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少降噪自编码器200的损失,即降噪自编码器200通过输出层输出的结果(本申请实施例中可以是预测剩余心电信号)和理想结果(本申请实施例中可以是无噪剩余心电信号)之间的误差。The output layer 240 can have a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error of the denoising autoencoder. Once the entire denoising autoencoder 200 has forward propagation (as shown in Figure 2 for the propagation from 210 to 240) For the forward propagation) is completed, the back propagation (as shown in Figure 2 from 240 to 210 direction propagation is back propagation) will start to update the weight values and deviations of the aforementioned layers to reduce the noise reduction autoencoder 200 The loss of the noise reduction autoencoder 200 through the output layer (the residual ECG signal can be predicted in the embodiment of the application) and the ideal result (the noise-free residual ECG signal in the embodiment of the application) Error.
需要说明的是,如图2所示的降噪自编码器200仅作为一种降噪自编码器的示例,在具体的应用中,降噪自编码器还可以以其他网络模型的形式存在。It should be noted that the denoising autoencoder 200 shown in FIG. 2 is only used as an example of a denoising autoencoder. In specific applications, the denoising autoencoder may also exist in the form of other network models.
下面介绍本申请实施例提供的一种芯片硬件结构。The following describes a chip hardware structure provided by an embodiment of the present application.
图6为本发明实施例提供的一种芯片硬件结构,该芯片包括神经网络处理器30。该芯片可以被设置在如图4所示的执行设备110中,用以完成计算模块171的计算工作。该芯片也可以被设置在如图4所示的训练设备120中,用以完成训练设备120的训练工作并输出目标降噪自编码器101。如图5所示的降噪自编码器中各层的算法均可在如图6所示的芯片中得以实现。FIG. 6 is a hardware structure of a chip provided by an embodiment of the present invention. The chip includes a neural network processor 30. The chip can be set in the execution device 110 as shown in FIG. 4 to complete the calculation work of the calculation module 171. The chip may also be set in the training device 120 shown in FIG. 4 to complete the training work of the training device 120 and output the target noise reduction autoencoder 101. The algorithms of each layer in the noise reduction autoencoder as shown in FIG. 5 can be implemented in the chip as shown in FIG. 6.
神经网络处理器30可以是NPU,TPU,或者GPU等一切适合用于大规模异或运算处理的处理器。以NPU为例:NPU可以作为协处理器挂载到主CPU(Host CPU)上,由主CPU为其分配任务。NPU的核心部分为运算电路303,通过控制器304控制运算电路303提取存储器(301和302)中的矩阵数据并进行乘加运算。The neural network processor 30 may be any processor suitable for large-scale XOR operation processing such as NPU, TPU, or GPU. Take the NPU as an example: the NPU can be mounted on the host CPU (Host CPU) as a coprocessor, and the host CPU assigns tasks to it. The core part of the NPU is the arithmetic circuit 303. The arithmetic circuit 303 is controlled by the controller 304 to extract matrix data in the memory (301 and 302) and perform multiplication and addition operations.
在一些实现中,运算电路303内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路303是二维脉动阵列。运算电路303还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路303是通用的矩阵处理器。In some implementations, the arithmetic circuit 303 includes multiple processing units (Process Engine, PE). In some implementations, the arithmetic circuit 303 is a two-dimensional systolic array. The arithmetic circuit 303 may also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 303 is a general-purpose matrix processor.
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路303从权重存储器302中取矩阵B的权重数据,并缓存在运算电路303中的每一个PE上。运算电路303从输入存储器301中取矩阵A的输入数据,根据矩阵A的输入数据与矩阵B的权重数据进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)308中。For example, suppose there is an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit 303 fetches the weight data of the matrix B from the weight memory 302 and caches it on each PE in the arithmetic circuit 303. The arithmetic circuit 303 fetches the input data of matrix A from the input memory 301, and performs matrix operations based on the input data of matrix A and the weight data of matrix B, and the partial or final result of the obtained matrix is stored in the accumulator 308 .
统一存储器306用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(DMAC,Direct Memory Access Controller)305,被搬运到权重存储器302中。输入数据也通过DMAC被搬运到统一存储器306中。The unified memory 306 is used to store input data and output data. The weight data is directly transferred to the weight memory 302 through the direct memory access controller (DMAC, Direct Memory Access Controller) 305 of the storage unit. The input data is also transferred to the unified memory 306 through the DMAC.
总线接口单元(BIU,Bus Interface Unit)310,用于DMAC和取指存储器(Instruction Fetch Buffer)309的交互;总线接口单元301还用于取指存储器309从外部存储器获取指令;总线接口单元301还用于存储单元访问控制器305从外部存储器获取输入矩阵A或者权重矩阵B的原数据。The bus interface unit (BIU, Bus Interface Unit) 310 is used for the interaction between the DMAC and the instruction fetch buffer (Instruction Fetch Buffer) 309; the bus interface unit 301 is also used for the instruction fetch memory 309 to obtain instructions from the external memory; the bus interface unit 301 also The storage unit access controller 305 obtains the original data of the input matrix A or the weight matrix B from the external memory.
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器306中,或将权重数据搬运到权重存储器302中,或将输入数据搬运到输入存储器301中。The DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 306, or to transfer the weight data to the weight memory 302, or to transfer the input data to the input memory 301.
向量计算单元307多个运算处理单元,在需要的情况下,对运算电路303的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。向量计算单元307主要用于神经网络中非卷积层,或全连接层(FC,fully connected layers)的计算,具体可以处理:Pooling(池化),Normalization(归一化)等的计算。例如,向量计算单元307可以将非线性函数应用到运算电路303的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元307生成归一化的值、合并值,或二者均有。The vector calculation unit 307 has multiple arithmetic processing units, if necessary, further processing the output of the arithmetic circuit 303, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on. The vector calculation unit 307 is mainly used for calculation of non-convolutional layers or fully connected layers (FC, fully connected layers) in the neural network. Specifically, it can process: Pooling (pooling), Normalization (normalization), etc. calculations. For example, the vector calculation unit 307 may apply a nonlinear function to the output of the arithmetic circuit 303, such as a vector of accumulated values, to generate the activation value. In some implementations, the vector calculation unit 307 generates a normalized value, a combined value, or both.
在一些实现中,向量计算单元307将经处理的向量存储到统一存储器306。在一些实现中,经向量计算单元307处理过的向量能够用作运算电路303的激活输入,例如用于神经网络中后续层中的使用,如图2所示,若当前处理层是隐含层1(231),则经向量计算单元307处理过的向量还可以被用到隐含层2(232)中的计算。In some implementations, the vector calculation unit 307 stores the processed vector to the unified memory 306. In some implementations, the vector processed by the vector calculation unit 307 can be used as the activation input of the arithmetic circuit 303, for example, for use in subsequent layers in a neural network, as shown in FIG. 2, if the current processing layer is a hidden layer 1 (231), the vector processed by the vector calculation unit 307 can also be used for calculation in the hidden layer 2 (232).
控制器304连接的取指存储器(instruction fetch buffer)309,用于存储控制器304使用的指令;The instruction fetch buffer 309 connected to the controller 304 is used to store instructions used by the controller 304;
统一存储器306,输入存储器301,权重存储器302以及取指存储器309均为On-Chip存储器。外部存储器独立于该NPU硬件架构。The unified memory 306, the input memory 301, the weight memory 302, and the fetch memory 309 are all On-Chip memories. The external memory is independent of the NPU hardware architecture.
其中,图5所示的降噪自编码器中各层的运算可以由运算电路303或向量计算单元307执行。Among them, the calculation of each layer in the noise reduction autoencoder shown in FIG. 5 can be executed by the arithmetic circuit 303 or the vector calculation unit 307.
下面详细描述本申请实施例涉及的方法。The methods involved in the embodiments of the present application are described in detail below.
实施例一:Example one:
图7A为本发明实施例一提供的一种降噪自编码器的训练方法的流程示意图,图7B为本发明实施例一提供的一种降噪自编码器的训练方法的示意性说明图。该方法具体可以由如图3所示的训练设备120执行。可选地,该方法中步骤S702-S706也可以由训练设备120之前由其他功能模块预先执行,即先对从所述数据库130中接收或者获取到的原始样本的数据进行预处理,得到训练样本,进而通过训练样本由训练设备执行S708、S710从而训练得到降噪自编码器。可选的,该方法可以由CPU处理,也可以由CPU和适合用于神经网络计算的处理器(如图6所示的神经网络处理器30)共同处理如图6所示的神经网络处理器30,本申请不做限制。该方法可以包括如下部分或全部步骤:FIG. 7A is a schematic flowchart of a method for training a noise-reducing autoencoder according to Embodiment 1 of the present invention, and FIG. 7B is a schematic explanatory diagram of a method for training a noise-reducing autoencoder according to Embodiment 1 of the present invention. The method can be specifically executed by the training device 120 shown in FIG. 3. Optionally, steps S702-S706 in the method may also be pre-executed by other functional modules before the training device 120, that is, the data of the original samples received or obtained from the database 130 is preprocessed to obtain training samples Then, the training device executes S708 and S710 through the training samples to train the noise-reducing autoencoder. Optionally, the method may be processed by the CPU, or may be processed by the CPU and a processor suitable for neural network calculations (the neural network processor 30 shown in FIG. 6) together to process the neural network processor shown in FIG. 6 30. This application is not restricted. The method may include some or all of the following steps:
S702:将无噪心电信号与肌电噪声信号叠加,得到合成心电信号,其中,无噪心电信号中肌电噪声的信噪比(signal-to-noise ratio,SNR)不小于第一阈值,无噪心电信号包括M拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的整数。S702: Superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal, where the signal-to-noise ratio (SNR) of the noise-free ECG signal is not less than the first Threshold, noise-free ECG signal includes M beat ECG signal, each beat ECG signal contains a QRS complex, H is an integer greater than 1.
在本申请一种实现中,无噪心电信号可以是在人处于静止状态下通过心电采集设备采集的心电信号。无噪心电信号可以包括H拍心电信号,为按时间排序的一系列采样点,采样点的值表示了采集该采样点时生物体表面电信号的强度。应理解,本申请实施例中无噪心电信号是指不含或几乎不含肌电噪声的心电信号,但不排除该无噪心电信号包括如工频噪声、基线漂移或其他噪声等。具体的,无噪心电信号的信噪比不小于第一阈值,该第一阈值可以是大于10db的固定值,比如10db、15db、20db或40db等,也可以根据无噪心电 信号的功率确定,例如,该第一阈值为使得无噪心电信号的信噪比等于第二阈值。该信噪比具体可以是无噪心电信号的功率与肌电噪声的功率比值,也可以是无噪心电信号的功率与噪声的功率的比值。In an implementation of the present application, the noise-free ECG signal may be an ECG signal collected by an ECG acquisition device when the person is in a static state. The noise-free ECG signal may include the H-beat ECG signal, which is a series of sampling points sorted by time, and the value of the sampling point represents the intensity of the electrical signal on the surface of the organism when the sampling point is collected. It should be understood that the noise-free ECG signal in the embodiments of the present application refers to the ECG signal that contains no or almost no EMG noise, but it is not excluded that the noise-free ECG signal includes such as power frequency noise, baseline drift or other noise, etc. . Specifically, the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold, and the first threshold can be a fixed value greater than 10db, such as 10db, 15db, 20db or 40db, etc., or it can be based on the power of the noise-free ECG signal It is determined, for example, that the first threshold is such that the signal-to-noise ratio of the noise-free ECG signal is equal to the second threshold. The signal-to-noise ratio may specifically be the ratio of the power of the noise-free ECG signal to the power of myoelectric noise, or the ratio of the power of the noise-free ECG signal to the power of the noise.
具体地,无噪心电信号和肌电噪声信号具有相同的采样频率和长度,生成合成心电信号的一种实现方式可以是,将肌电噪声信号与无噪心电信号进行叠加,即合成心电信号的幅值为无噪心电信号的幅值与肌电噪声信号的幅值之和,或者,为无噪心电信号的幅值与肌电噪声信号的幅值加权求和,也可以具有其他的叠加方式,本申请实施例不作限定。在具体的计算中,可以合成心电信号中第k个采样点的值等于无噪心电信号中第k个采样点的值与噪声信号中第k个采样点的值之和。Specifically, the noise-free ECG signal and the EMG noise signal have the same sampling frequency and length. One way to generate a synthetic ECG signal may be to superimpose the EMG noise signal and the noise-free ECG signal, that is, to synthesize The amplitude of the ECG signal is the sum of the amplitude of the noise-free ECG signal and the amplitude of the EMG noise signal, or the weighted sum of the amplitude of the noise-free ECG signal and the amplitude of the EMG noise signal, also There may be other superposition methods, which are not limited in the embodiment of the present application. In specific calculations, the value of the k-th sampling point in the synthesized ECG signal is equal to the sum of the value of the k-th sampling point in the noise-free ECG signal and the value of the k-th sampling point in the noise signal.
为区别本申请中各个样本,将合成心电信号和该合成心电信号对应的无噪心电信号构成的样本称为原始样本,多个原始样本构成原始样本集。不同原始样本中叠加生成的合成心电信号所采用的噪声信号可以不同或相同,对此不作限定。应理解,心电信号(比如合成心电信号或无噪心电信号等)的长度指心电信号的时长,本申请实施例中,心电信号的长度可以是5-10min,也可以更长或更短,此处,不作限定。还应理解,心电信号中采样点的个数与采样频率和心电信号的长度有关,同一采样频率的两个相同长度的信号,其采样点的个数相同。In order to distinguish each sample in this application, a sample composed of a synthetic ECG signal and a noise-free ECG signal corresponding to the synthetic ECG signal is called an original sample, and multiple original samples constitute an original sample set. The noise signals used in the synthesized ECG signals superimposed on different original samples may be different or the same, and there is no limitation on this. It should be understood that the length of an ECG signal (such as a synthesized ECG signal or a noiseless ECG signal, etc.) refers to the duration of the ECG signal. In the embodiment of the present application, the length of the ECG signal may be 5-10 minutes or longer. Or shorter, not limited here. It should also be understood that the number of sampling points in the ECG signal is related to the sampling frequency and the length of the ECG signal. Two signals with the same length at the same sampling frequency have the same number of sampling points.
可选地,还可以在叠加生成合成心电信号之前,对无噪心电信号进行预处理,该预处理的过程可以包括小波变换(wavelet transform,WT),以去除无噪心电信号中心电信号频带外的噪声。也可以在叠加生成合成心电信号之后,对合成心电信号进行小波变换,本申请实施例不作限定。应理解,心电信号的频带一般在0.05-60Hz之间,肌电噪声的频率主要集中在0.01-100Hz,可以采用小波变换去除心电信号频带外(0-0.05Hz和60H以上)的噪声信号,以减轻后期降噪过程的难度,小波变换的具体实现为现有技术,此处不再赘述。此时,原始样本中合成心电信号可以是其经过小波变换处理后的心电信号,同时,该合成心电信号对应的无噪心电信号可以是其经过小波变化处理后的心电信号。Optionally, the noise-free ECG signal may be preprocessed before superimposing and generating the synthesized ECG signal. The preprocessing process may include wavelet transform (wavelet transform, WT) to remove the central electrical signal of the noiseless ECG signal. Noise outside the signal band. It is also possible to perform wavelet transformation on the synthesized ECG signal after superposing and generating the synthesized ECG signal, which is not limited in the embodiment of the present application. It should be understood that the frequency band of the ECG signal is generally between 0.05-60Hz, and the frequency of myoelectric noise is mainly concentrated in 0.01-100Hz. Wavelet transform can be used to remove the noise signal outside the ECG signal band (0-0.05Hz and above 60H) In order to reduce the difficulty of the later noise reduction process, the specific implementation of wavelet transform is the prior art, which will not be repeated here. At this time, the synthetic ECG signal in the original sample may be the ECG signal processed by wavelet transform, and meanwhile, the noise-free ECG signal corresponding to the synthetic ECG signal may be the ECG signal processed by the wavelet transformation.
S704:利用平均节拍减法将合成心电信号分解为基准心电信号和含噪剩余心电信号。S704: Decompose the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using an average beat subtraction method.
S704的第一种实现具体可以包括如下步骤:The first implementation of S704 may specifically include the following steps:
S7041:对目标心电信号中的W拍心电信号进行平均处理,得到的第二平均心电信号,其中,目标心电信号可以是合成心电信号、无噪心电信号或从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等,W≤H,W为正整数。S7041: Perform average processing on the W beat ECG signal in the target ECG signal to obtain the second average ECG signal, where the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal or from the first user (That is, users who have been collected to obtain a noise-free ECG signal) historically collected ECG signals, etc., W≤H, W is a positive integer.
S7042:将第二平均心电信号替换合成心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H。 S7042: Substituting the second average ECG signal for A j corresponding to the H-beat ECG signal in the synthesized ECG signal to obtain a reference ECG signal, where A j represents the H-beat ECG signal centered on R j and left and right. For the ECG signal in the Δt interval, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H.
S7043:从合成心电信号中移除基准心电信号,得到含噪剩余心电信号。S7043: Remove the reference ECG signal from the synthesized ECG signal to obtain a noisy residual ECG signal.
应理解,S7041中生成第二平均心电信号所采用的W拍心电信号可以来源于合成心电信号、无噪心电信号或从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等。该W拍心电信号可以是连续的W拍心电信号,也可以是不连续或部分节拍连续的多拍心电信号。在训练设备对该W拍心电信号进行信号平均之前,需要保证该W拍心电信号的位置对齐,进而,将对齐后的W拍心电信号进行叠加、平均,本申请实施例 对合成心电信号以W拍心电信号进行平均处理得到第二平均心电信号为例来说明。It should be understood that the W beat ECG signal used to generate the second average ECG signal in S7041 can be derived from a synthetic ECG signal, a noise-free ECG signal, or from the first user (that is, a noise-free ECG signal that is collected) User) historically collected ECG signals, etc. The W-beat ECG signal may be a continuous W-beat ECG signal, or a discontinuous or partially continuous multi-beat ECG signal. Before the training device performs signal averaging on the W-beat ECG signal, it is necessary to ensure that the position of the W-beat ECG signal is aligned, and further, the aligned W-beat ECG signal is superimposed and averaged. The electrical signal is illustrated by taking the average processing of the W beat ECG signal to obtain the second average ECG signal as an example.
上述第二平均心电信号的具体实现可以是:The specific implementation of the above-mentioned second average ECG signal may be:
第二平均心电信号
Figure PCTCN2020080880-appb-000054
是通过对目标心电信号中W拍心电信号进行平均处理得到的。即:
Second average ECG signal
Figure PCTCN2020080880-appb-000054
It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
Figure PCTCN2020080880-appb-000055
Figure PCTCN2020080880-appb-000055
其中,
Figure PCTCN2020080880-appb-000056
表示第二平均心电信号,A k表示W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
among them,
Figure PCTCN2020080880-appb-000056
Represents the second average ECG signal, Ak represents the ECG signal in the interval of Δt taken from the left and right sides of the W-beat ECG signal with R k as the center, R k is the apex of the QRS complex in the W-beat ECG signal, k= 1,2……W.
进一步地,第二平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式:Further, the second average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
Figure PCTCN2020080880-appb-000057
Figure PCTCN2020080880-appb-000057
其中,
Figure PCTCN2020080880-appb-000058
为第二平均心电信号
Figure PCTCN2020080880-appb-000059
中第v个采样点的值,A k(v)为W拍心电信号中以R k为中心左右各取Δt区间内的心电信号中的第v个采样点的值,1≤v≤V,1≤k≤W,v,k为正整数。
among them,
Figure PCTCN2020080880-appb-000058
Is the second average ECG signal
Figure PCTCN2020080880-appb-000059
The value of the v-th sampling point in the W beat ECG signal, A k (v) is the value of the v-th sampling point in the ECG signal in the Δt interval with R k as the center in the W beat ECG signal, 1≤v≤ V,1≤k≤W, v,k are positive integers.
应理解,在上述实现方式1中,针对不同的合成心电信号,通过实现方式1得到的第二平均心电信号不同,进而通过实现方式1中第二平均心电信号得到的基准心电信号也不同。It should be understood that in the foregoing implementation manner 1, for different synthetic ECG signals, the second average electrocardiogram signals obtained through implementation manner 1 are different, and then the reference electrocardiogram signals obtained through the second average electrocardiogram signal in implementation manner 1 Also different.
可见,针对不同的合成心电信号,通过实现方式1得到的第二平均心电信号不同,进而通过实现方式1中第二平均心电信号得到的基准心电信号也不同。本实现方式1针对不同的合成心电信号自适应地选择基准心电信号,得到的基准心电信号可以提取出了合成心电信号的明显特征,使得训练得到的目标降噪自编码器可以适应不同的心电信号,从而提高目标降噪自编码器的降噪性能。It can be seen that for different synthetic ECG signals, the second average ECG signal obtained by the implementation method 1 is different, and the reference ECG signal obtained by the second average ECG signal in the implementation method 1 is also different. This implementation method 1 adaptively selects the reference ECG signal for different synthetic ECG signals, and the obtained reference ECG signal can extract the obvious characteristics of the synthetic ECG signal, so that the target noise reduction autoencoder obtained by training can be adapted Different ECG signals, thereby improving the noise reduction performance of the target noise reduction autoencoder.
还应理解,信号平均可以降低心电信号的噪声,通过对合成心电信号或无噪心电信号进行信号平均得到第二平均心电信号是经过降噪处理后的一拍心电信号,进而,由第二平均心电信号得到的基准心电信号,可以认为不含肌电噪声,还保留了和目标心电信号的R峰的平均幅值,且上述得到的基准心电信号是针对特定的合成心电信号生成的,更能准确地表示合成心电信号的明显特征。It should also be understood that signal averaging can reduce the noise of the ECG signal. By averaging the synthesized ECG signal or the noise-free ECG signal, the second average ECG signal is a one-beat ECG signal after noise reduction processing. , The reference ECG signal obtained from the second average ECG signal can be considered to contain no EMG noise, and the average amplitude of the R peak of the target ECG signal is retained, and the reference ECG signal obtained above is for a specific The synthetic ECG signal is generated, which can more accurately represent the obvious characteristics of the synthetic ECG signal.
在第二平均心电信号
Figure PCTCN2020080880-appb-000060
是通过对无噪心电信号中W拍心电信号进行平均处理得到的情况下。由于,合成心电信号是由无噪心电信号与噪声信号合成得到,无噪心电信号具有与合成心电信号相同的R峰位置、R-R间距等特征,因此,与合成心电信号进行信号平均得到的第二平均心电信号相比,由无噪心电信号进行平均得到的第二平均心电信号具有更少的噪声和肌电噪声,进而将更多的肌电噪声保留到含噪剩余心电信号中,使得训练得到的目标降噪自编码器可以学习到针对该部分肌电噪声的降噪功能。
Average ECG signal in the second
Figure PCTCN2020080880-appb-000060
It is obtained by averaging the W beat ECG signal in the noiseless ECG signal. Since the synthetic ECG signal is synthesized by the noise-free ECG signal and the noise signal, the noise-free ECG signal has the same characteristics as the R peak position and RR distance of the synthesized ECG signal, so it is combined with the synthesized ECG signal. Compared with the second average ECG signal obtained by averaging, the second average ECG signal obtained by averaging the noiseless ECG signal has less noise and EMG noise, and then more EMG noise is retained to contain noise In the remaining ECG signal, the trained target noise reduction autoencoder can learn the noise reduction function for this part of the EMG noise.
在第二平均心电信号
Figure PCTCN2020080880-appb-000061
是通过对第一用户上历史采集的心电信号中W拍心电信号进行平均处理得到的情况下。针对同一用户的心电信号,采用同一第二平均心电信号。该方式得到第二平均心电信号生成的基准心电信号考虑到个人的差异,使得基准心电信号可以 更准确地表示合成心电信号的明显特征,对于同一用户得到的基准心电信号,仅需要进行一次计算,提高计算效率。
Average ECG signal in the second
Figure PCTCN2020080880-appb-000061
It is obtained by averaging the W-beat ECG signals from the historically collected ECG signals of the first user. For the ECG signal of the same user, the same second average ECG signal is used. The reference ECG signal generated by the second average ECG signal obtained in this way takes into account individual differences, so that the reference ECG signal can more accurately represent the obvious characteristics of the synthesized ECG signal. For the reference ECG signal obtained by the same user, only A calculation is required to improve calculation efficiency.
S704的第二种实现具体可以包括但不限于如下步骤:The second implementation of S704 may specifically include but is not limited to the following steps:
S7044:训练设备可以检测目标心电信号中的W拍心电信号中每一拍心电信号的R峰(即R波的顶点),该R峰即为一拍心电信号中能量值最大的采样点。S7044: The training device can detect the R peak of each beat of the ECG signal in the W beat ECG signal in the target ECG signal (that is, the apex of the R wave), and the R peak is the highest energy value in the beat of the ECG signal Sampling point.
S7045:对目标心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,第二平均心电信号的R峰左侧包括Δt1的心电信号,右侧包括Δt2的心电信号,该目标心电信号可以是合成心电信号、无噪心电信号、或者从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等,W≤H,W为正整数。S7045: Perform average processing on the W beat ECG signal in the target ECG signal to obtain the second average ECG signal. The R peak of the second average ECG signal includes the ECG signal of Δt1 on the left side and the ECG signal of Δt2 on the right side. Signal, the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, or a historically collected ECG signal from the first user (that is, the user who has been collected to obtain the noiseless ECG signal), etc., W≤ H and W are positive integers.
S7046:将第二平均心电信号替换合成心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示H拍心电信号中以R j为基准左取Δt1右取Δt2得到的区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H。 S7046: Replace the second average ECG signal with A j corresponding to the H-beat ECG signal in the synthesized ECG signal to obtain the reference ECG signal. A j means that the H-beat ECG signal takes R j as the reference and takes Δt1 from the left and takes the right The ECG signal in the interval obtained by Δt2, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H.
S7047:从合成心电信号中移除待降噪基准心电信号,得到含噪剩余心电信号。S7047: Remove the reference ECG signal to be noise-reduced from the synthesized ECG signal to obtain the noise-containing residual ECG signal.
S7045的一种具体实现可以是针对W拍心电信号中的每一拍心电信号,选取以R峰为基准左取Δt1右取Δt2得到的区间内的心电信号,得到W个心电信号片段。进而,对该W个心电信号片段进行平均处理,得到第二平均心电信号。其中,每一个心电信号片段包括一个QRS波群,且所有心电信号片段中R峰位置相对于其所在心电信号片段的起点位置的距离相同,即W个心电信号片段在R峰同一侧的采样点个数都相同,以保证W个心电信号片段对齐。A specific implementation of S7045 can be to select the ECG signal in the interval obtained by taking the R peak as the reference to the left and right taking Δt2 for each beat of the W beat ECG signal to obtain W ECG signals Fragment. Furthermore, the W ECG signal segments are averaged to obtain a second average ECG signal. Among them, each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, W ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure that the W ECG signal segments are aligned.
在另一种实现中,被选取的W个长度为L的心电信号片段也可以包括P波、QRS波群、T波;或者包括P波、QRS波群等。In another implementation, the selected W ECG signal segments of length L may also include P waves, QRS complexes, and T waves; or include P waves, QRS complexes, and so on.
例如,被选取的W个心电信号片段都包括V个采样点,其中,R峰都位于第Z个采样点,V、Z为大于1的整数,Z小于V。For example, the selected W ECG signal segments all include V sampling points, where the R peaks are all located at the Z-th sampling point, V and Z are integers greater than 1, and Z is less than V.
第二平均心电信号
Figure PCTCN2020080880-appb-000062
是通过对W个心电信号片段C k(k=1,2……W)进行平均处理得到的。此时,C k表示W拍心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
Second average ECG signal
Figure PCTCN2020080880-appb-000062
It is obtained by averaging W ECG signal segments C k (k=1, 2...W). At this time, C k represents the ECG signal in the interval obtained by taking R k as the reference Δt1 and Δt2 in the W-beat ECG signal, R k is the apex of the QRS complex in the W-beat ECG signal, k=1, 2 ...W.
Figure PCTCN2020080880-appb-000063
Figure PCTCN2020080880-appb-000063
其中,
Figure PCTCN2020080880-appb-000064
表示第二平均心电信号,A k表示W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为W拍心电信号中QRS波群的顶点,k=1,2……W。
among them,
Figure PCTCN2020080880-appb-000064
Represents the second average ECG signal, Ak represents the ECG signal in the interval of Δt taken from the left and right sides of the W-beat ECG signal with R k as the center, R k is the apex of the QRS complex in the W-beat ECG signal, k= 1,2……W.
进一步地,第二平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式:Further, the second average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
Figure PCTCN2020080880-appb-000065
Figure PCTCN2020080880-appb-000065
其中,
Figure PCTCN2020080880-appb-000066
为第二平均心电信号
Figure PCTCN2020080880-appb-000067
中第v个采样点的值,C k(v)为W拍心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号中的第v个采样点的值,1≤v≤V, 1≤k≤W,v,k为正整数。
among them,
Figure PCTCN2020080880-appb-000066
Is the second average ECG signal
Figure PCTCN2020080880-appb-000067
The value of the v-th sampling point in the W beat ECG signal, C k (v) is the value of the v-th sampling point in the ECG signal in the interval obtained by taking R k as the reference Δt1 in the W beat ECG signal, 1≤ v≤V, 1≤k≤W, v and k are positive integers.
在第二平均心电信号的另一种实现中,训练设备可以从目标心电信号中划分出W拍心电信号,进而,检测W拍心电信号中每一拍心电信号的R峰,该R峰即为一拍心电信号中幅值最大的采样点;进而,以R峰为基准将W拍心电信号进行对齐,此时,对齐后,每一个位置的采样点的个数不大于W,进而,将对齐后的W拍心电信号进行平均,得到第二平均心电信号。具体的,可以计算每一个位置上的一个或多个采样点的平均幅值,计算的得到各个位置的平均幅值,得到平均心电信号,进而选取该平均心电信号中以R k为基准Δt1右取Δt2得到的区间内的心电信号,得到第二平均心电信号。 In another implementation of the second average ECG signal, the training device can divide the W-beat ECG signal from the target ECG signal, and then detect the R peak of each beat of the ECG signal in the W-beat ECG signal, The R peak is the sampling point with the largest amplitude in the one-beat ECG signal; furthermore, the W-beat ECG signal is aligned based on the R peak. At this time, after the alignment, the number of sampling points at each position is not Is greater than W, and then the aligned W beat ECG signals are averaged to obtain a second average ECG signal. Specifically, the average amplitude of one or more sampling points at each position can be calculated, the average amplitude of each position can be calculated, and the average ECG signal can be obtained, and then the average ECG signal is selected based on R k Δt1 takes the ECG signal in the interval obtained by Δt2 to the right to obtain the second average ECG signal.
此时,R峰在被划分得到的N拍心电信号中的位置可能各不相同,该N拍心电信号的长度可以相同或不同。将W拍心电信号对齐后得到的位置进行编号,k表示该W拍心电信号对齐后得到的位置的索引。At this time, the position of the R peak in the divided N-beat ECG signal may be different, and the length of the N-beat ECG signal may be the same or different. Number the positions obtained after the W-beat ECG signal is aligned, and k represents the index of the position obtained after the W-beat ECG signal is aligned.
此时,
Figure PCTCN2020080880-appb-000068
为平均心电信号
Figure PCTCN2020080880-appb-000069
中第v个采样点的值,可以表示为:
Figure PCTCN2020080880-appb-000070
其中,
Figure PCTCN2020080880-appb-000071
为平均心电信号
Figure PCTCN2020080880-appb-000072
中第v个采样点的值,D k(v)为W拍心电信号中以R k为所在的一拍心电信号中位置v处采样点的值,1≤v≤V,1≤k≤W,v,k为正整数。若心电信号D k中位置v处无采样点分布,则D k(v)为0。
at this time,
Figure PCTCN2020080880-appb-000068
Average ECG signal
Figure PCTCN2020080880-appb-000069
The value of the v-th sampling point in can be expressed as:
Figure PCTCN2020080880-appb-000070
among them,
Figure PCTCN2020080880-appb-000071
Average ECG signal
Figure PCTCN2020080880-appb-000072
The value of the v-th sampling point in the W-beat ECG signal, D k (v) is the value of the sampling point at position v in the W-beat ECG signal with R k as the location, 1≤v≤V, 1≤k ≤W, v and k are positive integers. If there is no sampling point distribution at position v in the ECG signal D k , then D k (v) is zero.
进一步地,选取平均心电信号
Figure PCTCN2020080880-appb-000073
以R k为基准Δt1右取Δt2得到的区间内的心电信号,得到第二平均心电信号
Figure PCTCN2020080880-appb-000074
Further, select the average ECG signal
Figure PCTCN2020080880-appb-000073
Take R k as the reference Δt1 and take the ECG signal in the interval obtained by Δt2 to get the second average ECG signal
Figure PCTCN2020080880-appb-000074
应理解,上述第一种实现为第二种实现的一个特例。原始样本中合成心电信号的长度越长,N越大,依据大数定路,第二平均心电信号的估计就更准确。It should be understood that the first implementation described above is a special case of the second implementation. The longer the length of the synthetic ECG signal in the original sample, the larger N will be, and the second average ECG signal will be more accurate when the route is determined based on a large number.
还应理解,信号平均可以降低心电信号的噪声,通过对合成心电信号或无噪心电信号进行信号平均得到第二平均心电信号是经过降噪处理后的一拍心电信号,进而,由第二平均心电信号生成的基准心电信号,可以认为不含肌电噪声,且上述得到的基准心电信号是针对特定的合成心电信号生成的,更能准确地表示合成心电信号的明显特征。It should also be understood that signal averaging can reduce the noise of the ECG signal. By averaging the synthesized ECG signal or the noise-free ECG signal, the second average ECG signal is a one-beat ECG signal after noise reduction processing. , The reference ECG signal generated by the second average ECG signal can be considered to contain no EMG noise, and the reference ECG signal obtained above is generated for a specific synthetic ECG signal, which can more accurately represent the synthetic ECG The distinctive feature of the signal.
进一步地,合成心电信号是由无噪心电信号与噪声信号合成得到,与合成心电信号进行信号平均得到的第二平均心电信号相比,由无噪心电信号进行平均得到的第二平均心电信号具有更少的肌电噪声,进而将更多的肌电噪声保留到含噪剩余心电信号中,使得训练得到的目标降噪自编码器可以学习到针对该部分肌电噪声的降噪功能。Further, the synthetic ECG signal is obtained by synthesizing the noise-free ECG signal and the noise signal. Compared with the second average ECG signal obtained by averaging the synthesized ECG signal, the first average ECG signal obtained by averaging the noise-free ECG signal The two-average ECG signal has less EMG noise, and more EMG noise is retained in the noisy residual ECG signal, so that the trained target noise reduction autoencoder can learn to deal with this part of EMG noise The noise reduction function.
S7042或S7046中形成基准心电信号的具体方法如下:The specific method of forming the reference ECG signal in S7042 or S7046 is as follows:
应理解,通过平均节拍减法得到的基准心电信号的R峰位置与合成心电信号的R峰位置相同。此时基准心电信号具有与合成心电信号相同的R峰位置、R-R间隔等特征。It should be understood that the R peak position of the reference ECG signal obtained by the average beat subtraction is the same as the R peak position of the synthesized ECG signal. At this time, the reference ECG signal has the same R peak position and R-R interval as the synthetic ECG signal.
本申请实施例以S7046的一种具体实现为例来说明,应理解,上述第一种实现为第二种实现的一个特例,S7042的具体实现可以参照S7046的实现,此处不再赘述。请一并参阅图7C所示的计算基准心电信号的原理示意图,S7046的一种具体的实现方式可以包括但不限于如下步骤:The embodiment of the present application takes a specific implementation of S7046 as an example for description. It should be understood that the above-mentioned first implementation is a special case of the second implementation, and the specific implementation of S7042 can refer to the implementation of S7046, which will not be repeated here. Please also refer to the schematic diagram of the principle of calculating the reference ECG signal shown in FIG. 7C. A specific implementation of S7046 may include but is not limited to the following steps:
S70461:检测合成心电信号中的R峰位置和第二平均心电信号的R峰位置。S70461: Detect the R peak position of the synthetic ECG signal and the R peak position of the second average ECG signal.
应理解,心电信号中R峰检测为现有技术,此处不再赘述。It should be understood that the R peak detection in the ECG signal is a prior art, and will not be repeated here.
S70462:根据第二平均心电信号、合成心电信号中的R峰位置和第二平均心电信号的 R峰位置,得到H个信号片段,H个信号片段具有与第二平均心电信号相同的波形,且H个信号片段中的第h个信号片段的R峰位置等于合成心电信号中的第h个R峰位置,h为正整数,h不大于合成心电信号中R峰的总个数。图7C以H=3为例来说明。S70462: Obtain H signal segments according to the second average ECG signal, the R peak position in the synthesized ECG signal, and the R peak position of the second average ECG signal, and the H signal segments are the same as the second average ECG signal And the R peak position of the h-th signal segment in the H signal segments is equal to the h-th R peak position in the synthesized ECG signal, h is a positive integer, and h is not greater than the total R peak in the synthesized ECG signal Number. Fig. 7C takes H=3 as an example for illustration.
具体的,以R峰位置为基准,将第二平均心电信号分别与合成心电信号中的每一拍心电信号对齐,与合成心电信号中R峰位置对齐的第二平均心电信号称为信号片段,应理解,相对于第二平均心电信号,信号片段中每一个采样点的位置整体移动,但其波形不变。Specifically, taking the R peak position as a reference, the second average ECG signal is aligned with each beat of the composite ECG signal, and the second average ECG signal aligned with the R peak position in the composite ECG signal is called It should be understood that, relative to the second average ECG signal, the position of each sampling point in the signal segment moves as a whole, but its waveform remains unchanged.
还应理解,合成心电信号中任意相邻两个R峰之间的间隔(即R-R间隔)可能不同,第二平均心电信号的长度可能大于一个R-R间隔的长度,也可能小于一个R-R间隔的长度。此时,相邻的两个信号片段可能发生部分重叠,也可能具有一定的间距。It should also be understood that the interval between any two adjacent R peaks in the synthetic ECG signal (ie, the RR interval) may be different, and the length of the second average ECG signal may be greater than the length of an RR interval, or may be less than the length of an RR interval. length. At this time, two adjacent signal segments may partially overlap or have a certain distance.
S70463:根据H个信号片段生成基准心电信号,其中,基准心电信号在第三位置的采样点的值为第三信号片段在第三位置上采样点的值和第四信号片段在第三位置上采样点的值的平均,第三位置为H个信号片段中存在多个采样点的位置,第三信号片段和第四信号片段为H个信号片段中在第三位置上有采样点的两个信号片段;基准心电信号在第四位置上的采样点的值是根据多个信号片段中与第四位置最相邻的两个采样点的值插值得到,第三位置为H个信号片段重叠的位置,第四位置为H个信号片段之间的位置。S70463: Generate a reference ECG signal according to the H signal segments, where the value of the sampling point of the reference ECG signal at the third position is the value of the sampling point of the third signal segment at the third position and the value of the fourth signal segment at the third position. The average of the value of the sampling point at the position, the third position is the position where there are multiple sampling points in the H signal fragments, the third signal fragment and the fourth signal fragment are the H signal fragments with the sampling point at the third position Two signal segments; the value of the sampling point of the reference ECG signal at the fourth position is obtained by interpolating the values of the two closest sampling points to the fourth position in the multiple signal segments, and the third position is H signals Where the segments overlap, the fourth position is the position between H signal segments.
其中,插值算法为现有技术,此处不再赘述。Among them, the interpolation algorithm is an existing technology, and will not be repeated here.
应理解,在S70463的另一种实现中,基准心电信号在第三位置上的采样点的值可以是第三信号片段在第三位置上的采样点的值或第四信号片段在第三位置上的采样点的值。基准心电信号在第四位置上的采样点的值也可以置0,此处不作限定。It should be understood that in another implementation of S70463, the value of the sampling point of the reference ECG signal at the third position may be the value of the sampling point of the third signal segment at the third position or the value of the sampling point of the fourth signal segment at the third position. The value of the sampling point at the location. The value of the sampling point of the reference ECG signal at the fourth position can also be set to 0, which is not limited here.
S7043、S7047从合成心电信号中移除基准心电信号,得到含噪剩余心电信号。S7043 and S7047 remove the reference ECG signal from the synthesized ECG signal to obtain the noisy residual ECG signal.
应理解,合成心电信号、无噪心电信号、基准心电信号、含噪剩余心电信号、无噪剩余心电信号都包括相同个数的采样点。从合成心电信号中移除基准心电信号,即为,合成心电信号中采样点的值与基准心电信号中采样点的值对应相减,也就是说,含噪剩余心电信号中第x个采样点的值等于合成心电信号中第x个采样点的值与基准心电信号中第x个采样点的值之差。It should be understood that the synthesized ECG signal, the noise-free ECG signal, the reference ECG signal, the noise-containing residual ECG signal, and the noise-free residual ECG signal all include the same number of sampling points. Remove the reference ECG signal from the synthetic ECG signal, that is, the value of the sample point in the synthetic ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the residual ECG signal with noise The value of the xth sampling point is equal to the difference between the value of the xth sampling point in the synthetic ECG signal and the value of the xth sampling point in the reference ECG signal.
S706:从无噪心电信号中移除基准心电信号,得到无噪剩余心电信号。S706: Remove the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal.
同理,从无噪心电信号中移除基准心电信号,即为,无噪心电信号中采样点的值与基准心电信号中采样点的值对应相减,也就是说,无噪剩余心电信号中第x个采样点的值等于无噪心电信号中第x个采样点的值与基准心电信号中第x个采样点的值之差。其中,x为采样点的索引,x为正整数,x不大于合成心电信号中采样点的总个数。In the same way, removing the reference ECG signal from the noise-free ECG signal means that the value of the sample point in the noise-free ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the noise-free ECG signal The value of the xth sample point in the remaining ECG signal is equal to the difference between the value of the xth sample point in the noise-free ECG signal and the value of the xth sample point in the reference ECG signal. Among them, x is the index of the sampling point, x is a positive integer, and x is not greater than the total number of sampling points in the synthesized ECG signal.
在本申请实施例的实现方式(1)中:In the implementation manner (1) of the embodiment of this application:
合成心电信号X q移除基准心电信号后得到的含噪剩余心电信号
Figure PCTCN2020080880-appb-000075
的长度符合降噪自编码器的对输入数据的长度要求。此时,含噪剩余心电信号
Figure PCTCN2020080880-appb-000076
和无噪剩余心电信号
Figure PCTCN2020080880-appb-000077
构成的样本称为训练样本,其中,合成心电信号X q是由无噪心电信号Y q与肌电噪声信号叠 加得到,无噪剩余心电信号
Figure PCTCN2020080880-appb-000078
是无噪心电信号Y q移除基准心电信号后得到的信号。原始样本与训练样本一一对应。多个训练样本构成训练样本集。该训练样本集用于降噪自编码器的训练。
Synthetic ECG signal X q The noisy residual ECG signal obtained after removing the reference ECG signal
Figure PCTCN2020080880-appb-000075
The length meets the length requirement of the input data of the noise reduction autoencoder. At this time, the noisy residual ECG signal
Figure PCTCN2020080880-appb-000076
And noiseless residual ECG signal
Figure PCTCN2020080880-appb-000077
The formed samples are called training samples, among which, the synthetic ECG signal X q is obtained by superimposing the noise-free ECG signal Y q with the EMG noise signal, and the noise-free residual ECG signal
Figure PCTCN2020080880-appb-000078
It is the signal obtained after the noise-free ECG signal Y q is removed from the reference ECG signal. The original sample corresponds to the training sample one to one. Multiple training samples constitute a training sample set. This training sample set is used to train the noise reduction autoencoder.
此时,训练样本集中一个训练样本可以表示为
Figure PCTCN2020080880-appb-000079
其中,q为原始样本集中原始样本的索引,在本实现方式中也是训练样本集中训练样本的索引;训练样本集中包括Q个训练样本,q、Q为正整数,q≤Q。
At this point, a training sample in the training sample set can be expressed as
Figure PCTCN2020080880-appb-000079
Among them, q is the index of the original sample in the original sample set, which is also the index of the training sample in the training sample set in this implementation; the training sample set includes Q training samples, q and Q are positive integers, and q≤Q.
可选地,训练样本中的含噪剩余心电信号可以是分解得到的含噪剩余心电信号经过归一化得到的,归一化(Normalization)的方法可以是极大极小值归一化,或其他归一化方法,此处,以极大极小值归一化为例来说明:Optionally, the noisy residual ECG signal in the training sample may be obtained by normalizing the noisy residual ECG signal obtained by decomposition, and the normalization method may be maximum-minimum normalization , Or other normalization methods, here, take the maximum and minimum value normalization as an example to illustrate:
Figure PCTCN2020080880-appb-000080
Figure PCTCN2020080880-appb-000080
其中,
Figure PCTCN2020080880-appb-000081
为训练样本中的含噪剩余心电信号,
Figure PCTCN2020080880-appb-000082
为分解得到的含噪剩余心电信号,
Figure PCTCN2020080880-appb-000083
为训练样本中的含噪剩余心电信号中最小信号强度,
Figure PCTCN2020080880-appb-000084
为训练样本中的含噪剩余心电信号中最大信号强度。
among them,
Figure PCTCN2020080880-appb-000081
Is the noisy residual ECG signal in the training sample,
Figure PCTCN2020080880-appb-000082
To decompose the noisy residual ECG signal,
Figure PCTCN2020080880-appb-000083
Is the minimum signal strength of the noisy residual ECG signal in the training sample,
Figure PCTCN2020080880-appb-000084
Is the maximum signal strength in the noisy residual ECG signal in the training sample.
同理,训练样本中的无噪剩余心电信号以是分解得到的无噪剩余心电信号经过归一化得到的。以极大极小值归一化为例来说明:In the same way, the noise-free residual ECG signal in the training sample is obtained by normalizing the noise-free residual ECG signal obtained by decomposition. Take the maximum and minimum value normalization as an example to illustrate:
Figure PCTCN2020080880-appb-000085
Figure PCTCN2020080880-appb-000085
其中,
Figure PCTCN2020080880-appb-000086
为训练样本中的无噪剩余心电信号,
Figure PCTCN2020080880-appb-000087
为分解得到的无噪剩余心电信号,
Figure PCTCN2020080880-appb-000088
为训练样本中的无噪剩余心电信号中最小信号强度,
Figure PCTCN2020080880-appb-000089
为训练样本中的无噪剩余心电信号中最大信号强度。
among them,
Figure PCTCN2020080880-appb-000086
Is the noise-free residual ECG signal in the training sample,
Figure PCTCN2020080880-appb-000087
In order to decompose the noiseless residual ECG signal,
Figure PCTCN2020080880-appb-000088
Is the minimum signal strength of the noise-free residual ECG signal in the training sample,
Figure PCTCN2020080880-appb-000089
Is the maximum signal strength of the noise-free residual ECG signal in the training sample.
此时,训练样本集中一个训练样本可以表示为
Figure PCTCN2020080880-appb-000090
At this point, a training sample in the training sample set can be expressed as
Figure PCTCN2020080880-appb-000090
应理解,归一化不是生成训练样本集必须的步骤,训练设备也可以在将训练样本输入到降噪自编码器之前,对训练样本进行预处理,该预处理的过程可以包括归一化的操作,还可以包括其他的操作,此处不作限定。It should be understood that normalization is not a necessary step for generating a training sample set. The training device may also preprocess the training samples before inputting the training samples to the denoising autoencoder. The preprocessing process may include normalization. Operations can also include other operations, which are not limited here.
在本申请实施例的实现方式(2)中:In the implementation manner (2) of the embodiment of this application:
合成心电信号X q移除基准心电信号后得到的含噪剩余心电信号
Figure PCTCN2020080880-appb-000091
的长度远远大于降噪自编码器要求的对输入数据的长度。此时,可以对原始样本中含噪剩余心电信号
Figure PCTCN2020080880-appb-000092
和 无噪剩余心电信号
Figure PCTCN2020080880-appb-000093
进行切割,切割得到的含噪剩余心电信号切片
Figure PCTCN2020080880-appb-000094
符合降噪自编码器的对输入数据要求的长度。同样,对无噪剩余心电信号
Figure PCTCN2020080880-appb-000095
进行切割,得到无噪剩余心电信号切片
Figure PCTCN2020080880-appb-000096
其中,合成心电信号X q是由无噪心电信号Y q与肌电噪声信号叠加得到,无噪剩余心电信号
Figure PCTCN2020080880-appb-000097
是无噪心电信号Y q移除基准心电信号后得到的信号,e为Q个含噪剩余心电信号切割得到的E个无噪剩余心电信号切片中无噪剩余心电信号切片的索引,e、E为正整数,e≤E。应理解,含噪剩余心电信号
Figure PCTCN2020080880-appb-000098
切割得到的多个含噪剩余心电信号切片与无噪剩余心电信号
Figure PCTCN2020080880-appb-000099
切割得到的多个无噪剩余心电信号一一对应。
Synthetic ECG signal X q The noisy residual ECG signal obtained after removing the reference ECG signal
Figure PCTCN2020080880-appb-000091
The length of is far greater than the length of the input data required by the noise reduction autoencoder. At this point, the noisy residual ECG signal in the original sample can be
Figure PCTCN2020080880-appb-000092
And noiseless residual ECG signal
Figure PCTCN2020080880-appb-000093
Carry out cutting, and cut the noisy residual ECG signal slices
Figure PCTCN2020080880-appb-000094
Meet the length of the input data required by the noise reduction autoencoder. Similarly, for the noiseless residual ECG signal
Figure PCTCN2020080880-appb-000095
Perform cutting to obtain noise-free residual ECG signal slices
Figure PCTCN2020080880-appb-000096
Among them, the synthesized ECG signal X q is obtained by superimposing the noise-free ECG signal Y q with the EMG noise signal, and the noise-free residual ECG signal
Figure PCTCN2020080880-appb-000097
It is the signal obtained by removing the reference ECG signal from the noise-free ECG signal Y q , and e is the noise-free residual ECG signal slice obtained from Q noise-free residual ECG signal slices. Index, e and E are positive integers, e≤E. It should be understood that noisy residual ECG signal
Figure PCTCN2020080880-appb-000098
Multiple slices of noisy residual ECG signal and noiseless residual ECG signal obtained by cutting
Figure PCTCN2020080880-appb-000099
The multiple noiseless residual ECG signals obtained by cutting correspond one to one.
此时,切割得到的一个含噪剩余心电信号切片
Figure PCTCN2020080880-appb-000100
和该含噪剩余心电信号切片
Figure PCTCN2020080880-appb-000101
对应的无噪剩余心电信号切片
Figure PCTCN2020080880-appb-000102
构成的样本称为训练样本。E个训练样本组成训练样本集,此时,训练样本集中一个训练样本可以表示为
Figure PCTCN2020080880-appb-000103
其中,e也称为训练样本集中训练样本的索引。此时,一个原始样本可以对应多个训练样本。多个训练样本构成训练样本集。该训练样本集用于训练降噪自编码器,得到目标降噪自编码器。
At this time, a slice of noisy residual ECG signal obtained by cutting
Figure PCTCN2020080880-appb-000100
And the noisy residual ECG signal slice
Figure PCTCN2020080880-appb-000101
Corresponding noise-free residual ECG signal slice
Figure PCTCN2020080880-appb-000102
The formed samples are called training samples. E training samples form the training sample set. At this time, one training sample in the training sample set can be expressed as
Figure PCTCN2020080880-appb-000103
Among them, e is also called the index of the training sample in the training sample set. At this time, one original sample can correspond to multiple training samples. Multiple training samples constitute a training sample set. The training sample set is used to train the noise reduction autoencoder to obtain the target noise reduction autoencoder.
需要说明的是,上述步骤S702-S706也可以由训练设备之前的其他设备执行,也可以由训练设备执行。It should be noted that the above steps S702-S706 may also be executed by other equipment before the training device, or may be executed by the training device.
训练设备可以生成多个训练样本,该多个训练样本可以划分为训练样本集和测试样本集,其中,训练设备可以使用训练样本集训练降噪自编码器,其中,含噪剩余心电信号为训练输入,含噪剩余心电信号对应的无噪剩余心电信号为训练标签,最终得到目标降噪自编码器。训练设备可以使用测试样本集对训练得到的目标降噪自编码器进行测试,以评价目标降噪自编码器的鲁棒性和泛化能力。本申请实施例以上述实现方式(1)描述的训练样本集为例来说明。应理解,步骤S708中训练样本还可以是上述实现方式(2)中的形式或其他形式,此处不再赘述。具体地,训练设备利用训练样本训练得到降噪自编码器的具体实现可以包括如下步骤:The training device can generate multiple training samples. The multiple training samples can be divided into a training sample set and a test sample set. The training device can use the training sample set to train the noise-reducing autoencoder, where the noisy residual ECG signal is Training input, the noise-free residual ECG signal corresponding to the noisy residual ECG signal is the training label, and finally the target noise reduction autoencoder is obtained. The training device can use the test sample set to test the trained target denoising autoencoder to evaluate the robustness and generalization ability of the target denoising autoencoder. The embodiment of the present application takes the training sample set described in the foregoing implementation (1) as an example for illustration. It should be understood that the training samples in step S708 may also be in the form in the foregoing implementation (2) or other forms, which will not be repeated here. Specifically, the specific implementation of the training device using the training samples to train the noise reduction autoencoder may include the following steps:
S708:将含噪剩余心电信号输入到降噪自编码器中,得到预测剩余心电信号。S708: Input the noisy residual ECG signal into the noise reduction autoencoder to obtain the predicted residual ECG signal.
其中,降噪自编码器的网络结构可以参见上述图2中的描述,本申请实施例不再赘述。For the network structure of the noise reduction autoencoder, refer to the description in FIG. 2 above, and details are not described in the embodiment of the present application.
此时,降噪自编码器为初始化的神经网络或者训练过程中更新得到的降噪自编码器。At this time, the denoising autoencoder is the initialized neural network or the denoising autoencoder updated during the training process.
本申请实施例以训练样本为
Figure PCTCN2020080880-appb-000104
为例来说明,即将含噪剩余心电信号
Figure PCTCN2020080880-appb-000105
输 入到降噪自编码器,通过降噪自编码器对该
Figure PCTCN2020080880-appb-000106
进行处理,得到预测剩余心电信号
Figure PCTCN2020080880-appb-000107
The embodiment of this application takes the training sample as
Figure PCTCN2020080880-appb-000104
As an example, the residual ECG signal with noise
Figure PCTCN2020080880-appb-000105
Input to the noise reduction autoencoder, and the noise reduction autoencoder
Figure PCTCN2020080880-appb-000106
Process to get predicted residual ECG signal
Figure PCTCN2020080880-appb-000107
S710:根据预测剩余心电信号和无噪剩余心电信号之间的误差更新降噪自编码器的参数,得到目标降噪自编码器。S710: Update the parameters of the noise reduction autoencoder according to the error between the predicted residual ECG signal and the noise-free residual ECG signal to obtain the target noise reduction autoencoder.
其中,在降噪自编码器一次训练过程中可以采用一个训练样本,也可以采用多个训练样本或者全部训练样本,本申请实施例不作限定。目标降噪自编码器为通过训练样本集训练好的降噪自编码器。Among them, one training sample may be used in one training process of the noise reduction autoencoder, or multiple training samples or all training samples may be used, which is not limited in the embodiment of the present application. The target denoising autoencoder is a denoising autoencoder trained through the training sample set.
本申请实施例以Q个训练样本为例来说明,其中,U为不大于Q的正整数,训练设备可以根据每一训练样本的预测剩余心电信号和无噪剩余心电信号的误差确定Q个训练样本对应的损失,根据Q训练样本对应的损失,通过优化算法更新降噪自编码器的参数,使得损失越来越小。优化算法可以是梯度下降法(gradient descent)、Adam算法或其他优化算法,本申请实施例不作限定。The embodiment of this application takes Q training samples as an example, where U is a positive integer not greater than Q, and the training device can determine Q according to the error between the predicted residual ECG signal and the noise-free residual ECG signal of each training sample For the loss corresponding to each training sample, according to the loss corresponding to the Q training sample, the parameters of the denoising autoencoder are updated through the optimization algorithm, so that the loss becomes smaller and smaller. The optimization algorithm may be gradient descent, Adam algorithm or other optimization algorithms, which are not limited in the embodiment of the present application.
本申请实施例中,损失函数用于计算Q个训练样本对应的损失,损失函数可以为预测剩余心电信号和无噪剩余心电信号的误差,其中,预测剩余心电信号和无噪剩余心电信号的误差可以是预测剩余心电信号和无噪剩余心电信号之间平均绝对误差(mean absolute error,MAE)、均方误差(mean squared error,MSE)或均方根误差(root mean squared error,RMSE)等,也可以是预测剩余心电信号和无噪剩余心电信号的交叉熵,还可以具有其他的形式,本申请不作限定。In the embodiment of the present application, the loss function is used to calculate the loss corresponding to Q training samples. The loss function can be the error between the predicted residual ECG signal and the noise-free residual ECG signal, where the predicted residual ECG signal and the noise-free residual ECG signal The error of the electrical signal can be the mean absolute error (MAE), mean squared error (MSE), or root mean squared error between the predicted residual ECG signal and the noise-free residual ECG signal. Error, RMSE), etc., can also be used to predict the cross entropy of the residual ECG signal and the noise-free residual ECG signal, and can also have other forms, which are not limited in this application.
例如,本申请实施例中可以通过预测剩余心电信号和无噪剩余心电信号之间平均绝对误差来表示损失函数L,则:For example, in the embodiment of the present application, the loss function L can be expressed by predicting the average absolute error between the residual ECG signal and the noise-free residual ECG signal, then:
Figure PCTCN2020080880-appb-000108
Figure PCTCN2020080880-appb-000108
上述方法,不直接采用合成心电信号进行降噪自编码器的训练,而是,先从合成心电信号中移除包括R峰位置等明显特征的基准心电信号,该基准心电信号保留了合成心电信号的明显特征,例如R峰位置、R峰的平均幅值等,避免心电信号的失真;将合成心电信号移除该基准心电信号后得到的含噪剩余心电信号作为降噪自编码器的输入,与现有技术中将整个心电信号作为自编码器的输入相比,本申请实施例中降噪自编码器只需要提取心电信号细节信息的编码表示,而不需要获取整个心电信号的编码表示,降低降噪自编码器的训练的难度,进而,使得训练得到的目标降噪自编码器可以更好地提取到含噪剩余心电信号中的细节特征,从而提高得到的目标降噪自编码器的降噪性能。The above method does not directly use the synthetic ECG signal for the training of the noise reduction autoencoder, but first removes the reference ECG signal including the R peak position and other obvious features from the synthetic ECG signal, and the reference ECG signal remains The obvious characteristics of the synthesized ECG signal, such as the R peak position, the average amplitude of the R peak, etc., are used to avoid the distortion of the ECG signal; the noisy residual ECG signal obtained after the synthetic ECG signal is removed from the reference ECG signal As the input of the noise reduction autoencoder, compared with the prior art where the entire ECG signal is used as the input of the autoencoder, the noise reduction autoencoder in the embodiment of the present application only needs to extract the encoding representation of the detailed information of the ECG signal. There is no need to obtain the encoding representation of the entire ECG signal, which reduces the difficulty of training the denoising autoencoder, and in turn, enables the trained target denoising autoencoder to better extract the details of the noisy residual ECG signal Feature, thereby improving the noise reduction performance of the obtained target noise reduction autoencoder.
实施例二:Embodiment two:
图7D为本发明实施例二提供的另一种降噪自编码器的训练方法的流程示意图。该方法具体可以由如图3所示的训练设备120执行。可选地,该方法中步骤S712-S716也可以由训练设备120之前由其他功能模块预先执行,即先对从所述数据库130中接收或者获取到的原始样本的数据进行预处理,得到训练样本,进而通过训练样本由训练设备执行S718、S720从而训练得到降噪自编码器。可选的,该方法可以由CPU处理,也可以由CPU和适合用于神经网络计算的处理器(如图6所示的神经网络处理器30)共同处理如图6所示的 神经网络处理器30,本申请不做限制。该方法可以包括如下部分或全部步骤:FIG. 7D is a schematic flowchart of another method for training a noise reduction autoencoder according to Embodiment 2 of the present invention. The method can be specifically executed by the training device 120 shown in FIG. 3. Optionally, steps S712-S716 in the method may also be pre-executed by other functional modules before the training device 120, that is, the data of the original samples received or obtained from the database 130 is preprocessed to obtain training samples Then, the training device executes S718 and S720 through the training samples to train the noise reduction autoencoder. Optionally, the method may be processed by the CPU, or may be processed by the CPU and a processor suitable for neural network calculations (the neural network processor 30 shown in FIG. 6) together to process the neural network processor shown in FIG. 6 30. This application is not restricted. The method may include some or all of the following steps:
S712:将无噪心电信号与肌电噪声信号叠加,得到合成心电信号,其中,无噪心电信号中肌电噪声的信噪比(signal-to-noise ratio,SNR)不小于第一阈值,无噪心电信号可以包括多拍心电信号H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的整数。S712: Superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal, where the signal-to-noise ratio (SNR) of the noise-free ECG signal is not less than the first Threshold, the noise-free ECG signal may include a multi-beat ECG signal H-beat ECG signal, each beat ECG signal contains a QRS complex, and H is an integer greater than 1.
S714:利用平均节拍减法将无噪心电信号分解为基准心电信号和无噪剩余心电信号。S714: Decompose the noise-free ECG signal into a reference ECG signal and a noise-free residual ECG signal by using an average beat subtraction method.
S714的具体实现方法同可以参见上述S704中利用平均节拍减法将无噪心电信号分解为基准心电信号和无噪剩余心电信号中相关描述。同理,S714的第一种实现具体:For the specific implementation method of S714, please refer to the related description in S704 using average beat subtraction to decompose the noise-free ECG signal into the reference ECG signal and the noise-free residual ECG signal. Similarly, the first implementation of S714 is specific:
S714的第一种实现具体可以包括如下步骤:The first implementation of S714 may specifically include the following steps:
S7141:对目标心电信号中的W拍心电信号进行平均处理,得到的第二平均心电信号,其中,目标心电信号可以是合成心电信号、无噪心电信号或从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等,W≤H,W为正整数。S7141: Perform average processing on the W beat ECG signal in the target ECG signal to obtain a second average ECG signal, where the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal or from the first user (That is, users who have been collected to obtain a noise-free ECG signal) historically collected ECG signals, etc., W≤H, W is a positive integer.
S7142:将第二平均心电信号替换无噪心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为W拍心电信号中QRS波群的顶点,j=1,2……H。 S7142: Replace the second average ECG signal with A j corresponding to the H-beat ECG signal in the noise-free ECG signal to obtain the reference ECG signal. A j represents the H-beat ECG signal with Δt as the center of R j. For the ECG signal in the interval, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H.
S7143:从无噪心电信号中移除基准心电信号,得到无噪剩余心电信号。S7143: Remove the reference ECG signal from the noise-free ECG signal to obtain the noise-free residual ECG signal.
应理解,上述S714的第一种实现同实施例一种S704的第一种实现方法一致,具体可参见上述实施例一种相关描述,本申请实施例不再赘述。It should be understood that the first implementation of S714 is the same as the first implementation of S704 in the embodiment. For details, please refer to a related description of the foregoing embodiment, which will not be repeated in this embodiment.
S714的第二种实现具体可以包括但不限于如下步骤:The second implementation of S714 may specifically include but is not limited to the following steps:
S7144:训练设备可以检测目标心电信号中的W拍心电信号中每一拍心电信号的R峰(即R波的顶点),该R峰即为一拍心电信号中能量值最大的采样点。S7144: The training device can detect the R peak of each beat of the ECG signal in the W beat ECG signal in the target ECG signal (that is, the apex of the R wave), and the R peak is the maximum energy value in the beat of the ECG signal Sampling point.
S7145:对目标心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,第二平均心电信号的R峰左侧包括Δt1的心电信号,右侧包括Δt2的心电信号,该目标心电信号可以是合成心电信号、无噪心电信号、或者从第一用户(也即被采集得到无噪心电信号的用户)上历史采集的心电信号等,W≤H,W为正整数。S7145: Perform average processing on the W beat ECG signal in the target ECG signal to obtain the second average ECG signal. The R peak of the second average ECG signal includes the ECG signal of Δt1 on the left side and the ECG signal of Δt2 on the right side. Signal, the target ECG signal can be a synthetic ECG signal, a noiseless ECG signal, or a historically collected ECG signal from the first user (that is, the user who has been collected to obtain the noiseless ECG signal), etc., W≤ H and W are positive integers.
S7146:将第二平均心电信号替换无噪心电信号中H拍心电信号对应的A j,得到基准心电信号,A j表示H拍心电信号中以R j为基准左取Δt1右取Δt2得到的区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H。 S7146: Replace the second average ECG signal with A j corresponding to the H-beat ECG signal in the noise-free ECG signal to obtain the reference ECG signal. A j means that the H-beat ECG signal takes R j as the reference left and Δt1 right Take the ECG signal in the interval obtained by Δt2, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H.
S7147:从无噪心电信号中移除基准心电信号,得到无噪剩余心电信号。S7147: Remove the reference ECG signal from the noise-free ECG signal to obtain the noise-free residual ECG signal.
应理解,上述S714的第二种实现同实施例一种S704的第二种实现方法一致,具体可参见上述实施例一种相关描述,本申请实施例不再赘述。It should be understood that the second implementation of S714 is the same as the second implementation of S704 in the embodiment. For details, please refer to a related description of the foregoing embodiment, which will not be repeated in this embodiment.
S716:从合成心电信号中移除基准心电信号,得到含噪剩余心电信号。S716: Remove the reference ECG signal from the synthesized ECG signal to obtain a noisy residual ECG signal.
应理解,合成心电信号、无噪心电信号、基准心电信号、含噪剩余心电信号、无噪剩余心电信号都包括相同个数的采样点。从合成心电信号中移除基准心电信号,即为,合成心电信号中采样点的值与基准心电信号中采样点的值对应相减,也就是说,含噪剩余心电信号中第x个采样点的值等于合成心电信号中第x个采样点的值与基准心电信号中第x个采样点的值之差。It should be understood that the synthesized ECG signal, the noise-free ECG signal, the reference ECG signal, the noise-containing residual ECG signal, and the noise-free residual ECG signal all include the same number of sampling points. Remove the reference ECG signal from the synthetic ECG signal, that is, the value of the sample point in the synthetic ECG signal is subtracted from the value of the sample point in the reference ECG signal, that is, the residual ECG signal with noise The value of the xth sampling point is equal to the difference between the value of the xth sampling point in the synthetic ECG signal and the value of the xth sampling point in the reference ECG signal.
S718:将含噪剩余心电信号输入到降噪自编码器中,得到预测剩余心电信号。S718: Input the noisy residual ECG signal into the noise reduction autoencoder to obtain the predicted residual ECG signal.
S720:根据预测剩余心电信号和无噪剩余心电信号之间的误差更新降噪自编码器的参 数,得到目标降噪自编码器。S720: Update the parameters of the noise reduction autoencoder according to the error between the predicted residual ECG signal and the noise-free residual ECG signal to obtain the target noise reduction autoencoder.
需要说明的是,上述S718可以参见实施例一中S708的相关描述,上述S720可以参见实施例一中S710的相关描述,此处不再赘述。It should be noted that the foregoing S718 may refer to the related description of S708 in Embodiment 1, and the foregoing S720 may refer to the related description of S710 in Embodiment 1, which will not be repeated here.
实施例三:Example three:
如图8A为本发明实施例二提供的一种心电信号降噪方法的流程示意图,图8B为本发明实施例二提供的一种心电信号降噪方法的示意性说明图,该方法通过实施例一训练得到的目标降噪自编码器实现对待降噪心电信号的降噪。该方法具体可以由如图3所示的执行设备110执行,该方法中的待降噪心电信号可以是如图3所示的用户设备140给出的输入数据,所述执行设备110中的预处理模块113可以用来执行所述方法800中S802-S804所述执行设备110中的信号叠加模块114以用来执行所述方法800中的S808,所述执行设备110中的计算模块111可以用于执行所述S806。可选的,所述方法800可以由CPU处理,也可以由CPU和适合用于神经网络计算的处理器(例如,图6所示的神经网络处理器30),本申请不做限制。FIG. 8A is a schematic flowchart of an ECG signal noise reduction method according to Embodiment 2 of the present invention, and FIG. 8B is a schematic explanatory diagram of an ECG signal noise reduction method according to Embodiment 2 of the present invention. The target noise reduction autoencoder obtained by training in the first embodiment realizes the noise reduction of the ECG signal to be denoised. The method may be specifically executed by the execution device 110 shown in FIG. 3, and the ECG signal to be denoised in the method may be the input data given by the user device 140 shown in FIG. The preprocessing module 113 can be used to execute the signal superimposing module 114 in the execution device 110 in S802-S804 of the method 800 to execute S808 in the method 800, and the calculation module 111 in the execution device 110 can Used to execute the S806. Optionally, the method 800 may be processed by a CPU, or a CPU and a processor suitable for neural network calculation (for example, the neural network processor 30 shown in FIG. 6), which is not limited in this application.
该心电信号降噪方法800可以包括但不限于如下部分或全部流程:The ECG signal noise reduction method 800 may include but is not limited to some or all of the following processes:
S802:获取待降噪心电信号。S802: Obtain the ECG signal to be noise-reduced.
其中,用户设备可以向执行设备发送待降噪心电信号,请求执行设备对待降噪心电信号进行降噪。执行设备也可以通过心电设备实时采集用户的心电信号,该实时采集到的预设长度的心电信号即为待降噪心电信号。其中,预设长度即为降噪自编码器的对输入数据要求的长度。The user equipment may send the ECG signal to be noise-reduced to the execution device, requesting the execution device to reduce the noise of the ECG signal to be noise-reduced. The execution device may also collect the user's ECG signal in real time through the ECG device, and the ECG signal of the preset length collected in real time is the ECG signal to be noise-reduced. Among them, the preset length is the length required by the noise reduction autoencoder for input data.
可选地,在S804之前,可以对待降噪心电信号进行预处理,该预处理可以包括但不限于小波变换等操作,此时下述步骤中待降噪心电信号为经过预处理后的待降噪心电信号。执行设备可以对待降噪心电信号进行小波变换,以去除待降噪心电信号中心电信号频带外的噪声,以减轻后期降噪过程的难度,小波变换的具体实现为现有技术,此处不再赘述。Optionally, before S804, the ECG signal to be denoised can be preprocessed. The preprocessing can include but is not limited to operations such as wavelet transform. At this time, the ECG signal to be denoised in the following steps is the preprocessed ECG signal. Noise reduction ECG signal. The execution device can perform wavelet transform on the ECG signal to be denoised to remove the noise outside the frequency band of the central electrical signal of the ECG signal to be denoised, so as to reduce the difficulty of the later noise reduction process. The specific implementation of wavelet transform is the existing technology, here No longer.
在一种可能的实现中,执行设备可以是配置了心电传感器的可穿戴设备或终端,如智能手环、智能手表等,此时,S802的一种具体实现可以是:执行设备通过心电传感器采集用户皮肤表面的模拟心电信号;进而,通过数模转换模块对该模拟心电信号进行处理,得到数字化的待降噪心电信号。In a possible implementation, the execution device may be a wearable device or terminal equipped with an ECG sensor, such as a smart bracelet, smart watch, etc. At this time, a specific implementation of S802 may be: The sensor collects the analog ECG signal on the surface of the user's skin; further, the analog ECG signal is processed through the digital-to-analog conversion module to obtain a digital ECG signal to be denoised.
在另一种可能的实现中,执行设备可以是服务器或终端等,此时,S802的一种具体实现可以是:执行设备接收心电采集设备发送的待降噪心电信号。其中,心电采集设备可以是配置了心电传感器的可穿戴设备或终端等。In another possible implementation, the execution device may be a server or a terminal, etc. In this case, a specific implementation of S802 may be: the execution device receives the ECG signal to be noise-reduced sent by the ECG acquisition device. Among them, the ECG acquisition device may be a wearable device or a terminal equipped with an ECG sensor.
例如,可穿戴设备,比如智能手表采集佩戴者的心电信号,该心电信号即为待降噪心电信号,智能手表可以通过蓝牙等方式向其绑定的终端(比如手机)发送该待降噪心电信号,手机接收到该待降噪心电信号。手机在接收到待降噪心电信号后可以对该待降噪心电信号进行降噪处理;也可以将待降噪心电信号发送给服务器,由服务器来实现对该待降噪心电信号进行降噪处理。For example, a wearable device, such as a smart watch, collects the ECG signal of the wearer, and the ECG signal is the ECG signal to be noise-reduced. The smart watch can send the signal to the terminal (such as a mobile phone) bound to it through Bluetooth. Noise reduction ECG signal, the mobile phone receives the ECG signal to be noise reduction. After the mobile phone receives the ECG signal to be noise-reduced, it can perform noise reduction processing on the ECG signal to be noise-reduced; it can also send the ECG signal to be noise-reduced to the server, and the server implements the ECG signal to be noise-reduced Perform noise reduction processing.
S804:利用平均节拍减法将待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号。S804: Decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised by using the average beat subtraction method.
同实施例一中S704的第一种实现方式类似,S804的第一种实现具体可以包括如下步骤:Similar to the first implementation of S704 in Embodiment 1, the first implementation of S804 may specifically include the following steps:
S8041:对待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,N小于M,N为正整数。S8041: Perform averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer.
S8042:将第一平均心电信号替换待降噪心电信号中M拍心电信号对应的B j,得到待降噪基准心电信号,B j表示所述M拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述M拍心电信号中QRS波群的顶点,j=1,2……M。 S8042: Substituting the first average ECG signal for the B j corresponding to the M-beat ECG signal in the ECG signal to be noise-reduced to obtain the reference ECG signal to be noise-reduced, and B j represents that R j is used in the M-beat ECG signal Is the ECG signal in the Δt interval of the center, R j is the apex of the QRS complex in the M-beat ECG signal, j=1, 2...M.
S8043:从待降噪心电信号中移除待降噪基准心电信号,得到待降噪剩余心电信号。S8043: Remove the reference ECG signal to be denoised from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
应理解,S8041中生成第一平均心电信号所采用的N拍心电信号可以是待降噪心电信号中连续的N拍心电信号,也可以是不连续或部分节拍连续的N拍心电信号。在执行设备对该N拍心电信号进行信号平均之前,需要将该N拍心电信号进行对齐,进而,将对齐后的多拍心电信号进行叠加、平均,具体实现同上述S704描述的第二平均心电信号的具体实现原理相似,可以参见上述实现1和实现2中相关描述,此处不再赘述。It should be understood that the N-beat ECG signal used to generate the first average ECG signal in S8041 may be a continuous N-beat ECG signal in the ECG signal to be denoised, or it may be a discontinuous or partially continuous N-beat ECG signal. electric signal. Before the execution device performs signal averaging on the N-beat ECG signal, the N-beat ECG signal needs to be aligned, and then the aligned multi-beat ECG signal is superimposed and averaged, and the specific implementation is the same as that described in S704 above. The specific implementation principles of the two average electrocardiogram signals are similar, and can refer to the related descriptions in the foregoing implementation 1 and implementation 2, which will not be repeated here.
对应于上述实施例一S704的第一种实现,在S804的第一种实现中,第一平均心电信号的实现方式1可以是:Corresponding to the first implementation of S704 in the first embodiment above, in the first implementation of S804, implementation 1 of the first average ECG signal may be:
第二平均心电信号
Figure PCTCN2020080880-appb-000109
是通过对目标心电信号中W拍心电信号进行平均处理得到的。即:
Second average ECG signal
Figure PCTCN2020080880-appb-000109
It is obtained by averaging the W beat ECG signal in the target ECG signal. which is:
Figure PCTCN2020080880-appb-000110
Figure PCTCN2020080880-appb-000110
其中,
Figure PCTCN2020080880-appb-000111
表示第一平均心电信号,B i表示N拍心电信号中以R i为中心左右各取Δt区间内的心电信号,R i为所述N拍心电信号中QRS波群的顶点,i=1,2……N。
among them,
Figure PCTCN2020080880-appb-000111
Represents a first average ECG, B i represents N ECG beat to about the center R i in the ECG signal from each interval Δt, R i shot vertex ECG QRS complex to the N, i=1, 2……N.
进一步地,第一平均心电信号、Δt区间内的心电信号可以包括V个采样点,V为大于1的正整数,信号平均可以通过公式:Further, the first average ECG signal and the ECG signal in the Δt interval may include V sampling points, where V is a positive integer greater than 1, and the signal average may be obtained by the formula:
Figure PCTCN2020080880-appb-000112
Figure PCTCN2020080880-appb-000112
其中,
Figure PCTCN2020080880-appb-000113
为第一平均心电信号
Figure PCTCN2020080880-appb-000114
中第v个采样点的值,B i(v)为N拍心电信号中以R i为中心左右各取Δt区间内的心电信号中的第v个采样点的值,1≤v≤V,1≤i≤N,v,i为正整数。
among them,
Figure PCTCN2020080880-appb-000113
Is the first average ECG signal
Figure PCTCN2020080880-appb-000114
In the v-th sampling point values, B i (v) about the center from each Sign v-th sampling point in the ECG interval Δt to ECG R i is a value for N, 1≤v≤ V,1≤i≤N, v,i are positive integers.
可见,针对不同的待降噪心电信号,通过实现方式4得到的第一平均心电信号不同,进而通过实现方式1中第一平均心电信号得到的基准心电信号也不同。本实现方式4针对不同的待降噪心电信号自适应地选择基准心电信号,得到的基准心电信号可以更准确地提取出了待降噪心电信号的明显特征,进而降噪后的心电信号可以更好地保留待降噪心电信号中的明显特征,减少降噪后的心电信号的失真,提高降噪后的心电信号的质量。It can be seen that for different ECG signals to be noise-reduced, the first average ECG signals obtained through implementation 4 are different, and the reference ECG signals obtained through the first average ECG signal in implementation 1 are also different. This implementation manner 4 adaptively selects the reference ECG signal for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, and then the denoised ECG signal The ECG signal can better retain the obvious features of the ECG signal to be noise-reduced, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
可见,针对不同的待降噪心电信号,得到的第一平均心电信号不同,进而通过该第一平均心电信号得到的基准心电信号也不同。在本申请实施例中,针对不同的待降噪心电信号自适应地选择基准心电信号,得到的基准心电信号可以更准确地提取出了待降噪心电信号的明显特征,进而降噪后的心电信号可以更好地保留待降噪心电信号中的明显特征,减少降噪后的心电信号的失真,提高降噪后的心电信号的质量。It can be seen that for different ECG signals to be denoised, the obtained first average ECG signals are different, and the reference ECG signals obtained from the first average ECG signals are also different. In the embodiment of the present application, the reference ECG signal is adaptively selected for different ECG signals to be denoised, and the obtained reference ECG signal can more accurately extract the obvious features of the ECG signal to be denoised, thereby reducing The noisy ECG signal can better retain the obvious features of the ECG signal to be denoised, reduce the distortion of the ECG signal after noise reduction, and improve the quality of the ECG signal after noise reduction.
第一平均心电信号的实现方式2可以是: Implementation mode 2 of the first average ECG signal may be:
第一平均心电信号
Figure PCTCN2020080880-appb-000115
是通过对第二用户(被采集得到待降噪心电信号的用户)上历史采集的心电信号中N拍心电信号进行平均处理得到的。具体计算方法同可以上述第一平均心电信号的实现方式1,可参见上述实现方式1中相关描述,此处不再赘述。
First average ECG signal
Figure PCTCN2020080880-appb-000115
It is obtained by averaging the N-beat ECG signals from the historically collected ECG signals of the second user (the user whose ECG signals to be denoised is collected). The specific calculation method is the same as that of the above-mentioned first average electrocardiogram signal implementation manner 1, please refer to the related description in the above-mentioned implementation manner 1, which will not be repeated here.
此时,针对同一用户的心电信号,采用同一第一平均心电信号。该实现方式5得到第一平均心电信号生成的待降噪基准心电信号考虑到个人的差异,使得待降噪基准心电信号可以更准确地表示待降噪心电信号的明显特征,相对于第一平均心电信号的实现方式4来说,对于同一用户得到的待降噪基准心电信号,仅需要进行一次计算,提高计算效率。At this time, for the ECG signals of the same user, the same first average ECG signal is used. The implementation manner 5 obtains the reference ECG signal to be denoised generated by the first average ECG signal, taking into account individual differences, so that the reference ECG signal to be denoised can more accurately represent the obvious characteristics of the ECG signal to be denoised, relatively For the implementation of the first average ECG signal 4, for the reference ECG signal to be noise-reduced obtained by the same user, only one calculation is required, which improves the calculation efficiency.
S804的第二种实现具体可以包括但不限于如下步骤:The second implementation of S804 may specifically include but not limited to the following steps:
S8044:检测待降噪心电信号中的N拍心电信号中每一拍心电信号的R峰(即R波的顶点),该R峰即为一拍心电信号中能量值最大的采样点。S8044: Detect the R peak of each beat of the ECG signal in the N-beat ECG signal in the ECG signal to be noise-reduced (that is, the apex of the R wave), and the R peak is the sample with the largest energy value in one beat of the ECG signal point.
S8045:对待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,第一平均心电信号的R峰左侧包括Δt3的心电信号,右侧包括Δt4的心电信号,N≤M,N为正整数。S8045: Perform averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal. The R peak of the first average ECG signal includes the ECG signal of Δt3 on the left side and the heart signal of Δt4 on the right side. Electric signal, N≤M, N is a positive integer.
S8046:将第一平均心电信号替换待降噪心电信号中M拍心电信号对应的B j,得到待降噪基准心电信号,B j表示M拍心电信号中以R j为基准左取Δt3右取Δt4得到的区间内的心电信号,R j为N拍心电信号中QRS波群的顶点,j=1,2……M。 S8046: Substituting the first average ECG signal for the B j corresponding to the M-beat ECG signal in the ECG signal to be noise-reduced, to obtain the reference ECG signal to be noise-reduced, B j represents the M-beat ECG signal based on R j Take the ECG signal in the interval obtained by taking Δt3 on the left and taking Δt4 on the right. R j is the apex of the QRS complex in the N-beat ECG signal, j = 1, 2...M.
S8047:从待降噪心电信号中移除待降噪基准心电信号,得到含噪剩余心电信号。S8047: Remove the reference ECG signal to be noise-reduced from the ECG signal to be noise-reduced to obtain the noise-containing residual ECG signal.
S8045的一种具体实现可以是针对N拍心电信号中的每一拍心电信号,选取以R峰为基准左取Δt3右取Δt4得到的区间内的心电信号,得到N个心电信号片段。进而,对该N个心电信号片段进行平均处理,得到第一平均心电信号。其中,每一个心电信号片段包括一个QRS波群,且所有心电信号片段中R峰位置相对于其所在心电信号片段的起点位置的距离相同,即N个心电信号片段在R峰同一侧的采样点个数都相同,以保证N个心电信号片段对齐。A specific implementation of S8045 can be to select the ECG signal in the interval obtained by taking the R peak as the reference to the left and right taking Δt4 for each beat of the N-beat ECG signal to obtain N ECG signals Fragment. Furthermore, the N ECG signal segments are averaged to obtain the first average ECG signal. Among them, each ECG signal segment includes a QRS complex, and the R peak position of all ECG signal segments has the same distance from the starting position of the ECG signal segment where it is located, that is, N ECG signal segments have the same R peak The number of sampling points on both sides are the same to ensure alignment of N ECG signal segments.
在本申请实施例的一种实现中,上述实施例一中Δt1可以等于Δt3,上述实施例一中Δt2可以等于Δt4。在本申请实施例的一种实现中,上述实施例一中Δt1可以不等于Δt3,上述实施例一中Δt2也可以不等于Δt4,对此不作限定。In an implementation of the embodiment of the present application, Δt1 may be equal to Δt3 in the first embodiment, and Δt2 may be equal to Δt4 in the first embodiment. In an implementation of the embodiment of the present application, Δt1 in the first embodiment may not be equal to Δt3, and Δt2 in the first embodiment may not be equal to Δt4, which is not limited.
上述S8045的具体实现可参见上述实施例一中S7045的具体实现,此处不再赘述。For the specific implementation of the foregoing S8045, refer to the specific implementation of S7045 in the foregoing embodiment 1, which will not be repeated here.
S8042或S8046中形成待降噪基准心电信号的具体方法如下:The specific method for forming the reference ECG signal to be noise-reduced in S8042 or S8046 is as follows:
应理解,通过平均节拍减法得到的基准心电信号的R峰位置与合成心电信号的R峰位置相同。此时基准心电信号具有与合成心电信号相同的R峰位置、R-R间隔等特征。It should be understood that the R peak position of the reference ECG signal obtained by the average beat subtraction is the same as the R peak position of the synthesized ECG signal. At this time, the reference ECG signal has the same R peak position and R-R interval as the synthetic ECG signal.
本申请实施例以S8046的一种具体实现为例来说明,应理解,上述第一种实现为第二种实现的一个特例,S8042的具体实现可以参照S8046的实现,此处不再赘述。The embodiment of the present application takes a specific implementation of S8046 as an example for illustration. It should be understood that the above-mentioned first implementation is a special case of the second implementation. For the specific implementation of S8042, refer to the implementation of S8046, which will not be repeated here.
同上述实施例一中计算基准心电信号的原理相同,请一并参阅图8C所示的计算待降噪基准心电信号的原理示意图,S8046的一种具体的实现方式可以包括但不限于如下步骤:The principle of calculating the reference ECG signal is the same as in the first embodiment above. Please also refer to the schematic diagram of the principle of calculating the reference ECG signal to be denoised shown in Figure 8C. A specific implementation of S8046 may include but is not limited to the following step:
S80461:检测待降噪心电信号中的R峰位置和第一平均心电信号的R峰位置。S80461: Detect the R peak position of the ECG signal to be noise-reduced and the R peak position of the first average ECG signal.
应理解,心电信号中R峰检测为现有技术,此处不再赘述。It should be understood that the R peak detection in the ECG signal is a prior art, and will not be repeated here.
S80462:根据第一平均心电信号、待降噪心电信号中的R峰位置和第一平均心电信号的R峰位置,得到M个信号片段,M个信号片段具有与第一平均心电信号相同的波形,且 M个信号片段中的第h个信号片段的R峰位置等于待降噪心电信号中的第h个R峰位置,h为正整数,h不大于待降噪心电信号中R峰的总个数。图8C以M=3为例来说明。S80462: Obtain M signal segments according to the first average ECG signal, the R peak position in the ECG signal to be noise-reduced, and the R peak position of the first average ECG signal, and the M signal segments have the same value as the first average ECG signal. The signal has the same waveform, and the R peak position of the h-th signal segment in the M signal segments is equal to the h-th R peak position in the ECG signal to be denoised, h is a positive integer, and h is not greater than the ECG to be denoised The total number of R peaks in the signal. Fig. 8C takes M=3 as an example for illustration.
具体的,以R峰位置为基准,将第一平均心电信号分别与待降噪心电信号中的每一拍心电信号对齐,与待降噪心电信号中R峰位置对齐的第一平均心电信号称为信号片段,应理解,相对于第一平均心电信号,信号片段中每一个采样点的位置整体移动,但其波形不变。Specifically, based on the R peak position, the first average ECG signal is aligned with each beat of the ECG signal to be denoised, and the first average ECG signal is aligned with the R peak position in the ECG signal to be denoised. The average ECG signal is called a signal segment. It should be understood that, relative to the first average ECG signal, the position of each sampling point in the signal segment moves as a whole, but its waveform remains unchanged.
还应理解,待降噪心电信号中任意相邻两个R峰之间的间隔(即R-R间隔)可能不同,第一平均心电信号的长度可能大于一个R-R间隔的长度,也可能小于一个R-R间隔的长度。此时,相邻的两个信号片段可能发生部分重叠,也可能具有一定的间距。It should also be understood that the interval between any two adjacent R peaks in the ECG signal to be noise-reduced (ie, the RR interval) may be different, and the length of the first average ECG signal may be greater than the length of one RR interval, or may be less than one RR interval. The length of the interval. At this time, two adjacent signal segments may partially overlap or have a certain distance.
S80463:根据M个信号片段生成待降噪基准心电信号,其中,待降噪基准心电信号在第一位置的采样点的值为第一信号片段在第一位置上采样点的值和第二信号片段在第一位置上采样点的值的平均,第一位置为M个信号片段中存在多个采样点的位置,第一信号片段和第二信号片段为M个信号片段中在第一位置上有采样点的两个信号片段;待降噪基准心电信号在第二位置上的采样点的值是根据M个信号片段中与第二位置最相邻的两个采样点的值插值得到,第一位置为M个信号片段上包括重叠的位置,第二位置为M个信号片段之间的位置。S80463: Generate a reference ECG signal to be denoised according to the M signal segments, where the value of the sampling point of the reference ECG signal to be denoised at the first position is the value of the sampling point of the first signal segment at the first position and the The average value of the sampling points of the two signal segments at the first position. The first position is the position where there are multiple sampling points in the M signal segments. The first signal segment and the second signal segment are the M signal segments in the first position. Two signal segments with sampling points at the position; the value of the sampling point of the reference ECG signal to be denoised at the second position is interpolated based on the value of the two most adjacent sampling points in the M signal segments It is obtained that the first position is the position including the overlap on the M signal segments, and the second position is the position between the M signal segments.
其中,插值算法为现有技术,此处不再赘述。Among them, the interpolation algorithm is an existing technology, and will not be repeated here.
应理解,在S80463的另一种实现中,待降噪基准心电信号在第一位置上的采样点的值可以是第一信号片段在第一位置上的采样点的值或第二信号片段在第一位置上的采样点的值。待降噪基准心电信号在第二位置上的采样点的值也可以置0,此处不作限定。It should be understood that in another implementation of S80463, the value of the sampling point of the reference ECG signal to be denoised at the first position may be the value of the sampling point of the first signal segment at the first position or the second signal segment The value of the sampling point at the first position. The value of the sampling point of the reference ECG signal to be denoised at the second position can also be set to 0, which is not limited here.
应理解,训练得到目标降噪自编码器所采用的待降噪基准心电信号的生成方式可以与待降噪基准心电信号的生成方式一致。It should be understood that the method of generating the reference ECG signal to be denoised used by the trained target denoising autoencoder may be consistent with the method of generating the reference ECG signal to be denoised.
S8043或S8047的一种具体实现可以是:A specific implementation of S8043 or S8047 can be:
应理解,待降噪心电信号、待降噪基准心电信号、待降噪剩余心电信号都包括相同个数的采样点。从待降噪心电信号中移除待降噪基准心电信号,即为,待降噪心电信号中采样点的值与待降噪基准心电信号中采样点的值对应相减,也就是说,待降噪剩余心电信号中第y个采样点的值等于待降噪心电信号中第y个采样点的值与待降噪基准心电信号中第y个采样点的值之差。其中,y为采样点的索引,y为正整数,y不大于合成心电信号中采样点的总个数。It should be understood that the ECG signal to be denoised, the reference ECG signal to be denoised, and the remaining ECG signal to be denoised all include the same number of sampling points. The reference ECG signal to be denoised is removed from the ECG signal to be denoised, that is, the value of the sample point in the ECG signal to be denoised is subtracted from the value of the sample point in the reference ECG signal to be denoised. That is, the value of the yth sampling point in the remaining ECG signal to be denoised is equal to the value of the yth sampling point in the ECG signal to be denoised and the value of the yth sampling point in the reference ECG signal to be denoised difference. Among them, y is the index of the sampling point, y is a positive integer, and y is not greater than the total number of sampling points in the synthesized ECG signal.
可选地,在得到待降噪剩余心电信号之后,可以对该待降噪剩余心电信号进行归一化操作。是否需要进行归一化操作与目标降噪自编码器对输入数据的要求决定。在目标降噪自编码器的训练样本中含噪剩余心电信号为经过归一化后的数据时,则在将待降噪剩余心电信号输入到目标降噪自编码器之前,需要对该待降噪剩余心电信号进行归一化操作;否则,不需要对该待降噪剩余心电信号进行归一化操作,本申请实施例不再赘述。Optionally, after obtaining the remaining ECG signal to be denoised, a normalization operation may be performed on the remaining ECG signal to be denoised. Whether the normalization operation is required and the target noise reduction autoencoder's requirements for input data are determined. When the noisy residual ECG signal in the training sample of the target noise reduction autoencoder is normalized data, the residual ECG signal to be denoised is input to the target noise reduction autoencoder. The normalization operation is performed on the remaining ECG signal to be denoised; otherwise, the normalization operation is not required to be performed on the remaining ECG signal to be denoised, which will not be repeated in this embodiment of the application.
S806:将待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号。S806: Input the residual ECG signal to be noise-reduced into the target noise-reduction autoencoder to obtain the residual ECG signal after noise reduction.
其中,目标降噪自编码器是通过上述实施例一或实施例二所述的降噪自编码器的训练方法训练得到的目标降噪自编码器,具备对剩余心电信号进行降噪处理功能,具体可参见上述实施例一或实施例二中相关描述,此处不再赘述。Among them, the target denoising autoencoder is a target denoising autoencoder trained by the training method of the denoising autoencoder described in the first embodiment or the second embodiment, and has the function of denoising the residual ECG signal For details, please refer to the related description in the above-mentioned Embodiment 1 or Embodiment 2, which will not be repeated here.
S808:将待降噪基准心电信号和降噪后的剩余心电信号叠加,得到降噪后的心电信号,该降噪后的心电信号即为待降噪心电信号经过降噪处理后的心电信号。S808: Superimpose the reference ECG signal to be noise-reduced and the remaining ECG signal after noise reduction to obtain the ECG signal after noise reduction. The ECG signal after noise reduction is the ECG signal to be noise-reduced after noise reduction processing After the ECG signal.
具体的,将待降噪基准心电信号和降噪后的剩余心电信号叠加得到的心电信号,即将基准心电信号中采样点的值与降噪后的剩余心电信号中采样点的值对应相加,也即,降噪后的心电信号中的第z个采样点的值等于待降噪基准心电信号中的第z个采样点的值与降噪后的剩余心电信号中的第z个采样点的值,z为采样点的索引,z不大于待降噪心电信号中采样点的总个数。Specifically, the ECG signal obtained by superimposing the reference ECG signal to be noise-reduced and the residual ECG signal after noise reduction, that is, the value of the sampling point in the reference ECG signal and the value of the sampling point in the residual ECG signal after noise reduction The value corresponds to the addition, that is, the value of the zth sample point in the denoised ECG signal is equal to the value of the zth sample point in the reference ECG signal to be denoised and the residual ECG signal after noise reduction The value of the zth sampling point in, z is the index of the sampling point, and z is not greater than the total number of sampling points in the ECG signal to be denoised.
执行上述方法,从待降噪心电信号中提取出包括该待降噪心电信号的R峰位置等明显特征的待降噪基准心电信号,通过目标降噪自编码器对待降噪心电信号去除基准心电信号之后的待降噪剩余心电信号进行降噪,避免目标降噪自编码器对待降噪心电信号中明显特征的降噪处理,使得待降噪基准心电信号和降噪后的剩余心电信号叠加得到降噪后的心电信号可以更好地保留待降噪心电信号中的R峰位置,减少降噪后的心电信号的失真.Perform the above method, extract from the ECG signal to be denoised the reference ECG signal to be denoised including obvious features such as the R peak position of the ECG signal to be denoised, and use the target denoising autoencoder to treat the denoised ECG signal After the signal is removed from the reference ECG signal, the remaining ECG signal to be de-noised is denoised, avoiding the noise reduction processing of the target denoising autoencoder on the obvious features of the de-noising ECG signal, so that the reference ECG signal to be denoised is The residual ECG signal after noise is superimposed to obtain the noise-reduced ECG signal, which can better retain the R peak position in the ECG signal to be noise-reduced, and reduce the distortion of the ECG signal after noise reduction.
请参阅图8D所示的目标降噪自编码器的心电信号的降噪结果的示意性说明图。其中,图8D示出了待降噪心电信号、理想心电信号(即待降噪心电信号通过降噪处理希望得到的心电信号)、通过现有技术中卷积自编码器对待降噪心电信号进行降噪处理后得到的降噪后的心电信号、通过本申请实施例中目标降噪自编码器和本申请提供的心电信号降噪方法对待降噪心电信号进行降噪处理后得到的降噪后的心电信号。由图8D可见,相对于现有技术中的心电信号的降噪方法,本申请实施例的方法更好地提取到待降噪心电信号中的细节特征,减少降噪后的心电信号的失真,提高降噪性能。Please refer to the schematic illustration of the denoising result of the ECG signal of the target denoising autoencoder shown in FIG. 8D. 8D shows the ECG signal to be denoised, the ideal ECG signal (that is, the ECG signal that the ECG signal to be denoised is expected to obtain through noise reduction processing), and the convolutional autoencoder in the prior art The denoised ECG signal obtained after the noise reduction process is performed on the noisy ECG signal, the denoised ECG signal is reduced by the target denoising autoencoder in the embodiment of the present application and the ECG signal denoising method provided in the present application The denoised ECG signal obtained after noise processing. It can be seen from FIG. 8D that, compared with the prior art method for reducing the noise of the ECG signal, the method of the embodiment of the present application better extracts the detailed features of the ECG signal to be denoised, and reduces the denoised ECG signal. Distortion, improve noise reduction performance.
可以理解,实施例一为该降噪自编码器的训练阶段(如图4所示的训练设备120执行的阶段),具体训练是采用由实施例一以及实施例一基础上任意一种可能的实现方式中提供的降噪自编码器进行的;而实施例二则可以理解为是训练得到的目标降噪自编码器的应用阶段(如图4所示的执行设备110执行的阶段),具体可以体现为采用由实施例一训练得到的目标降噪自编码器,并根据输入的待降噪剩余心电信号,从而得到输出信号,即实施例二中的降噪后的剩余心电信号,最后将降噪后的剩余心电信号和待降噪基准心电信号叠加,得到降噪后的心电信号。It can be understood that the first embodiment is the training stage of the denoising autoencoder (the stage performed by the training device 120 as shown in FIG. 4), and the specific training adopts any one of the possibilities based on the first embodiment and the first embodiment. The noise reduction autoencoder provided in the implementation manner is performed; and the second embodiment can be understood as the application stage of the target noise reduction autoencoder obtained by training (the stage executed by the execution device 110 as shown in FIG. 4). It can be embodied as adopting the target noise reduction autoencoder trained in the first embodiment, and obtaining the output signal according to the input residual ECG signal to be denoised, that is, the residual ECG signal after noise reduction in the second embodiment. Finally, the remaining ECG signal after noise reduction and the reference ECG signal to be noise-reduced are superimposed to obtain the noise-reduced ECG signal.
下面结合附图介绍本申请实施例涉及的装置。The following describes the devices involved in the embodiments of the present application with reference to the drawings.
图9A为本发明实施例中一种降噪自编码的训练装置的示意性框图。图9A所示的降噪自编码的训练装置90(该装置90具体可以是图4训练设备120),可以包括:Fig. 9A is a schematic block diagram of a training device for noise reduction and self-encoding in an embodiment of the present invention. The noise reduction self-encoding training device 90 shown in FIG. 9A (the device 90 may specifically be the training device 120 of FIG. 4), which may include:
叠加单元901,用于将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The superimposing unit 901 is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthetic ECG signal. The noise-free ECG signal includes an H-beat ECG signal, and each beat of the ECG signal includes a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
分解单元902,用于利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号;A decomposition unit 902, configured to decompose the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction;
移除单元903,用于从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;The removing unit 903 is configured to remove the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
训练单元904,用于根据所述含噪剩余心电信号和所述含噪剩余心电信号对应的无噪 剩余心电信号训练降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述含噪剩余心电信号对应的无噪剩余心电信号为训练标签。The training unit 904 is configured to train the noise-reducing autoencoder according to the noise-containing residual ECG signal and the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal, wherein the noise-containing residual ECG signal is Training input, and the noise-free residual ECG signal corresponding to the noisy residual ECG signal is a training label.
在一种可能的实现中,所述分解单元902具体用于:In a possible implementation, the decomposition unit 902 is specifically configured to:
对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W小于H,W为正整数;Perform average processing on the W beat ECG signal in the synthesized ECG signal to obtain a second average ECG signal, W is less than H, and W is a positive integer;
将所述第二平均心电信号替换所述合成心电信号中H拍心电信号对应的A j,得到所述基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H; Substituting the second average ECG signal for A j corresponding to the H-beat ECG signal in the synthesized ECG signal to obtain the reference ECG signal, A j represents the H-beat ECG signal where R j is The left and right sides of the center each take the ECG signal in the Δt interval, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H;
从所述合成心电信号中移除所述基准心电信号,得到所述含噪剩余心电信号。The reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
在一种可能的实现中,所述分解单元902执行所述对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号具体包括:In a possible implementation, the decomposing unit 902 performing the averaging processing of the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically includes:
Figure PCTCN2020080880-appb-000116
Figure PCTCN2020080880-appb-000116
其中,
Figure PCTCN2020080880-appb-000117
表示所述第二平均心电信号,A k表示所述W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为所述W拍心电信号中QRS波群的顶点,k=1,2……W。
among them,
Figure PCTCN2020080880-appb-000117
Represents the second average ECG signal, Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right Δt intervals, and R k is the QRS wave in the W-beat ECG signal For the vertices of the group, k = 1, 2...W.
本申请实施例中各个的单元的具体实现可以参见上述实施例一中相关描述,此处不再赘述。For the specific implementation of each unit in the embodiment of the present application, reference may be made to the related description in the foregoing embodiment 1, which will not be repeated here.
图9B为本发明实施例中一种降噪自编码的训练装置的示意性框图。图9B所示的降噪自编码的训练装置92(该装置92具体可以是图4训练设备120),可以包括:Fig. 9B is a schematic block diagram of a training device for noise reduction and self-encoding in an embodiment of the present invention. The training device 92 for noise reduction and self-encoding shown in FIG. 9B (the device 92 may specifically be the training device 120 of FIG. 4), which may include:
叠加单元921,用于将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The superimposing unit 921 is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal. The noise-free ECG signal includes an H-beat ECG signal, and each beat of the ECG signal includes a QRS complex, H is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
分解单元922,用于利用平均节拍减法(average beat subtraction)将所述无噪心电信号分解为基准心电信号和无噪剩余心电信号;The decomposition unit 922 is configured to decompose the noise-free ECG signal into a reference ECG signal and a noise-free residual ECG signal by using average beat subtraction;
移除单元923,用于从所述合成心电信号中移除所述基准心电信号,得到含噪剩余心电信号;The removing unit 923 is configured to remove the reference ECG signal from the synthesized ECG signal to obtain a noisy residual ECG signal;
训练单元924,用于根据所述含噪剩余心电信号和所述含噪剩余心电信号对应的无噪剩余心电信号训练降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述含噪剩余心电信号对应的无噪剩余心电信号为训练标签。The training unit 924 is configured to train the noise-reducing autoencoder according to the noise-containing residual ECG signal and the noise-free residual ECG signal corresponding to the noise-containing residual ECG signal, wherein the noise-containing residual ECG signal is Training input, and the noise-free residual ECG signal corresponding to the noisy residual ECG signal is a training label.
本申请实施例中各个的单元的具体实现可以参见上述实施例二中相关描述,此处不再赘述。For the specific implementation of each unit in the embodiment of the present application, reference may be made to the related description in the second embodiment above, which will not be repeated here.
图10为本发明实施例提供的一种心电信号降噪装置的示意性框图,图10所示的心电信号降噪装置1000(该装置1000具体可以是图4执行设备110),可以包括:FIG. 10 is a schematic block diagram of an ECG signal noise reduction device provided by an embodiment of the present invention. The ECG signal noise reduction device 1000 shown in FIG. 10 (the device 1000 may specifically be the execution device 110 of FIG. 4), which may include :
获取单元1001,用于获取待降噪心电信号,所述待降噪心电信号包含M拍心电信号,每拍心电信号包含一个QRS波群,M为大于1的正整数;The obtaining unit 1001 is configured to obtain an ECG signal to be noise-reduced, where the ECG signal to be noise-reduced includes M beats of the ECG signal, each beat of the ECG signal includes a QRS complex, and M is a positive integer greater than 1;
第一分解单元1002,利用平均节拍减法(average beat subtraction)将所述待降噪心电 信号分解为待降噪基准心电信号和待降噪剩余心电信号;The first decomposition unit 1002 uses average beat subtraction to decompose the ECG signal to be denoised into the reference ECG signal to be denoised and the remaining ECG signal to be denoised;
降噪单元1003,用于将所述待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号;The noise reduction unit 1003 is configured to input the residual ECG signal to be noise-reduced into the target noise reduction autoencoder to obtain the residual ECG signal after noise reduction;
叠加单元1004,用于将所述待降噪基准心电信号和所述降噪后的剩余心电信号叠加,得到降噪后的心电信号。The superimposing unit 1004 is configured to superimpose the reference ECG signal to be noise-reduced and the remaining ECG signal after noise reduction to obtain the ECG signal after noise reduction.
在一种可能的实现中,所述第一分解单元1002具体用于:In a possible implementation, the first decomposition unit 1002 is specifically configured to:
对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,N小于M,N为正整数;Perform averaging processing on the N beats of the ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer;
将所述第一平均心电信号替换所述待降噪心电信号中M拍心电信号对应的B j,得到所述待降噪基准心电信号,B j表示所述M拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述M拍心电信号中QRS波群的顶点,j=1,2……M; Substituting the first average ECG signal for the B j corresponding to the M-beat ECG signal in the ECG signal to be noise-reduced to obtain the reference ECG signal to be noise-reduced, B j represents the M-beat ECG signal Take R j as the center and left and right to take the ECG signals in the Δt interval, R j is the apex of the QRS complex in the M beat ECG signal, j=1, 2...M;
从所述待降噪心电信号中移除所述待降噪基准心电信号,得到所述待降噪剩余心电信号。The reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
在一种可能的实现中,所述第一分解单元1002执行所述对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号具体包括:In a possible implementation, the first decomposition unit 1002 performing the averaging processing on the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal specifically includes:
Figure PCTCN2020080880-appb-000118
Figure PCTCN2020080880-appb-000118
其中,
Figure PCTCN2020080880-appb-000119
表示所述第一平均心电信号,B i表示所述N拍心电信号中以R i为中心左右各取Δt区间内的心电信号,R i为所述N拍心电信号中QRS波群的顶点,i=1,2……N。
among them,
Figure PCTCN2020080880-appb-000119
Indicates the first average ECG, B i represents the N ECG beat to about the center R i in the ECG signal from each interval Δt, R i beat from the ECG QRS wave of the N The vertices of the group, i = 1, 2...N.
可选地,装置1000还可以包括如上述图9A或图9B所示的降噪自编码的训练装置90、92中部分或全部单元,此处不再赘述。Optionally, the device 1000 may further include some or all of the units in the noise reduction and self-encoding training device 90, 92 shown in FIG. 9A or FIG. 9B, and details are not described herein again.
本申请实施例中各个的单元的具体实现可以参见上述实施例三中相关描述,此处不再赘述。For the specific implementation of each unit in the embodiment of the present application, reference may be made to the related description in the third embodiment above, which will not be repeated here.
图11是本申请实施例提供的一种降噪自编码器的训练装置的硬件结构示意图。图11所示的降噪自编码器的训练装置1100(该装置1100具体可以是一种计算机设备)包括存储器1101、处理器1102、通信接口1103以及总线1104。其中,存储器1101、处理器1102、通信接口1103通过总线1104实现彼此之间的通信连接。FIG. 11 is a schematic diagram of the hardware structure of a training device for a noise reduction autoencoder provided by an embodiment of the present application. The training device 1100 of the noise reduction autoencoder shown in FIG. 11 (the device 1100 may specifically be a computer device) includes a memory 1101, a processor 1102, a communication interface 1103, and a bus 1104. Among them, the memory 1101, the processor 1102, and the communication interface 1103 implement communication connections between each other through the bus 1104.
存储器1101可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器1101可以存储程序,当存储器1101中存储的程序被处理器1102执行时,处理器1102和通信接口1103用于执行本申请实施例一或实施例二所述的降噪自编码器的训练方法的各个步骤。The memory 1101 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM). The memory 1101 may store a program. When the program stored in the memory 1101 is executed by the processor 1102, the processor 1102 and the communication interface 1103 are used to execute the training method of the noise reduction autoencoder described in Embodiment 1 or Embodiment 2 of this application The various steps.
处理器1102可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的降噪自编码器的训练装置中的单元所需执行的功能,或者执行本申请方法实施例一或实施例二中的降噪自编码器的训练方法。The processor 1102 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), graphics processing unit (graphics processing unit, GPU), or one or more The integrated circuit is used to execute related programs to realize the functions required by the units in the training device of the noise reduction autoencoder in this embodiment of the application, or to execute the noise reduction self in the first or second embodiment of the method of this application. Encoder training method.
处理器1102还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申 请的降噪自编码器的训练方法的各个步骤可以通过处理器1102中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1102还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1101,处理器1102读取存储器1101中的信息,结合其硬件完成本申请实施例的降噪自编码器的训练装置中包括的单元所需执行的功能,或者执行本申请方法实施例一或实施例二的降噪自编码器的训练方法。The processor 1102 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the training method of the noise reduction autoencoder of this application can be completed by the integrated logic circuit of the hardware in the processor 1102 or instructions in the form of software. The aforementioned processor 1102 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 1101, and the processor 1102 reads the information in the memory 1101, and combines its hardware to complete the functions required by the units included in the training device for the noise reduction autoencoder in this embodiment of the application, or execute the method of the application The training method of the noise reduction autoencoder of the first embodiment or the second embodiment.
通信接口1103使用例如但不限于收发器一类的收发装置,来实现装置1100与其他设备或通信网络之间的通信。例如,可以通过通信接口1103获取训练数据(如本申请实施例一所述的训练样本)。The communication interface 1103 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 1100 and other devices or communication networks. For example, training data (such as the training samples described in Embodiment 1 of the present application) can be obtained through the communication interface 1103.
总线1104可包括在装置1100各个部件(例如,存储器1101、处理器1102、通信接口1103)之间传送信息的通路。The bus 1104 may include a path for transferring information between various components of the device 1100 (for example, the memory 1101, the processor 1102, and the communication interface 1103).
应理解,降噪自编码器的训练装置90或92中的叠加单元901、921,分解单元902、922,移除单元903、923,和训练单元904、924可以相当于处理器1102。It should be understood that the superimposing units 901 and 921, the decomposing units 902 and 922, the removing units 903 and 923, and the training units 904 and 924 in the training device 90 or 92 of the noise reduction autoencoder may be equivalent to the processor 1102.
上述各个功能器件的具体实现可以参见上述实施例一中相关描述,本申请实施例不再赘述。For the specific implementation of each of the foregoing functional devices, reference may be made to the related description in the foregoing embodiment 1, and details are not repeated in the embodiment of the present application.
图12是本申请实施例提供的心电信号降噪装置的硬件结构示意图。图12所示的心电信号降噪装置1200(该装置1200具体可以是一种计算机设备)包括存储器1201、处理器1202、心电传感器1203、通信接口1204以及总线1205。其中,存储器1201、处理器1202、通信接口1204通过总线1205实现彼此之间的通信连接。FIG. 12 is a schematic diagram of the hardware structure of an electrocardiographic signal noise reduction device provided by an embodiment of the present application. The electrocardiographic signal noise reduction device 1200 shown in FIG. 12 (the device 1200 may specifically be a computer device) includes a memory 1201, a processor 1202, an electrocardiographic sensor 1203, a communication interface 1204, and a bus 1205. Among them, the memory 1201, the processor 1202, and the communication interface 1204 implement communication connections between each other through the bus 1205.
存储器1201可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器1201可以存储程序,当存储器1201中存储的程序被处理器1202执行时,处理器1202和通信接口1204用于执行本申请实施例三中的心电信号的降噪方法的各个步骤。The memory 1201 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM). The memory 1201 may store a program. When the program stored in the memory 1201 is executed by the processor 1202, the processor 1202 and the communication interface 1204 are used to execute the steps of the method for reducing the noise of the ECG signal in the third embodiment of the present application.
处理器1202可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的心电信号降噪装置1200中的单元所需执行的功能,或者执行本申请方法实施例三中的心电信号的降噪方法。The processor 1202 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a graphics processing unit (graphics processing unit, GPU), or one or more The integrated circuit is used to execute related programs to realize the functions required by the units in the electrocardiographic signal noise reduction device 1200 in this embodiment of the present application, or to implement the electrocardiographic signal noise reduction method in the third method embodiment of this application.
处理器1202还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请的心电信号的降噪方法的各个步骤可以通过处理器1202中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1202还可以是通用处理器、数字信号处理器(Digital  Signal Processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1201,处理器1202读取存储器1201中的信息,结合其硬件完成本申请实施例的心电信号降噪装置中包括的单元所需执行的功能,或者执行本申请方法实施例的心电信号的降噪方法。The processor 1202 may also be an integrated circuit chip with signal processing capability. In the implementation process, the various steps of the method for reducing the noise of the electrocardiogram signal of the present application can be completed by the integrated logic circuit of hardware in the processor 1202 or instructions in the form of software. The aforementioned processor 1202 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 1201, and the processor 1202 reads the information in the memory 1201, and combines its hardware to complete the functions required by the units included in the electrocardiographic signal noise reduction device of the embodiment of the present application, or execute the method embodiment of the present application The noise reduction method of the ECG signal.
心电传感器1203包括2个电极和模数转换模块,其中,在心电传感器1203工作时,两个电极分解接触用户不同部位的皮肤表面,采集用户的心电信号,数模转换模块用于将采集到的心电信号转换为数字化的心电信号,即为本申请实施例中待降噪心电信号。The ECG sensor 1203 includes two electrodes and an analog-to-digital conversion module. When the ECG sensor 1203 is working, the two electrodes decompose and contact the skin surface of different parts of the user to collect the user's ECG signal. The digital-to-analog conversion module is used to collect The obtained ECG signal is converted into a digitized ECG signal, which is the ECG signal to be noise-reduced in this embodiment of the application.
应理解,心电传感器1203不是心电信号降噪装置1200必须的部分。在一种实现场景中,心电信号降噪装置1200具体为智能手环或智能手表等可穿戴设备,心电信号降噪装置1200可以包括该心电传感器1203。在另一种实现场景中,心电信号降噪装置1200具体为手机或服务器等,心电信号降噪装置1200可以不包括该心电传感器1203,心电信号降噪装置1200可以接收心电采集设备发送的待降噪心电信号,该心电采集设备可以是配置了心电传感器的智能手环、智能手表等可穿戴设备。应理解,本申请实施例还可以包括其他应用场景。It should be understood that the ECG sensor 1203 is not a necessary part of the ECG signal noise reduction device 1200. In an implementation scenario, the ECG signal noise reduction device 1200 is specifically a wearable device such as a smart bracelet or a smart watch, and the ECG signal noise reduction device 1200 may include the ECG sensor 1203. In another implementation scenario, the ECG signal noise reduction device 1200 is specifically a mobile phone or server, etc. The ECG signal noise reduction device 1200 may not include the ECG sensor 1203, and the ECG signal noise reduction device 1200 can receive ECG collection The ECG signal to be noise-reduced sent by the device may be a wearable device such as a smart bracelet or a smart watch equipped with an ECG sensor. It should be understood that the embodiments of the present application may also include other application scenarios.
通信接口1204使用例如但不限于收发器一类的收发装置,来实现装置1200与其他设备或通信网络之间的通信。例如,可以通过通信接口1204获取训练数据(如本申请实施例二所述的待降噪心电信号)。The communication interface 1204 uses a transceiving device such as but not limited to a transceiver to implement communication between the device 1200 and other devices or a communication network. For example, training data (such as the ECG signal to be noise-reduced as described in the second embodiment of the present application) can be obtained through the communication interface 1204.
总线1205可包括在装置1200各个部件(例如,存储器1201、处理器1202、通信接口1204)之间传送信息的通路。The bus 1205 may include a path for transferring information between various components of the device 1200 (for example, the memory 1201, the processor 1202, and the communication interface 1204).
应理解,心电信号降噪装置1000中的获取单元1001相当于心电信号降噪装置1200中的通信接口1204或者心电传感器1203;心电信号降噪装置1000中的第一分解单元1002、降噪单元1003和叠加单元1004可以相当于处理器1202。It should be understood that the acquisition unit 1001 in the ECG signal noise reduction device 1000 is equivalent to the communication interface 1204 or the ECG sensor 1203 in the ECG signal noise reduction device 1200; the first decomposition unit 1002 in the ECG signal noise reduction device 1000 The noise reduction unit 1003 and the superposition unit 1004 may be equivalent to the processor 1202.
上述各个功能单元的具体实现可以参见上述实施例三中相关描述,本申请实施例不再赘述。For the specific implementation of the above-mentioned functional units, reference may be made to the relevant description in the above-mentioned embodiment 3, and details are not repeated in this embodiment of the application.
应注意,尽管图11和图12所示的装置1100和1200仅仅示出了存储器、处理器、通信接口,但是在具体实现过程中,本领域的技术人员应当理解,装置1100和1200还包括实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当理解,装置1100和1200还可包括实现其他附加功能的硬件器件。此外,本领域的技术人员应当理解,装置1100和1200也可仅仅包括实现本申请实施例所必须的器件,而不必包括图11或图12中所示的全部器件。It should be noted that although the devices 1100 and 1200 shown in FIG. 11 and FIG. 12 only show a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the devices 1100 and 1200 also include implementations. Other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the devices 1100 and 1200 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the apparatuses 1100 and 1200 may also only include the necessary devices for implementing the embodiments of the present application, and not necessarily all the devices shown in FIG. 11 or FIG. 12.
可以理解,所述装置1100相当于图4中的所述训练设备120,所述装置1200相当于图4中的所述执行设备110。本领域普通技术人员可以意识到,结合本文中所公开的实施例描 述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that the device 1100 is equivalent to the training device 120 in FIG. 4, and the device 1200 is equivalent to the execution device 110 in FIG. 4. A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed in this document can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (22)

  1. 一种心电信号降噪方法,其特征在于,包括:An ECG signal noise reduction method, which is characterized in that it comprises:
    获取待降噪心电信号,所述待降噪心电信号包含M拍心电信号,每拍心电信号包含一个QRS波群,M为大于1的正整数;Acquire an ECG signal to be denoised, where the ECG signal to be denoised includes M beats of the ECG signal, each beat of the ECG signal includes a QRS complex, and M is a positive integer greater than 1;
    利用平均节拍减法(average beat subtraction)将所述待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号;Decompose the ECG signal to be denoised into a reference ECG signal to be denoised and the remaining ECG signal to be denoised by using average beat subtraction;
    将所述待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号;Input the residual ECG signal to be noise-reduced into the target noise-reduction autoencoder to obtain the residual ECG signal after noise reduction;
    将所述待降噪基准心电信号和所述降噪后的剩余心电信号叠加,得到降噪后的心电信号。The reference ECG signal to be noise-reduced and the remaining ECG signal after noise reduction are superimposed to obtain a noise-reduced ECG signal.
  2. 根据权利要求1所述的方法,其特征在于,所述利用平均节拍减法(average beat subtraction)将所述待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号包括:The method according to claim 1, characterized in that the use of average beat subtraction (average beat subtraction) to decompose the ECG signal to be denoised into a reference ECG signal to be denoised and a residual ECG signal to be denoised include:
    对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,N小于M,N为正整数;Perform averaging processing on the N beats of the ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer;
    将所述第一平均心电信号替换所述待降噪心电信号中M拍心电信号对应的B j,得到所述待降噪基准心电信号,B j表示所述M拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述M拍心电信号中QRS波群的顶点,j=1,2……M; Substituting the first average ECG signal for the B j corresponding to the M-beat ECG signal in the ECG signal to be noise-reduced to obtain the reference ECG signal to be noise-reduced, B j represents the M-beat ECG signal Take R j as the center and left and right to take the ECG signals in the Δt interval, R j is the apex of the QRS complex in the M beat ECG signal, j=1, 2...M;
    从所述待降噪心电信号中移除所述待降噪基准心电信号,得到所述待降噪剩余心电信号。The reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
  3. 根据权利要求2所述的方法,其特征在于,所述对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号具体包括:The method according to claim 2, wherein the averaging processing of the N-beat ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal specifically comprises:
    Figure PCTCN2020080880-appb-100001
    Figure PCTCN2020080880-appb-100001
    其中,
    Figure PCTCN2020080880-appb-100002
    表示所述第一平均心电信号,B i表示所述N拍心电信号中以R i为中心左右各取Δt区间内的心电信号,R i为所述N拍心电信号中QRS波群的顶点,i=1,2……N。
    among them,
    Figure PCTCN2020080880-appb-100002
    Indicates the first average ECG, B i represents the N ECG beat to about the center R i in the ECG signal from each interval Δt, R i beat from the ECG QRS wave of the N The vertices of the group, i = 1, 2...N.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述将所述待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号之前,所述方法还包括:The method according to any one of claims 1-3, characterized in that, before inputting the residual ECG signal to be noise-reduced into a target noise-reducing autoencoder, and obtaining the residual ECG signal after noise reduction, The method also includes:
    将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The noise-free ECG signal and the EMG noise signal are superimposed to obtain a synthetic ECG signal. The noise-free ECG signal includes an H-beat ECG signal, and each ECG signal includes a QRS complex, and H is a positive value greater than 1. An integer, the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
    利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号;Decomposing the synthetic ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction (average beat subtraction);
    从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;Removing the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
    根据所述含噪剩余心电信号和所述无噪剩余心电信号训练降噪自编码器,得到所述目标降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述无噪剩余心电信号为训练标签。Train the noise-reducing autoencoder according to the noisy residual ECG signal and the noise-free residual ECG signal to obtain the target noise-reducing autoencoder, wherein the noisy residual ECG signal is a training input, so The noise-free residual ECG signal is a training label.
  5. 根据权利要求4所述的方法,其特征在于,所述利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号包括:The method according to claim 4, wherein the decomposing the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal using average beat subtraction (average beat subtraction) comprises:
    对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W小于H,W为正整数;所述第二平均心电信号替换所述合成心电信号中H拍心电信号对应的A j,得到所述基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H; Perform average processing on the W beat ECG signal in the synthetic ECG signal to obtain a second average ECG signal, W is less than H, and W is a positive integer; the second average ECG signal replaces the synthetic ECG signal The A j corresponding to the H-beat ECG signal is obtained, and the reference ECG signal is obtained. A j represents the ECG signal in the interval of Δt between the left and right sides of the H-beat ECG signal with R j as the center, and R j is the W beat the apex of QRS complex in ECG signal, j = 1, 2……H;
    从所述合成心电信号中移除所述基准心电信号,得到所述含噪剩余心电信号。The reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
  6. 根据权利要求5所述的方法,其特征在于,所述对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号具体包括:The method according to claim 5, wherein the averaging processing of the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically comprises:
    Figure PCTCN2020080880-appb-100003
    Figure PCTCN2020080880-appb-100003
    其中,
    Figure PCTCN2020080880-appb-100004
    表示所述第二平均心电信号,A k表示所述W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为所述W拍心电信号中QRS波群的顶点,k=1,2……W。
    among them,
    Figure PCTCN2020080880-appb-100004
    Represents the second average ECG signal, Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right Δt intervals, and R k is the QRS wave in the W-beat ECG signal For the vertices of the group, k = 1, 2...W.
  7. 一种降噪自编码器的训练方法,其特征在于,包括:A method for training a noise reduction autoencoder, which is characterized in that it includes:
    将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The noise-free ECG signal and the EMG noise signal are superimposed to obtain a synthetic ECG signal. The noise-free ECG signal includes an H-beat ECG signal, and each ECG signal includes a QRS complex, and H is a positive value greater than 1. An integer, the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
    利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号;Decomposing the synthetic ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction (average beat subtraction);
    从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;Removing the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
    根据所述含噪剩余心电信号和所述无噪剩余心电信号训练降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述无噪剩余心电信号为训练标签。The noise-reducing autoencoder is trained according to the noisy residual ECG signal and the noise-free residual ECG signal, wherein the noisy residual ECG signal is a training input, and the noise-free residual ECG signal is a training label .
  8. 根据权利要求7所述的方法,其特征在于,所述利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号包括:8. The method according to claim 7, wherein the decomposing the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction (average beat subtraction) comprises:
    对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W小于H,W为正整数;Perform average processing on the W beat ECG signal in the synthesized ECG signal to obtain a second average ECG signal, W is less than H, and W is a positive integer;
    将所述第二平均心电信号替换所述合成心电信号中H拍心电信号对应的A j,得到所述基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H; Substituting the second average ECG signal for A j corresponding to the H-beat ECG signal in the synthesized ECG signal to obtain the reference ECG signal, A j represents the H-beat ECG signal where R j is The left and right sides of the center each take the ECG signal in the Δt interval, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H;
    从所述合成心电信号中移除所述基准心电信号,得到所述含噪剩余心电信号。The reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
  9. 根据权利要求8所述的方法,其特征在于,所述对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号具体包括:The method according to claim 8, wherein the averaging processing of the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically comprises:
    Figure PCTCN2020080880-appb-100005
    Figure PCTCN2020080880-appb-100005
    其中,
    Figure PCTCN2020080880-appb-100006
    表示所述第二平均心电信号,A k表示所述W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为所述W拍心电信号中QRS波群的顶点,k=1,2……W。
    among them,
    Figure PCTCN2020080880-appb-100006
    Represents the second average ECG signal, Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right Δt intervals, and R k is the QRS wave in the W-beat ECG signal For the vertices of the group, k = 1, 2...W.
  10. 一种心电信号降噪装置,其特征在于,包括:An ECG signal noise reduction device, which is characterized by comprising:
    获取单元,用于获取待降噪心电信号,所述待降噪心电信号包含M拍心电信号,每拍心电信号包含一个QRS波群,M为大于1的正整数;The acquiring unit is configured to acquire the ECG signal to be denoised, the ECG signal to be denoised includes M beats of the ECG signal, each beat of the ECG signal includes a QRS complex, and M is a positive integer greater than 1;
    第一分解单元,利用平均节拍减法(average beat subtraction)将所述待降噪心电信号分解为待降噪基准心电信号和待降噪剩余心电信号;The first decomposition unit uses an average beat subtraction to decompose the ECG signal to be denoised into a reference ECG signal to be denoised and a residual ECG signal to be denoised;
    降噪单元,用于将所述待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号;A noise reduction unit, configured to input the residual ECG signal to be noise-reduced into the target noise reduction autoencoder to obtain the residual ECG signal after noise reduction;
    叠加单元,用于将所述待降噪基准心电信号和所述降噪后的剩余心电信号叠加,得到降噪后的心电信号。The superimposing unit is used to superimpose the reference ECG signal to be noise-reduced and the remaining ECG signal after noise reduction to obtain the ECG signal after noise reduction.
  11. 根据权利要求10所述的装置,其特征在于,所述第一分解单元具体用于:The device according to claim 10, wherein the first decomposition unit is specifically configured to:
    对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号,N小于M,N为正整数;Perform averaging processing on the N beats of the ECG signal in the ECG signal to be noise-reduced to obtain the first average ECG signal, where N is less than M, and N is a positive integer;
    将所述第一平均心电信号替换所述待降噪心电信号中M拍心电信号对应的B j,得到所述待降噪基准心电信号,B j表示所述M拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述M拍心电信号中QRS波群的顶点,j=1,2……M; Substituting the first average ECG signal for the B j corresponding to the M-beat ECG signal in the ECG signal to be noise-reduced to obtain the reference ECG signal to be noise-reduced, B j represents the M-beat ECG signal Take R j as the center and left and right to take the ECG signals in the Δt interval, R j is the apex of the QRS complex in the M beat ECG signal, j=1, 2...M;
    从所述待降噪心电信号中移除所述待降噪基准心电信号,得到所述待降噪剩余心电信号。The reference ECG signal to be denoised is removed from the ECG signal to be denoised to obtain the remaining ECG signal to be denoised.
  12. 根据权利要求11所述的装置,其特征在于,所述第一分解单元执行所述对所述待降噪心电信号中N拍心电信号进行平均处理,得到第一平均心电信号具体包括:The device according to claim 11, wherein the first decomposition unit performs the averaging processing of the N-beat ECG signal in the ECG signal to be noise-reduced, and obtaining the first average ECG signal specifically comprises :
    Figure PCTCN2020080880-appb-100007
    Figure PCTCN2020080880-appb-100007
    其中,
    Figure PCTCN2020080880-appb-100008
    表示所述第一平均心电信号,B i表示所述N拍心电信号中以R i为中心左右各取Δt区间内的心电信号,R i为所述N拍心电信号中QRS波群的顶点,i=1,2……N。
    among them,
    Figure PCTCN2020080880-appb-100008
    Indicates the first average ECG, B i represents the N ECG beat to about the center R i in the ECG signal from each interval Δt, R i beat from the ECG QRS wave of the N The vertices of the group, i = 1, 2...N.
  13. 根据权利要求10-12任一项所述的装置,其特征在于,所述降噪单元执行所述将所述待降噪剩余心电信号输入目标降噪自编码器,得到降噪后的剩余心电信号之前,所述装置还包括:The device according to any one of claims 10-12, wherein the noise reduction unit executes the input of the remaining ECG signal to be noise-reduced into a target noise-reduction autoencoder to obtain the remaining noise-reduction Before the ECG signal, the device further includes:
    合成单元,用于将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The synthesis unit is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthesized ECG signal. The noise-free ECG signal includes an H beat ECG signal, and each beat ECG signal includes a QRS complex, H Is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
    第二分解单元,用于利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号;The second decomposition unit is configured to decompose the synthetic ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction;
    移除单元,用于从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;A removing unit for removing the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
    训练单元,用于根据所述含噪剩余心电信号和所述无噪剩余心电信号训练降噪自编码器,得到所述目标降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述无噪剩余心电信号为训练标签。The training unit is configured to train a noise-reducing autoencoder according to the noise-containing residual ECG signal and the noise-free residual ECG signal to obtain the target noise-reducing autoencoder, wherein the noise-containing residual ECG signal It is a training input, and the noise-free residual ECG signal is a training label.
  14. 根据权利要求13所述的装置,其特征在于,所述第二分解单元具体用于:The device according to claim 13, wherein the second decomposition unit is specifically configured to:
    对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W小于H,W为正整数;所述第二平均心电信号替换所述合成心电信号中H拍心电信号对应的A j,得到所述基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H; Perform average processing on the W beat ECG signal in the synthetic ECG signal to obtain a second average ECG signal, W is less than H, and W is a positive integer; the second average ECG signal replaces the synthetic ECG signal The A j corresponding to the H-beat ECG signal is obtained, and the reference ECG signal is obtained. A j represents the ECG signal in the interval of Δt between the left and right sides of the H-beat ECG signal with R j as the center, and R j is the W beat the apex of QRS complex in ECG signal, j = 1, 2……H;
    从所述合成心电信号中移除所述基准心电信号,得到所述含噪剩余心电信号。The reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
  15. 根据权利要求14所述的装置,其特征在于,所述第二分解单元执行所述对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号具体包括:The device according to claim 14, wherein the second decomposition unit performing the averaging processing on the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically comprises:
    Figure PCTCN2020080880-appb-100009
    Figure PCTCN2020080880-appb-100009
    其中,
    Figure PCTCN2020080880-appb-100010
    表示所述第二平均心电信号,A k表示所述W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为所述W拍心电信号中QRS波群的顶点,k=1,2……W。
    among them,
    Figure PCTCN2020080880-appb-100010
    Represents the second average ECG signal, Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right Δt intervals, and R k is the QRS wave in the W-beat ECG signal The vertices of the group, k = 1, 2...W.
  16. 一种降噪自编码器的训练装置,其特征在于,包括:A training device for a noise reduction autoencoder, which is characterized in that it comprises:
    叠加单元,用于将无噪心电信号和肌电噪声信号叠加,得到合成心电信号,所述无噪心电信号包含H拍心电信号,每拍心电信号包含一个QRS波群,H为大于1的正整数,所述无噪心电信号的信噪比不小于第一阈值;The superimposing unit is used to superimpose the noise-free ECG signal and the EMG noise signal to obtain a synthetic ECG signal. The noise-free ECG signal includes an H beat ECG signal, and each beat ECG signal includes a QRS complex, H Is a positive integer greater than 1, and the signal-to-noise ratio of the noise-free ECG signal is not less than the first threshold;
    分解单元,用于利用平均节拍减法(average beat subtraction)将所述合成心电信号分解为基准心电信号和含噪剩余心电信号;A decomposition unit, configured to decompose the synthesized ECG signal into a reference ECG signal and a noisy residual ECG signal by using average beat subtraction (average beat subtraction);
    移除单元,用于从所述无噪心电信号中移除所述基准心电信号,得到无噪剩余心电信号;A removing unit for removing the reference ECG signal from the noise-free ECG signal to obtain a noise-free residual ECG signal;
    训练单元,用于根据所述含噪剩余心电信号和所述无噪剩余心电信号训练降噪自编码器,其中,所述含噪剩余心电信号为训练输入,所述无噪剩余心电信号为训练标签。The training unit is configured to train the noise-reducing autoencoder according to the noisy residual ECG signal and the noise-free residual ECG signal, wherein the noisy residual ECG signal is a training input, and the noise-free residual ECG signal The electrical signal is a training label.
  17. 根据权利要求16所述的装置,其特征在于,所述分解单元具体用于:The device according to claim 16, wherein the decomposition unit is specifically configured to:
    对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号,W小于 H,W为正整数;Perform average processing on the W beat ECG signal in the synthesized ECG signal to obtain a second average ECG signal, W is less than H, and W is a positive integer;
    将所述第二平均心电信号替换所述合成心电信号中H拍心电信号对应的A j,得到所述基准心电信号,A j表示所述H拍心电信号中以R j为中心左右各取Δt区间内的心电信号,R j为所述W拍心电信号中QRS波群的顶点,j=1,2……H; Substituting the second average ECG signal for A j corresponding to the H-beat ECG signal in the synthesized ECG signal to obtain the reference ECG signal, where A j represents the H-beat ECG signal where R j is The left and right sides of the center each take the ECG signal in the Δt interval, R j is the apex of the QRS complex in the W beat ECG signal, j=1, 2...H;
    从所述合成心电信号中移除所述基准心电信号,得到所述含噪剩余心电信号。The reference ECG signal is removed from the synthetic ECG signal to obtain the noisy residual ECG signal.
  18. 根据权利要求17所述的装置,其特征在于,所述分解单元执行所述对所述合成心电信号中W拍心电信号进行平均处理,得到第二平均心电信号具体包括:18. The device according to claim 17, wherein the decomposition unit performing the averaging processing on the W beat ECG signal in the synthesized ECG signal to obtain the second average ECG signal specifically comprises:
    Figure PCTCN2020080880-appb-100011
    Figure PCTCN2020080880-appb-100011
    其中,
    Figure PCTCN2020080880-appb-100012
    表示所述第二平均心电信号,A k表示所述W拍心电信号中以R k为中心左右各取Δt区间内的心电信号,R k为所述W拍心电信号中QRS波群的顶点,k=1,2……W。
    among them,
    Figure PCTCN2020080880-appb-100012
    Represents the second average ECG signal, Ak represents the ECG signal in the W-beat ECG signal that takes R k as the center and takes the left and right Δt intervals, and R k is the QRS wave in the W-beat ECG signal The vertices of the group, k = 1, 2...W.
  19. 一种心电信号降噪装置,其特征在于,包括:存储器和处理器,所述存储器用于程序,所述处理器执行所述存储器存储的程序,当存储器存储的程序被执行时,所述处理器用于执行如权利要求1-6任一项所述的心电信号降噪方法。An electrocardiographic signal noise reduction device, characterized by comprising: a memory and a processor, the memory is used for a program, the processor executes the program stored in the memory, and when the program stored in the memory is executed, the The processor is used to execute the ECG signal noise reduction method according to any one of claims 1-6.
  20. 一种降噪自编码器的训练装置,其特征在于,包括:存储器和处理器,所述存储器用于程序,所述处理器执行所述存储器存储的程序,当存储器存储的程序被执行时,所述处理器用于执行如权利要求7-9任一项所述的降噪自编码器的训练方法。A training device for a noise reduction autoencoder, which is characterized by comprising: a memory and a processor, the memory is used for a program, the processor executes the program stored in the memory, and when the program stored in the memory is executed, The processor is configured to execute the method for training a noise reduction autoencoder according to any one of claims 7-9.
  21. 一种计算机可读存储介质,其特征在于,所述计算机可读介质存储用于设备执行的程序代码,所述程序代码包括如权利要求1-6任一项所述的心电信号降噪方法。A computer-readable storage medium, wherein the computer-readable medium stores program code for device execution, and the program code includes the ECG signal noise reduction method according to any one of claims 1-6 .
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读介质存储用于设备执行的程序代码,所述程序代码包括如权利要求7-9任一项所述的降噪自编码器的训练方法。A computer-readable storage medium, wherein the computer-readable medium stores program code for device execution, and the program code includes the noise reduction autoencoder according to any one of claims 7-9 Training method.
PCT/CN2020/080880 2019-05-14 2020-03-24 Denoising autoencoder training method, electrocardiography signal denoising method, and apparatuses WO2020228420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910399830.9 2019-05-14
CN201910399830.9A CN110141215B (en) 2019-05-14 2019-05-14 Training method of noise reduction self-encoder, noise reduction method of electrocardiosignal, related device and equipment

Publications (1)

Publication Number Publication Date
WO2020228420A1 true WO2020228420A1 (en) 2020-11-19

Family

ID=67595358

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/080880 WO2020228420A1 (en) 2019-05-14 2020-03-24 Denoising autoencoder training method, electrocardiography signal denoising method, and apparatuses

Country Status (2)

Country Link
CN (1) CN110141215B (en)
WO (1) WO2020228420A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110141215B (en) * 2019-05-14 2020-12-15 清华大学 Training method of noise reduction self-encoder, noise reduction method of electrocardiosignal, related device and equipment
CN110974217B (en) * 2020-01-03 2022-08-09 苏州大学 Dual-stage electrocardiosignal noise reduction method based on convolution self-encoder
US20220061768A1 (en) * 2020-09-01 2022-03-03 Biosense Webster (Israel) Ltd. Removing noise from cardiac signals
US20220133206A1 (en) * 2020-11-03 2022-05-05 Biosense Webster (Israel) Ltd. Recording apparatus noise reduction
CN114781445B (en) * 2022-04-11 2022-11-18 山东省人工智能研究院 Deep neural network electrocardiosignal noise reduction method based on interpretability

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035231A (en) * 1997-10-29 2000-03-07 Siemens Elema Ab Electrocardiogram signal processing apparatus
US20070066907A1 (en) * 1999-12-29 2007-03-22 Bsp Biological Signal Processing Ltd. Method and device for analyzing a periodic or semi-periodic signal
CN102247143A (en) * 2011-06-03 2011-11-23 吉林大学珠海学院 Integratable fast algorithm for denoising electrocardiosignal and identifying QRS waves
CN104706350A (en) * 2014-11-13 2015-06-17 华中科技大学 Electrocardio-signal noise reduction method
CN106889984A (en) * 2017-01-22 2017-06-27 河北大学 A kind of automatic noise-reduction method of electrocardiosignal
US10123745B1 (en) * 2015-08-21 2018-11-13 Greatbatch Ltd. Apparatus and method for cardiac signal noise detection and disposition based on physiologic relevance
CN110141215A (en) * 2019-05-14 2019-08-20 清华大学 The training method of noise reduction self-encoding encoder, the noise-reduction method of electrocardiosignal and relevant apparatus, equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9986951B1 (en) * 2013-11-25 2018-06-05 Vital Connect, Inc. Low-distortion ECG denoising
CN105590011B (en) * 2014-10-20 2019-04-30 深圳市迈迪加科技发展有限公司 A kind of ecg signal data modification method and system based on pulse regression model
US10346665B2 (en) * 2017-05-30 2019-07-09 Sunasic Technologies Limited Noise reduced capacitive image sensor and method operating the same
CN109645979A (en) * 2017-10-10 2019-04-19 深圳市理邦精密仪器股份有限公司 Ambulatory ecg signal artifact identification method and device
CN109620212A (en) * 2019-01-31 2019-04-16 天津工业大学 A kind of contactless Electro-cadiogram signals detector system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035231A (en) * 1997-10-29 2000-03-07 Siemens Elema Ab Electrocardiogram signal processing apparatus
US20070066907A1 (en) * 1999-12-29 2007-03-22 Bsp Biological Signal Processing Ltd. Method and device for analyzing a periodic or semi-periodic signal
CN102247143A (en) * 2011-06-03 2011-11-23 吉林大学珠海学院 Integratable fast algorithm for denoising electrocardiosignal and identifying QRS waves
CN104706350A (en) * 2014-11-13 2015-06-17 华中科技大学 Electrocardio-signal noise reduction method
US10123745B1 (en) * 2015-08-21 2018-11-13 Greatbatch Ltd. Apparatus and method for cardiac signal noise detection and disposition based on physiologic relevance
CN106889984A (en) * 2017-01-22 2017-06-27 河北大学 A kind of automatic noise-reduction method of electrocardiosignal
CN110141215A (en) * 2019-05-14 2019-08-20 清华大学 The training method of noise reduction self-encoding encoder, the noise-reduction method of electrocardiosignal and relevant apparatus, equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAO, HUAQING: "Research on ECG Denoising Algorithm Based on Improved Guided Filter", COLLECTION OF MASTER'S THESIS OF HEBEI UNIVERSITY, 31 January 2019 (2019-01-31) *
XIANG, YANDE: "Research on Electrocardiogram Signal Detection and Classification Based on Convolutional Neural Network", COLLECTION OF DOCTORAL DISSERTATIONS OF ZHEJIANG UNIVERSITY, 31 January 2019 (2019-01-31), pages 1 - 124 *

Also Published As

Publication number Publication date
CN110141215B (en) 2020-12-15
CN110141215A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
WO2020228420A1 (en) Denoising autoencoder training method, electrocardiography signal denoising method, and apparatuses
Chiang et al. Noise reduction in ECG signals using fully convolutional denoising autoencoders
Singh et al. A new ECG denoising framework using generative adversarial network
Huang et al. Accurate classification of ECG arrhythmia using MOWPT enhanced fast compression deep learning networks
Dasan et al. A novel dimensionality reduction approach for ECG signal via convolutional denoising autoencoder with LSTM
CA2849294C (en) Physiological signal denoising
Wang et al. A novel ECG signal compression method using spindle convolutional auto-encoder
US20140005988A1 (en) Physiological signal denoising
Rasti-Meymandi et al. A deep learning-based framework For ECG signal denoising based on stacked cardiac cycle tensor
Mir et al. ECG denoising and feature extraction techniques–a review
Maalej et al. On the wavelet-based compressibility of continuous-time sampled ECG signal for e-health applications
CN116012916A (en) Remote photoplethysmograph signal and heart rate detection model construction method and detection method
Jin et al. A novel deep wavelet convolutional neural network for actual ecg signal denoising
CN114648048A (en) Electrocardiosignal noise reduction method based on variational self-coding and PixelCNN model
Zhang et al. An end-to-end lower limb activity recognition framework based on sEMG data augmentation and enhanced CapsNet
Karri et al. A real-time cardiac arrhythmia classification using hybrid combination of delta modulation, 1D-CNN and blended LSTM
CN110495878B (en) ECG (electrocardiogram) -based disease prediction method and device and electronic equipment
CN116383617B (en) Intelligent blood pressure detection method and system based on pulse wave waveform characteristics
CN116942172A (en) Wavelet double-channel single-lead electrocardiograph denoising method based on coding and decoding structure
Said et al. Deep learning and low rank dictionary model for mhealth data classification
Sheu et al. Lightweight denoising autoencoder design for noise removal in electrocardiography
CN113827253A (en) Computing device and method for removing noise from electroencephalogram signals
Banerjee et al. Noise cleaning of ECG on edge device using convolutional sparse contractive Autoencoder
CN113288050A (en) Multidimensional enhanced epileptic seizure prediction system based on graph convolution network
Emara et al. A Hybrid Compressive Sensing and Classification Approach for Dynamic Storage Management of Vital Biomedical Signals

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20806068

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20806068

Country of ref document: EP

Kind code of ref document: A1