DEV Community

Amritesh
Amritesh

Posted on

Building a Network Intrusion Detection System with Machine Learning: A Deep Dive into the CICIDS2017 Dataset

In today's digital era, network security is paramount. Traditional detection systems struggle with advance threats, making machine learning a gamechanger for proactive threat identification and anomaly detection.

For this project, I utilized the comprehensive CICIDS2017 dataset, which provides a wide range of benign and malicious network traffic scenarios, making it ideal for training and testing intrusion detection models.

The data preprocessing phase involved handling missing values and infinite values using zero-imputation. Additionally, features were normalized using StandardScaler to ensure consistent distribution across the dataset.

I constructed a deep learning model with input layers, hidden layers using ReLU activation, and a modified output layer configured for 15 classes using softmax. The model was compiled using Adam optimizer with a learning rate of 0.0001 and trained 5 epochs with a batch size of 32.

Evaluation on the test set yielded a test accuracy of 99.43% and a low test loss of 0.0380 demonstrating exceptional generalization on unseen data.

This project demonstrates the effectiveness of deep learning for network intrusion detection. Future work will focus on addressing class imbalance to further improve minority class recall.

Top comments (0)