A model optimization method, device, medium and equipment based on slow-wave sleep

By converting the artificial neural network into a pulsed neural network and simulating the oscillation activity of slow wave sleep, adjusting the network weight, the problem of model overfitting and insufficient robustness is solved, and the accuracy and noise resistance of the model are improved.

CN116739058BActive Publication Date: 2025-08-26ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310738684.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2025-08-26
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

The existing artificial neural network models have problems such as overfitting and insufficient robustness during training, resulting in limited model accuracy and inability to meet the growing business needs.

Method used

The artificial neural network model is converted into a pulsed neural network model, and the network weight is adjusted using pulse time-dependent synaptic plasticity to optimize model parameters by simulating the oscillating activity and rhythmic patterns of slow wave sleep.

Benefits of technology

It alleviates the problem of overfitting the model, improves the robustness and accuracy of the model, and enhances the anti-interference ability of the model in a noisy environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116739058B_ABST
    Figure CN116739058B_ABST
Patent Text Reader

Abstract

This specification discloses a model optimization method, apparatus, medium, and device based on slow-wave sleep. The method includes: obtaining model data of a model to be optimized, converting the model to be optimized into a spiking neural network model; performing slow-wave sleep simulation on the spiking neural network model, wherein the slow-wave cycle is divided into a rising phase and a falling phase, wherein each neuron node in the spiking neural network model emits pulses at a first frequency during the rising phase of each slow-wave cycle and emits pulses at a second frequency during the falling phase of each slow-wave cycle, wherein the second frequency is less than the first frequency; updating the connection weights between each neuron node according to the pulse emission sequence corresponding to each neuron node in the spiking neural network model to obtain updated weights; and converting the spiking neural network model into an artificial neural network model according to the updated weights to obtain an optimized model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method, device, medium, and equipment for model optimization based on slow-wave sleep. Background Art

[0002] With the development of machine learning technology, artificial neural networks (ANNs) have been widely used in fields such as computer vision and natural language processing, and have achieved many achievements.

[0003] However, the current training process of artificial neural network models still suffers from problems such as overfitting and insufficient robustness, which limits the accuracy of the model and prevents further improvement, making it difficult to meet growing business needs.

[0004] Therefore, how to reduce model overfitting while improving the robustness of the model, enhancing the knowledge learned during model training, and further improving model accuracy is an urgent problem to be solved. Summary of the Invention

[0005] This specification provides a model optimization method, device, medium and equipment based on slow-wave sleep to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This manual provides a model optimization method based on slow-wave sleep, including:

[0008] Obtaining model data of a model to be optimized, wherein the model to be optimized is an artificial neural network model;

[0009] Converting the model to be optimized into a spiking neural network model according to the model data;

[0010] Performing slow-wave sleep simulation on the spiking neural network model, dividing each slow-wave cycle of the slow-wave sleep of the spiking neural network model into a rising phase and a falling phase, wherein neuronal nodes in each layer of the spiking neural network model emit pulses at a first frequency during the rising phase of each slow-wave cycle and emit pulses at a second frequency during the falling phase of each slow-wave cycle, wherein the second frequency is less than the first frequency;

[0011] updating the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the spiking neural network model to obtain updated weights;

[0012] According to the updated weights, the pulse neural network model is converted into an artificial neural network model to obtain an optimized model.

[0013] Optionally, before obtaining the model data of the model to be optimized, the method further includes:

[0014] Get the target model;

[0015] The target model is trained, and the trained target model is used as the model to be optimized.

[0016] Optionally, the method further includes:

[0017] At any unit time, for each layer of neuron nodes except the neuron nodes in the input layer of the spiking neural network model, the membrane potential corresponding to the neuron node is updated according to the pulse output by the neuron node of the previous network layer that has an information transmission relationship with the neuron node of the layer, the connection weight between the neuron node and the neuron node of the previous network layer, the preset scaling factor corresponding to the neuron node of the layer, and the slow wave stage of the slow wave cycle in which the unit time is located;

