Motor fault diagnosis method based on adaptive WOA optimization Transform

By adaptive WOA optimization of the parameters of the Transformer model, the problem of time-consuming feature extraction and inappropriate hyperparameter setting in motor fault diagnosis is solved, and the accuracy and efficiency of fault diagnosis are improved.

CN119848607APending Publication Date: 2025-04-18CHANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510039973.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art has the problem that feature extraction is time-consuming and easy to introduce artificial bias in motor fault diagnosis, and the inappropriate hyperparameter setting of deep learning models leads to poor performance.

Method used

Adaptive WOA is used to optimize the parameters of the Transformer model, and the learning rate, encoder layer number and dropout inactivation rate of the Transformer model are optimized through the adaptive WOA algorithm to improve the accuracy of fault diagnosis.

Benefits of technology

It improves the accuracy of motor fault diagnosis, overcomes the problems of time-consuming feature extraction and inappropriate hyperparameter setting in traditional methods, and achieves more efficient fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848607A_ABST
    Figure CN119848607A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of geological exploration and motor fault diagnosis, in particular to a motor fault diagnosis method based on adaptive WOA optimization Transform. Comprising the following steps: respectively acquiring motor current data in various states to form a motor diagnosis data set; a Transform model suitable for fault diagnosis is constructed, the Transform model comprises N layers of encoders, an average pooling layer and a full connection layer which are arranged in sequence, and N is one of to-be-optimized parameters; the method comprises the following steps: training a Transform model by using a motor diagnosis data set, and performing parameter optimization on the Transform model through an adaptive WOA algorithm in a training process to obtain a trained Transform model; and based on the current data of the to-be-diagnosed motor, diagnosing the fault of the to-be-diagnosed motor by using the trained Transform model. According to the method, the adaptive WOA is adopted to carry out parameter adjustment and optimization on the Transform model, so that the accuracy of model fault diagnosis is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of geological exploration and motor fault diagnosis, and in particular to a motor fault diagnosis method based on adaptive WOA optimized Transformer. Background Art

[0002] In geological exploration, the choice of drive mode depends on the specific exploration method and equipment requirements. In the past, hydraulic drive technology was widely used in geological exploration, especially in drilling equipment. Hydraulic drive has high torque and good control performance, which is suitable for operations under complex geological conditions. However, with the advancement of motor technology, motor drive has gradually become the mainstream choice for many geological exploration equipment. However, the operation site of geological exploration is usually an unstable natural environment such as mining areas, mountains, and deserts in the wild. The motor not only has to deal with extreme temperatures, humidity and dust, but also has to withstand long-term high-load operation. Due to its harsh working environment and heavy workload, the motor is easily affected by various factors, resulting in its performance degradation or failure. Common faults include rotor bar breakage, air gap eccentricity, and inter-turn short circuit.

[0003] Traditional fault diagnosis methods are mostly implemented using machine learning algorithms, which often rely on manually designed feature extraction steps, which are time-consuming and prone to human bias. They may also overfit or underfit the training data, resulting in insufficient generalization ability. Deep learning has the ability to extract high-level abstract features and powerful data fitting capabilities. It can capture nonlinear relationships in data and has strong adaptability. However, deep learning models require manual setting of some hyperparameters before training. The selection of hyperparameters has a significant impact on model performance. Inappropriate hyperparameter settings will lead to poor performance of the model for motor fault diagnosis. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a motor fault diagnosis method based on adaptive WOA to optimize Transformer, which uses adaptive WOA to tune the parameters of the Transformer model and improves the accuracy of model fault diagnosis.

[0005] In order to solve the above technical problems, the technical solution of the present invention is: a motor fault diagnosis method based on adaptive WOA optimized Transformer, comprising:

[0006] Acquire motor current data in various states respectively to form a motor diagnosis data set;

[0007] Construct a Transformer model suitable for fault diagnosis. The Transformer model includes N encoder layers, an average pooling layer, and a fully connected layer, where N is one of the parameters to be optimized.

[0008] The Transformer model is trained using the motor diagnosis dataset. During the training process, the parameters of the Transformer model are tuned using the adaptive WOA algorithm to obtain a trained Transformer model.

[0009] Based on the current data of the motor to be diagnosed, the trained Transformer model is used to diagnose the fault of the motor to be diagnosed.

