neural networks distilled into if-else rules for microcontrollers

A knowledge distillation framework that extracts lightweight, interpretable decision rules from trained neural networks, converting black-box models into portable if-else classifiers ready for resource-constrained deployment, with near-equivalent accuracy at a fraction of the cost.

Experimental Results

Evaluated on a balanced IEEE dataset of 14,000 images (7,000 pristine + 7,000 modified)

Inference Speedup

4.56x Faster than NN

Memory Reduction

54% Less Memory Used

Fidelity to NN

93.52% Decision Match Rate

Detailed Results

Classification Accuracy

Neural Network 90.18%
Decision Tree 87.05%
Manual Rules 87.05%
Accuracy Trade-off Only ~3% drop

Inference Speed (per sample)

Neural Network 0.143 ms
Decision Tree 0.260 ms
Manual Rules 0.033 ms
NN vs Manual Rules 4.3x slower
DT vs Manual Rules 7.9x slower

Memory per Inference

Neural Network 2.102 KB
Decision Tree 3.679 KB
Manual Rules 0.969 KB
NN vs Manual Rules 2.2x more memory
DT vs Manual Rules 3.8x more memory

Model Size on Disk

Neural Network (.pth) 7.735 KB
Decision Tree (pickle) 6.040 KB
Manual Rules (code) 4.709 KB
NN vs Manual Rules 1.6x larger
Rules Complexity 103 lines, 31 conditions

Beyond Steganalysis

This research validates the framework on LSB steganalysis as a proof of concept. However, the distillation pipeline is application-agnostic by design—it operates on feature vectors and learned decision boundaries, not domain-specific assumptions. This makes it a promising candidate for any classification task where deploying neural networks on constrained hardware is impractical. Formal evaluation on additional domains remains future work.

Potential Applications

Digital Forensics

Deploy fast, interpretable steganalysis classifiers on forensic workstations and edge devices where explainability and auditability are critical requirements.

Edge & IoT Devices

Run ML classifiers on microcontrollers and embedded systems with extremely limited memory and compute, without any framework dependencies.

Explainable AI

Convert opaque neural network decisions into human-readable if-else rules for domains where transparency and regulatory compliance are non-negotiable.

Real-Time Classification

Achieve sub-millisecond inference times for latency-sensitive classification tasks where every fraction of a millisecond counts.