The network is responsible for all aspects of life,and preventing and controlling the entry of abnormal traffic data can go a long way towards protecting it.As a tool to defend against network attacks,intrusion detection techniques are widely used.To address the problems of class imbalance and high dimensionality of features presented in network traffic data,this paper conducts a relevant study on network intrusion detection methods based on adaptive sampling methods and whale optimisation algorithms.The details of the research are as follows:First,an adaptive oversampling algorithm based on density estimation and boundary metric is proposed to address the class imbalance problem in network traffic data.The algorithm uses Euclidean distance for distance metric,and performs local estimation of data density and boundary metric based on k-nearest neighbours of minority class sample points,so that minority class samples in low-density regions and boundary regions are paid more attention to;adaptive weights are designed to synthesize new samples and adjust the distribution of data to solve the problem of sparse distribution of minority class samples in anomaly detection,which improves the classifier’s recognition rate and the classification accuracy of the model.Secondly,to address the problem of high feature dimensionality in intrusion detection,a hybrid multi-strategy based improved whale optimization algorithm is proposed for feature selection.The algorithm introduces a non-linear convergence factor to speed up the convergence of the algorithm and reduce the time consumption in feature selection;combined with the Lévy flight strategy and the differential variance strategy,it introduces neighbourhood perturbation and population perturbation respectively for the whale optimisation algorithm to avoid the algorithm falling into local optimal solutions in order to extract a better subset of features.The feature selection method considers the correlation between feature attributes and removes the redundant features present in the network traffic data to a certain extent.Finally,combining the oversampling algorithm and feature selection method proposed in this paper,data generation is performed for one of the small-sample attack types,and the optimal feature subset is extracted for constructing an intrusion detection classification model,which increases the generalization ability of the model and improves the detection rate of the model for the small-sample attack types.Data generation experiments are conducted for the proposed oversampling algorithm;simulation evaluation of the benchmark test function and corresponding feature selection experiments are conducted for the proposed improved whale optimisation algorithm;ablation experiments are designed for the constructed classification model to verify the effectiveness and applicability of the proposed algorithm and the intrusion detection model constructed in this paper. |