Background: Wireless networks are essential communication technologies that prevent cable installation prices and burdens. Because of this technology's pervasive usage, wireless network safety is a significant problem. Owing to distributed and open wireless medium aspects, attackers might use different jamming methods to exploit physical and MAC layer protocol vulnerabilities. In addition, jamming attacks require to be accurately grouped so that suitable countermeasures can be considered. Given the potential severity of such attacks, precisely identifying and classifying them is critical for implementing effective responses. The motivation for this paper is the need to improve the detection and categorization of jamming signals using modern machine learning algorithms, consequently enhancing wireless network security and reliability. Objective: In this paper, we compare some machine learning models' efficiency for diagnosing jamming signals. Methods: Such algorithms refer to support vector machine (SVM) and k-nearest neighbors (KNN). We checked the signal features that recognize jamming signals. After the jamming attack model, the developed grey wolf optimizer version known as IGWO (improved grey wolf optimizer) has been discussed for feature extraction of software usability. Four separate metrics were employed as features to detect jamming attacks in order to evaluate the machine learning models. This novel feature extraction method is crucial for improving the accuracy of jamming detection. Results: The measurements of these parameters were gathered through a simulation of a real setting. And generated a large dataset using these parameters. Conclusion: The simulation results illustrate that the KNN algorithm based on jamming detection could diagnose jammers having a minimal likelihood of false alarms and a high level of accuracy.