WO2023179482A1 - 一种图像处理方法、神经网络的训练方法以及相关设备 - Google Patents

一种图像处理方法、神经网络的训练方法以及相关设备 Download PDF

Info

Publication number
WO2023179482A1
WO2023179482A1 PCT/CN2023/082159 CN2023082159W WO2023179482A1 WO 2023179482 A1 WO2023179482 A1 WO 2023179482A1 CN 2023082159 W CN2023082159 W CN 2023082159W WO 2023179482 A1 WO2023179482 A1 WO 2023179482A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
processed
neural network
feature information
feature
Prior art date
Application number
PCT/CN2023/082159
Other languages
English (en)
French (fr)
Inventor
李文硕
陈汉亭
郭健元
张子阳
王云鹤
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023179482A1 publication Critical patent/WO2023179482A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of artificial intelligence, and in particular to an image processing method, a neural network training method and related equipment.
  • Artificial Intelligence is a 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.
  • artificial intelligence is a branch of computer science that attempts to understand the nature of intelligence and produce a new class of intelligent machines that can respond in a manner similar to human intelligence.
  • Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
  • Using artificial intelligence for image processing is a common application method of artificial intelligence.
  • spiking neural network (SNN), as a bionic neural network, has received widespread attention in recent years.
  • the leaky integrate and fire (LIF) module in the impulse neural network has the advantages of fast and effective calculation.
  • spiking neural networks are mainly used to process sparse data, such as processing multiple images collected by dynamic vision sensors through spiking neural networks.
  • spiking neural networks cannot be directly applied to perform mainstream general-purpose vision tasks.
  • Embodiments of the present application provide an image processing method, a neural network training method and related equipment, which enable feature extraction of a single image through the LIF module, thereby enabling the LIF module to be applied to perform mainstream general-purpose visual tasks.
  • embodiments of the present application provide an image processing method that can apply artificial intelligence technology to the field of image processing.
  • the method includes: an execution device inputs an image to be processed into a first neural network, and the image to be processed is passed through the first neural network. Perform feature extraction to obtain feature information of the image to be processed.
  • the execution device performs feature extraction on the image to be processed through the first neural network, including: the execution device obtains the first feature information corresponding to the image to be processed, the image to be processed includes a plurality of image blocks, and the first feature information includes the first feature information in the image to be processed.
  • Characteristic information of multiple image blocks is also the characteristic information of the image to be processed; the execution device inputs the characteristic information of at least two groups of image blocks into the LIF module in sequence, and obtains the target data generated by the LIF module, a group of images
  • the characteristic information of the block includes the characteristic information of at least one image block; the execution device obtains the second characteristic information corresponding to the image to be processed according to the target data.
  • the second characteristic information includes the updated characteristic information of the image block.
  • the second characteristic information is Updated feature information of the image to be processed.
  • the feature information of the entire image to be processed is divided into multiple image blocks in the image to be processed.
  • Feature information the feature information of multiple image blocks can be divided into at least two sets of feature information of image blocks, and the feature information of at least two sets of image blocks are input into the LIF module in sequence to realize the leakage and accumulation process of the LIF module, and we get
  • the target data generated by the LIF module is then used to obtain the updated feature information of the image to be processed based on the target data; through the aforementioned method, feature extraction of a single image through the LIF module is achieved, and the LIF module can be applied to execute mainstream General vision tasks, which help improve the efficiency and accuracy of the feature extraction process.
  • the execution device sequentially inputs the characteristic information of at least two groups of image blocks into the LIF module to obtain the target data generated by the LIF module, including: the execution device inputs the characteristic information of at least two groups of image blocks into the LIF module.
  • Information is input into the LIF module in turn, and when the excitation conditions of the LIF module are met, the activation function is used to generate target data.
  • the target data is not binary data, that is, the output data of the LIF module may not be pulse data, that is, the target data output by the LIF module may no longer be two fixed values, but higher-precision data; as an example,
  • the target data can be floating point data.
  • the precision of the feature information of the target data and the image block may be the same, that is, the numerical bit levels of the target data and the feature information of the image block may be the same.
  • the LIF module outputs non-binary data, which improves the accuracy of the target data output by the LIF module, so that richer feature information of the image to be processed can be extracted.
  • the advantages of fast and effective calculation of the LIF module are retained, and richer feature information can also be obtained.
  • the execution device sequentially inputs the characteristic information of at least two groups of image blocks into the LIF module, including: the execution device inputs the characteristic information of at least two groups of image blocks in multiple rounds.
  • the LIF modules are input in sequence; further, in each round, the execution device inputs the characteristic information of a set of image blocks into a LIF module.
  • the first neural network may include M parallel LIF modules, then in each round, the execution device may input the feature information of M groups of image blocks into the M parallel LIF modules at the same time, and pass them through M parallel LIF modules process the input data.
  • the characteristic information of at least two groups of image blocks includes characteristic information of multiple rows of image blocks, and the characteristic information of each row of image blocks includes characteristic information of multiple image blocks located in the same row,
  • the characteristic information of each group of image blocks includes characteristic information of at least one row of image blocks.
  • the characteristic information of at least two groups of image blocks includes characteristic information of multiple columns of image blocks, the characteristic information of each column of image blocks includes characteristic information of multiple image blocks located in the same column, and the characteristic information of each group of image blocks Includes at least one column of feature information of image blocks.
  • the excitation condition of the LIF module may include whether a value of a membrane potential in the LIF module is greater than or equal to a preset threshold.
  • the characteristic information of the image block may include characteristic information corresponding to the image block and at least one channel, correspondingly, the excitation conditions of the LIF module may include one or more thresholds, that is, the threshold values corresponding to different channels may be the same. Or different.
  • the first neural network is a multi-layer perceptron MLP, a convolutional neural network, or a neural network using a self-attention mechanism.
  • the neural network using a self-attention mechanism can also be called a Transformer. Neural Networks.
  • the first neural network is an MLP, a convolutional neural network or a residual Transformer neural network
  • the LIF module can be compatible with the image processing method provided by the embodiment of the present application. Since the MLP, convolutional neural network and residual Transformer neural network can be applied to different application scenarios, greatly expanding the application of this solution. scenarios and implementation flexibility.
  • the method further includes: the execution device performs feature processing on the feature information of the image to be processed through a second neural network to obtain a prediction result corresponding to the image to be processed, wherein the first neural network and The second neural network is included in the same target neural network, and the tasks performed by the target neural network are any of the following: image classification, image segmentation, target detection on images, or super-resolution processing on images.
  • the execution device performs feature processing on the feature information of the image to be processed through a second neural network to obtain a prediction result corresponding to the image to be processed, wherein the first neural network and The second neural network is included in the same target neural network, and the tasks performed by the target neural network are any of the following: image classification, image segmentation, target detection on images, or super-resolution processing on images.
  • embodiments of the present application provide a neural network training method that can apply artificial intelligence technology to the field of image processing.
  • the method includes: inputting an image to be processed into a first neural network, and passing the image to be processed through the first neural network. Perform feature extraction to obtain the feature information of the image to be processed, perform feature processing on the feature information of the image to be processed through the second neural network, and obtain the prediction results corresponding to the image to be processed; according to the prediction results and correct results corresponding to the image to be processed,
  • the first neural network and the second neural network are trained using a loss function indicating the similarity between the predicted results and the correct results.
  • feature extraction of the image to be processed through the first neural network includes: obtaining first feature information corresponding to the image to be processed, where the image to be processed includes a plurality of image blocks, and the first feature information includes feature information of the image blocks; and at least The characteristic information of the two groups of image blocks is sequentially input to the accumulation-leakage-excitation LIF module to obtain the target data generated by the LIF module.
  • the characteristic information of a group of image blocks includes the characteristic information of at least one image block; according to the target data, the data to be processed is obtained
  • the second feature information corresponding to the image, the second feature information includes updated feature information of the image block, and the first feature information and the second feature information are both feature information of the image to be processed.
  • the training device is also used to perform the steps performed by the execution device in each possible implementation of the first aspect.
  • inventions of the present application provide an image processing device that can apply artificial intelligence technology to the field of image processing.
  • the image processing device includes: an input unit for inputting an image to be processed into a first neural network; a feature extraction unit , used to extract features of the image to be processed through the first neural network to obtain the feature information of the image to be processed.
  • the feature extraction unit includes: an acquisition subunit, used to obtain the first feature information corresponding to the image to be processed, the image to be processed includes a plurality of image blocks, the first feature information includes the feature information of the image block; the generation subunit, Used to sequentially input the characteristic information of at least two groups of image blocks into the accumulation-leakage-excitation LIF module to obtain the target data generated by the LIF module.
  • the characteristic information of one group of image blocks includes the characteristic information of at least one image block; the acquisition subunit , used to obtain the second feature information corresponding to the image to be processed according to the target data.
  • the second feature information includes the updated feature information of the image block.
  • the first feature information and the second feature information are both feature information of the image to be processed. .
  • the image processing device is also used to execute the steps performed by the execution device in each possible implementation of the first aspect.
  • the specific implementation methods and meanings of the nouns in each possible implementation of the third aspect of this application please refer to the first aspect and various possible implementation methods of the first aspect, which will not be described again here.
  • inventions of the present application provide a neural network training device that can apply artificial intelligence technology to the field of image processing.
  • the neural network training device includes: a feature extraction unit for inputting the image to be processed into the first neural network. network, through the first neural network to extract features of the image to be processed, and obtain the feature information of the image to be processed; special The feature processing unit is used to perform feature processing on the feature information of the image to be processed through the second neural network to obtain the prediction result corresponding to the image to be processed; the training unit is used to use the prediction result and the correct result corresponding to the image to be processed.
  • the first neural network and the second neural network are trained by a loss function that indicates the similarity between the predicted results and the correct results.
  • the feature extraction unit includes: an acquisition subunit, used to obtain the first feature information corresponding to the image to be processed, the image to be processed includes a plurality of image blocks, the first feature information includes the feature information of the image block; the generation subunit, with In order to sequentially input the characteristic information of at least two groups of image blocks into the accumulation-leakage-excitation LIF module to obtain the target data generated by the LIF module, the characteristic information of one group of image blocks includes the characteristic information of at least one image block; the acquisition subunit, It is also used to obtain the second feature information corresponding to the image to be processed according to the target data.
  • the second feature information includes the updated feature information of the image block.
  • the first feature information and the second feature information are both feature information of the image to be processed. .
  • the image processing device is also used to execute the steps performed by the execution device in each possible implementation of the second aspect.
  • the beneficial effects brought about please refer to the second aspect and various possible implementation methods of the second aspect, which will not be described again here.
  • inventions of the present application provide a computer program product.
  • the computer program product includes a program. When the program is run on a computer, it causes the computer to execute the method described in the first aspect or the second aspect.
  • embodiments of the present application provide a computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium. When the program is run on a computer, it causes the computer to execute the first aspect or the second aspect. methods described in this aspect.
  • embodiments of the present application provide an execution device, including a processor and a memory.
  • the processor is coupled to the memory.
  • the memory is used to store programs; the processor is used to execute the program in the memory, so that the execution device executes the above.
  • embodiments of the present application provide a training device, including a processor and a memory.
  • the processor is coupled to the memory.
  • the memory is used to store programs; the processor is used to execute the program in the memory, so that the training device executes the above The training processing method of the neural network described in the second aspect.
  • inventions of the present application provide a chip system.
  • the chip system includes a processor and is used to support a terminal device or a communication device to implement the functions involved in the above aspects, for example, sending or processing the functions involved in the above methods. data and/or information.
  • the chip system further includes a memory, and the memory is used to store necessary program instructions and data for the terminal device or communication device.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • Figure 1a is a schematic structural diagram of the artificial intelligence main framework provided by the embodiment of the present application.
  • Figure 1b is an application scenario diagram of the image processing method provided by the embodiment of the present application.
  • Figure 2a is a system architecture diagram of the image processing system provided by an embodiment of the present application.
  • Figure 2b is a schematic flow chart of the image processing method provided by the embodiment of the present application.
  • Figure 3 is a schematic flow chart of an image processing method provided by an embodiment of the present application.
  • Figure 4 is a schematic structural diagram of the first neural network in the image processing method provided by the embodiment of the present application.
  • Figure 5 is a schematic diagram of feature information of multiple image blocks in the image processing method provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of the LIF unit in the first neural network in the image processing method provided by the embodiment of the present application;
  • Figure 7 is a schematic diagram of the characteristic information of a group of image blocks in the image processing method provided by the embodiment of the present application.
  • Figure 8 is a schematic diagram of the characteristic information of a group of image blocks in the image processing method provided by the embodiment of the present application.
  • Figure 9 is a schematic diagram of sequentially inputting the characteristic information of at least two groups of image blocks into the LIF module in the image processing method provided by the embodiment of the present application;
  • Figure 10 is a schematic diagram of sequentially inputting the characteristic information of at least two groups of image blocks into the LIF module in the image processing method provided by the embodiment of the present application;
  • Figure 11 is a schematic flow chart of a neural network training method provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • Figure 13 is a schematic structural diagram of a neural network training device provided by an embodiment of the present application.
  • Figure 14 is a schematic structural diagram of an execution device provided by an embodiment of the present application.
  • Figure 15 is a schematic structural diagram of the training equipment provided by the embodiment of the present application.
  • Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • Embodiments of the present application provide a SIMD instruction generation and processing method and related equipment for selecting second SIMD instructions from multiple sets of information on first SIMD instruction models based on the length of each cycle dimension of the tensor calculation formula.
  • the information of the model is then used to generate the first SIMD instruction converted from the first tensor calculation formula according to the second SIMD instruction model, which greatly improves the efficiency of the SIMD instruction generation process.
  • Figure 1a shows a structural schematic diagram of the artificial intelligence main framework.
  • the following is from the “intelligent information chain” (horizontal axis) and “IT value chain” ( The above artificial intelligence theme framework is elaborated on the two dimensions of vertical axis).
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has gone through the condensation process of "data-information-knowledge-wisdom".
  • the "IT value chain” reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence and information (providing and processing technology implementation) to the systematic industrial ecological process.
  • Infrastructure provides computing power support for artificial intelligence systems, enables communication with the external world, and supports it through basic platforms.
  • computing power is provided by a smart chip, which can specifically use a central processing unit (CPU), an embedded neural network processor (neural-network processing unit, NPU), a graphics processor ( Graphics processing unit (GPU), application specific integrated circuit (ASIC) or field programmable gate array (FPGA) and other hardware acceleration chips;
  • the basic platform includes distributed computing framework and network and other related platforms Guarantee and support can include cloud storage and computing, interconnection networks, etc.
  • sensors communicate with the outside world to obtain data, which are provided to smart chips in the distributed computing system provided by the basic platform for calculation.
  • Data from the upper layer of the infrastructure is used to represent data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
  • machine learning and deep learning can perform symbolic and formal intelligent information modeling, extraction, preprocessing, training, etc. on data.
  • Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formal information to perform machine thinking and problem solving based on reasoning control strategies. Typical functions are search and matching.
  • Decision-making refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of further data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, and image processing. identification, etc.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Its application fields mainly include: intelligent terminals, intelligent manufacturing, Smart transportation, smart home, smart healthcare, smart security, autonomous driving, smart city, etc.
  • the embodiments of the present application can be applied to various application fields in the field of artificial intelligence. Specifically, they can be applied to tasks of performing image processing in various application fields.
  • the aforementioned tasks include but are not limited to: feature extraction of images, image classification, image processing, etc. Segmentation, target detection on images, super-resolution processing of images, or other types of tasks, etc., are not exhaustive here.
  • Figure 1b is an application scenario diagram of the image processing method provided by the embodiment of the present application.
  • Figure 1b takes the application of the target neural network in the field of intelligent terminals as an example.
  • the training device uses the training data set to iteratively train the neural network used for image classification.
  • the training device converts the gradient The values are backpropagated to update the weight parameters of the aforementioned neural network.
  • the trained neural network can be sent to the mobile device to perform graphics classification through the neural network. It should be understood that the example in Figure 1b is only for convenience of understanding this solution and is not used to limit this solution. plan.
  • neural networks to perform target detection on collected images, that is, input the rational images collected by the autonomous vehicles into the neural network, and obtain the expected output of the neural network. Process the category and location of at least one object in the image.
  • image retouching applications may provide the function of image segmentation of input images, that is, inputting the image to be processed into a neural network, and obtaining the output of the neural network to be processed. Processes the class of each pixel in the image, each pixel is classified as foreground or background.
  • Neural networks need to be used to extract features from the collected images of users, and then the extracted images can be The obtained characteristic information is matched with the pre-registered characteristic information to determine whether the current user is a registered user, etc.
  • the graphics processing method provided by the embodiment of the present application can also be applied to other application scenarios, which are not exhaustive here.
  • the various application scenarios mentioned above in the process of using neural networks to process images, It is necessary to first perform feature extraction on the input image.
  • embodiments of the present application provide an image processing method.
  • Figure 2a is a system architecture diagram of the image processing system provided by the embodiment of the present application.
  • the image processing system 200 includes a training device 210 and a database. 220.
  • the execution device 230 includes a computing module 231.
  • the database 220 stores a training data set.
  • the training device 210 generates the first model/rule 201 and uses the training data set to iteratively train the first model/rule 201 to obtain the trained first model/rule 201.
  • the trained first model/rule 201 is deployed to the computing module 231 of the execution device 230 .
  • the first model/rule 201 may be embodied as a neural network, or may be embodied as a non-neural network model. In the embodiment of this application, only the first model/rule 201 expressed as a neural network is used as an example for explanation.
  • the execution device 230 can be embodied as different systems or devices, such as mobile phones, tablets, laptops, virtual reality (VR) devices, monitoring systems, etc. Among them, the execution device 230 can call data, codes, etc. in the data storage system 240, and can also store data, instructions, etc. in the data storage system 240.
  • the data storage system 240 may be placed in the execution device 230 , or the data storage system 240 may be an external memory relative to the execution device 230 .
  • FIG. 2a The execution device 230 can directly interact with the "user".
  • Figure 2a is only an architectural schematic diagram of two image processing systems provided by embodiments of the present invention.
  • Figure The positional relationship between the equipment, components, modules, etc. shown in does not constitute any limitation.
  • the execution device 230 and the client device may be independent devices.
  • the execution device 230 is configured with an input/output (I/O) interface to perform data interaction with the client device.
  • the "user" The image to be processed can be input to the I/O interface through the client device.
  • the execution device 230 returns the processing results to the client device through the I/O interface and provides them to the user.
  • I/O input/output
  • FIG. 2b is a schematic flowchart of a graphics processing method provided by an embodiment of the present application.
  • the execution device inputs the image to be processed into the first neural network.
  • the execution device performs feature extraction on the image to be processed through the first neural network to obtain the feature information of the image to be processed.
  • Step A2 may include: 201.
  • the execution device obtains the first feature information corresponding to the image to be processed.
  • the image to be processed Including multiple image blocks, the first characteristic information includes the characteristic information of the image blocks; 202.
  • the execution device inputs the characteristic information of at least two groups of image blocks into the LIF module in sequence, and obtains the target data generated by the LIF module.
  • the feature information includes feature information of at least one image block; 203.
  • the execution device obtains second feature information corresponding to the image to be processed according to the target data.
  • the second feature information includes updated feature information of the image block, the first feature information and
  • the second feature information is all feature information of the image to be processed.
  • the characteristic information of at least two groups of image blocks is sequentially input into the LIF module to realize the leakage and accumulation process of the LIF module, obtain the target data generated by the LIF module, and then obtain the updated image of the image to be processed based on the target data.
  • Feature information through the aforementioned method, the LIF module can be used to extract features from a single image, and then the LIF module can be applied to perform mainstream general vision tasks.
  • Figure 3 is a schematic flow chart of the image processing method provided by the embodiment of the present application.
  • the image processing method provided by the embodiment of the present application may include:
  • the execution device inputs the image to be processed into the first neural network.
  • the execution device can input the image to be processed into the first neural network, and perform feature extraction on the image to be processed through the first neural network to obtain the feature information of the image to be processed.
  • the first neural network can be specifically represented as a multilayer perceptron (MLP), a convolutional neural network (CNN), a neural network using a self-attention mechanism (self-attention), or other types of neural networks.
  • MLP multilayer perceptron
  • CNN convolutional neural network
  • self-attention self-attention mechanism
  • Neural networks Neural networks that use self-attention mechanism can also be called Transformer neural networks. The details can be flexibly determined based on actual application scenarios and are not limited here.
  • FIG 4 is a schematic structural diagram of the first neural network in the image processing method provided by the embodiment of the present application, as shown in Figure 4
  • the first neural network may include a segmentation unit and a LIF unit.
  • the first neural network may also include a channel mixing unit and an upsampling/downsampling unit.
  • the segmentation unit in the first neural network is used to perform feature extraction and segmentation of the image to be processed to obtain the initial feature information (embedding) of multiple image patches (patches) included in the image to be processed. Since multiple image patches constitute the image to be processed, image, then the feature information of multiple image blocks is also the feature information of the image to be processed.
  • the aforementioned segmentation operation is used to divide the image to be processed into multiple image blocks, and the execution order of the aforementioned feature extraction operation and segmentation operation can be flexibly determined according to the actual application scenario.
  • the characteristic information of multiple image blocks shown in Figure 4 is only for convenience in understanding the relationship between the multiple image blocks and the image to be processed. In actual situations, the characteristic information of multiple image blocks is in the form of data.
  • the LIF unit in the first neural network is used to update the feature information of the image block.
  • the aforementioned LIF unit at least includes Including the LIF module in the embodiment of this application, the aforementioned LIF unit may also include other neural network layers.
  • the specific implementation process of the LIF unit will be introduced in detail through the following steps 302 to 304.
  • the channel mixing unit in the first neural network is also used to update the feature information of the image patch.
  • Both the up-sampling unit and the down-sampling unit are used to change the size of the feature information of the image to be processed; among them, the up-sampling unit is used to perform an up-sampling operation on the feature information of the image block to enlarge Feature information of the image block; the down-sampling unit is used to perform a down-sampling operation on the feature information of the image block to reduce the feature information of the image block.
  • the first neural network can include more or less units, the positions of the LIF unit and the channel mixing unit can be adjusted, and the numbers of the LIF unit, the channel mixing unit and the upsampling/downsampling units can be adjusted. They can be the same or different, as long as there is a LIF unit in the first neural network.
  • the first neural network shown in Figure 4 is only an example to facilitate understanding of this solution, and is not used to limit this solution.
  • the execution device obtains first feature information corresponding to the image to be processed.
  • the image to be processed includes a plurality of image blocks, and the first feature information includes feature information of the image blocks.
  • the execution device may first obtain the first feature information corresponding to the image to be processed; where the image to be processed includes multiple images block, the first feature information includes feature information of the aforementioned plurality of image blocks.
  • the first feature information may include initial feature information of each image block or updated feature information of each image block.
  • the convolutional neural network layer can be used to perform the convolution operation again on the feature information of the multiple image blocks to update the feature information of the image blocks to obtain the updated The first characteristic information after.
  • the convolutional neural network layer can be specifically represented as a depthwise separable convolution layer (depth wise convolution) or other types of convolutional neural network layers. When a depthwise separable convolutional layer is selected, the efficiency of the aforementioned convolution operation can be reduced. amount of calculation.
  • the execution device sequentially inputs the characteristic information of at least two groups of image blocks into the LIF module to obtain the target data generated by the LIF module.
  • the execution device may add the multiple image blocks included in the image to be processed.
  • the characteristic information of the image blocks is divided into at least two groups of characteristic information of the image blocks.
  • the characteristic information of the at least two groups of image blocks is sequentially input into the LIF module to realize the leakage and accumulation process of the LIF module and obtain the target data generated by the LIF module.
  • the characteristic information of a group of image blocks includes characteristic information of at least one image block.
  • the execution device can sequentially input the characteristic information of at least two groups of image blocks into the LIF module, and when the excitation conditions of the LIF module are met, the activation function is used to generate target data.
  • the target data can be binary data, that is, the output of the LIF module can be two preset values.
  • the target data can also be non-binary data, that is, the LIF module may not output pulse data, that is, the target data output by the LIF module may no longer be two fixed values, but higher-precision data.
  • the target data can be floating point data.
  • the precision of the feature information of the target data and the image block may be the same, that is, the numerical bit levels of the target data and the feature information of the image block may be the same.
  • the LIF module outputs non-binary data, which improves the purpose of the LIF module output.
  • the accuracy of the target data can be improved, so that richer feature information of the image to be processed can be extracted.
  • the advantages of fast and effective calculation of the LIF module are retained, and richer feature information can be obtained. characteristic information.
  • the concept of feature information for at least two groups of image patches can include two dimensions: horizontal and vertical.
  • the image to be processed can be segmented in the two dimensions of horizontal and vertical, that is, the feature information of multiple image blocks. It may include feature information of multiple image blocks in the horizontal dimension and feature information of multiple image blocks in the vertical dimension.
  • Figure 5 is a schematic diagram of the characteristic information of multiple image blocks in the image processing method provided by the embodiment of the present application.
  • a B1 in Figure 5 can represent the characteristic information of an image block.
  • the characteristic information to be processed includes the characteristic information of 16 image blocks as an example.
  • the characteristic information of an image block can include at least one corresponding to an image block.
  • the characteristic information of an image block includes the characteristic information of multiple channels corresponding to an image block as an example; different channels can correspond to the same or different types of information.
  • a channel can be used to obtain any of the following information: color, texture, brightness or other information, etc., which is not limited here.
  • the characteristic information of the image to be processed may include the characteristic information of multiple image blocks in the horizontal dimension and the characteristic information of multiple image blocks in the vertical dimension, that is, including multi-line images. It should be understood that the example in Figure 5 is only for convenience in understanding the concept of feature information of multiple image blocks and is not used to limit this solution.
  • the execution device may determine the characteristic information of one or more rows of image blocks as the characteristic information of a group of image blocks, or the execution device may also determine the characteristic information of one or more columns of image blocks as the characteristic information of a group of image blocks. , thereby dividing the feature information of multiple image blocks into at least two groups of feature information of image blocks.
  • FIG. 6 is a schematic diagram of the LIF unit in the first neural network in the image processing method provided by the embodiment of the present application.
  • the first neural network is specifically used.
  • a LIF unit can include multiple MLP layers, a depth-separable convolution layer, a vertical LIF module and a horizontal LIF module.
  • the MLP layer refers to a neural network layer composed of at least one fully connected neuron; if the first neural network is specifically a convolutional neural network, the MLP layer can be replaced by a convolutional neural network layer; if the first neural network The network is specifically represented as a Transformer neural network, and the MLP layer can be replaced by a Transformer neural network layer.
  • the convolutional neural network layer refers to a neural network layer composed of at least one partially connected neuron
  • the Transformer neural network layer refers to a neural network layer that introduces an attention mechanism.
  • the characteristic information of each group of image blocks obtained by the vertical LIF module includes the characteristic information of at least one row of image blocks.
  • Figure 7 shows a group of image processing methods provided by embodiments of the present application.
  • C1, C2, C3 and C4 respectively represent the characteristic information of four groups of image blocks, that is, the characteristic information of multiple image blocks is divided into four groups in the vertical direction, and the characteristics of each group of image blocks
  • the information includes characteristic information of a row of image blocks. It should be understood that the example in Figure 7 is only for convenience of understanding this solution and is not used to limit this solution.
  • the characteristic information of each group of image blocks obtained by the horizontal LIF module includes the characteristic information of at least one column of image blocks, that is, in Group the feature information of multiple image blocks in the horizontal direction, and input at least two obtained groups into the horizontal LIF module in sequence.
  • Figure 8 is a schematic diagram of the characteristic information of a group of image blocks in the image processing method provided by the embodiment of the present application.
  • D1, D2, D3 and D4 represent the characteristic information of four groups of image blocks, that is, the characteristic information of multiple image blocks is divided into four groups in the horizontal direction, and the characteristics of each group of image blocks
  • the information includes characteristic information of a column of image blocks. It should be understood that the example in Figure 8 is only for convenience of understanding this solution and is not used to limit this solution.
  • one LIF unit in the first neural network may include more or fewer neural network layers.
  • the example in Figure 6 is only for convenience of understanding this solution and is not used to limit this solution.
  • the execution device can group the feature information of multiple image blocks in the vertical direction, and input the obtained feature information of at least two groups of image blocks into the vertical LIF module in sequence , that is, each time a set of feature information of image blocks is input to the vertical LIF module.
  • the execution device inputs the characteristic information of at least one row of image blocks (that is, the characteristic information of a group of image blocks) to the vertical LIF module, it will determine whether the excitation conditions of the vertical LIF module are met. If the judgment result is no, the vertical The LIF module does not need to generate any value; if the judgment result is yes, the vertical LIF module can use the activation function to generate target data and reset a membrane potential of the vertical LIF module to 0.
  • the execution device continues to input the characteristic information of the next group of image blocks to the vertical LIF module to leak and accumulate the characteristic information of the two groups of image blocks.
  • the execution device repeatedly performs the foregoing operations to complete processing the feature information of all image blocks through the vertical LIF module.
  • represents the leakage parameter of the LIF module, which is a hyperparameter.
  • V th represents the excitation condition of the LIF module, Represents the nth value in the feature information of a set of image blocks input to the LIF module in the current round (that is, the t+1th round), represents the membrane potential of the LIF module in the previous round (that is, the t-th round), Represents the membrane potential of the LIF module in the current round.
  • the LIF module can multiply the feature information of the previous round of image blocks by After the parameters are leaked, they are added to the feature information of the image blocks of the current round to obtain multiple target values included in the current round. Represents the nth value among multiple target values, when When the value is greater than the preset threshold, determine When the excitation conditions of the LIF module are met, the LIF module is stimulated to use the activation function to generate a target data.
  • the excitation conditions of the LIF module may include one or more thresholds; further, the threshold values corresponding to different channels Can be the same or different.
  • Figure 9 is a schematic diagram of sequentially inputting the characteristic information of at least two groups of image blocks into the LIF module in the image processing method provided by the embodiment of the present application.
  • Figure 9 uses a
  • the characteristic information of a group of image blocks includes the characteristic information of a row of image blocks.
  • the execution device can input the characteristic information of the first row of images (that is, the characteristic information of a group of image blocks represented by C1) into the vertical LIF module; in the second round, the execution device The characteristic information of the first row of images (that is, the characteristic information of a group of image blocks represented by C2) can be input into the vertical LIF module; in the third round, the execution device can input the characteristic information of the first row of images (also the characteristic information of a group of image blocks represented by C2).
  • the characteristic information of a group of image blocks represented by C3) is input into the vertical LIF module; in the fourth round, the execution device can input the characteristic information of the first row of images (that is, the characteristics of a group of image blocks represented by C4 Information) is input into the vertical LIF module, thereby enabling the characteristic information of the four groups of image blocks to be input into the LIF module in sequence.
  • the example in Figure 9 is only for convenience of understanding this solution and is not used to limit this solution.
  • one LIF unit of the first neural network can include M parallel vertical LIF modules, then in each round, the execution device can simultaneously input the feature information of M groups of image blocks into M parallel LIF modules. Vertical LIF module, and the input data is processed through M parallel vertical LIF modules respectively.
  • the execution device can group the feature information of multiple image blocks in the horizontal direction, and input the obtained feature information of at least two groups of image blocks into the horizontal direction in turn.
  • the LIF module that is, each time the feature information of a set of image blocks is input to the horizontal LIF module.
  • the execution device inputs the characteristic information of at least one column of image blocks (that is, the characteristic information of a group of image blocks) to the horizontal LIF module, it will determine whether the excitation conditions of the horizontal LIF module are met. If the judgment result is no, then the The horizontal LIF module does not need to generate any value; if the judgment result is yes, the horizontal LIF module can use the activation function to generate target data and reset a membrane potential of the horizontal LIF module to 0.
  • the execution device continues to input the characteristic information of the next group of image blocks to the horizontal LIF module to leak and accumulate the characteristic information of the two groups of image blocks.
  • the execution device repeatedly performs the foregoing operations to complete processing the feature information of all image blocks through the horizontal LIF module.
  • one LIF unit of the first neural network may include M parallel horizontal LIF modules, then in each round, the execution device may simultaneously input the feature information of M groups of image blocks into M parallel LIF modules.
  • horizontal LIF module horizontal LIF module, and the input data is processed through M parallel horizontal LIF modules.
  • Figure 10 is a schematic diagram of sequentially inputting the characteristic information of at least two groups of image blocks into the LIF module in the image processing method provided by the embodiment of the present application.
  • a The characteristic information of a group of image blocks includes the characteristic information of a row of image blocks, and there are two parallel horizontal LIF modules in one LIF unit as an example.
  • the execution device inputs the characteristic information of the first column of image blocks (that is, the characteristic information of a group of image blocks represented by E1) into the horizontal LIF module, and inputs the third column of image blocks into the horizontal LIF module.
  • the characteristic information (that is, the characteristic information of a group of image blocks represented by F1) is input into the horizontal LIF module, that is, the characteristic information of the two groups of image blocks is input into two parallel horizontal LIF modules in one round.
  • the execution device inputs the characteristic information of the image blocks in the second column (that is, the characteristic information of a group of image blocks represented by E2) into the horizontal LIF module, and inputs the characteristic information of the image blocks in the fourth column (that is, the characteristic information of the group of image blocks represented by E2). That is, the characteristic information of a group of image blocks represented by F2) is input into the horizontal LIF module, thereby realizing the input of the characteristic information of four groups of image blocks into two parallel levels.
  • the LIF module it should be understood that the example in Figure 10 is only for convenience of understanding this solution and is not used to limit this solution.
  • the execution device can respectively use the vertical LIF module and the horizontal LIF module to process the feature information of all image blocks included in the image to be processed.
  • the vertical LIF module and horizontal LIF The specific implementation details of the module will not be described here.
  • the execution device obtains the second feature information corresponding to the image to be processed according to the target data.
  • the second feature information includes updated feature information of the image block.
  • the execution device can obtain the second feature information corresponding to the image to be processed based on the aforementioned multiple target data.
  • the second feature information includes the updated image block
  • the first characteristic information and the second characteristic information are both characteristic information of the image to be processed.
  • the execution device may determine the plurality of target data output by the vertical LIF module or the horizontal LIF module as the second feature information corresponding to the image to be processed;
  • other neural network layers may be used to process the output multiple target data again, and the processed data may be determined as the second feature information corresponding to the image to be processed.
  • the execution device can fuse the target data output by the vertical LIF module and the horizontal LIF module, and directly determine the fused data as the third image corresponding to the image to be processed. 2. Feature information.
  • the execution device may utilize other neural network layers to perform update operations before performing the fusion operation or after performing the fusion operation.
  • the other neural network layers mentioned above may be MLP layers; if the first neural network is embodied as a convolutional neural network, the other neural network layers mentioned above may be convolutional neural network layers. ; If the first neural network is specifically embodied as a Transformer neural network, the other neural network layers mentioned above can be Transformer neural network layers, etc.; if the first neural network adopts other types of neural networks, the other neural network layers mentioned above can also be replaced by other neural network layers. Types of neural network layers, etc., will not be described in detail here.
  • the first neural network is an MLP, a convolutional neural network or a Transformer neural network
  • the LIF module can be compatible with the image processing method provided by the embodiment of the present application. Since the MLP, the convolutional neural network and the Transformer neural network It can be applied in different application scenarios, greatly expanding the application scenarios and implementation flexibility of this solution.
  • steps described in the above steps 302 to 304 are steps performed by a LIF unit in the first neural network.
  • the execution device can use other neural network layers
  • the second feature information is updated, that is, the feature information of the image to be processed is updated again.
  • steps 302 to 304 can be executed multiple times. Steps 302 to 304 and steps 302 to 304 are not limited in the embodiment of the present application.
  • the number of executions between 301 can be after executing step 301 once, executing steps 302 to 304 one or more times, and then entering step 305.
  • the execution device performs feature processing on the feature information of the image to be processed through the second neural network to obtain a prediction result corresponding to the image to be processed.
  • the execution device after the execution device generates the feature information of the image to be processed through the first neural network, it can perform feature processing on the feature information of the image to be processed through the second neural network to obtain the predetermined image corresponding to the image to be processed. test results.
  • the first neural network and the second neural network are included in the same target neural network, and the tasks performed by the target neural network are any of the following: image classification, image segmentation, target detection on images, and super-resolution processing on images. Or other types of tasks, etc.
  • the specific implementation tasks of the target neural network will not be exhaustive here.
  • the specific meaning of the prediction results corresponding to the image to be processed depends on the type of task performed by the target neural network. As an example, if the task performed by the target neural network is image classification, the prediction result corresponding to the image to be processed can be used to indicate the prediction category corresponding to the image to be processed; as another example, if the task performed by the target neural network is The task is to detect objects in images, then the prediction results corresponding to the image to be processed can be used to indicate the predicted category and predicted position of each object in the image to be processed; as another example, if the task performed by the target neural network For image segmentation, the prediction result corresponding to the image to be processed can be used to indicate the prediction category of each pixel in the image to be processed; as another example, if the task performed by the target neural network is image segmentation, then the to-be-processed
  • the prediction results corresponding to the image may include processed images, etc., which are not exhaustive here.
  • the characteristic information of the entire image to be processed is divided into the characteristic information of multiple image blocks in the image to be processed, and the characteristic information of the multiple image blocks can be divided into at least two groups of characteristic information of the image blocks.
  • Figure 11 is a schematic flow chart of the neural network training method provided by the embodiment of the present application.
  • the neural network training method provided by the embodiment of the present application may include:
  • the training device inputs the image to be processed into the first neural network.
  • the training device obtains first feature information corresponding to the image to be processed.
  • the image to be processed includes multiple image blocks, and the first feature information includes feature information of the image blocks.
  • the training device sequentially inputs the characteristic information of at least two groups of image blocks into the LIF module to realize the leakage and accumulation process of the LIF module and obtain the target data generated by the LIF module.
  • the training device obtains second feature information corresponding to the image to be processed based on the target data.
  • the second feature information includes updated feature information of the image block.
  • the training device performs feature processing on the feature information of the image to be processed through the second neural network, and obtains the prediction result corresponding to the image to be processed.
  • the training device may be configured with a training data set.
  • the training data set is used to train a target neural network.
  • the target neural network includes a first neural network and a second neural network.
  • the tasks performed by the target neural network are: Any of the following: image classification, target detection on images, image segmentation, super-resolution processing of images, or other types of tasks, etc. This is not an exhaustive list.
  • the training data set includes multiple training data.
  • Each training data includes an image to be processed and the correct result corresponding to the image to be processed.
  • the specific meaning of the correct result corresponding to the image to be processed depends on the task performed by the target neural network. type.
  • the concepts of "correct result corresponding to the image to be processed” and “prediction result corresponding to the image to be processed” are similar. The difference is that the “correct result corresponding to the image to be processed” includes correct information, and “the predicted result corresponding to the image to be processed”
  • the "prediction corresponding to the image” includes information generated by the target neural network.
  • steps 1101 to 1105 please refer to the description of steps 301 to 305 in the corresponding embodiment of Figure 3, and will not be described again here.
  • the training device uses a loss function to train the first neural network and the second neural network based on the prediction result corresponding to the image to be processed and the correct result corresponding to the image to be processed.
  • the loss function indicates the difference between the prediction result and the correct result. similarity.
  • the training device can generate the function value of the loss function based on the prediction result corresponding to the image to be processed and the correct result corresponding to the image to be processed, perform gradient derivation of the function value of the loss function, and reverse broadcast
  • the gradient value is used to update the weight parameters of the first neural network and the second neural network (that is, the target neural network) to complete a training of the first neural network and the second neural network.
  • the training device repeats steps 1101 to 1106 until the convergence condition is met.
  • the loss function indicates the similarity between the predicted result corresponding to the image to be processed and the correct result corresponding to the image to be processed.
  • the type of loss function can be flexibly selected based on the actual application scenario. As an example, if the task performed by the target neural network is image classification, the loss function can choose a cross-entropy loss function, a 0-1 loss function or other types of loss functions, etc. The examples here are only for the convenience of understanding this solution and are not used to limit this solution.
  • the convergence condition can be that the convergence condition of the loss function is satisfied or the number of iterations reaches a preset number, etc., and is not limited here.
  • ResMLP-B24, DeiT-B and AS-MLP-B are three existing neural networks.
  • the aforementioned three neural networks can be used to classify images. From the above data, it can be seen that using the model provided by the embodiment of this application The obtained classification results have the highest accuracy.
  • DNL, Swin-S and OCRNet are all existing neural networks
  • mIoU is an indicator to evaluate the accuracy of the detection results of target detection on images.
  • Figure 12 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • the image processing device 1200 includes: an input unit 1201 for inputting the image to be processed into the first neural network; a feature extraction unit 1202, Used to perform feature extraction on the image to be processed through the first neural network to obtain feature information of the image to be processed.
  • the feature extraction unit 1202 includes: an acquisition subunit 12021, used to obtain the first feature information corresponding to the image to be processed.
  • the image to be processed includes a plurality of image blocks, and the first feature information includes the feature information of the image blocks;
  • the generator Unit 12022 is used to sequentially input the characteristic information of at least two groups of image blocks into the accumulation-leakage-excitation LIF module to obtain the target data generated by the LIF module.
  • the characteristic information of one group of image blocks includes the characteristic information of at least one image block;
  • the acquisition subunit 12021 is used to obtain the second feature information corresponding to the image to be processed according to the target data.
  • the second feature information includes the updated feature information of the image block. Both the first feature information and the second feature information are to be processed. Feature information of the image.
  • the generation subunit 12022 is specifically used to input the characteristic information of at least two groups of image blocks into the LIF module in sequence.
  • the activation function is used to generate target data.
  • the target data is not Binarized data.
  • the first neural network is a multi-layer perceptron MLP, a convolutional neural network, or a neural network using a self-attention mechanism.
  • the image processing device 1200 further includes: a feature processing unit configured to perform feature processing on the feature information of the image to be processed through a second neural network to obtain a prediction result corresponding to the image to be processed, wherein the first The neural network and the second neural network are included in the same target neural network, and the tasks performed by the target neural network are any of the following: classification, segmentation, target detection, or super-resolution.
  • FIG. 13 is a schematic structural diagram of a neural network training device provided by an embodiment of the present application.
  • the neural network training device 1300 includes: a feature extraction unit 1301 for inputting the image to be processed into the first neural network, Extract features of the image to be processed through the first neural network to obtain feature information of the image to be processed; the feature processing unit 1302 is used to perform feature processing on the feature information of the image to be processed through the second neural network to obtain predictions corresponding to the image to be processed. Result; training unit 1303, used to use a loss function to train the first neural network and the second neural network according to the prediction result and the correct result corresponding to the image to be processed. The loss function indicates the similarity between the prediction result and the correct result. .
  • the feature extraction unit 1301 includes: an acquisition subunit 13011, which is used to acquire the third feature corresponding to the image to be processed.
  • a feature information, the image to be processed includes multiple image blocks, the first feature information includes the feature information of the image blocks;
  • the generation subunit 13012 is used to input the feature information of at least two groups of image blocks into the accumulation-leakage-excitation LIF module in sequence , obtain the target data generated by the LIF module, and the characteristic information of a group of image blocks includes the characteristic information of at least one image block;
  • the acquisition subunit 13011 is also used to obtain the second characteristic information corresponding to the image to be processed according to the target data,
  • the second feature information includes updated feature information of the image block, and both the first feature information and the second feature information are feature information of the image to be processed.
  • the generation subunit 13012 is specifically used to input the characteristic information of at least two groups of image blocks into the LIF module in sequence.
  • the activation function is used to generate target data.
  • the target data is not Binarized data.
  • FIG. 14 is a schematic structural diagram of an execution device provided by an embodiment of the present application.
  • the execution device 1400 may specifically be a virtual reality VR device, a mobile phone, Tablets, laptops, smart wearable devices, monitoring data processing equipment, etc. are not limited here.
  • the execution device 1400 includes: a receiver 1401, a transmitter 1402, a processor 1403 and a memory 1404 (the number of processors 1403 in the execution device 1400 can be one or more, one processor is taken as an example in Figure 14) , wherein the processor 1403 may include an application processor 14031 and a communication processor 14032.
  • the receiver 1401, the transmitter 1402, the processor 1403, and the memory 1404 may be connected by a bus or other means.
  • Memory 1404 may include read-only memory and random access memory and provides instructions and data to processor 1403 .
  • a portion of memory 1404 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 1404 stores processor and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for implementing various operations.
  • the processor 1403 controls the execution of operations of the device.
  • various components of the execution device are coupled together through a bus system.
  • the bus system may also include a power bus, a control bus, a status signal bus, etc.
  • various buses are called bus systems in the figure.
  • the methods disclosed in the above embodiments of the present application can be applied to the processor 1403 or implemented by the processor 1403.
  • the processor 1403 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 1403 .
  • the above-mentioned processor 1403 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (ASIC), a field programmable Gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the processor 1403 can implement or execute each method, step and logical block diagram disclosed in the embodiment of this application.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the methods disclosed in the embodiments of this application can be directly
  • the implementation is implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 1404.
  • the processor 1403 reads the information in the memory 1404 and completes the steps of the above method in combination with its hardware.
  • the receiver 1401 may be configured to receive input numeric or character information and generate signal inputs related to performing relevant settings and functional controls of the device.
  • the transmitter 1402 can be used to output numeric or character information through the first interface; the transmitter 1402 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1402 can also include a display device such as a display screen .
  • the processor 1403 is used to execute the image processing method executed by the execution device in the corresponding embodiments of FIG. 3 to FIG. 10 .
  • the application processor 14031 is used to perform the following steps:
  • the image to be processed is input into the first neural network, and features of the image to be processed are extracted through the first neural network to obtain feature information of the image to be processed.
  • Extracting features of the image to be processed through the first neural network includes: obtaining first feature information corresponding to the image to be processed, where the image to be processed includes a plurality of image blocks, and the first feature information includes feature information of the image blocks;
  • the characteristic information of the image blocks is input into the accumulation-leakage-excitation LIF module in sequence to obtain the target data generated by the LIF module.
  • the characteristic information of a group of image blocks includes the characteristic information of at least one image block; according to the target data, the image to be processed is obtained.
  • the corresponding second feature information includes updated feature information of the image block, and both the first feature information and the second feature information are feature information of the image to be processed.
  • FIG. 15 is a schematic structural diagram of the training device provided by the embodiment of the present application.
  • the training device 1500 is implemented by one or more servers.
  • the training device 1500 There may be relatively large differences due to different configurations or performance, and may include one or more central processing units (CPU) 1522 (for example, one or more processors) and memory 1532, one or more storage applications Storage medium 1530 for program 1542 or data 1544 (eg, one or more mass storage devices).
  • the memory 1532 and the storage medium 1530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device.
  • the central processor 1522 may be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the training device 1500 .
  • the training device 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and/or, one or more operating systems 1541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and so on.
  • operating systems 1541 such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and so on.
  • the central processor 1522 is used to execute the image processing method executed by the training device in the corresponding embodiment of FIG. 12 . Specifically, the central processing unit 1522 is used to perform the following steps:
  • the image to be processed is input into the first neural network, and features of the image to be processed are extracted through the first neural network to obtain The characteristic information of the image to be processed is obtained, and the characteristic information of the image to be processed is processed through the second neural network to obtain the prediction result corresponding to the image to be processed; according to the prediction result and the correct result corresponding to the image to be processed, the loss function is used to The first neural network and the second neural network are trained, and the loss function indicates the similarity between the predicted results and the correct results.
  • feature extraction of the image to be processed through the first neural network includes: obtaining first feature information corresponding to the image to be processed, where the image to be processed includes a plurality of image blocks, and the first feature information includes feature information of the image blocks; and at least The characteristic information of the two groups of image blocks is sequentially input to the accumulation-leakage-excitation LIF module to obtain the target data generated by the LIF module.
  • the characteristic information of a group of image blocks includes the characteristic information of at least one image block; according to the target data, the data to be processed is obtained
  • the second feature information corresponding to the image, the second feature information includes updated feature information of the image block, and the first feature information and the second feature information are both feature information of the image to be processed.
  • An embodiment of the present application also provides a computer program product that, when run on a computer, causes the computer to perform the steps performed by the execution device in the method described in the embodiments shown in FIGS. 3 to 10, or, causes the computer to perform The computer performs the steps performed by the training device in the method described in the embodiment shown in FIG. 11 .
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a program for signal processing. When it is run on a computer, it causes the computer to execute the steps shown in Figures 3 to 10. The steps performed by the execution device in the method described in the embodiment shown in this embodiment, or the computer is caused to perform the steps performed by the training device in the method described in the embodiment shown in FIG. 11 .
  • the image processing device, neural network training device, execution device or training device provided by the embodiment of the present application may specifically be a chip.
  • the chip includes: a processing unit and a communication unit.
  • the processing unit may be, for example, a processor.
  • the communication unit may be, for example, a processor. It can be an input/output interface, pin or circuit, etc.
  • the processing unit can execute the computer execution instructions stored in the storage unit, so that the chip executes the image processing method described in the embodiment shown in FIGS. 3 to 10, or to cause the chip in the training device to execute the embodiment shown in FIG. 11. Describes training methods for neural networks.
  • the storage unit is a storage unit within the chip, such as a register, cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM Read-only memory
  • RAM random access
  • Figure 16 is a structural schematic diagram of a chip provided by an embodiment of the present application.
  • the chip can be represented as a neural network processor NPU 160.
  • the NPU 160 serves as a co-processor and is mounted to the main CPU (Host). CPU), tasks are allocated by the Host CPU.
  • the core part of the NPU is the arithmetic circuit 1603.
  • the arithmetic circuit 1603 is controlled by the controller 1604 to extract the matrix data in the memory and perform multiplication operations.
  • the computing circuit 1603 internally includes multiple processing units (Process Engine, PE).
  • arithmetic circuit 1603 is a two-dimensional systolic array.
  • the arithmetic circuit 1603 may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • arithmetic circuit 1603 is a general-purpose matrix processor.
  • the arithmetic circuit obtains the corresponding data of matrix B from the weight memory 1602 and caches it on each PE in the arithmetic circuit.
  • the operation circuit takes matrix A data and matrix B from the input memory 1601 to perform matrix operations, and the partial result or final result of the matrix is stored in an accumulator (accumulator) 1608 .
  • the unified memory 1606 is used to store input data and output data.
  • the weight data directly passes through the storage unit access controller (Direct Memory Access Controller, DMAC) 1605, and the DMAC is transferred to the weight memory 1602.
  • Input data is also transferred to unified memory 1606 via DMAC.
  • DMAC Direct Memory Access Controller
  • BIU is the Bus Interface Unit, that is, the bus interface unit 1610, which is used for the interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1609.
  • IFB Instruction Fetch Buffer
  • the bus interface unit 1610 (Bus Interface Unit, BIU for short) is used to fetch the memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
  • BIU Bus Interface Unit
  • DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1606 or the weight data to the weight memory 1602 or the input data to the input memory 1601 .
  • the vector calculation unit 1607 includes multiple arithmetic processing units, and if necessary, further processes the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc.
  • vector calculation unit 1607 can store the processed output vectors to unified memory 1606 .
  • the vector calculation unit 1607 can apply a linear function and/or a nonlinear function to the output of the operation circuit 1603, such as linear interpolation on the feature plane extracted by the convolution layer, or a vector of accumulated values, to generate an activation value.
  • vector calculation unit 1607 generates normalized values, pixel-wise summed values, or both.
  • the processed output vector can be used as an activation input to the arithmetic circuit 1603, such as for use in a subsequent layer in a neural network.
  • the instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
  • the unified memory 1606, the input memory 1601, the weight memory 1602 and the fetch memory 1609 are all On-Chip memories. External memory is private to the NPU hardware architecture.
  • each layer in the first neural network and the second neural network shown in FIGS. 3 to 11 may be performed by the operation circuit 1603 or the vector calculation unit 1607 .
  • the processor mentioned in any of the above places may be a general central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control program execution of the method of the first aspect.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separate.
  • the physical unit can be located in one place, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between modules indicates that there is a communication connection between them, which can be implemented as a Or multiple communication buses or signal lines.
  • the present application can be implemented by software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, Special components, etc. to achieve. In general, all functions performed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. circuit etc. However, for this application, software program implementation is a better implementation in most cases. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to cause a computer device (which can be a personal computer, training device, or network device, etc.) to execute the steps described in various embodiments of this application. method.
  • a computer device which can be a personal computer, training device, or network device, etc.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training equipment or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (Solid State Disk, SSD)), etc.

