Image optimization classification method based on brain-like network model
By constructing an image optimization classification method based on brain-like network model, using pulsed neurons and improved feedback and inhibition connections, the robustness of image classification and Brain-Score scores are improved, and the problem of insufficient working principle of simulated biological neurons in the existing technology is solved.
Patent Information
- Application Number
- CN202310553246.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-05-17
AI Technical Summary
Existing artificial intelligence models are difficult to simulate the working principle of biological neurons, resulting in less robustness in image classification.
A image optimization classification method based on brain-like network model is constructed, and a pulsed neuron model is adopted, combined with Poisson encoding, improved feedback connections and inhibitory connections, and an electrical and mathematical characteristics of biological neurons are designed to construct feature extraction and classification parts.
Improves the robustness of image classification, showing higher Brain-Score scores and image classification accuracy under adversarial attacks.
Smart Images

Figure CN116403054B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of neural network applications, specifically an image optimization classification method based on a brain-like network model of spiking neurons and cerebral visual cortex. Background Art
[0002] The working mode of brain-inspired networks is more consistent with the cognitive abilities of the brain, with strong autonomous learning and association analysis capabilities, strong robustness, low consumption of computing resources, strong logical analysis and reasoning capabilities, cognitive reasoning capabilities, good temporal correlation, and more consistent with real-world scenarios. They may solve common problems and achieve strong artificial intelligence and general intelligence. However, research on brain-inspired networks has been very slow, limited by the complex structure of biological neurons and nervous systems. The calculations used in existing artificial intelligence models cannot simulate the working principles of biological neurons. Summary of the Invention
[0003] In response to the problem of low robustness of image classification in the existing technology, the present invention proposes an image optimization classification method based on a brain-like network model. According to the working principle of the potential changes of biological neurons, a pulse neuron model is designed based on the electrical and mathematical characteristics of the leaky integrate-fire model (LIF) of biological neurons, and the pulse neuron model is used to build and implement it.
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to an image optimization classification method based on a brain-like network model. In the offline stage, a brain-like network model including a feature extraction part, a classification part, a pulse neuron model, a coding layer using Poisson coding, an improved feedback connection, and an improved inhibitory connection is constructed and trained; in the online stage, the trained brain-like network model is used to perform image optimization classification.
[0006] The brain-like network model includes: a Poisson coding layer, five two-dimensional convolutional layers, seven activation function layers, three maximum pooling layers, a one-dimensional layer, two fully connected layers and a softmax layer, wherein: the Poisson coding layer constitutes an input data preprocessing part; the first two-dimensional convolutional layer, the first activation function layer, the first maximum pooling layer, the second two-dimensional convolutional layer, the second activation function layer, the second maximum pooling layer, the third two-dimensional convolutional layer, the third activation function layer, the fourth two-dimensional convolutional layer, the third activation function layer, the fifth two-dimensional convolutional layer, the fourth activation function layer and the third maximum pooling layer connected in sequence constitute a feature extraction part; the one-dimensional layer, the first fully connected layer, the fifth activation function layer, the second fully connected layer, the sixth activation function layer and the softmax connection layer connected in sequence constitute a classification part; the output end of the second maximum pooling layer and the output end of the third maximum pooling layer are both connected to the input end of the first convolutional layer, and the output end of the third maximum pooling layer is connected to the input end of the second convolutional layer and a transposed convolution calculation is added to form an improved feedback connection;
[0007] Each of the seven activation function layers is equipped with a pulse neuron model, which uses an RC circuit with resistors and capacitors to simulate the potential changes of biological neurons. Specifically: Where: V m ≥0 is the membrane potential of the neuron, R m >0 is the resistance value of the neuron, C m >0 is the capacitance value of the capacitor in the circuit, I>0 is the signal size of the external input, and time t=0, 1, 2, 3, .... When the membrane potential V m Greater than the potential threshold V th When t=0, the neuron sends a pulse signal δ(t)=1 and returns to resting potential. When the input value at time t=0 is I0, and there is no other input in the subsequent time period, the value of the neuron will be based on the value of the input signal and the set time constant τ. m =R m C m Perform exponential decay When there is other input, the potential value of the neuron will first decay, and then accumulate the new input signal; when the potential value of the neuron V m Greater than the threshold V th When the neuron sends a pulse signal and restores the resting potential, the resting potential V rest =0.
[0008] The output data of neurons in the spiking neuron model is affected by both the computational output and the inhibitory strength from other neurons, specifically: Where: y ij is the output value of position (i, j) in the output matrix, xij is the contribution of the neuron at position (i, j) to the classification result, is the lateral inhibition strength of the neuron at position (i, j). The lateral inhibition strength is specifically: Where: η is a learnable randomly initialized parameter, uv represents all positions adjacent to the (i, j) position in the output matrix, is the Euclidean distance from position (u, v) to position (i, j), δ(·) is the impulse function, x uv is the contribution of the neuron at position (u, v) to the classification result.
[0009] The improved inhibitory connection specifically includes:
[0010] i) Calculation and Where: μ is the average value of the output data calculated by this layer, (H, W, C) represents the width, length and number of channels respectively, and uv represents all positions in the calculated output matrix. is the calculated output value of the neuron at position (u, v), and σ is the variance of the output data calculated by this layer.
[0011] ii) Calculate the inhibition strength of each neuron: in: is the inhibitory strength of the neuron at position (i, j), a and b are learnable randomly initialized parameters, and e is the base of the natural logarithm. To find the average value, uv represents all positions in the output matrix except (i, j), and d uv =|ui|+|vj| is the distance between (u, v) and (i, j), sinh(·) is the hyperbolic sine function, and δ(·) is the impulse function. Each neuron is inhibited by all neurons in the same layer. The closer the neurons are, the stronger the inhibition.
[0012] iii) Calculate the output of the neuron: Where: y ij is the final output value of the neuron at position (i, j), It is calculated as a fixed function. When the inhibition strength is greater than the calculated output value of the neuron, the neuron is completely inhibited. Otherwise, the output data of the neuron is partially offset by the inhibitory connection.
[0013] The input data preprocessing is to encode the input data using a Poisson process, specifically: Where: P(X=k) is the probability of the event X=k, X is the number of output pulses, k is a non-negative integer, λ is a non-negative integer, which is the excitation frequency proportional to the size of the input data, and e is the base of the natural logarithm.
[0014] The feedback connection refers to connecting the output of the third maximum pooling layer of the brain-like network model to the first convolutional layer, specifically: X C1 =Y PC +Y MP3 , where: X C1 Y is the input data accepted by the first two-dimensional convolutional layer. PC is the output data of the Poisson coding layer, Y MP3 is the output data of the third maximum pooling layer.
[0015] The transposed convolution calculation is specifically: X C1 =Y PC +TC(Y MP2 )+TC(Y MP3 ) and X C2 =Y C1 +TC(Y MP3 ), where: X C1 Y is the input data accepted by the first two-dimensional convolutional layer. PC is the output data of the Poisson coding layer, Y MP2 is the output data of the second maximum pooling layer, Y MP3 is the output data of the third maximum pooling layer, X C2 Y is the input data accepted by the second two-dimensional convolution layer. C1 is the output data of the first two-dimensional convolutional layer, and TC(·) represents the transposed convolution calculation.
[0016] Technical Effects
[0017] The present invention constructs a brain-like network model based on an improved feedback connection structure and an improved inhibitory connection structure designed based on the structure of the cerebral visual cortex. The model scores on the Brain-Score tool are significantly improved compared to several other common neural network models. The brain-like network model of the present invention is trained using a public dataset and then attacked using a public adversarial attack algorithm. The brain-like network model of the present invention exhibits higher robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Flowchart of the present invention;
[0019] Figure 2 This is a schematic diagram of the improved feedback connection;
[0020] Figure 3 Schematic diagram of improved inhibition connection;
[0021] Figure 4 and Figure 5 Schematic diagram of the embodiment effect. DETAILED DESCRIPTION
[0022] like Figure 1 As shown in FIG, this embodiment relates to an image optimization classification method based on a spiking neuron model and a brain-like network model of the visual cortex structure, which is implemented using toolkits such as PyTorch, SpikingJelly, and NumPy. The CIFAR-10 dataset is used, and the specific steps include:
[0023] Step 1: Build the AlexNet neural network for image classification, which includes feature extraction and classification parts.
[0024] Step 2: Use the spiking neuron model to replace the neurons in the AlexNet neural network built in step 1. Use the IFNode neuron model in spikingjelly.activation_based.neuron built into SpikingJelly as the spiking neuron model, and use this neuron model to replace the neuron model in the activation function layer of the AlexNet neural network built in step 1.
[0025] Step 3: Add an encoding layer using Poisson encoding to the front end of the AlexNet network. Use the PoissonEncoder in SpikingJelly's built-in spikingjelly.activation_based.encoding as the encoding layer and add it to the front end of the AlexNet network to generate the corresponding spike train based on the input image.
[0026] Step 4: Add an improved feedback connection to the AlexNet network. MP2 And the output result Y of the third maximum pooling layer MP2 Before connecting to the first convolutional layer, the output of the third maximum pooling layer Y MP3 Connect to the second convolution layer and add transposed convolution to calculate TC(·). Figure 2 shown.
[0027] Step 5: Add improved inhibitory connections to the AlexNet network. First, calculate the mean μ and variance σ of the output data of each layer, and then calculate the inhibitory strength of each neuron. Finally, the data is output according to the calculation of the neuron and the intensity of inhibition Calculate the final output value y of the neuron ij .like Figure 3 shown.
[0028] Step 6: Train the brain-inspired network model for image classification: First, set the parameters: learning rate lr = 0.001, batch size batch_size = 32, cross-entropy loss, SGD optimization, and maximum number of training epochs max_epochs = 100. Use the CIFAR-10 dataset to train the brain-inspired network model for image classification. After training, obtain the trained brain-inspired network model.
[0029] After specific practical experiments, in order to reflect the effectiveness of the proposed method of building a brain-like network model, we compared it with several common artificial intelligence models. We selected AlexNet, VGG-11, VGG-19, ResNet-18, DenseNet, and SqueezeNet models, and carried out the same training process as described in step 6. Finally, we used Brain-Score to evaluate the similarity of their neuron activations. The higher the model score, the higher the brain-like degree of the model. The score results are as follows: Figure 4 shown.
[0030] In order to reflect the robustness of the constructed brain-like network model in image classification, the constructed brain-like network model and AlexNet were trained in the same way as in step six, and then the common FGSM, BIM, PGD and CW2 adversarial attack algorithms were selected to conduct adversarial attacks on the two models respectively, and the corresponding adversarial samples were obtained. The image classification accuracy of the brain-like network model and AlexNet model on the adversarial samples of different adversarial attack algorithms was calculated respectively, and compared with the image classification accuracy during training, and the decrease in the image classification accuracy of the two models was calculated. The smaller the decrease, the better the robustness of the model. The results are as follows. Figure 5 shown.
[0031] Compared to existing technologies, this invention achieves higher scores than mainstream AI models by building a brain-inspired network model based on a spiking neuron model and the structure of the visual cortex, demonstrating a higher degree of similarity to the brain. In CIFAR-10 image classification, the model demonstrates improved robustness against adversarial attack algorithms.
[0032] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principles and purpose of the present invention. The scope of protection of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. All implementation schemes within its scope shall be subject to the constraints of the present invention.
Claims
1. A method for building a brain-like intelligent model based on a pulse neuron model, characterized in that: In the offline phase, a brain-like network model including a feature extraction part, a classification part, a spiking neuron model, an encoding layer using Poisson coding, an improved feedback connection, and an improved inhibitory connection is constructed and trained; In the online stage, the trained brain-like network model is used for image optimization classification; The brain-like network model includes: a Poisson coding layer, five two-dimensional convolutional layers, seven activation function layers, three maximum pooling layers, a one-dimensional layer, two fully connected layers and a softmax layer, wherein: the Poisson coding layer constitutes an input data preprocessing part; the first two-dimensional convolutional layer, the first activation function layer, the first maximum pooling layer, the second two-dimensional convolutional layer, the second activation function layer, the second maximum pooling layer, the third two-dimensional convolutional layer, the third activation function layer, the fourth two-dimensional convolutional layer, the third activation function layer, the fifth two-dimensional convolutional layer, the fourth activation function layer and the third maximum pooling layer connected in sequence constitute a feature extraction part; the one-dimensional layer, the first fully connected layer, the fifth activation function layer, the second fully connected layer, the sixth activation function layer and the softmax connection layer connected in sequence constitute a classification part; the output end of the second maximum pooling layer and the output end of the third maximum pooling layer are both connected to the input end of the first convolutional layer, and the output end of the third maximum pooling layer is connected to the input end of the second convolutional layer and a transposed convolution calculation is added to form an improved feedback connection; The improved inhibitory connection specifically includes: i) Calculation and ,in: is the average value of the output data calculated by this layer, Represent the width, length and number of channels respectively, represents all positions in the calculated output matrix, for The calculated output value of the position neuron, Calculate the variance of the output data for this layer; ii) Calculate the inhibition strength of each neuron: ,in: for The inhibitory strength of the neurons at that location, and are learnable randomly initialized parameters, is the base of natural logarithms, To find the average value, Represents the output matrix except All locations except for arrive The distance between is the hyperbolic sine function, is the impulse function; each neuron is inhibited by all neurons in the same layer. The closer the neurons are, the higher the inhibition strength. iii) Calculate the output of the neuron: ,in: for The final output value of the position neuron, It is calculated as a fixed function; when the inhibition strength is greater than the calculated output value of the neuron, the neuron is completely inhibited, otherwise, the output data of the neuron is partially offset by the inhibitory connection.
2. The method for building a brain-like intelligent model based on a pulse neuron model according to claim 1, characterized in that: Each of the seven activation function layers is equipped with a pulse neuron model, which uses an RC circuit with resistors and capacitors to simulate the potential changes of biological neurons. Specifically: ,in: The membrane potential of the neuron, The resistance of the neuron, The capacitance of the capacitor in the circuit, External input signal size, time When the membrane potential Greater than the potential threshold When the neuron sends a pulse signal and restore the resting potential; when The size of the input value at the moment is , if there is no other input in the subsequent time period, the value of the neuron will be based on the value of the input signal and the set time constant Perform exponential decay , when there is other input, the potential value of the neuron will first decay, and then accumulate the new input signal; when the potential value of the neuron Greater than threshold When the neuron sends a pulse signal and returns to the resting potential, .
3. The method for building a brain-like intelligent model based on a pulse neuron model according to claim 2, wherein: The output data of the neuron is affected by the computational output and the inhibitory strength from other neurons, specifically: ,in: In the output matrix The output value of the position, for The contribution of neurons at that position to the classification results, for The lateral inhibition strength of the neurons at the position is: ,in: are randomly initialized learnable parameters, Represents the output matrix in All positions adjacent to each other, For location To location The Euclidean distance, is the impulse function, For location The contribution of neurons to the classification results.
4. The method for building a brain-like intelligent model based on a spiking neuron model according to claim 1, wherein: The input data preprocessing is to encode the input data using a Poisson process, specifically: ,in: for The probability of an event, is the number of output pulses, is a non-negative integer, is a non-negative integer, which is the excitation frequency proportional to the size of the input data. is the base of natural logarithms.
5. The method for building a brain-like intelligent model based on a spiking neuron model according to claim 1, wherein: The feedback connection refers to connecting the output of the third maximum pooling layer of the brain-like network model to the first convolutional layer, specifically: ,in: is the input data accepted by the first two-dimensional convolutional layer, is the output data of the Poisson coding layer, is the output data of the third maximum pooling layer.
6. The method for building a brain-like intelligent model based on a spiking neuron model according to claim 1, wherein: The transposed convolution calculation is specifically as follows: and ,in: is the input data accepted by the first two-dimensional convolutional layer, is the output data of the Poisson coding layer, is the output data of the second maximum pooling layer, is the output data of the third maximum pooling layer, is the input data accepted by the second two-dimensional convolutional layer, is the output data of the first two-dimensional convolutional layer, Represents transposed convolution calculation.
7. The method for building a brain-like intelligent model based on a spiking neuron model according to claim 1, wherein: The training mentioned above means: first set the parameters and set the learning rate , batch training size , the loss function uses cross entropy loss, the optimizer uses SGD optimization, and the maximum number of training rounds ; Use the CIFAR-10 dataset to train the brain-like network model for image classification, and after training, obtain the trained brain-like network model.
Citation Information
Patent Citations
Image classification method based on interactive multilayer spiking neural network
CN110659666A
Feedback type pulse neural network model training method for image data classification
CN113449864A