Summary
- Useful, not decisive. On held-out PhiUSIIL domains the shipped model reaches ROC-AUC 0.916 and catches 64% of phishing at its “high” threshold with 0.9% false alarms.
- Weaker on different data. On held-out Hannousse domains ROC-AUC is 0.850 and false alarms at “high” rise to 3.6%.
- Fewer sites than URLs. Counted once per host instead of once per URL, recall at “high” is 58% on PhiUSIIL and 31% on Hannousse (details).
- A shortcut, found and excluded. In PhiUSIIL every legitimate URL is a bare
https://www.homepage; a one-line rule scores F1 0.996 there. The model therefore reads only the host name. - The model is one input. In the workspace it sits beside explainable rules, and a verdict never says a link is safe.
Data
Two public datasets, both CC BY 4.0, verified by SHA-256 on download. Only the URL text and label are used. Supplied features derived from page content are ignored, because a URL-only detector cannot see them.
| Split | URLs |
|---|---|
| Training (both datasets) | 170,734 |
| Validation (both datasets) | 38,233 |
| Test: PhiUSIIL held-out domains | 35,816 |
| Test: Hannousse held-out domains | 1,946 |
Method
- Split by owner. Every URL is grouped by its registrable domain (Public Suffix List), and the split is 70/15/15 by a salted hash of that domain. No domain appears in two splits, so the test measures new sites, not memorised ones.
- Choices on validation only. Hash size, regularisation, quantisation, calibration and thresholds were all chosen on the validation split. Each test set was scored once, afterwards.
- Model. Hashed character 3–5-grams of the host name (one leading “www.” removed), L2-normalised, with logistic regression; 216 buckets, int8 weights, Platt calibration. It runs in the browser, and a parity test checks the browser’s scores against Python to 1e-9 on 318 reference hosts. Its id,
url-host-ea3f55ce1c18faa2, is derived from the SHA-256 of its weights, calibration and thresholds; the browser checks it before using the model. Host names outside the international domain name standard (IDNA2008) are not scored, because training dropped them. - Thresholds. “High” is the score giving at most 1% false alarms on validation; “elevated” gives at most 5%. Validation is about 95% PhiUSIIL, which matters below.
A dataset shortcut
In PhiUSIIL, legitimate URLs are popular homepages written as https://www.domain with no path. A rule with no machine learning — “legitimate if https, starts with www. and has no path or query” — scores F1 0.996 on PhiUSIIL but 0.754 on Hannousse. Any model that can see the scheme, a “www.” prefix or the path learns that artefact. The shipped model sees none of them; path and structure signals are handled by the explainable rules instead.
Results on held-out domains
All three models use thresholds chosen on the same validation split.
| Model | ROC-AUC | PR-AUC | Recall at high | False alarms at high | Recall at elevated | False alarms at elevated |
|---|---|---|---|---|---|---|
| Shipped model | 0.916 | 0.921 | 64.2% | 0.9% | 74.2% | 5.0% |
| Earlier hostname model (PhiUSIIL only) | 0.919 | 0.925 | 65.4% | 0.8% | 74.9% | 4.5% |
| Original prototype | 0.848 | 0.840 | 13.2% | 0.0% | 62.6% | 1.7% |
| Model | ROC-AUC | PR-AUC | Recall at high | False alarms at high | Recall at elevated | False alarms at elevated |
|---|---|---|---|---|---|---|
| Shipped model | 0.850 | 0.898 | 53.8% | 3.6% | 66.6% | 11.2% |
| Earlier hostname model (PhiUSIIL only) | 0.832 | 0.881 | 52.5% | 4.9% | 65.1% | 10.2% |
| Original prototype | 0.780 | 0.823 | 57.5% | 18.3% | 85.9% | 51.6% |
Training on both datasets bought a modest gain on Hannousse and cost a little on PhiUSIIL compared with the earlier PhiUSIIL-only model. We shipped it because broader training data is the better bet for unfamiliar traffic, and say so rather than pick the more flattering table.
Counted once per site
The tables above count every URL. The model reads only the host name, so all URLs on one host get the same score, and a site with hundreds of URLs in a dataset counts hundreds of times. In the Hannousse test set one domain alone is 18% of the URLs. Counting each host or domain once gives a less flattering and more honest picture of how the model does on a site it has not seen:
| Counted | Items | ROC-AUC | Recall at high | False alarms at high |
|---|---|---|---|---|
| Once per URL (as above) | 35,816 | 0.916 | 64.2% | 0.9% |
| Once per host name | 31,968 | 0.899 | 57.6% | 0.9% |
| Once per registrable domain | 29,537 | 0.887 | 55.1% | 0.9% |
| Counted | Items | ROC-AUC | Recall at high | False alarms at high |
|---|---|---|---|---|
| Once per URL (as above) | 1,946 | 0.850 | 53.8% | 3.6% |
| Once per host name | 1,208 | 0.758 | 31.5% | 3.7% |
| Once per registrable domain | 1,067 | 0.757 | 28.2% | 3.3% |
The false-alarm rate barely moves; recall drops, most sharply on Hannousse. These figures are produced by phase3/run.py engine-sites from the shipped model file, alongside the per-URL report.
Across datasets
Trained on one dataset and tested on the other’s held-out domains, the same recipe reaches ROC-AUC 0.838 (PhiUSIIL to Hannousse) and 0.802 (Hannousse to PhiUSIIL). Expect performance on your own traffic to be closer to these figures than to the in-dataset ones.
Calibration and thresholds
Scores are calibrated with Platt scaling on validation. Expected calibration error on the test sets is 0.034 (PhiUSIIL) and 0.071 (Hannousse); Brier scores are 0.108 and 0.159. Because validation is mostly PhiUSIIL, the “high” threshold’s 1% false-alarm target holds there but not on Hannousse. In the workspace, a high model score alone yields “Suspicious”, never “High risk”; it takes rule-based evidence as well. On domains in the brand reference list, the model score is not used at all.
The original prototype
The course-project app displayed “98.6% accuracy”. That figure came from a model trained on 48 page-content features of a different dataset, not from the Random Forest that scored links, which was trained on synthetic URLs. Measured the same way as above, that Random Forest catches 10.6% of phishing on held-out PhiUSIIL domains at its default setting. It is kept in the repository as a reference baseline only.
Limitations
- Distribution shift. PhiUSIIL’s legitimate URLs are popular homepages; everyday legitimate links are far more varied, so real false-alarm rates will be higher.
- No time dimension. Neither dataset has timestamps, so drift over time is unmeasured, and phishing infrastructure changes quickly.
- Text only. A URL-only model cannot recognise a compromised legitimate site, content on shared hosting, or a convincing newly registered domain.
- Unknown provenance. Neither dataset documents its URL sources, so label noise cannot be quantified.
- Popular sites can score high. Login and account hosts of real services (and some popular sites such as large shops) resemble phishing hosts to a model trained on these datasets. On domains in the brand reference list the score is ignored; elsewhere a high score alone gives “Suspicious”, never “High risk”.
- Brand list. The brand reference list behind the impersonation checks is curated by hand and covers a few dozen commonly impersonated brands, not every brand.
Credits
Prasad, A. & Chandra, S. (2024). PhiUSIIL Phishing URL (Website) [Dataset]. UCI Machine Learning Repository. doi:10.1016/j.cose.2023.103545. CC BY 4.0.
Hannousse, A. & Yahiouche, S. (2021). Web page phishing detection (Version 3) [Dataset]. Mendeley Data. doi:10.17632/c2gw7fy2j4.3. CC BY 4.0.
Public Suffix List, Mozilla Public License 2.0. Reports: phase3/reports/engine/ and phase3/reports/ in the source repository.