betaFeedback

WorksComputer Science

Binarization as an Attack Surface in Weightless Neural Networks

Abstract

Weightless Neural Networks (WNNs) are lightweight classifiers that binarize their inputs and learn by storing binary patterns in lookup memories, which makes them attractive for resource-constrained tasks such as intrusion detection. Because a small perturbation that crosses no binarization threshold leaves the binary input unchanged, WNNs may appear naturally robust to adversarial examples; a perturbation that does cross a threshold, however, can still change the prediction. We study this tension in WiSARD, the canonical RAM-based WNN, and in two variants that replace its memories with Bloom filters, Bloom WiSARD and BTHOWeN. A continuous perturbation reaches these classifiers only by crossing an encoding threshold, changing at least one binary tuple, and redirecting a memory query; we formalize this mechanism with a threshold-crossing bound and a response-margin certificate for standard Boolean WiSARD. Controlled MNIST experiments compare linear and data-driven thermometer encodings under model-agnostic sensitivity probes, a score-based Simulated Annealing attack, and surrogate-transfer attacks. Changing only the encoding while keeping each model otherwise fixed shows that encoding granularity can trade a small clean-accuracy loss for a large decrease in attack success. On the Bot-IoT, CICIDS, and UNSW-NB15 intrusion-detection datasets, adversarial perturbations lead WNN detectors to classify many attacks as normal traffic and to raise false alarms, even when their aggregate accuracy remains high.

Introduction

Weightless Neural Networks (WNNs) are lightweight learning models that replace floating-point multiply–accumulate operations with binarization, hashing, and memory lookups [1, 2, 3]. This makes them attractive for resource-constrained networking applications such as traffic classification, anomaly detection, and intrusion detection [4], [5]. Their design is also closely related to Bloom filters, which are widely used in networked systems for compact approximate membership tests in settings such as routing, caching, distributed systems, intrusion detection, and blockchain networks [6, 7, 8, 9, 10, 11, 12, 13]. In both cases, efficiency comes from compact binary representations and hash-based access to memory.

Despite these advantages, the adversarial robustness of WNNs remains poorly understood. This is a critical gap: machine-learning systems deployed in security-sensitive networking environments may be exposed to inputs crafted to induce misclassification. In conventional deep neural networks, such adversarial examples have been extensively studied [14], [15]; for WNNs, however, the attack surface is different. Perturbations do not directly exploit differentiable weights. Instead, they may change the binary encoding of the input, redirect tuple addresses, alter RAM or Bloom-filter responses, and ultimately change the discriminator selected by the model.

We study this gap through the input binarizer, the first non-smooth component of a WiSARD-family pipeline. A perturbation that crosses no encoding threshold leaves the binary input unchanged and is invisible to the classifier. Once thresholds are crossed, however, tuple addresses and RAM or Bloom-filter queries may change. Discreteness therefore creates locally invariant regions, but it does not provide a global robustness guarantee. The size and placement of those regions depend on the encoding, while the effect of leaving a region also depends on tuple construction, memory occupancy, hash collisions, and bleaching [16]. We refer to this chain of 1) threshold crossing, 2) tuple change, and 3) memory-query redirection as the threshold-crossing mechanism.

We evaluate this mechanism in two settings: MNIST and Intrusion-Detection Systems (IDS). On MNIST [17], model-agnostic random perturbations first measure encoding sensitivity; such perturbations are explicitly treated as probes rather than adversarial attacks. A score-based Simulated Annealing attack and attacks transferred from a differentiable surrogate then test whether the locally invariant regions can be crossed deliberately.

We study DictWiSARD, our implementation of standard Boolean WiSARD [3] (hereafter Standard WiSARD), whose memory nodes are exact, collision-free binary RAMs. Varying the encoding granularity of DictWiSARD while keeping its architecture fixed changes only the binarizer, and therefore provides the strongest evidence that the encoding itself drives robustness.

A second controlled comparison changes the input encoding of BTHOWeN [5], a Bloom-filter-based WNN, from its original Gaussian thermometer to a linear one, keeping all other parameters fixed. We also compare DictWiSARD, BTHOWeN, and Bloom WiSARD [18], noting that these models differ in capacity, hashing, and bleaching [16]. Finally, we evaluate Standard WiSARD and Bloom WiSARD on three IDS datasets—Bot-IoT [19], CICIDS [20], and UNSW-NB15 [21]—under binary and multiclass classification.

This paper makes the following contributions.

A threshold-crossing account of WNN robustness. We formalize how a norm-bounded perturbation changes thermometer bits and tuple addresses, and derive a response-margin robustness certificate for Standard WiSARD. This separates properties implied by the encoding and classifier structure from empirical observations about particular attacks (§ 3).

Controlled and adaptive empirical evidence. We distinguish model-agnostic sensitivity probes from score-based and surrogate-transfer attacks. Within-model experiments show that increasing thermometer resolution can substantially raise attack success even when clean accuracy changes little (§ 4 and § 5).

IDS stress tests. Across Bot-IoT, CICIDS, and UNSW-NB15, we report Matthews Correlation Coefficient (MCC), malicious-to-Normal evasion rate, False Alarm Rate (FAR), and class-level miss rates. This exposes failure modes hidden by accuracy while making the limitations of normalized-feature perturbations explicit (§ 6).

The remainder of the paper is organized as follows. Section 2 reviews WNNs, Bloom-filter-based WNNs, and adversarial-learning background. Section 3 introduces the binarization schemes and robustness analysis. Section 4 details the attack methodology. Sections 5 and 6 present the MNIST and IDS experimental results, Section 7 discusses their implications, and Section 8 concludes the paper.

Related Work and Background

The adversarial robustness of WNNs [3, 22, 23] remains largely unexplored, but closely related ideas appear in the adversarial-learning literature on input quantization. For example, thermometer encoding has been proposed as a defense mechanism because discretization can disrupt gradients used by attackers [24, 25]. Madry et al. also observed that adversarially trained networks may learn threshold-like behavior in early layers [26]. These observations motivate our study: since WNNs rely on explicit binarization as part of their native computation, input quantization may provide stability against some perturbations, but it may also introduce threshold-crossing vulnerabilities.

WNNs [27] were popularized by WiSARD [3]. In contrast to Deep Neural Networks (DNNs), WiSARD does not learn real-valued weights. Instead, each class is represented by a discriminator composed of RAM-based neurons. Given a binarized input with II bits and RAM nodes addressed by tuples of size nn, each discriminator contains NN RAM nodes. In the simplest non-overlapping construction, N=I/nN = I/n, and a dense implementation requires ∣C∣N2n|C|N2^n memory entries, where CC is the set of classes. The implementations evaluated here allow the tuple mapping and number of memory nodes to be configured independently, as specified in Table 2.

Modelbpituple_sizeRAMsdtypebleachfilter_sizen_hash
DictWiSARD44850boolfalse--
Bloom WiSARD44850boolfalse374124
BTHOWeN64996inttrue81924

Table 2. Baseline WNN configurations.

During training, each binarized input is mapped to tuples through a fixed pseudo-random mapping and modifies only the discriminator associated with its true class. During inference, the same input is queried against all discriminators, and the predicted label is the class whose discriminator obtains the largest response. Thus, a perturbation can affect the WiSARD response only if it changes the binary encoding and thereby redirects at least one tuple to a different memory address; however, such redirection does not necessarily change the final prediction.

Bloom-filter-based WNNs

The main scalability limitation of WiSARD is the exponential memory growth in the tuple size nn. For example, n=64n = 64 would require 2642^{64} possible addresses for a single RAM node. Bloom WiSARD addresses this limitation by replacing RAM nodes with Bloom-filter-based memories [18]. A Bloom filter is a compact hash-based data structure for approximate membership queries [7]: under the standard model, it has no false negatives, but may return false positives depending on the filter size, the number of hash functions, and the number of inserted elements.

