Identity recognition method, electronic equipment and storage medium
By building an identity recognition model containing multiple convolutional blocks and encoding and decoding modules, and introducing a self-correcting attention module, the problem of low accuracy of ECG signal identity recognition is solved, and a higher recognition accuracy is achieved.
Patent Information
- Application Number
- CN202411309123.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, the identification accuracy of the ECG signal is low, and the rich characteristics of the ECG signal cannot be effectively extracted, resulting in unsatisfactory identification results.
The identity recognition model is constructed, including a first input convolution block, a plurality of second input convolution blocks, a self-correcting attention module and a plurality of encoding and decoding modules, and the recognition accuracy is improved through multi-dimensional feature extraction and self-correcting attention mechanisms.
Through multi-dimensional feature extraction and self-correcting attention mechanisms, the identity recognition accuracy based on ECG signals is significantly improved, and the characteristic information of ECG signals is fully utilized.
Smart Images

Figure CN119293580A_ABST
Abstract
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 identity recognition method, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of information technology, personal identification technology has been widely used in finance, medical care, security monitoring, data confidentiality and other fields. However, traditional identity recognition technology has many defects and cannot ensure a high level of security. For example, certificates and passwords are easy to copy and steal, and complex password designs are easy to forget. Therefore, biometric recognition systems came into being, using personal biological or behavioral characteristics to identify or verify identity. Although related technologies also use biometric features such as electrocardiogram signals to identify personal information, there is a problem of low recognition accuracy. Therefore, how to improve the accuracy of identity recognition based on electrocardiogram signals is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a method for identifying a person, an electronic device and a storage medium, which can improve the accuracy of identifying a person based on an electrocardiogram signal.
[0004] In a first aspect, an embodiment of the present application provides an identity recognition method, the method comprising: Obtaining an identity recognition model and denoised ECG data corresponding to the ECG data to be predicted, wherein the identity recognition model includes a first input convolution block, a plurality of second input convolution blocks, a self-correction attention module, and a plurality of encoding and decoding modules connected in sequence, and the convolution kernel size of the second input convolution block is larger than the convolution kernel size of the first input convolution block; Inputting the denoised ECG data into the first input convolution block for feature extraction, and outputting a first recognition feature; Extracting features of the first identification feature through the plurality of second input convolution blocks to obtain a second identification feature; Inputting the second identification feature into the self-correcting attention module for feature extraction to obtain a third identification feature; Extracting the third identification feature through the multiple encoding and decoding modules to obtain a fourth identification feature; According to the fourth identification feature, identity identification information corresponding to the electrocardiogram data is determined.
[0005] In some optional embodiments, the step of inputting the second identification feature into the self-correcting attention module for feature extraction to obtain a third identification feature comprises: Performing dimension expansion processing on the second identification feature and dividing the second identification feature after the dimension expansion processing into sub-identification features of the number of input channels; wherein the number of input channels is the number of channels for the convolution calculation of the self-correcting attention module; Generalizing each of the sub-identification features through the convolution branch of the self-correction attention module to obtain first generalized features corresponding to the sub-identification features one by one, and normalizing each of the first generalized features to obtain a plurality of first intermediate features; Performing convolution feature transformation processing on each of the sub-identification features through the self-correction attention branch in the self-correction attention module to obtain a second intermediate feature corresponding to the sub-identification feature one by one; Obtaining an aggregated attention weight corresponding to each of the sub-identification features one by one according to a first product of the first intermediate feature and the first attention weight of the self-correction attention branch, and a second product of the second intermediate feature and the second attention weight of the convolution branch; The sub-identification features are weighted according to each of the aggregated attention weights to obtain a third identification feature.
[0006] In some optional embodiments, the first attention weight and the second attention weight are determined by the identity recognition model during training through the following steps: Obtaining a first intermediate training feature output by the convolution branch during the training process and obtaining a second intermediate training feature output by the self-correction attention branch during the training process; Performing average pooling processing and normalization processing on the first training intermediate features and the second intermediate training features respectively, and updating the attention weights of the self-correction attention branch and the convolution branch respectively according to the normalization processing results; When the identity recognition model meets the preset convergence conditions, the updated attention weights of the self-correction attention branch and the convolution branch in the current iterative training are used as the first attention weight and the second attention weight, respectively.
[0007] In some optional embodiments, generalizing each of the sub-identification features through the convolution branch of the self-correcting attention module to obtain a first generalized feature corresponding to each of the sub-identification features, includes: Performing dimension conversion processing and average pooling processing on each of the sub-recognition features respectively; The features obtained by the dimension conversion processing of each of the sub-recognition features and the features obtained by the average pooling processing are concatenated and subjected to a 1x1 convolution operation to obtain a second generalized feature; Performing feature segmentation on each of the second generalized features to obtain two generalized sub-features corresponding to each of the sub-identification features; Normalizing each of the generalized sub-features to obtain a normalized weight feature corresponding to the sub-recognition feature; The sub-identification feature and the corresponding two normalized weight features are weighted to obtain a first generalized feature that corresponds one-to-one to the sub-identification feature.
[0008] In some optional embodiments, the self-correcting attention branch in the self-correcting attention module performs convolution feature transformation processing on each of the sub-identification features to obtain a second intermediate feature corresponding to the sub-identification feature one by one, including: Evenly dividing each of the sub-identification features into a first sub-feature and a second sub-feature; Performing a first convolution operation on the second sub-feature to obtain a second correction feature; Downsampling each of the first sub-features by average pooling to obtain a third intermediate feature; performing a second convolution operation, an upsampling process, a residual connection process, and a normalization process on the third intermediate feature in sequence, and correcting a result of performing the third convolution operation on the first sub-feature according to the feature after the normalization process to obtain a first corrected feature; The first calibration feature and the second calibration feature are concatenated to obtain the second intermediate feature which corresponds one-to-one to the sub-identification feature.
[0009] In some optional embodiments, the steps of performing feature extraction by each encoding and decoding module include: The input features of the encoding and decoding modules are captured by a multi-head attention mechanism to obtain a fourth intermediate feature; wherein the input feature of the first encoding and decoding module is the third recognition feature; the input features of the remaining encoding and decoding modules are the output features of the previous encoding and decoding modules; Performing residual connection and normalization processing on the fourth intermediate feature and the corresponding input feature to obtain a fifth intermediate feature; Inputting the fifth intermediate feature into a preset feedforward neural network layer to obtain a sixth intermediate feature; The sixth intermediate feature is residually connected and normalized with the fifth intermediate feature to obtain the output feature of the corresponding encoding and decoding module, wherein the output feature of the last encoding and decoding module is the fourth recognition feature.
[0010] In some optional embodiments, the denoised ECG data is determined by the following steps: Performing wavelet decomposition on the ECG data by using the Mallett algorithm to obtain multiple layers of candidate wavelet coefficients; The candidate wavelet coefficients of each layer are screened by a soft threshold function to obtain target candidate wavelet coefficients; Wavelet reconstruction is performed based on the target candidate wavelet coefficients to obtain the denoised ECG data.
[0011] In some optional embodiments, the identity recognition model is trained by the following steps: Obtain sample ECG data; De-noising the sample ECG data to obtain de-noised sample ECG data; Performing R peak positioning and heart beat segmentation on each ECG signal in the denoised sample ECG data to obtain signal segments of a preset length corresponding to the ECG signals one by one; The identity recognition model is trained based on each of the signal segments until a preset convergence condition is met.
[0012] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the identity recognition method as described in any one of the first aspects are implemented.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the steps of the identity recognition method as described in any one of the first aspects above.
[0014] According to the above-mentioned embodiments of the present application, at least the following beneficial effects are achieved: by constructing an identity recognition model having a first input convolution block, multiple second input convolution blocks, and multiple encoding and decoding modules, the identity recognition model can extract features from multiple dimensions, making full use of the rich features in the electrocardiogram signal, and achieving a higher accuracy in identity recognition. And by adding the self-correction attention mechanism to the identity recognition model through the self-correction attention module, the accuracy of identity recognition can be further improved. Therefore, compared with the related art, the embodiments of the present application can improve the accuracy of identity recognition based on electrocardiogram signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of an identity recognition method provided for this application; Figure 2 A schematic diagram of the architecture of an identity recognition model in an identity recognition method provided in this application; Figure 3 A schematic diagram of the architecture of a convolutional block in an identity recognition method provided in this application; Figure 4 A schematic diagram of the architecture of the encoding and decoding module in an identity recognition method provided in this application; Figure 5 A schematic diagram of the architecture of a self-correcting attention module in an identity recognition method provided in this application; Figure 6 A flowchart of a training process of an identity recognition model in one embodiment of an identity recognition method provided by the present application; Figure 7 A schematic diagram of the architecture of a self-correcting attention branch in an identity recognition method provided in this application; Figure 8 A schematic diagram of the hardware structure of a device corresponding to an identity recognition method provided in this application. DETAILED DESCRIPTION
[0016] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0017] 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.
[0018] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0020] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given: Electrocardiogram, also known as electrocardiogram; abbreviated as ECG.
[0021] Linear rectification function, also known as corrected linear unit, is an activation function commonly used in artificial neural networks. It usually refers to nonlinear functions represented by ramp functions and their variants.
[0022] With the rapid development of information technology, personal identification technology has been widely used in finance, medical care, security monitoring and data confidentiality. However, traditional identification technology has many defects and cannot ensure a high level of security. For example, certificates and passwords are easy to be copied and stolen, and complex password designs are easy to be forgotten. Therefore, biometric identification systems have emerged, using personal biological or behavioral characteristics to identify or verify identity. Mainstream biometrics include fingerprints, faces, irises, voices, and EEG signals, which have brought great convenience to people. However, these biometrics also have some disadvantages or limitations. For example, fingerprints and voices are easy to be counterfeited, face recognition is easily affected by light and distance, iris recognition is expensive to collect, and EEG signal collection is inconvenient. Therefore, the application of ECG signals as identity recognition is becoming more and more widespread. Compared with other biometrics, ECG signals have many unique advantages. First, everyone has a unique ECG signal, and the physical differences between individuals make ECG signals significantly different. Second, ECG signals are highly stable and rarely change under normal circumstances unless heart disease occurs. In addition, the collection of ECG signals is very convenient and can be performed through a dedicated ECG signal collector or wearable device. Finally, as an in-vivo feature, the ECG signal is highly secure and not easily stolen, copied or cracked. Among them, ECG-based biometric identification methods generally include four main steps: data collection, preprocessing, feature extraction and recognition. Among these steps, feature extraction and recognition are particularly critical. Although a deep learning model can be used as a feature learner to extract deeper verification information. However, the existing feature extraction still has the following major problems: (1) The rich features of the ECG signal cannot be effectively extracted during the model training process, resulting in insufficient feature extraction capabilities; (2) When processing individual identification in certain ECG databases, the final identification result still fails to reach the expected level, and the identification accuracy needs to be further improved. Based on this, the embodiments of the present application provide an identity recognition method, an electronic device and a storage medium that can improve the accuracy of identity recognition based on ECG signals.
[0023] Understandably, referring to Figure 1 As shown, the identity recognition method provided in the embodiment of the present application includes: First, refer to Figure 1 and Figure 2 As shown, the embodiment of the present application provides an identity recognition method, the method comprising: Step S100, obtaining an identity recognition model and denoised ECG data corresponding to the ECG data to be predicted, wherein the identity recognition model includes a first input convolution block, a plurality of second input convolution blocks, a self-correction attention module, and a plurality of encoding and decoding modules connected in sequence, and the convolution kernel size of the second input convolution block is larger than the convolution kernel size of the first input convolution block; Step S200, inputting the denoised ECG data into a first input convolution block for feature extraction, and outputting a first recognition feature; Step S300, extracting the first identification feature through a plurality of second input convolution blocks to obtain a second identification feature; Step S400, inputting the second identification feature into the self-correcting attention module for feature extraction to obtain a third identification feature; Step S500, extracting the third identification feature through multiple encoding and decoding modules to obtain a fourth identification feature; Step S600: Determine the identity recognition information corresponding to the ECG data according to the fourth recognition feature.
[0024] Therefore, by constructing an identity recognition model having a first input convolution block, multiple second input convolution blocks, and multiple encoding and decoding modules, the identity recognition model can extract features from multiple dimensions, making full use of the rich features in the ECG signal, and the accuracy of identity recognition is higher. And by adding the self-correction attention mechanism to the identity recognition model through the self-correction attention module, the accuracy of identity recognition can be further improved. Therefore, the embodiment of the present application can improve the accuracy of identity recognition based on ECG signals.
[0025] The ECG data is a set of ECG signals to be identified, and the ECG data may include one ECG signal or multiple ECG signals. The denoised ECG data is a set of signals obtained after denoising the ECG signals to be identified.
[0026] The first input convolution block is used for initial feature extraction, and the second input convolution block is used for further feature extraction. By setting the convolution kernel sizes of the first input convolution block and the second input convolution block differently, richer features can be extracted. Exemplarily, if the first input convolution block is set to a 1x3 convolution block, and the second input convolution block is set to a 1x9 convolution block. In some embodiments, the first input convolution block and the second input convolution block both include a convolution layer, a batch normalization (BatchNormalization, BN) layer, a ReLU, and a maximum pooling layer. Among them, the convolution layer of the first input convolution block is a 1x3 convolution block, and the convolution layer of the second input convolution block is a 1x9 convolution block. Exemplarily, taking the first input convolution block as an example, Figure 3 As shown in the figure, the denoised ECG data is input to the 1x3 convolutional layer, the output of the convolutional layer is used as the input of the BN layer, the output of the BN layer is used as the input of the ReLU, and the output of the ReLU is used as the input of the maximum pooling layer. At this time, the maximum pooling layer outputs the first recognition feature.
[0027] The number of the second input convolution blocks can be set according to actual needs, for example, Figure 2As shown, the number of the second input convolution blocks is set to 3, namely, the second input convolution block 1, the second input convolution block 2 and the second input convolution block 3. Then the first identification feature is input to the second input convolution block 1, the output of the second input convolution block 1 is used as the input of the second input convolution block 2, and the output of the second input convolution block 2 is used as the input of the second input convolution block 3. At this time, the second input convolution block 3 outputs the second identification feature.
[0028] The self-correcting attention module combines the self-correcting attention mechanism, which can further propose key recognition features, making the feature information of the third recognition feature richer.
[0029] The number of encoding and decoding modules can be set according to actual needs. Multiple encoding and decoding modules can increase the learned feature information, thereby improving the accuracy. For example, in some embodiments, four encoding and decoding modules are provided. Figure 2 As shown, the four encoding and decoding modules are encoding and decoding module 1, encoding and decoding module 2, encoding and decoding module 3 and encoding and decoding module 4. After the third identification feature is input into encoding and decoding module 1, the output feature of encoding and decoding module 1 is used as the input feature of encoding and decoding module 2, the output feature of encoding and decoding feature 2 is used as the input feature of encoding and decoding module 3, and the output feature of encoding and decoding module 3 is used as the input feature of encoding and decoding module 4, so that the third identification feature is subjected to multiple feature extractions through multiple encoding and decoding features to obtain the fourth identification feature.
[0030] In some embodiments, Figure 2 As shown, step S600 can input the fourth identification feature into the fully connected layer to classify the identity information, and then obtain the identity identification information. The present application does not limit the specific content of the identity identification information, which can be an identified identity ID, a name, etc.
[0031] It is understandable that step S400, inputting the second identification feature into the self-correcting attention module for feature extraction to obtain the third identification feature, includes: Performing dimension expansion processing on the second recognition feature and dividing the second recognition feature after the dimension expansion processing into sub-recognition features of the number of input channels; wherein the number of input channels is the number of channels for convolution calculation by the self-correcting attention module; Generalizing each sub-identification feature through the convolution branch of the self-correcting attention module to obtain a first generalized feature corresponding to the sub-identification feature one by one, and normalizing each first generalized feature to obtain a plurality of first intermediate features; The self-correction attention branch in the self-correction attention module performs convolution feature transformation processing on each sub-recognition feature to obtain a second intermediate feature corresponding to the sub-recognition feature one by one; Obtaining an aggregated attention weight corresponding to the recognition feature one-to-one according to a first product of the first intermediate feature and the first attention weight of the self-correction attention branch, and a second product of the second intermediate feature and the second attention weight of the convolution branch; The sub-identification features are weighted according to the aggregated attention weights to obtain a third identification feature.
[0032] The aggregated attention weight can be multiplied by the corresponding sub-identification feature and then added together, thereby achieving weighted processing of the second identification feature to obtain the third identification feature.
[0033] The present application does not limit the method used for normalization processing. In some embodiments, normalization can be performed using a sigmoid activation function or group normalization can be performed using GroupNorm.
[0034] The first intermediate feature, the second intermediate feature and other intermediate features are all features output by the identity recognition model during the processing process in actual application.
[0035] By calculating the aggregate attention weight based on the first intermediate feature and the second intermediate feature each time a feature is extracted, the third recognition feature is strongly correlated with the input denoised ECG data, thereby ensuring the feature extraction accuracy of the third recognition feature.
[0036] For example, refer to Figure 4 As shown, the second identification feature is , then Expand the dimension to get , and then divide the features into Divided into G sub-recognition features, respectively , ; Wherein, G is the number of input channels; thus, different feature information can be learned through each sub-feature, and the sub-feature information learned from multiple sub-features can be combined together to more accurately describe the second recognition feature, enhance the expression ability of the model, and then the second recognition feature can be learned from multiple perspectives and dimensions. In some embodiments, . The corrected attention module extracts the attention weights in the grouped features through two parallel paths, the convolution branch and the self-corrected attention branch. The learned attention weights will be used to strengthen the feature representation of the sub-feature interest area. The convolution branch and the self-corrected attention branch use different convolution kernel sizes to extract features of different scales. In addition, the self-corrected convolution branch establishes long-range spatial and channel dependencies around each spatial position through self-correction operations, thereby generating more discriminative feature expressions, which helps the model capture richer information in the input data and optimizes the weight distribution of the calculated features according to the computational complexity and importance of each branch to achieve more efficient calculations. Moreover, through the feature interaction of cross-space learning, the feature information extracted by different branches can be integrated to generate a richer and more comprehensive feature representation. For example, refer to Figure 4 As shown, for the i-th sub-recognition feature Perform dimension conversion and average pooling operations respectively, concatenate the features after dimension conversion and the features after average pooling, and then perform 1x1 convolution to obtain the features ,Will Split into and .like Figure 4 As shown, Normalized by sigmoid1 activation function; Normalized by sigmoid2 activation function, and then the normalized result is compared with Perform weighted operations to complete At this time, the results of the generalization processing are grouped and normalized to obtain the first intermediate features corresponding to each sub-recognition feature. ;in, , represents the group normalization operation, Represents the sigmoid activation function. Figure 4 As shown, each aggregated attention weight is multiplied by the corresponding sub-identification feature and then added to obtain a third identification feature consistent with the dimension of the second identification feature.
[0037] It can be understood that the first attention weight and the second attention weight are determined by the identity recognition model during the training process through the following steps: Obtaining a first intermediate training feature output by the convolution branch during the training process and obtaining a second intermediate training feature output by the self-correction attention branch during the training process; Performing average pooling and normalization processing on the first training intermediate features and the second training intermediate features respectively, and updating the attention weights of the self-correction attention branch and the convolution branch respectively according to the normalization processing results; When the identity recognition model meets the preset convergence conditions, the updated attention weights of the self-correction attention branch and the convolution branch in the current iterative training are used as the first attention weight and the second attention weight, respectively.
[0038] For example, assuming that the first training intermediate feature is ; The second intermediate feature is ; then Figure 4 As shown, Perform average pooling and normalization processing respectively (that is, after Softmax in the figure), and get the normalized result , ;in, , They are the attention weights of the convolution branch and the attention weights of the self-correction attention branch, respectively. Represents average pooling. When the Nth iteration meets the convergence condition, the Nth calculated is the second attention weight; calculated for the Nth time The convergence condition may be that the recognition accuracy meets a threshold or the number of iterations meets a preset number. In this regard, the embodiment of the present application does not restrict the convergence condition of the identity model during the training process.
[0039] It can be understood that each sub-identification feature is generalized through the convolution branch of the self-correction attention module to obtain a first generalized feature corresponding to the sub-identification feature one by one, including: Each sub-recognition feature is processed by dimension conversion and average pooling respectively; The features obtained by dimension conversion processing of each sub-recognition feature and the features obtained by average pooling processing are concatenated and subjected to 1x1 convolution operation to obtain the second generalized feature; Perform feature segmentation on each second generalized feature to obtain two generalized sub-features corresponding to each sub-recognition feature; Each generalized sub-feature is normalized to obtain a normalized weight feature corresponding to the sub-identification feature; The sub-identification features and the corresponding two normalized weight features are weighted to obtain a first generalized feature that corresponds one-to-one to the sub-identification features.
[0040] For example, Figure 4 As shown, each sub-identification feature After changing the dimension .
[0041] It can be understood that segmentation is to segment it according to the features before average pooling processing, such as Figure 4 As shown, the generalized sub-features are and The generalization ability can be further improved by concatenating them for 1x1 convolution and then calculating them separately. At this time, the first generalization feature is .
[0042] It can be understood that, by performing convolution feature transformation processing on each sub-identification feature through the self-correction attention branch in the self-correction attention module, a second intermediate feature corresponding to the sub-identification feature is obtained, including: Each sub-recognition feature is evenly divided into a first sub-feature and a second sub-feature; Each first sub-feature is downsampled by average pooling to obtain a third intermediate feature; The third intermediate feature is sequentially subjected to a second convolution operation, an upsampling process, a residual connection process, and a normalization process, and the result of the third convolution operation on the first sub-feature is corrected according to the normalized feature to obtain a first corrected feature; Performing a first convolution operation on the second sub-feature to obtain a second correction feature; The first calibration feature and the second calibration feature are concatenated to obtain a second intermediate feature that corresponds one-to-one to the sub-identification feature.
[0043] For example, Figure 5 As shown, input A is used as each sub-recognition feature For example, each sub-recognition feature Divide into the first sub-feature (i.e. A1 in the figure) and the second sub-feature (A2 in the figure); the first sub-feature Downsampling by average pooling is called , and then use convolution Perform feature transformation, this part of the operation is called , and then upsample to get the features The specific process is shown in the following formula: ;in, It indicates that the linear difference operation is up-sampled to obtain the mapping of the intermediate reference from the small-scale space to the original feature space; Represents the second convolution matrix. and After residual connection and normalization, the features are obtained ; The first sub-feature is obtained after the third convolution operation ; represents the third convolution matrix. At this time, through right Perform calibration to obtain the first calibration feature ; represents the fourth convolution matrix. The second correction feature ; Represents the first convolution matrix. The first correction feature and the second correction feature are concatenated to obtain the second intermediate feature (That is, the result of splicing B1 and B2 in the figure). Figure 4 As shown, you can Get the aggregated attention weights.
[0044] It is understandable that the steps of feature extraction in each encoding and decoding module include: The third recognition feature is captured through a multi-head attention mechanism to obtain the fourth intermediate feature; Performing residual connection and normalization processing on the fourth intermediate feature and the third recognition feature to obtain a fifth intermediate feature; Inputting the fifth intermediate feature into a preset feedforward neural network layer to obtain a sixth intermediate feature; The sixth intermediate feature is residually connected with the fifth intermediate feature and normalized to obtain the fourth recognition feature.
[0045] Exemplarily, taking one of the encoding and decoding modules as an example, after the third identification feature is input into the multi-head attention mechanism, the third identification feature is linearly transformed to obtain three matrices of query, key and value, and the third identification feature is split into multiple "heads", and then the attention weight is calculated independently for each head, where each head can be expressed by the formula as follows: , as well as ; is the third identification feature, , and are the query matrix, key matrix and value matrix, , and It is The learnable projection matrix of the head. At this point, we can get Self-attention ;in, It is Head Then, multiple heads are concatenated and multiplied with the output projection matrix to obtain the output of the multi-head attention. The output of the multi-head attention is reduced in dimension using the Flatten function and processed through the fully connected layer and then normalized using the Softmax function to obtain the fourth intermediate feature. ; is the output projection matrix of the final multi-head attention output, Indicates the number of heads. Represents a concatenation operation.
[0046] It can be understood that the denoised ECG data is determined by the following steps: The ECG data is decomposed by wavelet using the Mallett algorithm to obtain multiple layers of candidate wavelet coefficients; The candidate wavelet coefficients of each layer are screened by a soft threshold function to obtain the target candidate wavelet coefficients; Wavelet reconstruction is performed based on the target candidate wavelet coefficients to obtain denoised ECG data.
[0047] By screening the candidate wavelet coefficients of each layer through the soft threshold function, invalid content in the ECG data can be removed.
[0048] It is understandable that the identity recognition model is trained through the following steps: Obtain sample ECG data; De-noising the sample ECG data to obtain de-noised sample ECG data; Perform R peak location and heart beat segmentation on each ECG signal in the denoised sample ECG data to obtain a signal segment of a preset length corresponding to the ECG signal; The identity recognition model is trained based on each signal segment until the preset convergence condition is met.
[0049] For each signal segment, model training is performed with reference to steps S100 to S600, wherein in step S400, when the self-correcting attention module performs feature extraction, the first attention weight and the second attention weight are updated.
[0050] For example, refer to Figures 2 to 7 Describe the identity recognition method of the embodiment of the present application, the specific steps are as follows Figure 6 As shown: Step S1, obtaining sample ECG data, and marking each sample ECG signal in the sample ECG data.
[0051] Among them, since the data storage formats of each sample ECG signal in the sample ECG data in different databases are different, it is necessary to use a data reading method corresponding to the data storage format to extract the sample ECG signal, and then assign an identity label to each individual according to his or her name.
[0052] Step S2, denoising the sample ECG signal using a wavelet denoising algorithm based on weight threshold shrinkage, the specific steps are as follows: Step S2.1, using the Mallat algorithm to perform wavelet decomposition on the sample ECG signal to obtain the wavelet coefficients of candidate samples of each layer; Step S2.2, using a dynamic soft threshold function to process the candidate sample wavelet coefficients to obtain the target sample wavelet coefficients of each layer; Step S3.2, performing wavelet reconstruction on the target sample wavelet coefficients to obtain the final denoised sample signal.
[0053] Step S3, performing R peak location and heart beat segmentation on the denoised sample signal to obtain a signal segment of fixed length; the details are as follows: Step S3.1, using Hamilton segmentation algorithm to locate the peak point of the R wave in the electrocardiogram, and using it as a reference point, taking the 119 points before and 180 points after the peak point of the R wave for heartbeat segmentation to obtain the heartbeat data of a single cycle; Step S3.2, use the Min-Max function to normalize the single-cycle heartbeat data. The formula is as follows:
[0054] in Represents the input single-cycle heartbeat data, Represents the minimum value in a single cycle of heartbeat data, Represents the maximum value in a single cycle of heartbeat data, represents the normalized signal segment.
[0055] Step S4, dividing each signal segment into a training set and a test set, as follows: All the segmented signal fragments are randomly divided into 10 parts, and a 10-point data cross-validation experiment is performed. For example, each part of the data will be used as a test set in turn, and the remaining 9 parts of the data will be used as training sets. A total of 10 recognition experiments are performed. The final recognition result is determined by the average of the 10 experimental results.
[0056] Step S5, training the initial identity recognition model based on the training set to obtain the final identity recognition model; the details are as follows: Among them, Figure 2 As shown, the initial identity recognition model includes a first input convolution block, three second input convolution blocks, a self-correction attention module, and four encoding and decoding modules, and the convolution kernel size of the second input convolution block is larger than the convolution kernel size of the first input convolution block. The first input convolution block is set to a 1x3 convolution block; the convolution kernel of each second input convolution block is a 1x9 convolution block. By stacking multiple encoding and decoding modules and combining the self-attention mechanism and feedforward neural network, the complex dependencies in the input data can be captured. ECG signals have similar sequence characteristics to text sequences. Transformer (i.e., encoding and decoding) can be used to extract the characteristics of sequence semantics in the time dimension to mine more detailed features. The multi-head attention in the structure is composed of multiple self-attention splicing.
[0057] The training process includes: firstly, the training set passes through the first input convolution block to extract the preliminary features of the ECG signal, and then passes through three second input convolution blocks to further extract features. Then, it passes through the self-correction attention module to further highlight the key recognition features, and then passes through four encoding and decoding modules to fully capture different aspects of information in the deep features.
[0058] Among them, Figure 3 As shown, the first input convolution block and the second input convolution block both include a convolution layer, a batch normalization layer, a ReLU and a maximum pooling layer.
[0059] Among them, Figure 7 As shown in the figure, the encoding and decoding module is mainly composed of a multi-head self-attention mechanism, a feedforward neural network, two normalization layers, and the corresponding residual connection (also known as Add&Norm in the figure). The multi-head attention mechanism is multiple independent self-attention operations. In the self-attention operation, each feature block is first transformed linearly to obtain three matrices: query, key, and value. Its output is the result of multiplying the weighted product of QK with V, which expresses the association information between each feature block. Multi-head attention is used to calculate the relationship between different positions in the input data. By splitting the input data into multiple "heads", each head independently calculates the attention weight to capture different aspects of the sequence. The outputs of these heads are then concatenated and the final output is obtained through a linear transformation.
[0060] Among them, Figure 7 As shown, the processing process of the encoding and decoding module is as follows: the output features of the self-correction attention module First, it goes through the multi-head self-attention mechanism, and then The output features are added to the features obtained through the multi-head attention mechanism and passed through the normalization layer to obtain the output features (that is, residual connection is performed through ADD&Norm), and then the output features are added to the output of the feedforward neural network. Finally, the final output features are obtained through the normalization layer (that is, residual connection is performed through ADD&Norm again).
[0061] Among them, the multi-head attention mechanism can be expressed by the multi-head attention formula as follows: , as well as ;in, is the query matrix; is the key matrix; is the value matrix, , and It is The learnable projection matrix of each head. Then we can get The self-attention of each head is shown in the following formula: ; in, It is The self-attention of the head, It is Head Dimension.
[0062] Then the output of multi-head attention can be obtained as shown in the following formula: ;in, represents the multi-head self-attention output, is the output projection matrix of the final multi-head attention output, Indicates the number of heads. Represents a concatenation operation.
[0063] Finally, use the Flatten function to Perform dimensionality reduction, then pass through the fully connected layer, and finally output the prediction result through the Softmax function, and use the output prediction result as the input of ADD&Norm.
[0064] When training the model, Figure 4 As shown, the self-correction attention module performs the following process: First, for a given input feature Expand to , and then divide the features into Divide into G sub-features, and the original features Multi-perspective and multi-dimensional learning is carried out so that each sub-feature can learn different feature information. Multiple sub-features combined together can more accurately describe the original features and enhance the expressive power of the model. Divide into , , . The self-correcting attention module uses two parallel paths to extract the attention weights in the grouped features. The learned attention weights will be used to strengthen the feature representation of the sub-feature interest area. One parallel path is in the 1x1 convolution branch, and the other parallel path is in the self-correcting convolution branch. The two branches use different convolution kernel sizes to extract features of different scales. In addition, the self-correcting convolution establishes long-range spatial and channel dependencies around each spatial position through self-correction operations, thereby generating more discriminative feature expressions, which helps the model capture richer information in the input data and optimizes the weight distribution of the calculated features according to the computational complexity and importance of each branch to achieve more efficient calculations. Moreover, through cross-branch feature interactions, the feature information extracted from different branches can be integrated to generate a richer and more comprehensive feature representation. Among them, the i-th sub-feature Follow the steps below to extract features. All sub-features are processed in the same way. Finally, all processed sub-features are concatenated to obtain features with the same dimensions as the original features. The details are as follows: like Figure 4 As shown, in the 1x1 convolution branch, the input feature The dimension-changing and adaptive average pooling operations are used respectively, and then they are concatenated together and the features are obtained through 1x1 convolution. .
[0065] Then Split into and , and then the processed features are combined with sigmoid1 activation function and sigmoid2 activation function respectively. Multiply them together to perform weighted operations, thereby adjusting the weights, and then obtain the features through grouping and normalization , the process is shown in the following formula: .
[0066] in, , represents the group normalization operation, express and The corresponding sigmoid activation function.
[0067] like Figure 4 and Figure 5 As shown, in the self-corrected convolution branch, the input features Divide evenly into two parts (also known as A1 in the diagram) and (That is, A2 in the figure), and then perform convolution feature transformation in two different scale spaces.
[0068] like Figure 5 As shown, in the self-correction scale space, the input feature First, downsampling is performed through average pooling, which is called , and then use convolution right Perform feature transformation, this part of the operation is called , and then upsample to get the features The specific process is shown in the following formula: ; in Represents a linear interpolation operation, which obtains the mapping of the intermediate reference from the small-scale space to the original feature space.
[0069] Will With the original input features Perform residual connection, and then pass the result of residual connection through sigmoid function to obtain ;pass Original input features Through convolution The extracted features are calibrated to obtain the output The specific process is shown in the following formula: ; Among them, the original input features Through convolution The process of feature transformation is called , ,symbol" " represents element-by-element multiplication, is used as the residual to form the weights for calibration.
[0070] Finally, the output Then through convolution Perform feature extraction, which is called , the final output after self-calibration is , the process is shown in the following formula: ; in, It is the feature of the self-corrected scale space output.
[0071] like Figure 4 As shown, in the original space, the input feature Through convolution Perform feature extraction, a process called , and get its output , the process is shown in the following formula: ; in, is the output feature of the original space.
[0072] Then output features and Splice to get the i-th sub-feature The corresponding final output features .
[0073] like Figure 4 As shown, during training, the output of the 1x1 convolution branch is and the output of the self-corrected convolution branch Introducing cross-space learning areas, and The global spatial information is encoded by global average pooling, and then The function normalizes the weight results. The specific process is shown in the following formula: ; ; in, , are the attention weights of the 1x1 convolution branch and the self-correction convolution branch, respectively. Represents global average pooling.
[0074] Next, the output features of the 1x1 convolution branch are Attention weights with self-corrected convolution branches Perform matrix multiplication to obtain the first spatial attention weight, and then use the output features of the self-correction branch Attention weights with 1x1 convolution branches Perform matrix multiplication to obtain the second spatial attention weight. The final weight is the aggregation of the two generated spatial attention weight values. Then, the original input feature is weighted by the Sigmoid function and the final weight is calculated. , and then perform G Reduce the dimension to get the final output features The specific process is shown in the following formula: ; ; in, Represents the result of the aggregation of two attention values.
[0075] By combining the attention mechanism with the Transformer network, the recognition accuracy is further improved based on the full use of ECG signals.
[0076] Among them, Figure 4 As shown, G After normalization and weighted processing, we can obtain the self-correction attention module during training. Features output after feature extraction In practical applications, the second identification feature can be used to obtain the third identification feature by referring to the above training process.
[0077] In actual application, the identity recognition may be performed with reference to steps S100 to S600.
[0078] In order to test the performance of the identity recognition method based on the self-correcting attention network proposed in the present invention, the ECG-ID database provided in the international biomedical signal research resource website PHYSIONET can be used for experimental verification. A total of 310 ECG signals were collected in the ECG-ID database from 90 healthy individuals, and lead I measurement was applied. Among them, 44 males and 46 females were between the ages of 13 and 75, and each person collected 2 to 20 ECG signals in different time periods. Some were collected within one day, and some were collected at intervals of more than 6 months. Each signal was 20 seconds, and the sampling frequency was 500 Hz. This embodiment uses Python to implement the algorithm, and the specific steps are as follows: Step 1, use the wfdb package of the python platform to read the ECG-ID data of 90 individuals’ ECG signals; Step 2, using a wavelet denoising algorithm based on weight threshold contraction to remove baseline drift and power line interference in the ECG signal and suppress electromyographic artifacts; Step 3, locate the peak point of the R wave of the ECG signal, and use it as the reference point, take the first 119 points and the last 180 points for heartbeat segmentation to obtain the heartbeat data of a single cycle, and then use the Min-Max function to normalize it; Step 4: Divide all data into training set and test set; Step 5, input the training data into the identity recognition model for training, and obtain the final identity recognition model; Step 6: randomly divide all the segmented data into 10 parts, and conduct a 10-fold cross-validation experiment. Each part of the data will be used as a test set in turn, and the remaining 9 parts of the data will be used as training sets. A total of 10 recognition experiments will be conducted. The final recognition result is determined by the mean of the results of the 10 experiments. The following evaluation indicators are used to evaluate the recognition effect.
[0079]
[0080] in , , and They represent true positive, false positive, true negative and false negative respectively. The comparison results are shown in Table 1 below: Table 1 Comparison results with related studies
[0081] As can be seen from Table 1, by comparing the experimental results of this application with the corresponding experimental results of related studies (Wang et al. (2023) and Ibtehaz et al. (2022) respectively), it can be seen that the identity recognition model of this application can achieve higher recognition results.
[0082] like Figure 8 As shown, Figure 8 The structure block diagram of an electronic device 300 provided according to an embodiment of the present application is shown. The components of the electronic device 300 include but are not limited to a memory 310 and a receiver 320. The receiver 320 is connected to the memory 310 via a bus 330.
[0083] The electronic device 300 further includes an access module 340, which enables the electronic device 300 to communicate with one or more terminal devices 400. In one embodiment of the present application, the above components of the electronic device 300 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The structural block diagram of the electronic device shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0084] The terminal device 400 may be any type of stationary or mobile electronic device, including a mobile computer or mobile electronic device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable electronic device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary electronic device such as a desktop computer or a PC. The terminal device 400 may also be a mobile or stationary server.
[0085] The receiver 320 is used for computer executable instructions of an identity recognition method.
[0086] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above object receiving method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above object receiving method.
[0087] An embodiment of the present application also provides a computer-readable storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a receiver, it implements the above-mentioned identity recognition method.
[0088] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the receiver, and these remote memories may be connected to the receiver via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0089] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a receiver, such as a central receiver, a digital signal receiver, or a microreceiver, or as hardware, or 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 non-transitory medium) and a communication medium (or transient 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 technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can 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.
[0090] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions under the shared conditions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. An identity recognition method, characterized in that: The method comprises: Obtaining an identity recognition model and denoised ECG data corresponding to the ECG data to be predicted, wherein the identity recognition model includes a first input convolution block, a plurality of second input convolution blocks, a self-correction attention module, and a plurality of encoding and decoding modules connected in sequence, and the convolution kernel size of the second input convolution block is larger than the convolution kernel size of the first input convolution block; Inputting the denoised ECG data into the first input convolution block for feature extraction, and outputting a first recognition feature; Extracting features of the first identification feature through the plurality of second input convolution blocks to obtain a second identification feature; Inputting the second identification feature into the self-correcting attention module for feature extraction to obtain a third identification feature; Extracting the third identification feature through the multiple encoding and decoding modules to obtain a fourth identification feature; According to the fourth identification feature, identity identification information corresponding to the electrocardiogram data is determined.
2. The identity recognition method according to claim 1, characterized in that: The step of inputting the second identification feature into the self-correcting attention module for feature extraction to obtain a third identification feature comprises: Performing dimension expansion processing on the second identification feature and dividing the second identification feature after the dimension expansion processing into sub-identification features of the number of input channels; wherein the number of input channels is the number of channels for the convolution calculation of the self-correcting attention module; Generalizing each of the sub-identification features through the convolution branch of the self-correction attention module to obtain first generalized features corresponding to the sub-identification features one by one, and normalizing each of the first generalized features to obtain a plurality of first intermediate features; Performing convolution feature transformation processing on each of the sub-identification features through the self-correction attention branch in the self-correction attention module to obtain a second intermediate feature corresponding to the sub-identification feature one by one; Obtaining an aggregated attention weight corresponding to each of the sub-identification features one by one according to a first product of the first intermediate feature and the first attention weight of the self-correction attention branch, and a second product of the second intermediate feature and the second attention weight of the convolution branch; The sub-identification features are weighted according to each of the aggregated attention weights to obtain a third identification feature.
3. The identity recognition method according to claim 2, characterized in that: The first attention weight and the second attention weight are determined by the identity recognition model during the training process through the following steps: Obtaining a first intermediate training feature output by the convolution branch during the training process and obtaining a second intermediate training feature output by the self-correction attention branch during the training process; Performing average pooling processing and normalization processing on the first training intermediate features and the second intermediate training features respectively, and updating the attention weights of the self-correction attention branch and the convolution branch respectively according to the normalization processing results; When the identity recognition model meets the preset convergence conditions, the updated attention weights of the self-correction attention branch and the convolution branch in the current iterative training are used as the first attention weight and the second attention weight, respectively.
4. The identity recognition method according to claim 2, characterized in that: The process of generalizing each of the sub-identification features through the convolution branch of the self-correcting attention module to obtain a first generalized feature corresponding to each of the sub-identification features, including: Performing dimension conversion processing and average pooling processing on each of the sub-recognition features respectively; The features obtained by the dimension conversion processing of each of the sub-recognition features and the features obtained by the average pooling processing are concatenated and subjected to a 1x1 convolution operation to obtain a second generalized feature; Performing feature segmentation on each of the second generalized features to obtain two generalized sub-features corresponding to each of the sub-identification features; Normalizing each of the generalized sub-features to obtain a normalized weight feature corresponding to the sub-recognition feature; The sub-identification feature and the corresponding two normalized weight features are weighted to obtain a first generalized feature that corresponds one-to-one to the sub-identification feature.
5. The identity recognition method according to claim 2, characterized in that: The self-correcting attention branch in the self-correcting attention module performs convolution feature transformation processing on each of the sub-identification features to obtain a second intermediate feature corresponding to the sub-identification feature one by one, including: Evenly dividing each of the sub-identification features into a first sub-feature and a second sub-feature; Performing a first convolution operation on the second sub-feature to obtain a second correction feature; Downsampling each of the first sub-features by average pooling to obtain a third intermediate feature; performing a second convolution operation, an upsampling process, a residual connection process, and a normalization process on the third intermediate feature in sequence, and correcting a result of performing the third convolution operation on the first sub-feature according to the feature after the normalization process to obtain a first corrected feature; The first calibration feature and the second calibration feature are concatenated to obtain the second intermediate feature which corresponds one-to-one to the sub-identification feature.
6. The identity recognition method according to claim 1, characterized in that: The steps of performing feature extraction in each of the encoding and decoding modules include: The input features of the encoding and decoding modules are captured by a multi-head attention mechanism to obtain a fourth intermediate feature; wherein the input feature of the first encoding and decoding module is the third recognition feature; the input features of the remaining encoding and decoding modules are the output features of the previous encoding and decoding modules; Performing residual connection and normalization processing on the fourth intermediate feature and the corresponding input feature to obtain a fifth intermediate feature; Inputting the fifth intermediate feature into a preset feedforward neural network layer to obtain a sixth intermediate feature; The sixth intermediate feature is residually connected and normalized with the fifth intermediate feature to obtain the output feature of the corresponding encoding and decoding module, wherein the output feature of the last encoding and decoding module is the fourth recognition feature.
7. The identity recognition method according to claim 1, characterized in that: The denoised ECG data is determined by the following steps: Performing wavelet decomposition on the ECG data by using the Mallett algorithm to obtain multiple layers of candidate wavelet coefficients; The candidate wavelet coefficients of each layer are screened by a soft threshold function to obtain target candidate wavelet coefficients; Wavelet reconstruction is performed based on the target candidate wavelet coefficients to obtain the denoised ECG data.
8. The identity recognition method according to claim 1, characterized in that: The identity recognition model is trained through the following steps: Obtain sample ECG data; De-noising the sample ECG data to obtain de-noised sample ECG data; Performing R peak positioning and heart beat segmentation on each ECG signal in the denoised sample ECG data to obtain signal segments of a preset length corresponding to the ECG signals one by one; The identity recognition model is trained based on each of the signal segments until a preset convergence condition is met.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the identity recognition method according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the steps of the identity recognition method according to any one of claims 1 to 8.