Arrhythmia monitoring method and system

By using three-lead fabric electrode electrocardiogram and MCNN-BiLSTM model, the problems of low efficiency in diagnosis of traditional arrhythmia and susceptible to noise interference are solved, and the accurate acquisition and efficient detection of ECG signals are achieved, which improves the accuracy and efficiency of arrhythmia detection.

CN119632528APending Publication Date: 2025-03-18BEIFANG UNIV OF NATITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411821448.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional arrhythmia diagnosis relies on experienced experts, has low analysis efficiency and is prone to misjudgment. Deep learning models are susceptible to data imbalance and noise interference during training, making it difficult to effectively capture the multi-scale features of ECG signals.

Method used

The three-lead fabric electrode electrocardiogram, ESP32 module and AD8232 module are used to collect ECG signals and detect them through the MCNN-BiLSTM model. Combined with multi-scale convolution, attention layer and long-term recording network, the spatial and timing characteristics of the ECG signal are extracted.

Benefits of technology

It realizes the accurate collection and transmission of ECG signals, improves the accuracy and efficiency of arrhythmia detection, reduces the burden on doctors, improves the detection efficiency, and alleviates the problem of tight medical resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119632528A_ABST
    Figure CN119632528A_ABST
Patent Text Reader

Abstract

The invention discloses an arrhythmia monitoring method and system, and relates to the technical field of electrocardiogram monitoring. The three-lead fabric electrode electrocardiograph clothes, the ESP32 module and the AD8232 module are adopted for collecting and transmitting ECG electrocardiosignal data, the collection accuracy of the ECG electrocardiosignal data can be guaranteed, data transmission loss is reduced, and the transmission rate is increased; the MCNN-BiLSTM model is adopted for detection, the detection result of the patient in the current state is accurately obtained in real time, the spatial features of ECG electrocardio voltage signal data are effectively extracted, the detection accuracy is improved, the rapid heart rhythm monitoring result is provided, the burden of a doctor is reduced, the overall detection efficiency is improved, the doctor can remotely check the real-time electrocardio data of the patient, and the doctor experience is improved. The requirement for multiple examinations of a patient in a hospital is reduced, the problem of shortage of medical resources can be effectively relieved, and the electrocardiogram monitoring efficiency and popularization degree are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrocardiogram monitoring, and in particular to a method and system for monitoring arrhythmia. Background Art

[0002] Traditional arrhythmia diagnosis mainly relies on experienced electrocardiogram (ECG) analysis experts. Although this method has high accuracy, it relies on the subjective judgment of experts, has low analysis efficiency, and is prone to misjudgment when the data volume is large. In recent years, with the rapid development of artificial intelligence technology, especially the rise of deep learning methods, a new technical path has been provided for automated arrhythmia detection. There are many types of arrhythmias, including ventricular tachycardia (VT), atrial fibrillation (AF), ventricular premature beats (PVC), etc., and their waveform characteristics are complex and varied. Noise interference, baseline drift, and individual differences among patients can significantly affect the quality of ECG signals, thereby increasing the difficulty of detection. In addition, manual labeling of arrhythmia categories requires experienced experts, which is costly and prone to subjective bias. In arrhythmia datasets, the distribution of different types of arrhythmias is often highly unbalanced. This imbalance can cause deep learning models to tend to dominate categories during training, reducing the detection performance of minority classes. As time series data, ECG signals are characterized by short-term changes (such as QRS waves) and long-term dependencies (such as rhythm patterns). Traditional machine learning methods find it difficult to capture these multi-scale features simultaneously. Although deep learning performs well, it has high requirements for hardware resources and the model has poor interpretability. Summary of the invention

[0003] The object of the present invention is to provide a method and system for monitoring arrhythmia to improve the above technical problems.

[0004] In order to achieve the above-mentioned object of the invention, the embodiment of the present invention provides the following technical solutions:

[0005] A method for monitoring cardiac arrhythmia, comprising:

[0006] S1. Collect the patient's ECG signal data through a three-lead fabric electrode electrocardiograph;

[0007] S2. Use the ESP32 module to monitor the AD8232 module and obtain the corresponding monitoring results;

[0008] S3, based on the monitoring results, using the AD8232 module to amplify the ECG signal data to obtain the corresponding amplified ECG signal data;

[0009] S4, using the ESP32 module to convert the amplified ECG signal data to obtain the corresponding ECG voltage signal data;

[0010] S5. Input the ECG voltage signal data into an arrhythmia detection model, and output a corresponding arrhythmia detection result; wherein the arrhythmia detection model adopts an MCNN-BiLSTM model.

[0011] Furthermore, the ESP32 module is ESP32-WROOM-32E.

[0012] Furthermore, the ESP32 module is used to monitor the AD8232 module to obtain corresponding monitoring results, including:

[0013] The ESP32 module is used to monitor whether the AD8232 module has lead-off, and the pins corresponding to the AD8232 module are collected in real time as LOD- and LOD+; the detection state of the pin LOD- is that in the DC lead-off detection mode, when the connection with the -IN electrode is disconnected, the pin LOD- is in a high level state, otherwise it is in a low level state; the detection state of the pin LOD+ is that in the DC lead-off detection mode, when the +IN electrode is disconnected, the pin LOD+ is in a high level state, otherwise it is in a low level state; when the pin LOD -, when the pin LOD+ is in a high level state, the ESP32 module is used to transmit the corresponding high level signal to the mobile terminal, and the software of the mobile terminal outputs "AD8232 module has poor contact", which is displayed in red; conversely, when the pin LOD- and the pin LOD+ are in a low level state, the ESP32 module is used to transmit the corresponding low level signal to the mobile terminal, and the software of the mobile terminal outputs "AD8232 module has good contact", which is displayed in green; wherein the monitoring result is "AD8232 module has poor contact" or "AD8232 module has good contact".

