Classification method and system of type B residual current waveform based on cyclic MDC
By using the cyclic cascade multi-scale atrous convolution module and the waveform prediction model of the attention mechanism in the B-type residual current protector, the problem of complex waveform identification is solved, an efficient recognition accuracy rate of 99.95% is achieved, and the protector's performance is improved. Security and reliability.
Patent Information
- Application Number
- CN202410576359.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-05-10
AI Technical Summary
It is difficult for existing technology to effectively identify and classify complex residual current waveforms, leading to misoperation of protectors and affecting the safety of distribution lines.
A waveform prediction model based on a cyclic cascade multi-scale atrous convolution module, a S-type exponential nonlinear unit activation function and a channel and spatial attention mechanism is used, and trained through a multi-class cross-entropy loss function to achieve the prediction of B-type residual current waveforms. Efficient identification and classification.
It achieves 99.95% recognition accuracy of B-type residual current waveform, enhances the reliability and safety of the protector, and is suitable for the identification and classification of complex waveforms.
Smart Images

Figure CN118245886B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of residual current waveform classification, and relates to a B-type residual current waveform classification method and system based on cyclic MDC (cascaded multi-scale void convolution). Background Art
[0002] Residual current protector is a commonly used electrical device in distribution network, which plays a very important role in ensuring the safety of power supply of the line. At present, the residual current protection device commonly used in my country is AC type, which can only trip and protect the sudden or slowly rising power frequency AC residual current. However, with the rapid development of science and technology, the electrical loads in the distribution network are becoming more and more complex, and the possibility of various complex residual currents such as pure DC residual current, AC current superimposed on pulsating DC, DC current superimposed on high-frequency AC, etc. in the line is increasing. The application of type B residual current protector will become very important. Type B residual current protector has a wider range of application scenarios and can provide safer protection. It will be required to be used compulsorily in some fields.
[0003] In addition to realizing the function of protecting AC and A type residual currents, type B residual current protector should also identify various complex waveforms such as pure DC, pulsating DC, smooth DC, DC superimposed on industrial frequency AC, DC superimposed on high frequency AC, etc. The identification and classification of various complex waveforms is a very arduous task, which is related to the reliability and safety of the residual current protector.
[0004] The traditional waveform analysis method is to convert the analog signal collected by the system into digital form, and then analyze the frequency components of the signal in the frequency domain based on methods such as Fourier transform to achieve signal recognition and classification. However, the residual current waveform is complex and changeable, and the traditional waveform analysis method may misclassify or miss detection, which will cause the protector to malfunction and affect the safety of the distribution line. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the present invention provides a type B residual current waveform classification method and system based on cyclic MDC, which can efficiently realize the waveform recognition and classification of type B residual current, with a recognition accuracy rate of 99.95%.
[0006] The present invention adopts the following technical solution.
[0007] A type B residual current waveform classification method based on cyclic MDC includes the following steps:
[0008] S1: According to the B-type residual current waveform characteristics, a cascaded multi-scale dilated convolution module is constructed according to different dilated convolution kernels;
[0009] S2: A waveform prediction model is constructed by cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules;
[0010] S3: The waveform prediction model is trained using a multi-classification cross entropy loss function, and the trained waveform prediction model is used to classify the type B residual current waveform.
[0011] Preferably, the cascaded multi-scale dilated convolution module constructed in S1 includes an input layer, three dilated convolution kernels with dilation rates of 1, 2, and 3, respectively, a splicing layer, a convolution layer, a residual structure, and an output layer connected in sequence.
[0012] Preferably, the convolution kernel sizes of the three dilated convolution kernels are all 3, and the convolution kernel size of the convolution layer is 1.
[0013] Preferably, in S2, the activation function of the sigmoid exponential nonlinear unit is:
[0014] (2)
[0015] Among them, x is the input feature.
[0016] Preferably, in S2, the channel and spatial attention mechanism module includes a channel attention feature extraction unit and a spatial attention feature extraction unit;
[0017] The channel attention feature extraction unit performs global average pooling on deep features in space to obtain the spatial average pooling weight of each channel. It performs nonlinear learning on the channel spatial average pooling weight through two fully connected layers and an activation function to obtain the weight value of the feature on the channel. The weight value is processed by the sigmoid function and multiplied with the original feature to obtain the channel attention feature.
[0018] The spatial attention feature extraction unit obtains the maximum value of each feature point of the waveform, that is, the spatial weight, for the channel attention feature by using the maximum value screening method on the channel. The spatial weight is nonlinearly learned through two fully connected layers and an activation function to obtain the weight value of the feature in space. The weight value is processed by the softmax function and multiplied with the original channel attention feature to obtain the spatial attention feature.
[0019] Preferably, the logic of the channel attention feature extraction unit for performing channel attention feature extraction is:
[0020] (3)
[0021] In the formula, represents the input features, represents the global average pooling in space, represents the first fully connected layer in the channel attention feature extraction unit, represents the second fully connected layer in the channel attention feature extraction unit, Represents a sigmoid-like exponential nonlinear unit activation function.
[0022] Preferably, the logic of the spatial attention feature extraction unit for performing spatial attention feature extraction is:
[0023] (4)
[0024] In the formula, represents the input features, The maximum value of each feature point in the space is screened on the representative channel. represents the first fully connected layer in the spatial attention feature extraction unit, represents the second fully connected layer in the spatial attention feature extraction unit, Represents a sigmoid-like exponential nonlinear unit activation function.
[0025] Preferably, the waveform prediction model constructed in S2 includes an input layer, a first batch normalization layer, a first 1x1 convolution layer, a first SENU layer, a second batch normalization layer, three cascaded multi-scale hole convolution modules of a cycle, a channel and spatial attention mechanism module, a first linear layer, a third batch normalization layer, a random inactivation layer, a second SENU layer, a fourth batch normalization layer, a second linear layer and an output layer in sequence, wherein the first SENU layer and the second SENU layer adopt an S-type exponential nonlinear unit activation function; an input layer for inputting a B-type residual current waveform; a first 1x1 convolution layer for convolving waveform features; three cascaded cycles The multi-scale hole convolution module is used to extract the global information features of the residual current waveform; the channel and spatial attention mechanism module is used to extract channel and spatial attention features; the first batch normalization layer, the second batch normalization layer, the third batch normalization layer, and the fourth batch normalization layer are used to normalize the features in batches; the first linear layer and the second linear layer are used to perform full connection operations on the features; the first SENU layer and the second SENU layer are used to perform nonlinear transformation activation on the features; the random inactivation layer is used to improve the robustness and stability of the network by randomly losing neurons; the output layer is used to output the classification results of the type B residual current waveform.
[0026] Preferably, the multi-classification cross entropy loss function used in S3 is:
[0027] (5)
[0028] in The network predicts the probability distribution of a waveform in different categories. Representative Waveform; is the one-hot encoding of the waveform sample label; n Indicates the number of residual current waveforms.
[0029] A type B residual current waveform classification system based on cyclic MDC, comprising:
[0030] The model building module is used to construct a cascaded multi-scale dilated convolution module based on different dilated convolution kernels for the B-type residual current waveform characteristics. The waveform prediction model is constructed by cyclically cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules.
[0031] The model training and waveform classification module is used to train the waveform prediction model using a multi-classification cross entropy loss function, and use the trained waveform prediction model to classify the type B residual current waveform.
[0032] A terminal comprises a processor and a storage medium; the storage medium is used to store instructions;
[0033] The processor is configured to operate according to the instructions to execute the steps of the method.
[0034] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0035] The beneficial effects of the present invention are as follows:
[0036] The present invention takes into account the characteristics of type B residual current waveform being short, the amount of data being small, and the waveform being not suitable for feature extraction by downsampling. In order to expand the receptive field, a cascaded dilated convolution mode is adopted to construct a cascaded multi-scale dilated convolution module to obtain the global information of the type B residual current waveform. While increasing the receptive field, the amount of calculation parameters is reduced, and on this basis, multi-scale information under different receptive fields is fused, and the feature information of the smaller receptive field is further fused into the deep network, which increases the feature diversity while also enhancing the attention to local information.
[0037] The S-type exponential nonlinear unit activation function of the present invention has different activation degrees for input features in different intervals. Its gradient in the negative semi-axis is smaller than that in the positive semi-axis, which has a unilateral weak inhibition effect on the negative semi-axis, enhances the attention to the positive semi-axis, and avoids the neuron death problem caused by the ReLU function. The problem of gradient disappearance during back propagation can be avoided under the action of the BatchNorm function.
[0038] The channel and spatial attention mechanism modules of the present invention enhance the expression ability of the network model in deep features, can better highlight the proportion of each feature point, and increase the weight of the feature layer with greater contribution.
[0039] The waveform prediction model network constructed by the present invention through cyclic cascade multi-scale void convolution modules and introduction of S-type exponential nonlinear unit activation function and channel and space attention mechanism modules has high robustness and stability. The present invention sets a multi-classification cross entropy loss function that has the best effect on type B residual current. The trained waveform prediction model can efficiently realize the waveform recognition and classification of type B residual current, and the recognition accuracy rate reaches 99.95%. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is the receptive field size under different dilated convolution kernel operations;
[0041] Figure 2 It is a cascaded multi-scale dilated convolution module;
[0042] Figure 3 It is an S-type exponential nonlinear unit activation function;
[0043] Figure 4 is the gradient of the activation function of the S-type exponential nonlinear unit;
[0044] Figure 5 is the waveform prediction model;
[0045] Figure 6 It is the channel and spatial attention mechanism module;
[0046] Figure 7 This is a schematic diagram of the randomly selected 1st to 4th category B residual current waveform;
[0047] Figure 8 This is a schematic diagram of the randomly selected 5th to 8th category B residual current waveform;
[0048] Fig. 9 This is a schematic diagram of the randomly selected 9th to 11th category B residual current waveform;
[0049] Fig.10 is the loss value and accuracy during training;
[0050] Fig.11 is the loss value and accuracy on the validation set. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only embodiments of a part of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.
[0052] Embodiment 1 of the present invention provides a type B residual current waveform classification method based on cyclic MDC, comprising the following steps:
[0053] S1: According to the B-type residual current waveform characteristics, a cascaded multi-scale dilated convolution module is constructed according to different dilated convolution kernels;
[0054] A convolutional neural network is a feedforward neural network that includes convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning and has outstanding performance in information classification. In traditional neural networks, the parameter amount of the model is reduced by introducing a pooling layer, but this also brings about the problem of loss of spatial detail information. The present invention takes into account the method of increasing the receptive field without increasing the parameter amount as much as possible and reducing the loss of spatial details, and adopts the method of dilated convolution. When the network parameters are fixed, the receptive field of the dilated convolution kernel obtained by setting different dilated rates is different. When the dilated rate of the cascaded dilated convolution kernel is sawtooth-shaped and satisfies the maximum distance formula between two non-zero values, the receptive field obtained is continuous. As Figure 1 As shown, (a), (b) and (c) represent the receptive field range in the process of cascade convolution kernels. The convolution layer used in (a) is of size The dilated convolution with a size of 3, and the convolution layer used in (b) is of size The cascade modes of the dilated convolution kernels are 3 and 5 respectively. The convolution layer used in (c) is of size The dilated convolution kernel cascade modes are 3, 5, and 7 respectively, where represents the original convolution kernel size, represents the void ratio, represents the convolution kernel size of the dilated convolution, so the size of the receptive field RF can be expressed as:
[0055] (1)
[0056] in, represents the number of convolutional layers, Indicates The product of the strides in the layer and all the layers before it.
[0057] like Figure 1 As shown in (c), the receptive field that can be obtained is 13. Because the dilated convolution uses zero padding to expand the receptive field, if we assume that the number of input and output layers of the three convolution kernels is the same, both c, then Figure 1 (c) The required number of parameters is , and under the same receptive field, the number of parameters required for traditional convolution is ,thus, Figure 1 (c) The number of parameters required is much smaller than that of traditional cascaded convolution.
[0058] The present invention takes into account the short waveform of the B-type residual current and adopts Figure 1 (c) The dilated convolution kernels with dilation rates of 1, 2, and 3 in the cascade mode are the basic modules of the cascaded multi-scale dilated convolution module (MDC module).
[0059] Since the size of the local feature points in the current waveform has an important reference value for classification, the present invention adopts the following method: Figure 2 The cascaded multi-scale dilated convolution module (MDC module) shown in the figure includes a sequentially connected input layer, three dilated convolution kernels with different dilation rates, a splicing layer, a convolution layer, a residual structure, and an output layer. It adds multi-scale fusion to the cascade model, integrates the feature information obtained from a smaller receptive field into the calculation of the deep layer of the network, and strengthens the focus on local information features. At the same time, multi-scale fusion increases the diversity of features, reduces the risk of overfitting, and thus improves the generalization ability of the model.
[0060] Further preferably, the dilation rates of the three dilation convolution kernels with different dilation rates are 1, 2, and 3, respectively.
[0061] S2: A waveform prediction model is constructed by cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules;
[0062] (1) Based on the MDC module, according to formula (1), when three MDC modules are cycled, the receptive field RF reaches a size of 37, which is larger than the data length of the current waveform. Therefore, the global information of the current waveform can be obtained.
[0063] The MDC module uses cascaded dilated convolution to increase the receptive field range to 13 with a small number of parameters. At the same time, nonlinearity is added after each convolution layer to increase the complexity of the model so as to more accurately approximate the classification function. Since the features under different receptive fields have different understandings of waveform data, multi-scale fusion can better capture local detail information and broader context information. In order to ensure the globality of the extracted features, the present invention obtains a network model with a receptive field of 37 by cascading three MDC modules to extract the global information of the waveform signal.
[0064] (2) S-type exponential nonlinear unit activation function:
[0065] The present invention proposes an S-like Exponential Nonlinear Unit (SENU) activation function as shown in formula (2), which is used to perform nonlinear transformation activation on features. The SENU activation function has different activation degrees for input features in different intervals, such as Figure 4 As shown in , the gradient of the SENU activation function on the negative semi-axis is smaller than that on the positive semi-axis, which has a unilateral weak inhibition effect on the negative semi-axis, enhances the attention to the positive semi-axis, and avoids the neuron death problem caused by the ReLU function. Figure 3 As shown in the figure, the gradient of the SENU activation function approaches 1 in most of the unsaturated regions [-1, 2]. Under the action of the BatchNorm function, the problem of gradient disappearance during back propagation can be avoided.
[0066] (2)
[0067] In formula (2) represents the input features, Represents the output feature of the activation function.
[0068] (3) Channel and spatial attention mechanism module:
[0069] In order to enhance the expressive ability of the network model in deep features, the present invention proposes a channel and spatial attention mechanism (CSAM) module, including a channel attention feature extraction unit and a spatial attention feature extraction unit.
[0070] like Figure 6 As shown in (a), the channel attention feature extraction unit performs global average pooling on the deep features in space to obtain the spatial average pooling weight of each channel, and performs nonlinear learning on the channel weights through two fully connected layers and an activation function to obtain the weight value of the feature on the channel. The weight value is processed by the sigmoid function and multiplied with the original feature to obtain the channel attention feature, as shown in formula (3).
[0071] In the spatial attention feature extraction unit, the channel attention feature obtains the maximum value of each feature point of the waveform by using the maximum value screening on the channel, and nonlinearly learns the spatial weight through two fully connected layers and an activation function to obtain the weight value of the feature in space. The weight value is processed by the softmax function and multiplied with the original channel attention feature to obtain the spatial attention feature, as shown in formula (4). Formula (4) uses the softmax function in space to normalize the sum of the spatial attention weight values of the waveform feature points in space to 1, which can better highlight the proportion of each feature point.
[0072] (3)
[0073] In formula (3), Represents the input features of the CSAM module, represents the global average pooling in space, represent Figure 6 The first fully connected layer in (b), represents the second fully connected layer, represents the activation function shown in formula (2). In this embodiment, , for modeling.
[0074] (4)
[0075] In formula (4), Represents the input features of the CSAM module, The maximum value of each feature point in the space is screened on the representative channel. represent Figure 6 The first fully connected layer in (c) represents the second fully connected layer, represents the activation function shown in formula (2). In this embodiment, Modeling.
[0076] It is understandable that the formulas (3) and (4) The first SENU layer and the second SENU layer below only use the S-type exponential nonlinear unit activation function, but the formulas (3) and (4) This is not achieved through the first SENU layer and the second SENU layer described below. They both use the S-type exponential nonlinear unit activation function, but use the same formula.
[0077] The first fully connected layer and the second fully connected layer are in the channel and spatial attention mechanism module (channel attention feature extraction unit), while the first linear layer and the second linear layer below are in the waveform prediction model. The two are not related or different.
[0078] (4) For waveform classification tasks, the waveform prediction model proposed by the present invention through the cyclic cascade multi-scale dilated convolution module is as follows Figure 5 As shown, it includes an input layer, a first batch normalization layer, a first 1x1 convolution layer, a first SENU layer, a second batch normalization layer, three cascaded multi-scale hole convolution modules (i.e., three cascaded MDC modules), a channel and spatial attention mechanism module, a first linear layer, a third batch normalization layer, a random inactivation layer, a second SENU layer, a fourth batch normalization layer, a second linear layer, and an output layer. First, since the residual current waveform is short and the amount of data is small, the waveform is not suitable for extracting features by downsampling. In order to expand the receptive field, the present invention adopts a cascaded hole convolution mode, and on this basis, it fuses multi-scale information under different receptive fields, and further fuses the feature information of the smaller receptive field into the deep network, which increases the feature diversity while also enhancing the attention to local information. According to the receptive field formula (1), the three-layer hole rates are calculated to be 1, 2, and 3 respectively. The receptive field obtained after the convolution kernel of size 3 is 13. Therefore, the present invention is based on the MDC module. According to formula (1), the receptive field obtained when the MDC module is cycled three times is 37, and the global information of the residual current waveform can be obtained. Then, in order to increase the weight of the feature layer with greater contribution, the present invention uses a channel and space attention mechanism module (CSAM module) to further optimize the features extracted by the network. It performs global adaptive mean on the channel and maximum value screening on the channel to extract the attention weight of the feature block, thereby optimizing the extracted features. The third batch normalization layer and the fourth batch normalization layer are used to normalize the features in batches. The first linear layer and the second linear layer perform full connection operations on the extracted features, and the S-type exponential nonlinear unit activation function (SENU layer) and the random loss layer with a loss rate of 0.5 are introduced to randomly lose neurons to improve the robustness and stability of the network.
[0079] S3: The waveform prediction model is trained using a multi-classification cross entropy loss function, and the trained waveform prediction model is used to classify the type B residual current waveform.
[0080] Commonly used multi-classification cross entropy loss functions mainly include: cross entropy loss function (CELoss), binary cross entropy loss function (BCELoss), loss function for solving category imbalance (FocalLoss), etc. The present invention uses CELoss, BCELoss, and FocalLoss to obtain accuracy rates of 99.95%, 99.80%, and 99.25%, respectively. Experiments have verified that the cross entropy loss function (CELoss) has a good performance effect on the B-type residual current waveform prediction model. Therefore, the present invention uses the multi-classification cross entropy loss function shown in formula (5) to perform network training of the waveform prediction model.
[0081] (5)
[0082] in For a waveform, the network predicts the probability distribution of different categories. Representative bar waveform, c represents the number of waveform categories; is the one-hot encoding of the waveform sample label; n Indicates the number of residual current waveforms.
[0083] In specific implementation, the data set of the present invention collects 11 common B-type residual current waveforms, each waveform has 200 samples, a total of 2200 waveform data, and the length of each residual current waveform is 31. The data set is divided into training set, validation set and test set in a ratio of 6:2:2, and waveforms of each category are randomly read from the three data sets for model training. The present invention avoids the limitations and particularities of fixed data set division through 5-fold cross-validation. The five models trained under 5-fold cross-validation are tested on the test set respectively, and the average of the predicted accuracy is used as the evaluation indicator of model performance. By observation Figure 7-Figure 9 From the distribution characteristics of each waveform, we can see that at different feature points, each waveform has different information representations. There are waveforms with large differences in performance, such as waveforms in categories 5, 9, and 10. These categories have obvious characteristics and good classification characteristics. There are also waveforms with similar distributions, such as waveforms in categories 1, 3, 4, 5, and 11. Therefore, local information features play an important role in the classification of these categories.
[0084] The present invention adopts the Adam algorithm for gradient descent, the initial learning rate is 0.0001, the number of iterations is 80, and the Cosine Annealing algorithm is used to update the learning rate during the iteration process. The cascaded hole convolution model algorithm proposed by the present invention is used to train the network under the supervision of the multi-classification cross entropy loss function of formula (5). The loss value and accuracy rate on the training set and the validation set during the training process are respectively as follows: Fig.10 , Fig.11 As shown in the figure, it can be verified that the model proposed by the present invention has good classification performance for simple small sample waveform data. The accuracy rate in the test set reaches 99.95%. Therefore, the present invention achieves a relatively accurate classification of the B-type residual current waveform.
[0085] The ablation experiment results are shown in Table 1:
[0086] Table 1 Classification prediction results of different models on the B-type residual waveform test set
[0087]
[0088] Based on the small number of waveform features, the AlexNet model was used to determine that the basic convolution block consists of a one-dimensional convolution layer, a ReLU activation layer, and a batch normalization layer.
[0089] The basic convolutional neural network in Table 1 consists of the first batch normalization layer, the first convolution kernel size The basic convolution block and the second convolution kernel size are The basic convolution block, the first maximum pooling layer, and the third convolution kernel size are The basic convolution block, the second maximum pooling layer, and the fourth convolution kernel size are It consists of a basic convolutional block and a multi-layer perceptron.
[0090] The cascaded multi-scale dilated convolution model based on loop 1 uses the cascaded multi-scale dilated convolution module proposed in the present invention to replace the second convolution kernel size The basic convolution block, the first maximum pooling layer, and the third convolution kernel size are The basic convolution block, the second maximum pooling layer, and the fourth convolution kernel size are The basic convolutional block.
[0091] The cycle-based cascaded multi-scale dilated convolution model 2 replaces the ReLU activation function in the cycle-based cascaded multi-scale dilated convolution model 1 with the S-type exponential nonlinear unit activation function proposed in the present invention.
[0092] The cycle-based cascaded multi-scale dilated convolution model 3 uses the channel and spatial attention mechanism modules proposed in the present invention to be added to the multi-layer perceptron of the cycle-based cascaded multi-scale dilated convolution model 1.
[0093] The cycle-based cascaded multi-scale dilated convolution model 4 uses the channel and spatial attention mechanism modules proposed in the present invention to be added to the multi-layer perceptron of the cycle-based cascaded multi-scale dilated convolution model 2.
[0094] It can be seen from the data in Table 1 that after adopting the design of the present invention, the indicators are all improved.
[0095] Embodiment 2 of the present invention provides a type B residual current waveform classification system based on cyclic MDC, comprising:
[0096] The model building module is used to construct a cascaded multi-scale dilated convolution module based on different dilated convolution kernels for the B-type residual current waveform characteristics. The waveform prediction model is constructed by cyclically cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules.
[0097] The model training and waveform classification module is used to train the waveform prediction model using a multi-classification cross entropy loss function, and use the trained waveform prediction model to classify the type B residual current waveform.
[0098] A terminal includes a processor and a storage medium, wherein the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method.
[0099] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0100] The beneficial effects of the present invention are as follows:
[0101] The present invention takes into account the characteristics of type B residual current waveform being short, the amount of data being small, and the waveform being not suitable for feature extraction by downsampling. In order to expand the receptive field, a cascaded dilated convolution mode is adopted to construct a cascaded multi-scale dilated convolution module to obtain the global information of the type B residual current waveform. While increasing the receptive field, the amount of calculation parameters is reduced, and on this basis, multi-scale information under different receptive fields is fused, and the feature information of the smaller receptive field is further fused into the deep network, which increases the feature diversity while also enhancing the attention to local information.
[0102] The S-type exponential nonlinear unit activation function of the present invention has different activation degrees for input features in different intervals. Its gradient in the negative semi-axis is smaller than that in the positive semi-axis, which has a unilateral weak inhibition effect on the negative semi-axis, enhances the attention to the positive semi-axis, and avoids the neuron death problem caused by the ReLU function. The problem of gradient disappearance during back propagation can be avoided under the action of the BatchNorm function.
[0103] The channel and spatial attention mechanism modules of the present invention enhance the expression ability of the network model in deep features, can better highlight the proportion of each feature point, and increase the weight of the feature layer with greater contribution.
[0104] The waveform prediction model network constructed by the present invention through cyclic cascade multi-scale void convolution modules and introduction of S-type exponential nonlinear unit activation function and channel and space attention mechanism modules has high robustness and stability. The present invention sets a multi-classification cross entropy loss function that has the best effect on type B residual current. The trained waveform prediction model can efficiently realize the waveform recognition and classification of type B residual current, and the recognition accuracy rate reaches 99.95%.
[0105] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0106] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0107] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0108] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0109] 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 above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A classification method for type B residual current waveform based on cyclic MDC, It is characterized in that The following steps are involved: S1: According to the B-type residual current waveform characteristics, a cascaded multi-scale dilated convolution module is constructed according to different dilated convolution kernels; S2: A waveform prediction model is constructed by cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules; In S2, the channel and spatial attention mechanism module includes a channel attention feature extraction unit and a spatial attention feature extraction unit; The channel attention feature extraction unit performs global average pooling on deep features in space to obtain the spatial average pooling weight of each channel. It performs nonlinear learning on the channel spatial average pooling weight through two fully connected layers and an activation function to obtain the weight value of the feature on the channel. The weight value is processed by the sigmoid function and multiplied with the original feature to obtain the channel attention feature. The spatial attention feature extraction unit obtains the maximum value of each feature point of the waveform, i.e., the spatial weight, for the channel attention feature by using the maximum value screening method on the channel. The spatial weight is nonlinearly learned through two fully connected layers and an activation function to obtain the weight value of the feature in space. The weight value is processed by the softmax function and multiplied with the original channel attention feature to obtain the spatial attention feature. The logic of channel attention feature extraction unit for channel attention feature extraction is: (3) In the formula, represents the input features, represents the global average pooling in space, represents the first fully connected layer in the channel attention feature extraction unit, represents the second fully connected layer in the channel attention feature extraction unit, Represents the S-type exponential nonlinear unit activation function; The logic of spatial attention feature extraction by the spatial attention feature extraction unit is: (4) In the formula, represents the input features, The maximum value of each feature point in the space is screened on the representative channel. represents the first fully connected layer in the spatial attention feature extraction unit, represents the second fully connected layer in the spatial attention feature extraction unit, Represents the S-type exponential nonlinear unit activation function; S3: The waveform prediction model is trained using a multi-classification cross entropy loss function, and the trained waveform prediction model is used to classify the type B residual current waveform.
2. A type B residual current waveform classification method based on cyclic MDC according to claim 1, Features: The cascaded multi-scale dilated convolution module constructed in S1 includes an input layer, three dilated convolution kernels with dilation rates of 1, 2, and 3, a splicing layer, a convolution layer, a residual structure, and an output layer connected in sequence.
3. A type B residual current waveform classification method based on cyclic MDC according to claim 2, Features: The convolution kernel sizes of the three hole convolution kernels are all 3, and the convolution kernel size of the convolution layer is 1.
4. A type B residual current waveform classification method based on cyclic MDC according to claim 1, Features: In S2, the activation function of the S-type exponential nonlinear unit is: (2) Among them, x is the input feature.
5. A type B residual current waveform classification method based on cyclic MDC according to claim 1, Features: The waveform prediction model constructed in S2 includes an input layer, a first batch normalization layer, a first 1x1 convolution layer, a first SENU layer, a second batch normalization layer, three cascaded multi-scale hole convolution modules of a cycle, a channel and spatial attention mechanism module, a first linear layer, a third batch normalization layer, a random inactivation layer, a second SENU layer, a fourth batch normalization layer, a second linear layer and an output layer, wherein the first SENU layer and the second SENU layer use an S-type exponential nonlinear unit activation function; an input layer for inputting a B-type residual current waveform; The first 1x1 convolution layer is used to convolve the waveform features; the three cascaded multi-scale hole convolution modules are used to extract the global information features of the residual current waveform; The channel and spatial attention mechanism module is used for channel and spatial attention feature extraction; the first batch normalization layer, the second batch normalization layer, the third batch normalization layer, and the fourth batch normalization layer are used to normalize the features in batches; the first linear layer and the second linear layer are used to perform full connection operations on the features; the first SENU layer and the second SENU layer are used to perform nonlinear transformation activation on the features; the random inactivation layer is used to randomly lose neurons to improve the robustness and stability of the network; the output layer is used to output the classification results of the type B residual current waveform.
6. A type B residual current waveform classification method based on cyclic MDC according to claim 1, Features: The multi-classification cross entropy loss function used in S3 is: (5) in The network predicts the probability distribution of a waveform in different categories. Representative Waveform; is the one-hot encoding of the waveform sample label; n Indicates the number of residual current waveforms.
7. A type B residual current waveform classification system based on cyclic MDC, using the method described in any one of claims 1 to 6, Features: The system comprises: The model building module is used to construct a cascaded multi-scale dilated convolution module based on different dilated convolution kernels for the B-type residual current waveform characteristics. The waveform prediction model is constructed by cyclically cascading multi-scale dilated convolution modules and introducing S-type exponential nonlinear unit activation functions and channel and spatial attention mechanism modules. The model training and waveform classification module is used to train the waveform prediction model using a multi-classification cross entropy loss function, and use the trained waveform prediction model to classify the type B residual current waveform.
8. A terminal comprising a processor and a storage medium; Features: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