[0010] Furthermore, each layer of the encoder includes a multi-head attention layer, a residual connection normalization layer 1, a feedforward neural network layer and a residual connection normalization layer 2 which are arranged in sequence, and the feedforward neural network layer includes two fully connected layers.

[0011] Furthermore, each encoder layer also includes a dropout layer 1 and a dropout layer 2, wherein the dropout layer 1 is located between the multi-head attention layer and the residual connection normalization layer 1, and the dropout layer 2 is located between the feedforward neural network layer and the residual connection normalization layer 2.

[0012] Furthermore, the specific steps of the adaptive WOA algorithm are:

[0013] (1) Set the population size, number of iterations, and variable value range;

[0014] (2) Use Latin hypercube sampling to initialize the population, divide the input search space into equal intervals, and randomly select samples in each interval. The samples are forced to represent the values ​​of each interval;

[0015] (3) Using the cross entropy loss function as the algorithm’s fitness;

[0016] (4) Calculate the fitness of individual whales and record the optimal individual position;

[0017] (5) The whale individual with the smallest fitness is regarded as the elite individual, and the elite individuals and their fitness values ​​in the current population are saved;

[0018] (6) Update matrix coefficients A, C;

[0019] A=2a·r1-a,

[0020] C = 2·r2,

[0021] Where r1 and r2 are random vectors between [0,1], and a is a nonlinear convergence factor combining dynamic adaptation and random perturbation, and the formula is:

[0022]

[0023] Among them, ε is the perturbation coefficient; rand() is a random number in the range of [-0.8, 0.8], t is the current iteration number, T max is the maximum number of iterations;

[0024] (7) Update the position according to different conditions:

[0025]

[0026] D=|C·X best (t)-X(t)|

[0027] D”=|C·X rand (t)-X(t)|

[0028] D'=|X best -X(t)|

[0029] Among them, p is a random number between [0,1], b is a constant parameter that determines the spiral shape, l is a random number between [-1,1], and X best (t) represents the current optimal position of the whale, X rand (t) represents the position of a randomly selected whale individual, X(t+1) represents the updated individual position, and ω is the introduced adaptive weight:

[0030]

[0031] Among them, β is the weight coefficient;

[0032] (8) Calculate the fitness of individual whales, and take the whale individual with the smallest fitness as the new optimal individual;

[0033] (9) Recover elite individuals and put them back into the population to replace the individuals with the highest fitness;

[0034] (10) Determine whether the current number of iterations reaches the maximum number of iterations. If so, directly output the optimal value and end the loop. Otherwise, return to step (5).

[0035] Furthermore, various states of the motor include: normal, air gap eccentricity, rotor bar breakage and turn-to-turn short circuit.

[0036] After adopting the above technical solution, the present invention uses the improved whale algorithm to optimize the hyperparameters of Transformer, thereby improving the accuracy of motor fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1It is a flow chart of the motor fault diagnosis method based on adaptive WOA optimized Transformer of the present invention;

[0038] Figure 2 It is a framework diagram of the Transformer model of the present invention;

[0039] Figure 3 is a flow chart of the adaptive WOA algorithm of the present invention;

[0040] Figure 4 Optimize the comparison curves for the traditional WOA algorithm and the adaptive WOA algorithm;

[0041] Figure 5 A comparison chart of fault classification of a test set by the traditional model and the adaptive WOA optimized Transformer in the present invention;

[0042] Figure 5 In the figure: (a) is the VMD-SVM fault classification result diagram; (b) is the Transformer fault classification result diagram; (c) is the WOA optimized Transformer fault classification result diagram; (d) is the adaptive WOA optimized Transformer fault classification result diagram of the present invention. DETAILED DESCRIPTION

[0043] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments in conjunction with the accompanying drawings.

[0044] like Figure 1 , Figure 2 and Figure 3 As shown, a motor fault diagnosis method based on adaptive WOA optimized Transformer includes:

[0045] Step S1, respectively acquiring motor current data in various states to form a motor diagnosis data set;

[0046] Specifically, set the sampling frequency and sampling time, collect the motor current data in normal, broken rotor bar, eccentric air gap, and inter-turn short circuit states, adjust the current data to the input format required by the Transformer model, and divide the samples in each state into training set and test set in a ratio of 7:3;