[0014] Furthermore, the MCNN-BiLSTM model includes a multi-scale convolution module, a STA attention layer, a convolution pooling layer, a BiLSTM layer, a Dense-Dropout layer, and an output layer connected in series in sequence;

[0015] The multi-scale convolution module includes a first one-dimensional convolution layer, a second one-dimensional convolution layer and a third one-dimensional convolution layer in parallel; wherein the convolution kernel of the first one-dimensional convolution layer is 5; the convolution kernel of the second one-dimensional convolution layer is 7; and the convolution kernel of the third one-dimensional convolution layer is 9;

[0016] The STA attention layer includes a multi-head attention layer, an input layer, an attention layer and a normalization layer; the output of the multi-head attention layer is input to the input layer; the outputs of the input layer and the attention layer are both input to the normalization layer;

[0017] The Dense-Dropout layer includes a fully connected layer and a Dropout layer connected in series; the output layer adopts a softmax activation function.

[0018] Furthermore, the training process of the MCNN-BiLSTM model includes the following steps:

[0019] S5-1, obtaining historical ECG voltage signal data and its labels; wherein the labels include normal heartbeat, left bundle branch block, right bundle branch block, atrial premature beat, ventricular premature beat, fusion heartbeat, and the corresponding parameter symbols are N, L, R, A, V, and F respectively;

[0020] S5-2, using a Butterworth filter to filter and denoise the historical ECG voltage signal data to obtain filtered historical ECG voltage signal data;

[0021] S5-3, inputting the filtered historical ECG voltage signal data into the first one-dimensional convolution layer, the second one-dimensional convolution layer and the third one-dimensional convolution layer respectively, and outputting historical ECG spatial feature data of different scales;

[0022] S5-4, inputting the historical ECG electrocardiogram spatial feature data of different scales into the STA attention layer, and outputting the historical ECG electrocardiogram key spatial feature data;

[0023] S5-5, inputting the historical ECG electrocardiogram key spatial feature data into the convolution pooling layer, and outputting the pooled historical ECG electrocardiogram key spatial feature data;

[0024] S5-6, inputting the pooled historical ECG key spatial feature data into the BiLSTM layer, and outputting the historical ECG temporal spatial feature data;

[0025] S5-7, inputting the historical ECG time series spatial feature data into the Dense-Dropout layer and the output layer in sequence to obtain historical arrhythmia detection result data;

[0026] S5-8. Based on the arrhythmia detection result data and its label, adjust the weight parameters of the MCNN-BiLSTM model to complete the training of the MCNN-BiLSTM model.

[0027] A cardiac arrhythmia monitoring system, comprising an ECG electrocardiogram signal data acquisition module, an AD8232 module, an ESP32 module, an arrhythmia detection module, and a power supply module; the ECG electrocardiogram signal data acquisition module is a three-lead fabric electrode electrocardiogram garment; the arrhythmia detection module comprises a mobile terminal and a cloud; the cloud comprises an MCNN model; wherein:

[0028] Three-lead fabric electrode electrocardiogram clothing, used to collect ECG signal data of patients;

[0029] AD8232 module, used to amplify ECG signal data to obtain corresponding amplified ECG signal data;

[0030] The ESP32 module is used to detect the AD8232 module and obtain the corresponding monitoring results; the amplified ECG signal data is converted to obtain the corresponding ECG voltage signal data;

[0031] The MCNN model is used to detect ECG voltage signal data and obtain corresponding arrhythmia detection results;

[0032] Mobile terminal, used for data transmission and reception;

[0033] A power module is used to supply power to the arrhythmia monitoring system.

[0034] Furthermore, the AD8232 module uses a chip U10 with model number AD8232ACPZ-RL;

[0035] Port 1 of the chip U10 is connected to one end of the capacitor C17; the other end of the capacitor C17 is respectively connected to port 20 of the chip U10 and one end of the resistor R16; the other end of the resistor R16 is respectively connected to one end of the resistor R17 and one end of the resistor R18; the other end of the resistor R17 is connected to port 19 of the chip U10; the other end of the resistor R18 is respectively connected to one end of the capacitor C18, port 6 of the chip U10 and one end of the resistor R20; the other end of the capacitor C18 serves as REFOUT; port 2 of the chip U10 is connected to one end of the resistor R24; the other end of the resistor R24 ​​is respectively connected to one end of the resistor R22 , the three-lead fabric electrode electrocardiograph clothing; the other end of the resistor R22 is respectively connected to one end of the resistor R25, one end of the resistor R19 and the other end of the resistor R20; the other end of the resistor R25 is respectively connected to one end of the resistor R23 and the three-lead fabric electrode electrocardiograph clothing; the other end of the resistor R19 serves as the first VDD3V3; the port 3 of the chip U10 is connected to the other end of the resistor R23; the port 4 of the chip U10 is connected to one end of the capacitor C19; the port 5 of the chip U10 is respectively connected to the other end of the capacitor C19 and one end of the resistor R21; the other end of the resistor R21 is connected to the three-lead fabric electrode electrocardiograph clothing; Port 7 of the chip U10 is respectively connected to one end of the resistor R26 and one end of the capacitor C20; the other end of the resistor R26 is respectively connected to one end of the resistor R27 and one end of the capacitor C21; the other end of the resistor R27 serves as IAOUT; port 8 of the chip U10 is respectively connected to the other end of the capacitor C20 and one end of the resistor R28, and serves as REFOUT; port 9 of the chip U10 is respectively connected to the other end of the resistor R28 and one end of the resistor R29; port 10 of the chip U10 is respectively connected to the other end of the resistor R9 and the other end of the capacitor C21, and serves as VP; the VP is connected to the positive electrode of the light-emitting diode D5; The cathode of the light-emitting diode D5 is connected to the grounding resistor R9; the ports 11, 12 and 13 of the chip U10 serve as I016, IO15 and SDN respectively; the SDN is connected to one end of the resistor R10; the ports 14, 16 and 21 of the chip U10 are all grounded; the port 17 of the chip U10 is respectively connected to the grounding capacitor C23 and the first VDD3V3; the port 18 of the chip U10 is respectively connected to one end of the resistor R31, the grounding resistor R30 and the grounding capacitor C22; the other end of the resistor R31, the port 15 of the chip U10 and the other end of the resistor R10 are all connected to the first VDD3V3.

