Small sample part domain adaptation mechanical fault diagnosis method and system and medium

By using bidirectional prototype learning and fault association adaptation of constrained feature parsing networks, the accuracy and stability issues of partial domain adaptation with small samples in mechanical fault diagnosis are solved, and fault identification is achieved under the conditions of scarce target domain samples and inconsistent label space.

CN122634409APending Publication Date: 2026-08-25SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611138987.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve stable and accurate fault identification in mechanical fault diagnosis when the target domain sample is limited and the label space is inconsistent. In particular, under conditions of distribution shifts and small sample sizes across operating conditions, equipment, or scenarios, it is difficult to effectively utilize fault features and suppress outlier interference.

Method used

A constrained feature parsing network is adopted. The prototype and anti-prototype are dynamically maintained through a bidirectional prototype learning module. Combined with the fault association adaptation module, the frequency weight matrix is ​​initialized based on the physical prior of the fault. The amplitude and phase are jointly aligned, and the network parameters are updated through a joint loss function to construct the category feature boundary and realize fault diagnosis.

Benefits of technology

Under the condition of scarce and unlabeled samples in the target domain, it significantly improves the accuracy and stability of fault diagnosis, effectively suppresses the interference of outliers in the source domain on the class boundary, and achieves fine-grained distribution alignment of shared class features under cross-operating conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122634409A_ABST
    Figure CN122634409A_ABST
Patent Text Reader

Abstract

The application discloses a small sample part domain adaptation mechanical fault diagnosis method and system and a medium, and belongs to the technical field of industrial artificial intelligence and intelligent fault diagnosis. The method comprises the following steps: for the diagnosis scene that target domain samples are scarce, unlabeled and target domain fault categories are only a subset of source domain fault categories, a constraint feature analysis network is constructed, the network comprises a bidirectional prototype learning module and a fault correlation adaptation module; by dynamically maintaining prototypes and counter-prototypes for each category, a stable category boundary is constructed by bidirectional mutual exclusion constraints to suppress outlier class interference; by introducing a learnable frequency weight matrix bound to the fault category, mechanical fault physical priors are fused, and the amplitude and phase of the shared class features of the source domain and the target domain are jointly aligned to realize fine cross-domain distribution matching. The application can significantly improve the fault diagnosis accuracy and stability under the condition that the target domain samples are limited and the label space is inconsistent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, system, and medium for small-sample partial-domain adaptive mechanical fault diagnosis, belonging to the fields of intelligent fault diagnosis of mechanical equipment and industrial artificial intelligence technology. Background Technology

[0002] Mechanical equipment is widely used in manufacturing, energy production, rail transportation, and aerospace. Key components such as bearings, gears, and rotors typically operate under high-speed, heavy-load, and variable operating conditions, making them prone to failure due to wear, fatigue impact, or abnormal lubrication. If these faults are not identified in time, they can lead to anything from degraded equipment performance and downtime for repairs to production interruptions and even safety accidents. Therefore, conducting operational status monitoring and fault diagnosis of mechanical equipment is crucial for ensuring safe equipment operation, improving maintenance efficiency, and reducing maintenance costs.

[0003] Early mechanical fault diagnosis relied primarily on manual signal analysis and expert experience. These methods typically employ signal processing techniques such as Fourier transform, empirical mode decomposition, spectral kurtosis analysis, or wavelet transform to extract features like peak value, kurtosis, root mean square (RMS), and spectral amplitude from monitoring signals. These features are then combined with manual criteria or traditional machine learning classifiers to complete fault identification. In scenarios with clear fault mechanisms and relatively stable operating conditions, these methods can achieve certain diagnostic results. However, their diagnostic performance is highly dependent on manual feature design, making it difficult to meet the demands of automated and stable diagnosis when faced with massive amounts of monitoring data and variable operating conditions in complex industrial settings.

[0004] In recent years, deep learning methods have gradually become an important technical approach for fault diagnosis of mechanical equipment due to their ability to automatically extract deep features. Models such as convolutional neural networks, residual networks, graph neural networks, and attention networks can directly learn fault representations from signals, thereby reducing manual feature design and improving the automation level of fault identification. However, these models typically assume that the training and test data follow a similar distribution. When equipment speed, load, temperature, installation status, or environmental noise changes, a distribution shift occurs between the source domain data and the target domain data, making it difficult to directly apply the diagnostic model trained on the source domain to the target domain.

[0005] To mitigate data distribution discrepancies across operating conditions, equipment, or scenarios, domain adaptation methods are increasingly being applied in fault diagnosis. These methods learn domain-invariant features between the source and target domains, enabling the model to transfer existing fault knowledge from the source domain to the target domain, thereby reducing the need for labeled samples in the target domain. Common methods include distribution alignment based on maximum mean difference, domain adaptation methods based on adversarial learning, and transfer diagnostic methods based on category prototypes or pseudo-labels.

[0006] Conventional domain adaptation typically assumes that the source and target domains have identical label spaces. However, in real-world industrial environments, the target domain often does not contain all fault categories found in the source domain. In this case, the target domain label space is a subset of the source domain label space, and outlier classes exist in the source domain that are not included in the target domain. This problem falls under the category of partial domain adaptation fault diagnosis. Existing technologies have further proposed partial domain adaptation methods to address this issue. These methods typically reduce the impact of outlier classes in the source domain on the cross-domain alignment process through class weighting, sample filtering, or selective adversarial learning. For example, selective adversarial networks estimate the transfer weights of various source domain categories based on the prediction results of target domain samples and reduce the weights of outlier classes during adversarial training; partially adversarial domain adaptation methods introduce class-level weights into the domain discriminator, making the model focus more on categories shared by the source and target domains; other methods assess the transferability of source domain samples through multi-level weighting or sample filtering strategies, thereby mitigating the impact of missing categories in the target domain.

[0007] In addition, some studies have improved partial domain adaptive diagnostic methods from the perspective of fault feature representation. For example, some methods construct dual-classifier or multi-classifier structures, learning separately for the complete source domain label space and the shared class label space, and achieving common class knowledge transfer through classifier output consistency constraints. Some methods introduce multi-scale attention mechanisms to extract fault features from time, frequency, or channel dimensions to enhance the expressive power of shared class features. Other methods utilize fault prototype or attribute attention mechanisms to weight samples according to the representative features of different fault categories, making the model focus more on fault information with higher transferability.

[0008] Most of the aforementioned methods rely on a relatively sufficient number of samples in the target domain. However, it is often difficult to obtain a large number of fault samples from industrial sites. Real-world faults occur infrequently, fault sample collection is time-consuming, and some faults cannot be artificially created for safety and production continuity considerations. Therefore, the number of samples available for model training in the target domain is often very limited, further leading to small-sample partial-domain adaptation diagnostic scenarios. While existing partial-domain adaptation methods can suppress outlier influences to some extent, most still rely on relatively sufficient target domain samples to estimate the target domain distribution. This makes it difficult to stably form shared class boundaries under small-sample conditions and to fully utilize the frequency prior information of mechanical faults themselves. Therefore, a small-sample partial-domain adaptation diagnostic method for mechanical equipment is needed that can simultaneously handle small target domain samples, source domain outlier interference, and cross-condition distribution shifts. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, system and medium for small sample partial domain adaptive mechanical fault diagnosis, which can significantly improve the accuracy and stability of fault diagnosis under the condition that the target domain sample is limited and the label space is inconsistent.

[0010] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0011] In a first aspect, the present invention provides a method for diagnosing mechanical faults with a small sample partial domain adaptation, comprising:

[0012] The monitoring signal of the mechanical equipment to be diagnosed is input into a pre-trained constraint feature parsing network. Based on the features of the monitoring signal of the mechanical equipment to be diagnosed and the distance between each type of prototype, the fault diagnosis result is output.

[0013] The training method for the constraint feature parsing network includes:

[0014] Acquire source domain monitoring signals and target domain monitoring signals, wherein the source domain monitoring signals are labeled with categories, the target domain monitoring signals are unlabeled samples, and the label space of the target domain is a subset of the label space of the source domain;

[0015] The source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples;

[0016] The source domain samples and the target domain samples are input into a constraint feature parsing network that includes a bidirectional prototype learning module and a fault association adaptation module;

[0017] The bidirectional prototype learning module extracts features from the source domain samples and the target domain samples to obtain deep features of the source domain and deep features of the target domain. It also dynamically maintains prototypes and anti-prototypes for each fault category and constructs category feature boundaries using the bidirectional mutual exclusion constraints between the prototypes and anti-prototypes.

[0018] The fault association adaptation module initializes and learns the frequency weight matrix bound to the fault category based on the fault physical prior, and performs joint distribution alignment of amplitude and phase according to the deep features of the source domain and the deep features of the target domain to obtain the aligned source domain features and target domain features.

[0019] Based on the aligned source domain features, target domain features, and category feature boundaries, a joint loss function is calculated, and the parameters of the constraint feature parsing network are updated according to the joint loss function to complete the training.

[0020] Furthermore, the source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples, including:

[0021] The following operations are performed on the source domain monitoring signal and the target domain monitoring signal respectively to generate source domain samples and target domain samples:

[0022] Slicing the signal according to a preset window length yields multiple vibration signal segments.

[0023] Each vibration signal segment is standardized using the formula. Standardization is carried out, among which, For the first A vibration signal segment, and These are the mean and standard deviation, respectively. This is a standardized vibration signal segment;

[0024] Perform a fast Fourier transform on the standardized vibration signal segment to obtain the frequency domain amplitude sequence;

[0025] The frequency domain amplitude sequence is reshaped into a fixed-size two-dimensional frequency domain source domain sample or target domain sample.

[0026] Furthermore, the dynamic maintenance of prototypes and deprototypes for each fault category includes: For the k Class fault categories, define prototypes For the first k The center vector of the fault category features defines the inverse prototype. It is a repulsive vector; During training, for the input batch data, features are aggregated by category and the cumulative mean is used to calculate the prototype cumulative value; For the anti-prototype, a hard example selection strategy is adopted to select the first... k Among the fault category features, the one closest to the current reverse prototype The features are accumulated and the reverse prototype is updated. A momentum accumulation strategy is used to smoothly update the prototype and the anti-prototype. t Round k The update formulas for the prototype and deprototype of a fault category are as follows: ; ; in, and The first t Round k Prototype and antiprototype momentum terms for fault categories; and The first t -1 round k Fault category prototype and anti-prototype momentum terms; This is the balance coefficient between historical momentum and current momentum; To update the learning rate; For the first t Roundk The prototype of the fault category; For the first t -1 round k The prototype of the fault category; For the first t Round k The reverse prototype of a fault category; For the first t -1 round k The reverse prototype of a fault category; and The first t Round k The amount of prototype update and reverse prototype update for each fault category.

[0027] Furthermore, the dynamic maintenance of prototypes and deprototypes for each fault category also includes:

[0028] Design dynamic fusion weights based on the training phase. The formula for balancing sample information between the source and target domains is as follows: ; in, Total number of training rounds; It is an exponential function.

[0029] In the early stages of training, source domain features are updated primarily, and source domain samples are used to stabilize the prototype and the anti-prototype. In the later stages of training, the weights of target domain features are gradually increased to adapt to the target domain distribution.

[0030] When the source domain is updated, the fusion formula for the prototype and the anti-prototype is:

[0031] ;

[0032] ;

[0033] In the formula, and The first and second features after fusing source domain features are respectively k The prototype and anti-prototype of a fault category; and The first k The prototype and anti-prototype of a fault category; The first sample obtained from the source domain k The prototype of the fault category, The first sample obtained from the source domain k The reverse prototype of the fault category; the dynamic fusion weights are reversed when the target domain is updated.

[0034] Furthermore, the fault association adaptation module initializes and learns a frequency weight matrix bound to the fault category based on fault physical priors, including:

[0035] Weight matrix based on fault physics priors Initialization is performed, where For feature dimension, For the real number space, For the largest category index, This represents the number of source domain fault categories, and its elements correspond to the theoretical characteristic frequencies of different fault types.

[0036] The frequency list is expanded by adding random perturbations to existing frequencies, and the formula is defined as follows:

[0037] ;

[0038] in, For random perturbations that follow a Gaussian distribution; and These represent the frequencies in the frequency list. q The and the first q -1 frequency component;

[0039] The theoretical frequencies are mapped to dimensional indices in the feature space, with the dimension corresponding to the theoretical frequency having the highest weight, and the weights of surrounding dimensions gradually decreasing. The calculation formula is as follows:

[0040] ;

[0041] in, For the first k Fault category in the first j Weights on each feature dimension Indicates the first k Fault frequency of fault category For the first k Fault frequency of fault category The corresponding dimension This is the feature dimension index during the normalization summation process.

[0042] Furthermore, the fault association adaptation module initializes and learns a frequency weight matrix bound to the fault category based on fault physical priors, and also includes:

[0043] For small-sample cross-domain scenarios, the feature representation is dynamically adjusted by encoding the differences between the target domain and the source domain conditions:

[0044] ;

[0045] in, These are features enhanced by adaptive working conditions; This represents the original features. The normalized deviation between the target domain operating conditions and the source domain operating conditions is... and These are the learnable matrix and the bias, respectively, and Sig represents the Sigmoid function.

[0046] The inner product operation is performed between the frequency weight matrix and the enhanced features to realize the correlation calculation between the features and the frequency weights of each fault type.

[0047] Furthermore, based on the deep features of the source domain and the deep features of the target domain, the amplitude and phase distributions are jointly aligned to obtain the aligned source domain features and target domain features, including:

[0048] The magnitudes of the source and target domain features are obtained through the feature function. With phase The calculation formula is: ; ; in, is the real part of the characteristic function; This represents the imaginary part of the characteristic function; This represents the matrix transpose operation. This represents the two-parameter arctangent function.

[0049] Calculate the amplitude difference between the source domain and the target domain on the amplitude component, and the phase difference between the source domain and the target domain on the phase component;

[0050] By minimizing the amplitude difference and the phase difference, the parameters of the fault association adaptation module are adjusted so that the shared class features of the source domain and the target domain tend to be consistent in amplitude and phase, thereby obtaining the aligned source domain features and target domain features.

[0051] Furthermore, the joint loss function includes a prototype classification loss function, an anti-prototype constraint loss function, an orthogonal loss function, and a distribution difference loss function, specifically including:

[0052] Prototype classification loss function Used to minimize the distance between features of similar samples and their corresponding prototypes:

[0053] ;

[0054] in, For Euclidean distance The number of samples in the source domain. The number of samples in the target domain. For the first The feature representation of each sample obtained by the feature extraction network For the first k The prototype of the fault category, For the first The class prototype is used to iterate through all categories in the denominator. For summation index, used from class 0 to class 1 Iterate through each fault category; Inverse Prototype Constraint Loss Function Used to force the current sample away from the anti-prototype of other categories: ; in, For current features Category;

[0055] Orthogonal loss function This is used to ensure that the prototype and the anti-prototype are orthogonal to each other in the feature space:

[0056] ;

[0057] Distribution difference loss function To constrain cross-domain distribution differences between shared class features in the source and target domains, the distribution difference loss function consists of magnitude difference and phase difference:

[0058] ;

[0059] In the formula, This is the amplitude-phase balance coefficient. and Source domain features and target domain features In the k Amplitude under the fault frequency weighting; and Source domain features and target domain features In the k Phase under fault frequency weighting; This indicates the operation of seeking the expected value.

[0060] Total loss function Defined as:

[0061] ;

[0062] in, and These represent the coefficients of the orthogonal loss function and the distributional difference loss function in the total loss function, respectively.

[0063] Secondly, the present invention provides a small-sample partial-domain adaptive mechanical fault diagnosis system for implementing the small-sample partial-domain adaptive mechanical fault diagnosis method described in any one of the preceding claims, comprising:

[0064] The data acquisition module is used to acquire tagged monitoring signals from the source domain and a small number of untagged monitoring signals from the target domain, and to record operating parameters and acquisition conditions.

[0065] The preprocessing module is used to slice, standardize, frequency transform, and resize the source domain monitoring signal and the target domain monitoring signal to generate a two-dimensional image suitable for input constraint feature parsing network;

[0066] The constraint feature parsing network module is used to perform deep feature parsing on the preprocessed samples. The constraint feature parsing network module internally includes:

[0067] A bidirectional prototype learning unit is used to extract deep fault features from the source and target domains and maintain prototypes and anti-prototypes for each fault category. The category boundaries are enhanced through hard case selection, momentum update and dynamic fusion weights.

[0068] The fault association adaptation unit is used to initialize and learn the frequency weight matrix based on the fault physical prior, and to perform operating condition difference enhancement and amplitude-phase distribution alignment.

[0069] The fault classification unit is used to calculate the fault category probability based on the distance between the target domain sample features and each shared class prototype.

[0070] The joint training optimization module is used to jointly train and update the parameters of the constraint feature parsing network based on the total loss function composed of the prototype classification loss function, the anti-prototype constraint loss function, the orthogonal loss function and the distribution difference loss function.

[0071] The fault classification output module is used to input the monitoring signal of the mechanical equipment to be diagnosed into the trained constraint feature parsing network, calculate the fault category probability based on the distance between the feature and the prototype of each category, and output the health status, fault type, fault category probability and alarm information of the target equipment.

[0072] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0073] Fourthly, the present invention provides an electronic device, comprising:

[0074] Memory, used to store computer programs / instructions;

[0075] A processor for executing the computer program / instructions to implement the steps of any of the methods described above.

[0076] Fifthly, the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.

[0077] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0078] 1. This invention provides a method, system, and medium for small-sample partial-domain adaptive mechanical fault diagnosis. By acquiring labeled monitoring signals from the source domain and unlabeled monitoring signals from the target domain, and inputting the preprocessed signals into a constraint feature parsing network, the bidirectional prototype learning module is used to extract features from the source and target domain samples and dynamically maintain prototypes and anti-prototypes for each fault category. The category feature boundary is constructed by a bidirectional constraint method in which similar features cluster towards the prototype and dissimilar features are far away from the corresponding category region. This achieves enhanced compactness and distinguishability of shared class features under the condition that the target domain samples are scarce and unlabeled, and effectively suppresses the interference of outliers in the source domain on the formation of category boundaries.

[0079] 2. This invention initializes and learns the frequency weight matrix bound to the fault category based on the fault physical prior through the fault association adaptation module, so that the network focuses on the fault-sensitive frequency band and performs joint distribution alignment of amplitude and phase of deep features in the source domain and target domain. This achieves fine distribution alignment of shared fault features under cross-operating conditions and effectively reduces the negative transfer caused by outliers in the source domain.

[0080] 3. This invention completes training by calculating the joint loss function and updating the network parameters, and finally outputs the diagnostic results based on the distance between the features of the signal to be diagnosed and the prototypes of each category. Thus, under the conditions of limited target domain samples, no labels, and the label space being only a subset of the source domain, it achieves a significant improvement in the accuracy and stability of small-sample partial domain adaptive mechanical fault diagnosis. Attached Figure Description

[0081] Figure 1 This is a flowchart of the small-sample partial-domain adaptive mechanical fault diagnosis method provided in an embodiment of the present invention;

[0082] Figure 2 This is a block diagram of the constraint feature parsing network structure provided in an embodiment of the present invention;

[0083] Figure 3 This is a schematic diagram of the confusion matrix of different methods provided in the embodiments of the present invention on the wheelset bearing dataset diagnostic task C6;

[0084] Figure 4 This is a schematic diagram of the confusion matrix of different methods provided in the embodiments of the present invention on the flywheel bearing dataset diagnostic task T12;

[0085] Figure 5 This is a schematic diagram of the feature visualization results of different methods provided in the embodiments of the present invention on the wheelset bearing dataset diagnostic task C6. Detailed Implementation

[0086] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0087] Example 1, as Figure 1 As shown in the figure, this embodiment introduces a small-sample partial-domain adaptive mechanical fault diagnosis method, including:

[0088] The monitoring signal of the mechanical equipment to be diagnosed is input into a pre-trained constraint feature parsing network. Based on the features of the monitoring signal of the mechanical equipment to be diagnosed and the distance between each type of prototype, the fault diagnosis result is output.

[0089] The training method for the constraint feature parsing network includes:

[0090] Acquire source domain monitoring signals and target domain monitoring signals, wherein the source domain monitoring signals are labeled with categories, the target domain monitoring signals are unlabeled samples, and the label space of the target domain is a subset of the label space of the source domain;

[0091] The source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples;

[0092] The source domain samples and the target domain samples are input into a constraint feature parsing network that includes a bidirectional prototype learning module and a fault association adaptation module;

[0093] The bidirectional prototype learning module extracts features from the source domain samples and the target domain samples to obtain deep features of the source domain and deep features of the target domain. It also dynamically maintains prototypes and anti-prototypes for each fault category and constructs category feature boundaries using the bidirectional mutual exclusion constraints between the prototypes and anti-prototypes.

