<span>The number of devices linked to the internet is rapidly increasing as the internet has become ingrained in every aspect of modern life. However, certain issues are getting worse, and their resolutions are not well-defined. One of the main issues is convergence and speed for communication between different internet of things (IoT) devices and their security. For that purpose, in this paper, an improved artificial bee colony (ABC) algorithm with binary search equations along with neural networks is proposed, known as the artificial bee colony algorithm with binary search equations (BABCN) algorithm for intrusion detection in terms of convergence and speed for communication. The depth-first search framework and binary search equations on which the artificial bee colony algorithm with binary search equations algorithm is built improve the algorithm’s capacity for exploitation and speed up convergence. The initial weight and threshold value of the ABC neural networks are optimized using an algorithm to prevent them from entering a local optimum during the training procedure and accelerating training. The NSL-KDD dataset was used, and based on the results; the proposed algorithm improves classification and has high intrusion detection ability in the network. The proposed has undergone tests to be evaluated, and the results show that it performs better in detection accuracy, time, and false positive rate.</span>