## 3 Intelligent Cluster-Based Routing Approach
### Cluster Formation
After verifying the connectivity parameters within the cluster, our system identifies and flags malicious nodes that exhibit suspicious behavior. The selection of malicious nodes is achieved through a deep learning process, significantly enhancing the efficiency of learning and detection, as detailed in Algorithm 2. We employ logistic regression, a binary classification algorithm, and ANN, a supervised deep learning technique, to identify black holes or malicious nodes. A precise and accurate model is cultivated using backpropagation, a method for minimizing error by reducing the cost function. Nodes identified as abnormal or malicious are subsequently excluded or rejected, while secure or normal nodes are integrated into the cluster. A three-layered deep learning model is deployed to detect and classify malicious attacks within the proposed system. Artificial neurons and successive layers process the input data, ultimately evaluating architectural values to pinpoint black holes or malicious or counterfeit nodes. Training the deep learning network hinges on detecting malicious attacks based on parameters such as black hole attack intensity, packet drop ratio, data content, timestamps, packet rates, and the distance between nodes and RSU in the network. This architectural approach repetitively uses 25, 50, 75, and 100 nodes to detect malicious nodes with black hole attacks. Once malicious nodes are identified, communication paths are determined using a modified AODV-based routing table and updated following the provided AODV architecture, as expounded in Algorithm 2, detailing the deep learning model for malicious node detection. After malicious node detection, secure nodes are connected to their relevant RSU, forming a cluster. The range for every cluster is set as a fixed range with the car's identity to be observed for the said range inside the cluster transformation. The set range is marked red and compared for the final selection of the clusters. Finally, the RSU successfully stores the ID of every vehicle with ID and becomes a thriving and active cluster member. The main ideas of Algorithms 1 and 2 are provided here. Algorithm 1 outlines the steps for cluster selection and appointing a cluster head in vehicular networks. It iteratively assesses vehicles and RSUs, evaluating distance, speed, and neighboring nodes. When detecting an RSU, it calculates the distance between the RSU and the vehicular node, considering speed and neighbouring nodes. If conditions regarding distance, speed, and neighbors are met, the RSU is assigned an identity, and a cluster is formed. The algorithm then sets the range and identity for the cluster, ensuring its integrity. The resulting cluster, with non-zero identifiers, represents a cohesive group in the vehicular network, ready for subsequent operations like content distribution and secure communication. 1. Initially, a vehicular node broadcasts a timestamp (ML parameter) to RSU. Then, RSU checks the speed of node i-e. If it is less than the speed threshold, it is considered eligible for permanent connection with RSU; if it is greater than the threshold, it forms a temporary connection with RSU, then the direction of the node is checked. * After that, all the ML parameters are applied for malicious node detection. The node's packet delivery and packet drop information, i.e., the node's previous behavior, is taken from the previous RSU. * After verifying present and previous behavior through the deep learning classifier ANN, the node is declared secure and becomes part of the secure cluster. Ultimately, each RSU within a cluster assigns an authentication key to every member of the secure cluster.