# US 2025/0152072 A1 · Few-shot electrocardiogram (ecg) signal classification method based on improved siamese network

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0152072 A1
- Document ID: US20250152072A1
- Status: Published application
- Kind: A1
- Application number: 18/739,383
- Filed: 2024-06-11
- Published: 2025-05-15
- Earliest claimed: 2023-11-13
- Assignees: Qilu University of Technology (Shandong Academy of Sciences); Shandong Computer Science Center (National Supercomputing Center In Jinan)
- Applicants: Qilu University of Technology (Shandong Academy of Sciences); Shandong Computer Science Center (National Supercomputing Center In Jinan)
- Inventors: Yinglong WANG; Mengyu SUN; Minglei SHU; Shuwang ZHOU; Pengyao XU; Zhaoyang LIU
- Web page: https://patentgrep.com/patent/US20250152072A1

## CPC

- A61B 5/349: Detecting specific parameters of the electrocardiograph cycle
- A61B 5/308: for electrocardiography [ECG]
- A61B 5/346: Analysis of electrocardiograms
- A61B 5/7203: {for noise prevention, reduction or removal}
- A61B 5/7264: {Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems}
- A61B 5/7267: {involving training the classification device}
- G16H 50/20: for computer-aided diagnosis, e.g. based on medical expert systems
- G16H 50/70: for mining of medical data, e.g. analysing previous cases of other patients
- A61B: DIAGNOSIS; SURGERY; IDENTIFICATION (usefulness limited to only animals A61D)
- G16H: HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA

## Abstract

A few-shot electrocardiogram (ECG) signal classification method based on an improved Siamese network is provided. The method constructs a CMP module as a sub-network of a Siamese network, and combines extracted local and global features to better analyze peak information such as position, amplitude, and offset, making a transformed feature vector more robust. In this way, the method improves the accuracy and stability of few-shot ECG signal classification.

## Claims

### Claim 1

A few-shot electrocardiogram (ECG) signal classification method based on an improved Siamese network, comprising the following steps:
a) acquiring n original ECG signals to form an original ECG signal set D, D={(x1, y1), (x2, y2), . . . , (xi, yi), . . . , (xn, yn)}, wherein xi denotes an i-th original ECG signal, and yi denotes a class label corresponding to the i-th original ECG signal xi, i∈{1, . . . , n};
b) preprocessing the original ECG signal set D to remove noise in the n original ECG signals, thereby acquiring a clean ECG signal set D′, D′={(x′1, y1), (x′2, y2), . . . , (x′i, yi), . . . , (x′n, yn)}, wherein x′i denotes an i-th clean ECG signal;
c) normalizing the i-th clean ECG signal x′i to acquire a normalized ECG signal x″i; and performing zero-padding in an end of a sequence of the normalized ECG signal x″i if a length of the sequence of the normalized ECG signal x″i is less than Lmax, wherein the length of the sequence of the normalized ECG signal x″i is equal to Lmax, and a normalized ECG signal set D″ is acquired, D″={(x″1, y1), (x″2, y2), . . . , (x″i, yi), . . . , (x″i, yi)};
d) creating a sample pair set P based on the normalized ECG signal set D″,
P
=
{
(
(
x
1
″
,
x
2
″
)
,
Y
′
)
,
(
(
x
2
″
,
x
3
″
)
,
Y
′
)
,
…
,
(
(
x
i
-
1
″
,
x
i
″
)
,
Y
′
)
,
(
(
x
i
″
,
x
i
+
1
″
)
,
Y
′
)
,
…
,
(
(
x
n
-
2
″
,
x
n
-
1
″
)
,
Y
′
)
,
(
(
x
n
-
1
″
,
x
n
″
)
,
Y
′
)
}
,
wherein
Y
′
=
{
1
y
i
-
1
=
y
i
0
y
i
-
1
≠
y
i
;
yi−1 denotes a class label corresponding to an (i−1)-th original ECG signal xi−1; and there are M sample pairs in the sample pair set P,
M
=
n
×
(
n
-
1
)
2
;
e) constructing a few-shot classification model, and inputting a sample pair ((x′i, x′i+1), Y′) from the sample pair set P into the few-shot classification model to acquire a similarity score Ew(x″i, x″i+1);
f) training, by an adaptive moment estimation (Adam) optimizer, the few-shot classification model through a loss function L to acquire an optimized few-shot classification model;
g) randomly sampling K ECG signals from each of N classes in a Massachusetts Institute of Technology-Beth Israel Hospital (MIT-BIH) dataset to form a support set ssupport, ssupport={(s1, a1), (s2, a2), . . . , (si, ai), . . . , (sNK, aNK)}, wherein S; denotes an i-th ECG signal, and ai denotes a class label corresponding to the i-th ECG signal si, i∈{1, . . . , NK};
h) randomly sampling Q ECG signals from each of the N classes in the MIT-BIH dataset to form a set squery, squery={(q1, b1), (q2, b2), . . . , (qi, bi), . . . , (qNQ, bNQ)}, wherein qi denotes an i-th ECG signal, and bi denotes a class label corresponding to the i-th ECG signal qi, i∈{1, . . . , NQ};
i) replacing the i-th original ECG signal xi with the i-th ECG signal si, and repeating the steps b) and c) to acquire an i-th normalized ECG signal s″i, wherein a normalized support set s″support is acquired, s″support={(s″1, a1), (s″2, a2), . . . , (s″i, ai), . . . , (s″NK, aNK)}; and replacing the i-th original ECG signal xi with the i-th ECG signal qi, and repeating the steps b) and c) to acquire an i-th normalized ECG signal q″i, a normalized query set s″query is acquired, s′query={(q″1, b1), (q″2, b2), . . . , (a″i, bi), . . . , (q″NQ, bNQ)}; and
j) inputting the i-th normalized ECG signal s″i and the i-th normalized ECG signal q″i into the optimized few-shot classification model to acquire a classification result.

