WorksPhysics and Astronomy
Reconfigurable On-Chip AI for Particle Physics Detectors with Logic Neural Networks
Abstract
On-device machine learning is increasingly important in applications where extreme data rates or resource constraints make centralized processing infeasible. Logic neural networks (LNNs), which directly learn Boolean logic instead of conventional arithmetic operations, have recently emerged as a state-of-the-art approach for efficient inference and are particularly well suited for deployment in custom silicon. However, hard-wired solutions are typically optimized for narrowly defined tasks and lack the ability to adapt to changing data distributions. Next-generation pixel detectors in particle physics present a particularly challenging use case: their high granularity and readout frequency generate data rates that cannot be centrally processed, while stringent space and power constraints necessitate highly efficient on-chip inference. Moreover, radiation damage progressively alters detector response, requiring models that can be re-trained and reconfigured after deployment. In this work, we evaluate LNNs for on-chip inference in pixel detectors. We show that their superior resource efficiency may enable a step change in model capability, making more complex architectures feasible within the available hardware budget. LNNs also provide increased robustness against radiation-induced random bit flips. Finally, we present novel work on reconfigurable LNNs, enabling models to adapt to changing operating conditions after deployment.
Introduction
The increasing deployment of machine learning (ML) in real-world systems is driving inference closer to where data are generated. In many applications, transmitting raw data to a central processor is infeasible due to stringent requirements on latency, bandwidth, power, or privacy. This motivates on-device intelligence, where models perform inference directly on resource-constrained hardware. For example, always-on keyword spotting and wearable health monitoring operate on microwatt power budgets and kilobyte memory footprints [1], autonomous driving systems require millisecond-scale decision making [2], and data selection systems in particle physics experiments process data at rates approaching petabytes per second [3].
Logic Neural Networks (LNNs) have recently demonstrated state-of-the-art tradeoffs between accuracy and computational footprint for small-scale inference [4, 5, 6, 7]. Rather than relying on arithmetic operations such as multiply-accumulate units and nonlinear activations, LNNs directly learn Boolean functions, such as AND and XOR, or higher-arity lookup tables (LUTs). This makes them particularly attractive for custom hardware, where learned logic can be directly mapped to digital circuits. However, the benefits of hard-wired logic also introduce a fundamental challenge: once deployed, the resulting circuit is specialized to the task and data distribution seen during training, potentially limiting its ability to adapt to changing conditions.
Future particle physics colliders provide a particularly demanding setting for adaptable on-device inference. At an event rate of 40 MHz, their pixel detectors will comprise billions of readout channels [8, 9], while detector response will evolve over time due to accumulated radiation damage. An on-device AI-based data preselection system must therefore not only be highly resource efficient, but also robust to hardware faults and capable of adapting after deployment. Recent advances in efficient ML architectures and hardware make such systems increasingly feasible, potentially enabling new approaches to data reduction and boosting the physics discovery potential of future detectors.
In this work, we use the publicly available SmartPixels datasets [10, 11] to investigate LNNs as an architecture for adaptive, resource-constrained inference in pixel detectors. We compare LNNs to quantized arithmetic-based neural networks, evaluating classification performance and hardware resource usage. We show that the superior inference efficiency of LNNs may enable a step change in model capability by making more complex architectures feasible within the available hardware budget. We further study their resilience to random bit flips, finding increased robustness. Finally, we present novel work on reconfigurable LNNs and investigate the associated tradeoff between reconfigurability and resource usage. Together, these results highlight LNNs as a promising building block for on-device intelligence in environments where efficiency, reliability, and adaptation must be considered jointly.
Related Work
The SmartPixels collaboration has conducted several studies using the public datasets considered in this work. A classifier for rejecting low-transverse-momentum () tracks has been developed and its deployment on an ASIC studied [12]. It separates high- tracks from positively and negatively charged low- tracks, exploiting the opposite bending of low- trajectories in the detector’s magnetic field. Several quantized arithmetic architectures are considered, but only a simple dense model is synthesized for deployment using hls4ml [13]; the convolutional architecture does not meet the hardware constraints. We use this dense quantized model as our baseline.
The effects of accumulated radiation damage on the SmartPixels system have also been studied [14]. The resulting shift in the input distribution substantially degrades classifier performance, while retraining on the shifted data largely recovers the original accuracy. That work does not, however, consider the hardware implications of reconfigurability.
Neuromorphic computing has also been explored for the SmartPixels application, using spiking neural networks to replace quantized arithmetic with a fundamentally different computational paradigm [15]. Promising results have been demonstrated, but post-deployment adaptation is not addressed.
LNNs reach comparable efficiency while relying on mature digital hardware. Early approaches approximate lookup tables (LUTs) with parameterized continuous functions [7, 16, 17, 18, 19, 20], whereas more recent differentiable formulations learn LUTs directly and universally, covering both 2-input logic gates [4] and higher-arity LUTs [5]. Such architectures achieve highly competitive accuracy–resource tradeoffs on small-scale classification tasks, but their suitability for adaptive, fault-tolerant on-device inference has received comparatively little attention.
Finally, quantization-aware training and sparsification are known to improve robustness to weight perturbations and bit-flip errors [21]. LNNs can be viewed as an extreme point in this design space, replacing arithmetic weights with discrete Boolean functions, and recent work shows empirically that this transition can yield a more favorable accuracy–resilience tradeoff for hardware fault tolerance [22]. We extend these observations to the SmartPixels application, studying robustness jointly with hardware efficiency and post-deployment reconfigurability.
Experiments
We evaluate dense QKeras [23], dense LNN, and convolutional LNN classifiers on the SmartPixels benchmark. We use the same preprocessing of the raw charge images as [12], giving 14 high-level input features for the dense models and a time profile plus one high-level feature for the convolutional models; see appendix § 5 for details.
All LNNs use exclusively 2-input LUTs (“logic gates”) with random, fixed connectivity, and a fixed binarization of the inputs by distributive thresholding into 100 ordered thresholds per feature. Following [4], each gate is parametrized as a softmax-weighted sum over all 16 two-input Boolean functions and evaluated with fuzzy logic during training to make it differentiable; at inference the softmax is replaced by its argmax, yielding a discrete circuit. LNNs are implemented using torchlogix [24]. Exact architectures and training hyperparameters are given in appendix § 6.
As the intended deployment target is custom silicon, we use FPGA synthesis as a common surrogate for comparing hardware resource requirements. Since application-specific arithmetic can be implemented more efficiently as dedicated logic than through the general-purpose DSP blocks available on FPGAs, we disable DSP use and use the combined LUT+FF count as a logic-resource proxy. All models are synthesized for the Xilinx VU13P FPGA (xcvu13p-flga2577-2-e) with a requested clock period of 4.1667 ns (240 MHz). Trained LNNs are converted to RTL using da4ml [25], while QKeras models are converted using hls4ml [13]. Input preprocessing and encoding, I/O and routing, and downstream decision logic are excluded from the reported post-synthesis resources; place-and-route and timing closure are not evaluated (left to future work)1.
Hardware Efficiency and Classification Performance
Figure 1 compares balanced accuracy with post-synthesis FPGA logic utilization for dense QKeras, dense LNN, and convolutional LNN architectures. Dense LNNs provide a substantially better accuracy–resource tradeoff than the QKeras baselines. For example, at comparable balanced accuracy (0.807 for LNN and 0.798 for QKeras), the dense LNN requires 14,418 LUTs+FFs compared with 275,815 for QKeras, corresponding to approximately lower resource utilization. Across the architecture sweep, dense LNNs reach balanced accuracies above 0.81 while remaining in the tens-of-thousands resource regime.

