ECG open-set identity recognition method and device based on multi-branch attention

Through the ECG open-set identity recognition method based on multi-branch attention, the problem of insufficient feature extraction and difficulty in distinguishing new signals in ECG identity recognition technology is solved, and the accuracy of ECG identity recognition and open-set identification is improved.

CN119226716APending Publication Date: 2024-12-31ZHUHAI COLLEGE OF JILIN UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411070985.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing ECG identity recognition technology cannot guarantee the accuracy of ECG identity recognition and the accuracy of open set recognition due to insufficient extraction of the ECG signal characteristics to be detected and the inability to accurately distinguish and reject newly added ECG signals.

Method used

Using the ECG open set identity recognition method based on multi-branch attention, wavelet denoising, R-wave detection and positioning and heart beat segmentation processing are obtained, the training set and test set are divided, and the initial multi-branch attention feature fusion network is trained. , the open set identification threshold is calculated using the target multi-branch attention feature fusion network, and the identity identification result is determined based on the sample category probability and threshold.

Benefits of technology

The accuracy of ECG identity recognition and open set recognition is effectively improved. By fully extracting ECG data features, the accuracy of identity recognition and the reliability of open set recognition are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226716A_ABST
    Figure CN119226716A_ABST
Patent Text Reader

Abstract

The invention discloses an ECG open set identity recognition method and device based on multi-branch attention, and the method comprises the steps: dividing target cardiac beat data after data preprocessing into a first data set and a second data set which are the same in data size, taking the first data set as a training set training model, and taking the second data set as a training set training model; obtaining a target multi-branch attention feature fusion network; dividing the second data set into a verification set and a test set; inputting the verification set into the target multi-branch attention feature fusion network to obtain an open set recognition threshold; inputting each piece of first cardiac beat data of the test set into the target multi-branch attention feature fusion network to obtain a plurality of sample category probabilities corresponding to each piece of first cardiac beat data; and determining an open set identity recognition result of each piece of first cardiac beat data based on each sample category probability and an open set recognition threshold. The ECG data features are fully extracted through the target multi-branch attention feature fusion network, and the accuracy of identity recognition and open set recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to the field of data processing technology, and in particular to an ECG open-set identity recognition method and device based on multi-branch attention. Background Art

[0002] With the rapid development and progress of information technology, the application of individual identity recognition technology is becoming more and more extensive. Traditional identity authentication methods (such as passwords and PIN codes) are prone to being cracked or imitated, which has promoted the development of biometric recognition technology. For example, the use of biological signals (such as electrocardiogram (ECG)) for identity authentication has attracted widespread attention and research due to its high uniqueness and difficulty in forging.

[0003] However, the existing ECG identity recognition technology does not fully extract the features of the ECG signal to be detected, and cannot accurately distinguish and reject the newly added ECG signal, resulting in the inability to guarantee the accuracy of ECG identity recognition and open set recognition. Summary of the invention

[0004] The embodiment of the present application provides an ECG identity recognition method based on multi-branch attention, which can effectively improve the ECG identity recognition accuracy and open set recognition accuracy.

[0005] In a first aspect, an embodiment of the present application provides an ECG open set identity recognition method based on multi-branch attention, comprising:

[0006] Acquire an ECG data set, and sequentially perform wavelet denoising, R-wave detection and positioning, and heartbeat segmentation processing on each ECG data in the ECG data set to obtain target heartbeat data;

[0007] Dividing all the target heartbeat data into a first data set and a second data set, using the first data set as a training set, and training an initial multi-branch attention feature fusion network based on the training set to obtain a target multi-branch attention feature fusion network, wherein the first data set and the second data set include the same amount of data;

[0008] Divide the second data set into a validation set and a test set;

[0009] Inputting the verification set into the target multi-branch attention feature fusion network, and calculating the open set recognition threshold;

[0010] Input each first heartbeat data in the test set into the target multi-branch attention feature fusion network to obtain multiple sample category probabilities corresponding to each first heartbeat data;

[0011] An open set identification result of each of the first heartbeat data is determined based on each of the sample category probabilities and the open set identification threshold.

[0012] In some embodiments, the step of sequentially performing wavelet denoising, R-wave detection and positioning, and heartbeat segmentation processing on each ECG data in the ECG data set to obtain target heartbeat data includes:

[0013] Performing wavelet decomposition on each of the ECG data using a DB8 wavelet function to obtain a plurality of first wavelet coefficients, wherein the scales of the first wavelet coefficients are different from each other;

[0014] Performing threshold processing on each of the first wavelet coefficients to obtain each of the second wavelet coefficients;

[0015] Reconstructing the second wavelet coefficients to obtain a denoised intermediate ECG data sequence;

[0016] Determine the R wave peak point of the intermediate ECG data sequence based on the Hamilton segmentation algorithm, and obtain the single heart beat data of the preset length in the intermediate ECG data sequence based on the R wave peak point;

[0017] The single heartbeat data is normalized to obtain the target heartbeat data.

