In the context of the close integration of computer network technology and daily life, big data network security faces many challenges. With its powerful information processing ability, this AI can effectively identify and handle potential threats in the network, thereby improving network security. This paper discusses the application of artificial intelligence (AI) in enhancing big data network security defense, especially in the threat detection link. This paper proposes a detection algorithm that combines support vector machine (SVM) and K nearest neighbor (KNN), namely SVM-KNN algorithm, for network attack detection and defense. When the hazard data is 60 under the test sample, the detection accuracy of KNN, SVM, and SVM-KNN is 86.88%, 89.51%, and 96.75% respectively; when the hazard data is 60 under the experimental sample, the detection accuracy of KNN, SVM, and SVM-KNN is 82.70%, 83.88%, and 89.26% respectively.response.