Small sample motor fault identification method, model training method, device and equipment
By combining the Gram angle field module and the two-dimensional convolution module, along with the sequence-to-sequence model and the attention mechanism, the problems of overfitting and noise interference in small-sample motor fault diagnosis are solved, thus achieving reliability and stability in fault diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA WUZHOU ENG GRP
- Filing Date
- 2025-04-25
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies suffer from overfitting in small-sample motor fault diagnosis, making it difficult to handle complex operating conditions and noise interference, resulting in insufficient reliability and stability of the diagnostic results.
The training sample dataset is converted into two-dimensional images using the Gram corner field module. Features are extracted by combining the two-dimensional convolution module and the compression activation module. Data is augmented by a sequence-to-sequence model. Attention mechanism and physical constraint loss function are introduced to dynamically adjust feature channel weights and suppress redundant features.
It significantly improves the robustness to noise interference in the signal, ensures the reliability and stability of fault diagnosis results, and meets the fault diagnosis needs of application scenarios with small samples and complex and variable operating conditions.
Smart Images

Figure CN120561792B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electric motor fault identification technology, and specifically relates to a method, model training method, device and equipment for identifying small-sample electric motor faults. Background Technology
[0002] In modern industry, rotating mechanical equipment (such as electric motors, generators, and turbines) is a core driving component, and its operating status directly affects the safety and efficiency of the entire production system. However, these devices are prone to failure in complex working environments, leading to equipment downtime, production interruptions, and even safety accidents. Therefore, timely and accurate diagnosis of faults in rotating mechanical equipment is of great significance. Traditional fault diagnosis methods mainly rely on signal processing techniques and expert experience, such as Fourier transform, wavelet transform, and empirical mode decomposition (EMD). While these methods can extract fault features to some extent, their performance is heavily dependent on the expertise and experience of technicians and performs poorly when handling nonlinear and non-stationary signals. With the rapid development of industrial big data and artificial intelligence technologies, deep learning has been widely applied in the field of fault diagnosis.
[0003] However, in industrial settings, fault samples are typically few, and labeling them is costly. The operating conditions of rotating mechanical equipment are complex and variable (e.g., load variations, speed fluctuations), and the signals often contain significant noise. Existing models perform poorly when handling complex operating conditions and noise interference, making it difficult to guarantee the reliability of diagnostic results. Summary of the Invention
[0004] To address the aforementioned issues, this invention proposes a small-sample motor fault identification method, model training method, apparatus, and equipment. This method can meet the fault diagnosis needs of motor fault identification in application scenarios with small sample sizes and complex and variable operating conditions, significantly improve robustness against noise interference in signals, and ensure the reliability and stability of fault diagnosis results.
[0005] In a first aspect, the present invention provides a method for training a small-sample electric motor fault model, comprising:
[0006] Obtain a training sample dataset; wherein the training sample dataset includes multiple training samples and labels, the training samples are the operating data of the motor under various operating states, and the various operating states include various fault states;
[0007] The training sample dataset is input into the motor fault identification model to be trained to obtain the trained motor fault identification model; wherein, the motor fault identification model includes a Gram angle field module, a two-dimensional convolution module and a compressed excitation module;
[0008] The Gram angle field module is used to convert multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, so as to preserve the time-dependent and nonlinear features of the signals in the training samples.
[0009] The two-dimensional convolution module is used to extract features at different scales in the two-dimensional image based on a multi-scale convolution kernel group to obtain feature extraction results.
[0010] The compression excitation module is used to dynamically adjust the weights of feature channels to enhance key features and suppress redundant features.
[0011] In an optional implementation, before inputting the training sample dataset into the motor fault identification model to be trained to obtain the trained motor fault identification model, the method further includes:
[0012] Multiple training samples and labels from the training sample dataset are input into a pre-built sequence-to-sequence model to obtain multiple amplified training samples corresponding to the multiple training samples; wherein, the sequence-to-sequence model includes an encoding module and a decoding module, the decoding module introduces an attention mechanism and a physical constraint loss function, the attention mechanism focuses on the features of key time steps, and the physical constraint loss function includes spectral matching loss and / or energy distribution loss;
[0013] The multiple amplified training samples are added to the training sample dataset to obtain the amplified training sample dataset.
[0014] This embodiment generates augmented data from the input original fault signal and operating parameters using a pre-built sequence-to-sequence model, thus achieving sample amplification. During the decoding process, an attention mechanism and a physical constraint loss function are also introduced to ensure the consistency of fault characteristics in the generated signals. Using the amplified training sample dataset to train the motor fault identification model improves the model's classification accuracy for small sample data.
[0015] In an optional implementation, the motor fault identification model further includes a one-dimensional attention mechanism module, which is used to extract key pulse features from the training samples using a one-dimensional signal attention mechanism based on global max pooling, and dynamically adjust the activation state of neurons based on an improved one-dimensional meta-learning adaptive activation function to obtain a feature weighting matrix.
[0016] In an optional implementation, the two-dimensional convolution module includes:
[0017] The first convolutional submodule is used to extract global texture features of the two-dimensional image using a first two-dimensional convolutional layer to capture the overall trend and low-frequency components of the signal in the two-dimensional image, thereby obtaining a first initial feature map; and to reduce the resolution of the first initial feature map using a first max pooling layer, thereby obtaining a first feature map.
[0018] The second convolutional submodule is used to extract local texture features of the two-dimensional image using a second two-dimensional convolutional layer to focus on the high-frequency components and transient changes of the signal to obtain a second initial feature map; and to reduce the number of parameters of the second initial feature map using depthwise separable convolution to obtain a second feature map.
[0019] The feature fusion submodule is used to concatenate the first feature map and the second feature map by dimension to obtain the concatenation result; and to perform cross-channel information interaction on the concatenation result through the third convolutional layer to obtain the feature extraction result;
[0020] Wherein, the kernel size of the first two-dimensional convolutional layer is smaller than the kernel size of the second two-dimensional convolutional layer.
[0021] In an optional implementation, the one-dimensional attention mechanism module includes:
[0022] The global max pooling submodule extracts the key impulse feature matrix of the training samples based on global max pooling. As shown in equation (1):
[0023]
[0024] In equation (1), x c Let d represent the signal feature matrix of the c-th channel, d be the signal length, and j represent the elements in the pooling region of the key pulse feature matrix.
[0025] The modeling submodule is used to compare the original feature matrix x corresponding to the training samples with the key pulse feature matrix. The enhanced feature matrix is obtained by concatenating along the channel dimension; the enhanced feature matrix is then mapped to obtain the intermediate feature connection matrix f, as shown in equation (2) below:
[0026]
[0027] In equation (2), F1 is a convolutional layer; where δ is the improved one-dimensional meta-learning adaptive activation function;
[0028] The feature reconstruction and weight allocation submodule is used to split and reconstruct the intermediate feature connection matrix to obtain the reconstructed feature matrix x'. The reconstructed feature matrix x' is mapped to the same number of channels as the original feature matrix x using the following formula (3) and combined with the fourth convolutional layer F2, to generate channel attention weights g:
[0029] g=σ(F2(x')), (3)
[0030] In equation (3), σ is the Sigmoid function;
[0031] The feature weighting submodule is used to multiply the channel attention weights g with the original feature matrix x channel by channel to obtain the feature weighting matrix y. c As shown in equation (4):
[0032] y c =x c *g c (4)
[0033] In equation (4), x c Let g represent the input feature matrix of the c-th channel. c This represents the attention weight on the c-th channel.
[0034] In an optional implementation, the physical constraint loss function is:
[0035] L total =λ1L MSE +λ2‖FFT(x gen )-FFT(x real )‖+λ3‖E(x gen )-E(x real )‖2
[0036] Among them, L MSE FFT(·) represents the mean square error between the generated signal corresponding to the amplified sample and the real signal corresponding to the input training sample, E(·) represents the Fourier transform, λ1, λ2, and λ3 represent the signal energy, and x represents the weighting coefficients. gen x represents the estimated value of the expanded training samples. real Representing the real signal, λ2‖FFT(x) gen )-FFT(x real )‖ is the spectral matching loss, λ3‖E(x gen )-E(x real )‖2 represents the energy distribution loss.
[0037] In an optional implementation, the two-dimensional convolution module further includes a discarding module. The step of inputting the training sample dataset into the motor fault identification model to be trained, and obtaining the trained motor fault identification model, includes:
[0038] The motor fault identification model is trained using a label smoothing algorithm and / or an L2 weight decay algorithm.
[0039] Secondly, the present invention provides a method for identifying faults in a small sample of electric motors, comprising:
[0040] Obtain the current operating data of the motor;
[0041] The current operating data is input into the trained motor fault identification model to obtain the fault type of the motor; wherein, the motor fault identification model is trained using the motor fault identification model training method described in any one of the first aspects.
[0042] Thirdly, the present invention provides a small-sample electric motor fault model training device, comprising:
[0043] Fourthly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in any of the foregoing embodiments.
[0044] Fifthly, the present invention provides a computer-readable medium having processor-executable non-volatile program code, the program code causing the processor to perform the method described in any of the foregoing embodiments.
[0045] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: The small-sample motor fault identification method, model training method, apparatus, and device of the present invention employ a motor fault identification model including a Gram angle field module, a two-dimensional convolution module, and a compression excitation module. The Gram angle field module converts multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, respectively, to preserve the time-dependent and nonlinear features of the signals in the training samples. The two-dimensional convolution module is used to extract features of different scales in the two-dimensional image based on a multi-scale convolution kernel group to obtain feature extraction results. The compression excitation module is used to dynamically adjust the weights of the feature channels to enhance key features and suppress redundant features. The present invention uses Gram angle field transform to replace the traditional one-dimensional convolutional network, encoding one-dimensional signals into two-dimensional images, preserving the time-dependent and amplitude distribution features of the original signals; it uses a multi-scale convolution kernel group of the two-dimensional convolution module to extract features of different scales in the two-dimensional image, such as global texture features and local detail features; and it uses the compression excitation module to dynamically adjust the channel weights to suppress redundant features. This invention can significantly improve the robustness to noise interference in signals, ensure the reliability and stability of fault diagnosis results, and meet the fault diagnosis needs of motor fault identification in application scenarios with small sample sizes and complex and variable operating conditions. Attached Figure Description
[0046] Figure 1 A flowchart illustrating the electric motor fault identification model training method provided in an embodiment of the present invention;
[0047] Figure 2 Another flowchart illustrating the electric motor fault identification model training method provided in this embodiment of the invention;
[0048] Figure 3 The confusion matrix diagram after model training in the electric motor fault identification model training method provided in this embodiment of the invention;
[0049] Figure 4 This is a graph showing the changes in model training loss and accuracy in the electric motor fault identification model training method provided in this embodiment of the invention.
[0050] Figure 5 This is a flowchart illustrating the motor fault identification method provided in an embodiment of the present invention.
[0051] Figure 6 This is a schematic diagram of the system principle of the electric motor fault identification model training device provided in an embodiment of the present invention;
[0052] Figure 7 A schematic diagram of the system principle of an electronic device provided in an embodiment of the present invention.
[0053] In the diagram: 100 - Acquisition module; 200 - Training module; 210 - Motor fault identification model; 211 - Gram angle field module; 212 - Two-dimensional convolution module; 213 - Compression excitation module; 1000 - Electronic equipment; 1001 - Communication interface; 1002 - Processor; 1003 - Memory; 1004 - Bus. Detailed Implementation
[0054] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0055] Current electric motor fault identification technologies face the following core challenges:
[0056] (1) Small sample overfitting problem: In practical applications, fault samples are scarce and the labeling cost is high, while mainstream deep learning models rely on large-scale labeled data for training. In small sample scenarios, overfitting is likely to occur, and the generalization performance will decrease significantly.
[0057] (2) Complex operating conditions and noise interference: Load fluctuations, speed changes and signal acquisition noise during motor operation cause the fault characteristics to exhibit non-stationary characteristics. Existing models are not robust enough to dynamic noise and operating condition transitions, and the reliability of diagnosis is limited.
[0058] (3) Spatiotemporal feature fragmentation modeling: The temporal correlation of fault signals (such as the dynamic evolution of vibration waveforms) and spatial distribution characteristics (such as sensor network topology association) are not deeply integrated. Single-dimensional modeling is difficult to capture multi-dimensional fault modes, which restricts the model's representation ability.
[0059] Based on this, the present invention provides a method for identifying motor faults with a small sample size, a model training method, an apparatus, and a device, aiming to solve the problems of data scarcity, noise interference, and model overfitting under complex working conditions. The present invention will be described in detail below through embodiments.
[0060] Reference Figure 1 A method for training a motor fault identification model includes the following steps S100 to S200.
[0061] Step S100: Obtain the training sample dataset; wherein, the training sample dataset includes multiple training samples and labels, and the training samples are the operating data of the motor under various operating states, including various fault states. These operating data include current data and vibration data. In this embodiment, motor faults are identified and classified based on feature extraction and fusion of vibration signals and current signals.
[0062] Specifically, this embodiment collects vibration and current data of the motor using a test bench. The collected data includes seven operating states: normal operation, broken rotor bar fault, dynamic eccentricity fault, static eccentricity fault, bearing cage fault, bearing inner ring fault, and bearing outer ring fault. The signal acquisition frequency during the test was 40960Hz, the operating conditions were a power supply frequency of 50Hz, 100% operating condition (full load), and the actual speed was approximately 2870rpm. Except for the normal operation data, the rest were collected under motor fault conditions. Figure 2 The image shows a vibration or current signal from a specific sampling. The collected data is organized into training samples, and these training samples are labeled (fault labels) to obtain the final training sample dataset.
[0063] The training samples are amplified through the following steps S110 to S120.
[0064] Step S110: Input multiple training samples and labels from the training sample dataset into a pre-built sequence-to-sequence model to obtain multiple amplified training samples corresponding to the multiple training samples; wherein, the sequence-to-sequence model includes an encoding module and a decoding module (e.g., Figure 2 As shown, the decoding module introduces an attention mechanism and a physical constraint loss function. The attention mechanism focuses on the features of key time steps, and the physical constraint loss function includes spectrum matching loss and / or energy distribution loss.
[0065] Sequence-to-Sequence (Seq2Seq) is a data generation method that effectively expands the diversity of the original dataset by simulating potential failure modes of rotating mechanical equipment under different faults. Before inputting the training sample dataset into the encoder, the training samples (original vibration signals or current signals) in the training sample dataset need to be divided into fixed-length (e.g., 2048) segments according to time series as the input sequence for the Sequence-to-Sequence model, and the input sequence needs to include fault labels.
[0066] The encoding module in this embodiment employs a Bidirectional Long Short-Term Memory (BiLSTM) network to encode the input sequence, extracting the temporal features and operational context information of the signal. The decoding module uses a Gated Recurrent Unit (GRU) to progressively generate new signal sequences based on the encoder's hidden states, and dynamically focuses on the features of key time steps through an attention mechanism to improve the physical plausibility of the generated signal. The formula for the physical constraint loss function is:
[0067] L total =λ1L MSE +λ2‖FFT(x gen )-FFT(x real )‖+λ3‖E(x gen )-E(x real )‖2
[0068] Among them, L MSE FFT(·) represents the mean square error between the generated signal corresponding to the amplified sample and the real signal corresponding to the input training sample, E(·) represents the Fourier transform, λ1, λ2, and λ3 represent the signal energy, and x represents the weighting coefficients. gen This represents a signal sample (i.e., an augmented training sample) generated by a sequence-to-sequence model (e.g., a model obtained through training). It is an estimate of the fault signal generated by the model based on the input training data, i.e., an estimate of the augmented training sample; x real This represents the actual signal, that is, the fault signal data actually obtained from the motor system.
[0069] Here, λ1L MSE It can guarantee the waveform similarity between the generated signal and the real signal.
[0070] λ2‖FFT(x gen )-FFT(x real λ3‖E(x) represents the spectral matching loss, also known as the Fourier transform difference. Calculating this loss constrains the spectral distribution of the generated signal to match the real signal, ensuring the physical plausibility of fault characteristics in the frequency domain. gen)-E(x real The loss 2 represents the energy distribution loss, i.e., the energy difference. Calculating this loss constrains the signal energy, preventing energy shifts caused by amplitude distortion in the generated signal. In the motor fault diagnosis scenario of this embodiment, key features of the fault signal (such as the periodic impact of bearing faults and the harmonic components of broken rotor bars) need to maintain high fidelity in both the time and frequency domains. The physical constraint loss function explicitly introduces frequency and energy constraints, solving the problem of physically unreasonable waveforms easily generated by traditional generative models (e.g., GANs or VAEs) in fault data generation, significantly improving the usability of the generated data.
[0071] The weight coefficients λ1, λ2, and λ3 are initialized using a normal distribution, ranging from [0,1] to ensure that different loss terms contribute reasonably during training. During training, these weights are adjusted based on feedback from the loss function to maximize the performance of the final model.
[0072] In the decoding module, a gated recurrent unit (GRU) is used to generate new signal sequences step by step. At each time step, an attention mechanism is used to dynamically focus on the features of key time steps to improve the physical plausibility of the generated signal. Assume the input sequence length is T, and the hidden state is [h1, h2, ..., h...]. T The specific implementation method of introducing the attention mechanism into the decoding module is shown in steps (1) to (5) below.
[0073] (1) Calculate attention weights:
[0074] Assume the hidden states generated by the encoder are H = [h1, h2, ..., h T ,];
[0075] (2) The hidden state of the decoder at the current moment is s t ;
[0076] (3) Attention weights are calculated using the learnable parameter matrix:
[0077] e t,i =v T tanh(W h h i +W s s t +b);
[0078] Among them, W h W s v and b are the learnable weight matrices and biases, respectively. t,i This represents the matching degree between the encoder's i-th time step and the decoder's t-th time step.
[0079] (4) Use Softmax to normalize the attention weights to obtain the attention weights α. t,i This weight reflects the degree of attention the current decoding step pays to each encoding time step. The context vector c is obtained by weighted summation of the attention weights. t :
[0080]
[0081] (5) Transfer the context vector c t With decoder hidden state s t After splicing, the generated signal is predicted through linear transformation.
[0082]
[0083] The attention mechanism dynamically adjusts the importance of features based on the saliency of the signal, enabling the model to focus more on key fault features, suppress noise and redundant information, thereby improving the accuracy and robustness of fault diagnosis. This mechanism is particularly effective with small sample data, helping to enhance the model's generalization ability and avoid overfitting.
[0084] Step S120: Add multiple amplified training samples to the training sample dataset to obtain the amplified training sample dataset.
[0085] In practice, the amplified training samples can be mixed with existing samples to form the training set, while the original samples can be used as the test set. Generally, the ratio of the test set to the training set is 3:7.
[0086] This embodiment preprocesses the training sample dataset and uses a sequence-to-sequence model-based data generation method to predict and generate the original data, thereby enriching the diversity of the original data and enhancing the training of the subsequent network.
[0087] Step S200: Input the training sample dataset into the motor fault identification model to be trained for training, and obtain the trained motor fault identification model; wherein, the motor fault identification model includes a Gram angle field module, a two-dimensional convolution module and a compression excitation module.
[0088] The Gram corner field module is used to convert multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, so as to preserve the time-dependent and nonlinear features of the signals in the training samples.
[0089] Here, the Gram Angular Field module uses Gram Angular Field (GAF) to divide the original one-dimensional vibration or current signal in the training samples into time-series segments of fixed length, and normalizes each segment, mapping it to the [-1, 1] interval. A polar coordinate transformation is then performed on the normalized time-series signal, and each data point x... i Convert to angle θ i =arccos(x i ), calculate the angle and cosine value between any two time points, and generate the Gram angle field matrix G, whose elements are defined as:
[0090] G i,j =cos(θ) i +θ j )
[0091] Using the Gram corner field module, a one-dimensional signal is encoded into a two-dimensional image, thus preserving the temporal dependence and amplitude distribution characteristics of the original signal.
[0092] The 2D convolution module is used to extract features at different scales from a 2D image based on a multi-scale convolution kernel group, obtaining the feature extraction results. The compression excitation module is used to dynamically adjust the weights of the feature channels to enhance key features and suppress redundant features.
[0093] The two-dimensional convolution module in this embodiment adopts a dual-path network design, including a first convolution submodule, a second convolution submodule, a feature fusion submodule, a squeeze-and-excitation (SE) submodule, and a dropout submodule.
[0094] The first convolutional submodule is used to extract global texture features of the two-dimensional image using a first two-dimensional convolutional layer to capture the overall trend and low-frequency components of the signal in the two-dimensional image, thus obtaining a first initial feature map; a first max-pooling layer is used to reduce the resolution of the first initial feature map, thus obtaining a first feature map. Here, as... Figure 2 As shown, the first convolutional submodule uses a large-size convolutional kernel (e.g., a 5×5 convolutional kernel) and employs a 2×2 max pooling layer to reduce the feature map resolution and computational cost.
[0095] The second convolutional submodule is used to extract local texture features from the two-dimensional image using a second two-dimensional convolutional layer, focusing on high-frequency components and transient changes in the signal to obtain a second initial feature map. Depthwise separable convolution is then used to reduce the number of parameters in the second initial feature map and avoid overfitting, resulting in a second feature map. The kernel size of the first two-dimensional convolutional layer is smaller than that of the second two-dimensional convolutional layer. Specifically, the second convolutional submodule uses a large-size convolutional kernel (e.g., a 3×3 kernel).
[0096] Feature fusion submodule (e.g.) Figure 2 The first feature map and the second feature map are concatenated by dimension to obtain the concatenation result; the concatenation result is then processed by a third convolutional layer (e.g., a 1×1 convolutional layer) to obtain the feature extraction result, thereby generating a fused high-dimensional feature representation.
[0097] Because the number of feature channels and feature representation capabilities vary significantly among different convolutional layers, a dynamic scaling factor is designed in the compression activation module:
[0098]
[0099] Where C is the number of input feature channels and k is a hyperparameter.
[0100] The dropout layer is embedded after the compressed excitation layer, with a dropout rate set to 0.3. The parameter settings for the compressed excitation layer require careful consideration of the scaling factor, as it controls the attention weights of each channel. For small datasets, it may be necessary to adjust the dropout rate, using a higher dropout rate (0.5) to effectively reduce overfitting. Additionally, this embodiment also uses label smoothing and / or L2 weight decay (decay coefficient 1e-4) to train the motor fault identification model. These regularization strategies enhance the model's generalization ability and mitigate the risk of overfitting during small-sample training.
[0101] The proposed motor fault identification model in this embodiment is based on Gram corner field transform and lightweight 2D convolution, replacing the traditional 1D convolutional network. First, the Gram corner field module performs Gram corner field transform on the original 1D time-series signal to generate a 2D image representation. Then, based on the 2D convolutional module, large and small convolutional kernels are used to extract global and local features respectively. A 5×5 convolutional kernel is used for the global feature path, and a 3×3 depthwise separable convolutional kernel is used for the local feature path. Afterwards, feature fusion is achieved through channel concatenation and 1×1 convolution to output the fault classification result. Simultaneously, a compression excitation module is introduced after the 2D convolutional module, embedding a dropout layer (dropout module) and L2 weight decay, and label smoothing technology is used to mitigate the risk of overfitting in small-sample training.
[0102] This improvement converts a one-dimensional signal into a two-dimensional image through Gram angular field transformation. It utilizes the inherent local perception characteristics of two-dimensional convolutional networks to reduce network depth and the number of parameters, making it more suitable for training with small samples. This improved scheme solves the overfitting problem caused by excessive parameters in traditional dual-path one-dimensional convolutional networks in small sample scenarios.
[0103] In some possible embodiments, such as Figure 2As shown, the Gram corner field module of the motor fault identification model includes a one-dimensional attention mechanism module. This module extracts key impulse features from the training samples using a one-dimensional signal attention mechanism based on global max pooling. It dynamically adjusts the neuron activation state based on an improved one-dimensional meta-learning adaptive (1D-Meta-ACON) activation function to obtain a feature weighting matrix. It should be noted that after adding the one-dimensional attention mechanism module, the input to the Gram corner field module of the motor fault identification model becomes the output of the one-dimensional attention mechanism module. That is, the Gram corner field module converts the feature matrix output by the one-dimensional attention mechanism module into a two-dimensional image, resulting in a one-dimensional sequence in the final motor fault identification model.
[0104] Specifically, the one-dimensional attention mechanism module includes a global max pooling submodule, a modeling submodule, a feature reconstruction and weight allocation submodule, and a feature weighting submodule.
[0105] The global max pooling submodule is used to extract the key impulse feature matrix of training samples based on global max pooling. As shown in equation (1):
[0106]
[0107] In equation (1), x c Let d represent the signal feature matrix of the c-th channel, d be the signal length, and j represent the elements in the pooling region of the key pulse feature matrix.
[0108] The modeling submodule is used to compare the original feature matrix x corresponding to the training samples with the key impulse feature matrix. The enhanced feature matrix is obtained by concatenating along the channel dimension; the enhanced feature matrix is then mapped through a 1×6 convolutional layer F1 to obtain the intermediate feature connection matrix f, as shown in equation (2) below:
[0109]
[0110] In equation (2), δ represents the improved one-dimensional meta-learning adaptive activation function (1D-Meta-ACON), a nonlinear activation function with a learnable gating mechanism, which typically has more flexible nonlinear expression capabilities than ReLU; the formula for the adaptive activation function (ACON) is:
[0111] ACON(x)=(p1·x-p2·x+p2·x)·σ(β·(p1·x-p2·x))+p2·x
[0112] Here, p1 and p2 are learnable parameters that control the switching and adjustment between different activation functions, updated through backpropagation, and can adapt to changes in different features. β is also a learnable parameter used to adjust the intensity of nonlinear activation, controlling the smoothness and sparsity of features. σ is the Sigmoid function.
[0113] By introducing a meta-learning strategy on the basis of the traditional adaptive activation function, the parameters of the activation function can be adaptively adjusted according to the input, thus obtaining the improved one-dimensional meta-learning adaptive activation function δ(x).
[0114] in:
[0115] β=σ(BN2(FC2(BN1(FC1(mean(x))))))
[0116] FC1 and FC2 are one-dimensional convolutional layers (equivalent to fully connected layers) used for feature transformation. BN1 and BN2 are batch normalization layers used to stabilize training and prevent overfitting. mean(x) is the mean along the feature dimension, used for feature compression and enhanced robustness. σ is the sigmoid function, ensuring that β takes values in the range (0,1).
[0117] The meta-learning adaptive activation function (RTO) in one-dimensional meta-learning adaptive activation functions introduces a dynamic adjustment mechanism for adaptive parameters, enabling the activation function to automatically select appropriate activation states for different input features. In motor fault identification tasks, it can extract fault features more accurately, thereby improving fault identification accuracy and robustness. Compared with traditional activation functions, its adaptability is significantly enhanced, helping to alleviate overfitting problems and effectively improving the model's sensitivity to feature changes.
[0118] In this embodiment, the one-dimensional attention mechanism module has an input feature matrix of dimension C×L, which contains C channels, each with a length of L, representing a one-dimensional temporal signal. Although the overall structure is a two-dimensional tensor, attention extraction is performed using the one-dimensional sequence within each channel as the basic unit during modeling. The output feature weighting matrix maintains the same dimension as the input, preserving the channel and temporal structure, thereby enhancing key impulse features and suppressing redundant information.
[0119] Compared to traditional one-dimensional attention mechanisms, this embodiment makes the following innovative improvements in design: First, traditional global max pooling methods only extract maximum values from a statistical perspective, easily ignoring representative transient pulse features in the signal. This embodiment, however, actively focuses on key pulses in the fault signal through a global max pooling mechanism. It calculates the weights for each time step using a one-dimensional attention module, rather than simply extracting maximum values. By weighted integrating global features through the attention mechanism, more fine-grained information is retained, adaptively highlighting key pulse signals. This is particularly effective in improving the response to sudden fault features, especially for the transient impact characteristics of motor faults. Second, an improved one-dimensional meta-learning adaptive activation function is introduced. This function has dynamic gating capabilities, dynamically adjusting the activation state of neurons based on input features, enhancing the model's expressive ability under nonlinear signals. Third, by concatenating the original feature matrix and the key pulse feature matrix along the channel dimension to form an enhanced feature matrix, and then generating channel attention weights through convolutional mapping and feature reconstruction, joint attention modeling of space and channels is finally achieved. This mechanism significantly improves the model's ability to extract fault features and its generalization performance under complex conditions with small samples.
[0120] The feature reconstruction and weight allocation submodule is used to split and reconstruct the intermediate feature concatenation matrix to obtain the reconstructed feature matrix x'. The reconstructed feature matrix x' is mapped to the same number of channels as the original feature matrix x using the following formula (3) and combined with the fourth convolutional layer F2, generating channel attention weights g:
[0121] g=σ(F2(x')), (3)
[0122] In equation (3), σ is the Sigmoid function. The Sigmoid function (S-type activation function) is an activation function, often used for probability output in binary classification problems. The fourth convolutional layer F2 can be a 1×1 convolutional layer.
[0123] The feature weighting submodule is used to multiply the channel attention weights g with the original feature matrix x channel by channel to obtain the feature weighting matrix y. c As shown in equation (4):
[0124] y c =x c *g c (4)
[0125] In equation (4), x c Let g represent the input feature matrix of the c-th channel. c This represents the attention weight on the c-th channel, where c represents the channel index, i.e., the input feature matrix.
[0126] y cThe final output is fed into the subsequent network. The network output is observed, and the classification accuracy is tested using a test set. A confusion matrix is output to observe the classification performance. Figure 3 and Figure 4 As shown, Figure 3 The confusion matrix of the model in this embodiment on the test set is shown, from which the accuracy of the model in identifying various types of motor faults can be intuitively observed. It can be seen that the model has a high accuracy rate in identifying normal conditions and various typical faults (such as bearing outer ring, rotor bar breakage, etc.) and a low false positive rate, which verifies the model's effective classification ability under multiple fault categories. Figure 4 The curves show the changes in loss value and classification accuracy during model training. In the early stage of training, the loss decreases rapidly and the accuracy increases rapidly; in the later stage, it tends to stabilize, showing that the model has good convergence and robustness under small sample conditions.
[0127] This embodiment uses global max pooling to extract key impulse features from training samples. The original features are concatenated with the key impulse feature matrix and passed through a convolutional layer to generate spatial-channel joint channel attention weights *g*. An improved one-dimensional meta-learning adaptive activation function is then used to dynamically adjust the neuron activation state. Traditional channel attention mechanisms (such as those based on global average pooling (GAP)) typically focus on the overall statistical properties of the signal in fault diagnosis, but neglect the decisive role of key impulse features in fault classification. This embodiment proposes a one-dimensional signal attention mechanism based on global max pooling (GMP), which significantly improves the sensitivity of the motor fault identification model to fault features by focusing on key impulses in the signal.
[0128] In summary, this embodiment first employs a sequence-to-sequence model to generate augmented data from the training sample dataset. Then, a BiLSTM-based encoding module and a GRU-based decoding module convert the one-dimensional sequence into a two-dimensional image. The decoding module introduces an attention mechanism and a physical constraint loss function. The attention mechanism focuses on features at key time steps, improving the physical plausibility of the generated signal; the physical constraint loss function incorporates spectral matching and energy distribution constraint losses, further enhancing the physical consistency of the generated signal. This embodiment augments the data during preprocessing by generating diverse data types, which improves the generalization ability of the subsequent model and reduces overfitting.
[0129] The electric motor fault identification model in this embodiment is based on a one-dimensional attention mechanism module. It utilizes global max pooling to focus on key pulse features and suppress noise interference, thereby improving diagnostic accuracy, especially in small sample applications. Combined with an improved one-dimensional meta-learning adaptive activation function, it dynamically adjusts the activation state of neurons to adapt to different inputs, avoids dead neuron problems, and enhances the model's nonlinear expressive power.
[0130] The motor fault identification model in this embodiment is also based on a lightweight two-dimensional convolutional network using Gram angle field transform. The Gram angle field module converts one-dimensional signals into two-dimensional images, and a dual-path two-dimensional convolutional module (5×5 global convolution and 3×3 depthwise separable local convolution) is used to extract time-frequency features, resulting in lower computational complexity and better small-sample adaptability. Furthermore, generalization performance is optimized through a compression excitation module and label smoothing technology. This embodiment can simultaneously focus on temporal and spatial features, achieving deep fusion of spatiotemporal features, solving the problems of data scarcity, noise interference, and model overfitting under complex working conditions, and improving the model's expressive power.
[0131] See Figure 5 The present invention provides a method for identifying small-sample motor faults, including steps S300 to S400.
[0132] Step S300: Obtain the current operating data of the motor.
[0133] Step S400: Input the current running data into the trained motor fault identification model to obtain the fault type of the motor; wherein, the motor fault identification model is trained using the aforementioned motor fault identification model training method.
[0134] See Figure 6 This invention provides a small-sample motor fault model training device, comprising an acquisition module 100 and a training module 200. The acquisition module 100 acquires a training sample dataset; wherein the training sample dataset includes multiple training samples and labels, and the training samples are operating data of the motor under various operating states, including various fault states. The training module 200 inputs the training sample dataset into the motor fault identification model to be trained for training, obtaining a trained motor fault identification model 210; wherein the motor fault identification model 210 includes a Gram angle field module 211, a two-dimensional convolution module 212, and a compression excitation module 213. The Gram angle field module 211 converts multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, respectively, to preserve the time-dependent and nonlinear features of the signals in the training samples. The two-dimensional convolution module 212 extracts features at different scales in the two-dimensional image based on a multi-scale convolution kernel group, obtaining feature extraction results. The compression excitation module 213 dynamically adjusts the weights of the feature channels to enhance key features and suppress redundant features.
[0135] In an optional embodiment, the device further includes:
[0136] The sample augmentation module is used to input multiple training samples and labels from the training sample dataset into a pre-built sequence-to-sequence model to obtain multiple augmented training samples corresponding to the multiple training samples; wherein, the sequence-to-sequence model includes an encoding module and a decoding module, the decoding module introduces an attention mechanism and a physical constraint loss function, the attention mechanism focuses on the features of key time steps, and the physical constraint loss function includes spectral matching loss and / or energy distribution loss;
[0137] The sample addition module is used to add the multiple amplified training samples to the training sample dataset to obtain the amplified training sample dataset.
[0138] In an optional embodiment, the motor fault identification model further includes a one-dimensional attention mechanism module, which is used to extract key pulse features from the training samples using a one-dimensional signal attention mechanism based on global max pooling, and dynamically adjust the activation state of neurons based on an improved one-dimensional meta-learning adaptive activation function to obtain a feature weighting matrix.
[0139] In an optional embodiment, the two-dimensional convolution module 212 includes:
[0140] The first convolutional submodule is used to extract global texture features of the two-dimensional image using a first two-dimensional convolutional layer to capture the overall trend and low-frequency components of the signal in the two-dimensional image, thereby obtaining a first initial feature map; and to reduce the resolution of the first initial feature map using a first max pooling layer, thereby obtaining a first feature map.
[0141] The second convolutional submodule is used to extract local texture features of the two-dimensional image using a second two-dimensional convolutional layer to focus on the high-frequency components and transient changes of the signal to obtain a second initial feature map; and to reduce the number of parameters of the second initial feature map using depthwise separable convolution to obtain a second feature map.
[0142] The feature fusion submodule is used to concatenate the first feature map and the second feature map by dimension to obtain the concatenation result; and to perform cross-channel information interaction on the concatenation result through the third convolutional layer to obtain the feature extraction result;
[0143] Wherein, the kernel size of the first two-dimensional convolutional layer is smaller than the kernel size of the second two-dimensional convolutional layer.
[0144] In an optional embodiment, the one-dimensional attention mechanism module includes:
[0145] The global max pooling submodule is used to extract the key impulse feature matrix of the training samples based on global max pooling. As shown in equation (1):
[0146]
[0147] In equation (1), x c Let d represent the signal feature matrix of the c-th channel, d be the signal length, and j represent the elements in the pooling region of the key pulse feature matrix.
[0148] The modeling submodule is used to compare the original feature matrix x corresponding to the training samples with the key pulse feature matrix. The enhanced feature matrix is obtained by concatenating along the channel dimension; the enhanced feature matrix is then mapped to obtain the intermediate feature connection matrix f, as shown in equation (2) below:
[0149]
[0150] In equation (2), F1 is a convolutional layer; where δ is an improved one-dimensional learning adaptive activation function, which typically has a more flexible nonlinear expression capability than ReLU.
[0151] The feature reconstruction and weight allocation submodule is used to split and reconstruct the intermediate feature connection matrix to obtain the reconstructed feature matrix x'. The reconstructed feature matrix x' is mapped to the same number of channels as the original feature matrix x using the following formula (3) and combined with the fourth convolutional layer F2, to generate channel attention weights g:
[0152] g=σ(F2(x')), (3)
[0153] In equation (3), σ is the Sigmoid function;
[0154] The feature weighting submodule is used to multiply the channel attention weights g with the original feature matrix x channel by channel to obtain the feature weighting matrix y. c As shown in equation (4):
[0155] y c =x c *g c (4)
[0156] In equation (4), x c Let g represent the input feature matrix of the c-th channel. c This represents the attention weight on the c-th channel, where c represents the channel index, i.e., the input feature matrix.
[0157] In an optional embodiment, the physical constraint loss function is:
[0158] L total =λ1L MSE +λ2‖FFT(x gen )-FFT(x real)‖+λ3‖E(x gen )-E(x real )‖2
[0159] Among them, L MST FFT(·) represents the mean square error between the generated signal corresponding to the amplified sample and the real signal corresponding to the input training sample, E(·) represents the Fourier transform, λ1, λ2, and λ3 represent the signal energy, and x represents the weighting coefficients. gen x represents the estimated value of the expanded training samples. real Representing the real signal, λ2‖FFT(x) gen )-FFT(x real )‖ is the spectral matching loss, λ3‖E(x gen )-E(x real )‖2 represents the energy distribution loss.
[0160] In an optional embodiment, the two-dimensional convolution module further includes a dropout module, and the training module further includes a regularization module for training the motor fault identification model using a label smoothing algorithm and / or an L2 weight decay algorithm.
[0161] The apparatus provided in the embodiments of this application has the same inventive concept as the method provided in the embodiments of this application. As long as the method can solve the technical problem, the apparatus can also solve the technical problem. This will not be elaborated here.
[0162] Reference Figure 7 The present invention also provides an electronic device 1000, including a communication interface 1001, a processor 1002, a memory 1003, and a bus 1004. The processor 1002, the communication interface 1001, and the memory 1003 are connected via the bus 1004. The memory 1003 is used to store a computer program that supports the processor 1002 in executing the small sample motor fault identification method and / or the small sample motor fault model training method. The processor 1002 is configured to execute the program stored in the memory 1003.
[0163] Optionally, embodiments of the present invention also provide a computer-readable medium having non-volatile program code executable by a processor 1002, the program code causing the processor 1002 to execute the small sample motor fault identification method and / or small sample motor fault model training method as described in the above embodiments.
[0164] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.
Claims
1. A method for training a motor fault identification model, characterized in that, include: Obtain a training sample dataset; wherein the training sample dataset includes multiple training samples and labels, the training samples are the operating data of the motor under various operating states, and the various operating states include various fault states; The training sample dataset is input into the motor fault identification model to be trained to obtain the trained motor fault identification model; wherein, the motor fault identification model includes a Gram angle field module, a two-dimensional convolution module and a compressed excitation module; The Gram angle field module is used to convert multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, so as to preserve the time-dependent and nonlinear features of the signals in the training samples. The two-dimensional convolution module is used to extract features at different scales in the two-dimensional image based on a multi-scale convolution kernel group to obtain feature extraction results. The compression excitation module is used to dynamically adjust the weights of the feature channels to enhance key features and suppress redundant features; The motor fault identification model also includes a one-dimensional attention mechanism module, which is used to extract key pulse features in the training samples using a one-dimensional signal attention mechanism based on global max pooling, and dynamically adjust the activation state of neurons based on an improved one-dimensional meta-learning adaptive activation function to obtain a feature weighting matrix. The two-dimensional convolution module includes: The first convolutional submodule is used to extract global texture features of the two-dimensional image using a first two-dimensional convolutional layer to capture the overall trend and low-frequency components of the signal in the two-dimensional image, thereby obtaining a first initial feature map; and to reduce the resolution of the first initial feature map using a first max pooling layer, thereby obtaining a first feature map. The second convolutional submodule is used to extract local texture features of the two-dimensional image using a second two-dimensional convolutional layer to focus on the high-frequency components and transient changes of the signal to obtain a second initial feature map; and to reduce the number of parameters of the second initial feature map using depthwise separable convolution to obtain a second feature map. The feature fusion submodule is used to concatenate the first feature map and the second feature map by dimension to obtain the concatenation result; and to perform cross-channel information interaction on the concatenation result through the third convolutional layer to obtain the feature extraction result; Wherein, the kernel size of the first two-dimensional convolutional layer is smaller than the kernel size of the second two-dimensional convolutional layer; The one-dimensional attention mechanism module includes: The global max pooling submodule is used to extract the key impulse feature matrix of the training samples based on global max pooling. As shown in equation (1): ,(1) In equation (1), Indicates the first The signal feature matrix of each channel For signal length, This represents each element within the pooling region of the key pulse feature matrix; The modeling submodule is used to convert the original feature matrix corresponding to the training samples. x With the key pulse feature matrix Concatenate along the channel dimension to obtain the enhanced feature matrix; map the enhanced feature matrix to obtain the intermediate feature connection matrix. f, As shown in equation (2): ,(2) In equation (2), F 1 It is a convolutional layer; where For an improved one-dimensional meta-learning adaptive activation function; The feature reconstruction and weight allocation submodule is used to split and reconstruct the intermediate feature connection matrix to obtain the reconstructed feature matrix. By using the following equation (3) and combining it with the fourth convolutional layer F 2 The reconstructed feature matrix Mapped to the original feature matrix x With the same number of channels, generate channel attention weights. : ,(3) In equation (3), For the Sigmoid function; The feature weighting submodule is used to weight the channel attention weights. With the original feature matrix x Multiplying by each channel yields the feature weighting matrix. As shown in equation (4): * ,(4) In equation (4), Indicates the first c The input feature matrix of each channel, Indicates the first c Attention weights on the channel.
2. The electric motor fault identification model training method according to claim 1, characterized in that, Before inputting the training sample dataset into the motor fault identification model to be trained to obtain the trained motor fault identification model, the process further includes: Multiple training samples and labels from the training sample dataset are input into a pre-built sequence-to-sequence model to obtain multiple amplified training samples corresponding to the multiple training samples; wherein, the sequence-to-sequence model includes an encoding module and a decoding module, the decoding module introduces an attention mechanism and a physical constraint loss function, the attention mechanism focuses on the features of key time steps, and the physical constraint loss function includes spectral matching loss and / or energy distribution loss; The multiple amplified training samples are added to the training sample dataset to obtain the amplified training sample dataset.
3. The electric motor fault identification model training method according to claim 2, characterized in that, The physical constraint loss function is: , in, This is the mean square error between the generated signal corresponding to the amplified sample and the real signal corresponding to the input training sample. For Fourier transform, For signal energy, 、 and These are the weighting coefficients. x gen This represents the estimated value of the expanded training samples. x real Represents the true signal. The spectrum matching loss This refers to the energy distribution loss.
4. The electric motor fault identification model training method according to claim 1, characterized in that, The two-dimensional convolution module further includes a discarding module. The step of inputting the training sample dataset into the motor fault identification model to be trained, and obtaining the trained motor fault identification model, includes: The motor fault identification model is trained using a label smoothing algorithm and / or an L2 weight decay algorithm.
5. A method for identifying faults in a small sample of electric motors, characterized in that, include: Obtain the current operating data of the motor; The current operating data is input into the trained motor fault identification model to obtain the fault type of the motor; wherein the motor fault identification model is trained using the motor fault identification model training method described in any one of claims 1-4.
6. A small-sample electric motor fault identification device, characterized in that, include: The acquisition module is used to acquire a training sample dataset; wherein, the training sample dataset includes multiple training samples and labels, and the training samples are the operating data of the motor under various operating states, including various fault states; The training module is used to input the training sample dataset into the motor fault identification model to be trained for training, so as to obtain the trained motor fault identification model; wherein, the motor fault identification model includes a Gram angle field module, a two-dimensional convolution module and a compression excitation module. The Gram angle field module is used to convert multiple training samples in the training sample dataset into two-dimensional images through polar coordinate mapping and Gram matrix operations, so as to preserve the time-dependent and nonlinear features of the signals in the training samples. The two-dimensional convolution module is used to extract features at different scales in the two-dimensional image based on a multi-scale convolution kernel group to obtain feature extraction results. The compression excitation module is used to dynamically adjust the weights of the feature channels to enhance key features and suppress redundant features; The motor fault identification device also includes a one-dimensional attention mechanism module, which is used to extract key pulse features in the training samples using a one-dimensional signal attention mechanism based on global max pooling, and dynamically adjust the activation state of neurons based on an improved one-dimensional meta-learning adaptive activation function to obtain a feature weighting matrix. The two-dimensional convolution module includes: The first convolutional submodule is used to extract global texture features of the two-dimensional image using a first two-dimensional convolutional layer to capture the overall trend and low-frequency components of the signal in the two-dimensional image, thereby obtaining a first initial feature map; and to reduce the resolution of the first initial feature map using a first max pooling layer, thereby obtaining a first feature map. The second convolutional submodule is used to extract local texture features of the two-dimensional image using a second two-dimensional convolutional layer to focus on the high-frequency components and transient changes of the signal to obtain a second initial feature map; and to reduce the number of parameters of the second initial feature map using depthwise separable convolution to obtain a second feature map. The feature fusion submodule is used to concatenate the first feature map and the second feature map by dimension to obtain the concatenation result; and to perform cross-channel information interaction on the concatenation result through the third convolutional layer to obtain the feature extraction result; Wherein, the kernel size of the first two-dimensional convolutional layer is smaller than the kernel size of the second two-dimensional convolutional layer; The one-dimensional attention mechanism module includes: The global max pooling submodule is used to extract the key impulse feature matrix of the training samples based on global max pooling. As shown in equation (1): ,(1) In equation (1), Indicates the first The signal feature matrix of each channel For signal length, This represents each element within the pooling region of the key pulse feature matrix; The modeling submodule is used to convert the original feature matrix corresponding to the training samples. x With the key pulse feature matrix Concatenate along the channel dimension to obtain the enhanced feature matrix; map the enhanced feature matrix to obtain the intermediate feature connection matrix. f, As shown in equation (2): ,(2) In equation (2), F 1 It is a convolutional layer; wherein As an improved one-dimensional learning adaptive activation function, it typically has a more flexible nonlinear expressive power than ReLU; The feature reconstruction and weight allocation submodule is used to split and reconstruct the intermediate feature connection matrix to obtain the reconstructed feature matrix. By using the following equation (3) and combining it with the fourth convolutional layer F 2 The reconstructed feature matrix Mapped to the original feature matrix x With the same number of channels, generate channel attention weights. : ,(3) In equation (3), For the Sigmoid function; The feature weighting submodule is used to weight the channel attention weights. With the original feature matrix x Multiplying by each channel yields the feature weighting matrix. As shown in equation (4): * ,(4) In equation (4), Indicates the first c The input feature matrix of each channel, Indicates the first c Attention weights on the channel.
7. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1-5.