Built to order

AI-Based Malware Classification using ML and API Call Sequences

This project builds an AI-based malware classifier that reads the ordered Windows API calls a program makes and predicts its malware family, using a 1D-CNN + BiLSTM model trained on BODMAS data. It ships with a Cuckoo Sandbox trace-collection pipeline, a working web demo that classifies sample traces with per-family probabilities, and a full evaluation with a confusion matrix and per-class precision, recall and F1. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.

Chat on WhatsApp — get a quotation

AI & Machine Learning PythonMatplotlibJupyter notebookTensorFlow · KerasHTML · CSS · JavaScript demoNumPy · scikit-learnBODMAS datasetCuckoo SandboxSoftware
AI-Based Malware Classification using ML and API Call Sequences — project thumbnail preview
More project photos (2)

The problem

AI-Based Malware Classification using ML and API Call Sequences is a software project that classifies Windows programs as benign or as one of eight distinct malware families — Trojan, Worm, Backdoor, Downloader, Ransomware, Dropper, Infostealer or Virus — by reading the ordered sequence of Windows API calls the program makes while it runs in an isolated sandbox. A 1D-CNN learns short local call patterns such as VirtualAllocEx followed by WriteProcessMemory and CreateRemoteThread, a BiLSTM carries the order across the full 128-call trace, and a softmax layer returns a probability for each of the nine classes, trained on the publicly available BODMAS dataset of 134,435 labelled samples with 581 families, while the demo shows the trace and the probability distribution behind every prediction. Antivirus tools that rely on file hashes or static signatures miss malware that repacks itself, yet a single API call proves nothing, since CreateFile is used by every program, and only the order of calls reveals intent.

How it works

A Windows executable is run inside an isolated Cuckoo Sandbox virtual machine, which records every Windows API call it makes in order — file, registry, process, network and cryptography calls with timestamps and arguments. Those ordered calls are cleaned, mapped to a fixed vocabulary, and truncated or padded to 128-call sequences; the BODMAS dataset supplies the family label for each sample, giving 134,435 labelled examples across eight malware categories plus benign programs. A 1D-CNN reads short local patterns in the sequence while a BiLSTM carries order across the whole trace, and a softmax layer outputs a probability for each of the nine classes. At inference time the same pipeline runs on a new trace, the demo shows the predicted family with its full probability distribution, and the evaluation reports a confusion matrix and per-class precision, recall and F1 on held-out traces.

  1. Samples are executed in an isolated Cuckoo Sandbox virtual machine, which records the ordered Windows API calls with timestamps and arguments.
  2. Each sample is labelled with its BODMAS family — eight categories (Trojan, Worm, Backdoor, Downloader, Ransomware, Dropper, Infostealer, Virus) plus benign — from the 134,435-sample corpus with 581 curated families.
  3. Traces are cleaned, mapped to a fixed API-call vocabulary, and truncated or padded to 128-call sequences, then split 80/10/10 into training, validation and test sets.
  4. The 1D-CNN + BiLSTM model is trained: the CNN learns local 3-gram call patterns, the BiLSTM carries order across the trace, and a nine-class softmax produces the family probabilities.
  5. The model is evaluated once on the held-out test split: a confusion matrix and per-class precision, recall and F1 are recorded, and only the figures that run produces go into the report.
  6. In the web demo, a sample trace is classified in the browser and the result shows the predicted family, its confidence, the full nine-class distribution, and the trace with suspicious calls highlighted.

Tech stack:

  • Python 3, TensorFlow/Keras

  • Cuckoo Sandbox (trace collection)

  • BODMAS dataset

  • NumPy, scikit-learn (metrics)

  • Jupyter Notebook (training & evaluation)

  • HTML, CSS, JavaScript (demo)

  • Matplotlib (training curves)

  • Git

  • Dataset: BODMAS — 57,293 malware + 77,142 benign = 134,435 samples, collected August 2019 to September 2020, 581 curated families, 2,381-dimensional static feature vectors in EMBER format. Source: Yang et al., IEEE Symposium on Security and Privacy Workshops 2021. Eight categories used: Trojan 29,972; Worm 16,697; Backdoor 7,331; Downloader 1,031; Ransomware 821; Dropper 715; Infostealer 448; Virus 192. API-call sequences are collected separately by running a labelled subset in Cuckoo Sandbox.

  • Task: 9-class sequence classification; input = ordered API-call sequence (128 calls, design); output = probability distribution over 8 malware families + benign.

  • Model: 1D-CNN (3-gram filters) + BiLSTM + dense softmax; embedding layer maps each API call to a vector; the demo build uses a 312-call vocabulary and the full build derives its vocabulary from the training corpus.

  • Metrics: Per-class precision, recall and F1, confusion matrix, macro-F1. Design target: macro-F1 0.85 or higher on the held-out split. No accuracy is claimed as measured until the training run is executed for the order.

Parameter Value
Input Ordered Windows API-call sequence, 128 calls (design)
Classes 9 (8 malware families + benign)
Dataset BODMAS: 134,435 samples, 581 families
Model 1D-CNN + BiLSTM, 9-class softmax
Demo scoring 0.006 ms per run over a 47-call trace (measured: 1,000 runs, 6.08 ms total, during the demo build)
Train/test split 80 / 10 / 10 (design)
Macro-F1 0.85 or higher (design target, not a measured claim)
Demo Single-file web app, runs offline after download
Trace collection Cuckoo Sandbox in an isolated VM (required)

Project features

