An intelligent identification method for mechanical multiple faults based on a lightweight capsule network model
By reducing the complexity of the capsule network through knowledge distillation and parameter sharing mechanisms, the problems of large model parameters and difficulty in fault feature extraction in harsh environments are solved, and high-precision mechanical fault identification and small-scale equipment deployment are achieved.
Patent Information
- Application Number
- CN202210958834.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-08-10
AI Technical Summary
The existing mechanical multi-fault identification method based on capsule network has a large number of model parameters and high computational requirements, making it difficult to deploy in small embedded devices. In addition, fault feature extraction is difficult in harsh environments, and the identification accuracy is insufficient.
By adopting knowledge distillation technology and parameter sharing mechanism, constructing feature extraction teacher model and student model, combining contrastive learning and dynamic routing algorithm, the model complexity is reduced, the capsule network is lightweight and adaptable to harsh working conditions.
It achieves high-precision mechanical fault identification in harsh environments, reduces the time and space complexity of the model, makes it suitable for deployment in small portable devices, and improves the accuracy and applicability of fault diagnosis.
Smart Images

Figure CN115392358B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to intelligent fault identification of multiple mechanical faults, and in particular to an intelligent fault identification method of multiple mechanical faults based on a capsule network lightweight model. Background Art
[0002] Aircraft engines, wind turbines, ship propulsion systems, and high-speed railway wheelsets are complex machines. Bearings and planetary gearboxes are key components and are widely used in these large-scale equipment. The health monitoring results of these key components are of great significance to the reliable operation and safety of these machines.
[0003] Currently, intelligent identification methods for multiple mechanical faults can be broadly categorized into three approaches. The first is based on analytical models; the second is based on signal processing; and the third is based on deep learning. Deep learning-based methods are exemplified by recurrent neural networks and convolutional neural networks, and these two types of algorithms are currently hot topics in research on intelligent identification of multiple mechanical faults. However, model training based on recurrent neural networks involves serial computation, which takes a long time and is prone to the risks of vanishing and exploding gradients. Capsule networks differ from conventional convolutional neural networks in that a capsule is composed of multiple neurons, and the parameters between upper and lower capsules are updated using a dynamic routing algorithm. Dynamic routing clusters features, strengthens similar features, automatically selects features, and outputs more expressive feature vectors. Furthermore, capsule networks feature vector-input and vector-output, allowing capsules to express richer fault characteristics, making it easier to identify mechanical faults. This characteristic of capsule networks offers the potential for improving the accuracy of multiple mechanical fault identification.
[0004] Mechanical equipment has diverse motion structures and harsh operating conditions. Equipment often operates in harsh environments (high noise levels). Failure to promptly address critical equipment failures can pose safety risks. Extracting mechanical failure features in high-noise environments remains challenging. Contrastive learning can learn the commonalities between samples of the same type and the specificities between samples of different types. Incorporating contrastive learning into mechanical multi-fault identification can help extract features that better represent the fault information.
[0005] Like many deep learning methods, current approaches to multi-fault identification based on capsule networks often suffer from large model parameters and high computing power requirements, resulting in poor practicality and difficulty in deployment in small, embedded, and portable devices. Furthermore, lightweight capsule network models often produce poor fault identification results. Therefore, exploring the lightweighting of models for multi-fault identification algorithms based on capsule networks is particularly important.
[0006] To address this dilemma, one of the solutions proposed in this paper is to employ knowledge distillation. Knowledge distillation is a method for model lightweighting that transfers knowledge from a teacher network (with a complex model structure and a large number of parameters) to a student network (with a simpler model structure and a smaller number of parameters). Knowledge distillation can be categorized as feature-based or response-based, depending on the processing method. Because mechanical fault signals are often overwhelmed by noise, fault feature extraction is difficult, this paper chooses feature-based knowledge distillation. A second solution proposed in this paper for model lightweighting is to share parameters between capsule layers to reduce the model's spatial complexity.
[0007] Existing capsule networks cannot adapt to harsh working conditions and situations with high model complexity. Summary of the Invention
[0008] The present invention provides a method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model, so as to realize effective identification of multiple mechanical faults by the capsule network lightweight model and solve the problems raised in the above-mentioned background technology.
[0009] To achieve the above objectives, a method for intelligent identification of multiple mechanical faults based on a lightweight capsule network model is proposed. The method includes:
[0010] S1. Collect one-dimensional signal sequence data collected by sensors according to specific mechanical fault categories, convert the data into images, and establish a mechanical multi-fault status database; the mechanical multi-fault status database consists of several pairs of time series data and health status labels;
[0011] S2. Based on the mechanical multi-fault state database, the mechanical multi-fault state database is divided into a training set and a test set; a feature extraction teacher model is constructed, and the model loss function is the contrast loss loss cl Contrastive loss is an indicator that measures the feature similarity of similar samples in the same batch and the distance between the features of different samples. The feature extraction teacher model contains ResNet-18 and a primary capsule layer. The Adam optimization algorithm is used to train the model until the model converges.
[0012] S3. Build a feature extraction student model that is less complex than the feature extraction teacher network model;
[0013] The output of the feature extraction student model needs to be consistent with the output dimension of the feature extraction teacher model. The total loss of the feature extraction student model is loss. student is the KL divergence loss kl and contrast loss clThe KL divergence loss is an indicator that measures the knowledge distillation ability between the feature extraction teacher model and the feature extraction student model. The feature extraction student model contains LeNet-5 and the primary capsule layer. The Adam optimization algorithm is used to train the model until the model converges.
[0014] S4. Freeze the weights of the feature extraction student model and add a capsule network classification module after the feature extraction student model. The feature extraction student model plus the capsule network classification module are collectively referred to as a capsule network lightweight model. The capsule network lightweight model includes a digital capsule layer and a length layer. One digital capsule layer corresponds to multiple digital capsules, and each digital capsule contains multiple neurons (neurons are the most basic unit elements in deep learning. Almost all deep learning networks are composed of neurons combined in different ways). The parameters between the digital capsule layer and the primary capsule layer are updated using a dynamic routing mechanism. The length layer calculates the bi-norm of the corresponding digital capsule. The dimension of the weight transformation matrix between the primary capsule layer and the digital capsule layer is reduced from a×l1×b×l2 to l1×b×l2, where a is the number of capsules in the primary capsule layer, l1 is the number of neurons in each primary capsule, b is the number of digital capsules in the digital capsule layer, and l2 is the number of neurons in each digital capsule layer. The loss function of the capsule network lightweight model is the edge loss. margin , the Adam optimization algorithm is used to train the model until the model converges;
[0015] S5. Obtain a test set of the above-mentioned mechanical multiple fault state database as input, and obtain the intelligent recognition result of the mechanical multiple fault state through the trained capsule network classification module.
[0016] Furthermore, the sensor in step 1 is one or both of a vibration sensor and a sound signal sensor.
[0017] Furthermore, the method for converting the data into images in step 2 is:
[0018] The direct dimensionality change is one of a grayscale image, a Grammi angle field, a Markov transition field, a recurrence graph, and a discrete-time Fourier transform.
[0019] Furthermore, the loss of the feature extraction teacher model in step 2 is the contrast loss; the contrast loss function is: z i Represents the function mapping from the i-th sample in a batch to the feature extractor output, and the parameter τ is used to adjust the concentration of the output features in the feature space; for each anchor sample, there are multiple positive samples, Indicates the number of samples in a batch whose sample labels are the same as the i-th sample label;
[0020] Furthermore, in step 3, the total loss function of the feature extraction student model is: loss student =loss kl +loss cl ; The KL divergence loss function is: X∈{1,...,N}, T(i) represents the probability distribution of teacher characteristics, and S(i) represents the probability distribution of student characteristics.
[0021] Furthermore, in step 4, the edge loss function loss margin Equal to the loss corresponding to each corresponding category k margin (k) and loss margin (k) = T k max(0,m + -||v k ||2) 2 +λ(1-T k )max(0,||v k ||2-m - ) 2 , where T k =1 means the category represented by the digital capsule exists, and T k =0 means that the category represented by the digital capsule does not exist; ||v k ||2 is the bi-norm of the output of the kth capsule in the digital capsule layer, λ is a hyperparameter adjustment factor, and m + and m - Indicates upper and lower edges.
[0022] Compared with the prior art, the present invention has the following advantages and positive effects:
[0023] The present invention proposes a method for intelligent fault identification of multiple mechanical faults, which can identify faults of mechanical equipment in harsh environments. It can realize "end-to-end" intelligent identification of the health status of mechanical equipment from data collection, and has high fault diagnosis accuracy.
[0024] The joint contrastive learning of the present invention can obtain similarity information between samples in the same batch and the information transmission capability of the capsule network with vector input and vector output, so as to mine information more relevant to the mechanical fault.
[0025] Compared with the traditional capsule network method, the present invention combines the parameter-sharing digital capsule layer and the knowledge distillation operation of the feature extractor from the teacher model to the student model, which greatly reduces the time complexity and space complexity of the model, making the model lightweight and miniaturized, and more suitable for deployment in small portable embedded devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1This is a flow chart of a method for intelligent identification of multiple mechanical faults based on a lightweight capsule network model;
[0027] Figure 2 This is a working principle diagram of a mechanical multi-fault intelligent identification method based on a lightweight capsule network model;
[0028] Figure 3 The feature extraction teacher network and feature extraction student network described in the embodiment;
[0029] Figure 4 2 is a structural diagram of a lightweight capsule network model described in an embodiment;
[0030] Figure 5 Graph showing the variation of accuracy of the training set and test set classification of the capsule network lightweight model with the number of iterations in the embodiment;
[0031] Figure 6 This is a confusion matrix diagram of the capsule network lightweight model classification in the embodiment. DETAILED DESCRIPTION
[0032] See also Figure 1-2 The present invention proposes a method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model, which includes the following steps:
[0033] S1. Collect one-dimensional signal sequence data collected by sensors according to specific mechanical fault categories, convert the data into images, and establish a mechanical multi-fault state database. The mechanical multi-fault state database consists of several pairs of time series data and health status labels;
[0034] The present invention uses planetary gears to conduct experiments on a test bench. The model of the experimental planetary gear is ZLS160. The acquisition card model is NI USB4432, the sensor type is a vibration sensor, the experimental sampling frequency is 20480Hz, and the rotation speed is 3000 revolutions per second. The fault types include sun gear pitting, sun gear cracks, sun gear broken teeth, sun tooth missing, planet gear pitting, planet gear cracks, planet gear broken teeth, and planet gear missing teeth, a total of 8 types of mechanical fault states. The experiment was collected under a signal-to-noise ratio of -4dB, and the length of the sample sequence was 1024. The way to convert sequence data into an image is discrete time Fourier transform. The discrete Fourier transform formula is u[n] represents the time series signal collected by the sensor, w represents the angular frequency, and j is the imaginary number sign;
[0035] S2. Based on the mechanical multi-fault state database, the mechanical multi-fault state database is divided into a training set and a test set at a ratio of 70%:30%. A feature extraction teacher model is constructed, and the model loss function is defined as the contrast loss (loss cl), contrastive loss is an indicator that measures the feature similarity of samples of the same type and the distance between the features of different samples in the same batch. The feature extraction teacher network should include a primary capsule layer and the model should be trained using the Adam optimization algorithm until the model converges;
[0036] The dataset is divided into training set and test set with 744 and 320 samples respectively. The loss of the feature extraction teacher model is contrast loss. The contrast loss function is: z i It represents the function mapping from the i-th input sample in a batch to the feature extractor output, and τ is the degree of concentration of the output features in the feature space. For each anchor sample, there are multiple samples of the same category (positive samples), Indicates the number of samples in a batch whose label is the same as the i-th sample label.
[0037] S3. Construct a feature extraction student model with lower complexity than the feature extraction teacher network model. The output of the feature extraction student model needs to be consistent with the output dimension of the feature extraction teacher model. The total loss of the feature extraction student model (loss student ) is defined as KL divergence loss (loss kl ) and contrast loss (loss cl ). KL divergence loss is a measure of the ability to distill knowledge from the feature extraction teacher model to the feature extraction student model. The feature extraction student model should contain a primary capsule layer and be trained using the Adam optimization algorithm until convergence.
[0038] The total loss function of the feature extraction student model is: loss student =loss kl +loss cl ; KL divergence loss function is: KL divergence is a method for describing the difference between the teacher feature distribution T and the student feature distribution, with the parameter X∈{1,...,N}. Here, the number of capsules in the primary capsule layer is 256, and the number of neurons contained in a capsule is 16.
[0039] In the corresponding embodiment, the structure diagram of the feature extraction teacher model and feature extraction student model in step S2 and step S3 can be found in Figure 3 The feature extraction teacher model is composed of ResNet-18 and primary capsule layers, and the feature extraction student model is composed of LeNet-5 and primary capsule layers.
[0040] S4. Freeze the weights of the above-mentioned feature extraction student network, and add a capsule network classification module after the model, which is recorded as a capsule network lightweight model. The capsule network classification module includes a digital capsule layer and a Length layer. One digital capsule layer corresponds to multiple digital capsules. The parameter update between the digital capsule layer and the primary capsule layer uses a dynamic routing mechanism, and the Length layer can calculate the two norms of the corresponding digital capsules. It should be noted that the difference from ordinary digital capsules is that the parameter amount of the weight transformation matrix between the above-mentioned primary capsule layer and the digital capsule layer is reduced from a×l1×b×l2 to l1×b×l2. The reason for this parameter change is the implementation of a parameter-sharing digital capsule layer. Among them, a is the number of capsules in the primary capsule layer, l1 is the number of neurons in each primary capsule, b is the number of capsules in the digital capsule layer, and l2 is the number of neurons in each digital capsule layer. The loss function of the capsule network lightweight model is the edge loss (loss margin ), use the Adam optimization algorithm to train the model until the model converges;
[0041] Edge loss function loss margin Equal to the loss corresponding to each corresponding fault category k margin (k) and loss margin (k) = T k max(0,m + -||v k ||2) 2 +λ(1-T k )max(0,||v k ||2-m - ) 2 , where T k =1 means the category represented by the digital capsule exists, and T k =0 means the category represented by the digital capsule does not exist. k ||2 is the bi-norm of the output of the kth capsule in the digital capsule layer. λ is a hyperparameter adjustment factor, and the parameter value is set to 0.5. + and m - The upper and lower edges are set to 0.875 and 0.125 respectively. The number of capsules in the digital capsule layer corresponds to the number of mechanical fault categories (in other words, the number of capsules is 8), and the number of neurons contained in a capsule is 16.
[0042] In the corresponding embodiment, the digital capsule layer structure diagram of step S4 is shown in Figure 4 The digital capsule layer with the parameter sharing mechanism reduces the number of parameters from 524288 to 2048 compared to the ordinary digital capsule layer.
[0043] S5. Obtain a test set of the above-mentioned mechanical multiple fault state database as input, and obtain a mechanical multiple fault state intelligent recognition result through the trained capsule network lightweight model.
[0044] Correspondingly, Figure 5 The following graph shows the variation of the accuracy of the capsule lightweight model in the training and test sets with the number of iterations. The results show that the accuracy of the intelligent identification of multiple mechanical faults in the test set reached 88.75% in the last batch.
[0045] Correspondingly, Figure 6 The confusion matrix corresponding to the test results in the embodiment. Each column of the confusion matrix represents the true category, and the total number of each column represents the true number of data instances of that category; each row represents the predicted category of the data, and the total number of data in each row represents the number of data instances predicted to be of that category.
[0046] Figure 6 Sequence numbers 1 to 8 represent sun gear pitting, sun gear cracking, sun gear tooth breakage, and sun gear tooth loss, respectively; planet gear pitting, planet gear cracking, planet gear tooth breakage, and planet gear tooth loss, respectively. The confusion matrix shows that the fault diagnosis of each fault state in the embodiment still achieves good results under harsh conditions (-4 dB), indicating that the method of the present invention is effective.
Claims
1. A method for intelligently identifying multiple mechanical faults based on a lightweight capsule network model, the method comprising: S1. Collect one-dimensional signal sequence data collected by sensors according to specific types of mechanical faults, convert the data into images, and establish a mechanical multi-fault status database; The mechanical multi-fault state database consists of several paired time series data and health state labels; S2. Based on a mechanical multi-fault state database, dividing the mechanical multi-fault state database into a training set and a test set; Construct a feature extraction teacher model with a contrast loss function. cl Contrastive loss is an indicator that measures the feature similarity of similar samples in the same batch and the distance between the features of different samples. The feature extraction teacher model contains ResNet-18 and a primary capsule layer. The Adam optimization algorithm is used to train the model until the model converges. S3. Build a feature extraction student model that is less complex than the feature extraction teacher network model; The output of the feature extraction student model needs to be consistent with the output dimension of the feature extraction teacher model. The total loss of the feature extraction student model is loss. student is the KL divergence loss kl and contrast loss cl The KL divergence loss is an indicator that measures the knowledge distillation ability between the feature extraction teacher model and the feature extraction student model. The feature extraction student model contains LeNet-5 and the primary capsule layer. The Adam optimization algorithm is used to train the model until the model converges. S4. Freeze the weights of the feature extraction student model and add a capsule network classification module after the feature extraction student model. The feature extraction student model plus the capsule network classification module are collectively referred to as a capsule network lightweight model. The capsule network lightweight model includes a digital capsule layer and a length layer. One digital capsule layer corresponds to multiple digital capsules, and each digital capsule contains multiple neurons. The parameters between the digital capsule layer and the primary capsule layer are updated using a dynamic routing mechanism. The length layer calculates the two-norm of the corresponding digital capsule. The dimension of the weight transformation matrix between the primary capsule layer and the digital capsule layer is reduced from a×l1×b×l2 to l1×b×l2, where a is the number of capsules in the primary capsule layer, l1 is the number of neurons in each primary capsule, b is the number of digital capsules in the digital capsule layer, and l2 is the number of neurons in each digital capsule layer. The loss function of the lightweight model of the capsule network is the edge loss. margin , the Adam optimization algorithm is used to train the model until the model converges; S5. Obtain a test set of the above-mentioned mechanical multiple fault state database as input, and obtain the intelligent recognition result of the mechanical multiple fault state through the trained capsule network classification module.
2. The method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model according to claim 1, characterized in that: The loss of the feature extraction teacher model in step S2 is the contrast loss; the contrast loss function is: z i Represents the function mapping from the i-th sample in a batch to the feature extractor output, and the parameter τ is used to adjust the concentration of the output features in the feature space; for each anchor sample, there are multiple positive samples, Indicates the number of samples in a batch whose label is the same as the i-th sample label.
3. The method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model according to claim 1, characterized in that: In step S3, the total loss function of the feature extraction student model is: loss student =loss kl +loss cl ; The KL divergence loss function is: T(i) represents the probability distribution of teacher characteristics, and S(i) represents the probability distribution of student characteristics.
4. The method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model according to claim 1, characterized in that: In step S4, the edge loss function loss margin Equal to the loss corresponding to each corresponding category k margin (k) and loss margin (k) = T k max(0,m + -||v k ||2) 2 +λ(1-T k )max(0,||v k ||2-m - ) 2 , where T k =1 means the category represented by the digital capsule exists, and T k =0 means that the category represented by the digital capsule does not exist; ||v k ||2 is the bi-norm of the output of the kth capsule in the digital capsule layer, λ is a hyperparameter adjustment factor, and m + and m - Indicates upper and lower edges.
5. The method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model according to claim 1, characterized in that: The sensor in step S1 is one or both of a vibration sensor and a sound signal sensor.
6. The method for intelligently identifying multiple mechanical faults based on a capsule network lightweight model according to claim 1, characterized in that: The method for converting the data into an image in step S1 is: The direct dimensionality change is one of a grayscale image, a Grammi angle field, a Markov transition field, a recurrence graph, and a discrete-time Fourier transform.