Width pulse neural network-based image classification model training method and device

Through the image classification model based on width pulse neural network, combined with sparse autoencoder and pulsed neurons, the problems of high energy consumption, low training efficiency and poor interpretability of deep neural networks are solved, and low energy consumption, efficient training and strong timing are achieved Image classification model with modeling capabilities is suitable for scenes with resource constrained.

CN118968151AActive Publication Date: 2024-11-15SOUTH CHINA UNIV OF TECH

Patent Information

Application Number
CN202411012963.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-15
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

Deep neural networks consume high energy, low training efficiency and poor interpretability during training and inference, which limits their application in resource-constrained and rapid decision-making scenarios, especially in mobile or embedded fields.

Method used

Using a width-based pulse neural network image classification model, Leaky Integrate-and-Fire, Integrate-and-Fire, Integrate-and-Fire , Izhikevich or Hodgkin-Huxley neurons use stochastic gradient descent algorithm to update model parameters to achieve low energy consumption and efficient training.

Benefits of technology

Efficient training of image classification models under low energy consumption improves the interpretability and prediction accuracy of the model, reduces the computational complexity, and has strong timing modeling and dynamic adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968151A_ABST
    Figure CN118968151A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification model training method and device based on a width pulse neural network. The method comprises the steps of obtaining a training sample set; constructing an original input matrix according to the sample image; performing feature extraction on the original input matrix through a feature layer to obtain a mapping feature matrix; coding the mapping characteristic matrix through a pulse coding layer to obtain a characteristic pulse sequence; generating an enhanced pulse sequence according to the characteristic pulse sequence through a pulse enhancement layer; inputting the characteristic pulse sequence and the enhanced pulse sequence into a pulse output layer, and processing by the pulse output layer to obtain an output pulse sequence; the output pulse sequence is used for representing a prediction result of the category corresponding to the sample image; and according to the output pulse sequence and the output matrix, updating parameters in the image classification model to obtain a trained image classification model. According to the method, the image classification model can be efficiently trained under the condition of low energy consumption, and the prediction precision is better. The method can be widely applied to the technical field of artificial intelligence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method and device for an image classification model based on a pulse width neural network. Background Art

[0002] With the vigorous development of deep learning (DL) technology, the research and application of deep neural network (DNN) have achieved breakthrough results in many fields such as computer vision and natural language processing. For example, there are currently applications that use deep learning technology to build image classification models to achieve image content classification.

[0003] However, while the deep structure of neural networks brings breakthroughs, there are also the following problems and limitations: 1) High energy consumption. During the training and reasoning process, deep neural networks need to implement forward propagation and back propagation in their deep structures, and perform a large number of intensive floating-point operations, which leads to high energy consumption, resulting in higher costs, resource consumption and hardware requirements. Literature estimates that the total carbon emissions of the current highest level of neural architecture search can reach 626,155 pounds, equivalent to the cumulative carbon emissions of an average person for 56.8 years. 2) Low training efficiency. Deep neural networks rely on gradient-based optimization algorithms (such as back propagation), which require a large amount of training data and computing resources, and take a long time to train. 3) Poor interpretability. Deep neural networks lack explicit rules or decision boundaries and are black-box models, that is, their internal working mechanisms are difficult to explain, which limits the application of deep neural networks in trusted fields (such as medical diagnosis and financial analysis).

[0004] These problems make it difficult to deploy deep neural networks in real time under resource-constrained and fast-decision scenarios, limiting their application in mobile or embedded systems. How to reduce resource consumption while maintaining network performance has become one of the main issues of concern in the machine learning community. Summary of the invention

[0005] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent.

[0006] To this end, an object of an embodiment of the present application is to provide a training method and device for an image classification model based on a width pulse neural network.

