Research on network intrusion detection algorithm based on Focal Loss and spatio-temporal feature extraction
In the field of network intrusion detection,the recognition rate of intrusion detection systems is significantly affected due to insufficient extraction of network traffic features and the problem of uneven distribution of network data.To address these issues,this paper proposes a network model based on Focal Loss that can extract features from both temporal and spatial dimensions.In terms of temporal features,the extraction mainly utilizes the Bidirectional Gated Recurrent Unit(BiGRU)model,followed by the reassignment of feature weights through the multi-head attention mechanism of the Transformer-Encoder,enhancing the model's focus on key features.Regarding spatial features,the Inception module is primarily adopted,incorporating residual thinking to effectively extract spatial features within the network.Finally,these two-dimensional features are fused and classified using a classifier.To alleviate the problem of model focusing on majority class samples,the entire model employs the Focal Loss function for parameter updates.Through extensive experiments conducted on the CICIDS2018 and UNSW_NB15 datasets,it effectively demonstrates that the proposed model outperforms existing methods in terms of accuracy,precision,recall,and F1 score.
intrusion detectionspatiotemporal feature extractionmulti-head attention mechanismresidual networkFocal Loss