Combination of Organic‐Based Reservoir Computing and Spiking Neuromorphic Systems for a Robust and Efficient Pattern Classification

Nowadays, neuromorphic systems based on memristors are considered promising approaches to the hardware realization of artificial intelligence systems with efficient information processing. However, a major bottleneck in the physical implementation of these systems is the strong dependence of their performance on the unavoidable variations (cycle‐to‐cycle, c2c, or device‐to‐device, d2d) of memristive devices. Recently, reservoir computing (RC) and spiking neuromorphic systems (SNSs) are separately proposed as valuable options to partially mitigate this problem. Herein, both approaches are combined to create a fully organic system based on 1) volatile polyaniline memristive devices for the reservoir layer and 2) nonvolatile parylene memristors for the SNS readout layer. This combination provides a simpler SNS training procedure compared with the formal neural networks and results in greater robustness to device variability, while ensuring the extraction and encoding of the input critical features (performed by the polyaniline reservoir) and the analysis and classification performed by the SNS layer. Furthermore, the spatiotemporal pattern recognition of the system brings us closer to the implementation of efficient and reliable brain‐inspired computing systems built with partially unreliable analog elements.


Introduction
The development of neuromorphic systems (NSs) based on memristive devices has been driven mainly by the yearning of replicating the exceptionally high computational and energy efficiency of biological systems in solving cognitive tasks (pattern and speech recognition, prediction, generalization, etc.). [1,2] Most organic electronic devices share their working principles with those of biological synapses and neurons, that is ion migration, [3] and can effectively emulate synaptic and neuronal properties. [4][5][6][7] Moreover, memristors could be organized in large crossbar arrays to perform weighted vector matrix multiplication naturally by the electrical current summation. Being the most massively parallel operation in deep learning algorithms, it is very resource expensive for traditional von Neumann digital computing systems. [8] Nowadays, neuromorphic systems based on memristors are considered promising approaches to the hardware realization of artificial intelligence systems with efficient information processing. However, a major bottleneck in the physical implementation of these systems is the strong dependence of their performance on the unavoidable variations (cycle-to-cycle, c2c, or device-to-device, d2d) of memristive devices. Recently, reservoir computing (RC) and spiking neuromorphic systems (SNSs) are separately proposed as valuable options to partially mitigate this problem. Herein, both approaches are combined to create a fully organic system based on 1) volatile polyaniline memristive devices for the reservoir layer and 2) nonvolatile parylene memristors for the SNS readout layer. This combination provides a simpler SNS training procedure compared with the formal neural networks and results in greater robustness to device variability, while ensuring the extraction and encoding of the input critical features (performed by the polyaniline reservoir) and the analysis and classification performed by the SNS layer. Furthermore, the spatiotemporal pattern recognition of the system brings us closer to the implementation of efficient and reliable braininspired computing systems built with partially unreliable analog elements.
Recently, promising results in the implementation of NSs based on memristive synapses have been demonstrated in the realization of perceptrons, [9][10][11] reinforcement learning, [12] long-/short-term memory [13] networks, and even macros. [14] Such formal neuromorphic systems (FNSs) are usually trained by various types of gradient descent optimization algorithms. This algorithm has some critical issues, such as the complexity of its hardware realization due to unreliable cycle-to-cycle (c2c) and device-to-device (d2d) variations of memristive characteristics and the necessity of the global weight update computation and realization. [15] Several approaches have been proposed to partially mitigate these problems, including spiking neuromorphic systems (SNSs) with local training rules [16] and reservoir computing (RC). [14,17] SNSs encode and process information in the relative timings or rates of the spikes, and the weight update only occurs in the presence of spikes overlap. Therefore, SNSs could be more energy efficient than FNSs, when implemented in specialized neuromorphic hardware, especially for processing temporal and dynamic data. [18] SNSs can provide adaptive local training via spike-timing-dependent plasticity (STDP) [19] or Bienenstock-Cooper-Munro [20] protocols, which reduces the hardware overhead in peripheral circuits compared with the realization of the gradient descent algorithms. More importantly, SNSs are more resilient to c2c and d2d variations than FNSs, for example, for a spiking network the variation of 25% is acceptable for different tasks, [21] while for the formal one the variation of 5% could lead to convergence problems. [12] RC systems, in turn, consist of two main parts (layers). The reservoir part represents a dynamic system with short-term memory that is used for the nonlinear processing of the input signal and extracting valuable features from the inputs. Subsequently, the readout part, which may consist of a simple linear network, analyzes the extracted features. [22] In this organization, the training procedure is limited only to the readout layer of the RC system, which considerably reduces the total training cost. Several studies have demonstrated the hardware implementation of RC systems using atomic switch networks, [23] photonic systems, [24] and memristive devices. [25][26][27][28][29][30][31][32] The results of these demonstrations pave the way toward high-efficiency RC systems. Nevertheless, the training of the readout layer, implemented either in software or hardware, is still realized via various types of power-hungry gradient descent algorithms.
In this work, we propose to combine the advantages of a reservoir and a spiking computing system and create an RC system based on organic memristive devices (OMDs) with an SNS readout layer. OMDs do not concede to inorganic counterparts in their main characteristics: R off /R on ratio, retention, endurance, etc. [33] Additionally, OMDs have undeniable advantages, such as cheap and large-scale production, biological compatibility, [34] flexibility, and the possibility of 3D stacking. [35] Several groups have reported the realization of OMDs based on polymers. [33,36] OMDs based on polyaniline (PANI) are used in various neuromorphic applications and considered promising candidates for reservoir implementation in RC systems. Indeed, PANI-based OMDs are well-studied three-terminal systems, operating via redox reactions and involving ion motion in the electrolyte layer, [37] applicable in neuromorphic circuits [10,38] and demonstrating short-term memory effects under zero potential. [39] Moreover, their characteristic switching time could be regulated by the choice of the electrolyte, that is solid or liquid, [40] which could be important for the reservoirs' capability to map diverse features at different timescales. [26] Here we implemented the reservoir layer using PANI-based OMDs with a solid electrolyte. For the readout layer, we used OMDs based on parylene (poly-(p-xylylene), or PPX). PPX is an FDA-approved polymer widely used in medicine and electronics due to its chemical inertness, excellent barrier characteristics, as well as good and conformal adhesion. [41] PPX-based OMDs work through the electrochemical metallization mechanism (i.e., ion migration), demonstrate fairly good memristive characteristics, and can be organized in crossbar arrays, which allow them to be used as building blocks of hardware SNSs. [42][43][44][45][46][47] Thus, we propose an RC system with a PANI-based reservoir layer and a PPX-based SNS readout layer modeled in software but based on experimental results. Furthermore in this work, we tested the effectiveness of different approaches (FNS vs. SNS), highlighting the role and impact of the device variations in the total performance of the RC system.