[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:

[0008] On the one hand, an embodiment of the present application provides a training method for an image classification model based on a width pulse neural network, wherein the image classification model includes a feature layer, a pulse coding layer, a pulse enhancement layer, and a pulse output layer, and the method includes:

[0009] Acquire a training sample set; the training sample set includes a plurality of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to represent the true result of the category corresponding to the sample image;

[0010] According to the sample image, construct an original input matrix;

[0011] Performing feature extraction on the original input matrix through the feature layer to obtain a mapping feature matrix;

[0012] Encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence;

[0013] generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer;

[0014] Inputting the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and processing the pulse output layer to obtain an output pulse sequence; the output pulse sequence is used to characterize the prediction result of the category corresponding to the sample image;

[0015] According to the output pulse sequence and the output matrix, the parameters in the image classification model are updated to obtain a trained image classification model.

[0016] In addition, the training method of an image classification model based on a pulse width neural network according to the above embodiment of the present application may also have the following additional technical features:

[0017] Further, in one embodiment of the present application, the feature layer includes a number of sparse autoencoders;

[0018] The step of extracting features from the original input matrix through the feature layer to obtain a mapping feature matrix includes:

[0019] The sparse autoencoder is used to perform feature extraction on the original input matrix to obtain a mapping feature matrix.

[0020] Further, in one embodiment of the present application, the pulse enhancement layer includes a number of pulse neurons;

[0021] The step of generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer includes:

[0022] On the basis of the characteristic pulse sequence, the enhanced pulse sequence is generated by randomly exciting the pulse neurons.

[0023] Furthermore, in one embodiment of the present application, the pulse neuron adopts at least one of a Leaky Integrate-and-Fire pulse neuron, an Integrate-and-Fire neuron, an Izhikevich neuron or a Hodgkin-Huxley neuron.

[0024] Further, in one embodiment of the present application, updating the parameters in the image classification model according to the output pulse sequence and the output matrix includes:

[0025] Determining a loss value according to the output pulse sequence and the output matrix;

[0026] Constructing a proxy function to perform a differentiable approximation on the excitation function corresponding to the spiking neuron, and obtaining a target gradient descent equation corresponding to the excitation function;

[0027] According to the target gradient descent equation and the loss value, the parameters in the image classification model are updated using a stochastic gradient descent algorithm.

[0028] Furthermore, in one embodiment of the present application, updating the parameters in the image classification model to obtain a trained image classification model includes:

[0029] Get a test sample set;

[0030] Updating the parameters in the image classification model, and determining the test accuracy of the updated image classification model through the test sample set;

[0031] If the test accuracy is greater than or equal to a preset accuracy threshold, the current updated image classification model is determined as a trained image classification model; or, if the test accuracy is less than the preset accuracy threshold, return to execute the step of updating the parameters in the image classification model.

[0032] On the other hand, an embodiment of the present application provides an image classification method, including:

[0033] Obtain a target image to be classified;

[0034] The target image is classified by the image classification model trained by the aforementioned training method of the image classification model based on the width pulse neural network to obtain the classification result corresponding to the target object.

[0035] On the other hand, an embodiment of the present application provides a training device for an image classification model based on a width pulse neural network, wherein the image classification model includes a feature layer, a pulse coding layer, a pulse enhancement layer, and a pulse output layer, and the device includes:

[0036] An acquisition unit, used to acquire a training sample set; the training sample set includes a plurality of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to represent the true result of the category corresponding to the sample image;

[0037] A construction unit, used to construct an original input matrix according to the sample image;

[0038] An extraction unit, used for performing feature extraction on the original input matrix through the feature layer to obtain a mapping feature matrix;

[0039] A coding unit, used for encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence;

[0040] A generating unit, configured to generate an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer;

[0041] A prediction unit, used for inputting the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and obtaining an output pulse sequence through processing by the pulse output layer; the output pulse sequence is used for representing the prediction result of the category corresponding to the sample image;

[0042] An updating unit is used to update the parameters in the image classification model according to the output pulse sequence and the output matrix to obtain a trained image classification model.

[0043] On the other hand, an embodiment of the present application provides a computer device, including:

[0044] at least one processor;

[0045] at least one memory for storing at least one program;

[0046] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned training method or image classification method of an image classification model based on a width pulse neural network.

[0047] On the other hand, an embodiment of the present application also provides a computer-readable storage medium, which stores a program executable by a processor. When the above-mentioned processor-executable program is executed by the processor, it is used to implement the above-mentioned training method or image classification method of an image classification model based on a width pulse neural network.

[0048] The advantages and benefits of the present application will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:

[0049] The present application discloses a training method for an image classification model based on a width pulse neural network, wherein a training sample set is obtained; the training sample set includes a number of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to characterize the real result of the category corresponding to the sample images; an original input matrix is ​​constructed according to the sample images; a feature layer is used to extract features from the original input matrix to obtain a mapping feature matrix; the mapping feature matrix is ​​encoded by the pulse coding layer to obtain a feature pulse sequence; an enhanced pulse sequence is generated according to the feature pulse sequence by the pulse enhancement layer; the feature pulse sequence and the enhanced pulse sequence are input to the pulse output layer, and an output pulse sequence is obtained by processing the pulse output layer; the output pulse sequence is used to characterize the prediction result of the category corresponding to the sample image; the parameters in the image classification model are updated according to the output pulse sequence and the output matrix to obtain a trained image classification model. The method can efficiently train the image classification model under low energy consumption, and the obtained image classification model has strong interpretability and better prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 A schematic diagram of an implementation environment of a training method for an image classification model based on a pulse width neural network provided in an embodiment of the present application;

[0052] Figure 2 A schematic diagram of a flow chart of a training method for an image classification model based on a pulse width neural network provided in an embodiment of the present application;

[0053] Figure 3 A schematic diagram of the structure of an image classification model provided in an embodiment of the present application;

[0054] Figure 4 A classification accuracy curve during the training process of an image classification model provided in an embodiment of the present application;

[0055] Figure 5A loss value curve in the training process of an image classification model provided in an embodiment of the present application;

[0056] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0058] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0060] 1) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0061] 2) Computer Vision (CV): It is a science that studies how to make machines "see". To be more specific, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0062] 3) Machine Learning (ML): A multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies.