[0018] In some embodiments, the training set includes multiple training samples, the initial multi-branch attention feature fusion network includes a convolution block, a global feature extraction module, a local feature extraction module, an attention feature fusion module, a fully connected layer and an OpenMax module, and the initial multi-branch attention feature fusion network is trained based on the training set to obtain a target multi-branch attention feature fusion network, including:

[0019] Inputting all the training samples into the convolution block for convolution processing to obtain first intermediate feature data;

[0020] Inputting all the training samples into the global feature extraction module to obtain global feature data;

[0021] Inputting all the training samples into the local feature extraction module to obtain local feature data;

[0022] Inputting the global feature data, the local feature data and the first intermediate feature data into the attention feature fusion module for feature fusion processing to obtain second intermediate feature data;

[0023] Inputting the second intermediate feature data into the fully connected layer to obtain a category score of each of the training samples, where different category scores correspond to different sample categories;

[0024] Inputting all of the category scores into the OpenMax module to calculate the activation vector of each of the training samples and the average activation vector of each of the sample categories, and calculating the Euclidean distance from each of the activation vectors to the average activation vector;

[0025] The initial multi-branch attention feature fusion network is iteratively trained based on all the Euclidean distances and a preset fitting criterion to obtain the target multi-branch attention feature fusion network, wherein the fitting criterion is that the Euclidean distance satisfies the Weibull distribution.

[0026] In some embodiments, the second data set includes a plurality of sub-data sets, each of which corresponds to a different sample category, and the second data set is divided into a validation set and a test set, including:

[0027] Acquire a first set from each of the sub-data sets, and take the average value of the heartbeat data in each of the first sets to obtain a heartbeat template value, wherein the data volume of the first set is half of the data volume of the corresponding sub-data set;

[0028] Combining each of the heartbeat template values ​​with the corresponding heartbeat data in the sub-data set except the first set to obtain a positive sample pair set;

[0029] Combining each of the heartbeat template values ​​with the corresponding heartbeat data of the second set to obtain a negative sample pair set, wherein the sample category corresponding to all the heartbeat data in the second set is different from the sample category corresponding to the heartbeat template value, and the difference between the number of heartbeat data in the positive sample pair set and the number of heartbeat data in the negative sample pair set is less than a preset threshold;

[0030] Randomly shuffle the heartbeat data in the positive sample pair set and the heartbeat data in the negative sample pair set to obtain a third set;

[0031] The third set is divided into the validation set and the test set, wherein the data amount of the validation set is the same as the data amount of the test set.

[0032] In some embodiments, the single heartbeat data is normalized to obtain the target heartbeat data according to the following formula:

[0033]

[0034] Among them, x0 is the single heartbeat data, and x~ is the target heartbeat data.

[0035] In some embodiments, the global feature extraction module includes a first residual structure and multiple dilated convolutional layers, and the dilated convolution receptive field of the dilated convolutional layer is obtained according to the following formula:

[0036]

[0037] Among them, RF 1+1 is the receptive field size corresponding to the feature data of the current hole convolution layer, RF l is the receptive field size corresponding to the feature data of the previous hole convolution layer, f l+1 is the convolution kernel size of the current hole convolution layer, S i is the stride product of the dilated convolution layer connected before the current dilated convolution layer, and l is the number of dilated convolution layers connected before the current dilated convolution layer.

[0038] In some embodiments, the global feature data, the local feature data and the first intermediate feature data are input into the attention feature fusion module for feature fusion processing to obtain second intermediate feature data, including:

[0039] splicing the global feature data, the local feature data and the first intermediate feature data to obtain third intermediate feature data;

[0040] Inputting the global feature data and the local feature data into the attention feature fusion module to obtain fourth intermediate feature data;

[0041] The third intermediate feature data and the fourth intermediate feature data are fused and concatenated to obtain the second intermediate feature data.

[0042] In some embodiments, the attention feature fusion module includes a squeeze excitation network and a spatial attention module, and the global feature data and the local feature data are input into the attention feature fusion module to obtain fourth intermediate feature data, including:

[0043] Inputting the global feature data and the local feature data into the extrusion excitation network, and weighting the output data to obtain fifth intermediate feature data;

[0044] Inputting the global feature data and the local feature data into the spatial attention module, and weighting the output data to obtain sixth intermediate feature data;

[0045] The fifth intermediate feature data, the sixth intermediate feature data and the seventh intermediate feature data are concatenated to obtain the fourth intermediate feature data, wherein the seventh intermediate feature data is obtained by processing the global feature data, the local feature data and the first intermediate feature data through a convolution layer and a RELU layer.

[0046] In some embodiments, the global feature data and the local feature data are input into the squeeze excitation network, and the output data are weighted to obtain fifth intermediate feature data, which is obtained according to the following formula:

[0047]

[0048] in, is the fifth intermediate feature data, and the fifth intermediate feature data is used to indicate the feature data of the cth channel after reweighting, s c is the weight of the cth channel, u c u is the cth channel of the global feature data and the local feature data, both of which are feature maps; c According to the following formula:

[0049]

[0050] Among them, H and W are the height and width of the feature map respectively, z c is the global average pooling result of the cth channel.

[0051] In a second aspect, an embodiment of the present application provides an electronic device comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the ECG open-set identity recognition method based on multi-branch attention as described in the first aspect.

[0052] An embodiment of the present application provides an ECG open-set identity recognition method and device based on multi-branch attention, wherein the method includes: obtaining an ECG data set, performing wavelet denoising, R-wave detection and positioning, and heart beat segmentation processing on each ECG data in the ECG data set in turn to obtain target heart beat data; dividing all of the target heart beat data into a first data set and a second data set, using the first data set as a training set, and training an initial multi-branch attention feature fusion network based on the training set to obtain a target multi-branch attention feature fusion network, wherein the first data set and the second data set include the same amount of data; dividing the second data set into a validation set and a test set; inputting the validation set into the target multi-branch attention feature fusion network to calculate an open-set recognition threshold; inputting each first heart beat data in the test set into the target multi-branch attention feature fusion network to obtain multiple sample category probabilities corresponding to each first heart beat data; determining the open-set identity recognition result of each first heart beat data based on each of the sample category probabilities and the open-set recognition threshold. According to the solution provided in the embodiment of the present application, the ECG data features are fully extracted through the target multi-branch attention feature fusion network and the accuracy of identity recognition and open set recognition is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a flowchart of the steps of an ECG open set identity recognition method based on multi-branch attention provided by an embodiment of the present application;

[0054] Figure 2 is a network structure diagram of an initial multi-branch attention feature fusion network provided by another embodiment of the present application;

[0055] Figure 3 It is a structural diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0057] It is understood that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flow chart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0058] First, the terms involved in one or more embodiments of the present application are explained:

[0059] (1) ECG signal, also known as electrocardiogram signal, is a bioelectric signal generated by the electrical activity of the heart, which records the contraction and relaxation process of the heart. Each person's ECG signal has unique patterns and characteristics, such as heartbeat intervals, QRS waveforms, etc. With the advancement of sensor technology, the collection of ECG signals has become more accurate and convenient. Signal processing techniques include filtering, denoising, and feature extraction to extract information that can characterize the identity characteristics of an individual.

[0060] (2) ECG signal open set recognition refers to the process of analyzing and recognizing ECG signals, which not only recognizes known categories (such as normal and various heart disease categories), but also detects and rejects samples of unknown categories. This method is very important in the medical field because it can help identify new or unseen cardiac abnormalities, thereby improving the accuracy and reliability of diagnosis.

[0061] With the rapid development and progress of information technology, the application of individual identity recognition technology is becoming more and more extensive. Traditional identity authentication methods (such as passwords and PIN codes) are prone to being cracked or imitated, which has promoted the development of biometric recognition technology. For example, the use of biological signals (such as electrocardiogram (ECG)) for identity authentication has attracted widespread attention and research due to its high uniqueness and difficulty in forging.

[0062] The following is an explanation of the terms involved in the application documents.

[0063] However, the existing ECG identity recognition technology does not fully extract the features of the ECG signal to be detected, and cannot accurately distinguish and reject the newly added ECG signal, resulting in the inability to guarantee the accuracy of ECG identity recognition and open set recognition.

[0064] To solve the above-mentioned problems, an embodiment of the present application provides an ECG open-set identity recognition method and device based on multi-branch attention, wherein the method includes: obtaining an ECG data set, and performing wavelet denoising, R-wave detection and positioning, and heart beat segmentation processing on each ECG data in the ECG data set in turn to obtain target heart beat data; dividing all of the target heart beat data into a first data set and a second data set, using the first data set as a training set, and training an initial multi-branch attention feature fusion network based on the training set to obtain a target multi-branch attention feature fusion network, wherein the first data set and the second data set include the same amount of data; dividing the second data set into a validation set and a test set; inputting the validation set into the target multi-branch attention feature fusion network to calculate an open-set recognition threshold; inputting each first heart beat data in the test set into the target multi-branch attention feature fusion network to obtain multiple sample category probabilities corresponding to each first heart beat data; determining the open-set identity recognition result of each first heart beat data based on each of the sample category probabilities and the open-set recognition threshold. According to the solution provided in the embodiment of the present application, the ECG data features are fully extracted through the target multi-branch attention feature fusion network and the accuracy of identity recognition and open set recognition is improved.

[0065] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0066] refer to Figure 1 , Figure 1 Yes, the embodiment of the present application provides an ECG open set identity recognition method based on multi-branch attention, which includes but is not limited to the following steps:

[0067] Step S10, obtaining an ECG data set, and sequentially performing wavelet denoising, R wave detection and positioning, and heart beat segmentation processing on each ECG data in the ECG data set to obtain target heart beat data;

[0068] Step S20, dividing all target heartbeat data into a first data set and a second data set, using the first data set as a training set, and training the initial multi-branch attention feature fusion network based on the training set to obtain a target multi-branch attention feature fusion network, wherein the first data set and the second data set include the same amount of data;