[0018] If the membrane potential corresponding to the neuron node exceeds the preset pulse threshold, a pulse will be sent to the neuron node in the next network layer that has an information transmission relationship with the neuron node. The pulse sending of the neuron nodes in each layer is iteratively advanced according to each unit time.

[0019] Optionally, for each slow wave cycle of slow wave sleep performed by the spiking neural network model, the slow wave cycle is divided into a rising phase and a falling phase, specifically including:

[0020] The scaling factors corresponding to the neuron nodes of each layer are adjusted so that the pulse emission frequency corresponding to the rising phase of each slow wave cycle of the neuron nodes of each layer remains at the first frequency, and the first frequency is determined based on the pulse emission frequency when the biological brain is in a slow wave sleep state.

[0021] Optionally, updating the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the spiking neural network model to obtain the updated weights specifically includes:

[0022] For each neuron node in the pulse neural network model, if a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse after the neuron node, the connection weight between the neuron node and the neuron node in the next network layer is increased.

[0023] Optionally, updating the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the spiking neural network model to obtain the updated weights specifically includes:

[0024] For each neuron node in the pulse neural network model, if a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse before the neuron node, the connection weight between the neuron node and the neuron node in the next network layer is reduced.

[0025] Optionally, updating the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the spiking neural network model to obtain the updated weights specifically includes:

[0026] For each neuron node in the spiking neural network model, obtaining a connection weight between the neuron node and a neuron node in a next network layer that has an information transmission relationship with the neuron node during the previous unit time;

[0027] Determining a weight adjustment value according to the connection weight of the previous unit time and the difference between the pulse emission time corresponding to the neuron node and the pulse emission time corresponding to the neuron node in the next network layer;

[0028] The connection weight of the previous unit time is updated according to the weight adjustment value to obtain the updated weight.

[0029] This specification provides a model optimization device based on slow-wave sleep, including

[0030] An acquisition module acquires model data of a model to be optimized, where the model to be optimized is an artificial neural network model;

[0031] A conversion module, which converts the model to be optimized into a spiking neural network model according to the model data;

[0032] a sleep module that simulates slow-wave sleep on the spiking neural network model, and divides each slow-wave cycle of the slow-wave sleep of the spiking neural network model into a rising phase and a falling phase, wherein the neuron nodes of each layer in the spiking neural network model emit pulses at a first frequency during the rising phase of each slow-wave cycle and emit pulses at a second frequency during the falling phase of each slow-wave cycle, wherein the second frequency is less than the first frequency;

[0033] An updating module updates the connection weights between the neuron nodes according to the pulse emission sequence corresponding to the neuron nodes in the spiking neural network model to obtain updated weights;

[0034] The optimization module converts the pulse neural network model into an artificial neural network model according to the updated weights to obtain an optimized model.

[0035] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned slow-wave sleep-based model optimization method.

[0036] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned slow-wave sleep-based model optimization method is implemented.

[0037] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0038] In the model optimization method based on slow wave sleep provided in this specification, model data of the model to be optimized is obtained, and the model to be optimized is converted into a pulse neural network model; slow wave sleep simulation is performed on the pulse neural network model, and the slow wave cycle is divided into a rising phase and a falling phase, wherein each neuron node in the pulse neural network model emits pulses at a first frequency in the rising phase of each slow wave cycle, and emits pulses at a second frequency in the falling phase of each slow wave cycle, and the second frequency is less than the first frequency; according to the pulse emission sequence corresponding to each neuron node in the pulse neural network model, the connection weights between each neuron node are updated to obtain updated weights, and according to the updated weights, the pulse neural network model is converted into an artificial neural network model to obtain an optimized model.