[0063] 4) Deep Learning (DL): Deep learning is a new research direction in the field of machine learning. It is used to learn the inherent laws and representation levels of sample data. The information obtained in the learning process is very helpful for interpreting data such as text, images and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images and sounds.

[0064] At present, with the vigorous development of deep learning (DL) technology, the research and application of deep neural network (DNN) has achieved breakthrough results in many fields such as computer vision and natural language processing. For example, there are currently applications that use deep learning technology to build image classification models to achieve image content classification.

[0065] However, while the deep structure of neural networks brings breakthroughs, there are also the following problems and limitations: 1) High energy consumption. During the training and reasoning process, deep neural networks need to implement forward propagation and back propagation in their deep structures, and perform a large number of intensive floating-point operations, which leads to high energy consumption, resulting in higher costs, resource consumption and hardware requirements. Literature estimates that the total carbon emissions of the current highest level of neural architecture search can reach 626,155 pounds, equivalent to the cumulative carbon emissions of an average person for 56.8 years. 2) Low training efficiency. Deep neural networks rely on gradient-based optimization algorithms (such as back propagation), which require a large amount of training data and computing resources, and take a long time to train. 3) Poor interpretability. Deep neural networks lack explicit rules or decision boundaries and are black-box models, that is, their internal working mechanisms are difficult to explain, which limits the application of deep neural networks in trusted fields (such as medical diagnosis and financial analysis).

[0066] These problems make it difficult to deploy deep neural networks in real time under resource-constrained and fast-decision scenarios, limiting their application in mobile or embedded systems. How to reduce resource consumption while maintaining network performance has become one of the main issues of concern in the machine learning community.

[0067] In view of this, a training method for an image classification model based on a width pulse neural network is provided in an embodiment of the present application, wherein a training sample set is obtained; the training sample set includes a number of sample images and an output matrix corresponding to the sample images, and the output matrix is ​​used to characterize the real result of the category corresponding to the sample image; the original input matrix is ​​constructed according to the sample image; the feature layer is used to extract features from the original input matrix to obtain a mapping feature matrix; the mapping feature matrix is ​​encoded by the pulse coding layer to obtain a feature pulse sequence; the pulse enhancement layer is used to generate an enhanced pulse sequence according to the feature pulse sequence; the feature pulse sequence and the enhanced pulse sequence are input to the pulse output layer, and the output pulse sequence is obtained by processing the pulse output layer; the output pulse sequence is used to characterize the prediction result of the category corresponding to the sample image; the parameters in the image classification model are updated according to the output pulse sequence and the output matrix to obtain a trained image classification model. This method can efficiently train the image classification model under low energy consumption, and the obtained image classification model has strong interpretability and better prediction accuracy.

[0068] The training method in the embodiment of the present application combines the technology of Broad Learning System (BLS) and Spiking Neural Network (SNN). Among them, the width learning system belongs to a feedforward artificial neural network. Unlike the traditional deep neural network, the width learning system adopts the shallow structure of Random Vector Functional Link Neural Network (RVFLNN), focusing on the lateral expansion of the network rather than the vertical deepening, and the network structure is flatter. Compared with the deep neural network, the width learning system has the following advantages: 1) Low hardware requirements. The width learning system has a simple structure and requires fewer computing resources, and can be implemented on a low-resource hardware platform. 2) Fast training speed. The width learning system adopts a pseudo-inverse solution algorithm, which does not require iterative propagation optimization in the deep structure, has low training complexity, can achieve fast training, and reduces overfitting while maintaining good performance. For example, in the classification task test of the MNIST handwritten digit image set, the wide learning system achieved a classification accuracy of 98.74% after 29.92 seconds of training, while the Convolutional Neural Network (CNN) took 21793.93 seconds to train but only achieved an accuracy of 95.63%. 3) Strong interpretability. The wide learning system uses a shallow structure, the network structure is more transparent, and the role of feature mapping and enhancement nodes is easier to understand and analyze.

[0069] The spiking neural network is a brain-like network model that is closer to the biological nervous system. Unlike deep neural networks that use continuous real-number activation values, it uses pulse sequences as input and output signals of neurons. The spiking neural network has the following advantages: 1) Low energy consumption. Similar to the biological brain, spiking neurons are activated only when they receive sparse pulse signals, avoiding unnecessary calculations and thus having extremely low energy consumption. Relevant experiments show that in character recognition tasks, the energy consumption of spiking neural networks is only 2.8mW, while the corresponding artificial neural network is as high as 3320mW, a difference of three orders of magnitude. 2) Strong time coding ability. The spiking neural network encodes and transmits information with discrete pulse events, and encodes information through the time interval and frequency of pulse emission, which gives the spiking neural network a natural advantage in computing and communication, and can handle tasks involving time series data or time patterns well. 3) Computational efficiency. The spiking neural network only performs calculations when a pulse occurs. Due to the sparsity and asynchronous nature of the pulse, efficient asynchronous parallel computing can be achieved through hardware acceleration and other means, thereby greatly improving computing efficiency.