[0094] The fault association adaptation module initializes and learns the frequency weight matrix bound to the fault category based on the fault physical prior, and performs joint distribution alignment of amplitude and phase according to the deep features of the source domain and the deep features of the target domain to obtain the aligned source domain features and target domain features.

[0095] Based on the aligned source domain features, target domain features, and category feature boundaries, a joint loss function is calculated, and the parameters of the constraint feature parsing network are updated according to the joint loss function to complete the training.

[0096] The small-sample partial-domain adaptive mechanical fault diagnosis method provided in this embodiment involves the following steps in its application process:

[0097] S1. Obtain source domain monitoring signals and target domain monitoring signals, wherein the source domain monitoring signals are labeled with categories, the target domain monitoring signals are unlabeled samples, and the label space of the target domain is a subset of the label space of the source domain.

[0098] Monitoring signals are collected under different operating conditions, including different mechanical equipment, different speeds, different loads, different temperatures, or different operating environments, to construct a source domain dataset and a target domain dataset. The source and target domains originate from different operating conditions. The source domain dataset includes a large number of samples and their class labels, while the target domain dataset includes a small number of unlabeled samples. The source domain label space contains multiple fault types, and the target domain label space is a subset of the source domain label space. The true label space of the target domain is unknown and needs to be estimated using the predicted probability and the probability of class existence in the target domain. The problem of small-sample partial-domain adaptive fault diagnosis is defined as follows: Given a source domain… Include Each source domain sample and its corresponding label, among which For source domain monitoring samples, The category label corresponding to the source domain sample. Number of samples in the source domain; number of samples in the target domain. Contains n t There are 10 unlabeled samples, among which For unlabeled samples in the target domain, The target domain sample size is [value]. The source domain label space is [value]. , covering Fault type, label space of the target domain A subset of the source domain, i.e. Therefore, the tag space of the source domain can be divided into two parts: one is the shared class tag space common to both domains. The other is the outlier class label space that belongs only to the source domain. Furthermore, the characteristic distribution of the source domain and the feature distribution of the target domain There are differences, and the target domain can only provide a small amount of data to support model training. .

[0099] S2. The source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples.

[0100] S21, Signal Slicing;

[0101] The continuously monitored signal is sliced ​​according to a preset window length L to obtain multiple signal segments. Adjacent signal segments can be non-overlapping or can slide slices according to a preset overlap rate. For example, the window length L is 2048 sampling points, and the overlap rate is 0% to 50%.

[0102] S22, Standardization Processing;

[0103] Each signal segment is standardized using... Standardization is carried out, among which, For the first A vibration signal segment, and These are the mean and standard deviation, respectively. This is a standardized vibration signal segment.

[0104] S23, Frequency domain transformation;

[0105] Perform Fast Fourier Transform on the standardized signal segment ,in, For Fast Fourier Transform, It is a frequency domain amplitude sequence.

[0106] Specifically, a 2048-point Fast Fourier Transform is performed on a signal segment of length 2048, and the first 1024 single-sided spectral amplitudes are extracted.

[0107] S24, Frequency Domain Sample Reshaping;

[0108] Reconstruct the frequency domain amplitude sequence into a fixed-size two-dimensional source or target domain sample in the frequency domain: .in, and For the image height and width, To reshape the operator.

[0109] Specifically, the 1024-dimensional single-sided spectral amplitude can be reconstructed into a 32×32 two-dimensional image according to frequency order. If the spectral length is greater than... × If the frequency spectrum length is less than 1, then downsampling is performed; if the frequency spectrum length is less than 1, then × If so, then interpolation will be performed to complete the result.

[0110] S3. Input the source domain samples and the target domain samples into a constraint feature parsing network that includes a bidirectional prototype learning module and a fault association adaptation module.

[0111] like Figure 1As shown, the constrained feature parsing network mainly includes a bidirectional prototype learning module, a fault association adaptation module, and a fault classification module. The bidirectional prototype learning module takes deep features obtained from processing two-dimensional images by a feature extractor as input. It balances prior knowledge from the source domain with small sample information from the target domain by dynamically maintaining bidirectional mutual exclusion constraints between prototypes and anti-prototypes, combined with momentum accumulation updates and dynamic weight fusion strategies during the training phase. The fault association adaptation module introduces learnable frequency weights bound to fault categories and achieves joint alignment of amplitude and phase of shared class features between the source and target domains based on feature function distribution matching. The fault classification module calculates the probability that a sample in the target domain belongs to each fault category based on the distance between the sample features and the prototypes of each category, and outputs the fault diagnosis result.

[0112] S31, Two-way prototype learning module;

[0113] The bidirectional prototype learning module extracts features from the source domain samples and the target domain samples to obtain deep features of the source domain and deep features of the target domain. It also dynamically maintains prototypes and anti-prototypes for each fault category and constructs category feature boundaries using the bidirectional mutual exclusion constraints between the prototypes and anti-prototypes.

[0114] For the k-th fault category, define a prototype. Let the center vector of the k-th fault category feature be the inverse prototype. This is a repulsive vector that prevents features from other classes from approaching the prototype region of class k. Initially, both the prototype and anti-prototype are set to zero. During training, for each batch of input data, the prototype aggregates features by class and accumulates the mean. The feature set of class k. Then the prototype accumulated value Defined as:

[0115] ;

[0116] In the formula, It is the first The feature representation of a sample obtained by a feature extraction network; It is the first The category label of each sample.

[0117] Specifically, the anti-prototype aims to capture confusing out-of-class features to enhance the repulsion effect. Therefore, a hard-example selection strategy is employed to calculate the cumulative value of the anti-prototype. For the feature set of non-class k, the following is given: Through calculation Features and current anti-prototype The distance is used to select the closest previous prototype. The features are accumulated and calculated, and the update formula is:

[0118] ;

[0119] In the formula, for Zhongyu The first with the smallest distance One characteristic, This is the cumulative value of the reverse prototype of the k-th fault category, which is obtained by selecting the hardest example features closest to the current reverse prototype from the features of non-k-th fault categories and summing them. Simultaneously, the cumulative features are mean-calculated and normalized to reduce the impact of feature scale differences.

[0120] To avoid fluctuations caused by batch training, a momentum accumulation strategy is used between the prototype and anti-prototype to smooth the update process. The prototype update amount in round t is... ,in, This is the normalized prototype. The update formulas for the momentum term, prototype, and anti-prototype are:

[0121] ;

[0122] ;

[0123] In the formula, and The first t Round k Prototype and antiprototype momentum terms for fault categories; and The first t -1 round k Fault category prototype and anti-prototype momentum terms; This is the balance coefficient between historical momentum and current momentum; To update the learning rate; For the first t Round k The prototype of the fault category; For the first t -1 round k The prototype of the fault category; For the first t Round k The reverse prototype of a fault category; For the first t -1 round k The reverse prototype of a fault category; and The first t Round k The amount of prototype update and reverse prototype update for each fault category.

