This project explores two different deep learning approaches for detecting web-based cyber attacks using network traffic features. It builds upon prior work, then introduces a creative, dual-path semantic-enhanced model that shows significant performance improvements.
project-root/
│
├── notebooks/
│ ├── initial_code.ipynb # Baseline model implementation
│ └── improved_code.ipynb # Improved model with semantic features + attention
│
├── reports/
│ ├── initial_report.md # Report for the baseline model
│ └── improved_report.md # Report for the improved model
│
├── requirements.txt # Python dependencies
├── README.md # This file
└── result.md #Model Performance Comparison
- 📊 Dataset: Balanced web attack dataset (Brute Force, SQL Injection, XSS)
- 🧠 Model 1: A basic deep learning model for web attack classification
- 🚀 Model 2: A novel architecture that combines:
- Semantic feature extraction
- Convolutional + BiLSTM layers
- Attention mechanism
- Dual-input fusion strategy
- 📈 Improved Accuracy, Precision, Recall, and F1-score across 5-fold cross-validation
We use the Balanced Web Attacks Dataset originally introduced in this project.
To load it inside your notebook:
!wget https://github.com/fisher85/ml-cybersecurity/blob/master/python-web-attack-detection/datasets/web_attacks_balanced.zip?raw=true -O dataset.zip
!unzip -u dataset.zip- Clone this repository:
git clone https://github.com/nlppaperclub/web-attack-detection-4033614008.git
cd web-attack-detection-4033614008
- Install dependencies:
pip install -r requirements.txt
- Open the notebooks: You can use Jupyter or Google Colab. Each notebook is self-contained and runnable:
notebooks/initial_code.ipynb → Baseline
notebooks/improved_code.ipynb → Enhanced model with attention and semantic logic
In-depth explanations and analysis are available in the reports/ folder:
initial_report.md: Describes the baseline model, features, and results
improved_report.md: Outlines the motivation, semantic idea, model improvements, and metrics
Python 3.8+
TensorFlow / Keras
scikit-learn
pandas / numpy
matplotlib
Inspired by the original research from fisher85/ml-cybersecurity Semantic feature engineering and architectural improvements proposed independently in this project.