Physiological electrical signal classification method, device, electronic device and storage medium
By combining labelless and labeled data, using timing misalignment processing and neural network model training, a physiological electrical signal feature extraction model is generated, which solves the problem of lack of labeled data in the existing technology, and improves physiological electrical signal classification in sleep analysis Accuracy and user experience.
Patent Information
- Application Number
- CN202210255157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-15
AI Technical Summary
In the prior art, due to the lack of labeled data, the accuracy of physiological electrical signal classification models is low and the user experience is poor. Especially in the fields of sleep staging, data lacking accurate labels affects the performance of deep learning models.
By combining labelless data and labeled data, using timing misalignment processing and neural network model training, a physiological electrical signal feature extraction model is generated to improve classification accuracy. The specific steps include obtaining the physiological electrical signal training data set, performing timing misalignment processing, inputting the neural network model to calculate the loss function, updating the model parameters until converging, and generating a physiological electrical signal feature extraction model.
The accuracy and user experience of the physiological signal classification model are improved, and the robustness and processing accuracy of the model are improved by effectively utilizing labelless data and labeled data.
Smart Images

Figure CN114757260B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a physiological electrical signal classification method, device, electronic equipment and storage medium. Background Art
[0002] Sleep is a life process that humans have developed in the long process of evolution in order to adapt to changes in circadian rhythms. It is an indispensable physiological process for humans and has many important meanings, such as reducing energy consumption, memory encoding, memory consolidation, and remodeling brain function.
[0003] At present, due to work pressure and other reasons, more and more people suffer from sleep problems to varying degrees. To address this problem, patients need to go to the hospital's sleep department for professional sleep analysis, and the classification of physiological electrical signals with time series is the most important part of sleep analysis.
[0004] The existing technology uses a physiological electrical signal classification method based on polysomnography (PSG) monitoring, which requires patients to undergo a full night of PSG monitoring in a professional sleep laboratory. The operation is cumbersome. However, the mainstream physiological electrical signal classification method in academia is to train a neural network model that can perform classification by using supervised learning methods. However, due to the difficulty in obtaining high-quality labeled data, it is currently difficult to train a model with high accuracy and good robustness. In addition, in the field of deep learning, the quantity and quality of data have a huge impact on the performance of deep learning models. In the field of physiological signal classification represented by sleep staging, there is a lack of accurately labeled data, resulting in low accuracy of the trained model and poor user experience. Summary of the invention
[0005] The present invention provides a physiological electrical signal classification method, device, electronic device and storage medium, which are used to solve the technical problem in the prior art that the lack of labeled data leads to low accuracy of the trained model and poor user experience. The present invention aims to improve the accuracy of the physiological signal classification model obtained by combining unlabeled data with labeled data for training, thereby improving the user experience.
[0006] In a first aspect, the present invention provides a method for classifying physiological electrical signals, comprising:
[0007] Acquire a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time series signal;
[0008] Inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal;
[0009] Determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category;
[0010] The physiological electrical signal feature extraction model is obtained by training based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set.
[0011] Furthermore, according to the physiological electrical signal classification method provided by the present invention, before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the method further includes:
[0012] Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data;
[0013] Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels;
[0014] Input the data in the physiological electrical signal training data set into a first neural network model to obtain a first output result; input the data in the time series misalignment data set into a second neural network model to obtain a second output result; calculate a first loss function according to the first output result and the second output result; wherein the first neural network model includes a feature extraction network, a mapping network and a classification network, and the second neural network model includes a feature extraction network and a mapping network;
[0015] Inputting the data in the physiological electrical signal training data set into the second neural network model to obtain a third output result; inputting the data in the time series misalignment data set into the first neural network model to obtain a fourth output result; calculating a second loss function according to the third output result and the fourth output result;
[0016] Determine a total loss function according to the first loss function and the second loss function, and train the first neural network model and the second neural network model according to the total loss function until the first neural network model converges;
[0017] The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained first neural network model.
[0018] Further, according to the physiological electrical signal classification method provided by the present invention, the training data in the physiological electrical signal training data set is subjected to time sequence misalignment processing to obtain a time sequence misalignment data set corresponding to the physiological electrical signal training data set, including:
[0019] Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data;
[0020] The plurality of replicated training data are moved in time sequence to obtain a plurality of replicated training data after time sequence movement;
[0021] The lengths of the multiple copied training data after the time sequence shift are aligned with the corresponding training data in the physiological electrical signal training data set to obtain a time sequence misaligned data set corresponding to the physiological electrical signal training data set.
[0022] Further, according to the physiological electrical signal classification method provided by the present invention, the data in the physiological electrical signal training data set is input into a first neural network model to obtain a first output result; the data in the time series misalignment data set is input into a second neural network model to obtain a second output result; and a first loss function is calculated according to the first output result and the second output result, including:
[0023] Input the data v in the physiological electrical signal training data set into the feature extraction network f of the first neural network model θ , get the first eigenvector y θ ; The first feature vector y θ Input the mapping network g of the first neural network model θ , and get the second eigenvector z θ ; The second eigenvector z θ Input the classification network q of the first neural network model θ , and get the third eigenvector q θ (z θ );
[0024] The data v' in the time series misalignment data set is input into the feature extraction network f of the second neural network model ε , and get the fourth eigenvector y′ ε ; The fourth eigenvector y′ ε Input the mapping network g of the second neural network model ε , and get the fifth eigenvector Z′ ε ;
[0025] For the first eigenvector y θ , the second eigenvector Z θ , the third eigenvector q θ(Z θ ), the fourth eigenvector y′ ε and the fifth eigenvector Z′ ε Perform l2 regularization processing; calculate the first loss function according to the result of l2 regularization processing; wherein the first loss function L θ,ε The calculation formula is:
[0026]
[0027] Further, according to the physiological electrical signal classification method provided by the present invention, the data in the physiological electrical signal training data set is input into the second neural network model to obtain a third output result; the data in the time series misalignment data set is input into the first neural network model to obtain a fourth output result; and the second loss function is calculated according to the third output result and the fourth output result, including:
[0028] Input the data v in the physiological electrical signal training data set into the feature extraction network f of the second neural network model ε , and get the sixth eigenvector y ε ; The sixth eigenvector y ε Input the mapping network g of the second neural network model ε , and get the seventh eigenvector Z ε ;
[0029] Input the data v in the time series misalignment data set into the feature extraction network f of the first neural network model θ , and get the eighth eigenvector y′ θ ; The eighth eigenvector y′ θ Input the mapping network g of the first neural network model θ , and get the ninth eigenvector Z′ θ ; The ninth eigenvector Z′ θ Input the classification network q of the first neural network model θ , and get the tenth eigenvector q′ θ (Z′ θ );
[0030] For the sixth eigenvector y ε , the seventh eigenvector Z ε , the eighth eigenvector y′ θ , the ninth eigenvector Z′ θ and the tenth eigenvector q′ θ (z′ θ ) performs l2 regularization processing; calculates the second loss function according to the result of l2 regularization processing; wherein the second loss function L′ θ,ε The calculation formula is:
[0031]
[0032] Further, according to the physiological electrical signal classification method provided by the present invention, determining the total loss function according to the first loss function and the second loss function, and training the first neural network model and the second neural network model according to the total loss function until the first neural network model converges, includes:
[0033] The total loss function is determined according to the first loss function and the second loss function; wherein the calculation formula of the total loss function is:
[0034] L los,s =L θ,ε +L′ θ,ε ;
[0035] Determining whether the first neural network model converges according to the total loss function;
[0036] In the case of non-convergence, the parameters of the first neural network model are updated by gradient updating; wherein the updating formula of the parameters of the first neural network model is:
[0037]
[0038] Among them, optimizer is the optimizer, θ is the parameter of the first neural network model, and η is the learning rate;
[0039] In the case of non-convergence, the parameters of the second neural network model are updated; wherein the updating formula of the parameters in the second neural network model is:
[0040] ε←τε+(1-τ)θ;
[0041] Wherein, ε is the parameter of the second neural network model, τ is the iteration rate after one round of training of the second neural network model, where τ∈(0,1);
[0042] In the case of convergence, the training process of the first neural network model and the second neural network model is ended.
[0043] Further, according to the physiological electrical signal classification method provided by the present invention, the feature extraction network in the trained first neural network model is used to generate the physiological electrical signal feature extraction model, including:
[0044] Adding a fully connected network at the end of the feature extraction network in the trained first neural network model to obtain an initial physiological electrical signal feature extraction model;
[0045] Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating a network loss according to the feature vector and label information corresponding to the labeled physiological electrical signal training data;
[0046] The parameters in the physiological electrical signal feature extraction model are updated by back-propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
[0047] Furthermore, according to the physiological electrical signal classification method provided by the present invention, before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the method further includes:
[0048] Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data;
[0049] Performing data augmentation processing on the training data in the physiological electrical signal training data set to obtain an augmented data set corresponding to the physiological electrical signal training data set; wherein the augmented data set includes: augmented data with labels and augmented data without labels;
[0050] Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels;
[0051] Input the first type of data in the augmented data set into the third neural network model to obtain a third output result; input the second type of data in the augmented data set into the fourth neural network model to obtain a fourth output result; input the data in the time series misalignment data set into the fifth neural network model to obtain a fifth output result; calculate a third loss function based on the third output result and the fourth output result; calculate a fourth loss function based on the fourth output result and the fifth output result; wherein the third neural network model, the fourth neural network model and the fifth neural network model all include a feature extraction network, a mapping network and a classification network;
[0052] Determine a target loss function according to the third loss function and the fourth loss function, and train the third neural network model, the fourth neural network model and the fifth neural network model according to the target loss function until the fourth neural network model converges;
[0053] The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained fourth neural network model.
[0054] Further, according to the physiological electrical signal classification method provided by the present invention, the training data in the physiological electrical signal training data set is subjected to data augmentation processing to obtain an augmented data set corresponding to the physiological electrical signal training data set, including:
[0055] Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data;
[0056] Performing augmentation processing on the plurality of replicated training data according to a preset threshold within a unit time to obtain augmented first-category training data;
[0057] Performing augmentation processing on the plurality of replicated training data according to a preset threshold value within a unit time to obtain augmented second-category training data;
[0058] The augmented data set is obtained according to the first category of training data and the second category of training data.
[0059] Further, according to the physiological electrical signal classification method provided by the present invention, the first type of data in the augmented data set is input into a third neural network model to obtain a third output result; the second type of data in the augmented data set is input into a fourth neural network model to obtain a fourth output result; and a third loss function is calculated according to the third output result and the fourth output result, including:
[0060] The first type of data v in the augmented data set 1 Input the feature extraction network f of the third neural network model θ1 , and get the eleventh eigenvector y θ1 ; The eleventh eigenvector y θ1 Input the mapping network g of the third neural network model θ1 , and get the twelfth eigenvector z θ1 ; The twelfth eigenvector z θ1 Input the classification network q of the third neural network model θ1 , and get the thirteenth eigenvector q θ1 (z θ1 );
[0061] The second type of data v in the augmented data set 2 Input the feature extraction network f of the fourth neural network model θ2 , and get the fourteenth eigenvector y θ2 ; The fourteenth eigenvector y θ2Input the mapping network g of the fourth neural network model θ2 , and get the fifteenth eigenvector z θ2 ; The fifteenth eigenvector z θ2 Input the classification network q of the fourth neural network model θ2 , and get the sixteenth eigenvector q θ2 (z θ2 );
[0062] For the eleventh eigenvector y θ1 , the twelfth eigenvector z θ1 、The thirteenth eigenvector q θ1 (z θ1 ), the fourteenth eigenvector y θ2 、The fifteenth eigenvector z θ2 and the sixteenth eigenvector q θ2 (z θ2 ) to calculate the difference and obtain a third loss function, wherein the calculation formula of the third loss function is:
[0063]
[0064] Further, according to the physiological electrical signal classification method provided by the present invention, the second type of data in the augmented data set is input into a fourth neural network model to obtain a fourth output result; the data in the time series misalignment data set is input into a fifth neural network model to obtain a fifth output result; and a fourth loss function is calculated according to the fourth output result and the fifth output result, including:
[0065] The second type of data v in the augmented data set 2 Input the feature extraction network f of the fourth neural network model θ2 , and get the fourteenth eigenvector y θ2 ; The fourteenth eigenvector y θ2 Input the mapping network g of the fourth neural network model θ2 , and get the fifteenth eigenvector z θ2 ; The fifteenth eigenvector z θ2 Input the classification network q of the fourth neural network model θ2 , and get the sixteenth eigenvector q θ2 (z θ2 );
[0066] The data v' in the time series misalignment data set is input into the feature extraction network f of the fifth neural network model. ε , and get the seventeenth eigenvector y ε ; The seventeenth eigenvector y ε Input the mapping network g of the fifth neural network model ε, we get eighteen eigenvectors z ε ; The eighteenth eigenvector z ε Input the classification network q of the fifth neural network model ε , and we get the nineteenth eigenvector q ε (z ε );
[0067] For the fourteenth eigenvector y θ2 、The fifteenth eigenvector z θ2 , the sixteenth eigenvector q θ2 (z θ2 ), the seventeenth eigenvector y ε , Eighteen eigenvectors z ε and the nineteenth eigenvector q ε (z ε ) to calculate the difference and obtain a fourth loss function, wherein the calculation formula of the fourth loss function is:
[0068]
[0069] Further, according to the physiological electrical signal classification method provided by the present invention, the target loss function is determined according to the third loss function and the fourth loss function, and the third neural network model, the fourth neural network model and the fifth neural network model are trained according to the target loss function until the fourth neural network model converges, including:
[0070] The target loss function is determined according to the third loss function and the fourth loss function; wherein the calculation formula of the target loss function is:
[0071] L total =L Intrasample1 +L Intersample2 ;
[0072] Determining whether the fourth neural network model converges according to the target loss function;
[0073] In the case of non-convergence, the parameters of the fourth neural network model are updated by gradient updating; wherein the updating formula of the parameters of the fourth neural network model is:
[0074]
[0075] Among them, optimizer is the optimizer, θ 2 are the parameters of the fourth neural network model, and η is the learning rate;
[0076] In the case of non-convergence, the parameters of the third neural network model and the fifth neural network model are updated; wherein the updating formula of the parameters in the third neural network model is:
[0077] θ 1 ←τθ 1 +(1-τ)θ 2 ;
[0078] Among them, θ 1 is the parameter of the third neural network model, τ is the iteration rate after one round of training of the third neural network model, where τ∈(0,1), θ 2 are the parameters of the fourth neural network model;
[0079] The updating formula of the parameters in the fifth neural network model is:
[0080] ε←τε+(1-τ)θ 2 ;
[0081] Wherein, ε is the parameter of the fifth neural network model, τ is the iteration rate after one round of training of the fifth neural network model, where τ∈(0,1);
[0082] In the case of convergence, the training process of the third neural network model, the fourth neural network model and the fifth neural network model is terminated.
[0083] Further, according to the physiological electrical signal classification method provided by the present invention, the feature extraction network in the trained fourth neural network model is used to generate the physiological electrical signal feature extraction model, including:
[0084] Adding a fully connected network to the end of the feature extraction network in the trained fourth neural network model to obtain an initial physiological electrical signal feature extraction model;
[0085] Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating a network loss according to the feature vector and label information corresponding to the labeled physiological electrical signal training data;
[0086] The parameters in the physiological electrical signal feature extraction model are updated by back-propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
[0087] Further, according to the physiological electrical signal classification method provided by the present invention, determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of the physiological electrical signal of a known category includes:
[0088] Inputting a plurality of labeled physiological electrical signals into the physiological electrical signal feature extraction model to obtain feature vectors of the plurality of labeled physiological electrical signals;
[0089] Performing cluster analysis on the characteristic vectors of the plurality of labeled physiological electrical signals, and determining the centroid positions of the plurality of categories and the average distances between the data clusters according to the cluster analysis results and the labels corresponding to the plurality of labeled physiological electrical signals;
[0090] The distances between the feature vector of the target physiological electrical signal and the centroid positions of the multiple categories are calculated, and the category of the target physiological electrical signal is determined according to the distances and the average distances of the data clusters of the multiple categories.
[0091] Furthermore, according to the physiological electrical signal classification method provided by the present invention, the method further includes:
[0092] Inputting the classified physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the classified physiological electrical signal;
[0093] According to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category, the data quality and the label quality of the classified physiological electrical signal are detected.
[0094] Further, according to the physiological electrical signal classification method provided by the present invention, the data quality and label quality of the classified physiological electrical signal are detected according to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category, including:
[0095] When the distance between the feature vector of the classified physiological electrical signal and the centroid position of a known physiological electrical signal category is less than the average distance of the corresponding category, and the distance between the feature vector of the classified physiological electrical signal and the centroid position of other known physiological electrical signal categories is greater than the average distance of the corresponding category, and the label corresponding to the classified physiological electrical signal is inconsistent with the label of the physiological electrical signal category to which the nearest centroid position belongs, reduce the confidence of the label corresponding to the classified physiological electrical signal, and verify and re-verify the label corresponding to the classified physiological electrical signal;
[0096] In the case where the distance between the feature vector of the classified physiological electrical signal and the centroid position of any known physiological electrical signal category is greater than a preset multiple value of the average distance of the corresponding category, the classified physiological electrical signal is determined to be an outlier, and the classified physiological electrical signal is verified and analyzed;
[0097] When the distances between the characteristic vector of the classified physiological electrical signal and the centroid positions of at least two known physiological electrical signal categories are within preset multiples of the average distance of the corresponding category, and the difference between the distances is less than a preset value, the classified physiological electrical signal is determined to be low-quality data in an intermediate state, and a verification analysis is performed on the classified physiological electrical signal.
[0098] Furthermore, according to the physiological electrical signal classification method provided by the present invention, the method further includes:
[0099] Inputting the data in the standard data set into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the data in the standard data set; wherein the standard data set includes labeled data and unlabeled data;
[0100] Performing cluster analysis on the feature vectors of the data in the standard data set, and determining the centroid positions of multiple categories according to the labels of the labeled data in the standard data set;
[0101] Determining the labels of the unlabeled data in the standard data set according to the distance between the feature vector of the unlabeled data in the standard data set and the centroid positions of the multiple categories;
[0102] The labels of the unlabeled data in the standard data set are compared with the real labels of the unlabeled data in the standard data set obtained by other methods, and the accuracy of the physiological electrical signal feature extraction model is calculated.
[0103] Further, according to the physiological electrical signal classification method provided by the present invention, the step of obtaining the target physiological electrical signal to be classified includes:
[0104] A target physiological electrical signal to be classified is collected, and at least one of the following operations is performed on the target physiological electrical signal: a noise reduction operation, a desensitization operation, a data incompleteness confirmation, and a normalization operation.
[0105] In a second aspect, the present invention further provides a physiological electrical signal classification device, comprising:
[0106] An acquisition module, used for acquiring a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time sequence signal;
[0107] An input module, used for inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal;
[0108] A determination module, configured to determine the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category;
[0109] The physiological electrical signal feature extraction model is obtained by training based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set.
[0110] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned physiological electrical signal classification methods are implemented.
[0111] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described physiological electrical signal classification methods.
[0112] In a fifth aspect, the present invention further provides a computer program product, comprising computer executable instructions, which, when executed, are used to implement the steps of the physiological electrical signal classification method as described in any one of the above items.
[0113] The present invention provides a physiological electrical signal classification method, device, electronic device and storage medium, the method comprising: obtaining a target physiological electrical signal to be classified; inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; wherein the physiological electrical signal feature extraction model is obtained by training based on a physiological electrical signal training data set, a time sequence misalignment data set corresponding to the physiological electrical signal training data set, or a time sequence misalignment data set and an augmented data set corresponding to the physiological electrical signal training data set. The physiological signal processing method provided by the present invention can ensure the accuracy of the classification results, improve the processing accuracy of the physiological signal classification model, and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0114] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0115] Figure 1 It is a schematic diagram of the flow of the physiological electrical signal classification method provided by the present invention;
[0116] Figure 2 It is a flow chart of the training process of the physiological electrical signal feature extraction model provided by the present invention;
[0117] Figure 3 It is a schematic diagram of the training process of supervised learning of the physiological electrical signal feature extraction model provided by the present invention;
[0118] Figure 4 It is a schematic diagram of the training process of another physiological electrical signal feature extraction model provided by the present invention;
[0119] Figure 5 It is a flow chart of data quality and label quality analysis provided by the present invention;
[0120] Figure 6 It is a structural schematic diagram of the physiological electrical signal processing and classification device provided by the present invention;
[0121] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0122] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0123] Figure 1 A schematic diagram of the process of the physiological electrical signal processing method provided by the present invention is shown in FIG. Figure 1 As shown, the present invention provides a physiological electrical signal processing method, comprising:
[0124] Step 101: Acquire a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time series signal.
[0125] In this embodiment, it is necessary to obtain the target physiological electrical signal data monitored by the user's whole night sleep, and then check the integrity and availability of the target physiological electrical signal data, and pre-process the physiological electrical signal data under the premise of ensuring the integrity and availability of the acquired target physiological electrical signal data, wherein the target physiological electrical signal is a time series signal; it should be noted that during the pre-processing, the methods adopted include any one of the following: bandpass filter filtering, LMS adaptive filtering, Wiener filtering, filtering method based on statistical model, filtering method based on neural network, maximum and minimum normalization, sigmoid normalization and other processing, and the physiological electrical signal data after the pre-processing is used for subsequent processing.
[0126] It should be noted that the target physiological electrical signals are obtained based on polysomnography. Polysomnography (PSG), also known as sleep electroencephalogram, is mainly used for sleep and dream research and the diagnosis of depression and sleep apnea syndrome.
[0127] It should be noted that, in this embodiment, the target physiological electrical signal refers to the EEG signal data, and in other embodiments it may also be an EO signal or a mandibular electromyography signal, which can be set according to the actual needs of the user and is not specifically limited here.
[0128] Step 102: Input the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal.
[0129] In this embodiment, the target physiological electrical signal obtained in step 101 is input into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal. It should be noted that the physiological electrical signal in the embodiment of the present invention can be data of any signal event to be detected (i.e., an event with a certain signal feature), wherein the signal includes but is not limited to PSG signals, electrocardiogram signals or electroencephalogram signals.
[0130] It should be noted that the physiological electrical signal feature extraction model used in this embodiment is obtained by training using a supervised learning method based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set. It can make full use of a large amount of unlabeled training data existing in the prior art to improve the processing efficiency and accuracy of the physiological electrical signal feature extraction model.
[0131] Step 103: determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category;
[0132] The physiological electrical signal feature extraction model is obtained by training based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set.
[0133] In this embodiment, it is necessary to calculate the distance between the extracted feature vector of the target physiological electrical signal and the feature vector of the known category physiological electrical signal, and then compare the obtained distance value with the preset threshold value to determine the category of the target physiological electrical signal. If the category is A, it corresponds to deep sleep, indicating that the target user's sleep quality is relatively good. If it is always in a shallow sleep state, it means that the target user's sleep quality is poor.
[0134] It should be noted that, in this embodiment, the characteristic vector of the target physiological electrical signal can be determined by the t-SNE method, wherein t-SNE (t-distributed stochastic neighbor embedding) is a machine learning algorithm for dimensionality reduction, which was proposed by Laurens van der Maaten and Geoffrey Hinton in 2008. t-SNE is a nonlinear dimensionality reduction algorithm, which is very suitable for reducing high-dimensional data to 2 or 3 dimensions for visual display.
[0135] It should be noted that the categories can be information corresponding to each sleep stage, or can be corresponding different scores, where the sleep stages include falling asleep, light sleep, deep sleep, deep sleep, and rapid eye movement. The categories can be set according to the actual needs of the user and are not specifically limited here.
[0136] According to the physiological electrical signal classification method provided by the present invention, a target physiological electrical signal to be classified is obtained; the target physiological electrical signal is a time series signal; the target physiological electrical signal is input into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; and the category of the target physiological electrical signal is determined according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category. The physiological signal processing method provided by the present invention can ensure the accuracy of the classification result, improve the processing accuracy of the physiological signal classification model, and enhance the user experience.
[0137] Based on any of the above embodiments, in this embodiment, before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the method further includes:
[0138] Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data;
[0139] Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels;
[0140] Input the data in the physiological electrical signal training data set into a first neural network model to obtain a first output result; input the data in the time series misalignment data set into a second neural network model to obtain a second output result; calculate a first loss function according to the first output result and the second output result; wherein the first neural network model includes a feature extraction network, a mapping network and a classification network, and the second neural network model includes a feature extraction network and a mapping network;
[0141] Inputting the data in the physiological electrical signal training data set into the second neural network model to obtain a third output result; inputting the data in the time series misalignment data set into the first neural network model to obtain a fourth output result; calculating a second loss function according to the third output result and the fourth output result;
[0142] Determine a total loss function according to the first loss function and the second loss function, and train the first neural network model and the second neural network model according to the total loss function until the first neural network model converges;
[0143] The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained first neural network model.
[0144] In this embodiment, it is necessary to complete the training of the physiological electrical signal feature extraction model, and the training data includes not only the data in the physiological electrical signal training data set, but also the data in the timing misalignment data set obtained by timing misalignment processing, wherein the physiological electrical signal feature extraction model is composed of a two-part model, which is divided into a first neural network model and a second neural network model, wherein the first neural network model consists of three parts, and the second neural network model consists of two parts.
[0145] Among them, the first layer of the first neural network model and the second neural network model are both feature extraction networks, which adopt the deep learning convolutional neural network method. The feature extraction layer is constructed by convolution layer, pooling layer, activation layer and normalization layer, which can be used to extract deep semantic information of physiological electrical signal data and transmit the deep semantic information to the mapping network.
[0146] The second layers of the first neural network model and the second neural network model are both mapping networks, which are fully connected neural network mapping networks designed after the aforementioned feature extraction network to extract deep semantic information again. The third layer of the first neural network model is a fully connected network, which is connected to another fully connected neural network after the aforementioned mapping network to further extract information and classify the physiological electrical signal data.
[0147] In this embodiment, it is necessary to perform time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set, which includes labeled time-series misalignment data and unlabeled time-series misalignment data. The first neural network model and the second neural network model are trained according to the data in the physiological electrical signal training data set and the data in the time-series misalignment data set to obtain a physiological electrical signal feature extraction model.
[0148] In this embodiment, it is necessary to input the data in the physiological electrical signal training data set into the first neural network model to obtain the first output result, input the data in the time sequence misalignment data set into the second neural network model to obtain the second output result, calculate the first loss function based on the first output result and the second output result, and then input the data in the physiological electrical signal training data set into the second neural network model to obtain the third output result, input the data in the time sequence misalignment data set into the first neural network model to obtain the fourth output result, calculate the second loss function based on the third output result and the fourth output result, determine the total loss function based on the first loss function and the second loss function, and then train the network model based on the total loss function until the first neural network model converges to obtain the physiological electrical signal feature extraction model. Among them, the physiological electrical signal feature extraction model is obtained based on the feature extraction network in the first neural network model.
[0149] It should be noted that in this embodiment, a large number of unlabeled PSG physiological electrical signal data are used as the original data in the physiological electrical signal training data set. The first neural network model and the second neural network model are used to realize the deep extraction of feature meanings and the integration and refinement of high-level abstract information to form feature vectors, and further dimensionality reduction processing is performed through neural network mapping and a fully connected layer. After that, the loss function of the two sets of feature vectors extracted by regularization calculation is obtained, and another set of loss functions is calculated by exchanging input data, and the total loss function is summed up. Then, the loss function value is minimized by back propagation and gradient descent methods to ensure that the first neural network model and the second neural network model can extract similar information and features. The coordinated adjustment of the two neural network models is ensured by the linkage model parameter update amplitude, and the model is gradually optimized, so that the trained physiological electrical signal feature extraction model can judge and evaluate the extraction ability of high-level feature information of the network through cluster analysis, and can be used in tasks such as supervised classification and feature analysis.
[0150] According to the physiological electrical signal classification method provided by the present invention, the physiological electrical signal feature extraction model is composed of a first neural network model and a second neural network model, and the first neural network model is composed of a feature extraction network, a mapping network and a fully connected network, and the second neural network model is composed of a feature extraction network and a mapping network, so that the obtained physiological electrical signal feature extraction model can ensure the accuracy of the extraction results, improve the accuracy and precision of feature processing, and enhance the user experience.
[0151] Based on any of the above embodiments, in this embodiment, the training data in the physiological electrical signal training data set is subjected to time sequence misalignment processing to obtain a time sequence misalignment data set corresponding to the physiological electrical signal training data set, including:
[0152] Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data;
[0153] The plurality of replicated training data are moved in time sequence to obtain a plurality of replicated training data after time sequence movement;
[0154] The lengths of the multiple copied training data after the time sequence shift are aligned with the corresponding training data in the physiological electrical signal training data set to obtain a time sequence misaligned data set corresponding to the physiological electrical signal training data set.
[0155] In this embodiment, after obtaining the original data in the physiological electrical signal training data set, it is necessary to perform pre-processing such as denoising, desensitization, and data incompleteness confirmation on the original data in the physiological electrical signal training data set, and then perform time sequence misalignment processing on the original data in the physiological electrical signal training data set, that is, after the same segment of physiological electrical signal original data is copied, it is shifted by one unit in time sequence to ensure that each unit data can correspond to the physiological electrical signal data of the adjacent unit, and the physiological electrical signal original data and the time sequence misaligned data after the misalignment processing are determined as positive sample sets, and the first neural network model and the second neural network model are trained.
[0156] In this embodiment, if a complete electrophysiological signal is obtained, the electrophysiological signal is copied to generate an identical electrophysiological signal, and the copied electrophysiological signal data is moved forward or backward in time sequence by one signal unit, wherein the signal unit refers to one frame of data (30 seconds of data). If the forward movement is selected, the first frame of the copied electrophysiological signal data is removed, and the last frame of the original electrophysiological signal data is removed; if the backward movement is selected, the last unit of the copied electrophysiological signal data is removed, and the first unit of the original electrophysiological signal data is removed, ensuring that the length of the original electrophysiological signal data and the copied electrophysiological signal data remain consistent. Among them, the timing misalignment processing can be to move the original data of the physiological signal forward in time sequence, or to move the original data of the physiological signal backward in time sequence, which can be set according to the actual needs of the user and is not specifically limited here.
[0157] According to the physiological electrical signal classification method provided by the present invention, each training data in the physiological electrical signal training data set is copied to obtain multiple copied training data, and then the multiple copied training data are moved in time sequence to obtain multiple copied training data after time sequence movement; the multiple copied training data after time sequence movement are aligned in length with the corresponding training data in the physiological electrical signal training data set to obtain a time sequence misaligned data set corresponding to the physiological electrical signal training data set, and training the model with the data in the time sequence misaligned data set can improve the accuracy and efficiency of the physiological electrical signal feature extraction model processing.
[0158] Based on any of the above embodiments, in this embodiment, the step of inputting data in the physiological electrical signal training data set into a first neural network model to obtain a first output result; inputting data in the timing misalignment data set into a second neural network model to obtain a second output result; and calculating a first loss function according to the first output result and the second output result includes:
[0159] Input the data v in the physiological electrical signal training data set into the feature extraction network f of the first neural network model θ , get the first eigenvector y θ ; The first feature vector y θ Input the mapping network g of the first neural network model θ , and get the second eigenvector Z θ ; The second eigenvector Z θ Input the classification network q of the first neural network model θ , and get the third eigenvector q θ (Z θ );
[0160] The data v in the time series misalignment data set is input into the feature extraction network f of the second neural network model ε , and get the fourth eigenvector y′ ε ; The fourth eigenvector y′ ε Input the mapping network g of the second neural network model ε , and get the fifth eigenvector Z′ ε ;
[0161] For the first eigenvector y θ , the second eigenvector Z θ , the third eigenvector q θ (Z θ ), the fourth eigenvector y′ ε and the fifth eigenvector Z′ ε Perform l2 regularization processing; calculate the first loss function according to the result of l2 regularization processing; wherein the first loss function L θ,ε The calculation formula is:
[0162]
[0163] In this implementation, it is necessary to obtain the calculation formula of the first loss function. If the original data in a collected physiological electrical signal training data set is processed by data time sequence dislocation, two segments of physiological electrical signal data that are positive samples of each other are obtained with the original data in the physiological electrical signal training data set, which are respectively recorded as v and v'. Figure 2 As shown, the data v in the physiological electrical signal training data set and the data v' in the time sequence misalignment data set are respectively passed through the first neural network model and the second neural network model, and the data v in the physiological electrical signal training data set is passed through the feature extraction network, mapping network and classification network layer in the first neural network model, and the obtained feature vector data are y θ 、z θ ,q θ (z θ), and the data v' in the time series misalignment data set is obtained by the extraction network and mapping network of the second neural network model to obtain the feature vector y' ε and z′ ε . The parameters of the first neural network model are represented by θ, and the parameters of the second neural network model are represented by ε.
[0164] Then proceed with 2 Regularization processing is specifically shown in formula (2) and formula (3).
[0165]
[0166]
[0167] Then the loss value of the first loss function is calculated based on the regularized data as Lθ, ε:
[0168]
[0169] The loss value of the first loss function obtained above can be used in the subsequent calculation of the total loss function. The degree of convergence of the model training can be judged according to the obtained total loss function. For details, see the following embodiments, which will not be introduced in detail here.
[0170] According to the physiological electrical signal classification method provided by the present invention, by respectively inputting the data in the physiological electrical signal training data set and the data in the time series misalignment data set into the first neural network model and the second neural network model, a first loss function is obtained, which can improve the accuracy and efficiency of the physiological electrical signal feature extraction model processing.
[0171] Based on any of the above embodiments, in this embodiment, the step of inputting the data in the physiological electrical signal training data set into the second neural network model to obtain a third output result; inputting the data in the timing misalignment data set into the first neural network model to obtain a fourth output result; and calculating the second loss function according to the third output result and the fourth output result includes:
[0172] Input the data v in the physiological electrical signal training data set into the feature extraction network f of the second neural network model ε , and get the sixth eigenvector y ε ; The sixth eigenvector y ε Input the mapping network g of the second neural network model ε , and get the seventh eigenvector Z ε ;
[0173] Input the data v in the time series misalignment data set into the feature extraction network f′ of the first neural network model θ , and get the eighth eigenvector y′θ ; The eighth eigenvector y′ θ Input the mapping network g of the first neural network model θ , and get the ninth eigenvector z' θ ; The ninth eigenvector Z' θ Input the classification network q of the first neural network model θ , and get the tenth eigenvector q' θ (z' θ );
[0174] For the sixth eigenvector y ε , the seventh eigenvector z ε 、The eighth eigenvector y' θ 、The ninth eigenvector z' θ and the tenth eigenvector q′θ ( z' θ ) performs l2 regularization processing; calculates the second loss function according to the result of l2 regularization processing; wherein the second loss function L′ θ,ε The calculation formula is:
[0175]
[0176] In this embodiment, the operation process of the above embodiment needs to be reversed, and the data v in the time sequence misalignment data set is input into the first neural network model, and the data v in the physiological electrical signal training data set is input into the second neural network model, and y′ is obtained respectively. θ 、z' θ ,q' θ (z' θ ) and y ε 、z ε , similar to formula (2), and then through l 2 Regularization processing, calculate the loss value of the second loss function, and get L' θ , ε, the specific calculation method is as follows formula (5):
[0177]
[0178] The loss value of the second loss function obtained above is used in the subsequent calculation of the total loss function. The degree of convergence of the model training is judged according to the obtained total loss function. For details, see the following embodiment, which will not be introduced in detail here.
[0179] According to the physiological electrical signal classification method provided by the present invention, by respectively inputting the data in the physiological electrical signal training data set and the data in the time series misalignment data set into the second neural network model and the first neural network model, a second loss function is obtained, which can improve the accuracy and efficiency of the physiological electrical signal feature extraction model processing.
[0180] Based on any of the foregoing embodiments, in this embodiment, determining a total loss function according to the first loss function and the second loss function, and training the first neural network model and the second neural network model according to the total loss function until the first neural network model converges, includes:
[0181] The total loss function is determined according to the first loss function and the second loss function; wherein the calculation formula of the total loss function is:
[0182] L loss =L θ,ε +L′ θ,ε ;
[0183] Determining whether the first neural network model converges according to the total loss function;
[0184] In the case of non-convergence, the parameters of the first neural network model are updated by gradient updating; wherein the updating formula of the parameters of the first neural network model is:
[0185]
[0186] Among them, optimizer is the optimizer, θ is the parameter of the first neural network model, and η is the learning rate;
[0187] In the case of non-convergence, the parameters of the second neural network model are updated; wherein the updating formula of the parameters in the second neural network model is:
[0188] ε←τε+(1-τ)θ;
[0189] Wherein, ε is the parameter of the second neural network model, τ is the iteration rate after one round of training of the second neural network model, where τ∈(0,1);
[0190] In the case of convergence, the training process of the first neural network model and the second neural network model is ended.
[0191] In this embodiment, it is necessary to determine the total loss function based on the formula of the second loss function obtained above and the first loss function, and add the values of formula (1) and formula (4) to obtain the total loss function L loss , as shown in formula (6).
[0192] L loss =L θ,ε +L' θ,ε (6)
[0193] It should be noted that in this embodiment, the parameters of the physiological signal classification model need to be updated by back propagation to obtain the parameters of the feature extraction network. The back propagation algorithm is used to update the parameters. In this process, θ maintains the parameter update and ε stops the gradient update. The parameter update formula of the first neural network model is shown in formula (7), where optimizer is the optimizer, θ is the parameter of the first neural network model, and η is the learning rate.
[0194]
[0195] The parameter update of the second neural network model adopts formula (8), where ε is the parameter of the second neural network model, τ is the iteration rate after one round of neural network training, and τ∈(0, 1).
[0196] ε←τε+(1-τ)θ (8)
[0197] After the relevant parameter update operation is completed, the physiological electrical signal feature extraction model with parameter initialization settings is obtained, which is used for subsequent transfer learning data classification or data feature analysis, data quality analysis, label quality evaluation and other tasks.
[0198] According to the physiological electrical signal classification method provided by the present invention, the first neural network model and the second neural network model are trained by determining the total loss function until the first neural network model converges. The obtained physiological electrical signal feature extraction model has higher precision, thereby improving the accuracy of physiological electrical signal classification.
[0199] Based on any of the above embodiments, in this embodiment, the feature extraction network in the trained first neural network model is used to generate the physiological electrical signal feature extraction model, including:
[0200] Adding a fully connected network at the end of the feature extraction network in the trained first neural network model to obtain an initial physiological electrical signal feature extraction model;
[0201] Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating a network loss according to the feature vector and label information corresponding to the labeled physiological electrical signal training data;
[0202] The parameters in the physiological electrical signal feature extraction model are updated by back-propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
[0203] In this embodiment, if Figure 3As shown, by adding a fully connected network at the end of the feature extraction network in the trained first neural network model obtained in the above embodiment, an initial physiological electrical signal feature extraction model is obtained, and then the labeled physiological electrical signal training data is input into the initial physiological electrical signal feature extraction model to obtain the corresponding feature vector, and the network loss is calculated according to the label information corresponding to the feature vector and the labeled physiological electrical signal training data, and the parameters in the physiological electrical signal feature extraction model are updated by back propagation according to the network loss. When the model converges, the final physiological electrical signal feature extraction model is obtained.
[0204] It should be noted that a fully connected network is added after the feature extraction network in the first neural network model to form a network with classification capabilities, and the network is supervised by using labeled physiological electrical signals, and all model parameters are set to be gradient variable, and appropriate hyperparameters such as optimizer, learning rate, number of training segments, and training rounds are set. The model is trained, and the accuracy, recall, precision and other indicators of the model are calculated on the test data set until the model converges and the accuracy of the test set is stable.
[0205] It should be noted that in this embodiment, the physiological electrical signal data is randomly enhanced. In the supervised classification task, in order to increase the generalization and robustness of the model and improve the accuracy, the data enhancement methods used include but are not limited to time domain shift, frequency domain shift, Gaussian noise addition, pulse waveform addition, cropping, speed change, etc. Then, the enhanced physiological electrical signal data is input into the initial physiological electrical signal feature extraction model to obtain the output of the signal data. It should be noted that all parameter gradients in the physiological electrical signal feature extraction model set before this are variable, and the output feature vector is obtained together with the original label information to calculate the network loss of the model; and it is also necessary to set a suitable learning rate, and use the calculated loss back propagation to update the neural network parameters.
[0206] According to the physiological electrical signal classification method provided by the present invention, a fully connected network is added at the end of the feature extraction network in the trained first neural network model to obtain an initial physiological electrical signal feature extraction model, and then the model is trained using labeled physiological electrical signal data. When the model converges, the final physiological electrical signal feature extraction model is obtained, which ensures the extraction accuracy of the model and improves the efficiency of model processing.
[0207] Based on any of the above embodiments, in this embodiment, before inputting the target physiological electrical signal into the pre-trained physiological electrical signal feature extraction model, the method further includes:
[0208] Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data;
[0209] Performing data augmentation processing on the training data in the physiological electrical signal training data set to obtain an augmented data set corresponding to the physiological electrical signal training data set; wherein the augmented data set includes: augmented data with labels and augmented data without labels;
[0210] Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels;
[0211] Input the first type of data in the augmented data set into the third neural network model to obtain a third output result; input the second type of data in the augmented data set into the fourth neural network model to obtain a fourth output result; input the data in the time series misalignment data set into the fifth neural network model to obtain a fifth output result; calculate a third loss function based on the third output result and the fourth output result; calculate a fourth loss function based on the fourth output result and the fifth output result; wherein the third neural network model, the fourth neural network model and the fifth neural network model all include a feature extraction network, a mapping network and a classification network;
[0212] Determine a target loss function according to the third loss function and the fourth loss function, and train the third neural network model, the fourth neural network model and the fifth neural network model according to the target loss function until the fourth neural network model converges;
[0213] The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained fourth neural network model.
[0214] In this embodiment, it is also necessary to complete the training of the physiological electrical signal feature extraction model. In this embodiment, the training data not only includes the augmented data set corresponding to the physiological electrical signal training data set, but also includes the data in the timing misaligned data set obtained by timing misalignment processing. Among them, the physiological electrical signal feature extraction model is composed of three models, which are divided into a third neural network model, a fourth neural network model and a fifth neural network model. Among them, the three neural network models are composed of three parts: a feature extraction network, a mapping network and a classification network.
[0215] In this embodiment, it is necessary to input the first data in the augmented data set into the third neural network model to obtain the third output result, input the second data in the augmented data set into the fourth neural network model to obtain the fourth output result, and input the data in the time-series misaligned data set into the fifth neural network model to obtain the fifth output result, and then calculate the third loss function according to the third output result and the fourth output result, calculate the fourth loss function according to the fourth output result and the fifth output result, determine the target loss function according to the third loss function and the fourth loss function, and then train the network model according to the target loss function until the fourth neural network model converges to obtain the physiological electrical signal feature extraction model. Among them, the physiological electrical signal feature extraction model is obtained based on the feature extraction network in the fourth neural network model. It should be noted that the role and function of each layer of each neural network model can be seen in the above embodiment, and will not be introduced in detail here.
[0216] According to the physiological electrical signal classification method provided by the present invention, the physiological electrical signal feature extraction model is composed of three neural network models, and each neural network model is composed of three parts, so that the obtained physiological electrical signal feature extraction model can ensure the accuracy of the extraction results, improve the accuracy and precision of feature processing, and enhance the user experience.
[0217] Based on any of the above embodiments, in this embodiment, data augmentation processing is performed on the training data in the physiological electrical signal training data set to obtain an augmented data set corresponding to the physiological electrical signal training data set, including:
[0218] Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data;
[0219] Performing augmentation processing on the plurality of replicated training data according to a preset threshold value within a unit time to obtain first-category training data after augmentation processing;
[0220] Performing augmentation processing on the plurality of replicated training data according to a preset threshold value within a unit time to obtain the second type of training data after augmentation processing;
[0221] An augmented data set is obtained according to the first type of training data and the second type of training data.
[0222] In this embodiment, each training data in the physiological electrical signal training data set is copied to obtain a plurality of copied training data, and the copied training data is augmented within a unit time. Since the augmentation process is random, the first type of training data and the second type of training data are determined according to the range of a preset threshold, and then the obtained first type of training data and the second type of training data are determined as augmented data sets. The augmentation process refers to processing such as translation and transformation of data.
[0223] According to the physiological electrical signal classification method provided by the present invention, by copying the data in the acquired physiological electrical signal training data set, and then augmenting the copied data, the obtained data is determined as the augmented data set, which can achieve the expansion of the training data set and improve the accuracy of model training.
[0224] Based on any of the foregoing embodiments, in this embodiment, the first type of data in the augmented data set is input into the third neural network model to obtain a third output result; the second type of data in the augmented data set is input into the fourth neural network model to obtain a fourth output result; and a third loss function is calculated according to the third output result and the fourth output result, including:
[0225] The first category of data v in the augmented data set 1 Input the feature extraction network f of the third neural network model θ1 , and get the eleventh eigenvector y θ1 ; The eleventh eigenvector y θ1 Input the mapping network g of the third neural network model θ1 , and get the twelfth eigenvector z θ1 ; The twelfth eigenvector z θ1 Input the classification network q of the third neural network model θ1 , and get the thirteenth eigenvector q θ1 (z θ1 );
[0226] The second type of data v in the augmented data set 2 Input the feature extraction network f of the fourth neural network model θ2 , and get the fourteenth eigenvector y θ2 ; The fourteenth eigenvector y θ2 Input the mapping network g of the fourth neural network model θ2 , and get the fifteenth eigenvector z θ2 ; The fifteenth eigenvector z θ2 Input the classification network q of the fourth neural network model θ2 , and get the sixteenth eigenvector q θ2 (z θ2 );
[0227] For the eleventh eigenvector y θ1 , the twelfth eigenvector z θ1 、The thirteenth eigenvector q θ1 (z θ1 ), the fourteenth eigenvector y θ2 、The fifteenth eigenvector z θ2 and the sixteenth eigenvector q θ2 (z θ2) to calculate the difference and obtain the third loss function, where the calculation formula of the third loss function is:
[0228]
[0229] In this embodiment, the first type of data in the augmented data set is input into the third neural network model and the second type of data in the augmented data set is input into the fourth neural network model, and then the third loss function is calculated according to the third output result and the fourth output result. In this embodiment, the third loss function is calculated according to the difference degree, and the specific difference degree calculation formula is:
[0230]
[0231] According to the physiological electrical signal classification method provided by the present invention, the accuracy and efficiency of the physiological electrical signal feature extraction model processing can be improved by calculating the third loss function through the difference.
[0232] Based on any of the above embodiments, in this embodiment, if Figure 4 As shown, the second type of data in the augmented data set is input into the fourth neural network model to obtain a fourth output result; the data in the time series misalignment data set is input into the fifth neural network model to obtain a fifth output result; and a fourth loss function is calculated according to the fourth output result and the fifth output result, including:
[0233] The second type of data v in the augmented data set 2 Input the feature extraction network f of the fourth neural network model θ2 , and get the fourteenth eigenvector y θ2 ; The fourteenth eigenvector y θ2 Input the mapping network g of the fourth neural network model θ2 , and get the fifteenth eigenvector z θ2 ; The fifteenth eigenvector z θ2 Input the classification network q of the fourth neural network model θ2 , and get the sixteenth eigenvector q θ2 (z θ2 );
[0234] Input the data v' in the time series misalignment dataset into the feature extraction network f of the fifth neural network model ε , and get the seventeenth eigenvector y ε ; The seventeenth eigenvector y ε Input the mapping network g of the fifth neural network model ε , we get eighteen eigenvectors z ε ; The eighteenth eigenvector z ε Input the classification network q of the fifth neural network modelε , and we get the nineteenth eigenvector q ε (z ε );
[0235] For the fourteenth eigenvector y θ2 、The fifteenth eigenvector z θ2 , the sixteenth eigenvector q θ2 (z θ2 ), the seventeenth eigenvector y ε , Eighteen eigenvectors z ε and the nineteenth eigenvector q ε (z ε ) to calculate the difference and obtain the fourth loss function, wherein the calculation formula of the fourth loss function is:
[0236]
[0237] In this embodiment, the fourth loss function is also calculated by the difference degree, the second category of data in the augmented data set is input into the fourth neural network model, and the data in the time-series misaligned data set is input into the fifth neural network model, and then the fourth loss function is calculated based on the fourth output result and the fifth output result.
[0238] According to the physiological electrical signal classification method provided by the present invention, the fourth loss function is calculated by the difference degree, so as to improve the accuracy and efficiency of the physiological electrical signal feature extraction model processing.
[0239] Based on any of the above embodiments, in this embodiment, a target loss function is determined according to the third loss function and the fourth loss function, and the third neural network model, the fourth neural network model and the fifth neural network model are trained according to the target loss function until the fourth neural network model converges, including:
[0240] The target loss function is determined according to the third loss function and the fourth loss function; wherein the calculation formula of the target loss function is:
[0241] L total =L Intrasample 1 +L Intersample2 (12)
[0242] Determining whether the fourth neural network model converges according to the target loss function;
[0243] In the case of non-convergence, the parameters of the fourth neural network model are updated by gradient updating; wherein the updating formula of the parameters of the fourth neural network model is:
[0244]
[0245] Among them, optimizer is the optimizer, θ 2 are the parameters of the fourth neural network model, and η is the learning rate;
[0246] In the case of non-convergence, the parameters of the third neural network model and the fifth neural network model are updated; wherein the updating formula of the parameters in the third neural network model is:
[0247] θ 1 ←τθ 1 +(1-τ)θ 2 (14)
[0248] Among them, θ 1 is the parameter of the third neural network model, τ is the iteration rate after one round of training of the third neural network model, where τ∈(0,1), θ 2 are the parameters of the fourth neural network model;
[0249] The updating formula of the parameters in the fifth neural network model is:
[0250] ε←τε+(1-τ)θ 2 (15)
[0251] Wherein, ε is the parameter of the fifth neural network model, τ is the iteration rate after one round of training of the fifth neural network model, where τ∈(0,1);
[0252] When convergence occurs, the training process of the third neural network model, the fourth neural network model and the fifth neural network model is terminated.
[0253] In this embodiment, the target loss function is determined by using the third loss function and the fourth loss function obtained in the above embodiment, and whether the fourth neural network model converges is determined based on the obtained target loss function. If it does not converge, the parameters in the fourth neural network model are updated by gradient updating until convergence, and the training process of the third neural network model, the fourth neural network model and the fifth neural network model is terminated to obtain a physiological electrical signal classification model.
[0254] According to the physiological electrical signal classification method provided by the present invention, the accuracy and efficiency of the physiological electrical signal feature extraction model processing can be improved by updating the parameters in each neural network model.
[0255] Based on any of the above embodiments, in this embodiment, based on the feature extraction network in the trained fourth neural network model, the physiological electrical signal feature extraction model is generated, including:
[0256] Adding a fully connected network to the end of the feature extraction network in the trained fourth neural network model to obtain an initial physiological electrical signal feature extraction model;
[0257] Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating the network loss according to the feature vector and the label information corresponding to the labeled physiological electrical signal training data;
[0258] The parameters in the physiological electrical signal feature extraction model are updated by back propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
[0259] In this embodiment, a fully connected network is added to the end of the feature extraction network in the fourth neural network model to obtain an initial physiological electrical signal feature extraction model. Finally, the physiological electrical signal feature extraction model is obtained based on the fourth neural network model. The specific processing process is the same as that in the above embodiment and will not be introduced in detail here.
[0260] According to the physiological electrical signal classification method provided by the present invention, a fully connected network is added at the end of the feature extraction network in the trained fourth neural network model to obtain an initial physiological electrical signal feature extraction model, and then the model is trained using labeled physiological electrical signal data. When the model converges, the final physiological electrical signal feature extraction model is obtained, which ensures the extraction accuracy of the model and improves the efficiency of model processing.
[0261] Based on any of the above embodiments, in this embodiment, determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category includes:
[0262] Inputting a plurality of labeled physiological electrical signals into the physiological electrical signal feature extraction model to obtain feature vectors of the plurality of labeled physiological electrical signals;
[0263] Performing cluster analysis on the characteristic vectors of the plurality of labeled physiological electrical signals, and determining the centroid positions of the plurality of categories and the average distances between the data clusters according to the cluster analysis results and the labels corresponding to the plurality of labeled physiological electrical signals;
[0264] The distances between the feature vector of the target physiological electrical signal and the centroid positions of the multiple categories are calculated, and the category of the target physiological electrical signal is determined according to the distances and the average distances of the data clusters of the multiple categories.
[0265] In this embodiment, it is necessary to input the labeled physiological electrical signal into the physiological electrical signal feature extraction model to obtain the feature vector of the physiological electrical signal, and then perform cluster analysis on the feature vector. According to the cluster analysis results and the label information corresponding to the physiological electrical signal, the centroid positions of multiple categories and the average distance of the data cluster are determined. According to the distance between the target physiological electrical signal and the centroid positions of multiple categories, the type of the target physiological electrical signal is determined. If the distance is close to category A and meets the preset conditions, category A is determined as the category of the target physiological electrical signal.
[0266] It should be noted that, in this embodiment, it is necessary to calculate the centroid point of the data cluster of each feature vector in different categories. The coordinates of the centroid point are the arithmetic mean of the corresponding coordinates of all data points in the corresponding category, and then the average value of the Euclidean distances between all data points and the centroid point is calculated. This method can be used to calculate the centroid point position of the data in each category and the average distance of the data cluster, which is used to determine the category of the target physiological electrical signal.
[0267] For example, if the calculated average distance of the data cluster is a, and it is determined that a target physiological electrical signal is closest to the centroid point of category A and is within the range of the average distance a of the data cluster of category A, then the category of the target physiological electrical signal is determined to be category A.
[0268] According to the physiological electrical signal classification method provided by the present invention, a plurality of physiological electrical signals with labels are input into the physiological electrical signal feature extraction model to obtain feature vectors of the plurality of physiological electrical signals with labels, and then cluster analysis is performed on the feature vectors of the plurality of physiological electrical signals with labels, and based on the results of the cluster analysis and the labels corresponding to the plurality of physiological electrical signals with labels, the centroid positions of a plurality of categories and the average distances of the data clusters are determined, and the distances between the feature vector of the target physiological electrical signal and the centroid positions of the plurality of categories are calculated, and based on the distances and the average distances of the data clusters of the plurality of categories, the category of the target physiological electrical signal is determined, thereby improving the accuracy of the physiological electrical signal classification processing and enhancing the user experience.
[0269] Based on any of the above embodiments, in this embodiment, the method further includes:
[0270] Inputting the classified physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the classified physiological electrical signal;
[0271] According to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category, the data quality and the label quality of the classified physiological electrical signal are detected.
[0272] In this embodiment, the classified physiological electrical signal needs to be input into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the physiological electrical signal, and then the data quality and label quality of the classified physiological electrical signal are detected based on the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category. It should be noted that in this embodiment, a large number of unlabeled physiological electrical signals in the prior art are used to determine the corresponding label information for the unlabeled physiological electrical signal data.
[0273] In this embodiment, if Figure 5 As shown in the figure, the data to be tested needs to be preprocessed and then input into the trained physiological electrical signal feature extraction model to obtain a feature vector containing high-level semantic information after dimensionality reduction, and then use tSNE or clustering methods to calculate and analyze the distribution and distance of the feature vector in high-dimensional space, calculate the centroid and average distance of each data cluster, and confirm the distance between the calculated feature vector and the centroid of each data to be tested, infer the possible corresponding label information, and compare the label information with the real label information to determine the label information of the physiological electrical signal data in the low confidence area. At the same time, by confirming the feature vector outliers and intermediate state points, the corresponding label information and data can be verified and analyzed, prompting to find out the wrong label information, low-quality outlier data, and low-quality intermediate state data, so as to improve the data quality.
[0274] It should be noted that it is necessary to calculate the centroid point of the data cluster of each feature vector in different categories. The coordinates of the centroid point are the average values of the corresponding coordinates of all data points in the corresponding category. Then, the average value of the Euclidean distance between these data points and the centroid point is calculated to determine the centroid point position of each category and the average distance between the data cluster.
[0275] According to the physiological electrical signal classification method provided by the present invention, the feature vector of the classified physiological electrical signal is obtained by inputting the classified physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, and the data quality and label quality of the classified physiological electrical signal are detected according to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category, thereby improving the quality of the physiological electrical signal data and the processing quality of the model.
[0276] Based on any of the above embodiments, in this embodiment, detecting the data quality and label quality of the classified physiological electrical signal according to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category includes:
[0277] When the distance between the feature vector of the classified physiological electrical signal and the centroid position of a known physiological electrical signal category is less than the average distance of the corresponding category, and the distance between the feature vector of the classified physiological electrical signal and the centroid position of other known physiological electrical signal categories is greater than the average distance of the corresponding category, and the label corresponding to the classified physiological electrical signal is inconsistent with the label of the physiological electrical signal category to which the nearest centroid position belongs, reduce the confidence of the label corresponding to the classified physiological electrical signal, and verify and re-verify the label corresponding to the classified physiological electrical signal;
[0278] In the case where the distance between the feature vector of the classified physiological electrical signal and the centroid position of any known physiological electrical signal category is greater than a preset multiple value of the average distance of the corresponding category, the classified physiological electrical signal is determined to be an outlier, and the classified physiological electrical signal is verified and analyzed;
[0279] When the distances between the characteristic vector of the classified physiological electrical signal and the centroid positions of at least two known physiological electrical signal categories are within preset multiples of the average distance of the corresponding category, and the difference between the distances is less than a preset value, the classified physiological electrical signal is determined to be low-quality data in an intermediate state, and a verification analysis is performed on the classified physiological electrical signal.
[0280] In this embodiment, the Euclidean distance is used to evaluate the data quality and label quality. The specific method is as follows: (1) If the distance between the classified physiological electrical signal in the test data and the centroid position of a known physiological electrical signal category is less than the average distance, and the distances from the centroid positions of other known physiological electrical signal categories are greater than the average distances of the corresponding categories, and the label corresponding to the classified physiological electrical signal is inconsistent with the category label information of the nearest centroid position, then the confidence of the label corresponding to the classified physiological electrical signal can be lowered, and the label information can be verified and re-verified; (2) If the feature vector distance of the classified physiological electrical signal in the test data is any If the distance between the centroid position of any known physiological electrical signal category exceeds twice the average distance of the corresponding category, the classified physiological electrical signal can be determined as outlier data, and the classified physiological electrical signal can be further verified and analyzed to determine whether the inference is correct; (3) If the Euclidean distance between the feature vector of the classified physiological electrical signal of the test data and the centroid position of two or more known physiological electrical signal categories is less than 10%, and the distance is within twice the average distance of the centroid position, then the classified physiological electrical signal can be considered as low-quality data in an intermediate state, and the classified physiological electrical signal can be further verified and analyzed to determine whether the inference is correct.
[0281] According to the physiological electrical signal classification method provided by the present invention, the processing accuracy of the physiological electrical signal feature extraction model can be improved by verifying the data quality and label quality of the classified physiological electrical signals.
[0282] Based on any of the above embodiments, in this embodiment, the method further includes:
[0283] Inputting the data in the standard data set into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the data in the standard data set; wherein the standard data set includes labeled data and unlabeled data;
[0284] Performing cluster analysis on the feature vectors of the data in the standard data set, and determining the centroid positions of multiple categories according to the labels of the labeled data in the standard data set;
[0285] Determining the labels of the unlabeled data in the standard data set according to the distance between the feature vector of the unlabeled data in the standard data set and the centroid positions of the multiple categories;
[0286] The labels of the unlabeled data in the standard data set are compared with the real labels of the unlabeled data in the standard data set obtained by other methods, and the accuracy of the physiological electrical signal feature extraction model is calculated.
[0287] In this embodiment, the data in the standard data set needs to be input into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the data in the standard data set, and the label of the unlabeled data is determined based on the distance between the feature vector and the centroid positions of multiple categories. The label is compared with the real label information of the unlabeled data, and the accuracy of the physiological electrical signal feature extraction model is calculated, wherein the distance of the feature vector is calculated using the above-mentioned specific calculation method, which is not introduced in detail here.
[0288] It should be noted that, in this embodiment, the labeled data and unlabeled data in the preprocessed standard data set (the standard data set ensures that the amount of data in each category is almost the same) are respectively input into the pre-trained physiological electrical signal feature extraction model to obtain the corresponding feature vectors, and a cluster analysis is performed, wherein 10% to 30% of the data in the standard data set are given label information, and the centroid position of each category of data is calculated based on the labeled data, and then the label information of the unlabeled data is inferred by calculating the distance between other unknown label data and the centroid positions of multiple categories, and it is compared with the real label information, and the accuracy of the physiological electrical signal feature extraction model is calculated, and the performance of the physiological electrical signal feature extraction model is evaluated based on the obtained accuracy.
[0289] According to the physiological signal processing method provided by the present invention, the centroid positions of multiple categories are calculated using labeled data in the standard data set, and the label information is obtained using unlabeled data. The accuracy of the physiological electrical signal feature extraction model is obtained by comparing with the real label information, thereby making full use of the unlabeled data resources and improving the accuracy of the model processing.
[0290] Based on any of the above embodiments, in this embodiment, obtaining the target physiological electrical signal to be classified includes:
[0291] A target physiological electrical signal to be classified is collected, and at least one of the following operations is performed on the target physiological electrical signal: a noise reduction operation, a desensitization operation, a data incompleteness confirmation, and a normalization operation.
[0292] In this embodiment, it is necessary to perform preprocessing operations on the collected target physiological electrical signals to be classified, specifically including at least any one of noise reduction operation, desensitization operation, data incompleteness confirmation and normalization operation. It should be noted that the normalization processing can be maximum and minimum normalization, sigmoid normalization, etc., and the noise reduction operation can be bandpass filtering, LMS adaptive filtering, Wiener filtering, filtering based on statistical models or filtering based on neural networks. The specific processing method can be set according to the actual needs of the user and is not specifically limited here.
[0293] According to the physiological electrical signal classification method provided by the present invention, the accuracy of the physiological electrical signal data classification result can be improved by performing certain preprocessing on the collected physiological electrical signals to be classified.
[0294] Based on any of the above embodiments, in this embodiment, the physiological electrical signal data acquisition process is: obtain the PSG physiological electrical signal data of sleep monitoring, cut it into physiological electrical signal segments of 30 seconds per frame, so that the subsequent network can classify the segments of one frame every 30 seconds, wherein it is necessary to ensure that there are two to five stable signal channels; then divide the physiological electrical signal data into a standard data set, an unlabeled pre-training data set, a labeled training data set, a verification data set, and a test data set, and use a bandpass filter to filter the signal data. It should be noted that the obtained physiological electrical signal data is normalized before being input into the physiological electrical signal feature extraction model.
[0295] It should be noted that the process of acquiring unlabeled data is as follows: a complete segment of unlabeled physiological electrical signal raw data is acquired, and the same segment of physiological electrical signal data is copied and generated. The copied physiological electrical signal data is moved forward or backward in time sequence by one signal unit, where the signal unit often refers to a frame of data (30 seconds of data). If you choose to move forward, the first frame of the copied physiological electrical signal data is removed, and the last frame of the physiological electrical signal raw data is removed; if you choose to move backward, the last unit of the copied physiological electrical signal data is removed, and the first unit of the physiological electrical signal raw data is removed to ensure that the lengths of the two segments of data remain corresponding. The processed physiological electrical signal time sequence misalignment data and the physiological electrical signal raw data are determined as unlabeled data.
[0296] Figure 6 The present invention provides a physiological electrical signal classification device, such as Figure 6 As shown, the present invention provides a physiological electrical signal classification device, comprising:
[0297] An acquisition module 601 is used to acquire a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time sequence signal;
[0298] An input module 602 is used to input the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal;
[0299] A determination module 603, configured to determine the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category;
[0300] Wherein, the physiological electrical signal feature extraction model is obtained by training based on the physiological electrical signal training data set and the time sequence misalignment data set corresponding to the physiological electrical signal training data set;
[0301] or,
[0302] The physiological electrical signal feature extraction model is obtained by training based on an augmented data set and a time-series misalignment data set corresponding to the physiological electrical signal training data set.
[0303] According to the physiological electrical signal classification device provided by the present invention, a target physiological electrical signal to be classified is obtained; the target physiological electrical signal is a time series signal; the target physiological electrical signal is input into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; and the category of the target physiological electrical signal is determined according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category. The physiological electrical signal processing device provided by the present invention can ensure the accuracy of the classification result, improve the processing accuracy of the physiological signal classification model, and enhance the user experience.
[0304] Since the principle of the device described in the embodiment of the present invention is the same as that of the method described in the above embodiment, a more detailed explanation will not be repeated here.
[0305] Figure 7 FIG. 1 is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Figure 7 As shown, the present invention provides an electronic device, including: a processor (processor) 701, a memory (memory) 702 and a bus 703;
[0306] The processor 701 and the memory 702 communicate with each other via the bus 703;
[0307] The processor 701 is used to call the program instructions in the memory 702 to execute the methods provided in the above-mentioned method embodiments, for example, including: obtaining a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a timing signal; inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; wherein the physiological electrical signal feature extraction model is trained based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set, or the physiological electrical signal feature extraction model is trained based on an augmented data set and a timing misalignment data set corresponding to the physiological electrical signal training data set.
[0308] In addition, the logic instructions in the above-mentioned memory 702 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0309] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above methods, which include: obtaining a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a timing signal; inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; determining the category of the target physiological electrical signal based on the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; wherein the physiological electrical signal feature extraction model is trained based on a physiological electrical signal training data set and a timing misalignment data set corresponding to the physiological electrical signal training data set, or the physiological electrical signal feature extraction model is trained based on an augmented data set and a timing misalignment data set corresponding to the physiological electrical signal training data set.
[0310] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the above-mentioned methods, the methods comprising: obtaining a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a timing signal; inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; determining the category of the target physiological electrical signal based on the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; wherein the physiological electrical signal feature extraction model is trained based on a physiological electrical signal training data set and a timing misaligned data set corresponding to the physiological electrical signal training data set, or the physiological electrical signal feature extraction model is trained based on an augmented data set and a timing misaligned data set corresponding to the physiological electrical signal training data set.
[0311] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0312] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0313] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A physiological electrical signal classification method, characterized in that: include: Acquire a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time series signal; Inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; Determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; Wherein, the physiological electrical signal feature extraction model is obtained by training based on the physiological electrical signal training data set and the time sequence misalignment data set corresponding to the physiological electrical signal training data set; or, The physiological electrical signal feature extraction model is obtained by training based on an augmented data set corresponding to the physiological electrical signal training data set and a time sequence misalignment data set corresponding to the physiological electrical signal training data set; Before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the method further includes: Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data; Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels; Input the data in the physiological electrical signal training data set into a first neural network model to obtain a first output result; input the data in the time series misalignment data set into a second neural network model to obtain a second output result; calculate a first loss function according to the first output result and the second output result; wherein the first neural network model includes a feature extraction network, a mapping network and a classification network, and the second neural network model includes a feature extraction network and a mapping network; Inputting the data in the physiological electrical signal training data set into the second neural network model to obtain a third output result; inputting the data in the time series misalignment data set into the first neural network model to obtain a fourth output result; calculating a second loss function according to the third output result and the fourth output result; Determine a total loss function according to the first loss function and the second loss function, and train the first neural network model and the second neural network model according to the total loss function until the first neural network model converges; The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained first neural network model.
2. The physiological electrical signal classification method according to claim 1, characterized in that: The step of performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set includes: Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data; The plurality of replicated training data are moved in time sequence to obtain a plurality of replicated training data after time sequence movement; The lengths of the multiple copied training data after the time sequence shift are aligned with the corresponding training data in the physiological electrical signal training data set to obtain a time sequence misaligned data set corresponding to the physiological electrical signal training data set.
3. The physiological electrical signal classification method according to claim 1, characterized in that: The data in the physiological electrical signal training data set is input into a first neural network model to obtain a first output result; the data in the time sequence misalignment data set is input into a second neural network model to obtain a second output result; Calculating a first loss function according to the first output result and the second output result includes: The data in the physiological electrical signal training data set v Input feature extraction network of the first neural network model , and get the first eigenvector ; The first feature vector Input the mapping network of the first neural network model , and get the second eigenvector ; The second eigenvector Input the classification network of the first neural network model , and get the third eigenvector ; The data in the time series misalignment data set v’ Input feature extraction network of the second neural network model , and get the fourth eigenvector ; The fourth eigenvector Input the mapping network of the second neural network model , and get the fifth eigenvector ; For the first eigenvector , the second eigenvector , the third eigenvector , the fourth eigenvector and the fifth eigenvector conduct l 2 Regularization processing; according to l 2 The result of regularization processing is used to calculate the first loss function; wherein, the first loss function The calculation formula is: 。 4. The physiological electrical signal classification method according to claim 3, characterized in that: The data in the physiological electrical signal training data set is input into the second neural network model to obtain a third output result; the data in the time sequence misalignment data set is input into the first neural network model to obtain a fourth output result; Calculating a second loss function according to the third output result and the fourth output result includes: The data in the physiological electrical signal training data set v Input feature extraction network of the second neural network model , and get the sixth eigenvector ; The sixth eigenvector Input the mapping network of the second neural network model , and get the seventh eigenvector ; The data in the time series misalignment data set v’ Input feature extraction network of the first neural network model , and we get the eighth eigenvector ; The eighth eigenvector Input the mapping network of the first neural network model , and we get the ninth eigenvector ; The ninth eigenvector Input the classification network of the first neural network model , and we get the tenth eigenvector ; For the sixth eigenvector , the seventh eigenvector , the eighth eigenvector , the ninth eigenvector and the tenth eigenvector conduct l 2 Regularization processing; according to l 2 The result of regularization processing is used to calculate the second loss function; where the second loss function The calculation formula is: 。 5. The physiological electrical signal classification method according to claim 4, characterized in that: The determining a total loss function according to the first loss function and the second loss function, and training the first neural network model and the second neural network model according to the total loss function until the first neural network model converges, comprises: The total loss function is determined according to the first loss function and the second loss function; wherein the calculation formula of the total loss function is: ; Determining whether the first neural network model converges according to the total loss function; In the case of non-convergence, the parameters of the first neural network model are updated by gradient updating of the first neural network model; wherein the updating formula of the parameters of the first neural network model is: ; Among them, optimizer is the optimizer, θ are the parameters of the first neural network model, η is the learning rate; In the case of non-convergence, the parameters of the second neural network model are updated; wherein the updating formula of the parameters in the second neural network model is: ; in, ε are the parameters of the second neural network model, τ is the iteration rate after one round of training of the second neural network model, where τ ∈(0,1); In the case of convergence, the training process of the first neural network model and the second neural network model is ended.
6. The physiological electrical signal classification method according to claim 1, characterized in that: The step of generating the physiological electrical signal feature extraction model based on the feature extraction network in the trained first neural network model comprises: Adding a fully connected network at the end of the feature extraction network in the trained first neural network model to obtain an initial physiological electrical signal feature extraction model; Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating a network loss according to the feature vector and label information corresponding to the labeled physiological electrical signal training data; The parameters in the physiological electrical signal feature extraction model are updated by back-propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
7. The physiological electrical signal classification method according to claim 1, characterized in that: Before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the method further includes: Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data; Performing data augmentation processing on the training data in the physiological electrical signal training data set to obtain an augmented data set corresponding to the physiological electrical signal training data set; wherein the augmented data set includes: augmented data with labels and augmented data without labels; Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels; Input the first type of data in the augmented data set into the third neural network model to obtain a third output result; input the second type of data in the augmented data set into the fourth neural network model to obtain a fourth output result; input the data in the time series misalignment data set into the fifth neural network model to obtain a fifth output result; calculate a third loss function based on the third output result and the fourth output result; calculate a fourth loss function based on the fourth output result and the fifth output result; wherein the third neural network model, the fourth neural network model and the fifth neural network model all include a feature extraction network, a mapping network and a classification network; Determine a target loss function according to the third loss function and the fourth loss function, and train the third neural network model, the fourth neural network model and the fifth neural network model according to the target loss function until the fourth neural network model converges; The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained fourth neural network model.
8. The physiological electrical signal classification method according to claim 7, characterized in that: The step of performing data augmentation processing on the training data in the physiological electrical signal training data set to obtain an augmented data set corresponding to the physiological electrical signal training data set includes: Copying each training data in the physiological electrical signal training data set to obtain a plurality of copied training data; Performing augmentation processing on the plurality of replicated training data according to a preset threshold within a unit time to obtain augmented first-category training data; Performing augmentation processing on the plurality of replicated training data according to a preset threshold value within a unit time to obtain augmented second-category training data; The augmented data set is obtained according to the first category of training data and the second category of training data.
9. The physiological electrical signal classification method according to claim 7, characterized in that: The first type of data in the augmented data set is input into a third neural network model to obtain a third output result; the second type of data in the augmented data set is input into a fourth neural network model to obtain a fourth output result; Calculating a third loss function according to the third output result and the fourth output result includes: The first type of data in the augmented data set v 1 Input the feature extraction network of the third neural network model , and we get the eleventh eigenvector ; The eleventh eigenvector Input the mapping network of the third neural network model , and we get the twelfth eigenvector ; The twelfth eigenvector Input the classification network of the third neural network model , and we get the thirteenth eigenvector ; The second type of data in the augmented data set v 2 Input feature extraction network of the fourth neural network model , and we get the fourteenth eigenvector ; The fourteenth eigenvector Input the mapping network of the fourth neural network model , and get the fifteenth eigenvector ; The fifteenth eigenvector Input the classification network of the fourth neural network model , and get the sixteenth eigenvector ; For the eleventh eigenvector , the twelfth eigenvector , the thirteenth eigenvector , the fourteenth eigenvector , the fifteenth eigenvector , and the sixteenth eigenvector The difference is calculated to obtain a third loss function, wherein the calculation formula of the third loss function is: 。 10. The physiological electrical signal classification method according to claim 7, characterized in that: The second type of data in the augmented data set is input into a fourth neural network model to obtain a fourth output result; the data in the time series misaligned data set is input into a fifth neural network model to obtain a fifth output result; Calculating a fourth loss function according to the fourth output result and the fifth output result includes: The second type of data in the augmented data set v 2 Input feature extraction network of the fourth neural network model , and we get the fourteenth eigenvector ; The fourteenth eigenvector Input the mapping network of the fourth neural network model , and get the fifteenth eigenvector ; The fifteenth eigenvector Input the classification network of the fourth neural network model , and get the sixteenth eigenvector ; The data in the time series misalignment data set v’ Input the feature extraction network of the fifth neural network model , and we get the seventeenth eigenvector ; The seventeenth eigenvector Input mapping network of the fifth neural network model , and get eighteen eigenvectors ; The eighteenth eigenvector Input the classification network of the fifth neural network model , and we get the nineteenth eigenvector ; For the fourteenth eigenvector , the fifteenth eigenvector , the sixteenth eigenvector 、The seventeenth eigenvector , Eighteen eigenvectors and the nineteenth eigenvector The difference is calculated to obtain a fourth loss function, wherein the calculation formula of the fourth loss function is: 。 11. The physiological electrical signal classification method according to claim 7, characterized in that: The step of determining a target loss function according to the third loss function and the fourth loss function, and training the third neural network model, the fourth neural network model, and the fifth neural network model according to the target loss function until the fourth neural network model converges, comprises: The target loss function is determined according to the third loss function and the fourth loss function; wherein the calculation formula of the target loss function is: ; Determining whether the fourth neural network model converges according to the target loss function; In the case of non-convergence, the parameters of the fourth neural network model are updated by gradient updating; wherein the updating formula of the parameters of the fourth neural network model is: ; Among them, optimizer is the optimizer, θ 2 is the parameter of the fourth neural network model, η is the learning rate; In the case of non-convergence, the parameters of the third neural network model and the fifth neural network model are updated; wherein the updating formula of the parameters in the third neural network model is: ; in, θ 1 is the parameter of the third neural network model, τ is the iteration rate after one round of training of the third neural network model, where τ ∈(0,1), θ 2 is the parameter of the fourth neural network model; The updating formula of the parameters in the fifth neural network model is: ; in, ε are the parameters of the fifth neural network model, τ is the iteration rate after one round of training of the fifth neural network model, where τ ∈(0,1); In the case of convergence, the training process of the third neural network model, the fourth neural network model and the fifth neural network model is terminated.
12. The physiological electrical signal classification method according to claim 7, characterized in that: The step of generating the physiological electrical signal feature extraction model based on the feature extraction network in the trained fourth neural network model comprises: Adding a fully connected network to the end of the feature extraction network in the trained fourth neural network model to obtain an initial physiological electrical signal feature extraction model; Inputting the labeled physiological electrical signal training data into the initial physiological electrical signal feature extraction model to obtain a feature vector of the labeled physiological electrical signal training data, and calculating a network loss according to the feature vector and label information corresponding to the labeled physiological electrical signal training data; The parameters in the physiological electrical signal feature extraction model are updated by back-propagation according to the calculated network loss until the physiological electrical signal feature extraction model converges to obtain a final physiological electrical signal feature extraction model.
13. The physiological electrical signal classification method according to claim 1, characterized in that: Determining the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category includes: Inputting a plurality of labeled physiological electrical signals into the physiological electrical signal feature extraction model to obtain feature vectors of the plurality of labeled physiological electrical signals; Performing cluster analysis on the characteristic vectors of the plurality of labeled physiological electrical signals, and determining the centroid positions of the plurality of categories and the average distances of the data clusters according to the cluster analysis results and the labels corresponding to the plurality of labeled physiological electrical signals; The distances between the feature vector of the target physiological electrical signal and the centroid positions of the multiple categories are calculated, and the category of the target physiological electrical signal is determined according to the distances and the average distances of the data clusters of the multiple categories.
14. The physiological electrical signal classification method according to any one of claims 1 to 13, characterized in that: The method also includes: Inputting the classified physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the classified physiological electrical signal; According to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category, the data quality and the label quality of the classified physiological electrical signal are detected.
15. The physiological electrical signal classification method according to claim 14, characterized in that: The detecting the data quality and label quality of the classified physiological electrical signal according to the distance between the feature vector of the classified physiological electrical signal and the feature vector of the physiological electrical signal of a known category comprises: When the distance between the feature vector of the classified physiological electrical signal and the centroid position of a known physiological electrical signal category is less than the average distance of the corresponding category, and the distance between the feature vector of the classified physiological electrical signal and the centroid position of other known physiological electrical signal categories is greater than the average distance of the corresponding category, and the label corresponding to the classified physiological electrical signal is inconsistent with the label of the physiological electrical signal category to which the nearest centroid position belongs, reduce the confidence of the label corresponding to the classified physiological electrical signal, and verify and re-verify the label corresponding to the classified physiological electrical signal; In the case where the distance between the feature vector of the classified physiological electrical signal and the centroid position of any known physiological electrical signal category is greater than a preset multiple value of the average distance of the corresponding category, the classified physiological electrical signal is determined to be an outlier, and the classified physiological electrical signal is verified and analyzed; When the distances between the characteristic vector of the classified physiological electrical signal and the centroid positions of at least two known physiological electrical signal categories are within preset multiples of the average distance of the corresponding category, and the difference between the distances is less than a preset value, the classified physiological electrical signal is determined to be low-quality data in an intermediate state, and a verification analysis is performed on the classified physiological electrical signal.
16. The physiological electrical signal classification method according to any one of claims 1 to 13, characterized in that: The method also includes: Inputting the data in the standard data set into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the data in the standard data set; wherein the standard data set includes labeled data and unlabeled data; Performing cluster analysis on the feature vectors of the data in the standard data set, and determining the centroid positions of multiple categories according to the labels of the labeled data in the standard data set; Determining the labels of the unlabeled data in the standard data set according to the distance between the feature vector of the unlabeled data in the standard data set and the centroid positions of the multiple categories; The labels of the unlabeled data in the standard data set are compared with the real labels of the unlabeled data in the standard data set obtained by other methods, and the accuracy of the physiological electrical signal feature extraction model is calculated.
17. The physiological electrical signal classification method according to claim 1, characterized in that: The step of obtaining the target physiological electrical signal to be classified comprises: A target physiological electrical signal to be classified is collected, and at least one of the following operations is performed on the target physiological electrical signal: a noise reduction operation, a desensitization operation, a data incompleteness confirmation, and a normalization operation.
18. A physiological electrical signal classification device, characterized in that: include: An acquisition module, used for acquiring a target physiological electrical signal to be classified; wherein the target physiological electrical signal is a time sequence signal; An input module, used for inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model to obtain a feature vector of the target physiological electrical signal; A determination module, configured to determine the category of the target physiological electrical signal according to the distance between the feature vector of the target physiological electrical signal and the feature vector of a physiological electrical signal of a known category; Wherein, the physiological electrical signal feature extraction model is obtained by training based on the physiological electrical signal training data set and the time sequence misalignment data set corresponding to the physiological electrical signal training data set; or, The physiological electrical signal feature extraction model is based on the augmented data set corresponding to the physiological electrical signal training data set and the time sequence misalignment data set corresponding to the physiological electrical signal training data set; Before inputting the target physiological electrical signal into a pre-trained physiological electrical signal feature extraction model, the device is further used to: Acquire a physiological electrical signal training data set; wherein the physiological electrical signal training data set includes: labeled physiological electrical signal training data and unlabeled physiological electrical signal training data; Performing time-series misalignment processing on the training data in the physiological electrical signal training data set to obtain a time-series misalignment data set corresponding to the physiological electrical signal training data set; wherein the time-series misalignment data set includes: time-series misalignment data with labels and time-series misalignment data without labels; Input the data in the physiological electrical signal training data set into a first neural network model to obtain a first output result; input the data in the time series misalignment data set into a second neural network model to obtain a second output result; calculate a first loss function according to the first output result and the second output result; wherein the first neural network model includes a feature extraction network, a mapping network and a classification network, and the second neural network model includes a feature extraction network and a mapping network; Inputting the data in the physiological electrical signal training data set into the second neural network model to obtain a third output result; inputting the data in the time series misalignment data set into the first neural network model to obtain a fourth output result; calculating a second loss function according to the third output result and the fourth output result; Determine a total loss function according to the first loss function and the second loss function, and train the first neural network model and the second neural network model according to the total loss function until the first neural network model converges; The physiological electrical signal feature extraction model is generated based on the feature extraction network in the trained first neural network model.
19. An electronic device, characterized in that: include: processor, memory and bus, wherein, The processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor can execute the steps of the physiological electrical signal classification method according to any one of claims 1 to 17 by calling the program instructions.
20. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which enable the computer to execute the steps of the physiological electrical signal classification method according to any one of claims 1 to 17.