[0047] Step S2, constructing a Transformer model suitable for fault diagnosis, the Transformer model includes N layers of encoders, an average pooling layer and a fully connected layer arranged in sequence, wherein N is one of the parameters to be optimized; each layer of the encoder includes a multi-head attention layer, a dropout layer one, a residual connection normalization layer one, a feedforward neural network layer, a dropout layer two and a residual connection normalization layer two arranged in sequence, and the feedforward neural network layer includes two fully connected layers.

[0048] The processing steps of each encoder layer are:

[0049] Step SA, input data X, use three linear transformation matrices W respectively Q , W K and W V Get the query Q, key K, value V, and use Softmax to calculate the attention of each head. The formula is:

[0050]

[0051] In the formula, head i is the output of the ith head, Q i , K i and V i Input the i-th head part for query Q, key K, value V, d k K i Dimensions;

[0052] Step SB, concatenate the output of each head and perform a linear transformation to obtain the output result of the multi-head attention. The formula is:

[0053] Multihead(Q,K,V)=concat(head1,head2,…,head s )·W o

[0054] Where s is the number of attention heads, W o Is a linear transformation matrix used to transform the concatenated vector into the final output vector.

[0055] Step SC, dropout the output of the multi-head attention to reduce overfitting, then make a residual connection with the input X, and then perform LayerNorm normalization on the result after the residual connection;

[0056] In step SD, the normalized result is input into the feedforward neural network. The feedforward neural network consists of two fully connected layers. The formula is:

[0057] FFN(x)=max(0,xW1+b1)W2+b2

[0058] Among them, W1, W2 are the weights of the two fully connected layers trained in FFN, b1, b2 are the bias parameters of the two fully connected layers trained in FFN;

[0059] In step SE, the output of the feedforward neural network is also processed by dropout, residual connection and normalization.

[0060] The output of the last encoding layer is compressed into a fixed-length vector through global average pooling and input into the fully connected layer for classification.

[0061] Step S3, using the training set to train the Transformer model, optimizing the parameters of the Transformer model by using the adaptive WOA algorithm during the training process, to obtain a trained Transformer model;

[0062] Specifically, the adaptive WOA algorithm is used to iteratively optimize the learning rate, number of encoder layers, and dropout inactivation rate of the Transformer model. The fitness is transmitted from the training set to obtain the optimal combination parameters, which are then input into the Transformer model to obtain a trained Transformer model.

[0063] Step S4, based on the current data of the motor to be diagnosed, diagnose the fault of the motor to be diagnosed using the trained Transformer model.

[0064] like Figure 3 As shown, the specific steps of the adaptive WOA algorithm are:

[0065] (1) Set the population size, number of iterations, and variable value range;

[0066] The algorithm parameters can be:

[0067] parameter Settings Population size 30 Iterations 100 Learning Rate [0.001,0.00001] Regularization parameter [0.1,0.5] Number of encoder layers [1,8]

[0068] (2) To address the shortcoming of the WOA algorithm in that the population is not uniformly initialized, the Latin Hypercube Sampling (LHS) is used to initialize the population, the input search space is divided into equal intervals, and samples are randomly selected in each interval. The samples are forced to represent the values ​​of each interval.

[0069] Among them, if there are n variables, the value range of each variable is evenly divided into m intervals according to the population size, and a sample point is randomly selected in each interval, and then the m samples of each variable are randomly combined to obtain the sample vector of the input variable, that is, m n-dimensional sample points;

[0070] (3) Using the cross entropy loss function as the algorithm’s fitness;

[0071] Right now

[0072] Where λ represents the number of current samples, represents the number of fault categories, y IJ is an indicator variable indicating whether the I-th sample belongs to the J-th category. If the true category of the I-th sample is J, then y IJ =1, otherwise y IJ =0, p IJ It indicates the probability that the model predicts that the I-th sample belongs to the J-th category;

[0073] (4) Calculate the fitness of individual whales and record the optimal individual position;

[0074] (5) Introduce the elite strategy, take the individual with the smallest fitness as the elite individual, and save the elite individuals and their fitness values ​​in the current population;

[0075] (6) Update matrix coefficients A, C;

[0076] A=2a·r1-a,

[0077] C = 2·r2,

[0078] Where r1 and r2 are random vectors between [0,1], and a is a nonlinear convergence factor combining dynamic adaptation and random perturbation, and the formula is:

[0079]

[0080] Among them, ε is the perturbation coefficient; rand() is a random number in the range of [-0.8, 0.8], t is the current iteration number, T max is the maximum number of iterations;

