← Back to Projects

Attention Net

Python PyTorch Scapy Streamlit

A CNN-Transformer hybrid model for encrypted network traffic classification, paired with a real-time analysis dashboard.

OVERVIEW

Attention Net classifies encrypted network traffic by trating the problem as a computer vision task. The system first creates image representations from raw packet data. The CNN layers extract local byte-pattern features from these representations while the Transformer's self-attention mechanism captures dependencies between the extracted features.

The model is trained on ISCX NonVPN-VPN dataset and achieves %86.45 overall accuracy and 0.88 Macro F1-Score. A real time network analysis dahsboard was developed to utilize the model for real time encrypted network traffic analysis.


MODEL ARCHITECTURE

CNN-Transformer Hybrid — The model is a CNN-Transformer hybrid. The main motivation behind the architecture is to treat encrypted network traffic classification as a computer vision task, and enhance the performance of the CNN block with attention mechanism of Transformers

Model and Training Implementation with PyTorch — The model and training procedure is implemented with PyTorch.

Traffic Capture with Scapy — Scapy is used to capture and pre-process raw network packets into image representations for model input.

Real-Time Dashboard — A Streamlit dashboard visualises live classification results, traffic distributions, and model confidence scores in real time.