Hackers nowadays employ botnets to undertake cyberattacks towards the Internet of Things (IoT) by illegally exploiting the scattered network’s resources of computing devices. Several Machine Learning (ML) and Deep Learning (DL) methods for detecting botnet (BN) assaults in IoT networks have recently been proposed. However, in the training set, severely imbalanced network traffic data degrades the classification performances of state-of-the-art ML as well as DL algorithm, particularly in classes with very few samples. The Convolutional Neural Network -Pelican Optimization System (CNN-POA) is a DL relied botnet attack detection algorithm developed in this research. Meanwhile, typical evaluation markers are used to compare the overall performance of the proposed CNN-POA and additional frequently employed algorithms. The simulation results suggest that the CNN-POA method is effective and dependable for detecting IoT network intrusion attacks. Experiments revealed that the suggested CNN-POA approach outperformed a number of current metaheuristic algorithms, with an accuracy of 99.5%.