Concept of the Reservoir Computing System
A conceptual scheme of an RC system with a spiking readout layer is presented in Figure 1a. Generally, a reservoir unit maps nonlinearly an input signal u(t) into higher-dimensional computational spaces of the reservoir internal state x(t), which is then classified by the readout layer. In our hardware realization of the reservoir, the input image was binarized and fed to the inputs of the reservoir as 3-bit pulse trains (Figure 1b). The reservoir layer was implemented with PANI-based OMDs (Figure 1c), which are volatile at zero bias.
A read voltage pulse followed each pulse train, and the currents from all read pulses were then acquired and used as the inputs for the model of the fully connected readout layer. The readout layer consisted of a modeled SNS based on the experimental characteristics of the PPX-based nonvolatile OMDs ( Figure 1d) and was trained by local bioinspired STDP rules ( Figure 1e). For comparison, the readout layer was also modeled by FNS with a gradient descent learning algorithm.

PANI-Based Memristive Reservoir Layer
The application of voltage sweeping to PANI-based OMDs induces the typical current response of the devices (Figure 2a,b and S1, Supporting Information), revealing a considerable and stable voltage-dependent conductance variation. A high-or low-enough positive voltage value (U > 0.55 V and U < 0.2 V) promotes internal redox reactions at the PANI-electrolyte interface, [37] inducing a significant variation in the internal conductance of the device. In contrast, voltages between these values show a modest impact on the reactions of this OMD and thus can be chosen to read the resistance. We used 0.4 V as the reading voltage value for the device under investigation to maximize the ratio between the current in the low-and high-resistive states. It should be noted that even if the values of the output current can vary d2d, the switching voltages are fixed for the realized device configuration, as they are determined by the redox potentials of polyaniline.
If stimulated with a voltage pulse, PANI-based OMDs can reach several internal resistive states depending on the amplitude and duration of the voltage stimulus. [48] In this study, the temporal evolution of the I D (Figure 2c and S2, Supporting Information) suggests the presence of several internal resistive states, the gain of which with respect to the initial current (I D-after /I D-before ) is large enough to avoid misclassification even after just 1 s programming pulse (Table S1, Supporting Information). The results of the experiments carried out to evaluate the device endurance are shown in Figure S3, Supporting Information. After a short initialization, the devices remained stable for 3 Â 10 4 cycles, corresponding to more than 24 h of continuous operation.
These features suggest the possibility of using PANI-based memristive devices as a reservoir layer. To demonstrate this, eight patterns corresponding to 3-pixel image rows ("0" for black and "1" for white pixels) were converted into eight different sequences of incoming voltage pulses. Subsequently, the PANI-based OMD was fed with these voltage sequences in a random order. Every bit in a pattern was applied for 150 ms and at the end of the 3-bit sequence, we applied a 100 ms reading pulse after the device was reset by a long 1000 ms relaxation pulse ( Figure 2d) to avoid the accumulation of responses from previous cycles.
The results of this experiment (Figure 2e), represented by output current values measured during the reading phase, demonstrate the ability of the PANI-based OMDs to efficiently and reproducibly distinguish all 3-bit patterns. Each pattern produces a distinguishable final state of the device ( Figure 2f ) with no degradation within 800 cycles (100 cycles for each pattern). The small oscillations that lead to relatively wide distributions of the output currents may be explained by the random order of the patterns, which induce different initial states of the device during cycles despite the relaxation period.
We also have tested liquid-based devices using compatible protocols to assess whether this functionality is caused by the switching kinetics of solid-electrolyte PANI-based OMDs. The results of the reservoir experiment, shown in Figure S4, Supporting Information, are similar to those in Figure 2e, confirming that the classification capability of 3-bit sequences is an intrinsic characteristic of PANI-based OMDs independent from the electrolyte nature. PANI-based OMDs with liquid electrolyte are equally able to distinguish all incoming patterns, reducing the total experimental time using bit pulses of shorter duration. This means that for the class of PANI-based OMDs, the operational timescale of the device (resistive switching time) could be tuned according to the classification task by varying the channel size of the device, [49] the voltage amplitude ( Figure S2, Supporting Information), or using different electrolytes (solid or liquid) ( Figure S4, Supporting Information). www.advancedsciencenews.com www.advintellsyst.com