Before presenting the algorithms, we introduce the basic notation, summarized in Table 1. The binarized input is denoted by zz. The WiSARD mapping divides zz into tuples, where each tuple ztz_t contains a subset of the input bits and is indexed by t∈Tt \in\mathcal{T}. For each class discriminator, every tuple index tt has an associated storage unit, or memory node, that records patterns observed for tuple ztz_t. In Standard WiSARD, this memory node is an exact RAM table: the tuple bits determine an address, and training sets the corresponding entry to 1. In Bloom WiSARD, the memory node is implemented as a Bloom filter: the tuple bits are mapped by multiple hash functions, and training sets the corresponding Bloom-filter positions to 1.

SymbolMeaning
x=(x1,…,xd)x = (x_1,\ldots,x_d)Input before binarization (image or feature vector), with dd features indexed by jj
bbbits_per_input: thermometer bits per feature
Θj=(τj,1,…,τj,bj)\Theta_j = (\tau_{j,1},\ldots,\tau_{j,b_j})Thermometer thresholds of feature jj
z=B(x)z = B(x)Input after binarization: the concatenated thermometer code
t∈T,ztt \in\mathcal{T}, z_tTuple index and the bits of zz in tuple tt
nntuple_size: bits of zz read by each memory node
c∈C,yc \in\mathcal{C}, yClass index and true class
Mc,t\mathcal{M}_{c,t}Memory node of class cc for tuple tt
Ft,f\mathcal{F}_t, fAddressing or hash functions of tuple tt; rr hashes into mm positions for Bloom WiSARD
ht,Rch_t, R_cActive positions reached by tuple tt; response of class cc
δ,ϵ\delta, \epsilonPerturbation and its budget, ∥δ∥p≤ϵ\lVert\delta\rVert_p \le\epsilon

Table 1. Notation.

We denote by Mc,t\mathcal{M}_{c,t} the memory node associated with class cc and tuple tt. For each tuple tt, the set Ft\mathcal{F}_t contains the addressing or hash functions used to access Mc,t\mathcal{M}_{c,t}. During inference, RcR_c is the total response of class discriminator cc, and hth_t is the temporary response of tuple tt, i.e., the number of active memory positions reached by the functions in Ft\mathcal{F}_t.

Algorithms 1 and 2 summarize this unified view of WiSARD and Bloom WiSARD. During training, the input is processed one tuple at a time (line 1). Each tuple is mapped through its associated addressing or hash functions (line 2). The selected memory positions are then set to 1 in the memory node of the true class (line 3). Thus, training stores class-specific binary patterns: exact tuple addresses in standard WiSARD and Bloom-filter hash positions in Bloom WiSARD.

During inference, the model computes one response RcR_c for each class (line 1). For each class, the response is initialized to zero (line 2) and then accumulated over the input tuples (line 3). For a given tuple, the algorithm counts how

Algorithm 1: Training for WiSARD/Bloom WiSARD

Input: Binarized training example zz, label yy, tuple set T\mathcal{T}, per-tuple function sets Ft\mathcal{F}_t, and class memories Mc,t\mathcal{M}_{c,t}.

Output: Trained model, i.e., updated memories.

  1. for each tuple t∈Tt \in\mathcal{T} do

  2. for each function f∈Ftf \in\mathcal{F}_t do

  3. My,t[f(zt)]←1\mathcal{M}_{y,t}[f(z_t)] \leftarrow1

Algorithm 2: Inference for WiSARD/Bloom WiSARD

Input: Binarized input zz, classes C\mathcal{C}, tuple set T\mathcal{T}, per-tuple function sets Ft\mathcal{F}_t, and memories Mc,t\mathcal{M}_{c,t}.

Output: Predicted class.

  1. for each class c∈Cc \in\mathcal{C} do

  2. Rc←0R_c \leftarrow0

  3. for each tuple t∈Tt \in\mathcal{T} do

  4. ht←0h_t \leftarrow0

  5. for each function f∈Ftf \in\mathcal{F}_t do

  6. ht←ht+Mc,t[f(zt)]h_t \leftarrow h_t + \mathcal{M}_{c,t}[f(z_t)]

  7. if ht=∣Ft∣h_t = |\mathcal{F}_t| then

  8. Rc←Rc+1R_c \leftarrow R_c + 1

  9. return arg⁡max⁡c∈CRc\arg\max_{c \in\mathcal{C}} R_c

many associated memory positions are active (line 6). The tuple contributes to the class response only if all associated positions are active (line 7). Finally, the predicted class is the one with the largest discriminator response (line 9).

Standard WiSARD, a classical Bloom filter, and Bloom WiSARD are recovered as special cases of this framework through the choice of C\mathcal{C}, T\mathcal{T}, Ft\mathcal{F}_t, and the memory size:

  • Standard WiSARD: Ft={ft}\mathcal{F}_t = \{f_t\} contains a single injective function that reads the nn tuple bits as a binary address, and Mc,t\mathcal{M}_{c,t} has 2n2^n entries. Each tuple pattern therefore has its own entry, and the test ht=∣Ft∣=1h_t = |\mathcal{F}_t| = 1 (line 7) reduces to reading that entry.

  • Classical Bloom filter: with a single class, a single tuple containing all input bits (∣C∣=∣T∣=1|\mathcal{C}| = |\mathcal{T}| = 1), and Ft={ft,1,…,ft,r}\mathcal{F}_t = \{f_{t,1}, \ldots, f_{t,r}\} a set of rr hash functions into an mm-bit memory, line 3 inserts zz into the filter, and the test ht=rh_t = r (line 7) is the standard membership query: it never misses an inserted input, but may return false positives when other inputs have set the same rr positions (rr is n_hash in Table 2).

  • Bloom WiSARD: each tuple of each class uses its own such filter, with m≪2nm \ll2^n, so the class response RcR_c counts the tuples whose patterns the filter reports as seen. With r=1r = 1, m=2nm = 2^n, and the identity address map, Bloom WiSARD reduces to Standard WiSARD.

This formulation highlights where adversarial perturbations can affect the model. A perturbation that changes the binarized input may change a tuple ztz_t, which in turn changes the addressed memory locations (lines 3 and 6). In Bloom WiSARD, such changes interact with hash collisions and Bloom-filter false positives: a perturbed tuple may fail to activate positions associated with the true class, or it may activate positions in a competing class. Thus, collisions are not only an efficiency issue; they also affect discriminator responses and therefore form part of the model’s adversarial behavior.

BTHOWeN (Bleached, Thermometer-Encoded, Hashed-input Optimized Weightless Neural Network) further extends this Bloom-filter-based design space [5]. It combines counting Bloom filters, bleaching, hashing, and Gaussian thermometer encoding to improve accuracy and hardware efficiency. With bleaching [16], repeated tuple insertions increment counters, and a tuple is considered active at inference time only if all its mapped positions reach a threshold β\beta. This suppresses rare patterns and can improve clean-data behavior, but it also changes the response surface seen by an attacker. Consequently, binarization thresholds, hash collisions, Bloom-filter false positives, and bleaching thresholds all contribute to the robustness trade-offs analyzed in this work.

Adversarial Machine Learning Background

