Equipment fault diagnosis model training method based on lightweight meta learning
Through a method based on lightweight meta-learning, the time-frequency diagram of single fault and composite fault electrical signals of electromechanical equipment is used to train the model of deep separation convolution layer and lightweight convolutional transformation network, which solves the problem of composite fault diagnosis of electromechanical equipment. The problem of insufficient sample size improves the diagnostic performance.
Patent Information
- Application Number
- CN202411223894.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-03
AI Technical Summary
In the composite fault diagnosis of electromechanical equipment, insufficient sample size makes it difficult for traditional supervised learning methods to learn and generalize effectively, especially in the condition of few samples, and diagnostic performance deteriorates.
Adopt training methods for diagnostic models based on device fault diagnosis based on lightweight dollars. By obtaining sample single failure and composite electrical signals of electromechanical equipment, it is converted to time -frequency diagram, and the depth of the deeper separation of the metaphysical gradient reduction algorithm is used The model of the grade convolutional transformation network is migrated from single fault to composite failure.
Under less composite fault samples, the performance of equipment fault diagnosis has been improved, the problem of insufficient sample volume is solved, and the effective generalization of the model under the condition of less samples.
Smart Images

Figure CN119337225A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of equipment fault detection, and in particular to a lightweight meta-learning-based equipment fault diagnosis model training method, diagnosis method, system, device and medium. Background Art
[0002] In order to solve the problem of insufficient sample size in complex fault diagnosis of electromechanical equipment, researchers are committed to the study of few-shot learning technology. This research aims to solve the problem of scarce training data and unclear features. In traditional supervised learning, models usually require a large amount of labeled data to effectively learn tasks. However, in practical applications, obtaining a large amount of labeled data may be expensive and time-consuming, or simply not feasible for some tasks. Therefore, few-shot learning is committed to enabling models to learn and generalize to new, unseen samples with very limited labeled data.
[0003] Common few-sample learning methods based on deep learning include: methods based on generative adversarial networks; generative adversarial networks require a certain amount of compound fault samples to achieve equilibrium. When the sample size is too small, the quality of the generated samples is poor and the diagnostic performance decreases. Summary of the invention
[0004] In order to solve the above problems, the purpose of the present invention is to provide a equipment fault diagnosis model training method, diagnosis method, system, device and medium based on lightweight meta-learning, which can improve the diagnostic performance with fewer complex fault samples.
[0005] In one aspect, the present invention provides a method for training a device fault diagnosis model based on lightweight meta-learning, comprising the following steps:
[0006] Obtain a sample single fault electrical signal set and a sample composite fault electrical signal set of electromechanical equipment;
[0007] Converting the sample single-fault electrical signal set into a sample single-fault time-frequency atlas set, and converting the sample composite fault electrical signal set into a sample composite fault time-frequency atlas set;
[0008] Using the sample single fault time-frequency atlas and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model, a primary electromechanical equipment fault diagnosis model is obtained; the electromechanical equipment fault diagnosis model includes a deep separation convolution layer and a lightweight convolution transformation network;
[0009] The primary electromechanical equipment fault diagnosis model is fine-tuned using the sample composite fault time-frequency atlas and the meta-stochastic gradient descent algorithm to obtain the trained electromechanical equipment fault diagnosis model.
[0010] Optionally, the using the sample single fault time-frequency atlas and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model to obtain a primary electromechanical equipment fault diagnosis model specifically includes:
[0011] The sample single fault time-frequency graph set is divided into a support set and a query set, and a plurality of tasks are constructed. For each task, the sample single fault time-frequency graph in the support set is input into the untrained electromechanical equipment fault diagnosis model to obtain the predicted fault on the support set;
[0012] constructing a first loss function according to the predicted faults and actual faults on the support set, processing the first loss function using the meta-stochastic gradient descent algorithm, and updating the parameters of the untrained electromechanical equipment fault diagnosis model;
[0013] Inputting the sample single fault time-frequency graph in the query set into the electromechanical equipment fault diagnosis model after updating parameters to obtain the predicted fault on the query set;
[0014] A second loss function is constructed according to the predicted faults and actual faults on the query set, and the second loss function is processed using the meta-stochastic gradient descent algorithm to update the parameters of the electromechanical equipment fault diagnosis model to obtain the primary electromechanical equipment fault diagnosis model.
[0015] Optionally, the step of inputting the sample single fault time-frequency diagram in the support set into the untrained electromechanical equipment fault diagnosis model to obtain the predicted fault on the support set specifically includes:
[0016] Input the sample single fault time-frequency graph into the depth separation convolution layer, perform first feature extraction to obtain a first preliminary feature, and restore the first preliminary feature to a second preliminary feature;
[0017] The second preliminary feature is input into the lightweight convolutional transformation network to perform second feature extraction to obtain the predicted fault on the support set.
[0018] Optionally, the depth separation convolution layer includes a depth convolution layer and a point-by-point convolution layer; the sample single fault time-frequency graph is input into the depth separation convolution layer, and a first feature extraction is performed to obtain a first preliminary feature, which specifically includes:
[0019] Inputting the sample single fault time-frequency graph into the deep convolution layer, performing a deep convolution operation, and obtaining an output of the deep convolution layer;
[0020] The residual between the sample single fault time-frequency diagram and the output of the deep convolution layer is calculated, and the residual is input into the point-by-point convolution layer to perform a point-by-point convolution operation to obtain the first preliminary feature.
[0021] Optionally, the lightweight convolutional transformation network includes an overlapping input module, a linear space dimension reduction attention module and an output module; the step of inputting the second preliminary feature into the lightweight convolutional transformation network, performing second feature extraction, and obtaining the predicted fault on the support set specifically includes:
[0022] Input the second preliminary feature into the overlapping input module, perform third feature extraction, and obtain a fusion feature;
[0023] Input the fused features into the linear space dimension reduction attention module to perform fourth feature extraction to obtain pooled features;
[0024] The pooled features are input into the output module to perform full connection classification to obtain predicted faults on the support set.
[0025] Optionally, the overlapping input module includes an overlapping patch embedding layer, a layer normalization layer and a position encoding layer; the inputting the second preliminary feature into the overlapping input module, performing a third feature extraction, and obtaining a fusion feature specifically includes:
[0026] Inputting the second preliminary feature into the overlapping patch embedding layer to obtain a patch feature;
[0027] Inputting the patch features into the layer normalization layer to obtain normalized features;
[0028] The normalized features are input into the position encoding layer to obtain the fused features.
[0029] On the other hand, the present invention provides a method for fault diagnosis of electromechanical equipment based on lightweight meta-learning, comprising the following steps:
[0030] Acquire feedback electrical signals from electromechanical equipment, and convert the feedback electrical signals into a time-frequency diagram for prediction;
[0031] Inputting the predicted time-frequency graph into a trained electromechanical equipment fault diagnosis model to obtain a prediction result; the trained electromechanical equipment fault diagnosis model is obtained by training using the training method described above;
[0032] The prediction result is post-processed to obtain a composite fault diagnosis result; the post-processing includes denoising and / or regularization.
[0033] On the other hand, the present invention provides a mechanical and electrical equipment fault diagnosis device based on lightweight meta-learning, comprising:
[0034] at least one processor;
[0035] at least one memory for storing at least one program;
[0036] When the at least one program is executed by the at least one processor, the at least one processor implements the training method or the diagnosis method as fully described.
[0037] On the other hand, the present invention provides a computer-readable storage medium storing a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to perform the training method or the diagnosis method as described above.
[0038] On the other hand, the present invention provides a mechanical and electrical equipment fault diagnosis system based on lightweight meta-learning, comprising an electrical signal acquisition device and a computer device connected to the electrical signal acquisition device; wherein,
[0039] The electrical signal acquisition device is used to collect a sample single-fault electrical signal set, a sample composite fault electrical signal set or a feedback electrical signal, and upload the sample single-fault electrical signal set, the sample composite fault electrical signal set or the feedback electrical signal to the computer device;
[0040] The computer device comprises:
[0041] at least one processor;
[0042] at least one memory for storing at least one program;
[0043] When the at least one program is executed by the at least one processor, the at least one processor implements the training method or diagnosis method as described above.
[0044] The implementation of the present invention includes the following beneficial effects: the present invention obtains a sample single-fault electrical signal set and a sample composite fault electrical signal set of electromechanical equipment; converts the sample single-fault electrical signal set into a sample single-fault time-frequency atlas set, and converts the sample composite fault electrical signal set into a sample composite fault time-frequency atlas set; uses the sample single-fault time-frequency atlas set and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model to obtain a primary electromechanical equipment fault diagnosis model; the electromechanical equipment fault diagnosis model includes a deep separation convolution layer and a lightweight convolution transformation network; uses the sample composite fault time-frequency atlas set and the meta-stochastic gradient descent algorithm to fine-tune the primary electromechanical equipment fault diagnosis model to obtain a trained electromechanical equipment fault diagnosis model; obtains model generalization parameters by performing meta-training on the sample single-fault time-frequency atlas set, and then performs fine-tuning on the sample composite fault electrical signal set, thereby completing the knowledge transfer from single fault to composite fault, reducing the problem of scarcity of composite fault samples, and improving the diagnosis performance with fewer composite fault samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of the steps of a method for training a device fault diagnosis model based on lightweight meta-learning provided by the present invention;
[0046] Figure 2 It is a flowchart of the steps of another equipment fault diagnosis model training method based on lightweight meta-learning provided by the present invention;
[0047] Figure 3 It is a flow chart of steps for obtaining a primary electromechanical equipment fault diagnosis model provided by the present invention;
[0048] Figure 4 It is a flow chart of the steps of processing a time-frequency diagram of a mechanical and electrical equipment fault diagnosis model provided by the present invention;
[0049] Figure 5 It is a flowchart of processing a time-frequency graph by a deep separation convolution layer provided by the present invention;
[0050] Figure 6 It is a flowchart of the steps of processing the second preliminary feature by a lightweight convolution transformation network provided by the present invention;
[0051] Figure 7 It is a flow chart of the steps of a method for diagnosing a fault of an electromechanical device provided by the present invention;
[0052] Figure 8 It is a structural schematic diagram of a device for diagnosing mechanical and electrical equipment faults provided by the present invention;
[0053] Fig. 9 It is a structural schematic diagram of a mechanical and electrical equipment fault diagnosis system provided by the present invention. DETAILED DESCRIPTION
[0054] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0055] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0056] When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first / S1000", "second / S20001", "third / S3000" etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above-mentioned terms in the present application can be understood according to specific circumstances.
[0057] like Figure 1 and Figure 2 As shown, Figure 1 It is a flowchart of the steps of the equipment fault diagnosis model training method based on lightweight meta-learning. Figure 2 The present invention provides a method for training a device fault diagnosis model based on lightweight meta-learning, comprising the following steps:
[0058] S1000: Obtain a sample single-fault electrical signal set and a sample compound-fault electrical signal set of electromechanical equipment.
[0059] The sample single-fault electrical signal set includes but is not limited to a number of sample single-fault electrical signals and actual faults, and the sample composite fault electrical signal set includes but is not limited to a number of sample composite fault electrical signals and actual faults.
[0060] S2000. Convert the sample single-fault electrical signal set into a sample single-fault time-frequency atlas set, and convert the sample composite fault electrical signal set into a sample composite fault time-frequency atlas set.
[0061] Specifically, each single fault electrical signal in the sample single fault electrical signal set is converted into a time-frequency diagram to obtain a sample single fault time-frequency diagram set; each composite fault electrical signal in the sample composite fault electrical signal set is converted into a time-frequency diagram to obtain a sample composite fault time-frequency diagram set.
[0062] The method of converting single fault electrical signals and composite fault electrical signals into time-frequency diagrams is the same. The single fault electrical signals or composite fault electrical signals x(t) of the motor of the electromechanical equipment motion system are collected as the original signals. The original signal x(t) is divided into multiple segments, each of which contains N sampling points. The wavelet transform formula is used to perform wavelet transform W on each segment of the signal x(t) to obtain its time-frequency diagram X. The wavelet transform is shown in formula (1):
[0063]
[0064] in, is the mother wavelet function after scaling and translation, and its expression is shown in formula (2):
[0065]
[0066] Among them, a is the scale factor and b is the translation factor.
[0067] S3000: Using the sample single fault time-frequency atlas and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model to obtain a primary electromechanical equipment fault diagnosis model.
[0068] Among them, the electromechanical equipment fault diagnosis model includes a deep separation convolutional layer and a lightweight convolutional transformation network.
[0069] Specifically, Figure 3 As shown, Figure 3 The invention is a flowchart of steps for obtaining a primary electromechanical equipment fault diagnosis model, which includes step S3100, dividing the sample single fault time-frequency graph set into a support set and a query set, constructing a plurality of tasks, and for each task, inputting the sample single fault time-frequency graph in the support set into the untrained electromechanical equipment fault diagnosis model to obtain a predicted fault on the support set.
[0070] Specifically, the sample single fault time-frequency graph set is divided into a support set S and a query set Q, and several tasks {T1, T2, ...T K}, where each task can represent a single fault type. For each task, the sample single fault time-frequency diagram in the support set S is input into the untrained electromechanical equipment fault diagnosis model to obtain the predicted fault on the support set.
[0071] S3200. Construct a first loss function according to the predicted faults and actual faults on the support set, and process the first loss function using the meta-stochastic gradient descent algorithm to update the parameters of the untrained electromechanical equipment fault diagnosis model.
[0072] Specifically, the first loss function is constructed based on the predicted faults and actual faults on the support set. The loss function is the same as that of the existing meta-training, and the meta-stochastic gradient descent algorithm is used to process the first loss function to update the parameters of the untrained electromechanical equipment fault diagnosis model, as shown in formula (3):
[0073]
[0074] Among them, θ i ′ is task T i Updated parameters of the electromechanical equipment fault diagnosis model; θ i is the parameter before updating, Represents the first loss function with respect to θ i gradient.
[0075] Each time a sample single-fault time-frequency diagram is input into an untrained electromechanical equipment fault diagnosis model, the parameters of the electromechanical equipment fault diagnosis model may be updated according to the above method.
[0076] Among them, the training goal of the support set is to minimize the cross-task loss, and its objective function is shown in formula (4):
[0077]
[0078] Among them, T i ~p(T) represents T i belongs to {T1, T2, ...T K}.
[0079] S3300. Input the sample single fault time-frequency diagram in the query set into the electromechanical equipment fault diagnosis model after updating parameters to obtain the predicted faults on the query set; construct a second loss function based on the predicted faults and actual faults on the query set, and use the meta-stochastic gradient descent algorithm to process the second loss function, update the parameters of the electromechanical equipment fault diagnosis model, and obtain the primary electromechanical equipment fault diagnosis model.
[0080] Input the sample single fault time-frequency graph in the query set into the electromechanical equipment fault diagnosis model after updating the parameters to obtain the predicted fault on the query set. Construct the second loss function L based on the predicted fault and actual fault on the query set. Q , L Q As shown in formula (5):
[0081]
[0082] The second loss function is processed by using the meta-stochastic gradient descent algorithm to update the parameters of the electromechanical equipment fault diagnosis model, and obtain a primary electromechanical equipment fault diagnosis model. The formula for updating the parameters of the electromechanical equipment fault diagnosis model is shown in formula (6):
[0083]
[0084] Among them, θ1′ i represents the parameters of the updated electromechanical equipment fault diagnosis model, represents the meta-test about θ i The gradient of ′.
[0085] It is worth noting that the method by which the electromechanical equipment fault diagnosis model processes the sample single fault time-frequency diagram in the query set to obtain the predicted fault on the query set is the same as the method by which the electromechanical equipment fault diagnosis model processes the sample single fault time-frequency diagram in the support set to obtain the predicted fault on the support set, that is, the electromechanical equipment fault diagnosis model at different stages has the same processing flow for the time-frequency diagram.
[0086] S4000: fine-tune the primary electromechanical equipment fault diagnosis model using the sample composite fault time-frequency atlas and the meta-stochastic gradient descent algorithm to obtain the trained electromechanical equipment fault diagnosis model.
[0087] Specifically, the finite sample composite fault time-frequency atlas Dc contains M types of composite faults, with k samples in each type. Construct N few-sample tasks {T11, T12, ...T1 N}, used for each mission T1 i The composite fault time-frequency graph set is divided into a support set S and a query set Q, T1 i Indicates that the composite fault will cause each task T i The sample composite fault time-frequency graphs in the support set S and the query set Q are input into the primary electromechanical equipment fault diagnosis model to perform model fine-tuning and meta-testing. The process is consistent with step S300, except that in this step, both the first loss function and the second loss function use L Q , using L Q Evaluating the Model Performance in composite fault diagnosis. The trained electromechanical equipment fault diagnosis model is obtained after fine-tuning for composite faults.
[0088] It is worth noting that the processing method of the primary electromechanical equipment fault diagnosis model for the sample composite fault time-frequency diagram is the same as the processing method for the sample single fault time-frequency diagram, which will not be repeated here.
[0089] It is worth noting that the fine-tuning method can be but is not limited to Rola and other fine-tuning techniques.
[0090] In some embodiments, Figure 4 As shown, Figure 4 The invention is a flowchart of the steps of processing a time-frequency graph by a mechanical and electrical equipment fault diagnosis model. Step S3100 inputs the sample single fault time-frequency graph in the support set into the untrained mechanical and electrical equipment fault diagnosis model to obtain a predicted fault on the support set, specifically including:
[0091] S3110. Input the sample single fault time-frequency diagram into the depth separation convolution layer, perform a first feature extraction to obtain a first preliminary feature, and restore the first preliminary feature to a second preliminary feature.
[0092] Among them, the deep separation convolution layer includes but is not limited to a deep convolution layer and a point-by-point convolution layer. The deep convolution layer and the point-by-point convolution layer use residual connections. The residual connection can be interpreted as adding the output of the deep convolution layer to the sample single fault time-frequency diagram, and then inputting the result of the addition into the point-by-point convolution layer.
[0093] Specifically, Figure 5 As shown, Figure 5 The flowchart is a processing flow chart of the time-frequency graph by the deep separation convolution layer. In step S3110, the sample single fault time-frequency graph is input into the deep separation convolution layer to perform the first feature extraction to obtain the first preliminary feature, which specifically includes:
[0094] S3111. Input the sample single fault time-frequency diagram into the deep convolution layer, perform a deep convolution operation, and obtain the output of the deep convolution layer.
[0095] Specifically, the deep convolution layer first uses grouped convolution on the input image (e.g., the sample single fault frequency map), where the number of groups is equal to the number of patches in the sample single fault frequency map, denoted by N; the length of the patch is denoted by e. A larger kernel size is used to expand the receptive field of the model, which is usually equal to the default patch step size S, that is, K = S, and the step size S is equal to the patch length, that is, K = S = e, so that there is no overlap between patches. In this process, each of the N patches in the sample single fault frequency map is convolved with a convolution kernel separately, which generates N feature maps, each corresponding to a specific patch, and these feature maps are connected in series to generate a feature map with N channels.
[0096] The details are as follows:
[0097] The sample single fault time-frequency graph X is input into the deep convolution layer with a size of H×W×C, and a sliding window is used to divide X into N patches, where: The size of each patch is e×e and there is no overlap between patches, as shown in formula (7):
[0098] X patch =patch(X,patch_len=e,strike=S) (7)
[0099] Among them, X patch It represents the single fault time-frequency diagram of the sample after being divided into N patches, and its size is N×E×C, where E=e 2 , patch(X) means dividing X into N patches.
[0100] Use the convolution kernel to transform X according to formula (8) patch Perform convolution to obtain N feature maps:
[0101]
[0102] Among them, BatchNorm(.) represents convolution, σ represents the element nonlinear activation function, and the GELU activation function is adopted. Represents the feature map obtained after convolution, Conv N→N Represents convolution kernel processing.
[0103] N feature maps are stacked to obtain a feature map with N channels.
[0104] S3112. Calculate the residual between the sample single fault time-frequency diagram and the output of the deep convolution layer, input the residual into the point-by-point convolution layer, perform a point-by-point convolution operation, and obtain the first preliminary feature.
[0105] Specifically, the residual between the sample single fault time-frequency graph and the deep convolutional layer is calculated As shown in formula (9):
[0106]
[0107] Among them, X patch It represents the time-frequency diagram of a single fault of a sample after being divided into N patches.
[0108] Then, the residual is input into the point-by-point convolution layer, and the point-by-point convolution operation is performed to obtain the first preliminary feature The size is A×E×C as shown in formula (10):
[0109]
[0110] Among them, A represents the number of output channels of the point-by-point convolutional layer, which allows the degree of information aggregation between patches to be controlled by adjusting the number of output channels A; σ represents the element nonlinear activation function, which adopts the GELU activation function; BtachNorm(.) has the same processing flow as the BtachNorm layer of the existing neural network.
[0111] The output of the point-by-point convolutional layer Note: X conv , for X conv Perform the reverse stacking operation to obtain the stacked features, as shown in formula (11):
[0112] X1 out =X conv .Reshape(A, e, e, C) (11)
[0113] Among them, Reshape(.) is the same as the existing Reshape processing flow.
[0114] SplicingX out All patches in are concatenated to obtain the concatenated feature Y, as shown in formula (12):
[0115] Y=X1 out .Reshape(R, L, e, e, C)
[0116] Wherein, R and L are two random numbers, which satisfy A=R×L.
[0117] Process the concatenated feature Y to obtain the second preliminary feature X2 out , whose size is H′×W′×C, where A=R×L, H′=R×e, W′=L×e, as shown in formula (13):
[0118] X1 out =Y.Transpose(0,2,1,3,4)Reshape(R×e,L×e,C) (13)
[0119] Among them, Transpose(.) means transposition.
[0120] S3120. Input the second preliminary feature into the lightweight convolutional transformation network to perform second feature extraction to obtain predicted faults on the support set.
[0121] The lightweight convolutional transformation network includes but is not limited to an overlapping input module, a linear space dimension reduction attention module and an output module. The overlapping input module includes but is not limited to an overlapping patch embedding layer, a layer normalization layer and a position encoding layer.
[0122] Specifically, Figure 6 As shown, Figure 6 The flowchart is a step of processing the second preliminary feature by a lightweight convolutional transformation network, wherein step S3120 specifically includes:
[0123] S3121. Input the second preliminary feature into the overlapping input module, perform third feature extraction, and obtain a fusion feature.
[0124] Specifically, the overlapping input module includes but is not limited to an overlapping patch embedding layer, a layer normalization layer, and a position encoding layer.
[0125] Step S3121 specifically includes the following steps:
[0126] S3121a. Input the second preliminary feature into the overlapping patch embedding layer to obtain a patch feature.
[0127] The overlapping patch embedding layer has a stride of s, a kernel size of 2s-1, and a convolution with padding s-1 to segment and embed the input, and the number of output channels is C′.
[0128] Specifically, for the second preliminary feature X1 obtained by the above-mentioned depth separation convolution out , input it into the overlapping patch embedding layer for segmentation and embedding, and obtain the patch feature P0, as shown in formula (14):
[0129] P0=Conv(X1 out )
[0130] P0∈R(H′ / s)×(W′ / s)×C′ (14)
[0131] S3121b, input the patch features into the layer normalization layer to obtain normalized features.
[0132] Specifically, the patch feature P0 is input into the layer normalization layer for layer normalization to obtain the normalized feature P1, as shown in formula (15):
[0133] P1=LayerNorm(P0) (15)
[0134] Among them, LayerNorm(.) represents layer normalization.
[0135] S3121c, input the normalized features into the position encoding layer to obtain the fused features.
[0136] Specifically, the normalized feature P1 is input into the position encoding layer, and the normalized feature P1 is concatenated with the position encoding vector E to obtain the fused feature Z, as shown in formula (16):
[0137] Z=[P1;E] (16)
[0138] S3122. Input the fused features into the linear space dimensionality reduction attention module, perform fourth feature extraction, and obtain pooled features.
[0139] Among them, the linear space dimensionality reduction attention module includes but is not limited to an input layer, an average pooling layer, a point-by-point convolution layer, and a multi-head self-attention layer (MSA).
[0140] Specifically, the fusion feature Z is input into the input layer, the input layer extracts the key matrix K and value matrix V and matrix Q of the fusion feature Z, and processes the key matrix K and value matrix V to obtain the output Z1 of the input layer KV , the average pooling layer and the point-by-point convolution layer output Z of the input layer KV Perform average pooling and point-by-point convolution respectively to obtain the first attention feature Z2 KV , as shown in formula (17):
[0141] Z2 KV =PointwiseConv(AveragePool(Z1 KV )) (17)
[0142] Multi-head attention layer for the first attention feature Z2 K V and Q are used for feature extraction to obtain the second attention feature H, as shown in formula (18):
[0143] H = Transformer (Z2 KV ) (18)
[0144] The second attention feature H is linearly processed and normalized to extract the sequence pattern in the feature map and reduce the size of the feature map. The feature map Z after linear processing and normalization p , the dimension is b×1×d, where b is the batch size and d is the embedding dimension, as shown in formula (19):
[0145] Z p =Softmax(Linear(H))×H (19)
[0146] Among them, Linear(.) represents the linear layer; Softmax(.) represents the normalization layer.
[0147] After linear processing and normalization, the feature map Z p Perform sequence pooling to obtain the pooling feature S, as shown in formula (20):
[0148] S=Pooling(Z p) (20)
[0149] S3123: Input the pooled features into the output module, perform full-connection classification, and obtain predicted faults on the support set.
[0150] The output module may include but is not limited to a fully connected layer.
[0151] Specifically, the pooled features are input into the fully connected layer to obtain the predicted fault Y, as shown in formula (21):
[0152] Y=Linear(S) (21)
[0153] The present invention constructs an efficient and lightweight convolutional Transformer network by designing a linear space dimensionality reduction attention module and a feedforward fully connected network, laying the foundation for meta-learning under few-sample conditions.
[0154] like Figure 7 As shown, Figure 7 The present invention provides a method for diagnosing electromechanical equipment faults based on lightweight meta-learning, which includes the following steps:
[0155] S100: Acquire a feedback electrical signal from an electromechanical device, and convert the feedback electrical signal into a time-frequency diagram for prediction.
[0156] Specifically, the method of converting the feedback electrical signal into a time-frequency diagram for prediction is the same as the method of converting the sample electrical signal in step S1000, and will not be described in detail here.
[0157] S200, inputting the time-frequency diagram for prediction into a trained electromechanical equipment fault diagnosis model to obtain a prediction result Y.
[0158] The trained electromechanical equipment fault diagnosis model is obtained by training using the training method described above.
[0159] Specifically, the method for obtaining the prediction result is the same as the method for obtaining the predicted fault on the support set. The difference is that the input into the electromechanical equipment fault diagnosis model is the time-frequency diagram for prediction. The specific process refers to the aforementioned training method and will not be repeated here.
[0160] S300: Post-process the prediction result to obtain a composite fault diagnosis result.
[0161] Among them, post-processing includes denoising and / or regularization.
[0162] Specifically, the prediction result Y is post-processed to obtain the composite fault diagnosis result y, as shown in formula (22):
[0163] y=PostProcess(Y) (22)
[0164] Among them, PostProcess(.) can mean denoising the prediction result Y; it can also mean regularizing the prediction result Y; it can also mean denoising the prediction result Y first and regularizing the denoised result.
[0165] The implementation of the present invention includes the following beneficial effects: the present invention completes the knowledge transfer from single fault to compound fault by performing meta-training on a sample single fault time-frequency atlas set to obtain model generalization parameters, and then performs fine-tuning on a sample compound fault electrical signal set, thereby reducing the problem of scarcity of compound fault samples and improving diagnostic performance with fewer compound fault samples.
[0166] The present invention constructs an efficient and lightweight convolutional Transformer network by designing a linear space dimensionality reduction attention module and a feedforward fully connected network, laying the foundation for meta-learning under few-sample conditions.
[0167] The present invention achieves efficient training under the meta-learning framework by using deep separation convolution as the preliminary feature extractor and a lightweight Transformer network as the base learner, solves the problem that standard Transformers are difficult to apply to meta-learning scenarios due to their overly complex structure, and can reduce computational complexity.
[0168] like Figure 8 As shown, Figure 8 The present invention is a schematic diagram of a structure of a mechanical and electrical equipment fault diagnosis device based on lightweight meta-learning. The present invention also provides a mechanical and electrical equipment fault diagnosis device, including:
[0169] at least one processor;
[0170] at least one memory for storing at least one program;
[0171] When the at least one program is executed by the at least one processor, the at least one processor implements the training method and / or diagnosis method steps described in the above method embodiments.
[0172] Among them, the memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. The memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a remote memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0173] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0174] In addition, the embodiment of the present application also discloses a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method. Similarly, the contents in the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0175] The present invention also provides a computer-readable storage medium, which stores a program executable by a processor. The program executable by the processor is used to implement the above method when executed by the processor.
[0176] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0177] like Fig. 9 As shown, Fig. 9The present invention is a schematic diagram of a mechanical and electrical equipment fault diagnosis system based on lightweight meta-learning. The present invention also provides a mechanical and electrical equipment fault diagnosis system, including an electrical signal acquisition device and a computer device connected to the electrical signal acquisition device; wherein,
[0178] The electrical signal acquisition device is used to collect a sample single-fault electrical signal set, a sample composite fault electrical signal set or a feedback electrical signal, and upload the sample single-fault electrical signal set, the sample composite fault electrical signal set or the feedback electrical signal to the computer device;
[0179] The computer device comprises:
[0180] at least one processor;
[0181] at least one memory for storing at least one program;
[0182] When the at least one program is executed by the at least one processor, the at least one processor implements the training method and / or diagnosis method steps described in the above method embodiments.
[0183] Specifically, for the electrical signal acquisition equipment, it is mainly realized through sensors, and it may specifically include at least one voltage sensor or current sensor; and for computer equipment, it may be different types of electronic devices, including but not limited to desktop computers, laptops and other terminals.
[0184] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0185] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0186] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for training a device fault diagnosis model based on lightweight meta-learning, characterized in that: The following steps are involved: Obtain a sample single fault electrical signal set and a sample composite fault electrical signal set of electromechanical equipment; Converting the sample single-fault electrical signal set into a sample single-fault time-frequency atlas set, and converting the sample composite fault electrical signal set into a sample composite fault time-frequency atlas set; Using the sample single fault time-frequency atlas and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model to obtain a primary electromechanical equipment fault diagnosis model; the electromechanical equipment fault diagnosis model includes a deep separation convolution layer and a lightweight convolution transformation network; The primary electromechanical equipment fault diagnosis model is fine-tuned using the sample composite fault time-frequency atlas and the meta-stochastic gradient descent algorithm to obtain the trained electromechanical equipment fault diagnosis model.
2. The training method according to claim 1, characterized in that: The method of using the sample single fault time-frequency atlas and the meta-stochastic gradient descent algorithm to train an untrained electromechanical equipment fault diagnosis model to obtain a primary electromechanical equipment fault diagnosis model specifically includes: The sample single fault time-frequency graph set is divided into a support set and a query set, and a plurality of tasks are constructed. For each task, the sample single fault time-frequency graph in the support set is input into the untrained electromechanical equipment fault diagnosis model to obtain the predicted fault on the support set; constructing a first loss function according to the predicted faults and actual faults on the support set, processing the first loss function using the meta-stochastic gradient descent algorithm, and updating the parameters of the untrained electromechanical equipment fault diagnosis model; Inputting the sample single fault time-frequency graph in the query set into the electromechanical equipment fault diagnosis model after updating parameters to obtain the predicted fault on the query set; A second loss function is constructed according to the predicted faults and actual faults on the query set, and the second loss function is processed using the meta-stochastic gradient descent algorithm to update the parameters of the electromechanical equipment fault diagnosis model to obtain the primary electromechanical equipment fault diagnosis model.
3. The training method according to claim 2, characterized in that: The step of inputting the sample single fault time-frequency graph in the support set into the untrained electromechanical equipment fault diagnosis model to obtain the predicted fault on the support set specifically includes: Input the sample single fault time-frequency graph into the depth separation convolution layer, perform first feature extraction to obtain a first preliminary feature, and restore the first preliminary feature to a second preliminary feature; The second preliminary feature is input into the lightweight convolutional transformation network to perform second feature extraction to obtain the predicted fault on the support set.
4. The training method according to claim 3, characterized in that: The depth separation convolution layer includes a depth convolution layer and a point-by-point convolution layer; The sample single fault time-frequency graph is input into the depth separation convolution layer to perform first feature extraction to obtain a first preliminary feature, which specifically includes: Inputting the sample single fault time-frequency graph into the deep convolution layer, performing a deep convolution operation, and obtaining an output of the deep convolution layer; The residual between the sample single fault time-frequency diagram and the output of the deep convolution layer is calculated, and the residual is input into the point-by-point convolution layer to perform a point-by-point convolution operation to obtain the first preliminary feature.
5. The training method according to claim 3, characterized in that: The lightweight convolutional transformation network includes an overlapping input module, a linear space dimension reduction attention module and an output module; the second preliminary feature is input into the lightweight convolutional transformation network, and the second feature is extracted to obtain the predicted fault on the support set, specifically including: Input the second preliminary feature into the overlapping input module, perform third feature extraction, and obtain a fusion feature; Input the fused features into the linear space dimension reduction attention module to perform fourth feature extraction to obtain pooled features; The pooled features are input into the output module to perform full connection classification to obtain predicted faults on the support set.
6. The training method according to claim 5, characterized in that: The overlapping input module includes an overlapping patch embedding layer, a layer normalization layer and a position encoding layer; the second preliminary feature is input into the overlapping input module, and the third feature is extracted to obtain a fusion feature, which specifically includes: Inputting the second preliminary feature into the overlapping patch embedding layer to obtain a patch feature; Inputting the patch features into the layer normalization layer to obtain normalized features; The normalized features are input into the position encoding layer to obtain the fused features.
7. A method for fault diagnosis of electromechanical equipment based on lightweight meta-learning, characterized in that: The following steps are involved: Acquire feedback electrical signals from electromechanical equipment, and convert the feedback electrical signals into a time-frequency diagram for prediction; Inputting the time-frequency diagram for prediction into a trained electromechanical equipment fault diagnosis model to obtain a prediction result; the trained electromechanical equipment fault diagnosis model is obtained by training the training method according to any one of claims 1 to 6; The prediction result is post-processed to obtain a composite fault diagnosis result; the post-processing includes denoising and / or regularization.
8. A mechanical and electrical equipment fault diagnosis device based on lightweight meta-learning, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.
10. A mechanical and electrical equipment fault diagnosis system based on lightweight meta-learning, characterized in that: It includes an electric signal acquisition device and a computer device connected to the electric signal acquisition device; wherein, The electrical signal acquisition device is used to collect a sample single-fault electrical signal set, a sample composite fault electrical signal set or a feedback electrical signal, and upload the sample single-fault electrical signal set, the sample composite fault electrical signal set or the feedback electrical signal to the computer device; The computer device comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Wind turbine generator set mechanical fault audio identification and fault diagnosis method
CN114778112A
Method and system for forecasting non-stationary time-series
US20230108916A1