### Claim 2 (depends on 1)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 1, wherein the step a) comprises: acquiring the n original ECG signals from a University of California Riverside (UCR) dataset.

### Claim 3 (depends on 1)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 1, wherein the step b) comprises: denoising, by a first median filter and a second median filter in sequence, the i-th original ECG signal xi to acquire the i-th clean ECG signal x′i.

### Claim 4 (depends on 3)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 3, wherein the first median filter has a width of 300 ms, and the second median filter has a width of 600 ms.

### Claim 5 (depends on 1)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 1, wherein Lmax=187.

### Claim 6 (depends on 1)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 1, wherein the step e) comprises:
e-1) constructing the few-shot classification model, comprising an embedding module and a metric module;
e-2) constructing the embedding module of the few-shot classification model, wherein the embedding module comprises a Siamese network formed by a first CMP module and a second CMP module; the first CMP module comprises a convolutional layer, a first rectified linear unit (ReLU) activation function layer, a primary capsule layer of a capsule network, a digital capsule layer of the capsule network, a first fully connected layer, a second ReLU activation function layer, and a second fully connected layer; and the second CMP module comprises a convolutional layer, a first ReLU activation function layer, a primary capsule layer of a capsule network, a digital capsule layer of the capsule network, a first fully connected layer, a second ReLU activation function layer, and a second fully connected layer;
e-3) inputting the i-th normalized ECG signal x″i into the convolutional layer and the first ReLU activation function layer of the first CMP module in sequence to acquire a feature f11; inputting the feature f11 into the primary capsule layer of the capsule network in the first CMP module to acquire a vector f12; inputting the vector f12 into the digital capsule layer of the capsule network in the first CMP module to acquire a feature f13; inputting the feature f13 into the first fully connected layer and the second ReLU activation function layer of the first CMP module in sequence to acquire a feature f14; and inputting the feature f14 into the second fully connected layer of the first CMP module to acquire a feature f(x″i);
e-4) inputting an (i+1)-th normalized ECG signal x″i+1 into the convolutional layer and the first ReLU activation function layer of the first CMP module in sequence to acquire a feature f21; inputting the feature f21 into the primary capsule layer of the capsule network in the first CMP module to acquire a vector f22; inputting the vector f22 into the digital capsule layer of the capsule network in the first CMP module to acquire a feature inputting the feature f23 into the first fully connected layer and the second ReLU activation function layer of the first CMP module in sequence to acquire a feature f24; and inputting the feature f24 into the second fully connected layer of the first CMP module to acquire a feature f(x″i+1); and
e-5) inputting the feature f(x″i) and the feature f(x″i+1) into the metric module of the few-shot classification model, and calculating the similarity score Ew(x″1, x″i+1) by Ew(x″i, x″i+1)=∥f(x″i)−f(x″i+1)∥, wherein ∥●∥ denotes a Euclidean distance (ED) calculation.