[0039] It can be seen from the above method that this scheme can convert the target model into a pulse neural network model, and update the parameters of the target model by simulating slow-wave sleep on the pulse neural network model, thereby alleviating the overfitting problem of the target model during the training process. In the descending phase of the slow-wave cycle, each neuron emits pulses at a lower frequency, and in the rising phase, each neuron emits pulses at a higher frequency, thereby realizing the simulation of the oscillatory activity and rhythmic pattern of brain neurons in the slow-wave sleep state, thereby consolidating and optimizing the model parameters, improving the robustness of the model, and further improving the model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:

[0041] Figure 1This is a flowchart of a slow-wave sleep-based model optimization method provided in this specification;

[0042] Figure 2 A schematic diagram of an update process of a spiking neural network model provided in this specification;

[0043] Figure 3 A schematic diagram of a slow-wave sleep-based model optimization device provided in this specification;

[0044] Figure 4 This manual provides a corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0045] To make the objectives, technical solutions, and advantages of this specification more clear, the following will clearly and completely describe the technical solutions of this specification in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this specification.

[0046] The technical solutions provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0047] Figure 1 This is a flow chart of a slow-wave sleep-based model optimization method provided in this specification, comprising the following steps:

[0048] S101: Acquire model data of a model to be optimized, where the model to be optimized is an artificial neural network model.

[0049] S102: Converting the model to be optimized into a pulse neural network model according to the model data.

[0050] The human brain can still make robust decisions under limited or noisy stimulus conditions, indicating that combining neural networks with brain-inspired or biologically constrained computing mechanisms can improve network robustness. Neurobiological research has shown that sleep plays an important role in memory consolidation in the biological brain. During deep sleep, neurons in the brain produce complex oscillatory activity and rhythmic patterns. The slow wave state in deep sleep is divided into a down state and an up state. In the down state, neurons in the brain are less active, while in the up state, neurons in the brain have short high-frequency discharges. These patterns play a role in memory consolidation.

[0051] Based on this, this specification provides a model optimization method based on slow-wave sleep. By converting the artificial neural network model into a spiking neural network model to simulate the oscillatory activity and rhythmic pattern of the human brain during slow-wave sleep, the network weights are adjusted according to spike timing dependent synaptic plasticity (STDP). In this way, during the slow-wave sleep simulated by the spiking neural network, the synergistic characteristics of slow waves and their influence on network synaptic plasticity are combined to achieve biomimetic memory consolidation function and resource utilization efficiency.

[0052] In this specification, the execution entity for implementing the slow-wave sleep-based optimization method can be a designated device such as a server. For the sake of convenience of description, this specification only takes the server as the execution entity as an example to illustrate an optimization method based on slow-wave sleep provided in this specification.

[0053] Among them, the server can train the target model in advance. Since overfitting problems may occur during the model training process and its robustness is relatively low, the server can use the trained target model as the model to be optimized to optimize it.

[0054] It should be noted that the model to be optimized can be an artificial neural network (ANNs) model. The application scenarios of the optimized target model can be diverse, including image recognition, natural language processing, information recommendation, etc. This manual does not make specific limitations on this.

[0055] After the target model is trained, the server can obtain the model data of the model to be optimized, and then the server can convert the model to be optimized into a spiking neural network (SNN) model based on the model data.

[0056] Specifically, the server can construct each neuron node in the spiking neural network model using Leaky Integrate and Fire (LIF) type neurons. Each neuron node in the spiking neural network model corresponds to each computational node in the model to be optimized (ANNs). The relationship between the membrane potential of each neuron node and time can be expressed as:

[0057]

[0058] Among them, u rest is the initial membrane potential, u(t) is the membrane potential corresponding to time t, I(t) is the current input corresponding to time t, τ m is the preset time parameter, Rm is the preset resistance parameter. In this specification, τ m =10ms, R m =10MΩ.

[0059] For each connection in the artificial neural network, there is also a corresponding connection in the spiking neural network. The server can assign an initial membrane potential value and a pulse threshold to all neuron nodes in the spiking neural network model. In this specification, the initial membrane potential u rest and pulse threshold u thresh Set to u respectively rest =-75mV, u thresh =-55mV.