[0081] (7) Update the position according to different conditions:

[0082]

[0083] D=|C·X best (t)-X(t)|

[0084] D”=|C·X rand (t)-X(t)|

[0085] D'=|X best -X(t)|

[0086] Right now:

[0087] When |A|<1,p<0.5, the position is updated in a way of surrounding the prey;

[0088] When |A|≥1, p<0.5, the position is updated in the manner of searching for prey;

[0089] When p ≥ 0.5, the position is updated in a way that captures prey;

[0090] Among them, p is a random number between [0,1], b is a constant parameter that determines the shape of the spiral, which is generally taken as 1, l is a random number between [-1,1], and X best (t) represents the current optimal position of the whale, X rand (t) represents the position of a randomly selected whale individual, X(t+1) represents the updated individual position, and ω is the introduced adaptive weight, which is set to ln(3 / 2):

[0091]

[0092] Among them, β is the weight coefficient;

[0093] (8) Calculate the fitness of individual whales, and take the whale individual with the smallest fitness as the new optimal individual;

[0094] (9) Restore the elite individuals and put them back into the population to replace the individuals with the highest fitness.

[0095] (10) Determine whether the current number of iterations reaches the maximum number of iterations. If so, directly output the optimal value and end the loop. Otherwise, return to step (5).

[0096] It should be noted that in this embodiment, the cross entropy loss function is used as the fitness of the algorithm, and the smaller the better. The elite retention strategy is proposed for genetic algorithms. Its core idea is to copy the best individuals that have appeared so far to the next generation without pairing and crossover during the evolution of the genetic algorithm to avoid these excellent individuals being destroyed or lost in the genetic operation. In this embodiment, it is introduced into the whale algorithm, and the best individual in the population is first saved in each iteration, and it replaces the worst individual in the population after the iteration, which optimizes the global convergence of the algorithm.

[0097] The entire adaptive WOA algorithm has the following advantages:

[0098] Advantage 1: In the population initialization stage of the whale algorithm, the original random initialization method is not used. Instead, the Latin hypercube sampling method is introduced to ensure that there is sample distribution in each dimension, reduce the correlation between input variables, avoid repeated sampling in small areas, increase the diversity of the initial population, and help speed up the convergence of the algorithm.

[0099] Advantage 2: When the whale algorithm updates the matrix coefficients, the convergence factor is improved. The improved adaptive convergence factor is based on the change of the cosine function in the early iteration, which can increase the convergence factor, make the convergence factor decay more slowly, and increase the global exploration ability of the population. Introducing random perturbations in the later iterations allows the algorithm to maintain a certain degree of diversity, enhances the ability of the algorithm to jump out of the local optimal solution, and also makes the algorithm more adaptable to different problems;

[0100] Advantage 3: Adaptive weights are introduced into the whale update position formula, which allows the algorithm to focus more on global search in the early stage and more on local optimization in the later stage, thereby improving the performance of the algorithm;

[0101] Advantage 4: The elite retention strategy is introduced into the whale algorithm to retain the best individuals in the current population and replace the worst individuals in the population after the position is updated, thereby improving the stability and convergence of the algorithm.

[0102] The solutions involved in the above embodiments are described in detail below in conjunction with specific embodiments.

[0103] In this embodiment, the current signal of the motor is collected for 5.5s, the sampling frequency is 25KHz, the motor model is Y160M-4, the rated speed is 1460r / min, and the rated power is 11kW.

[0104] The current data is divided into training set and test set in a ratio of 7:3 for each state.

[0105] Classify the fault types into labels as shown in the following table

[0106] Fault type Label normal 0 Air gap eccentricity 1 Broken rotor bars 2 Turn-to-turn short circuit 3

[0107] Each sample is a 1*500 sequence, which is first divided and stacked into a shape of 10*50 to meet the input format of the Transformer model. Therefore, a feature input with a dimension of (M, 10, 50) is constructed, where M is the batch size, which is set to 64. That is, each state has 178 samples as training samples and 77 groups as test samples, which are input into the adaptive WOA optimized Transformer in this embodiment for optimization training and testing.