[0070] In the embodiments of the present application, a width learning system and a pulse neural network are integrated to realize the application of image classification, which have unique advantages in terms of energy consumption, computing efficiency, training complexity, etc.

[0071] Please refer to Figure 1 , Figure 1 The schematic diagram of the implementation environment of a training method for an image classification model based on a pulse width neural network provided in an embodiment of the present application is shown. In the implementation environment, the main hardware and software entities involved include a terminal device 110 and a backend server 120. The terminal device 110 and the backend server 120 are connected in communication.

[0072] Specifically, the training method of the image classification model based on the width pulse neural network provided in the embodiment of the present application can be executed alone on the terminal device 110 side, or can be executed alone on the background server 120 side, or can be executed based on data interaction between the terminal device 110 and the background server 120.

[0073] The terminal device 110 of the above embodiment may include a mobile phone, a computer, a PDA device, an intelligent voice interaction device, a vehicle-mounted terminal, etc., but is not limited thereto. The backend server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0074] The terminal device 110 and the backend server 120 may establish a communication connection via a wireless network or a wired network. The wireless network or wired network uses standard communication technology and / or protocols, and the network may be set to the Internet or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network.

[0075] Of course, it is understandable that Figure 1 The implementation environment in the present application is only some optional application scenarios of the training method of the image classification model based on the pulse width neural network provided in the embodiment of the present application. The actual application is not fixed. Figure 1 The hardware and software environment shown.

[0076] Below, in combination with the introduction of the aforementioned implementation environment, a training method for an image classification model based on a width pulse neural network provided in an embodiment of the present application is introduced and explained.

[0077] Please refer to Figure 2 , Figure 2 : is a schematic diagram of a training method for an image classification model based on a width pulse neural network provided in an embodiment of the present application. The training method for an image classification model based on a width pulse neural network includes but is not limited to:

[0078] Step 210: Obtain a training sample set; the training sample set includes a number of sample images and an output matrix corresponding to the sample images, and the output matrix is ​​used to represent the true results of the categories corresponding to the sample images;

[0079] Step 220: construct an original input matrix according to the sample image;

[0080] Step 230: extracting features from the original input matrix through the feature layer to obtain a mapping feature matrix;

[0081] Step 240, encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence;

[0082] Step 250, generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer;

[0083] Step 260: input the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and obtain an output pulse sequence through processing by the pulse output layer; the output pulse sequence is used to characterize the prediction result of the category corresponding to the sample image;

[0084] Step 270: Update the parameters in the image classification model according to the output pulse sequence and the output matrix to obtain a trained image classification model.

[0085] In the embodiment of the present application, an image classification model based on a pulse width neural network in an information transmission mode is provided. Please refer to Figure 3 , Figure 3 The structure diagram of an image classification model provided in the embodiment of the present application is shown, and the image classification model in the embodiment of the present application includes a feature layer, a pulse coding layer, a pulse enhancement layer and a pulse output layer. The image classification model in the embodiment of the present application is introduced and explained below in combination with a specific training method.

[0086] In an embodiment of the present application, when training an image classification model, a training sample set may be obtained, and the training sample set may include several sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to characterize the true result of the category corresponding to the sample image. Specifically, in an embodiment of the present application, for the task type of image classification, the specific content contained in the sample image is not limited. For example, in some embodiments, the task of image classification may be animal classification, and the sample image may be a photo of various animals such as a cat, a dog, a lion, a bird, etc., and the output matrix may be data representing "cat", "dog", "lion", "bird", etc. In some embodiments, the task of image classification may be face recognition, and the sample image may be a facial photo of an individual, and the output matrix may be data representing specific personal information. In some embodiments, the task of image classification may be medical image analysis, and the sample image may be an X-ray, an MRI scan, or a photo of a skin lesion, and the output matrix may be data representing diagnostic results such as "normal", "abnormal", and "tumor".

[0087] Of course, the above application scenarios are only used to illustrate the image classification in the embodiments of the present application, and are not meant to limit the actual use of the present application.

[0088] In the embodiment of the present application, the original input matrix can be constructed according to the sample image. Specifically, for example, a matrix can be constructed according to the pixels of the sample image, which is the original input matrix. After obtaining the original input matrix, the feature layer can be used to extract features of the original input matrix to obtain a mapping feature matrix. Specifically, for example, the feature layer in the embodiment of the present application may include a number of sparse autoencoders, for example, n (n is a positive integer), denoted as Φ1,…,Φ n , input the original input matrix into these sparse autoencoders, and the corresponding mapping feature matrix can be obtained, denoted as Z n :=[Z1,…,Z n ].