[0060] In practical applications, the neuron nodes in the input layer (starting layer) of the pulse neural network model can generate a pulse time series through Poisson distributed neural activity based on the activation level of each neuron node in the model to be optimized after training. The pulse value corresponding to each time unit in the pulse time series can be expressed as 1 or 0, that is, a pulse is emitted or not.

[0061] The neuron nodes in other network layers, except for the input layer, can receive the pulses emitted by the neuron nodes in the previous network layer and scale the integrated network connection weights and the inner product emitted by the upper layer neuron nodes by the scaling factor. The current input of the neuron node receiving the pulse integration can be expressed as:

[0062]

[0063] Among them, I(t) is the current input of the neuron node receiving the pulse integration at time t, is the pulse time series (0 / 1) emitted by the neuron node in the previous layer at time t, W(t) is the network connection weight at time t, and a is the preset scaling factor used to Scaling is performed so that the neuron node can receive all the information input by the upper neuron node.

[0064] In the feedforward process of the spiking neural network model, each neuron node can integrate the input it receives into its current membrane potential according to the weight. When the membrane potential exceeds the pulse threshold (-55mV), it will emit a pulse and reset the membrane potential to the initial membrane potential (-75mV) at the same time.

[0065] S103: Performing slow wave sleep simulation on the pulse neural network model, dividing each slow wave cycle of the slow wave sleep of the pulse neural network model into a rising phase and a falling phase, wherein the neuron nodes of each layer in the pulse neural network model emit pulses at a first frequency in the rising phase of each slow wave cycle, and emit pulses at a second frequency in the falling phase of each slow wave cycle, wherein the second frequency is less than the first frequency.

[0066] In this specification, the server can perform slow-wave sleep simulation on the neural network model, that is, simulate the oscillatory activity and rhythmic pattern of the human brain during slow-wave sleep.

[0067] In the process of simulating slow-wave sleep of the neural network model, its slow-wave sleep process includes multiple slow-wave cycles. For each slow-wave cycle of the pulse neural network model performing slow-wave sleep, the server can divide the slow-wave cycle into two slow-wave stages, namely the up state stage and the down state stage. In this specification, the duration of the up state stage and the duration of the down state stage can be the same, and the two stages are performed alternately.

[0068] Among them, the slow wave frequency corresponding to the above-mentioned slow wave sleep can be set to 1Hz. For the rising stage of each slow wave cycle, each neuron node in the pulse neural network model can maintain a high degree of activity and emit pulses at a higher first frequency. Among them, the neuron nodes in the input layer of the pulse neural network model emit pulses based on the above-mentioned pulse time series, and the neuron nodes in other network layers emit pulses along with the neuron nodes in the preceding network layer.

[0069] During the descending phase of each slow wave cycle, each neuron node can maintain a relatively low activity level and emit a small number of pulses at a relatively low second frequency.

[0070] It should be noted that the first frequency and the second frequency are both frequencies of pulse emission, and the first frequency is much greater than the second frequency. In this specification, the first frequency can be set to 4 Hz, and the second frequency can be set to less than 0.02 Hz.

[0071] Of course, in this manual, the server can also simulate the awake state of the human brain through a pulse neural network model to compare with the above-mentioned slow-wave sleep state. In this awake state, the neuron nodes in each layer emit pulses at a pulse emission frequency of 2.5 Hz.

[0072] In the slow-wave sleep state, at any unit time, for each neuron node in the spiking neural network model except the input layer, the server can update the current input of the integrated pulses received by the neuron node based on the pulses output by the neuron node of the previous network layer that has an information transmission relationship with the neuron node of this layer, the connection weight between the neuron node of this layer and the neuron node of the previous network layer, the preset scaling factor corresponding to the neuron node, and the slow-wave phase of the slow-wave cycle in which the unit time is located. The integrated current of the neuron node can be expressed as:

[0073]

