ML Phishing Detection: How Classifiers Work and How to Evaluate Them

Machine learning phishing detection trains a classifier on labelled examples of phishing and legitimate messages or URLs. The model learns from features such as sender authentication results, link and domain properties, page content and wording. It outputs a score, and a threshold decides whether to block, warn or deliver. Choosing that threshold is a trade-off: catch more phishing and you also flag more real mail.

Mar 25, 2025 - 10:44
Updated: 
107.6k

AI in Cybersecurity in Cybersecurity & Ethical Hacking · Explainer

ML Phishing Detection: How Classifiers Work and How to Evaluate Them

Quick answer: Machine learning phishing detection trains a classifier on labelled examples of phishing and legitimate messages or URLs. The model learns from features such as sender authentication results, link and domain properties, page content and wording. It outputs a score, and a threshold decides whether to block, warn or deliver. Choosing that threshold is a trade-off: catch more phishing and you also flag more real mail. Good evaluation uses precision, recall and false positive rate on recent data the model has never seen. ML works best layered with DMARC, user reporting and fast takedown.

Key takeaways

  • A classifier is only as good as its labelled training data and features.
  • Accuracy alone is misleading because phishing is rare compared with legitimate mail.
  • Precision, recall and false positive rate tell you far more.
  • Attackers adapt, so models need time-split testing and regular retraining.
  • ML adds to email authentication and user reporting; it does not replace them.

Table of Contents

How Does a Phishing Classifier Work?

Phishing is listed as technique T1566 in MITRE ATT&CK, covering attachments, links and messages through third-party services. A classifier handles it in four steps: extract features from each message or URL, feed them to a trained model, get a probability score, then apply a threshold policy. Messages above a high threshold are quarantined, a middle band gets a warning banner, and the rest are delivered.

Which Features Do Phishing Models Use?

Feature groupExamples
AuthenticationSPF, DKIM and DMARC results, reply-to mismatch
Sender historyFirst time sender, unusual sending time
URL and domainDomain age, look-alike characters, redirect chains
TextUrgency, payment or credential requests, tone
Landing pageLogin forms, brand logos on unrelated domains
AttachmentsFile type, embedded links or QR codes

DMARC, defined in RFC 7489, is one of the strongest single signals because it shows whether a message really came from the domain it claims.

Which Model Types Are Common?

  • Gradient boosted trees and random forests work well on structured features such as URL length or domain age, and their decisions are easier to explain.
  • Transformer language models read message text and catch persuasive wording that keyword rules miss.
  • Image models compare landing pages with known brand login pages.
  • Ensembles combine several models so one weak signal does not decide alone.

How Do You Evaluate a Phishing Classifier?

If one message in a thousand is phishing, a model that never flags anything is 99.9 percent accurate and useless. Use these measures instead.

MetricQuestion it answers
PrecisionOf the messages flagged, how many were really phishing?
RecallOf the real phishing, how much did we catch?
False positive rateHow much legitimate mail was wrongly flagged?
Precision-recall curveHow do these change as the threshold moves?

Test on messages from a later period than the training data. A random split leaks future campaigns into training and makes results look better than they will be in production.

Why Do False Positives Matter So Much?

A blocked invoice or job offer costs real money and trust. When users see too many warnings they start ignoring them, which helps attackers. Track false positives per department, offer a simple release request process, and review what the model blocked each week.

How Do Attackers Evade ML Detection?

Attackers host pages on trusted cloud services, use QR codes instead of links, hide text in images and use generative AI to vary wording. These are evasion attacks in the language of NIST AI 100-2 E2025. User reports used as training labels can also be poisoned. Defences include adversarial testing, label review and retraining on fresh samples. The APWG trends reports help teams follow current phishing patterns.

What Should Sit Around the Model?

  • Enforced DMARC on your own domains.
  • Phishing-resistant MFA, as CISA phishing guidance recommends.
  • A report button that feeds the SOC and model labels.
  • Governance of model changes under the NIST AI RMF.
  • In India, victims can report fraud on 1930 or cybercrime.gov.in.

See also how AI detects and prevents phishing and anti-phishing tools for SOC analysts. To learn email security in practice, ask about cybersecurity training.

References

Frequently Asked Questions

It extracts features from messages and URLs, scores them with a model trained on labelled examples, and applies a threshold to block or warn.

Phishing is rare, so a model that flags nothing can look highly accurate. Precision, recall and false positive rate are more useful.

Precision is the share of flagged messages that were phishing. Recall is the share of all phishing messages that the model caught.

Phishing campaigns change over time, so testing on a later period shows how the model will perform against new attacks in production.

Yes. They use trusted hosting, QR codes, text in images and varied AI-written wording, so models need regular retraining and other layers.

Yes. DMARC verifies that mail really comes from the claimed domain, which is one of the strongest signals any filter can use.

Track them by department, offer a quick release process, review blocked mail weekly and adjust thresholds where legitimate mail is often caught.

Call the 1930 helpline or file a complaint at cybercrime.gov.in, and inform your organisation’s security team if it involves work accounts.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.