Figure 1. Balanced accuracy versus post-synthesis FPGA logic utilization for dense QKeras, dense LNN, and convolutional LNN architectures. Annotations identify the smallest and largest configurations in each sweep by number of trainable parameters, and report the GroupSum scaling parameter for LNNs and weight/activation precision (W/A) for QKeras.
The lower resource utilization of LNNs is particularly relevant for the time-resolved SmartPixels representation. Previous SmartPixels studies found that using eight charge profiles in a convolutional model improved performance over a dense single-profile model, but increased the parameter count by approximately ; the convolutional architecture was not pursued in the hardware implementation [12]. In contrast, our convolutional LNN operates on the same 105-input, eight-profile representation while requiring post-synthesis FPGA resources comparable to the dense LNNs and reaching balanced accuracies above 0.84.
Robustness to Input Bit Flips
Faults are applied to each model’s digital input representation: 1,400 threshold-encoded bits for the LNN and 112 bits from the 8-bit representation of the 14 QKeras inputs. During fault-aware training, input bits are independently flipped with the specified probability on each forward pass. At inference, the same target fraction of input bits is flipped at random; the reported fault rate therefore denotes the fraction of corrupted bits within each model’s own input representation. Each nonzero evaluation point is averaged over five independent full-test realizations.
We compare dense LNN and QKeras models with similar fault-free balanced accuracies of 0.807 and 0.798, respectively. Figure 2 shows how balanced accuracy changes as the fraction of corrupted input bits increases. Without fault-aware training, the LNN degrades substantially more slowly than QKeras. Training with random input bit flips improves robustness for both architectures, while the LNN maintains a pronounced advantage. At approximately 10% input corruption, models trained without faults achieve approximately 47% and 36% balanced accuracy for LNN and QKeras, respectively; with 10% fault-aware training they retain approximately 72% and 46%. Thus, at comparable fault-free accuracy, LNNs exhibit substantially greater robustness than QKeras to random input-bit corruption under the evaluated fault model.