[0036] Furthermore, the power module adopts a chip U4 with model AMS1117-3.3V; port 1 of the chip U4 is grounded; port 2 of the chip U4 is respectively connected to the grounding capacitor C7 and port 4 of the chip U4, and serves as the second VDD3V3; port 3 of the chip U4 is respectively connected to the grounding capacitor C6 and one end of the resistor R8; the other end of the resistor R8 is respectively connected to port 3 and port 6 of the switch SW1; port 1, port 2, port 4 and port 5 of the switch SW1 are I-type connections; port 2 of the switch SW1 is respectively connected to the cathode of the diode D3 and the source of the field effect transistor Q1; the drain of the field effect transistor Q1 serves as BAT+; the gate of the field effect transistor Q1 is respectively connected to the anode of the diode D3 and the grounding resistor R7, and serves as VDD-BUS; the second VDD3V3 is connected to the anode of the light-emitting diode D6; the cathode of the light-emitting diode D6 is connected to the grounding resistor R32.

[0037] The beneficial effects of the present invention are:

[0038] This method uses a three-lead fabric electrode electrocardiograph, an ESP32 module, and an AD8232 module to collect and transmit ECG signal data, which can further ensure the accuracy of ECG signal data collection, reduce the loss of ECG signal data during transmission, and improve the transmission rate; the MCNN-BiLSTM model is used to detect ECG voltage signal data, and the detection results of the patient in the current state are obtained in real time and accurately, and the spatial features of ECG voltage signal data are effectively extracted to improve the detection accuracy.

[0039] This system is controlled and collected through the ESP32 module, and the Bluetooth in the ESP32 module transmits the ECG voltage signal data to the detection model in real time for analysis. It can complete the preliminary analysis of the ECG voltage signal data in a short time and provide fast heart rhythm monitoring results, reducing the burden on doctors and improving the overall detection efficiency. It assists doctors to remotely view the real-time ECG data of patients, reducing the need for patients to go to the hospital for multiple examinations, effectively alleviating the problem of tight medical resources and improving the efficiency and popularity of ECG monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A flow chart of a method in an embodiment of the present invention;

[0042] Figure 2 A system structure diagram in an embodiment of the present invention;

[0043] Figure 3 is a circuit diagram of the AD8232 module in an embodiment of the present invention;

[0044] Figure 4 ESP32 module according to an embodiment of the present invention;

[0045] Figure 5 ESP32 module according to an embodiment of the present invention;

[0046] Figure 6 is a circuit diagram of a blood oxygen rhythm module in an embodiment of the present invention;

[0047] Figure 7 is a circuit diagram of a SWITCH module in an embodiment of the present invention;

[0048] Figure 8 is a circuit diagram of a power module in an embodiment of the present invention;

[0049] Fig. 9 is a circuit diagram of a lithium battery charging module in an embodiment of the present invention;

[0050] Fig.10 1 is a circuit diagram of a USB TO TTL module in an embodiment of the present invention;

[0051] Fig.11 This is a filtering effect diagram of a 4th-order Butterworth filter in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0053] See also Figure 1 , this embodiment provides a method for monitoring arrhythmia, which includes:

[0054] S1. The patient's ECG signal data is collected through a three-lead fabric electrode ECG suit; the three-lead fabric electrode ECG suit uses three electrodes, namely RA, LA and RL, which are placed at the first intercostal space on the right side of the sternum and the first intercostal space on the midclavicular line on the left side of the sternum and the level of the xiphoid process on the left midclavicular line. All three electrodes are flexible wearable fabric electrodes. Flexible wearable fabric electrodes have better fit, reducing the signal instability or inaccuracy caused by patient movement, poor skin contact, etc. during the use of traditional electrodes, thereby improving the accuracy of signal acquisition.

[0055] S2. Use the ESP32 module to monitor the AD8232 module and obtain corresponding monitoring results; the ESP32 module is ESP32-WROOM-32E.

[0056] The ESP32 module is used to monitor the AD8232 module to obtain corresponding monitoring results, including:

[0057] Because in practice, the electrodes of the three-lead fabric electrode ECG clothing will have poor contact with the AD8232 module. The problem of poor contact between the electrode and the AD8232 module can be converted into lead detachment of the AD8232 module, so that the ESP32 module can be used to monitor whether the AD8232 module has lead detachment and collect real-time data of the AD8232 module. The corresponding pins are LOD- and LOD+; the detection state of the pin LOD- is in the DC lead detachment detection mode, when the connection with the -IN electrode is disconnected, the pin LOD- is in a high level state, otherwise it is in a low level state; the detection state of the pin LOD+ is in the DC lead detachment detection mode, when the +IN electrode is disconnected, the pin LOD+ is in a high level state. state, otherwise it is in a low level state; when the pin LOD- and the pin LOD+ are in a high level state, the corresponding high level signal is transmitted to the mobile terminal by using the ESP32 module, and the "AD8232 module has poor contact" is output through the software of the mobile terminal, which is displayed in red; conversely, when the pin LOD- and the pin LOD+ are in a low level state, the corresponding low level signal is transmitted to the mobile terminal by using the ESP32 module, and the "AD8232 module has good contact" is output through the software of the mobile terminal, which is displayed in green; wherein the monitoring result is "AD8232 module has poor contact" or "AD8232 module has good contact".

[0058] Among them, the mobile software is the WeChat program.

