PHISHREV+: An ASP-Based Post-Hoc Defeasible Machine Learning Framework for Phishing Detection
Organizations: Computer Science & Engineering Department, Techno India University, West Bengal, EM 4, Salt Lake, Kolkata, 700091, West Bengal, India · A.K.Choudhury School of Information Technology, University of Calcutta, JD 2, Sector 3, Kolkata, 700106, West Bengal, India · ECSU Unit, Indian Statistical Institute, 203, B. T Road, Kolkata, 700108, West Bengal, India · Department of Artificial Intelligence, Indian Institute of Technology, Kharagpur, Kolkata, 721302, West Bengal, India
Abstract
Phishing website detection remains a critical cybersecurity challenge. Although machine learning classifiers achieve high accuracy on benchmark datasets, they suffer from a fundamental limitation: once trained, their decision boundaries are fixed and cannot incorporate new contextual evidence without retraining the model. This work presents PHISHREV+, a hybrid framework that instantiates the notion of post-hoc defeasible machine learning. This framework does not replace the classifier. It treats the initial classifier predictions as defeasible beliefs and revises them through an Answer Set Programming based non-monotonic reasoning(NMR) layer. The framework operates in two phases. In the machine learning phase, four classifiers (SVM, KNN, DT and RF) are trained on the 87 feature benchmark dataset. In the post-hoc NMR phase, four defeasible rules derived from exploratory data analysis of the training set, and validated through Chi-square and Mann-Whitney U tests, formally revise initial predictions. The proposed framework achieves consistent false positive reduction across all our classifiers SVM (4139), KNN (4746), DT (6261), and RF (5251) while maintaining complete false negative parity with zero increase overhead. A comprehensive ablation studies across seven rule configurations confirms that the hierarchical combination of all four defeasible rules is necessary to achieve this optimal balance. Instance level explainability is provided through eXplainable ASP (XASP), which generates formal derivation graphs showing which defeasible rules fired and why the initial belief was retracted, a capability absent from all existing phishing detection approaches.
Figures & tables
| Ref. | Year | Algorithm | Features | Key Findings | Limitations |
| [ 25 ] | 2021 | RF | 87 lexical, content and external | RF achieved 96.61% accuracy on proposed 87-feature benchmark dataset | No defeasibility; retraining required |
| [ 23 ] | 2021 | RF | 9 lexical | RF achieved 99.57% for real-time detection on constrained devices | No defeasibility; retraining required |
| [ 1 ] | 2023 | RF | 87 lexical | RF achieved 96.54% on benchmark dataset | No defeasibility; retraining required |
| [ 16 ] | 2023 | RF, LR, DT, SVM, XGBoost | 25 hybrid | RF achieved 98.80% on PhishTank and 97.87% on UCI dataset | No defeasibility; retraining required |
| [ 46 ] | 2025 | RF + XAI | 87 lexical | RF achieved 96.76% with SHAP-based explainability | No defeasibility; retraining required |
| [ 48 ] | 2025 | XGBoost, GBM, LGBM + SHAP | 30 hybrid URL | XGBoost achieved 97.78% with SHAP-based explainability | No defeasibility; retraining required |
| Ref. | Year | Algorithm | Key Findings | Limitations |
| [ 49 ] | 2019 | Bi-LSTM + CNN | Bi-LSTM followed by CNN achieved 95.6% accuracy on 500,000 URLs dataset | No defeasibility; retraining required |
| [ 2 ] | 2021 | LSTM | LSTM achieved 98.3% accuracy on 450,176 URLs dataset | No defeasibility; retraining required |
| [ 50 ] | 2021 | CNN + Multi-head Attention | CNN with multi-head attention achieved 95.6% accuracy | No defeasibility; retraining required |
| [ 6 ] | 2022 | CNN | Character-level CNN achieved 98.13% accuracy | No defeasibility; retraining required |
| [ 10 ] | 2024 | Bi-LSTM + Attention | Bi-LSTM with attention achieved 99% accuracy on webpage content | No defeasibility; retraining required |
| [ 24 ] | 2024 | RNN + WOA | WOA-optimized RNN achieved 92% accuracy on 11K dataset | No defeasibility; retraining required |
| Ref. | Year | Model | Key Findings | Limitations |
| [ 27 ] | 2024 | GPT-4 | GPT-4 used for both generating and detecting phishing emails. Claude detected AI-generated phishing with 100% accuracy when primed but dropped to 75% on real-world emails | Non-revisable at inference; fine-tuning required for updates |
| [ 15 ] | 2024 | GPT-3.5, GPT-4, ChatGPT | Evaluated phishing detection capabilities of three LLM variants with varying levels of success across models | Non-revisable at inference; fine-tuning required for updates |
| [ 51 ] | 2025 | GPT-3.5, Llama-3 | GPT-3.5 and Llama-3-8b-Instruct identified as best performing models for phishing detection in SMEs | Non-revisable at inference; fine-tuning required for updates |
| [ 32 ] | 2024 | Multimodal LLM | Multimodal LLM combining webpage visual and textual signals for phishing webpage detection | Non-revisable at inference; fine-tuning required for updates |
| Property | ML Classifier | NMR (ASP) |
|---|---|---|
| Learning | Data-driven | Rule-driven |
| Decision boundary | Fixed after training | Dynamic via rules |
| Belief revision | Not supported | Formally supported |
| New evidence | Requires retraining | Rule addition only |
| Update complexity | ||
| Defeasibility | No | Yes |
| Split | URL Type | Meta Present | Meta Absent | Meta (%) |
|---|---|---|---|---|
| Train | Legitimate (4,572) | 2,319 | 2,253 | 50.72 |
| Phishing (4,570) | 457 | 4,113 | 10.00 | |
| Total (9,142) | 2,776 | 6,366 | 30.37 | |
| Test | Legitimate (1,143) | 568 | 575 | 49.69 |
| Phishing (1,143) | 112 | 1,031 | 9.80 | |
| Total (2,286) | 680 | 1,606 | 29.75 | |
| Descriptive Statistics | Percentile Comparison | ||||
| Metric | Phishing | Legitimate | Percentile | Phishing | Legitimate |
| Count | 457 | 2,319 | P10 | 27.0 | 23.0 |
| Mean | 63.22 | 45.47 | P25 | 34.0 | 27.0 |
| Std Dev | 49.59 | 23.09 | P50 | 47.0 | 38.0 |
| Min | 15.0 | 13.0 | P75 | 74.0 | 59.0 |
| Max | 415.0 | 161.0 | P90 | 113.4 | 77.0 |
| nb_www Value | Phishing ( =313) | Legitimate ( =1,845) |
|---|---|---|
| 0 (no www prefix) | 243 (77.6%) | 459 (24.9%) |
| 1 (has www prefix) | 69 (22.0%) | 1,386 (75.1%) |
| 2 | 1 (0.3%) | 0 (0.0%) |
| Separation | 52.8% | |
| domain_in_title | Phishing ( =69) | Legitimate ( =1,386) |
|---|---|---|
| 0 (not in title) | 12 (17.4%) | 599 (43.2%) |
| 1 (in title) | 57 (82.6%) | 787 (56.8%) |
| Separation | 25.8% | |
| Feature | Phishing (%) | Legitimate (%) | Separation (%) | NMR Usage |
| meta_info_present | 10.00 | 50.72 | 40.72 | Rule 1 (revision trigger) |
| length_url ( 63) | 31.5 | 20.4 | 11.1 | Rule 2 (defeater) |
| nb_www (=0) | 77.6 | 24.9 | 52.8 | Rule 3 (defeater) |
| domain_in_title (=1) | 82.6 | 56.8 | 25.8 | Rule 4 (defeater) |
| Feature | Test | Statistic | Critical | p-value | Effect | Decision |
| meta_info_present | 1790.46 | 3.841 | 0.001 | OR=9.26 | Reject | |
| length_url | Mann-Whitney | 650657 | — | =0.146 | Reject | |
| nb_www | 336.96 | 3.841 | OR=10.48 | Reject | ||
| domain_in_title | 16.95 | 3.841 | OR=3.62 | Reject |
| Classifier | Search Space | Best Configuration |
|---|---|---|
| SVM | C {0.1, 1, 10}, kernel {linear, rbf}, {scale, auto} | C=10, kernel=rbf, =scale |
| KNN | k {3,5,7,9}, weights {uniform, distance}, metric {euclidean, manhattan} | k=7, weights=distance, metric=manhattan |
| DT | criterion {gini, entropy}, max_depth {3,5,10,None}, min_samples_split {2,5,10} | criterion=gini, max_depth=10, min_samples_split=2 |
| RF | n_estimators {100,200}, max_depth {5,10,None}, criterion {gini, entropy} | n_estimators=200, max_depth=None, criterion=gini |
| Predicate | Fact |
|---|---|
| Prediction | pred(rf,464,phishing). |
| Metadata | meta(464,yes). |
| URL Length | url_length(464,44). |
| WWW Count | nb_www(464,1). |
| Domain in Title | domain_in_title(464,0). |
| Prediction | pred(svm,2048,phishing). |
| Phase | Operation | Complexity |
|---|---|---|
| ML Training | SVM | |
| ML Training | KNN | |
| ML Training | DT | |
| ML Training | RF | |
| NMR Fact Generation | All classifiers | |
| NMR Rule Evaluation | All classifiers |
| Classifier | Accuracy (%) | Precision | Recall | F1-Score | FP | FN |
| SVM | 96.33 | 0.9641 | 0.9624 | 0.9632 | 41 | 43 |
| KNN | 95.45 | 0.9585 | 0.9501 | 0.9543 | 47 | 57 |
| Decision Tree | 93.70 | 0.9448 | 0.9283 | 0.9365 | 62 | 82 |
| Random Forest | 95.80 | 0.9548 | 0.9615 | 0.9582 | 52 | 44 |
| Classifier | Revised Predictions |
|---|---|
| SVM | 2 |
| KNN | 1 |
| Decision Tree | 1 |
| Random Forest | 1 |
| Total | 5 |
| Classifier | Before NMR | After NMR | Revised | ||||||
| Acc(%) | Prec | FP | FN | Acc(%) | Prec | FP | FN | ||
| SVM | 96.33 | 0.9641 | 41 | 43 | 96.41 | 0.9658 | 39 | 43 | 2 |
| KNN | 95.45 | 0.9585 | 47 | 57 | 95.49 | 0.9594 | 46 | 57 | 1 |
| Decision Tree | 93.70 | 0.9448 | 62 | 82 | 93.74 | 0.9456 | 61 | 82 | 1 |
| Random Forest | 95.80 | 0.9548 | 52 | 44 | 95.84 | 0.9557 | 51 | 44 | 1 |
| Classifier | Exact | ||
|---|---|---|---|
| SVM | 2 | 0 | 0.500 |
| KNN | 1 | 0 | 1.000 |
| DT | 1 | 0 | 1.000 |
| RF | 1 | 0 | 1.000 |
| Classifier | ML-only | ML + If-Else | ML + ASP |
|---|---|---|---|
| SVM | 41 / 43 | 39 / 43 | 39 / 43 |
| KNN | 47 / 57 | 46 / 57 | 46 / 57 |
| DT | 62 / 82 | 61 / 82 | 61 / 82 |
| RF | 52 / 44 | 51 / 44 | 51 / 44 |
| Component | Training (s) | Inference (s) |
|---|---|---|
| SVM | 7.665 | 0.4116 |
| KNN | 0.003 | 0.4534 |
| DT | 0.126 | 0.0006 |
| RF | 2.876 | 0.0610 |
| NMR layer ( = 2,286; 9,144 decisions) | ||
| Fact generation | 0.2507 | |
| Ground + Solve (s) | ms / instance | |
|---|---|---|
| 500 | 0.0140 | 0.0281 |
| 1000 | 0.0267 | 0.0267 |
| 1500 | 0.0423 | 0.0282 |
| 2000 | 0.0535 | 0.0267 |
| 2286 | 0.0614 | 0.0268 |
| Configuration | SVM | KNN | DT | RF | Total | RF FN | ||||
| FP | FN | FP | FN | FP | FN | FP | FN | Revised | Change | |
| Before NMR | 41 | 43 | 47 | 57 | 62 | 82 | 52 | 44 | — | — |
| Rule 1 only | 30 | 145 | 33 | 159 | 42 | 177 | 38 | 146 | 460 | +102 |
| Rule 1+2 | 33 | 100 | 34 | 115 | 49 | 135 | 41 | 101 | 270 | +57 |
| Comb A (Rule 1+3) | 35 | 68 | 42 | 78 | 53 | 106 | 46 | 68 | 120 | +24 |
| Comb B (Rule 1+2+3) | 37 | 55 | 43 | 67 | 57 | 93 | 48 | 56 | 62 | +12 |
| Stage | URLs | Phish. | Legit. | Pred. phish. a | Pred. legit. b |
| R1: meta = yes | 680 | 112 | 568 | 136 | 544 |
| + R2: length_url 63 | 520 | 65 | 455 | 81 | 439 |
| + R3: nb_www = 1 | 347 | 13 | 334 | 18 | 329 |
| + R4: domain_in_title = 0 | 145 | 0 | 145 | 2 | 143 |
| a Predicted phishing by at least one classifier. | |||||
| b Predicted legitimate by all four classifiers. | |||||
| Rule set | Revised predictions | Correct | Incorrect | Precision |
|---|---|---|---|---|
| R1 | 460 | 59 | 401 | 12.8% |
| R1 + R2 | 270 | 45 | 225 | 16.7% |
| R1 + R2 + R3 | 62 | 17 | 45 | 27.4% |
| R1 + R2 + R3 + R4 | 5 | 5 | 0 | 100% |
| Aspect | If-else procedure | ASP knowledge base |
|---|---|---|
| Predictions | Identical to ASP (Table 18 ) | Identical to if-else |
| Rule priority | Implicit in nesting order | Explicit via default and defeater rules |
| Adding a rule | Edit control flow at the correct position | Append one rule |
| Semantics | Defined by program execution | Stable model semantics; unique answer set |
| Explanation | Returns a label only | Formal derivation per revision (XASP) |
| Knowledge vs. code | Rules embedded in code | Rules separate from ML pipeline |
| Aspect | Hannousse et al. [ 25 ] | Adane et al. [ 1 ] | Shafin [ 46 ] | PHISHREV [ 45 ] | PHISHREV+ |
| RF accuracy (%) | 96.61 | 96.54 | 96.76 | 95.89 | 95.80 / 95.84 a |
| FP / FN reported | n.r. | n.r. | n.r. | FP only b | Yes |
| Post-hoc revision of predictions | No | No | No | Yes | Yes |
| Number of revision rules | – | – | – | 1 | 4 (1 default, 3 defeaters) |
| New knowledge needs retraining | Yes | Yes | Yes | No | No |
| Explanation | None | None | Feature-level | None | Rule-level (XASP) |