Handwritten digital image classification and identification method based on random threshold switch memristor
Through the handwritten digital image classification recognition method based on random threshold switch memristor, the problems of high energy consumption and poor recognition accuracy in traditional technology are solved, efficient handwritten digital recognition is achieved, power consumption is reduced, and memory resistance is enhanced The complexity of the device model and the optimization performance of the neural network.
Patent Information
- Application Number
- CN202410998538.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The existing handwritten digital recognition technology is based on the traditional von Neumann architecture, which is difficult to effectively reduce energy consumption and lacks sufficient discussion of the dynamic and random characteristics of volatile memristors, resulting in poor recognition accuracy and calculation costs.
Using the handwritten digital image classification recognition method based on random threshold switch memristor, the particle motion model, dynamic process of dynamics of the system and discrete event differentiable distribution model are established to achieve efficient handwritten digital images by constructing particle motion models, dynamics of Monte Carlo description system and discrete event differentiable distribution model, and establishing pulsed neural networks to achieve high efficiency of handwritten digital images Identify.
Improves recognition accuracy and convergence characteristics, reduces power consumption, increases the complexity of the volatile memristor model, can better handle the device's threshold switching problems, provide an in-depth understanding of the memristor principle and optimize neural network performance reference.
Smart Images

Figure CN118968523A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microelectronic technology, and in particular to a handwritten digital image classification and recognition method based on a random threshold switching memristor. Background Art
[0002] In real life, we often face many scenes of handwritten numbers. However, if we want to consider the electronicization of such handwritten digital information, relying solely on manual recognition will lead to problems such as low efficiency, high cost, and general accuracy. Therefore, it is very necessary to realize the automatic recognition of handwritten numbers. At present, with the development of electronic information technology, the recognition accuracy of such handwritten digital application scenarios has been improved. But at the same time, since the existing recognition technology is mainly based on the traditional von Neumann architecture, breaking through the energy consumption bottleneck has become a top priority. Therefore, considering how to introduce a storage and computing architecture based on memristors in this application scenario has become a major problem that needs to be solved urgently.
[0003] On the other hand, the development and application of memristors have received extensive attention in the field of modern microelectronics. The working mechanism of metal conductive filament memristor devices includes multiple physical processes, such as metal oxidation, ion transition in electrolyte, and adsorption and reduction on electrodes. The switching process of memristors is mainly dominated by two factors: charge transfer and ion diffusion / drift. At present, there are still many challenges in the study of stochastic models involving volatile memristors. If you want to realize the circuit simulation of handwritten digit recognition application of neuromorphic computing devices, the first step is to complete the construction of such models. At present, compact models for memristors mostly focus on the steady-state characteristics or ideal electrical characteristics of the device, and rarely explore its dynamic characteristics and randomness. The relevant dynamic and stochastic models either study the underlying physical mechanism in detail and use computationally expensive numerical simulation methods, or directly start from the apparent electrical characteristics and lack physical interpretability.
[0004] In this existing technical context, it is necessary to design new volatile memristor models for better application in handwritten digit recognition solutions. These models have certain physical interpretability and low computational cost, and can well simulate the dynamic and random electrical characteristics of the device. This is a key step in deep learning and optimizing pulse neural networks, and is also a necessary condition for efficient circuit simulation. In this way, the corresponding large-scale array pulse neural network can be constructed according to the model, and the recognition application network can be optimized. Therefore, the existing technology still needs to be improved and developed. Summary of the invention
[0005] The present invention aims to address the deficiencies of the prior art and to propose a handwritten digital image classification and recognition method based on random threshold switching memristors.
[0006] The object of the present invention is achieved through the following technical solution: a handwritten digital image classification and recognition method based on random threshold switching memristor, comprising the following steps:
[0007] Obtain a handwritten digital image classification and recognition dataset, normalize the grayscale values of the handwritten digital image and flatten it into a one-dimensional matrix, and construct a Poisson encoder corresponding to the original channel of the digital image;
[0008] Construct a spiking neural network for handwritten digit image classification and recognition. Connect the Poisson encoder to the neurons composed of random threshold switch memristor model through synapses, and output the recognition result corresponding to the handwritten image through the output neuron.
[0009] The construction of the random threshold switch memristor model includes: establishing a random motion model of particles moving forward or backward, using one-dimensional dynamic Monte Carlo to describe the dynamic process of the system according to the equilibrium state of the memristor and the random motion model of the particles, establishing an intensive model of the random conversion time of the particle state, deriving a differentiable distribution model of discrete time, characterizing the relationship model between the transition of the switching state of the memristor and time and external stimulation, and obtaining the required memristor component model;
[0010] The handwritten digit image classification and recognition spiking neural network is trained through the data set; the handwritten digit image is flattened and input into the trained handwritten digit image classification and recognition spiking neural network to obtain the handwritten digit image classification and recognition result.
[0011] Furthermore, the number of pixels of the handwritten digital image after being flattened into a one-dimensional matrix is consistent with the number of Poisson encoder channels in the handwritten digital image classification and recognition pulse neural network, and the grayscale of the pixels is normalized to a value between 0 and 1, corresponding to the average pulse emission rate of each channel.
[0012] Furthermore, the handwritten digit image classification and recognition pulse neural network is a multi-layer fully connected pulse neural network, the input of the first layer is a Poisson encoder corresponding to the original image, and the input is connected to neurons composed of a random switching threshold model through synapses; the 10 output neurons of the last layer correspond to the recognition results of handwritten digits 0 to 9 respectively; the neuron with the highest pulse emission frequency in the output layer is identified as the classification result of the network.
[0013] Furthermore, the establishment of a random motion model of particles moving forward or backward specifically includes:
[0014] Metal Atom Oxidation or restore The rate is calculated using the following formula:
[0015]
[0016] Among them, vr is the constant term used for redox rate fitting, E r is the activation energy, α is the charge transfer coefficient, V T is the threshold voltage in DC test, T is the local temperature of the device, k B is the Boltzmann constant, q is the charge per unit electron, and V is the voltage applied across the device;
[0017] The rate of the metal ion forward or reverse transition process is calculated by the following formula:
[0018]
[0019] Among them, v h is the vibration frequency, E h is the transition barrier height in the dielectric, where the residual nanoclusters have an influence on the transition barrier U l It can be calculated by this formula:
[0020]
[0021] Among them, l c is the equivalent length of the residual nanocluster, R c is the influence radius of the nanocluster on the electric potential field, w0 is the influence amplitude of the nanocluster on the electric potential field, and l is the length of the current conductive filament. The local electric field influence factor γ representing the transition barrier g It can be calculated by the following formula:
[0022] γ g =γ0-γ3g 3 ,
[0023] Among them, γ0 and γ3 are fitting parameters, and g is the gap between the conductive filament and the electrode on the other side.
[0024] Furthermore, the establishment of an intensive model for random particle state transition time specifically includes:
[0025] The equilibrium state of the volatile memristor is: DC test when the threshold voltage V is applied T When the conductive filament just starts to grow, or a holding voltage V is applied H When the conductive filament just begins to break, the expression is as follows:
[0026]
[0027] According to the equilibrium state expression, substituting the specific expression of the forward / backward transition rate, the following relationship is obtained:
[0028] γ(g max )V T =U(Lgmax ),g max =Ll c ,
[0029] and γ(g min )V H =U(Lg min ),g min =0,
[0030] Where L is the thickness of the dielectric layer, g max is the length of the gap when the conductive filaments begin to grow, g min is the length of the gap when the conductive filament just begins to break;
[0031] One-dimensional dynamic Monte Carlo is used to describe the dynamic process of the system: the internal relationship when the particle state changes is as follows:
[0032]
[0033] Among them, t ′ is the time when the last particle state transition occurred, and u is uniformly distributed A random variable sampled from The state transitions that can occur include: Represents the state transition direction of the particle in the current state. When the particle is in the redox stage, When the particles are oxidized but at the interface, When the particles are oxidized but in the dielectric layer, This results in a model of the random state transition time of particles.
[0034] Furthermore, the derived discrete event differentiable distribution model includes:
[0035] n0 is the critical number of forward transitions required to turn on the device. When the device is turned off, the number of forward transitions required for the particle minus the number of reverse transitions is greater than n0. The turn-on probability when the device is turned off is:
[0036]
[0037] Where Γ is the upper incomplete gamma function, N + is the number of positive transitions, N - is the number of reverse transitions, n0 is the critical number of forward transitions required for the device to turn on, λ + represents the expected number of positive transitions in a single cycle, λ - represents the expected number of reverse transitions in a single cycle,
[0038] The shutdown probability when the device is turned on satisfies:
[0039] p reset =Pr{N - >N + +n1},
[0040] Where n0 is the critical reverse transition number required for the device to shut down;
[0041] The overall performance of the device in a single pulse cycle is studied, and the uniform distribution is transformed into a geometric distribution using the reparameterization technique:
[0042]
[0043] Where u satisfies uniform distribution p depends on the current device state. If the device is off, we choose p fire , otherwise select p reset , the resulting ΔT represents the time interval required for the next device switch to occur, where ΔT follows a geometric distribution; the relationship between the transition of the device switch state and time and the external stimulus is obtained:
[0044] δ t =(tt ′ )-ΔT,
[0045]
[0046] Where t is the current time, t ′ is the time when the device status last changed, m t It is a binary state conversion mask. If it is 1, it means that the current switch state needs to be reversed, otherwise it remains the same.
[0047] Use the surrogate gradient method to estimate the state transition mask m t The derivative with respect to the sampling time interval ΔT is:
[0048]
[0049] Among them, m t Equal to the value of δ t The step function is replaced by SigmoidSpike. The switching state of the device is expressed as:
[0050] s t+1 =(1-s t )·m t +s t ·(1-m t ),
[0051] Among them, s=1 means that the device is in the on state, and s=0 means that the device is in the off state; at this time, all steps of modeling random switching events can backpropagate gradients.
[0052] Furthermore, the training of the pulse neural network for handwritten digit image classification and recognition using the data set is specifically as follows:
[0053] The training end condition is preset, the training data set is input into the initialized neural network, and the loss function value is determined according to the result output by the neural network to update the synaptic parameters in the neural network; the updated neural network parameters are used as the parameters of the new neural network to be trained, and the training data set is re-input into the neural network to be trained, and the above training steps are repeated until the performance improvement of the updated neural network on the test set is less than the preset condition, then the training is stopped.
[0054] On the other hand, the specification provides a handwritten digital image classification and recognition device based on a random threshold switching memristor, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it implements the handwritten digital image classification and recognition method based on a random threshold switching memristor.
[0055] On the other hand, the specification provides a computer-readable storage medium having a program stored thereon, and when the program is executed by a processor, the method for classifying and recognizing handwritten digital images based on a random threshold switching memristor is implemented.
[0056] Beneficial effects of the present invention:
[0057] The present invention provides a novel pulse neural network construction and optimization method based on a memristor with random threshold switching behavior, which can be applied to solve the classification problem of handwritten digital images. Compared with the previous neural network model, it has improvements in accuracy, convergence characteristics and computational cost. While ensuring the accuracy of handwritten digital recognition, it further reduces the power consumption of the use scenario. Secondly, the introduction of this technical solution increases the complexity of the volatile memristor neuron model in the device, so that it can handle more complex memristor threshold switching problems, such as the correlation problem between the voltage at both ends of the memristor and the interval time of the switch state transition, and provides a new reference idea for the realization of other application scenarios. In addition, the introduction of the volatile memristor model in the network plays an important role in deeply understanding the principle of memristors and optimizing the performance of neural networks. The introduction of the model provides a reference model that is more in line with the electrical characteristics of the device for the training of the neural network, so as to find the optimal working point; increase the robustness of the algorithm to non-ideal factors, so that a wider range of devices can be applied to neuromorphic computing. Finally, the effect of the volatile memristor model is actually verified by experiment, so that the feasibility and effectiveness of applying the model in the network are guaranteed.
[0058] The present invention provides a new method for classifying and recognizing handwritten digital images based on a memristor with random threshold switching behavior, which has important practical application value for solving a series of technical problems related to a high-performance, low-energy storage and computing integrated network architecture in the application field of handwritten digital image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a schematic diagram of the initial state and growth process of the conductive filaments in the device;
[0060] Figure 2 It is the relationship diagram between input voltage and switching probability obtained from experiments and simulations;
[0061] Figure 3 A schematic diagram of a random threshold switch model experiment and simulation provided by an embodiment of the present invention;
[0062] Figure 4 The middle is the device output result diagram of the experiment and simulation under the pulse test;
[0063] Figure 5 This is a schematic diagram of a spiking neural network for handwritten digit recognition based on a volatile memristor model;
[0064] Figure 6 It is the recognition result output by the classification pulse neural network system proposed in the present invention after inputting the image of the number "5";
[0065] Figure 7 It is a comparison of the accuracy of the traditional LIF neuron spiking neural network and the proposed new network architecture on the MNIST handwritten digit recognition task;
[0066] Figure 8 A schematic diagram of a handwritten digital image classification and recognition device based on a random threshold switching memristor proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.
[0068] like Figure 1 As shown, the present invention provides a handwritten digital image classification and recognition method based on a random threshold switching memristor, the method comprising:
[0069] Obtain a handwritten digital image classification and recognition dataset, normalize the grayscale values of the handwritten image and flatten it into a one-dimensional matrix, correspond the grayscale values to the pulse emission rate, and construct a Poisson encoder of the original channel of the corresponding handwritten digital image;
[0070] In order to realize the memristor model in the network, it is necessary to establish a one-dimensional dynamic Monte Carlo process to simulate the random dynamic process of particles in the internal system of the volatile memristor;
[0071] Based on the Monte Carlo process established above, a description method based on the atomic-level particle perspective is introduced, and the influence of ion migration dynamics on the device threshold switching behavior is considered to obtain a model of the random state transition time of particles;
[0072] Based on the model established above, by comparing the relationship between pulse characteristics and switch change characteristics, a differentiable distribution model of discrete events is derived, thereby realizing the required memristor device model, so that the model can predict the random behavior of the device at a lower computational cost;
[0073] Finally, according to the proposed device model, the Poisson encoder is connected to the neurons composed of the random threshold switch memristor model through synapses, and the output neurons output the recognition results corresponding to the handwritten image. A large-scale spiking neural network netlist is constructed, and the synaptic weights are iteratively trained so that the network system can complete the recognition and classification tasks of the handwritten digit set, showing better recognition accuracy and convergence than the traditional LIF neural network.
[0074] Specifically, construct a Poisson encoder corresponding to the handwritten digital image:
[0075] In order to realize the input and processing of handwritten digital image signals in the system, a multi-channel Poisson encoder corresponding to the handwritten digital image is considered here, where the pulse emission frequency of each channel corresponds to the grayscale value of the pixel in the image. The construction process of the multi-channel Poisson encoder is as follows:
[0076] The handwritten digit image with an input pixel size of 28 × 28 is flattened into a one-dimensional matrix of length 784, where the grayscale value of each pixel is normalized to a value between 0 and 1, corresponding to the average pulse firing rate of different pixels.
[0077] Since the number of pulses emitted within a period of time conforms to the Poisson distribution, a Poisson encoder that can restore the original data can be generated after random sampling of the average emission rate. The larger the gray value of a single pixel, the higher the pulse emission frequency of the corresponding channel. In addition, the longer the simulation time, the better the encoder restores the original image and the higher the simulation accuracy.
[0078] Specifically, establishing a random motion model of particles moving forward or backward includes:
[0079] Here we consider using random threshold switching memristors to realize the neuron structure in neural networks, and the implementation of the corresponding device model requires the establishment of models in multiple stages.
[0080] The resistance switching process of a memristor involves multiple physical processes. Metal atoms are oxidized to become mobile ions, which undergo forward or backward transitions to the other side of the electrode and are reduced. In addition, due to surface diffusion effects, clusters may form in the dielectric. The basic structure of the device is as follows: Figure 1 As shown in the figure, the left side shows the initial state of the conductive filaments in the device, and the right side shows the growth process of the conductive filaments. For the simplicity of the intensive model, the two influencing factors of charge transfer and ion diffusion / drift are mainly considered here, and the corresponding formula is decomposed into oxidation process and reduction process, so that the model can more accurately reflect the actual situation.
[0081] In this model, the metal atoms oxidize or restore The rate is calculated using the following formula:
[0082]
[0083] Among them, v r is the constant term used for redox rate fitting, E r is the activation energy, α is the charge transfer coefficient, V T is the threshold voltage in DC test, T is the local temperature of the device, k B is the Boltzmann constant, q is the charge per unit electron, and V is the voltage applied across the device.
[0084] The transition of metal ions in the dielectric layer will lead to the growth and breakage of metal wires, and the rate of the forward or reverse transition process of metal ions can be calculated by the following formula:
[0085]
[0086] Among them, v h is the vibration frequency, E h is the transition barrier height in the dielectric. The effect of the residual nanoclusters on the transition barrier is U l It can be calculated by this formula:
[0087]
[0088] Among them, l c is the equivalent length of the residual nanocluster, R c is the influence radius of the nanocluster on the electric potential field, w0 is the influence amplitude of the nanocluster on the electric potential field, and l is the length of the current conductive filament. The local electric field influence factor γ representing the transition barrier g It can be calculated by the following formula:
[0089] γ g =γ0-γ3g 3 ,
[0090] Among them, γ0 and γ3 are fitting parameters, and g is the gap between the conductive filament and the electrode on the other side.
[0091] The intensive model for obtaining the random transition time of particle states includes:
[0092] Under DC test, when the threshold voltage V is applied T When the conductive filament just starts to grow, or a holding voltage V is applied H When the conductive filament just begins to break, the volatile memristor reaches a balanced state, and it is easy to know that the internal relationship satisfies:
[0093]
[0094] According to the equilibrium state expression, substituting the specific expression of the forward / backward transition rate, the following relationship can be obtained:
[0095] γ(g max )V T =U(Lg max ),g max =Ll c ,
[0096] and γ(g min )V H =U(Lg min ),g min =0,
[0097] Where L is the thickness of the dielectric layer, g max is the length of the gap when the conductive filaments begin to grow, g min is the length of the gap when the conductive filament just begins to break.
[0098] When using one-dimensional dynamic Monte Carlo to describe the dynamic process of the system, when the particle state changes, we believe that the following relationship is satisfied:
[0099]
[0100] Among them, t′ is the time when the particle state transition occurred for the last time, and u is the uniform distribution. A random variable sampled from For any possible state transition, in the present invention, Represents the direction of state transition that may occur in the current state of the particle. For example, when the particle is in the redox stage, When the particles are oxidized but at the interface, When the particles are oxidized but in the dielectric layer, This allows us to model the random state transition time of particles.
[0101] Models that derive differentiable distributions of discrete events include:
[0102] Assuming that n0 is the critical number of forward transitions required for the device to turn on, the number of forward transitions required for the device to turn on minus the number of reverse transitions is greater than n0, so the probability of turning on the device when it is turned off is:
[0103]
[0104] Where Γ is the upper incomplete gamma function, N + is the number of positive transitions, N _ is the number of reverse transitions, n0 is the critical number of forward transitions required for the device to turn on, λ + Represents the expected number of positive transitions in a single cycle (Δt) λ - Represents the expected number of reverse transitions in a single cycle
[0105] Similarly, the turn-off probability when the device is turned on satisfies:
[0106] p reset =Pr{N - >N + +n1},
[0107] Where n0 is the critical reverse transition number required for the device to shut down. Figure 2 It is the relationship diagram between input voltage and device switching probability obtained from experiments and simulations.
[0108] At this point, if the overall performance of the device in a single pulse cycle is taken as the research object, the uniform distribution can be transformed into a geometric distribution using the reparameterization technique:
[0109]
[0110] Where u satisfies uniform distribution p depends on the current device state. If the device is off, we choose p fire , otherwise select p reset , the resulting ΔT represents the time interval required for the next device switch to occur (in units of pulses), where ΔT follows a geometric distribution. The relationship between the transition of the device switch state and time and external stimulus can be obtained:
[0111] δ t =(tt ′ )-ΔT,
[0112]
[0113] Where t is the current time, t ′ is the time when the device status last changed, m t It is a binary state conversion mask. If it is 1, it means that the current switch state needs to be reversed, otherwise it remains the same.
[0114] At this time, the substitute gradient method is used to estimate the state transition mask m t The derivative with respect to the sampling time interval ΔT is:
[0115]
[0116] Among them, m t Equal to the value of δ t The step function is replaced by SigmoidSpike. The switching state of the device can be expressed as:
[0117] s t+1 =(1-s t )·m t +s t ·(1-m t ),
[0118] Among them, s = 1 means that the device is in the on state, and s = 0 means that the device is in the off state. At this time, all steps of modeling random switching events can backpropagate gradients. Therefore, the constructed memristor device model can be used as a basic differentiable computing module in the neural network to participate in the optimization.
[0119] Model verification and experiments:
[0120] Here, we use experiments to verify the compact model of random threshold switch devices. The specific implementation method is to simulate the working environment of the memristor in the laboratory and use actual data to verify the correctness of the model. Here, the model is verified by experimental data under different test conditions, and the simulation results are consistent with the experimental data.
[0121] like Figure 3 As shown, this embodiment performs 50 cycles of triangular wave experiments and simulations, where (a) (c) are experimental results, (b) (d) are simulation results, (a) (b) are current-voltage curves of single-turn switches of the device under triangular wave voltage sweep test, and (c) (d) are statistical results of device turn-on time under pulse test;
[0122] Random switching behavior can be observed. Since two integral processes are considered in the model of this embodiment, one is the redox reaction and the other is the ion transition, the total integral time is dominated by the slowest process. Considering the use of these two processes to fit the model parameters and simulating the switching behavior with the ideal case and the KMC compact model, it can be seen that the experimental data in (c) and the simulation results in (d) are similar. Figure 4 As shown, under the pulse test conditions, neuronal firing and inhibition behaviors similar to those in the model and the experiment can be observed.
[0123] After experimental testing and data collection, we verified that the random threshold switching model used in the present invention is not only accurate and effective, but also can reveal the close relationship between the threshold switching behavior and the threshold voltage and integration time in the memristor, and has a low computational overhead.
[0124] Model-based spiking neural network architecture construction and optimization:
[0125] Based on the random threshold switch device model and Poisson encoder mentioned in the present invention, a neural network for handwritten digit classification tasks can be constructed. Figure 5 The constructed spiking neural network system based on the random threshold switch model is demonstrated. The network structure implemented here is a two-layer fully connected spiking neural network of 784×128×10. The random threshold switch model proposed in the present invention acts as a neuron in the fully connected spiking neural network. By selecting appropriate system internal parameters through network training, the network can achieve the classification task of the MNIST handwritten digit data set.
[0126] The specific implementation method is to connect the Poisson encoder to the neurons composed of the random threshold switch memristor model through synapses, and the output neurons output the recognition results corresponding to the handwritten image. The input of the first layer in the implemented pulse neural network structure is the 784-channel Poisson encoder corresponding to the original image, and the input is connected to 128 neurons composed of the random switch threshold model through synapses; the 10 output neurons in the second layer correspond to the recognition results of the handwritten numbers 0 to 9 respectively. The neuron with the highest pulse emission frequency in the output layer is identified as the classification result of the network. After inputting the handwritten number "5", the output result is as follows Figure 6 As shown in the figure, it can be seen that the output neuron pulse emission frequency corresponding to the number "5" is the highest, and the system recognizes the input number as the number "5", and the recognition is successful.
[0127] After obtaining the circuit netlist of the neural network, it is necessary to determine the appropriate parameters in the system in order to obtain the optimal operating point of the system and show the expected high recognition accuracy and low power consumption. Therefore, the process of training the handwritten digit image recognition network is the process of optimizing the synaptic weights in the system.
[0128] The main optimization process includes inputting the training data set into the randomly initialized neural network through a Poisson encoder, and determining the loss function value according to the classification results output by the neural network.
[0129] The loss function uses the mean square error function. The quality of the model is measured by calculating the square of the error between the predicted pulse emission rate output by the neural network and the expected pulse emission rate. Assuming that the closer the predicted value is to the true value, the smaller the mean square error between the two.
[0130] At this time, the obtained results are used to update the synaptic weights in the neural network, where the rule for updating the weights is the Adam optimization algorithm, and the updated neural network parameters are used as the weights of the new neural network to be trained, and the training data set is re-input into the neural network to be trained for a new round of training.
[0131] Here, the preset condition is that the output accuracy does not improve for five consecutive cycles, and the above training steps are repeated until the performance improvement of the updated neural network on the test set is less than our preset condition, then the training is stopped. Here, the spiking neural network implemented using the traditional LIF neuron model is compared with the network system implemented by the present invention. Figure 7 As shown, in comparison, the pulse neural network proposed in the present invention converges faster and achieves higher classification accuracy on the handwritten digit test set.
[0132] Corresponding to the aforementioned embodiment of a method for classifying and recognizing handwritten digital images based on a random threshold switching memristor, the present invention further provides an embodiment of a device for classifying and recognizing handwritten digital images based on a random threshold switching memristor.
[0133] See also Figure 8 An embodiment of the present invention provides a handwritten digital image classification and recognition device based on a random threshold switching memristor, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement a handwritten digital image classification and recognition method based on a random threshold switching memristor in the above embodiment.
[0134] An embodiment of a handwritten digital image classification and recognition device based on a random threshold switch memristor provided by the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located reading the corresponding computer program instructions in the non-volatile memory into the internal memory for execution. From a hardware perspective, if Figure 8As shown in FIG. 1 , a hardware structure diagram of a handwritten digital image classification and recognition device based on a random threshold switch memristor provided by the present invention is provided in any device with data processing capability, except Figure 8 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0135] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0136] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0137] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, a handwritten digital image classification and recognition method based on a random threshold switching memristor in the above embodiment is implemented.
[0138] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0139] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the method for classifying and recognizing handwritten digital images based on random threshold switching memristors is implemented.
[0140] Those skilled in the art will readily appreciate other embodiments of the present application after considering the description and practicing the contents disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The description and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0141] It should be understood that the above general description and the detailed description below are only exemplary and explanatory and cannot limit the present application. The present application is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the attached claims.
[0142] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A handwritten digital image classification and recognition method based on random threshold switching memristor, characterized in that: The method comprises the following steps: Obtain a handwritten digital image classification and recognition dataset, normalize the grayscale values of the handwritten digital image and flatten it into a one-dimensional matrix, and construct a Poisson encoder corresponding to the original channel of the digital image; Construct a spiking neural network for handwritten digit image classification and recognition. Connect the Poisson encoder to the neurons composed of random threshold switch memristor model through synapses, and output the recognition result corresponding to the handwritten image through the output neuron. The construction of the random threshold switch memristor model includes: establishing a random motion model of particles moving forward or backward, using one-dimensional dynamic Monte Carlo to describe the dynamic process of the system according to the equilibrium state of the memristor and the random motion model of the particles, establishing an intensive model of the random conversion time of the particle state, deriving a differentiable distribution model of discrete time, characterizing the relationship model between the transition of the switching state of the memristor and time and external stimulation, and obtaining the required memristor component model; The dataset is used to train the spiking neural network for handwritten digit image classification and recognition; The handwritten digit image is flattened and input into the trained handwritten digit image classification and recognition pulse neural network to obtain the handwritten digit image classification and recognition result.
2. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 1 is characterized in that: The number of pixels after the handwritten digital image is flattened into a one-dimensional matrix is consistent with the number of Poisson encoder channels in the handwritten digital image classification and recognition pulse neural network, and the grayscale of the pixels is normalized to a value between 0 and 1, corresponding to the average pulse emission rate of each channel.
3. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 1 is characterized in that: The handwritten digit image classification and recognition spiking neural network is a multi-layer fully connected spiking neural network, the input of the first layer is a Poisson encoder corresponding to the original image, and the input is connected to neurons composed of a random switch threshold model through synapses; the 10 output neurons of the last layer correspond to the recognition results of handwritten digits 0 to 9 respectively; the neuron with the highest pulse emission frequency in the output layer is identified as the classification result of the network.
4. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 1 is characterized in that: The establishment of a random motion model for the forward or reverse motion of particles specifically includes: Metal Atom Oxidation or restore The rate is calculated using the following formula: Among them, v r is the constant term used for redox rate fitting, E r is the activation energy, α is the charge transfer coefficient, V T is the threshold voltage in DC test, T is the local temperature of the device, k B is the Boltzmann constant, q is the charge per unit electron, and V is the voltage applied across the device; The rate of the metal ion forward or reverse transition process is calculated by the following formula: Among them, v h is the vibration frequency, E h is the transition barrier height in the dielectric, where the residual nanoclusters have an influence on the transition barrier U l Calculated by this formula: Among them, l c is the equivalent length of the residual nanocluster, R c is the influence radius of the nanocluster on the electric potential field, w0 is the influence amplitude of the nanocluster on the electric potential field, l is the length of the current conductive filament; and the local electric field influence factor γ representing the transition barrier g Calculated by the following formula: c g =γ0-γ3g 3 Among them, γ0 and γ3 are fitting parameters, and g is the gap between the conductive filament and the electrode on the other side.
5. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 4 is characterized in that: The intensive model for establishing the random transition time of particle states specifically includes: The equilibrium state of the volatile memristor is: DC test when the threshold voltage V is applied T When the conductive filament just starts to grow, or a holding voltage V is applied H When the conductive filament just begins to break, the expression is as follows: According to the equilibrium state expression, substituting the specific expression of the forward / backward transition rate, the following relationship is obtained: γ(g max )V T =U(L - g max ), g max =L - l c , and γ(g min )V H =U(L - g min ), g min =0, Where L is the thickness of the dielectric layer, g max is the length of the gap when the conductive filaments begin to grow, g min is the length of the gap when the conductive filament just begins to break; One-dimensional dynamic Monte Carlo is used to describe the dynamic process of the system: the internal relationship when the particle state changes is as follows: Among them, t′ is the time when the particle state transition occurred for the last time, and u is the uniform distribution. A random variable sampled from The state transitions that can occur include: Represents the state transition direction of the particle in the current state. When the particle is in the redox stage, When the particles are oxidized but at the interface, When the particles are oxidized but in the dielectric layer, This results in a model of the random state transition time of particles.
6. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 5 is characterized in that: The derived discrete event differentiable distribution model includes: n0 is the critical number of forward transitions required for the device to turn on. When the device is turned off, the number of forward transitions required for the particle to turn on minus the number of reverse transitions is greater than n0, and the turn-on probability when the device is turned off is: p fire =Pr{N + >N - +n0} Where Γ is the upper incomplete gamma function, N + is the number of forward transitions, N_ is the number of reverse transitions, n0 is the critical number of forward transitions required for the device to turn on, λ + represents the expected number of positive transitions in a single cycle, λ- represents the expected number of reverse transitions in a single cycle, The shutdown probability when the device is turned on satisfies: p reset =Pr{N - >N + +n1}, Where n0 is the critical reverse transition number required for the device to shut down; The overall performance of the device in a single pulse cycle is studied, and the uniform distribution is transformed into a geometric distribution using the reparameterization technique: Where u satisfies the uniform distribution u(0,1), and p depends on the current device state. If the device is turned off, we choose p fire , otherwise select p reset , the resulting ΔT represents the time interval required for the next device switch to occur, where ΔT follows a geometric distribution; the relationship between the transition of the device switch state and time and the external stimulus is obtained: δ t =(t-t′)-ΔT, Where t is the current time, t′ is the time when the device status last changed, and m t It is a binary state conversion mask. If it is 1, it means that the current switch state needs to be reversed, otherwise it remains the same. Use the surrogate gradient method to estimate the state transition mask m t The derivative with respect to the sampling time interval ΔT is: Among them, m t Equal to the value of δ t The step function is replaced by SigmoidSpike. The switching state of the device is expressed as: s t+1 =(1-s t )·m t +s t ·(1-m t ), Among them, s=1 means that the device is in the on state, and s=0 means that the device is in the off state; at this time, all steps of modeling random switching events can backpropagate gradients.
7. The handwritten digital image classification and recognition method based on random threshold switching memristor according to claim 1 is characterized in that: The training of the pulse neural network for handwritten digit image classification and recognition using the data set is specifically as follows: The training end condition is preset, the training data set is input into the initialized neural network, and the loss function value is determined according to the result output by the neural network to update the synaptic parameters in the neural network; the updated neural network parameters are used as the parameters of the new neural network to be trained, and the training data set is re-input into the neural network to be trained, and the above training steps are repeated until the performance improvement of the updated neural network on the test set is less than the preset condition, then the training is stopped.
8. A handwritten digital image classification and recognition device based on random threshold switch memristor, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the processor executes the executable code, a handwritten digital image classification and recognition method based on a random threshold switching memristor as described in any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, a handwritten digital image classification and recognition method based on a random threshold switching memristor as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
ESN neural network image classification processing method based on memristor
CN111553415A
Probability artificial synaptic unit, 1T1R array structure and neural network information identification method
CN114169509A
Gas recognition method based on memristor random calculation lightweight convolutional neural network
CN116578906A
Cited By
Method for reducing memristor noise based on random pulse sequence
CN119811451A
SNN dynamic PET image processing method based on memristor array
CN120694669A
High-precision dynamic memristor model and application method thereof
CN120808843A