[0059] S3. Based on the monitoring results, the AD8232 module is used to amplify the ECG signal data to obtain the corresponding amplified ECG signal data; the AD8232 module uses a 0.5 Hz double-pole high-pass filter and a 40 Hz double-pole low-pass filter to amplify and filter the ECG signal data, which can effectively filter out common interferences such as baseline drift, electromyographic interference and power frequency noise, ensuring that the collected signal is more accurate.

[0060] S4, using the ESP32 module to convert the amplified ECG signal data to obtain the corresponding ECG voltage signal data;

[0061] S5. Input the ECG voltage signal data into an arrhythmia detection model, and output a corresponding arrhythmia detection result; wherein the arrhythmia detection model adopts an MCNN-BiLSTM model.

[0062] The MCNN-BiLSTM model includes a multi-scale convolution module, a STA attention layer, a convolution pooling layer, a BiLSTM layer, a Dense-Dropout layer, and an output layer connected in series in sequence; the multi-scale convolution module includes a first one-dimensional convolution layer, a second one-dimensional convolution layer, and a third one-dimensional convolution layer in parallel; wherein the convolution kernel of the first one-dimensional convolution layer is 5; the convolution kernel of the second one-dimensional convolution layer is 7; the convolution kernel of the third one-dimensional convolution layer is 9; the STA attention layer includes a multi-head attention layer, an input layer, an attention layer, and a normalization layer; the output of the multi-head attention layer is input to the input layer; the outputs of the input layer and the attention layer are both input to the normalization layer; the Dense-Dropout layer includes a fully connected layer and a Dropout layer connected in series; the output layer adopts a softmax activation function.

[0063] The training process of the MCNN-BiLSTM model includes the following steps:

[0064] S5-1, obtaining historical ECG voltage signal data and its labels; wherein the labels include normal heartbeat, left bundle branch block, right bundle branch block, atrial premature beat, ventricular premature beat, fusion heartbeat, and the corresponding parameter symbols are N, L, R, A, V, and F respectively;

[0065] S5-2, using a Butterworth filter to filter and denoise the historical ECG voltage signal data to obtain filtered historical ECG voltage signal data;

[0066] S5-3, inputting the filtered historical ECG voltage signal data into the first one-dimensional convolution layer, the second one-dimensional convolution layer and the third one-dimensional convolution layer respectively, and outputting historical ECG spatial feature data of different scales;

[0067] S5-4. Input the historical ECG electrocardiogram spatial feature data of different scales into the STA attention layer, and output the historical ECG electrocardiogram key spatial feature data; the STA attention layer assigns different attention weights to the features of each time point and spatial position corresponding to the input historical ECG electrocardiogram spatial feature data of different scales to highlight the most helpful part for ECG classification. The STA attention layer usually weights the input data to generate a weight matrix, which assigns different weights to the input features of different time steps and spatial positions. These weights can be obtained through training and learning, usually by calculating the similarity between the input features and a learned query vector. The calculated spatiotemporal attention weights are applied to the input features, and the final feature representation, i.e., the historical ECG electrocardiogram key spatial feature data, is generated by weighted summation.

[0068] S5-5, inputting the historical ECG electrocardiogram key spatial feature data into the convolution pooling layer, and outputting the pooled historical ECG electrocardiogram key spatial feature data;

[0069] S5-6, inputting the pooled historical ECG key spatial feature data into the BiLSTM layer, and outputting the historical ECG temporal spatial feature data;

[0070] S5-7, inputting the historical ECG time series spatial feature data into the Dense-Dropout layer and the output layer in sequence to obtain historical arrhythmia detection result data;

[0071] S5-8. Based on the historical arrhythmia detection result data and its labels, adjust the weight parameters of the MCNN-BiLSTM model to complete the training of the MCNN-BiLSTM model.

[0072] See also Figure 2 The present embodiment provides an arrhythmia monitoring system, which includes an ECG signal data acquisition module, an AD8232 module, an ESP32 module, an arrhythmia detection module, and a power module; the ECG signal data acquisition module is a three-lead fabric electrode electrocardiograph; the arrhythmia detection module includes a mobile terminal and a cloud; the cloud includes an MCNN model; wherein:

[0073] The three-lead fabric electrode ECG garment is used to collect the ECG signal data of the patient; the three-lead fabric electrode ECG garment uses three electrodes, namely RA, LA and RL, which are placed at the first intercostal space on the right edge of the sternum and the first intercostal space on the midclavicular line on the left edge of the sternum and the level of the xiphoid process on the left midclavicular line, which can further ensure that the electrode placement requirements meet the medical standards.

[0074] AD8232 module, used to amplify ECG signal data to obtain corresponding amplified ECG signal data;

[0075] like Figure 3 As shown, the AD8232 module uses a chip U10 with model number AD8232ACPZ-RL; the AD8232 module collects 360 data points per second, and the collection frequency is 360 Hz, ensuring that the ECG data meets the sampling accuracy and frequency required by medicine.