[0089] In the embodiment of the present application, the pulse coding layer can be used to encode the extracted feature information (i.e., the mapping feature matrix) into a discrete feature pulse sequence. For example, for the aforementioned Z n , through the pulse coding layer processing, we can get n groups of characteristic pulse sequences S n :=[s1,…,s n Then, the pulse enhancement layer can be used to generate m groups (m is a positive integer) of enhanced pulse sequences based on the characteristic coding pulses. In the embodiment of the present application, the pulse output layer can combine the pulse sequence of the pulse coding layer and the pulse enhancement layer. Producing the final output decision That is, an output pulse sequence is obtained. The output pulse sequence can be used to represent the prediction result of the category corresponding to the sample image.

[0090] It is understandable that in the embodiment of the present application, the output matrix represents the actual result of the category corresponding to the sample image, and the output pulse sequence represents the predicted result of the category corresponding to the sample image. Therefore, by comparing the output matrix and the output pulse sequence, the classification performance of the image classification model can be measured. If the result represented by the output matrix is ​​close to the result represented by the output pulse sequence, it means that the classification performance of the image classification model is good. On the contrary, if the result represented by the output matrix is ​​not close to the result represented by the output pulse sequence, and the difference is relatively large, it means that the classification performance of the image classification model is poor. In the embodiment of the present application, the loss value of the training can be determined based on the output pulse sequence and the output matrix, and then the parameters of the image classification model can be updated according to the loss value, so as to obtain a trained image classification model.

[0091] Through the above technical solutions and model design, the embodiment of the present application adopts a flattened width structure and sparse pulse coding, which can effectively solve the problems of high energy consumption, high computational complexity, low training efficiency, poor interpretability, and insufficient time coding ability in the prior art. The technical solution of the present application has at least the following beneficial effects:

[0092] 1) Low energy consumption. This application fully utilizes the advantages of pulse neural networks in time and energy efficiency through sparse pulse coding and event-driven information processing mechanisms, with low computational complexity, giving the system low power consumption characteristics.

[0093] 2) High training efficiency. This application uses the flat network structure of the wide learning system to avoid the problems of gradient vanishing and overfitting caused by the deep structure. At the same time, it introduces the proxy gradient descent to overcome the difficulty of pulse neural network training and realizes end-to-end training of the network.

[0094] 3) Strong interpretability. The flat information transmission structure of this application makes the information flow within the network clearer, which is conducive to analyzing and understanding the decision-making process of the network. The pulse coding mechanism is closer to the biological nervous system, and the decision-making process is more in line with human intuition, which enhances the interpretability of the model.

[0095] 4) Strong time series modeling capability. This application solves the problem of the lack of time series information processing capability in the prior art by introducing the time coding mechanism of the pulse neural network, enabling the system to fully mine the time series information in the input data and enhancing the modeling capability of the model for time series data.

[0096] 5) Strong dynamic adaptability. This application combines the dynamic characteristics of the pulse neural network and the fast learning mechanism of the width learning system, which can quickly adapt to changes in input data, has better processing capabilities for time-varying signals, allows the network to adapt to new data without complete retraining, and improves the plasticity of the model.

[0097] The following is a detailed introduction to each level of the image classification model in the embodiment of the present application.

[0098] In the embodiment of the present application, the n sparse autoencoders Φ1, ..., Φ n , for the input image X, consider the optimization problem:

[0099]

[0100] Among them, λ is Regularization coefficient, is the characteristic solution, Z i For a given linear equation The expected output of this problem is a convex optimization problem, and its approximate solution can be obtained by dozens of algorithms, such as orthogonal matching pursuit (OMP), K-SVD, etc. Here, the Lasso iterative algorithm based on the alternating direction method of multipliers (ADMM) is used.

[0101] It should be noted that in the embodiments of the present application, the feature layer can also be constructed using other models, for example, the k-means clustering algorithm can be used, and the present application does not limit its specific type.

[0102] For the pulse coding layer, it is used to encode the sparse features extracted by the feature layer into a discrete feature pulse sequence. Specifically, let z ij Node Z of the feature layer i The j-th dimension information is derived, and at each time step t, this dimension excites the pulse event The probability of where z′ ij =min{z ij ,1}, B(·) is Bernoulli distribution, thus obtaining n groups of characteristic pulse sequences S with the original data characteristics n :=[S1,…,S n ].

[0103] It should be noted that the embodiments of the present application may also use other distributions (such as Poisson distribution) or other encoding methods (such as frequency method, phase encoding) to generate characteristic pulse sequences. For the specific implementation process, reference may be made to relevant technologies, and this application will not elaborate on it here.

[0104] In some embodiments, the spiking enhancement layer includes a number of spiking neurons;

[0105] The step of generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer includes:

[0106] On the basis of the characteristic pulse sequence, the enhanced pulse sequence is generated by randomly exciting the pulse neurons.

