The exponential growth of network traffic in recent years has intensified the need for robust and sustainable security measures. Intrusion Detection Systems (IDS) play a crucial role in maintaining network security but face significant challenges due to the increasing volume and complexity of data. The high dimensionality of network traffic data makes it difficult to efficiently identify and process the most relevant features for effective intrusion detection. To address these challenges and enhance IDS performance, we propose AEJaya+DE, an adaptive optimization technique that combines the Adaptive Enhanced Jaya Algorithm (AEJaya) with Differential Evolution (DE) for effective feature selection in IDS. Unlike the basic Jaya algorithm, which can get trapped in local optima due to its single learning strategy, AEJaya improves local search ability by utilizing local attractors for exploitation and historical population for enhanced global exploration. AEJaya+DE incorporates dynamic parameter adjustment and adaptive probabilistic strategy selection to maintain a balanced exploration and exploitation process. We evaluated the method on two benchmark datasets: UNSW-NB15 and NSL-KDD. AEJaya+DE reduced the feature set from 42 to 21 on UNSW-NB15, achieving 96.10% accuracy with the XGBoost classifier, and from 41 to 24 on NSL-KDD, achieving 99.93% accuracy with the CatBoost classifier. These results demonstrate AEJaya+DE’s ability to significantly enhance IDS performance by selecting a minimal yet highly informative feature set, improving both accuracy and computational efficiency. This novel approach offers a robust and efficient solution for intrusion detection across diverse network environments, contributing to advancements in the field of network security.