The increasing rate of cybercrime in the digital world highlights the importance of having a reliable intrusion detection system (IDS) to detect unauthorized attacks and notify administrators. IDS can leverage machine learning techniques to identify patterns of attacks and provide real-time notifications. In building a successful IDS, selecting the right features is crucial as it determines the accuracy of the predictions made by the model. This paper presents a new IDS algorithm that combines the rectified linear unit (ReLU) activation function with a pigeon-inspired optimizer in feature selection. The proposed algorithm was evaluated on network security layer - knowledge discovery in databases (NSL-KDD) datasets and demonstrated improved performance in terms of training speed and accuracy compared to previous IDS models. Thus, the use of the ReLU activation function and a pigeon-inspired optimizer in feature selection can significantly enhance the effectiveness of an IDS in detecting unauthorized attacks.