Hardware Realization of the Pattern Recognition with an Artificial Neuromorphic Device Exhibiting a Short-Term Memory

Materials exhibiting memory or those capable of implementing certain learning schemes are the basic building blocks used in hardware realizations of the neuromorphic computing. One of the common goals within this paradigm assumes the integration of hardware and software solutions, leading to a substantial efficiency enhancement in complex classification tasks. At the same time, the use of unconventional approaches towards signal processing based on information carriers other than electrical carriers seems to be an interesting trend in the design of modern electronics. In this context, the implementation of light-sensitive elements appears particularly attractive. In this work, we combine the abovementioned ideas by using a simple optoelectronic device exhibiting a short-term memory for a rudimentary classification performed on a handwritten digits set extracted from the Modified National Institute of Standards and Technology Database (MNIST)(being one of the standards used for benchmarking of such systems). The input data was encoded into light pulses corresponding to black (ON-state) and white (OFF-state) pixels constituting a digit and used in this form to irradiate a polycrystalline cadmium sulfide electrode. An appropriate selection of time intervals between pulses allows utilization of a complex kinetics of charge trapping/detrapping events, yielding a short-term synaptic-like plasticity which in turn leads to the improvement of data separability. To the best of our knowledge, this contribution presents the simplest hardware realization of a classification system capable of performing neural network tasks without any sophisticated data processing.


Introduction
Pattern recognition is one of the basic cognitive functions, which, due to its complexity and required accuracy, has challenged researchers for decades in a strive to mimic it in an artificial setup. The development of such systems is fueled by various possible applications in medicine, security, economics and many other fields of human's activity. At the moment, the majority of available solutions are based on various software implementations of the machine learning approach, including above all the use of artificial neural networks (ANN) of different architectures. In most of the cases, the ANNs principle of operation is based on the optimization of weights associated with individual connections between nodes (neurons) and the information flow is inspired by the functions of biological structures found in the nervous system. It has been proven on numerous occasions that these algorithms provide an excellent efficiency in various classification tasks with both supervised and unsupervised learning procedures [1][2][3].

Material Characterization
In order to determine the band gap width (Eg) of cadmium sulfide (CdS), the reflectance spectrum was recorded. Kubelka-Munk's function FKM was calculated based on the raw data and a Tauc plot was made (Figure 1a). CdS is typically considered a direct semiconductor with the Eg value equal to 2.42 eV for the hexagonal phase and 2.33 eV for the tetragonal polymorph. The value determined for the discussed material (2.33 eV, Figure 1a) may suggest the dominance of the latter polymorph, but this value is usually also observed for mixtures of both crystalline phases [33].
The powder X-ray diffraction measurements have been employed to assess the CdS sample composition. The obtained data was analyzed using HighScore Plus software [34] in which so called Rietveld refinement was applied [35]. This method allows evaluation of certain parameters including the volume fraction of phases. The analysis conducted for the diffraction pattern shown in Figure 1b indicates that both the tetragonal hawleyite [36] and hexagonal greenockite [37] phases are present in approx. 1:1 volume ratio. The energy dispersive X-ray spectroscopy (Figure 1c) indicates the absence of significant impurities, therefore electronic trap states (vide infra) most likely originate from CdS lattice defects. The SEM image ( Figure 1d) reveals heavily agglomerated material, for which the particle size statistics were calculated using Image J software [38]. The distribution of crystalline diameters is relatively narrow, ranging from 25 to 110 nm, with an average diameter of 71 ± 3 nm, whereas the distribution maximum is found at 53 ± 1 nm.

