Domain generalization detection of fault categories in industrial equipment diagnosis is a challenging problem, as it demands a model with high generalization performance. Previous methods have primarily focused on a closed set, implying that the label spaces of the training and testing sets are identical. However, this approach is insufficient to reason about the intricate industrial dynamics. In this article, we fuse domain generalization and open-set recognition to introduce a new domain generalization fault diagnosis scenario, called open-set domain generalization. It learns from different source domains to achieve high performance on unknown target domains, where the distribution and label set can be different for each source and target domain. The problem can be more applicable to real-world industrial applications. In addition, we propose a multidomain contrastive coding (MDCC) framework to learn open-set domain generalizable representations. We conduct multidomain contrastive coding by designing a new contrastive coding task and loss to preserve domain-unique knowledge and generalize knowledge across domains simultaneously. Experimental results on two multidomain datasets demonstrate that the proposed MDCC framework outperforms prior methods in open-set domain generalization.
Offshore wind turbines operate under harsh and time-varying marine environments, leading to significant distribution shifts between source and target domains. These challenges are further intensified by limited fault samples, imbalanced class distributions, and difficult maintenance access in maritime scenarios. To address these issues, this paper proposes a multi-source domain adaptation method, termed the class-wise dynamic anchor weighting fusion framework (CDAWF), for offshore wind turbine drivetrain fault diagnosis. CDAWF dynamically assigns weights to different source domains according to their feature-level similarity to the target domain, enabling adaptive feature fusion across operating conditions. Convolutional neural networks are used to extract domain-specific representations, while adversarial training is introduced to reduce cross-domain discrepancies. The proposed method is validated on a multi-condition bearing fault dataset generated from high-fidelity simulations of a 5 MW offshore wind turbine drivetrain. Experimental results show that CDAWF effectively improves diagnostic robustness under domain shift, limited labeled data, and class imbalance. Compared with benchmark methods, CDAWF achieves superior classification performance and serves as a useful reference for cross-condition fault diagnosis of offshore wind turbine drivetrain systems.