A heart sound signal classification method based on convolution and channel attention mechanism
By using convolution and channel attention mechanisms in heart sound signal classification, and using atrous convolution and depth-separable convolution to learn channel features, the problem of being unable to effectively extract important channel features in the existing technology is solved, and higher classification is achieved. accuracy and lower computational overhead.
Patent Information
- Application Number
- CN202410239673.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-03-04
AI Technical Summary
Existing convolutional neural networks cannot effectively learn features on important channels in heart sound signal classification, resulting in many parameters, complex training, and high overhead.
A heart sound signal classification method based on convolution and channel attention mechanism is adopted, and different channel features are learned through dilated convolution and depth-separable convolution, giving higher weight to important channel features and improving the network's ability to extract features.
It improves the accuracy of abnormal classification of heart sound signals, performs better than traditional convolutional and recurrent neural networks, and improves classification accuracy and F1 score.
Smart Images

Figure CN117995170B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of heart sound signals, and in particular to a heart sound signal classification method based on convolution and channel attention mechanism. Background Art
[0002] Heart sound signals are sounds emitted by the heart, so different states of the heart can be distinguished through heart sound signals, and abnormal classification of heart sound signals can be achieved through deep learning. However, the feature information extracted by the current convolutional neural network cannot focus on learning the features on important channels, but can only treat the features on each channel equally, so there are disadvantages such as numerous parameters, complex training, and high overhead. Summary of the invention
[0003] In order to overcome the deficiencies of the above technologies, the present invention provides a heart sound signal classification method based on convolution and channel attention mechanism, which learns both the global features and the local features of the heart sound signal.
[0004] The technical solution adopted by the present invention to overcome the technical problems is:
[0005] A heart sound signal classification method based on convolution and channel attention mechanism, characterized by comprising the following steps:
[0006] a) obtaining an original heart sound signal X;
[0007] b) Divide the original heart sound signal X into n heart sound segments x1, x2, ..., x i ,...,x n , x i is the i-th heart sound segment, i∈{1,2,...,n}, and the length of each heart sound segment is m seconds;
[0008] c) Extract the i-th heart sound segment x i Mel cepstral coefficients are obtained to obtain the i-th heart sound segment x i Features of x i ′;
[0009] d) establishing a heart sound classification model, which consists of a first CBCAM module, a second CBCAM module, a third CBCAM module, a global average pooling layer, a first Droupout layer, a first Dense layer, a second Droupout layer, a second Dense layer, and a Softmax function;
[0010] e) Translate the i-th heart sound segment x i Features of x i ′ is input into the first CBCAM module of the heart sound classification model, and the heart sound feature X′ is output;
[0011] f) inputting the heart sound feature X′ into the second CBCAM module of the heart sound classification model, and outputting the heart sound feature X″;
[0012] g) inputting the heart sound feature X″ into the third CBCAM module of the heart sound classification model, and outputting the heart sound feature X″′;
[0013] h) The heart sound feature X″′ is sequentially input into the global average pooling layer, the first Dropout layer, the first Dense layer, the second Dropout layer, and the second Dense layer of the heart sound classification model, and the heart sound feature X″″ is output; i) The heart sound feature X″″ is input into the Softmax function of the heart sound classification model, and two probability distributions in the range of 0 to 1 are output. When it is 0, it indicates that the heart sound signal is a normal signal, and when it is 1, it indicates that the heart sound signal is an abnormal signal.
[0014] Furthermore, in step a), the original heart sound signal X is obtained from the Physionet2016 heart sound database.
[0015] Furthermore, in step b), m is set to 2.5, and the heart sound segments less than 2.5 seconds are padded with zeros. Preferably, in step c), the Mel cepstral coefficient dimension is set to 40, and the sampling rate is set to 16000 Hz.
[0016] Further, step e) comprises the following steps:
[0017] e-1) The first CBCAM module of the heart sound classification model consists of a first branch, a second branch, and a third branch; e-2) The first branch of the first CBCAM module consists of an average pooling layer, a first atrous convolution block, a second atrous convolution block, and a third atrous convolution block, which takes the i-th heart sound segment x i Features of x i ′ is input into the average pooling layer of the first branch, and the output is the feature The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a LeakyRelu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information and the i-th heart sound segment x iFeatures of x i ′ performs multiplication operation to obtain the feature e-3) The second branch of the first CBCAM module consists of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a ReLU function, and a BN layer in sequence. The i-th heart sound segment x i Features of x i ′ is input into the first convolutional block and the output is the feature The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature
[0018] e-4) The third branch of the first CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. i Features of x i ′ is input into the maximum pooling layer of the third branch, and the output is the feature The first depth-wise separable convolutional block is composed of a depth-wise separable convolutional layer, a first LeakyRelu function, a first BN layer, a convolutional layer, a second LeakyRelu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information and the i-th heart sound segment x i Features of x i ′ performs multiplication operation to obtain the feature e-5) The characteristics feature feature Perform a concatenation operation to obtain the heart sound feature X′ containing important channel features.
[0019] Preferably, in step e-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step e-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step e-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0020] Further, step f) comprises the following steps:
[0021] f-1) The second CBCAM module of the heart sound classification model consists of a first branch, a second branch, and a third branch; f-2) The first branch of the second CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X′ is input into the average pooling layer of the first branch, and the feature X′ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature f-3) The second branch of the second CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X′ is input into the first convolution block, and the feature X′ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature f-4) The third branch of the second CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X′ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature
[0022] f-5) The characteristics feature feature A splicing operation is performed to obtain the heart sound feature X″. Preferably, in step f-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step f-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step f-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0023] Further, step g) comprises the following steps:
[0024] g-1) The third CBCAM module of the heart sound classification model consists of a first branch, a second branch, and a third branch; g-2) The first branch of the third CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X″ is input into the average pooling layer of the first branch, and the feature X″ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature g-3) The second branch of the third CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X″ is input into the first convolution block, and the feature X″ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature g-4) The third branch of the third CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X″ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature
[0025] g-5) The characteristics feature feature A splicing operation is performed to obtain the heart sound feature X″′. Preferably, in step g-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step g-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step g-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0026] The beneficial effects of the present invention are: through the dilated convolution and the depthwise separable convolution, different channel features are learned, and higher weights are given to important channel features, thereby improving the network's ability to extract features and realizing abnormal classification of heart sound signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Flow chart of the method of the present invention
[0028] Figure 2 is a structural diagram of a CBCAM module of the present invention;
[0029] Figure 3 This is a comparison chart of the effects of the present invention and traditional convolutional and recurrent neural networks. DETAILED DESCRIPTION
[0030] The following is combined with Figure 1 To Attachment Figure 3 The present invention is further described.
[0031] As attached Figure 1 As shown, a heart sound signal classification method based on convolution and channel attention mechanism is characterized by comprising the following steps:
[0032] a) Obtain the original heart sound signal X.
[0033] b) Divide the original heart sound signal X into n heart sound segments x1, x2, ..., x i ,...,x n , x i is the i-th heart sound segment, i∈{1,2,...,n}, and the length of each heart sound segment is m seconds.
[0034] c) Extract the i-th heart sound segment x i Mel cepstral coefficients are obtained to obtain the i-th heart sound segment x i Features of x i ′.
[0035] d) Establish a heart sound classification model, which consists of a first CBCAM module, a second CBCAM module, a third CBCAM module, a global average pooling layer, a first Droupout layer, a first Dense layer, a second Droupout layer, a second Dense layer, and a Softmax function.
[0036] e) Translate the i-th heart sound segment x i The characteristic x′ i It is input into the first CBCAM module of the heart sound classification model and the heart sound feature X′ is output.
[0037] f) Input the heart sound feature X′ into the second CBCAM module of the heart sound classification model, and output the heart sound feature X″.
[0038] g) Input the heart sound feature X″ into the third CBCAM module of the heart sound classification model, and output the heart sound feature X″′.
[0039] h) The heart sound feature X″′ is sequentially input into the global average pooling layer, the first Droupout layer, the first Dense layer, the second Droupout layer, and the second Dense layer of the heart sound classification model, and the heart sound feature X″″ is output. Preferably, the parameter of the first Droupout layer is set to 0.5, the hidden unit of the first Dense layer is set to 512, the parameter of the second Droupout layer is set to 0.5, and the hidden unit of the second Dense layer is set to 2.
[0040] i) The heart sound feature X″″ is input into the Softmax function of the heart sound classification model, and two probability distributions between 0 and 1 are output. When it is 0, it means that the heart sound signal is a normal signal, and when it is 1, it means that the heart sound signal is an abnormal signal.
[0041] As attached Figure 3 As shown in the figure, the accuracy of the heart sound classification method based on convolution and channel attention mechanism of the present invention is slightly higher than that of traditional convolution and recurrent neural networks. The classification accuracy of normal heart sounds of the method in this paper is 0.93. The accuracy of abnormal heart sound classification is 0.83, which is higher than 0.90 and 0.81 of convolutional neural network and 0.91 and 0.81 of recurrent neural network. At the same time, the F1 score reaches 0.9 and 0.8, indicating that the overall effect of the method is good and new progress has been made in accuracy.
[0042] In one embodiment of the present invention, in step a), the original heart sound signal X is obtained from the Physionet2016 heart sound database.
[0043] In one embodiment of the present invention, in step b), the value of m is 2.5, and the heart sound segments less than 2.5 seconds are padded with zeros.
[0044] In one embodiment of the present invention, in step c), the dimension of the Mel-frequency cepstral coefficient is set to 40, and the sampling rate is set to 16000 Hz, then the input feature size of the model is (40, 79).
[0045] As attached Figure 2 As shown, in one embodiment of the present invention, step e) includes the following steps: e-1) the first CBCAM module of the heart sound classification model is composed of a first branch, a second branch, and a third branch. e-2) the first branch of the first CBCAM module is composed of an average pooling layer, a first atrous convolution block, a second atrous convolution block, and a third atrous convolution block, and the i-th heart sound segment x is converted into i Features of x i ′ is input into the average pooling layer of the first branch, and the output is the feature The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information and the i-th heart sound segment x i Features of x i ′ performs multiplication operation to obtain the feature e-3) The second branch of the first CBCAM module consists of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a ReLU function, and a BN layer in sequence. The i-th heart sound segment x i Features of x i ′ is input into the first convolutional block and the output is the feature The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature
[0046] e-4) The third branch of the first CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. i Features of x i ′ is input into the maximum pooling layer of the third branch, and the output is the feature The first depth-wise separable convolutional block is composed of a depth-wise separable convolutional layer, a first LeakyRelu function, a first BN layer, a convolutional layer, a second LeakyRelu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information and the i-th heart sound segment x i Features of x i ′ performs multiplication operation to obtain the feature e-5) The characteristics feature feature The concatenation operation is performed to obtain the heart sound feature X′ containing important channel features. The features after each branch processing are concatenated to form a feature containing channel feature weights, that is, a higher weight is given to important channel features, thereby improving the network's ability to extract features.
[0047] In this embodiment, preferably, in step e-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step e-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step e-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0048] In one embodiment of the present invention, step f) comprises the following steps:
[0049] f-1) The second CBCAM module of the heart sound classification model consists of a first branch, a second branch, and a third branch. f-2) The first branch of the second CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X′ is input into the average pooling layer of the first branch, and the feature X′ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature f-3) The second branch of the second CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X′ is input into the first convolution block, and the feature X′ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature f-4) The third branch of the second CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X′ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature
[0050] f-5) The characteristics feature feature Perform a splicing operation to obtain the heart sound feature X″. In this embodiment, preferably, in step f-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilationrate is set to 5, and the step size is 2, the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilationrate is set to 2, and the step size is 2, and the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilationrate is set to 1, and the step size is 2; in step f-3), the convolution kernel size of the first convolution block The convolution kernel size of the convolution layer is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step f-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0051] In one embodiment of the present invention, step g) comprises the following steps:
[0052] g-1) The third CBCAM module of the heart sound classification model consists of a first branch, a second branch, and a third branch. g-2) The first branch of the third CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X″ is input into the average pooling layer of the first branch, and the feature X″ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature g-3) The second branch of the third CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X″ is input into the first convolution block, and the feature X″ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature g-4) The third branch of the third CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X″ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature
[0053] g-5) The characteristics feature feature Perform a splicing operation to obtain the heart sound feature X″′. In this embodiment, preferably, in step g-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilationrate is set to 5, and the step size is 2, the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilationrate is set to 2, and the step size is 2, and the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilationrate is set to 1, and the step size is 2; in step g-3), the convolution kernel size of the first convolution block The convolution kernel size of the convolution layer is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step g-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
[0054] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A heart sound signal classification method based on convolution and channel attention mechanism, characterized in that: The steps include: a) obtaining an original heart sound signal X; b) Divide the original heart sound signal X into n heart sound segments x1, x2, ..., x i ,...,x n , x i is the i-th heart sound segment, i∈{1,2,...,n}, and the length of each heart sound segment is m seconds; c) Extract the i-th heart sound segment x i Mel cepstral coefficients are obtained to obtain the i-th heart sound segment x i The characteristic x′ i ; d) establishing a heart sound classification model, which consists of a first CBCAM module, a second CBCAM module, a third CBCAM module, a global average pooling layer, a first Droupout layer, a first Dense layer, a second Droupout layer, a second Dense layer, and a Softmax function; e) Translate the i-th heart sound segment x i The characteristic x′ i Input into the first CBCAM module of the heart sound classification model, and output the heart sound feature X′; f) inputting the heart sound feature X′ into the second CBCAM module of the heart sound classification model, and outputting the heart sound feature X″; g) inputting the heart sound feature X″ into the third CBCAM module of the heart sound classification model, and outputting the heart sound feature X″′; h) inputting the heart sound feature X″′ into the global average pooling layer, the first Dropout layer, the first Dense layer, the second Dropout layer, and the second Dense layer of the heart sound classification model in sequence, and outputting the heart sound feature X″″; i) inputting the heart sound feature X″″ into the Softmax function of the heart sound classification model, and outputting two probability distributions between 0 and 1, where 0 indicates that the heart sound signal is a normal signal, and 1 indicates that the heart sound signal is an abnormal signal; Step e) comprises the following steps: e-1) The first CBCAM module of the heart sound classification model is composed of a first branch, a second branch, and a third branch; e-2) The first branch of the first CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The i-th heart sound segment x i The characteristic x′ i Input to the average pooling layer of the first branch, and output the feature The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information and the i-th heart sound segment x i The characteristic x′ i Perform multiplication operation to obtain features e-3) The second branch of the first CBCAM module consists of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a ReLU function, and a BN layer in sequence. The i-th heart sound segment x i The characteristic x′ i Input into the first convolution block and output the feature The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature e-4) The third branch of the first CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. i The characteristic x′ i Input to the maximum pooling layer of the third branch, and output the feature The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information and the i-th heart sound segment x i The characteristic x′ i Perform multiplication operation to obtain features e-5) The characteristics feature feature Perform concatenation operation to obtain the heart sound feature X′ containing important channel features; Step f) comprises the following steps: f-1) The second CBCAM module of the heart sound classification model is composed of a first branch, a second branch, and a third branch; f-2) The first branch of the second CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X′ is input into the average pooling layer of the first branch, and the feature X′ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature f-3) The second branch of the second CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X′ is input into the first convolution block, and the feature X′ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature f-4) The third branch of the second CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X′ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X′ to get the feature f-5) The characteristics feature feature Perform concatenation operation to obtain the heart sound feature X″; Step g) comprises the following steps: g-1) The third CBCAM module of the heart sound classification model is composed of a first branch, a second branch, and a third branch; g-2) The first branch of the third CBCAM module consists of an average pooling layer, a first dilated convolution block, a second dilated convolution block, and a third dilated convolution block. The heart sound feature X″ is input into the average pooling layer of the first branch, and the feature X″ is output. The first dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the first hole convolution block of the first branch, and output the feature The second dilated convolution block is composed of a dilated convolution layer, a leaky Relu function, and a BN layer. Input into the second hole convolution block of the first branch, and output the feature The third hole convolution block is composed of a hole convolution layer, a leaky Relu function, a BN layer, and a sigmoid function. Input into the third hole convolution block, and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature g-3) The second branch of the third CBCAM module is composed of the first convolution block, the second convolution block, and the third convolution block. The first convolution block is composed of a convolution layer, a Relu function, and a BN layer in sequence. The heart sound feature X″ is input into the first convolution block, and the feature X″ is output. The second convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the second convolution block and output the feature The third convolutional block is composed of convolutional layer, Relu function, and BN layer in sequence. Input into the third convolution block and output the feature g-4) The third branch of the third CBCAM module consists of a maximum pooling layer, a first depth-separable convolution block, a second depth-separable convolution block, and a sigmoid function. The heart sound feature X″ is input into the maximum pooling layer of the third branch, and the feature is output. The first depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the first depth separable convolution, output feature The second depth-wise separable convolution block is composed of a depth-wise separable convolution layer, a first Leaky Relu function, a first BN layer, a convolution layer, a second Leaky Relu function, and a second BN layer. Input into the second depth separable convolution, and output the feature The characteristics Input into the sigmoid function of the third branch and output the weight information Weight information Multiply it with the heart sound feature X″ to get the feature g-5) The characteristics feature feature Perform concatenation operation to obtain the heart sound feature X″′.
2. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step a), the original heart sound signal X is obtained from the Physionet2016 heart sound database.
3. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step b), the value of m is 2.5, and the heart sound segments less than 2.5 seconds are padded with zeros.
4. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step c), the Mel cepstral coefficient dimension is set to 40 and the sampling rate is set to 16000 Hz.
5. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step e-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step e-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step e-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
6. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step f-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step f-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step f-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
7. The heart sound signal classification method based on convolution and channel attention mechanism according to claim 1, characterized in that: In step g-2), the convolution kernel size of the dilated convolution layer of the first dilated convolution block is 3×3, the dilation rate is set to 5, and the step size is 2; the convolution kernel size of the dilated convolution layer of the second dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2; the convolution kernel size of the dilated convolution layer of the third dilated convolution block is 3×3, the dilation rate is set to 2, and the step size is 2. rate is set to 1 and the step size is 2; in step g-3), the convolution kernel size of the convolution layer of the first convolution block is 1×1 and the step size is 2, the convolution kernel size of the convolution layer of the second convolution block is 3×3 and the step size is 2, and the convolution kernel size of the convolution layer of the third convolution block is 1×1 and the step size is 1; in step g-4), the convolution kernel size of the depthwise separable convolution layer of the first depthwise separable convolution block is 3×3, the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1, the convolution kernel size of the depthwise separable convolution layer of the second depthwise separable convolution block is 3×3, and the convolution kernel size of the convolution layer of the first depthwise separable convolution block is 1×1.