[0069] Step S30, dividing the second data set into a verification set and a test set;

[0070] Step S40, inputting the verification set into the target multi-branch attention feature fusion network, and calculating the open set recognition threshold;

[0071] Step S50, inputting each first heartbeat data in the test set into the target multi-branch attention feature fusion network to obtain multiple sample category probabilities corresponding to each first heartbeat data;

[0072] Step S60 , determining an open set identity recognition result of each first heart beat data based on each sample category probability and an open set recognition threshold.

[0073] Specifically, the ECG data set of this embodiment includes multiple ECG data, which are used to train the initial multi-branch attention feature fusion network and verify and test the recognition accuracy of the trained model.

[0074] It is understandable that in order to better ensure the quality of the training results of the initial multi-branch attention feature fusion network, as well as the subsequent identity recognition accuracy of the trained target multi-branch attention feature fusion network, it is necessary to perform data preprocessing on each ECG data in the ECG data set to remove abnormal noise and other useless information in the ECG data. The preprocessing method of this embodiment is to perform wavelet denoising, R-wave detection and positioning, and heart beat segmentation processing on each ECG data in turn to obtain target heart beat data.

[0075] Specifically, in some embodiments, Figure 1 In step S10, each ECG data in the ECG data set is subjected to wavelet denoising, R wave detection and positioning, and heart beat segmentation processing in sequence to obtain target heart beat data, including but not limited to the following steps:

[0076] Step S11, performing wavelet decomposition on each ECG data using a DB8 wavelet function to obtain a plurality of first wavelet coefficients, wherein the scales of the first wavelet coefficients are different from each other;

[0077] Step S12, performing threshold processing on each first wavelet coefficient to obtain each second wavelet coefficient;

[0078] Step S13, reconstructing the second wavelet coefficients to obtain a denoised intermediate ECG data sequence;

[0079] Step S14, determining the R wave peak point of the intermediate ECG data sequence based on the Hamilton segmentation algorithm, and acquiring single heart beat data of a preset length in the intermediate ECG data sequence based on the R wave peak point;

[0080] Step S15, normalizing the single heartbeat data to obtain target heartbeat data.

[0081] It should be noted that the length of the single heart beat data obtained based on the R wave peak point in this embodiment can be 300 points, which can be determined by those skilled in the art according to actual needs and is not limited here.

[0082] Specifically, in the embodiment of the present application, the single heartbeat data is normalized to obtain the target heartbeat data according to the following formula:

[0083]

[0084] Among them, x0 is single heart beat data, The target heartbeat data.

[0085] It is understandable that due to the different sampling frequencies, storage methods, etc. of source data in different databases, different methods are used to sample and read the data, and the obtained data will contain a large amount of noise, such as power frequency interference, electromyographic interference, and baseline drift. By adopting the wavelet denoising method, this embodiment selects DB8 wavelet to perform wavelet decomposition on the ECG signal to obtain the first wavelet coefficients of different scales, and threshold processing is performed on the wavelet coefficients of each first wavelet scale to obtain the second wavelet coefficients. The second wavelet coefficients are reconstructed to obtain the denoised intermediate ECG data sequence; the Hamilton segmentation algorithm is used to locate the R wave peak point of the intermediate ECG data sequence, and a single heartbeat data with a length of 300 points is taken at the R wave peak point. Finally, the segmented heartbeat is subjected to the following Min-Max normalization function to obtain the final heartbeat data, thereby better ensuring the quality of the training results of the initial multi-branch attention feature fusion network and the subsequent identity recognition accuracy of the trained target multi-branch attention feature fusion network.

[0086] In addition, in some embodiments, the training set includes multiple training samples, the initial multi-branch attention feature fusion network includes a convolution block, a global feature extraction module, a local feature extraction module, an attention feature fusion module, a fully connected layer and an OpenMax module, Figure 1 Step S20 includes but is not limited to the following steps:

[0087] Step S21, inputting all training samples into the convolution block for convolution processing to obtain first intermediate feature data;

[0088] Step S22, inputting all training samples into a global feature extraction module to obtain global feature data;

[0089] Step S23, inputting all training samples into a local feature extraction module to obtain local feature data;

[0090] Step S24, inputting the global feature data, the local feature data and the first intermediate feature data into the attention feature fusion module for feature fusion processing to obtain second intermediate feature data;

[0091] Step S25, inputting the second intermediate feature data into the fully connected layer to obtain the category score of each training sample, where different category scores correspond to different sample categories;

[0092] Step S26, input all the category scores into the OpenMax module to calculate the activation vector of each training sample and the average activation vector of each sample category, and calculate the Euclidean distance from each activation vector to the average activation vector;

[0093] Step S27, iteratively train the initial multi-branch attention feature fusion network based on all Euclidean distances and a preset fitting criterion to obtain a target multi-branch attention feature fusion network, wherein the fitting criterion is that the Euclidean distance satisfies the Weibull distribution.

