Network security is one of the key components of cybersecurity anomaly intrusion detection, which is responsible for identifying unusual behaviours or activities within a network that might indicate possible security breaches or threats. In this suggested intrusion detection system (IDS), network traffic data is continuously monitored via anomaly detection. The study makes utilising one of the most recent datasets to spot unusual behaviour in networks connected to the Internet of Things, the IoTID20 dataset, to facilitate this process. The preprocessing stage involves painstaking steps for smoothing, filtering, and cleaning the data. The Pine Cone Optimisation algorithm (PCOA), a novel optimizer inspired by nature, is introduced in this study for the feature selection process. PCOA seeks to increase the effectiveness of feature selection while drawing inspiration from the various ways that pine trees reproduce, such as pollination and the movement of pine cones by animals and gravity. Moreover, IDS is classified using Bidirectional Gated Recurrent Unit–Additive Attention Mechanism Based on Convolutional Neural Networks (CNN-BiGRU-AAM), which makes use of deep learning's capabilities for efficient classification tasks. In addition, this work presents the Botox Optimisation Algorithm (BOA) for hyperparameter tuning, which is modelled after the way Botox functions in human anatomy. BOA uses a human-based method to adjust the hyperparameters of the model to attain the best accuracy. The results of the experiments show that the suggested methodologies are effective in improving network anomaly intrusion detection systems, with a maximum accuracy of 99.45%.