[0074] Where I(t) is the current input of the integrated pulse received by the neuron node at time t in the slow-wave sleep state. is the pulse time series emitted by the neuron node in the previous layer at time t, W(t) is the connection weight of the network at time t, a is the scaling factor, [sign(z)] + is a rectifier function that returns 1 when sin(2πt / T) is greater than 0 and 0 otherwise. This function determines the slow wave phase of the slow wave cycle for each unit time t. 1 / T represents the slow wave frequency corresponding to slow wave sleep, which determines the duration of a single slow wave cycle and can be set to 1Hz in this manual. q represents the noise term, which follows a uniform distribution from -b to b, as defined by U(-b, b), where b is the noise parameter.

[0075] For each neuron node, the server can update the membrane potential corresponding to the neuron node based on the current input of the integrated pulse received by the neuron node. If the membrane potential corresponding to the neuron node exceeds the preset pulse threshold (-55mV), a pulse will be sent to the next layer of neuron nodes that have an information transmission relationship with the neuron node, and the membrane potential will be reset to the initial membrane potential (-75mV). Otherwise, no pulse will be sent. The pulse issuance of each layer of neuron nodes is iteratively advanced in sequence according to each unit time.

[0076] Furthermore, in this specification, each neuron node in each network layer corresponds to a scaling factor, and the server can adjust the scaling factors and noise parameters corresponding to the neuron nodes in each layer so that the pulse emission frequency corresponding to the rising phase of each slow wave cycle of the neuron nodes in each layer remains at a first frequency. The first frequency is determined based on the pulse emission frequency when the biological brain is in a slow-wave sleep state, thereby adjusting the network pulse emission rate to the biological brain standard.

[0077] S104: According to the pulse emission sequence corresponding to each neuron node in the pulse neural network model, the connection weights between the neuron nodes are updated to obtain updated weights.

[0078] S105: Converting the pulse neural network model into an artificial neural network model according to the updated weights to obtain an optimized model.

[0079] The server can update the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the pulse neural network model.

[0080] For example, the server may adjust the connection weights based on spike timing dependent synaptic plasticity (STDP).

[0081] Specifically, the server can monitor the pulse emission status of each neuron node at each time unit. Based on the direction of information transmission in the weight feedforward, the presynaptic and postsynaptic neurons are determined. When the postsynaptic neuron's firing follows the presynaptic neuron's firing, the weight increases. Conversely, when the presynaptic neuron's firing follows the postsynaptic neuron's firing, the weight decreases.

[0082] In other words, for each neuron node in the pulse neural network model, if a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse after the neuron node, the connection weight between the neuron node and the next neuron node is increased.

[0083] If a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse before the neuron node, the connection weight between the neuron node and the neuron node in the next network layer is reduced.

[0084] Furthermore, the weight adjustment value in the process of increasing or decreasing the weight can be determined based on the connection weight corresponding to the previous unit time and the difference between the pulse emission time of the neuron node and the pulse emission time of the neuron node in the next network layer (Δt = t post -t pre ) is determined, and the weight adjustment value can be expressed as:

[0085]

[0086] ε(w)=2·min(sigmoid(w),1-sigmoid(w))

[0087]

[0088] Where Δw ijis the weight adjustment value of the connection weight between the neuron node i and the neuron node j with a data transmission relationship, ε(w) represents the relationship that the degree of weight change also depends on the weight size itself. In this specification, A + =0.0103, A - =0.0051, τ + =14ms, τ - =34ms.

[0089] Then, after each monitoring of the pulse emission sequence corresponding to each neuron node, the server can update the connection weights between each neuron node based on the weight adjustment value determined by the above formula, obtain the updated weights, and determine the updated pulse neural network model. For ease of understanding, this specification provides a schematic diagram of the update process of the pulse neural network model, such as Figure 2 shown.

[0090] Figure 2 This is a schematic diagram of the update process of a pulse neural network model provided in this specification.

