Quantised Neural Network NIDS on SmartNIC: Balancing Accuracy and Efficiency in P4
Yaying Chen, Siamak Layeghy, Marius Portmann · 2025
This paper presents the implementation of various quantised neural network-based Network Intrusion Detection Systems on a SmartNIC using the P4 programming language. SmartNICs impose significant memory and computational constraints, making deep learning integration particularly challenging. Prior work has been restricted to shallow networks and 1-bit quantisation due to these limitations. In contrast, we deploy a binary neural network with a 64–16–8–1 architecture, along with several other quantised models not previously implemented on SmartNICs. To overcome the limited support for quantisation-aware training, which is restricted to 8-bit, we introduce a variable quantiser scheme for neural networks that allows adaptable quantisation levels during training. We further deploy and evaluate 2-bit and 4-bit models on the SmartNIC, made feasible by optimising resource utilisation. The model achieves a 91.65% accuracy and a 91.46% F1 score while achieving throughputs above 6Mpps.