Multi-working-condition fault diagnosis method and system based on feature similarity measurement and cross-domain equalization, medium and product
By introducing a similarity measurement module and a cross-domain equalization module into the fault diagnosis model, the diagnostic accuracy problems caused by the changes in the fault mode under different operating conditions are solved, and accurate fault diagnosis and robust adaptability improvement under different data distributions are achieved.
Patent Information
- Application Number
- CN202411890608.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In the prior art, it is difficult to achieve accurate fault diagnosis when facing changes in equipment failure modes under different operating conditions, especially in the case of unknown data distribution, and it is difficult for models based on training data to perform accurate fault diagnosis.
Using a multi-case fault diagnosis method based on feature similarity metrics and cross-domain equalization, the model's anti-domain interference capability and the extraction ability of domain invariant features are enhanced by introducing a similarity metric module and a cross-domain equalization module in the loss function.
Accurate fault diagnosis under different data distributions is realized, fault types under preset operating conditions can be identified, and faults in unknown operating conditions can be accurately identified in actual production environments, improving the robustness and adaptability of the model.
Smart Images

Figure CN119830101A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of mechanical vibration fault diagnosis, and more specifically, relates to a multi-operating condition fault diagnosis method, system, medium and product based on feature similarity measurement and cross-domain balance. Background Art
[0002] As the complexity and automation level of industrial equipment increase, the potential impact of failures is becoming increasingly severe if they are not handled in a timely manner. Failures not only hinder the normal operation of equipment, reduce production efficiency and capacity, but also easily cause product quality problems and increase the defective product rate. More seriously, some failures may cause safety issues, such as worker injuries or dangerous working environments, increasing the risk of accidents. Therefore, the use of advanced fault diagnosis technology to timely and accurately identify equipment failure modes will help improve the reliability, efficiency and safety of industrial production.
[0003] Currently, data-driven algorithms are widely used in fault diagnosis technology. Such algorithms can learn relevant knowledge based on massive historical data and can build models without precise process information. With the rapid development of Internet of Things technology and computing hardware, deep learning technology has received widespread attention and has been introduced into fault diagnosis systems. Deep learning algorithms automatically learn and extract data features through multi-layer neural networks to achieve end-to-end fault diagnosis, ensuring high-precision and high-efficiency diagnostic results.
[0004] However, in actual production, the working environment of the equipment changes all the time. Different motor speeds, workloads, etc. will change the data distribution of the equipment failure mode, causing the distribution of the collected vibration signal data to change, resulting in domain drift, which affects the diagnostic performance of the trained model in actual applications. In other words, in actual applications, failure modes with unknown data distribution may occur, and it is difficult for the model based on the training data to perform accurate fault diagnosis. Summary of the invention
[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a multi-condition fault diagnosis method, system, medium and product based on feature similarity measurement and cross-domain balance, the purpose of which is to achieve cross-domain fault diagnosis with high accuracy and adaptability to different data distributions.
[0006] To achieve the above object, according to a first aspect of the present invention, a multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance is proposed, comprising the following steps:
[0007] Model training phase:
[0008] The neural network model is trained through the training set, and the trained neural network model is used as a fault diagnosis model;
[0009] The training set includes several source domain data sets obtained under different working conditions. Each source domain data set includes multiple data. Each data includes a fault signal sample and a true label representing the corresponding fault category.
[0010] The neural network model includes a feature extraction module and a classifier. The feature extraction module is used to extract a feature vector according to the fault signal, and the classifier is used to predict the probability that the fault signal belongs to each fault category according to the feature vector.
[0011] The loss function used in training as follows:
[0012]
[0013] in, It is the loss function of the feature extraction module, which is used to measure the difference between the predicted value output by the model and the true label value; is the loss function of the similarity measurement module, which is used to make samples of the same category as close as possible to the corresponding comparison prototype of their category; is the cross-domain balancing module loss function, which is used to minimize the variance of the model’s classification error for samples in different source domains; λ1 and λ2 are weight hyperparameters; x and y are sample and true labels, respectively, and θ is a model parameter;
[0014] Model application phase:
[0015] The fault signal to be diagnosed is input into the fault diagnosis model, and the fault diagnosis model outputs the probability that it belongs to each fault category, thereby determining the fault category corresponding to the fault signal.
[0016] As a further preferred embodiment, the similarity measurement module loss function Specifically:
[0017]
[0018] in, represents all samples under category k in the training set, represents all samples in the training set except for category k; S kj is the jth sample x j Comparison prototype with category k , γ is the boundary threshold; α and β represent hyperparameters, and M represents the total number of samples.
[0019] As a further preferred method, the boundary threshold γ is determined as follows:
[0020] The comparison prototype corresponding to each fault category is preset; for each category, the sample feature vector farthest from the comparison prototype of the category is used as the category boundary sample, and the distance between the category boundary sample and the comparison prototype is used as the boundary threshold γ.
[0021] As a further preferred method, cosine similarity is used to calculate the sample x j Compared with the prototype The similarity S between kj .
[0022] As a further preferred embodiment, the cross-domain balancing module loss function Specifically:
[0023]
[0024] Where n represents the total number of source domains, represents the i-th source domain S i The cross entropy loss function of the sample, c represents the sample belonging to the source domain S i A sample of and represent the feature vector and true label value of sample c respectively, f(·) represents the predicted value output by the neural network model, Indicates all The average value of .
[0025] As a further preferred embodiment, the feature extraction module loss function Specifically:
[0026]
[0027] As a further preference, the neural network model adopts 1DResNet-18 network.
[0028] According to a second aspect of the present invention, a multi-operating condition fault diagnosis system based on feature similarity measurement and cross-domain balance is provided, comprising a processor, wherein the processor is used to execute the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance.
[0029] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance is implemented.
[0030] According to a fourth aspect of the present invention, there is provided a computer program product, comprising a computer program, which, when executed by a processor, implements the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance.
[0031] In general, the above technical solution conceived by the present invention has the following technical advantages compared with the prior art:
[0032] 1. When training the fault diagnosis model, the present invention introduces a similarity measurement module and a cross-domain equalization module in the loss function to enhance the model's classification ability against domain interference and its ability to extract domain-invariant features. When the obtained fault diagnosis model is used for diagnosis, it can not only identify the fault type under the preset working conditions, but also accurately identify the faults of unknown working conditions in the actual production environment. The present invention does not require complex preprocessing steps such as signal transformation and feature extraction on the original signal, and shows a strong adaptability to working conditions and environmental changes, which can effectively reduce labor costs and improve the level of automation and intelligence in the equipment quality inspection process.
[0033] 2. The similarity measurement module designed in the present invention constructs a category prototype for each fault category, and shortens the distance between samples of the same category under different working conditions through the designed prototype comparison loss, thereby improving the similarity between samples of the same category; the cross-domain balancing module is inspired by the invariant risk minimization theory, and by minimizing the maximum explained variance of the model under different working conditions, it achieves a balanced performance of the model under different working condition data sets and improves robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a schematic diagram of the function of the similarity measurement module according to an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the function of the cross-domain balancing module according to an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the structure of a fault diagnosis model according to an embodiment of the present invention;
[0037] Figure 4 The figure is a flow chart of a cross-operating-condition fault diagnosis method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0039] An embodiment of the present invention provides a multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balancing, comprising the following steps:
[0040] (1) Model training and testing phase:
[0041] A training set and a neural network model are pre-built. The training set includes several source domain data sets obtained under different working conditions. Each source domain data set includes multiple samples. The samples include fault signals and their corresponding fault category labels. The fault signals can be mechanical vibration signals, electrical signals, or sound wave signals, etc. This embodiment uses the vibration signal of rotating machinery. The neural network model includes a feature extraction module and a classifier. After the fault signal is input, the feature extraction module extracts the fault signal features. The classifier outputs the probability of it belonging to each fault category based on the extracted feature signal; the neural network model preferably uses a 1DResNet-18 network.
[0042] The neural network model is trained using the training set, and a similarity measurement module and a cross-domain equalization module are designed to enhance the model network's classification ability against domain interference and its ability to extract domain-invariant features during the training process; the trained neural network model is used as a fault diagnosis model.
[0043] Specifically:
[0044] (1-1) Similarity measurement module
[0045] In the training set, there are obvious distribution differences in source domain data from different working conditions, which leads to the fact that even samples belonging to the same category but coming from different source domains may still be far apart in the feature space. Therefore, the present invention designs a similarity measurement module to align the distribution of samples of the same category with different data distributions according to the similarity of sample features (e.g. Figure 1 As shown in the figure), the model learns strong generalization features suitable for data distributions in different source domains. This module combines the ideas of prototype learning and contrastive learning.
[0046] In prototype learning, each category is represented as one or more prototypes, which can be the average value, center point, or representative sample of data points. By comparing the similarity between new samples and these prototypes, they are classified into the corresponding category. k , using Euclidean distance or cosine similarity to measure the sample x and prototype O k Distance between:
[0047]
[0048] d d (Θ(x),O k )=Θ(x)·O k #(2)
[0049] Where Θ(x) represents the feature vector of sample x, and m represents the dimension of the feature vector of sample x. e and d d They represent Euclidean distance and cosine similarity respectively.
[0050] The prototype loss can be expressed as:
[0051]
[0052] Among them, loss pro represents the prototype loss of sample x, P y represents the prototype of the category to which sample x belongs, and Θ(x) represents the feature map obtained after sample x passes through the feature extraction module. This loss can make the samples of each category as close to the prototype of the category as possible, thereby achieving the purpose of reducing the distance within the category.
[0053] The core idea of contrastive learning is to bring the representations of similar samples (positive samples) closer together and push the representations of dissimilar samples (negative samples) further apart, so that the model can learn more discriminative feature representations. Three corresponding samples are selected in each training sample: anchor sample A, positive sample P, and negative sample K, forming a triplet (A, P, K). Among them, P represents a sample similar to anchor sample A, usually another sample of the same category as A, and K represents a sample dissimilar to anchor sample A, usually a sample of a different category from A. The goal of triplet loss is to make the distance (similarity) between anchor sample A and positive sample P as small as possible, and at the same time make the distance (similarity) between anchor sample A and negative sample K as large as possible. This goal is achieved through the following loss function:
[0054]
[0055] Among them, α is a predefined edge threshold to prevent the model from learning the same features of positive and negative samples. That is, if the threshold α is not set, as long as d(A,P)=d(A,K), the loss function value will be 0, and the model will be difficult to train.
[0056] The triplet considers the contrast loss from the sample level, ignoring other samples between the positive sample P and the negative sample K. These samples still contain a lot of information to guide the model, and the model performance will be affected to a certain extent. The present invention combines prototype learning, considers the contrast loss from the category level rather than the sample level, considers all difficult samples during the training process, and greatly increases the information of the samples during training, as follows:
[0057] First, a comparison prototype was designed for each category. (N is the total number of categories in the training set). For category k, during the model iteration process, each time the distance from the category is compared to the prototype The nearest sample of other categories (negative sample K), the distance from the prototype of this category The farthest sample of the same category (positive sample P) and all samples between these two samples are optimized at the same time. By optimizing formula (5), the samples of the same category in the training set can be made as close as possible to the corresponding comparison prototype of their category, the similarity between samples can be improved, and the samples of different source domains can have better intra-class closeness at the category level to obtain a better decision boundary. The loss function corresponding to the similarity measurement module is:
[0058]
[0059] in, represents all samples under fault category k in the training set, represents all samples in the training set except for category k; M represents the total number of samples; S kj For sample x j Comparison prototype with category k The similarity between them is the cosine similarity used in this embodiment, see formula (6). γ is the boundary threshold to prevent the model from learning the same features of positive and negative samples. α and β represent the hyperparameters of the positive sample pair and the negative sample pair, respectively. In this embodiment, α=2 and β=50.
[0060]
[0061] The similarity measurement module takes all difficult samples into consideration during training, but it considers the contrast loss at the category level rather than the sample level. Therefore, the calculation speed of the algorithm is slightly slower than the triplet loss, but the information that the samples can provide during training is greatly increased.
[0062] (1-2) Cross-domain balancing module
[0063] When the bearing is working, it rotates at a certain speed, and the rolling element will pass through the faulty part of the bearing at a specific time interval, generating a periodic frequency characteristic. Therefore, for each fault mode, its vibration will theoretically appear as a vibration of a specific frequency based on the operating frequency of the bearing, and the collected vibration signal should have an obvious theoretical frequency. i 、Outer ring fault f o and rolling element failure f b The theoretical failure frequencies are:
[0064]
[0065] In formulas (7) to (9), n represents the number of rolling elements included in the bearing, f represents the inner ring speed of the bearing, d represents the diameter of a single rolling element of the bearing, D represents the pitch circle diameter of a single rolling element of the bearing, and α represents the contact angle.
[0066] However, in actual operation, the bearing does not work as a separate part, but as one of the components of the mechanical equipment, it participates in the operation of the equipment. Therefore, the collected vibration signal is not only caused by the vibration of the bearing itself, but also contains a large number of signals generated by the environment. That is, the vibration signal collected by the three-dimensional vibration sensor consists of two parts: fault frequency characteristics and environmental interference characteristics.
[0067] The fault frequency characteristics of the bearing are only affected by the parameters and fault modes of the bearing, and have nothing to do with the environment and working conditions that the bearing is in. Therefore, for data sets collected under different working conditions, samples of the same category will show the same fault frequency characteristics, but the environmental interference characteristics will be different.
[0068] Inspired by the idea of invariant risk minimization, this paper proposes a cross-domain balancing module, which aims to find a predictor that achieves Bayesian optimality under all working conditions. The core idea of the cross-domain balancing module is to balance the performance of the model under different source domain data, and learn the minimum error of fault classification and the invariance under different source domain distributions, that is, to make the features extracted by the model as similar as possible to the fault frequency features, and ignore the influence of environmental interference features.
[0069] Given a data set collected under various working conditions as the training set S train ={S1,S2,S3,……,S n}, the data set collected under each working condition is called a source domain S i , each has an independent and identically distributed sample The source domain S i The sample feature vector under The source domain S i The sample labels under . Introducing the definition of invariant risk minimization, the risk of any source domain is defined as:
[0070]
[0071] In formula (10), L represents the loss function, which reflects the predicted value and the true value The difference between The source domain S i The cross-domain balancing module aims to find a mapping method so that the classification effect of the classifier is the same in the space of all source domain mappings. In statistical terms, the variance of the classification error of the model under different source domains is minimized. Therefore, the loss function corresponding to the cross-domain balancing module is for:
[0072]
[0073] in, is the source domain S in the training batch i The cross entropy loss function value of the corresponding sample, Aims to minimize the variance of the cross entropy loss values of different source domains; c represents the number of samples in the training batch belonging to the source domain S i A sample of and Represent the feature vector and true label of sample c respectively.
[0074] By minimizing The model's classification performance differences in different source domains are minimal, that is, the features extracted by the model have consistent classification performance for any known source domain, which ensures that the model focuses on domain-invariant features such as fault frequency features. Figure 2 As shown in Figure 2, the cross-domain balancing module can correct the sample distribution so that the category decision boundaries under different source domain distributions are close to the same.
[0075] (1-3) Model training and testing
[0076] Taking into account the losses of each module, such as Figure 3 As shown, for the neural network model, its overall loss function during training as follows:
[0077]
[0078] Among them, λ1 and λ2 are and The weight hyperparameters of . is the cross entropy loss function of the model in the feature extraction module, which measures and optimizes the difference between the probability distribution of the model output and the true label. Combined with formula (12), The calculation formula is:
[0079]
[0080] Specifically, the neural network model training and testing process is as follows Figure 4 As shown:
[0081] In the training phase, the N source domain data sets collected from different working conditions are first divided, and 80% of the samples are randomly selected from each source domain data set to form the training set, and the remaining 20% of the samples form the validation set. During the model training process, one of the source domain data sets is selected as the validation set of the model, and the remaining N-1 source domain data sets participate in the model training.
[0082] In the verification phase, the 20% verification set divided above is input into the final trained model, and the distance between the high-discriminative feature vector of each sample extracted by the model and the prototype corresponding to its category in the similarity measurement module is calculated. For each category, the feature vector of the sample farthest from the category prototype is used as the category boundary sample, and the distance between the boundary sample and the category prototype is used as the category boundary threshold γ, which can determine whether the sample belongs to the category.
[0083] In the testing phase, the test samples of unknown working conditions are input into the trained model to obtain the predicted category label output by the model, and the distance between the high discriminant feature vector of the sample and the prototype corresponding to its predicted label is calculated. If the distance If it is smaller than the category boundary threshold γ corresponding to the predicted label, it means that it belongs to the failure mode predicted by the model. Based on this, the effectiveness of the trained model can be judged.
[0084] The neural network model that has undergone the above training, verification and testing is used as the final fault diagnosis model.
[0085] (2) Model application stage:
[0086] The fault signal to be diagnosed under unknown working conditions is input into the fault diagnosis model, and the fault diagnosis model outputs the probability of it belonging to each fault category, thereby determining the fault category corresponding to the fault signal.
[0087] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance, characterized in that: The steps include: Model training phase: The neural network model is trained through the training set, and the trained neural network model is used as a fault diagnosis model; The training set includes several source domain data sets obtained under different working conditions. Each source domain data set includes multiple data. Each data includes a fault signal sample and a true label representing the corresponding fault category. The neural network model includes a feature extraction module and a classifier. The feature extraction module is used to extract a feature vector according to the fault signal, and the classifier is used to predict the probability that the fault signal belongs to each fault category according to the feature vector. The loss function used in training as follows: in, It is the loss function of the feature extraction module, which is used to measure the difference between the predicted value output by the model and the true label value; is the loss function of the similarity measurement module, which is used to make samples of the same category as close as possible to the corresponding comparison prototype of their category; is the cross-domain balancing module loss function, which is used to minimize the variance of the model’s classification error for samples in different source domains; λ1 and λ2 are weight hyperparameters; x and y are sample and true labels, respectively, and θ is a model parameter; Model application phase: The fault signal to be diagnosed is input into the fault diagnosis model, and the fault diagnosis model outputs the probability that it belongs to each fault category, thereby determining the fault category corresponding to the fault signal.
2. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to claim 1 is characterized in that: Similarity measurement module loss function Specifically: in, represents all samples under category k in the training set, represents all samples in the training set except for category k; S kj is the jth sample x j Comparison prototype with category k , γ is the boundary threshold; α and β represent hyperparameters, and M represents the total number of samples.
3. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to claim 1 is characterized in that: The method for determining the boundary threshold γ is: The comparison prototype corresponding to each fault category is preset; for each category, the sample feature vector farthest from the comparison prototype of the category is used as the category boundary sample, and the distance between the category boundary sample and the comparison prototype is used as the boundary threshold γ.
4. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to claim 1, characterized in that: Use cosine similarity to calculate sample x j Compared with the prototype The similarity S between kj .
5. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to claim 1, characterized in that: Cross-domain balancing module loss function Specifically: Where n represents the total number of source domains, represents the i-th source domain S i The cross entropy loss function of the sample, c represents the sample belonging to the source domain S i A sample of and represent the feature vector and true label value of sample c respectively, f(·) represents the predicted value output by the neural network model, Indicates all The average value of .
6. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to claim 1, characterized in that: Feature extraction module loss function Specifically:
7. The multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance according to any one of claims 1 to 6, characterized in that: The neural network model adopts 1DResNet-18 network.
8. A multi-operating condition fault diagnosis system based on feature similarity measurement and cross-domain balance, characterized in that: It includes a processor, which is used to execute the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance as described in any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the multi-operating condition fault diagnosis method based on feature similarity measurement and cross-domain balance as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Mechanical fault diagnosis method, device and equipment under unavailable target working condition data
CN116756483A
Industrial equipment fault diagnosis method and device based on cross-domain generalization label
CN116956048A
Variable working condition bearing fault diagnosis method based on similarity confrontation and comparative learning
CN118035766A
Cross-domain fault diagnosis method and system based on pseudo-label learning under time-varying working condition
CN119089297A
Fault diagnosis method for intra-class self-adaptive bearing under variable working conditions
WO2021243838A1
Cited By
Equipment fault diagnosis method based on causal residual learning and invariant risk minimization
CN122333119A