[0124] Furthermore, due to the scarcity of samples in the target domain, relying on them to update the prototype can easily lead to a bias between the prototype and the anti-prototype. Therefore, a dynamic fusion weight based on the training phase is designed. To balance the small sample information of the source and target domains, the calculation formula is as follows: ; in, Total number of training rounds; It is an exponential function.

[0125] In the early stages of training , Values ​​close to 0 are used for updating primarily based on source domain features, stabilizing the prototype and anti-prototype using sufficient samples. (Later stages of training) Approaching 1, The value is also close to 1, gradually increasing the weight of the target domain features to adapt to the target domain distribution. When updating the source domain, the fusion formula for the prototype and anti-prototype is:

[0126] ;

[0127] ;

[0128] In the formula, and The first and second features after fusing source domain features are respectively k The prototype and anti-prototype of a fault category; and The first k The prototype and anti-prototype of a fault category; The first sample obtained from the source domain k The prototype of the fault category, The first sample obtained from the source domain k The reverse prototype of the fault category. The weights are reversed when the target domain is updated.

[0129] S32, Fault Association Adaptation Module;

[0130] The fault association adaptation module initializes and learns the frequency weight matrix bound to the fault category based on the fault physical prior, and performs joint distribution alignment of amplitude and phase according to the deep features of the source domain and the deep features of the target domain to obtain the aligned source domain features and target domain features.

[0131] Based on physical priors on the weight matrix Initialization is performed, and its elements correspond to the theoretical characteristic frequencies of different fault types, where For feature dimension, For the real number space, For the largest category index, This represents the number of source domain fault categories. The frequency list is expanded by adding random perturbations to existing frequencies; the formula is defined as:

[0132] ;

[0133] In the formula, To obey random perturbations distributed in a Gaussian manner; and These represent the frequencies in the frequency list. q The and the first q -1 frequency component. The theoretical frequency is mapped to the dimension index of the feature space. A weight vector is initialized for each fault type, with the dimension corresponding to the theoretical frequency having the highest weight, and the weights of surrounding dimensions gradually decreasing. The calculation formula is as follows:

[0134] ;

[0135] in, For the first k Fault category in the first j Weights on each feature dimension Indicates the first k Fault frequency of fault category For the first k Fault frequency of fault category The corresponding dimension This is the feature dimension index during the normalization summation process.

[0136] For small-sample cross-domain scenarios, a specific feature enhancement mechanism is designed. By encoding the differences between the target domain and the source domain, the feature representation is dynamically adjusted as follows:

[0137] ;

[0138] In the formula, These are features enhanced by adaptive working conditions; This represents the original features. The normalized deviation between the target domain operating conditions and the source domain operating conditions; and These are the learnable matrix and the bias, respectively; Sig represents the Sigmoid function.

[0139] The inner product operation is performed between the frequency weight matrix and the enhanced features to realize the correlation calculation between the features and the frequency weights of each fault type, and the amplitudes of the source and target domain features are obtained through the feature function. With phase The calculation formula is: ; ; in, is the real part of the characteristic function; This represents the imaginary part of the characteristic function; This represents the matrix transpose operation. This represents the two-parameter arctangent function.

[0140] Calculate the amplitude difference between the source domain and the target domain on the amplitude component, and the phase difference between the source domain and the target domain on the phase component;

[0141] By minimizing the amplitude difference and the phase difference, the parameters of the fault association adaptation module are adjusted so that the shared class features of the source domain and the target domain tend to be consistent in amplitude and phase, thereby obtaining the aligned source domain features and target domain features.

[0142] S4. Calculate the joint loss function based on the aligned source domain features, the target domain features, and the bidirectional mutual exclusion constraint between the prototype and the anti-prototype, and update the parameters of the constraint feature parsing network according to the joint loss function to complete network training.

[0143] The training loss of the constrained feature parsing network includes a prototype classification loss function, an anti-prototype constraint loss function, an orthogonality loss function, and a distribution difference loss function. Through the constraints of multiple loss terms, the model is guided to learn feature representations that possess both discriminative and domain-invariant properties. The weighted sum of these losses yields the total loss function, which is then used to update the parameters in the bidirectional prototype learning module, the fault association adaptation module, and the fault classification module through backpropagation.

[0144] S41, Prototype classification loss function;

[0145] To minimize the distance between the features of similar samples and their corresponding prototypes, and to guide similar samples to cluster tightly in the feature space, a prototype classification loss function is defined. for:

[0146] ;

[0147] In the formula, distance Defined as Euclidean distance. The number of samples in the source domain. The number of samples in the target domain. For the first The feature representation of each sample obtained by the feature extraction network For the first k The prototype of the fault category, For the first The class prototype is used to iterate through all categories in the denominator. For summation index, used from class 0 to class 1 The fault categories are traversed one by one.

[0148] S42, Inverse Prototype Constraint Loss Function;

[0149] To force the current sample away from the anti-prototypes of other classes and avoid confusion between features of different classes in the feature space, an anti-prototype constraint loss function is defined. for:

[0150] ;

[0151] In the formula, For current features Category to which it belongs.

[0152] S43, Orthogonal loss function;

[0153] To ensure that the prototype and anti-prototype are orthogonal in the feature space, the orthogonality loss function is defined by minimizing the cosine similarity between the prototype and anti-prototype to force them to separate their directions and enhance discriminative power. for:

[0154] ;

[0155] S44, Distribution Dissimilarity Loss Function;

[0156] To constrain cross-domain distribution differences among shared class features between the source and target domains, the distribution difference loss function consists of magnitude difference and phase difference. The distribution difference loss function is defined as follows: for:

[0157] ;

[0158] In the formula, This is the amplitude-phase balance coefficient. and Source domain features and target domain features In the k Amplitude under the frequency weight of fault category; and Source domain features and target domain features In the k Phase under fault frequency weighting; This indicates the operation of seeking the expected value.

[0159] Total loss function Defined as:

[0160] ;

[0161] In the formula, and These represent the coefficients of the orthogonal loss function and the distributional difference loss function in the total loss function, respectively.

[0162] S5. Input the monitoring signal of the mechanical equipment to be diagnosed into the trained constraint feature parsing network, and output the fault diagnosis result based on the feature of the monitoring signal of the mechanical equipment to be diagnosed and the distance between the prototypes of each category.

[0163] After the model training is completed, the preprocessed target domain monitoring signal to be diagnosed is input into the constraint feature parsing network to calculate the distance between the target domain sample features and each shared class prototype, and the fault category probability is obtained based on the distance. Finally, the category with the highest probability is taken as the fault diagnosis result of the mechanical equipment in the target domain, and the health status, fault type, category probability and alarm information of the target equipment are output.

[0164] The following description, in conjunction with a preferred embodiment, illustrates the content involved in the above embodiments.

[0165] This embodiment takes bearing fault diagnosis as the application object, and uses wheelset bearing dataset and flywheel bearing dataset to verify the diagnostic effect of the present invention in a small sample partial domain adaptation scenario.