[0094] It should be noted that the global feature extraction module of the embodiment of the present application includes a first residual structure and multiple dilated convolution layers, and the dilated convolution receptive field of the dilated convolution layer is obtained according to the following formula:

[0095]

[0096] Among them, RF 1+1 is the receptive field size corresponding to the feature data of the current hole convolution layer, RF l is the receptive field size corresponding to the feature data of the previous hole convolution layer, f l+1 is the convolution kernel size of the current hole convolution layer, S i is the stride product of the dilated convolution layer connected before the current dilated convolution layer, and l is the number of dilated convolution layers connected before the current dilated convolution layer.

[0097] Specifically, the local feature extraction module of this embodiment includes a first convolution module, a first RELU module, a second convolution module and a second RELU module connected in sequence, wherein the convolution kernels of the first convolution module and the second convolution module can be 1×3, and no further restrictions are made here.

[0098] Specifically, the embodiments of the present application do not limit the specific number of global feature extraction modules, local feature extraction modules, attention feature fusion modules, and fully connected layers in the initial multi-branch attention feature fusion network. Figure 2 As shown, it includes 3 sequentially connected global feature extraction modules, 3 sequentially connected local feature extraction modules, 3 sequentially connected attention feature fusion modules, and 2 sequentially connected fully connected layers, which can be determined by technical personnel in this field according to actual conditions.

[0099] Specifically, in the embodiment of the present application, the step of inputting the global feature data, the local feature data and the first intermediate feature data into the attention feature fusion module for feature fusion processing to obtain the second intermediate feature data, and step S24 include but are not limited to the following steps:

[0100] Step S241, concatenating the global feature data, the local feature data and the first intermediate feature data to obtain third intermediate feature data;

[0101] Step S242, inputting the global feature data and the local feature data into an attention feature fusion module to obtain fourth intermediate feature data;

[0102] Step S243, fusing and concatenating the third intermediate feature data and the fourth intermediate feature data to obtain second intermediate feature data.

[0103] It can be understood that, before inputting the feature data into the attention feature fusion module, this embodiment concatenates the global feature data, the local feature data and the first intermediate feature data to obtain the third intermediate feature data, and then inputs the global feature data and the local feature data into the attention feature fusion module to obtain the fourth intermediate feature data; the third intermediate feature data and the fourth intermediate feature data are fused and concatenated to obtain the second intermediate feature data, which provides an effective data basis for the subsequent steps of inputting into the fully connected layer and the Softmax classifier in the OpenMax module to calculate the identity recognition result.

[0104] Specifically, the attention feature fusion module of the present embodiment is a channel-space fused attention (CAFA) module, which has two branches. The first branch is a squeeze-and-excitation network (SENet), and the second branch is a spatial attention (SAM) module for information enhancement integration in the spatial dimension. The embodiment of the present application inputs the global feature data and the local feature data into the attention feature fusion module to obtain the fourth intermediate feature data, that is, step S242, including but not limited to the following steps:

[0105] Step S2421, inputting the global feature data and the local feature data into the squeeze excitation network, and weighting the output data to obtain fifth intermediate feature data;

[0106] Step S2422, inputting the global feature data and the local feature data into the spatial attention module, and weighting the output data to obtain sixth intermediate feature data;

[0107] Step S2423, concatenate the fifth intermediate feature data, the sixth intermediate feature data and the seventh intermediate feature data to obtain fourth intermediate feature data, wherein the seventh intermediate feature data is obtained by processing the global feature data, the local feature data and the first intermediate feature data through a convolution layer and a RELU layer.

[0108] It should be noted that the global feature data and the local feature data are input into the squeeze-excitation network, the feature information of the channel dimension is integrated and enhanced, and the output data is weighted to obtain the fifth intermediate feature data. The squeeze and excitation network corresponding attention squeeze operation is obtained according to the following formula:

[0109]

[0110] Among them, H and W are the height and width of the feature map respectively, z c is the global average pooling result of the cth channel;

[0111] The attention excitation process corresponding to the squeeze and excitation network is obtained according to the following formula:

[0112] s=F ex (z,W)=σ(g(z,W))=σ(W2δ(W I z));

[0113] Among them, z is the output of the Squeeze stage, W1 and W2 are the weight matrices of the fully connected layer, σ is the Sigmoid activation function, and δ is the Relu activation function;

[0114] The fifth intermediate characteristic data finally outputted is obtained according to the following formula:

[0115]

[0116] in, is the fifth intermediate feature data, which is used to indicate the feature data of the cth channel after re-weighting, s c is the weight of the cth channel, u c The cth channel of the input global feature data and local feature data, both of which are feature maps.

[0117] It should be noted that after obtaining the sixth intermediate feature data output by the spatial attention module, the fifth intermediate feature data, the sixth intermediate feature data, and the seventh intermediate feature data obtained by processing the global feature data, the local feature data, and the first intermediate feature data through the convolution layer and the RELU layer are concatenated to obtain the fourth intermediate feature data, which is obtained according to the following formula:

[0118] x f =cat(x1,x c ,x s );