Parylene-Based Memristors for Readout Layer
PPX-based OMDs are suitable for the realization of the reservoir readout layer due to stable and reproducible resistive switching (see Figure 3a, where 100 I-V curves of the PPX-based memristive device are reported with their median curve). These devices show typical bipolar resistive switching common for nonvolatile memristors, [15] in which the compliance current is reached as high-enough voltage (U set ) is applied to the structure, and the memristor switches from the R off to the R on state. Then, it gradually switches back to the R off state as a voltage of opposite polarity is applied. It should be noted that the PPX-based OMDs could operate with a lower compliance current as well (see Figure S5, Supporting Information). The resistive switching of these devices is driven by electrochemical metallization mechanism: metal ions of the top electrode (Cu in our case) move into the polymer layer under the action of positive voltage, and then migrate to the bottom electrode and form a conducting filament, connecting the upper and lower electrodes. When a negative voltage is applied, the thinnest part of the filament ruptures due to Joule heating, some of the metal ions return to the top electrode, and the structure switches to the high-resistive state. [50] The cumulative probability of the resistive switching characteristics calculated from these 100 cycles (Figure 3b) demonstrates that the U set and U reset values have negligible c2c variation, which is crucial for the memristor usage in the NSs. Moreover, this type of device demonstrates significant performance stability (inset in Figure 3b) of R on and R off for the same device (c2c variation) and 15 different devices (d2d variation). Resistance values were measured at U read = 0.1 V. This stability was further confirmed by the endurance test of the PPX-based OMDs, which showed that they can endure at least 1000 stable resistive switching cycles ( Figure S6a, Supporting Information). The essential requirements for using these memristors in the readout layer are the abilities to exhibit multilevel switching and update their resistive states according to STDP rules, which ensure the evolution of the normalized conductance depending on the delay time between the spikes. PPX-based memristors can claim a high level of plasticity of their internal resistive states since they can access at least 32 states (stable for at least 300 s, Figure 3c), which were obtained via write-verify algorithm. [51] Additionally, four of these states were chosen to demonstrate their long-term stability (more than 10 4 s, Figure S6b, Supporting Information). The possibility of accessing multiple and time-stable resistive states is an essential requirement for their efficient use in artificial neural networks [52,53] for pattern classification and in general for the implementation of unsupervised algorithms. The number of accessible resistive states in a device, or more in general in a memristive system, determines the resolution with which a neuromorphic network can process incoming data, precisely adjusting the synaptic weights during the computation or the classification. A high resolution leads to an increment in precision and accuracy of the computing performance.  Figure 1b. The spike parameters were selected so that one spike was insufficient for memristor switching. The obtained results obey the STDP rule observed in biological systems considering the memristor conductance (G) as synaptic weight, [54] regardless of the chosen initial state (G 0 in the plot). In the case of positive Δt, the postsynaptic spike is applied after the presynaptic one, which follows the cause-and-effect relation and increases the synaptic weight (ΔG > 0). On the other hand, the opposite situation occurs in the case of negative Δt, which decreases the synaptic weight (ΔG < 0).
Moreover, several crucial issues about the obtained STDP dependencies were addressed. We tested different devices under the same conditions and obtained consistent STDP windows, demonstrating significant resilience to d2d variations ( Figure S6c, Supporting Information). Furthermore, the amplitude of the STDP window can be precisely adjusted depending on the spike amplitude ( Figure S6d, Supporting Information). However, it is worth mentioning that too large conductance variations could be a limiting factor for future readout layer implementation in scaled SNSs.
Additionally, the PPX-based memristors are endowed with potentiation (depression) abilities ( Figure S7, Supporting Information) achievable with 50 switching pulses of 10 ms and þ1.5 (À1.5) V. Despite perceptible c2c stochasticity of the curves, originating from the use of shorter pulses (10 ms instead of 100 ms), the mean value of the coefficient of variation (obtained from the ratio between the standard deviation and the relative mean value -σ/μ), calculated for each experimental point, was 6.0% (5.6%) for the potentiation (depression) curves. The depression curve was used for the simulation of the formal readout layer. In this way, the implementation of a two-step weight update is suggested for the FNS readout layer, in which at first the low-resistive state is obtained with a 100 ms U set pulse, and then the desired resistive state is obtained with a required quantity of 10 ms depressing pulses. In general, devices with the other types of resistive switching mechanism demonstrating superior switching and synaptic properties could be used for the readout layer realization. [55]