[0166] (1) A wheelset bearing test bench was used to collect wheelset bearing data. The wheelset bearing test bench contained two sets of wheelsets: one set with a diameter of 280 mm to simulate track support; and the other set with a diameter of 200 mm to simulate train wheels. An NJ208E test bearing was installed on one side of the smaller wheelset, and an acceleration sensor was deployed on the bearing to collect vibration data at a sampling frequency of 32768 Hz. By setting different degrees of defects on the rolling surface of the bearing, vibration signals under normal conditions, inner ring faults, outer ring faults, and rolling element faults were obtained.

[0167] (2) A flywheel bearing test bench was used to collect flywheel bearing data. The main structure of the flywheel bearing test bench includes a flywheel, a drive motor, a vibration sensor, and a test bearing. The bearing model used in this experiment was 6203DDU NSK. Faults were set on the bearing using wire cutting technology, with faults of different sizes set on the inner ring, outer ring, and rollers of the bearing. The experimental data were collected at a sampling frequency of 10 kHz.

[0168] These two datasets cover four bearing health states: normal (H), inner ring failure (IF), rolling element failure (BF), and outer ring failure (OF). Faults are grouped according to three fault diameters of 0.2 mm, 0.3 mm, and 0.4 mm, and labeled as categories 0 to 9, resulting in 10 different health states.

[0169] In this embodiment, 12 partial domain adaptation tasks were designed to simulate different small-sample partial domain adaptation diagnostic scenarios. For example, in this embodiment, the source domain and target domain were set to different speed conditions. For instance, the wheelset bearing dataset was set to a cross-condition migration task between 400 rpm, 600 rpm, and 800 rpm; the flywheel bearing dataset was set to a cross-condition migration task between 600 rpm, 800 rpm, and 1000 rpm. The source domain contained categories labeled 0 to 9, and the target domain contained only a subset of the categories in the source domain label space. Each category in the source domain contained 100 samples for training, and each category in the target domain contained 100 samples, of which 8 samples were used for training and the remaining 92 samples were used for testing.

[0170] The constrained feature parsing network uses either a stochastic gradient descent optimizer or an Adam optimizer for parameter updates. When using a stochastic gradient descent optimizer, the momentum is set to 0.9, and the weight decay is set to... The initial learning rate can be set to 0.001 to 0.01, the batch size can be set to 32 or 64, and the total number of training epochs can be set to 100 to 300.

[0171] In this embodiment, the input signal segment length is set to 2048 sampling points. After Fast Fourier Transform, the 1024-dimensional single-sided spectral amplitude is extracted and reconstructed into a 32×32 two-dimensional image. τ is set to 5, the prototype momentum coefficient ρ is set to 0.5, the prototype update learning rate η is set to 0.05, and the amplitude-phase balance coefficient ξ is set to 0.5. and Set them to 0.5 and 0.5 respectively. The above parameters can be adjusted according to different equipment types, sampling frequencies, operating conditions, and sample sizes.

[0172] To reduce experimental randomness, each diagnostic task was run independently five times, and the average of the multiple trials was used for result analysis. To ensure fairness in comparison, different methods used the same input preprocessing method, training sample partitioning method, and basic feature extraction structure.

[0173] The partial domain adaptive diagnostic task settings for the wheelset bearing dataset and the flywheel bearing dataset are shown in Table 1 and Table 2, respectively.

[0174] Table 1. Partial Domain Adaptive Diagnostic Task Settings for Wheelset Bearing Dataset

[0175]

[0176] Table 2. Partial Domain Adaptive Diagnostic Task Settings for Flywheel Bearing Dataset

[0177]

[0178] To verify the effectiveness of the method of this invention, two standard domain adaptation methods, Domain-Adversarial Neural Network (DANN) and Maximum Mean Discrepancy-based Domain Adaptation (MMD-DA), as well as three partial domain adaptation methods, Selective Adversarial Network (SAN), Importance Weighted Adversarial Network (IWAN), and Maximum Likelihood Weight Estimation (MLWE), were used as comparison methods.

[0179] 1) DANN includes a feature extractor, a classifier, and a domain discriminator, and uses adversarial training to extract domain-invariant features.

[0180] 2) MMD-DA is widely used in cross-domain scenarios. It achieves feature distribution alignment by embedding a loss function based on the maximum mean difference in deep networks, thereby effectively reducing domain offset.

[0181] 3) SAN introduces a class-level weighting mechanism in the domain discriminator to reduce the interference of outliers. Through multiple discriminator structures, it achieves refined distribution alignment between the two domains.

[0182] 4) IWAN designs two domain discriminators: one is used to quantify the importance weight of source domain samples to the target domain, and the other is used to optimize feature extraction.

[0183] 5) MLWE calculates the weight function using the maximum likelihood estimation method, and achieves the distribution alignment of the two domains in the shared class label space.

[0184] For diagnostic tasks on wheelset bearing datasets and flywheel bearing datasets, the average accuracy and standard deviation of the proposed method and the comparative method are shown in Tables 3 and 4, respectively.

[0185] Table 3. Diagnostic accuracy of different methods in wheelset bearing dataset diagnostic tasks (unit: %)

[0186]

[0187] Table 4. Diagnostic accuracy of different methods in the flywheel bearing dataset diagnostic task (unit: %)

[0188]

[0189] Standard domain adaptation methods like DANN and MMD-DA improve cross-domain diagnostic accuracy through feature distribution alignment. However, these methods have significant limitations when dealing with outliers, particularly evident in task C2. On the wheelset bearing dataset, the accuracy of DANN and MMD-DA decreased by 44.74% and 28.39%, respectively, compared to the method presented in this invention. This indicates that global distribution alignment struggles to handle outliers and lacks generalization ability in small-sample partial domain adaptation scenarios. Furthermore, in tasks C11 and C12 where the target domain contains only two shared classes, the standard deviations of DANN and MMD-DA are high, and the coupling effect of outliers and small samples leads to highly unstable predictions.

[0190] Furthermore, some domain adaptation methods targeting outlier interference, including SAN, IWAN, and MLWE, achieved average diagnostic accuracies of 68.07%, 83.50%, and 63.85%, respectively, on the flywheel dataset. These methods still suffer from negative transfer due to feature confusion caused by their difficulty in capturing discriminative and domain-invariant features under complex distribution shifts. Moreover, taking SAN as an example, its average diagnostic accuracy differed by 15.10% between the two datasets, indicating poor performance stability. These experimental results demonstrate that simply suppressing outlier interference is insufficient to effectively alleviate the problems of unstable feature representation and unreliable outlier identification under small sample conditions in the target domain.

[0191] The method of this invention achieved the highest average diagnostic accuracy on both datasets, at 98.34% and 93.98%, respectively. In task T11, it still outperformed the second-best method, SAN, by 16.57%, fully validating its adaptability to small sample sizes and various operating conditions. The standard deviation of the method of this invention is also smaller than that of the comparative method, demonstrating superior stability. For example, in the wheelset bearing dataset, the standard deviation of the method of this invention was below 1.0 for most tasks, while the comparative method showed significant fluctuations, indicating its stronger resistance to data distribution fluctuations and sample randomness.

