## 3 Proposed Methodology
### Feature Selection Using Hybrid Genetic Fire Hawker Optimizer (FHO)
The transformer's multi-head self-attention layer enables the network to search for various prior time steps while anticipating the next ones, as attacks incorporate the entire frequency distributions rather than a one-time step. To minimize the trainable parameters of the network, the input features of MFCC were then mapped into the transformer block. The set of key-value pairs \((K,V)\), whose dimensions were equal to the length of the input sequence and were utilized by the transformer architecture. The hidden state of the encoder consists of keys and values. The output sequence of the decoder was mapped from \(K-V\) pairs using \(Q\) as \((Q,K,V)\). The decoder's output is the averaged sum of all values in \((K,V)\) stored representation of inputs. The transformer's self-attention, which is defined as a sequence-length-scaled dot product for all the keys, yields each hidden state alignment, as illustrated in Equation (13):  
\[Attention(Q,K,V)=softmax\bigg{(}\frac{QK^{T}}{\sqrt{n}}\bigg{)} \tag{13}\]  
The scaled dot product for the sequence output at the time step \(t\) was scaled by the hidden state dimension \(n\). Numerous self-attention techniques can be utilized. This allows multi-head self-attention (MHSA) to estimate an over-term with a different weight dependent on a subspace of the input sequence. Multiplying and combining the output from each attention head incorporated with a weight matrix can minimize the encoded state dimensions. Instead of utilizing a single feed-forward layer as the transformer encoder in this study, the number of attention heads Conv-1D operates on stored latent space. The mathematical representations for estimating a softmax prediction are expressed in Equations (14) and (15):  
\[MultiHead(Q,K,V)=[head_{1};head_{2};\ldots head_{n}]W^{O} \tag{14}\]\[head_{i}=Attention\Big{(}QW_{i}^{Q},KW_{i}^{K},VW_{i}^{V}\Big{)} \tag{15}\]  
Here, the learnable parameter matrices are denoted as \(QW_{i}^{Q},KW_{i}^{K}\), and \(VW_{i}^{V}\). The total weighted layers of multi-head attention are denoted as \(W^{O}\). The structure of the multi-head attention transformer is shown in Figure 2.  
Four identical stacked blocks of transformer encoder were utilized to categorize different attacks. Each block contains one MHSA layer and a fully connected feed-forward layer. After the MHSA layer, a skip connection and a normalization layer were added. The development of a skip connection and normalization follows the feed-forward layer. The skip connection increases the original embedding by using the output from the MHSA layer. The normalization is identical to batch normalization. The norm layer is additionally applied during testing, compared to batch normalization, which is adjusted to sequential inputs. After the residual connection, the norm layer is applied to the combined embeddings. The researchers created a residual dense network (RDN) utilizing 1-dimensional (1D) convolutions to classify segments of 1s long, that is, \(\left(2\times 2048-dimensional\right)^{2}\) segments, into positive and negative binary segments. The RDN, divided into 27 blocks with two convolutional layers each, has a depth of 54. Blocks 5, 8, 11, 14, and 17 have two-stride residual connections, indicating a reduction of half in dimensionality. Moreover, the remaining were utilized in the residual connection. Figure 3 illustrates the structure of RDN. Figure 2: Structure of multi-head attention transformer. The output of residual block layers was written as  
\[j=f(y)+h(y) \tag{16}\]  
Here, the block of two convolutional layers is denoted as \(f(y)\). The input of the first layer is represented as \(y\). The identity function is \(h(y)=y\), or a strided convolutional layer forms the residual function \(h(y)\). The ReLU activation function and batch normalization replaced each of the convolutional layers. Finally, two further individual convolutional layers reduced the output to a binary result.