[0107] In the embodiment of the present application, the pulse enhancement layer generates m groups of enhanced pulse sequences by randomly exciting the pulse neurons based on the characteristic coding pulses. Specifically, for example, m groups of Leaky Integrate-and-Fire (LIF) pulse neurons can be randomly initialized, and the membrane potential of the i-th group of enhanced pulse neurons at time t is Modeling is done as follows:

[0108] Charging: The decay constant (τ m is the membrane time constant of the neuron), Ψ ij is the synaptic weight to be learned. In this stage, the pulse width neural network simulates biological neurons, continuously charging characteristic pulses to enhance the membrane potential of neurons, and implementing potential decay when there is no input pulse.

[0109] excitation: Where V th is the signed excitation potential threshold, and Θ(·) is a step function. At this stage, the membrane potential exceeds the excitation threshold, and the neuron automatically excites pulses, thereby obtaining m groups of enhanced characteristic pulse sequences. These impulses are transmitted to downstream neurons through synapses.

[0110] Reset: During this phase, the enhanced neurons reset to their resting potential to receive subsequent characteristic pulses, which simulates the refractory phase of biological neurons.

[0111] It should be noted that in the embodiments of the present application, the type of pulse neurons is not limited to LeakyIntegrate-and-Fire pulse neurons. In other embodiments, Integrate-and-Fire neurons, Izhikevich neurons or Hodgkin-Huxley neurons may also be used. The present application does not impose any restrictions on this, and it may use at least one of the above neurons.

[0112] In some embodiments, updating the parameters in the image classification model according to the output pulse sequence and the output matrix includes:

[0113] Determining a loss value according to the output pulse sequence and the output matrix;

[0114] Constructing a proxy function to perform a differentiable approximation on the excitation function corresponding to the spiking neuron, and obtaining a target gradient descent equation corresponding to the excitation function;

[0115] According to the target gradient descent equation and the loss value, the parameters in the image classification model are updated using a stochastic gradient descent algorithm.

[0116] In the embodiment of the present application, the pulse output layer is responsible for outputting the decision. Specifically, for the classification problem of image classification, for example, the total number of categories to be classified may be 10. In the embodiment of the present application, 10 groups of LIF neurons may be randomly initialized, and their modeling is the same as described above. The synaptic connection between the feature neuron and the enhancement neuron is established, that is, the input pulse sequence Among the 10 groups of LIF neurons, the first spike event S out The neurons correspond to the final classification decision results.

[0117] In the embodiment of the present application, due to the non-differentiable nature of the pulse event, the output layer cannot be directly learned using the back propagation algorithm. Inspired by the Sigmoid function, a proxy function is constructed to perform a differentiable approximation on the excitation function of the pulse neuron in this layer:

[0118]

[0119] Among them, α is the approximation parameter, and the gradient descent equation of the activation function after using the proxy function is:

[0120]

[0121] In the embodiment of the present application, the stochastic gradient descent algorithm can be implemented according to the equation to achieve end-to-end training of the network required by the present embodiment. Of course, in some embodiments, the network can also be trained using unsupervised learning methods (such as STDP), transfer learning methods (such as ANN-SNN conversion) or other methods, and the present application does not limit this.

[0122] In some embodiments, updating the parameters in the image classification model to obtain a trained image classification model includes:

[0123] Get a test sample set;

[0124] Updating the parameters in the image classification model, and determining the test accuracy of the updated image classification model through the test sample set;

[0125] If the test accuracy is greater than or equal to a preset accuracy threshold, the current updated image classification model is determined as a trained image classification model; or, if the test accuracy is less than the preset accuracy threshold, return to execute the step of updating the parameters in the image classification model.

[0126] In the embodiment of the present application, when the parameters of the image classification model are updated, a loop iteration method can be used to implement it. Exemplarily, in some embodiments, the parameters of each pair of image classification models can be updated once, and the corresponding loss value can be calculated once. If the loss value is small, or the difference between the loss value and the previous round of training is small, it can be considered that the parameters of the current image classification model are basically trained, and the current image classification model can be used as a trained image classification model. In some embodiments, the iteration rounds of training can also be set in advance. When the number of times the image classification model is updated reaches the iteration round, the training is stopped and the current image classification model is used as a trained image classification model. In some embodiments, a test sample set can also be obtained. The data form of the test sample set is consistent with the training sample set. When the parameters of the image classification model are updated once, the test sample set can be used to verify its performance and determine the test accuracy of the updated image classification model. Then, if the test accuracy of the updated image classification model is high, for example, greater than or equal to the preset accuracy threshold, the current updated image classification model can be determined as a trained image classification model. If the test accuracy of the updated image classification model is low, for example, less than the preset accuracy threshold, training can continue. This application does not impose any limitation on the specific numerical value of the accuracy threshold, which can be determined based on actual needs.