[0091] Among them, after the server completes the training in the awake state of the artificial neural network model, it converts it into a pulse neural network model. The horizontal line before each neuron node in the figure represents the pulse time series, the blank part represents that the pulse value corresponding to the time node in the pulse time series is 0 (ie, no pulse), and the vertical line represents the pulse value 1 (ie, there is a pulse). Then, based on the pulse emission corresponding to each neuron node, the connection weights between each neuron node can be updated.

[0092] When the slow-wave sleep simulation is completed (such as reaching a preset slow-wave cycle or reaching a specified simulation duration), the server can reconvert the updated pulse neural network model into an artificial neural network model to obtain an optimized model.

[0093] It should be pointed out that in the process of converting the weight-modified spiking neural network back to an artificial neural network, the server can use the updated weights corresponding to the spiking neural network model to directly change the feedforward mode of the spiking neural network information to the feedforward function of the artificial neural network (such as ReLu).

[0094] In addition, the server can further test the optimized model. During the test, the network classification ability can be tested by classifying 0 and 1 characters in the MNIST dataset. Gaussian noise is added to the images in the test set (the mean is 0 in this manual, and the variance ranges from 10 -1 to 10 2 ) and Gaussian blur (standard deviation is an integer from 1 to 10) to test the robustness of the model to the input.

[0095] After completing the optimization of the target model, the server can deploy the optimized model and input the business data into the optimized model after receiving it to execute the task.

[0096] For example, when the target model is an image recognition model, the server can input the image to be recognized into the deployed optimized model, recognize the image to be recognized through the optimized model, and output the image classification or image content (such as text in the image) corresponding to the image to be recognized.

[0097] It can be seen from the above method that this scheme can make the artificial neural network robust in a single classification task of a public dataset (such as the MNIST dataset) and has the ability to resist interference from both Gaussian noise and Gaussian blur of the input.

[0098] In addition, since the number of neuron nodes required by the pulse neural network and the number of time periods used for slow-wave sleep simulation are fixed, there is no need to consume a large amount of storage capacity according to different learning samples, nor is there a need to consume a large amount of computing power to adapt to the learning samples, thus achieving bionic level of resource utilization efficiency.

[0099] Moreover, the model optimization process of this solution is independent of the model learning process, so it can be freely combined with the current cutting-edge artificial intelligence algorithms to greatly enhance the consolidation effect and thus improve the network robustness.

[0100] The above is one or more implementation model deployment methods of this specification. Based on the same idea, this specification also provides a corresponding model optimization device based on slow wave sleep, such as Figure 3 shown.

[0101] Figure 3 A schematic diagram of a slow-wave sleep-based model optimization device provided in this specification, comprising:

[0102] An acquisition module 301 is used to acquire model data of a model to be optimized, where the model to be optimized is an artificial neural network model;

[0103] A conversion module 302 is configured to convert the model to be optimized into a spiking neural network model based on the model data;

[0104] The sleep module 303 is used to simulate slow wave sleep of the pulse neural network model, and for each slow wave cycle of the slow wave sleep of the pulse neural network model, the slow wave cycle is divided into a rising phase and a falling phase, wherein the neuron nodes of each layer in the pulse neural network model emit pulses at a first frequency in the rising phase of each slow wave cycle, and emit pulses at a second frequency in the falling phase of each slow wave cycle, wherein the second frequency is less than the first frequency.

[0105] An updating module 304 is configured to update the connection weights between the neuron nodes according to the pulse emission sequence corresponding to the neuron nodes in the spiking neural network model to obtain updated weights;

[0106] The optimization module 305 is used to convert the pulse neural network model into an artificial neural network model according to the updated weights to obtain an optimized model.

[0107] Optionally, before obtaining the model data of the model to be optimized, the acquisition module 301 is further used to obtain a target model; train the target model, and use the trained target model as the model to be optimized.