Figure 2. Balanced accuracy under random input-bit corruption for dense LNN (left) and QKeras (right) models with comparable fault-free performance.
Reconfigurability
Radiation-induced sensor degradation progressively shifts detector response after deployment, requiring the on-chip classifier to be retrained and updated in the field [14]. For conventional arithmetic models, this is straightforward: the computational graph is hard-wired once and the trained parameters are held in writable registers, so retraining only changes register contents. LNNs admit no such clean separation. Much of their efficiency comes from compactifying the Boolean computational graph at compile time, folding constants and merging redundant gates, so the surviving topology is itself a function of the trained truth tables. Retraining an LNN can therefore change its connectivity, not merely a set of stored coefficients.
To address this, we introduce a lightweight reconfigurability mechanism for LNNs. A designated subset of gates keeps its two-input connectivity fixed at synthesis time but reads its four-entry truth table from a small runtime configuration register instead of having it permanently wired; each such gate is realized as a multiplexer with two select bits and four configuration bits, stored in flip-flops, in place of a static logic gate. All remaining gates stay permanently fixed. This makes part of the deployed logic reprogrammable after fabrication without requiring general FPGA-style reconfigurable routing, at the cost of additional resources. That cost has a direct component: logic implementing the multiplexers and registers for the truth-tables, and an indirect component: the loss of compactification, since a reconfigurable gate can no longer be folded away.
Because the timing and severity of radiation-induced drift are only partially predictable, we evaluate reconfigurability under three assumed levels of prior knowledge about the data drift:
(a) No knowledge: the reconfigurable subset must be fixed before any exposure to the shifted data. Three approaches are considered: We either make entire layers reconfigurable, adding them from the output layer backwards (i), select the individual gates whose truth-table distribution is least converged after baseline training (ii), or compactify the baseline model first and retrain a reconfigurable model within that compactified topology (iii).
(b) Exact knowledge: an oracle in which the retrained model is known a priori and only the gates whose truth table changed are made reconfigurable. This gives the minimum resource overhead for a known target.
(c) Partial knowledge: assuming radiation effects can be simulated somewhat faithfully, we use one drifted operating condition to select a candidate reconfigurable subset, then retrain and evaluate that subset on the other drifted condition.
We evaluate all three regimes on the dense LNN, trained on the non-irradiated SmartPixels sample and retrained on samples corresponding to two accumulated fluences (low and high) [11]2. The resulting balanced accuracies are plotted against the reconfigurability-aware resource estimates in Figure 3. As expected, the fully static model degrades on the drifted data, while unrestricted retraining restores baseline performance. Making every gate reconfigurable, however, increases resource usage roughly 17-fold relative to the static model. The partially reconfigurable designs interpolate between these extremes. The oracle of scenario (b) performs best among retrained models of comparable size, as expected. Scenario (c), which selects the reconfigurable subset on one irradiation scenario and applies it to the other, offers no advantage over scenario (a), which assumes no knowledge of the drift at all. The latter performs surprisingly well: with three reconfigurable layers it retains 99% of the fully retrained accuracy at 37% of the resource cost of full reconfigurability. Notably, making whole layers reconfigurable Pareto-dominates the gate-wise criteria3.

