A hybrid generative and transformer-based framework for anomaly detection in industrial sensor time-series for predictive maintenance Authors: Nayab Asim, Irum Matloob, Zaid Khan, Rukaiya Rukaiya, Shoab Khan, Hessa Alfraihi Published: 2026 ABSTRACT AbstractThe multivariate time-series sensor data present in Industry 4.0 generates a number of difficulties for anomaly detection for predictive maintenance, including small fault datasets with imbalanced distributions and dynamically evolving industrial environments. The hybrid anomaly detection framework suggested in this paper aims to provide a solution for both unsupervised and supervised versions of industrial anomaly detection by combining improved TransGAN architectures, transformer-based temporal sequence modelling and statistical validation. The framework includes a range of techniques including convolutional feature extraction, multi-headed self-attention transformer blocks, Bidirectional LSTM-GRU temporal learning, adversarial reconstruction learning, and weighted fusion of reconstruction-based and discriminator-based scores to detect anomalies. The proposed framework has been evaluated on two benchmark datasets, including the ’Machine Failure’ dataset and the ’SWaT’ (Secure Water Treatment) dataset and on a real-world unlabeled crane current data set, which provided a generalised evaluation across different industrial domains. On the Machine Failure dataset, the experimental results obtained were: 84.09% accuracy; 68.95% precision; 84.32% recall; and 75.86% F1-score. For the SWaT dataset, the corresponding values were: 92.25% accuracy 66.65% precision 72.33% recall and 69.37% F1-score. For the unlabeled crane dataset, various methods including GAN, Anomaly Transformer, MSPG-SEN, and statistical validation (i.e. STUMPY, Merlion) are used to conduct unsupervised anomaly detection. Instead of using predictions from each method independently, the authors proposed a weighted fusion and cross-model agreement approach to increase reliability by overlapping detections and leveraging different types of anomalies. The hybrid fusion framework consistently produced 14 high-confidence anomalies that were supported by a variety of deep learning and statistical paradigms. The combination of generative modeling, transformer-based temporal dependency modeling, and statistical validation methods proved to be a more reliable way to detect anomalies than any individual method alone. The proposed approach will provide an effective means to perform predictive maintenance in an industrial environment where there is limited labeled data and the process of validating faults is difficult.Subject terms: Engineering, Mathematics and computing Introduction The emergence of Industry 4.0, sensor-based monitoring systems that are capable of continuously capturing and recording real-time data from the industrial infrastructure are now commonplace. Industrial machines today produce substantial amounts of multivariate time series data. Data streams collected from a variety of sensors (measuring parameters like vibration, current, temperature, humidity, pressure, etc.) contain valuable information regarding the operational health, reliability, and deterioration trends of an industrial asset. Because of this, predictive maintenance (PdM) has become a critical element of modern industrial systems in that it allows for the early identification of equipment failures decreasing unplanned downtime, enhancing operational reliability and reducing maintenance costs1 therefore, anomaly detection plays an integral part in the identification of atypical behaviours of equipment prior to catastrophic failures. Current approaches to implementing predictive maintenance predominantly use supervised machine learning techniques that have been trained on labelled datasets containing both normal and abnormal operating conditions2. The majority of the time, supervised models will perform very well in a controlled experimental environment, but their widespread use in industrial environments presents numerous challenges. The data being generated about equipment failure at an industrial facility is frequently highly imbalanced, difficult to obtain and costly to label, as the creation of actual faulty conditions may result in an interruption of the manufacturing process and can also create safety hazards. Additionally, since industrial systems frequently experience fluctuation (or changes) in operating conditions, the behaviour of machinery is also subject to variation over time3–6. Due to this fact, supervised algorithms often fail to generalize well on the data when used to test new fault patterns or evolving operating environments. One of the most important reasons for maintaining labeled benchmark datasets is to provide valid ways of assessing the performance (detection, robustness and generalization) of anomaly detection methods in controlled environments. Therefore, there is an increase in recent studies focusing on unsupervised and semi-supervised methods for detecting anomalies in data that do not rely on never-before-seen fault or complete annotations of faults, but instead, learn to identify normal operational behavior from raw sensor data. For example, deep generative networks such as Generative Adversarial Networks (GANs) have shown strong promise for detecting industrial anomalies by learning the distribution of normal data (i.e., through reconstruction-based and discriminator-based anomaly scores) to identify deviations from those distributions7,8. In addition, transformer networks have received significant attention when dealing with sequential data because of their ability to effectively capture long-range temporal dependencies through self-attention. One type of transformer, Anomaly Transformer, uses association discrepancy learning techniques to help identify contextual anomalies in industrial time series data by distinguishing between normal and abnormal temporal associations9. Unfortunately, generative networks with and without transformers will not fully capture the distribution of all anomalies based on time and vice versa. Although many companies have adopted deep learning strategies for use on their sensors; most continue to use traditional techniques that have been in place for decades simply because they provide accountability of an anomaly, are computationally efficient, and scale well for use. The STUMPY10 method is one of the most widely incorporated statistical methods within industry to monitor for anomalies. Another statistical based method used frequently by industry practitioners is the Merlion11 anomaly detection framework. Unfortunately, most purely statistical techniques do not have the ability to recognize non-linear or high-dimensional dependencies often found in the multivariate industrial sensor data. so, our aim is to develop a hybrid anomaly detection framework that takes advantage of generative learning, the modeling of temporal dependencies as well as statistical validation to create a unified framework that can offer improved reliability and overall performance of anomaly detection. This study develops a hybrid predictive maintenance anomaly detection framework using supervised and unsupervised learning techniques. The supervised anomaly detection approach consists of a modified TransGAN architecture utilizing convolutional feature extraction, multi-head self-attention transformer blocks, Bidirectional long short-term memory Gated recurrent unit (Bi-LSTM-GRU) temporal sequence learning, adversarial reconstruction learning, and anomaly scoring based on adaptive thresholds. This framework learns normal operational behavior from the multivariate sequences of sensors and upon identifying an abnormal condition, it generates a weighted hybrid anomaly score based on the reconstruction errors and the confidence levels of the discriminators. The supervised algorithm is evaluated with two different benchmark industrial datasets the Machine Failure dataset and the Secure Water Treatment (SWaT) dataset. For unlabeled industrial monitoring scenarios, the framework incorporates multiple anomaly detection paradigms including GAN-based reconstruction learning, Anomaly Transformer temporal modeling, MSPG-SEN analysis, and statistical validation techniques including STUMPY, PyOD, and Merlion. Instead of relying solely on independent model outputs, a weighted fusion and cross-model agreement strategy is introduced to improve anomaly reliability by analyzing overlapping detections among different models. Experimental analysis on real-world crane current data shows that multiple anomaly detection models consistently identify 14 common anomalous regions, demonstrating stable agreement across different anomaly detection paradigms and validating the robustness of the proposed framework for unlabeled industrial environments. Several studies also examined the use of Graph Neural Networks (GNN) as a method of monitoring processes in an industrial setting and diagnosing faulty components. Recent studies, including physics- informed graph neural modeling for intelligent damage localization, and causal graph inference with adaptive dynamic structure learning, have demonstrated that using graph-based architectures can capture structural relationships across industrial components as well as between sensor networks. The majority of the proposed methods have focused on spatial dependency modeling and the learning of the structure of a graph. While those systems do focus on the representation of spatial relationships, the framework presented in this study attempts to detect anomalies using an integrated system that employs adversarial generative reconstruction, Transformer-based models that capture temporal relationships, statistical validation of any anomalous conditions, and methods to analyze the consistency of different models. Therefore, this framework is well-suited to predictive maintenance when the number of known fault labels is limited or non-existent12,13. Unlike previous methods, which largely centre on generative modelling, transformer-based temporal sequence learning, or statistical detection of anomalies individually, the proposed model brings together these diversities under one comprehensive industrial monitoring architecture. Furthermore, new methods for weighted anomaly fusion and cross-model agreement analysis are proposed to support the assessment of the validity of the anomalous characteristics of an unlabeled industrial dataset. In addition, the framework has been evaluated on both precision benchmark datasets as well as real-world unlabeled industrial currents signals supporting validation across multiple industrial monitoring environments. The main contributions of this research could be summarized as follows: An integrated hybrid industrial anomaly detection framework that includes enhanced TransGAN-based generative learning, transformer-based temporal modeling, and statisical validation approaches from a single unified architecture. An integrated hybrid industrial anomaly detection framework that includes enhanced TransGAN-based generative learning, transformer-based temporal modeling, and statisical validation approaches from a single unified architecture. An enhanced TransGAN architecture with convolutional feature extraction, multi-headed self-attention transformer block, Bidirectional LSTM-GRU temporal learning, adversarial reconstruction learning, an adaptive threshold based anomaly score is for multivariate industrial time-series analysis. An enhanced TransGAN architecture with convolutional feature extraction, multi-headed self-attention transformer block, Bidirectional LSTM-GRU temporal learning, adversarial reconstruction learning, an adaptive threshold based anomaly score is for multivariate industrial time-series analysis. A strategy for improving anomaly reliability and validating the overlap of detected unlabeled anomalies across different models in industrial datasets through the use of a weighted anomaly fusion and cross model agreement. A strategy for improving anomaly reliability and validating the overlap of detected unlabeled anomalies across different models in industrial datasets through the use of a weighted anomaly fusion and cross model agreement. A comprehensive experimental evaluation of the developed framework on both supervised benchmark datasets (Machine Failure and SWaT) and real world unlabeled crane current data to evaluate the robustness of the developed model. A comprehensive experimental evaluation of the developed framework on both supervised benchmark datasets (Machine Failure and SWaT) and real world unlabeled crane current data to evaluate the robustness of the developed model. An empirical evaluation showing complementary features of the generative, transformer based and statistical anomaly detection paradigms in capturing unique multivariate characteristics/events of industrial sensor data. An empirical evaluation showing complementary features of the generative, transformer based and statistical anomaly detection paradigms in capturing unique multivariate characteristics/events of industrial sensor data. To our knowledge, there has been little work in the area that has jointly integrated enhanced generative adversarial learning, transformer based temporal modeling, weighted anomaly fusion and cross-model agreement validation in a unified framework for predictive maintenance for both supervised and unlabeled scenarios of industrial anomaly detection. This paper has the following sections: “Related work” section reviews the previous literature; “Methodology” section provides details of the datasets and pre-processing; “Experimental setup” section describes our methodology and provides an overview of the results from our experiments; “Conclusion” section compares these different approaches; and finally, we discuss our findings and final thoughts. Related work Industry 4.0 predictive maintenance relies heavily on unsupervised / weakly supervised time-series anomaly detection because faults are rare and labels are scarce12,14,15. Previous studies have investigated the use of statistical decision layers in conjunction with LSTM or GRU sequence models. Ergen and Kozat trained the LSTM (and GRU) encoders together with OC-SVM/SVDD to learn how to represent variable length sequences using a combination of supervised and unsupervised learning. They showed improvements over classical techniques by more than double the results obtained from previous attempts16. Filonov et al. proposed the use of LSTM based forecasting for industrial multivariate data having simulated cyber-attacks. The authors adopted a reconstruction error thresholding method for performing this prediction17. Lastly, Patra et al. suggested a BiLSTM-GRU autoencoder framework for rotating machinery and proposed the use of reconstruction error plus adaptive thresholding for predictive maintenance of these assets18. In the case of both IIoT and control systems, a variety of hybrid deep architectures have been explored. Nizam et al. developed an architecture for real-time anomaly detection of streaming multivariate data from industrial IoT devices, which comprises a combination of a CNN and two-stage LSTM autoencoders19. Tang et al. built an architecture named GRN, in which they integrated a network of GRUs with a neural graph network to model sensor dependencies in data from SWaT/WADI; they reported substantial advancements in precision/recall rates and overall interpretability20. Lastly, Lu et al. proposed a multi-scale predictive maintenance solution that utilizes GRUs and Graph Neural Networks for detecting multivariate anomalies, while jointly learning how to model spatial and temporal correlations21. Recent research has broadened the use of graph-based industry monitoring through the two paradigms of physics-informed graph learning and causal graph learning. For instance, PIGMind is a physics-informed graph neural modeling framework introduced by Li and collaborators to assist in damage localization detection in carbon-fiber-reinforced polymer (CFRP) composites by including physical priors within graph construction to promote interpretability and structural damage assessment12. A second example, the Dynamic Causal Graph Inference (DCMI), was also developed by Li and collaborators as a method for mechanism-oriented fault diagnosis of industrial systems that combines adaptive causal structure learning and temporal encoding to reflect the changing dependencies between industrial-related variables13. Both of these examples illustrate that there is a burgeoning interest in using graph-based dependency modelling to support industrial monitoring and fault diagnosis. Nonetheless, the bulk of the studies using graph-based methods thus far have focused on fault localisation, causal relationship discovery, and dependency modelling; in contrast, this new framework focuses on anomaly detection via the integration of enhanced TransGAN temporal modelling and reconstruction learning, along with statistical validation and cross-model consistency analysis. The importance of transformers and benchmarking cannot be overstated. In their extensive evaluations of unsupervised/semi-supervised deep architectures (such as GANs, autoencoders, and forecasting LSTMs), Mejri et al. and Garg et al. demonstrated the significance of reliable scoring/thresholding and event-level metrics compared to the naive use of pointwise F1 measure22,14. Boggia et al. benchmarked TSADs based on transformers (e.g., iTransformer, TranAD, and variations of Anomaly Transformer) and investigated aspects of windowing, label extraction, and robustness to the contamination of training data23. TAB and tsad-ef benchmarks also provide unified benchmarks and evaluation frameworks for transposing knowledge to an evaluation environment that emphasizes that simple models with excellent scoring capabilities can perform just as well as complex, deep architectures and that evaluation processes are often misleading24,25. There have been numerous reviews and applications that indicate the broad use of deep learning in predictive maintenance activity (PdM). Both Çınar et al. and Wang et al. have reviewed machine learning and deep learning with respect to PdM in smart manufacturing, identifying key technologies, such as LSTM/GRUs, CNNs, and GAN-type models, as well as data scarcity, class imbalance, and the need for reliable benchmarks and datasets26,27. Fordal et al. adaptive PdM through sensor-derived databases is achievable through Using ANN-Based Platforms to Enable PdM Support within Industry 4.0 Models28. Arantes et al. present a method for High-Area-Under-Curve (AUC) unsupervised statistical features for industrial PdM, it is limited due to low deep temporal modelling capability29. Designed by Varalakshmi and Kumar, the Ensemble Deep Reinforcement Learning (DRL), Random Forest (RF) and Gradient Boosted Models (GBM) framework allows for real-time processing of IIoT streaming data with an emphasis on adaptive predictive fault analytics as opposed to detailed time-series representation learning30. Gawde et al. presented explainable PdM using Multi-Sensor Fusion and Explainable Artificial Intelligence (XAI) in the context of Rotating Machinery, building upon IPC’s Digital Twin fire and emphasis on multi-fault diagnosis as part of XAI Interpretability31. Recent benchmarks have focused on dataset quality, including the PATH Dataset introduced by Correia et al. to demonstrate how contamination and threshold choice can have an enormous impact on multivariate automotives PID datasets used for Multivariate Discrete Sequence Anomaly Detection (MDSAD) in automotive vehicle powertrains15. The TAB Dataset introduced by Qiu et al. illustrates a comparison of 29 different multivariate datasets from a number of different TSAD families showing extensive fair and consistent comparison of deep statistical and pretraining methods for MDSAD24. The above studies indicate a necessity for Hybrid frameworks for industrial PdM utilizing a combination of generative modelling, long-term temporal transformational designs and reliable statistical validation in situations where very few labels are available. Table 1 summarizes closely related anomaly detection methods and highlights their limitations with respect to the proposed framework. Existing approaches primarily focus on isolated paradigms such as recurrent forecasting, graph-based learning, or statistical indicators, whereas the proposed framework integrates enhanced TransGAN-based reconstruction learning, Transformer-driven temporal modeling, weighted anomaly fusion, and cross-model agreement validation within a unified predictive maintenance architecture. Table 1Comparison of related anomaly detection schemes with the proposed hybrid TransGAN-transformer-statistical framework.MethodCore ideaMain limitations compared to the proposed frameworkErgen & Kozat (LSTM/GRU + OC-SVM/SVDD)16Joint optimization of LSTM/GRU encoders with one-class SVM/SVDD for sequence anomaly detectionDoes not utilize GAN-based adversarial reconstruction or Transformer attention mechanisms. The framework also lacks weighted anomaly fusion and statistical cross-model validation for industrial multivariate datasets.Filonov et al. (LSTM Predictive Model)17LSTM forecasting model with reconstruction error thresholding for industrial multivariate anomaly detectionRelies on a single LSTM-based paradigm with static thresholding. No Transformer attention, adversarial generator-discriminator learning, or cross-model agreement analysis is incorporated.Patra et al. (BiLSTM–GRU Autoencoder)18BiLSTM–GRU autoencoder using reconstruction error for predictive maintenanceUses reconstruction-only learning without adversarial training or self-attention modeling. The approach focuses on isolated reconstruction scoring without statistical fusion or multi-paradigm validation.Nizam et al. (CNN + Two-Stage LSTM Autoencoder)19Real-time CNN–LSTM autoencoder for IIoT streaming anomaly detectionAlthough CNN and LSTM layers are used, Transformer-based temporal dependency learning and GAN-based adversarial reconstruction are absent. No weighted fusion or unlabeled cross-model validation strategy is provided.Tang et al. (GRN: GNN + GRU)20Graph neural network combined with GRU for interpretable anomaly detection in industrial control systemsFocuses mainly on graph topology and interpretability. The method does not integrate adversarial generative learning, Transformer self-attention, or statistical anomaly fusion across multiple paradigms.Lu et al. (GNN + GRU Multiscale Framework)21Hybrid graph-based GRU framework for multivariate industrial time-series analysisPrimarily emphasizes spatial-temporal graph learning while lacking GAN-based reconstruction learning, Transformer-enhanced temporal attention, and weighted anomaly fusion mechanisms.Arantes et al. (Statistical Feature-Based PdM)29Low-complexity unsupervised predictive maintenance using handcrafted statistical indicatorsRelies on manually engineered statistical features and cannot effectively capture complex nonlinear temporal dependencies. Deep generative learning, Transformer modeling, and cross-paradigm agreement validation are not included. Comparison of related anomaly detection schemes with the proposed hybrid TransGAN-transformer-statistical framework. Research gaps Most current anomaly detection systems use only one method at a time: examples include recurrent auto-encoders, graph-based temporal learning, or statistical indicators16–21,29. Although these methods may appear to work well for an isolated case of industrial application, all of these methods by themselves typically do not have an integration of the current methods for integrating adversarial reconstruction learning and cross-model validation mechanisms on the entire set of unlabeled industrial dataset. Recent benchmarking studies have shown that various strategies for calculating an anomaly score, the threshold to use when selecting an anomaly point, and the method for evaluating an anomaly will affect reliability in detecting an automobile anomaly therefore there may be a large number of instances where simple-based method for detecting an anomaly may be at least as successful as complicated deep-learning-based methods12,14,15,23–25. There has been limited simultaneous research studies on: Integration of advanced TransGAN architectures using convolutional feature extraction, multi-headed self-attention mechanisms, and bidirectional LSTM-GRU temporal learning, is one of the main contributions of this work to support real-time anomaly detection in industrial multivariate time-series datasets. Integration of advanced TransGAN architectures using convolutional feature extraction, multi-headed self-attention mechanisms, and bidirectional LSTM-GRU temporal learning, is one of the main contributions of this work to support real-time anomaly detection in industrial multivariate time-series datasets. By including the temporal dependency representation through the use of a Transformer-based architecture within our adversarial learning-based reconstruction framework, we have created an integrated model that can validate anomalies in the multivariate time series of the target dataset through various anomaly detection methods. By including the temporal dependency representation through the use of a Transformer-based architecture within our adversarial learning-based reconstruction framework, we have created an integrated model that can validate anomalies in the multivariate time series of the target dataset through various anomaly detection methods. The fused-based approach developed in this study allowed for weighted anomaly detection between deep-generative, Transformer-based, and statistical will be applied to validate anomalies in unlabeled industrial datasets using cross-model analysis. The fused-based approach developed in this study allowed for weighted anomaly detection between deep-generative, Transformer-based, and statistical will be applied to validate anomalies in unlabeled industrial datasets using cross-model analysis. To ensure the effectiveness of the proposed anomaly detection methods, both supervised industrial benchmark datasets and real-world unlabeled industrial sensor data were used to evaluate their robustness in the context of predictive maintenance. To ensure the effectiveness of the proposed anomaly detection methods, both supervised industrial benchmark datasets and real-world unlabeled industrial sensor data were used to evaluate their robustness in the context of predictive maintenance. This framework overcomes limitations in predictive maintenance associated with the lack of labels on time series data, class imbalance, and noise typically found in industrial work settings by combining generative learning of distribution, Transformer-enhanced temporal modeling, statistical validation of detection of an anomaly using weighted cross-paradigm fusion, and machine learning-based validation procedure. Methodology The proposed framework combines supervised as well as unsupervised learning techniques together to create an integrated hybrid anomaly detection mechanism for predictive maintenance purposes that utilizes industrial environments and processes. The anomaly detection framework is developed specifically to solve the challenges associated with using multivariate industrial time-series data that have nonlinear, temporal dependencies; operational noise; limited training sets containing faults; and highly skewed anomaly distributions. This framework provides a completely new way of detecting anomalies in real-world industrial processes while eliminating the drawbacks associated with previously developed single-model based anomaly detection techniques. Specifically, the proposed framework combines deep generative learning, transformer-based temporal models, statistical validation and the application of weighted fusion analysis techniques which provide improved robustness and reliability when it comes to the detection of anomalies across varying types of industrial processes. Evaluation of the methodology included the use of various labeled benchmark datasets and unlabeled real-world industrial datasets. The benchmarking of the methodology involved conducting both supervised (machine failure, and SWaT control system) experiments and unsupervised (real-world crane current) experiments on data sources that utilized ground-truth anomaly labels in controlled conditions, as well as without any true anomaly labels in uncontrolled conditions. The combination of the two types of experiments afforded researchers an opportunity to assess the efficacy of the anomaly detection framework in both controlled benchmarking environments, and in authentic monitoring of industrial processes. The TransGAN framework trained in a supervised manner to model the normal distribution of data generated from healthy operation. The inferred anomalous data is identified by comparing the reconstructed datasets with the input dataset and estimated confidence scores from the discriminator. Detection accuracy and precision were evaluated for both supervised experiments using known fault labels, including recall and F1-score. In an unsupervised manner, several different anomaly detection methods run on the crane sensor data without ground truth fault labels. These included using Transformer-based temporal reconstruction learning, GAN-based anomaly scores, STUMPY matrix profile, and Merloin Isolation Forest methods to evaluate anomalies. Since there were no labeled anomalies in the crane data, reliability of detected anomalies was assessed via analyses of weighted anomaly fusion and cross-model consistency, rather than through conventional classification metrics, such as accuracy or F1-score. The overall analysis involved four steps: preprocessing and output generation of industrial sensor data, detecting anomalies from the data with deep learning, validating statistics around detected anomalies, and combining the results from step 3 with consistency analysis to complete the anomaly detection process. Figure 1 illustrates the complete architecture of the proposed hybrid predictive maintenance framework. Hybrid framework for anomaly detection—enhanced TransGAN, transformer based temporal modelling, statistical validation, and weighted fusion for industrial predictive maintenance. Table 2 presents a summary of the supervised and unsupervised datasets, learning modes, and anomaly detection models which were incorporated into the hybrid predictive maintenance approach which was proposed. Table 2The proposed hybrid predictive maintenance framework employs various datasets, learning settings, and anomaly detection methods for predictive maintenance purposes.DatasetLearning settingApplied modelsPurposeSWaT datasetSupervisedTransGAN with CNN, Transformer, BiLSTM, and GRU modulesEvaluation of labeled industrial control system anomalies using reconstruction and adversarial anomaly scoring.Machine failure datasetSupervisedEnhanced TransGAN framework with discriminator-based scoring and reconstruction learningPredictive maintenance fault detection using labeled machine operational data.Crane sensor datasetUnsupervisedSTUMPY Matrix Profile, Merlion Isolation Forest, GAN-based anomaly detection, and Transformer-based reconstruction modelDetection of unknown anomalies from unlabeled industrial current and vibration sequences using statistical and deep learning approaches.Crane sensor dataset (fusion stage)Unsupervised hybrid fusionWeighted anomaly fusion of STUMPY, Merlion, Transformer, and GAN outputsCross-model anomaly validation and robust anomaly agreement analysis for unlabeled industrial monitoring. The proposed hybrid predictive maintenance framework employs various datasets, learning settings, and anomaly detection methods for predictive maintenance purposes. Industrial sensor data processing The proposed approach is built on the basis of industrial multivariate sensor data derived from machine monitoring systems. These datasets consist of different types of sensors (including vibration, temperature, power consumption, current, humidity, time spent in state of operation, and machine type), and are presented in both structured (tabular) and sequence-based (signal) forms. Within the crane dataset there are a number of columns that include temporal sensor sequences in comma-separated form; these were turned into numerical arrays before any other processing was performed. The multivariate time-series dataset is expressed as: where each observation contains multiple industrial sensor measurements recorded over time. Normalization methods were used to avoid large differences in scale and irrelevant data when training models have been introduced. TransGAN’s use of RobustScaler normalizer is due to its effectiveness in resisting extreme operations fluctuations and having very noisy industrial measures. For overall data leave-in’ from transformer based temporal reconstruction learning and statistical validation, the StandardScaler was use to create a zero mean, unit variance around the models developed from the data sets in prior experiments. GAN based models were normalized with MinMaxScaler across a maximum range of [-1,1]. The purpose of this was to create an even better fit with functions used through Tanh and make it easier to implement using an adversarial approach when optimizing these models. Overall using these methods to normalize data helped to stabilise converged outcomes while also reducing response to noisy operations than reducing the potential separations at the time of training. Sequence window generation In order to maintain both time continuity as well as the operation of the sensors in the industrial environment, we have utilized a method called sliding-window segmentation to produce multiple, overlapping subsequences from the continuous multivariate signals produced by the industrial sensors. Each of these subsequences will then be represented as: where L denotes the sequence length. To maintain fine-grain temporal consistency across neighbouring windows and maximise learning of sequential context, we chose to implement a stride of one. As a consequence of the characteristics of each dataset and the requirements of each model’s architecture, we have selected multiple different sequence lengths. For supervised TransGAN experiments, a sequence length of 32 is used in order to provide evidence of longer term dependencies in the behaviour of industrial machines. For the transformer-based reconstruction learning and statistical validation experiment, we opted to use a sequence length of 10, in order to better reflect localised deviations over time and provide greater computing efficiency. The generated overlapping sequences allowed our framework to learn time-based operational patterns, sequential dependencies, and abnormal transitions in the industrial processes being assessed. Training and validation strategy For the supervised experiments and the unsupervised experiments, different training methodologies are applied based on the characteristics of each dataset and whether or not labels were available for each dataset within the Machine Failure Dataset and SWaT Dataset. The sequence generated by the supervised methods for the two datasets described in prior paragraphs is separated into normal and abnormal operational sequences using the ground-truth labels provided by each dataset based on the Temporal Sequence Data generated by the datasets being used. The Proposed TransGAN framework is used to train only on healthy operational sequences to obtain a model for the distribution of normal behaviour of a machine, in doing so, the normal distribution of previously generated sequences allowed for the identification of previously unseen sequences, or anomalous sequences based on reconstruction deviation and confidence analysis performed by the discriminator during inference. For the learning of temporal reconstruction with Transformers, the generated operational sequences underwent an 80:20 split into a training and validation sequence subset. The training sequence subset is used to define the optimal reconstruction learning, and the validation sequence subset is used to assess the reconstruction error between the generated and the original sequence by estimating reconstruction error, determining anomaly scores, and calculating thresholds after training to avoid overfit and improve the generalisation of the trained Temporal Sequence Generator when exposed to previously unseen operational behaviour. Since there are no fault annotations present in the Unsupervised Crane dataset, conventional supervised evaluation statistics could not be employed to evaluate the reliability of an anomaly therefore, statistical consistency analysis, weighted anomaly fusion, and cross-model agreement among independent anomaly detection paradigms were used to determine whether an observed anomaly was appropriately assigned an alias. The presented findings are from the highest-scoring experimental runs, which resulted from extensive experimental tuning of the model and optimization of its hyperparameters. Due to the high cost of training GAN and Transformer based models repeatedly using large-scale industrial time-series datasets, no statistical analysis based on multiple experimental runs was performed. Future research will involve re-experimentation with multiple random initialization of the models to calculate the means and standard deviations for each of these random initializations in order to provide additional information on the robustness and reproducibility of the models at the completion of the experiments. Feature engineering The unmapped crane sensor data is the main focus of the feature construction process in efforts to improve the ability to separate between anomalous and normal data points and also improve the capabilities in statistical representation learning (SRL). As part of extracting SRL at the time of generating these features to be used for classification, statistical sequence features are extracted for each of the temporal windows of interest (as defined by the industry current/operational sensor windows) based on the use of the CT1, CT2, CT3, CT_Avg, Total_Current and State_Duration sensor sequences. For each generated subsequence , the statistical feature extraction process is represented as: where denotes the statistical feature extraction operation. The extracted statistical representations improved discrimination between stable operational behavior and irregular temporal deviations, thereby strengthening both statistical validation models and Transformer-based anomaly reconstruction learning. Enhanced TransGAN-based anomaly detection The main component of the supervised anomaly detection portion of this proposed model is a modified version of a Generative Adversarial Network architecture called TransGAN that uses TensorFlow and Keras for implementation. The new architecture consists of features extracted by convolution with multi-scale features, self-attention learning with Transformers, bidirectional modeling of temporal dependencies using RNNs, and an adversarial methodology to reconstruct predictions based on received data. The generator network takes multivariate real-time signals from industrial environments as input to generate an output equating to the normal expected operational profile of the system being monitored. The use of one-dimensional convolutional layers with variable kernel sizes allows the model to capture localised temporal dependencies as well as multi-scale features that are representative of different types of operations from the signals received from sensors used in an industrial setting. Both batch normalisation and Leaky ReLU activations help support the improved stability of the distributions of extracted features and aid with improving the nonlinear learning capabilities of the hidden layer representations of the generator network. Once the convolutional features have been extracted, the output from the last convolutional layer will be input into a series of Transformer blocks containing multi-head self-attention mechanisms, feed-forward neural network layers, skip connect residual connections, GELU activation functions, and layer normalisation layers, to create a representation of the long-term relationships among the temporal patterns and contextual operating behaviour of the industrial processes being monitored. The information rendered by the previous transformer blocks allows the model to learn the global relationships between the inputs based on their actual time-stamped arrangements of when they were collected at the time of monitoring those behaviours; something that localised-convolutions alone are not able to clearly document. In order to strengthen temporal dependency modeling, Bidirectional LSTM and Bidirectional GRU layers are added after the Transformer blocks, which allowed the recurrent layers to process temporal sequences both forwards and backwards. This approach allowed for the framework to fully capture an entire operational transition along with the corresponding sequential machine dynamics. The decoder took the generated operational representation and reconstructed it to the original multivariate sensor space by using upsampling techniques and convolutional reconstruction layers. The final output of the generator is reconstructed industrial sequences that presented normal operational behaviour. The discriminator is intended to distinguish between reconstructed normal sequences and abnormal operational behaviour patterns. The discriminator architecture consisted of convolutional feature extraction layers, bidirectional recurrent learning modules, dense feature learning layers, dropout regularization, and a sigmoid-based confidence estimate. The discriminator outputted a confidence score which represented the probability that a sequence is normal operational behaviour. The adversarial optimization process is represented as: where G denotes the generator and D denotes the discriminator. The generator is pre-trained before adversarial optimization on healthy operational sequences only via reconstruction learning in a pre-training process. Reconstruction learning utilized the Huber loss and MAE loss functions through Adam optimization with early stopping and ReduceLROnPlateau to provide stabilization during convergence as well as improved reconstruction quality. There are a number of GAN stabilization methods that are incorporated into the training pipeline including: label smoothing, learning rate scheduling, batch normalization, dropout regularization, generator pretraining, and noise injection. These methods enabled mode collapse reduction, improved adversarial stability, reduced rate of false positive detection, and improved separation between normal and anomalous operational regions. TransGAN anomaly scoring The final TransGAN anomaly score combines reconstruction deviation and discriminator confidence estimation. The reconstruction error is computed as: The final anomaly score is defined as: where represents discriminator confidence. Adaptive percentile-based thresholding was applied over normal reconstruction scores to determine anomaly boundaries. Sequences exceeding the adaptive threshold were classified as anomalous operational behaviour. Transformer-based temporal anomaly detection A Transformer-based reconstruction model is built with PyTorch to explicitly model temporal inconsistencies in industrial sequences. In contrast to GAN based models, which focus on learning operational data distributions, the focus of the Transformer models is on temporal dependencies and sequential behavioural deviations across industrial processes. The Transformer architecture includes linear embedding layers, multiple heads of self-attention, stacks of Transformer encoder layers, and feedforward networks and reconstruction output layers. The input sequences are first transformed into a high dimensional latent representation and processed through stacked Transformer encoder blocks. The ability of multi-headed self-attention allowed the Transformer model to learn long-term temporal dependencies and contextual dependencies across multiple observations from multiple sensors in an industrial setting. The Transformer model produced a reconstructed normalized multivariate sensor sequence from the input sequence to calculate anomaly scores using reconstruction error analysis. The reconstruction loss can be expressed mathematically as: The anomaly score is computed as: Sequences exceeding the reconstruction threshold were classified as anomalous operational patterns. Reconstruction error distributions generated from both training and validation sequences were used for adaptive threshold estimation, thereby improving anomaly sensitivity and reducing unstable threshold behaviour. STUMPY matrix profile-based validation To independently validate the statistical distribution of anomalies in the unlabeled dataset from the cranes’ sensors, matrix profile analysis using STUMPY iss conducted. The matrix profile method detects subsequences that are discordant due to their significant deviation away from the other neighboring temporal patterns found within time-series industrial data. In this case, statistical features from several crane sensor signals (i.e., CT1, CT2, CT3, CT_Avg, total_current and state_duration) were analyzed for abnormal operational regions. The first step in performing matrix profile analysis is to extract the mean and standard deviation features from the temporal sequences and to then normalize these series. The STUMPY algorithm applied the sliding window as a subsequence to measure how similar neighboring temporal patterns are to one another in series. Discordant subsequences are identified due to their significantly higher matrix profile distance than the dominant operational behavior learned through the remaining series in the dataset. The criterion used to define an anomaly is as follows: where MP(i) denotes the matrix profile value at sequence index i, while and represent the mean and standard deviation of the matrix profile distribution, respectively. Sequences exceeding this adaptive statistical threshold were treated as anomalous operational regions. The matrix profile branch provided interpretable subsequence-level validation and enabled visualization of localized temporal deviations within industrial current signals. Merlion isolation forest validation The Merlion framework, which uses an Isolation Forest algorithm, produced another statistical validation branch using an anomaly detection framework. The Merlion branch used the extracted crane sensor feature space to identify statistically isolated operational behaviours as opposed to using sequence reconstructions. The same CT1, CT2, CT3, CT_Avg, total_current, and state_duration sensor sequences that are used for the anomaly analysis were also used to create the statistical representations used within the Merlion framework. Using identity transformation and aggregate alarm thresholding, the Merlion framework is configured to permit minimal alteration of the original temporal feature distributions while increasing anomaly score stability. Isolation Forest produced individual anomaly scores as a result of how well each individual observation could be separated from the remainder of the operational data by recursively partitioning the data into two, and thus, any observation which required fewer partitions to be isolated would be deemed to be more anomalous. The dynamic computation of the anomaly threshold is specified as: where μ and σ denote the mean and standard deviation of the generated anomaly scores. Samples exceeding the threshold were classified as anomalous operational points. The Merlion branch provided an additional independent statistical verification mechanism that complemented the temporal reconstruction capabilities of the Transformer and GAN-based models. Hybrid weighted fusion framework In the last stage of the proposed framework, the combination of anomaly scores from several independent detection methods is used to help provide more reliability for anomalies and lower the number of false positive detections. Each model can capture a different type of industrial anomaly thus, the aggregation of complementary information provided by statistical and deep learning methods is accomplished through weighted score fusion. In this fusion stage, normalized anomaly scores from the following four branches were incorporated: the STUMPY matrix profile branch, the Merlion Isolation Forest branch, the Transformer Reconstruction Branch, and the GAN-based anomaly detection branch. All anomaly scores are individually Min–Max standardized before fusion to provide a common score distribution for all models. The final fusion score is computed as: where , , , and represent the normalized anomaly scores produced by each branch of the framework. The implemented fusion weights were experimentally selected as , , , and . A higher weight is assigned to the Transformer branch because of its stronger capability to model temporal dependencies and sequence-level contextual inconsistencies within industrial sensor streams. The fusion weights assigned are based on the amount of the various anomaly detection branches inputted into the overall framework that were used to develop it. The greater weight is assigned to the Transformer branch due to its more consistently stable temporal representations and thus its better means of capturing sequential behaviour variation relative to the other statistical validation branches. All other branches received equal weights in order to preserve their contribution to anomaly verification, while ensuring an even and balanced means of fusing information from the different branches into the overall framework. The final anomaly threshold is computed dynamically using the statistical distribution of the fused anomaly scores: where and denote the mean and standard deviation of the fused anomaly score distribution. Sequences exceeding this threshold are classified as final anomalies. The weighted fusion strategy improved robustness by integrating distributional, temporal, and statistical anomaly characteristics into a unified predictive maintenance framework. Table 3 summarizes all thresholding strategies used across the proposed framework. Table 3Thresholding strategies used in different framework components.Model branchThreshold strategyApplied datasetEnhanced TransGANAdaptive percentile-based thresholding on normal reconstruction scoresMachine failure, SWaTTransformer reconstructionModel-specific reconstruction error thresholdMachine failure, SWaT, CraneSTUMPY matrix profileCrane datasetMerlion isolation forest anomaly score thresholdCrane datasetFusion scoreCrane dataset Thresholding strategies used in different framework components. Cross-model consistency analysis The dataset of crane sensors lacked ground-truth anomaly labels, therefore cross-model consistency analysis is used to estimate the reliability of the anomalies detected. This analysis was performed by comparing the anomaly detections produced independently by the TransGAN model, the Transformer reconstruction model, analysis with STUMPY matrix profile, and validation with Merlion Isolation Forest. The final anomaly decision is represented as: where f(· ) represents the weighted fusion and consistency analysis process. The validity of an agreement mechanism is assessed by using multiple different independent paradigms to evaluate whether there are repeated detections of anomalous operational regions. Any anomaly that is detected at the same time from all three models (deep generative modeling, temporal reconstruction modeling and statistical validation modeling) is likely to be a more accurate representation of an operational irregularity. Cross-model validation of results helps to reduce the potential for isolated false alarms and increase the reliability of anomaly detection in real-world industrial environments when labelled failure data are unavailable. Motivation for hybrid integration Detecting abnormalities in industrial production systems continues to be difficult because the data generated from sensors used in an industrial environment has (1) nonlinear temporal dependencies (2) operational variance (3) sparsely located faults (4) noisy measurements (5) highly imbalanced distributions of anomalies. Anomaly detection is complicated in real-world (industrial) settings due to the fact that abnormal operational behavior is generally undefined, context-specific, and represented inconsistently across different sensor streams. There are many different types of individual anomaly detection approaches, each with their own respective strengths and weaknesses. Models based on GANs (generative adversarial networks) can effectively learn the underlying distribution of normal operational behavior using adversarial learning (reconstruction of input); unfortunately, some subtle temporal inconsistencies/weak sequential deviations may not be captured by these models. Models using transformer technologies provide strong temporal dependency modeling by employing self-attention and learning sequences in context, but there is still no guarantee that the underlying distributional characteristics of an industrial environment (when noisy) will be captured by these technologies. Statistical anomaly detection approaches (e.g. STUMPY matrix profile analysis, Isolation Forest) generally provide interpretable anomaly validation and operational transparency, but their ability to detect anomalies with respect to extremely nonlinear, high-dimensional patterns in industrial environments is limited. The proposed framework is designed to overcome these limitations by bringing together deep generative distribution learning, Transformer-based temporal dependency modelling, statistical anomaly validation, cross-model agreement analysis and weighted fusion of anomalies into a single unified predictive maintenance architecture. The combined use of these complementary anomaly detection paradigms will allow the framework to detect simultaneously distributional deviations, temporal behaviour inconsistencies and statistically abnormal operational subsequences. Moreover, cross-model agreement analysis will further increase the reliability of anomalies by providing validation of anomalies that are consistently detected by independent models, and weighted fusion of anomalies will diminish false positive detections that result from independent anomaly predictors. This will ultimately result in a more robust, more separable and more reliable predictive maintenance system for use in industrial environments where fault labels are few, very imbalanced, or entirely absent. Dataset specific framework configuration The suggested framework’s evaluation took place in the categories of supervised and unsupervised predictive maintenance. While the complete hybrid architecture consists of the same preprocessing and generation operations, the active model branches (from the same hybrid architecture) depend upon the nature of the dataset (properties) and the availability of labels. In the case of the supervised Machine Failure and SWaT datasets, the primary anomaly detection model was the Enhanced TransGAN framework. This model employed convolutional feature extraction, Transformer based self-attention learning, Bidirectional LSTM-GRU temporal modelling, adversarial reconstruction learning, Mahalanobis distance scoring, and Isolation Forest validation. Since these datasets contained ground truth labels it was possible to evaluate the various classification metric performances (accuracy, precision, recall and F1-score). For the unlabeled crane current dataset, an active independent unsupervised validation branch is activated. Because there are no fault annotations available on this dataset, anomaly detection relied primarily on Transformer based temporal reconstruction, STUMPY matrix profile analysis, Merlion Isolation Forest validation, weighted anomaly fusion, and cross-model consistency analysis for anomaly detection. Anomalies that are detected by Paradigms of independent Anomaly Detection Models (as above) are used to improve the reliability of anomalies. Thus, the proposed framework provides a unified preprocessing pipeline while activating independent anomaly detection and validation branches according to the availability of fault labels and properties of the datasets.Table 4 provides a summary of the framework components activated for each dataset, clearly distinguishing the supervised learning branch from the unsupervised anomaly validation branch. Table 4Dataset-specific activation of framework components.ComponentMachine failureSWaTCrane datasetSequence generation\checkmark\checkmark\checkmarkEnhanced TransGAN\checkmark\checkmark–Transformer reconstruction\checkmark\checkmark\checkmarkMahalanobis distance\checkmark\checkmark–Isolation forest validation\checkmark\checkmark–STUMPY matrix profile––\checkmarkMerlion isolation forest––\checkmarkWeighted fusion––\checkmarkCross-model consistency analysis––\checkmark Dataset-specific activation of framework components. Algorithmic summary of the proposed framework The structure of the proposed method for anomaly detection in a supervised framework, the unsupervised framework, and a weighted fusion validation framework will be improved by providing two concise algorithmic summaries that explain each method. The algorithms provide a clear picture of the major steps used in both types of anomaly detection as well as the validation of the anomaly detection across both labeled and unlabeled datasets from industrial sources. Algorithm 1: supervised enhanced TransGAN-based anomaly detection Algorithm 1 summarizes how we apply the supervised anomaly detection workflow to both the Machine Failure and SWaT datasets. The training method for developing a model of normal operations from the Enhanced TransGAN architecture has been outlined in terms of using reconstruction-based scoring methods and validation methods to identify potential anomalies. Supervised enhanced TransGAN-based anomaly detection. Algorithm 2: unsupervised hybrid anomaly detection The crane dataset is processed using unsupervised anomaly detection methods, as outlined in Algorithm 2. These techniques rely on the use of many different and independent anomaly detection paradigms to identify actions that deviate from normal operational activity without the need for fault-labeling. Unsupervised hybrid anomaly detection. Algorithm 3: weighted fusion and cross-model validation The weighted fusion and consistency analysis process outlined in Algorithm 3 validates any detected anomalies using several independent predictive models. As a result, the process improves the reliability of detected anomalies through a greater emphasis on agreement across models. Weighted fusion and cross-model validation. Experimental setup This Section presents the components of the experimental frame used in this study. Further information with respect to the development of the dataset employed for training along with descriptions of the associated training methods and processes used to help implement the hybrid anomaly detection framework can be found in this section. Datasets Three datasets of both labeled and unlabeled time-series data are used to evaluate the proposed anomaly detection framework. The Machine Failure dataset and the SWaT dataset are used as labeled datasets for a supervised approach to anomaly detection and quantitative evaluation, while a current dataset from an unlabeled crane application is used as an unlabeled dataset for an unsupervised approach to anomaly detection and cross-validation between all models. These datasets represent different types of industrial environments, including predictive maintenance systems, industrial control systems, and actual operational current monitoring systems. The diverse nature of these datasets allowed for a thorough evaluation of the proposed framework in both a supervised and an unsupervised manner. Machine failure dataset The Machine Failure Dataset32 represents a multivariate industrial predictive maintenance dataset collected from smart manufacturing environments where various sensors record telemetry data from machines in both normal and abnormal mode. It contains lots of sensor data collected from a number of different industrial machines including: air temperature, process temperature, rotational speed, torque, tool wear and failure labels for machines that encounter thermal, power overload, over/under stress or another form of malfunction causing the machines to break down. The goal of this data set is to allow researchers to assess the performance and capabilities of a proposed framework for writing future supervised algorithms using ground truth information about failures. The data set is helpful in predictive maintenance research because it not only has failure events (i.e. machine failures) identified but also includes normal operational performance information that can serve as input to future machine learning algorithms attempting to learn smart predictions of the probability of future machine failure across a wide variety of operating states. SWaT dataset (secure water treatment) The Secure Water Treatment (SWaT) dataset33 is a large-scale dataset on industrial control systems generated at a testbed for an operational water treatment plant. The SWaT dataset collects multivariate sensor and actuator readings from numerous stages of a water purification/distribution system. Some of these sensor readings include continuous time series of flow rates, water levels, valve states, pump states, and pressure readings from pressure sensors. Besides normal operational behavior, the SWaT dataset also contains several attack scenarios that target the water processing operation and introduce anomalous behavior into the process. The SWaT dataset is a useful benchmark for evaluating the performance of different types of algorithms that detect anomalies in a complex industrial cyber-physical system because of its large size, the temporal dependency of the data, and the highly imbalanced distribution of anomaly measurements in the data. The SWaT dataset has also been used in this research to evaluate the scalability and robustness of the proposed supervised GAN framework for anomaly detection in complex industrial cyber-physical systems. Cranes dataset (unlabeled real-world dataset) The performance of unlabelled real-world industrial crane current data from a dataset was evaluated in an evaluation of the proposed framework’s ability to perform unsupervised anomaly detection. The dataset consists of multi-channel electrical current measurements collected from operating crane systems. Crane current (from different channels, such as CT1, CT2, and CT3 is formatted as time-series data. The raw current signals are converted to numerical sequences for deep learning models to predict and then divided into a fixed-length temporal window for deep learning analysis. Since no labels for the anomalies are found within the dataset, it is used to compare the consistency and overlap of several unsupervised models (GAN, Anomaly Transformer, MSPG-SEN, STUMPY, and Merlion). The dataset is representative of typical industrial conditions with naturally occurring fluctuations, transient disturbances, and concealed abnormal operational patterns. The dataset is private therefore it cannot be publicly shared due to confidentiality. The datasets used to evaluate the proposed anomaly detection framework have been summarized in Table 5. Table 5Summary of datasets used to evaluate the proposed anomaly detection framework.DatasetLearning typeFeatures / sensor modalitiesData characteristicsLabels availableApplication areaMachine failure datasetSupervisedTemperature, rotational speed, torque, tool wearMultivariate industrial telemetry dataYesPredictive maintenance and machine fault detectionSWaT datasetSupervisedWater levels, flow rates, valve states, pressure, actuator signalsLarge-scale industrial control system time-seriesYesCyber-physical anomaly detection in industrial systemsCranes datasetUnsupervisedMulti-channel electrical current signals (CT1, CT2, CT3)Real-world multivariate current time-seriesNoReal-world industrial anomaly detection Summary of datasets used to evaluate the proposed anomaly detection framework. Training and implementation details Amazon Web Services (AWS) provided cloud computing resources to perform all experiments in Python on Google Colab with GPU acceleration using TensorFlow/Keras/PyTorch (i.e. TensorFlow/Keras/PyTorch) for all deep learning model training and testing. In addition, the framework implements both supervised and unsupervised anomaly detection models in TensorFlow/Keras/PyTorch using NumPy/Pandas for data pre-processing and manipulating, and matplotlib/seaborn for visualizing and analyzing results. Finally, all model checkpoint files (anomaly scores and intermediate outputs) were stored in Google Drive for reproducibility and tracking experimental results. Before training the deep learning models, all datasets were analysed using preprocessing methods of normalisation and sequence generation. For instance, the numerical values of raw sensor data (i.e. raw) were normalised using Min-Max normalisation to help mitigate the effects of parallel convergence of the model as a result of differences in the relative magnitude of the features of each measured value, and as a result, to help improve statistical convergence of the model as well as, boundaries of imbalance in the relative magnitudes between features of the respective sensor data. As such, to facilitate sequence-based representation of the data used to build out the models (for example, by using a sequencing algorithm), the data was also segmented into fixed length (< 10ms) overlapping temporal/cyclic windows, which are formed from using a sliding window technique, thereby allowing the models to learn both statistical and temporal operating properties of the industrial sensor signals. We trained a GAN-based architecture consisting of generator/discriminator networks using an adversarial training approach for supervised anomaly detection. The generator network was trained to produce examples of normal industrial operation (i.e., the training set was representative of normal operation in the field). The role of the discriminator was to compare operating sequences that were produced using the generator with operating sequences that had been generated (i.e., true operating sequences). To improve stability when training the GAN and increase the accuracy of the generated anomaly scores, multiple enhancements were implemented in the updated implementation. The generator utilized Leaky Rectified Linear Activation Functions with layer normalization to improve the flow of gradients and representations. Rather than using standard binary cross-entropy to determine the generator’s performance, we used binary focal cross-entropy in order to increase the sensitivity of the generator to challenging-to-detect anomalies. We also added label smoothing and Gaussian noise regularization to the discriminator in order to maintain confidence in the true operating sequences and provide stability to the adversarial learning process. The GAN model was trained using a batch size of 32 and the Adam optimizer for 140 epochs on the machine failure dataset. As the losses for both the discriminator and generator approached equality, the stability of the GAN-based model improved. The final value of the discriminator’s loss was approximately 0.6934 and the final value of the generator’s loss was approximately 0.7024. The anomaly threshold for final labelling of the anomalies was developed by calculating an adaptive anomaly threshold from the statistical distribution of the normalized anomaly scores. The adaptive anomaly threshold was calculated to be 0.3331. The SWaT (Secure Water Treatment) dataset was trained using a dual-discriminator Generative Adversarial Network (GAN) architecture optimized to learn the structure of multivariate industrial control system signals at scale. To meet the complexity and large-scale nature of the SWaT dataset, optimized reconstruction learning and balancing of the discriminator losses were used during training. Through training for 50 epochs, the final discriminator losses for the SWaT GAN were 0.709, while the generator loss was 0.682. The sequences generated by the trained generator were then compared to original sequences in order to calculate anomaly scores and to identify periods of anomalous operational behaviour by using an adaptive thresholding approach. The four independent models of deep learning (including GAN, Anomaly Transformer, Stumpy and MSPG-SEN) are used to evaluate unsupervised experiments on the crane dataset. The Anomaly Transformer was trained by minimizing reconstruction error and learning temporal association discrepancies, with the goal of capturing hidden temporal inconsistencies present in industrial current signals. The purpose of MSPG-SEN is to learn both multi-scale temporal dependencies across current sequences, as well as to identify the local characteristics of anomalies. The outputs from all deep models were analyzed independently, as well as through an overlap analysis, to assess for consistency in the patterns associated with the detection of anomalies. To enhance robustness and reduce models’ decision biases that would otherwise be solution dependent or model-specific in nature, a hybrid approach to anomaly score fusions is developed by fusing normalized, standardized anomaly scores derived from four models: STUMPY, Merlion, Anomaly Transformer and GAN. Before rolling up aberrant or anomalous score results via fusion methods, fusing all models’ outputs required that all scores have been normalized using MinMax scaling. After normalizing the anomaly scores, each anomalies or aberrant score was fused together using weighted averages the Transformer model score was given a higher weighting because of its greater ability to model temporal dependencies within industrially replicated sequences than the other methods. Dynamic thresholding is also implemented based on the mean and standard deviation of the scores generated through model fusions to finally produce one combined score for each model; Finally, the hybrid fusion framework was successful in the detection of 14 anomalous data points (high-confidence detection) from the cranes’ dataset having produced a final threshold of 0.4849. Lastly, the visualization of the anomaly sequence was created by comparing the detected sequences to their neighbour states in CT1, CT2, CT3, CT_Avg, total_current, and state_duration using various real time sensor channels, thereby allowing a qualitative validation and interpretive analysis of the detected anomalous behaviour. Results and discussion This section presents the experimental evaluation of the proposed anomaly detection framework on both supervised and unsupervised industrial datasets. The supervised experiments are conducted on the Machine Failure and SWaT datasets using the proposed GAN-based framework to quantitatively evaluate anomaly detection performance using standard classification metrics including accuracy, precision, recall, and F1-score. Table 6 evaluated thread for the supervised evaluations of the SWaT and Machine Failure data sets presented strong results in the ability to identify anomalies in multiple industrial monitoring scenarios. As demonstrated by the received evaluation metrics, the performance of our framework was exceptional based on its high accuracy and well-balanced precision & recall characteristics both indicative of the ability to accurately identify anomalous operational states. Table 6Presents a performance comparison of the proposed TransGAN-based anomaly detection framework using various classification-based evaluation metrics for the supervised SWaT and Machine Failure datasets.DatasetAccuracyPrecisionRecallF1-scoreSWaT dataset0.92250.66650.72330.6937Machine failure dataset0.84090.68950.84320.7586 Presents a performance comparison of the proposed TransGAN-based anomaly detection framework using various classification-based evaluation metrics for the supervised SWaT and Machine Failure datasets. The confusion matrices obtained using the Machine Failure and SWaT datasets, which are shown in Fig. 2, indicate that the proposed framework accurately identifies both anomalous and non-anomalous operational states in supervised monitoring within an industrial setting. Confusion matrices of machine failure and SWaT datasets. In contrast, unsupervised anomaly detection experiments are conducted on the unlabeled crane current dataset using GAN, Anomaly Transformer, MSPG-SEN, STUMPY, and Merlion models. Since no ground truth labels are available for the crane dataset, model consistency, overlap analysis, and anomaly score agreement are utilized as indirect validation measures.In the unsupervised experiments with the crane current data set, several anomaly detection techniques (i.e., GAN, Anomaly Transformer, MSPG-SEN, STUMPY, and Merlion) are tried to find different types of invalid data from the current signals measured in an industrial setting. Using normalized sets of current sequences for the training of the GAN model, the model learned how to identify anomalies based on how confident it is that each current sequence represented valid operating behaviour to the model’s definition of valid. During training of the Anomaly Transformer model, two techniques were used (1) reduce the difference between the reconstructed sequence and the original current sequence reconstruction error and (2) learn to recognize when the sequence being passed to the model had inconsistencies in time (temporal association discrepancy). The MSPG-SEN algorithm is used to learn about the multi-scale temporal characteristics and characteristics of anomalous data within different industrial sensor windows related to the current. The STUMPY algorithm is used for finding unique subsequences based on a matrix profile. The Merlion algorithm is used as a statistical anomaly detection framework related to forecasting, and thus identifying and scoring residual anomaly data. Unsupervised deep learning results on crane dataset Three unsupervised deep learning techniques have been utilized to detect anomalies in the unlabelled Crane Current dataset; Anomaly Transformer, Unsupervised GAN and MSPG-SEN. To validate these techniques, due to the absence of labels that can be used for validation purposes, we utilized indirect measures of validation co-occurrence and consistency among the different data cleansing models. Comparative deep model analysis on crane dataset The learning processes of the three deep learning models can be understood by the convergence of the training loss of their respective deep models (Anomaly Transformer, GAN Unsupervised, and Multi-Factorally Structured Prediction Gradient with Straight Edges). The plot of each model’s training loss over time is shown in Fig. 3. Based on the convergence of all three models, it can be concluded that all learned normal patterns from the crane current dataset. Training loss convergence of anomaly transformer, GAN, and MSPG-SEN on crane dataset. The locations of the detected anomalies are represented for each model using dot markers on graphs for the temporal signals. Each of these diagrams contains an indication of the specific points where the detected anomalies are detected using each of the Anomaly Transformer, Types of GAN, and Types of MSPG models in relation to the crane current signals. They indicate each of the sequences that have exceeded the threshold of either reconstruction or abnormality score according to that model’s layout. The points also represent non-reconstructable or distributionally different qualities in the signal, and are therefore not necessarily continuous areas of faults. Thus, while the graphs demonstrate that anomalies occur in a sparse manner in localized areas, the Models have all provided some partially-overlapping and also model-specific abnormal regions that are based on the differences related to time, space, and context (Fig. 4). Anomaly detection for anomaly transformer, GAN, and MSPG-SEN on crane current dataset. Benchmarking with statistical anomaly detection libraries The comparison of the datasets was completed using three anomaly detection libraries, PyOD, STUMPY, and Merlion, which are based on different methodologies as shown in Table 7 can be summarized as follows: Table 7Analysis of different types of anomaly detection techniques.AspectPyOD (IForest)Stumpy (Matrix profile)Merlion (ZMS)Library purposeGeneral outlier detection in tabular feature spaceTime-series discord detectionForecasting-based anomaly detectionModel usedIsolation ForestMatrix Profile + Discords/FLUSSZ-score Moving StatisticTime series requiredNoYesYesData usedStatistical featuresRMS time seriesRMS time seriesFeatures used9 statistical featuresRMS onlyRMS onlyNormalizationMinMaxScalerMinMaxScalerMinMaxScalerWindowingNoImplicit via subsequence lengthNoThresholding90th percentileTop-k / FLUSSZ-score thresholdControl parametercontamination = 0.1top-k or segmentationThreshold = 3.0Total data points∼2300∼2300∼2300Anomalies detected209320702070 Analysis of different types of anomaly detection techniques. A total of 27 anomalies are found by the Anomaly transformer whereas 411 are identified by the hybrid GAN from the crane vibration dataset. While both models have different types of models, partially overlapping with respect to their findings, they still corresponded to each other to some extent. In addition, the evolution of the GAN’s loss function throughout the training process is shown in Fig. 5 which shows the training and validation loss graphs for both models, and the effect of threshold selections for finding anomalies is shown in Figs. 6, 7 and 8 where the detected anomalies are located on the threshold level and indicated with a diamond point. There are also representation case studies provided through Fig. 9 which show the anomalous sample and the two nearest normal samples for easy comparison. Training and validation loss convergence of anomaly transformer on the vibration data set, with stable learning properties and decreasing reconstruction error with epoch iterations. Anomaly transformer selection threshold curve on vibration data with an illustration of how the decision boundary separates normal sequences from potential anomalies. Anomaly points highlighted by the anomaly transformer from vibration signals that represent anomalies in the time-series data above and below the learned threshold. Anomalies detected by GAN-based framework on vibration signals with discriminator scores and by MAD-based adaptive thresholding to identify abnormal patterns. Anomalous characteristic vibration sequence recognized by the models, shown with its two nearest normal neighbors to allow comparison-based estimation of capability to detect. When applied to the bearing dataset, there are a total of 2499 generated sequences. Anomaly Transformer identified 60 anomalies, while the hybrid GAN identified 422 anomalies. Of these, 14 anomalies are identified by both models, also supporting cross-consistency. Figure 10, illustrate the loss on training and validation of the Anomaly transformer. Furthermore, threshold selection’s influence on the detection of anomalies is illustrated in Figs. 11, 12 and 13 where both identified anomaly points and threshold levels have been shown. Training and validation loss convergence of anomaly transformer on the bearing dataset with progressive reconstruction loss decrease and stable convergence over epochs. Threshold selection in anomaly transformer on the bearing dataset, with visualization of choosing the decision threshold to isolate anomalies. Anomaly points detected by the anomaly transformer on bearing signals, which indicate non-reconstructable sequence deviations greater than the threshold value set. Anomalies extracted by GAN-based approach on bearing signal data, with discriminator ratings and adaptive MAD-based thresholding to identify abnormal operational behaviors. To confirm the strength of these results, we carried out cross check anomaly detection with Stumpy and Merlion. In the crane dataset, Stumpy identified 47 anomalies and Merlion identified 49 anomalies. Out of these, Stumpy presented 12 common overlaps with the GAN anomalies and 8 common overlaps with the Transformer anomalies. Merlion, on the other hand, presented only 1 common anomaly with the GAN model, highlighting its approach-based difference in scoring and thresholding. In the bearing dataset, Stumpy identified 111 anomalies and Merlion identified 74 anomalies; however, no overlapping anomalies between them are available, which presents the fundamental operational principles of both algorithms. Figure 14, illustrates the anomalies identified by the Stumpy (Matrix Profile) approach on crane vibration dataset, while Fig. 15, presents two representative anomalous samples with their neighboring samples. Likewise, Fig. 16, presents the anomalies identified by the Merlion (ZMS) approach on crane vibration dataset, and Fig. 17, presents some anomalous sequences with normal samples to verify qualitatively. Anomalies identified in the crane vibration data set with the STUMPY (Matrix Profile) algorithm, in which subsquence discords represent dissimilar temporal patterns. Anomalous characteristic sequences found by STUMPY on the crane dataset, shown with the closest normal sequence samples to allow qualitative visualization. Crane vibration data anomalies identified with the Merlion (ZMS) framework, which illustrate forecasting-based residual deviation anomalies. Anomalous sequences that have been identified by Merlion on the crane data set and compared with normal samples to highlight dissimilarity in temporal dynamics. Figure 18, illustrates the anomalies detected by the Stumpy (Matrix Profile) method on crane vibration dataset, while Fig. 19, presents two representative anomalous samples along with their nearest neighbors. Similarly, Fig. 20, highlights the anomalies detected by the Merlion (ZMS) method on crane vibration dataset, and Fig. 21, shows selected anomalous sequences with normal samples for qualitative verification. Also Table 8 show the normal and anomalous sequence and Table 9describe the whole summery of count and overlap. Anomalies determined in the crane vibration data set based on applying the STUMPY (Matrix Profile) algorithm, which finds discord subsequences that deviate from normal working. Anomalies in SAMPLEd crane signal data that were highlighted by STUMPY versus the neighboring normal samples to highlight localization of anomalies. Other anomalies recognized in the crane vibration data with the Merlion (ZMS) model, based on residual departure predictions from normal patterns. Representative anomalous sequences that were identified by Merlion on crane signals, presented along with normal samples to qualitatively assess the accuracy of anomaly detection. Table 8Comparison of anomalous and normal characteristics among vibration sequences in the crane data set.IndexAnomaly sequenceNormal sequence440.03, − 0.08, 0.12, 0.19, − 0.04, − 0.02, 0.20, 0...− 0.13, 0.08, − 0.06, − 0.22, − 0.05, − 0.05, − 0.24...1050.00, − 0.02, − 0.16, − 0.03, 0.05, − 0.12, − 0.11...− 0.04, 0.03, 0.20, 0.06, − 0.03, 0.16, 0.06, − 0... Comparison of anomalous and normal characteristics among vibration sequences in the crane data set. Table 9Anomaly count summary and overlap between Bearing and Crane datasets with GAN, Transformer, STUMPY, and Merlion.DatasetMethodTotal anomalies detectedOverlap with GANOverlap with transformerOverlap with stumpyOverlap with merlionCraneGAN411–4121CraneTransformer274–80CraneStumpy47128–1CraneMerlion49101–BearingGAN422–1451BearingTransformer6014–31BearingStumpy11153–0BearingMerlion74110– Anomaly count summary and overlap between Bearing and Crane datasets with GAN, Transformer, STUMPY, and Merlion. Furthermore, the GAN training pipeline is refined to improve stability and anomaly detection accuracy. As shown in Table 10, enhancements were introduced in generator activation functions (ReLU → LeakyReLU + LayerNorm), discriminator noise levels, loss function (binary cross-entropy → focal cross-entropy), label smoothing, training frequency, and optimizer configuration. These modifications collectively led to lower discriminator losses (D < 0.60) and generator losses (G < 0.45) compared to the earlier implementation (D ≈ 0.71, G ≈ 0.58), while also stabilizing the generator output distribution closer to the scaled input range. Table 10Improved GAN training and anticipated results after pipeline tuning. Improved stability, lower loss, and steadier generator outputs were caused by the changes.FeaturePrevious codeNew code (This version)Activation (Generator)ReLULeakyReLU + LayerNormalizationDiscriminator noise0.020.01 (less distortion)Loss functionBinary crossentropyBinary Focal Crossentropy (γ = 2.0)Label smoothing0.8-1.0/ 0.0-0.2 0.9-1.0 / 0.0-0.1 Generator training frequency2 times per epoch3 times per epoch (more stable)OptimizerAdam (lr )Adam (lr with clipnorm)Expected lossD ≈ 0.71, G ≈ 0.58D < 0.60, G < 0.45Expected gen output mean ∼ -0.61 ∼ -0.2 to +0.2 (closer to scaled range) Improved GAN training and anticipated results after pipeline tuning. Improved stability, lower loss, and steadier generator outputs were caused by the changes. For the last step of the unsupervised framework, a hybrid anomaly fusion mechanism is created to merge the anomaly evidence produced by the GAN, Anomaly Transformer, STUMPY, and Merlion models. Each of these models has its own unique ways of capturing different aspects of abnormal behavior, which enabled the anomaly scores from each of the methods to be standardized or scaled first (using MinMax scaling), then merged together by a weighted score fusion. The reason for the higher weighting given to the Anomaly Transformer is it has much more powerful temporal representation capabilities than the GAN, STUMPY, and Merlion models, who provide complementary information to those being used for distribution-level and statistical-level anomaly-detection purposes. In terms of how the final fusion score is computed, it will use a weighted combination of the normalized anomaly score values, then apply adaptive thresholding to that fused score, using the mean and standard deviation from the normal and anomaly score for each region. Using this process, there are a total of 14 high-confidence anomalies detected in the crane current dataset. The anomaly is located at each of the following indexes: 335, 543, 545, 548, 565, 576, 679, 818, 874, 924, 1082, 1409, 1411, and 1557. In order to validate that the anomalies were true, each anomaly-detection sequence was viewed along with their adjacent normal record(s) across all of the current sensor channels, CT1, CT2, CT3, CT_Avg, total_current and state_duration to see if there were any indications of potential data corruption. Figure 22 presents representative examples of anomalous sequences detected through fusion of data from multiple cranes, as collected in the crane dataset, along with their adjacent normal sequences experienced by the crane over time, in multiple sensors. Anomalous sequences show significant differences in time and irregular current behavior compared to the adjacent normal operation. Representative fused anomalous current sequences collected from the crane dataset, along with adjacent normal sequences collected from different sensors, are provided below to qualitatively validate an abnormality’s change in behavioral nature. The findings from both labeled and unlabeled industrial datasets showed that the performance of an anomaly detection methodology is reliant on data characteristics, the density of anomalies in the system, and the baseline detection methodology used for its identification. In supervised settings, using a Generative Adversarial Network (GAN) based framework, there is strong correlation between the anomalies detected and the ground truth fault index using the combined measure of reconstruction error, discriminator confidence, Mahalanobis distance, and Isolation Forest scores. However, for datasets that have primary class imbalances, like the Machine Failure Analysis Databases, the lack of training on generative models for sparse anomaly detection from normal behaviors continues to present challenges. In the unsupervised crane current dataset, the GAN, Anomoly Transformer, and MSPG-SEN are able to demonstrate the different aspects of abnormal behavior they could detect. Specifically, the GAN is able to identify distributional outputs, the Anomaly Transformer was able to pick up on temporal patterns of change in the behavior of the current, and the MSPG-SEN is only able to look at short-term local irregularities in their sub-scales. Some of the statistical evaluations completed with STUMPY, PyOD, and Merlion provided additional evidence, but they are all limited by the constraints of fixed mathematical assumptions and therefore could not be very sensitive to detecting complex temporal dependencies.An overlap analysis to investigate the similarities/differences between deep learning and statistical approaches has demonstrated that each method identifies different types of anomalies since they represent distinct types of faults as opposed to the same faults. To create a robust model for anomaly detection in industry, a hybrid fusion approach is developed using weighted score fusion and adaptive thresholding for combined normalized anomaly scores, combining the GAN, Anomaly Transformer and STUMPY, produced by Merlion, therefore significantly reducing the number of isolated false detections (FDs) and creating more robust, high-confidence anomaly localization within the crane dataset as compared to using either a single method from deep learning or statistic alone. Therefore, these results indicate that a hybrid multi-model framework will help better address anomaly detection within industry than using a single statistical or one from deep learning. Conclusion This research introduced a unified framework for anomaly detection in predictive maintenance through the application of an enhanced TransGAN-based reconstruction learning approach, combined with the use of Transformer-based temporal modeling and statistical validation methods. Testing is conducted on both supervised benchmark datasets (Machine Failure and SWaT) and real-world unlabeled crane sensor data to determine if it is suitable for all types of industrial monitoring environments. Furthermore, combining generative learning, attention-based temporal dependencies, and statistical anomaly detection achieved a higher degree of accuracy and robustness in detecting anomalies within a noisy, unbalanced, or limited labeled industrial environment. In addition, a weighted fusion approach and cross-model agreement permitted the identification of high confidence anomalies by merging complementary attributes associated with the various different methodologies examined. In summary, this framework provides an effective and scalable means for evaluating the success of predictive maintenance initiatives within industrial environments where successful validation of the failure and early detection of anomalies are essential. The next focus of research will be to extend this framework to include predictive maintenance applications based on the IIoT and utilize predictive maintenance for real time monitoring and intelligent decision support in an industrial environment. The framework can be improved further by incorporating Remaining Useful Life (RUL) predictions, fault prognostics and online streaming anomaly detection to facilitate early maintenance planning in smart manufacturing systems. Additionally, there will be further research into lightweight deployable edge enabled solutions, adaptive self-learning fusion methodologies, and federated industrial learning architectures for distributed IIoT systems. The framework will also be evaluated using large-scale heterogeneous industrial sensors networks and cyber-physical systems to enhance scalability, capability of generalization and operational reliability in real-time applications of Industry 4.0.