[0108] To prove the superiority of the adaptive WOA in this embodiment over the traditional WOA, Figure 4 Iterative process of optimizing model hyperparameters for both optimization algorithms. Figure 4It can be seen that the adaptive WOA reaches the best fitness around the 51st iteration, while WOA can only reach the best fitness around the 65th iteration. This comparison shows that the adaptive WOA has a significant improvement in convergence speed, and it means that it can find the optimal solution to the problem in a shorter time. In addition, the minimum fitness value achieved by the adaptive WOA algorithm is lower than that of WOA, reflecting the superiority of the adaptive WOA in convergence accuracy.

[0109] Figure 5 In the figure, (a) is the fault classification result of the test set by the adaptive WOA optimized Transformer of this embodiment; (b) is the fault classification result of the test set by the WOA optimized Transformer; (c) is the fault classification result of the test set by the Transformer; (d) is the fault classification result of the test set by the VMD-SVM. Figure 5 It can be seen that the classification accuracy of the adaptive WOA optimized Transformer proposed in this embodiment is 99.35%, while the classification accuracy of WOA optimized Transformer, Transformer, and VMD-SVM are 97.4%, 94.81%, and 91.88% respectively. Therefore, the model proposed in this embodiment has better superiority.

[0110] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A motor fault diagnosis method based on adaptive WOA optimized Transformer, characterized in that: include: Acquire motor current data in various states respectively to form a motor diagnosis data set; Construct a Transformer model suitable for fault diagnosis. The Transformer model includes N encoder layers, an average pooling layer, and a fully connected layer, where N is one of the parameters to be optimized. The Transformer model is trained using the motor diagnosis dataset. During the training process, the parameters of the Transformer model are tuned using the adaptive WOA algorithm to obtain a trained Transformer model. Based on the current data of the motor to be diagnosed, the trained Transformer model is used to diagnose the fault of the motor to be diagnosed.

2. The motor fault diagnosis method based on adaptive WOA optimized Transformer according to claim 1 is characterized in that: Each encoder layer includes a multi-head attention layer, a residual connection normalization layer 1, a feedforward neural network layer and a residual connection normalization layer 2, which are arranged in sequence. The feedforward neural network layer includes two fully connected layers.

3. The motor fault diagnosis method based on adaptive WOA optimized Transformer according to claim 1 is characterized in that 。 4. Each encoder layer also includes dropout layer 1 and dropout layer 2. Dropout layer 1 is located between the multi-head attention layer and the residual connection normalization layer 1, and dropout layer 2 is located between the feedforward neural network layer and the residual connection normalization layer 2.

5. The motor fault diagnosis method based on adaptive WOA optimized Transformer according to claim 1 is characterized in that: The specific steps of the adaptive WOA algorithm are: (1) Set the population size, number of iterations, and variable value range; (2) Use Latin hypercube sampling to initialize the population, divide the input search space into equal intervals, and randomly select samples in each interval. The samples are forced to represent the values ​​of each interval; (3) Using the cross entropy loss function as the algorithm’s fitness; (4) Calculate the fitness of individual whales and record the optimal individual position; (5) The individual with the smallest fitness is regarded as the elite individual, and the elite individuals and their fitness values ​​in the current population are saved; (6) Update matrix coefficients A, C; A=2a·r1-a, C=2·r2, Where r1 and r2 are random vectors between [0,1], and a is a nonlinear convergence factor combining dynamic adaptation and random perturbation, and the formula is: Among them, ε is the perturbation coefficient; rand() is a random number in the range of [-0.8, 0.8], t is the current iteration number, T max is the maximum number of iterations; (7) Update the position according to different conditions: D=|C·X best (t)-X(t)| D″=|C·X rand (t)-X(t)| D′=|X best -X(t)| Where p is a random number between [0,1], b is a constant parameter that determines the spiral shape, and l is a random number between [-1,1]; X best (t) represents the current optimal position of the whale, X rand (t) represents the position of a randomly selected whale individual, X(t+1) represents the updated individual position, and ω is the introduced adaptive weight: Among them, β is the weight coefficient; (8) Calculate the fitness of individual whales, and take the whale individual with the smallest fitness as the new optimal individual; (9) Recover elite individuals and put them back into the population to replace the individuals with the highest fitness; (10) Determine whether the current number of iterations reaches the maximum number of iterations. If so, directly output the optimal value and end the loop. Otherwise, return to step (5).

6. The motor fault diagnosis method based on adaptive WOA optimized Transformer according to claim 1 is characterized in that: The various states of the motor include: normal, air gap eccentricity, broken rotor bars and inter-turn short circuit.