A multi-source domain open set fault diagnosis method and system based on prototype contrastive learning and pseudo-label learning
By employing prototype contrastive learning and pseudo-label learning methods, the problems of category alignment and unknown category identification in multi-source domain open set fault diagnosis are solved, achieving feature alignment between multi-source domains and stable diagnosis of the target domain, thereby improving diagnostic accuracy and robustness.
Patent Information
- Application Number
- CN202611076666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to achieve accurate alignment of shared categories among multiple source domains, effective separation of unknown categories, and full utilization of the internal structure of the target domain in multi-source domain open set fault diagnosis scenarios, resulting in insufficient diagnostic accuracy and robustness.
We adopt a prototype-based contrastive learning and pseudo-label learning approach, and construct a multi-level feature alignment framework through multi-source domain prototype-driven feature learning, sample-prototype contrastive learning, cross-domain sample contrastive learning and pseudo-label global alignment strategy to achieve class center alignment, sample-level structural constraints and cross-domain feature distribution alignment.
It improves diagnostic accuracy and robustness under multi-source domain open set conditions, and can accurately identify known fault categories and effectively identify unknown fault categories in the target domain, making it suitable for complex industrial environments.
Smart Images

Figure CN123115745A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to, but is not limited to, the field of mechanical equipment fault diagnosis technology, and particularly relates to a multi-source domain open set fault diagnosis method and system based on prototype contrastive learning and pseudo-label learning. Background Technology
[0002] Rotating machinery is widely used in industrial settings such as manufacturing, energy equipment, and transportation. Its key components, such as bearings, gears, and rotors, are susceptible to load fluctuations, speed variations, installation errors, and environmental disturbances during long-term operation. Vibration acceleration signals exhibit different distributions depending on the operating conditions, equipment carrier, and data acquisition location. With the application of deep learning and transfer learning in fault diagnosis, existing methods typically train diagnostic models using labeled fault data from the source domain and transfer knowledge from the source domain to the target domain through domain adaptation mechanisms to reduce the impact of insufficient labeled samples under the target operating condition on diagnostic accuracy. Relatively similar existing solutions mainly include single-source-domain open-set fault diagnosis methods and multi-source-domain closed-set fault diagnosis methods. The former typically assumes only one labeled source domain and one unlabeled target domain, identifying unknown fault categories in the target domain not seen in the source domain through adversarial learning, confidence discrimination, or classification boundary constraints. The latter typically collects data from multiple source domains, learning cross-operating-condition feature representations through feature alignment or domain obfuscation, but often presupposes that the source and target domain category spaces are consistent.
[0003] In practical industrial applications, fault data often does not originate from a single device or operating condition, but rather from different devices, different speeds and loads, different sensor arrangements, or different operating environments simultaneously. In this case, not only are there differences in probability distributions between the source domains, but there is also inconsistency in the class spaces; that is, some fault categories appear only in a few source domains, and the target domain may contain new fault categories not seen in the source domains. If a single-source-domain open-set method is directly used, the model can only establish known class boundaries around one source domain, making it difficult to utilize complementary information from multiple source data and susceptible to bias from a single source domain. If a multi-source-domain closed-set method is directly used, its alignment process usually tends to compress the source and target domains into the same feature space. When the target domain contains unknown fault categories, unknown samples may be incorrectly pulled closer to a known category, resulting in negative transfer. If only ordinary pseudo-label learning is used, the target domain samples, when predictions are unstable in the early stages, will incorrectly assign known labels to unknown samples, further amplifying the misalignment.
[0004] Therefore, existing technologies still have shortcomings in multi-source domain open set fault diagnosis scenarios: they lack structured constraints that can simultaneously characterize local class centers in each source domain and shared class centers across source domains, making it difficult to ensure that the same type of fault forms a consistent semantic center in different source domains; they lack fine-grained matching relationships between samples and class prototypes, making it difficult to balance intra-class compactness and inter-class separation; they lack cross-domain sample-level constraints oriented towards shared classes, making it difficult to eliminate fine-grained distribution bias; they lack a stable alignment mechanism between the target domain pseudo-prototype and the source domain global prototype, making it difficult to maintain transfer reliability in unlabeled target domains; at the same time, existing classifiers have insufficient ability to separate known and unknown classes, making it difficult to form effective recognition boundaries when unknown faults occur in the target domain. These problems limit the generalization and diagnostic capabilities of the model in complex industrial multi-source environments. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention provides a multi-source domain open set fault diagnosis method and system based on prototype contrastive learning and pseudo-label learning. It integrates multi-source domain prototype-driven feature learning, sample-prototype contrastive learning, cross-domain sample contrastive learning, and pseudo-label global alignment strategy. The aim is to achieve accurate alignment of shared categories among multi-source domains, effective separation of unknown categories, and full utilization of the internal structure of the target domain, thereby improving the diagnostic accuracy and robustness under multi-source domain open set conditions.
[0006] This invention is implemented as follows: a multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning, comprising:
[0007] Multiple source domain vibration signal samples and target domain vibration signal samples are input into a feature extraction network, which outputs corresponding sample features. Based on the fault category label and domain source label of the source domain samples, the mean value of the sample features of the same fault category within each source domain is calculated to obtain a local category prototype. The mean values of the local category prototypes of the same fault category existing in multiple source domains are aggregated to obtain a global category prototype. The distance between the local category prototype and the corresponding global category prototype is used as a category center alignment constraint to update the feature extraction network. Source domain sample features are set as positive matching relationships with the global category prototypes of their respective fault categories, and source domain sample features are set as negative matching relationships with the global category prototypes of other fault categories. Sample prototype comparison constraints are constructed based on similarity and temperature coefficient. Cross-domain sample pairs are constructed based on shared fault categories in multiple source domains. Sample features from different source domains but with the same category are set as positive cross-domain relationships, and sample features from different categories are set as negative cross-domain relationships. To establish cross-domain relationships, cross-domain sample comparison constraints are constructed based on similarity and temperature coefficients. The target domain sample features are input into a classifier trained from the source domain, which outputs the predicted probability of the target domain sample's category. The known fault category corresponding to the highest predicted probability is identified as the pseudo-label. A target domain pseudo-prototype is calculated based on the target domain sample features and its pseudo-label. The distance between the target domain pseudo-prototype and the corresponding source domain global category prototype is used as the source-target domain global alignment constraint. The target domain sample features are input into an extended classifier, which outputs the predicted probabilities for the known fault category dimension and the unknown fault category dimension. A threshold binary cross-entropy constraint separates the target domain sample prediction results between the known and unknown fault categories. The sample prototype comparison constraint, cross-domain sample comparison constraint, source-target domain global alignment constraint, and threshold binary cross-entropy constraint are used together to update network parameters, outputting the known fault category diagnosis result or the unknown fault category identification result for the target domain test sample.
[0008] Furthermore, the source domain vibration signal samples are obtained by slicing vibration acceleration signals collected from rotating machinery under different working conditions, different equipment, or different operating environments through a sliding window. Multiple source domain vibration signal samples are labeled with fault categories, while target domain vibration signal samples are not labeled with fault categories, and the target domain vibration signal samples include source domain samples without fault categories.
[0009] Furthermore, the input of the local category prototype is the sample features of the same fault category within the same source domain, and the output is the mean feature vector of the fault category in that source domain; the input of the global category prototype is the local category prototype of the same fault category in multiple source domains, and the output is the cross-source domain mean feature vector of the fault category.
[0010] Furthermore, a global category prototype is computed only for fault categories that exist in multiple source domains, and source domain-specific categories that exist only in a single source domain are excluded from the category center alignment constraint.
[0011] Furthermore, the sample prototype comparison constraint uses cosine similarity as a similarity measure and uses a temperature coefficient to adjust the distribution difference between positive and negative matching relationships, so that the source domain sample features are attracted by the global category prototype of their respective fault category and rejected by the global category prototype of other fault categories.
[0012] Furthermore, the cross-domain sample comparison constraint is constructed only based on shared fault categories in multiple source domains, and source domain-specific categories do not participate in the construction of cross-domain positive sample relationships.
[0013] Furthermore, the threshold of the threshold binary cross-entropy constraint is 0.5, and the first few output dimensions of the extended classifier correspond to known fault categories, while the last output dimension corresponds to unknown fault categories.
[0014] The present invention also provides a multi-source domain open set fault diagnosis device based on prototype contrastive learning and pseudo-label learning, including a data construction module, a prototype construction module, a feature learning module, a pseudo-label alignment module, an open set separation module, and a joint optimization module;
[0015] The data construction module is used to input the vibration acceleration signal of rotating machinery and output multiple labeled source domain datasets and unlabeled target domain datasets;
[0016] The prototype building module takes source domain sample features, fault category labels, and domain source labels as input, and outputs local category prototypes and global category prototypes.
[0017] The feature learning module is used to output aligned sample features based on the correspondence between local and global class prototypes, the correspondence between sample features and global class prototypes, and the class relationship between cross-domain samples.
[0018] The pseudo-label alignment module is used to input target domain sample features and classifier predicted probabilities, and output target domain pseudo-labels and target domain pseudo-prototypes.
[0019] The open set separation module is used to input target domain sample features and output the predicted probabilities of known fault categories and unknown fault categories.
[0020] The joint optimization module is used to update the parameters of each module based on the sample prototype comparison constraint, cross-domain sample comparison constraint, source domain target domain global alignment constraint, and threshold binary cross-entropy constraint.
[0021] Furthermore, the prototype building module is configured to generate global category prototypes only for fault categories that exist in multiple source domains, and output the global category prototypes to the feature learning module and the pseudo-label alignment module.
[0022] Furthermore, the open set separation module includes an extended classifier, the output dimension of which includes a known fault category dimension and an unknown fault category dimension, and separates the target domain samples into known and unknown categories based on a binary cross-entropy constraint with a threshold of 0.5.
[0023] This invention also provides a multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning, including:
[0024] Step 1, Multi-source domain data acquisition and segmentation: Vibration acceleration signals of rotating machinery under different working conditions, equipment, or operating environments are collected. A sliding window strategy is used to slice the signals, constructing multiple labeled source domain datasets and unlabeled target domain datasets. The target domain samples contain data of unknown categories, and a shared category set, a source domain-specific category set, and a target domain private category set are defined.
[0025] Step 2, Multi-source domain prototype construction: For class samples in each source domain, calculate the local class prototype; for shared classes that exist in multiple source domains, calculate the global class prototype to provide a unified reference anchor for subsequent cross-domain feature alignment.
[0026] Step 3, Multi-source domain feature extraction module based on prototype contrastive learning: Construct a deep learning network to extract distinguishable representational features from samples in multiple source and target domains. This module achieves structured modeling of the multi-source domain feature space through class prototype constraints.
[0027] Step 4, Multi-Source Domain Prototype-Driven Cross-Domain Feature Learning: This is a comprehensive feature alignment framework comprising three progressive alignment levels. First, cross-domain category prototype alignment ensures that similar samples from different source domains have a unified semantic center in the feature space. Second, sample-prototype contrastive learning achieves accurate matching between sample features and category prototypes. Finally, cross-domain sample contrastive learning further eliminates fine-grained distribution differences between domains. This framework simultaneously guarantees the class discriminativeness and domain invariance of features, providing a stable and reliable feature representation foundation for multi-source domain fault diagnosis.
[0028] Step 5, Global Alignment of Pseudo-Labels: Use the classifier trained in the source domain to predict the target domain samples and generate pseudo-labels; construct a pseudo-prototype of the target domain based on the pseudo-labels, and achieve global distribution alignment between the source domain and the target domain by minimizing the distance between the global prototype of the source domain and the pseudo-prototype of the target domain.
[0029] Step 6, Separate Adversarial Learning: Construct an extended classifier, increase the dimension of unknown categories, and force the predicted distribution of target domain samples to polarize towards "purely known" or "purely unknown" through threshold-based binary cross-entropy loss, thereby enhancing the model's ability to distinguish unknown category samples.
[0030] Step 7, Joint Loss Function Optimization: Construct a joint loss function, which includes sample-prototype contrast loss, cross-domain sample contrast loss, pseudo-label global alignment loss, and separation adversarial loss. By uniformly optimizing the parameters of each sub-module until the model converges, end-to-end training for multi-source domain open set fault diagnosis is achieved.
[0031] Step 8, Model Inference and Diagnosis: Input the target domain test samples into the trained model, and the extended classifier outputs the final category prediction result, realizing accurate diagnosis of known categories and effective identification of unknown categories.
[0032] Furthermore, the source domain dataset and target domain dataset mentioned in step 1 are defined as follows: In the multi-source domain open set fault diagnosis task, the domain D consists of a data feature space and its corresponding probability distribution, covering multiple source domains and a single target domain. The introduction of multiple source domains stems from the diversity of equipment fault data collection in actual industrial scenarios. That is, data from different source domains are usually collected under different equipment operating conditions, sensor types, or operating environments, while the target domain corresponds to the unknown operating conditions in which the model is actually deployed. Suppose there are N source domains, and the nth source domain is denoted as... ,in Let n be the number of samples from the nth source domain. This represents the i-th sample in the n-th source domain. This corresponds to the fault category label. The target domain is denoted as... ,in The number of samples in the target domain. Let j be the j-th sample in the target domain, and let the target domain samples be unlabeled. Define the label space of the n-th source domain as follows: ,Include One fault category; the label space of the target domain is ,Include There are several fault categories. Due to differences in acquisition conditions between different source domains and the unknown operating characteristics of the target domain, there is a dual distribution difference between the multi-source domain and the target domain: on the one hand, the distribution differences between domains are significant, and the probability distributions of different source domains are not the same, i.e. At the same time, the probability distributions of any source domain and target domain also exhibit a shift, i.e. , On the other hand, the label spaces of each source domain differ, that is... Some fault categories exist only in a few source domains. The target domain label space contains new fault categories not seen in the source domains, satisfying... Further define the set of shared categories. The fault category is common to all source and target domains, i.e. Number of shared categories Define the set of source domain-specific categories. , This represents a fault category that exists only in the nth source domain and is not included in other source or target domains. The target domain private category set is defined as follows: The categories in this set are unique to the target domain and are the core objects of the open-set domain adaptation problem. To quantify the openness of the label space between the multi-source domain and the target domain, the single-source domain open set metric can be extended, and the multi-source domain openness metric is defined as:
[0033]
[0034] When openness=0, the target domain has no unknown categories, and the problem degenerates into a multi-source domain closed-set domain adaptive fault diagnosis problem; when When a new fault category exists in the target domain that is not found in the source domain, this is the multi-source domain open-set domain adaptation fault diagnosis problem. In summary, the core objective of the multi-source domain open-set fault diagnosis task is to learn domain-invariant fault feature representations using labeled data from multiple source domains, enabling the model to accurately classify shared category samples in the target domain while effectively identifying and classifying unknown category samples, thus avoiding interference from source domain-specific categories on the model's generalization performance.
[0035] Furthermore, step 2, multi-source domain prototype construction, is based on prototype learning theory. For category samples in each source domain, a local category prototype is calculated; for shared categories existing simultaneously in multiple source domains, a global category prototype is calculated, providing a unified reference anchor point for subsequent cross-domain feature alignment. Prototype learning is a representation learning approach based on metric space structure modeling. Its core lies in characterizing the global semantic position of a category in the feature space by constructing a central representation for each category. Unlike metric learning methods that directly use prototypes for classification decisions, this invention treats prototypes as reference anchor points for feature space structure constraints and cross-domain alignment, guiding the distribution of multi-domain features to form a consistent semantic structure.
[0036] Let the input sample via feature mapping function Obtain the embedded representation The prototype vector of class c is denoted as... In theory, the prototype of a category can be defined as the statistical mean of the features of samples in that category:
[0037]
[0038] in Let represent the set of samples for category c. This definition allows the category prototype to reflect the overall distribution of categories in the feature space, thus serving as a reference center for category discrimination. Common metrics include Euclidean distance and cosine similarity. From an optimization perspective, the goal of prototype learning is to construct a compact intra-class and segregated inter-class structure in the feature space. To achieve this, a center-constrained intra-class compactness loss is typically introduced:
[0039]
[0040] in This constraint represents the true class label of the sample. By minimizing the distance between a sample feature and its corresponding class prototype, this constraint effectively reduces intra-class variance, causing samples of the same class to cluster around the class center. Furthermore, constraints in the form of distance intervals or contrast can further enhance inter-class separability, thus forming a well-structured geometric distribution in the feature space.
[0041] Furthermore, step 4, multi-source domain prototype-driven cross-domain feature learning, addresses the issue that in multi-source domain fault diagnosis scenarios, data from different source domains not only contain explicit category semantic information but also implicitly represent distributional differences between source domains. Therefore, the multi-source domain prototype-driven cross-domain feature learning mechanism proposed in this invention utilizes both source domain category label information and domain label information to construct multi-level alignment constraints during the training phase. Domain labels characterize the data source of samples, thereby supporting the construction of local category prototypes and the effective organization of cross-domain sample pairs, achieving structural alignment of shared categories between different source domains. Sample-prototype contrastive learning, on the other hand, relies solely on category semantic information, guiding sample features to converge towards the global category prototype to enhance intra-class consistency. Through hierarchical constraints on the category layer, sample-category relationship layer, and sample layer, the model can effectively reduce cross-domain distribution shifts while maintaining category discriminativeness, providing stable domain-invariant feature representations for subsequent unknown category identification and open-set diagnosis.
[0042] (1) Cross-domain category prototype alignment
[0043] First, at the category level, this invention achieves category-level cross-domain feature alignment by aligning prototypes of the same category in different source domains to reduce the distribution shift of cross-domain category centers. Let there be N source domains, with the nth source domain denoted as... For any fault category c, if it is in the source domain The source domain contains a set of samples belonging to class c. Define the local class prototype of class c in the nth source domain. This is the mean vector of all sample features within the set:
[0044]
[0045] in, Represents the feature extraction function, | | indicates the number of samples in that category. That is, the prototype vector of category c in the source domain n.
[0046] In multi-source domain data, the distribution of different categories across different source domains may not be consistent, and some fault categories may only exist in some source domains. To avoid introducing unreasonable alignment constraints due to missing categories, this invention only constructs a global category prototype for categories that exist simultaneously in multiple source domains. Let the set of all source domain indices where category c appears be denoted as . And the size of the set Then the global category prototype of category c. Defined as the average of all relevant source domain local prototypes:
[0047]
[0048] To achieve cross-domain feature distribution alignment, the model needs to constrain the local class prototypes of each source domain to converge to the corresponding global class prototype. Therefore, the prototype alignment loss function is defined as follows:
[0049]
[0050] in, express The square of the norm. By minimizing Feature extractor Explicitly constrained learning of feature representations with consistent class centers allows similar samples from different source domains to share a unified class semantic structure in the feature space, resulting in a more compact and domain-invariant cluster distribution. Furthermore, the global prototype is estimated jointly by multi-source information, which reduces the impact of noise or bias from a single source domain on class center estimation, providing a stable reference for subsequent sample-level alignment. A schematic diagram of class prototype alignment is shown below. Figure 1 As shown.
[0051] (2) Sample-prototype comparative learning
[0052] After cross-domain category prototype alignment, the category centers of similar samples from different source domains tend to be consistent in the feature space. However, simply aligning the category centers does not guarantee the consistency of intra-class sample distribution; samples may still exhibit a loose or unstable structure near the prototype, thus affecting the discriminative and generalization abilities of cross-domain features. To further constrain intra-class structure and enhance inter-class separability, this invention introduces a sample-prototype contrastive learning mechanism to perform fine-grained optimization of the feature space from the perspective of sample-category relationship. Let the sample... Feature extraction function Feature representation is obtained after mapping Its corresponding category label is .remember For category The global prototype of is denoted as , and the global prototypes of other categories are denoted as . In sample-prototype contrastive learning, sample features are... its global prototype Constructed as positive sample pairs, while compared with prototypes of other categories. Negative sample pairs are formed. Through the contrastive learning paradigm, the model is explicitly constrained to increase the similarity of sample features with the global prototype of the same class, while decreasing its similarity with the global prototype of the opposite class. This invention adopts a contrastive loss form based on the temperature coefficient, defining the sample-prototype contrastive loss as:
[0053]
[0054] in, The similarity measurement function is represented in this invention, which uses cosine similarity. The temperature coefficient is used to adjust the smoothness of the similarity distribution, thereby enhancing the model's ability to distinguish between positive and negative samples. By optimizing this loss function, sample features are effectively brought closer to the global prototype of their respective class in the feature space, while maintaining a large gap with prototypes of other classes, thus forming a structured distribution in the feature space that is compact within classes and separate between classes. Compared to simply aligning class centers, this mechanism further realizes sample-level structural constraints, enabling cross-domain samples of the same type to gradually converge to a consistent feature cluster under the guidance of a shared prototype, providing a more stable representation foundation for subsequent cross-domain fine-grained alignment and unknown class recognition. Sample-prototype contrastive learning is as follows: Figure 2 As shown.
[0055] (3) Cross-domain sample comparison learning
[0056] While the aforementioned cross-domain category prototype alignment and sample-prototype contrastive learning can improve the consistency of feature representations at both the category and intra-class structure levels, in multi-source domain scenarios, due to differences in operating conditions, sensor configurations, and data acquisition environments, similar samples from different source domains may still exhibit significant fine-grained distribution shifts in the feature space. To address this, this invention further designs a cross-domain sample contrastive learning mechanism. By narrowing the feature distance between similar samples across domains and widening the feature distance between dissimilar samples across domains, it resolves fine-grained distribution differences between multiple source domains and enhances the domain invariance of feature representations.
[0057] The core idea of this mechanism is to construct positive and negative sample pairs at the cross-domain sample level, using shared categories from multiple source domains as constraints, and to achieve feature aggregation of similar samples across domains through a contrastive learning paradigm. Specifically, it first selects a set of shared categories from multiple source domains. Cross-domain contrastive learning is performed only based on samples of shared categories to avoid interference from source domain-specific categories in the contrast process.
[0058] Let the sample It comes from the nth source domain, and its category label is The rules for constructing cross-domain sample pairs are as follows: positive sample pairs are sample pairs from different source domains but belonging to the same shared category, and negative sample pairs are samples from any source domain but of different categories.
[0059] Based on the above cross-domain sample pair construction strategy, a contrastive loss function of the form InfoNCE is used to achieve fine-grained feature alignment. The cross-domain sample contrastive loss is defined as follows:
[0060]
[0061] Where f(⋅) is the feature extraction function, sim(⋅,⋅) represents the cosine similarity, and τ is the temperature coefficient. Indicates sample The corresponding cross-domain positive samples.
[0062] By learning through cross-domain sample comparison, the model can further eliminate the fine-grained distribution differences of similar samples between different source domains while maintaining class discriminativeness. This enables similar samples across domains to form a more compact and consistent domain-invariant cluster structure in the feature space, thereby effectively improving the model's domain generalization ability in multi-source domain open set fault diagnosis.
[0063] Furthermore, in the multi-source domain fault diagnosis task, the pseudo-label global alignment described in step 5 primarily achieves structural consistency learning of shared categories among multiple source domains through the aforementioned cross-domain category prototype alignment and contrastive learning mechanism. However, due to the lack of label supervision, the feature distribution of the target domain may still have an overall offset from that of the source domain, thus limiting the generalization performance of the model in actual deployment scenarios. Therefore, after completing the structured modeling of the multi-source domain feature space, it is still necessary to further achieve global distribution alignment between the source and target domains.
[0064] To build a stable class prototype obtained through pre-training in the source domain, a pseudo-label from the target domain is introduced to construct a pseudo-prototype in the target domain, which is then aligned with the global prototype in the source domain. This strategy enhances the model's adaptability to the target domain without relying on the true labels in the target domain, thereby improving cross-domain fault diagnosis performance.
[0065] Since the target domain samples are unlabeled, the classifier trained in the source domain is first used to predict the target domain samples, and the class corresponding to the maximum predicted probability is used as the pseudo-label:
[0066]
[0067] in, Represents target domain samples The predicted probability vector, This is the pseudo-label for the sample. Based on the pseudo-label, the features of samples of the same category in the target domain are averaged to obtain the pseudo-prototype of the target domain:
[0068]
[0069] in, This represents the pseudo-prototype of class c in the target domain. The total number of samples in the target domain. This is an indicator function (returning 1 if the condition is met, and 0 otherwise). Simultaneously, it is based on the obtained shared category source domain global prototype. By minimizing the Euclidean distance between the global prototype of the source domain and the pseudo-prototype of the target domain, the global alignment loss of pseudo-labels is defined as follows:
[0070]
[0071] The goal of alignment is to bring the target domain pseudo-prototype closer to the corresponding source domain global prototype, while maintaining the separability between source domain category prototypes.
[0072] Furthermore, the adversarial learning described in step 6 aims to effectively distinguish between known and unknown faults in the target domain. Following the aforementioned idea, this invention constructs a global pseudo-decision boundary based on a hybrid source domain. Specifically, by introducing a threshold-based binary cross-entropy loss, the predicted distribution of the target domain samples is forced to polarize towards either "purely known" or "purely unknown." The adversarial learning loss function between the hybrid source domain and the target domain is defined as follows:
[0073]
[0074] The first k dimensions represent known categories, and the (k+1)th dimension represents unknown categories. Following the standard setup for binary adversarial training, a threshold T of 0.5 is set here to prevent the model from generating mediocre solutions where all predictions in the target domain are known.
[0075] To comprehensively evaluate the diagnostic performance of the model in the open set transfer recognition task, multiple metrics are further introduced to assess the model's performance. Based on common methods in open set recognition research, this invention uses the following four evaluation metrics:
[0076] Correctly identify the number of samples in the target domain of the test set with known categories;
[0077] : Correctly identify the number of samples in the target domain of the test set with unknown categories;
[0078] The total number of known samples in the target domain test set;
[0079] : The number of all unknown samples in the target domain test set.
[0080] The formula for calculating the model evaluation index used in this invention is shown below:
[0081]
[0082] In the formula, OS* represents the accuracy of the known class, UK represents the accuracy of the unknown class, OS represents the accuracy of all target domain samples, and H-Score is the harmonic mean of the known and unknown classes. All unknown classes are considered as one class, and there are a total of k+1 classes. The harmonic mean H-Score of OS* and UK will only be high when both OS* of the known class and UK of the unknown class are high.
[0083] The purpose of this invention is to provide a multi-source domain open set fault diagnosis system based on prototype contrastive learning and pseudo-label learning, comprising:
[0084] Data acquisition and segmentation module: This module is used to acquire vibration signal data from multiple source domain devices and target domain devices under different operating conditions. It uses a sliding window method to segment the acquired signals into samples, constructing a labeled multi-source domain sample set and an unlabeled target domain sample set. The target domain sample set contains unknown category samples that do not appear in the source domain. It defines the shared category set and the unknown category set of the multi-source domain label space and the target domain label space.
[0085] Data preprocessing module: This module performs uniform standardization processing on vibration samples from multiple source and target domains to eliminate amplitude differences between different devices, operating conditions, or sensor configurations, ensuring consistency in the feature space and laying the foundation for subsequent multi-source domain feature alignment.
[0086] Multi-source domain prototype-driven feature learning module: used to build a cross-domain feature alignment network based on prototype contrast learning, including cross-domain category prototype alignment sub-module, sample-prototype contrast learning sub-module and cross-domain sample contrast learning sub-module. By constructing source domain local category prototypes and global category prototypes, it realizes hierarchical structure modeling of multi-source domain feature space and cross-domain consistency enhancement.
[0087] Classification module: Connected to the multi-source domain prototype-driven feature learning module, it is used to output fault category prediction results based on the extracted feature representation. It includes a main classifier for prediction of known categories and an extended classifier structure for identification of unknown categories, supporting discriminative classification of shared features from multiple source domains.
[0088] The pseudo-label global alignment module is used to predict target domain samples using a classifier trained in the source domain, generate target domain pseudo-labels and construct target domain pseudo-prototypes. By minimizing the distance between the source domain global prototype and the target domain pseudo-prototype, it achieves unsupervised global alignment between the source and target domains, thus mitigating the overall distribution shift between the source and target domains.
[0089] Unknown category identification module: Through the separation adversarial learning of the feature extractor and the extended classifier, and the threshold-based binary cross-entropy loss, the predicted distribution of the target domain samples is forced to polarize towards "purely known" or "purely unknown", thereby improving the model's ability to detect and reject unknown fault categories.
[0090] Model training module: Used to establish and optimize a joint objective function that includes cross-domain prototype alignment loss, sample-prototype contrast loss, cross-domain sample contrast loss, pseudo-label global alignment loss and separation adversarial loss, to train the entire diagnostic model and achieve collaborative optimization of multi-source domain feature alignment and open set fault identification.
[0091] Fault diagnosis module: This module applies the trained model to test samples in the target domain and outputs the final fault identification results. It includes accurate diagnosis of known fault categories and effective identification of unknown categories, realizing a complete solution for multi-source domain open set fault diagnosis tasks.
[0092] Another object of the present invention is to provide a computer device, the computer device including a memory and a processor, the memory storing a computer program, the computer program being executed by the processor causing the processor to perform the steps of the multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning.
[0093] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows:
[0094] This invention introduces a multi-level prototype contrastive learning mechanism to achieve refined cross-domain feature alignment. Addressing the problems of insufficient feature alignment and significant inter-domain distribution differences in traditional multi-source domain methods, this invention innovatively proposes a progressive alignment strategy based on prototype contrastive learning. This strategy comprises three levels: cross-domain category prototype alignment, sample-prototype contrastive learning, and cross-domain sample contrastive learning. Alignment constraints are applied progressively at the category level, the sample-category relationship level, and the sample level, ensuring that similar samples from different source domains form a compact and consistent cluster structure in the feature space. Compared to single-level alignment methods, this invention can simultaneously guarantee the class discriminativeness and domain invariance of features, significantly improving the quality and stability of multi-source domain feature alignment.
[0095] This invention integrates a pseudo-label global alignment strategy to enhance the adaptability of the target domain. Addressing the issue of overall feature distribution shift caused by the lack of label supervision in the target domain, this invention introduces a pseudo-label-based global alignment mechanism. By generating pseudo-labels for the target domain using a classifier trained in the source domain, a pseudo-prototype of the target domain is constructed and aligned with the global prototype of the source domain. This effectively alleviates the overall distribution shift between the source and target domains without relying on the true labels of the target domain. This strategy fully utilizes the stability of multi-source domain information, providing a reliable reference anchor for target domain feature learning and significantly improving the model's cross-domain generalization performance.
[0096] This invention is applicable to multi-source domain open set fault diagnosis scenarios, exhibiting strong robustness and wide applicability. It addresses the complex requirements of diverse data distributions, inconsistent categories, and unknown category identification in the target domain, making it particularly suitable for diverse equipment fault data acquisition scenarios in real-world industrial environments. Through the synergistic effect of prototype-driven feature constraints and global alignment of pseudo-labels, the model effectively improves the detection capability of unknown categories while maintaining the discriminative power of known categories. It achieves significantly better performance than existing methods on multiple typical bearing fault datasets such as CWRU and JNU, demonstrating excellent diagnostic accuracy, stability, and cross-domain generalization ability. Attached Figure Description
[0097] Figure 1 This is a flowchart of a multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning provided in an embodiment of the present invention.
[0098] Figure 2 This is a diagram of the multi-source domain open set diagnostic network structure provided in an embodiment of the present invention;
[0099] Figure 3 This is a schematic diagram of cross-domain category prototype alignment provided in an embodiment of the present invention;
[0100] Figure 4 This is a schematic diagram of sample-prototype comparative learning provided in an embodiment of the present invention;
[0101] Figure 5 These are H-Score graphs for different tasks provided in embodiments of the present invention. Figure 6 This is a schematic diagram of a multi-source domain open set fault diagnosis system based on prototype contrastive learning and pseudo-label learning provided in an embodiment of the present invention. Detailed Implementation
[0102] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0103] This invention utilizes the category information and domain source information contained in known fault samples from multiple source domains to construct a fault diagnosis model capable of simultaneously adapting to inter-domain differences and open-set unknown categories. First, rotating machinery vibration acceleration signals collected under different operating conditions, equipment, or environments are sliced using a sliding window to form multiple labeled source domain samples and unlabeled target domain samples. After the source domain samples are input into a feature extraction network, feature representations are obtained. The system forms a local category prototype based on the mean of features of samples of the same fault category within the same source domain, and aggregates the local prototypes of the same fault category existing in multiple source domains to form a global category prototype. This global category prototype serves as the semantic center for cross-domain shared categories, constraining similar fault samples from different source domains to converge towards a unified center in the feature space, reducing category center shifts caused by differences in operating conditions, equipment, or collection environments.
[0104] Building upon this foundation, the model further optimizes the feature space structure through the comparative relationship between samples and prototypes. Specifically, source domain sample features form a positive matching relationship with the global category prototype of their respective category, and a negative matching relationship with the global category prototype of other categories. Under the constraints of similarity and temperature coefficient, the network increases the proximity of samples of the same category to their corresponding prototype and reduces the proximity of samples of different categories to the prototype, resulting in a feature space that is compact within categories and separated between categories. Simultaneously, for fault categories common to multiple source domains, the system constructs cross-domain sample pairs, treating samples from different source domains but of the same category as positive cross-domain relationships and samples from different categories as negative cross-domain relationships. This further weakens the fine-grained distribution differences between source domains and enhances the domain invariance of feature representations.
[0105] Since the target domain samples lack true labels, the model uses a classifier trained in the source domain to predict the target domain samples. The known category with the highest predicted probability is used as the pseudo-label, and a target domain pseudo-prototype is calculated based on the features of target domain samples with the same pseudo-label. Subsequently, the system constrains the target domain pseudo-prototype to move closer to the corresponding global category prototype in the source domain, achieving global distribution alignment between the source and target domains. To prevent unknown fault samples in the target domain from being forcibly classified into known categories, the model sets up an extended classifier containing both known and unknown category dimensions. A threshold binary cross-entropy constraint is used to separate the prediction results of target domain samples between "known" and "unknown." Finally, the system obtains a stable diagnostic model by jointly optimizing sample prototype comparison constraints, cross-domain sample comparison constraints, pseudo-label global alignment constraints, and open set separation constraints. This enables the identification of known fault categories and the discrimination of unknown fault categories during the inference phase.
[0106] like Figure 1 As shown, this embodiment of the invention provides a multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning, including the following steps:
[0107] Step 1, data acquisition, is used to collect vibration signals from multiple labeled source domain devices and unlabeled target domain devices to construct N source domain datasets and 1 target domain dataset, where the target domain dataset contains unknown categories not found in the source domain datasets.
[0108] Step 2, data preprocessing, involves slicing, standardizing, and normalizing the acquired signals to construct a labeled multi-source domain sample set and an unlabeled target domain sample set. The target domain dataset contains unknown categories not present in the source domain dataset. A sliding window approach is used to divide the original vibration signals into samples, ensuring consistency in data format across different domains.
[0109] Step 3, Construction of a multi-source domain open-set fault diagnosis model based on prototype contrastive learning: (e.g.) Figure 2 As shown, the multi-source domain open set diagnostic model in this example is mainly divided into five core parts: shared feature extractor, multi-source domain prototype learning module, pseudo-label global alignment module, extended classifier, and separation adversarial learning module.
[0110] Shared Feature Extractor: This module constructs a deep feature extractor that integrates convolutional neural networks and residual blocks to extract distinguishable representational features from multiple source and target domain samples. It achieves cross-domain feature space alignment through shared parameters. The network structure includes multiple one-dimensional convolutional layers, residual blocks, and global pooling layers.
[0111] Multi-source domain prototype learning module: includes a cross-domain category prototype alignment submodule, a sample-prototype comparison learning submodule, and a cross-domain sample comparison learning submodule. For example... Figure 3 As shown, the cross-domain category prototype alignment submodule achieves center alignment of the same category in different source domains by constructing local and global category prototypes of the source domain; for example... Figure 4 As shown, the sample-prototype comparison learning submodule enhances intra-class compactness by narrowing the distance between sample features and corresponding class prototypes; the cross-domain sample comparison learning submodule eliminates fine-grained distribution differences by constructing positive sample pairs of cross-domain samples of the same class.
[0112] The pseudo-label global alignment module is used to predict the target domain samples using the classifier trained in the source domain, generate the class with the highest prediction probability as a pseudo-label, construct a pseudo-prototype of the target domain based on the pseudo-label, and achieve global distribution alignment between the source domain and the target domain by minimizing the Euclidean distance between the global prototype of the source domain and the pseudo-prototype of the target domain.
[0113] Extended classifier: Contains multiple fully connected layers and a Softmax activation function. The output classifier has one more known class than the number of known classes, with the additional classes representing unknown classes. This extended classifier receives feature vectors from the feature extractor and performs classification prediction on the input features to distinguish fault categories, including both known and unknown categories.
[0114] Separate adversarial learning module: By introducing a threshold-based binary cross-entropy loss, the predicted distribution of the target domain samples is forced to polarize towards "purely known" or "purely unknown". Through adversarial training, the feature boundary between the known class and the unknown class is explicitly widened, thereby improving the ability to identify the unknown class.
[0115] Step 4, Model Training: Input the predefined multi-source domain sample set and target domain sample set into the model constructed in Step 3 for end-to-end joint training. The goal of training is to minimize a joint loss function, including cross-domain prototype alignment loss, sample-prototype contrast loss, cross-domain sample contrast loss, pseudo-label global alignment loss, and separation adversarial loss, to collaboratively optimize the model parameters.
[0116] Step 5, Fault Diagnosis Module: This module deploys the trained model in the target domain to achieve efficient diagnosis of test samples. In this stage, only the backbone feature extractor and extended classifier are retained. Features are directly extracted and categories are determined for the test samples in the target domain, resulting in high-precision fault identification results. This ensures lightweight and efficient model inference, meeting the needs of practical industrial applications.
[0117] This invention proposes a fault diagnosis training method for multi-source domain open-set scenarios. First, a backbone feature extractor and an extended classifier are trained using labeled data from multiple source domains. Through cross-domain category prototype alignment, sample-prototype contrastive learning, and cross-domain sample contrastive learning, a hierarchical structure modeling of the multi-source domain feature space and enhanced cross-domain consistency are achieved. Subsequently, a pseudo-label global alignment strategy is introduced. The classifier trained in the source domains generates pseudo-labels for target domain samples, constructing a target domain pseudo-prototype aligned with the source domain global prototype, achieving unsupervised global alignment between the source and target domains. To enhance the model's ability to identify unknown categories, a separation adversarial learning module is designed. Through threshold-based binary cross-entropy loss, the feature boundaries between known classes and potentially unknown classes are explicitly widened. The entire training process requires no target domain label supervision, making it suitable for fault detection needs in industrial scenarios with multi-source data and complex operating conditions.
[0118] like Figure 6 As shown, this embodiment of the invention provides a multi-source domain open set fault diagnosis system based on prototype contrastive learning and pseudo-label learning, comprising:
[0119] Data acquisition and segmentation module: This module is used to acquire vibration signal data from multiple source domain devices and target domain devices under different operating conditions. It uses a sliding window method to segment the acquired signals into samples, constructing a labeled multi-source domain sample set and an unlabeled target domain sample set. The target domain sample set contains unknown category samples that do not appear in the source domain. It defines the shared category set and the unknown category set of the multi-source domain label space and the target domain label space.
[0120] Data preprocessing module: This module performs uniform standardization processing on vibration samples from multiple source and target domains to eliminate amplitude differences between different devices, operating conditions, or sensor configurations, ensuring consistency in the feature space and laying the foundation for subsequent multi-source domain feature alignment.
[0121] Multi-source domain prototype-driven feature learning module: used to build a cross-domain feature alignment network based on prototype contrast learning, including cross-domain category prototype alignment sub-module, sample-prototype contrast learning sub-module and cross-domain sample contrast learning sub-module. By constructing source domain local category prototypes and global category prototypes, it realizes hierarchical structure modeling of multi-source domain feature space and cross-domain consistency enhancement.
[0122] Classification module: Connected to the multi-source domain prototype-driven feature learning module, it is used to output fault category prediction results based on the extracted feature representation. It includes a main classifier for prediction of known categories and an extended classifier structure for identification of unknown categories, supporting discriminative classification of shared features from multiple source domains.
[0123] The pseudo-label global alignment module is used to predict target domain samples using a classifier trained in the source domain, generate target domain pseudo-labels and construct target domain pseudo-prototypes. By minimizing the distance between the source domain global prototype and the target domain pseudo-prototype, it achieves unsupervised global alignment between the source and target domains, thus mitigating the overall distribution shift between the source and target domains.
[0124] Unknown category identification module: Through the separation adversarial learning of the feature extractor and the extended classifier, and the threshold-based binary cross-entropy loss, the predicted distribution of the target domain samples is forced to polarize towards "purely known" or "purely unknown", thereby improving the model's ability to detect and reject unknown fault categories.
[0125] Model training module: Used to establish and optimize a joint objective function that includes cross-domain prototype alignment loss, sample-prototype contrast loss, cross-domain sample contrast loss, pseudo-label global alignment loss and separation adversarial loss, to train the entire diagnostic model and achieve collaborative optimization of multi-source domain feature alignment and open set fault identification.
[0126] Fault diagnosis module: This module applies the trained model to test samples in the target domain and outputs the final fault identification results. It includes accurate diagnosis of known fault categories and effective identification of unknown categories, realizing a complete solution for multi-source domain open set fault diagnosis tasks.
[0127] This invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning.
[0128] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.
[0129] This invention provides specific applications of the method, as follows:
[0130] Step 1, Data Acquisition: The operating status of the equipment under different working conditions is monitored using sensors, and vibration signals from the rolling bearings are collected to construct a cross-domain migration task. This embodiment uses two bearing datasets for verification:
[0131] 1. Case Western Reserve University Bearing Dataset: This experimental setup consists of a 2-horsepower motor, a torque sensor / encoder, and control electronics. Accelerometers are mounted on the drive and fan ends of the motor housing, with a sampling frequency of 12kHz. Bearing datasets were collected under four different operating conditions, corresponding to loads of 0hp, 1hp, 2hp, and 3hp. The tested bearing model was a 6205-2RSJMESKF deep groove ball bearing. Single-point failures in the bearing were introduced using electrical discharge machining (EDM) to create different failure modes, including four health states: healthy (N), inner ring failure (IR), outer ring failure (OR), and rolling element failure (BF). Each failure mode included three different failure severity levels, with failure depths of 0.007, 0.014, and 0.021 inches, respectively.
[0132] 2. The Jiangnan University Bearing Dataset is a dataset used for bearing fault diagnosis, with a sampling frequency of 50kHz and a sampling duration of 20s. The dataset contains rolling bearing fault signals at three speeds: 600r / min, 800r / min, and 1000r / min, including health status (H), inner ring fault (IF), outer ring fault (OF), and rolling element fault (BF).
[0133] Step 2, Data Preprocessing and Transfer Task Construction: The original signals from each dataset are sliced using overlapping sliding windows to construct samples. To evaluate model performance, this embodiment sets up a cross-domain open-set fault diagnosis task using the two datasets mentioned above. The Case Western Reserve University dataset is divided into 10 categories based on fault type and depth, while the Jiangnan University dataset is uniformly divided into four categories: normal, inner ring fault, outer ring fault, and roller fault. These two datasets are used to verify the open-set transfer task. This invention selects the CWRU bearing dataset and the JNU bearing dataset to construct a multi-source domain open-set domain adaptation task. The data sample length is set to 2048 points, with 400 samples in each category. For the CWRU dataset, transfer tasks are constructed with source domains of 0hp, 1hp, and 2hp and a target domain of 3hp; and transfer tasks with source domains of 1hp, 2hp, and 3hp and a target domain of 0hp, as shown in Tables 1 and 2. For the JNU dataset, transfer tasks are constructed from 600r and 800r to the target domain of 1000r, as shown in Table 3.
[0134] Table 1. CWRU Dataset Task 1 Settings
[0135]
[0136] Table 2 CWRU Dataset Task 2 Settings
[0137]
[0138] Table 3 JNU Dataset Task Settings
[0139]
[0140] Step 3, Model Construction: According to the technical solution described in this invention, a deep network model is constructed, consisting of a shared feature extractor (including an FFT frequency domain signal input layer, a convolutional-residual block layer, a global pooling layer, and an output layer), a multi-source domain prototype learning module, a pseudo-label global alignment module, an extended classifier, and a separation adversarial learning module.
[0141] Step 4, Model Training: Input the preprocessed multi-source domain sample set and target domain sample set into the model, and perform end-to-end joint training by minimizing a joint objective function that integrates cross-domain prototype alignment loss, sample-prototype contrast loss, cross-domain sample contrast loss, pseudo-label global alignment loss, and separation adversarial loss.
[0142] Step 5, Model Testing: Input the test data that was not seen during training into the target domain into the trained model, and directly output its predicted fault categories, including accurate diagnosis of known fault categories and effective identification of unknown fault categories.
[0143] (1) DANN: A typical adversarial domain adaptation method that achieves feature alignment of source / target domain by introducing a domain discriminator, but does not consider the open class problem and is used to evaluate the transfer performance under the closed set assumption.
[0144] (2) OSBP: This method extends the classifier through adversarial training to establish a decision boundary on the source and target domain samples, thereby separating known and unknown classes. At the same time, the generator is trained to keep the target samples away from the decision boundary.
[0145] (3) MADTN: The multi-source fault category matching module is used to align the multi-source distribution and reduce the category bias; the inter-domain differences are reduced through adversarial learning, and the comprehensive diagnostic results are obtained by combining multi-classifier ensemble decision-making; and the domain-invariant feature extraction capability is further improved through global alignment.
[0146] (4) MSWDAN: Multi-source domain weighted transfer learning is used to realize open set fault diagnosis of rolling bearings. First, the fault type perception strategy is used to distinguish unknown faults in the target domain to avoid invalid inter-domain feature alignment. Then, the multi-source classifier is weighted and fused based on the similarity scores between the target domain and each source domain, thereby improving the accuracy and generalization ability of cross-domain fault diagnosis.
[0147] All comparison methods employ the same feature extractor combining channel and spatial attention mechanisms as this invention, and are tested on a unified hardware and software platform with optimized hyperparameters to ensure fairness in the comparison.
[0148] Table 4. Accuracy of Task 1 on the CWRU dataset
[0149]
[0150] In the task of migrating from operating conditions 0, 1, and 2 to operating condition 3, the average operating system (OS) of the proposed method reached 93.82%, which is an improvement of 21.14%, 16.34%, 2.88%, and 2.78% respectively compared to DANN (72.68%), OSBP (77.48%), MADTN (90.94%), and MSWDAN (91.04%). This indicates that the proposed method can more effectively learn cross-domain shared discriminative features, thereby alleviating the distribution offset problem between different operating conditions. Regarding the performance of known category recognition, the average OS* of the proposed method reached 94.58%, a further improvement of 2.73 percentage points compared to the best-performing comparative method MSWDAN (91.85%). This demonstrates that through multi-source domain prototype-driven feature learning and global alignment mechanisms, the model can obtain a more compact and discriminative intra-class feature distribution, thereby improving the recognition accuracy of known fault categories. Regarding the ability to identify unknown categories, the method of this invention achieves an average UK score of 89.20%, which is superior to DANN (69.48%), OSBP (79.47%), MADTN (84.02%), and MSWDAN (85.98%). In particular, the UK score reaches 93.52% in the C1 category, which is 7 percentage points higher than the second-best MADTN model (86.52%). This further verifies that the proposed pseudo-label global alignment and separation adversarial learning strategy can effectively expand the feature margin between known and unknown categories and improve the model's ability to detect and reject unknown fault samples.
[0151] Table 5. Accuracy of Task 2 on the CWRU dataset.
[0152]
[0153] In the migration tasks from work conditions 1, 2, and 3 to work condition 0, the proposed method maintained stable leading performance, with average OS, OS*, and UK reaching 93.73%, 94.67%, and 88.12%, respectively. Compared to the better-performing MADTN method (average OS 90.62%, average OS* 91.48%, average UK 84.49%), the proposed method achieves improvements of 3.11%, 3.19%, and 3.63%, respectively, indicating that the proposed model can more effectively mitigate the performance degradation caused by inter-domain distribution differences during cross-work condition migration. Specifically, in the C3 task, the proposed method achieved an OS* of 96.00%, a 4.75 percentage point improvement over MSWDAN (91.25%). This result demonstrates that even in complex migration scenarios with significant differences between work conditions, the model can still learn stable and discriminative class feature representations.
[0154] The experimental results from both sets of transfer tasks reveal that the method of this invention exhibits consistent and stable performance advantages across different working conditions and transfer directions, demonstrating good cross-domain generalization ability. Compared to traditional contrastive methods, the method of this invention achieves structured aggregation of multi-source domain feature spaces through prototype contrastive learning and a pseudo-label global alignment mechanism, effectively promoting global distribution alignment between the source and target domains. On the one hand, this strategy enhances the intra-class compactness and inter-class separability of known category features; on the other hand, by optimizing the feature distribution boundary, it improves the model's ability to identify and reject samples of unknown categories.
[0155] To further verify the effectiveness of the proposed method in multi-source domain open-set fault diagnosis scenarios, this invention constructed five sets of cross-condition migration tasks (J1–J5) on the JNU dataset. By setting different source domain conditions (600hp and 800hp) and fault category combinations, and using two open-set opening degrees of 0.75 and 0.5, the open environment under different proportions of unknown categories was simulated. Among them, J1–J3 are higher opening degree tasks, containing more shared category information, while J4–J5 further increases the task difficulty while reducing the number of source domain categories. The experimental results are shown in Table 6. The proposed method achieves the best performance on all evaluation metrics, with average OS, OS*, and UK reaching 91.50%, 93.54%, and 86.44%, respectively. Compared with the better-performing MSWDAN method (89.40%, 91.56%, and 83.86%), these figures are improved by 2.10%, 1.98%, and 2.58%, respectively, demonstrating stronger cross-domain adaptability and open-set recognition performance. Based on the known category recognition results, the method of this invention maintains a stable advantage across all tasks. For example, the OS* for tasks J1 and J3 reaches 95.20% and 93.72%, respectively. Even in the more challenging tasks J4 and J5 with more limited category information, it still maintains a recognition accuracy of over 92%, indicating that prototype-driven feature constraints effectively enhance intra-class compactness and discriminative stability. Regarding unknown category recognition, the method of this invention achieves an average UK of 86.44%, outperforming all comparative methods. This demonstrates that the model can form clearer known-unknown category boundaries under various working conditions, thereby reducing the misclassification of unknown samples. Further analysis of different task difficulties reveals that the performance of the comparative methods declines significantly with decreasing openness and fewer categories, while the method of this invention maintains stable performance, indicating stronger robustness to changes in the training category scale. In summary, thanks to the synergistic effect of prototype-driven cross-domain feature learning, cross-domain sample comparison learning, and the pseudo-label global alignment mechanism, the model can effectively improve the detection capability of unknown categories while maintaining the discriminative power of known categories, thus exhibiting superior generalization performance and stability in multi-source domain open-set fault diagnosis tasks.
[0156] Table 6. Accuracy of JNU Dataset Tasks
[0157]
[0158] like Figure 5 As shown, the H-Scores for various tasks at different openness levels are displayed. It can be observed that each method exhibits a certain degree of performance fluctuation under different task settings, indicating that open-set domain generalization tasks place high demands on the model's stability and generalization ability. Overall, the method of this invention achieves relatively high H-Scores in most tasks, demonstrating a relatively stable performance advantage in C1–C3 tasks and related tasks on the JNU dataset; however, in some tasks with lower openness or larger class differences, the performance gap between methods decreases. Specific task settings reveal that as the openness changes and the differences in source domain class combinations increase, the model needs to effectively balance the ability to identify known classes with the ability to reject unknown classes, and different methods emphasize these two aspects differently. Some compared methods have certain advantages in identifying known classes, but their ability to detect unknown classes is relatively limited, thus affecting the overall H-Score; in contrast, the method of this invention maintains a more balanced performance in most tasks, making the comprehensive evaluation index more stable. Furthermore, in cross-dataset tasks, all methods exhibited varying degrees of performance degradation, indicating that differences in data distribution remain a significant factor affecting the generalization performance in the open set domain. In contrast, the H-Score of the method presented in this invention showed relatively smaller fluctuations, indicating a certain degree of stability under different task conditions, although further optimization is still possible. Overall, the experimental results demonstrate that each method has its own characteristics in open set recognition tasks, while the method presented in this invention exhibits a more balanced overall performance across various task settings.
[0159] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.
[0160] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A multi-source domain open set fault diagnosis method based on prototype contrastive learning and pseudo-label learning, characterized in that, include: Multiple source domain vibration signal samples and target domain vibration signal samples are input into a feature extraction network, which outputs the corresponding sample features. Based on the fault category label and domain source label of the source domain samples, the mean value of the sample features of the same fault category in each source domain is calculated to obtain the local category prototype. The mean values of the local category prototypes of the same fault category existing in multiple source domains are aggregated to obtain the global category prototype. The distance between the local category prototype and the corresponding global category prototype is used as a category center alignment constraint to update the feature extraction network. Source domain sample features are set as positive matching relationships with the global category prototypes of their respective fault categories, and source domain sample features are set as negative matching relationships with the global category prototypes of other fault categories. Sample prototype comparison constraints are constructed based on similarity and temperature coefficient. Cross-domain sample pairs are constructed based on shared fault categories in multiple source domains. Sample features from different source domains but with the same category are set as positive cross-domain relationships, and sample features from different categories are set as negative cross-domain relationships. Cross-domain pairs are constructed based on similarity and temperature coefficient. The process involves several steps: First, a target domain sample feature is input into a classifier trained on the source domain. The classifier outputs the predicted class probability of the target domain sample and identifies the known fault category corresponding to the highest predicted probability as the pseudo-label. Second, a target domain pseudo-prototype is calculated based on the target domain sample feature and its pseudo-label. The distance between the target domain pseudo-prototype and the corresponding source domain global category prototype is used as the source-target domain global alignment constraint. Third, the target domain sample feature is input into an extended classifier, which outputs the predicted probabilities for the known and unknown fault categories. A threshold binary cross-entropy constraint separates the target domain sample prediction results between known and unknown fault categories. Finally, the sample prototype comparison constraint, cross-domain sample comparison constraint, source-target domain global alignment constraint, and threshold binary cross-entropy constraint are used together to update network parameters, outputting the known fault category diagnosis result or the unknown fault category identification result for the target domain test sample.
2. The method according to claim 1, characterized in that, The source domain vibration signal samples are obtained by slicing vibration acceleration signals collected from rotating machinery under different working conditions, different equipment, or different operating environments through a sliding window. Multiple source domain vibration signal samples have fault category labels, while target domain vibration signal samples do not have fault category labels, and the target domain vibration signal samples include source domain samples without fault categories.
3. The method according to claim 1, characterized in that, The input of the local category prototype is the sample features of the same fault category within the same source domain, and the output is the mean feature vector of the fault category in that source domain; the input of the global category prototype is the local category prototype of the same fault category in multiple source domains, and the output is the cross-source domain mean feature vector of the fault category.
4. The method according to claim 1, characterized in that, The global category prototype is calculated only for fault categories that exist in multiple source domains, and source domain-specific categories that exist only in a single source domain are excluded from the category center alignment constraint.
5. The method according to claim 1, characterized in that, The sample prototype comparison constraint uses cosine similarity as the similarity measure and uses a temperature coefficient to adjust the distribution difference between positive and negative matching relationships, so that the source domain sample features are attracted by the global category prototype of their respective fault category and rejected by the global category prototype of other fault categories.
6. The method according to claim 1, characterized in that, The cross-domain sample comparison constraint is constructed only based on shared fault categories in multiple source domains, and source domain-specific categories do not participate in the construction of cross-domain positive sample relationships.
7. The method according to claim 1, characterized in that, The threshold of the threshold binary cross-entropy constraint is 0.
5. The first few output dimensions of the extended classifier correspond to known fault categories, and the last output dimension corresponds to unknown fault categories.
8. A multi-source domain open set fault diagnosis device based on prototype contrastive learning and pseudo-label learning, characterized in that, It includes a data construction module, a prototype construction module, a feature learning module, a pseudo-label alignment module, an open set separation module, and a joint optimization module; The data construction module is used to input the vibration acceleration signal of rotating machinery and output multiple labeled source domain datasets and unlabeled target domain datasets; The prototype building module takes source domain sample features, fault category labels, and domain source labels as input, and outputs local category prototypes and global category prototypes. The feature learning module is used to output aligned sample features based on the correspondence between local and global class prototypes, the correspondence between sample features and global class prototypes, and the class relationship between cross-domain samples. The pseudo-label alignment module is used to input target domain sample features and classifier predicted probabilities, and output target domain pseudo-labels and target domain pseudo-prototypes. The open set separation module is used to input target domain sample features and output the predicted probabilities of known fault categories and unknown fault categories. The joint optimization module is used to update the parameters of each module based on the sample prototype comparison constraint, cross-domain sample comparison constraint, source domain target domain global alignment constraint, and threshold binary cross-entropy constraint.
9. The apparatus according to claim 8, characterized in that, The prototype building module is configured to generate global category prototypes only for fault categories that exist in multiple source domains, and output the global category prototypes to the feature learning module and the pseudo-label alignment module.
10. The apparatus according to claim 8, characterized in that, The open set separation module includes an extended classifier, whose output dimensions include known fault category dimensions and unknown fault category dimensions. The extended classifier separates the target domain samples into known and unknown categories based on a binary cross-entropy constraint with a threshold of 0.5.