[0076] Port 1 of the chip U10 is connected to one end of the capacitor C17; the other end of the capacitor C17 is respectively connected to port 20 of the chip U10 and one end of the resistor R16; the other end of the resistor R16 is respectively connected to one end of the resistor R17 and one end of the resistor R18; the other end of the resistor R17 is connected to port 19 of the chip U10; the other end of the resistor R18 is respectively connected to one end of the capacitor C18, port 6 of the chip U10 and one end of the resistor R20; the other end of the capacitor C18 serves as REFOUT; port 2 of the chip U10 is connected to one end of the resistor R24; the other end of the resistor R24 ​​is respectively connected to one end of the resistor R22. The electrode LA of the three-lead fabric electrode electrocardiograph clothing is connected; the other end of the resistor R22 is respectively connected to one end of the resistor R25, one end of the resistor R19 and the other end of the resistor R20; the other end of the resistor R25 is respectively connected to one end of the resistor R23 and the electrode RA of the three-lead fabric electrode electrocardiograph clothing; the other end of the resistor R19 serves as the first VDD3V3; the port 3 of the chip U10 is connected to the other end of the resistor R23; the port 4 of the chip U10 is connected to one end of the capacitor C19; the port 5 of the chip U10 is respectively connected to the other end of the capacitor C19 and one end of the resistor R21; the other end of the resistor R21 is connected to the three-lead fabric electrode electrocardiograph clothing The electrode RL of the clothes; the port 7 of the chip U10 is respectively connected to one end of the resistor R26 and one end of the capacitor C20; the other end of the resistor R26 is respectively connected to one end of the resistor R27 and one end of the capacitor C21; the other end of the resistor R27 is used as IAOUT; the port 8 of the chip U10 is respectively connected to the other end of the capacitor C20 and one end of the resistor R28, and is used as REFOUT; the port 9 of the chip U10 is respectively connected to the other end of the resistor R28 and one end of the resistor R29; the port 10 of the chip U10 is respectively connected to the other end of the resistor R9 and the other end of the capacitor C21, and is used as VP; the VP is connected to the light emitting diode D5 The positive electrode of the light-emitting diode D5 is connected to the grounding resistor R9; the port 11, port 12 and port 13 of the chip U10 are respectively used as I016, IO15 and SDN; the SDN is connected to one end of the resistor R10; the port 14, port 16 and port 21 of the chip U10 are all grounded; the port 17 of the chip U10 is respectively connected to the grounding capacitor C23 and the first VDD3V3; the port 18 of the chip U10 is respectively connected to one end of the resistor R31, the grounding resistor R30 and the grounding capacitor C22; the other end of the resistor R31, the port 15 of the chip U10 and the other end of the resistor R10 are all connected to the first VDD3V3.

[0077] The AD8232 module has low power consumption and high-precision signal amplification functions, which can maintain good signal quality in mobile or home monitoring scenarios, avoiding the situation of insufficient sampling or low accuracy of traditional devices.

[0078] The ESP32 module is used to detect the AD8232 module and obtain the corresponding monitoring results; the amplified ECG signal data is converted to obtain the corresponding ECG voltage signal data;

[0079] like Figure 4 and Figure 5 As shown, the ESP32 module is ESP32-WROOM-32E, and uses a chip U12 of model ESP32-S3-WROOM-1-N8R8. Port 1, port 40 and port 41 of the chip U12 are all grounded; port 2 of the chip U12 is connected to a grounded fixed value capacitor C24 and serves as a third VDD3V3; port 38 of the chip U12 serves as IO and is connected to one end of a resistor R15; the other end of the resistor R15 is connected to a grounded light emitting diode D4.

[0080] like Figure 6 and Figure 7 As shown, the ESP32 module is also connected to the blood oxygen heart rhythm module and the SWITCH module; the blood oxygen heart rhythm module uses a chip CN1 of model XH2.54-5P; port 1 of the chip CN1 is connected to the third VDD3V3; port 2 of the chip CN1 is grounded; port 4 and port 5 of the chip CN1 are respectively connected to port 10 and port 11 of the chip U12. The SWITCH module includes two two-legged turtles U8; port 2 of one two-legged turtle U8 is grounded, and port 1 is connected to one end of the resistor R12; the other end of the resistor R12 is respectively connected to one end of the resistor R11 and port 3 of the chip U12; the other end of the resistor R11 is connected to the third VDD3V3; port 2 of the other two-legged turtle U8 is grounded, and port 1 is connected to one end of the resistor R13; the other end of the resistor R13 is respectively connected to one end of the resistor R14 and port 27 of the chip U12; the other end of the resistor R14 is connected to the third VDD3V3.

[0081] The low-power Bluetooth module integrated in the chip U12 of ESP32-S3-WROOM-1-N8R8 complies with the national wireless transmission standards, operates in the 2.4GHz ISM band, and has a transmission frequency range of 2400MHz to 2483.5MHz. It complies with the radio management regulations of the Ministry of Industry and Information Technology of China, ensures the security and legality of data transmission, and can improve the data transmission rate and quality, further reducing the processing time.

[0082] The MCNN model is used to detect ECG voltage signal data and obtain corresponding arrhythmia detection results;

[0083] Mobile terminal, used for data transmission and reception; the mobile terminal uses WeChat program;

[0084] The received ECG voltage signal data is converted into json format data through the mobile terminal and uploaded to the cloud; the cloud receives the json format data through the API interface (RESTfulAPI) and stores it, and calls the MCNN model through Flask to process the json format data; the MCNN model can load the local pre-trained weights and perform abnormality detection on the uploaded data to identify whether there is arrhythmia or other ECG abnormalities. Flask will package the detection results of the model into json format, return it to the mobile terminal, and send it to the doctor. The doctor can call the json format data corresponding to the ECG voltage signal data and the json format data corresponding to the arrhythmia detection results in the cloud at any time, and perform manual diagnosis, and feedback the manual diagnosis results to the mobile terminal.

[0085] A power module is used to supply power to the arrhythmia monitoring system.

[0086] like Figure 8 As shown, the power module uses a chip U4 of model AMS1117-3.3V; port 1 of the chip U4 is grounded; port 2 of the chip U4 is respectively connected to the ground capacitor C7 and port 4 of the chip U4, and serves as the second VDD3V3; port 3 of the chip U4 is respectively connected to the ground capacitor C6 and one end of the resistor R8; the other end of the resistor R8 is respectively connected to port 3 and port 6 of the switch SW1; port 1, port 2, port 4 and port 5 of the switch SW1 are I-type connections; port 2 of the switch SW1 is respectively connected to the cathode of the diode D3 and the source of the field effect transistor Q1; the drain of the field effect transistor Q1 serves as BAT+; the gate of the field effect transistor Q1 is respectively connected to the anode of the diode D3 and the ground resistor R7, and serves as VDD-BUS; the second VDD3V3 is connected to the anode of the light-emitting diode D6; the cathode of the light-emitting diode D6 is connected to the ground resistor R32. Wherein, the model of the switch SW1 is switch SW1K8-5851E-L1.

