In recent years, digital twin (DT) technology has garnered significant interest from both academia and industry. However, the development of effective fault detection and diagnosis models remains challenging due to the lack of comprehensive datasets. To address this issue, we propose the use of Generative Adversarial Networks (GANs) to generate synthetic data that replicate real-world data, capturing essential features indicative of health-related information without directly referencing actual industrial DT systems. This paper introduces an intelligent fault detection and diagnosis framework for industrial triplex pumps, enhancing fault recognition capabilities and offering a robust solution for real-time industrial applications within the DT paradigm. The proposed framework leverages Conditional GANs (CGANs) alongside the Harris Hawk Optimization (HHO) as a metaheuristic method to optimize feature selection from input data to enhance the performance of machine learning (ML) models such as Bagged Ensemble (BE), AdaBoost (AD), Support Vector Machine (SVM), K-Nearest Neighbors (KNNs), Decision Tree (DT), and Naive Bayes (NB). The efficacy of the approach is evaluated using key performance metrics such as accuracy, precision, recall, and F-measure on a triplex pump dataset. Experimental results indicate that hybrid-optimized ML algorithms (denoted by “ML-HHO”) generally outperform or match their classical counterparts across these metrics. BE-HHO achieves the highest accuracy at 95.24%, while other optimized models also demonstrate marginal improvements, highlighting the framework’s effectiveness for real-time fault detection in DT systems, where SVM-HHO attains 94.86% accuracy, marginally higher than SVM’s 94.48%. KNN-HHO outperforms KNNs with 94.73% accuracy compared to 93.14%. Both DT-HHO and DT achieve 94.73% accuracy, with DT-HHO exhibiting slightly better precision and recall. NB-HHO and NB show near-equivalent performance, with NB-HHO at 94.73% accuracy versus NB’s 94.6%. Overall, the optimized algorithms demonstrate consistent, albeit marginal, improvements over their classical versions.