## 2 Related Work  
The security of mobile ad hoc networks (MANETs) has been the subject of extensive research, particularly with regard to mitigating black hole and gray hole attacks. Traditional detection methods have laid the foundation for MANET security, with the watchdog mechanism being one of the earliest approaches [5]. In [3], the authors proposed a method that continuously monitors the behavior of neighboring nodes to detect malicious activity. While effective in certain scenarios, the watchdog mechanism can suffer from false positives in dynamic network conditions and is vulnerable to collusion attacks. Enhancements to basic routing protocols have also been proposed to incorporate security features, in order to protect personal data [6]. In [7], the authors introduced SAODY (Secure AODV), which extends the AODV protocol with digital signatures and hash chains to protect against route manipulation. These secure routing protocols provide resistance against attacks, but they often introduce significant computational and communication overhead. Intrusion detection systems (IDSs) for mobile ad hoc networks (MANETs) employ a variety of techniques, including anomaly-based, signature-based, and specification-based detection, to identify network anomalies [3; 8]. The primary challenge in IDS implementation is achieving an optimal balance between detection accuracy and computational efficiency in resource-constrained MANET environments. In this context, recent research has focused on developing hybrid approaches that combine multiple detection techniques, such as statistical techniques, artificial intelligence, and data mining techniques, to enhance accuracy and reduce false positives [9]. In [10], the authors proposed an advanced anomaly detection framework that utilizes the statistical modeling of normal network behavior and machine learning algorithms for pattern recognition. This approach offers enhanced adaptability to evolving network conditions; however, it necessitates meticulous calibration to minimize the occurrence of false alarms. With regard to data mining and clustering techniques, in [11], the authors introduced an approach incorporating K-means clustering and decision trees for node behavior categorization and malicious node classification. These techniques provide a more nuanced understanding of node behavior, but they may require significant computational resources. The application of machine learning and artificial intelligence methodologies has the potential to enhance the precision and efficacy of attack-detection mechanisms [5; 12]. In [13; 14; 15], the authors provided a comprehensive review using machine and deep learning to develop an intrusion detection system that can effectively determine the best possible next step of a malicious node. In particular, the former authors proposed a system designed for Internet-of-Things (IoT) networks, offering valuable insights that can be adapted to the context of mobile ad hoc networks (MANETs). In the latter work, the authors employ a deep neural network (DNN) model for the detection of blackhole attacks in VANETs, whereby the probability of the next node being a blackhole attack node is predicted. Furthermore, the implementation of the DNN model resulted in a reduction in delays during the optimization process and an enhancement in system performance. Furthermore, recent empirical studies have demonstrated the effectiveness of hybrid detection methods in enhancing MANET security. In [16; 17] the authors conducted comprehensive evaluations, revealing significant improvements in detection accuracy, reduced false positive rates, and the maintenance of high packet delivery ratios even under attack conditions. In this context, in [18], the authors introduced the concept of on-demand multipath distance vector routing, which provides inherent resilience against certain types of attacks by maintaining multiple route options. This approach, while not specifically tailored to these attack mitigation, offers a foundation for more robust routing mechanisms in MANETs.