Compared with other classifiers, neural network (NN) classifiers are faster and have more advantages. However, the NN classifier is unique, because the number of features often changes when selecting features and the classifier is classified by the number of hidden layer nodes, and a NN with a fixed number of hidden layer nodes is used to evaluate different types of feature subsets obviously inappropriate. Therefore, the NN classifier is optimized, and the ant colony optimization (ACO) algorithm is introduced to obtain a diverse solution, which will be faster than the NN classifier to avoid it falling into the problem of local solutions. As a classic feedforward NN, BP neural network (BPNN) is currently the most widely used NN for classification problems. Therefore, this paper constructs a BPNN classifier. By comparing the traditional BPNN classifier and the improved ACO-BPNN classifier on malicious web page detection and classification effects of different sizes of data sets, the results show that, compared with the traditional BPNN classification model, ACO-BPNN The classification accuracy of the BPNN classification model is higher and the classification effect is better.