BCM-Net: A Deep Learning Framework for Randomness Detection in Pseudo-Random and Quantum Random Sequences
Fan Fan, Longju Liu, Jie Yang, Wei Huang, Yang Li, Bingjie XuReliable randomness assessment is essential for evaluating random number generators used in cryptographic systems. This study presents the Bidirectional Convolutional Multi-head Attention Network (BCM-Net), which combines convolutional layers, a bidirectional gated recurrent unit, and multi-head attention for empirical discrimination between candidate and reference sequences. The evaluation uses Random.org reference data, linear congruential generators (LCGs) with moduli from 226 to 234, and an amplified spontaneous emission-based quantum random number generator under three post-processing settings. BCM-Net flags XLCG−30 and XLCG−32, although they pass the reported NIST SP 800-22 tests. In the baseline comparison on XLCG−32, its absolute difference between mean output scores is 52.38 percentage points (pp), compared with 32.88 pp for LSTM, 9.66 pp for CNN, and 0.02 pp for FNN. For the QRNG data, the 11-LSB output is flagged, while the 8-LSB and Toeplitz outputs are not. Under the generator configurations, finite observation lengths, preprocessing, and evaluation protocol examined here, these findings support empirical sequence discrimination as a complementary screening method. They do not establish detection performance for untested fractions of a generator period or certify randomness or cryptographic security.