[0119] Among them, x f is the fourth intermediate feature data, x c is the fifth intermediate feature data, x s is the sixth intermediate feature data, and x1 is the seventh intermediate feature data.

[0120] It should be noted that all category scores are input into the OpenMax module to calculate the activation vector of each training sample and the average activation vector of each sample category, as well as the Euclidean distance from each activation vector to the average activation vector. The initial multi-branch attention feature fusion network is iteratively trained based on all Euclidean distances and the preset fitting standard to obtain the target multi-branch attention feature fusion network, where the fitting standard is that the Euclidean distance satisfies the Weibull distribution. Specifically, the OpenMax algorithm corresponding to the OpenMax module is used to first input the training samples of each category into the proposed network to obtain their activation vectors, and retain the activation vectors of the correctly classified samples to obtain the set AVi, and use AVi to calculate the average activation vector MAVi of each category, that is, the centroid of each category. The Euclidean distance to the centroid MAVi of each category is calculated using AVi, denoted as Di, and the Weibull distribution is fitted to it.

[0121] Correspondingly, the probability density function of the Weibull distribution is expressed as:

[0122]

[0123] The cumulative distribution function of the Weibull distribution is expressed as:

[0124]

[0125] Among them, x is a continuous random variable, k is a shape parameter, and λ is a scale parameter.

[0126] In summary, it is understandable that reference Figure 2In this embodiment, all training samples are input into the convolution block for convolution processing to obtain the first intermediate feature data; all training samples are input into the global feature extraction module to obtain the global feature data; all training samples are input into the local feature extraction module to obtain the local feature data; the global feature data, the local feature data and the first intermediate feature data are input into the attention feature fusion module for feature fusion processing to obtain the second intermediate feature data; the second intermediate feature data is input into the fully connected layer to obtain the category score of each training sample, and different category scores correspond to different sample categories; so far, each training sample has performed sufficient multi-scale feature extraction, and then all category scores are input into the Ope nMax module, to calculate the activation vector of each training sample and the average activation vector of each sample category, and to calculate the Euclidean distance from each activation vector to the average activation vector; based on all the Euclidean distances and the preset fitting standard, the initial multi-branch attention feature fusion network is iteratively trained to obtain the target multi-branch attention feature fusion network, wherein the fitting standard is that the Euclidean distance satisfies the Weibull distribution, that is, this embodiment uses the Euclidean distance satisfying the Weibull distribution as the fitting standard, and iteratively trains the initial multi-branch attention feature fusion network based on the training samples, thereby continuously correcting the scores of the training samples until the fitting conditions are met, and a trained target multi-branch attention feature fusion network is obtained.

[0127] In addition, in some embodiments, the second data set includes multiple sub-data sets, and the sample categories corresponding to the sub-data sets are different from each other. Figure 1 Step S30 includes but is not limited to the following steps:

[0128] Step S31, obtaining a first set from each sub-data set, taking the average value of the heartbeat data in each first set to obtain a heartbeat template value, wherein the data volume of the first set is half of the data volume of the corresponding sub-data set;

[0129] Step S32, combining each heartbeat template value with the heartbeat data in the corresponding sub-data set except the first set to obtain a positive sample pair set;

[0130] Step S33, combining each heartbeat template value with the corresponding heartbeat data of the second set to obtain a negative sample pair set, wherein the sample categories corresponding to all the heartbeat data in the second set are different from the sample categories corresponding to the heartbeat template value, and the difference between the number of heartbeat data of the positive sample pair set and the number of heartbeat data of the negative sample pair set is less than a preset threshold;

[0131] Step S34, randomly shuffling the heartbeat data in the positive sample pair set and the heartbeat data in the negative sample pair set to obtain a third set;

[0132] Step S35, dividing the third set into a validation set and a test set, wherein the data volume of the validation set is the same as the data volume of the test set.

[0133] Specifically, a sub-data set of the present embodiment corresponds to a sample category. For each sub-data set, half of the heartbeat data (i.e., the first set) are taken and averaged to obtain a heartbeat template value. Each heartbeat template value is combined with the heartbeat data in the corresponding sub-data set except the first set to obtain a positive sample pair set. Each heartbeat template value is combined with the heartbeat data of the corresponding second set to obtain a negative sample pair set. The sample category corresponding to all the heartbeat data in the second set is different from the sample category corresponding to the heartbeat template value, thereby avoiding sample data imbalance. The difference between the number of heartbeat data in the sample pair set and the number of heartbeat data in the negative sample pair set is less than a preset threshold, that is, a negative sample pair is formed with heartbeat data of other categories. The heartbeat data in the positive sample pair set and the heartbeat data in the negative sample pair set are randomly shuffled to obtain a third set, and the third set is equally divided into a verification set and a test set, providing a data basis for ensuring the performance of the multi-branch attention feature fusion network.

