PHISHREV+: An ASP-Based Post-Hoc Defeasible Machine Learning Framework for Phishing Detection
Authors: Mainak Sen, Kumar Sanka Ray, Amlan Chakrabarti
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
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 (41→39), KNN (47→46), DT (62→61), and RF (52→51) 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
Figure 1: Anatomy of a phishing attack. The attacker creates a look-alike site ( https://chase-secure-login.com ) mimicking the legitimate domain ( https://chase.com ) and distributes its URL via email/SMS. Victim data flows from the user to the phishing site and then to the attacker, who reuses the stolen credentials on the genuine site.
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
Table 1: Summary of Machine Learning Based Phishing Detection Approaches
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
Table 2: Summary of Deep Learning Based Phishing Detection Approaches
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
Table 3: Summary of LLM Based Phishing Detection Approaches
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
O(T⋅n⋅f⋅logn)
O(n)
Defeasibility
No
Yes
Table 4: Comparison of Machine Learning and Non-Monotonic Reasoning
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
Table 5: Distribution of meta_info_present across the training and test sets. Training-set values are used for rule derivation; test-set values are shown for verification only.
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
Table 6: Descriptive Statistics and Percentile Comparison of length_url (Training Set) — Phishing (meta=yes, n =457) vs Legitimate (meta=yes, n =2,319)
Figure 2: Distribution of length_url in the training set for instances with meta=yes (phishing n=457 , legitimate n=2,319 ). The left panel shows the density histogram for both classes. The dashed black line marks the threshold τ=63 . The dotted lines mark the class means. URL lengths above 200 characters are shown in the last bin. The phishing mean (63.2) lies very close to τ=63 , so the two lines overlap. The right panel shows the percentage of URLs in each class that exceed each threshold. At τ=63 , 31.5% of phishing URLs and 20.4% of legitimate URLs exceed the threshold.
nb_www Value
Phishing ( n =313)
Legitimate ( n =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%
Table 7: Distribution of nb_www (Training Set) — Phishing vs Legitimate (meta=yes, length_url ≤ 63)
domain_in_title
Phishing ( n =69)
Legitimate ( n =1,386)
0 (not in title)
12 (17.4%)
599 (43.2%)
1 (in title)
57 (82.6%)
787 (56.8%)
Separation
25.8%
Table 8: Distribution of domain_in_title (Training Set) — Phishing vs Legitimate (meta=yes, length_url ≤ 63, nb_www = 1)
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)
Table 9: EDA Summary — Contextual Feature Separation Analysis Across All 4 Features (Training Set).Each feature is measured on the subset that reaches its rule: meta_info_present on all training instances, length_url on meta=yes, nb_www on meta=yes with length_url ≤63 , and domain_in_title on meta=yes with length_url ≤63 and nb_www = 1.
Feature
Test
Statistic
Critical
p-value
Effect
Decision
meta_info_present
χ2
1790.46
3.841
< 0.001
OR=9.26
Reject H0
length_url
Mann-Whitney
650657
—
1.23×10−14
r =0.146
Reject H0
nb_www
χ2
336.96
3.841
2.92×10−75
OR=10.48
Reject H0
domain_in_title
χ2
16.95
3.841
3.83×10−05
OR=3.62
Reject H0
Table 10: Statistical Significance of Contextual Features — Training Set ( α = 0.05, df=1)
Figure 3: Overview of the PHISHREV+ framework. In the first stage, the training set is used to train four ML classifiers and to derive the four defeasible rules and the threshold τ=63 through EDA. The rules and τ=63 are frozen before testing. In the inference stage, each test URL is classified by the trained models. These predictions become initial beliefs B0 . These beliefs and the contextual features of the URL are encoded as ASP facts. Clingo computes the unique answer set, which gives the final belief Bf .
Table 11: Best Hyperparameter Configuration for Each Classifier
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).
Table 12: ASP facts corresponding to two sample URLs
Phase
Operation
Complexity
ML Training
SVM
O(n2⋅f)
ML Training
KNN
O(n⋅f)
ML Training
DT
O(n⋅f⋅logn)
ML Training
RF
O(T⋅n⋅f⋅logn)
NMR Fact Generation
All classifiers
O(n)
NMR Rule Evaluation
All classifiers
O(n)
Table 13: Computational Complexity of PHISHREV+ Framework
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
Table 14: Machine Learning Classification Results Before NMR-Based Belief Revision
Classifier
Revised Predictions
SVM
2
KNN
1
Decision Tree
1
Random Forest
1
Total
5
Table 15: Number of Revised Predictions by NMR Layer
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
Table 16: Performance After NMR-Based Belief Revision — PHISHREV+ Framework
Classifier
b
c
Exact p
SVM
2
0
0.500
KNN
1
0
1.000
DT
1
0
1.000
RF
1
0
1.000
Table 17: McNemar test on paired predictions, ML-only vs ML+NMR (test set). b : wrong before and correct after revision. c : correct before and wrong after revision.
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
Table 18: Comparison of ML-only, Deterministic If-Else Post-Processing, and ASP-Based NMR (FP / FN)
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 ( n = 2,286; 9,144 decisions)
Fact generation
0.2507
Table 19: Empirical runtime of the ML phase and the NMR layer (median of five runs)
n
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
Table 20: Scaling of ASP grounding and solving time with the number of test instances (median of five runs).Grounding instantiates the rules with the facts of each instance; solving computes the unique answer set of the resulting ground program.
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
Table 21: Ablation Study: FP and FN across all classifiers for each rule configuration
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.
Table 22: Narrowing of the revision search space on the test set. Each row retains the instances that pass all preceding conditions, i.e., those not blocked by any defeater.
Figure 4: Narrowing of the revision search space on the test set. Each stage retains only the instances not blocked by the corresponding defeater rule; band width is proportional to the number of instances. Rule 1 admits 680 instances with meta information present (112 phishing). Successive defeaters — URL length (Rule 2), www prefix (Rule 3) and domain in title (Rule 4) — reduce this set to 520, 347 and finally 145 instances (21.3% of the initial set), none of which is phishing. Of these, only two were predicted as phishing by any classifier, and these are exactly the instances revised by the NMR layer.
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%
Table 23: Progressive narrowing of revisions as defeater rules are added. Counts are classifier-level predictions (test instances × classifiers), summed over all four classifiers.
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
Table 24: Qualitative comparison of deterministic if-else post-processing and ASP-based non-monotonic reasoning for the proposed rule set
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)
Table 25: Comparison with prior work on the same benchmark dataset. n.r. = not reported in the original paper.
Figure 5: XASP explanation DAG for instance url464 generated using the xasp library [ 7 ] . Teal nodes indicate true facts, fired rules and initial belief B0 ; blue nodes indicate contextual facts, brown nodes denote defeated rules, dark green indicates the final belief Bf . Rule 1 fires because all three defeating conditions are absent, formally retracting the initial phishing belief and revising to legitimate, thus correctly reducing a false positive. The same derivation applies to the SVM and KNN predictions for this instance. DT predicted legitimate, so no revision was needed.
In phishing detection, machine learning classifiers act as a first line of defense, but the false positives they produce are triaged by human analysts. The excessive false alarms cause alert fatigue that erodes human oversight. We propose CoGReV, a hybrid framework that augments standard machine learning classifiers with a post-hoc non-monotonic reasoning layer implemented in Answer Set Programming. The layer applies a confidence-gated defeasible rule that revises a phishing prediction toward legitimate only when website metadata is present and the classifier's decision is low-confidence, deferring uncertain predictions to the reasoning layer while leaving out confident decisions to the classifiers. This gating acts as a function-allocation mechanism between the classifier and the reasoning layer. Unlike an ungated rule, which reduces false positives only by discarding genuine detections and degrades phishing recall by about nine percentage points, the proposed gated rule keeps recall within 0.7 percentage points of the no-revision baseline for all classifiers while revising only 0.27 percent of decisions. By lowering false alarms, without sacrificing detection, CoGReV reduces analysts alert fatigue and integrates new domain knowledge into the reasoning layer in O(n) time.
Mainak Sen, Kumar Sankar Ray, Amlan Chakrabarti
Techno India University, West Bengal, India · A. K. Choudhury School of Information Technology, University of Calcutta, Kolkata, India · Electronics and Communication Sciences Unit (ECSU), Indian Statistical Institute, Kolkata, India +1
Organizations usually calibrate phishing detectors on public corpora, because privacy rules make their own labeled legitimate mail hard to collect. This practice breaks the false-positive budget of trained detectors: calibrated for a 1% false-positive rate (FPR) on older public mail and deployed on DataPhish 2025, they realize 20.2-22.9% FPR, 9-94 times the budget across three calibration sources. The cause is calibration transfer, not ranking: the classifiers separate the deployment mail well, but their thresholds do not transfer. We introduce CyberCane, a privacy-bounded neuro-symbolic detector that scores email only by similarity to known phishing in a redacted, training-only index, plus deterministic rules, and calibrates verdicts to an explicit FPR budget. Because legitimate mail never enters its score, only its threshold depends on the calibration source. Under the same shift CyberCane realizes 5.4% FPR at 86.4% recall, reducing the overrun 2.7-6.1 times across sources, seeds, a second shift family, and a local embedder. A segment-level variant, scoring an email's most phishing-like part, lowers the realized FPR a further 1.2-2.7 times at equal ranking quality and withstands benign padding. CyberCane screens an email locally in 0.20 s, sending no text out; a 70B zero-shot LLM ranks better at strict FPR but is 14-24 times slower and must receive each email. We also show that LLM rewriting does not evade embedding-based detectors and that a random split of DataPhish 2025 leaks 96% of its test set. All protocols were fixed in advance, and the released splits and code let a deployer measure realized FPR before trusting a budget.
Safayat Bin Hakim, Aniqa Afzal, Qi Zhao +3
α University of Maryland, Baltimore County · β Bowie State University
Phishing is a multi-modal threat. We present a hybrid pipeline that scores each modality with its own engine and fuses the results. Three engines are built, deployed, and independently benchmarked: a four-stage URL stack (Domain Guard, lexical model, threat intelligence, and an asymmetric L2 fusion sidecar); a generalization-hardened DistilBERT NLP classifier whose held-out real-phishing recall rises from 0.8% to 87.3%; and a threat-intelligence synchronizer with end-to-end OpenTelemetry instrumentation confirming 1:1 message conservation. A decision-level fusion stage, characterized on a 10,677-email whole-system benchmark, reaches F1=0.914 with a calibrated probabilistic-OR over URL, header, and phishing-probability channels while reducing held-out real-spam false positives to 3.6%. Because that benchmark uses proxy URL and header channels and an operating point still needing recalibration, we present it as a preliminary integrated result. For deployable detection, the limiting factor is how well a model generalizes, not how accurately it scores data drawn from its own training distribution.
Saifelden M. Ismail, Aser O. Ibrahim, Omar A. Mahmoud
Department of Communications and Information Engineering Zewail City of Science and Technology, Giza, Egypt