Wegis Phishing Detection Model
URL ๋ฌธ์ CNN + MobileBERT ๋ฉํฐ๋ชจ๋ฌ ํผ์ฑ ์ฌ์ดํธ ํ๋ณ ๋ชจ๋ธ์ ๋๋ค. Wegis ๋ธ๋ผ์ฐ์ ํ์ฅ๊ณผ Wegis Server์ ์ค์๊ฐ ํผ์ฑ ํ๋ณ์ ์ฌ์ฉ๋๋ฉฐ, ํ์ต ํ์ดํ๋ผ์ธ์ bnbong/Wegis_model์ ๊ณต๊ฐ๋์ด ์์ต๋๋ค.
Model Architecture
URL๊ณผ ํ์ด์ง ๋ณธ๋ฌธ ํ ์คํธ๋ฅผ ํจ๊ป ์ฝ๋ ์ด์ง ๋ถ๋ฅ(ํผ์ฑ = 1) ๋ชจ๋ธ์ ๋๋ค.
- URL ๋ถ๊ธฐ : ๋ฌธ์ ๋จ์ ํ ํฌ๋์ด์ (vocab 98, max 512) โ Embedding(98ร128) โ Conv1d k=3/k=5 ๋ณ๋ ฌ(๊ฐ 256ํํฐ, ReLU + ์ ์ญ max pool) โ concat(512) โ Linear(512โ512)
- HTML ๋ถ๊ธฐ : ๋ณธ๋ฌธ ํ
์คํธ ์ถ์ถ โ MobileBERT(
google/mobilebert-uncased) โ last_hidden_state๋ฅผ ์ํ์ค ์ถ median ํ๋ง โ (512) - ๊ฒฐํฉ ํค๋ : concat(1024) โ Linear(1024โ512) โ GELU โ Linear(512โ1) โ logits (์ถ๋ก ์ sigmoid๋ก ํ๋ฅ ์ถ๋ ฅ)
- ํ๋ผ๋ฏธํฐ 25,645,057๊ฐ. ์์ค์ BCEWithLogitsLoss.
์ธ๋ถ ๋ค์ด์ด๊ทธ๋จ๊ณผ ๋ ผ๋ฌธ ๋๋น ๊ตฌํ ์ฐจ์ด๋ ํ์ต ์ ์ฅ์ README๋ฅผ ์ฐธ๊ณ ํ์ธ์.
Performance
| Metric | Score |
|---|---|
| F1 | 0.8739 |
| Accuracy | 0.8710 |
Files
model.safetensors: ๋ชจ๋ธ ๊ฐ์ค์น state_dict (์ฝ 103MB) โ ๋ฐฐํฌ ๊ถ์ฅ๋ณธ. Wegis_model์ ๋ชจ๋ธ ์ ์์strict=True๋ก ๋ก๋๋จ (tests/test_pretrained_compat.py๋ก ๊ฒ์ฆ).best_acc_model.pt: ํ์ต ๋น์ ์ฒดํฌํฌ์ธํธ ์๋ณธ (model + optimizer + scheduler, 206MB). ์ฌ์ฉ ์torch.load(path, weights_only=True)["model"]๋ก ๋ชจ๋ธ ๋ถ๋ถ๋ง ์ทจํ์ธ์.
Usage
ํ์ต ์ ์ฅ์ CLI๋ก ํ๊ฐ
git clone https://github.com/bnbong/Wegis_model && cd Wegis_model
uv sync
uv run wegis-model evaluate --checkpoint hf://bnbong/wegis-model --data data/valid.parquet
Python
from wegis_model import QshingBertModel, load_state_dict, resolve_checkpoint
model = QshingBertModel(pretrained_html=False) # ์ฒดํฌํฌ์ธํธ๋ก ๋ฎ์ด์ธ ๊ฒ์ด๋ฏ๋ก ์ฌ์ ํ์ต ๋ค์ด๋ก๋ ์๋ต
load_state_dict(model, resolve_checkpoint("hf://bnbong/wegis-model"))
model.eval()
ํจํค์ง ์์ด safetensors๋ง์ผ๋ก ๋ก๋ํ๋ ๊ฒฝ์ฐ (๋ชจ๋ธ ํด๋์ค๋ wegis_model.model ์ฐธ๊ณ ):
from safetensors.torch import load_file
model.load_state_dict(load_file("model.safetensors"), strict=True)
Training
- ํ์ต ํ์ดํ๋ผ์ธ : https://github.com/bnbong/Wegis_model (MIT) โ uv ๊ธฐ๋ฐ CLI(
train/evaluate/prepare-data), AdamW, early stopping, ์ธตํ 8:2 ๋ถํ - ๋ฐ์ดํฐ ์คํค๋ง :
url,html,label(1 = ํผ์ฑ) โ CSV / Parquet / JSONL / XLSX - ๊ณต๊ฐ ๋ฐ์ดํฐ์
๋ก๋ : Kaggle
guchiopara/look-before-you-leap(Opara et al., 45,373๊ฑด ๊ท ํ ์ฝํผ์ค)
Provenance
๊ณต๊ฐ๋ ๊ฐ์ค์น๋ ๋์ผ ์ํคํ ์ฒ์ ์ด๊ธฐ ๊ตฌํ์ผ๋ก ํ์ต๋์์ผ๋ฉฐ, Wegis_model์ ๋ชจ๋ธ ์ ์์ ์์ ํ ํธํ๋ฉ๋๋ค(strict load ๊ฒ์ฆ ํฌํจ). ํด๋น ์ ์ฅ์๋ ์๋ ๋ ผ๋ฌธ๋ค์ ๊ธฐ๋ฐ์ผ๋ก ํ์ต ํ์ดํ๋ผ์ธ์ ์๋ก ๊ตฌํํ ๊ฒ์ ๋๋ค.
Known Behaviors
- URL ์๋ฒ ๋ฉ์
padding_idx๋ 0์ด๊ณ ์ค์ PAD ํ ํฐ id๋ 94์ ๋๋ค(ํ์ต๋ ๊ฐ์ค์น์ quirk โ ๊ทธ๋๋ก ์ ์งํด์ผ ํธํ๋จ). ํจ๋ฉ ์์น๋ forward์์ attention mask ๊ณฑ์ผ๋ก 0 ์ฒ๋ฆฌ๋ฉ๋๋ค. - HTML median ํ๋ง์ attention mask๋ฅผ ์ฐธ์กฐํ์ง ์์ ํจ๋ฉ ์์น ํํ๋ ํต๊ณ์ ํฌํจ๋ฉ๋๋ค.
- URL ๋ถ๊ธฐ์ ์ ์ญ max pooling์๋ ํฉ์ฑ๊ณฑ bias๋ก ์ธํ ํจ๋ฉ ๊ตฌ๊ฐ ์์ ํ์ฑ๊ฐ์ด ์ ์ ๋ ์ ์์ต๋๋ค.
References
๋ชจ๋ธ ์ํคํ ์ฒ์ ํ์ต ์ค๊ณ๋ ๋ค์ ๋ ผ๋ฌธ์ ๊ธฐ๋ฐํฉ๋๋ค.
Ahn, J., Akhavan, D., Jung, W., Kang, K., Son, J. "Encoder-Based Multimodal Ensemble Learning for High Compatibility and Accuracy in Phishing Website Detection." In: Security and Privacy in Communication Networks (SecureComm 2024), LNICST vol. 629, pp. 347โ365. Springer, 2025. https://doi.org/10.1007/978-3-031-94455-0_16
Opara, C., Chen, Y., Wei, B. "Look before you leap: Detecting phishing web pages by exploiting raw URL and HTML characteristics." Expert Systems with Applications 236 (2024) 121183. https://doi.org/10.1016/j.eswa.2023.121183 (Open Access, CC BY 4.0)
@inproceedings{ahn2025encoder,
author = {Ahn, Jemin and Akhavan, Dorian and Jung, Woohwan and Kang, Kyungtae and Son, Junggab},
title = {Encoder-Based Multimodal Ensemble Learning for High Compatibility and Accuracy in Phishing Website Detection},
booktitle = {Security and Privacy in Communication Networks (SecureComm 2024)},
series = {LNICST},
volume = {629},
pages = {347--365},
publisher = {Springer},
year = {2025},
doi = {10.1007/978-3-031-94455-0_16}
}
@article{opara2024look,
author = {Opara, Chidimma and Chen, Yingke and Wei, Bo},
title = {Look before you leap: Detecting phishing web pages by exploiting raw {URL} and {HTML} characteristics},
journal = {Expert Systems with Applications},
volume = {236},
pages = {121183},
year = {2024},
doi = {10.1016/j.eswa.2023.121183}
}
License
- ๊ฐ์ค์น : Apache License 2.0 (๋ฒ ์ด์ค ๋ชจ๋ธ MobileBERT์ ๋์ผ)
- ํ์ต ์ฝ๋ : MIT License (Wegis_model)
Related Projects
- bnbong/Wegis โ ๋ธ๋ผ์ฐ์ ํ์ฅ
- bnbong/Wegis_server โ ์ถ๋ก ์๋ฒ
- bnbong/Wegis_model โ ํ์ต ํ์ดํ๋ผ์ธ
Model tree for bnbong/wegis-model
Base model
google/mobilebert-uncased