# Neuromorphic Analog Machine Vision Enabled by Nanoelectronic Memristive Devices
## 4 Experiments and Results
The current plot shows that the frequency at which the pulses are fed into the memristor at the TE point is various—with a high frequency (pink color) for intensive illumination, and vice versa (green color). To generate the dataset, the deviation of photocurrent values for each pixel was set within 30% margins from the mean value, measured using the experimental set-up (100 \(\upmu\)A when the light source is turned on, and about 3 \(\upmu\)A when it is turned off). The values of the photocurrent for the light and dark pixels were measured by turning on the light sources in different combinations, corresponding to the mathematical symbols. The dataset consisted of 800 training and 200 testing images. The mathematical model of a formal ANN consists of one layer with five neurons (Figure 9, central part) and nine inputs. As a result of supervised learning, each neuron must respond to its own pattern. Memristive devices demonstrate bipolar switching of anionic type between the high resistance state and low resistance state. Both states are characterized by nonlinear current-voltage characteristics (Figure 8A, right panel). For the formal ANN, training was carried out on a mathematical model using the backpropagation method. The loss function is the mean square of errors. Accuracy was calculated as the ratio of correctly recognized patterns to the total number of patterns. Since the task of recognizing 3 \(\times\) 3 pixel images is not difficult for an ANN, the training resulted in 100% accuracy even with a 30% deviation in the input data. The synapse weights obtained after training were then converted into memristor resistances using Formula (5) for Figure 4, circuit C:  
\[ \begin{array}{l}R_{m1}=\frac{R_{m2}}{1-kR_{m2}},\ R_{m2}=R_{HRS},\ for\ w<0,\\ R_{m2}=\frac{R_{m1}}{kR_{m1}+1},\ R_{m1}=R_{LRS},\ for\ w>0,\ k=\frac{w}{K_{f}} \end{array}  \tag{1}\]  
Figure 8: Experimental set-up for measuring data for simulation. **(A)** The chip consists of a linear \(63\times 1\) memristive array for the sensory part and a 32 \(\times\) 8 memristive crossbar array for the ANN neurons. IV-curves of the memristive devices can be seen on the right. **(B)** Several parts are connected in the set-up: 1—PC; 2, 3, 6—PCB with the necessary electronic devices; 4—memristive chip; 5—light-proof container covering the light sources (LEDs) and the photodiodes (PDs). The calculated resistance values were transferred to a computer model of a machine vision system with a deviation \(\delta\), thereby simulating the memristor programming error. The parameters \(\delta\) were set as a percentage of the nominal resistance value; then, they were recalculated into standard deviation according to the three-sigma rule and fed into the pseudo-random number generation function according to the normal distribution law. After setting the weights, the operation of the network was emulated and the experiment was repeated 1000 times. The computer model of the hardware implementation of the formal ANN, in turn, had 18 inputs, since it used a scheme for generating bipolar weights with a differential input (Figure 9). To create the neural part of the ANN, a crossbar model of 18 \(\times\) 5 memristive devices was used, in which the signal from the sensory part is directly supplied to the rows of the crossbar, and the inference result is formed on the columns. The N-channel MOSFET transistor models were used for SPICE simulation. The response of the ANN to the presented visual patterns was fixed with a high voltage level on the corresponding column of the crossbar. After transferring this ANN model to a simulation model of a computer vision system, the accuracy of operation (inference) for five classes of mathematical signs was: 100% at \(\delta\) = \(\pm\)10%; 99.5% at \(\delta\) = \(\pm\)20%; and 99.1% at \(\delta\) = \(\pm\)30%. In this case, it is clear that the error in the memristor resistances in the ANN does not greatly reduce the recognition accuracy, which has been repeatedly demonstrated in other problems [29].