The build centres on four capabilities. First, sequence classification: a 1D-CNN plus BiLSTM reads ordered API-call traces and returns a nine-class probability distribution, so a student can show not just the verdict but how confident the model is in every family. Second, explainable traces: every classified sample shows its full call sequence with suspicious calls highlighted and the 3-grams that drove the decision listed, turning a black-box prediction into something a guide can interrogate. Third, honest evaluation: a confusion matrix and per-class precision, recall and F1 on a held-out split show exactly which families the model confuses, with rare families called out rather than hidden. Fourth, safe data handling: all traces come from the public BODMAS dataset and isolated Cuckoo Sandbox runs, so no live malware is ever executed on a student machine.

  • [Sequence classifier (1D-CNN + BiLSTM)] Each API call is embedded as a vector, the 1D-CNN learns short local patterns such as injection and encryption sequences, the BiLSTM carries order across the full 128-call window, and a softmax layer outputs probabilities for all nine classes.
  • [Explainable trace view] Every classified sample shows its ordered API-call trace with suspicious calls highlighted in context, plus the top 3-grams that drove the decision, so a prediction can be defended call by call.
  • [Four labelled demo samples] Trojan, Ransomware, Worm and Benign traces bundled with the demo — pick one, classify it in the browser, and compare the probability distribution across all nine classes.
  • [Confusion matrix and per-class metrics] A 9×9 confusion matrix on 1,200 held-out traces in the demo (illustrative demo evaluation), with per-class precision, recall and F1, showing exactly which families the model confuses (Trojan vs Backdoor is the worst pair in the demo figures).
  • [BODMAS dataset pipeline] The public BODMAS corpus — 57,293 malware and 77,142 benign samples, 581 curated families — with its eight best-represented categories mapped to the nine output classes.
  • [Cuckoo Sandbox trace collection] A documented setup for running samples in an isolated virtual machine and exporting ordered API-call traces with timestamps and arguments.
  • [Training notebook and evaluation report] A reproducible Jupyter notebook with training curves, the confusion matrix, per-class metrics and a viva Q&A document covering API calls, n-grams, CNN/BiLSTM design, concept drift and sandbox safety.

What is included

  • Complete training & evaluation Jupyter notebook
  • Trained 1D-CNN + BiLSTM model file with preprocessing code
  • Cuckoo Sandbox trace-collection setup guide
  • Working web demo (4 labelled samples, trace view, confusion matrix)
  • Confusion matrix, per-class metrics and training-curve plots
  • Project report PDF (background, sequence-model theory, methodology, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (API calls, n-grams, CNN/BiLSTM, concept drift, sandbox safety)

Limitations & prerequisites

  • BODMAS ships static feature vectors, not raw API-call traces, so the sequence dataset is a labelled subset collected in Cuckoo Sandbox — not the full 134,435 samples.
  • Rare families are starved of data: Virus has only 192 samples against 29,972 Trojans, so recall on rare families is expected to be lower.
  • A model trained on 2019–2020 malware faces concept drift — newer families and packers can reduce accuracy on recent samples.
  • Packed or obfuscated malware hides its real API calls until unpacked, so traces from packed samples can mislead the model.
  • The demo's four sample traces are short, labelled illustrations — they are not live malware and do not prove production performance.
  • Live malware must never be run outside an isolated sandbox VM; this is an academic prototype, not a production antivirus.

Frequently Asked Questions

Which dataset is used and why?

BODMAS is used because it is the largest public PE-malware dataset with analyst-curated family labels: 57,293 malware and 77,142 benign samples across 581 families, published by Yang et al. at IEEE SPW 2021. Its eight best-represented categories (Trojan through Virus) map directly onto the nine output classes, and its timestamps allow a time-aware split that tests concept drift.

Where do the API-call sequences come from?

The sequences are collected by executing labelled samples in Cuckoo Sandbox, an isolated virtual machine that records every Windows API call in order with timestamps and arguments. BODMAS itself ships static feature vectors, not raw traces, so the sequence dataset is a labelled subset built this way — never by running malware on a host machine.

Which model is used and what does it learn?

A 1D-CNN plus BiLSTM sequence classifier is used: an embedding layer turns each API call into a vector, the CNN learns short local patterns such as the VirtualAllocEx → WriteProcessMemory → CreateRemoteThread injection pattern, and the BiLSTM carries order across the full 128-call trace before a softmax outputs nine class probabilities.

Is the accuracy guaranteed?

No accuracy figure is guaranteed, and none is claimed as measured. The development target is macro-F1 of 0.85 or higher on the held-out split, and the report records only the figure the actual training run achieves, including the weaker recall expected on rare families such as Virus with only 192 samples.

Can new malware families be added?

Yes, a new family can be added by collecting labelled API-call traces for it in Cuckoo Sandbox, adding the class to the softmax output, and retraining the model. The practical limit is data: a family needs enough labelled traces to learn from, which is why rare families are the hardest part of this project.

Is this project suitable for a final-year project?

Yes, it suits Computer Science, IT and AI & Machine Learning programs because it combines dataset work, sequence modelling, sandbox-based data collection and honest evaluation. A student can explain the model call by call from the trace view and defend the confusion matrix, which makes for a strong viva.

Components & software requirements
  • Python 3, TensorFlow/Keras
  • Cuckoo Sandbox (trace collection)
  • BODMAS dataset
  • NumPy, scikit-learn (metrics)
  • Jupyter Notebook (training & evaluation)
  • HTML, CSS, JavaScript (demo)
  • Matplotlib (training curves)
  • Git
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation