Smart Phishing Hunt: How We Teach ML to Handle Phishing

Mariia Anisimova6 Dec 2023

Problem

The Mail.ru Antispam team (VK) fights phishing emails: 2,140,000 phishing emails were blocked in October 2023, against 1,140,000 per month three years earlier. Hand-written rules get bypassed by fraudsters who keep improving their evasion, and targeted phishing slips past filters tuned for mass mailings. A model must also avoid flagging legitimate mailings, and retraining is hard because new confirmed phishing examples are few.

Example from the article: an email about account blocking for violating the user agreement, shown as the bag-of-words input and turned into a 0/1 vector of dictionary hits.

Solution in brief

One classifier over four feature groups: email text, image-object probabilities from a CV model, sender reputation and URL reputation. The text encoder was upgraded from bag of words with logistic regression to FastText and then RoBERTa. The model is retrained automatically on new false negatives with a loss that stays close to the previous model's probabilities, plus k-fold training and weight averaging.

Questions this case answers
  • How to keep a production classifier current against adversaries who rewrite content to evade it, when new labeled examples are few and false positives are costly
  • How to fine-tune a deployed classifier on a small batch of new examples so that its behavior on the rest of the traffic does not change
  • How to detect phishing emails with ML when rule-based filters are bypassed?
  • How to build a text classifier for phishing that survives synonym substitution and new words?

Tools and methods

  • Bag of words + logistic regression — fast, interpretable baseline
  • FastText + fully connected network — n-gram embeddings for synonyms and unseen words
  • RoBERTa + fully connected network — word order and sentence meaning
  • CV model on images — object probabilities as features
  • LogLoss + MSE to the old model — retraining without drift
  • k-fold training with weight averaging — makes use of scarce new data
Continue reading — it's free

Google or a one-time email code. No password.