[0134] It should be noted that, due to the different data sources, the test set of this embodiment contains newly added ECG data categories, that is, categories that are not recorded in the target multi-branch attention feature fusion network. For such data, the technical solution of the present application inputs the test set into the trained target multi-branch attention feature fusion network, corrects the final score through the OpenMax algorithm, and then uses Softmax to map the probability of each classification (that is, calculates the probabilities of multiple sample categories corresponding to each first heartbeat data in the test set), and determines the open set identity recognition result of each first heartbeat data based on each sample category probability and the open set recognition threshold. Specifically, the open set recognition threshold serves as the boundary value for judging whether the corresponding heartbeat data of the test set belongs to an unrecorded new category. The open set identity recognition result is determined by comparing the probability of each sample category with the open set recognition threshold. The open set identity recognition result determines whether each first heartbeat data is unknown data.

[0135] In addition, each first heartbeat data in the test set of this embodiment corresponds to a real label, and the real label represents the real identity open set recognition result of the first heartbeat data. After determining the identity open set recognition result, the method of this embodiment also includes verifying the accuracy of the identity open set recognition result, and the verification is specifically implemented according to the following evaluation indicators:

[0136]

[0137] Among them, TP, FP, TN and FN respectively represent the number of true positive samples, false positive samples, true negative samples and false negative samples determined based on the open set identity recognition results of each first heartbeat data in the test set and the true open set identity recognition results. The number of true positive samples is the number of samples that are actually positive and judged as positive by the classifier; the number of false positive samples is the number of samples that are actually negative but judged as positive by the classifier; the number of true negative samples is the number of samples that are actually negative and judged as negative by the classifier; the number of false negative samples is the number of samples that are actually positive and judged as negative by the classifier. The accuracy of the final open set identity recognition result is determined by judging the Accuracy value and the preset accuracy threshold.

[0138] like Figure 3 As shown, Figure 3 3 is a structural diagram of an electronic device provided by an embodiment of the present application. The present invention also provides an electronic device 300, including:

[0139] The processor 310 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0140] The memory 320 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 320 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 320, and the processor 310 calls and executes the ECG open set identity recognition method based on multi-branch attention in the embodiment of this application;

[0141] Input / output interface 330, used to implement information input and output;

[0142] Communication interface 340, used to realize communication interaction between the apparatus and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0143] bus 350 , which transmits information between the various components of the device (e.g., processor 310 , memory 320 , input / output interface 330 , and communication interface 340 );

[0144] The processor 310 , the memory 320 , the input / output interface 330 and the communication interface 340 are connected to each other in communication within the device via the bus 350 .

[0145] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0146] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. An ECG open set identity recognition method based on multi-branch attention, characterized in that: include: Acquire an ECG data set, and sequentially perform wavelet denoising, R-wave detection and positioning, and heartbeat segmentation processing on each ECG data in the ECG data set to obtain target heartbeat data; Dividing all the target heartbeat data into a first data set and a second data set, using the first data set as a training set, and training an initial multi-branch attention feature fusion network based on the training set to obtain a target multi-branch attention feature fusion network, wherein the first data set and the second data set include the same amount of data; Divide the second data set into a validation set and a test set; Inputting the verification set into the target multi-branch attention feature fusion network, and calculating the open set recognition threshold; Input each first heartbeat data in the test set into the target multi-branch attention feature fusion network to obtain multiple sample category probabilities corresponding to each first heartbeat data; An open set identification result of each of the first heartbeat data is determined based on each of the sample category probabilities and the open set identification threshold.

2. The ECG open set identity recognition method based on multi-branch attention according to claim 1, characterized in that: The step of sequentially performing wavelet denoising, R wave detection and positioning, and heart beat segmentation processing on each ECG data in the ECG data set to obtain target heart beat data includes: Performing wavelet decomposition on each of the ECG data using a DB8 wavelet function to obtain a plurality of first wavelet coefficients, wherein the scales of the first wavelet coefficients are different from each other; Performing threshold processing on each of the first wavelet coefficients to obtain each of the second wavelet coefficients; Reconstructing the second wavelet coefficients to obtain a denoised intermediate ECG data sequence; Determine the R wave peak point of the intermediate ECG data sequence based on the Hamilton segmentation algorithm, and obtain the single heart beat data of the preset length in the intermediate ECG data sequence based on the R wave peak point; The single heartbeat data is normalized to obtain the target heartbeat data.

3. The ECG open set identity recognition method based on multi-branch attention according to claim 1, characterized in that: The training set includes multiple training samples, the initial multi-branch attention feature fusion network includes a convolution block, a global feature extraction module, a local feature extraction module, an attention feature fusion module, a fully connected layer and an OpenMax module, and the initial multi-branch attention feature fusion network is trained based on the training set to obtain a target multi-branch attention feature fusion network, including: Inputting all the training samples into the convolution block for convolution processing to obtain first intermediate feature data; Inputting all the training samples into the global feature extraction module to obtain global feature data; Inputting all the training samples into the local feature extraction module to obtain local feature data; Inputting the global feature data, the local feature data and the first intermediate feature data into the attention feature fusion module for feature fusion processing to obtain second intermediate feature data; Inputting the second intermediate feature data into the fully connected layer to obtain a category score of each of the training samples, where different category scores correspond to different sample categories; Inputting all of the category scores into the OpenMax module to calculate the activation vector of each of the training samples and the average activation vector of each of the sample categories, and calculating the Euclidean distance from each of the activation vectors to the average activation vector; The initial multi-branch attention feature fusion network is iteratively trained based on all the Euclidean distances and a preset fitting criterion to obtain the target multi-branch attention feature fusion network, wherein the fitting criterion is that the Euclidean distance satisfies the Weibull distribution.

