Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Machine Learning for Hardware Trojan Detection — Teaching Materials

Open teaching materials for a lab in EE202 · Engineering AI at Norwich University. Students learn to frame hardware Trojan detection as a machine-learning problem and discover why, for a rare-event security task, recall and false-negative rate — not accuracy — are what matter.

Designed to be followable by learners (and instructors) with no prior hardware-security background: it builds from "you didn't build your own chip" up to threshold tuning, one accessible step at a time.

Contents

file what it is
hardware_trojan_detection_lab.ipynb Runnable starter notebook: load data → baseline → the accuracy trap → the right metrics → threshold tuning → Your turn exercises. Runs top-to-bottom as delivered.
trojan_netlist_features.csv Dataset: one row per net, structural + switching features, label = Trojan/clean (~2% Trojan).
make_dataset.py How the stand-in dataset was generated (fixed seed, reproducible).
extract_features.py Real-data week starter: parses flat gate-level Verilog into the same feature table. Structural features implemented; activity features and labeling are guided TODOs. --selftest included.
LAB_HANDOUT.md Student-facing lab: background, tasks, deliverables.
RUBRIC.md 100-point grading rubric, weighted toward reasoning over raw performance.
slides/Hardware_Trojan_Teaching_Demo.pptx The introductory lesson deck ("What is a hardware Trojan, and how do we catch one with ML?"), with speaker notes.

Quick start

# Python 3.10+ with: numpy pandas scikit-learn matplotlib jupyter
git clone https://github.com/aalbata/hardware-trojan-ml-lab.git
cd hardware-trojan-ml-lab
jupyter notebook hardware_trojan_detection_lab.ipynb   # then Run All

Try the feature-extraction skeleton:

python extract_features.py --selftest

About the dataset

trojan_netlist_features.csv is a realistic stand-in for gate-level netlist features, generated by make_dataset.py (2,000 nets, ~2% Trojan, fixed seed). Its feature shapes and class imbalance mirror the public Trust-Hub benchmarks so the lab runs anywhere without an EDA toolchain. Section 8 of the notebook and extract_features.py show how to swap in real Trust-Hub data — the ML workflow is identical.

Cite Trust-Hub if you use the real benchmarks:

H. Salmani, M. Tehranipoor, R. Karri, "On design vulnerability analysis and trust benchmarks development," IEEE ICCD, 2013 · https://trust-hub.org

Trust-Hub files are not redistributed here — download them from the source and share only your feature-extraction code and results, per their terms.

⚠️ Scope & intended use

These materials are for defensive education: detecting Trojans in public benchmarks. They contain no attack instructions and must not be used to design, insert, or optimize Trojans against real systems.

License

  • Code (.py, .ipynb): MIT
  • Docs & slides (.md, slides/): CC BY 4.0

Citing these materials

See CITATION.cff, or:

A. Al Bataineh, "Machine Learning for Hardware Trojan Detection — Teaching Materials," EE202 Engineering AI, Norwich University, 2026. https://github.com/aalbata/hardware-trojan-ml-lab


Maintainer: Ali Al Bataineh, Ph.D. — Associate Professor, ECE; Director, AI Research Center, Norwich University.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages