Identity recognition method and device based on ECG signal, equipment and medium
By combining a dual-branch architecture that integrates grouped half-convolution and residuals of ECG signals with a dynamic spatial attention mechanism, the efficiency and accuracy issues of ECG signal identification in multi-session scenarios are resolved, achieving efficient and accurate identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-03-13
AI Technical Summary
Traditional authentication methods are susceptible to forgery, and ECG signals are affected by various factors at different times, resulting in poor efficiency and accuracy in identity recognition, and they cannot cope with changes in ECG signals during multiple sessions.
An ECG-based identity recognition method is adopted. Through a dual-branch architecture combining grouped semi-convolution and residuals, and combined with a dynamic spatial attention mechanism, the initial feature modules are removed, and feature extraction and enhancement are performed. The target identity recognition model is formed by iterative training.
It significantly reduces the number of parameters and memory access overhead, ensures the stability of gradient propagation, improves the efficiency and accuracy of identity recognition, and can accurately identify individual differences.
Smart Images

Figure CN121661670A_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of medical signal processing technology, and in particular to an identification method, device, equipment, and medium based on ECG signals. Background Technology
[0002] In recent years, the rapid development of information technology has made identity verification increasingly important in fields such as finance, healthcare, security monitoring, and data privacy protection. Traditional identity verification methods, such as credentials, passwords, and passwords, suffer from forgery problems, including the ease with which credentials can be copied, the ease with which complex passwords can be forgotten, and the ease with which passwords can be stolen. Based on this, existing technologies propose identity verification by analyzing an individual's physiological or behavioral characteristics. Biometric features can include fingerprints, facial features, iris scans, voice recognition, and electroencephalography (EEG). However, fingerprints and voice scans remain easily forged. While facial features, iris scans, and EEG scans are not easily forged, facial recognition is affected by changes in lighting and angle, leading to poor recognition results. Iris recognition is costly, and the acquisition of EEG signals is complex, making practical application difficult.
[0003] Furthermore, due to differences in heart size, muscle structure, and electrophysiological characteristics, each person's ECG signal is unique. In the absence of pathological conditions such as heart disease, an individual's ECG signal remains stable over a period of time, making ECG signal acquisition convenient. ECG signals can be acquired through medical devices or wearable devices, offering flexibility in acquisition methods. Moreover, the ECG signal acquisition device must be in close contact with the body, greatly reducing the risk of data theft or forgery, thus providing higher security. Considering these advantages, ECG signals have become an important choice in the field of identity verification. However, when verifying identity at different times, especially over long intervals, ECG signals are affected by various factors such as psychological state, emotional fluctuations, physiological changes, and environment, leading to differences in ECG signal distribution (i.e., multiple conversations). Conventional identity verification methods cannot handle the changes in ECG signals during multiple conversations and suffer from information redundancy, resulting in poor efficiency and accuracy in identity verification. Summary of the Invention
[0004] This application provides an identity recognition method, apparatus, device, and medium based on ECG signals, which can improve the efficiency and accuracy of identity recognition.
[0005] In a first aspect, embodiments of this application provide an identity recognition method based on ECG signals, applied to an identity recognition system, the ECG signal-based identity recognition method comprising: Input the target domain test set into the target identity recognition model to obtain the classification results; The target identity recognition model is determined through the following steps: Obtain a human electrocardiogram (ECG) image dataset, preprocess the ECG image dataset, and segment the preprocessed ECG image dataset into a source domain training set and a target domain training set; Obtain a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; Based on the domain adversarial model, the initial feature module is removed, and feature extraction is performed through a dual-branch architecture combining grouped half-convolution and residuals. A dynamic spatial attention mechanism is introduced to enhance features, resulting in an improved intermediate model. The intermediate model is iteratively trained using the source domain training set and the target domain training set to obtain the target identity recognition model.
[0006] Secondly, an ECG signal-based identity recognition device is applied to an identity recognition system, the ECG signal-based identity recognition device comprising: The application module is used to input the target domain test set into the target identity recognition model to obtain the classification result; The target identity recognition model is determined through the following steps: The acquisition module is used to acquire a human electrocardiogram (ECG) image dataset, preprocess the ECG image dataset, and segment the preprocessed ECG image dataset into a source domain training set and a target domain training set. A model acquisition module is used to acquire a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; An improvement module is used to remove the initial feature module based on the domain adversarial model, extract features through a dual-branch architecture combining grouped half-convolution and residuals, and introduce a dynamic spatial attention mechanism for feature enhancement to obtain an improved intermediate model. The training module is used to iteratively train the intermediate model using the source domain training set and the target domain training set to obtain the target identity recognition model.
[0007] Thirdly, an electronic device provided according to an embodiment of this application includes: At least one processor; At least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the ECG signal-based identity recognition method described in any of the first aspects is implemented.
[0008] Fourthly, according to the embodiments of the application, a computer-readable storage medium is provided, storing computer-executable instructions, which are used to execute the method for implementing the ECG signal-based identity recognition method described in any of the first aspects.
[0009] In summary, the above embodiments of this application include: inputting a target domain test set into a target identity recognition model to obtain a classification result; wherein, the target identity recognition model is determined through the following steps: acquiring a human electrocardiogram (ECG) image dataset, preprocessing the ECG image dataset, and segmenting the preprocessed ECG image dataset into a source domain training set and a target domain training set; acquiring a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; based on the domain adversarial model, removing the initial feature module, performing feature extraction through a dual-branch architecture combining grouped half-convolution and residuals, and introducing a dynamic spatial attention mechanism for feature enhancement to obtain an improved intermediate model; and iteratively training the intermediate model using the source domain training set and the target domain training set to obtain the target identity recognition model. Compared to domain adversarial models, the target identity recognition model in this application removes the initial feature module and can split the data into independent subgroups for parallel processing through grouped half-convolution based on channels, significantly reducing the number of parameters and memory access overhead, thereby suppressing feature redundancy. At the same time, it introduces residual skip connections to ensure gradient propagation stability, avoid deep network degradation, and maintain feature expressive power. Furthermore, it introduces a dynamic spatial attention mechanism at the output of the dual-branch architecture for feature enhancement, which can focus on key regions, suppress irrelevant noise, and improve the recognition accuracy of individual differences. Thus, when the target domain test set is input into the target identity recognition model, the classification results obtained can improve the efficiency and accuracy of identity recognition. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating the steps of an ECG signal-based identity recognition method according to an embodiment of this application. Figure 2 This is a general flowchart of an embodiment of an identity recognition method based on ECG signals provided in this application; Figure 3 This is an overall flowchart of residual convolution provided in one embodiment of this application; Figure 4 This is an overall flowchart of grouped binary convolution provided in one embodiment of this application; Figure 5 This is an overall flowchart of dynamic spatial attention provided in one embodiment of this application; Figure 6 This is a hardware schematic diagram of an electronic device provided in one embodiment of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0012] It is understandable that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, 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 flowchart. The terms "first," "second," etc., in the specification, claims, or the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0013] In recent years, the rapid development of information technology has made identity verification increasingly important in fields such as finance, healthcare, security monitoring, and data privacy protection. Traditional identity verification methods, such as credentials, passwords, and passwords, suffer from forgery problems, including the ease with which credentials can be copied, the ease with which complex passwords can be forgotten, and the ease with which passwords can be stolen. Based on this, existing technologies propose identity verification by analyzing an individual's physiological or behavioral characteristics. Biometric features can include fingerprints, facial features, iris scans, voice recognition, and electroencephalography (EEG). However, fingerprints and voice scans remain easily forged. While facial features, iris scans, and EEG scans are not easily forged, facial recognition is affected by changes in lighting and angle, leading to poor recognition results. Iris recognition is costly, and the acquisition of EEG signals is complex, making practical application difficult.
[0014] Furthermore, due to differences in heart size, muscle structure, and electrophysiological characteristics, each person's ECG signal is unique. In the absence of pathological conditions such as heart disease, an individual's ECG signal remains stable over a period of time, making ECG signal acquisition convenient. ECG signals can be acquired through medical devices or wearable devices, offering flexibility in acquisition methods. Moreover, the ECG signal acquisition device must be in close contact with the body, greatly reducing the risk of data theft or forgery, thus providing higher security. Considering these advantages, ECG signals have become an important choice in the field of identity verification. However, when verifying identity at different times, especially over long intervals, ECG signals are affected by various factors such as psychological state, emotional fluctuations, physiological changes, and environment, leading to differences in ECG signal distribution (i.e., multiple conversations). Conventional identity verification methods cannot handle the changes in ECG signals during multiple conversations and suffer from information redundancy, resulting in poor efficiency and accuracy in identity verification.
[0015] Based on this, embodiments of this application provide an identity recognition method, apparatus, device, and medium based on ECG signals, which can improve the efficiency and accuracy of identity recognition.
[0016] For example, compared with the domain adversarial model, the target identity recognition model of this application removes the initial feature module and can split into independent subgroups for parallel processing by grouped half-convolution according to the channel, which significantly reduces the number of parameters and memory access overhead, thereby suppressing the feature redundancy problem. At the same time, the introduction of residual skip connections ensures the stability of gradient propagation, avoids the degradation of deep networks, and maintains the feature expressive ability. Furthermore, a dynamic spatial attention mechanism is introduced at the output of the dual-branch architecture for feature enhancement, which can focus on key regions, suppress irrelevant noise, and improve the recognition accuracy of individual differences. Thus, when the target domain test set is input into the target identity recognition model, the classification results obtained by this application can improve the efficiency and accuracy of identity recognition.
[0017] For example, refer to Figure 1 and Figure 2 As shown, this application provides an ECG-based identity verification method, applied to an identity verification system. The ECG-based identity verification method includes, but is not limited to, the following steps: Step S10: Input the target domain test set into the target identity recognition model to obtain the classification result; When the target identity recognition model makes predictions on the target domain test set, the heartbeat sequence of the target domain test set (i.e., the test sample) is used. The output vector is shown in the following expression: ; in, Let U be the output vector, where U represents the parameters of the target feature extraction module of the target identity recognition model, and W and b are the parameters of the label prediction module of the target identity recognition model. Let W, U, and b be the optimal solutions respectively, and x be the heartbeat sequence of the target domain test set.
[0018] Then, the classification result is obtained based on the output vector. Specifically, the classification result is shown in the following expression: ; in, For the classification results, Let L be the i-th output vector, and L be the total number of predicted categories in the classification results.
[0019] The target identity recognition model is determined through the following steps: Step S11: Obtain the electrocardiogram (ECG) image dataset of the human body, preprocess the ECG image dataset, and divide the preprocessed ECG image dataset into a source domain training set and a target domain training set.
[0020] For example, the electrocardiogram (ECG) image dataset includes multiple ECG data points, each associated with an individual label. Preprocessing the ECG image dataset, specifically dividing it into a source domain training set and a target domain training set, involves: segmenting all ECG data points associated with each individual label into heartbeats to obtain an initial sequence; normalizing the initial sequence to obtain a heartbeat sequence; and randomly dividing the heartbeat sequence into multiple first data points and second data points. The first data points form the source domain training set, and the second data points form the target domain training set. The acquisition time of the second data points is different from that of the first data points.
[0021] For example, the target domain test set, the source domain training set, and the target domain training set can be determined through the following steps: (I) Obtaining ECG data: Using electrocardiogram (ECG) acquisition devices (such as ECG machines or 24-hour Holter monitors), ECG sampling data of more than 10 seconds are recorded for different individuals, and the individual classification corresponding to the ECG sampling data is labeled, so that each ECG sampling data is associated with an individual label, thereby obtaining the corresponding ECG data for each individual.
[0022] (II) Segmenting ECG data: For all ECG data associated with each individual label, perform the following operations: obtain the R-peak position of the ECG data; select 149 sampling points before and 150 sampling points after the R-peak, with each 300 sampling points constituting one heartbeat, thus obtaining the initial sequence.
[0023] (III) Standardization of ECG data: The initial sequence was normalized using a deviation normalization method to obtain the heartbeat sequence. Specifically, a linear transformation was performed on the initial sequence to map the heartbeats of different individuals in the ECG onto the [0,1] interval. The deviation normalization is expressed as follows: ; in, The feature vector of the heartbeat sequence, Let be the heartbeat vector of the initial sequence. This represents the minimum value of the heartbeat vector. This represents the maximum value of the heartbeat vector.
[0024] (iv) Segment the electrocardiogram sequence and its individual labels according to the time of acquisition: First, the heartbeat sequences and corresponding individual labels are randomly divided into ten groups according to the classification categories. Each group contains the heartbeats of all individuals. The tenth group of data cannot be sampled at the same time as the other nine groups of data, so that the tenth group of data can fully reflect the recognition effect among individuals. That is, the data distribution of the tenth group of data is different from that of the other nine groups of data. Then, the different groups of data with the same sequence are spliced into a complete group of data and the order is randomly shuffled. The first nine groups of data are used as the first group of data, and the tenth group of data is used as the second group of data. The first group of data is used to form the source domain training set, and the second group of data is used to form the target domain training set and the target domain test set.
[0025] Step S12: Obtain the domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module.
[0026] It is understandable that ECG signals are influenced by various factors, such as psychological state, emotional fluctuations, physiological changes, and environment, leading to changes in the morphology of the ECG signal of the same individual at different times (i.e., multiple conversations). This means that individual and environmental differences result in variations in ECG signal distribution. Since domain adversarial models can capture long-term dependencies in multi-turn dialogue history, this application selects a domain adversarial model as the baseline model. This allows for the combination of transfer learning and domain adversarial training in multiple conversations to accurately identify ECG signal distribution differences caused by individual and environmental variations, thereby ensuring basic accuracy in identity recognition.
[0027] For example, the domain adversarial model includes an initial feature extraction module and an initial label prediction module. First, the convolutional network of the initial feature extraction module extracts features from the input data to obtain feature vectors. These feature vectors suppress ECG signal distribution differences caused by individual and environmental variations, thereby improving the accuracy of indicating individual differences (since the domain adversarial model has undergone complete domain adversarial training, it can cope with scenarios where ECG signal distribution differences are caused by individual and environmental variations). Then, based on the accurate feature vectors, the initial label prediction module predicts and classifies the feature vectors to obtain the prediction results.
[0028] Step S13: Based on the domain adversarial model, the initial feature module is removed, and feature extraction is performed through a dual-branch architecture combining grouped half-convolution and residuals. A dynamic spatial attention mechanism is introduced to enhance features, resulting in an improved intermediate model.
[0029] Since ECG signals contain a large amount of data, and the initial feature module of the domain adversarial model is a conventional convolutional network, feature redundancy exists when extracting features from the entire ECG signal, leading to reduced efficiency in subsequent identity recognition. Therefore, this application removes the initial feature module from the domain adversarial model and performs feature extraction using a dual-branch architecture combining grouped semi-convolution and residuals. Grouped semi-convolution splits the signal into independent subgroups based on channels for parallel processing, significantly reducing the number of parameters and memory access overhead, thereby suppressing feature redundancy. Simultaneously, residual skip connections are introduced to ensure gradient propagation stability, prevent deep network degradation, and maintain feature expressiveness. Furthermore, a dynamic spatial attention mechanism is introduced at the output of the dual-branch architecture for feature enhancement, which focuses on key regions, suppresses irrelevant noise, and improves the accuracy of identifying individual differences, thereby improving the efficiency and accuracy of the improved intermediate model in identity recognition.
[0030] Step S14: Iteratively train the intermediate model using the source domain training set and the target domain training set to obtain the target identity recognition model.
[0031] For example, since the source domain training set and the target domain training set are distributed differently, the embodiments of this application generate features for the confusion domain discrimination module to distinguish between the source domain and the target domain through the target feature extraction module of the intermediate model under the action of the gradient inversion layer of the domain discrimination module. The target domain dataset exposes individual differences, forcing the intermediate model to learn domain-invariant features, and gradually making the spatial distribution of high-dimensional features of the source domain training set and the target domain training set tend to be consistent, thereby overcoming the signal distribution differences caused by individual physiological differences and environmental differences, and thus obtaining the target identity recognition model, thereby improving the identity recognition accuracy of the target identity recognition model.
[0032] In some embodiments, the intermediate model includes a target feature extraction module, a domain discrimination module, and a label prediction module. The inputs of the domain discrimination module and the label prediction module are bidirectionally connected to the output of the target feature extraction module. The initial identity recognition model is iteratively trained using the source domain training set and the target domain training set to obtain the target identity recognition model. This includes: using the target feature extraction module to sequentially perform channel grouping and halving convolution operations on each heartbeat sequence in the source domain training set and the target domain training set to extract features and obtain the halving feature map corresponding to the heartbeat sequence; simultaneously, convolution is performed on each heartbeat sequence in parallel and skip connections are made to obtain the residual feature map corresponding to the heartbeat sequence; then, the halving feature map and the residual feature map are fused and dynamically convolved at the spatial level to obtain the target feature map; the label prediction module is iteratively trained based on the target feature map, and domain adversarial training is performed by calculating the domain classification loss corresponding to the target feature map through the domain discrimination module until the domain classification loss is maximized to obtain the target identity recognition model.
[0033] For example, the target feature extraction module sequentially groups each heartbeat sequence in the source and target domain training sets by channel, and then performs convolution operations on only half of each group to extract features, obtaining a half-feature map corresponding to the heartbeat sequence. Since the initial feature extraction module in existing technologies extracts all features, it leverages the lightweight advantage of half-convolution to reduce feature redundancy. Simultaneously, parallel convolution of each heartbeat sequence and skip connections to obtain the residual feature map corresponding to the heartbeat sequence ensure gradient propagation stability and maintain feature expressiveness. Based on this, the half-feature map and residual feature map are fused and then dynamically convolved at the spatial level to obtain the target feature map, which enhances key features. This further enhances the expressive power of features, thereby improving the accuracy of identity recognition. Finally, iterative training of the label prediction module based on the target feature map can improve the accuracy of recognizing individual differences. Domain adversarial training is then performed by calculating the domain classification loss corresponding to the target feature map through the domain discrimination module until the domain classification loss is maximized. By gradually maximizing the domain classification loss, the spatial distribution of the high-dimensional features extracted by the target feature extraction module gradually becomes more consistent (that is, the features extracted by the target feature extraction module are features shared by the source domain and the target domain), thereby overcoming the signal distribution differences caused by individual physiological differences and environmental differences, and obtaining the target identity recognition model, thus improving the identity recognition accuracy of the target identity recognition model.
[0034] In some embodiments, the target feature extraction module includes a pre-module, a grouped half-convolution sub-module, a residual sub-module, and a dynamic spatial attention sub-module. The inputs of the grouped half-convolution sub-module and the residual sub-module are respectively connected to the output of the pre-module. The target feature extraction module performs channel grouping and half-convolution operations on each heartbeat sequence in the source domain training set and the target domain training set to extract features and obtain the half-feature map corresponding to the heartbeat sequence. Simultaneously, it performs convolution and skip connections on each heartbeat sequence in parallel to obtain the residual feature map corresponding to the heartbeat sequence. This includes: convolving the heartbeat sequence through the pre-module to obtain a first feature map, and performing max pooling on the first feature map to obtain a second feature map; inputting the second feature map into the grouped half-convolution sub-module for channel grouping and half-convolution to extract features and obtain the half-feature map; inputting the first feature map into the residual sub-module for feature extraction through at least two sequentially connected convolutional layers and then performing skip connections with the first feature map to obtain the residual feature map.
[0035] For example, since the receptive field of a regular convolution kernel is limited by the kernel size, while dilated convolution inserts intervals within the kernel through the dilation rate, it covers a longer time interval with fewer parameters. Therefore, embodiments of this application use a pre-module to process the heartbeat sequence (i.e., The first feature map is obtained by performing convolution using a 3×1 dilated convolution kernel. This allows for the capture of dependencies between multiple sessions; then the first feature map is... After global average pooling (GAP), a second feature map is obtained, which can compress the time dimension, aggregate channel-level global features, and reduce the number of parameters.
[0036] It is understood that, in this embodiment of the application, by inputting the second feature map into the grouped half-convolution submodule for channel grouping, complementary features between different groups can be learned through channel grouping, avoiding feature redundancy. Then, each group is further grouped, and half of each group is convolved to extract features. Compared with the full feature extraction in the prior art, this can reduce the number of parameters generated and the amount of memory access, further improving the computational efficiency of the half-feature map and reducing costs.
[0037] For example, refer to Figure 3 As shown, taking the residual submodule as two sequentially connected dilated convolutional layers as an example, the input first feature map is passed through two 3×1 dilated convolutional layers with the same number of channels. Each convolutional layer is followed by a batch normalization (BN) layer and an activation (ReLU) layer for feature extraction, resulting in an intermediate feature map. The intermediate feature map is shown in the following expression: ; in, This is an intermediate feature map. For activation layer, and All are hollow convolutional layers. This is the first feature map.
[0038] By performing a skip connection between the intermediate feature map and the first feature map, a residual feature map is obtained, which can maintain the expressive power of the features. The residual feature map is shown in the following expression: ; in, For residual feature maps, This is an intermediate feature map. This is the first feature map. This is a signal of length L and dimension C / 2 for the B batch.
[0039] In some embodiments, inputting the second feature map into the grouped half-convolution submodule for channel grouping and then extracting features via half-convolution to obtain a half-feature map includes: grouping the second feature map according to its channels to obtain a first subgroup corresponding to the second feature map, and further grouping the first subgroup to obtain two second subgroups; performing Fourier convolution on the first subgroup to extract features to obtain subgroup features, while keeping the remaining second subgroups unchanged; and concatenating the subgroup features with the remaining second subgroups to obtain a half-feature map.
[0040] For example, refer to Figure 4 As shown, taking a second feature map with three channels as an example, the feature map is divided into three groups according to the number of channels, resulting in the first subgroups corresponding to the three second feature maps. The size of each group is as follows: Each first subgroup is then divided into two equal subgroups.
[0041] Then, features are extracted from one of the second subgroups using Fourier convolution operations to obtain subgroup features. This allows for the capture of global contextual information through the frequency domain transformation of Fourier convolution, compensating for the locality limitations of spatial convolution. Furthermore, the complexity of frequency domain convolution is lower than that of large-kernel spatial convolution, further improving efficiency. Specifically, the Fourier convolution operation is shown in the following expression: ; in, For Fourier transform, For inverse Fourier transform, It is a 3×1 dilated convolution kernel. The size of the first subgroup. Features of subgroups.
[0042] Finally, the remaining second subgroup is kept unchanged. The unchanged subgroup retains the original spatial information, complementing the subgroup features and enhancing robustness. Then, the subgroup features and the remaining second subgroup are concatenated by channel. This allows the use of Fourier convolution to introduce a frequency domain perspective, concatenating and fusing multi-domain information, and improving the generalization ability of complex tasks. Specifically, the channel concatenation is shown in the following expression: ; in, Features of subgroups The size of the first subgroup. This is a binary feature map. This is a signal of length L and dimension C / 2 for the B batch.
[0043] In some embodiments, the outputs of the grouped halved convolutional submodule and the residual submodule are respectively connected to the input of the dynamic spatial attention submodule. The dynamic spatial attention submodule includes a fusion layer, a global average pooling layer, a miniature two-layer convolutional network, and a first convolutional layer connected in sequence. It then fuses the halved feature map and the residual feature map and performs dynamic convolution at the spatial level to obtain the target feature map. This includes: fusing the halved feature map and the residual feature map using the fusion layer to obtain a fused feature map; inputting the fused feature map into the global average pooling layer for global average pooling and then into the miniature two-layer convolutional network for convolution to obtain the dynamic convolutional kernel corresponding to the fused feature map; averaging the fused feature map by channels to obtain the spatial descriptor corresponding to the fused feature map, and inputting the spatial descriptor and the dynamic convolutional kernel into the first convolutional layer for convolution to obtain dynamic spatial attention weights; and then multiplying the fused feature map and the dynamic spatial attention weights along the channels to obtain the target feature map.
[0044] For example, the outputs of the branches of the grouped folded convolutional submodule and the residual submodule are first fused to obtain a fused feature map. Then, global average pooling is performed on the fused feature map, and then a dynamic convolution kernel is generated for each individual to enhance the ability to perceive features that are different from individuals. Next, the fused feature map is averaged by channel to obtain a spatial descriptor, which is then convolved with the fused feature map using a dynamic convolution kernel. Then, the dynamic spatial attention weights are obtained by activating the Sigmoid function. Finally, the dynamic spatial attention weights are multiplied element-wise with the fused feature map to enhance the key features of the target feature map and suppress noise interference.
[0045] Specifically, refer to Figure 5 As shown, firstly, the fused feature map... Perform global average pooling (GAP), then process the vector using a miniature two-layer convolutional network (which can be two consecutive 1×1 convolutional layers to improve efficiency), using ReLU in between. ) and Sigmoid ( The activation function generates a dynamic convolutional kernel corresponding to each individual. It uses global average pooling to aggregate global features to generate the dynamic convolutional kernel, allowing it to adjust according to the input samples and improving model adaptability. Specifically, the dynamic convolutional kernel is expressed as follows: ; in, A batch dynamically generated based on the input fused feature map F Dynamic convolution kernel (one convolution kernel for each sample / individual in the batch). and All are activation functions. It is a global average pooling layer. and All are 1×1 convolutional layers. To fuse feature maps.
[0046] Then, the spatial descriptor is obtained by averaging the fused feature map along the channel dimension. Spatial identifiers identify important areas; spatial descriptors Dynamic convolution kernels corresponding to the fused feature maps Convolution of the fused feature maps yields dynamic spatial attention weights. This allows the dynamic spatial attention weights to focus on important regions. Specifically, the dynamic spatial attention weights are expressed as follows: ; in, It is a convolutional layer. It is the Sigmoid activation function. For dynamic spatial attention weights, For dynamic convolution kernels, This is a space descriptor.
[0047] Finally, the fused feature map and the dynamic spatial attention weights are multiplied element-wise, that is, multiplied along the channels, to obtain the target feature map. This makes the target feature map focus on important regions, further enhancing the feature representation capability. The target feature map is shown in the following expression: ; in, For the target feature map, This indicates element-wise multiplication (multiplication along the channel). To fuse feature maps, For dynamic attention weights, The signal of length L and dimension C is the signal of batch B.
[0048] For example, the target identity recognition model is obtained by iteratively training the label prediction module based on the target feature map and performing domain adversarial training by calculating the domain classification loss corresponding to the target feature map through the domain discriminant module until the domain classification loss is maximized. This includes: calculating the label classification loss based on the target feature map through the label prediction module, backpropagating the label classification loss to the feature extraction module, and iteratively training the label prediction module and the feature extraction module by minimizing the label classification loss; calculating the domain classification loss based on the target feature map through the domain discriminant module, backpropagating the domain classification loss to the feature extraction module using the gradient reversal layer of the domain discriminant module, and performing domain adversarial training until the domain classification loss is maximized.
[0049] It is understood that, in the embodiments of this application, after the target feature map is extracted by the target feature extraction module, the feature dimension of the target feature map can be compressed by the global average pooling layer and then input into the label prediction module and the domain discrimination module.
[0050] For example, the label prediction module consists of multiple fully connected layers, using the AM-softmax function as the activation function, to predict the label of the target feature map. The label prediction module is shown in the following expression: ; in, For predicting labels, For the target feature map, For heartbeat sequence, U is the activation function, U is the parameter of the target feature extraction module, and W and b are both parameters of the label prediction module.
[0051] Assume the heartbeat sequence in the source domain training set is The AM-softmax cross-entropy loss function is used as the loss for the label prediction module. The label classification loss is expressed as follows: ; in, Represents the label classification loss. For predicting labels, Let be the target feature map, n be the total number of elements in the source domain training set, and s and m be constant values. This is the weight vector for the label prediction module. For the target feature map, for and The included angle, for .
[0052] Understandably, the label prediction module minimizes the label classification loss. To improve its classification performance, the target feature extraction module updates its parameters in a way that reduces the label classification loss, continuously extracting key classification features, thus gradually improving the accuracy of the label prediction module. Therefore, the final training optimization objective in the source domain is expressed as follows: ; Where U represents the parameters of the target feature extraction module, W and b are both parameters of the label prediction module, and n is the total number of elements in the source domain training set. This represents the label classification loss.
[0053] For example, the domain discrimination module consists of multiple fully connected layers, which are activated by the Sigmoid function to output domain labels, as shown in the following expression: ; in, For domain tags, For predicting labels, Let U be the target feature map, U be the parameters of the feature extraction module, and V and c be the parameters of the label prediction module.
[0054] Suppose we use the binary cross-entropy loss function as the loss calculation formula for the domain discrimination module, as shown in the following expression: ; in, For domain classification loss, For domain tags, For the target feature map, Here, U represents the heartbeat sequence, and U represents the parameters of the target feature extraction module. Represents the domain label of the i-th sample / individual, if =0 indicates that the sample comes from the source domain; otherwise, it comes from the target domain.
[0055] Because the domain discrimination module includes a gradient inversion layer, it is unaffected by the gradient inversion layer during backpropagation, thus minimizing the domain classification loss. The parameters of the domain discrimination module are updated to continuously improve its discrimination ability. Meanwhile, the backward gradient is passed through the gradient reversal layer and then to the target feature extraction module, causing the target feature extraction module to update its parameters in the direction that increases the domain classification loss. This allows the domain discrimination module and the target feature extraction module to perform domain adversarial training. Specifically, the objective function of the domain discrimination module is as follows: ; Where V and c are the parameters of the label prediction module, U is the parameter of the feature extraction module, and n is the total number of elements in the source domain training set. Let N be the domain classification loss for the i-th sample or individual, where N represents the total number of the source domain training set and the target domain training set.
[0056] Thus, based on minimizing the label classification loss and maximizing the domain classification loss, the parameters are... After loss adjustment, the final overall loss function of the intermediate model is shown below: ; in, Let V be the overall loss function of the intermediate model, V and c be the parameters of the label prediction module, U be the parameters of the feature extraction module, n be the total number of the source domain training set, W and b be the parameters of the label prediction module, and N represent the total number of the source domain training set and the target domain training set. Represents the label classification loss. For domain classification loss.
[0057] During the iteration process, as the parameters of the target feature extraction module and the domain discrimination module are adjusted and updated in opposite directions, they continuously engage in adversarial training. The parameters of the label prediction module are updated by minimizing the label classification loss, and the parameters of the domain discrimination module are updated by maximizing the domain discrimination loss, until the domain discrimination module can no longer accurately distinguish the specific source domain of the features extracted by the target feature extraction module. At this point, the domain adaptation process ends, indicating that the features extracted by the feature extraction module are common features of both domains. Thus, even when faced with the distribution differences of ECG signals across different time periods over a long time interval (i.e., multiple sessions), accurate identity recognition can still be performed. Therefore, the final objective function optimization is as follows: ; Where V and c are parameters of the label prediction module, U is a parameter of the feature extraction module, and W and b are parameters of the label prediction module. , and These are the optimal solutions for W, U, b, V, and c, respectively.
[0058] For example, in the iterative training process of this application embodiment, the batch size is 64, the initial learning rate is 0.001, and the learning rate adjustment adopts the gradient descent method.
[0059] For example, an ECG signal-based identity recognition device is applied to an identity recognition system. The ECG signal-based identity recognition device includes: an application module, which inputs a target domain test set into a target identity recognition model to obtain classification results; wherein the target identity recognition model is determined through the following steps: an acquisition module, which acquires a human electrocardiogram (ECG) image dataset, preprocesses the ECG image dataset, and segments the preprocessed ECG image dataset into a source domain training set and a target domain training set; a model acquisition module, which acquires a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; an improvement module, which, based on the domain adversarial model, removes the initial feature module, extracts features through a dual-branch architecture combining grouped semi-convolution and residuals, and introduces a dynamic spatial attention mechanism for feature enhancement to obtain an improved intermediate model; and a training module, which iteratively trains the intermediate model using the source domain training set and the target domain training set to obtain the target identity recognition model.
[0060] It is understood that the specific implementation of the ECG signal-based identity recognition device in this application is the same as the specific implementation of the ECG signal-based identity recognition method described above, and will not be repeated here.
[0061] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned ECG signal-based identity recognition method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0062] Please see Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, 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 this application. The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601 to execute the ECG signal-based identity recognition method of the embodiments of this application. The input / output interface 603 is used to implement information input and output; The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604); The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.
[0063] In some embodiments, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described ECG signal-based identity recognition method.
[0064] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0065] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0066] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0067] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0068] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0069] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0070] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0072] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0073] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0074] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. An identity recognition method based on ECG signals, characterized in that, The ECG signal-based identity recognition method, applied to an identity recognition system, includes: Input the target domain test set into the target identity recognition model to obtain the classification results; The target identity recognition model is determined through the following steps: Obtain a human electrocardiogram (ECG) image dataset, preprocess the ECG image dataset, and segment the preprocessed ECG image dataset into a source domain training set and a target domain training set; Obtain a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; Based on the domain adversarial model, the initial feature module is removed, and feature extraction is performed through a dual-branch architecture combining grouped half-convolution and residuals. A dynamic spatial attention mechanism is introduced to enhance features, resulting in an improved intermediate model. The intermediate model is iteratively trained using the source domain training set and the target domain training set to obtain the target identity recognition model.
2. The ECG signal-based identity recognition method according to claim 1, characterized in that, The intermediate model includes a target feature extraction module, a domain discrimination module, and a label prediction module. The inputs of the domain discrimination module and the label prediction module are bidirectionally connected to the output of the target feature extraction module. The step of iteratively training the initial identity recognition model using the source domain training set and the target domain training set to obtain the target identity recognition model includes: The target feature extraction module is used to sequentially perform channel grouping and folded convolution operations on each heartbeat sequence in the source domain training set and the target domain training set to extract features and obtain the folded feature map corresponding to the heartbeat sequence. At the same time, each heartbeat sequence is convolved in parallel and skipped to obtain the residual feature map corresponding to the heartbeat sequence. Then, the folded feature map and the residual feature map are fused and dynamic convolution is performed at the spatial level to obtain the target feature map. The label prediction module is iteratively trained based on the target feature map, and the domain classification loss corresponding to the target feature map is calculated by the domain discrimination module to perform domain adversarial training until the domain classification loss is maximized, thereby obtaining the target identity recognition model.
3. The ECG signal-based identity recognition method according to claim 2, characterized in that, The target feature extraction module includes a pre-module, a grouped half-convolution submodule, a residual submodule, and a dynamic spatial attention submodule. The inputs of the grouped half-convolution submodule and the residual submodule are respectively connected to the output of the pre-module. The step of using the target feature extraction module to sequentially perform channel grouping and half-convolution operations on each heartbeat sequence in the source domain training set and the target domain training set to extract features and obtain the half-feature map corresponding to the heartbeat sequence, while simultaneously performing convolution and skip connections on each heartbeat sequence in parallel to obtain the residual feature map corresponding to the heartbeat sequence, includes: The first feature map is obtained by convolving the heartbeat sequence through the pre-module, and the second feature map is obtained by max pooling the first feature map. The second feature map is input into the grouped half-convolution submodule to perform channel grouping and then half-convolution to extract features, thus obtaining the half-feature map; The first feature map is input into the residual submodule, and features are extracted through at least two sequentially connected convolutional layers. Then, the residual feature map is skipped and connected to the first feature map to obtain the residual feature map.
4. The ECG signal-based identity recognition method according to claim 3, characterized in that, The step of inputting the second feature map into the grouped half-convolution submodule for channel grouping and then extracting features via half-convolution to obtain the half-feature map includes: The second feature map is grouped according to its channels to obtain the first subgroup corresponding to the second feature map, and the first subgroup is further grouped to obtain two second subgroups; Perform a Fourier convolution operation on the first subgroup to extract features, obtain subgroup features, and keep the remaining second subgroup unchanged; The subgroup features are concatenated with the remaining second subgroup to obtain the folded feature map.
5. The ECG signal-based identity recognition method according to claim 2, characterized in that, The outputs of the grouped halved convolutional submodule and the residual submodule are respectively connected to the input of the dynamic spatial attention submodule. The dynamic spatial attention submodule includes a fusion layer, a global average pooling layer, a micro double-layer convolutional network, and a first convolutional layer connected in sequence. The fused halved feature map and the residual feature map are then dynamically convolved at the spatial level to obtain the target feature map, which includes: A fused feature map is obtained by fusing the folded feature map and the residual feature map using the fusion layer; The fused feature map is input into the global average pooling layer for global average pooling, and then input into the micro dual-layer convolutional network for convolution to obtain the dynamic convolutional kernel corresponding to the fused feature map. The fused feature map is averaged across channels to obtain the spatial descriptor corresponding to the fused feature map. The spatial descriptor and the dynamic convolution kernel are then input into the first convolutional layer for convolution to obtain dynamic spatial attention weights. The fused feature map and the dynamic spatial attention weights are then multiplied along the channels to obtain the target feature map.
6. The ECG signal-based identity recognition method according to claim 2, characterized in that, The step of iteratively training the label prediction module based on the target feature map, and performing domain adversarial training by calculating the domain classification loss corresponding to the target feature map through the domain discrimination module until the domain classification loss is maximized, to obtain the target identity recognition model includes: The label prediction module calculates the loss based on the target feature map to obtain the label classification loss, and then backpropagates the label classification loss to the feature extraction module. The label prediction module and the feature extraction module are then iteratively trained by minimizing the label classification loss. The domain classification loss is obtained by calculating the loss based on the target feature map by the domain discrimination module, and the domain classification loss is backpropagated to the feature extraction module by the gradient reversal layer of the domain discrimination module. Domain adversarial training is carried out until the domain classification loss is maximized, so as to obtain the target identity recognition model.
7. The ECG signal-based identity recognition method according to claim 1, characterized in that, The electrocardiogram (ECG) image dataset includes multiple ECG data points, each ECG data point being associated with an individual label. The preprocessing of the ECG image dataset, dividing the preprocessed ECG image dataset into a source domain training set and a target domain training set, includes: The ECG data associated with each individual label are segmented by heartbeat to obtain an initial sequence; The initial sequence is normalized and standardized to obtain the heartbeat sequence; The heartbeat sequence is randomly divided into multiple first data and second data. The first data is used to form the source domain training set, and the second data is used to form the target domain training set. The acquisition time of the second data is different from that of the first data.
8. An identity recognition device based on ECG signals, characterized in that, The ECG signal-based identity recognition device, used in an identity recognition system, includes: The application module is used to input the target domain test set into the target identity recognition model to obtain the classification result; The target identity recognition model is determined through the following steps: The acquisition module is used to acquire a human electrocardiogram (ECG) image dataset, preprocess the ECG image dataset, and segment the preprocessed ECG image dataset into a source domain training set and a target domain training set. A model acquisition module is used to acquire a domain adversarial model, wherein the domain adversarial model includes an initial feature extraction module; An improvement module is used to remove the initial feature module based on the domain adversarial model, extract features through a dual-branch architecture combining grouped half-convolution and residuals, and introduce a dynamic spatial attention mechanism for feature enhancement to obtain an improved intermediate model. The training module is used to iteratively train the intermediate model using the source domain training set and the target domain training set to obtain the target identity recognition model.
9. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the ECG signal-based identification method as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the ECG signal-based identity recognition method according to any one of claims 1 to 7.