Plasticity of the Artificial Neuron
The composites of cadmium sulfide with multiwalled carbon nanotubes reported in our previous works exhibited memory features that can be functionally associated with the neuronal facilitation (particularly, the paired-pulse facilitation-PPF) in terms of the short-term synaptic plasticity [20]. In the neuroscience, the PPF is considered a neuronal enhancement mechanism which consists of four distinctive processes characterized by different time constants and different physiology [39]. The PPF causes an amplification of the postsynaptic response as a consequence of the increase in stimulating event frequencies at the presynaptic axon [40]. It is believed that the PPF is realized mainly through the accumulation of depolarizing Ca 2+ ions in the presynaptic neuron [30]. High frequency components of the PPF mechanism (i.e., these characterized by low time constant values) may be useful from the point of view of information processing. These include the fast-decaying facilitation F1 and the slow-decaying facilitation F2 [30,39,41]. The influence of both components manifests itself in the double exponential decay of the postsynaptic response depicted in Figure 2.

Plasticity of the Artificial Neuron
The composites of cadmium sulfide with multiwalled carbon nanotubes reported in our previous works exhibited memory features that can be functionally associated with the neuronal facilitation (particularly, the paired-pulse facilitation-PPF) in terms of the short-term synaptic plasticity [20]. In the neuroscience, the PPF is considered a neuronal enhancement mechanism which consists of four distinctive processes characterized by different time constants and different physiology [39]. The PPF causes an amplification of the postsynaptic response as a consequence of the increase in stimulating event frequencies at the presynaptic axon [40]. It is believed that the PPF is realized mainly through the accumulation of depolarizing Ca 2+ ions in the presynaptic neuron [30]. High frequency components of the PPF mechanism (i.e., these characterized by low time constant values) may be useful from the point of view of information processing. These include the fastdecaying facilitation F1 and the slow-decaying facilitation F2 [30,39,41]. The influence of both components manifests itself in the double exponential decay of the postsynaptic response depicted in Figure 2. A similar phenomenon was observed for the photoelectrodes made of nanocrystalline cadmium sulfide ( Figure 3). Like in the case of multiwalled carbon nanotubes (MWCNT)-CdScomposite [20], when the interval between light pulses is sufficiently long (over 300 ms for this study) the subsequent photocurrent spikes are unafected by previous states the device was in. However, if the interval between irradiations becomes shorter (e.g., 80 ms) the amplifiation of the second photocurrent response becomes significant. Detailed analysis reveals that the ratio of pulse intensities (the facilitation rate) vs. the time interval between stimuli is best fitted with a biexponential function (1): which is fully consistent with the previous reports on MWCNT-CdS composite photoelectrodes [20]. The result of the fitting procedure is presented in Figure 3b and the parameters equal to: a1 = 0.218 ± 0.023, a2 = 0.340 ± 0.014, τ1 = 19.8 ± 4.6 ms, τ2 = 167 ± 23 ms and y0 = 1.008 ± 0.013. The time constants values, which are representative for polycrystalline CdS samples, are slightly higher than those obtained for CdS/MWCNT composites [20]. Interestingly, the determined values are consistent with the parameters typically observed in the case of biological structures [31]. The double exponential decay can be associated with two distinctive trapping/detrapping events characterized by two time constants τ1 and τ2. This diversity may originate from the presence of two CdS polymorphs, of which charge trapping states most likely differ. At the same, through the comparison with selected natural learning processes, these two mechanisms may be associated with A similar phenomenon was observed for the photoelectrodes made of nanocrystalline cadmium sulfide ( Figure 3). Like in the case of multiwalled carbon nanotubes (MWCNT)-CdScomposite [20], when the interval between light pulses is sufficiently long (over 300 ms for this study) the subsequent photocurrent spikes are unafected by previous states the device was in. However, if the interval between irradiations becomes shorter (e.g., 80 ms) the amplifiation of the second photocurrent response becomes significant. Detailed analysis reveals that the ratio of pulse intensities (the facilitation rate) vs. the time interval between stimuli is best fitted with a biexponential function (1): which is fully consistent with the previous reports on MWCNT-CdS composite photoelectrodes [20]. The result of the fitting procedure is presented in Figure 3b and the parameters equal to: a 1 = 0.218 ± 0.023, a 2 = 0.340 ± 0.014, τ 1 = 19.8 ± 4.6 ms, τ 2 = 167 ± 23 ms and y 0 = 1.008 ± 0.013. The time constants values, which are representative for polycrystalline CdS samples, are slightly higher than those obtained for CdS/MWCNT composites [20]. Interestingly, the determined values are consistent with the parameters typically observed in the case of biological structures [31].
The double exponential decay can be associated with two distinctive trapping/detrapping events characterized by two time constants τ 1 and τ 2 . This diversity may originate from the presence of two CdS polymorphs, of which charge trapping states most likely differ. At the same, through the comparison with selected natural learning processes, these two mechanisms may be associated with two components of neuronal plasticity: the fast-decaying facilitation F1 and the slow-decaying facilitation F2. Alternatively, they can be described as manifestations of short-and long-term memory, respectively [42].
Molecules 2019, 24, x FOR PEER REVIEW 5 of 16 two components of neuronal plasticity: the fast-decaying facilitation F1 and the slow-decaying facilitation F2. Alternatively, they can be described as manifestations of short-and long-term memory, respectively [42].  The overall mechanism of photocurrent generation and spikes amplification is summarized in Figure 4. The photoexcitation leads to the electrons transition from the valence to the conduction band (1) and the electron-hole recombination occurs spontaneously afterwards (1'). Electrons in the conduction band can be subsequently transferred through the interface to the conducting substrate (2) and holes can migrate to the surface and react with redox mediators in the electrolyte (2'). At the same time a fraction of electrons from the conduction band becomes trapped within interband states in a very fast process (3). This process efficiently competes with the interfacial electron transfer (2), but once the traps are filled this pathway becomes inactive. The trapped electrons undergo relaxation with the time constants τ1 (3') and τ2 (3'').  The overall mechanism of photocurrent generation and spikes amplification is summarized in Figure 4. The photoexcitation leads to the electrons transition from the valence to the conduction band (1) and the electron-hole recombination occurs spontaneously afterwards (1'). Electrons in the conduction band can be subsequently transferred through the interface to the conducting substrate (2) and holes can migrate to the surface and react with redox mediators in the electrolyte (2'). At the same time a fraction of electrons from the conduction band becomes trapped within interband states in a very fast process (3). This process efficiently competes with the interfacial electron transfer (2), but once the traps are filled this pathway becomes inactive. The trapped electrons undergo relaxation with the time constants τ 1 (3') and τ 2 (3").
Molecules 2019, 24, x FOR PEER REVIEW 5 of 16 two components of neuronal plasticity: the fast-decaying facilitation F1 and the slow-decaying facilitation F2. Alternatively, they can be described as manifestations of short-and long-term memory, respectively [42].  The overall mechanism of photocurrent generation and spikes amplification is summarized in Figure 4. The photoexcitation leads to the electrons transition from the valence to the conduction band (1) and the electron-hole recombination occurs spontaneously afterwards (1'). Electrons in the conduction band can be subsequently transferred through the interface to the conducting substrate (2) and holes can migrate to the surface and react with redox mediators in the electrolyte (2'). At the same time a fraction of electrons from the conduction band becomes trapped within interband states in a very fast process (3). This process efficiently competes with the interfacial electron transfer (2), but once the traps are filled this pathway becomes inactive. The trapped electrons undergo relaxation with the time constants τ1 (3') and τ2 (3'').  This simple mechanism provides a platform for the implementation of neuronal dynamics in an artificial, fully inorganic system. Due to its simplicity it can be applied for signal and pattern processing and could be integrated into larger neuromimetic systems. Furthermore, along with bioinspired neuromorphic computing, other information processing paradigms may be implemented within the same system: Boolean logic [43], ternary logic [44] and fuzzy logic [45]. The latter one is especially tempting, as it may contribute to the development of novel neuro-fuzzy information processing devices [46][47][48].

Recognition of Digits
A dataset containing 1000 handwritten digits (100 samples of each 0, . . . , 9 digit) was randomly selected from the MNIST database ( Figure 5a). All the images were transformed into binary strings and used for the modulation of a light source. In order to eliminate possible errors resulting from the photoelectrode equilibration or photodegradation, first 20 and last 20 recorded photocurrent profiles were discarded and the remaining 60 patterns were subjected to further processing. First of all, a set of simple classification rules have been developed. These are based on pixel counting, therefore cannot provide a significant separation of the input data. In the first step, each sign (in a form of 28 × 28-pixel image, Figure 5a This simple mechanism provides a platform for the implementation of neuronal dynamics in an artificial, fully inorganic system. Due to its simplicity it can be applied for signal and pattern processing and could be integrated into larger neuromimetic systems. Furthermore, along with bioinspired neuromorphic computing, other information processing paradigms may be implemented within the same system: Boolean logic [43], ternary logic [44] and fuzzy logic [45]. The latter one is especially tempting, as it may contribute to the development of novel neuro-fuzzy information processing devices [46][47][48].

Recognition of Digits
A dataset containing 1000 handwritten digits (100 samples of each 0, …, 9 digit) was randomly selected from the MNIST database ( Figure 5a). All the images were transformed into binary strings and used for the modulation of a light source. In order to eliminate possible errors resulting from the photoelectrode equilibration or photodegradation, first 20 and last 20 recorded photocurrent profiles were discarded and the remaining 60 patterns were subjected to further processing. First of all, a set of simple classification rules have been developed. These are based on pixel counting, therefore cannot provide a significant separation of the input data. In the first step, each sign (in a form of 28 × 28-pixel image, Figure 5a) was divided into four quadrants labelled κ1, …, κ4 (Figure 5b) and the sum of black pixels confined within each quadrant was calculated. In other words, an individual character was associated with a vector [ ] Subsequently, four 3-dimensional projections were formulated in the following manner: , , k k k S S S . For each type of input class (0, …, 9) an ellipsoid with the confidence level of 65% was fitted using 3D Confidence Ellipsoid toolbox in OriginPro 2019.  , , k k k combination of quadrants is shown in Figure 6a and the fitted ellipsoids in Figure 6b,c. It can be noticed, that the applied analysis procedure provides a rather poor separation, as the fitted ellipsoids excessively overlap in most of the cases, with the exception of "1" and "9" pair. This result is fully consistent with the initial assumption-simple pixels counting cannot serve as an efficient method for handwritten character recognition. The collection of data points representing all 600 characters under consideration for [κ 1 , κ 2 , κ 3 ] combination of quadrants is shown in Figure 6a and the fitted ellipsoids in Figure 6b,c. It can be noticed, that the applied analysis procedure provides a rather poor separation, as the fitted ellipsoids excessively overlap in most of the cases, with the exception of "1" and "9" pair. This result is fully consistent with the initial assumption-simple pixels counting cannot serve as an efficient method for handwritten character recognition.  Figure 6. A complete collection of input data points (before feeding them into the single-node neural network) for a set of 600 handwritten digits in the one, arbitrary chosen 3D projection (a) and an example of a relatively well-separated pair, which is associated with digits "1" and "9" (b). Other ellipsoids overlap significantly, e.g., those for digits "3" and "4" (c) or "2" and "5" (d).
It can be noticed that only two pairs are completely separated, whereas three others are close to complete separation. Most of these cases concern digit "1" which is substantially different (when the symmetry and number of pixels are taken into account) from any other handwritten digit.
In order to quantify the efficiency of digits recognition in various scenarios, a separability index was defined. Let The calculated separability indices for the input data in one of the possible projections are collected in Table 1. It is noteworthy that the matrix containing separability indices for a given combination of quadrants is not symmetrical, i.e.,  A complete collection of input data points (before feeding them into the single-node neural network) for a set of 600 handwritten digits in the one, arbitrary chosen 3D projection (a) and an example of a relatively well-separated pair, which is associated with digits "1" and "9" (b). Other ellipsoids overlap significantly, e.g., those for digits "3" and "4" (c) or "2" and "5" (d).
It can be noticed that only two pairs are completely separated, whereas three others are close to complete separation. Most of these cases concern digit "1" which is substantially different (when the symmetry and number of pixels are taken into account) from any other handwritten digit.
In order to quantify the efficiency of digits recognition in various scenarios, a separability index was defined. Let V m κ i , κ j , κ k be the volume of an ellipsoid fitted to the digit m representation in κ i , κ j , κ k projection. Then the separability index of the digit m to n will be defined as a ratio between the relative complement of n-ellipsoid in m-ellipsoid to the volume of m-ellipsoid for m n (2): The calculated separability indices for the input data in one of the possible projections are collected in Table 1. It is noteworthy that the matrix containing separability indices for a given combination of quadrants is not symmetrical, i.e., ξ m/n ξ n/m , since ellipsoids have different volumes. If m = n then ξ m/n = 0. Table 1. The collection of separability indices for the input data in κ 1 , κ 2 , κ 3 projection. The efficiency of data separation is color coded (vide infra) from red (no separation, ξ = 0) to green (perfect separation, ξ = 1). In most of the cases the separation is insufficient to allow the unequivocal recognition of handwritten shapes. The exception is a pair {1, 9} for which the separability index is equal to one, as the corresponding ellipsoids do not overlap. It is due to the fact, that "1" differs significantly in terms of pixels distribution between the quadrants. Poor separation can be however greatly improved with the use of even the simplest, the single-node hardware neural network.
In the first step all the characters were converted row-by-row into a stream of bits ("0" for a white pixel and "1" for a black one) and used to modulate the light source according to the scheme presented in Figure 7a,b. The recorded photocurrent spikes (Figure 7c) reflected the sequence of light pulses, but their intensity varied according to the previous states the photoelectrode was in (the short-term memory, vide supra, Figure 3). The photocurrent patterns were subsequently normalized: the amplitude of each signal was divided by the highest intensity recorded for the particular character. The application of various threshold values (Figure 7c,d) acted as a filter for the photocurrent spikes depending on their amplitude. The obtained images with the lowest intensity pixels removed at different thresholds are shown in Figure 8.  , , k k k projection. The efficiency of data separation is color coded (vide infra) from red (no separation, ξ = 0) to green (perfect separation, ξ = 1). In most of the cases the separation is insufficient to allow the unequivocal recognition of handwritten shapes. The exception is a pair {1, 9} for which the separability index is equal to one, as the corresponding ellipsoids do not overlap. It is due to the fact, that "1" differs significantly in terms of pixels distribution between the quadrants. Poor separation can be however greatly improved with the use of even the simplest, the single-node hardware neural network.
In the first step all the characters were converted row-by-row into a stream of bits ("0" for a white pixel and "1" for a black one) and used to modulate the light source according to the scheme presented in Figure 7a,b. The recorded photocurrent spikes (Figure 7c) reflected the sequence of light pulses, but their intensity varied according to the previous states the photoelectrode was in (the shortterm memory, vide supra, Figure 3). The photocurrent patterns were subsequently normalized: the amplitude of each signal was divided by the highest intensity recorded for the particular character. The application of various threshold values (Figure 7c,d) acted as a filter for the photocurrent spikes depending on their amplitude. The obtained images with the lowest intensity pixels removed at different thresholds are shown in Figure 8. The application of different thresholds (from Θ = 0.3, with virtually no signal filtration to Θ = 0.9, corresponding to the removal of all but the most intense pixels) leads to the evolution of the character image, which depends directly on the neighbors of each particular pixel in the row. Significantly, the "distance" (formerly in space, translated into time intervals between the light pulses) from the closest The application of different thresholds (from Θ = 0.3, with virtually no signal filtration to Θ = 0.9, corresponding to the removal of all but the most intense pixels) leads to the evolution of the character image, which depends directly on the neighbors of each particular pixel in the row. Significantly, the "distance" (formerly in space, translated into time intervals between the light pulses) from the closest preceding black pixel determines the weight of the subsequent photocurrent spike amplification. As the result, a simple type of classification according to the scattering of pixels can be achieved. Like in the case of the input data, the output images are subjected to the evaluation of respective separability indices at various threshold values. An example is shown in Table 2. Figure 9a shows a collection of all data points obtained for one selected projection (κ 1 , κ 2 , κ 3 ) and one threshold value (Θ = 0.7). They seem to be equally scattered as points for unprocessed data (cf. Figure 6a), but the fitting procedure reveals significant differences. Some ellipsoids, that were initially well separated (e.g., the {1, 9} pair) overlap significantly (Figure 9b). Some other remain unchanged (Figure 9c). More interestingly there are numerous pairs (e.g., {2, 5}, Figure 9d) which are significantly separated upon the data processing with the neuromimetic element.
Molecules 2019, 24, x FOR PEER REVIEW 9 of 16 preceding black pixel determines the weight of the subsequent photocurrent spike amplification. As the result, a simple type of classification according to the scattering of pixels can be achieved. Like in the case of the input data, the output images are subjected to the evaluation of respective separability indices at various threshold values. An example is shown in Table 2. Figure 9a shows a collection of all data points obtained for one selected projection ( 1 2 3 , , k k k ) and one threshold value (Θ = 0.7). They seem to be equally scattered as points for unprocessed data (cf. Figure 6a), but the fitting procedure reveals significant differences. Some ellipsoids, that were initially well separated (e.g., the {1, 9} pair) overlap significantly (Figure 9b). Some other remain unchanged (Figure 9c). More interestingly there are numerous pairs (e.g., {2, 5}, Figure 9d) which are significantly separated upon the data processing with the neuromimetic element.  , , k k k projection at the threshold Θ = 0.7. The efficiency of data separation is color coded from red (no separation, ξ = 0) to green (perfect separation, ξ = 1).   Table 2. The collection of separability indices for the output data in κ 1 , κ 2 , κ 3 projection at the threshold Θ = 0.7. The efficiency of data separation is color coded from red (no separation, ξ = 0) to green (perfect separation, ξ = 1). Upon data treatment with the neuromimetic element the separability is significantly improved. Six pairs of digits are completely separated and two others are close to complete separation. Furthermore, these pairs are different than those separated with the use of the pixel counting method (cf. Table 1).
The improvement of digits classification can be visually evaluated by the comparison of color-coded Tables 1 and 2. In order to perform a global quantitative evaluation of the separation efficiencies and to assess the improvement associated with the use of the single-node hardware neural device, a separability ratio (Ξ m/n ) was defined as a ratio of the separability index calculated for the processed data to the separability index determined for the input data (for m n) (3): and Ξ m/n = 0 for m = n. Detailed analysis of calculated values provides information on the discussed procedure efficiency even in the case of significantly overlapped ellipsoids. Selected separability ratios for κ 1 , κ 2 , κ 3 projection at the threshold Θ = 0.7 are presented in Table 3. Upon data treatment with the neuromimetic element the separability is significantly improved. Six pairs of digits are completely separated and two others are close to complete separation. Furthermore, these pairs are different than those separated with the use of the pixel counting method (cf. Table 1).
The improvement of digits classification can be visually evaluated by the comparison of colorcoded Tables 1 and 2. In order to perform a global quantitative evaluation of the separation efficiencies and to assess the improvement associated with the use of the single-node hardware neural device, a separability ratio ( , , k k k projection at the threshold Θ = 0.7 are presented in Table 3. Figure 9. A complete collection of output data points (after feeding them into the single-node neural network) for a set of 600 handwritten digits in the one, arbitrary chosen 3D projection (corresponding to the one shown in Figure 6) (a) and an example of significantly overlapped ellipsoids, corresponding to digits "1" and "9" (b), "3" and "4" (c). The majority of other ellipsoids are separated better, than in the case of untreated data-e.g., those associated with digits "2" and "5" (d). Figure 9. A complete collection of output data points (after feeding them into the single-node neural network) for a set of 600 handwritten digits in the one, arbitrary chosen 3D projection (corresponding to the one shown in Figure 6) (a) and an example of significantly overlapped ellipsoids, corresponding to digits "1" and "9" (b), "3" and "4" (c). The majority of other ellipsoids are separated better, than in the case of untreated data-e.g., those associated with digits "2" and "5" (d). Table 3. The collection of separability ratios (Ξ m/n ) for the output data in κ 1 , κ 2 , κ 3 projection at the threshold Θ = 0.7. The efficiency of data separation is color coded from red-significantly decreased separability (Ξ < 0.5), through yellow-slightly decreased separability (0.5 < Ξ < 1), green-moderately improved separability (1 < Ξ < 1.5), blue-significantly improved separability (1.5 < Ξ < 2) to navy blue-outstanding improvement of separability (Ξ > 2). It can be noticed that the overall improvement of separability is achieved with at least twofold increase of the index value for 10 pairs compared to the twofold decrease in five instances. A similar situation is also observed for other projections at this threshold. This qualitative picture suggests an improvement of handwritten digits recognition upon application of a neuromimetic element in data processing. A quantitative estimation of classification improvement can be obtained through simple numerical analysis of output data. Due to the analysis complexity (four quadrant combinations for eight different threshold values), various separation scenarios (depending on the chosen threshold and projection) are possible. Their overall efficiency can be evaluated using an integral separability index Ω, which acts as a global parameter indicating performance of the system for all of the above-mentioned variables. For each separation scenario it can be defined as follows (4): The above-mentioned dependency of the Ω function values is depicted in Figure 10. It can be noted, that in the majority of investigated separation scenarios the integral separability index after the treatment with the single-node hardware neural network is significantly higher than the value calculated for the unprocessed input data. In three cases the selection of a low threshold value (a situation which results in an insufficient filtration of pixels due to inadequate exploitation of memory features) leads to the inferior separation. On the other hand, when the short-term memory of the system is optimally utilized, the recognition of handwritten digits increases. For two quadrant combinations an optimal threshold value exists, which is fully consistent with the expectations-too deep filtration removes too many pixels and all the data points (cf. Figures 6a and 9a) interfuse at the origin of the coordinate system.

Conclusions
Surprisingly, even a primitive hardware realization of the neural network architecture based on a single-node exhibiting the short-term memory can significantly improve pattern recognition. Classification based solely on the number of black pixels encompassed by each of the four quadrants the character image is divided into (cf. Figure 5b) is insufficient-only a few characters of a specific symmetry (e.g., "1") could be distinguished using this primitive procedure. The application of the optoelectronic element with PPF functionality enhances tremendously (for such a simple device) the classification efficiency. This change is based on the extraction of a new feature of the studied data-the scattering of pixels within the 28 × 28 matrix. The high dispersion leads to the negligible photocurrent amplification. On the contrary, the digits with large groups of pixels are characterized by a higher number of counts for relatively high thresholds, for which the short-term memory of the system and resulting photocurrent amplification is strongly pronounced.
The system presented in this work is a single node neural device, the operation of which is based on the unsupervised learning paradigm involving the short-term memory of the device. The simple pixel counting method gives precise information on the size of the characters (therefore digit "1" separates well in all of the cases) and indirectly on their symmetry (it can be achieved by an appropriate selection of quadrant combinations). Application of a neuromimetic element allows further information processing, particularly the extraction of information on pixel "agglomeration", at least at the single row level. This process is analogous to Sammon mapping [49], but does not involve the reduction of data space dimensionality ( Figure 11). the scattering of pixels within the 28 × 28 matrix. The high dispersion leads to the negligible photocurrent amplification. On the contrary, the digits with large groups of pixels are characterized by a higher number of counts for relatively high thresholds, for which the short-term memory of the system and resulting photocurrent amplification is strongly pronounced.
The system presented in this work is a single node neural device, the operation of which is based on the unsupervised learning paradigm involving the short-term memory of the device. The simple pixel counting method gives precise information on the size of the characters (therefore digit "1" separates well in all of the cases) and indirectly on their symmetry (it can be achieved by an appropriate selection of quadrant combinations). Application of a neuromimetic element allows further information processing, particularly the extraction of information on pixel "agglomeration", at least at the single row level. This process is analogous to Sammon mapping [49], but does not involve the reduction of data space dimensionality ( Figure 11). The presented optoelectronic single-node neural device is superior compared to software implementations in terms of the error resistance and the energy efficiency. These features of the the scattering of pixels within the 28 × 28 matrix. The high dispersion leads to the negligible photocurrent amplification. On the contrary, the digits with large groups of pixels are characterized by a higher number of counts for relatively high thresholds, for which the short-term memory of the system and resulting photocurrent amplification is strongly pronounced.
The system presented in this work is a single node neural device, the operation of which is based on the unsupervised learning paradigm involving the short-term memory of the device. The simple pixel counting method gives precise information on the size of the characters (therefore digit "1" separates well in all of the cases) and indirectly on their symmetry (it can be achieved by an appropriate selection of quadrant combinations). Application of a neuromimetic element allows further information processing, particularly the extraction of information on pixel "agglomeration", at least at the single row level. This process is analogous to Sammon mapping [49], but does not involve the reduction of data space dimensionality ( Figure 11). The presented optoelectronic single-node neural device is superior compared to software implementations in terms of the error resistance and the energy efficiency. These features of the The presented optoelectronic single-node neural device is superior compared to software implementations in terms of the error resistance and the energy efficiency. These features of the discussed system make it a potential low-cost pre-processing unit. Furthermore, due to the operation based on time-series and the intrinsic short-term memory, it can be combined with selected aspects of the reservoir computing paradigm-in one of the possible scenarios, where a delayed feedback loop is used, the virtual neurons could significantly affect the system performance. At the same time, the analog character of the system allows the implementation of the fuzzy logic system, yielding a new class of hardware neuro-fuzzy devices.
The research presented in this paper supports the concept of heterodic computation [27,28]. It clearly shown that the performance of a simple numerical algorithm (classification based on pixel counting) can be improved by in-materio computational component, which itself cannot perform any classification tasks.
Working electrodes were prepared from polyethylene terephthalate (PET, Camarillo, CA, USA) foil coated with indium tin oxide (Aldrich, St. Louis, MO, USA). These substrates were washed carefully with diluted detergent solution, deionized water and isopropanol. They were then dried in air. The cadmium sulfide was ground with deionized water in an agate mortar to a thick paste and deposited onto the freshly cleaned substrates using a screen-printing machine (MikMetal, Masis St, Yerevan, Armenia) equipped with a 80 mesh polymer grid.
The UV/Vis spectra were recorded using Lambda 750 spectrophotometer (Perkin Elmer, Waltham, MA, USA) within the wavelength range of 200-2000 nm. Barium sulfate of spectral purity was used as a reference material. The X-ray diffraction patterns were recorded with Empyrean (Cu λ Kα1 = 1.54060 Å) diffractometer (PANalytical, Malvern, UK) at room temperature with 2θ values ranging from 20 to 80 degrees. The scanning electron images were taken on Versa 3d (FEI, Lausanne, Switzerland) scanning electron microscope operating at 20 kV with an Everhart-Thornley detector. The chemical composition of the CdS sample was confirmed using the energy dispersive X-ray spectroscopy. All electrochemical measurements were performed with the use of SP-300 potentiostat (BioLogic, Cary, NC, USA). Luxeon Star/O Royal Blue diode (465 nm, the total radiometric power of 110 mW) was used as the light source. It was powered through the WA-301 wideband amplifier (Aim-TTI, Cambridgeshire, England). Pulse sequences were generated with TG2512A arbitrary function generator (Aim-TTI, Cambridgeshire, England) triggered with Arduino Uno R3 system.
The photoelectrochemical experiments were performed in air-equilibrated electrolytes using a three-electrode configuration. As the photoactive component the screen-printed CdS electrodes, immersed in an aqueous electrolyte containing 0.1 M KNO 3 , 0.001 M KI and 0.0001 M I 2 , were used. A saturated Ag/AgCl electrode was used as a reference electrode and a platinum wire as a counter electrode. The positive voltage (400 mV) was applied to the working electrode and the photocell was irradiated with short light pulses (300 µs).
The experiment automation was realized based on the program written in Arduino C++ language. All the necessary data processing was performed with the use of programs written in Python 3.7.2.