[0108] Optionally, the update module 304 is specifically used to, at any unit time, for each layer of neuron nodes except the neuron nodes in the input layer of the pulse neural network model, update the membrane potential corresponding to the neuron node according to the pulses output by the neuron nodes of the previous network layer that have an information transmission relationship with the neuron nodes of the layer, the connection weights between the neuron node and the neuron nodes of the previous network layer, the preset scaling factors corresponding to the neuron nodes of the layer, and the slow wave stage of the slow wave cycle in the unit time; if the membrane potential corresponding to the neuron node exceeds the preset pulse threshold, a pulse is emitted to the neuron nodes in the next network layer that have an information transmission relationship with the neuron node, and the pulse emission of the neuron nodes of each layer is iteratively advanced in sequence according to each unit time.

[0109] Optionally, the sleep module 303 is specifically used to adjust the scaling factors corresponding to the neuron nodes in each layer so that the pulse emission frequency corresponding to the rising phase of each slow wave cycle of the neuron nodes in each layer remains at a first frequency, and the first frequency is determined based on the pulse emission frequency when the biological brain is in a slow wave sleep state.

[0110] Optionally, the update module 304 is specifically used to, for each neuron node in the pulse neural network model, increase the connection weight between the neuron node and the neuron node in the next network layer if the neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse after the neuron node.

[0111] Optionally, the update module 304 is specifically used to, for each neuron node in the pulse neural network model, reduce the connection weight between the neuron node and the neuron node in the next network layer if the neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse before the neuron node.

[0112] Optionally, the updating module 304 is specifically used to obtain, for each neuron node in the pulse neural network model, the connection weight between the neuron node and the neuron node in the next network layer that has an information transmission relationship with the neuron node in the previous unit time; determine the weight adjustment value based on the connection weight of the previous unit time and the difference between the pulse emission time corresponding to the neuron node and the pulse emission time corresponding to the neuron node in the next network layer; update the connection weight of the previous unit time according to the weight adjustment value to obtain the updated weight

[0113] This specification also provides a computer-readable storage medium, which stores a computer program that can be used to execute the above Figure 1 A model optimization method based on slow-wave sleep is provided.

[0114] This manual also provides Figure 4 The one shown corresponds to Figure 1 Schematic diagram of the electronic equipment. Figure 4 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model optimization method based on slow-wave sleep. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0115] Improvements to a technology can be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with technological advancements, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always program the improved process flow into the hardware circuit to obtain the corresponding hardware circuit structure. Therefore, it cannot be said that a process flow improvement cannot be implemented using a hardware module. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0116] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0117] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0118] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0119] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0121] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0123] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0124] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0125] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0127] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.

[0129] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0130] The foregoing is merely an example of the present invention and is not intended to limit the present invention. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A model optimization method based on slow-wave sleep, characterized in that: include: Obtaining model data of a model to be optimized, wherein the model to be optimized is an artificial neural network model; Converting the model to be optimized into a spiking neural network model according to the model data; Slow-wave sleep simulation is performed on the spiking neural network model. For each slow-wave sleep cycle of the spiking neural network model, the slow-wave cycle is divided into a rising phase and a falling phase. The neuron nodes of each layer in the spiking neural network model emit pulses at a first frequency during the rising phase of each slow-wave cycle, and emit pulses at a second frequency during the falling phase of each slow-wave cycle, wherein the second frequency is less than the first frequency. The scaling factors corresponding to the neuron nodes of each layer are adjusted so that the pulse emission frequency corresponding to the rising phase of each slow-wave cycle of the neuron nodes of each layer remains at the first frequency, and the first frequency is determined based on the pulse emission frequency of the biological brain in a slow-wave sleep state. For each layer of neuron nodes except the neuron nodes in the input layer of the spiking neural network model, if the current membrane potential of the neuron node exceeds a preset pulse threshold, a pulse is emitted to the neuron nodes of the next network layer that have an information transmission relationship with the neuron node, and the pulse emission of the neuron nodes of each layer is iteratively advanced according to each unit time. updating the connection weights between the neuron nodes according to the pulse emission order corresponding to the connected neuron nodes in the spiking neural network model to obtain updated weights; Converting the spiking neural network model into an artificial neural network model according to the updated weights to obtain an optimized model; The optimized model is used to perform image recognition on the input image to be recognized.