[0127] In order to verify the performance of the training method provided by the present application, experiments were carried out according to the embodiments of the present application, and the MNIST handwritten digital image dataset was used to train and test the present application. The MNIST dataset is a handwritten digital image dataset consisting of 70,000 28×28 pixel grayscale images, each of which is a single handwritten digit (0 to 9). The experimental environment of the embodiment of the present application is an Intel i5@3.70GHz desktop computer. During the training process, the network is optimized using the ADAM optimizer in combination with the proxy gradient descent. The training batch size is 128 and the learning rate is 2×10 -3 The number of nodes in the feature layer is n = 16, and each node contains 16 features; the enhancement layer is a single node, which contains m = 1000 features. The membrane time constant τ of the LIF spiking neuron m ∈(0,1) is set to 0.7, and the approximation parameter α of the impulse proxy function is set to 25. The experimental results show that the embodiment of the present application achieves a classification accuracy of 92.97% on the test set. The classification accuracy curve during the training process is shown in Figure 4 As shown, the X-axis is the number of training batches, the orange line is the accuracy of the training set, and the blue line is the accuracy of the test set.

[0128] The loss function value curve is as follows Figure 5 As shown, the X-axis is the number of training batches, the green line is the training set loss value, and the gray line is the test set loss value. It can be seen that the image classification method in the embodiment of the present application can achieve efficient model training under low energy consumption, and the obtained image classification model has strong interpretability and better prediction accuracy.

[0129] In an embodiment of the present application, an image classification method is also provided, comprising:

[0130] Obtain a target image to be classified;

[0131] The target image is classified by the image classification model trained by the aforementioned training method of the image classification model based on the width pulse neural network to obtain the classification result corresponding to the target object.

[0132] In the embodiment of the present application, after the image classification model is trained, it can be put into actual application scenarios. For example, for an image that needs to be classified, it can be recorded as a target image. Based on the trained image classification model, the target image can be classified and applied to obtain the corresponding classification result.

[0133] The embodiment of the present application also provides a training device for an image classification model based on a pulse width neural network, the device comprising:

[0134] An acquisition unit, used to acquire a training sample set; the training sample set includes a plurality of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to represent the true result of the category corresponding to the sample image;

[0135] A construction unit, used to construct an original input matrix according to the sample image;

[0136] An extraction unit, used for performing feature extraction on the original input matrix through the feature layer to obtain a mapping feature matrix;

[0137] A coding unit, used for encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence;

[0138] A generating unit, configured to generate an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer;

[0139] A prediction unit, used for inputting the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and obtaining an output pulse sequence through processing by the pulse output layer; the output pulse sequence is used for representing the prediction result of the category corresponding to the sample image;

[0140] An updating unit is used to update the parameters in the image classification model according to the output pulse sequence and the output matrix to obtain a trained image classification model.

[0141] Understandably, Figure 2 The contents of the training method embodiment of the image classification model based on the width pulse neural network shown in the figure are applicable to the training device embodiment of the image classification model based on the width pulse neural network. The functions specifically implemented by the training device embodiment of the image classification model based on the width pulse neural network are the same as those of the training method embodiment of the image classification model based on the width pulse neural network. Figure 2 The training method of the image classification model based on the width pulse neural network shown in the embodiment is the same as that of the embodiment shown in the embodiment, and the beneficial effects achieved are the same as those achieved in the embodiment shown in the embodiment. Figure 2 The beneficial effects achieved by the embodiment of the training method for an image classification model based on a width pulse neural network shown are also the same.

[0142] Reference Figure 6 , an embodiment of the present application provides an electronic device, including:

[0143] at least one processor 610;

[0144] At least one memory 620, used to store at least one program;

[0145] When at least one program is executed by at least one processor 610, at least one processor 610 implements the above-mentioned training method of the image classification model based on the width pulse neural network or the image classification method.

[0146] Similarly, the contents of the above method embodiments are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0147] An embodiment of the present application also provides a computer-readable storage medium, which stores a program executable by the processor 610. When the program executable by the processor 610 is executed by the processor 610, it is used to execute the above-mentioned training method or image classification method of the image classification model based on the width pulse neural network.

[0148] It can be understood that the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments, the functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0149] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.

[0150] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical system and / or software module, or one or more functions and / or features can be implemented in a separate physical system or software module. It can also be understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the system disclosed herein, the actual implementation of the module will be understood within the conventional techniques of engineers. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It can also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0151] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0152] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, system or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, system or device and execute the instructions), or in conjunction with these instruction execution systems, systems or devices. For the purpose of this specification, "computer-readable medium" can be any system that can contain, store, communicate, propagate or transport a program for use by an instruction execution system, system or device, or in conjunction with these instruction execution systems, systems or devices.

[0153] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic systems), a portable computer disk case (magnetic systems), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic system, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0154] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0155] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0156] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0157] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