[0087] The power module is used to manage the battery charging and discharging of the arrhythmia monitoring system to ensure that the arrhythmia monitoring system can continue to operate stably and extend its service life. Fig. 9As shown, when the power module is charging, the VDD-BUS of the power module is connected to a lithium battery charging module. The lithium battery charging module uses a chip U5 with a model number of TP4056X_C2763448; Port 1 and Port 3 of the chip U5 are grounded; Port 2 of the chip U5 is connected to the grounding resistor R4; Port 4 of the chip U5 is respectively connected to the grounding capacitor C3, the grounding capacitor C12, one end of the resistor R3, Port 8 of the chip U5, the anode of the light-emitting diode D1 and the anode of the light-emitting diode D2; The other end of the resistor R3 is connected to the VDD-BUS of the power module; Port 5 of the chip U5 is respectively connected to the grounding capacitor C3, the grounding capacitor C12, one end of the resistor R3, Port 8 of the chip U5, the anode of the light-emitting diode D1 and the anode of the light-emitting diode D2 Capacitor C2 and grounding capacitor C4, and serve as BAT+; port 6 of the chip U5 is connected to one end of the resistor R5; the other end of the resistor R5 is connected to the cathode of the light-emitting diode D2; port 7 of the chip U5 is connected to one end of the resistor R6; the other end of the resistor R6 is connected to the cathode of the light-emitting diode D1; port 9 of the chip U5 is grounded; the BAT+ is connected to port 2 of the chip U9; port 1 of the chip U9 is respectively connected to port 3 of the chip U9, port 4 of the chip U9 and the horizontal patch socket, and is grounded.

[0088] like Fig.10 As shown, the arrhythmia monitoring system also includes a USB TO TTL module, which is used to download the written software program to ESP32. The USB TO TTL module includes a chip U2 of model CH340C and a chip USB1 of model UF-M5DD-Y-1; port 1 of chip U2 is grounded; port 2 of chip U2 is connected to port 36 of chip U12; port 3 of chip U2 is connected to port 37 of chip U12; port 4 of chip U2 serves as the fourth VDD3V3; port 5 of chip U2 is connected to port 3 of chip USB1; port 6 of chip U2 is connected to port 2 of chip USB1; port 13 of chip U2 is respectively connected to the emitter of transistor U1 and one end of resistor R2; The collector of transistor U1 is connected to port 27 of chip U12; the base of transistor U1 is connected to one end of resistor R1; port 14 of chip U2 is respectively connected to the other end of resistor R1 and the emitter of transistor U3; the collector of transistor U3 is connected to grounded capacitor C1; the base of transistor U3 is connected to the other end of resistor R2; port 16 of chip U2 is respectively connected to grounded capacitor C5 and the fourth VDD3V3; port 1 of chip USB1 is connected to VDD-BUS of the power module; port 5, port 6, port 7, port 8 and port of chip USB1 are all grounded.

[0089] The first VDD3V3 of the AD8232 module, the third VDD3V3 of the ESP32 module, and the fourth VDD3V3 of the USB TO TTL module are all connected to the second VDD3V3 of the power module.

[0090] In an experiment, the MIT-BIH arrhythmia data was used as the training data for the MCNN-BiLSTM model. The training data was filtered using Butterworth filters of different orders, and the filtering effect of the Butterworth filter was evaluated using three indicators: signal-to-noise ratio (SNR), mean square error (MSE), and peak signal-to-noise ratio (PSNR).

[0091] Table 1

[0092] Degree SNR MSE PSNR 1 24.06 0.0031 73.26 2 25.37 0.0024 74.57 3 25.36 0.0022 74.76 4 25.59 0.0021 74.79 25 25.55 0.0023 74.75 30 25.55 0.0025 74.74 35 17.29 0.0146 66.49 36 18.13 0.0120 67.33

[0093] As shown in Table 1, when a Butterworth filter with an order of 4 is used, the corresponding signal-to-noise ratio (SNR), mean square error (MSE) and peak signal-to-noise ratio (PSNR) are 25.59, 0.0021 and 74.79 respectively, which are better than Butterworth filters with other orders. The 4th-order Butterworth filter retains sufficient signal details and reduces the impact of noise while ensuring signal smoothness. Fig.11 As shown in Figure 1, the 4th-order Butterworth filter removes noise without over-smoothing the signal, thus avoiding the signal distortion problem that may be caused by higher-order filters.

[0094] The filtered training data was input into the MCNN-BiLSTM model, and precision (Pre), recall (Rec), and F1 score (F1) were used as evaluation indicators.

[0095] Table 2

[0096] Class Pre Rec F1 N 0.91 0.90 0.94 L 0.96 0.98 0.97 R 0.98 0.99 0.99 A 0.93 0.93 0.93 V 0.93 0.93 0.93

[0097] As can be seen from Table 2, the precision and recall of the present invention in identifying normal heartbeat, left bundle branch block, right bundle branch block, atrial premature beat, ventricular premature beat, and fusion heartbeat are both greater than or equal to 0.9, and the corresponding F1 scores are all greater than or equal to 0.93, further proving that the present invention can effectively detect different types of ECG electrocardiogram signals. Class represents the label of the filtered training data, i.e., normal heartbeat, left bundle branch block, right bundle branch block, atrial premature beat, ventricular premature beat, and fusion heartbeat, and the corresponding parameter symbols are N, L, R, A, V, and F, respectively.

[0098] The MCNN model, the MCNN+STA model, the MCNN+BiLSTM model and the MCNN+STA+BiLSTM model of the present invention were used for comparison, and the precision (Pre), the recall rate (Rec) and the F1 score (F1) were used as evaluation indicators.

[0099] Table 3