2. The method according to claim 1, wherein Before obtaining the model data of the model to be optimized, the method further includes: Get the target model; The target model is trained, and the trained target model is used as the model to be optimized.

3. The method according to claim 1, wherein The method further comprises: At any unit time, for each layer of neuron nodes except the neuron nodes in the input layer of the pulse neural network model, the membrane potential corresponding to the neuron node is updated based on the pulses output by the neuron nodes of the previous network layer that have an information transmission relationship with the neuron nodes of this layer, the connection weight between the neuron node and the neuron nodes of the previous network layer, the preset scaling factor corresponding to the neuron nodes of this layer, and the slow wave stage of the slow wave cycle in which the unit time is located.

4. The method according to claim 1, wherein According to the pulse emission order corresponding to each neuron node connected in the spiking neural network model, the connection weights between each neuron node are updated to obtain the updated weights, specifically including: For each neuron node in the pulse neural network model, if a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse after the neuron node, the connection weight between the neuron node and the neuron node in the next network layer is increased.

5. The method according to claim 1, wherein According to the pulse emission order corresponding to each neuron node connected in the spiking neural network model, the connection weights between each neuron node are updated to obtain the updated weights, specifically including: For each neuron node in the pulse neural network model, if a neuron node in the next network layer that has an information transmission relationship with the neuron node emits a pulse before the neuron node, the connection weight between the neuron node and the neuron node in the next network layer is reduced.

6. The method according to claim 1, wherein According to the pulse emission order corresponding to each neuron node connected in the spiking neural network model, the connection weights between each neuron node are updated to obtain the updated weights, specifically including: For each neuron node in the spiking neural network model, obtaining a connection weight between the neuron node and a neuron node in a next network layer that has an information transmission relationship with the neuron node during the previous unit time; Determining a weight adjustment value according to the connection weight of the previous unit time and the difference between the pulse emission time corresponding to the neuron node and the pulse emission time corresponding to the neuron node in the next network layer; The connection weight of the previous unit time is updated according to the weight adjustment value to obtain the updated weight.

7. A model optimization device based on slow-wave sleep, characterized in that: include An acquisition module acquires model data of a model to be optimized, wherein the model to be optimized is an artificial neural network model; A conversion module, which converts the model to be optimized into a spiking neural network model according to the model data; a sleep module that simulates slow-wave sleep on the spiking neural network model, divides each slow-wave cycle of the slow-wave sleep of the spiking neural network model into a rising phase and a falling phase, and emits pulses at a first frequency in the rising phase of each slow-wave cycle and at a second frequency in the falling phase of each slow-wave cycle, wherein the second frequency is less than the first frequency; wherein the scaling factors corresponding to the neuron nodes of each layer are adjusted so that the pulse emission frequency corresponding to the rising phase of each slow-wave cycle of the neuron nodes of each layer remains at the first frequency, and the first frequency is determined based on the pulse emission frequency of the biological brain in a slow-wave sleep state; for each layer of neuron nodes except the neuron nodes in the input layer of the spiking neural network model, if the current membrane potential of the neuron node exceeds a preset pulse threshold, a pulse is emitted to the neuron nodes of the next network layer that have an information transmission relationship with the neuron node, and the pulse emission of the neuron nodes of each layer is iteratively advanced according to each unit time; An updating module updates the connection weights between the neuron nodes according to the pulse emission sequence corresponding to the neuron nodes in the spiking neural network model to obtain updated weights; An optimization module converts the pulse neural network model into an artificial neural network model according to the updated weights to obtain an optimized model, wherein the optimized model is used to perform image recognition on an input image to be recognized.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.