# Quantum-Inspired Neural Network Model of Optical Illusions
## 2 Deep Neural Network Algorithm
The physical processes underpinning the dynamics of switching between the perceptual states of ambiguous figures remains a subject of debate [7; 73]. One of the currently accepted theories suggests that the switching is likely to be explained by chaotic processes observed in nonlinear dynamical systems [51; 56; 74; 75; 76]. Indeed, broadly speaking, the brain is a dynamical system that exhibits a complex nonlinear and chaotic behaviour at multiple levels [77; 78; 79]. Subsequently, it is plausible that certain highly nonlinear and chaotic physical system can approximate the behaviour of a brain at least in principle [80]. To implement a chaotic dynamical behaviour in our model, we employ a quantum physical generator of random numbers [81; 82] to define matrices \(W^{(n)}\) that contain the weights of the connections of the neural network. Unlike the output of a pseudo-random generator such as the one described in ref. [83], a quantum generator produces truly random numbers [81; 82]. In our model, this property implies that the neural network is not biased towards one of the possible perceptual states of the Necker cube and that its predictions do not repeat in time [84; 85]. Furthermore, as with the purely classical neural network models [51; 56], our quantum random generator-based neural network exhibits a truly chaotic dynamical behaviour [86] and therefore can be considered to be a chaos-driven system [51; 56]. As illustrated in Figure 4, we first randomly generate \(W^{(n)}\), then we train the network on the data corresponding to the Necker cubes with the shaded faces, and then we exploit the trained neural network to predict the perceptual state of the ambiguous Necker cube. This procedure is repeated in a loop to plot the perceived states of the cube as a function of time. _Results: Predictions of the Neural Network Model_  
Figure 5 shows the prediction by the neural network model obtained as a result of 100 consecutive runs of the algorithm outlined in Figure 4. The states of the output nodes of the neural network were recorded at the end of each computational run and the respective results were plotted as a function of time (in arbitrary units). Therefore, every pair of data points that constitute the curves in Figure 5 was obtained using a unique initial set of neural weights \(W^{(n)}\) obtained from a truly random quantum physical system [81; 82]. We can observe a time-dependent switching between the two possible classical perception states of the cube that correspond to probability values zero and one on the \(y\)-axis of Figure 5. Importantly, the pattern of switching between one fundamental perceptual state to another is not abrupt, as often depicted in the literature and schematically shown in Figure 1b of this paper, but it involves certain intermediate states that are a superposition of the fundamental states. Thus, the data produced by the neural network model speak in favour of plausibility of the previous theoretical results [9] and experimental evidence [25; 26; 27] demonstrat  
Figure 4: Sketch of the recurring computation procedure that involves the generation of the connection weights using a random generator, training of the network and its exploitation to predict the perceptual state of the Necker cube. Characters \({}^{\prime}|0\rangle^{\prime}\) and \({}^{\prime}|1\rangle^{\prime}\) are not part of the training images. Figure 5: Perceptual switching curves simulated by the neural network model using quantum random neural connection weights. The data produced by the two output nodes of the network are plotted using the solid and dotted curves, respectively. The data points with probability \(P_{|0\rangle}=0\) or \(P_{|1\rangle}=1\) correspond to the fundamental perceptual states of the Necker cube. The remaining data points are in a superposition of states \(|0\rangle\) and \(|1\rangle\) with \(P_{|0\rangle}+P_{|1\rangle}=1\). ing that the actual perception state is a superposition of the two fundamental states, \(|0\rangle\) and \(|1\rangle\), of the Necker cube.