Abstract

一种图像处理方法、神经网络的训练方法以及相关设备,该方法可将人工智能技术应用于图像处理领域中,方法包括:通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息;前述通过第一神经网络对待处理图像进行特征提取,包括:获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据;根据目标数据,获取待处理图像包括图像块的更新后的特征信息。实现了通过LIF模块对单个的图像进行特征提取,进而能够实现将LIF模块应用于执行主流的通用视觉任务。

Description

一种图像处理方法、神经网络的训练方法以及相关设备
本申请要求于2022年03月25日提交中国专利局、申请号为202210302717.6、发明名称为“一种图像处理方法、神经网络的训练方法以及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,尤其涉及一种图像处理方法、神经网络的训练方法以及相关设备。
背景技术
人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式作出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。利用人工智能进行图像处理是人工智能常见的一个应用方式。
目前,脉冲神经网络(spiking neural network,SNN)作为一种仿生的神经网络,近年来得到了广泛关注。脉冲神经网络中的累积-泄露-激发(leaky integrate and fire,LIF)模块具有计算快捷且有效的优点。
但脉冲神经网络主要应用于处理稀疏数据,例如通过脉冲神经网络处理由动态视觉传感器采集到的多个图片,但脉冲神经网络无法直接应用于执行主流的通用视觉任务。
发明内容
本申请实施例提供了一种图像处理方法、神经网络的训练方法以及相关设备,实现了通过LIF模块对单个的图像进行特征提取,进而能够实现将LIF模块应用于执行主流的通用视觉任务。
为解决上述技术问题,本申请实施例提供以下技术方案:
第一方面,本申请实施例提供一种图像处理方法,可将人工智能技术应用于图像处理领域中,方法包括:执行设备将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息。其中,执行设备通过第一神经网络对待处理图像进行特征提取,包括:执行设备获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括待处理图像中的多个图像块的特征信息,第一特征信息也是待处理图像的特征信息;执行设备将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;执行设备根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第二特征信息为待处理图像的更新后的特征信息。
本实现方式中,整个待处理图像的特征信息被划分成了待处理图像中的多个图像块的 特征信息,多个图像块的特征信息可以被划分为至少两组图像块的特征信息,将至少两组图像块的特征信息依次输入LIF模块,以实现LIF模块的泄露和累积过程,得到LIF模块生成的目标数据,进而根据目标数据,获取待处理图像的更新后特征信息;通过前述方式,以实现通过LIF模块对单个的图像进行特征提取,进而能够实现将LIF模块应用于执行主流的通用视觉任务,有利于提高特征提取过程的效率和准确率。
在第一方面的一种可能实现方式中,执行设备将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据,包括:执行设备将至少两组图像块的特征信息依次输入LIF模块,当满足LIF模块的激发条件时,利用激活函数生成目标数据。
其中,目标数据不是二值化数据,也即LIF模块输出的可以不是脉冲数据,也即LIF模块输出的目标数据可以不再是两个固定的值,而是更高精度的数据;作为示例,例如目标数据可以为浮点型数据。可选地,目标数据和图像块的特征信息的精度可以相同,也即目标数据和图像块的特征信息的数值位水平可以相同。
本实现方式中,LIF模块输出的为非二值化的数据,也即提高了LIF模块输出的目标数据的精度,从而能够提取到待处理图像更为丰富的特征信息,则在对待处理图像进行特征提取的过程中,既保留了LIF模块计算快捷且有效的优点,也能够获取到更为丰富的特征信息。
在第一方面的一种可能实现方式中,执行设备将至少两组图像块的特征信息依次输入LIF模块,包括:执行设备在多个轮次中,将至少两组图像块的特征信息依次输入LIF模块;进一步地,在每个轮次中,执行设备将一组图像块的特征信息输入一个LIF模块中。可选地,第一神经网络可以包括M个并行的LIF模块,则在每个轮次中,执行设备可以同时将M组图像块的特征信息分别输入M个并行的LIF模块,并分别通过M个并行的LIF模块对输入的数据进行处理。
在第一方面的一种可能实现方式中,至少两组图像块的特征信息包括多行图像块的特征信息,每行图像块的特征信息包括位于同一行的多个图像块的特征信息,每组图像块的特征信息包括至少一行图像块的特征信息。和/或,至少两组图像块的特征信息包括多列图像块的特征信息,每列图像块的特征信息包括位于同一列的多个图像块的特征信息,每组图像块的特征信息包括至少一列图像块的特征信息。
在第一方面的一种可能实现方式中,LIF模块的激发条件可以包括LIF模块中一个膜电位的值是否大于或等于预设阈值。进一步地,由于图像块的特征信息可以包括图像块与至少一个通道对应的特征信息,对应的,LIF模块的激发条件可以包括一个或多个阈值,也即不同通道所对应的阈值取值可以相同或不同。
在第一方面的一种可能实现方式中,第一神经网络为多层感知机MLP、卷积神经网络或采用自注意力机制的神经网络,采用自注意力机制的神经网络也可以称为Transformer神经网络。
本实现方式中,无论第一神经网络为MLP、卷积神经网络还是残差Transformer神经网络,均能通过本申请实施例提供的图像处理方法兼容LIF模块,由于MLP、卷积神经网络和残差Transformer神经网络可以应用于不同的应用场景中,大大扩展了本方案的应用 场景以及实现灵活性。
在第一方面的一种可能实现方式中,方法还包括:执行设备通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果,其中,第一神经网络和第二神经网络包含于同一个目标神经网络,目标神经网络所执行的任务为如下任一种:图像分类、图像分割、对图像进行目标检测或对图像进行超分处理。本申请实施例中,提供了本方案的多种应用场景,大大扩展了本方案的实现灵活性。
第二方面,本申请实施例提供一种神经网络的训练方法,可将人工智能技术应用于图像处理领域中,方法包括:将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息,通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果;根据待处理图像所对应的预测结果和正确结果,利用损失函数对第一神经网络和第二神经网络进行训练,损失函数指示预测结果和正确结果之间的相似度。
其中,通过第一神经网络对待处理图像进行特征提取,包括:获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
本申请第二方面中,训练设备还用于执行第一方面的各个可能实现方式中执行设备所执行的步骤,本申请第二方面的各个可能实现方式中步骤的具体实现方式、名词的含义以及所带来的有益效果,均可以参阅第一方面,此处不再赘述。
第三方面,本申请实施例提供一种图像处理装置,可将人工智能技术应用于图像处理领域中,图像处理装置包括:输入单元,用于将待处理图像输入第一神经网络;特征提取单元,用于通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息。
其中,特征提取单元,包括:获取子单元,用于获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;生成子单元,用于将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;获取子单元,用于根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
本申请第三方面中,图像处理装置还用于执行第一方面的各个可能实现方式中执行设备所执行的步骤,本申请第三方面的各个可能实现方式中步骤的具体实现方式、名词的含义以及所带来的有益效果,均可以参阅第一方面以及第一方面的各个可能实现方式,此处不再赘述。
第四方面,本申请实施例提供一种神经网络的训练装置,可将人工智能技术应用于图像处理领域中,神经网络的训练装置包括:特征提取单元,用于将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息;特 征处理单元,用于通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果;训练单元,用于根据待处理图像所对应的预测结果和正确结果,利用损失函数对第一神经网络和第二神经网络进行训练,损失函数指示预测结果和正确结果之间的相似度。
其中,特征提取单元包括:获取子单元,用于获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;生成子单元,用于将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;获取子单元,还用于根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
本申请第四方面中,图像处理装置还用于执行第二方面的各个可能实现方式中执行设备所执行的步骤,本申请第四方面的各个可能实现方式中步骤的具体实现方式、名词的含义以及所带来的有益效果,均可以参阅二方面以及第二方面的各个可能实现方式,此处不再赘述。
第五方面,本申请实施例提供了一种计算机程序产品,计算机程序产品包括程序,当该程序在计算机上运行时,使得计算机执行上述第一方面或第二方面所述的方法。
第六方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当该程序在计算机上运行时,使得计算机执行上述第一方面或第二方面所述的方法。
第七方面,本申请实施例提供了一种执行设备,包括处理器和存储器,处理器与存储器耦合,存储器,用于存储程序;处理器,用于执行存储器中的程序,使得执行设备执行上述第一方面所述的图像处理方法。
第八方面,本申请实施例提供了一种训练设备,包括处理器和存储器,处理器与存储器耦合,存储器,用于存储程序;处理器,用于执行存储器中的程序,使得训练设备执行上述第二方面所述的神经网络的训练处理方法。
第九方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持终端设备或通信设备实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存终端设备或通信设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
附图说明
图1a为本申请实施例提供的人工智能主体框架的一种结构示意图;
图1b为本申请实施例提供的图像处理方法的一种应用场景图;
图2a为本申请实施例提供的图像处理系统的一种系统架构图;
图2b为本申请实施例提供的图像处理方法的一种流程示意图;
图3为本申请实施例提供的图像处理方法的一种流程示意图;
图4为本申请实施例提供的图像处理方法中第一神经网络的一种结构示意图;
图5为本申请实施例提供的图像处理方法中多个图像块的特征信息的一种示意图;
图6为本申请实施例提供的图像处理方法中第一神经网络中的LIF单元的一个示意图;
图7为本申请实施例提供的图像处理方法中一组图像块的特征信息的一种示意图;
图8为本申请实施例提供的图像处理方法中一组图像块的特征信息的一种示意图;
图9为本申请实施例提供的图像处理方法中将至少两组图像块的特征信息依次输入LIF模块的一种示意图;
图10为本申请实施例提供的图像处理方法中将至少两组图像块的特征信息依次输入LIF模块的一种示意图;
图11为本申请实施例提供的神经网络的训练方法的一种流程示意图;
图12为本申请实施例提供的图像处理装置的一种结构示意图;
图13为本申请实施例提供的神经网络的训练装置的一种结构示意图;
图14为本申请实施例提供的执行设备的一种结构示意图;
图15为本申请实施例提供的训练设备的一种结构示意图;
图16为本申请实施例提供的芯片的一种结构示意图。
具体实施方式
本申请实施例提供了一种SIMD指令的生成、处理方法以及相关设备,用于根据张量计算式的每个循环维度的长度,从多组第一SIMD指令模型的信息中选取第二SIMD指令模型的信息,进而根据第二SIMD指令模型,生成第一张量计算式转换后的第一SIMD指令,大大提高了SIMD指令生成过程的效率。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
首先对人工智能系统总体工作流程进行描述,请参见图1a,图1a示出的为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片提供,该智能芯片具体可以采用中央处理器(central processing unit,CPU)、嵌入式神经网络处理器(neural-network processing unit,NPU)、图形处理器(graphics processing unit,GPU)、专用集成电路(application specific integrated circuit,ASIC)或现场可编程门阵列(field programmable gate array,FPGA)等硬件加速芯片;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能制造、智能交通、智能家居、智能医疗、智能安防、自动驾驶、智慧城市等。
本申请实施例可以应用于人工智能领域的各个应用领域中,具体的,可以应用于在各个应用领域中执行图像处理的任务,前述任务包括但不限于:对图像进行特征提取,图像分类、图像分割、对图像进行目标检测、对图像进行超分处理或其他类型的任务等,此处不做穷举。
作为示例,在智能终端、智能家居、智能安防或其他应用领域中,均可以存在利用神经网络进行图像分类的需求。为更直观地理解本方案,请参阅图1b,图1b为本申请实施例提供的图像处理方法的一种应用场景图。图1b中以将目标神经网络应用于智能终端领域为例,在训练阶段,训练设备利用训练数据集对用于进行图像分类的神经网络进行迭代训练,在每次训练过程中,训练设备将梯度值反向传播以更新前述神经网络的权重参数。在 对目标神经网络完成训练操作后,可以将训练好的神经网络发送至移动设备端,以通过该神经网络进行图形分类,应理解,图1b中的示例仅为方便理解本方案,不用于限定本方案。
作为另一示例,例如在自动驾驶领域中,可以存在利用神经网络对采集到的图像进行目标检测的需求,也即将自动驾驶车辆采集到的理图像输入神经网络中,得到该神经网络输出的待处理图像中至少一个物体的类别和位置。
作为另一示例,例如在智能终端领域中,在修图类的应用程序中可能会提供对输入的图像进行图像分割的功能,也即将待处理图像输入神经网络中,得到该神经网络输出的待处理图像中每个像素的类别,每个像素的类别为前景或背景。
作为另一示例,例如在智能安防、智慧城市等领域中,可能会存在对采集到的图像进行超分处理的需求,也即将监控设备采集到的图像输入神经网络中,得到该神经网络输出的处理后的图像,该处理后的图像的分辨率更高。
作为另一示例,例如在智能终端、智能安防领域中,可能会存在基于采集到的图像进行人脸识别的需求,则需要利用神经网络对采集到的用户的图像进行特征提取,进而可以将提取到的特征信息与预先注册的特征信息进行匹配,以确定当前用户是否为已注册的用户等。
需要说明的是,本申请实施例提供的图形处理方法还可以应用于其他应用场景中,此处不做穷举,在上述种种应用场景中,在利用神经网络对图像进行处理的过程中,均需要先对输入的图像进行特征提取,为了能够将LIF模块应用于单个图像的特征提取过程中,本申请实施例提供了一种图像处理方法。
以下先结合图2a对本申请实施例的图像处理系统进行介绍,图2a为本申请实施例提供的图像处理系统的一种系统架构图,在图2a中,图像处理系统200包括训练设备210、数据库220、执行设备230和数据存储系统240,执行设备230中包括计算模块231。
其中,数据库220中存储有训练数据集合,训练设备210生成第一模型/规则201,并利用训练数据集合对第一模型/规则201进行迭代训练,得到训练后的第一模型/规则201,将训练后的第一模型/规则201部署至执行设备230的计算模块231中。第一模型/规则201可以具体表现为神经网络,也可以表现为非神经网络的模型,本申请实施例中仅以第一模型/规则201表现为神经网络为例进行说明。
执行设备230具体可以表现为不同的系统或设备,例如手机、平板、笔记本电脑、虚拟现实(virtual reality,VR)设备、监控系统等等。其中,执行设备230可以调用数据存储系统240中的数据、代码等,也可以将数据、指令等存入数据存储系统240中。数据存储系统240可以置于执行设备230中,也可以为数据存储系统240相对执行设备230是外部存储器。
本申请的一些实施例中,请参阅图2a,执行设备230可以直接与“用户”进行交互,需要说明的是,图2a仅是本发明实施例提供的两种图像处理系统的架构示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制。例如,在本申请的另一些实施例中,执行设备230和客户设备可以为分别独立的设备,执行设备230配置有输入/输出(I/O)接口,与客户设备进行数据交互,“用户”可以通过客户设备向I/O接口输入待处理图像, 执行设备230通过I/O接口将处理结果返回给客户设备,提供给用户。
结合上述描述,请参阅图2b,图2b为本申请实施例提供的图形处理方法的一种流程示意图。A1、执行设备将待处理图像输入第一神经网络。A2、执行设备通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息;其中,步骤A2可以包括:201、执行设备获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;202、执行设备将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;203、执行设备根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
本实现方式中,将至少两组图像块的特征信息依次输入LIF模块,以实现LIF模块的泄露和累积过程,得到LIF模块生成的目标数据,进而根据目标数据,获取待处理图像的更新后特征信息;通过前述方式,以实现通过LIF模块对单个的图像进行特征提取,进而能够实现将LIF模块应用于执行主流的通用视觉任务。
结合上述描述,下面开始对本申请实施例提供的图像处理方法的推理阶段和训练阶段的具体实现流程进行描述。
一、推理阶段
本申请实施例中,具体的,请参阅图3,图3为本申请实施例提供的图像处理方法的一种流程示意图,本申请实施例提供的图像处理方法可以包括:
301、执行设备将待处理图像输入第一神经网络。
本申请实施例中,执行设备在获取到待处理图像之后,可以将待处理图像输入第一神经网络中,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息。
其中,第一神经网络具体可以表现为多层感知机(multilayer perceptron,MLP)、卷积神经网络(convolutional neural network,CNN)、采用自注意力机制(self-attention)的神经网络或其他类型的神经网络,采用自注意力机制的神经网络也可以称为Transformer神经网络,具体可以结合实际应用场景灵活确定,此处不做限定。
为了更直观地理解本方案,以下先结合图4对第一神经网络的整体架构进行说明,图4为本申请实施例提供的图像处理方法中第一神经网络的一种结构示意图,如图4所示,第一神经网络可以包括分割单元和LIF单元,可选地,第一神经网络还可以包括通道混合(channel mixing)单元和上采样/下采样单元。
第一神经网络中的分割单元用于对待处理图像进行特征提取和分割,以得到待处理图像包括的多个图像块(patch)的初始的特征信息(embedding),由于多个图像块组成待处理图像,则多个图像块的特征信息也就是待处理图像的特征信息。其中,前述分割操作用于将待处理图像切分为多个图像块,前述特征提取操作和分割操作的执行顺序可以根据实际应用场景灵活确定。需要说明的是,图4示出的多个图像块的特征信息仅为方便理解多个图像块和待处理图像的关系,在实际情况中多个图像块特征信息表现为数据的形式。
第一神经网络中的LIF单元用于对图像块的特征信息进行更新,前述LIF单元至少包 括本申请实施例中的LIF模块,前述LIF单元还可以包括其他神经网络层,对于LIF单元的具体实现过程将会通过如下步骤302至304进行详细介绍。
第一神经网络中的通道混合单元也用于对图像块的特征信息进行更新。上采样(up-sampling)单元和下采样(down-sampling)单元均用于改变待处理图像的特征信息的尺寸;其中,上采样单元用于对图像块的特征信息执行上采样操作,以放大图像块的特征信息;下采样单元用于对图像块的特征信息执行下采样操作,以缩小图像块的特征信息。
需要说明的是,在实际应用中,第一神经网络可以包括更多或更少的单元,LIF单元和通道混合单元的位置可以调整,LIF单元、通道混合单元和上采样/下采样单元的数量可以相同或不同,只要第一神经网络中存在LIF单元即可,图4中示出的第一神经网络仅为方便理解本方案的一种示例,不用于限定本方案。
302、执行设备获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息。
本申请实施例中,执行设备在通过LIF模块对多个图像块的初始的特征信息进行更新的之前,可以先获取待处理图像所对应的第一特征信息;其中,待处理图像包括多个图像块,第一特征信息包括前述多个图像块的特征信息。
进一步地,第一特征信息包括的可以为每个图像块的初始的特征信息,也可以为每个图像块的更新后的特征信息。
可选地,执行设备获取待处理图像所对应的第一特征信息之后,可以利用卷积神经网络层对多个图像块的特征信息再次执行卷积操作,以更新图像块的特征信息,得到更新后的第一特征信息。其中,该卷积神经网络层具体可以表现为深度可分离卷积层(depth wise convolution)或其他类型的卷积神经网络层,当选用深度可分离卷积层时,能够降低前述卷积操作的计算量。
303、执行设备将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据。
本申请实施例中,执行设备在获取到待处理图像包括的多个图像块的特征信息(也即第一特征信息或更新后的第一特征信息)后,可以将待处理图像包括的多个图像块的特征信息分为至少两组图像块的特征信息,将至少两组图像块的特征信息依次输入LIF模块,以实现LIF模块的泄露和累积过程,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息。
具体的,执行设备可以将至少两组图像块的特征信息依次输入LIF模块,当满足LIF模块的激发条件时,利用激活函数生成目标数据。
其中,目标数据可以为二值化的数据,也即LIF模块输出的可以为预设的两个值。或者,目标数据也可以为非二值化的数据,也即LIF模块输出的可以不是脉冲数据,也即LIF模块输出的目标数据可以不再是两个固定的值,而是更高精度的数据;作为示例,例如目标数据可以为浮点型数据。可选地,目标数据和图像块的特征信息的精度可以相同,也即目标数据和图像块的特征信息的数值位水平可以相同。
本申请实施例中,LIF模块输出的为非二值化的数据,也即提高了LIF模块输出的目 标数据的精度,从而能够提取到待处理图像更为丰富的特征信息,则在对待处理图像进行特征提取的过程中,既保留了LIF模块计算快捷且有效的优点,也能够获取到更为丰富的特征信息。
针对至少两组图像块的特征信息的概念。待处理图像可以包括水平(horizontal)和垂直(vertical)两个方向维度,对应的,则可以在水平和垂直这两个方向维度上对待处理图像进行切分,也即多个图像块的特征信息可以包括在水平这个维度上的多个图像块的特征信息和在垂直这个维度上的多个图像块的特征信息。
为了更直观地理解本方案,请参阅图5,图5为本申请实施例提供的图像处理方法中多个图像块的特征信息的一种示意图。图5中的一个B1可以代表一个图像块的特征信息,图5中以待处理的特征信息包括16个图像块的特征信息为例,一个图像块的特征信息可以包括与一个图像块对应的至少一个通道(channel)的特征信息,图5中以一个图像块的特征信息包括与一个图像块对应的多个通道的特征信息为例;不同的通道所对应的可以为相同或不同类型的信息,作为示例,例如一个通道可以用于获取如下任一种信息:颜色、纹理、亮度或其他信息等,此处不做限定。
如图5所示,待处理图像的特征信息可以包括在水平这个方向维度上的多个图像块的特征信息和在垂直这个方向维度上的多个图像块的特征信息,也即包括多行图像块的特征信息和多列图像块的特征信息,应理解,图5中的示例仅为方便理解多个图像块的特征信息这一概念,不用于限定本方案。
执行设备可以将一行或多行图像块的特征信息确定为一组图像块的特征信息,或者,执行设备也可以将一列或多列图像块的特征信息确定为一组图像块的特征信息,从而将多个图像块的特征信息划分为至少两组图像块的特征信息。
针对将至少两组图像块的特征信息依次输入LIF模块的过程。在第一神经网络的一个LIF单元中可以有一个或多个LIF模块。为了更直观地理解本方案,请参阅图6至图8,图6为本申请实施例提供的图像处理方法中第一神经网络中的LIF单元的一个示意图,图6中以第一神经网络具体表现为MLP为例,如图所示,一个LIF单元可以包括多个MLP层、一个深度可分离卷积层、一个垂直LIF模块和一个水平LIF模块。
其中,MLP层指的是由至少一个全连接的神经元组成的神经网络层;若第一神经网络具体表现为卷积神经网络,则MLP层可以替换为卷积神经网络层;若第一神经网络具体表现为Transformer神经网络,则MLP层可以替换为Transformer神经网络层。进一步地,卷积神经网络层指的是由至少一个部分连接的神经元组成的神经网络层,Transformer神经网络层指的是引入了注意力机制的神经网络层。
垂直LIF模块获取的每组图像块的特征信息包括至少一行图像块的特征信息,为更直观地理解本方案,请参阅图7,图7为本申请实施例提供的图像处理方法中一组图像块的特征信息的一种示意图。如图7所示,C1、C2、C3和C4分别代表四组图像块的特征信息,也即在垂直方向上将多个图像块的特征信息分为四组,每组图像块的特征信息包括一行图像块的特征信息,应理解,图7中的示例仅为方便理解本方案,不用于限定本方案。
水平LIF模块获取的每组图像块的特征信息包括至少一列图像块的特征信息,也即在 水平方向上对多个图像块的特征信息进行分组,将得到的至少两组依次输入水平LIF模块。为更直观地理解本方案,请参阅图8,图8为本申请实施例提供的图像处理方法中一组图像块的特征信息的一种示意图。如图8所示,D1、D2、D3和D4分代表四组图像块的特征信息,也即在水平方向上将多个图像块的特征信息分为四组,每组图像块的特征信息包括一列图像块的特征信息,应理解,图8中的示例仅为方便理解本方案,不用于限定本方案。
需要说明的是,第一神经网络中的一个LIF单元可以包括更多或更少的神经网络层,图6中的示例仅为方便理解本方案,不用于限定本方案。
具体的,若第一神经网络中包括垂直LIF模块,则执行设备可以在垂直方向上对多个图像块的特征信息进行分组,将得到的至少两组图像块的特征信息依次输入垂直LIF模块,也即每次向垂直LIF模块输入一组图像块的特征信息。
执行设备每次向垂直LIF模块输入至少一行图像块的特征信息(也即一组图像块的特征信息)之后,会判断是否满足垂直LIF模块的激发条件,若判断结果为否,则该垂直LIF模块可以不生成任何值;若判断结果为是,则该垂直LIF模块可以利用激活函数生成目标数据,并将垂直LIF模块的一个膜电位重置为0。执行设备继续向垂直LIF模块输入下一组图像块的特征信息,以对两组图像块的特征信息进行泄露和累积。执行设备重复执行前述操作,以通过垂直LIF模块将所有的图像块的特征信息处理完毕。
为了进一步地理解本方案,以下公开LIF模块的具体实现方式的一个公式:
其中,τ代表LIF模块的泄露参数,是一个超参数,当的取值大于Vth时,的取值为1,当的取值小于或等于Vth时,的取值为0,Vth代表LIF模块的激发条件,代表当前轮次(也即第t+1轮次)输入LIF模块的一组图像块的特征信息中的第n个值,代表上一轮次(也即第t轮次)LIF模块的膜电位,代表当前轮次LIF模块的膜电位。当满足LIF模块的激发条件时,LIF模块生成的计算公式如下:
其中,和Vth可以参阅上述描述进行理解,ReLU为激活函数的一种示例,应理解,式(1)和式(2)中的示例仅为方便理解本方案,不用于限定本方案。
进一步地,两组图像块的特征信息的数据尺寸一致,也即两组图像块的特征信息包括的值可以一一对应,则LIF模块可以将上一轮的图像块的特征信息乘以泄露参数之后,与当前轮的图像块的特征信息相加得到当前轮所包括的多个目标值,代表多个目标值中的第n个值,当的取值大于预设阈值时,确定满足LIF模块的激发条件,激发LIF模块利用激活函数生成一个目标数据。
更进一步地,由于图像块的特征信息可以包括图像块与至少一个通道对应的特征信息,对应的,LIF模块的激发条件可以包括一个或多个阈值;进一步地,不同通道所对应的阈值取值可以相同或不同。
为了更直观地理解本方案,请参阅图9,图9为本申请实施例提供的图像处理方法中将至少两组图像块的特征信息依次输入LIF模块的一种示意图,图9中以一组图像块的特征信息包括一行图像块的特征信息为例。其中,在第一轮次中,执行设备可以将第一行图像的特征信息(也即C1代表的一组图像块的特征信息)输入垂直LIF模块中;在第二轮次中,执行设备可以将第一行图像的特征信息(也即C2代表的一组图像块的特征信息)输入垂直LIF模块中;在第三轮次中,执行设备可以将第一行图像的特征信息(也即C3代表的一组图像块的特征信息)输入垂直LIF模块中;在第四轮次中,执行设备可以将第一行图像的特征信息(也即C4代表的一组图像块的特征信息)输入垂直LIF模块中,从而实现了将四组图像块的特征信息依次输入LIF模块,应理解,图9中的示例仅为方便理解本方案,不用于限定本方案。
可选地,第一神经网络的一个LIF单元中可以包括M个并行的垂直LIF模块,则在每个轮次中,执行设备可以同时将M组图像块的特征信息分别输入M个并行的垂直LIF模块,并分别通过M个并行的垂直LIF模块对输入的数据进行处理。
具体的,若第一神经网络中包括水平LIF模块,则执列设备可以在水平方向上对多个图像块的特征信息进列分组,将得到的至少两组图像块的特征信息依次输入水平LIF模块,也即每次向水平LIF模块输入一组图像块的特征信息。
执列设备每次向水平LIF模块输入至少一列图像块的特征信息(也即一组图像块的特征信息)之后,会判断是否满足水平LIF模块的激发条件,若判断结果为否,则该水平LIF模块可以不生成任何值;若判断结果为是,则该水平LIF模块可以利用激活函数生成目标数据,将水平LIF模块的一个膜电位重置为0。执列设备继续向水平LIF模块输入下一组图像块的特征信息,以对两组图像块的特征信息进列泄露和累积。执行设备重复执行前述操作,以通过水平LIF模块将所有的图像块的特征信息处理完毕。
需要说明的是,“垂直LIF模块”和“水平LIF模块”对输入数据的具体处理方式类似,对于水平LIF模块的具体实现方式可以参阅上述描述,此处不做赘述。
可选地,第一神经网络的一个LIF单元中可以包括M个并列的水平LIF模块,则在每个轮次中,执列设备可以同时将M组图像块的特征信息分别输入M个并列的水平LIF模块,并分别通过M个并列的水平LIF模块对输入的数据进行处理。
为了更直观地理解本方案,请参阅图10,图10为本申请实施例提供的图像处理方法中将至少两组图像块的特征信息依次输入LIF模块的一种示意图,图10中以一组图像块的特征信息包括一行图像块的特征信息,且一个LIF单元中存在两个并列的水平LIF模块为例。如图所示,在第一轮次中,执行设备将第一列图像块的特征信息(也即E1代表的一组图像块的特征信息)输入水平LIF模块,并将第三列图像块的特征信息(也即F1代表的一组图像块的特征信息)输入水平LIF模块,也即在一个轮次中将2组组图像块的特征信息分别输入2个并列的水平LIF模块。
在第二轮次中,执行设备将第二列图像块的特征信息(也即E2代表的一组图像块的特征信息)输入水平LIF模块,并将第四列图像块的特征信息(也即F2代表的一组图像块的特征信息)输入水平LIF模块,从而实现了将四组图像块的特征信息输入2个并列的水平 LIF模块中,应理解,图10中的示例仅为方便理解本方案,不用于限定本方案。
若第一神经网络中同时包括垂直LIF模块和水平LIF模块,则执行设备可以分别利用垂直LIF模块和水平LIF模块对待处理图像包括的所有图像块的特征信息进行处理,对于垂直LIF模块和水平LIF模块的具体实现细节,此处不做赘述。
304、执行设备根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息。
本申请实施例中,执行设备在得到LIF模块生成的多个目标数据之后,可以根据前述多个目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,该第一特征信息和第二特征信息均为待处理图像的特征信息。
具体的,若第一神经网络中只包括垂直LIF模块或水平LIF模块,则执行设备可以将垂直LIF模块或水平LIF模块输出的多个目标数据确定为待处理图像所对应的第二特征信息;或者,也可以利用其他神经网络层对输出的多个目标数据再次进行处理,并将处理后的数据确定为待处理图像所对应的第二特征信息。
若第一神经网络同时包括垂直LIF模块和水平LIF模块,则执行设备可以将垂直LIF模块和水平LIF模块输出的目标数据进行融合,并将融合后的数据直接确定为待处理图像所对应的第二特征信息。或者,执行设备可以在执行融合操作之前或执行融合操作之后,利用其他神经网络层执行更新操作。
进一步地,若第一神经网络具体表现为MLP,则上述其他神经网络层可以为MLP层;若第一神经网络具体表现为卷积神经网络,则上述其他神经网络层可以为卷积神经网络层;若第一神经网络具体表现为Transformer神经网络,则上述其他神经网络层可以为Transformer神经网络层等;若第一神经网络采用其他类型的神经网络,则上述其他神经网络层还可以替换为其它类型的神经网络层等等,此处不做赘述。
本申请实施例中,无论第一神经网络为MLP、卷积神经网络还是Transformer神经网络,均能通过本申请实施例提供的图像处理方法兼容LIF模块,由于MLP、卷积神经网络和Transformer神经网络可以应用于不同的应用场景中,大大扩展了本方案的应用场景以及实现灵活性。
需要说明的是,上述步骤302至304所描述的步骤是第一神经网络中的一个LIF单元执行的步骤,执行设备在得到待处理图像所对应的第二特征信息之后,可以利用其他神经网络层对第二特征信息进行更新,也即对待处理图像的特征信息进行再次更新。
进一步地,结合上述图4进行理解,在执行设备通过第一神经网络获取待处理图像的特征信息的过程中可以执行步骤302至304多次,本申请实施例中不限定步骤302至304和步骤301之间的执行次数,可以在执行步骤301一次之后,执行一次或多次步骤302至304之后,再进入步骤305。
305、执行设备通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果。
本申请实施例中,执行设备在通过第一神经网络生成待处理图像的特征信息之后,可以通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预 测结果。其中,第一神经网络和第二神经网络包含于同一个目标神经网络,目标神经网络所执行的任务为如下任一种:图像分类、图像分割、对图像进行目标检测、对图像进行超分处理或其他类型的任务等,此处不对目标神经网络的具体实现任务进行穷举。
待处理图像所对应的预测结果的具体含义取决于目标神经网络所执行的任务的类型。作为示例,例如若目标神经网络所执行的任务为图像分类,则待处理图像所对应的预测结果可以用于指示待处理图像所对应的预测类别;作为另一示例,例如若目标神经网络所执行的任务为对图像进行目标检测,则待处理图像所对应的预测结果可以用于指示待处理图像中每个物体的预测类别和预测位置;作为另一示例,例如若目标神经网络所执行的任务为图像分割,则待处理图像所对应的预测结果可以用于指示待处理图像中每个像素点的预测类别;作为另一示例,例如若目标神经网络所执行的任务为图像分割,则待处理图像所对应的预测结果可以包括处理后的图像等等,此处不做穷举。
本申请实施例中,提供了本方案的多种应用场景,大大扩展了本方案的实现灵活性。
本申请实施例中,整个待处理图像的特征信息被划分成了待处理图像中的多个图像块的特征信息,多个图像块的特征信息可以被划分为至少两组图像块的特征信息,将至少两组图像块的特征信息依次输入LIF模块,得到LIF模块生成的目标数据,进而根据目标数据,获取待处理图像的更新后特征信息;通过前述方式,以实现通过LIF模块对单个的图像进行特征提取,进而能够实现将LIF模块应用于执行主流的通用视觉任务。
二、训练阶段
本申请实施例中,具体的,请参阅图11,图11为本申请实施例提供的神经网络的训练方法的一种流程示意图,本申请实施例提供的神经网络的训练方法可以包括:
1101、训练设备将待处理图像输入第一神经网络。
1102、训练设备获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息。
1103、训练设备将至少两组图像块的特征信息依次输入LIF模块,以实现LIF模块的泄露和累积过程,得到LIF模块生成的目标数据。
1104、训练设备根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息。
1105、训练设备通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果。
本申请实施例中,训练设备上可以配置有训练数据集合,训练数据集合用于对目标神经网络进行训练,目标神经网络包括第一神经网络和第二神经网络,目标神经网络所执行的任务为如下任一种:图像分类、对图像进行目标检测、图像分割、对图像进行超分处理或其他类型的任务等,此处不做穷举。
训练数据集合包括多个训练数据,每个训练数据包括一个待处理图像和该待处理图像所对应的正确结果,待处理图像所对应的正确结果的具体含义取决于目标神经网络所执行的任务的类型。“待处理图像所对应的正确结果”和“待处理图像所对应的预测结果”这两个概念类似,区别在于,“待处理图像所对应的正确结果”包括的是正确的信息,“待处理 图像所对应的预测结果”包括的是由目标神经网络生成的信息。
步骤1101至1105的具体实现方式,可以参阅图3对应实施例中步骤301至305中的描述,此处不做赘述。
1106、训练设备根据待处理图像所对应的预测结果和待处理图像所对应的正确结果,利用损失函数对第一神经网络和第二神经网络进行训练,该损失函数指示预测结果和正确结果之间的相似度。
本申请实施例中,训练设备可以根据待处理图像所对应的预测结果和待处理图像所对应的正确结果,生成损失函数的函数值,对损失函数的函数值进行梯度求导,并反向转播该梯度值,以更新第一神经网络和第二神经网络(也即目标神经网络)的权重参数,以完成对第一神经网络和第二神经网络的一次训练。训练设备重复执行步骤1101至1106,直至满足收敛条件。
其中,该损失函数指示待处理图像所对应的预测结果和待处理图像所对应的正确结果之间的相似度。损失函数的类型可以结合实际应用场景灵活选择,作为示例,若目标神经网络所执行的任务为图像分类,则损失函数可以选择交叉熵损失函数、0-1损失函数或其他类型的损失函数等,此处举例仅为方便理解本方案,不用于限定本方案。
收敛条件可以为满足损失函数的收敛条件或迭代次数达到预设次数等,此处不做限定。
本申请实施例中,不仅提供了第一神经网络在执行阶段的实现步骤,还提供了第一神经网络在训练阶段的实现步骤,扩展了本方案的应用场景,提高了本方案的全面性。
为了更直观地理解本方案所带来的有益效果,以下结合实验数据对本方案所带来的有益效果进行说明,先以目标神经网络执行图像分类任务为例,在ImageNet这一数据集上进行了实验,得到的实验结果通过如下表1进行展示。
表1
其中,ResMLP-B24、DeiT-B和AS-MLP-B是已有的三个神经网络,前述三个神经网络可以用于对图像进行分类,通过上述数据可知,采用本申请实施例提供的模型得到的分类结果的准确率最高。
接下来以目标神经网络对图像进行目标检测为例,得到的实验结果通过如下表2进行展示。
表2
其中,DNL、Swin-S和OCRNet均为已有的神经网络,mIoU是评价对图像进行目标检测的检测结果的精准度的一个指标,如上述数据可知,采用本申请实施例提供的模型得到的目标检测结果的精准度最高。
在图1至图11所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体参阅图12,图12为本申请实施例提供的图像处理装置的一种结构示意图,图像处理装置1200包括:输入单元1201,用于将待处理图像输入第一神经网络;特征提取单元1202,用于通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息。
其中,特征提取单元1202,包括:获取子单元12021,用于获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;生成子单元12022,用于将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;获取子单元12021,用于根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
在一种可能的设计中,生成子单元12022,具体用于将至少两组图像块的特征信息依次输入LIF模块,当满足LIF模块的激发条件时,利用激活函数生成目标数据,目标数据不是二值化数据。
在一种可能的设计中,第一神经网络为多层感知机MLP、卷积神经网络或采用自注意力机制的神经网络。
在一种可能的设计中,图像处理装置1200还包括:特征处理单元,用于通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果,其中,第一神经网络和第二神经网络包含于同一个目标神经网络,目标神经网络所执行的任务为如下任一种:分类、分割、目标检测或超分。
需要说明的是,图像处理装置1200中各模块/单元之间的信息交互、执行过程等内容,与本申请中图3至图10对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
请参阅图13,图13为本申请实施例提供的神经网络的训练装置的一种结构示意图,神经网络的训练装置1300包括:特征提取单元1301,用于将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息;特征处理单元1302,用于通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果;训练单元1303,用于根据待处理图像所对应的预测结果和正确结果,利用损失函数对第一神经网络和第二神经网络进行训练,损失函数指示预测结果和正确结果之间的相似度。
其中,特征提取单元1301包括:获取子单元13011,用于获取待处理图像所对应的第 一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;生成子单元13012,用于将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;获取子单元13011,还用于根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
在一种可能的设计中,生成子单元13012,具体用于将至少两组图像块的特征信息依次输入LIF模块,当满足LIF模块的激发条件时,利用激活函数生成目标数据,目标数据不是二值化数据。
需要说明的是,神经网络的训练装置1300中各模块/单元之间的信息交互、执行过程等内容,与本申请中图11对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
接下来介绍本申请实施例提供的一种执行设备,请参阅图14,图14为本申请实施例提供的执行设备的一种结构示意图,执行设备1400具体可以表现为虚拟现实VR设备、手机、平板、笔记本电脑、智能穿戴设备、监控数据处理设备等,此处不做限定。具体的,执行设备1400包括:接收器1401、发射器1402、处理器1403和存储器1404(其中执行设备1400中的处理器1403的数量可以一个或多个,图14中以一个处理器为例),其中,处理器1403可以包括应用处理器14031和通信处理器14032。在本申请的一些实施例中,接收器1401、发射器1402、处理器1403和存储器1404可通过总线或其它方式连接。
存储器1404可以包括只读存储器和随机存取存储器,并向处理器1403提供指令和数据。存储器1404的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1404存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器1403控制执行设备的操作。具体的应用中,执行设备的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器1403中,或者由处理器1403实现。处理器1403可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1403中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1403可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1403可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直 接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1404,处理器1403读取存储器1404中的信息,结合其硬件完成上述方法的步骤。
接收器1401可用于接收输入的数字或字符信息,以及产生与执行设备的相关设置以及功能控制有关的信号输入。发射器1402可用于通过第一接口输出数字或字符信息;发射器1402还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器1402还可以包括显示屏等显示设备。
本申请实施例中,处理器1403,用于执行图3至图10对应实施例中的执行设备执行的图像处理方法。具体的,应用处理器14031用于执行如下步骤:
将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得到待处理图像的特征信息。其中,
通过第一神经网络对待处理图像进行特征提取,包括:获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
需要说明的是,应用处理器14031执行上述各个步骤的具体方式,与本申请中图3至图10对应的各个方法实施例基于同一构思,其带来的技术效果与本申请中图3至图10对应的各个方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供了一种训练设备,请参阅图15,图15是本申请实施例提供的训练设备一种结构示意图,具体的,训练设备1500由一个或多个服务器实现,训练设备1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)1522(例如,一个或一个以上处理器)和存储器1532,一个或一个以上存储应用程序1542或数据1544的存储介质1530(例如一个或一个以上海量存储设备)。其中,存储器1532和存储介质1530可以是短暂存储或持久存储。存储在存储介质1530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备中的一系列指令操作。更进一步地,中央处理器1522可以设置为与存储介质1530通信,在训练设备1500上执行存储介质1530中的一系列指令操作。
训练设备1500还可以包括一个或一个以上电源1526,一个或一个以上有线或无线网络接口1550,一个或一个以上输入输出接口1558,和/或,一个或一个以上操作系统1541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
本申请实施例中,中央处理器1522,用于执行图12对应实施例中的训练设备执行的图像处理方法。具体的,中央处理器1522,用于执行如下步骤:
将待处理图像输入第一神经网络,通过第一神经网络对待处理图像进行特征提取,得 到待处理图像的特征信息,通过第二神经网络对待处理图像的特征信息进行特征处理,得到待处理图像所对应的预测结果;根据待处理图像所对应的预测结果和正确结果,利用损失函数对第一神经网络和第二神经网络进行训练,损失函数指示预测结果和正确结果之间的相似度。
其中,通过第一神经网络对待处理图像进行特征提取,包括:获取待处理图像所对应的第一特征信息,待处理图像包括多个图像块,第一特征信息包括图像块的特征信息;将至少两组图像块的特征信息依次输入累积-泄露-激发LIF模块,得到LIF模块生成的目标数据,一组图像块的特征信息包括至少一个图像块的特征信息;根据目标数据,获取待处理图像所对应的第二特征信息,第二特征信息包括图像块的更新后的特征信息,第一特征信息和第二特征信息均为待处理图像的特征信息。
需要说明的是,中央处理器1522执行上述各个步骤的具体方式,与本申请中图11对应的各个方法实施例基于同一构思,其带来的技术效果与本申请中图11对应的各个方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上运行时,使得计算机执行如前述图3至图10所示实施例描述的方法中执行设备所执行的步骤,或者,使得计算机执行如前述图11所示实施例描述的方法中训练设备所执行的步骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述图3至图10所示实施例描述的方法中执行设备所执行的步骤,或者,使得计算机执行如前述图11所示实施例描述的方法中训练设备所执行的步骤。
本申请实施例提供的图像处理装置、神经网络的训练装置、执行设备或训练设备具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使芯片执行上述图3至图10所示实施例描述的图像处理方法,或者,以使训练设备内的芯片执行上述图11所示实施例描述的神经网络的训练方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体的,请参阅图16,图16为本申请实施例提供的芯片的一种结构示意图,所述芯片可以表现为神经网络处理器NPU 160,NPU 160作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1603,通过控制器1604控制运算电路1603提取存储器中的矩阵数据并进行乘法运算。
在一些实现中,运算电路1603内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路1603是二维脉动阵列。运算电路1603还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1603是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1602中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1601中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1608中。
统一存储器1606用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)1605,DMAC被搬运到权重存储器1602中。输入数据也通过DMAC被搬运到统一存储器1606中。
BIU为Bus Interface Unit即,总线接口单元1610,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)1609的交互。
总线接口单元1610(Bus Interface Unit,简称BIU),用于取指存储器1609从外部存储器获取指令,还用于存储单元访问控制器1605从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1606或将权重数据搬运到权重存储器1602中或将输入数据数据搬运到输入存储器1601中。
向量计算单元1607包括多个运算处理单元,在需要的情况下,对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对特征平面进行上采样等。
在一些实现中,向量计算单元1607能将经处理的输出的向量存储到统一存储器1606。例如,向量计算单元1607可以将线性函数和/或非线性函数应用到运算电路1603的输出,例如对卷积层提取的特征平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1607生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1603的激活输入,例如用于在神经网络中的后续层中的使用。
控制器1604连接的取指存储器(instruction fetch buffer)1609,用于存储控制器1604使用的指令;
统一存储器1606,输入存储器1601,权重存储器1602以及取指存储器1609均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,图3至图11所示的第一神经网络和第二神经网络中各层的运算可以由运算电路1603或向量计算单元1607执行。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述第一方面方法的程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条 或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (16)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    将待处理图像输入第一神经网络,通过所述第一神经网络对所述待处理图像进行特征提取,得到所述待处理图像的特征信息;其中,
    所述通过所述第一神经网络对所述待处理图像进行特征提取,包括:
    获取所述待处理图像所对应的第一特征信息,所述待处理图像包括多个图像块,所述第一特征信息包括所述图像块的特征信息;
    将至少两组所述图像块的特征信息依次输入累积-泄露-激发LIF模块,得到所述LIF模块生成的目标数据,一组所述图像块的特征信息包括至少一个图像块的特征信息;
    根据所述目标数据,获取所述待处理图像所对应的第二特征信息,所述第二特征信息包括所述图像块的更新后的特征信息,所述第一特征信息和所述第二特征信息均为所述待处理图像的特征信息。
  2. 根据权利要求1所述的方法,其特征在于,所述将至少两组所述图像块的特征信息依次输入LIF模块,得到所述LIF模块生成的目标数据,包括:
    将至少两组所述图像块的特征信息依次输入所述LIF模块,当满足所述LIF模块的激发条件时,利用激活函数生成所述目标数据,所述目标数据不是二值化数据。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一神经网络为多层感知机MLP、卷积神经网络或采用自注意力机制的神经网络。
  4. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    通过第二神经网络对所述待处理图像的特征信息进行特征处理,得到所述待处理图像所对应的预测结果,其中,所述第一神经网络和所述第二神经网络包含于同一个目标神经网络,所述目标神经网络所执行的任务为如下任一种:分类、分割、目标检测或超分。
  5. 一种神经网络的训练方法,其特征在于,所述方法包括:
    将待处理图像输入第一神经网络,通过所述第一神经网络对所述待处理图像进行特征提取,得到所述待处理图像的特征信息,通过第二神经网络对所述待处理图像的特征信息进行特征处理,得到所述待处理图像所对应的预测结果;
    根据所述待处理图像所对应的预测结果和正确结果,利用损失函数对所述第一神经网络和所述第二神经网络进行训练,所述损失函数指示所述预测结果和所述正确结果之间的相似度;
    其中,所述通过所述第一神经网络对所述待处理图像进行特征提取,包括:
    获取所述待处理图像所对应的第一特征信息,所述待处理图像包括多个图像块,所述第一特征信息包括所述图像块的特征信息;
    将至少两组所述图像块的特征信息依次输入累积-泄露-激发LIF模块,得到所述LIF模块生成的目标数据,一组所述图像块的特征信息包括至少一个图像块的特征信息;
    根据所述目标数据,获取所述待处理图像所对应的第二特征信息,所述第二特征信息包括所述图像块的更新后的特征信息,所述第一特征信息和所述第二特征信息均为所述待处理图像的特征信息。
  6. 根据权利要求5所述的方法,其特征在于,所述将至少两组所述图像块的特征信息依次输入LIF模块,得到所述LIF模块生成的目标数据,包括:
    将至少两组所述图像块的特征信息依次输入所述LIF模块,当满足所述LIF模块的激发条件时,利用激活函数生成所述目标数据,所述目标数据不是二值化数据。
  7. 一种图像处理装置,其特征在于,所述装置包括:
    输入单元,用于将待处理图像输入第一神经网络;
    特征提取单元,用于通过所述第一神经网络对所述待处理图像进行特征提取,得到所述待处理图像的特征信息;其中,所述特征提取单元,包括:
    获取子单元,用于获取所述待处理图像所对应的第一特征信息,所述待处理图像包括多个图像块,所述第一特征信息包括所述图像块的特征信息;
    生成子单元,用于将至少两组所述图像块的特征信息依次输入累积-泄露-激发LIF模块,得到所述LIF模块生成的目标数据,一组所述图像块的特征信息包括至少一个图像块的特征信息;
    所述获取子单元,用于根据所述目标数据,获取所述待处理图像所对应的第二特征信息,所述第二特征信息包括所述图像块的更新后的特征信息,所述第一特征信息和所述第二特征信息均为所述待处理图像的特征信息。
  8. 根据权利要求7所述的装置,其特征在于,所述生成子单元,具体用于将至少两组所述图像块的特征信息依次输入所述LIF模块,当满足所述LIF模块的激发条件时,利用激活函数生成所述目标数据,所述目标数据不是二值化数据。
  9. 根据权利要求7或8所述的装置,其特征在于,所述第一神经网络为多层感知机MLP、卷积神经网络或采用自注意力机制的神经网络。
  10. 根据权利要求7或8所述的装置,其特征在于,所述装置还包括:
    特征处理单元,用于通过第二神经网络对所述待处理图像的特征信息进行特征处理,得到所述待处理图像所对应的预测结果,其中,所述第一神经网络和所述第二神经网络包含于同一个目标神经网络,所述目标神经网络所执行的任务为如下任一种:分类、分割、目标检测或超分。
  11. 一种神经网络的训练装置,其特征在于,所述装置包括:
    特征提取单元,用于将待处理图像输入第一神经网络,通过所述第一神经网络对所述待处理图像进行特征提取,得到所述待处理图像的特征信息;
    特征处理单元,用于通过第二神经网络对所述待处理图像的特征信息进行特征处理,得到所述待处理图像所对应的预测结果;
    训练单元,用于根据所述待处理图像所对应的预测结果和正确结果,利用损失函数对所述第一神经网络和所述第二神经网络进行训练,所述损失函数指示所述预测结果和所述正确结果之间的相似度;其中,所述特征提取单元包括:
    获取子单元,用于获取所述待处理图像所对应的第一特征信息,所述待处理图像包括多个图像块,所述第一特征信息包括所述图像块的特征信息;
    生成子单元,用于将至少两组所述图像块的特征信息依次输入累积-泄露-激发LIF模 块,得到所述LIF模块生成的目标数据,一组所述图像块的特征信息包括至少一个图像块的特征信息;
    所述获取子单元,还用于根据所述目标数据,获取所述待处理图像所对应的第二特征信息,所述第二特征信息包括所述图像块的更新后的特征信息,所述第一特征信息和所述第二特征信息均为所述待处理图像的特征信息。
  12. 根据权利要求11所述的装置,其特征在于,所述生成子单元,具体用于将至少两组所述图像块的特征信息依次输入所述LIF模块,当满足所述LIF模块的激发条件时,利用激活函数生成所述目标数据,所述目标数据不是二值化数据。
  13. 一种计算机程序产品,其特征在于,所述计算机程序产品包括程序,当所述程序在计算机上运行时,使得计算机执行如权利要求1至4中任一项所述的方法,或者,使得计算机执行如权利要求5或6所述的方法。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序,当所述程序在计算机上运行时,使得计算机执行如权利要求1至4中任一项所述的方法,或者,使得计算机执行如权利要求5或6所述的方法。
  15. 一种执行设备,其特征在于,包括处理器和存储器,所述处理器与所述存储器耦合,
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述执行设备执行如权利要求1至4中任一项所述的方法。
  16. 一种训练设备,其特征在于,包括处理器和存储器,所述处理器与所述存储器耦合,
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述训练设备执行如权利要求5或6所述的方法。
PCT/CN2023/082159 2022-03-25 2023-03-17 一种图像处理方法、神经网络的训练方法以及相关设备 WO2023179482A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210302717.6A CN114821096A (zh) 2022-03-25 2022-03-25 一种图像处理方法、神经网络的训练方法以及相关设备
CN202210302717.6 2022-03-25

