Transformer anomaly detection method and device, and training method and device of deep time convolution memory enhancement adaptation network
Through the reinforcement of the adaptation of the in -depth timely convolution memory to restructure and detect the transformer vibration data, the problem of low accuracy of the transformer abnormal detection in the existing technology is solved, and higher detection accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411320280.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art has low accuracy, poor real-time performance in transformer abnormality detection, and high false alarm rate, making it difficult to effectively distinguish abnormal samples from normal samples.
A deep temporal convolution memory enhanced adaptation network is used to reconstruct the vibration data through the temporal convolution encoder, memory enhancement module and temporal convolution decoder, and use the multivariate detection module for detection to determine the abnormal state of the transformer.
It improves the accuracy and stability of transformer abnormality detection, reduces the misjudgment rate, and enhances the ability to distinguish abnormal samples from normal samples.
Smart Images

Figure CN119337267A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of power generation technology, and specifically relates to a transformer anomaly detection method and device, and a training method and device for a deep temporal convolutional memory enhanced adaptation network. Background Art
[0002] With the continuous improvement of the level of intelligence of industrial equipment, the monitoring and anomaly detection of the operating status of transformers as key equipment in the power system have become particularly important. Traditional transformer anomaly detection methods mainly rely on expert experience or simple statistical analysis methods, which are difficult to cope with complex and changeable working conditions, and have low accuracy and real-time performance, and high false alarm rate. In recent years, with the development of deep learning technology, anomaly detection methods based on deep learning have gradually become a research hotspot. Deep convolutional neural networks (CNNs) have achieved remarkable results in the field of image processing. Temporal convolutional networks (TCNs), as their variants in time series processing, can effectively capture long-term dependencies in time series data. However, the traditional TCN model consists of dilated convolutional layers and residual blocks. When dealing with the problem of abnormal transformer anomaly detection, in the unsupervised anomaly detection algorithm, due to the strong generalization ability of the autoencoder, the abnormal samples can be well reconstructed, making it difficult for the unsupervised anomaly detection method based on the autoencoder to effectively distinguish abnormal samples from normal samples, which easily leads to misjudgment of the abnormal state of the transformer, that is, the accuracy of transformer anomaly detection is low. Summary of the invention
[0003] The technical problem to be solved by the present application is to provide a transformer anomaly detection method and device, and a training method and device of a deep temporal convolutional memory enhanced adaptation network in view of the above-mentioned deficiencies in the prior art. By using the transformer anomaly detection method, the accuracy of transformer anomaly detection can be improved.
[0004] In a first aspect, an embodiment of the present application provides a transformer abnormality detection method, comprising:
[0005] Acquire first vibration data of a target transformer; reconstruct the first vibration data using a target deep temporal convolution memory enhancement adaptation network to obtain reconstructed vibration data, wherein the target deep temporal convolution memory enhancement adaptation network includes a target temporal convolution encoder, a target memory enhancement module, and a target temporal convolution decoder connected in sequence; detect the first vibration data and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores, and at least two abnormal thresholds, wherein the first similarities correspond one-to-one to the scores, and the scores correspond one-to-one to the abnormal thresholds; determine whether the target transformer is abnormal based on the at least two first similarities, the at least two scores, and the at least two abnormal thresholds.
[0006] Based on the same inventive concept, in a second aspect, an embodiment of the present application also provides a training method for a deep time convolution memory enhanced adaptation network, including: obtaining a first training set, the first training set including n first training samples and n second training samples, each first training sample in the n first training samples including first normal vibration data of the transformer under a first working condition, and each second training sample in the n second training samples including second normal vibration data of the transformer under a second working condition, the first working condition and the second working condition are different, and the first training sample corresponds to the second training sample one by one; for any first training sample in the n first training samples and its corresponding second training sample, perform the following steps to obtain a target deep time convolution memory enhanced adaptation network: reconstruct the first training sample and the second training sample using a preset deep time convolution memory enhanced adaptation network to obtain a first reconstructed sample and a second reconstructed sample, the preset deep time convolution memory enhanced adaptation network including a preset time convolution encoder, a preset memory enhancement module and a preset time convolution decoder connected in sequence; determine the overall loss function value according to the first training sample, the second training sample, the first reconstructed sample and the second reconstructed sample; and update the parameters of the preset deep time convolution memory enhanced adaptation network using the overall loss function value.
[0007] Based on the same inventive concept, in the third aspect, an embodiment of the present application also provides a transformer abnormality detection device, including: a first acquisition module, used to acquire first vibration data of a target transformer; a first reconstruction module, connected to the first acquisition module, used to reconstruct the first vibration data using a target deep time convolution memory enhancement adaptation network to obtain reconstructed vibration data, the target deep time convolution memory enhancement adaptation network includes a target time convolution encoder, a target memory enhancement module and a target time convolution decoder connected in sequence; a first detection module, connected to the first reconstruction module, used to detect the first vibration data and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores and at least two abnormal thresholds, the first similarities correspond one-to-one to the scores, and the scores correspond one-to-one to the abnormal thresholds; a first determination module, connected to the first detection module, used to determine whether the target transformer is abnormal based on at least two first similarities, at least two scores and at least two abnormal thresholds.
[0008] Based on the same inventive concept, in a fourth aspect, an embodiment of the present application further provides a training device for a deep time convolutional memory enhanced adaptation network, comprising: a second acquisition module, used to acquire a first training set, the first training set comprising n first training samples and n second training samples, each of the n first training samples comprising first normal vibration data of the transformer under a first working condition, each of the n second training samples comprising second normal vibration data of the transformer under a second working condition, the first working condition and the second working condition are different, and the first training sample corresponds to the second training sample one by one; an execution module, connected to the second acquisition module, for performing the following steps for any first training sample in the n first training samples and its corresponding second training sample to obtain a target Deep time convolution memory enhanced adaptation network: wherein the execution module includes: a reconstruction submodule, connected to the second acquisition module, for reconstructing the first training sample and the second training sample using a preset deep time convolution memory enhanced adaptation network to obtain a first reconstructed sample and a second reconstructed sample, wherein the preset deep time convolution memory enhanced adaptation network includes a preset time convolution encoder, a preset memory enhancement module and a preset time convolution decoder connected in sequence; a first determination submodule, connected to the reconstruction submodule, for determining the overall loss function value based on the first training sample, the second training sample, the first reconstructed sample and the second reconstructed sample; an update submodule, connected to the first determination submodule, for updating the parameters of the preset deep time convolution memory enhanced adaptation network using the overall loss function value.
[0009] According to the transformer abnormality detection method and device, and the training method and device of the deep time convolution memory enhancement adaptation network provided in the embodiments of the present application, on the one hand, the first vibration data is reconstructed by the target deep time convolution memory enhancement adaptation network to obtain reconstructed vibration data. Since the target deep time convolution memory enhancement adaptation network includes a target memory enhancement module, the target memory enhancement module can expand the distribution interval between the reconstructed samples of normal samples and the reconstructed samples of abnormal samples, reduce the sample capacity in the overlapping area, and thus can effectively distinguish between abnormal samples and normal samples, thereby improving or solving the problem of misjudgment of the abnormal state of the transformer, that is, the accuracy of transformer abnormality detection can be improved; on the other hand, by using a multivariate detection module to detect the first vibration data and the reconstructed vibration data, at least two first similarities are obtained, that is, at least two similarity determination methods are used to measure the similarity between the reconstructed vibration data and the first vibration data, which can improve the accuracy and stability of transformer abnormality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A schematic diagram showing a flow chart of a transformer abnormality detection method provided in an embodiment of the present application;
[0011] Figure 2A network structure diagram of a target time convolution encoder provided in an embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram showing a result of an expanded convolutional layer provided in an embodiment of the present application is shown;
[0013] Figure 4 A working principle diagram of the target memory enhancement module provided in an embodiment of the present application is shown;
[0014] Figure 5 The overall framework schematic diagram of the transformer abnormality detection method provided by the embodiment of the present application is shown;
[0015] Figure 6 Another schematic diagram of a flow chart of a transformer abnormality detection method provided in an embodiment of the present application is shown;
[0016] Figure 7 A schematic diagram showing a flow chart of a training method for a deep temporal convolutional memory enhanced adaptation network provided in an embodiment of the present application;
[0017] Figure 8 A network structure diagram of a target deep temporal convolutional memory enhanced adaptation network provided by an embodiment of the present application is shown;
[0018] Fig. 9 A schematic diagram showing a structure of a transformer abnormality detection device provided in an embodiment of the present application is shown;
[0019] Fig.10 A structural schematic diagram of a training device for a deep temporal convolutional memory enhanced adaptation network provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is further described in detail below with reference to the accompanying drawings and embodiments.
[0021] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0022] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0023] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0024] Example 1
[0025] The transformer abnormality detection method provided in the embodiment of the present application can be executed by a transformer abnormality detection device and an electronic device, etc. The following is an example of the transformer abnormality detection method being executed by an electronic device for explanation.
[0026] like Figure 1 As shown, the transformer abnormality detection method provided in the embodiment of the present application may include steps S110 to S140.
[0027] S110. Acquire first vibration data of a target transformer.
[0028] S120. Reconstruct the first vibration data using a target deep temporal convolutional memory enhancement adaptation network to obtain reconstructed vibration data. The target deep temporal convolutional memory enhancement adaptation network includes a target temporal convolutional encoder, a target memory enhancement module, and a target temporal convolutional decoder connected in sequence.
[0029] S130. Detect the first vibration data and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores, and at least two abnormality thresholds, wherein the first similarities correspond to the scores one-to-one, and the scores correspond to the abnormality thresholds one-to-one.
[0030] S140. Determine whether the target transformer is abnormal according to at least two first similarities, at least two scores, and at least two abnormality thresholds.
[0031] According to the transformer abnormality detection method provided in the embodiment of the present application, on the one hand, the first vibration data is reconstructed by a target deep time convolution memory enhancement adaptation network to obtain reconstructed vibration data. Since the target deep time convolution memory enhancement adaptation network includes a target memory enhancement module, the target memory enhancement module can expand the distribution interval between the reconstructed samples of normal samples and the reconstructed samples of abnormal samples, reduce the sample capacity in the overlapping area, and thus can effectively distinguish between abnormal samples and normal samples, thereby improving or solving the problem of misjudgment of the abnormal state of the transformer, that is, the accuracy of transformer abnormality detection can be improved; on the other hand, by using a multivariate detection module to detect the first vibration data and the reconstructed vibration data, at least two first similarities are obtained, that is, at least two similarity determination methods are used to measure the similarity between the reconstructed vibration data and the first vibration data, which can improve the accuracy and stability of transformer abnormality detection.
[0032] The specific implementation methods of the above steps are introduced below.
[0033] In step S110 , the target transformer may be any transformer that needs to be detected for abnormality.
[0034] Exemplarily, the first vibration data may be a vibration signal of the target transformer.
[0035] Exemplarily, the electronic device may acquire the first vibration data of the target transformer through a vibration acceleration sensor.
[0036] In some implementations, after acquiring the first vibration data of the target transformer, the method further includes:
[0037] Performing data segmentation on the first vibration data to obtain a first sample matrix;
[0038] Substituting the first sample matrix into formula (9) for normalization processing to obtain the normalized first sample matrix, and updating the first vibration data to the normalized first sample matrix;
[0039] Formula (9) includes:
[0040]
[0041] Wherein, x′ represents the first sample matrix after normalization; x represents the first sample matrix; min(x) represents the minimum value in the first sample matrix; and max(x) represents the maximum value in the first sample matrix.
[0042] In this embodiment, the first vibration data is segmented to obtain a first sample matrix, and then the first sample matrix is normalized to obtain a normalized first sample matrix. Since the normalized first sample matrix is more accurate than the first vibration data, the first vibration data is updated to the normalized first sample matrix, and steps S120 to S140 are executed to obtain a more accurate transformer abnormality detection result.
[0043] It should be noted that when segmenting the first vibration data, it is required that the segmented data points contain full-cycle data, and the size of the data segmentation time window can be determined according to the sampling frequency.
[0044] For example, when the sampling frequency is 5120 Hz, the first vibration data may be segmented according to a window size of 1024 to obtain a first sample matrix with 1024 sample points.
[0045] It can be understood that after the first vibration data is updated to the first sample matrix after normalization, steps S120 to S140 are executed, wherein the essence of executing steps S120 to S130 is: reconstructing the first sample matrix after normalization using the target deep temporal convolution memory enhanced adaptation network to obtain reconstructed vibration data; S130, detecting the first sample matrix after normalization and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores and at least two abnormality thresholds.
[0046] In step S120, after acquiring the first vibration data of the target transformer, the electronic device may also use the target deep temporal convolutional memory enhanced adaptation network to reconstruct the first vibration data to obtain reconstructed vibration data.
[0047] The target deep temporal convolutional memory-augmented adaptation network (i.e., target DTCMAN) includes a novel temporal convolutional autoencoder (i.e., target temporal convolutional encoder) based on dilated causal convolution, skip connection and autoencoder, a memory enhancement module (i.e., target memory enhancement module) and a temporal convolutional autodecoder (i.e., target temporal convolutional decoder).
[0048] In some implementations, reconstructing the first vibration data using a target deep temporal convolutional memory augmented adaptation network to obtain reconstructed vibration data may include:
[0049] Extracting features from the first vibration data using a target time convolution encoder to obtain a first depth feature;
[0050] Based on the first depth feature, the target memory enhancement module is used to obtain the first memory feature, and the first memory feature realizes the alignment of the depth features under different working conditions through the dynamic feature adaptation method;
[0051] The target time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the first memory feature to obtain reconstructed vibration data.
[0052] It should be noted that the first memory feature realizes the alignment of deep features under different working conditions through dynamic feature adaptation. The loss function value of the target deep temporal convolutional memory enhanced adaptation network includes the center distance difference value between the two deep features under two different working conditions. The center distance difference value is used to measure the distribution difference between the two different working conditions as the feature alignment loss, and the deep feature alignment of different working conditions is achieved by minimizing the center distance difference value.
[0053] In some embodiments, the target temporal convolutional encoder includes K first dilated convolutional layers, a first connection layer, a first convolutional layer, and a first maximum pooling layer, the output of each of the K first dilated convolutional layers is added to the first connection layer through a skip connection, and the output of each first dilated convolutional layer is connected in sequence, and the first convolutional layer is connected between the first connection layer and the first maximum pooling layer;
[0054] Using a target time convolution encoder to extract features from the first vibration data to obtain a first depth feature may include:
[0055] Using the first first dilated convolution layer to perform dilated convolution and causal convolution on the first vibration data to obtain a first second depth feature;
[0056] For any first dilated convolution layer k1 among the 2nd to Kth first dilated convolution layers, use it to perform dilated convolution and causal convolution on the k1-1th second depth feature to obtain the k1th second depth feature, so as to obtain the 2nd to Kth second depth features, where k1 is a positive integer greater than or equal to 2 and less than or equal to K;
[0057] Using the first connection layer to integrate the first second depth feature to the Kth second depth feature to obtain a third depth feature;
[0058] Using the first convolutional layer to extract the third deep feature, obtaining a first feature map;
[0059] The first feature map is downsampled using the first maximum pooling layer to obtain a first deep feature.
[0060] For example, Figure 2As shown, taking K=5 as an example, the original data of size 1×T (i.e., the first vibration data) is input into the first first dilated convolution layer DCov1, and the first first dilated convolution layer DCov1 is used to perform dilated convolution and causal convolution on the first vibration data to obtain the first second depth feature of size 16×T, and then the first second depth feature of size 16×T is input into the second first dilated convolution layer DCov2, and the second first dilated convolution layer DCov2 is used to perform dilated convolution on the first second depth feature of size 16×T. and causal convolution to obtain the second second deep feature of size 16×T, and then the second second deep feature of size 16×T is input into the third first dilated convolution layer DCov3 (not shown in the figure), and the third first dilated convolution layer DCov3 is used to perform dilated convolution and causal convolution on the second second deep feature of size 16×T to obtain the third second deep feature of size 16×T, and so on, the fifth second deep feature of size 16×T can be obtained, and then 5 second deep features of size 16×T can be obtained. Next, the connection layer 1 (i.e., the first connection layer) is used to integrate the first second depth features to the fifth second depth features of size 16×T to obtain a third depth feature of size 80×T; then, the first convolutional layer Conv1 is used to extract the third depth feature of size 80×T to obtain a first feature map of size 4×T; and the maximum pooling layer (i.e., the first maximum pooling layer) is used to downsample the first feature map of size 4×T to obtain a first depth feature of size 4×T / 32. The above K value is only used for example and is not used to limit this application. The value of K can be set according to actual conditions and is not limited here. Among them, Figure 2 The q in the dilated convolution layer represents the gap between the convolution kernels. Figure 2 Each dilated convolution layer DConv (i.e., dilated convolution layer) includes sequentially connected input, dilated causal convolution layer, batch normalization layer, ReLU activation function, and output.
[0061] It should be noted that in the embodiment of the present application, the dilated causal convolution (i.e., the first dilated convolution layer) replaces the fully connected layer of the autoencoder, and the target time convolution encoder is constructed respectively. While the dilated convolution is used to increase the receptive field, the causal convolution is used to make the output and the input have a causal relationship. The structure of the first dilated convolution layer is as follows: Figure 3 As shown in Figure 1, the first dilated convolutional layer includes an input layer, a hidden layer 1, a hidden layer 2, and an output layer. n ]Give x=[x1,x2,…,x n ] is a one-to-one corresponding output. Given a one-dimensional sequence input x = [x1, x2, ..., x n ]∈R nand filter f:{0,L,k-1}, the dilated convolution operation on the sequence element s is defined as:
[0062]
[0063] Where d is the dilation factor, k is the filter size, and sd·i represents the past direction. When d=1, the dilated convolution is a regular convolution. For the internal continuous layers, the dilation rate is d. l =2 l This allows the output to represent a wider range of inputs without increasing the network parameters.
[0064] It should be noted that the values of k1 in the embodiment of the present application, as well as k2 to k6 described below, can be set according to actual conditions and are not limited here.
[0065] In some implementations, based on the first depth feature, obtaining the first memory feature using the target memory enhancement module includes:
[0066] Using a target memory enhancement module to obtain a first memory matrix, the first memory matrix includes N first memory vectors;
[0067] For any first memory vector among the N first memory vectors, using the target memory enhancement module to determine a second similarity between the first memory vector and the first deep feature to obtain N second similarities;
[0068] For any second similarity among the N second similarities, normalize the second similarity using a target memory enhancement module to obtain a first addressing weight of the first memory vector, so as to obtain N first addressing weights;
[0069] A first memory feature is determined using a target memory enhancement module according to the N first addressing weights and the N first memory vectors.
[0070] In this embodiment, by using N first addressing weights and N first memory vectors and utilizing a target memory enhancement module to determine the first memory feature, the accuracy of determining the first memory feature can be improved, thereby improving the accuracy of transformer detection.
[0071] The first memory matrix can be used to store the normal features extracted by the target time convolutional encoder. In the following, the second memory matrix and the third memory matrix can both be used to store the normal features extracted by the target time convolutional encoder.
[0072] In some examples, obtaining the first memory matrix using the target memory enhancement module may include:
[0073] A matrix with a size of N*F is generated through the target memory enhancement module, and the N*F matrix is used as the first memory matrix, wherein the target memory enhancement module can randomly generate a matrix with a size of N*F according to a normal distribution.
[0074] Wherein, N may be the number of positions in the first memory matrix M, that is, the number of first memory vectors, and F may be the dimension of the vector stored in each position, which is the same as the dimension of the subsequent first depth feature. The values of N and F can be set according to actual conditions and are not limited here. For example, N may be 4, F may be 3, etc.
[0075] Exemplarily, the first memory matrix M = [m1, m2, ..., m N ]∈R N×F .
[0076] In some examples, determining, using the target memory enhancement module, a second similarity between the first memory vector and the first deep feature includes:
[0077] Substituting the first memory vector and the first deep feature into formula (1) for calculation through the target memory enhancement module, a second similarity between the first memory vector and the first deep feature is obtained;
[0078] Formula (1) includes:
[0079]
[0080] Among them, d(h,m i ) represents the second similarity; h represents the first depth feature; m i represents the i-th first memory vector; represents the transposed matrix of the first memory vector; ||h|| represents the modulus of the first deep feature; ||m i || represents the first memory vector m i Model.
[0081] In other examples, the target memory enhancement module may also determine the second similarity between the first memory vector and the first deep feature by using other similarity measurement functions other than the cosine similarity function, which is not limited here.
[0082] In some examples, normalizing the second similarity using the target memory enhancement module to obtain a first addressing weight of the first memory vector may include:
[0083] Substituting the N second similarities into formula (2) for calculation using the target memory enhancement module, a first addressing weight of the first memory vector is obtained;
[0084] Formula (2) includes:
[0085]
[0086] Among them, w i represents the first addressing weight; d(h,m j ) represents the first deep feature h and the first memory vector m j The second similarity between d(h,m i ) represents the first deep feature h and the first memory vector ||m i The second similarity between ||
[0087] That is to say, the first addressing weight corresponding to each first memory vector can be calculated through the Softmax operation.
[0088] In some examples, determining the first memory feature using a target memory enhancement module according to the N first addressing weights and the N first memory vectors includes:
[0089] Substituting the N first addressing weights and the N first memory vectors into formula (3) for calculation through the target memory enhancement module, a first memory feature is obtained;
[0090] Formula (3) includes:
[0091]
[0092] in, Indicates the first memory feature; m i represents the i-th first memory vector; w i represents the first addressing weight of the i-th first memory vector; w represents the first addressing weight vector including N first addressing weights; M represents the first memory matrix.
[0093] That is, the target memory enhancement module obtains h∈R 1×F Depends on the first addressing weight vector w∈R 1×N , where w=[w1,…,w N ], is a row vector of non-negative elements and sums to 1, w i is the first addressing weight of the i-th first memory vector (that is, the weight assigned to the i-th position of the first memory matrix). The calculation of the first addressing weight vector w depends on the first deep feature h. The attention mechanism is used to focus on the positions with high similarity between the first memory matrix M and the first deep feature h. The first deep feature h obtained by the target time convolution encoder and the first memory vector m at each position of the first memory matrix M i Calculate the similarity and then normalize to obtain the first addressing weight vector w. Each one can be calculated by the Softmax operation:
[0094]
[0095] Among them, d(·,·) represents the similarity measurement function, and d(·,·) is further determined to be the cosine similarity.
[0096]
[0097] The inventors have found through extensive research that storing the characteristic information of normal samples in the first memory matrix helps abnormal samples to produce larger reconstruction errors. However, some abnormal samples still have the opportunity to use the first addressing weights of many smaller elements, and can reconstruct the samples well after complex combinations (this is a disadvantage and needs to be avoided). Therefore, it is necessary to increase the sparsity of the first addressing weights to encourage the target deep temporal convolutional memory enhancement adaptation network to use smaller and more similar vectors to represent the first deep features, thereby learning more information representation in the memory matrix.
[0098] Based on this, in some other examples, according to the N first addressing weights and the N first memory vectors, the target memory enhancement module is used to determine the first memory feature, including:
[0099] Performing a hard contraction operation on the N first addressing weights through the target memory enhancement module to obtain N second addressing weights corresponding to the N first addressing weights one by one;
[0100] A first memory feature is determined using a target memory enhancement module according to the N second addressing weights and the N first memory vectors.
[0101] In this embodiment, a hard shrinkage operation is performed on the N first addressing weights through the target memory enhancement module to obtain N second addressing weights corresponding to the N first addressing weights one by one, and then the first memory feature is determined based on the N second addressing weights and the N first memory vectors using the target memory enhancement module, which can improve the sparsity of the first addressing weights and further alleviate the problem that abnormal data can be well reconstructed through a complex combination of memories of many small elements.
[0102] In some examples, performing a hard contraction operation on the N first addressing weights by the target memory enhancement module to obtain N second addressing weights corresponding to the N first addressing weights may include:
[0103] Obtain the shrinkage threshold and positive scalar through the target memory enhancement module;
[0104] For any first addressing weight among the N first addressing weights, the shrinking threshold, the positive scalar and the first addressing weight are substituted into formula (4) through the target memory enhancement module to calculate, so as to obtain N third addressing weights corresponding to the N first addressing weights one by one;
[0105] Formula (4) includes:
[0106]
[0107] in, represents the third addressing weight corresponding to the first addressing weight; w i represents the first addressing weight of the i-th first memory vector; λ represents the shrinkage threshold; ε represents a positive scalar; max(w i -λ,0) represents w i -The maximum value of λ and 0;
[0108] For any third addressing weight among the N third addressing weights, the target memory enhancement module substitutes the third addressing weight and the third addressing weight vector including the N third addressing weights into formula (5) for calculation to obtain N second addressing weights;
[0109] Formula (5) includes:
[0110]
[0111] in, represents the i-th second addressing weight; The modulus of the third addressing weight vector representing the N third addressing weights.
[0112] represents the i-th second addressing weight, that is, the second addressing weight corresponding to the i-th first addressing weight.
[0113] Exemplarily, the target memory enhancement module may pre-store a shrinkage threshold and a positive scalar. In practical applications, the shrinkage threshold λ is set to a value in the interval [1 / N, 3 / N] to obtain an ideal result; the positive scalar may range from 0.0005 to 0.0015.
[0114] In some examples, determining the first memory feature using a target memory enhancement module based on the N second addressing weights and the N first memory vectors includes:
[0115] Substituting the N second addressing weights and the N first memory vectors into formula (6) for calculation through the target memory enhancement module, a first memory feature is obtained;
[0116]
[0117] in, Indicates the first memory feature; represents the i-th second addressing weight; m i Represents the i-th first memory vector.
[0118] In this embodiment, the first memory feature can be determined quickly and accurately using the above formula (6).
[0119] In the embodiment of the present application, the attention mechanism idea is used to construct a similarity matching method, and its working principle is as follows: Figure 4 As shown, the memory feature (i.e., the first memory feature) that is most similar to the input feature (i.e., the first deep feature) is queried and extracted from the memory matrix (i.e., the first memory matrix). The weight vector w (i.e., the first addressing weight vector) of the first deep feature h is determined using the attention addressing mechanism, and then the first addressing weight vector is hard-contracted to obtain the second addressing weight vector, and the product of the second addressing weight vector and the memory matrix (i.e., the first memory matrix) is determined as the first memory feature. The first memory matrix M is transposed and the value is fed back to the attention addressing mechanism.
[0120] In some embodiments, the target temporal convolution decoder includes a first upsampling layer, K second dilated convolution layers, a second connection layer, and a second convolution layer, the first upsampling layer is connected to a first second dilated convolution layer in the K second dilated convolution layers, an output of each second dilated convolution layer in the K second dilated convolution layers is added to the second connection layer through a skip connection, and the second connection layer is connected to the second convolution layer;
[0121] Using the target time convolution decoder to perform data dimension reduction and feature learning direction reconstruction on the first memory feature to obtain reconstructed vibration data may include:
[0122] Upsampling the first memory feature using the first upsampling layer to obtain a second memory feature;
[0123] The first second dilated convolution layer is used to perform dilated convolution and causal convolution on the second memory feature to obtain the first third memory feature;
[0124] For any second dilated convolution layer k2 among the second to K-th second dilated convolution layers, use it to perform dilated convolution and causal convolution on the k2-1-th third memory feature to obtain the k2-th third memory feature, so as to obtain the second to K-th third memory features, where k2 is a positive integer greater than or equal to 2 and less than or equal to K;
[0125] The first third memory feature to the Kth third memory feature are integrated by using the second connection layer to obtain a fourth memory feature;
[0126] The fourth memory feature is reconstructed using the second convolutional layer to obtain reconstructed vibration data.
[0127] For example, Figure 2As shown, taking K=5 as an example, the first memory feature of size 4×T / 32 is input into the upsampling layer (i.e., the first upsampling layer), and the first upsampling layer is used to upsample the first memory feature of size 4×T / 32 to obtain a second memory feature of size 16×T; the second memory feature of size 16×T is input into the first second dilated convolution layer DCnv6, and the first second dilated convolution layer DCnv6 is used to perform dilated convolution and causal convolution on the second memory feature of size 16×T to obtain the first third memory feature of size 16×T; the first third memory feature of size 16×T is input into the second second dilated convolution layer DCnv7 (not shown in the figure), and the second second dilated convolution layer DCnv7 is used to perform dilated convolution and causal convolution on the second memory feature of size 16×T. The first third memory feature of size T is subjected to dilated convolution and causal convolution to obtain the second third memory feature of size 16×T; by analogy, the fifth third memory feature of size 16×T can be obtained, and then five third memory features of size 16×T can be obtained; then, the fourth memory feature of size 80×T is input into the connection layer 2 (i.e., the second connection layer), and the five third memory features of size 16×T are integrated by using the connection layer 2 to obtain the fourth memory feature of size 80×T; then, the fourth memory feature of size 80×T is input into the convolution layer Conv2 (i.e., the second convolution layer), and the convolution layer Conv2 is used to reconstruct the fourth memory feature of size 80×T to obtain reconstructed data of size 1×T (i.e., reconstructed vibration data).
[0128] It should be noted that in the embodiment of the present application, a jump connection method is adopted, and a connection layer (i.e., the first connection layer and the second connection layer) is used at the end of the target time convolution encoder and the target time convolution decoder to collect the output features of each network layer (i.e., the first dilated convolution layer or the second dilated convolution causal convolution layer) and perform a merging operation. Specifically, in the target time convolution encoder, the output of each first dilated convolution layer is added to the first connection layer through a jump connection, wherein the output of each first dilated convolution layer is connected in series along the channel direction; in the target time convolution decoder, the output channel of each second dilated convolution layer is also added to the second connection layer through a jump connection, and finally the first vibration data is reconstructed through a 1×1 second convolution layer.
[0129] It should be noted that the target memory enhancement module is arranged between the target temporal convolutional encoder and the target temporal convolutional decoder. More specifically, the target memory enhancement module is connected to the first maximum pooling layer of the target temporal convolutional encoder and the first upsampling layer of the target temporal convolutional decoder.
[0130] In step S130, after the electronic device reconstructs the first vibration data using the target deep temporal convolutional memory enhanced adaptation network to obtain the reconstructed vibration data, it can also use the multivariate detection module to detect the first vibration data and the reconstructed vibration data to obtain at least two first similarities, at least two scores and at least two abnormal thresholds.
[0131] It is understandable that the input of the multivariate detection module can be connected to the output of the target deep temporal convolutional memory enhanced adaptation network.
[0132] In some embodiments, the first vibration data and the reconstructed vibration data are detected using a multivariate detection module to obtain at least two first similarities, at least two scores, and at least two abnormal thresholds, including:
[0133] Determine, by a multivariate detection module, at least two first similarities between the first vibration data and the reconstructed vibration data, wherein the at least two first similarities include at least two of a Euclidean distance, a cosine distance, and an absolute mean square error;
[0134] According to the 3σ criterion, at least two abnormal thresholds corresponding to at least two first similarities are determined by a multivariate detection module, wherein the at least two abnormal thresholds include at least two of a first abnormal threshold of Euclidean distance, a second abnormal threshold of cosine distance, and a third abnormal threshold of absolute mean square error;
[0135] According to at least two abnormality thresholds, at least two scores corresponding to the at least two abnormality thresholds are determined by a multivariate detection module, and the at least two scores include at least two of a first score corresponding to the Euclidean distance, a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error.
[0136] As an example, at least two first similarities include Euclidean distance and cosine distance; as another example, at least two first similarities include Euclidean distance and absolute mean square error; as yet another example, at least two first similarities include cosine distance and absolute mean square error; as yet another example, at least two first similarities include Euclidean distance, cosine distance, and absolute mean square error.
[0137] As an example, at least two anomaly thresholds include a first anomaly threshold of Euclidean distance and a second anomaly threshold of cosine distance; as another example, at least two anomaly thresholds include a first anomaly threshold of Euclidean distance and a third anomaly threshold of absolute mean square error; as yet another example, at least two anomaly thresholds include a second anomaly threshold of cosine distance and a third anomaly threshold of absolute mean square error; as yet another example, at least two anomaly thresholds include a first anomaly threshold of Euclidean distance, a second anomaly threshold of cosine distance, and a third anomaly threshold of absolute mean square error.
[0138] As an example, at least two scores include a first score corresponding to the Euclidean distance and a third score corresponding to the absolute mean square error; as another example, at least two scores include a first score corresponding to the Euclidean distance and a second score corresponding to the cosine distance; as yet another example, at least two scores include a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error; as yet another example, at least two scores include a first score corresponding to the Euclidean distance, a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error.
[0139] For example, the first vibration data set X=[x1, x2, . . . , x n ], x i =[x i1 ,x i2 ,…,x im ], reconstructing the vibration dataset The multivariate detection module can determine the Euclidean distance between the first vibration data and the reconstructed vibration data by formula (13);
[0140] Formula (13) includes:
[0141]
[0142] in, represents the i-th first vibration data x in the first vibration data set X i , and reconstructed vibration dataset The i-th reconstructed vibration data The Euclidean distance of x ij Indicates the i-th first vibration data x i The jth data in ; Represents the i-th reconstructed vibration data The jth data in .
[0143] The multivariate detection module can determine the cosine distance between the first vibration data and the reconstructed vibration data through formula (14);
[0144] Formula (14) includes:
[0145]
[0146] in, represents the i-th first vibration data x in the first vibration data set X i , and reconstructed vibration dataset The i-th reconstructed vibration data The Euclidean distance.
[0147] The multivariate detection module can determine the absolute mean square error between the first vibration data and the reconstructed vibration data through formula (15);
[0148] Formula (15) includes:
[0149]
[0150] in, represents the i-th first vibration data x in the first vibration data set X i , and reconstructed vibration dataset The i-th reconstructed vibration data The absolute mean square error.
[0151] In some examples, the multivariate detection module may determine at least two abnormality thresholds corresponding to at least two first similarities in one-to-one correspondence through formula (16);
[0152]
[0153] Wherein, k∈[1,2,3], λ1 represents the first anomaly threshold of Euclidean distance; λ2 represents the second anomaly threshold of cosine distance; λ3 represents the third anomaly threshold of absolute mean square error; and n represents the number of first vibration data in the first vibration data set.
[0154] In some examples, the at least two first similarities include Euclidean distance, cosine distance, and absolute mean square error;
[0155] The at least two anomaly thresholds include a first anomaly threshold of Euclidean distance, a second anomaly threshold of cosine distance, and a third anomaly threshold of absolute mean square error;
[0156] The at least two scores include a first score corresponding to the Euclidean distance, a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error;
[0157] According to the at least two abnormal thresholds, at least two scores corresponding to the at least two abnormal thresholds are determined by the multivariate detection module, including:
[0158] Substitute the Euclidean distance and the first abnormal threshold into formula (7) through the multivariate detection module to calculate and obtain the first score;
[0159] Formula (7) includes:
[0160]
[0161] Among them, Score 1,i Indicates the first score; d 1,i represents the Euclidean distance; λ1 represents the first anomaly threshold;
[0162] Substitute the cosine distance and the second abnormal threshold into formula (8) through the multivariate detection module to calculate and obtain the second score;
[0163] Formula (8) includes:
[0164]
[0165] Among them, Score 2,i Indicates the second score; d 2,i represents the cosine distance; λ2 represents the second abnormal threshold;
[0166] Substituting the absolute mean square error and the third abnormal threshold into formula (9) through the multivariate detection module to calculate and obtain the third score;
[0167] Formula (9) includes:
[0168]
[0169] Among them, Score 3,i Indicates the third score; d 3,i represents the absolute mean square error; λ3 represents the third abnormal threshold.
[0170] In this embodiment, the first score to the third score can be determined quickly and accurately through the above formulas (7) to (9).
[0171] In step S140, after the electronic device uses the multivariate detection module to detect the first vibration data and the reconstructed vibration data to obtain at least two first similarities, at least two scores and at least two abnormal thresholds, it can also determine whether the target transformer is abnormal based on the at least two first similarities, at least two scores and at least two abnormal thresholds.
[0172] In some examples, determining whether the target transformer is abnormal according to at least two scores and at least two abnormality thresholds includes:
[0173] Select the largest score among at least two scores as the abnormality measurement indicator;
[0174] When the first similarity corresponding to the abnormal measurement indicator is less than or equal to the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is normal;
[0175] Alternatively, when the first similarity corresponding to the abnormal measurement indicator is greater than the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is abnormal.
[0176] That is to say, in the embodiment of the present application, the abnormal measurement index Index i Satisfy: Index i =index_max{Score 1,i , Score 2,i , Score 3,i}.
[0177] That is to say, in the embodiment of the present application, the following detection function Class(x i )Determine whether the target transformer is abnormal:
[0178]
[0179] Among them, normal means that the target transformer is normal; abnormal means that the target transformer is abnormal.
[0180] For example, when Index i When it is 1, it means the first vibration data x of the i-th i The Euclidean distance d1 and the first abnormal threshold λ1 are used to make abnormal judgment. i Abnormal metrics Then it is determined that the target transformer is abnormal, otherwise it is determined that the target transformer is normal.
[0181] For example, the overall framework diagram of the transformer abnormality detection method provided in the embodiment of the present application is as follows: Figure 5 As shown in the figure, in the second part: the online anomaly detection stage, the online data (i.e., the first vibration data) is first acquired, and then the online data is normalized, and then the sliding frame segmentation data (i.e., data segmentation) is applied to the result of the normalization process, and then the segmented structure is input into the trained DTCMAN (i.e., the target deep temporal convolutional memory enhanced adaptation network), and the anomaly metric index of the test sample (i.e., the first vibration data) is calculated by DTCMAN; the anomaly detection module can calculate the anomaly index d of the training data set (i.e., the first vibration data), and then determine the anomaly threshold Ψ (i.e., λ) according to the anomaly index d and the 3σ criterion. k ), calculate the abnormal score (i.e. score) Score k,i and Index i , then When the target transformer is abnormal, It is determined that the target transformer is normal.
[0182] For example, Figure 6As shown, in some more specific embodiments, the transformer abnormality detection method may include: obtaining transformer operation data (i.e., transformer vibration data), dividing the transformer operation data into normal data (i.e., normal vibration data) and abnormal data (i.e., abnormal vibration data), and performing DTCMAN training on the normal data after data preprocessing, wherein DTCMAN includes a new time convolution autoencoder model (i.e., a preset time convolution encoder), a memory enhancement module (i.e., a preset memory enhancement module) and a dynamic feature adaptation method, and after DTCMAN training, parameters can be migrated to a trained DTCMAN model (i.e., a target deep time convolution memory enhancement adaptation network), and after DTCMAN training, the training results can also be input into a multivariate anomaly detection module (i.e., a multivariate detection module), and the abnormality threshold is calculated by the multivariate anomaly detection module; after data preprocessing, the abnormal data is input into the trained DTCMAN model, and the output result of the trained DTCMAN model and the abnormality threshold are combined to output a comparison result (i.e., whether the target transformer is abnormal).
[0183] It should be noted that the embodiments of the present application can start from three aspects: spatiotemporal feature extraction, variable working condition feature alignment, and abnormality detection enhancement. The new temporal convolution autoencoder model, memory enhancement module, dynamic feature adaptation method, and multivariate detection module are used to enhance the model's ability to capture complex data structures, expand the distribution interval between normal samples and reconstructed samples of abnormal samples, achieve alignment of different working condition features, improve the reliability of the measurement between input samples and reconstructed samples, and ultimately improve the accuracy and robustness of transformer abnormality detection. Therefore, the invention has a strong practical value, can provide maintenance personnel with reliable transformer working status information, reduce economic losses caused by faults, and meet the needs of fault monitoring and diagnosis.
[0184] The embodiment of the present application proposes a transformer anomaly detection method based on a deep temporal convolution memory-enhanced adaptation network. The embodiment of the present application develops a new temporal convolution autoencoder model to stimulate the network model to learn the temporal characteristics of the data, and enhances the model's ability to capture the complex structure of the data; uses an external memory matrix and an attention mechanism to design a memory enhancement module to expand the distribution interval between normal samples and reconstructed samples of abnormal samples, and reduce the sample capacity in the overlapping area; solves the problem of inconsistent feature distribution caused by different operating states of the transformer through dynamic feature adaptation, and designs a multivariate detection module based on Euclidean distance, cosine distance and absolute mean square error to improve the reliability of the measurement between the input sample and the reconstructed sample, thereby achieving improved accuracy and enhanced robustness of transformer anomaly detection.
[0185] Example 2
[0186] The training method of the deep time convolution memory enhancement adaptation network provided in the embodiment of the present application can be executed by a training device and electronic device of the deep time convolution memory enhancement adaptation network. The following is an example of the training method of the deep time convolution memory enhancement adaptation network being executed by an electronic device.
[0187] like Figure 7 As shown, the training method of the deep temporal convolutional memory enhanced adaptation network provided in the embodiment of the present application may include steps S710 to S720.
[0188] S710. Obtain a first training set, where the first training set includes n first training samples and n second training samples, where each of the n first training samples includes first normal vibration data of the transformer under a first operating condition, and each of the n second training samples includes second normal vibration data of the transformer under a second operating condition. The first operating condition and the second operating condition are different, and the first training samples correspond to the second training samples one-to-one.
[0189] S720: For any first training sample among the n first training samples and its corresponding second training sample, perform the following steps to obtain a target deep temporal convolutional memory enhanced adaptation network:
[0190] Reconstructing the first training sample and the second training sample using a preset deep temporal convolutional memory enhancement adaptation network to obtain a first reconstructed sample and a second reconstructed sample, wherein the preset deep temporal convolutional memory enhancement adaptation network includes a preset temporal convolutional encoder, a preset memory enhancement module, and a preset temporal convolutional decoder connected in sequence;
[0191] Determine an overall loss function value according to the first training sample, the second training sample, the first reconstructed sample, and the second reconstructed sample;
[0192] The overall loss function value is used to update the parameters of the preset deep temporal convolutional memory enhanced adaptation network.
[0193] According to the training method of the deep time convolution memory enhancement adaptation network provided in the embodiment of the present application, the first training sample and the second training sample are reconstructed by a preset deep time convolution memory enhancement adaptation network to obtain a first reconstructed sample and a second reconstructed sample. Since the preset deep time convolution memory enhancement adaptation network includes a preset memory enhancement module, the preset memory enhancement module can expand the distribution interval between the reconstructed samples of normal samples and the reconstructed samples of abnormal samples, reduce the sample capacity in the overlapping area, and thus can effectively distinguish between abnormal samples and normal samples, thereby providing a possibility for improving or solving the problem of misjudgment of the abnormal state of the transformer, that is, providing a possibility for improving the accuracy of transformer abnormality detection.
[0194] In step S710, normal vibration data and abnormal vibration data of the transformer vibration signal can be collected and preprocessed to obtain a first training set and a test data set. It should be noted that the preprocessing includes data segmentation and normalization processing, and the process of data segmentation and normalization processing is similar to the process of data segmentation and normalization processing of the first vibration data in Example 1. It will not be repeated here. Afterwards, the preprocessed normal vibration data is divided into two parts, one part is used as a training set for learning network model parameters, and the other part is mixed with the preprocessed abnormal vibration data to form a test set together for testing model performance.
[0195] Normal vibration data may be vibration data of multiple working conditions collected when the transformer is in a healthy state, and abnormal vibration data may be vibration signals of the transformer collected when the winding is loose / deformed or the core is loose / deformed.
[0196] In step S720, in some embodiments, reconstructing the first training sample and the second training sample using a preset deep temporal convolutional memory enhanced adaptation network to obtain a first reconstructed sample and a second reconstructed sample may include:
[0197] Using a preset time convolution encoder to extract features from the first training sample to obtain a fourth depth feature, and using a preset time convolution encoder to extract features from the second training sample to obtain a fifth depth feature;
[0198] Based on the fourth depth feature, a fifth memory feature is obtained by using a preset memory enhancement module, and based on the fifth depth feature, a sixth memory feature is obtained by using a preset memory enhancement module;
[0199] The preset time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the fifth memory feature to obtain a first reconstructed sample, and the preset time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the sixth memory feature to obtain a second reconstructed sample.
[0200] In some embodiments, the preset temporal convolution encoder includes K third dilated convolutional layers, a third connection layer, a third convolutional layer, and a second maximum pooling layer, the output of each third dilated convolutional layer in the K third dilated convolutional layers is added to the third connection layer through a skip connection, and the output of each third dilated convolutional layer is connected in sequence, and the third convolutional layer is connected between the third connection layer and the second maximum pooling layer;
[0201] The first training sample is subjected to feature extraction using a preset temporal convolution encoder to obtain a fourth depth feature, including:
[0202] Using the first third dilated convolution layer to perform dilated convolution and causal convolution on the first training sample, obtaining the first sixth depth feature;
[0203] For any third dilated convolution layer k3 among the second to Kth third dilated convolution layers, use it to perform dilated convolution and causal convolution on the k3-1th sixth depth feature to obtain the k3th sixth depth feature, so as to obtain the second to Kth sixth depth features, where k3 is a positive integer greater than or equal to 2 and less than or equal to K;
[0204] Using the third connection layer to integrate the first sixth depth feature to the Kth sixth depth feature to obtain a seventh depth feature;
[0205] Using the third convolutional layer to extract the seventh depth feature, obtaining a second feature map;
[0206] The second feature map is downsampled using the second maximum pooling layer to obtain a fourth deep feature.
[0207] In some implementations, extracting features from the second training sample using a preset temporal convolutional encoder to obtain a fifth depth feature includes:
[0208] Using the first third dilated convolution layer to perform dilated convolution and causal convolution on the second training sample, obtaining the first eighth depth feature;
[0209] For any third dilated convolution layer k4 among the second to Kth third dilated convolution layers, use it to perform dilated convolution and causal convolution on the k4-1th eighth depth feature to obtain the k4th eighth depth feature, so as to obtain the second to Kth eighth depth features, where k4 is a positive integer greater than or equal to 2 and less than or equal to K;
[0210] Using the third connection layer to integrate the first eighth depth feature to the Kth eighth depth feature to obtain a ninth depth feature;
[0211] Using the third convolutional layer to extract the ninth deep feature, obtaining a third feature map;
[0212] The third feature map is downsampled using the second maximum pooling layer to obtain the fifth deep feature.
[0213] In some implementations, based on the fourth depth feature, obtaining the fifth memory feature using a preset memory enhancement module includes:
[0214] Using a preset memory enhancement module to obtain a second memory matrix, the second memory matrix includes N second memory vectors;
[0215] For any second memory vector among the N second memory vectors, using a preset memory enhancement module to determine a third similarity between the second memory vector and the fourth deep feature to obtain N third similarities;
[0216] For any third similarity among the N third similarities, the third similarity is normalized using a preset memory enhancement module to obtain a fourth addressing weight of the second memory vector, so as to obtain N fourth addressing weights;
[0217] A fifth memory feature is determined using a preset memory enhancement module according to the N fourth addressing weights and the N second memory vectors.
[0218] In some implementations, based on the fifth depth feature, obtaining the sixth memory feature using a preset memory enhancement module includes:
[0219] Using a preset memory enhancement module to obtain a third memory matrix, the third memory matrix includes N third memory vectors;
[0220] For any third memory feature in the N third memory vectors, using a preset memory enhancement module to determine a fourth similarity between the third memory vector and the fifth depth feature to obtain N fourth similarities;
[0221] For any fourth similarity among the N fourth similarities, the fourth similarity is normalized by using a preset memory enhancement module to obtain a fifth addressing weight of the third memory vector, so as to obtain N fifth addressing weights;
[0222] A sixth memory feature is determined using a preset memory enhancement module according to the N fifth addressing weights and the N third memory vectors.
[0223] In some implementations, obtaining the second memory matrix using a preset memory enhancement module includes:
[0224] A matrix with a size of N*F is generated through a preset memory enhancement module, and the N*F matrix is used as a second memory matrix, wherein the preset memory enhancement module can randomly generate a matrix with a size of N*F according to a normal distribution.
[0225] In some implementations, obtaining the third memory matrix using a preset memory enhancement module includes:
[0226] A matrix with a size of N*F is generated through a preset memory enhancement module, and the N*F matrix is used as a third memory matrix, wherein the preset memory enhancement module can randomly generate a matrix with a size of N*F according to a normal distribution.
[0227] In some embodiments, determining the third similarity between the second memory vector and the fourth depth feature using a preset memory enhancement module includes:
[0228] Substituting the second memory vector and the fourth depth feature into formula (17) for calculation through the preset memory enhancement module, a third similarity between the second memory vector and the fourth depth feature is obtained;
[0229] Formula (17) includes:
[0230] d'(h',m i ')=h'm i ' T / ||h'||·||m i '|| (17)
[0231] Among them, d'(h',m i ') represents the third similarity; h' represents the fourth depth feature; m i ' represents the i-th second memory vector; m i ' T represents the transposed matrix of the second memory vector; ||h'|| represents the modulus of the fourth depth feature; ||m i '|| represents the second memory vector m i 'Model.
[0232] In some embodiments, determining a fourth similarity between the third memory vector and the fifth depth feature using a preset memory enhancement module includes:
[0233] Substituting the third memory vector and the fifth depth feature into formula (18) for calculation through the preset memory enhancement module, a fourth similarity between the third memory vector and the fifth depth feature is obtained;
[0234] Formula (18) includes:
[0235] d”(h”,m i ”)=h”m i ” T / ||h”||·||m i ”|| (18)
[0236] Among them, d”(h”,m i ”) represents the fourth similarity; h” represents the fifth depth feature; m i " represents the i-th third memory vector; m i ” T represents the transposed matrix of the third memory vector; ||h"|| represents the modulus of the fifth deep feature; ||m i ”|| represents the third memory vector m i "Model.
[0237] In some implementations, the third similarity is normalized using a preset memory enhancement module to obtain a fourth addressing weight of the second memory vector, including:
[0238] Substituting the N third similarities into formula (19) for calculation using a preset memory enhancement module to obtain a fourth addressing weight of the second memory vector;
[0239] Formula (19) includes:
[0240]
[0241] Among them, w i * indicates the fourth addressing weight; d'(h',m j ') represents the fourth depth feature h' and the second memory vector m j 'The third similarity between d'(h',m i ') represents the fourth depth feature h and the second memory vector || m i The third similarity between '||
[0242] In some implementations, the fourth similarity is normalized using a preset memory enhancement module to obtain a fifth addressing weight of the third memory vector, including:
[0243] Substituting the N fourth similarities into formula (20) for calculation using a preset memory enhancement module to obtain a fifth addressing weight of the third memory vector;
[0244] Formula (20) includes:
[0245]
[0246] Among them, w i ** indicates the fifth addressing weight; d”(h”,m j ”) represents the fifth depth feature h” and the third memory vector m j The fourth similarity between "; d" (h", m i ”) represents the fifth depth feature h” and the third memory vector m i The fourth similarity between ”
[0247] In some embodiments, determining the fifth memory feature using a preset memory enhancement module according to the N fourth addressing weights and the N second memory vectors includes:
[0248] Substituting the N fourth addressing weights and the N second memory vectors into formula (21) for calculation by a preset memory enhancement module, a fifth memory feature is obtained;
[0249] Formula (21) includes:
[0250]
[0251] in, Indicates the fifth memory feature; m i ' represents the i-th second memory vector; w i' represents the fourth addressing weight of the i-th second memory vector, w' represents the fourth addressing weight vector including N fourth addressing weights; M' represents the second memory matrix.
[0252] In some embodiments, determining the sixth memory feature using a preset memory enhancement module according to the N fifth addressing weights and the N third memory vectors includes:
[0253] Substituting the N fifth addressing weights and the N third memory vectors into formula (22) for calculation through the preset memory enhancement module, a sixth memory feature is obtained;
[0254] Formula (22) includes:
[0255]
[0256] in, Indicates the sixth memory feature; m i " represents the i-th third memory vector; w i " represents the fifth addressing weight of the i-th third memory vector, w" represents the fifth addressing weight vector including N fifth addressing weights; M" represents the third memory matrix.
[0257] In some embodiments, determining the fifth memory feature using a preset memory enhancement module according to the N fourth addressing weights and the N second memory vectors includes:
[0258] Performing a hard contraction operation on the N fourth addressing weights through a preset memory enhancement module to obtain N sixth addressing weights corresponding to the N fourth addressing weights one by one;
[0259] A fifth memory feature is determined using a preset memory enhancement module according to the N sixth addressing weights and the N second memory vectors.
[0260] In some embodiments, determining the sixth memory feature using a preset memory enhancement module according to the N fifth addressing weights and the N third memory vectors includes:
[0261] Performing a hard contraction operation on the N fifth addressing weights through a preset memory enhancement module to obtain N seventh addressing weights corresponding to the N fifth addressing weights one by one;
[0262] A sixth memory feature is determined using a preset memory enhancement module according to the N seventh addressing weights and the N third memory vectors.
[0263] In some implementations, a hard contraction operation is performed on the N fourth addressing weights by a preset memory enhancement module to obtain N sixth addressing weights corresponding to the N fourth addressing weights one by one, including:
[0264] Obtain the contraction threshold and positive scalar through a preset memory enhancement module;
[0265] For any fourth addressing weight among the N fourth addressing weights, the shrinkage threshold, the positive scalar and the fourth addressing weight are substituted into formula (23) for calculation by the preset memory enhancement module to obtain N eighth addressing weights corresponding to the N fourth addressing weights one by one;
[0266] Formula (23) includes:
[0267]
[0268] in, represents the eighth addressing weight corresponding to the fourth addressing weight; w i * represents the fourth addressing weight of the i-th second memory vector; λ represents the shrinkage threshold; ε represents a positive scalar; max(w i *-λ,0) represents w i *-the maximum value of λ and 0;
[0269] For any eighth addressing weight among the N eighth addressing weights, substitute it and the eighth addressing weight vector including the N eighth addressing weights into formula (24) for calculation through the preset memory enhancement module to obtain N sixth addressing weights;
[0270] Formula (24) includes:
[0271]
[0272] in, represents the ith sixth addressing weight; The modulus of the eighth addressing weight vector representing the N eighth addressing weights.
[0273] In some implementations, a hard contraction operation is performed on the N fifth addressing weights by a preset memory enhancement module to obtain N seventh addressing weights corresponding to the N fifth addressing weights one by one, including:
[0274] Obtain the contraction threshold and positive scalar through a preset memory enhancement module;
[0275] For any fifth addressing weight among the N fifth addressing weights, the shrinkage threshold, the positive scalar and the fifth addressing weight are substituted into formula (25) through the preset memory enhancement module to calculate, so as to obtain N ninth addressing weights corresponding to the N fifth addressing weights one by one;
[0276] Formula (25) includes:
[0277]
[0278] in, represents the ninth addressing weight corresponding to the fifth addressing weight; w i ** represents the fifth addressing weight of the i-th third memory vector; λ represents the shrinkage threshold; ε represents a positive scalar; max(w i **-λ,0) represents w i **- maximum value of λ and 0;
[0279] For any ninth addressing weight among the N ninth addressing weights, substitute it and the ninth addressing weight vector including the N ninth addressing weights into formula (26) through the preset memory enhancement module for calculation to obtain N seventh addressing weights;
[0280] Formula (26) includes:
[0281]
[0282] in, represents the seventh addressing weight of the ith one; The modulus of the ninth addressing weight vector representing the N ninth addressing weights.
[0283] In some embodiments, determining the fifth memory feature using a preset memory enhancement module according to the N sixth addressing weights and the N second memory vectors includes:
[0284] Substituting the N sixth addressing weights and the N second memory vectors into formula (27) for calculation by a preset memory enhancement module, a fifth memory feature is obtained;
[0285]
[0286] in, Indicates the fifth memory feature; represents the sixth addressing weight of the ith one; m i ' represents the i-th second memory vector.
[0287] In some embodiments, determining the sixth memory feature using a preset memory enhancement module according to the N seventh addressing weights and the N third memory vectors includes:
[0288] Substituting the N seventh addressing weights and the N third memory vectors into formula (28) for calculation through the preset memory enhancement module, a fifth memory feature is obtained;
[0289]
[0290] in, Indicates the fifth memory feature; represents the seventh addressing weight of the ith one; m i ” represents the i-th third memory vector.
[0291] In some embodiments, the preset temporal convolution decoder includes a second upsampling layer, K fourth dilated convolution layers, a fourth connection layer and a fourth convolution layer, the second upsampling layer is connected to the first fourth dilated convolution layer among the K fourth dilated convolution layers, the output of each fourth dilated convolution layer among the K fourth dilated convolution layers is added to the fourth connection layer through a skip connection, and the fourth connection layer is connected to the fourth convolution layer;
[0292] The fifth memory feature is subjected to data dimension reduction and feature learning direction reconstruction using a preset time convolution decoder to obtain a first reconstructed sample, including:
[0293] The fifth memory feature is upsampled by using the second upsampling layer to obtain the seventh memory feature;
[0294] Using the first fourth dilated convolution layer to perform dilated convolution and causal convolution on the seventh memory feature, the first eighth memory feature is obtained;
[0295] For any fourth dilated convolution layer k5 among the second to Kth fourth dilated convolution layers, use it to perform dilated convolution and causal convolution on the k5-1th eighth memory feature to obtain the k5th eighth memory feature, so as to obtain the second to Kth eighth memory features, where k5 is a positive integer greater than or equal to 2 and less than or equal to K;
[0296] The fourth connection layer is used to integrate the first eighth memory feature to the Kth eighth memory feature to obtain a ninth memory feature;
[0297] Reconstruct the ninth memory feature using the fourth convolutional layer to obtain a first reconstructed sample;
[0298] And / or, using a preset time convolution decoder to perform data dimension reduction and feature learning direction reconstruction on the sixth memory feature to obtain a first reconstructed sample, including:
[0299] Upsampling the sixth memory feature using the second upsampling layer to obtain a tenth memory feature;
[0300] Using the first fourth dilated convolution layer to perform dilated convolution and causal convolution on the tenth memory feature, the first eleventh memory feature is obtained;
[0301] For any fourth dilated convolution layer k6 among the second to Kth fourth dilated convolution layers, use it to perform dilated convolution and causal convolution on the k6-1th eleventh memory feature to obtain the k6th eleventh memory feature, so as to obtain the second to Kth eleventh memory features, where k6 is a positive integer greater than or equal to 2 and less than or equal to K;
[0302] Using the fourth connection layer to integrate the first eleventh memory feature to the Kth eleventh memory feature, to obtain the twelfth memory feature;
[0303] The twelfth memory feature is reconstructed using the fourth convolutional layer to obtain a second reconstructed sample.
[0304] It should be noted that the specific implementation method of reconstructing the first training sample and the second training sample by using a preset deep time convolution memory enhanced adaptation network to obtain the first reconstructed sample and the second reconstructed sample is the same as the specific implementation method of reconstructing the first vibration data by using a target deep time convolution memory enhanced adaptation network to obtain the reconstructed vibration data in Example 1, and will not be repeated here.
[0305] In some implementations, determining the overall loss function value according to the first training sample, the second training sample, the first reconstructed sample, and the second reconstructed sample includes:
[0306] Based on the center distance difference function, determining a center distance difference value between a fourth depth feature and a fifth depth feature, where the fourth depth feature is a depth feature corresponding to the first training sample, and the fifth depth feature is a depth feature corresponding to the second training sample;
[0307] Determine a first target loss value according to the first loss function, where the first target loss value includes a first loss value corresponding to the fourth depth feature or a second loss value corresponding to the fifth depth feature;
[0308] According to the second loss function, determine a second target loss value, the second target loss value includes a third loss value between the first training sample and the first reconstructed sample, or a fourth loss value between the second training sample and the second reconstructed sample, and the first target loss value corresponds to the second target loss value;
[0309] Determine a third target loss value according to a third loss function, where the third target loss value includes a fifth loss value between the first training sample and the first reconstructed sample, or a sixth loss value between the second training sample and the second reconstructed sample, and the third target loss value corresponds to the second target loss value;
[0310] Determine a fourth target loss value according to a fourth loss function, where the fourth target loss value includes a seventh loss value between the first training sample and the first reconstructed sample, or an eighth loss value between the second training sample and the second reconstructed sample, and the fourth target loss value corresponds to the third target loss value;
[0311] The overall loss function value is determined based on the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value.
[0312] In some implementations, determining a center distance difference value between the fourth depth feature and the fifth depth feature based on the center distance difference function includes:
[0313] Obtain a first vector of center distances of all 2nd-order to Jth-order training samples under the fourth depth feature, and a second vector of center distances of all 2nd-order to Jth-order training samples under the fifth depth feature, where J is a positive integer greater than 2;
[0314] Substituting the first vector, the second vector, the fourth depth feature and the fifth depth feature into formula (10) for calculation, the center distance difference value between the fourth depth feature and the fifth depth feature is obtained;
[0315] Formula (10) includes:
[0316]
[0317] Among them, h i ' represents the i-th first depth sub-feature included in the fourth depth feature; h i " represents the i-th second depth sub-feature included in the fifth depth feature; L cmd (h',h") represents the center distance difference between the fourth depth feature and the fifth depth feature; C j (h') represents the first vector of the center distances of all j-order training samples under the fourth depth feature coordinate; C j (h”) represents the center distance difference value of all j-order training samples under the coordinates of the fifth depth feature; a represents the maximum value of the fourth depth feature; b represents the minimum value of the fifth depth feature.
[0318] In some embodiments, obtaining a first vector of center distances of all 2nd-order to Jth-order training samples under the fourth depth feature and a second vector of center distances of all 2nd-order to Jth-order training samples under the fifth depth feature includes:
[0319] For any j-order training sample center distance among all 2-order to J-order training sample center distances under the fourth depth feature coordinate, obtain its first expected vector on the fourth depth feature, and substitute the first expected vector into formula (11) for calculation to obtain the first vector corresponding to all j-order training sample center distances, so as to obtain the first vector of all 2-order to J-order training sample center distances under the fourth depth feature coordinate;
[0320] For any j-order training sample center distance among all 2nd-order to J-order training sample center distances under the fifth depth feature coordinate, obtain its second expected vector on the fifth depth feature, and substitute the second expected vector into formula (11) for calculation to obtain the second vector corresponding to all j-order training sample center distances, so as to obtain the second vector of all 2nd-order to J-order training sample center distances under the fifth depth feature coordinate;
[0321] Formula (11) includes:
[0322]
[0323] in, represents the first vector corresponding to the center distance of all j-order training samples, or the second vector corresponding to the center distance of all j-order training samples; Represents the first expected vector of the center distances of all j-order training samples on the i-th fourth depth feature, or the second expected vector of the center distances of all j-order training samples on the i-th fifth depth feature.
[0324] Exemplarily, the first expected vector of the center distances of all j-order training samples on the fourth depth feature and the second expected vector of the center distances of all j-order training samples on the fifth depth feature can be obtained by the following formula: in, represents the i-th feature in the fourth depth feature or the i-th feature in the fifth depth feature; h s Represents the fourth depth feature or the fifth depth feature.
[0325] In some embodiments, the first loss function includes:
[0326]
[0327] Among them, L in represents the first target loss value; h i represents the i-th feature in the fourth depth feature or the i-th feature in the fifth depth feature;
[0328] And / or, the second loss function includes:
[0329]
[0330] in, represents the second target loss value; x i represents the first training sample or the second training sample; represents the first reconstructed sample or the second reconstructed sample;
[0331] And / or, the third loss function includes:
[0332]
[0333] in, represents the third target loss value; represents the sixth addressing weight of the i-th second memory vector in the second memory matrix corresponding to the first training sample, or the seventh addressing weight corresponding to the i-th third memory vector in the third memory matrix corresponding to the second training sample;
[0334] And / or, the fourth loss function includes:
[0335]
[0336] Among them, R(W) represents the fourth target loss value; λ represents the weight decay regularization coefficient; W represents the weight of the preset deep temporal convolutional memory enhanced autoencoder network.
[0337] It should be noted that the first target loss value can be randomly determined to be the first loss value or the second loss value. When the first target loss value is the first loss value, the second target loss value is the third loss value, the third target loss value is the fifth loss value, and the fourth target loss value is the seventh loss value. When the first target loss value is the second loss value, the second target loss value is the fourth loss value, the third target loss value is the sixth loss value, and the fourth target loss value is the eighth loss value.
[0338] In some implementations, determining an overall loss function value according to the center distance difference value, the first target loss value, the second target loss value, the third target loss value, and the fourth target loss value includes:
[0339] Get the sparse regularization coefficient;
[0340] Substitute the sparse regularization coefficient, the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value into formula (12) to calculate and obtain the overall loss function value;
[0341] Formula (12) includes:
[0342]
[0343] Among them, L total Represents the overall loss function value; L cmd (h',h") represents the center distance difference between the fourth depth feature and the fifth depth feature; L in represents the first target loss value; represents the second target loss value; represents the third target loss value; R(W) represents the fourth target loss value; α represents the sparse regularization coefficient.
[0344] Sparse regularization: The sparsity can be determined by experiments and its value range is 0 to 1.
[0345] That is, in an embodiment of the present application, first, the input sample (i.e., the first training sample and the second training sample) is extracted with a temporal convolution encoder (i.e., a preset temporal convolution encoder) to extract deep features (i.e., the fourth deep features and the fifth deep features); then, the deep features (i.e., the fourth deep features and the fifth deep features) and the memory matrix (i.e., the second memory matrix and the third memory matrix) are used to obtain addressing weight vectors (i.e., the fourth addressing weight vector and the fifth addressing weight vector) through an attention mechanism, and the sparse weight vectors (i.e., the sixth addressing weight vector and the seventh addressing weight vector) are combined with the memory matrix (the second memory matrix and the third memory matrix) to obtain memory features (the fifth memory feature and the sixth memory feature); then, the memory features (the fifth memory feature and the sixth memory feature) are input into a temporal convolution decoder (i.e., a preset temporal convolution decoder) to generate reconstructed samples (i.e., the first reconstructed sample and the second reconstructed sample), and finally, the loss (i.e., the overall loss function value) between the input samples (i.e., the first training sample and the second training sample) and the reconstructed samples (i.e., the first reconstructed sample and the second reconstructed sample) is calculated as a basis for updating the parameters of the deep temporal convolution memory enhanced autoencoder network model.
[0346] For example, given a first training set of n samples represents the reconstructed sample set corresponding to the first training set. In order to minimize the reconstruction error of each first training sample in the first training set, the mean square error loss function (i.e., the second loss function) is used to calculate the third loss value of each first training sample in the first training set. In order to further improve the sixth addressing weight The sparsity of Sparse regularization during training, taking into account All entries of are non-negative and The minimization can be determined according to the third loss function In addition, in order to reduce the risk of overfitting of the preset deep temporal convolution memory enhanced adaptive network, weight decay is used to constrain the model weights of the preset deep temporal convolution memory enhanced adaptive network, and its calculation formula is the fourth loss function. In summary, the training loss function of the preset deep temporal convolution memory enhanced adaptive network is constructed as:
[0347]
[0348] Among them, θ e ,θ d ,M is the parameter of the preset deep temporal convolutional memory enhanced autoencoder network training,θ e is the network parameter of the temporal convolutional encoder, θ dis the network parameter of the temporal convolution decoder, and α is the sparsity regularization coefficient. The first term of the training loss function is used to constrain the difference between the reconstructed sample and the input sample, so that the model can reconstruct the input sample well. The second term is to improve the sparsity of the memory weight (i.e., the addressing weight) in the memory enhancement module (i.e., the preset memory enhancement module), to prevent the model from reconstructing abnormal samples well through the complex combination of the memory of many small elements. The last term is to constrain the weight of the model, so that the weight decays to a smaller value, which reduces the overfitting of the model to a certain extent. Among them, θ e Includes the weights W and bias b of the preset deep temporal convolutional memory enhanced autoencoder network.
[0349] In addition, the center distance difference is used as a feature difference measurement method, and the feature aggregation is further realized through the compact constraint term to dynamically measure the distribution difference of deep features under different working conditions. Specifically, the center distance difference is used to calculate the feature distribution difference between different working conditions. Assuming that the first training sample corresponds to the first working condition feature h s (i.e., the fourth depth feature), the second training sample corresponds to the second working condition feature h t (i.e., the fifth deep feature), the center distance difference is used to measure the distribution difference between the two working condition features as the feature alignment loss, and the feature alignment of different working conditions is achieved by minimizing the center distance difference value. The calculation formula is formula (10). The feature centroid corresponding to the normal vibration data can also be calculated, and then the distance from the normal vibration feature corresponding to the normal vibration data to the feature centroid is calculated, which is used as the loss function of the compact constraint (i.e., the first loss function), so that the distribution of the normal vibration feature is more concentrated.
[0350] In the embodiment of the present application, the dynamic feature adaptation method is combined with the preset deep time convolution memory enhanced autoencoder network to construct a preset deep time convolution memory enhanced adaptation network. The structure of the obtained preset deep time convolution memory enhanced adaptation network is as follows: Figure 8 As shown in Figure 1, by minimizing the distribution difference of features and compact constraints, transformer anomaly detection under multiple working conditions is achieved. Figure 8 As shown, the input sample X (i.e., the first training sample in the first training set or the second training sample in the second training set) is feature extracted by a temporal convolutional encoder (i.e., a preset temporal convolutional encoder) including an expansion convolution layer (i.e., a third expansion convolutional layer) and a jump connection mode to obtain a depth feature H (i.e., a plurality of fourth depth features or a plurality of fifth depth features), and then each feature h (the fourth depth feature or the fifth depth feature) in the depth feature H is determined by a dynamic feature adaptation mode. The center distance difference (i.e., the center distance difference value) L cmd (h s ,h t ) and the compact constraint L in (i.e., the first target loss value), and by something like Figure 4 The memory enhancement module (i.e., the preset memory enhancement module) shown in the figure processes each of the multiple depth features to obtain a memory feature (i.e., multiple second memory features or multiple third memory features), and then the memory features The input includes a dilated causal convolution (i.e., the fourth dilated convolution layer) and a temporal convolution decoder with a skip connection (i.e., a preset temporal convolution decoder). The temporal convolution decoder is used to reconstruct multiple memory features to obtain a reconstructed sample. (i.e., the first reconstructed sample or the second reconstructed sample). e ,θ d ,M) is the training loss function that determines the loss value between the input sample and the reconstructed sample.
[0351] It can be understood that the overall loss function shown in the above formula (12) can be used to update the parameters of the preset deep temporal convolutional memory enhanced adaptation network.
[0352] Exemplarily, the training rules of the preset deep temporal convolutional memory enhanced adaptation network may include: using the error back propagation algorithm to convert the training loss L total (i.e., the overall loss function value) is passed back to each layer and the parameters are updated using the gradient descent algorithm.
[0353] In some more specific examples, the input of the preset deep temporal convolution memory enhanced adaptation network may include a training set (i.e., the first training set and the second training set), where x1 and x2 represent the vibration data of two different working conditions (i.e., the first training sample and the second training sample), hyperparameters α, λ, learning rate η, number of iterations epochs, and the amount of data processed by the model in each iteration c, and the output includes the parameters θ of the preset deep temporal convolutional memory enhanced autoencoder network training e ,θ d ,M. The detailed training process of the preset deep temporal convolution memory enhanced adaptation network may include:
[0354] Step S1, randomly initialize the network weights W (i.e., the weights of the preset deep temporal convolutional memory enhanced autoencoder network), the bias b and the memory matrix M (i.e., the second memory matrix and the third memory matrix).
[0355] Step S2, for i=1,…,epochs do: (i.e., perform training for the number of iterations in sequence).
[0356] Step S3: Collect b small batch samples from the training set
[0357] Step S4: Calculate the depth features h of the two types of working conditions respectivelys ←tce(x 1i ),h t ←tce(x 2i )(i.e., the fourth deep feature and the fifth deep feature, tce() is the preset time convolution encoder).
[0358] Step S5: Calculate the center distance difference L between the two working conditions cmd (i.e., the center distance difference) and the loss function L of the compact constraint in (i.e. the first target loss value).
[0359] Step S6: Calculate the addressing weight vector (i.e., the fourth addressing weight and the fifth addressing weight) (ie, formula (19) and formula (20)).
[0360] Step S7: i (ie, the fourth addressing weight and the fifth addressing weight) perform sparsity operations. (ie, formula (23) and formula (25)).
[0361] Step S8: Normalization (ie, formula (24) and formula (26)).
[0362] Step S9, calculate the memory vector (i.e., the fifth memory feature and the sixth memory feature) (i.e., formula (27) and formula (28))
[0363] Step S10: reconstruct the output (i.e., the first reconstructed sample and the second reconstructed sample) (tcd() is the preset time convolution decoder).
[0364] Step S11, calculate the loss function (i.e., training loss function).
[0365] Step S12: Calculate the overall loss function L of the DTCMAN model (i.e., the preset deep temporal convolutional memory enhanced adaptation network) total .
[0366] Step S13: Update the DTCMAN model parameters using the gradient descent algorithm.
[0367] Step S14: Training is completed.
[0368] Step S15: Save the trained DTCMAN model parameters.
[0369] For example, in some more specific embodiments, Figure 5As shown in the figure, in the offline model training stage: the offline data includes normal data (i.e., normal vibration data) and abnormal data (i.e., abnormal vibration data), the normal data and the abnormal data are normalized, a part of the normalized results are used to apply sliding frame segmentation data (i.e., data segmentation), a test data set is generated according to the segmented data, and is input into the trained DTCMAN; another part of the normalized results is used as the training data set to construct a new temporal convolutional autoencoder model (i.e., preset temporal convolutional encoder) including dilated causal convolution, skip connection and autoencoder, and a memory enhancement module (i.e., preset Suppose a memory enhancement module) constructs a deep time convolution memory enhancement autoencoder network through memory matrices (i.e., the second memory matrix and the third memory matrix) and attention mechanism addressing; a dynamic feature adaptation method, that is, constructing a deep time convolution memory enhancement adaptation network (i.e., a preset deep time convolution memory enhancement adaptation network) through center distance difference (i.e., center distance difference value) and compact constraint terms, and transferring the parameter values of the deep time convolution memory enhancement adaptation network to the trained DTCMAN, and then using the deep time convolution memory enhancement adaptation network to train the DTCMAN model (i.e., the target deep time convolution memory enhancement adaptation network).
[0370] Example 3
[0371] like Fig. 9 As shown, the transformer abnormality detection device provided in the embodiment of the present application includes a first acquisition module 910, a first reconstruction module 920, a first detection module 930 and a first determination module 940.
[0372] Wherein, the first acquisition module 910 is used to acquire first vibration data of the target transformer;
[0373] A first reconstruction module 920, connected to the first acquisition module 910, is used to reconstruct the first vibration data using a target deep temporal convolutional memory enhancement adaptation network to obtain reconstructed vibration data, wherein the target deep temporal convolutional memory enhancement adaptation network includes a target temporal convolutional encoder, a target memory enhancement module, and a target temporal convolutional decoder connected in sequence;
[0374] A first detection module 930, connected to the first reconstruction module 920, is used to detect the first vibration data and the reconstructed vibration data using the multivariate detection module to obtain at least two first similarities, at least two scores and at least two abnormal thresholds, wherein the first similarities correspond to the scores one-to-one, and the scores correspond to the abnormal thresholds one-to-one;
[0375] The first determination module 940 is connected to the first detection module 930 and is used to determine whether the target transformer is abnormal according to at least two first similarities, at least two scores and at least two abnormal thresholds.
[0376] In some implementations, the first reconstruction module 920 is specifically configured to:
[0377] Extracting features from the first vibration data using a target time convolution encoder to obtain a first depth feature;
[0378] Based on the first depth feature, the target memory enhancement module is used to obtain the first memory feature, and the first memory feature realizes the alignment of the depth features under different working conditions through the dynamic feature adaptation method;
[0379] The target time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the first memory feature to obtain reconstructed vibration data.
[0380] In some implementations, the first detection module 930 is specifically configured to:
[0381] Determine, by a multivariate detection module, at least two first similarities between the first vibration data and the reconstructed vibration data, wherein the at least two first similarities include at least two of a Euclidean distance, a cosine distance, and an absolute mean square error;
[0382] According to the 3σ criterion, at least two abnormal thresholds corresponding to at least two first similarities are determined by a multivariate detection module, wherein the at least two abnormal thresholds include at least two of a first abnormal threshold of Euclidean distance, a second abnormal threshold of cosine distance, and a third abnormal threshold of absolute mean square error;
[0383] According to the at least two abnormal thresholds, determining at least two scores corresponding to the at least two abnormal thresholds one by one by a multivariate detection module, the at least two scores comprising at least two of a first score corresponding to the Euclidean distance, a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error;
[0384] In some implementations, the first determining module 940 is specifically configured to:
[0385] Select the largest score among at least two scores as the abnormality measurement indicator;
[0386] When the first similarity corresponding to the abnormal measurement indicator is less than or equal to the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is normal;
[0387] Alternatively, when the first similarity corresponding to the abnormal measurement indicator is greater than the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is abnormal.
[0388] The transformer abnormality detection device provided in the embodiment of the present application can be used to execute the transformer abnormality detection method, that is, it has the beneficial effects and implementation methods of the transformer abnormality detection method provided in Example 1 of the present application. For details, please refer to the specific description of the transformer abnormality detection method in the above Example 1, which will not be repeated in this embodiment.
[0389] Example 4
[0390] like Fig.10 As shown, the training device for the deep temporal convolutional memory enhanced adaptation network provided in the embodiment of the present application may include a second acquisition module 1010 and an execution module 1020.
[0391] The second acquisition module 1010 is used to acquire a first training set, the first training set includes n first training samples and n second training samples, each of the n first training samples includes first normal vibration data of the transformer under a first working condition, and each of the n second training samples includes second normal vibration data of the transformer under a second working condition, the first working condition and the second working condition are different, and the first training samples correspond to the second training samples one by one;
[0392] The execution module 1020 is connected to the second acquisition module 1010, and is used to perform the following steps for any first training sample among the n first training samples and its corresponding second training sample to obtain a target deep temporal convolutional memory enhanced adaptation network:
[0393] The execution module 1020 includes:
[0394] A reconstruction submodule 1021, connected to the second acquisition module 1010, is used to reconstruct the first training sample and the second training sample using a preset deep temporal convolutional memory enhancement adaptation network to obtain a first reconstructed sample and a second reconstructed sample, wherein the preset deep temporal convolutional memory enhancement adaptation network includes a preset temporal convolutional encoder, a preset memory enhancement module, and a preset temporal convolutional decoder connected in sequence;
[0395] A first determination submodule 1022, connected to the reconstruction submodule 1021, is used to determine the overall loss function value according to the first training sample, the second training sample, the first reconstruction sample, and the second reconstruction sample;
[0396] The updating submodule 1023 is connected to the first determining submodule 1022, and is used to update the parameters of the preset deep temporal convolutional memory enhanced adaptation network using the overall loss function value.
[0397] In some implementations, the reconstruction submodule 1021 is specifically configured to:
[0398] Using a preset time convolution encoder to extract features from the first training sample to obtain a fourth depth feature, and using a preset time convolution encoder to extract features from the second training sample to obtain a fifth depth feature;
[0399] Based on the fourth depth feature, a sixth memory feature is obtained by using a preset memory enhancement module, and based on the fifth depth feature, a seventh memory feature is obtained by using a preset memory enhancement module;
[0400] The preset time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the sixth memory feature to obtain a first reconstructed sample, and the preset time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the seventh memory feature to obtain a second reconstructed sample.
[0401] In some implementations, the first determining submodule 1022 is specifically configured to:
[0402] Based on the center distance difference function, determining a center distance difference value between a fourth depth feature and a fifth depth feature, where the fourth depth feature is a depth feature corresponding to the first training sample, and the fifth depth feature is a depth feature corresponding to the second training sample;
[0403] Determine a first target loss value according to the first loss function, where the first target loss value includes a first loss value corresponding to the fourth depth feature or a second loss value corresponding to the fifth depth feature;
[0404] According to the second loss function, determine a second target loss value, the second target loss value includes a third loss value between the first training sample and the first reconstructed sample, or a fourth loss value between the second training sample and the second reconstructed sample, and the first target loss value corresponds to the second target loss value;
[0405] Determine a third target loss value according to a third loss function, where the third target loss value includes a fifth loss value between the first training sample and the first reconstructed sample, or a sixth loss value between the second training sample and the second reconstructed sample, and the third target loss value corresponds to the second target loss value;
[0406] Determine a fourth target loss value according to a fourth loss function, where the fourth target loss value includes a seventh loss value between the first training sample and the first reconstructed sample, or an eighth loss value between the second training sample and the second reconstructed sample, and the fourth target loss value corresponds to the third target loss value;
[0407] The overall loss function value is determined based on the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value.
[0408] The training device for the deep time convolution memory enhancement adaptation network provided in the embodiment of the present application can be used to execute the training method for the deep time convolution memory enhancement adaptation network, that is, it has the beneficial effects and implementation methods of the training method for the deep time convolution memory enhancement adaptation network provided in Example 2 of the present application. For details, please refer to the specific description of the training method for the deep time convolution memory enhancement adaptation network in the above Example 2, which will not be repeated in this embodiment.
[0409] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present application, but the present application is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and substance of the present application, and these modifications and improvements are also considered to be within the scope of protection of the present application.
Claims
1. A transformer abnormality detection method, characterized in that: include: Acquiring first vibration data of a target transformer; Reconstructing the first vibration data using a target deep temporal convolutional memory enhancement adaptation network to obtain reconstructed vibration data, wherein the target deep temporal convolutional memory enhancement adaptation network includes a target temporal convolutional encoder, a target memory enhancement module, and a target temporal convolutional decoder adaptation network connected in sequence; Using a multivariate detection module to detect the first vibration data and the reconstructed vibration data, obtaining at least two first similarities, at least two scores, and at least two abnormal thresholds, wherein the first similarities correspond to the scores one-to-one, and the scores correspond to the abnormal thresholds one-to-one; Whether the target transformer is abnormal is determined according to at least two first similarities, at least two scores, and at least two abnormality thresholds.
2. The method according to claim 1, characterized in that The step of reconstructing the first vibration data by using a target deep temporal convolutional memory enhanced adaptation network to obtain reconstructed vibration data includes: Using the target time convolution encoder to perform feature extraction on the first vibration data to obtain a first depth feature; Based on the first depth feature, the target memory enhancement module is used to obtain a first memory feature, wherein the first memory feature realizes alignment of depth features under different working conditions through a dynamic feature adaptation method; The target time convolution decoder is used to perform data dimension reduction and feature learning direction reconstruction on the first memory feature to obtain reconstructed vibration data.
3. The method according to claim 2, characterized in that The target temporal convolution encoder includes K first dilated convolutional layers, a first connection layer, a first convolutional layer and a first maximum pooling layer, the output of each first dilated convolutional layer in the K first dilated convolutional layers is added to the first connection layer through a skip connection, and the output of each first dilated convolutional layer is connected in sequence, and the first convolutional layer is connected between the first connection layer and the first maximum pooling layer; The step of extracting features from the first vibration data using the target time convolution encoder to obtain a first depth feature includes: Using a first first dilated convolution layer to perform dilated convolution and causal convolution on the first vibration data to obtain a first second depth feature; For any first dilated convolution layer k1 among the 2nd to Kth first dilated convolution layers, use it to perform dilated convolution and causal convolution on the k1-1th second depth feature to obtain the k1th second depth feature, so as to obtain the 2nd to Kth second depth features, where k1 is a positive integer greater than or equal to 2 and less than or equal to K; Integrate the first second depth feature to the Kth second depth feature using the first connection layer to obtain a third depth feature; Using the first convolutional layer to extract the third depth feature, to obtain a first feature map; The first feature map is downsampled by using the first maximum pooling layer to obtain a first depth feature.
4. The method according to claim 2, characterized in that: The step of acquiring the first memory feature by using the target memory enhancement module based on the first depth feature includes: Using the target memory enhancement module to obtain a first memory matrix, wherein the first memory matrix includes N first memory vectors; For any first memory vector among the N first memory vectors, using the target memory enhancement module to determine a second similarity between the first memory vector and the first deep feature to obtain N second similarities; For any second similarity among the N second similarities, the target memory enhancement module is used to normalize the second similarity to obtain a first addressing weight of the first memory vector, so as to obtain N first addressing weights; The target memory enhancement module is used to determine a first memory feature according to the N first addressing weights and the N first memory vectors.
5. The method according to claim 4, characterized in that Determining a second similarity between the first memory vector and the first deep feature using the target memory enhancement module includes: Substituting the first memory vector and the first depth feature into formula (1) for calculation by the target memory enhancement module, a second similarity between the first memory vector and the first depth feature is obtained; Formula (1) includes: Among them, d(h,m i ) represents the second similarity; h represents the first depth feature; m i represents the i-th first memory vector; represents the transposed matrix of the first memory vector; h represents the modulus of the first deep feature; m i Represents the first memory vector m i Model; And / or, using the target memory enhancement module to normalize the second similarity to obtain a first addressing weight of the first memory vector, including: Substituting the N second similarities into formula (2) for calculation using the target memory enhancement module to obtain a first addressing weight of the first memory vector; The formula (2) includes: Among them, w i represents the first addressing weight; d(h,m j ) represents the first deep feature h and the first memory vector m j The second similarity between d(h,m i ) represents the first deep feature h and the first memory vector m i The second similarity between And / or, determining the first memory feature using the target memory enhancement module according to the N first addressing weights and the N first memory vectors, including: Substituting the N first addressing weights and the N first memory vectors into formula (3) for calculation by the target memory enhancement module to obtain a first memory feature; The formula (3) includes: in, Indicates the first memory feature; m i represents the i-th first memory vector; w i represents the first addressing weight of the i-th first memory vector, w represents the first addressing weight vector including N first addressing weights; M represents the first memory matrix; And / or, determining the first memory feature using the target memory enhancement module according to the N first addressing weights and the N first memory vectors, including: Performing a hard contraction operation on the N first addressing weights through the target memory enhancement module to obtain N second addressing weights corresponding to the N first addressing weights one by one; The target memory enhancement module is used to determine a first memory feature according to the N second addressing weights and the N first memory vectors.
6. The method according to claim 1, characterized in that The detecting the first vibration data and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores and at least two abnormal thresholds includes: Determine, by the multivariate detection module, at least two first similarities between the first vibration data and the reconstructed vibration data, wherein the at least two first similarities include at least two of a Euclidean distance, a cosine distance, and an absolute mean square error; According to the 3σ criterion, at least two abnormal thresholds corresponding to at least two first similarities are determined by the multivariate detection module, wherein the at least two abnormal thresholds include at least two of a first abnormal threshold of Euclidean distance, a second abnormal threshold of cosine distance, and a third abnormal threshold of absolute mean square error; According to the at least two abnormal thresholds, at least two scores corresponding to the at least two abnormal thresholds are determined by the multivariate detection module, wherein the at least two scores include at least two of a first score corresponding to the Euclidean distance, a second score corresponding to the cosine distance, and a third score corresponding to the absolute mean square error; And / or, determining whether the target transformer is abnormal according to at least two scores and at least two abnormal thresholds, including: Select the largest score among at least two scores as the abnormality measurement indicator; When the first similarity corresponding to the abnormal measurement indicator is less than or equal to the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is normal; Alternatively, when the first similarity corresponding to the abnormal measurement indicator is greater than the abnormal threshold corresponding to the abnormal measurement indicator, it is determined that the target transformer is abnormal.
7. A training method for a deep temporal convolutional memory-enhanced adaptive network, characterized in that: include: Acquire a first training set, the first training set includes n first training samples and n second training samples, each of the n first training samples includes first normal vibration data of the transformer under a first working condition, each of the n second training samples includes second normal vibration data of the transformer under a second working condition, the first working condition and the second working condition are different, and the first training samples correspond to the second training samples one by one; For any first training sample among the n first training samples and its corresponding second training sample, the following steps are performed to obtain a target deep temporal convolutional memory enhanced adaptation network: Reconstructing the first training sample and the second training sample using a preset deep temporal convolutional memory enhancement adaptation network to obtain a first reconstructed sample and a second reconstructed sample, wherein the preset deep temporal convolutional memory enhancement adaptation network includes a preset temporal convolutional encoder, a preset memory enhancement module, and a preset temporal convolutional decoder connected in sequence; Determine an overall loss function value according to the first training sample, the second training sample, the first reconstructed sample, and the second reconstructed sample; The overall loss function value is used to update the parameters of the preset deep temporal convolutional memory enhanced adaptation network.
8. The method according to claim 7, characterized in that Determining an overall loss function value according to the first training sample, the second training sample, the first reconstructed sample, and the second reconstructed sample includes: Based on the center distance difference function, determining a center distance difference value between a fourth depth feature and a fifth depth feature, where the fourth depth feature is a depth feature corresponding to the first training sample, and the fifth depth feature is a depth feature corresponding to the second training sample; Determine a first target loss value according to the first loss function, where the first target loss value includes a first loss value corresponding to the fourth depth feature or a second loss value corresponding to the fifth depth feature; Determine a second target loss value according to a second loss function, where the second target loss value includes a third loss value between the first training sample and the first reconstructed sample, or a fourth loss value between the second training sample and the second reconstructed sample, and the first target loss value corresponds to the second target loss value; Determine a third target loss value according to a third loss function, wherein the third target loss value includes a fifth loss value between the first training sample and the first reconstructed sample, or a sixth loss value between the second training sample and the second reconstructed sample, and the third target loss value corresponds to the second target loss value; Determine a fourth target loss value according to a fourth loss function, wherein the fourth target loss value includes a seventh loss value between the first training sample and the first reconstructed sample, or an eighth loss value between the second training sample and the second reconstructed sample, and the fourth target loss value corresponds to the third target loss value; The overall loss function value is determined based on the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value.
9. The method according to claim 8, characterized in that Determining a center distance difference value between the fourth depth feature and the fifth depth feature based on the center distance difference function includes: Obtain a first vector of center distances of all 2nd-order to Jth-order training samples under the fourth depth feature, and a second vector of center distances of all 2nd-order to Jth-order training samples under the fifth depth feature, where J is a positive integer greater than 2; Substituting the first vector, the second vector, the fourth depth feature and the fifth depth feature into formula (10) for calculation, the center distance difference value between the fourth depth feature and the fifth depth feature is obtained; The formula (10) includes: Among them, h i ' represents the i-th first depth sub-feature included in the fourth depth feature; h i " represents the i-th second depth sub-feature included in the fifth depth feature; L cmd (h',h") represents the center distance difference between the fourth depth feature and the fifth depth feature; C j (h') represents the first vector of the center distances of all j-order training samples under the fourth depth feature coordinate; C j (h”) represents the center distance difference value of all j-order training sample center distances under the fifth depth feature coordinate; a represents the maximum value of the fourth depth feature; b represents the minimum value of the fifth depth feature; and / or, The first loss function includes: Among them, L in represents the first target loss value; h i represents the i-th feature in the fourth depth feature or the i-th feature in the fifth depth feature; And / or, the second loss function includes: in, represents the second target loss value; x i represents the first training sample or the second training sample; represents the first reconstructed sample or the second reconstructed sample; And / or, the third loss function includes: in, represents the third target loss value; represents the sixth addressing weight of the i-th second memory vector in the second memory matrix corresponding to the first training sample, or the seventh addressing weight corresponding to the i-th third memory vector in the third memory matrix corresponding to the second training sample; And / or, the fourth loss function includes: Wherein, R(W) represents the fourth target loss value; λ represents the weight decay regularization coefficient; W represents the weight of the preset deep temporal convolutional memory enhanced autoencoder network; And / or, determining the overall loss function value according to the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value, including: Get the sparse regularization coefficient; Substitute the sparse regularization coefficient, the center distance difference value, the first target loss value, the second target loss value, the third target loss value and the fourth target loss value into formula (12) to calculate and obtain the overall loss function value; The formula (12) includes: Among them, L total Represents the overall loss function value; L cmd (h',h") represents the center distance difference between the fourth depth feature and the fifth depth feature; L in represents the first target loss value; represents the second target loss value; represents the third target loss value; R(W) represents the fourth target loss value; α represents the sparse regularization coefficient.
10. A transformer abnormality detection device, characterized in that: include: A first acquisition module, used to acquire first vibration data of a target transformer; A first reconstruction module, connected to the first acquisition module, is used to reconstruct the first vibration data using a target deep temporal convolutional memory enhancement adaptation network to obtain reconstructed vibration data, wherein the target deep temporal convolutional memory enhancement adaptation network includes a target temporal convolutional encoder, a target memory enhancement module, and a target temporal convolutional decoder connected in sequence; a first detection module connected to the first reconstruction module, and configured to detect the first vibration data and the reconstructed vibration data using a multivariate detection module to obtain at least two first similarities, at least two scores, and at least two abnormal thresholds, wherein the first similarities correspond to the scores in a one-to-one manner, and the scores correspond to the abnormal thresholds in a one-to-one manner; The first determination module is connected to the first detection module and is used to determine whether the target transformer is abnormal based on at least two first similarities, at least two scores and at least two abnormal thresholds.