### Claim 7 (depends on 6)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 6, wherein in the step e-2), the convolutional layer of the first CMP module comprises a 3×3 convolution kernel, and the convolutional layer of the second CMP module comprises a 3×3 convolution kernel.

### Claim 8 (depends on 1)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 1, wherein the step f) comprises: calculating the loss function L by, L=L1+αL2, wherein
L
1
=
Y
′
⁢
1
2
⁢
(
E
w
(
x
i
″
,
x
i
+
1
″
)
)
2
+
(
1
-
Y
′
)
⁢
{
max
⁡
(
0
,
m
-
E
w
(
x
i
″
,
x
i
+
1
″
)
)
}
2
;
m denotes a hyperparameter, α denotes a hyperparameter; and L2 denotes a cross entropy loss function.

### Claim 9 (depends on 6)

The few-shot ECG signal classification method based on the improved Siamese network according to claim 6, wherein the step j) comprises:
j-1) inputting the i-th normalized ECG signal s″i of a u-th class into the convolutional layer and the first ReLU activation function layer of the first CMP module in sequence to acquire a feature f31, u∈{1, . . . , N}; inputting the feature f31 into the primary capsule layer of the capsule network in the first CMP module to acquire a vector f32; inputting the vector f32 into the primary capsule layer of the capsule network in the first CMP module to acquire a feature f33; inputting the feature f33 into the first fully connected layer and the second ReLU activation function layer of the first CMP module in sequence to acquire a feature f34; inputting the feature f34 into the second fully connected layer of the first CMP module to acquire a feature f(s″i)u; and calculating, by a mean( ) function in Python, an average of all K features f(s″1)u, f(s″2)u, . . . , f(s″i)u, . . . , f(s″K)u, of the u-th class to acquire a feature vector μu;
j-2) inputting the i-th normalized ECG signal q″i into the convolutional layer and the first ReLU activation function layer of the first CMP module in sequence to acquire a feature f41; inputting the feature f41 into the primary capsule layer of the capsule network in the first CMP module to acquire a vector f42; inputting the vector f42 into the primary capsule layer of the capsule network in the first CMP module to acquire a feature f43; inputting the feature f43 into the first fully connected layer and the second ReLU activation function layer of the first CMP module in sequence to acquire a feature f44; and inputting the feature f44 into the second fully connected layer of the first CMP module to acquire a feature f(q″i);
j-3) inputting the feature vector μu and the feature f(q″i) into the metric module of the few-shot classification model, and calculating the similarity score Ew(μu, f(q″i)) by Ew(μu, f(q″i))=∥μu−f(q″i)∥; and
j-4) calculating a class label ŷi of the i-th normalized ECG signal q″i by {right arrow over (y)}i=arg max {Ew(μ1, f(q″i)), Ew(μ2, f(q″i)), . . . , Ew(μu, f(q″i)), . . . , Ew(μN, f(q″i))}, and combining class labels of all NQ normalized ECG signals to form the classification result.
