## 3 Proposed Methodology
### Binarized Deep Spiking Capsule Fire Hawk Neural Network Based Packet Classification  
The binarized deep spiking capsule fire hawk neural network (BSHNN) algorithm combines state-of-the-art neural network architectures, including binarized neural networks, spiking neural networks, and capsule networks, for real-time, resource-efficient, and highly accurate data packet classification in 5G SDN environments. It enhances power efficiency, spatiotemporal sensitivity, and hierarchical data understanding, making it suitable for high-speed, low-latency, and large-scale 5G network demands. Binarized neural networks (BNNs) are deep learning models where the network's weights and activations are constrained to binary values (e.g., \(-1\) and \(+1\)) instead of floating-point values. This reduces the computational complexity and memory usage, allowing the model to operate efficiently with minimal hardware resources. BNNs are particularly useful for mobile and internet-of-things devices with limited CPUs and large memories. Spiking neural networks (SNNs) are designed to mimic the biological neurons, processing information in discrete time steps, making them well-suited for handling temporal data such as network traffic flows. It allows real-time responses without the need to buffer large amounts of data. This event-driven approach reduces power consumption and enhances processing speed in 5G SDN networking environments. Capsule networks are a type of neural network that improves the accuracy of traditional convolutional neural networks by preserving spatial hierarchies between features. This is crucial for understanding data packet types and malicious patterns. The data packets undergo a dual verification process for classification, involving header and content inspection in the controller plane with two layers: smart control and domain control. The domain control layer uses two classifiers to analyze header and content attributes, including flow-based characteristics and packet details. The suggested approach uses binary outputs instead of continuous outputs in CNN [32], enabling effective training on spatiotemporal data and simplifying the intricacies of conventional neural networks. The classification process integrates Capsule Network (CapsNet) [33] outputs with optimized parameters from Fire Hawk Optimization (FHO) [34], contributing to decision-making based on learned patterns and hierarchical relationships. The BSHNN is trained using a dataset of network packets labelled as normal or malicious and deployed in the network's controller layer to analyze incoming packets in real-time. BSHNN's robustness against adversarial attacks enhances network security, while its adaptability allows it to evolve with emerging threats, making it ideal for the dynamic 5G environment. The FHO algorithm is an evolutionary optimization algorithm inspired by the behaviour of firehawks in nature. The detailed description of the FHO algorithm and its mathematical calculations are explained below. In the context of network optimization, it is used to optimize network parameters '\((\beta,\delta)\)' of the proposed neural network. This optimization process involves updating the weights of the neural network during backpropagation through a specified Equation (4). \[W_{i}=\hat{W}-\eta\times\
abla loss \tag{4}\]  
where '\(W_{i}\)' represents the weight update of the neural networks utilizing gradient descent, '\(\hat{W}\)' represents the existing weight during the training of the network, '\(\eta\)' is the learning rate, which controls the step size of the weight update of the proposed network. '\(\
abla\)' is the gradient of the loss function with respect to the weights, which indicates the direction and rate of change of the loss function. The fitness function of solutions FHO is evaluated using Equation (5). \[F=\frac{1}{1+J} \tag{5}\]  
where '\(F\)' represents the fitness function of the optimization method and '\(J\)' is the loss function, which measures the error between the predicted output and the actual output.