[0100] Model Pre Recall F1 MCNN 0.87 0.91 0.89 MCNN+STA 0.92 0.94 0.91 MCNN+BiLSTM 0.93 0.93 0.92 MCNN+STA+BiLSTM 0.94 0.94 0.94

[0101] As can be seen from Table 3, the precision, recall and F1 score of the MCNN+STA+BiLSTM model are all 0.94, which are greater than the precision, recall and F1 scores of the MCNN model, MCNN+STA model and MCNN+BiLSTM model, further proving the superiority of the MCNN+STA+BiLSTM model.

[0102] The Inception-CNN-BiLSTM model, the SVMA model, the XGBoost model and the MCNN+STA+BiLSTM model of the present invention were used for comparison, and the precision (Pre), recall (Rec) and F1 score (F1) were used as evaluation indicators.

[0103] Table 4

[0104] Methods Pre Rec F1 Inception-CNN-BiLSTM - - 91.27% SVM 53.4% 58.65% 55.90% XGBoost 61.8% 75.09 67.8% MCNN+STA+BiLSTM 94% 94% 94%

[0105] It can be seen from Table 4 that the precision, recall rate and F1 score of the MCNN+STA+BiLSTM model are much greater than those of the Inception-CNN-BiLSTM model, the SVMA model and the XGBoost model, which further illustrates that the present invention can effectively capture the temporal features and spatial information in the ECG signal, thereby improving the detection performance.

[0106] In summary, the present invention adopts three-lead fabric electrode electrocardiograph clothing, ESP32 module, and AD8232 module to collect and transmit ECG electrocardiograph signal data, which can further ensure the collection accuracy of ECG electrocardiograph signal data, reduce the loss of ECG electrocardiograph signal data during transmission, and improve the transmission rate; adopt MCNN-BiLSTM model to detect ECG electrocardiograph voltage signal data, obtain the detection result of the patient in the current state in real time and accurately, effectively extract the spatial characteristics of ECG electrocardiograph voltage signal data, and improve the detection accuracy. Control and collection are carried out through ESP32 module, and the Bluetooth in ESP32 module transmits ECG electrocardiograph voltage signal data to the detection model in real time for analysis, which can complete the preliminary analysis of ECG electrocardiograph voltage signal data in a short time, and provide fast heart rhythm monitoring results, reduce the burden of doctors, and improve the overall detection efficiency. Doctors can remotely view the real-time electrocardiograph data of patients, reduce the need for patients to go to the hospital for multiple examinations, and effectively alleviate the problem of tight medical resources, and improve the efficiency and popularity of electrocardiograph monitoring.

[0107] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for monitoring arrhythmia, characterized in that: include: S1. Collect the patient's ECG signal data through a three-lead fabric electrode electrocardiograph; S2. Use the ESP32 module to monitor the AD8232 module and obtain the corresponding monitoring results; S3, based on the monitoring results, using the AD8232 module to amplify the ECG signal data to obtain the corresponding amplified ECG signal data; S4, using the ESP32 module to convert the amplified ECG signal data to obtain the corresponding ECG voltage signal data; S5. Input the ECG voltage signal data into an arrhythmia detection model, and output a corresponding arrhythmia detection result; wherein the arrhythmia detection model adopts an MCNN-BiLSTM model.

2. The arrhythmia monitoring method according to claim 1, characterized in that: The ESP32 module is ESP32-WROOM-32E.

3. The arrhythmia monitoring method according to claim 1, characterized in that: The ESP32 module is used to monitor the AD8232 module to obtain corresponding monitoring results, including: The ESP32 module is used to monitor whether the AD8232 module has lead-off, and the pins corresponding to the AD8232 module are collected in real time as LOD- and LOD+; the detection state of the pin LOD- is that in the DC lead-off detection mode, when the connection with the -IN electrode is disconnected, the pin LOD- is in a high level state, otherwise it is in a low level state; the detection state of the pin LOD+ is that in the DC lead-off detection mode, when the +IN electrode is disconnected, the pin LOD+ is in a high level state, otherwise it is in a low level state; when the pin LOD -, when the pin LOD+ is in a high level state, the ESP32 module is used to transmit the corresponding high level signal to the mobile terminal, and the software of the mobile terminal outputs "AD8232 module has poor contact", which is displayed in red; conversely, when the pin LOD- and the pin LOD+ are in a low level state, the ESP32 module is used to transmit the corresponding low level signal to the mobile terminal, and the software of the mobile terminal outputs "AD8232 module has good contact", which is displayed in green; wherein the monitoring result is "AD8232 module has poor contact" or "AD8232 module has good contact".

4. The arrhythmia monitoring method according to claim 1, characterized in that: The MCNN-BiLSTM model includes a multi-scale convolution module, a STA attention layer, a convolution pooling layer, a BiLSTM layer, a Dense-Dropout layer, and an output layer connected in series in sequence; The multi-scale convolution module includes a first one-dimensional convolution layer, a second one-dimensional convolution layer and a third one-dimensional convolution layer in parallel; wherein the convolution kernel of the first one-dimensional convolution layer is 5; the convolution kernel of the second one-dimensional convolution layer is 7; and the convolution kernel of the third one-dimensional convolution layer is 9; The STA attention layer includes a multi-head attention layer, an input layer, an attention layer and a normalization layer; the output of the multi-head attention layer is input to the input layer; the outputs of the input layer and the attention layer are both input to the normalization layer; The Dense-Dropout layer includes a fully connected layer and a Dropout layer connected in series; the output layer adopts a softmax activation function.

