## 4 Discussion
This contributes to reduced training time while still achieving high-quality results. From an industrial perspective, such rapid convergence is critical for real-time applications and retraining in Edge-based environments where resources and time are constrained. The results in Table 4 confirm that Transformer-GAN-AE not only performs better but also learns faster, making it a practical and deployable solution for mission-critical IIoT intrusion detection systems. Analyzing computational complexity is critical for understanding the scalability and deployment feasibility of DL models, particularly in latency-sensitive and resource-constrained IIoT and edge environments. The proposed Transformer-GAN-AE framework is optimized by the IChOA consists of multiple interdependent modules, each contributing differently to the overall computational cost. The total complexity can be approximated by summing the complexities of its four core components: transformer encoder, GAN, AE, and IChOA. The transformer encoder, which captures long-range dependencies using multi-head self-attention, incurs the highest cost when sequence lengths are large. The complexity of a single forward pass is given by Equation (35):  
\[O_{Transformer}=O(T\times A\times L^{2}\times F) \tag{35}\]  
where \(T\) is the number of transformer layers; \(A\) is the number of attention heads per layer; \(L\) is the sequence length; \(F\) is the feature dimensionality of each token. The GAN component consists of a generator and a discriminator, both assumed to be multilayer perceptrons with k hidden layers of width w. For a batch size of \(n\), latent vector of dimension \(z\), and output dimension \(D\), the combined forward-backward complexity is estimated as Equation (36):  
\[O_{GAN}=O(n\times(z\times w+k\times w^{2}+w\times D)) \tag{36}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Proposed Methods**} & \multicolumn{4}{c}{**Run Time (s)**} \\  & **RMSE \textless{} 15** & **RMSE \textless{} 10** & **RMSE \textless{} 5** & **RMSE \textless{} 2.5** \\ \hline Transformer–GAN–AE & 15 & 49 & 89 & 128 \\ BERT & 96 & 218 & 419 & - \\ TST & 110 & 231 & - & - \\ DBN & 125 & 286 & - & - \\ GAN & 163 & 341 & - & - \\ CNN & 180 & - & - & - \\ XGBoost & 214 & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Runtime comparison of models at different RMSE thresholds on the WUSTL-IIoT-2021 dataset. where \(n\) is the number of samples per batch; \(z\) is the size of the input noise vector; \(w\) is the width of each hidden layer; \(k\) is the number of layers in each network; and \(D\) is the dimensionality of the generated data sample. This formulation reflects the training cost of both generator and discriminator. The \(AE\), consisting of symmetric encoder and decoder subnetworks, also relies on fully connected layers. Assuming input dimensionality \(d\), encoder depth \(k_{e}\), decoder depth \(k_{d}\), and hidden width \(w\), the total complexity is estimated as Equation (37):  
\[O_{AE}=O(n\times(d\times w+(k_{e}+k_{d})\times w^{2}+w\times D)) \tag{37}\]  
The encoder compresses the input into a latent space, and the decoder reconstructs it back to the original feature space. The \(IChOA\) optimizer introduces additional overhead by iteratively refining the model's hyperparameters. Let \(I\) be the number of iterations, \(P\) the population size, and \(D_{h}\) the number of hyperparameters being optimized. The optimization cost is estimated as Equation (38):  
\[O_{IChOA}=O(P\times I\times D_{h}) \tag{38}\]  
The total computational complexity of the proposed system can be approximated as the sum of the above components (Equation (39)):  
\[O_{Total}=O_{Transformer}+O_{GAN}+O_{AE}+O_{IChOA} \tag{39}\]  
This composite expression highlights the layered nature of the model's complexity, with Transformer dominating in long-sequence scenarios, \(GAN\) and \(AE\) influencing training runtime and memory usage, and \(IChOA\) contributing to overall optimization cost.