Adversarial attacks aim to induce misclassification by applying a small perturbation to an input while preserving its semantic class. Let gg be a classifier, xx an input correctly classified as yy, and δ\delta a perturbation. An adversarial example is an input xadv=x+δx_{\mathrm{adv}} = x + \delta such that g(xadv)≠yg(x_{\mathrm{adv}}) \ne y, subject to a perturbation budget ∥δ∥p≤ϵ\lVert\delta\rVert_p \le\epsilon. Common choices include the L2L_2 norm, ∥δ∥2=∑j=1dδj2\lVert\delta\rVert_2 = \sqrt{\sum_{j=1}^{d}\delta_j^2}, which bounds the Euclidean magnitude of the perturbation, and the L∞L_\infty norm, ∥δ∥∞=max⁡1≤j≤d∣δj∣\lVert\delta\rVert_\infty= \max_{1 \le j \le d}|\delta_j|, which bounds the maximum change applied to any individual feature or pixel [28]. In image classification, this constraint is often interpreted as preserving visual similarity; in networking and tabular settings, it must also respect the feature domain and preprocessing pipeline.

This work focuses on evasion attacks, where the model is already trained and the adversary modifies inputs presented during inference to cause incorrect predictions. We do not consider poisoning or backdoor attacks, where the training data or training procedure is compromised. The threat model is shaped by the non-differentiable nature of WNNs: binarization, memory lookup, hashing, and discriminator aggregation do not provide gradients in the same way as conventional neural networks. Therefore, direct white-box gradient attacks are not applicable to the target WNN.

We consider three complementary attack families. Random perturbations provide a baseline for measuring sensitivity to norm-constrained noise. Query-based optimization attacks treat the WNN as a black-box scoring function and search for perturbations that reduce the true-class response. Transfer-based attacks train a differentiable surrogate model to mimic the WNN, generate adversarial examples using gradient-based attacks on the surrogate, and then evaluate whether these examples transfer to the original WNN [29, 30]. This setting is especially relevant because it tests whether a non-differentiable, memory-based classifier can still be attacked through a smooth approximation of its input-output behavior.

Binarization and Robustness

In this section we describe the binarization schemes, since they determine how continuous perturbations are translated into binary tuple-address changes. Then, we introduce a simple threshold-crossing bound to assess the robustness of WNNs with respect to input encodings.

Input Binarization

Input binarization is the first step in WNN inference and a central design choice for both clean accuracy and robustness. Since WNNs store and query binary patterns, a perturbation in the continuous input affects the model only if it crosses one or more binarization thresholds and changes the resulting binary code. The models evaluated in this work use thermometer-style encodings: WiSARD variants use linear thermometer encoding, whereas BTHOWeN uses a data-driven Gaussian thermometer encoding.

Linear thermometer encoding. Linear thermometer encoding discretizes the normalized range [0,1][0,1] using evenly spaced thresholds [24]. Given bits_per_input bb, the encoding creates bb thresholds and compares each input value against them. For example, with b=4b=4, the thresholds are the ordered sequence Θ=(0.2,0.4,0.6,0.8)\Theta=(0.2,0.4,0.6,0.8), so a value of 0.70.7 is encoded as 1110. Each bit tests non-strict inequality, 1{xj≥τj,k}\mathbf{1}\{x_j \ge\tau_{j,k}\}, and equality is therefore encoded as 1. This encoding is relatively stable when bb is small, because small perturbations often do not cross any threshold, and even when they do, they usually change only a few bits.

Gaussian thermometer encoding. BTHOWeN uses a data-driven Gaussian thermometer encoding [5]. Instead of spacing thresholds uniformly, it estimates the mean and standard deviation of each feature from the training data and places thresholds according to Gaussian quantiles. This concentrates resolution near high-density regions of the data distribution, which can improve clean accuracy. However, it can also increase adversarial sensitivity: when several thresholds are close together, a small perturbation near the mean may cross multiple thresholds and produce a large change in the binary representation.

Threshold-crossing Bound

This section quantifies how far a bounded perturbation can propagate through a WNN: from thermometer thresholds, to binary code bits, to memory tuples, and finally to class responses. The result is a sufficient condition under which no perturbation within the budget can change the prediction.

Let x=(x1,…,xd)x=(x_1,\ldots,x_d), where j∈{1,…,d}j \in\{1,\ldots,d\} indexes an input feature and xjx_j is its value. For each feature jj, let Θj=(τj,1,…,τj,bj)\Theta_j=(\tau_{j,1},\ldots,\tau_{j,b_j}) be its ordered threshold sequence, where k∈{1,…,bj}k \in\{1,\ldots,b_j\} indexes a threshold within that feature, and let B(x)B(x) denote the concatenated thermometer code, z=B(x)z=B(x). For a perturbation δ\delta satisfying ∥δ∥∞≤ϵ\lVert\delta\rVert_\infty\le\epsilon, define Hϵ(x)H_\epsilon(x) as the threshold exposure of xx at budget ϵ\epsilon: the number of thresholds that lie within ϵ\epsilon of the input,

Hϵ(x)=∑j∑k=1bj1{∣xj−τj,k∣≤ϵ}.(1)H_\epsilon(x)=\sum_j\sum_{k=1}^{b_j}\mathbf{1}\{|x_j-\tau_{j,k}|\le\epsilon\}. \tag*{(1)}

For example, let x=(0.34,0.74)x=(0.34,0.74), Θ1=Θ2=(0.2,0.4,0.6,0.8)\Theta_1=\Theta_2=(0.2,0.4,0.6,0.8), and ϵ=0.07\epsilon=0.07. The interval [0.27,0.41][0.27,0.41] for feature 1 contains only the threshold 0.4, while the interval [0.67,0.81][0.67,0.81] for feature 2 contains only 0.8. Therefore, H0.07(x)=1+1=2H_{0.07}(x)=1+1=2, so at most two thermometer bits can change.

For coordinate jj, the L∞L_\infty constraint keeps xj+δjx_j+\delta_j inside [xj−ϵ,xj+ϵ][x_j-\epsilon,x_j+\epsilon]. A threshold outside this interval remains on the same side of the feature value before and after perturbation, so its comparison bit cannot change; counting the thresholds inside such intervals therefore upper-bounds the number of changed bits. Hence,

dH(B(x),B(x+δ))≤Hϵ(x).(2)d_H(B(x),B(x+\delta))\le H_\epsilon(x). \tag*{(2)}

where dHd_H is Hamming distance. In particular, Hϵ(x)=0H_\epsilon(x)=0 is an input-level certificate: every perturbation in the L∞L_\infty ball produces exactly the same WNN input code. Because (1) uses closed threshold windows, the containment in (2) is unaffected by the tie convention used when an input is exactly equal to a threshold.

The WiSARD mapping assigns encoded bits to memory tuples. Let Qℓ(x)Q_\ell(x) be the set of tuples containing at least one bit counted by Hϵ(x)H_\epsilon(x); then at most q=∣Qℓ(x)∣q=|Q_\ell(x)| tuple addresses can change. Equations (1)–(2) depend only on the encoding and therefore apply to every model in this paper; the next step depends on the memory. Let yy be the clean predicted class (the true class, for a correctly classified input), and define its response margin as

Δ(x)=Ry(B(x))−max⁡c≠yRc(B(x)).(3)\Delta(x)=R_y(B(x))-\max_{c\ne y}R_c(B(x)). \tag*{(3)}

In Standard WiSARD, each changed tuple can alter a class response by at most one, so under any ∥δ∥∞≤ϵ\lVert\delta\rVert_\infty\le\epsilon the response of yy decreases by at most qq while a competitor increases by at most qq. This yields the response-margin certificate:

Δ(x)>2q⟹arg⁡max⁡cRc(B(x+δ))=y, ∀∥δ∥∞≤ϵ.(4)\Delta(x) > 2q \Longrightarrow\mathop{\arg\max}_{c} R_c(B(x+\delta)) = y,\ \forall\lVert\delta\rVert_\infty\le\epsilon. \tag*{(4)}

In words, if the clean class leads every competitor by more than twice the number of tuples that can change, then no perturbation within the budget can change the prediction: even if every changeable tuple both lowers the response of yy and raises that of its strongest competitor, yy still wins.