Publications (1)

Publication Number Publication Date
WO2023179482A1 true WO2023179482A1 (zh) 2023-09-28

Family

ID=82530917

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/082159 WO2023179482A1 (zh) 2022-03-25 2023-03-17 一种图像处理方法、神经网络的训练方法以及相关设备

Country Status (2)

Country Link
CN (1) CN114821096A (zh)
WO (1) WO2023179482A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114821096A (zh) * 2022-03-25 2022-07-29 华为技术有限公司 一种图像处理方法、神经网络的训练方法以及相关设备
CN117746047A (zh) * 2022-09-21 2024-03-22 华为技术有限公司 一种图像处理方法及其相关设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109934192A (zh) * 2019-03-20 2019-06-25 京东方科技集团股份有限公司 目标图像定位方法及装置、视线追踪设备
CN113066017A (zh) * 2021-02-27 2021-07-02 华为技术有限公司 一种图像增强方法、模型训练方法及设备
CN113065997A (zh) * 2021-02-27 2021-07-02 华为技术有限公司 一种图像处理方法、神经网络的训练方法以及相关设备
KR20210112495A (ko) * 2020-03-05 2021-09-15 (주)퀀텀솔루션 지능형 영상 촬영 장치 및 이를 이용한 영상 처리 방법
CN113469897A (zh) * 2021-05-24 2021-10-01 苏州市科远软件技术开发有限公司 图像增强模型的训练、图像增强方法、装置及电子设备
CN114091659A (zh) * 2021-11-24 2022-02-25 西安电子科技大学 基于空时信息的超低延时脉冲神经网络及学习方法
CN114821096A (zh) * 2022-03-25 2022-07-29 华为技术有限公司 一种图像处理方法、神经网络的训练方法以及相关设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109934192A (zh) * 2019-03-20 2019-06-25 京东方科技集团股份有限公司 目标图像定位方法及装置、视线追踪设备
KR20210112495A (ko) * 2020-03-05 2021-09-15 (주)퀀텀솔루션 지능형 영상 촬영 장치 및 이를 이용한 영상 처리 방법
CN113066017A (zh) * 2021-02-27 2021-07-02 华为技术有限公司 一种图像增强方法、模型训练方法及设备
CN113065997A (zh) * 2021-02-27 2021-07-02 华为技术有限公司 一种图像处理方法、神经网络的训练方法以及相关设备
CN113469897A (zh) * 2021-05-24 2021-10-01 苏州市科远软件技术开发有限公司 图像增强模型的训练、图像增强方法、装置及电子设备
CN114091659A (zh) * 2021-11-24 2022-02-25 西安电子科技大学 基于空时信息的超低延时脉冲神经网络及学习方法
CN114821096A (zh) * 2022-03-25 2022-07-29 华为技术有限公司 一种图像处理方法、神经网络的训练方法以及相关设备