Readout Layer Modeling
The SNS model was established based on the created models of the PPX-based OMDs and neurons (see Experimental Section). b) The cumulative probability of the resistive switching from R off to R on at U set and from R on to R off at U reset . The voltage U set was considered equal to the voltage at which the compliance current was reached. The voltage U reset was determined as the voltage at which the I-V curve derivative decreased by e times. In the inset: the variation of resistances in the high-and low-resistive states. The values are given both for one device (c2c variation) and several (15) devices (d2d variation). c) Demonstration of the multilevel resistive switching and storage of the obtained intermediate resistive states. d) The STDP window of the memristor (for various initial conductance values). Postsynaptic spikes were applied after (or before) presynaptic ones with a varying delay time Δt. Every point of the curves is a median of ten recorded experimental values.
www.advancedsciencenews.com www.advintellsyst.com Two tasks of progressive complexity were chosen to test SNS performance, that is, 3 Â 3 pattern classification (Figure 4a,c) and 5 Â 3 number classification (Figure 4b,d). The capability of facing imprecise or incomplete data is a crucial aspect of neuromorphic computing, which could represent a limitation for different applications. In this light, we tested our system with the variability obtained from the STDP experiment. The coefficient of variation obtained from the STDP experiment for the PPX-based OMDs equaled 61%. Moreover, a comparison between SNS model results and those derived from the FNS model (see Experimental Section for the FNS model details) was made in order to test different approaches to the readout layer implementation. The first task was to classify four patterns. Inference was carried out with the same patterns as for the training, but with one wrong pixel (Figure 4c). Simulations show that both SNS and FNS with experimentally derived variation reach an accuracy of more than 95% after 200 training epochs ( Figure 4e). As already pointed out, SNSs are more energy efficient and more resilient to c2c and d2d variations than FNSs and in fact the introduction of high device variability only slightly decreases the classification accuracy for the SNS ( Figure S8a, Supporting Information). In this simple task, the simulated FNS manages to reach accuracy of 100% in a few epochs (Figure 4e), which is better than the results for the SNS readout layer. However, it is crucial to note that the FNS result was obtained with a quite small coefficient of variation σ/μ = 5.6%, which corresponds to the experimental value obtained from the depression curve of the PPX-based OMDs. The increase in the coefficient of variation (up to 61%, so that the variations introduced to the SNS and FNS are the www.advancedsciencenews.com www.advintellsyst.com same) leads to a dramatic decrease in the classification accuracy and its volatility (Figure 4e). The results on the digit classification confirm the above results. In this case, the accuracy of the FNS is again higher than that of the SNS readout layer (Figure 4f ). However, the increase in the coefficient of variation of the FNS leads to a collapse of the FNS training process. In contrast, introducing high device variability again decreases the SNS classification accuracy only slightly ( Figure S8b, Supporting Information). It is worth noticing that the increased complexity of the task leads to a more noticeable accuracy variation in the FNS case, while it does not affect the accuracy variation in the SNS case (Figure 4g,h).
Moreover, the influence of the input current confusion and variation (Figure 2e) on the FNS and SNS models was studied. Figure S9, Supporting Information, presents the FNS and SNS models with and without the variation of the input current for the task of number classification (the same as in Figure 4f ). The input current variation does not decrease the classification accuracy significantly, especially after 200 training epochs. Accordingly, it can be stated that the variation in the currents in Figure 2e should not affect FNS and SNS noticeably.
Thus, four main conclusions can be drawn. First, the FNS readout layer is extremely sensitive to the degree of the memristive variations; high variations may lead to the failure of the training process. Second, the SNS is practically robust to the introduced variations. Third, the expansion of the network architecture leads to an increase in the FNS accuracy variations and does not influence the SNS accuracy variations. Finally, the experimental input current variations do not influence the training processes of the FNS and SNS significantly.
Observed effects originate from the training procedures: in the local training (for SNS), nonsupervision and the relative sparseness of spike events provide extreme system adaptability, while in the global training (for FNS), inaccuracy for each weight incrementally degrades the total tolerance of the system. The immunity of the SNS to variability in memristor characteristics is related to the local nature of the training procedure and the rate-based method of encoding the signal. Since the exact number of spikes that come to the neuron during the exposure of a sample at the input is unknown, the quantitative response to each spike is less important than the qualitative one: potentiation or depression of the synapse. After a sufficient time of applying a sample, the dynamical equilibrium between potentiation and depression of each synapse is naturally reached due to the conductance-dependent character of the memristive STDP. Therefore, the variation does not influence the training process much. The shown degree of robustness to the variability of memristor characteristics is preferable for the readout layer and establishes one of the most substantial advantages of the SNS over the FNS approach.