The response-margin certificate in Equation (4) is established here for Standard WiSARD [3]. Extensions accounting for Bloom collisions in Bloom WiSARD [18], counting memories [31], and bleaching [16] remain future work.

The rest of the paper uses the above bound in two ways. Threshold exposure explains why linear and Gaussian encodings react so differently to random probes (§ 5.3 and Figure 2), and the bound in Equation (2) predicts that attack success grows with bits_per_input (§ 5.4 and § 5.5).

Binarization Hamming distance between clean MNIST images and their noisy versions under random $L_\infty$ perturbations

Figure 2. Binarization Hamming distance between clean MNIST images and their noisy versions under Random L∞L_\infty perturbations with ϵ=0.1\epsilon= 0.1. Linear binarization produces substantially smaller representation changes, with mean Hamming distance 51.62, whereas Gaussian binarization produces a mean Hamming distance of 613.16.

Attack Methodology

This section describes the experimental methodology used to evaluate the adversarial robustness of WiSARD-family WNNs. In the following three subsections, we present the random, query-based, and surrogate-transfer attacks.

Model-Agnostic Sensitivity Probes

We use two random perturbation attacks as baseline sensitivity tests. The Random L∞L_\infty attack independently adds or subtracts ϵ=0.1\epsilon= 0.1 to each pixel with uniform probability and clips the result to [0,1][0, 1]. The Random L2L_2 attack samples Gaussian noise, normalizes it to have L2L_2 norm ϵ=3\epsilon= 3, adds it to the image, and clips the result to [0,1][0, 1]. These budgets follow common MNIST-scale adversarial settings [28]. The goal of these attacks is not to optimize against the model, but to measure how often simple norm-constrained noise crosses binarization thresholds and alters discriminator responses. Figure 1 illustrates their visual effect.

Figure 1. Example of random perturbations applied to an MNIST digit: (a) Original; (b) Random L∞L_\infty; (c) Random L2L_2.

Simulated Annealing Attack

We use Simulated Annealing (SA) as a query-based black-box attack against DictWiSARD. The attack searches

for an L2L_2-bounded perturbation that reduces the true-class discriminator response relative to the strongest competing class. Let xx be a clean MNIST image and x′x' a candidate within the permitted L2L_2 ball. For an untargeted attack, the energy function is the response margin of Equation (3) evaluated at the candidate and normalized by the total response, with yy the true class,

