CPC H04L 63/1416 (2013.01) | 7 Claims |
1. A lightweight intrusion detection method of an internet of vehicles based on knowledge distillation, comprises the following steps:
S1: obtaining traffic data of the internet of vehicles, extracting network traffic features therefrom as a feature data set, and pre-processing the data;
S2: dividing pre-processed data into an initial training set, an initial verification set and an initial test set according to a preset proportion, performing data balance on the initial training set to obtain a balanced training set, performing feature selection on the balanced training set, the initial verification set and the initial test set to obtain a model training set, a model verification set and a model test set;
S3: building a first model, inputting the model training set and the model verification set into the first model for model training, and obtaining a teacher model after the training;
S4: building a second model, and using the teacher model, the model training set and the model verification set to perform distillation training on the second model, and obtaining a student model after the training;
S5: testing a size and complexity of the student model, if the size and the complexity are higher than a preset value, adjusting parameters of the second model, and performing S4 again, and if the size and the complexity are lower than the preset value, using the model test set to test the performance of the student model; and if the test passes, saving the student model as a lightweight intrusion detection model of an internet of vehicles, and if the test fails, performing S1 to S4 again until the model passes a performance detection; and
S6: deploying the lightweight intrusion detection model of the internet of vehicles into the internet of vehicles for an intrusion detection.
|