Conclusion
In conclusion, we have proposed a fully organic RC system with a reservoir based on PANI OMDs and a spiking readout layer based on PPX OMDs. Exploiting the rich dynamic of the voltage-dependent switching time of PANI-based OMDs enables the reservoir to extract critical features from the 3-bit input.
This ability is independent of the properties of a specific device since it has been demonstrated in OMDs with liquid and solid electrolytes, which have different switching kinetics and voltage windows. The use of the SNS readout layer for the analysis and classification allows a simpler and more energy-efficient training procedure ensuring computing capabilities, such as spatiotemporal pattern recognition, with an accuracy of more than 80%. Moreover, the SNS readout layer is shown to be exceptionally robust to the memristive characteristic variations, showing only a minimal accuracy decrease in the presence of large variability. This ability arises from the local nature of the training procedure in the SNS systems and is crucial for the successful hardware implementation and the application of these systems in real-life tasks. From the direct comparison between FNS and SNS, the results obtained with the formal network are much more sensitive to device variability. Besides the level of accuracy and the great robustness to variations, our RC system has the further advantage of being fully organic based, allowing in perspective an easy and low-cost realization. Obtained results pave the way for the implementation of the efficient and reliable brain-inspired computing systems, built with partially unreliable analog elements.

Experimental Section
Polyaniline-Based Devices Fabrication: Polyaniline (PANI, Mw = 10 5 Da, Sigma Aldrich) was dissolved in N-methylpyrrolidone (NMP, Component-Reaktiv, 99.7%) with a concentration of 1 g l À1 and then diluted with NMP and toluene to obtain a solution with a concentration of 0.1 g l À1 in the 8:1 NMP/toluene (Chimmed, 99.5%) mixture. The formation of the Langmuir layers was carried out with Minitrough (KSV, Finland) with a maximum interfacial area of 243 cm 2 under compression between moving barriers at a speed of 7.5 cm 2 min À1 . The surface pressure was measured by the Wilhelmy method using a rough platinum plate with an accuracy of 0.1 mN m À1 . Langmuir layer was compressed to a pressure of 10 mN m À1 ; after that, the active channel of the device was formed by ten consequent transfers by the Langmuir-Schaefer (horizontal lift) technique. PANI-based OMDs were typically realized by depositing a polyaniline channel on two gold electrodes acting as source and drain electrodes. A water-based PEO solution was used as the solid electrolyte in which a silver wire was inserted as a gate and reference electrode. [37] The SiO 2 /Si substrates with gold electrodes on a chromium adhesion sublayer made by thermal evaporation and subsequent lift-off process were used. The distance between the electrodes was 10 μm and their width was 500 μm. Polyethylene oxide (PEO, Mw = 6·10 5 Da, Sigma Aldrich) was dissolved in the 0.23 M lithium perchlorate aqueous solution with a concentration of 80 g l À1 . The obtained solution was used to form a solid electrolyte layer. Before the deposition, the solution was diluted with a 1 M HCl aqueous solution in a ratio of 9:1 (PEO/HCl). It was drop cast on the top of the active channel and a silver wire was placed above, as typical for PANIbased OMDs. Then the device was dried in airflow for 2 h. The assembling and connection diagram is shown in Figure 1c.
Parylene-Based Devices Fabrication: PPX-based OMD is a two-electrode device with thin layers of copper and ITO used as the top and bottom electrodes, respectively, and PPX-MoO 3 (PPX with embedded MoO 3 nanoparticles) active layer between them. The PPX-based nanocomposite was prepared by the low-temperature vapor deposition polymerization technology, [56] which enables the preparation of thin hybrid nanocomposite films with a wide range of inorganic filler content. The thickness of the PPX-MoO 3 layer was %680 nm ( Figure S10, Supporting Information). The top Cu electrodes were deposited by magnetron sputtering through a shadow mask of 0.2 Â 0.5 mm 2 . In this way, the Cu/PPX-MoO 3 /ITO structure was obtained.
www.advancedsciencenews.com www.advintellsyst.com Electrical Measurements: I-V curves and endurance measurements of PANI-based devices were performed using a Keysight B2902A sourcemeasurement unit (SMU). The reservoir experiment was performed using NI PXIe 4140 SMU. The memristive characteristics of the PPX-based devices were measured via the 3S SWIN EPS4 analytic probe station. Voltage pulses were applied to the top electrode from Keithley 2636B SMU. The bottom electrode was ground. The compliance currents (I cc ) were established at þ1 mA and -50 mA to avoid the thermal destruction of the memristor during the I-V characteristic measurement. For STDP measurements, a memristor was preliminary set to the initial state, and two spikes were applied to the structure with the specific delay Δt between them. Then, the conductance change was measured. These two steps were repeated ten times in a row for the same Δt. Finally, the median conductance change value was calculated and depicted in the graph. All the experiments were carried out at room temperature using custom LabVIEW programs.
SNS Readout Layer Modeling: A Python code with modified version of the BindsNET library [57] was used to simulate the SNS readout layer. To adapt this library to our scope, we added 1) the support of biologically plausible bitriangular spikes; and 2) the possibility of STDP window input from the database prepared in advance. The SNS weights were limited to the range (0, 1) during training. Initially, all the weights were averaged and set to 0.5. The experimentally obtained STDP windows were normalized according to the formula Δw = ΔG/(G on À G off ), where ΔG is the experimentally measured conductance difference (Figure 3d). This normalization limited the variation of w to the range (0, 1), in which w plays the role of the memristor synaptic weight.
The Voltage ThrEshold Adaptive Model (VTEAM) was chosen for the memristive behavior description. [58] This model uses voltage dependence, which is convenient for practical applications and offers a compromise between the over-simplified ideal models and accurate structure-specific models. [59] Description of the model is presented in Note S1, Supporting Information. To run simulations, this model was implemented in Python code. The experimentally obtained STDP windows for three different initial states were fit in the framework of this model; thus, the memristor was modeled and its VTEAM parameters were obtained (Table S2, Supporting Information); the approximation is shown in Figure S11, Supporting Information. This allowed creating the STDP database for every possible normalized weight value with a step of 0.01 for the modeled memristor. The spikes utilized for the database formation were different from the experimental ones to prevent an excessive increase in Δw value. Pulses are shown in Figure S12 and S13, Supporting Information. For the neuron simulation, the leaky integrate-and-fire model was chosen. The neuron activation charge threshold was equal to 0.024 or 0.036 C, depending on the task. The refractory period after the action potential generation, during which the neuron functioning was limited, was equal to the pulse duration (40 ms).
Starting from the PANI-based OMD electrical response, a model of the reservoir layer with a higher number of elements was realized. In this, each element of the reservoir layer was connected to its corresponding input of the readout layer. The mean read current values from the reservoir layer played the role of the inputs to the SNS layer, taking into account their experimental dispersion ( Figure S14, Supporting Information). The raw input data was converted to the spike form. The linearly normalized input data (ranged from 0 to 1), multiplied with an intensity value (12 Hz), represented the mean generation rate of Poisson distributed spikes. Such intensity value provides high stability and satisfactory learning rate because the number of pulses that are applied within the refractory periods of input neurons is low. The number of SNS inputs was doubled because both normal and inverted values of the inputs were introduced to the SNS. The inverted inputs were needed to equalize the intensity of the input data. The inhibition neurons were introduced to suppress the wrong neurons by inverted pulses during the training process. The inhibition neurons were inactive during the inference process. Each inhibitor corresponded to the specific class and sent inverted pulses with a fixed rate to all output neurons, except for the one corresponding to this class. The weights between the inhibition and output neurons were not changed according to the STDP rules; their normalized conductance was fixed and was 10 times higher than the maximum value of normalized conductivity of PPX-based memristor to make the suppression efficient. At the inference stage, the class corresponding to the neuron emitting spikes with the highest rate was considered the network's output.
FNS Readout Layer Modeling: The FNS readout layer model was built as similar to the SNS one as possible. However, some changes had to be made. The FNS readout layer inputs were not converted to the spike form, and initial current values from the reservoir layer were utilized. In contrast to the SNS, the FNS architecture lacks an inhibitor layer, which is unnecessary for the FNS training procedure. Another difference was the necessity of negative weights for the FNS, the FNS weights were limited to the range (À1, 1). Consequently, each weight was represented by the difference between the two memristors' weights. The depression curve (in Figure S7, Supporting Information) was chosen for this simulation in order to facilitate the calculations.
For the FNS simulation, Python code was used with the imported Pytorch machine learning framework. The FNS was programmed in a typical way with the only considerable change: the network weights were changed in accordance with the experimental memristive data (depression curves in Figure S7, Supporting Information). After each training epoch, the theoretically required update for each FNS weight was calculated using the backpropagation algorithm. Then, the nearest to theoretical, experimental weight update was found, calculated as the difference between the two mean conduction states of a memristor (both chosen from the normalized averaged depression curve in Figure S7, Supporting Information). As long as the depression curve had some significant c2c variation, the chosen states of the two memristors were replaced with corresponding normally distributed random state values (experimental standard deviation and mean value were used). The choice of normal distribution for the weights' selection was justified with the quantile-quantile (Q-Q) plots (an example is presented in Figure S15, Supporting Information, as long as the experimental points do not show severe divergence from the reference line, the distribution is assumed to be normal). In this way, each actual FNS weight was equal to the difference between some two experimental states, considering their dispersion.

Supporting Information
Supporting Information is available from the Wiley Online Library or from the author.