5. The arrhythmia monitoring method according to claim 4, characterized in that: The training process of the MCNN-BiLSTM model includes the following steps: S5-1, obtaining historical ECG voltage signal data and its labels; wherein the labels include normal heartbeat, left bundle branch block, right bundle branch block, atrial premature beat, ventricular premature beat, fusion heartbeat, and the corresponding parameter symbols are N, L, R, A, V, and F respectively; S5-2, using a Butterworth filter to filter and denoise the historical ECG voltage signal data to obtain filtered historical ECG voltage signal data; S5-3, inputting the filtered historical ECG voltage signal data into the first one-dimensional convolution layer, the second one-dimensional convolution layer and the third one-dimensional convolution layer respectively, and outputting historical ECG spatial feature data of different scales; S5-4, inputting the historical ECG electrocardiogram spatial feature data of different scales into the STA attention layer, and outputting the historical ECG electrocardiogram key spatial feature data; S5-5, inputting the historical ECG electrocardiogram key spatial feature data into the convolution pooling layer, and outputting the pooled historical ECG electrocardiogram key spatial feature data; S5-6, inputting the pooled historical ECG key spatial feature data into the BiLSTM layer, and outputting the historical ECG temporal spatial feature data; S5-7, inputting the historical ECG time series spatial feature data into the Dense-Dropout layer and the output layer in sequence to obtain historical arrhythmia detection result data; S5-8. Based on the historical arrhythmia detection result data and its labels, adjust the weight parameters of the MCNN-BiLSTM model to complete the training of the MCNN-BiLSTM model.

6. An arrhythmia monitoring system, used to implement the arrhythmia monitoring method according to any one of claims 1 to 5, characterized in that: It includes an ECG signal data acquisition module, an AD8232 module, an ESP32 module, an arrhythmia detection module, and a power module; the ECG signal data acquisition module is a three-lead fabric electrode electrocardiogram garment; the arrhythmia detection module includes a mobile terminal and a cloud; the cloud includes an MCNN model; wherein: Three-lead fabric electrode electrocardiogram clothing, used to collect ECG signal data of patients; AD8232 module, used to amplify ECG signal data to obtain corresponding amplified ECG signal data; The ESP32 module is used to detect the AD8232 module and obtain the corresponding monitoring results; the amplified ECG signal data is converted to obtain the corresponding ECG voltage signal data; The MCNN model is used to detect ECG voltage signal data and obtain corresponding arrhythmia detection results; Mobile terminal, used for data transmission and reception; A power module is used to supply power to the arrhythmia monitoring system.

7. The arrhythmia monitoring system according to claim 6, characterized in that: The AD8232 module uses a chip U10 with model number AD8232ACPZ-RL; Port 1 of the chip U10 is connected to one end of the capacitor C17; the other end of the capacitor C17 is respectively connected to port 20 of the chip U10 and one end of the resistor R16; the other end of the resistor R16 is respectively connected to one end of the resistor R17 and one end of the resistor R18; the other end of the resistor R17 is connected to port 19 of the chip U10; the other end of the resistor R18 is respectively connected to one end of the capacitor C18, port 6 of the chip U10 and one end of the resistor R20; the other end of the capacitor C18 serves as REFOUT; port 2 of the chip U10 is connected to one end of the resistor R24; the other end of the resistor R24 ​​is respectively connected to one end of the resistor R22 , the three-lead fabric electrode electrocardiograph clothing; the other end of the resistor R22 is respectively connected to one end of the resistor R25, one end of the resistor R19 and the other end of the resistor R20; the other end of the resistor R25 is respectively connected to one end of the resistor R23 and the three-lead fabric electrode electrocardiograph clothing; the other end of the resistor R19 serves as the first VDD3V3; the port 3 of the chip U10 is connected to the other end of the resistor R23; the port 4 of the chip U10 is connected to one end of the capacitor C19; the port 5 of the chip U10 is respectively connected to the other end of the capacitor C19 and one end of the resistor R21; the other end of the resistor R21 is connected to the three-lead fabric electrode electrocardiograph clothing; Port 7 of the chip U10 is respectively connected to one end of the resistor R26 and one end of the capacitor C20; the other end of the resistor R26 is respectively connected to one end of the resistor R27 and one end of the capacitor C21; the other end of the resistor R27 serves as IAOUT; port 8 of the chip U10 is respectively connected to the other end of the capacitor C20 and one end of the resistor R28, and serves as REFOUT; port 9 of the chip U10 is respectively connected to the other end of the resistor R28 and one end of the resistor R29; port 10 of the chip U10 is respectively connected to the other end of the resistor R9 and the other end of the capacitor C21, and serves as VP; the VP is connected to the positive electrode of the light-emitting diode D5; The cathode of the light-emitting diode D5 is connected to the grounding resistor R9; the ports 11, 12 and 13 of the chip U10 serve as I016, IO15 and SDN respectively; the SDN is connected to one end of the resistor R10; the ports 14, 16 and 21 of the chip U10 are all grounded; the port 17 of the chip U10 is respectively connected to the grounding capacitor C23 and the first VDD3V3; the port 18 of the chip U10 is respectively connected to one end of the resistor R31, the grounding resistor R30 and the grounding capacitor C22; the other end of the resistor R31, the port 15 of the chip U10 and the other end of the resistor R10 are all connected to the first VDD3V3.

8. The arrhythmia monitoring system according to claim 6, characterized in that: The power module adopts a chip U4 of model AMS1117-3.3V; port 1 of the chip U4 is grounded; port 2 of the chip U4 is respectively connected to the grounding capacitor C7 and port 4 of the chip U4, and serves as the second VDD3V3; port 3 of the chip U4 is respectively connected to the grounding capacitor C6 and one end of the resistor R8; the other end of the resistor R8 is respectively connected to port 3 and port 6 of the switch SW1; port 1, port 2, port 4 and port 5 of the switch SW1 are I-type connections; port 2 of the switch SW1 is respectively connected to the cathode of the diode D3 and the source of the field effect transistor Q1; the drain of the field effect transistor Q1 serves as BAT+; the gate of the field effect transistor Q1 is respectively connected to the anode of the diode D3 and the grounding resistor R7, and serves as VDD-BUS; the second VDD3V3 is connected to the anode of the light-emitting diode D6; the cathode of the light-emitting diode D6 is connected to the grounding resistor R32.