Also Published As

Publication number Publication date
CN114821096A (zh) 2022-07-29

Similar Documents

Publication Publication Date Title
WO2022017245A1 (zh) 一种文本识别网络、神经网络训练的方法以及相关设备
CN111401406B (zh) 一种神经网络训练方法、视频帧处理方法以及相关设备
CN111797893B (zh) 一种神经网络的训练方法、图像分类系统及相关设备
WO2022012407A1 (zh) 一种用于神经网络的训练方法以及相关设备
WO2022083536A1 (zh) 一种神经网络构建方法以及装置
WO2023179482A1 (zh) 一种图像处理方法、神经网络的训练方法以及相关设备
CN108734210B (zh) 一种基于跨模态多尺度特征融合的对象检测方法
WO2021159714A1 (zh) 一种数据处理方法及相关设备
WO2021218471A1 (zh) 一种用于图像处理的神经网络以及相关设备
WO2023051369A1 (zh) 一种神经网络的获取方法、数据处理方法以及相关设备
CN113095475A (zh) 一种神经网络的训练方法、图像处理方法以及相关设备
WO2023202511A1 (zh) 一种数据的处理方法、神经网络的训练方法以及相关设备
WO2024041479A1 (zh) 一种数据处理方法及其装置
CN108171328B (zh) 一种神经网络处理器和采用其执行的卷积运算方法
US20240020541A1 (en) Model training method and apparatus
WO2023231954A1 (zh) 一种数据的去噪方法以及相关设备
WO2022012668A1 (zh) 一种训练集处理方法和装置
US10438088B2 (en) Visual-saliency driven scene description
CN113065997B (zh) 一种图像处理方法、神经网络的训练方法以及相关设备
WO2021169366A1 (zh) 数据增强方法和装置
CN114925320B (zh) 一种数据处理方法及相关装置
Wang et al. Deep leaning-based ultra-fast stair detection
CN113627421A (zh) 一种图像处理方法、模型的训练方法以及相关设备
WO2023197857A1 (zh) 一种模型切分方法及其相关设备
WO2023231753A1 (zh) 一种神经网络的训练方法、数据的处理方法以及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23773730

Country of ref document: EP

Kind code of ref document: A1