Signal-oriented feature positioning display and quantitative analysis method and device
Through signal-oriented feature positioning display and quantitative analysis methods, using deep convolutional neural networks and non-pooling layer networks, the problem of lack of interpretability of convolutional neural networks in signal processing is solved, and the transparency of signal processing decisions is achieved. reliability and trustworthiness, providing judgment standards and logical basis.
Patent Information
- Application Number
- CN202210621841.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Convolutional neural networks lack clear judgment standards and logical basis in the signal processing decision-making process, resulting in a lack of interpretability and limiting its application in medical diagnosis and other fields.
A signal-oriented feature positioning display and quantitative analysis method is proposed. By constructing a deep convolutional neural network and a non-pooling layer network, and using gradient activation class mapping or variable convolution class activation mapping, it can realize multi-type data channels. Visual display and analysis provide judgment criteria and logical basis.
It effectively provides interpretability for convolutional neural networks in the signal processing decision-making process, indicates the areas and key features that the model focuses on, and improves the transparency and trustworthiness of decision-making.
Smart Images

Figure CN114997230B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a signal-oriented feature positioning display and quantitative analysis method and a device thereof. Background Art
[0002] Convolutional neural networks have shown high accuracy and performance in multi-classification tasks. However, the lack of interpretability in the decision-making process of convolutional neural networks has become a serious problem, limiting its widespread application in some low-risk tolerance fields, such as medical diagnosis, aerospace, and military industry. The interpretability of neural networks means that the decision-making process of neural networks has and can show a logical basis that can be understood by humans, and the network parameters have clear rules and are easy to understand. A qualified artificial intelligence algorithm applied to medical diagnosis activities must be transparent, understandable, interpretable, and trustworthy. However, the current neural network model represented by data-driven deep convolutional neural networks lacks clear diagnostic criteria and logical basis, and the parameters in the model are unclear and ambiguous, with "black box" attributes. These have brought difficulties to the application of deep learning methods in this field.
[0003] Therefore, how to effectively provide explainability for the decision-making process of artificial intelligence algorithms in one-dimensional signal processing and medical diagnosis activities is still a technical problem that needs to be solved. At present, some research results have provided methods and inspirations for neural network explainability. These methods are mainly oriented to image data and natural language data, but related technologies in signal processing and one-dimensional information data processing are still very lacking. Summary of the invention
[0004] In order to make up for the shortcomings of the above-mentioned background technology, the present invention proposes a signal-oriented feature positioning display and quantitative analysis method and device thereof to solve the problem that convolutional neural networks cannot effectively provide interpretability in the decision-making process involving signal processing due to the lack of clear judgment criteria and logical basis.
[0005] The technical problem of the present invention is solved by the following technical solutions:
[0006] The present invention discloses a signal-oriented feature positioning display and quantitative analysis method, which comprises the following steps: S1: obtaining a data signal to be processed, checking the integrity and availability of the data signal, and preprocessing it, wherein the specific preprocessing comprises data denoising, desensitization, and data incompleteness judgment; S2: constructing a deep convolutional neural network that can be used for classifying the data signal to be processed, denoted as the first network, performing model training on the collected data signal to be processed and constructing a loss function, and training until convergence using a back propagation algorithm; S3: constructing a deep neural network similar to the first network for visual display and analysis of the data signal to be processed, denoted as the second network; S4: converting the first network into a deep convolutional neural network, which is used for visual display and analysis of the data signal to be processed; The weights of the convolutional layer in one network are assigned to the convolutional layer with the same name in the second network. The data of the data signal to be processed is used to be input into the second network, and the output is obtained and then the parameters of the last layer of the first network are calculated to obtain the output; S5: Establish a loss function, calculate the loss of the output of the network without a pooling layer and the data label, and calculate the gradient of the loss and the input data, or directly calculate the gradient between the output and the input data; S6: Set a threshold to obtain a high contribution gradient area of a channel of the data signal to be processed, and use the gradient area for further visualization, so as to realize the visualization and analysis of each channel in multiple categories of data.
[0007] In some embodiments, the data signal to be processed is a physiological signal of sleep monitoring; and the method further includes step S7: calculating the average value of the gradient obtained by each channel, and using it for further quantitative analysis through histogram and pie chart methods.
[0008] In some embodiments, the S1 includes: S11: obtaining PSG physiological signals of sleep monitoring and cutting them into physiological signal segments to facilitate subsequent network classification of the segments; S12: obtaining PSG physiological signals of sleep monitoring, which come from two to five stable signal channels; S13: dividing the physiological signals 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; S14: using a bandpass filter to filter the signal, and then normalizing the obtained physiological signal before inputting the neural network.
[0009] In some embodiments, in S2: the first network is divided into two parts, the first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling, and the second part is a classification module composed of a fully connected layer; by setting the loss function, the network is trained using the back propagation algorithm until convergence.
[0010] In some embodiments, the first network and the second network are both composed of two parts, the first part is a feature extraction module composed of a convolution module and a dimensionality reduction module, and the second part is a classification module composed of a fully connected layer; wherein, compared with the first network, all convolution layers in the second part of the second network use dilated convolution, and the pooling layer is removed.
[0011] In some embodiments, the step of assigning the convolutional layer weights in the first network to the second network in S4, since the names of the convolutional layers in the two networks are the same, the parameters of the convolutional layer of the first network can be directly assigned to the corresponding convolutional layer in the second network, and the specific steps include: representing the first network with F(), where its input is represented as X and its output is represented as Y; representing the second network with F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W1, F dilated The parameter value of () is expressed as W2; the convolutional layer parameters in the first network are assigned to the convolutional network layer with the same name in the second network, and a certain category of data to be studied is used as the input of the second network to calculate the output, as shown in the following formulas 1, 2 and 3:
[0012] Y=F(X)|W1 Formula 1
[0013] W2=W1 Formula 2
[0014] Y output =F dilated (X input )|W2 Formula 3.
[0015] In some embodiments, there are three methods for calculating the gradient in S5, of which the first and second methods require first establishing a loss function, calculating the loss of the output of the network without a pooling layer and the data label, and calculating the gradient of the loss and the input data, and the third method directly uses the input and output to calculate the data gradient.
[0016] Furthermore, the data labels are encoded into a one-hot code form and then the loss and gradient are calculated. The specific steps include: input The label is encoded as one-hot code and represented as label onehot ; Use categorical cross entropy as the loss function, the categorical cross entropy function is represented by categorical_crossentropy(), and the loss is represented by Loss0, as shown in the following formula 4:
[0017] Loss0=categorical_crossentropy(Y output ,Y output -Y output *label onthot ) Formula 4
[0018] The gradient calculation function is represented as Gradient(), which is composed of Loss0 and X input The calculated gradient is represented by Grad0, as shown in the following formula 5:
[0019] Grad0=Gradient(Loss0,X input ) Formula 5.
[0020] Furthermore, the data labels are encoded into one-hot code form and zero-value one-hot code form and then the loss and gradient are calculated respectively. The specific steps include: a frame of data X of a certain category to be studied input The labels are encoded in one-hot code form and zero-value one-hot code form, and are represented as label onehot 、label zero ; Y output With label onehot The loss is expressed as Loss temp1 Indicates that Y output With label zero The loss is expressed as Loss temp2 It is expressed as shown in the following formula 6 and formula 7:
[0021] Loss temp1 =categorical_crossentropy(Y output , label onehot ) Formula 6
[0022] Loss temp2 =categorical_crossentropy(Y output , label zero ) Formula 7
[0023] By Loss temp1 With X input The calculated gradient is given by Grad temp1 Indicated by Loss temp2 With X input The calculated gradient is given by Grad temp2 It is expressed as shown in the following formula 8 and formula 9:
[0024] Grad temp1 = gradient(Loss temp1 , Xinput ) Formula 8
[0025] Loss temp2 =Gradient(Loss temp2 , X input ) Formula 9
[0026] The final gradient value is represented by Grad1, which is composed of Grad temp1 [0] Subtract Grad temp2 [0] is obtained, as shown in formula 10:
[0027] Grad1=Grad temp1 [0]-Grad temp2 [0] Formula 10.
[0028] Furthermore, the data label is encoded into a one-hot code form and directly multiplied with the output of the network without pooling layer to obtain the loss and then calculate the gradient. The specific steps include: encoding the data label into a one-hot code form, then directly multiplying it with the output of the network without pooling layer, and the result is multiplied by X input The calculated gradient is represented by Grad2, as shown in the following formula 11:
[0029] Grad2=Gradient(Y output *label onehot , X input ) Formula 11.
[0030] In some embodiments, the specific step S6 includes: the gradient is represented as Grad, the maximum and minimum values of the gradient are obtained, which are represented as Grad.min() and Grad.max() respectively; a threshold is used to obtain the required gradient area, and the threshold is represented as ts, as shown in the following formulas 12 and 13:
[0031] Grad=Grad-Grad.min() Formula 12
[0032] Grad[Grad<ts*Grad.max()]=0 Formula 13
[0033] The gradient regions calculated above are used for further visualization and analysis of each channel in multi-class data.
[0034] In some embodiments, the specific step S7 includes: the average value of the gradient change of a specific channel during the back propagation algorithm is represented as Mean(i), the function mean() represents the calculation of the average value, and the parameter i represents a specific channel among the five channels; specifically, the value range of the parameter i is 0 to 4, representing the five channels of EEG1, EEG2, EOG1, EOG2, and EMG, respectively; as shown in the following formula 14:
[0035] Mean(i)=mean(Grad[:,:,i]) Formula 14
[0036] The average values calculated above were used for further quantitative analysis using histogram and pie chart methods.
[0037] The present invention further discloses another signal-oriented feature positioning, display and quantitative analysis method, which includes the following steps: S1': obtaining a data signal to be processed, checking the integrity and availability of the data signal, and preprocessing it, and the specific preprocessing includes data denoising, desensitization, and data incompleteness judgment; S2': training a data signal processing network for physiological signal EEG classification, denoted as the first network, including a feature extraction layer and a mapping layer; S3': constructing a second network with the same name as each layer of the first network, using a variable convolution as the convolution kernel, and removing the pooling layer; S4': assigning the parameters of the first network to the second network, randomly selecting a frame of data, inputting the second network model, and calculating the output of the second network with the fully connected parameters of the first network to obtain the output; S5': visually displaying features of different output dimensions, and setting thresholds at the same time to achieve positioning and visualization operations on key features; S6': quantitatively analyzing the features of the visual display.
[0038] In some embodiments, the data signal to be processed is a physiological signal of sleep monitoring; the specific method of S1' includes: obtaining PSG physiological signals of sleep monitoring; and cutting them into physiological signal segments to facilitate subsequent network classification of the segments; obtaining PSG physiological signals of sleep monitoring, which come from two to five stable signal channels; dividing the physiological signals 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; using a bandpass filter to filter the signal, and then normalizing the obtained physiological signal before inputting it into the neural network.
[0039] In some embodiments, in S2', the first network is divided into two parts, the first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling, and the second part is a classification module composed of a fully connected layer; by setting the loss function, the network is trained using the back propagation algorithm until convergence.
[0040] In some embodiments, the specific step of S4′ includes: representing the first network with F(), with its input represented as X and its output represented as Y; representing the second network with F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W1, F dilated The parameter value of () is expressed as W2; the convolutional layer parameters in the first network are assigned to the convolutional network layer with the same name in the second network, and a certain category of data to be studied is used as the input of the second network to calculate the output, as shown in the following formulas 1, 2, and 3:
[0041] Y=F(X)|W1 Formula 1
[0042] W2=W1 Formula 2
[0043] Y output =F dilated (X input )|W2 Formula 3.
[0044] In some embodiments, the S4' specific method includes:
[0045] Use a frame of data of a certain category to be studied as the second network F dilated () Input X input , name the output Y output , X input and Y output The dimensions of Y are [1, 1500, 5] and [1, 1500, 512] respectively; then, using the weights in the fully connected (fc) layer, defined as fc.weights, output Convert to Y output_fc , Y output The dimensions of , fc.weights, and Youtput_fc are [1, 1500, 512], [512, 5], and [1, 1500, 5] respectively; the process is shown in the following formulas 15 and 16. Formula 15 indicates that in the second network F dilated () uses a test data to get specific output, F dilated The parameter value of () is expressed as W2; Formula 16 expresses the use of Y output Multiply by fc.weights to get Y output_fc ; Among them, Y output_fc The dimension is [1, 1500, 5]. This channel represents the contribution wave to a specific classification. 1500 represents the characteristics of a frame of specific data, and the number 5 represents five stages of classification.
[0046] Y output =F dilated (X input )|W2 Formula 15
[0047] Y output_fc =Y output *fc.Weights Formula 16.
[0048] In some embodiments, the specific method of S5' is as follows:
[0049] Y output_fc [i] indicates the contribution to a particular category when numbered from 0 to 4; i Represents the characteristic wave of the test data for a specific category. The parameter i represents five categories from 0 to 4, corresponding to the five stages of W, N1, N2, N3 and REM. By visualizing Wave i The difference in contribution is shown, where the peak represents the area that contributes more to this category, and the trough refers to the area that contributes less to the final classification result; as shown in the following formula 17:
[0050] Wave i =Y output_fc [i] Formula 17
[0051] Then, the eigenvalue Y is calculated by formula 18. output_fc Converted to a positive value; In order to retain key features, a retention function is used in Formula 19 to make the feature value zero when it is below a specific threshold; The parameter ts represents the threshold in feature retention, which is set to 0.65 by default; Formulas 18 and 19 are as follows:
[0052] Y output_fc =Y output_fc -Y output_fc .min() Formula 18
[0053] Y output_fc [Y output_fc <ts*Y output_fc .max()]=0 Formula 19.
[0054] In some embodiments, in S6', the features of the visual display are quantitatively analyzed, and the specific method is as follows:
[0055] The influence of the region of interest on the final result is quantitatively evaluated by calculating the weighted value; the function is defined as mean(), and the average value of Wavei is calculated using the average operation to obtain the value M(i), which represents the quantitative contribution to the specific category i; this value can be used to analyze the preference influence on a specific category; when visualizing Wavei in a graph with 1500 features as the x-axis, the colored strips indicate the position of the feature contribution to a specific category, and the depth of the colored area indicates the size of the decision contribution. Formula 20 is as follows:
[0056] M(i)=mean(Wave i ) Equation 20.
[0057] The present invention also discloses a signal-oriented feature positioning display and quantitative analysis device, including a processor and a memory, characterized in that a computer program is stored in the memory, and the computer program can be executed by the processor to implement any of the methods described above.
[0058] The beneficial effects of the present invention compared with the prior art include:
[0059] The signal-oriented feature location display and quantitative analysis method provided by the present invention is based on a gradient activation class map or a variable convolution class activation map, and is combined with the characteristics of a dimensionality reduction sampling network without a pooling layer to achieve visual display and analysis of each channel in multiple categories of data, thereby indicating or displaying the areas of concern to the neural network model. These areas, as the key features found, can provide judgment criteria and logical basis for decisions involving signal processing, thereby effectively providing interpretability for the convolutional neural network in the decision-making process involving signal processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flow chart of a signal-oriented feature location display and quantitative analysis method based on a gradient activation category map in an embodiment of the present invention;
[0061] Figure 2 It is a flow chart of a signal-oriented feature location display and quantitative analysis method based on variable convolution class activation mapping in an embodiment of the present invention;
[0062] Figure 3a Schematic diagram of a convolution module in a data signal processing network for EEG classification in an embodiment of the present invention;
[0063] Figure 3b Schematic diagram of a dimensionality reduction module in a data signal processing network for EEG classification in an embodiment of the present invention;
[0064] Figure 4 Schematic diagram of a convolution module in a data signal processing network similar to an EEG classification network but without a pooling layer in an embodiment of the present invention;
[0065] Figure 5a to Figure 5d It is a schematic diagram of the principle of a class activation map based on gradient calculation in an embodiment of the present invention;
[0066] Figures 6a to 6d A schematic diagram of the class activation mapping principle based on variable convolution provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The present invention is further described below with reference to the accompanying drawings and in combination with preferred embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0068] It should be noted that the directional terms such as left, right, up, down, top, and bottom in this embodiment are merely relative concepts or are based on the normal use status of the product, and should not be considered as restrictive.
[0069] The embodiment of the present invention discloses a signal-oriented feature positioning display and quantitative analysis method, which is used for interpretable classification and analysis of convolutional neural networks in one-dimensional signal classification. The method includes: obtaining a data signal to be processed, checking the availability of the data signal and preprocessing it; training a model on a training data set; assigning the weights in the layers of the training model to a new model with the same name as the convolutional network layer but without a pooling layer; using two different feature positioning display methods, method one: a new feature display and quantitative analysis method based on a gradient activation category map, that is, establishing a loss function, calculating the loss of the output of the network without a pooling layer and the data label, and calculating the gradient of the loss and the input data; setting a threshold to obtain the required gradient area, and using the gradient area for further visualization and analysis of each channel in multiple categories of data; calculating the average value of the gradient obtained for each channel, and using it for further quantitative analysis through histogram and pie chart methods. Method 2: A signal feature display and analysis method based on variable convolution-like activation mapping, i.e., randomly selecting a frame of data to input into a new model without a pooling layer, multiplying the output by the parameters of the last fully connected layer of the training model to obtain the output; visualizing features of different output dimensions, setting thresholds, locating and visualizing key features, and quantitatively analyzing the features of the visual display. The embodiments of the present invention are helpful for model interpretation.
[0070] The following embodiment of the present invention takes one-dimensional physiological signal analysis as an example to demonstrate a signal-oriented feature positioning display and quantitative analysis method, including the following steps:
[0071] S1: Obtain the data signal to be processed, check the integrity and availability of the data signal, and preprocess it. The specific preprocessing includes data denoising, desensitization, and data incompleteness judgment;
[0072] The data signals to be processed are physiological signals of sleep monitoring, and the physiological signals include electroencephalogram signals, electrooculogram signals and mandibular electromyography signals.
[0073] Specifically, it includes:
[0074] S11: Obtain PSG physiological signals from sleep monitoring and cut them into physiological signal segments to facilitate subsequent network classification of the segments;
[0075] S12: Acquire PSG physiological signals for sleep monitoring, which come from two to five stable signal channels;
[0076] S13: Divide the physiological signals into a standard dataset, an unlabeled pre-training dataset, a labeled training dataset, a validation dataset, and a test dataset;
[0077] S14: Filter the signal using a bandpass filter, and then normalize the obtained physiological signal before inputting it into the neural network.
[0078] S2: construct a deep convolutional neural network that can be used for classifying the data signals to be processed, recorded as the first network, perform model training on the collected data signals to be processed and construct a loss function, and use the back propagation algorithm to train until convergence;
[0079] In some embodiments, the first network is divided into two parts, the first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling, and the second part is a classification module composed of a fully connected layer; by setting the loss function, the network is trained using a back propagation algorithm until convergence.
[0080] S3: construct a deep neural network similar to the first network for visual display and analysis of the data signal to be processed, which is recorded as the second network;
[0081] In some embodiments, both the first network and the second network are composed of two parts, the first part is a feature extraction module composed of a convolution module and a dimensionality reduction module, and the second part is a classification module composed of a fully connected layer; wherein, compared with the first network, all convolution layers in the second part of the second network use dilated convolution, and the pooling layer is removed.
[0082] S4: assigning the weights of the convolutional layer in the first network to the convolutional layer with the same name in the second network, using the data of the data signal to be processed to be studied, inputting it into the second network, and obtaining the output, and then calculating the fully connected parameters of the last layer of the first network to obtain the output;
[0083] Specifically, the weights of the convolutional layer in the first network are assigned to the second network. Since the names of the convolutional layers in the two networks are the same, the parameters of the convolutional layer of the first network can be directly assigned to the corresponding convolutional layer in the second network. The specific steps include:
[0084] The first network is represented by F(), its input is represented by X, and its output is represented by Y; the second network is represented by F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W1, F dilated The parameter value of () is expressed as W2;
[0085] The convolutional layer parameters in the first network are assigned to the convolutional network layer with the same name in the second network, and a certain category of data to be studied is used as the input of the second network to calculate the output, as shown in the following formulas 1, 2 and 3:
[0086] Y=F(X)|W1 Formula 1
[0087] W2=W1 Formula 2
[0088] Y output =F dilated (X input )W2 Formula 3.
[0089] S5: Establish a loss function, calculate the loss of the output of the network without pooling layer and the data label, and calculate the gradient of the loss and the input data, or directly calculate the gradient between the output and the input data;
[0090] Specifically, there are three methods for calculating the gradient. The first and second methods require first establishing a loss function, calculating the loss of the output of the network without a pooling layer and the data label, and calculating the gradient of the loss and the input data. The third method directly uses the input and output to calculate the data gradient.
[0091] In some embodiments, the data labels are encoded into a one-hot code form and then the loss and gradient are calculated, and the specific steps include:
[0092] A frame of data X of a certain category to be studied input The label is encoded as one-hot code and represented as label onehot ; Use categorical cross entropy as the loss function, the categorical cross entropy function is represented by categorical_crossentropy(), and the loss is represented by Loss0, as shown in the following formula 4:
[0093] Loss0=categorical_crossentropy(Y output , Y output -Y output *label onehot ) Formula 4
[0094] The gradient calculation function is represented as Gradient(), which is composed of Loss0 and X input The calculated gradient is represented by Grad0, as shown in the following formula 5:
[0095] Grad0=Gradient(Loss0,X input ) Formula 5.
[0096] In some embodiments, the data labels are encoded into a one-hot code form and a zero-value one-hot code form and then the loss and gradient are calculated respectively, and the specific steps include:
[0097] A frame of data X of a certain category to be studied input The labels are encoded in one-hot code form and zero-value one-hot code form, and are represented as label onehot 、label zero ; Y output With label onehot The loss is expressed as Loss temp1 Indicates that Y output With label zero The loss is expressed as Loss temp2 It is expressed as shown in the following formula 6 and formula 7:
[0098] Loss temp1 =categorical_crossentropy(Y output , label onehot ) Formula 6
[0099] Loss temp2 =categorical_crossentropy(Y ou t put , label zero ) Formula 7
[0100] By Loss temp1 With X input The calculated gradient is given by Grad temp1 Indicated by Loss temp2 With X input The calculated gradient is given by Grad temp2 It is expressed as shown in the following formula 8 and formula 9:
[0101] Gradtemp1 =Gradient(Loss temp1 , X input ) Formula 8
[0102] Grad temp2 =Gradient(Loss temp2 , X input ) Formula 9
[0103] The final gradient value is represented by Grad1, which is composed of Grad temp1 [0] Subtract Grad temp2 [0] is obtained, as shown in formula 10:
[0104] Grad1=Grad temp1 [0]-Grad temp2 [0] Formula 10
[0105] In the formula, Grad temp1 [0] and Grad temp2 The [0] in [0] means taking the first value in the sequence information, that is, taking the specific value of the gradient.
[0106] In some embodiments, the data label is encoded as a one-hot code and directly multiplied with the output of the network without pooling layer to obtain the loss and then calculate the gradient. The specific steps include: encoding the data label as a one-hot code, then directly multiplying it with the output of the network without pooling layer, and the result is multiplied by X input The calculated gradient is represented by Grad2, as shown in the following formula 11:
[0107] Grad2=Gradient(Y output *label onehot, X input ) Formula 11.
[0108] S6: Setting a threshold to obtain a high-contribution gradient region of a certain channel of the data signal to be processed, and using the gradient region for further visualization, so as to achieve visualization and analysis of each channel in multiple types of data.
[0109] Specifically, the gradient is represented as Grad, and the maximum and minimum values of the gradient are obtained, which are represented as Grad.min() and Grad.max() respectively; a threshold is used to obtain the required gradient area, and the threshold is represented as ts, as shown in the following formulas 12 and 13:
[0110] Grad=Grad-Grad.min() Formula 12
[0111] Grad[Grad<ts*Grad.max()]=0 Formula 13
[0112] The gradient regions calculated above are used for further visualization and analysis of each channel in multi-class data.
[0113] S7: Calculate the average value of the gradient obtained in each channel and use it for further quantitative analysis using histogram and pie chart methods.
[0114] Specifically, the average value of the gradient change of a specific channel in the propagation algorithm is represented as Mean(i), the function mean() represents the calculation of the average value, and the parameter i represents a specific channel among the five channels; specifically, the value range of the parameter i is 0 to 4, representing the five channels of EEG1, EEG2, EOG1, EOG2, and EMG, respectively; as shown in the following formula 14:
[0115] Mean(i)=mean(Grad[:,:,i]) Formula 14
[0116] The average values calculated above were used for further quantitative analysis using histogram and pie chart methods.
[0117] The embodiment of the present invention also provides another signal-oriented feature positioning display and quantitative analysis method, comprising the following steps:
[0118] S1': Obtain the data signal to be processed, check the integrity and availability of the data signal, and preprocess it. The specific preprocessing includes data denoising, desensitization, and data incompleteness judgment;
[0119] The data signal to be processed is a physiological signal of sleep monitoring, and the physiological signal includes an electroencephalogram signal, an electrooculogram signal, and a mandibular electromyography signal; the specific method includes:
[0120] Obtain PSG physiological signals from sleep monitoring and cut them into physiological signal segments to facilitate subsequent network classification of the segments;
[0121] Obtain PSG physiological signals for sleep monitoring, which come from two to five stable signal channels;
[0122] Divide the physiological signals into standard dataset, unlabeled pre-training dataset, labeled training dataset, validation dataset and test dataset;
[0123] The signal is filtered using a bandpass filter, and then the obtained physiological signal is normalized before being input into the neural network.
[0124] S2': training a data signal processing network for physiological signal EEG classification, denoted as the first network, including a feature extraction layer and a mapping layer;
[0125] Specifically, the first network is divided into two parts. The first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling module. The second part is a classification module composed of a fully connected layer. By setting the loss function, the network is trained using the back propagation algorithm until convergence.
[0126] S3': Build a second network with the same name as each layer of the first network, use variable convolution as the convolution kernel, and remove the pooling layer;
[0127] S4': assign the parameters of the first network to the second network, randomly select a frame of data, input it into the second network model, calculate the output of the second network and the fully connected parameters of the first network to obtain the output;
[0128] In some embodiments, the first network is represented by F(), its input is represented by X, and its output is represented by Y; the second network is represented by F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W1, F dilated The parameter value of () is expressed as W2;
[0129] Assign the convolutional layer parameters in the first network to the convolutional network layer with the same name in the second network, use a certain category of data to be studied as the input of the second network, and calculate the output, as shown in the following formulas 1, 2, and 3:
[0130] Y=F(X)|W1 Formula 1
[0131] W2=W1 Formula 2
[0132] Y output =F dilated (X input )|W2 Formula 3.
[0133] In a preferred embodiment, the specific method includes:
[0134] Use a frame of data of a certain category to be studied as the second network F dilated () Input X input , name the output Y output , X input and Y output The dimensions of Y are [1, 1500, 5] and [1, 1500, 512] respectively; then, using the weights in the fully connected (fc) layer, defined as fc.weights, output Convert to Y output_fc , Y outputThe dimensions of , fc.weights, and Youtput_fc are [1, 1500, 512], [512, 5], and [1, 1500, 5] respectively; the process is shown in the following formulas 15 and 16. Formula 15 indicates that in the second network F dilated () uses a test data to get specific output, F dilated The parameter value of () is expressed as W2; Formula 16 expresses the use of Y output Multiply by fc.weights to get Y output_fc ; Among them, Y output_fc The dimension is [1, 1500, 5]. This channel represents the contribution wave to a specific classification. 1500 represents the characteristics of a frame of specific data, and the number 5 represents five stages of classification.
[0135] Y output =F dilated (X input )|W2 Formula 15
[0136] Y output_fc =Y output *fc.weights Formula 16.
[0137] S5': Visualize the features of different output dimensions and set thresholds to locate and visualize key features;
[0138] The specific method is as follows:
[0139] Y output_fc [i] indicates the contribution to a particular category when numbered from 0 to 4; i Represents the characteristic wave of the test data for a specific category. The parameter i represents five categories from 0 to 4, corresponding to the five stages of W, N1, N2, N3 and REM. By visualizing Wave i The difference in contribution is shown, where the peak represents the area that contributes more to this category, and the trough refers to the area that contributes less to the final classification result; as shown in the following formula 17:
[0140] Wave i =Y output_fc [i] Formula 17
[0141] Then, the eigenvalue Y is calculated by formula 18. output_fc Converted to a positive value; In order to retain key features, a retention function is used in Formula 19 to make the feature value zero when it is below a specific threshold; The parameter ts represents the threshold in feature retention, which is set to 0.65 by default; Formulas 18 and 19 are as follows:
[0142] Y output_fc =Y output_fc -Youtput_fc .min() Formula 18
[0143] Y output_fc [Y output_fc <ts*Y output_fc .max()]=0 Formula 19.
[0144] S6': Quantitative analysis of the features of the visual display.
[0145] The specific method is as follows:
[0146] The influence of the region of interest on the final result is quantitatively evaluated by calculating the weighted value; the function is defined as mean(), and the average value of Wavei is calculated using the average operation to obtain the value M(i), which represents the quantitative contribution to the specific category i; this value can be used to analyze the preference influence on a specific category; when visualizing Wavei in a graph with 1500 features as the x-axis, the colored strips indicate the position of the feature contribution to a specific category, and the depth of the colored area indicates the size of the decision contribution. Formula 20 is as follows:
[0147] M(i)=mean(Wave i ) Equation 20.
[0148] An embodiment of the present invention further provides a signal-oriented feature positioning display and quantitative analysis device, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program can be executed by the processor to implement any of the methods described above.
[0149] The specific embodiments of the present invention and their working principles are further described in detail below with reference to the accompanying drawings.
[0150] like Figure 1 As shown, a signal-oriented feature positioning display and quantitative analysis method based on a gradient activation category map provided by an embodiment of the present invention includes the following steps:
[0151] S1: Obtain the PSG (Polysomnography) physiological signal to be processed, perform preprocessing, and then perform signal data time sequence misalignment processing.
[0152] It should be noted that the data signal to be processed in the embodiment of the present invention can be a signal of any signal event to be detected (i.e., an event with a certain signal feature), including but not limited to PSG signals, electrocardiogram signals or electroencephalogram signals; the electroencephalogram classification method based on self-supervised contrastive learning provided in the embodiment of the present invention can be applied to model pre-training of any one-dimensional signal.
[0153] The method adopted in the preprocessing of the embodiment of the present invention includes any one of the following methods or a combination of several methods: 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, etc.
[0154] S2: Using the EEG data to train the data signal processing network for EEG classification (also called the "first network" or "EEG classification network"). Figure 3a Schematic diagram of the convolution module in the data signal processing network for EEG classification. Figure 3b Schematic diagram of the dimensionality reduction module in the data signal processing network for EEG classification.
[0155] In the specific implementation, the first network constructed is divided into two parts. The first part is a feature extraction module composed of a convolution module, a dimensionality reduction module, and a global average pooling module, and the second part is a classification module composed of a fully connected layer. By setting the loss function, the network is trained using the back propagation algorithm until convergence.
[0156] S3: Construct a second network similar to the EEG classification network (also called “EEG visualization network”). Figure 4 Schematic diagram of the convolution module in a data signal processing network that is similar to the EEG classification network but without the pooling layer.
[0157] In the specific implementation, the second network constructed is divided into two parts. The first part is a feature extraction module composed of a convolution module and a dimension reduction module, and the second part is a classification module composed of a fully connected layer. Compared with the first network, the second network uses dilated convolution and no pooling layer, and the other network structures are all the same.
[0158] S4: Assign the parameters of the convolutional layer in the first network to the convolutional layer with the same name in the second network, use a frame of data of a certain category to be studied and tested with the required label as the input of the second network, and obtain the output through network calculation.
[0159] In specific implementation, the first network in S2 is represented by F(), its input is represented by X, and its output is represented by Y. The second network in S103 is represented by F dilated () indicates that a frame of data of a certain category to be studied and tested is represented by X input , used as F dalited () input, the output is represented by Y output The weight of F() is represented by W1, F dilated The weight of () is represented as W2.
[0160] Assign the parameter weights of the convolutional network in the first network to the corresponding convolutional layer with the same name in the second network, with X input As the input of the second network, the output is obtained through network calculation, as shown in formulas (1), (2), and (3):
[0161] Y=F(X)|W1 Formula 1
[0162] W2=W1 Formula 2
[0163] Y output =F dilated (X input )W2 Formula 3
[0164] S5: Use a new feature representation and quantitative analysis method based on gradient activation class maps to calculate gradients in different ways. You can either establish a loss function to calculate the loss of the output of the network without pooling layers and the data label, and calculate the gradient of the loss with the input data; or you can directly calculate the gradient between the input and output data.
[0165] There are three specific implementation methods.
[0166] Method 1: Change the X in S4 input The label is encoded in one-hot form and represented as tabel onehot . Use categorical cross entropy as the loss function. The categorical cross entropy function is represented by categorical_crossentropy(), and the loss is represented by Loss0, as shown in Formula 4:
[0167] Loss0=categorical_crossentropy(Y output , Y output -Y output *label onehot ) Formula 4
[0168] The gradient calculation function is represented as Gradient(), which is composed of Loss0 and X input The calculated gradient is represented by Grad0, as shown in Formula 5:
[0169] Grad0=Gradient(Loss0,X input ) Formula 5
[0170] Method 2: Change the X in S4 input The labels are encoded in one-hot code form and zero-value one-hot code form, and are represented as label onehot , label zero .Y output With label onehotThe loss is expressed as Loss temp1 Indicates that Y output With label zero The loss is expressed as Loss temp2 It is expressed as shown in Formula 6 and Formula 7:
[0171] Loss temp1 =categorical_crossentropy(Y output , label onehot ) Formula 6
[0172] Loss temp2 =categorical_crossentropy(Y output , label zero ) Formula 7
[0173] By Loss temp1 With X input The calculated gradient is given by Grad temp1 Indicated by Loss temp2 With X input The calculated gradient is given by Grad temp2 It is expressed as shown in Formula 8 and Formula 9:
[0174] Grad temp2 =Gradient(Loss temp1 , X input ) Formula 8
[0175] Grad temp2 =Gradient(Loss temp2 , X input ) Formula 9
[0176] The final gradient value is represented by Grad1, which is composed of Grad temp1 [0] Subtract Grad temp2 [0] is obtained, as shown in formula 10:
[0177] Grad1=Grad temp1 [0]-Grad temp2 [0] Formula 10
[0178] Method 3: Encode the data label into a one-hot code and then directly multiply it with the output of the network without pooling layer. input The calculated gradient is represented by Grad2, as shown in Formula 11:
[0179] Grad2=Gradient(Y output *label onehot , Xinput ) Formula 11.
[0180] S6: Setting a threshold to obtain the desired gradient region, and using the gradient region for further visualization and analysis of each channel in the five categories of data.
[0181] In the specific implementation, the gradients Grad0, Grad1 and Grad2 in S5 are all represented as Grad, and the maximum and minimum values of the gradients are obtained, which are represented as Grad.min() and Grad.max() respectively. The threshold is used to obtain the required gradient area, and the threshold is represented as ts (where 0<ts<1.0), as shown in Formula 12 and Formula 13:
[0182] Grad=Grad-Grad.min() Formula 12
[0183] Grad[Grad<ts*Grad.max()]=0 Formula 13
[0184] The gradient areas calculated above were used for further visualization and analysis of each channel in the five categories of data.
[0185] S7: Calculate the average value of the gradient obtained in each channel and use it for further quantitative analysis using histogram and pie chart methods.
[0186] In the specific implementation, the average value of the gradient change of a specific channel during the back-propagation algorithm is expressed as Mean(i), the function mean() represents the calculation of the average value, and the parameter i represents a specific channel among the five channels. Specifically, the value range of parameter i is 0 to 4, representing the five channels of EEG1, EEG2, EOG1, EOG2, and EMG, respectively. When using, you can use numbers to correspond to different channels according to the actual number of channels used and the order of channel arrangement. These five channels are synonymous with the five commonly used input signals in sleep staging. As shown in Formula 14:
[0187] Mean(i)=mean(Grad[:,:,i]) Formula 14
[0188] The average values calculated above were used for further quantitative analysis using histogram and pie chart methods.
[0189] The schematic diagram of the principle of the class activation map based on gradient calculation in the embodiment of the present invention is as follows: Figure 5a to Figure 5dAs shown in the figure, the first network at the top is a traditional neural network model, which consists of a feature extraction layer and a classification layer. The feature extraction layer is composed of a convolution module and a dimensionality reduction module. First, train the first network until convergence, and then pass the parameters to the second network below. The second network has three differences compared with the first network: ① No dimensionality reduction module is used, so that the dimension of the data will not be reduced during the feature extraction process, so there will be no information loss; ② Use variable convolution, which will ensure that the convolution kernel will feel greater; ③ There is no classification layer, that is, the last few fully connected layers. Since the parameter assignment is based on the name of the network layer, although the second network has fewer layers, it will not be misplaced. Then select a certain category of data to be studied, the dimension of this data is [1,1500,5], and input this data into the second network. The gradient is calculated in three ways, and the gradient change of each category of data is calculated, and the relevant threshold is set for truncation. The truncated threshold can show the position and color on the feature maps of five different channels. This position can indicate the location where the feature appears, and the depth of the color can represent the value of the gradient; the corresponding area can be calculated and analyzed through quantitative methods to achieve quantitative calculation of key features of different channels.
[0190] like Figure 2 As shown, a signal-oriented feature positioning display and quantitative analysis method based on variable convolutional class activation mapping provided by an embodiment of the present invention includes the following steps:
[0191] S1': Same as S1, obtaining the PSG physiological signal to be processed and performing preprocessing.
[0192] S2': Same as S2, the EEG data is used to train the data signal processing network (first network) for EEG classification.
[0193] S3': Same as S3, a data signal processing network (second network) similar to the EEG classification network is constructed, but without the pooling layer.
[0194] S4': Randomly select a frame of data and input it into the second network. Multiply the output by the parameters of the last fully connected layer of model one to obtain the output.
[0195] Use a frame of test data with the expected label as the second network F dilated () Input X input , name the output Y output , X input and Y output The dimensions of Y are [1,1500,5] and [1,1500,512] respectively; then use the weights in the fully connected (fc) layer, defined as fc.weights, where fc.weights refers to the parameters in the fully connected layer, tooutput Convert to Y output_fc , that is, multiply the output of the convolutional layer by the parameters of the fully connected layer to obtain the output of the fully connected layer Y output_fc , Y output The dimensions of , fc.weights, and Youtput_fc are [1,1500,512], [512,5], and [1,1500,5] respectively; the process is shown in the following formulas 15 and 16. Formula 15 indicates that in the second network F dilated () uses a test data to get specific output, F dilated The parameter value of () is expressed as W2; Formula 16 expresses the use of Y output Multiply by fc.weights to get Y output_fc ; Among them, Y output_fc The dimension is [1, 1500, 5]. This channel represents the contribution wave to a specific classification. 1500 represents the characteristics of a frame of specific data, and the number 5 represents five stages of classification.
[0196] Y output =F dilated (X input )|W2 Formula 15
[0197] Y output-fc =Y output *fc.weights Formula 16.
[0198] S5': Visualize the features of different output dimensions and set thresholds to locate and visualize key features.
[0199] Y output_fc [i] indicates the contribution to a particular category when numbered from 0 to 4; i Represents the characteristic wave of the test data for a specific category. The parameter i represents five categories from 0 to 4, corresponding to the five stages of W, N1, N2, N3 and REM, indicating five different stages in sleep staging, that is, five different labels; by visualizing Wave i The difference in contribution is shown, where the peak represents the area that contributes more to this category, and the trough refers to the area that contributes less to the final classification result; as shown in the following formula 17:
[0200] Wave i =Y output_fc [i] Formula 17
[0201] Then, the eigenvalue Y is calculated by formula 18. output_fcConverted to a positive value; In order to retain key features, a retention function is used in Formula 19 to make the feature value zero when it is below a specific threshold; The parameter ts represents the threshold in feature retention, which is set to 0.65 by default; Formulas 18 and 19 are as follows:
[0202] Y output_fc =Y output_fc -Y output_fc .min() Formula 18
[0203] Y output_fc [Y output_fc <ts*Y output_fc .max()]=0 Formula 19.
[0204] S6': Quantitative analysis of the features of the visual display.
[0205] The influence of the region of interest on the final result is quantitatively evaluated by calculating the weighted value; the function is defined as mean(), and the average value of Wavei is calculated using the average operation to obtain the value M(i), which represents the quantitative contribution to the specific category i; this value can be used to analyze the preference influence on a specific category; when visualizing Wavei in a graph with 1500 features as the x-axis, the colored strips indicate the position of the feature contribution to a specific category, and the depth of the colored area indicates the size of the decision contribution. Formula 20 is as follows:
[0206] M(i)=mean(Wave i ) Equation 20.
[0207] The principle diagram of class activation mapping based on variable convolution in an embodiment of the present invention is as follows: Figures 6a to 6dAs shown in the figure, the first network at the top is a traditional neural network model, which consists of a feature extraction layer and a classification layer. The feature extraction layer is composed of a convolution module and a dimensionality reduction module. First, train the neural network above until convergence, and then pass the parameters to the second network below. The second network has three differences compared to the first network: ① No dimensionality reduction module is used, so that the dimension of the data will not be reduced during the feature extraction process, so there will be no information loss; ② Use variable convolution, which will ensure that the convolution kernel will feel greater; ③ There is no classification layer, that is, the last few fully connected layers. Since the parameter assignment is based on the name of the network layer, although the second network has fewer layers, it will not be misplaced. Then select a certain category of data to be studied, the dimension of this data is [1,1500,5], input this data into the second network, and multiply the output by the fully connected parameters of the last layer of the first network to get the output, which is also [1,1500,5]. The 1500 represents the number of features in the time domain, and 5 represents the tendency for the five classification categories. The five feature graphs below are the visualizations of these five dimensions. The vertical axes of these feature graphs represent the absolute values of the features. We set the corresponding thresholds for truncation and then visualize them. Figure 6c These bars represent the location and size of the corresponding features.
[0208] The present invention can also be used in fields such as aerospace and military industry to realize signal-oriented feature positioning display and quantitative analysis, which will not be given as examples here. The feature positioning display and quantitative analysis method of the present invention is a method formed by a specific data form, and the types of data in various applicable fields are the same, that is, one-dimensional data, which is often signal data. The mainstream imaging data and linguistic data in the current artificial intelligence field have been widely used, and the one-dimensional signal data proposed by the present invention has different characteristics from the two types of imaging data and linguistic data, thus filling the gap of one-dimensional signal data.
[0209] The signal-oriented feature location display and quantitative analysis method provided by the embodiment of the present invention utilizes gradient or variable convolution activation category mapping diagrams, combines the characteristics of a downsampling network without a pooling layer, and combines with the dilated convolution technology to achieve visual display and analysis of each channel in multiple categories of data, thereby indicating or displaying the areas of concern to the neural network model. These areas, as the key features found, can provide judgment criteria and logical basis for decisions involving signal processing, thereby effectively providing explainability for the convolutional neural network in the decision-making process involving signal processing.
[0210] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A signal-oriented feature location display and quantitative analysis method, It is characterized in that The method comprises the following steps: S1: Obtain the data signal to be processed, check the integrity and availability of the data signal, and preprocess it. The specific preprocessing includes data denoising, desensitization, and data incompleteness judgment; S2: construct a deep convolutional neural network that can be used for classifying the data signals to be processed, recorded as the first network, perform model training on the collected data signals to be processed and construct a loss function, and use the back propagation algorithm to train until convergence; S3: construct a deep neural network similar to the first network for visual display and analysis of the data signal to be processed, which is recorded as the second network; S4: assigning the weights of the convolutional layer in the first network to the convolutional layer with the same name in the second network, using the data of the data signal to be processed to be studied, inputting it into the second network, and obtaining the output, and then calculating the fully connected parameters of the last layer of the first network to obtain the output; S5: Establish a loss function, calculate the loss of the output of the network without pooling layer and the data label, and calculate the gradient of the loss and the input data, or directly calculate the gradient between the output and the input data; S6: Setting a threshold to obtain a high-contribution gradient region of a certain channel of the data signal to be processed, and using the gradient region for further visualization, so as to achieve visualization and analysis of each channel in multiple types of data.
2. The signal-oriented feature positioning, display and quantitative analysis method according to claim 1, It is characterized in that The data signal to be processed is a physiological signal of sleep monitoring; and the method also includes step S7: calculating the average value of the gradient obtained by each channel, and using it for further quantitative analysis through histogram and pie chart methods.
3. The signal-oriented feature positioning display and quantitative analysis method according to claim 2, It is characterized in that The S1 includes: S11: Obtain PSG physiological signals from sleep monitoring and cut them into physiological signal segments to facilitate subsequent network classification of the segments; S12: Acquire PSG physiological signals for sleep monitoring, which come from two to five stable signal channels; S13: Divide the physiological signals into a standard dataset, an unlabeled pre-training dataset, a labeled training dataset, a validation dataset, and a test dataset; S14: Filter the signal using a bandpass filter, and then normalize the obtained physiological signal before inputting it into the neural network.
4. The signal-oriented feature positioning display and quantitative analysis method according to claim 2, It is characterized in that In S2: The first network is divided into two parts. The first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling module. The second part is a classification module composed of a fully connected layer. By setting the loss function, the network is trained using the back propagation algorithm until convergence.
5. The signal-oriented feature positioning display and quantitative analysis method according to claim 1, It is characterized in that The first network and the second network are both composed of two parts. The first part is a feature extraction module composed of a convolution module and a dimensionality reduction module, and the second part is a classification module composed of a fully connected layer. Compared with the first network, all convolution layers in the second part of the second network use dilated convolution, and the pooling layer is removed.
6. The signal-oriented feature positioning display and quantitative analysis method according to claim 2, It is characterized in that In S4, the weights of the convolutional layers in the first network are assigned to the second network. Since the names of the convolutional layers in the two networks are the same, the parameters of the convolutional layers of the first network can be directly assigned to the corresponding convolutional layers in the second network. The specific steps include: The first network is represented by F(), its input is represented by X, and its output is represented by Y; the second network is represented by F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W 1 , F dilated The parameter value of () is expressed as W 2 ; The convolutional layer parameters in the first network are assigned to the convolutional network layer with the same name in the second network, and a certain category of data to be studied is used as the input of the second network to calculate the output, as shown in the following formulas 1, 2 and 3: Y = F(X)|W 1 Formula 1 W 2 = W 1 Formula 2 Y output = F dilated (X input )|W 2 Formula 3.
7. The signal-oriented feature positioning display and quantitative analysis method according to claim 1, It is characterized in that There are three methods for calculating the gradient described in S5. The first and second methods require first establishing a loss function, calculating the loss of the output of the network without a pooling layer and the data label, and calculating the gradient of the loss and the input data. The third method directly uses the input and output to calculate the data gradient.
8. The signal-oriented feature positioning display and quantitative analysis method according to claim 7, It is characterized in that Encode the data label into a one-hot code and then calculate the loss and gradient. The specific steps include: A frame of data X of a certain category to be studied input The label is encoded as one-hot code and represented as label onehot ; Use categorical cross entropy as the loss function, the categorical cross entropy function is represented by categorical_crossentropy(), and the loss is represented by Loss 0 It is represented as shown in the following formula 4: Loss 0 = categorical_crossentropy(Y output , Y output -Y output * label onehot ) Formula 4 The gradient calculation function is represented as Gradient(), and Loss 0 With X input The calculated gradient is given by Grad 0 It is represented as shown in the following formula 5: Grad 0 =Gradient(Loss 0 , X input ) Formula 5.
9. The signal-oriented feature positioning display and quantitative analysis method according to claim 7, It is characterized in that Encode the data labels into one-hot code form and zero-value one-hot code form and then calculate the loss and gradient respectively. The specific steps include: A frame of data X of a certain category to be studied input The labels are encoded in one-hot code form and zero-value one-hot code form, and are represented as label onehot 、label zero ; Y output With label onehot The loss is expressed as Loss temp1 Indicates that Y output With label zero The loss is expressed as Loss temp2 It is expressed as shown in the following formula 6 and formula 7: Loss temp1 = categorical_crossentropy(Y output , label onehot ) Formula 6 Loss temp2 = categorical_crossentropy(Y output , label zero ) Formula 7 By Loss temp1 With X input The calculated gradient is given by Grad temp1 Indicated by Loss temp2 With X input The calculated gradient is given by Grad temp2 It is expressed as shown in the following formula 8 and formula 9: Grad temp1 =Gradient(Loss temp1 , X input ) Formula 8 Grad temp2 =Gradient(Loss temp2 , X input ) Formula 9 The final gradient value is represented by Grad 1 , by Grad temp1 [0] Subtract Grad temp2 [0] is obtained, as shown in formula 10: Grad 1 = Grad temp1 [0]-Grad temp2 [0] Formula 10.
10. The signal-oriented feature positioning display and quantitative analysis method according to claim 7, It is characterized in that The data label is encoded as a one-hot code, and then directly multiplied with the output of the network without pooling layer to obtain the loss and then calculate the gradient. The specific steps include: encoding the data label as a one-hot code, and then directly multiplying it with the output of the network without pooling layer, and the result is X input The calculated gradient is given by Grad 2 It is represented as shown in the following formula 11: Grad 2 = Gradient(Y output *label onehot , X input ) Formula 11.
11. The signal-oriented feature positioning display and quantitative analysis method according to claim 1, It is characterized in that The specific steps of S6 include: The gradient is represented by Grad, and the maximum and minimum values of the gradient are obtained, which are represented by Grad.min() and Grad.max() respectively; a threshold is used to obtain the required gradient area, and the threshold is represented by ts, as shown in the following formulas 12 and 13: Grad=Grad-Grad.min() Formula 12 Grad[Grad<ts*Grad.max()]=0 Formula 13 The gradient regions calculated above are used for further visualization and analysis of each channel in multi-class data.
12. The signal-oriented feature positioning display and quantitative analysis method according to claim 1, It is characterized in that The specific steps of S7 include: The average value of the gradient change of a specific channel during the back-propagation algorithm is expressed as Mean(i). The function mean() represents the calculation of the average value, and the parameter i represents a specific channel among the five channels. Specifically, the value range of the parameter i is 0 to 4, representing the five channels of EEG1, EEG2, EOG1, EOG2, and EMG, respectively; as shown in the following formula 14: Mean(i)=mean(Grad[:,:,i]) Formula 14 The average values calculated above were used for further quantitative analysis using histogram and pie chart methods.
13. A signal-oriented feature location display and quantitative analysis method, It is characterized in that The method comprises the following steps: S1': Obtain the data signal to be processed, check the integrity and availability of the data signal, and preprocess it. The specific preprocessing includes data denoising, desensitization, and data incompleteness judgment; S2': training a data signal processing network for physiological signal EEG classification, denoted as the first network, including a feature extraction layer and a mapping layer; S3': Build a second network with the same name as each layer of the first network, use variable convolution as the convolution kernel, and remove the pooling layer; S4': assign the parameters of the first network to the second network, randomly select a frame of data, input it into the second network model, calculate the output of the second network and the fully connected parameters of the first network to obtain the output; S5': Visualize the features of different output dimensions and set thresholds to locate and visualize key features; S6': Quantitative analysis of the features of the visual display.
14. The signal-oriented feature positioning display and quantitative analysis method according to claim 13, It is characterized in that The data signal to be processed is a physiological signal of sleep monitoring; the specific method of S1' comprises: Obtain PSG physiological signals from sleep monitoring and cut them into physiological signal segments to facilitate subsequent network classification of the segments; Obtain PSG physiological signals for sleep monitoring, which come from two to five stable signal channels; Divide the physiological signals into standard dataset, unlabeled pre-training dataset, labeled training dataset, validation dataset and test dataset; The signal is filtered using a bandpass filter, and then the obtained physiological signal is normalized before being input into the neural network.
15. The signal-oriented feature positioning, display and quantitative analysis method according to claim 13, It is characterized in that In S2', the first network is divided into two parts, the first part is a feature extraction module composed of a convolution module, a dimensionality reduction module and a global average pooling, and the second part is a classification module composed of a fully connected layer; by setting a loss function, the network is trained using a back propagation algorithm until convergence.
16. The signal-oriented feature positioning display and quantitative analysis method according to claim 14, It is characterized in that The specific steps of S4' include: The first network is represented by F(), its input is represented by X, and its output is represented by Y; the second network is represented by F dilated () indicates that a frame of data of a certain category to be studied is represented by X input , used as F dalited () input, the output is represented by Y output , the parameter value of F() is expressed as W 1 , F dilated The parameter value of () is expressed as W 2 ; Assign the convolutional layer parameters in the first network to the convolutional network layer with the same name in the second network, use a certain category of data to be studied as the input of the second network, and calculate the output, as shown in the following formulas 1, 2, and 3: Y = F(X)|W 1 Formula 1 W 2 = W 1 Formula 2 Y output = F dilated (X input )|W 2 Formula 3.
17. The signal-oriented feature positioning, display and quantitative analysis method according to claim 13, It is characterized in that The specific method of S4' comprises: Use a frame of data of a certain category to be studied as the second network F dilated () Input X input , name the output Y output , X input and Y output The dimensions of Y are [1, 1500, 5] and [1, 1500, 512] respectively; then, using the weights in the fully connected (fc) layer, defined as fc.weights, output Convert to Y output_fc , Y output The dimensions of , fc.weights, and Youtput_fc are [1, 1500, 512], [512, 5], and [1, 1500, 5] respectively; the process is shown in the following formulas 15 and 16. Formula 15 indicates that in the second network F dilated () uses a test data to get specific output, F dilated The parameter value of () is expressed as W 2 ; Formula 16 means using Y output Multiply by fc.weights to get Y output_fc ; Among them, Y output_fc The dimension is [1, 1500, 5]. This channel represents the contribution wave to a specific classification. 1500 represents the characteristics of a frame of specific data, and the number 5 represents five stages of classification. Y output = F dilated (X input )|W 2 Formula 15 Y output_fc = Y output *fc.weights Official 16.
18. The signal-oriented feature positioning, display and quantitative analysis method according to claim 13, It is characterized in that The specific method of S5' is as follows: Y output_fc [i] indicates the contribution to a particular category when numbered from 0 to 4; i Represents the characteristic wave of the test data for a specific category. The parameter i represents five categories from 0 to 4, corresponding to the five stages of W, N1, N2, N3 and REM. By visualizing Wave i The difference in contribution is shown, where the peak represents the area that contributes more to this category, and the trough refers to the area that contributes less to the final classification result; as shown in the following formula 17: Wave i = Y output_fc [i] Official 17 Then, the eigenvalue Y is calculated by formula 18. output_fc Converted to a positive value; In order to retain key features, a retention function is used in Formula 19 to make the feature value zero when it is below a specific threshold; The parameter ts represents the threshold in feature retention, which is set to 0.65 by default; Formulas 18 and 19 are as follows: Y output_fc = Y output_fc -Y output_fc .min() formula 18 Y output_fc [Y output_fc <ts*Y output_fc .max()] = 0 Equation 19.
19. The signal-oriented feature positioning, display and quantitative analysis method according to claim 13, It is characterized in that In S6', the features of the visual display are quantitatively analyzed, and the specific method is as follows: The influence of the region of interest on the final result is quantitatively evaluated by calculating the weighted value; the function is defined as mean(), and the average value of Wavei is calculated using the average operation to obtain the value M(i), which represents the quantitative contribution to the specific category i; this value can be used to analyze the preference influence on a specific category; when visualizing Wavei in a graph with 1500 features as the x-axis, the colored strips indicate the position of the feature contribution to a specific category, and the depth of the colored area indicates the size of the decision contribution. Formula 20 is as follows: M(i)=mean(Wave i ) Formula 20.
20. A signal-oriented feature positioning display and quantitative analysis device, comprising a processor and a memory, It is characterized in that A computer program is stored in the memory, and the computer program can be executed by the processor to implement the method according to any one of claims 1 to 19.
Citation Information
Patent Citations
Epilepsy magnetoencephalogram spinous wave automatic detection method and traceability positioning system
CN111340142A
Video classification method and model training method and apparatus thereof, and electronic device
WO2020221278A1