E(x′)=Δ(x′)∑c∈CRc(B(x′)).(5)E(x') = \frac{\Delta(x')}{\sum_{c\in C} R_c(B(x'))}. \tag*{(5)}

Since the normalization is positive, the attack succeeds exactly when E(x′)<0E(x') < 0, that is, when it drives the margin protected by the certificate of Equation (4) below zero.

The valid state space is

S={x′∈[0,1]784∣∥x′−x∥2≤ϵ}.S = \{x' \in[0,1]^{784} \mid\lVert x' - x \rVert_2 \le\epsilon\}.

Transitions are designed to target the WNN threshold-crossing mechanism: the attack selects a pixel at random and moves it just across one of its two neighboring thermometer thresholds, redrawing the move if it would exceed the L2L_2 budget. Budget spent on a pixel is not recovered if the pixel later returns to its original bin, which makes the attack conservative. This directly encourages threshold crossings and therefore changes in the binary representation.

For the SA attack, we use the standard MNIST L2L_2 budget ϵ=3\epsilon= 3. The SA procedure uses initial temperature 1010, exponential cooling by a factor of 0.9990.999 per iteration down to a floor of 0.0010.001, and at most 5000 iterations per image, stopping early once the attack succeeds. A proposed move from the current candidate x′∈Sx' \in S to a new candidate x′′∈Sx'' \in S is accepted with probability

P(x′,x′′)=min⁡(1,exp⁡(−E(x′′)−E(x′)T)),P(x',x'') = \min\left(1,\exp\left(-\frac{E(x'')-E(x')}{T}\right)\right),

where TT is the current temperature.

Surrogate-Transfer Attack

The surrogate-transfer attack consists in producing adversarial examples on a differentiable approximation of the WNN, and use them to fool the original non-differentiable model. The target WNN is treated as a black box, and a Multi-Layer Perceptron (MLP) is trained to mimic its output distribution. In the first stage, the MLP is trained on the original MNIST inputs using soft labels obtained by querying the WNN, with a Kullback–Leibler divergence objective between the surrogate and WNN output distributions. In the second stage, gradient-based attacks are generated against the surrogate and transferred back to the WNN.

We use FGSM, BIM, MI-FGSM, and PGD as implemented in Foolbox [32], with the corresponding standard references [26], [33, 34, 35].

For the surrogate-transfer experiments, adversarial examples are constrained by ∥δ∥∞≤0.15\lVert\delta\rVert_\infty\le0.15. We use the default Foolbox 3.3.4 attack parameters. FGSM performs a single gradient-sign step. BIM and MI-FGSM use 10 iterations with step size 0.2ϵ=0.030.2\epsilon= 0.03 and no random initialization; MI-FGSM additionally uses momentum factor 1.0. PGD uses 40 iterations with step size ϵ/30=0.005\epsilon/30 = 0.005 and random initialization within the L∞L_\infty ball. All adversarial inputs are constrained to [0,1][0, 1].

The surrogate is an MLP with two hidden layers of 256 neurons each. We use this simple architecture to approximate the score vector without reproducing the target’s discrete computation. All reported transfer rates are averaged over three independent runs.

Experimental Results with MNIST

In this section we consider experimental results with MNIST. The experiments proceed in three steps. First, model-agnostic random perturbations characterize the sensitivity of the architectures and binarization schemes to bounded input changes (Section 5.2). Second, controlled encoding comparisons isolate the threshold-crossing mechanism itself: varying bits_per_input within DictWiSARD, or replacing only the BTHOWeN binarizer, changes the encoding while holding the rest of the model fixed, whereas comparisons across DictWiSARD, Bloom WiSARD, and BTHOWeN also differ in hashing, memory organization, capacity, and bleaching and are therefore descriptive (Section 5.3). Finally, query-based Simulated Annealing and surrogate-transfer attacks test whether an adversary can deliberately exploit the threshold-crossing mechanism (Sections 5.4 and 5.5). Together, these experiments distinguish stability to incidental perturbations from robustness against adaptive attacks.

Models, Dataset, and Configurations

The experiments use the 60,000 training and 10,000 test images of MNIST [36]: 28×2828 \times28 grayscale handwritten digits with pixel values normalized to [0,1][0, 1]. We evaluate the three architectures of Section 2.1. DictWiSARD implements Standard WiSARD [3] with hash maps that store only the observed tuple patterns, which is functionally equivalent to dense Boolean RAMs; Bloom WiSARD [7], [18] and BTHOWeN [5] use Bloom-filter memories. Table 2 lists their parameters, using the notation of Table 1 for bpi (bb; also referred to as bits_per_input), and tuple_size (nn). RAMs is the number of memory nodes per discriminator, dtype the memory type, and bleach whether bleaching is used at inference. For Bloom-filter-based models, filter_size (mm), and n_hash (rr) denote the Bloom filter size and the number of hash functions, respectively.

Sensitivity to Model-Agnostic Perturbations

Random noise provides a baseline for measuring how each WNN reacts to simple norm-constrained perturbations. Although random noise does not optimize against the model, it reveals a sharp contrast between the evaluated binarization schemes.

Table 3 shows that the two WiSARD variants are largely unaffected by random perturbations: both retain more than 98% of their clean accuracy under the considered random attacks. In contrast, BTHOWeN with Gaussian thermometer encoding suffers a severe degradation, dropping from 95.20% clean accuracy to nearly random performance. This contrast is important because BTHOWeN is the most accurate model on clean data, but also the least stable under these perturbations.

ModelProbeClean Acc.Pert. Acc.Retention
DictWiSARDRandom L∞L_\infty94.80%94.71%99.91%
DictWiSARDRandom L2L_294.80%93.84%98.99%
Bloom WiSARDRandom L∞L_\infty94.75%94.55%99.79%
Bloom WiSARDRandom L2L_294.74%93.38%98.56%
BTHOWeNRandom L∞L_\infty95.20%10.12%10.63%
BTHOWeNRandom L2L_295.22%13.14%13.80%

Table 3. Clean accuracy, post-perturbation accuracy, and retention under random L∞L_\infty and random L2L_2 perturbations.

Analysis of Binarization Scheme Impact

Linear binarization improves stability under random perturbations

The WiSARD models use the linear thermometer of Section 3.1, whose evenly spaced thresholds make the binary code relatively stable under small random perturbations. Returning to the 4-bit example (thresholds 0.2, 0.4, 0.6, 0.8): for an input x∈(0,0.1]x \in(0, 0.1], no L∞L_\infty perturbation with ϵ=0.1\epsilon= 0.1 can alter the code, and the same holds for x∈(0.9,1]x \in(0.9, 1]; elsewhere, the number of potentially changed bits is given exactly by Equation (1). With one bit per input, only pixels within 0.1 of the single threshold can change their code.

Gaussian binarization amplifies sensitivity to random perturbations

The standard binarization process of the BTHOWeN model is quite different and considers the statistics of each feature from the training data to create local Gaussian thermometers. For example, if a feature has mean 0.8 and standard deviation 0.05, the generated 4-bit thermometer has values [0.75791894, 0.78733264, 0.81266736, 0.84208106]. An input x=0.75x = 0.75 is encoded as 0000, while x+0.1=0.85x + 0.1 = 0.85 is encoded as 1111.

Comparison between linear and Gaussian-based binarization

Figure 2 quantifies the difference in representational stability between the two binarization methods on 100 test images with bits_per_input =6= 6 (maximum possible Hamming distance 784⋅6=4704784 \cdot6 = 4704). The mean Hamming distance is 51.62 for linear binarization and 613.16 for Gaussian binarization, which helps explain the accuracy differences reported in Table 3.

To confirm this, we changed the binarization method for the BTHOWeN model, while all the parameters were kept the same, including the bits_per_input = 6. The results are displayed in Table 4, showing a performance retention that is much more in line with the other models. Notice that the standard Gaussian-encoded BTHOWeN model has an edge against the modified Linear-encoded BTHOWeN on the clean accuracy test (95.2% vs 94.16%), but whereas Gaussian-encoded BTHOWeN suffers a sharp accuracy degradation under the same model-agnostic perturbations, Linear-encoded BTHOWeN largely preserves its performance.

BTHOWeN ModelInput setAccuracyRetention
Gaussian-encodedClean set95.20%-
Linear-encodedClean set94.16%-
Gaussian-encodedRandom L2L_213.14%13.80%
Linear-encodedRandom L2L_291.88%97.58%
Gaussian-encodedRandom L∞L_\infty10.12%10.63%
Linear-encodedRandom L∞L_\infty94.33%100.18%

Table 4. ACCURACY AND RETENTION FOR BTHOWEN UNDER RANDOM L∞L_\infty AND RANDOM L2L_2 PERTURBATIONS.

Comparison between norms

Tables 3 and 4 show that L∞L_\infty perturbations are more damaging for Gaussian binarization, whereas L2L_2 perturbations are more effective against linear binarization. Table 5 summarizes why: the effect depends on how each norm spreads the budget relative to how each encoding spaces its thresholds.

NormPerturbation patternMore affected encoding
L∞L_\inftySmall per-feature changes applied broadly across the input. This can flip many bits when thresholds are close together.Gaussian, because thresholds are concentrated near high-density regions of the data distribution.
L2L_2Larger changes concentrated on fewer features. This can help cross thresholds that are farther apart.Linear, because uniformly spaced thresholds often require larger local changes to be crossed.

Table 5. QUALITATIVE EFFECT OF L∞L_\infty AND L2L_2 PERTURBATIONS UNDER DIFFERENT BINARIZATION SCHEMES.

Query-Based Simulated Annealing Results

The random probes introduced in § 4.1 and evaluated in § 5.2 and § 5.3 left both WiSARD variants essentially unaffected (Table 3). We now ask whether a query-based adversary can deliberately cross the thresholds that random noise rarely reaches. We focus on DictWISARD, whose exact Boolean memories match the setting of the non-margin certificate in § 3.2, and vary bits_per_input: higher values create more threshold comparisons per feature, and hence more opportunities for a perturbation to change the binary code. The attack modifies one pixel at a time, as described in § 4.2, under the standard MNIST budget ϵ=3\epsilon= 3.

Unlike the random probes, SA places its noise where it matters, moving pixels across thermometer thresholds; even the lowest success rate observed below, 62.0%, is substantial.

Varying bits_per_input has only a small effect on clean accuracy, but a large effect on adversarial vulnerability. DictWISARD’s clean accuracy varies by less than half a percentage point, from 94.5% to 95.0%, as bits_per_input goes from 1 to 6. In contrast, the Simulated Annealing attack success rate increases from 62.0% with one bit per input to 75.5%, 90.0%, and 95.0% with 2, 4, and 6 bits per input, respectively. These rates are computed over the first 200 test images, and images misclassified before the attack count as successes; restricted to correctly classified images, they are 60.2%, 74.9%, 89.6%, and 94.8%.

Thus, at this fixed budget, increasing bits_per_input provides only marginal clean-accuracy gains but substantially increases SA success. This is consistent with the threshold-crossing bound: finer binarization creates more thresholds, while coarser binarization creates larger invariant regions.

Surrogate-Transfer Results

Table 6 shows the success rate of the surrogate-transfer strategy (see § 4.3). The “Surrogate Fooling Rate” is the fraction of test images correctly classified by the WNN whose adversarial version fools the MLP; it confirms that the gradient-based attacks are highly effective against the MLP itself, consistently fooling it on 89 to 95% of these images. The key metric, “Successful Transfer Rate,” is the fraction of those surrogate-fooling examples that also fool the target WNN.

AttackbpiSuccessful Transfer RateSurrogate Fooling Rate
FGSM13.87%89.32%
FGSM27.09%89.29%
FGSM421.15%91.27%
FGSM623.61%89.67%
BIM18.69%94.32%
BIM213.57%94.59%
BIM430.99%94.46%
BIM635.66%94.86%
MI-FGSM17.43%94.27%
MI-FGSM215.00%93.73%
MI-FGSM425.45%93.73%
MI-FGSM639.68%93.79%
PGD14.18%93.53%
PGD28.22%93.52%
PGD417.12%94.23%
PGD630.80%93.78%

Table 6. Adversarial transfer rate on DictWiSARD with different attacks and bits_per_inputbits\_per\_input (BPI).

The transfer results follow the same qualitative trend observed with SA: higher bits_per_inputbits\_per\_input values generally increase transferability. For example, MI-FGSM transfer rises from 7.43% at one bit per input to 39.68% at six. A plausible mechanism is visible in Equation (1): widely spaced thresholds leave more surrogate perturbations inside invariant regions, whereas finer encodings offer more opportunities to change the WNN code. This interpretation is consistent with prior warnings that non-smooth preprocessing can create an appearance of robustness under non-adaptive attacks [37].

Equation (1) also explains why transfer success grows unevenly with bits_per_inputbits\_per\_input (bb; see Table 1). With linear thresholds τk=k/(b+1)\tau_k = k/(b + 1), k=1,…,bk = 1, \ldots, b, and ∥δ∥∞≤0.15\lVert\delta\rVert_\infty\le0.15, a pixel that is 0 before binarization can cross a threshold only if 1/(b+1)≤0.151/(b+1) \le0.15, that is, only from b=6b = 6 on, since 1/7≈0.1431/7 \approx0.143. Because 81% of MNIST test pixels are exactly 0, at most 19% of pixels can change their code when b<6b < 6. Counting all pixel values, the actual fractions are 2.9%, 6.1%, and 10.3% for b=1b = 1, 2, and 4, compared with 100% at b=6b = 6.

The MNIST experiments isolate the role of binarization in a controlled image classification setting: perturbations matter when they cross encoding thresholds and change the binary representation. In the following section, we ask whether similar robustness issues arise in networking data, where class imbalance and the different operational costs of false alarms and missed attacks make accuracy alone insufficient.

Intrusion-Detection Robustness

The intrusion-detection experiments extend the MNIST analysis to a more operational setting, where the main question is not only whether accuracy drops, but also which types of IDS errors are induced by adversarial perturbations.

Intrusion-Detection Datasets and Metrics

To evaluate whether the robustness patterns observed on MNIST also arise in networking data, we evaluate Standard WiSARD and Bloom WiSARD on Bot-IoT, CICIDS, and UNSW-NB15 under binary and multiclass classification. Inputs are preprocessed into normalized continuous feature vectors; categorical variables are one-hot encoded and numerical variables are scaled to [0,1][0, 1]. We vary the binarization scheme (linear or Gaussian thermometer), bits_per_inputbits\_per\_input, and tuple_sizetuple\_size. Each table entry averages over the configuration grid: two encodings, seven bits_per_inputbits\_per\_input values (1–32), and four tuple_sizetuple\_size values (5–20), plus, for Bloom WiSARD, two Bloom-filter sizes and two hash counts.

IDS threat model and scope. We keep the evasion setting of Section 2.2; in the IDS context, the attacker seeks either to move malicious traffic to the Normal decision or to raise false alarms on benign traffic. Table 7 lists the three considered perturbation methods: an FGSM transferred from an MLP surrogate (introduced in Section 4.3) and two random probes (introduced in Section 4.1). Perturbations are applied to the normalized feature vector, clipped to [0,1][0, 1], and only then binarized. Because one-hot groups, integer fields, and protocol-derived relations among flow features are not enforced, perturbed vectors need not correspond to realizable traffic; the IDS results are therefore classifier-level stress tests rather than end-to-end evasion attacks.

PerturbationNormBudgetObservation
FGSM (Section 4.3)L∞L_\inftyϵ=0.3\epsilon= 0.3Single-step gradient perturbation generated on a differentiable MLP surrogate.
Random L2L_2 (Section 4.1)L2L_2ϵ=3.0\epsilon= 3.0Model-agnostic random perturbation.
Random L∞L_\infty (Section 4.1)L∞L_\inftyϵ=0.3\epsilon= 0.3Model-agnostic random perturbation.

Table 7. Perturbations used in the IDS experiments.

Metrics. For intrusion-detection experiments, accuracy alone is insufficient because the datasets are highly imbalanced and different error types have different operational consequences. We therefore report post-perturbation accuracy together with Matthews Correlation Coefficient (MCC), Attack Success Rate (ASR), False Alarm Rate (FAR), and class-level miss rates.

Metric definitions. MCC summarizes all entries of the confusion matrix and is more informative than accuracy under severe class imbalance. ASR is the fraction of malicious samples classified as Normal and thus measures evasion; unlike on MNIST, for the IDS experiments it is not conditioned on samples correctly classified before the attack. FAR is the fraction of Normal samples classified as malicious, i.e., operational false alarms. For an intrusion class cc, Miss_cMiss\_c is the fraction of its samples classified as Normal.

IDS Results

Standard WiSARD and Bloom WiSARD both degrade under perturbation. In this section, we quantitatively assess how the extent of this degradation depends on the dataset, task, perturbation method, and binarization scheme.

Throughout this section, a perturbation method is how the classifier is attacked (FGSM, Random L2L_2, or Random L∞L_\infty), whereas an intrusion class is the network-security category being classified (DDoS, bots, web attacks, reconnaissance, shellcode, generic traffic, and so on). In binary tasks, Malicious denotes the aggregate non-Normal class.

Which perturbation methods have the strongest aggregate impact

Table 8 summarizes the aggregate impact of the three perturbation methods. For Standard WiSARD, FGSM causes the largest mean accuracy drop, 35.89 percentage points, and produces the lowest mean post-perturbation MCC, −0.0206. Random L2L_2 and Random L∞L_\infty also degrade performance substantially, with mean drops of 27.02 and 24.48 percentage points, respectively. For Bloom WiSARD, FGSM is again the most damaging perturbation method by mean accuracy drop, with 24.58 percentage points, and also yields the highest mean ASR, 0.5167.

ModelPerturbationAcc. drop (pp)MCCASRFAR
StandardFGSM35.89-0.02060.47860.5520
StandardRandom L2L_227.020.05210.32460.6117
StandardRandom L∞L_\infty24.480.13250.31520.5565
BloomFGSM24.58-0.01460.51670.5160
BloomRandom L2L_215.690.05850.36810.5462
BloomRandom L∞L_\infty13.540.14250.35630.5075

Table 8. Mean accuracy drop and post-perturbation metrics by model family and perturbation method, averaged over the linear and Gaussian configurations.

Which operational failures do ASR and FAR reveal

Beyond aggregate accuracy and MCC, IDS robustness must separate two operational failure modes: evasion, measured by ASR (malicious-to-Normal), and false alarms, measured by FAR (Normal-to-malicious). Table 8 shows that the two do not coincide. For Standard WiSARD, FGSM has the highest mean ASR, 0.4786, and the lowest post-perturbation MCC, −0.0206, whereas Random L2L_2 has the highest mean FAR, 0.6117. For Bloom WiSARD, FGSM again has the highest mean ASR, 0.5167, whereas Random L2L_2 has the highest mean FAR, 0.5462. The comparison between families also shows why accuracy drop alone is misleading: Bloom WiSARD has smaller mean drops than Standard WiSARD but higher ASR and lower FAR. Accuracy drop depends on the clean baseline and on class prevalence, and these means pool heterogeneous configurations, so a smaller drop does not imply less evasion. Evaluating IDS robustness therefore requires reporting missed detections and false alarms separately (see ASR and FAR in Table 8).

Which datasets and tasks are most vulnerable

Table 9 aggregates results by dataset and task. For Standard WiSARD, the most vulnerable scenario by mean accuracy drop is Bot-IoT multiclass, with a 55.06 percentage-point drop and post-perturbation MCC of 0.0119; UNSW-NB15 multiclass is nearly as fragile, with a 54.49 percentage-point drop and MCC of 0.0160. UNSW-NB15 binary has a negative mean MCC, −0.1321, i.e., worse than chance. In contrast, Bot-IoT binary preserves high post-perturbation accuracy on average (0.9341), but its MCC of 0.1000 shows that this does not imply low operational risk.

ModelDatasetTaskAcc.DropMCCASR
StandardBot-IoTBinary0.93416.590.10000.0658
StandardBot-IoTMulticlass0.322655.060.01190.0192
StandardCICIDSBinary0.84189.520.23370.8517
StandardCICIDSMulticlass0.777815.650.09840.8700
StandardUNSW-NB15Binary0.460333.46-0.13210.3146
StandardUNSW-NB15Multiclass0.143154.490.01600.1156
BloomBot-IoTBinary0.812518.750.11520.1874
BloomBot-IoTMulticlass0.395540.930.01440.0100
BloomCICIDSBinary0.84125.690.20470.8666
BloomCICIDSMulticlass0.7725-17.760.07050.8760
BloomUNSW-NB15Binary0.484627.28-0.05250.4325
BloomUNSW-NB15Multiclass0.156932.730.02060.1095

Table 9. Mean post-perturbation performance by model family, dataset, and task; accuracy drop in percentage points.

For Bloom WiSARD, the lowest mean post-perturbation MCC is observed in UNSW-NB15 binary, −0.0525. CICIDS multiclass is particularly informative: its mean accuracy drop is negative (−17.76 percentage points), indicating that aggregate accuracy can improve while MCC (0.0705) and ASR (0.8760) reveal poor security behavior. CICIDS binary and multiclass exhibit high ASR for both models, showing that evasion into the Normal class remains a central concern even when post-perturbation accuracy appears high.

How does binarization interact with perturbation method

For Standard WiSARD, linear binarization yields the higher mean MCC under FGSM, Random L2L_2, and Random L∞L_\infty, reaching 0.011, 0.086, and 0.230, respectively, versus −0.053, 0.018, and 0.035 for Gaussian binarization. For Bloom WiSARD, linear binarization likewise gives the higher mean MCC under Random L2L_2 and Random L∞L_\infty (0.094 and 0.253, versus 0.023 and 0.032), while the two encodings tie under FGSM (−0.014 versus −0.015).

These results reinforce that the relationship between binarization and robustness is perturbation-dependent. The same encoding strategy can have different effects on MCC, ASR and FAR, so robustness cannot be characterized by a single clean-accuracy or adversarial-accuracy number.

Which intrusion classes are most often missed as Normal

Class-level miss rates provide a complementary view of evasion. Since class-level miss is defined as the fraction of samples from a given intrusion class classified as Normal, high values identify network-security categories that are likely to bypass the detector. Table 10 shows that CICIDS is the most exposed dataset for both models: every intrusion class is missed at rates between 0.84 and 0.91. UNSW-NB15 shows intermediate vulnerability: binary Malicious traffic is missed at 0.31 by Standard WiSARD and 0.43 by Bloom WiSARD, while multiclass rates range from 0.07 to 0.18 and from 0.03 to 0.25, respectively, with generic traffic the least missed. Bot-IoT has the smallest miss rates, at most 0.04 in the multiclass task, although Bloom WiSARD misses 0.19 of binary Malicious traffic. Overall, these differences show that IDS robustness must be reported not only through aggregate accuracy, but also through class-level evasion metrics.

DatasetTaskClassStandardBloom
CICIDSMulticlassBots0.910.90
CICIDSMulticlassWeb attacks0.910.91
CICIDSMulticlassPort scanning0.900.91
CICIDSMulticlassBrute force0.900.90
CICIDSMulticlassDDoS0.890.89
CICIDSBinaryMalicious0.850.87
CICIDSMulticlassDoS0.840.85
UNSW-NB15BinaryMalicious0.310.43
UNSW-NB15MulticlassDoS0.180.20
UNSW-NB15MulticlassAnalysis0.180.25
UNSW-NB15MulticlassBackdoor0.170.23
UNSW-NB15MulticlassWorms0.170.14
UNSW-NB15MulticlassExploits0.150.16
UNSW-NB15MulticlassFuzzers0.150.18
UNSW-NB15MulticlassReconnaissance0.110.10
UNSW-NB15MulticlassShellcode0.090.08
UNSW-NB15MulticlassGeneric0.070.03
Bot-IoTBinaryMalicious0.070.19
Bot-IoTMulticlassReconnaissance0.040.03
Bot-IoTMulticlassDDoS0.020.01
Bot-IoTMulticlassDoS0.020.01
Bot-IoTMulticlassTheft0.000.00

Table 10. Mean adversarial miss rate by dataset, task, and intrusion class. A miss is an intrusion sample classified as normal; for binary tasks it equals the ASR in Table 9.

Implications

Our results suggest that WNN deployment in security-sensitive settings should not tune for clean accuracy alone. Binarization is a core design choice: increasing bits_per_input can improve granularity, but also creates more threshold-crossing opportunities for adversarial perturbations. Coarser encodings may reduce sensitivity to small perturbations, but they are not adversarial-proof, as shown by the Simulated Annealing and surrogate-transfer experiments. For IDS applications, robustness should therefore be assessed with MCC, ASR, FAR, and class-level miss rates, which expose evasion into the Normal class and false alarms on benign traffic.

These findings also matter for Bloom-filter-based networking systems. Bloom filters are prevalent in routing, caching, filtering, and monitoring, and Bloom WiSARD generalizes this hash-based memory principle into a learning model. Thus, robustness should also be considered when Bloom-filter-like structures operate in adversarial environments. Parameters such as tuple_size affect memory use, collisions, and adversarial behavior, and should be tuned with the binarization scheme and deployment metric.

Conclusion and Future Work

This study identifies the precise interface through which continuous perturbations reach a WiSARD-family classifier: encoding thresholds are crossed, binary tuples change, and memory queries are redirected. The resulting bound explains why coarse encodings can be locally invariant while also making clear that discreteness is not a robustness certificate. In controlled MNIST experiments, increasing encoding resolution substantially increases the success of score-based and transfer attacks with little clean-accuracy gain. The IDS experiments reinforce a separate operational point: accuracy can hide malicious-to-Normal errors, false alarms, and failures on minority classes.

We investigated vulnerabilities but did not yet evaluate defenses. Several extensions follow. The response-margin certificate can be extended to Bloom collisions, counting memories, and bleaching. For intrusion detection, perturbations can be restricted to attacker-controllable packet fields, with protocol constraints enforced and derived features recomputed. Finally, the threshold-crossing bound suggests two defenses: placing thresholds away from the training data and threshold-aware adversarial training.

More broadly, in WNNs the binarizer is not an incidental preprocessing step: it determines which perturbations the classifier can see. It should therefore be designed, tuned, and evaluated as part of the attack surface, and this work takes a first step toward weightless models that are robust by design rather than by accident.

Reproducibility

Code and results are available at https://github.com/lucassenosc/adversarialwnn.

Acknowledgements

This work was supported by CAPES and FAPERJ under grants E-26/204.268/2024 and E-26/260.168/2026, CNPq 444956/2024-7, 424622/2021-1, 315106/2023-9, and 307770/2025-7, as well as Finep PlatCiber. Pedro Teixeira was also supported by Elytron Cybersecurity. The authors thank Gabriel Menezes Rebello for fruitful discussions during the preparation of the camera-ready version of this paper.

LLM Usage Statement

LLMs were used for editorial purposes and to assist with LaTeX editing. All outputs were inspected by the authors to ensure accuracy.

References

References

  1. [1]A. T. Bacellar, Z. Susskind, M. Breternitz, E. John, L. K. John, P. M. Lima, F. M. França, et al., “Differentiable weightless neural networks,” in Proceedings of the 41st International Conference on Machine Learning, PMLR, vol. 235, pp. 2277–2295, 2024.arxiv.org/abs/2410.11112
  2. [2]H. C. Carneiro, C. E. Pedreira, F. M. França, and P. M. Lima, “The exact VC dimension of the WiSARD n-tuple classifier,” Neural computation, vol. 31, no. 1, pp. 176–207, 2019.
  3. [3]I. Aleksander, W. V. Thomas, and P. Bowden, “WiSARD: a radical step forward in image recognition,” Sensor Review, vol. 4, pp. 120–124, 1984.DOI
  4. [4]V. C. Ferreira, A. S. Nery, L. A. J. Marzulo, L. Santiago, D. Souza, B. F. Goldstein, F. M. G. França, and V. Alves, “A Feasible FPGA Weightless Neural Accelerator,” in 2019 IEEE International Symposium on Circuits and Systems (ISCAS), pp. 1–5, 2019.DOI
  5. [5]Z. Susskind, A. Arora, I. D. Miranda, L. A. Villon, R. F. Katopodis, L. S. De Araújo, D. L. Dutra, P. M. Lima, F. M. França, M. Breternitz Jr, et al., “Weightless neural networks for efficient edge inference,” in Proceedings of the International Conference on Parallel Architectures and Compilation Techniques, pp. 279–290, 2022.arxiv.org/abs/2203.01479
  6. [6]R. B. Barbosa, D. L. C. Dutra, P. M. V. Lima, D. Carvalho, and F. M. G. França, “Updating KernelCanvas for weightless graph classification,” Neurocomputing, vol. 646, p. 130458, 2025.DOI
  7. [7]B. H. Bloom, “Space/time trade-offs in hash coding with allowable errors,” Commun. ACM, vol. 13, p. 422–426, July 1970.DOI
  8. [8]P. Reviriego, O. Rottenstreich, S. Liu, and F. Lombardi, “Analyzing and assessing pollution attacks on Bloom filters: Some filters are more vulnerable than others,” in 2021 17th International Conference on Network and Service Management (CNSM), pp. 491–499, 2021.DOI
  9. [9]A. Kotzer, D. Gandelman, and O. Rottenstreich, “SoK: Applications of sketches and rollups in blockchain networks,” IEEE Transactions on Network and Service Management, vol. 21, no. 3, pp. 3194–3208, 2024.DOI
  10. [10]Y. Banoun, D. S. Menasch́e, and O. Rottenstreich, “Learning filters with certainty,” in Proceedings of the 10th Asia-Pacific Workshop on Networking (APNet 2026), (Singapore), 2026. Co-located with ACM SIGCOMM 2026. arXiv:2606.22786.DOI
  11. [11]G. Almashaqbeh, A. Bishop, and H. Tirmażi, “Adversary resilient learned Bloom filters,” arXiv preprint arXiv:2409.06556, 2024.arxiv.org/abs/2409.06556
  12. [12]C. Lotan and M. Naor, “Adversarially Robust Bloom Filters: Monotonicity and Betting,” IACR Commun. Cryptol., vol. 2, no. 1, p. 24, 2025.
  13. [13]T. Gerbet, A. Kumar, and C. Laurdoux, “The power of evil choices in Bloom filters,” in 2015 45th Annual IEEE/IFIP International Conference on dependable systems and networks, pp. 101–112, IEEE, 2015.
  14. [14]S. Pelekis, T. Koutroubas, A. Blika, A. Berdelis, E. Karakolis, C. Ntanos, E. Spiliotis, and D. Askounis, “Adversarial machine learning: a review of methods, tools, and critical industry sectors: S. pelekis et al.,” Artificial Intelligence Review, vol. 58, no. 8, p. 226, 2025.DOI
  15. [15]C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, “Intriguing properties of neural networks,” arXiv, 2014. https://arxiv.org/abs/1312.6199.
  16. [16]D. Carvalho, H. Carneiro, F. França, and P. Lima, “B-bleaching: Agile Overtraining Avoidance in the WiSARD Weightless Neural Classifier,” in ESANN, 04 2013.
  17. [17]L. Deng, “The Modified National Institute of Standards and Technology (MNIST) database of handwritten digit images for machine learning research,” IEEE signal processing magazine, vol. 29, no. 6, pp. 141–142, 2012.
  18. [18]L. Santiago, L. Verona, F. Rangel, F. Faria, D. Menasch́e, W. Carls, M. Breternitz, S. Kundu, P. Lima, and F. França, “Weightless Neural Networks as Memory Segmented Bloom Filters,” Neurocomputing, vol. 416, 02 2020.DOI
  19. [19]N. Koroniotis, N. Moustafa, E. Sitnikova, and B. Turnbull, “Towards the Development of Realistic Botnet Dataset in the Internet of Things for Network Forensic Analytics: Bot-IoT Dataset,” Future Generation Computer Systems, vol. 100, pp. 779–796, 2019.arxiv.org/abs/1811.00701
  20. [20]I. Sharafaldin, A. Habibi Lashkari, and A. A. Ghorbani, “Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization,” in Proceedings of the 4th International Conference on Information Systems Security and Privacy, pp. 108–116, 2018.DOI
  21. [21]N. Moustafa and J. Slay, “UNSW-NB15: A Comprehensive Data Set for Network Intrusion Detection Systems (UNSW-NB15 Network Data Set),” in 2015 Military Communications and Information Systems Conference, pp. 1–6, 2015.
  22. [22]M. Jadhao, A. T. Bacellar, S. Nag, I. D. Miranda, F. M. França, and L. K. John, “Hybrid weightless neural networks for efficient edge inference,” in 2025 35th International Conference on Field-Programmable Logic and Applications (FPL), 2025.DOI
  23. [23]A. T. Bacellar, S. Chemudupati, S. Nag, A. Seigler, P. Lima, F. M. França, and L. K. John, “From Arithmetic to Logic: The Resilience of Logic and Lookup-Based Neural Networks Under Parameter Bit-Flips,” arXiv preprint arXiv:2603.22770, 2026.arxiv.org/abs/2603.22770
  24. [24]H. Carneiro, F. França, and P. Lima, “Multilingual part-of-speech tagging with weightless neural networks,” Neural Networks, vol. 66, 03 2015.DOI
  25. [25]J. Buckman, A. Roy, C. Raffel, and I. Goodfellow, “Thermometer encoding: One hot way to resist adversarial examples,” in International Conference on Learning Representations, 2018.
  26. [26]A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu, “Towards deep learning models resistant to adversarial attacks,” arXiv preprint arXiv:1706.06083, 2017.arxiv.org/abs/1706.06083
  27. [27]T. B. Ludermir, A. C. P. d. L. F. d. Carvalho, A. P. Braga, and M. C. De Souto, “Weightless neural models: a review of current and past works,” Neural Computing Surveys, vol. 2, pp. 41–61, 1999.
  28. [28]J. C. Costa, T. Roxo, H. Proença, and P. R. M. Inácio, “How deep learning sees the world: A survey on adversarial attacks and defenses,” IEEE Access, vol. 12, p. 61113–61136, 2024.DOI
  29. [29]N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, Z. B. Celik, and A. Swami, “Practical black-box attacks against machine learning,” arXiv, 2017. https://arxiv.org/abs/1602.02697.
  30. [30]N. Papernot, P. McDaniel, and I. Goodfellow, “Transferability in machine learning: from phenomena to black-box attacks using adversarial samples,” arXiv, 2016. https://arxiv.org/abs/1605.07277.
  31. [31]L. Fan, P. Cao, J. Almeida, and A. Broder, “Summary cache: a scalable wide-area web cache sharing protocol,” IEEE/ACM Transactions on Networking, vol. 8, no. 3, pp. 281–293, 2000.
  32. [32]J. Rauber, W. Brendel, and M. Bethge, “Foolbox: A python toolbox to benchmark the robustness of machine learning models,” in Reliable Machine Learning in the Wild Workshop, 34th International Conference on Machine Learning, 2017.arxiv.org/abs/1707.04131
  33. [33]I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarial examples,” arXiv preprint arXiv:1412.6572, 2014.DOI
  34. [34]A. Kurakin, I. Goodfellow, and S. Bengio, “Adversarial examples in the physical world,” arXiv preprint arXiv:1607.02533, 2017. https://arxiv.org/abs/1607.02533.
  35. [35]Y. Dong, F. Liao, T. Pang, H. Su, J. Zhu, X. Hu, and J. Li, “Boosting adversarial attacks with momentum,” 2018.arxiv.org/abs/1710.06081
  36. [36]Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, 1998.
  37. [37]A. Athalye, N. Carlini, and D. Wagner, “Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples,” in International conference on machine learning, pp. 274–283, PMLR, 2018.arxiv.org/abs/1802.00420

Paper details

vlnc:W_5dy2rr9k
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

LLMs

View statement
Looking for related papers…
Contents