Lion Cipher Lab

Group cross-validation by malware family, and measure what random folds hide

Why it matters

Malware comes in families. One author or crew ships a family, then rebuilds it again and again with small changes. Every rebuild is a VARIANT, and variants of one family look almost identical to a static feature extractor. That breaks the usual way people test a classifier. Shuffle the samples into random folds and nearly every test sample has a sibling in the training data, so the model can score near perfect just by remembering family fingerprints. Then the detector meets a family it has never seen, and the score drops. This is not rare: Arp et al. found sampling bias and data snooping, the…

What you'll learn

Steps in this lab

  1. What you are measuring: family leakage, in plain words
  2. Set up: a terminal, Python, scikit-learn, a lab folder
  3. Generate the synthetic dataset (and know exactly what is in it)
  4. BEFORE and AFTER: random folds vs folds grouped by family
  5. Prove it was memorisation: a model that can only copy
  6. The deployment question: lock away families before you train
  7. Family attribution: the right group depends on the question
  8. Honest negative 1: grouping needs family labels, and you may not trust yours
  9. Honest negatives 2 and 3: the grouped number is noisy, and it does not fix time
  10. What to report, and how a pro does it better

Open the full interactive lab →