Figure 3. Balanced accuracy versus estimated resource usage for the baseline model retrained on the irradiated datasets at two accumulated fluences. No retraining (fully static) and unrestricted retraining (fully reconfigurable) are the two limiting cases. The remaining points use partial reconfigurability, with the reconfigurable subset chosen under different assumptions about a-priori knowledge of the data shift, indicated by the letters in parentheses.
Limitations and Future Work
The hardware results in this work use FPGA synthesis as a proxy for on-chip implementation cost; future work will require ASIC synthesis, place-and-route, and power analysis for more realistic deployment estimates. A first SoC integrating an LNN on an eFPGA is targeted for tape-out in 2027. The robustness studies currently consider input bit flips only, and should be extended to faults in intermediate activations and to convolutional LNNs. Reconfigurability is likewise evaluated only for dense models. Lastly, further optimizations can be applied to LNNs, e.g., by learning the connectivity [26] and/or the binarization thresholds [27]. In particular the latter could improve bit-efficiency when including the cost of data I/O in future works.
Acknowledgments and Disclosure of Funding
We thank the SmartPixels Collaboration for their valuable discussions, feedback, and continued input throughout this work. We also thank members of the MAIA detector and muon-collider beam-induced-background mitigation efforts for helpful discussions on detector operating conditions and radiation effects.
This work was supported by the National Science Foundation under Cooperative Agreements OAC-1836650 and PHY-2323298.
Data Structure and Preprocessing
Each SmartPixels event consists of 20 time samples of a pixel charge image, together with the local track position . We follow the preprocessing of [12].
For the dense models, only the final time sample is used. The charge image is projected along the dimension by averaging, giving a 13-component charge profile; together with this yields the 14 input features.
For the convolutional models, the same projection is applied to the first eight time samples, giving a time-profile representation. Together with this yields 105 inputs in total.
Charge values are transformed with a symmetric-log scaling before being passed to the models. The task is a three-class problem, separating positively charged low-, negatively charged low-, and high- tracks. Training uses an inverse-class-frequency weighted cross-entropy loss and we report balanced accuracy throughout. Train and test samples are drawn from disjoint sets of data files, following an 80/20 train/test split: 128 training and 32 test files for the dataset used in sections 3.1 and 3.2, and 16 and 4 for the irradiated dataset used in section 3.3. A further 1% of the training files is held out for validation. All splits use a fixed seed of 42.
Model Architectures and Training
Dense LNNs. The dense LNN sweep of section 3.1 combines a three-layer family for the smallest models and a seven-layer family for the larger models, with layer widths varied to sweep model size. Writing the layer widths as a tuple, the smallest configuration is (1269, 1269, 1269) and the largest is (33600, 33600, 33600, 22400, 22400, 22400, 16800). The 14 input features are binarized into bits, and the final layer feeds a GroupSum over three groups with scaling parameter . Across the evaluated sweep, takes values in . Every LogicDense layer uses lut_rank = 2 (i.e. two-input LUTs) and residual weight initialization.
The reconfigurability study of section 3.3 uses a single dense model of shape (6300, 6300, 6300, 4200, 4200, 4200, 3150) with : seven logic layers, resulting in 554,000 trainable parameters.
Convolutional LNN. The convolutional LNN sweep uses a common sequence of four LogicConv2d layers, one OrPooling2d stage, and four LogicDense layers, while the kernel counts and dense-layer widths are varied to sweep model size. The convolutional layers use receptive fields, tree depth 3, and lut_rank = 2. In the reference configuration, the first two convolutional layers contain 256 and 512 kernels, followed by an OrPooling2d stage with kernel size and stride 2 and two further convolutional layers with 1024 and 960 kernels. The flattened output is concatenated with the 100 binarized bits and passed through four LogicDense layers of widths (12000, 12000, 6000, 3000) into a GroupSum over three groups.
QKeras baselines. The quantized baselines follow the dense Model-2 architecture of [12]: fully connected layers on the 14 input features, with batch normalization after the first layer and quantized ReLU activations. The plotted sweep contains 21 trained and synthesized configurations. Five weight/activation precision settings—W2/A4, W2/A6, W3/A6, W4/A8, and W5/A10—are represented for two variants of the (128) topology and for the (192) and (256, 64) topologies. The (768, 256, 128) topology is included at W5/A10.
Trend fits. For each model family, balanced accuracy is fitted independently as a saturating function of FPGA resource utilization,
where . The saturation scale is scanned over 450 logarithmically spaced values. At each value, and are determined by unweighted least squares, and the solution with the smallest mean squared residual is retained. Each fitted curve is evaluated only over the resource range spanned by its corresponding models.
Training. All LNNs are trained with AdamW (learning rate 0.01, no weight decay), batch size 1024, and a class-weighted cross-entropy loss, with a fixed seed of 42. The sweep of section 3.1 trains each configuration for at least 20,000 steps and at least five hours of wall-clock time; the reconfigurability study trains for at least 30,000 steps and at least two hours, after which balanced accuracy was observed to have plateaued. Models are evaluated every 5,000 steps and the best checkpoint by validation balanced accuracy is retained.
References
- [1]Colby R. Banbury et al. “MLPerf Tiny Benchmark”. In: CoRR abs/2106.07597 (2021). arXiv: 2106.07597. URL: https://arxiv.org/abs/2106.07597.
- [2]Jie Lin et al. “Low-latency edge video analytics for on-road perception of autonomous ground vehicles”. In: IEEE Transactions on Industrial Informatics 19.2 (2022), pp. 1512–1523.DOI
- [3]Thea Aarrestad et al. “Fast convolutional neural networks on FPGAs with hls4ml”. In: Machine Learning: Science and Technology 2.4 (2021), p. 045015.
- [4]Felix Petersen et al. “Deep differentiable logic gate networks”. In: Advances in Neural Information Processing Systems 35 (2022), pp. 2006–2018.arxiv.org/abs/2210.08277
- [5]Alan TL Bacellar et al. “Differentiable weightless neural networks”. In: Proceedings of the 41st International Conference on Machine Learning, PMLR. Vol. 235. 2024, pp. 2277–2295.arxiv.org/abs/2410.11112
- [6]Felix Petersen et al. “Convolutional differentiable logic gate networks”. In: Advances in Neural Information Processing Systems 37 (2024), pp. 121185–121203.arxiv.org/abs/2411.04732
- [7]Marta Andronic and George A Constantinides. “NeuraLUT-Assemble: Hardware-aware Assembling of Sub-Neural Networks for Efficient LUT Inference”. In: Proceedings of the 33rd IEEE Annual International Symposium on Field Programmable Custom Computing Machines (FCCM). IEEE. 2025, pp. 208–216.
- [8]The CMS Collaboration. The Phase-2 Upgrade of the CMS Tracker. Tech. rep. Geneva: CERN, 2017. DOI: 10.17181/CERN.QZ28.FLHW. URL: https://cds.cern.ch/record/2272264.
- [9]The ATLAS Collaboration. Technical Design Report for the ATLAS Inner Tracker Pixel Detector. Tech. rep. Geneva: CERN, 2017. DOI: 10.17181/CERN.FOZZ.ZP3Q. URL: https://cds.cern.ch/record/2285585.DOI
- [10]Morris Swartz and Jennet Dickinson. Smart pixel dataset. Version 3. Zenodo, Mar. 2024. DOI: 10.5281/zenodo.10783560. URL: https://doi.org/10.5281/zenodo.10783560.
- [11]Danush Shekar et al. Smartpixels co-design datasets. Version 1. Zenodo, Sept. 2025. DOI: 10.5281/zenodo.17180303. URL: https://doi.org/10.5281/zenodo.17180303.
- [12]Jieun Yoo et al. “Smart pixel sensors: towards on-sensor filtering of pixel clusters with deep learning”. In: Machine Learning: Science and Technology 5.3 (Aug. 2024), p. 050047. DOI: 10.1088/2632-2153/ad6a00. URL: https://doi.org/10.1088/2632-2153/ad6a00.
- [13]Jan-Frederik Schulte et al. “hls4ml: A Flexible, Open-Source Platform for Deep Learning Acceleration on Reconfigurable Hardware”. In: arXiv preprint arXiv:2512.01463 (2025).
- [14]Danush Shekar et al. “Robustness of the smartpixels classifier for different simulated sensor geometries and non-ideal detector conditions”. In: Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 1092 (2026), p. 171897. ISSN: 0168-9002. DOI: https://doi.org/10.1016/j.nima.2026.171897. URL: https://www.sciencedirect.com/science/article/pii/S0168900226002636.
- [15]Shruti R. Kulkarni et al. “On-Sensor Data Filtering using Neuromorphic Computing for High Energy Physics Experiments”. In: Proceedings of the 2023 International Conference on Neuromorphic Systems. ICONS ’23. Santa Fe, NM, USA: Association for Computing Machinery, 2023, pp. 1–8. ISBN: 9798400705757. DOI: 10.1145/3589737.3605976. URL: https://doi.org/10.1145/3589737.3605976.
- [16]Zachary Susskind et al. “Weightless neural networks for efficient edge inference”. In: Proceedings of the 31st International Conference on Parallel Architectures and Compilation Techniques (PACT). 2022, pp. 279–290.arxiv.org/abs/2203.01479
- [17]Zachary Susskind et al. “Uleen: A novel architecture for ultra-low-energy edge neural networks”. In: Transactions on Architecture and Code Optimization (TACO) 20.4 (2023), pp. 1–24.arxiv.org/abs/2304.10618
- [18]Marta Andronic and George A Constantinides. “PolyLUT: learning piecewise polynomials for ultra-low latency FPGA LUT-based inference”. In: Proceedings of the 2023 International Conference on Field Programmable Technology (ICFPT). IEEE. 2023, pp. 60–68.DOI
- [19]Marta Andronic and George A Constantinides. “NeuraLUT: Hiding neural network density in boolean synthesizable functions”. In: Proceedings of the 34th International Conference on Field-Programmable Logic and Applications (FPL). IEEE. 2024, pp. 140–148.DOI
- [20]Olivia Weng et al. “Greater than the Sum of its LUTs: Scaling Up LUT-based Neural Networks with AmigoLUT”. In: Proceedings of the 2025 ACM/SIGDA International Symposium on Field Programmable Gate Arrays. 2025, pp. 25–35.DOI
- [21]Zhezhi He et al. “Defending and Harnessing the Bit-Flip Based Adversarial Weight Attack”. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 2020.DOI
- [22]Alan T. L. Bacellar et al. “From Arithmetic to Logic: The Resilience of Logic and Lookup-Based Neural Networks Under Parameter Bit-Flips”. In: Transactions on Machine Learning Research (July 2026).arxiv.org/abs/2603.22770
- [23]Claudionor N. Jr. Coelho et al. “Automatic heterogeneous quantization of deep neural networks for low-latency inference on the edge for particle detectors”. In: Nature Machine Intelligence 3 (2021), pp. 675–686. DOI: 10.1038/s42256-021-00356-5.DOI
- [24]Lino Gerlach et al. torchlogix. 2026. DOI: 10.5281/zenodo.18800427. URL: https://github.com/ligerlac/torchlogix.DOI
- [25]Chang Sun et al. “da4ml: Distributed Arithmetic for Real-time Neural Networks on FPGAs”. In: arXiv preprint arXiv:2507.04535 (2025).DOI
- [26]Wout Mommen. “A Method for Optimizing Connections in Differentiable Logic Gate Networks”. In: International Conference on Neuromorphic Computing Systems 2025. 2025.arxiv.org/abs/2507.06173
- [27]Lino Gerlach et al. “WARP-LUTs–Walsh-Assisted Relaxation for Probabilistic Look Up Tables”. In: arXiv preprint arXiv:2510.15655 (2025).arxiv.org/abs/2510.15655