[0192] To visually reflect the classification effectiveness of each type of fault diagnosis, the confusion matrices of the comparison methods on Task C6 and Task T12 are as follows: Figure 3 and Figure 4 As shown, in Task C6, the shared classes of DANN and MMD-DA were misclassified as outliers in the source domain. Although SAN, IWAN, and MLWE further considered outliers, significant misclassification still occurred due to the influence of small samples in the target domain, even resulting in negative transfer. For Task T12, the confusion matrix of the method in this invention shows that its misclassification rate for shared classes is also much lower than that of the comparative methods, reducing the classification ambiguity caused by the coupling effect of small samples and outliers.

[0193] The last layer features of task C6 are visualized using t-distributed stochastic neighbor embedding (t-SNE) to more intuitively highlight the clustering effect of the proposed method. The results are as follows: Figure 5 As shown in the figure, the feature visualization results based on t-SNE dimensionality reduction show that in task C6, the shared class features extracted by the method of this invention exhibit a highly compact clustering effect, clustering in five independent and clearly defined regions. Outlier feature points are significantly excluded from the shared class clustering regions, with no overlap. In contrast, the feature visualization results of standard domain adaptation methods such as DANN show overlap between shared and outlier feature points, and the model cannot effectively distinguish between shared and outlier classes. The target domain feature points of IWAN deviate from the cluster center, and some even fall into the outlier feature region. The feature distribution of MLWE is more dispersed, with blurred boundaries with outlier features. Compared to all the comparison methods, the inter-class distance of the shared class feature clustering region feature space of the method of this invention is significantly larger, while the intra-class distance is greatly reduced.

[0194] This embodiment has the following beneficial effects:

[0195] First, this embodiment constructs prototypes and anti-prototypes simultaneously through bidirectional prototype learning, causing similar fault features to cluster towards the prototype and keeping easily confused heterogeneous features away from the corresponding category region, thereby enhancing the compactness and distinguishability of category features under small sample conditions.

[0196] Second, this embodiment can stably update the class representation when the target domain samples are scarce by selecting difficult examples, accumulating momentum updates and dynamically fusing weights, and balance the sufficient sample information in the source domain and the small sample information in the target domain during the training process, thereby reducing small sample fluctuations and outlier class interference.

[0197] Third, this embodiment introduces learnable frequency weights bound to fault categories through the fault association adaptation module, aligning and combining physical priors such as fault theoretical frequencies with deep features, making the model pay more attention to fault-sensitive frequency bands and improving the accuracy of fault feature alignment across operating conditions.

[0198] Fourth, this embodiment performs amplitude and phase joint distribution alignment on the shared class features of the source and target domains, which can more finely characterize the distribution differences between the two domains and reduce the negative transfer caused by outliers in the source domain.

[0199] Example 2: This example provides a small-sample partial-domain adaptive mechanical fault diagnosis system, including:

[0200] The data acquisition module is used to acquire tagged monitoring signals from the source domain and a small number of untagged monitoring signals from the target domain, and to record operating parameters and acquisition conditions.

[0201] The preprocessing module is used to slice, standardize, frequency transform, and resize the source domain monitoring signal and the target domain monitoring signal to generate a two-dimensional image suitable for input constraint feature parsing network;

[0202] The constraint feature parsing network module is used to perform deep feature parsing on the preprocessed samples. The constraint feature parsing network module internally includes:

[0203] A bidirectional prototype learning unit is used to extract deep fault features from the source and target domains and maintain prototypes and anti-prototypes for each fault category. The category boundaries are enhanced through hard case selection, momentum update and dynamic fusion weights.

[0204] The fault association adaptation unit is used to initialize and learn the frequency weight matrix based on the fault physical prior, and to perform operating condition difference enhancement and amplitude-phase distribution alignment.

[0205] The fault classification unit is used to calculate the fault category probability based on the distance between the target domain sample features and each shared class prototype.

[0206] The joint training optimization module is used to jointly train and update the parameters of the constraint feature parsing network based on the total loss function composed of the prototype classification loss function, the anti-prototype constraint loss function, the orthogonal loss function and the distribution difference loss function.

[0207] The fault classification output module is used to input the monitoring signal of the mechanical equipment to be diagnosed into the trained constraint feature parsing network, calculate the fault category probability based on the distance between the feature and the prototype of each category, and output the health status, fault type, fault category probability and alarm information of the target equipment.

[0208] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.

[0209] Example 3: This example provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described in Example 1.

[0210] Example 4: This example provides an electronic device, including:

[0211] Memory, used to store computer programs / instructions;

[0212] A processor for executing the computer program / instructions to implement the steps of any of the methods described in Embodiment 1.

[0213] Example 5: This example provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described in any one of Examples 1.

[0214] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

[0215] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0216] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0217] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0218] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0219] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims.

Claims

1. A method for diagnosing mechanical faults with a small sample partial domain adaptation, characterized in that, include: The monitoring signal of the mechanical equipment to be diagnosed is input into a pre-trained constraint feature parsing network. Based on the features of the monitoring signal of the mechanical equipment to be diagnosed and the distance between each type of prototype, the fault diagnosis result is output. The training method for the constraint feature parsing network includes: Acquire source domain monitoring signals and target domain monitoring signals, wherein the source domain monitoring signals are labeled with categories, the target domain monitoring signals are unlabeled samples, and the label space of the target domain is a subset of the label space of the source domain; The source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples; The source domain samples and the target domain samples are input into a constraint feature parsing network that includes a bidirectional prototype learning module and a fault association adaptation module; The bidirectional prototype learning module extracts features from the source domain samples and the target domain samples to obtain deep features of the source domain and deep features of the target domain. It also dynamically maintains prototypes and anti-prototypes for each fault category and constructs category feature boundaries using the bidirectional mutual exclusion constraints between the prototypes and anti-prototypes. The fault association adaptation module initializes and learns the frequency weight matrix bound to the fault category based on the fault physical prior, and performs joint distribution alignment of amplitude and phase according to the deep features of the source domain and the deep features of the target domain to obtain the aligned source domain features and target domain features. Based on the aligned source domain features and target domain features, as well as the category feature boundary, a joint loss function is calculated, and the parameters of the constrained feature parsing network are updated according to the joint loss function to complete the training.

2. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 1, characterized in that, The source domain monitoring signal and the target domain monitoring signal are preprocessed respectively to generate source domain samples and target domain samples, including: The source domain monitoring signal and the target domain monitoring signal are sliced ​​according to a preset window length to obtain multiple vibration signal segments; Each vibration signal segment is standardized using the formula. Standardization is carried out, among which, For the first A vibration signal segment, and These are the mean and standard deviation, respectively. This is a standardized vibration signal segment; Perform a fast Fourier transform on the standardized vibration signal segment to obtain the frequency domain amplitude sequence; The frequency domain amplitude sequence is reshaped into a fixed-size two-dimensional frequency domain source domain sample or target domain sample.

3. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 1, characterized in that, The dynamic maintenance of prototypes and deprototypes for each fault category includes: For the k Class fault categories, define prototypes For the first k The center vector of the fault category features defines the inverse prototype. It is a repulsive vector; During training, for the input batch data, features are aggregated by category and the cumulative mean is used to calculate the prototype cumulative value; For the anti-prototype, a hard example selection strategy is adopted to select the first... k Among the fault category features, the one closest to the current reverse prototype The features are accumulated and the reverse prototype is updated. A momentum accumulation strategy is used to smoothly update the prototype and the anti-prototype. t Round k The update formulas for the prototype and deprototype of a fault category are as follows: ; ; in, and The first t Round k The prototype and anti-prototype momentum terms of the fault category; and The first t -1 round k Fault category prototype and anti-prototype momentum terms; This is the balance coefficient between historical momentum and current momentum; To update the learning rate; For the first t Round k The prototype of the fault category; For the first t -1 round k The prototype of the fault category; For the first t Round k The reverse prototype of a fault category; For the first t -1 round k The reverse prototype of a fault category; and The first t Round k The amount of prototype update and reverse prototype update for each fault category.

4. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 3, characterized in that, The method of dynamically maintaining prototypes and deprototypes for each fault category also includes: Design dynamic fusion weights based on the training phase. The formula for balancing sample information between the source and target domains is as follows: ; in, Total number of training rounds; It is an exponential function; In the early stages of training, source domain features are updated primarily, and source domain samples are used to stabilize the prototype and the anti-prototype. In the later stages of training, the weights of target domain features are gradually increased to adapt to the target domain distribution. When the source domain is updated, the fusion formula for the prototype and the anti-prototype is: ; ; In the formula, and The first and second features after fusing source domain features are respectively k The prototype and anti-prototype of a fault category; and The first k The prototype and anti-prototype of a fault category; The first sample obtained from the source domain k The prototype of the fault category, The first sample obtained from the source domain k The reverse prototype of the fault category; the dynamic fusion weights are reversed when the target domain is updated.

5. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 1, characterized in that, The fault association adaptation module initializes and learns a frequency weight matrix bound to the fault category based on fault physical priors, including: Weight matrix based on fault physics priors Initialization is performed, where For feature dimension, For the real number space, For the largest category index, This represents the number of source domain fault categories, and its elements correspond to the theoretical characteristic frequencies of different fault types. The frequency list is expanded by adding random perturbations to existing frequencies, and the formula is defined as follows: ; in, For random perturbations that follow a Gaussian distribution; and These represent the frequencies in the frequency list. q The and the first q -1 frequency component; The theoretical frequencies are mapped to dimensional indices in the feature space, with the dimension corresponding to the theoretical frequency having the highest weight, and the weights of surrounding dimensions gradually decreasing. The calculation formula is as follows: ; in, For the first k Fault category in the first j Weights on each feature dimension Indicates the first k Fault frequency of fault category For the first k Fault frequency of fault category The corresponding dimension This is the feature dimension index during the normalization summation process.

6. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 5, characterized in that, The fault association adaptation module initializes and learns a frequency weight matrix bound to the fault category based on fault physical priors, and also includes: For small-sample cross-domain scenarios, the feature representation is dynamically adjusted by encoding the differences between the target domain and the source domain conditions: ; in, These are features enhanced by adaptive working conditions; This represents the original features. The normalized deviation between the target domain operating conditions and the source domain operating conditions is... and Here, denoted as the learnable matrix and the bias, respectively, and Sig represents the Sigmoid function. The inner product operation is performed based on the frequency weight matrix and the enhanced features to realize the correlation calculation between the features and the frequency weights of each fault type.

7. The small-sample partial-domain adaptive mechanical fault diagnosis method according to claim 6, characterized in that, Based on the deep features of the source domain and the deep features of the target domain, the amplitude and phase distributions are aligned to obtain the aligned source domain features and target domain features, including: The magnitudes of the source and target domain features are obtained through the feature function. With phase The calculation formula is: ; ; in, is the real part of the characteristic function; This represents the imaginary part of the characteristic function; This represents the matrix transpose operation. Represents the two-parameter arctangent function; Calculate the amplitude difference between the source domain and the target domain on the amplitude component, and the phase difference between the source domain and the target domain on the phase component; By minimizing the amplitude difference and the phase difference, the parameters of the fault association adaptation module are adjusted so that the shared class features of the source domain and the target domain tend to be consistent in amplitude and phase, thereby obtaining the aligned source domain features and target domain features.

8. The method for small-sample partial-domain adaptive mechanical fault diagnosis according to claim 1, characterized in that, The joint loss function includes the prototype classification loss function, the anti-prototype constraint loss function, the orthogonality loss function, and the distribution difference loss function; Prototype classification loss function Used to minimize the distance between features of similar samples and their corresponding prototypes: ; in, For Euclidean distance The number of samples in the source domain. The number of samples in the target domain. For the first The feature representation of each sample obtained by the feature extraction network For the first k The prototype of the fault category, For the first The class prototype is used to iterate through all categories in the denominator. For summation index, used from class 0 to class 1 Iterate through each fault category; Inverse Prototype Constraint Loss Function Used to force the current sample away from the anti-prototype of other categories: ; in, For current features Category; Orthogonal loss function This is used to ensure that the prototype and the anti-prototype are orthogonal to each other in the feature space: ; Distribution difference loss function To constrain cross-domain distribution differences between shared class features in the source and target domains, the distribution difference loss function consists of magnitude difference and phase difference: ; In the formula, This is the amplitude-phase balance coefficient. and Source domain features and target domain features In the k The magnitude of the fault category under the fault frequency weight; and Source domain features and target domain features In the k Phase under fault frequency weighting for fault category; This indicates an operation to calculate the expected value. Total loss function Defined as: ; in, and These represent the coefficients of the orthogonal loss function and the distributional difference loss function in the total loss function, respectively.

9. A small-sample, partial-domain adaptive mechanical fault diagnosis system, characterized in that, include: The data acquisition module is used to acquire tagged monitoring signals from the source domain and a small number of untagged monitoring signals from the target domain, and to record operating parameters and acquisition conditions. The preprocessing module is used to slice, standardize, frequency transform, and resize the source domain monitoring signal and the target domain monitoring signal to generate a two-dimensional image suitable for input constraint feature parsing network; The constraint feature parsing network module is used to perform deep feature parsing on the preprocessed samples. The constraint feature parsing network module internally includes: A bidirectional prototype learning unit is used to extract deep fault features from the source and target domains and maintain prototypes and anti-prototypes for each fault category. The category boundaries are enhanced through hard case selection, momentum update and dynamic fusion weights. The fault association adaptation unit is used to initialize and learn the frequency weight matrix based on the fault physical prior, and to perform operating condition difference enhancement and amplitude-phase distribution alignment. The fault classification unit is used to calculate the fault category probability based on the distance between the target domain sample features and each shared class prototype. The joint training optimization module is used to jointly train and update the parameters of the constraint feature parsing network based on the total loss function composed of the prototype classification loss function, the anti-prototype constraint loss function, the orthogonal loss function and the distribution difference loss function. The fault classification output module is used to input the monitoring signal of the mechanical equipment to be diagnosed into the trained constraint feature parsing network, calculate the fault category probability based on the distance between the feature and the prototype of each category, and output the health status, fault type, fault category probability and alarm information of the target equipment.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-8.