The reliance on computer networks in our daily lives has grown in both magnitude and complexity in recent years [
1]. The comparative growth in network attacks has brought network security to the forefront for many organizations [
2]. To prevent the drastic consequences of network attacks, a network intrusion detection system (NIDS) alerts network operators when an attack is present. Researchers have recently focused their efforts to take advantage of deep learning techniques as a way to detect complex network attacks and improve the protection provided by a NIDS [
2,
3,
4,
5].
This article is an extended version of our paper published in the Proceedings of the 21st IEEE International Conference on Machine Learning and Applications (ICMLA), 2022 [
6]. Here, we develop the use of autoencoder feature residuals to generate features for various neural network architectures including this extension of the technique to use sequential network data with recurrent neural network classifiers. Previously introduced work showed that this technique is effective for network intrusion detection when paired with traditional classifiers such as random forest and k-nearest neighbors [
7]. What was not treated in that work, however, was the application of the technique in conjunction with neural network architectures, such as feedforward and recurrent neural networks, which are used in state-of-the-art research today. Here, we extend the literature by exploring the application of autoencoder feature residuals to several neural network architectures and assess their performance. In particular, we analyze performance using autoencoder feature residuals in combination with feedforward neural networks and various architectures of recurrent neural networks.
The process for generating and using autoencoder feature residuals can be summarized by a series of four steps, which are displayed in
Figure 1. Taking only benign network flow samples, an autoencoder is trained. This trained autoencoder can then be provided with benign and attack network samples to construct a number of novel feature sets using autoencoder feature residuals. These feature sets then train a neural network such that it can effectively classify a given network sample as attack or benign. With both trained models in hand, we can then perform inference on novel samples. We show that autoencoder feature residuals perform as well as an original set of input features and have the potential to increase performance under certain conditions. Unlike most other works that use autoencoders for network intrusion detection, we do not rely on summary metrics such as mean-squared error when utilizing autoencoder reconstruction error [
3,
4,
8]. By exploring this process, we have found that there is value in using the individual residuals of each feature. In addition, we show that using autoencoder feature residuals has benefits in terms of data compression, even in the cases where classification performance is not improved.
The remainder of this article is structured as follows. In
Section 1, we discuss recent related works in network intrusion detection.
Section 2 provides the reader with necessary background information associated with the work and outlines our methodology. Our results and their associated discussion are presented in
Section 3. Finally, we conclude the article in
Section 4.
Related Work
This work is rooted within several areas of research, including anomaly detection and deep learning, as well as their application to network intrusion detection. A key assumption of the work relies on the one-class pretraining step producing an autoencoder, which has difficulty reconstructing network attacks compared to benign network samples. This assumption is made by similar techniques, in that the residuals for attack samples will have more data in them; however, they often use an aggregate summary error metric in combination with a threshold [
10]. Other techniques that utilize autoencoders in this space make use of the bottleneck layer for feature reduction/selection [
10].
One recent work that utilizes this assumption introduces a method where the authors train an autoencoder to detect distributed denial-of-service attacks [
11]. In their work, the authors focus on the industrial cyberphysical environment by using lightweight features as input to an autoencoder. Using only benign network flows during training, they are able to detect attack network flows using the autoencoder’s reconstruction mean-squared error compared to a threshold. Similarly, another recent work uses this same concept as part of a larger two-stage system to detect network attacks [
12]. In the first stage of the system, the authors use a light gradient-boosting model to perform initial detection of network attacks. An autoencoder is used in the second stage to confirm that any network flows identified as benign also have a reconstruction mean-squared error that is below a threshold as a second check.
AIDA is a full NIDS introduced to detect network attacks [
3]. The AIDA system uses a single autoencoder residual for each sample to augment their classifier input features. Similarly, a related work produces three additional features using a stacked sparse autoencoder [
13]. First, a bottleneck layer of a single node is utilized as a feature. The authors then use two forms of the reconstruction error from the autoencoder, euclidean distance and cosine similarity, as the other two additional features. While these works share a similarity in concept to our work, we propose using the residual of
each reconstructed feature as opposed to a summary metric.
Two systems are outlined that include an ensemble of autoencoders to detect network attacks in an unsupervised manner [
4,
8]. While these systems differ in their specific implementations, both use the root-mean-squared errors from reconstructions in the ensemble as their primary metric for detecting network attacks.
An emerging technique involves the use of triplet networks being formed by providing them with autoencoder reconstructions [
14]. In one-class training, the two autoencoders are trained on benign and attack network data separately. The reconstructions of novel samples are provided to the triplet network to determine if it is attack or benign during inference. Another application of triplet networks involving the use of autoencoders augments this idea by providing the triplet network with the output of the encoder’s bottleneck layer [
5].
Through an analysis of the effects of autoencoder bottleneck size on performance, one recent work uses a z-score threshold on the autoencoder reconstruction error [
10]. Trained only on benign network data, it is shown that such a summary metric can be used for detecting network attacks.
It is common to see feedforward networks used to classify network attacks [
15,
16]. While some works use only a single feedforward layer as part of a larger model [
17], others use a larger feedforward network as their main classifier [
18]. A recent work that presents the IGRF-RFE feature selection method utilizes a multilayer perceptron to perform classification of netflow data using features derived from an ensemble feature selection and reduction method [
19]. Increasing in popularity are works that use recurrent neural networks (RNNs) as part of their proposed methods [
15,
16]. In one interesting work, the HCRNNIDS method is introduced, which uses a combination of convolutional networks and a recurrent neural network together [
20]. The convolutional network is intended to focus on local features in network flow data, while the recurrent network then focuses on using temporal features.
Another work making use of recurrent neural networks takes an ensemble consisting of an RNN, gated recurrent unit (GRU), and long short-term memory (LSTM) model in order to perform feature extraction on network flow data [
21]. The various extracted features from the ensemble are then combined to be used with a downstream classifier. A similar method makes use of an autoencoder by extracting the bottleneck layer as features for input to a downstream RNN classifier [
22].
Rather than using two separate models, other works combine model architectures, as was carried out for the DDoSNet model [
23]. For this suggested NIDS, an autoencoder was constructed using recurrent layers. The bottleneck layer was then used to successfully classify distributed denial of service attacks using network flow data.
Among the few works that use autoencoder feature residuals, one that stands out details the DeepAID framework [
24]. This proposed framework takes autoencoder feature residuals with the purpose of adding interpretability to deep learning-based anomaly detection systems. Unlike our work, however, DeepAID does not perform anomaly detection, and rather focuses on analyzing previously detected anomalies. Similar interpretability comes for free with our technique, as the feature residuals of attack samples with high magnitude identify the particular features that deviate the most from benign data.
Another work incorporates autoencoder feature residuals into a larger system focused on transfer learning [
25]. The authors train an autoencoder on each device on a network and then use a global classifier to detect attacks from network data. The input to the global classifier are normalized autoencoder feature residuals. While the focus of that work is on their entire NIDS, we differentiate our work by explicitly exploring the use of autoencoder feature residuals and capturing their performance across multiple feature encodings in order to show their general applicability with several architectures of neural network classifiers.
One of the main drawbacks for the related works discussed here is that by using an aggregate residual for detecting network attacks, it is possible for valuable information to be lost. This can be demonstrated with the synthetic example shown in
Figure 2, where we have two clearly different network samples, one being benign and the other an attack. Previously discussed techniques that use mean-squared error [
3,
4,
8,
11] or some other aggregate metric [
13] are destined to incorrectly classify one of these samples. When using our technique, however, we are still able to differentiate samples such as these by providing the structure of the samples to a downstream classifier, since the residual for each feature is preserved.
Broad overviews of network intrusion detection techniques can be found in a number of recent surveys of the area. Several, such as [
2,
15], cover both anomaly detection and deep learning techniques for network intrusion detection.