HCAN: a hierarchical CNN–attention network for multi-class malicious URL detection using dual-input feature fusion
Abstract Malicious URL detection is a challenging task due to the lexical ambiguity between different threat classes and lack of URL representation learning in previous works, which motivates us to design HCAN (Hierarchical CNN–Attention Network) for classifying benign, phishing, defacement, and malware URLs given their raw character sequences and handcrafted structured features. The presented approach utilizes hierarchical convolutional neural networks with multi-scale convolution, residual convolution, and multi-head self-attention modules to learn sequential patterns in the character-sequence input at different levels of abstraction. The character-based representation is combined with another sub-network processing 64 handcrafted lexical, statistical, entropy, IP, HTTPS and phishing keyword features to yield a joint embedding for downstream classification. Experiments were carried out on 629,822 pre-processed URLs from the Malicious-Phish dataset, employing leakage-aware pre-processing and five-fold out-of-fold validation. On the main dataset, HCAN achieved 92.56% accuracy, 90.61% macro-F1 and 93% weighted-F1, with phishing URLs being the hardest class with an F1 of 79%. An independent performance evaluation on external URL dataset without any re-training or fine-tuning demonstrated that our approach achieved 87.43% accuracy and 82.48% macro-F1, highlighting the ability of our approach to generalize across different URL datasets, while also uncovering some performance gaps in the face of distribution shifts. The results show the potential of the hierarchical architecture using dual-branch design for four-class malicious URL identification.
Authors
- Arshpreet Kaur (ORCID: https://orcid.org/0000-0002-5157-5870)
- S. Devika
Institutions
- Amity University Bengaluru (IN)
- Manipal University Jaipur (IN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-11-17
- DOI
- https://doi.org/10.1038/s41598-026-77772-3
- Primary Topic
- Spam and Phishing Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00