4. The ECG open set identity recognition method based on multi-branch attention according to claim 1, characterized in that: The second data set includes a plurality of sub-data sets, and the sample categories corresponding to the sub-data sets are different from each other. The second data set is divided into a validation set and a test set, including: Acquire a first set from each of the sub-data sets, and take the average value of the heartbeat data in each of the first sets to obtain a heartbeat template value, wherein the data volume of the first set is half of the data volume of the corresponding sub-data set; Combining each of the heartbeat template values ​​with the corresponding heartbeat data in the sub-data set except the first set to obtain a positive sample pair set; Combining each of the heartbeat template values ​​with the corresponding heartbeat data of the second set to obtain a negative sample pair set, wherein the sample category corresponding to all the heartbeat data in the second set is different from the sample category corresponding to the heartbeat template value, and the difference between the number of heartbeat data in the positive sample pair set and the number of heartbeat data in the negative sample pair set is less than a preset threshold; Randomly shuffle the heartbeat data in the positive sample pair set and the heartbeat data in the negative sample pair set to obtain a third set; The third set is divided into the validation set and the test set, wherein the data amount of the validation set is the same as the data amount of the test set.

5. The ECG open set identity recognition method based on multi-branch attention according to claim 2, characterized in that: The single heartbeat data is normalized to obtain the target heartbeat data according to the following formula: Wherein, x0 is the single heartbeat data, is the target heartbeat data.

6. The ECG open set identity recognition method based on multi-branch attention according to claim 3, characterized in that: The global feature extraction module includes a first residual structure and multiple dilated convolutional layers, and the dilated convolution receptive field of the dilated convolutional layer is obtained according to the following formula: Among them, RF 1+1 is the receptive field size corresponding to the feature data of the current hole convolution layer, RF l is the receptive field size corresponding to the feature data of the previous hole convolution layer, f l+1 is the convolution kernel size of the current hole convolution layer, S i is the stride product of the dilated convolution layer connected before the current dilated convolution layer, and l is the number of dilated convolution layers connected before the current dilated convolution layer.

7. The ECG open set identity recognition method based on multi-branch attention according to claim 3, characterized in that: Inputting the global feature data, the local feature data and the first intermediate feature data into the attention feature fusion module for feature fusion processing to obtain second intermediate feature data, including: splicing the global feature data, the local feature data and the first intermediate feature data to obtain third intermediate feature data; Inputting the global feature data and the local feature data into the attention feature fusion module to obtain fourth intermediate feature data; The third intermediate feature data and the fourth intermediate feature data are fused and spliced ​​to obtain the second intermediate feature data.

8. The ECG open set identity recognition method based on multi-branch attention according to claim 7, characterized in that: The attention feature fusion module includes a squeeze excitation network and a spatial attention module, and the global feature data and the local feature data are input into the attention feature fusion module to obtain fourth intermediate feature data, including: Inputting the global feature data and the local feature data into the extrusion excitation network, and weighting the output data to obtain fifth intermediate feature data; Inputting the global feature data and the local feature data into the spatial attention module, and weighting the output data to obtain sixth intermediate feature data; The fifth intermediate feature data, the sixth intermediate feature data and the seventh intermediate feature data are concatenated to obtain the fourth intermediate feature data, wherein the seventh intermediate feature data is obtained by processing the global feature data, the local feature data and the first intermediate feature data through a convolution layer and a RELU layer.

9. The ECG open set identity recognition method based on multi-branch attention according to claim 8, characterized in that: The global feature data and the local feature data are input into the squeeze excitation network, and the output data are weighted to obtain the fifth intermediate feature data, which is obtained according to the following formula: in, is the fifth intermediate feature data, and the fifth intermediate feature data is used to indicate the feature data of the cth channel after reweighting, s c is the weight of the cth channel, u c u is the cth channel of the global feature data and the local feature data, both of which are feature maps; c According to the following formula: Among them, H and W are the height and width of the feature map respectively, z c is the global average pooling result of the cth channel.

10. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the ECG open set identity recognition method based on multi-branch attention as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • ECG identity recognition method based on attention-enhanced multi-branch convolutional neural network

    CN116992421A

  • ECG identity recognition method based on multi-scale feature selection fusion residual network

    CN117171634A

  • ECG identity recognition method, system and equipment based on attention depth residual network

    CN117958813A

  • Method for realizing a multi-channel convolutional recurrent neural network EEG emotion recognition model using transfer learning

    US20230039900A1