[0158] In the description of this specification, the description with reference to the terms "one embodiment", "another embodiment" or "certain embodiments" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0159] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A training method for an image classification model based on a pulse width neural network, characterized in that: The image classification model includes a feature layer, a pulse coding layer, a pulse enhancement layer and a pulse output layer, and the method includes: Acquire a training sample set; the training sample set includes a plurality of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to represent the true result of the category corresponding to the sample image; According to the sample image, construct an original input matrix; Performing feature extraction on the original input matrix through the feature layer to obtain a mapping feature matrix; Encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence; generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer; Inputting the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and processing the pulse output layer to obtain an output pulse sequence; the output pulse sequence is used to characterize the prediction result of the category corresponding to the sample image; According to the output pulse sequence and the output matrix, the parameters in the image classification model are updated to obtain a trained image classification model.

2. The training method of the image classification model based on pulse width neural network according to claim 1 is characterized in that: The feature layer includes a plurality of sparse autoencoders; The step of extracting features from the original input matrix through the feature layer to obtain a mapping feature matrix includes: The sparse autoencoder is used to perform feature extraction on the original input matrix to obtain a mapping feature matrix.

3. The training method of the image classification model based on pulse width neural network according to claim 1 is characterized in that: The pulse enhancement layer includes a plurality of pulse neurons; The step of generating an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer includes: On the basis of the characteristic pulse sequence, the enhanced pulse sequence is generated by randomly exciting the pulse neurons.

4. The training method of the image classification model based on pulse width neural network according to claim 3 is characterized in that: The pulse neuron is at least one of a Leaky Integrate-and-Fire pulse neuron, an Integrate-and-Fire neuron, an Izhikevich neuron or a Hodgkin-Huxley neuron.

5. The training method of the image classification model based on pulse width neural network according to claim 3 is characterized in that: The updating of parameters in the image classification model according to the output pulse sequence and the output matrix comprises: Determining a loss value according to the output pulse sequence and the output matrix; Constructing a proxy function to perform a differentiable approximation on the excitation function corresponding to the spiking neuron, and obtaining a target gradient descent equation corresponding to the excitation function; According to the target gradient descent equation and the loss value, the parameters in the image classification model are updated using a stochastic gradient descent algorithm.

6. A method for training an image classification model based on a pulse width neural network according to any one of claims 1 to 5, characterized in that: The updating of the parameters in the image classification model to obtain a trained image classification model includes: Get a test sample set; Updating the parameters in the image classification model, and determining the test accuracy of the updated image classification model through the test sample set; If the test accuracy is greater than or equal to a preset accuracy threshold, the current updated image classification model is determined as a trained image classification model; or, if the test accuracy is less than the preset accuracy threshold, return to execute the step of updating the parameters in the image classification model.

7. An image classification method, characterized in that: include: Obtain a target image to be classified; The target image is classified by using an image classification model trained by the training method for an image classification model based on a width pulse neural network as described in any one of claims 1 to 6 to obtain a classification result corresponding to the target object.

8. A training device for an image classification model based on a pulse width neural network, characterized in that: The image classification model includes a feature layer, a pulse coding layer, a pulse enhancement layer and a pulse output layer, and the device includes: An acquisition unit, used to acquire a training sample set; the training sample set includes a plurality of sample images and an output matrix corresponding to the sample images, wherein the output matrix is ​​used to represent the true result of the category corresponding to the sample image; A construction unit, used to construct an original input matrix according to the sample image; An extraction unit, used for performing feature extraction on the original input matrix through the feature layer to obtain a mapping feature matrix; A coding unit, used for encoding the mapping characteristic matrix through the pulse coding layer to obtain a characteristic pulse sequence; A generating unit, configured to generate an enhanced pulse sequence according to the characteristic pulse sequence through the pulse enhancement layer; A prediction unit, used for inputting the characteristic pulse sequence and the enhanced pulse sequence into the pulse output layer, and obtaining an output pulse sequence through processing by the pulse output layer; the output pulse sequence is used for representing the prediction result of the category corresponding to the sample image; An updating unit is used to update the parameters in the image classification model according to the output pulse sequence and the output matrix to obtain a trained image classification model.

9. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • Feedback type pulse neural network model training method for image data classification

    CN113449864A

  • Self-adaptive convolution automatic coding method based on spiking neurons

    CN115620026A

  • Steel surface defect image classification method based on pulse convolutional neural network

    CN116188870A

  • Implanted image sample restoration method based on spiking neural network information storage model

    CN117911283A

  • Method and a system for creating dynamic neural function libraries

    US20160019457A1

Cited By

  • Image orientation recognition method and device, equipment and storage medium

    CN119832060A

  • An image orientation identification method, device, equipment and storage medium

    CN119832060B

  • Infrared image coding method, device and equipment for pulse neural network

    CN120747255A

  • Infrared image encoding method, device and equipment for pulse neural network

    CN120747255B

  • Impulse neural network image classification method and device based on isomorphic model progressive training

    CN121708357A