WO2021164752A1 - 一种神经网络通道参数的搜索方法及相关设备 - Google Patents
一种神经网络通道参数的搜索方法及相关设备 Download PDFInfo
- Publication number
- WO2021164752A1 WO2021164752A1 PCT/CN2021/076986 CN2021076986W WO2021164752A1 WO 2021164752 A1 WO2021164752 A1 WO 2021164752A1 CN 2021076986 W CN2021076986 W CN 2021076986W WO 2021164752 A1 WO2021164752 A1 WO 2021164752A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- neural network
- layer
- computing power
- channels
- data
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/082—Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local 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
Definitions
- This application relates to the field of artificial intelligence, and in particular to a method for searching neural network channel parameters and related equipment.
- the network structure search technology is a technology to optimize the network structure. It designs the network structure through an automatic search strategy, that is, the network structure search technology automatically finds a better network structure in the defined search space. At present, the performance of the network structure obtained based on the network structure search technology has exceeded the artificially designed network structure.
- the neural network channel parameter is a searchable network structure parameter.
- the method of designing neural network channel parameters through an automatic search strategy is called neural network channel parameter search technology. Optimizing neural network channel parameters through neural network channel parameter search technology can effectively improve the performance of neural network.
- the currently commonly used network channel number parameter search technology is a neural network channel parameter search method based on pruning, which obtains more efficient neural network channel parameters by cutting off unimportant channels.
- this method only considers whether it is important when cutting the unimportant channels, and does not consider the cost performance.
- pruning is to obtain neural network channel parameters by removing unimportant channels, instead of directly searching for the number of channels, so there will be deviations.
- the embodiment of the application provides a method for searching channel parameters of a neural network and related equipment, which can be used in the field of artificial intelligence.
- Channel parameters realize the search of neural network channel parameters of the neural network, so as to improve the performance of the neural network without increasing the complexity of the neural network.
- the embodiments of the present application first provide a method for searching neural network channel parameters, which can be used in the field of artificial intelligence.
- the method includes: First, the training device will obtain a data set, which includes multiple training data and Multiple verification verification data. After that, the training device will train the initial neural network according to the multiple training data in the data set.
- the training tasks can be classification, detection, segmentation, etc., and then the trained neural network can be obtained, and the training device can obtain the trained neural network.
- the use efficiency of any layer in the trained neural network will be determined based on the multiple verification data in the data set.
- the use efficiency of the computing power is the amount of network performance change caused by the unit computing power.
- the training equipment Adjust the neural network channel parameters of the trained neural network according to the utilization efficiency of the computing power, thereby obtaining the first neural network.
- a neural network channel parameter search method based on the use efficiency of computing power is proposed for the first time. Adjust the neural network channel parameters of the trained neural network to the utilization efficiency of computing power to obtain the first neural network.
- the first neural network obtained in this way is a neural network that has adjusted the channel parameters of the neural network once, and its performance is better than that of the neural network that has not been adjusted by the neural network channel parameters.
- the number of iterations can be set in the training device in advance, and the obtained first neural network can be used as a new initial neural network for iteration.
- the first neural network after each iteration is obtained, and the first neural network is tested through multiple test data (multiple test data can be data in a data set or task target data, which is not limited here) And the performance of the first neural network after each iteration.
- the first neural network and each first neural network after each iteration is determined as the target neural network (for example, the specific operation can be to use the test data to test the performance of the first neural network after each iteration of the first neural network, and save the performance And the neural network channel parameter corresponding to the performance), and output the target neural network, and the output target neural network is the optimized neural network described above.
- the obtained first neural network is used as a new initial neural network to perform iterative training again, calculate the efficiency of the use of computing power of each layer of the neural network, and adjust the channel parameters of the neural network, so as to obtain the new neural network.
- the first neural network with the best performance is selected as the final output target neural network. After multiple iterations, the final output target neural network will have the best performance of.
- determining the utilization efficiency of any layer in the trained neural network based on multiple verification data in the data set can be as follows: First, obtain any one of the trained neural network A function (ie corresponding relationship) between the computing power of a layer and the number of channels in the layer. Then, according to the function, calculate the proportion of channels in any layer that are discarded, that is, determine the proportion in which some channels of this layer should be discarded, and Further randomly discard part of the channels of any layer according to the calculated ratio, so as to obtain a second neural network that discards the channels. Finally, it is determined that the performance change reflected by the second neural network through multiple verification data is computing power Use efficiency.
- a function ie corresponding relationship
- the input neural network has a total of 4 layers (for example, 4 convolutional layers), the first layer has 40 channels, the second layer has 30 channels, and the third layer has 70 Channels, the fourth layer has 50 channels.
- the percentages of channels discarded in each layer calculated according to the function are 4%, 8%, 10%, and 20% respectively.
- the percentage of randomly discarded channels in the first layer is 4%
- the rate of randomly discarded channels in the second layer is 8%
- the rate of randomly discarded channels in the third layer is 10%
- the rate of randomly discarded channels in the fourth layer is 20%
- Each discard can only randomly discard part of the number of channels in one layer. If there are four layers, it is necessary to determine the utilization efficiency of each of the four layers in the trained neural network layer by layer according to the verification data.
- calculating the proportion of channels discarded in any layer of the neural network according to the function may specifically be as follows: first, the derivative of the above-obtained function is obtained to obtain the derivative of the function, and then, According to the derivative, determine the number of channels that need to be discarded when any layer of the neural network reduces the computing power by a preset value, and finally, determine that the ratio of the number of channels that need to be discarded to the number of channels of any layer is the ratio.
- the discard ratio that is, how many channels need to be discarded when each layer of the neural network reduces the fixed computing power.
- the ratio of the number of channels that need to be discarded to the total number of channels is the discard ratio. Simple and easy to implement.
- the performance change of the second neural network on the plurality of verification data may be the first loss function and the failure rate reflected by the second neural network through the plurality of verification data.
- the neural network before discarding the channel reflects the difference of the second loss function through the multiple verification data, or it can be the accuracy of the recognition result obtained by recognizing multiple verification data on the second neural network and the undiscarded channel The difference in the accuracy of the recognition results obtained by the previous neural network through the multiple verification data.
- the performance change is not limited here, as long as the performance difference of the neural network before and after the channel is not discarded can be measured. This is called the amount of change in performance.
- the training device adjusts the neural network channel parameters of the trained neural network according to the efficiency of computing power.
- Use lower efficiency layers to reduce the number of channels. For example, it can be to obtain the utilization efficiency of each layer of the neural network after training, and then increase the number of channels of the layer corresponding to the use efficiency of the larger first m computing power and reduce the smaller last n computing power
- the use efficiency corresponds to the number of channels in the layer.
- the first m are the m that rank before the m+1 serial number when the computing power usage efficiency corresponding to each layer is sorted from high to low
- the last n are the computing power usage efficiency corresponding to each layer from high to low.
- m can be the same as or different from n, and the specifics are not limited here.
- the training device adjusts the neural network channel parameters of the trained neural network according to the use efficiency of computing power.
- it may be a layer corresponding to the use efficiency of the larger first m computing power.
- the number of channels is increased according to a first preset ratio (for example, 10%) and the number of channels of the layer corresponding to the lower n computing power usage efficiency is reduced according to a second preset ratio (for example, 5%).
- the first preset ratio may be the same as or different from the second preset ratio, which is not specifically limited here.
- the efficiency of computing power can have a variety of specific manifestations.
- computing power can be floating point operations (FLOPs), and computing power usage efficiency is corresponding Ground refers to the utilization efficiency of FLOPs (FLOPs utilization ratio, FUR).
- FLOPs utilization ratio, FUR refers to the use efficiency of floating-point arithmetic by neural networks, and is used to measure whether the network is efficient in terms of the complexity of floating-point operations.
- the use efficiency of computing power may be the use efficiency of FLOPs, which is achievable.
- this application may use data obtained by sensors such as cameras and red line sensors as a data set to search for neural network channel parameters.
- the data set described in this application may also be multiple picture data, or multiple video data, which is not limited here.
- the data set described in the present application can be multiple types of data, which has wide applicability.
- the embodiments of the present application provide an image processing method that can be used in the field of artificial intelligence.
- the method includes: first, the execution device obtains a target image, which may be a picture/video that is about to be recognized or located After that, the execution device will operate the target image through the input target neural network.
- the target neural network is a neural network that has adjusted the channel parameters of the neural network according to the efficiency of the use of computing power by any layer in the network.
- the final execution device outputs the recognition result of the target object.
- the recognition result may be the category information, location information, etc. of the target object in the target image.
- the execution device uses the neural network that adjusts the neural network channel parameters according to the use efficiency of the computing power of any layer in the network to operate on the target image, and the optimized neural network recognition speed Faster and better recognition effect.
- an embodiment of the present application provides a training device, which has the function of implementing the foregoing first aspect or any one of the possible implementation methods of the first aspect.
- This function can be realized by hardware, or by hardware executing corresponding software.
- the hardware or software includes one or more modules corresponding to the above-mentioned functions.
- an embodiment of the present application provides an execution device, and the execution device has the function of realizing the foregoing second aspect.
- This function can be realized by hardware, or by hardware executing corresponding software.
- the hardware or software includes one or more modules corresponding to the above-mentioned functions.
- an embodiment of the present application provides a training device, which may include a memory, a processor, and a bus system.
- the memory is used to store a program
- the processor is used to call the program stored in the memory to execute the first embodiment of the present application. Aspect or any one of the possible implementation methods of the first aspect.
- an embodiment of the present application provides an execution device, which may include a memory, a processor, and a bus system.
- the memory is used to store a program
- the processor is used to call the program stored in the memory to execute the second embodiment of the present application. Aspect method.
- an embodiment of the present application provides a chip system including a processor, which is used to support an execution device or a training device to implement the functions involved in the above aspects, for example, send or process the functions involved in the above methods Data and/or information.
- the chip system further includes a memory for storing program instructions and data necessary for the execution device or the training device.
- the chip system can be composed of chips, and can also include chips and other discrete devices.
- the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, enables the computer to execute any one of the above-mentioned first aspect or the first aspect It is possible to implement the method, or so that the computer can execute the method of the second aspect described above.
- the embodiments of the present application provide a computer program that, when it runs on a computer, causes the computer to execute the method of the first aspect or any one of the possible implementations of the first aspect, or causes the computer to execute the first aspect. Two-sided approach.
- Figure 1 is a schematic diagram of a neural network channel parameter search method based on pruning
- FIG. 2 is a schematic diagram of a structure of an artificial intelligence main frame provided by an embodiment of the application
- FIG. 3 is a schematic diagram of an application system architecture provided by an embodiment of the application.
- FIG. 4 is a diagram of an application scenario provided by an embodiment of the application.
- FIG. 5 is a diagram of another application scenario provided by an embodiment of the application.
- Figure 6 is a schematic diagram of a structure of a convolutional neural network
- Figure 7 is a schematic diagram of another structure of a convolutional neural network
- FIG. 8 is a schematic diagram of a method for searching neural network channel parameters provided by an embodiment of the application.
- FIG. 9 is a schematic diagram of a neural network channel parameter search system provided by an embodiment of the application.
- FIG. 10 is an overall flowchart of neural network channel parameter search provided by an embodiment of this application.
- FIG. 11 is another schematic diagram of the system architecture provided by an embodiment of the application.
- FIG. 12 is a schematic diagram of an image processing method provided by an embodiment of this application.
- FIG. 13 is a schematic diagram of a training device provided by an embodiment of the application.
- FIG. 14 is a schematic diagram of an execution device provided by an embodiment of this application.
- FIG. 15 is another schematic diagram of training equipment provided by an embodiment of the application.
- FIG. 16 is another schematic diagram of an execution device provided by an embodiment of this application.
- FIG. 17 is a schematic diagram of a structure of a chip provided by an embodiment of the application.
- the embodiment of the application provides a method for searching channel parameters of a neural network and related equipment, which can be used in the field of artificial intelligence.
- the network channel parameters realize the search of the neural network channel parameters of the neural network, so as to improve the performance of the neural network without increasing the complexity of the neural network, and finally obtain a neural network with a very efficient use of computing power.
- this application briefly introduces the technique of using the pruning method to search for neural network channel parameters.
- Figure 1 For a given neural network network structure, first train it to a width that can be changed by a certain method. Network (that is, narrow the network). Then change the width of the network layer by layer with the same ratio, and test the influence of the width of each layer of the network on the performance of the network (as shown in Figure 1, the data in the verification set is used to test the network to determine which layer to narrow), and Reduce the number of channels in the layer that has little impact on performance. The process of “testing the influence-adjusting the channel” is iterated continuously until the complexity of the network reaches the set target. As shown in Figure 1, the “structure n” is the optimal network structure. At this time, the neural network channel parameter of "structure n" is the final search result.
- the above pruning method only considers the absolute value of the network performance change when testing the impact of the width of each layer of the network on the performance, and does not consider the relative value of the performance change with respect to the computational complexity.
- the varying width of each layer has a different effect on the computational complexity of the network.
- Some layers may have a great impact on performance, that is, the absolute value of the performance change is larger, but it takes up more computational complexity, that is, the performance change per unit complexity is small.
- the relative value of performance should be considered when searching for network parameters, while the above method only considers the absolute value of performance, so only sub-optimal results can be searched.
- this method needs to first train the network into a network with variable width. Compared with traditional network training methods, this method is more complicated and requires more training time.
- this application proposes a new neural network channel parameter search method, which can efficiently search for neural network channel parameters while accurately assessing the channel cost performance. That is, this application fully considers the relative performance of the number of channels in each layer with respect to the complexity, and the neural network channel parameter search method provided by this application is simpler and faster than the traditional pruning method.
- the neural network channel parameters mentioned in this application are introduced.
- the neural network channel parameters are used to characterize the number of channels, and the number of channels is a type of network structure.
- the number of channels can be regarded as the number of feature maps.
- the feature map is the intermediate representation of the data on the neural network. Take Convolutional Neural Networks (CNN) as an example.
- CNN Convolutional Neural Networks
- the feature map is the intermediate output result of the convolution.
- CNN the channel of each layer The number is equal to the number of convolution kernels in the layer, so the number of channels is sometimes called the number of convolution kernels, and one convolution kernel corresponds to one channel.
- there are a total of 70 channels output by each layer of CNN and the neural network channel parameters are used to characterize the relevant information of these 70 channels (for example, which layer of the CNN is located in, the attribute information of the channel, etc.).
- Figure 2 shows a schematic diagram of the main framework of artificial intelligence.
- 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 condensing process of "data-information-knowledge-wisdom".
- the "IT value chain” from the underlying infrastructure of human intelligence, information (providing and processing technology realization) to the industrial ecological process of the system, reflects the value that artificial intelligence brings to the information technology industry.
- the infrastructure provides computing power support for the artificial intelligence system, realizes communication with the outside world, and realizes support through the basic platform.
- smart chips hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA
- basic platforms include distributed computing frameworks and network related platform guarantees and support, which can include cloud storage and Computing, interconnection network, etc.
- sensors communicate with the outside to obtain data, and these data are provided to the smart chip in the distributed computing system provided by the basic platform for calculation.
- the data in the upper layer of the infrastructure is used to represent the data source in the field of artificial intelligence.
- the data involves graphics, images, voice, and text, as well as the Internet of Things 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 symbolize and formalize data for intelligent information modeling, extraction, preprocessing, training, etc.
- Reasoning refers to the process of simulating human intelligent reasoning in a computer or intelligent system, using formal information to conduct machine thinking and solving problems based on reasoning control strategies.
- the typical function is search and matching.
- Decision-making refers to the process of making decisions after intelligent information is reasoned, and usually provides functions such as classification, ranking, and prediction.
- some general capabilities can be formed based on the results of the data processing, such as an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image Recognition and so on.
- Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. It is an encapsulation of the overall solution of artificial intelligence, productizing intelligent information decision-making and realizing landing applications. Its application fields mainly include: intelligent terminals, intelligent manufacturing, Intelligent transportation, smart home, smart medical, smart security, autonomous driving, safe city, etc.
- This application can be applied to the automatic design of neural network network structure, and the neural network that has optimized neural network channel parameters through this application can be specifically applied to the image processing field in the field of artificial intelligence.
- the data in the data set obtained by the infrastructure in the application embodiment can be multiple data of different types obtained through sensors such as cameras and radars, or multiple image data or multiple video data, as long as the data set meets the requirements for
- the neural network can be iteratively trained and can be used to realize the neural network channel parameter search function of the present application.
- the data type in the data set is not limited here.
- the application system architecture of this application is shown in FIG. 3, taking the acquired data set as object image data as an example: first, the neural network channel parameter search system 102 will receive multiple object image data, among which, the multiple object image data Including multiple training data and multiple verification data, the neural network 101 searched in the search space is input into the neural network channel parameter search system 102, and the neural network channel parameter search system 102 compares the neural network 101 with the training data. After training, the trained neural network (not shown in Figure 3) is obtained. Then, according to the verification data, the neural network channel parameter search system 102 adjusts the use efficiency of computing power based on any layer of the trained neural network. The neural network channel parameters of the trained neural network, thereby obtaining the final output neural network 103.
- the method provided in this application can search the neural network channel parameters of any neural network in a preset search space.
- the present application can optimize the neural network channel parameters of the neural network, and improve the network performance without increasing the computational complexity of the neural network.
- the neural network that has adjusted the channel parameters of the neural network according to the efficiency of the use of computing power in any layer of the neural network can be used for image processing, as follows It will introduce multiple application scenarios that have been applied to the product.
- the neural network channel parameter search system 102 described in this application can be applied to intelligent object recognition.
- the neural network channel parameter search system provided can optimize the neural network structure and improve recognition. Speed and recognition accuracy.
- a given data set which can be multiple image data or multiple video data, it is not limited here, as shown in Figure 4 is an object image data set
- this application can be based on Data sets and task goals (eg, target pictures) are used to optimize the number of channels in each layer of the neural network.
- the data set is each object and its corresponding category label.
- the task goal is to identify and classify each object.
- the optimized neural network can be used for object recognition.
- the optimized neural network can identify the object category in the target image as "shark" faster and more accurately, that is, the optimized neural network
- the neural network recognition speed is faster and the recognition effect is better.
- the neural network channel parameter search system 102 described above in this application can also be applied to the recognition of autonomous vehicles.
- sensors need to be used to identify vehicles, pedestrians, traffic signs, etc. on the road. These tasks are all It can be achieved with a neural network.
- the neural network structure can be optimized by using the provided neural network channel parameter search system, so as to achieve the purpose of optimizing the recognition effect of the neural network, as shown in Figure 5.
- This application can use the data obtained by sensors such as cameras and red line sensors as a data set to search for neural network channel parameters, thereby improving the recognition speed and ability of the neural network.
- the optimized neural network can quickly identify the category and location of each target object (such as other vehicles, pedestrians, etc.) in the target picture.
- the neural network channel parameter search system 102 described in this application can also be applied to other fields, such as: smart terminals, smart transportation, smart medical care, smart security, autonomous driving, safe cities, and so on.
- the optimized neural network can be obtained through the neural network channel parameter search system 102 described in this application, and the obtained optimized neural network can be applied to the above-mentioned various fields, specifically here No longer list other application scenarios one by one.
- the neural network described in this application can be any form of neural network, and can be various typical deep neural networks, such as CNN, Recurrent Neural Networks (RNN), etc., or other special types.
- CNN Recurrent Neural Networks
- RNN Recurrent Neural Networks
- the specific type of neural network is not limited here.
- CNN is used as an example for illustration.
- CNN is a deep neural network with a convolutional structure. It is a deep learning architecture.
- the deep learning architecture refers to the algorithm of machine learning. Multi-level learning is carried out on the abstract level of.
- CNN is a feed-forward artificial neural network. Each neuron in the feed-forward artificial neural network responds to overlapping regions in the input image.
- the convolutional neural network can logically include the input layer, the convolutional layer and the neural network layer, but because the input layer and the output layer are mainly used to facilitate the import and export of data, with the continuous development of the convolutional neural network
- the concept of input layer and output layer is gradually diluted, but the function of input layer and output layer is realized through convolutional layer.
- convolutional neural network can also include other types of layers. There is no limit. Taking FIG. 6 as an example, the convolutional neural network 100 may include an input layer 110, a convolutional layer/pooling layer 120, where the pooling layer is optional, and a neural network layer 130.
- the convolutional layer in the convolutional layer/pooling layer 120 is the convolutional layer in the convolutional layer/pooling layer 120.
- the convolutional layer/pooling layer 120 may include layers 121-126 as in the example.
- layer 121 is a convolutional layer
- layer 122 is a pooling layer
- layer 123 is a convolutional layer
- 124 is a pooling layer
- 121 and 122 are convolutional layers
- 123 is a pooling layer
- 124 and 125 are convolutional layers
- 126 is a convolutional layer.
- Pooling layer That is, the output of the convolutional layer can be used as the input of the subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
- the convolutional layer 121 can include many convolution operators, which are also called kernels or convolution kernels.
- the number of channels in each layer is equal to the volume of the layer.
- the number of kernels, so sometimes the number of channels is also called the number of convolution kernels, and one convolution kernel corresponds to one channel.
- the role of the convolution kernel in image processing is equivalent to a filter that extracts specific information from the input image matrix.
- the convolution kernel can essentially be a weight matrix. This weight matrix is usually pre-defined and is used for convolution operations on the image.
- the weight matrix is usually processed one pixel after another (or two pixels after two pixels...this depends on the value of the stride) along the horizontal direction on the input image, so as to complete the processing from the image
- the size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix and the depth dimension of the input image are the same.
- the weight matrix will extend to Enter the entire depth of the image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, a single weight matrix is not used, but multiple weight matrices with the same dimension are applied.
- each weight matrix is stacked to form the depth dimension of the convolutional image.
- Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract edge information of the image, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to eliminate unwanted noise in the image. Fuzzy... the dimensions of the multiple weight matrices are the same, the dimension of the feature map extracted by the weight matrix of the same dimension is also the same, and then the extracted feature maps of the same dimension are merged to form the output of the convolution operation .
- weight values in these weight matrices need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained through training can extract information from the input image, thereby helping the convolutional neural network 100 to make correct predictions.
- the initial convolutional layer (such as 121) often extracts more general features, which can also be called low-level features; with the convolutional neural network
- the subsequent convolutional layers for example, 126
- features such as high-level semantics
- the pooling layer in the convolutional layer/pooling layer 120 is the pooling layer in the convolutional layer/pooling layer 120:
- the pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
- the pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling the input image to obtain an image with a smaller size.
- the average pooling operator can calculate the pixel values in the image within a specific range to generate an average value.
- the maximum pooling operator can take the pixel with the largest value within a specific range as the result of the maximum pooling.
- the operators in the pooling layer should also be related to the image size.
- the size of the image output after processing by the pooling layer can be smaller than the size of the image of the input pooling layer, and each pixel in the image output by the pooling layer represents the average value or the maximum value of the corresponding sub-region of the image input to the pooling layer.
- the convolutional neural network 100 After processing by the convolutional layer/pooling layer 120, the convolutional neural network 100 is not enough to output the required output information. Because as mentioned above, the convolutional layer/pooling layer 120 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other related information), the convolutional neural network 100 needs to use the neural network layer 130 to generate one or a group of required classes of output. Therefore, the neural network layer 130 may include multiple hidden layers (131, 132 to 13n as shown in FIG. 6) and an output layer 140. The parameters contained in the multiple hidden layers can be based on specific task types. The relevant training data of the, for example, the task type can include image recognition, image classification, image super-resolution reconstruction and so on.
- the output layer 140 After the multiple hidden layers in the neural network layer 130, that is, the final layer of the entire convolutional neural network 100 is the output layer 140.
- the output layer 140 has a loss function similar to the classification cross entropy, which is specifically used for calculations. Prediction error, once the forward propagation of the entire convolutional neural network 100 (as shown in Figure 6 from 110 to 140 is the forward propagation) is completed, the back propagation (as shown in Figure 6 is the propagation from 140 to 110 is the back propagation) The weight values and deviations of the aforementioned layers will start to be updated to reduce the loss of the convolutional neural network 100 and the error between the output result of the convolutional neural network 100 through the output layer and the ideal result.
- CNN convolutional neural network 100 shown in FIG. 6 is only used as an example of a CNN.
- CNN may also exist in the form of other network models, for example, as shown in FIG. 7
- the two convolutional layers/pooling layers are in parallel, and the respectively extracted features are input to the full neural network layer 130 for processing.
- the concept of input layer and output layer is gradually being diluted, but the function of input layer and output layer is realized through convolutional layer, in some CNNs, there can be only convolutional layer.
- CNN can also include Other types of layers are not specifically limited here.
- any layer of the neural network represents the convolutional layer of CNN (the other layers can be regarded as the layer with zero channels. ), if the neural network is another type of deep neural network such as RNN, then any layer of the neural network represents a fully connected layer (similarly, other types of layers can also be regarded as layers with zero channels).
- FIG. 8 is a schematic flowchart of a method for searching for neural network channel parameters provided by an embodiment of this application, which may specifically include:
- the training device will obtain a data set, which includes multiple training data and multiple verification data.
- a data set can be a data set acquired by the infrastructure in Figure 2, specifically it can be multiple data of different types acquired by sensors such as cameras, radars, etc., or multiple image data or multiple video data, as long as
- the data set only needs to be used for iterative training of the neural network and can be used to realize the neural network channel parameter search function of the present application.
- the data type in the data set is not limited here.
- the training device will train the initial neural network based on multiple training data in the data set.
- the training tasks can be classification, detection, segmentation, and so on.
- the trained neural network can be obtained. For example, if the initial neural network is a CNN, it can be iteratively trained according to the CNN training process as shown in FIG. 6 to obtain a trained CNN.
- the training device After the training device obtains the trained neural network, it will further determine the use efficiency of the computing power of any layer in the trained neural network based on the multiple verification data in the data set.
- the computing power (also known as computing power resource) Usage efficiency is the amount of network performance change caused by unit computing power.
- determining the utilization efficiency of any layer in the trained neural network based on multiple verification data in the data set may be as follows: first, obtain any one of the trained neural network A function (ie corresponding relationship) between the computing power of the layer and the number of channels in the any layer, and then calculate the proportion of channels discarded in the any layer according to the function, and further randomly discard all the channels according to the calculated proportion. At least one channel in any one layer is used to obtain a second neural network that discards some channels. Finally, it is determined that the performance change amount reflected by the second neural network through the multiple verification data is the utilization efficiency of computing power.
- a function ie corresponding relationship
- the input neural network has a total of 4 layers (for example, 4 convolutional layers), the first layer has 40 channels, the second layer has 30 channels, and the third layer has 70 Channels, the fourth layer has 50 channels.
- the percentages of channels discarded in each layer calculated according to the function are 4%, 8%, 10%, and 20% respectively.
- the percentage of randomly discarded channels in the first layer is 4%
- the rate of randomly discarded channels in the second layer is 8%
- the rate of randomly discarded channels in the third layer is 10%
- the rate of randomly discarded channels in the fourth layer is 20%
- Each discard can only randomly discard part of the number of channels in one layer. If there are four layers, it is necessary to determine the efficiency of computing power for each of the four layers in the trained neural network based on multiple verification data.
- the performance change amount reflected by the second neural network through the plurality of verification data may be the first loss function reflected by the second neural network through the plurality of verification data and
- the neural network before discarding the channel reflects the difference of the second loss function through multiple verification data. It can also be the accuracy of the recognition result obtained by multiple verification data through the second neural network. The difference in the accuracy of the recognition result obtained by the neural network through the multiple verification data.
- the performance change is not limited here, as long as the performance difference of the neural network before and after the channel is not discarded can be called Is the stated change in performance.
- calculating the ratio of discarded channels in any layer of the neural network according to the function may specifically be as follows: First, the derivative of the function obtained above is obtained to obtain the derivative of the function After that, the number of channels that need to be discarded when any layer of the neural network reduces the computing power by the preset value is determined according to the derivative, and finally, the ratio of the number of channels that need to be discarded to the number of channels of any layer is determined as the ratio.
- the training device adjusts the neural network channel parameters of the trained neural network according to the utilization efficiency of the computing power, thereby obtaining the first neural network.
- the first neural network obtained in this way is a neural network that has adjusted the channel parameters of the neural network once, and its performance is better than that of the neural network that has not been adjusted by the neural network channel parameters.
- the training device adjusts the neural network channel parameters of the trained neural network according to the efficiency of computing power.
- the lower the efficiency of the use of force the corresponding layer reduces the number of channels.
- it can be to obtain the utilization efficiency of each layer of the neural network after training, and then increase the number of channels of the layer corresponding to the use efficiency of the larger first m computing power and reduce the smaller last n computing power
- the use efficiency corresponds to the number of channels in the layer. Specifically, it may be that the number of channels of the layer corresponding to the use efficiency of the larger first m computing power is increased by a first preset ratio (for example, 10%), and the use efficiency of the last n computing power is corresponding to the smaller use efficiency.
- the number of channels of the layer is reduced according to a second preset ratio (for example, 5%).
- the first m are the m that rank before the m+1 serial number when the computing power usage efficiency corresponding to each layer is sorted from high to low
- the last n are the computing power usage efficiency corresponding to each layer from high to low.
- m can be the same as or different from n, which is not limited here; in addition, the first preset ratio can be the same as the second preset ratio, or it can be Different, there is no limitation here.
- the number of iterations (for example, 20) can be set in the training device in advance, and the implementation described in FIG. 8
- the first neural network obtained in the example is iterated as the initial neural network, so as to obtain the first neural network after each iteration, and pass multiple test data (multiple test data can also be data in a data set or a task Target data, which is not specifically limited here) Test the performance of the first neural network and the first neural network after each iteration, when the number of iterations reaches a preset threshold (for example, the number of iterations reaches the preset 20 times), Then, from the first neural network and each first neural network after each iteration, the first neural network with the best performance is determined as the target neural network (for example, the specific operation can be the first neural network after each iteration.
- Use the test data to test the performance of the first neural network, and save the performance and the neural network channel parameters corresponding to the performance
- a neural network channel parameter search method based on the use efficiency of computing power is proposed for the first time.
- the number of channels in the layer reduces the number of channels in the layer with low efficiency in the use of computing power.
- This process can be carried out iteratively, and finally a neural network with very efficient use of computing power will be obtained, thereby solving the inadequacy of the current neural network channel parameter search method Taking into account the complexity, low efficiency and slow search speed.
- this application also proposes a method for calculating the utilization efficiency of the computing power of each layer of the neural network. This method randomly discards some channels at a certain proportion and tests their impact on the network performance. The discarded channels affect different test samples. It is random to calculate the efficiency of computing power used by each layer of the neural network.
- the use efficiency of computing power can have a variety of specific manifestations.
- the computing power can be FLOPs, and the use efficiency of computing power correspondingly refers to the use efficiency of FLOPs, that is, FUR, FUR is Refers to the efficiency of the neural network in the use of floating-point arithmetic, which is used to measure whether the neural network is efficient in the complexity of floating-point operations.
- the neural network channel parameter search system 900 is a FUR-based neural network channel parameter search framework, which may specifically include but is not limited to: network training module 901, FUR The calculation module 902 and the channel update module 903, wherein the network training module 901 is used to iteratively train the initial neural network using the training data in the acquired data set to obtain the trained neural network; the FUR calculation module 902 is used to calculate The FUR of each layer of the neural network after training is the core part of the embodiment of the present application; the channel update module 903 is used to adjust the neural network channel parameters of the neural network according to the calculated FUR, that is, update the number of channels of each layer of the neural network. The input neural network will continue to pass through these three modules until it reaches the set number of iterations.
- the neural network with the best performance among these iterations will be used as the final output neural network (that is, the target neural network in the above embodiment).
- the overall process is shown in Figure 10, where a predetermined data set (not shown in Figure 10) will be divided into a training set, a verification set, and a test set (in some embodiments, the test set can also be It is the data of other data sets, which is not limited here).
- the training set includes multiple training data, which are used to train the network structure of the input neural network, the verification set is used to calculate the FUR of each layer of the trained neural network, and the test set is used to test the output after each iteration The network performance of the neural network.
- the FUR calculation module 902 evaluates the FUR of each layer of the neural network, and the data used in the evaluation is multiple verification data on the verification set.
- the channel update module 903 updates the number of channels according to the obtained FUR of each layer.
- the specific update strategy is that a layer with a higher FUR will increase the number of channels, and a layer with a lower FUR will reduce the number of channels.
- the network structure of the new neural network can be obtained. The new network structure will be sent back to the network training module 901 to restart training (because the neural network channel parameters do not exist independently, and are different from other networks in the network structure.
- the parameters are related, so losing some of the channel numbers will change the network structure. In extreme cases, the trained network will be unavailable, so it needs to be retrained.) FUR calculation and channel number update are performed again. This process will be repeated for many rounds. Until the network structure of the searched neural network is good enough or the preset number of iterations is reached. At this time, the network structure of the neural network with the best performance in the whole process is the search result of this method. Among them, the method of selecting the network structure of the neural network with the best performance is to compare the network performance on the verification set during the search process.
- the embodiment of the present application first models the influence of the number of channels in each layer of the neural network on FLOPs, that is, obtains the function of the number of FLOPs in each layer of the neural network and the number of channels in the layer. Since the number of channels is discrete, this application uses this function to simulate the effect of the number of continuous channels on FLOPs. Then, for the trained neural network, calculate the number of channels corresponding to each layer of FLOPs through the FLOPs function.
- each layer of the neural network randomly discards some channels of the corresponding layer at the corresponding discarding ratios and observes the changes in the performance of the network on the verification set after the number of channels changes.
- the performance change amount of is the required FUR (only one layer can be discarded each time, and the other layers or other channels of the layer are discarded next time, that is, iterative discarding). It should be noted that the discarded channels are random for different test examples to calculate the efficiency of using FLOPs in each layer of the neural network.
- the network training module 901 trains the network model of the input neural network, for example, through the training of the dataset ImageNet (a public image recognition dataset), this application can set some search parameters in advance, for example, only train 10 Epochs, that is, the preset threshold of the number of iterations is 10, 1 epoch means that all samples in the training set have been passed through 1 pass, the learning rate is 0.1, the number of pictures per cluster in training (batch size) is 256, batch size represents the sample size used in one iteration, and the neural network channel parameters of the network structure are updated once in each iteration.
- the learning rate uses a cosine descent method.
- the FUR calculation module 902 first calculates the relationship between the number of channels in each layer of the network and FLOPs.
- a neural network without branches is used (a neural network with branches also uses a similar method, which can be deduced by analogy, and will not be repeated here).
- the functional relationship between FLOPs and the number of channels in the corresponding layer is:
- c l is the number of channels output by the first layer of the neural network
- M is FLOPs that have nothing to do with c l .
- k l is the size of the convolution kernel; if the initial neural network is another fully connected layer
- the derivative represents the sensitivity of the number of channels in each layer of the neural network on FLOPs. That is, when reducing ⁇ F FLOPs from each layer, the number of channels that need to be thrown away is:
- the number of channels c l is usually a decimal, and the ratio of the number of channels that need to be discarded at each layer can be obtained as This ratio is the above-mentioned discard ratio.
- the number of channels in each layer of the neural network is randomly discarded at this ratio, and the corresponding FLOPs changes are counted, so that the FUR of each layer can be estimated as:
- FUR l L val (c, SpatialDropout(W * , p l , l))-L val (c, W * )
- L val represents the loss function (loss) on the verification set.
- the channel update module 903 can update the number of channels of the corresponding layer according to the FUR of each layer of the neural network. Specifically, first sort the FUR of each layer, then select the larger first k and the smallest k FUR, increase the number of channels of the largest k FUR corresponding to the layer, and the smaller k FURs correspond to the number of channels of the layer reduce.
- the magnitude of increase or decrease is a hyperparameter that can be adjusted. Among them, k will gradually decrease with the search process.
- the neural network channel parameter search system 900 may also include more or fewer modules, as long as it can be used to implement the network channel search methods described in the foregoing embodiments. Specifically, the division method of the functional modules of the neural network channel parameter search system 900 is not specifically limited here.
- the purpose of the embodiments of the present application is to provide a method for searching neural network channel parameters, so as to search for more efficient neural network channel parameters.
- the following combined experimental data to further demonstrate the beneficial effects of this solution As shown in Table 1, this application significantly improves the network's CIFAR- 100 (a public image recognition data set).
- Table 1 Comparison of the performance of the network structure searched by the search method of this application on the public data set and the original network
- a search system for neural network channel parameters based on the use efficiency of FLOPs is proposed.
- the system is characterized by searching for neural network channel parameters according to the use efficiency of FLOPs in each layer of the neural network during the search process ( That is, in the search process, the neural network channel parameters of the neural network are adjusted iteratively by calculating the use efficiency of FLOPs in each layer of the neural network).
- the above-mentioned embodiment of this application also proposes a method for calculating the use efficiency of FLOPs.
- Each layer of the neural network discards channels in a certain proportion and tests its impact on performance, so as to calculate the efficiency of the use of FLOPs in each layer of the neural network.
- the neural network channel parameter search method described in the above embodiments can be implemented on the cloud side, for example, a training device on the cloud side (the training device can be implemented by one or more servers) can obtain the data set. , And train the initial neural network according to the multiple training data in the data set to obtain the trained neural network, and then determine the use of computing power in any layer of the trained neural network based on the multiple verification data in the data set Efficiency, finally adjust the neural network channel parameters of the trained neural network according to the efficiency of computing power to obtain the first neural network, and then use the obtained first neural network as the new initial neural network for iteration; as described in the above embodiment
- the search method of neural network channel parameters can also be implemented on the terminal side, for example, can be obtained by terminal devices (such as personal computers, computer workstations, smart phones, tablets, smart cars, media consumption devices, wearable devices, etc.) Data set, and train the initial neural network based on multiple training data in the data set to obtain the trained neural network, and then determine the computing power of any layer in the trained
- the training device can be implemented by one or more servers.
- the data determines the use efficiency of computing power in any layer of the trained neural network, and finally adjusts the neural network channel parameters of the trained neural network according to the use efficiency of computing power to obtain the first neural network, and then the terminal device will get the
- the first neural network is sent to the training device on the cloud side, and the training device on the cloud side then iterates the received first neural network as a new initial neural network.
- the neural network channel parameter search methods described in the embodiments of the present application are all implemented on the cloud side as an example to illustrate a system architecture of the present application. Please refer to FIG. 11.
- the embodiments of the present application provide a system Architecture 1100.
- the training device 210 is implemented by one or more servers, and optionally, cooperates with other computing devices, such as data storage, routers, load balancers and other devices; the training device 210 can be arranged on one physical site or distributed in multiple On the physical site.
- the training device 210 can use the data set in the data storage system 250 (such as the object picture data set described in the foregoing embodiments), or call the program code in the data storage system 250 to implement the function of training the initial neural network, thereby obtaining After training the neural network, afterwards, it can further use the data set in the data storage system 250 or call the program code in the data storage system 250 to determine the utilization efficiency of any layer in the trained neural network (eg, for The use efficiency of FLOPs), and finally adjust the neural network channel parameters of the trained neural network according to the use efficiency of computing power to obtain the first neural network.
- the data set in the data storage system 250 such as the object picture data set described in the foregoing embodiments
- the program code in the data storage system 250 to implement the function of training the initial neural network, thereby obtaining
- it can further use the data set in the data storage system 250 or call the program code in the data storage system 250 to determine the utilization efficiency of any layer in the trained neural network (eg, for The use efficiency of FLOPs), and finally adjust the neural
- the number of iterations (for example, 30) can be set in the training device 210 in advance, and the first neural network obtained above can be iterated as the new initial neural network, so as to obtain each time The first neural network after iteration, and through multiple test data (multiple test data can also be the data in the data set, or the data of the task target, the specifics are not limited here) to test the first neural network and each time The performance of the first neural network after iteration, when the number of iterations reaches a preset threshold (for example, the number of iterations reaches the preset 30 times), it is determined from the first neural network and each first neural network after each iteration
- the first neural network with the best performance is the target neural network (for example, the specific operation can be to use the test data to test the performance of the first neural network after each iteration of the first neural network, and save the performance and the performance Corresponding neural network channel parameters) and output the target neural network.
- the output target neural network is the optimized neural network.
- the training device 210 may include the neural network channel parameter search system in Figs. 3-5 and 9 and the functions of each functional module in the system. For details, please refer to Figs. 3-5 and 9 corresponding to Figs. Examples are not repeated here.
- the user can operate respective user devices (for example, the local device 301 and the local device 302) to interact with the training device 210.
- Each local device can represent any computing device, such as personal computers, computer workstations, smart phones, tablets, smart cameras, smart cars or other types of cellular phones, media consumption devices, wearable devices, set-top boxes, game consoles, etc.
- Each user's local device can interact with the training device 210 through a communication network of any communication mechanism/communication standard.
- the communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
- one or more aspects of the training device 210 can be implemented by each local device.
- the local device 301 can obtain a neural network trained by the training device, and determine the trained neural network based on the verification data. According to the efficiency of computing power in any layer in the layer, finally adjust the neural network channel parameters of the trained neural network according to the efficiency of computing power to obtain the first neural network, and then the local device 301 sends the obtained first neural network to The training device 210, the training device 210 then iterates the received first neural network as the initial neural network.
- the training device 210 can also be implemented by a local device.
- the local device 301 implements the function of the training device 210 and provides services for its own users, or provides services for users of the local device 302.
- the neural network that adjusts the neural network channel parameters according to the efficiency of the use of computing power in any layer of the neural network is used to perform image processing.
- it can be applied to the intelligent object recognition as shown in Figure 4, can also be applied to the self-driving vehicle recognition as shown in Figure 5, and can also be applied to other intelligent terminals, intelligent transportation, intelligent medical, intelligent Security, safe city and other fields.
- the neural network provided by the above-mentioned embodiments of this application can be used to adjust the neural network channel parameters according to the utilization efficiency of any layer in the neural network.
- the embodiments of this application An image processing method is also provided. As shown in FIG. 12, the image processing method may specifically include:
- the execution device acquires a target image, which may be a picture/video frame to be recognized or located.
- the target neural network is a neural network that has adjusted the channel parameters of the neural network according to the utilization efficiency of the computing power of any layer in the network.
- the execution device will operate the target image through the target neural network, which is a neural network that has adjusted the channel parameters of the neural network according to the utilization efficiency of the computing power of any layer in the network.
- the target neural network which is a neural network that has adjusted the channel parameters of the neural network according to the utilization efficiency of the computing power of any layer in the network.
- how to adjust the neural network channel parameters according to the utilization efficiency of the computing power of any layer in the network can refer to the neural network channel parameter search method or neural network channel described in the embodiments corresponding to FIGS. 3-5 and 8-11.
- the steps performed by the parameter search system will not be repeated here.
- the neural network channel parameters are only optimized during the training phase, and the application phase of the optimized neural network is not optimized. The improvement is made.
- the execution device can operate on the target image through CNN as shown in Figure 6.
- the target image is used as input, and the input layer 110 and convolutional layer of CNN are used as input.
- /Pooling layer 120 and neural network layer 130 perform corresponding processing. Please refer to FIG. 6 for the specific processing process, which will not be repeated here.
- the final execution device After processing by the neural network, the final execution device outputs the recognition result of the target object.
- the recognition result may be the category information and position information of the target object in the target image.
- FIG. 13 is a schematic structural diagram of a training device provided by an embodiment of the application.
- the training device 1300 includes: an acquisition module 1301, a training module 1302, a determination module 1303, and an adjustment module 1304.
- the acquisition module 1301 uses To obtain a data set, the data set includes a plurality of training data and a plurality of verification data; the training module 1302 is used to train the initial neural network according to the plurality of training data to obtain the trained neural network; the determination module 1303 , Used to determine the utilization efficiency of computing power in any layer of the trained neural network according to the multiple verification data, where the computing power utilization efficiency is the amount of network performance change caused by the unit computing power; adjustment module 1304 , For adjusting the neural network channel parameters of the trained neural network according to the utilization efficiency of the computing power to obtain the first neural network.
- the training module 1302 is also used to: iterate the first neural network as the initial neural network, obtain the first neural network after each iteration, and test the data by multiple test data.
- the performance of the first neural network and the performance of the first neural network after each iteration are described, and then the number of iterations is obtained.
- the number of iterations can be preset (for example, the number of iterations is set to 20), and when the number of iterations reaches the preset Threshold, the first neural network with the best performance is determined from the first neural network and each first neural network after each iteration as the target neural network (for example, the specific operation may be to obtain the first neural network in each iteration).
- the neural network uses the test data to test the performance of the first neural network, saves the performance and the neural network channel parameters corresponding to the performance), and outputs the target neural network.
- the output target neural network is the process described above.
- the optimized neural network is the process described above. The optimized neural network.
- the determining module 1303 is specifically configured to: obtain the function of the computing power and the number of channels in the layer of any layer in the trained neural network, and calculate the function of the number of channels in the layer according to the function. After that, at least one channel of any layer is randomly discarded according to the ratio to obtain a second neural network that discards some channels. Finally, it is determined that the second neural network passes the multiple verification data The reflected performance change amount is the utilization efficiency of the computing power.
- the determining module 1303 is specifically further used to: derivate the function to obtain the derivative of the function, and determine, according to the derivative, that the calculation power of any layer needs to be reduced by a preset value. The number of discarded channels, and then it is determined that the ratio of the number of channels that need to be discarded to the number of channels of any layer is the ratio.
- the performance variation may specifically include the first loss function reflected by the second neural network through the multiple verification data, and the neural network before the channel is not discarded through the multiple verification data.
- the difference of the second loss function obtained can also be the accuracy of the recognition result obtained by identifying multiple verification data on the second neural network and the recognition obtained by the neural network before the channel is not discarded through the multiple verification data.
- the difference in the accuracy of the result is not specifically limited here, as long as it can measure the performance difference of the neural network before and after the channel is not discarded, it can be called the performance change.
- the adjustment module 1304 is specifically configured to: obtain the computing power usage efficiency of each layer in the trained neural network, and increase the layer corresponding to the larger first m computing power usage efficiency And reduce the number of channels of the layer corresponding to the use efficiency of the lower n computing power, where the first m is the number of channels corresponding to the computing power of each layer in descending order of m+
- the m before a serial number, and the last n are the n after the last n-1 serial number when sorting from high to low in the utilization efficiency of the corresponding computing power of each layer.
- m can be the same as or different from n. There is no limitation here.
- the adjustment module 1304 is specifically used to: increase the number of channels of the layer corresponding to the use efficiency of the first m computing power with a larger first preset ratio (for example, 10%) and be smaller
- the number of channels in the layer corresponding to the use efficiency of the last n computing power is reduced by a second preset ratio (for example, 5%).
- the first preset ratio may be the same as or different from the second preset ratio, specifically here There is no limit.
- the computing power can be FLOPs, and correspondingly, the utilization efficiency of computing power can be FUR.
- the data set may be multiple data obtained by sensors, for example, it may be data obtained by sensors such as a camera or a red line sensor.
- the data set may also be multiple image data or multiple video data, which is not limited here.
- FIG. 14 is a schematic structural diagram of an execution device provided by an embodiment of the application.
- the execution device 1400 includes: an acquisition module 1401 and an operation module 1402, wherein the acquisition module 1401, used to obtain a target image, the target image may be a picture/video frame to be recognized or located, etc., the operation module 1402, used to operate the target image through the target neural network, and output the target image
- the recognition result can be the category information and location information of the target object in the target image.
- the target neural network is a neural network that has adjusted the channel parameters of the neural network according to the utilization efficiency of the computing power of any layer in the network.
- how to adjust the neural network channel parameters according to the utilization efficiency of the computing power of any layer in the network can refer to the neural network channel parameter search method or neural network channel parameter search method or neural network described in the above-mentioned embodiments corresponding to Figure 3- Figure 5 and Figure 8- Figure 11.
- the steps performed by the network channel parameter search system will not be repeated here.
- the neural network channel parameters are optimized only in the training phase, and the application phase of the optimized neural network is No improvement has been made. Therefore, taking the target neural network as CNN as an example, the execution device can operate on the target image through CNN as shown in FIG.
- the accumulation/pooling layer 120 and the neural network layer 130 perform corresponding processing. Please refer to FIG. 6 for the specific processing process, which will not be repeated here.
- FIG. 15 is a schematic structural diagram of the training device provided in an embodiment of this application.
- the described training device 1300 is used to implement the functions of the training device 1300 in the embodiment corresponding to FIG. 13.
- the training device 1500 is implemented by one or more servers, and the training device 1500 may have relatively large differences due to different configurations or performances.
- CPU central processing units
- storage media 1530 for example, one or more storage media 1530 for storing application programs 1542 or data 1544
- the memory 1532 and the storage medium 1530 may be short-term storage or permanent 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 on the training device 1500.
- the central processing unit 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, etc.
- operating systems 1541 such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
- the central processing unit 1522 is configured to execute the neural network channel parameter search method executed by the training device in the embodiment corresponding to FIG. 8. Specifically, the central processing unit 1522 is used to obtain a data set, the data set includes a plurality of training data and a plurality of verification data, and then the initial neural network is trained according to the plurality of training data to obtain the trained neural network, And according to the multiple verification data, determine the use efficiency of computing power in any layer of the trained neural network.
- the use efficiency of computing power is the amount of network performance change caused by the unit computing power.
- the use efficiency of force adjusts the neural network channel parameters of the trained neural network to obtain the first neural network.
- the computing power may be FLOPs, and correspondingly, the utilization efficiency of the computing power may be FUR.
- the data set may be multiple data obtained by sensors, for example, it may be data obtained by sensors such as a camera or a red line sensor. In another possible design, the data set may also be multiple image data or multiple video data, which is not limited here.
- the central processing unit 1522 is also used to iterate the first neural network as the initial neural network, obtain the first neural network after each iteration, and pass multiple test data tests The performance of the first neural network and the performance of the first neural network after each iteration, and then the number of iterations is obtained.
- the number of iterations can be preset (for example, the number of iterations is set to 20), and when the number of iterations reaches the preset
- the threshold is set, the first neural network with the best performance is determined from the first neural network and each first neural network after each iteration as the target neural network (for example, the specific operation may be to obtain the first neural network in each iteration.
- the output target neural network is the above-mentioned target neural network.
- the optimized neural network uses the test data to test the performance of the first neural network, and save the performance and the neural network channel parameters corresponding to the performance), and output the target neural network.
- the output target neural network is the above-mentioned target neural network.
- the optimized neural network uses the optimized neural network.
- the central processing unit 1522 is specifically configured to obtain a function of the computing power of any layer in the trained neural network and the number of channels in the layer, and calculate the function of any layer according to the function. After that, at least one channel of any layer is randomly discarded according to the ratio to obtain a second neural network that discards some channels. Finally, it is determined that the second neural network passes the multiple
- the performance change reflected by the verification data is the utilization efficiency of the computing power. It should be noted that the performance change amount may specifically include the first loss function reflected by the second neural network through the multiple verification data and the first loss function reflected by the neural network before the channel is not discarded through the multiple verification data.
- the difference of the second loss function can also be the accuracy of the recognition result obtained by identifying multiple verification data on the second neural network and the accuracy of the recognition result obtained by the neural network before discarding the channel through the multiple verification data.
- the difference of the rate, specifically, the performance change is not limited here, as long as the performance difference of the neural network before and after the undiscarded channel can be measured, it can be called the performance change.
- the central processing unit 1522 is specifically used to derive the function to obtain the derivative of the function, and to determine according to the derivative when the computing power of any layer decreases by a preset value The number of channels that need to be discarded, and then it is determined that the ratio of the number of channels that need to be discarded to the number of channels in any layer is the ratio.
- the central processing unit 1522 is specifically also used to obtain the computing power utilization efficiency of each layer in the trained neural network, and increase the utilization efficiency of the first m computing power corresponding to the larger one.
- the number of channels in the layer and the number of channels in the layer corresponding to the lower n computing power usage efficiency is reduced, where m may be the same as or different from n, and the details are not limited here.
- the number of channels in the layer corresponding to the use efficiency of the larger first m computing power is increased by a first preset ratio (eg, 10%) and the layer corresponding to the use efficiency of the last n computing power is smaller.
- the number of channels is reduced according to a second preset ratio (for example, 5%).
- the first preset ratio may be the same as or different from the second preset ratio, which is not specifically limited here.
- FIG. 16 is a schematic structural diagram of an execution device provided by an embodiment of this application.
- Realistic VR devices, mobile phones, tablets, laptops, smart wearable devices, surveillance data processing devices or radar data processing devices, etc. are not limited here.
- the execution device 1600 described in the embodiment corresponding to FIG. 14 may be deployed on the execution device 1600 to implement the functions of the execution device 1400 in the embodiment corresponding to FIG. 14.
- the execution device 1600 includes: a receiver 1601, a transmitter 1602, a processor 1603, and a memory 1604 (the number of processors 1603 in the execution device 1600 may be one or more, and one processor is taken as an example in FIG. 16) ,
- the processor 1603 may include an application processor 16031 and a communication processor 16032.
- the receiver 1601, the transmitter 1602, the processor 1603, and the memory 1604 may be connected by a bus or in other ways.
- the memory 1604 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1603. A part of the memory 1604 may also include a non-volatile random access memory (NVRAM).
- NVRAM non-volatile random access memory
- the memory 1604 stores a processor and operating instructions, executable modules or data structures, or a subset of them, or an extended set of them.
- the operating instructions may include various operating instructions for implementing various operations.
- the processor 1603 controls the operation of the execution device 1600.
- the various components of the execution device 1600 are coupled together through a bus system.
- the bus system may also include a power bus, a control bus, and a status signal bus.
- various buses are referred to as bus systems in the figure.
- the method disclosed in the above embodiment corresponding to FIG. 12 of the present application may be applied to the processor 1603 or implemented by the processor 1603.
- the processor 1603 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 1603 or instructions in the form of software.
- the aforementioned processor 1603 may be a general-purpose processor, a digital signal processing (digital signal processing, DSP), a microprocessor or a microcontroller, and may further include an application specific integrated circuit (ASIC), field programmable Field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- DSP digital signal processing
- FPGA field programmable Field-programmable gate array
- the processor 1603 can implement or execute the methods, steps, and logical block diagrams disclosed in the embodiment corresponding to FIG. 12 of the present application.
- the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
- the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
- the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
- the storage medium is located in the memory 1604, and the processor 1603 reads the information in the memory 1604, and completes the steps of the foregoing method in combination with its hardware.
- the receiver 1601 can be used to receive input digital or character information, and generate signal input related to the relevant settings and function control of the execution device 1600.
- the transmitter 1602 can be used to output digital or character information through the first interface; the transmitter 1602 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 1602 can also include display devices such as a display screen .
- the processor 1603 is configured to execute the image processing method executed by the execution device in the embodiment corresponding to FIG. 12.
- the application processor 16031 is configured to obtain a target image, and the target image may be a picture/video frame to be recognized or located. After that, the application processor 16031 will be used to operate the target image through the target neural network, which is a neural network that has adjusted the channel parameters of the neural network according to the utilization efficiency of the computing power of any layer in the network.
- how to adjust the neural network channel parameters according to the utilization efficiency of the computing power of any layer in the network can refer to the neural network channel parameter search method or neural network channel described in the embodiments corresponding to FIGS. 3-5 and 8-11.
- the processor 16031 is finally applied to output the recognition result of the target object.
- the recognition result may be the category information, position information, etc. of the target object in the target image.
- An embodiment of the present application also provides a computer-readable storage medium, which stores a program for signal processing, and when it runs on a computer, the computer executes the embodiment shown in FIG. 8
- the steps performed by the training device in the described method, or the computer is caused to execute the steps performed by the execution device in the method described in the embodiment shown in FIG. 12.
- the training equipment, execution equipment, etc. provided in the embodiments of the present application may specifically be chips.
- the chips include a processing unit and a communication unit.
- the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface and a pin. Or circuits, etc.
- the processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the training device executes the neural network channel parameter search method described in the embodiment shown in FIG. 8, or so that the chip in the execution device executes the above FIG.
- the illustrated embodiment describes the image processing method.
- the storage unit is a storage unit in the chip, such as a register, a 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 (RAM), etc.
- ROM Read-only memory
- RAM random access memory
- Figure 17 is a schematic diagram of a structure of a chip provided by an embodiment of the application.
- the Host CPU assigns tasks.
- the core part of the NPU is the arithmetic circuit 200.
- the arithmetic circuit 2003 is controlled by the controller 2004 to extract matrix data from the memory and perform multiplication operations.
- the arithmetic circuit 2003 includes multiple processing units (Process Engine, PE). In some implementations, the arithmetic circuit 2003 is a two-dimensional systolic array. The arithmetic circuit 2003 may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 2003 is a general-purpose matrix processor.
- PE Process Engine
- the arithmetic circuit fetches the corresponding data of matrix B from the weight memory 2002 and caches it on each PE in the arithmetic circuit.
- the arithmetic circuit fetches the matrix A data and matrix B from the input memory 2001 to perform matrix operations, and the partial result or final result of the obtained matrix is stored in an accumulator 2008.
- the unified memory 2006 is used to store input data and output data.
- the weight data directly passes through the memory unit access controller (Direct Memory Access Controller, DMAC) 2005, and the DMAC is transferred to the weight memory 2002.
- the input data is also transferred to the unified memory 2006 through the DMAC.
- DMAC Direct Memory Access Controller
- the BIU is the Bus Interface Unit, that is, the bus interface unit 2010, which is used for the interaction between the AXI bus and the DMAC and the instruction fetch buffer (IFB) 2009.
- IFB instruction fetch buffer
- the bus interface unit 2010 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 2009 to obtain instructions from the external memory, and is also used for the storage unit access controller 2005 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
- DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 2006 or the weight data to the weight memory 2002 or the input data to the input memory 2001.
- the vector calculation unit 2007 includes multiple arithmetic processing units, if necessary, further processing the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on. It is mainly used in the calculation of non-convolutional/fully connected layer networks in neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.
- the vector calculation unit 2007 can store the processed output vector to the unified memory 2006.
- the vector calculation unit 2007 may apply a linear function and/or a non-linear function to the output of the arithmetic circuit 2003, such as linearly interpolating the feature plane extracted by the convolutional layer, and then, for example, a vector of accumulated values to generate the activation value.
- the vector calculation unit 2007 generates normalized values, pixel-level summed values, or both.
- the processed output vector can be used as an activation input to the arithmetic circuit 2003, for example for use in a subsequent layer in a neural network.
- the instruction fetch buffer 2009 connected to the controller 2004 is used to store instructions used by the controller 2004;
- the unified memory 2006, the input memory 2001, the weight memory 2002, and the fetch memory 2009 are all On-Chip memories.
- the external memory is private to the NPU hardware architecture.
- each layer in the CNN shown in FIG. 6 and FIG. 7 may be executed by the arithmetic circuit 2003 or the vector calculation unit 2007.
- processor mentioned in any of the foregoing may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the program of the method in the first aspect.
- the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physically separate.
- the physical unit can be located in one place or distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the connection relationship between the modules indicates that they have a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
- this application can be implemented by means of software plus necessary general hardware.
- it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memory, Dedicated components and so on to achieve.
- all functions completed by computer programs can be easily implemented with corresponding hardware.
- the specific hardware structures used to achieve the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. Circuit etc.
- software program implementation is a better implementation in more cases.
- the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and 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 make a computer device (which can be a personal computer, training device, or network device, etc.) execute the various embodiments described in 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 devices.
- the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a website, computer, training device, or data.
- the center uses wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to transmit to another website, computer, training equipment, or data center.
- 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 can be stored by a computer or a data storage device such as a training device or a data center integrated with one or more available media.
- the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
一种神经网络通道参数的搜索方法及相关设备,一种基于算力(如FLOPs)的使用效率的神经网络通道参数搜索方法,其应用于人工智能领域,首先计算网络各层对算力的使用效率,然后增加算力的使用效率高的层的通道数,减少算力的使用效率低的层的通道数,该过程可迭代进行,最终获得对算力的使用效率非常高效的神经网络,缓解了目前神经网络通道参数搜索方法没有充分考虑到复杂度、使用效率低、搜索速度慢等问题。还提出了一种计算神经网络各层对算力的使用效率的方法,该方法以一定比例随机丢弃部分通道并测试其对网络性能的影响,丢弃的通道对于不同测试样例是随机的,以此计算神经网络每层对算力的使用效率。
Description
本申请要求于2020年2月21日提交中国专利局、申请号为202010109184.0、申请名称为“一种神经网络通道参数的搜索方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及人工智能领域,尤其涉及一种神经网络通道参数的搜索方法及相关设备。
近年来,随着深度学习的发展,神经网络被应用到各个领域,神经网络的网络结构对其性能有重要影响。因此,设计神经网络的网络结构的技术受到业界的广泛关注。该网络结构的设计最初是人为手工设计,人工手工设计耗时且性能也有待提高,因此网络结构搜索技术得到了长足发展。
网络结构搜索技术是一种优化网络结构的技术,其通过自动搜索的策略来设计网络结构,即网络结构搜索技术在定义的搜索空间内自动地寻找较好的网络结构。目前,基于网络结构搜索技术得到的网络结构的性能已经超过了人为设计的网络结构。其中,神经网络通道参数是一种可以搜索的网络结构参数。通过自动搜索的策略来设计神经网络通道参数的方法被称为神经网络通道参数搜索技术,通过神经网络通道参数搜索技术优化神经网络通道参数能够有效提升神经网络的性能。
目前普遍采用的网络通道数参数搜索技术是基于剪枝的神经网络通道参数搜索方法,该方法通过剪掉不重要的通道来获取更高效的神经网络通道参数。然而,该方法剪掉不重要的通道时只考虑是否重要,没考虑性价比。此外,剪枝是通过除去不重要通道得到神经网络通道参数,不是直接对通道数的搜索,因此会有偏差。
发明内容
本申请实施例提供了一种神经网络通道参数的搜索方法及相关设备,可用于人工智能领域中,该方法基于神经网络中任意一层对算力的使用效率调整训练后的神经网络的神经网络通道参数,实现神经网络的神经网络通道参数的搜索,从而在不提升神经网络复杂度的前提下提高神经网络的性能。
基于此,本申请实施例提供以下技术方案:
第一方面,本申请实施例首先提供一种神经网络通道参数的搜索方法,可用于人工智能领域中,该方法包括:首先,训练设备会获取数据集,该数据集就包括多个训练数据及多个验证验证数据。之后,训练设备会根据数据集中的多个训练数据对初始神经网络进行训练,训练的任务可以是分类、检测、分割等,之后就可以得到训练后的神经网络,训练设备得到训练好的神经网络之后,会进一步根据数据集中的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率,该算力的使用效率为单位算力引起的网络性能改变量,最后,训练设备根据算力的使用效率调整训练后的神经网络的神经网络通道参数,从 而得到第一神经网络。
在本申请上述实施例中,首次提出了一种基于算力的使用效率的神经网络通道参数搜索方法,该方法首先计算神经网络各层对算力的使用效率,并基于得到的神经网络各层对算力的使用效率调整训练后的神经网络的神经网络通道参数,从而得到第一神经网络。这样得到的第一神经网络就是调整过一次神经网络通道参数的神经网络,其比未经过神经网络通道参数调整的神经网络的性能是更好的。
在第一方面的一种可能实现方式中,为了得到性能更优的神经网络,还可以事先在训练设备中设置好迭代次数,并将得到的第一神经网络作为新的初始神经网络进行迭代,从而得到每次迭代后的第一神经网络,并通过多个测试数据(多个测试数据可以是数据集中的数据,也可以是任务目标的数据,具体此处不做限定)测试第一神经网络和每次迭代后的第一神经网络的性能,当迭代次数达到预设阈值(如,迭代次数达到预设的20次)时,则从第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络(如,具体操作可以是每次迭代获取到第一神经网络后就利用测试数据测试该第一神经网络的性能,并保存该性能以及该性能对应的神经网络通道参数),并输出该目标神经网络,该输出的目标神经网络就是上述所述的经过优化后的神经网络。
在本申请上述实施例中,将得到的第一神经网络又作为新的初始神经网络重新进行迭代训练、计算神经网络各层对算力的使用效率、调整神经网络通道参数等步骤,从而得到新的下一次迭代的第一神经网络,达到预设次数后,选择性能最好的一个第一神经网络作为最终输出的目标神经网络,通过多次迭代,最终输出的目标神经网络将是性能最优的。
在第一方面的一种可能实现方式中,根据数据集中的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率可以是:首先,获取训练后的神经网络中任意一层的算力与该层通道数的函数(即对应关系),之后,根据该函数计算所述任意一层中的通道被丢弃的比例,即确定该按照多少比例丢弃该层的部分通道,并进一步根据计算得到的比例随机丢弃所述任意一层的部分通道,从而得到丢弃通道的第二神经网络,最后,确定该第二神经网络通过多个验证数据反应出的性能变化量为算力的使用效率。为便于理解,此处举例说明:假设输入的神经网络一共有4层(如,4个卷积层),第1层有40个通道,第2层有30个通道,第3层有70个通道,第4层有50个通道,根据函数计算得到的每层的通道被丢弃的比例分别为4%、8%、10%、20%,那么第1层中通道被随机丢弃的比例就为4%,第2层中通道被随机丢弃的比例就为8%,第3层中通道被随机丢弃的比例就为10%,第4层中通道被随机丢弃的比例就为20%,并且,每次丢弃只能随机丢弃一层的部分通道数,有四层的话,就需要根据验证数据逐层确定训练后的神经网络中四层中的每一层对算力的使用效率。
在本申请上述实施例中,具体阐述了如何确定算力的使用效率,即先获取函数,再计算神经网络每层对应的通道数的丢弃概率,之后分别以相应比例随机丢弃每层的部分通道并测试网络性能,由此确定算力的使用效率,具备灵活性。
在第一方面的一种可能实现方式中,根据函数计算神经网络任意一层中的通道被丢弃的比例具体可以是:首先,对上述获取到的函数求导,得到该函数的导数,之后,根据该 导数确定神经网络的任意一层对算力降低预设值时需要丢弃的通道数,最后,确定需要丢弃的通道数与任意一层的通道数的比值为所述的比例。
在本申请上述实施例中,具体阐述了如何确定丢弃比例,即神经网络每层降低固定的算力时需要丢弃多少通道数,需要丢弃的通道数与总的通道数的比值就是丢弃比例,计算简单,易于实现。
在第一方面的一种可能实现方式中,该第二神经网络在该多个验证数据上的性能变化量可以是第二神经网络通过所述多个验证数据反应出的第一损失函数与未丢弃通道之前的神经网络通过所述多个验证数据反应出的第二损失函数的差值,也可以是多个验证数据通过第二神经网络上进行识别得到的识别结果的准确率与未丢弃通道之前的神经网络通过所述多个验证数据得到的识别结果的准确率的差值,具体此处对性能变化量不做限定,只要能衡量未丢弃通道前后的神经网络的性能差别的量都可称为所述的性能变化量。
在本申请上述实施方式中,阐述了性能变化量如何表征的几种方式,具有可选择性。
在第一方面的一种可能实现方式中,训练设备根据算力的使用效率调整训练后的神经网络的神经网络通道参数可以是:算力的使用效率大对应的层增加通道数、算力的使用效率小对应的层降低通道数。例如,可以是获取训练后的神经网络中每一层对算力的使用效率,之后增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数。其中,前m个为各层对应的算力的使用效率由高到低排序时的排在第m+1个序号之前的m个,后n个为各层对应的算力的使用效率由高到低排序时倒数第n-1个序号之后的n个,m可以与n相同,也可以不同,具体此处不做限定。
在本申请上述实施方式中,具体阐述了如何调整神经网络通道参数,即增加算力的使用效率高的层的通道数,减少算力的使用效率低的层的通道数,从而在不提升神经网络复杂度的前提下获得对算力的使用效率非常高效的神经网络。
在第一方面的一种可能实现方式中,训练设备根据算力的使用效率调整训练后的神经网络的神经网络通道参数具体可以是将较大的前m个算力的使用效率对应的层的通道数按第一预设比例(如,10%)增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例(如,5%)降低。其中,第一预设比例可以与第二预设比例相同,也可以不同,具体此处也不做限定。
在本申请上述实施方式中,具体阐述了如何增加算力的使用效率高的层的通道数,以及如何减少算力的使用效率低的层的通道数,具体可实现性。
在第一方面的一种可能实现方式中,算力的使用效率可以有多种具体的表现形式,例如,算力可以是浮点运算数(floating point operations,FLOPs),算力的使用效率相应地就是指FLOPs的使用效率(FLOPs utilization ratio,FUR),FUR是指神经网络对浮点运算数的使用效率,用于衡量网络在浮点运算复杂度上是否高效。
在本申请上述实施方式中,具体阐述了算力的使用效率可以是FLOPs的使用效率,具备可实现性。
在第一方面的一种可能实现方式中,本申请可以使用摄像头、红线感应等传感器获取到的数据作为数据集来搜索神经网络通道参数。
在第一方面的一种可能实现方式中,本申请所述的数据集还可以是多个图片数据,也可以是多个视频数据,此处不做限定。
在本申请上述实施方式中,具体阐述本申请所述的数据集可以是多种类型的数据,具备广泛适用性。
第二方面,本申请实施例提供了一种图像处理方法,可用于人工智能领域中,该方法包括:首先,执行设备获取目标图像,该目标图像可以是即将要被识别或定位的图片/视频帧等,之后,执行设备将通过输入的目标神经网络对该目标图像进行操作,该目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络,经过神经网络的处理后,最后执行设备输出对该目标对象的识别结果,如,该识别结果可以是目标图像中目标物体的类别信息、位置信息等。
在本申请上述实施方式中,具体阐述了执行设备如何利用根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络对目标图像进行操作,该优化后的神经网络识别速度更快、识别效果更好。
第三方面,本申请实施例提供一种训练设备,该训练设备具有实现上述第一方面或第一方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第四方面,本申请实施例提供一种执行设备,该执行设备具有实现上述第二方面的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第五方面,本申请实施例提供一种训练设备,可以包括存储器、处理器以及总线系统,其中,存储器用于存储程序,处理器用于调用该存储器中存储的程序以执行本申请实施例第一方面或第一方面任意一种可能实现方式的方法。
第六方面,本申请实施例提供一种执行设备,可以包括存储器、处理器以及总线系统,其中,存储器用于存储程序,处理器用于调用该存储器中存储的程序以执行本申请实施例第二方面的方法。
第七方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持执行设备或训练设备实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存执行设备或训练设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
第八方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面或第一方面任意一种可能实现方式的方法,或,使得计算机可以执行上述第二方面的方法。
第九方面,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任意一种可能实现方式的方法,或,使得计算机执行上述第二方面的方法。
图1为基于剪枝的神经网络通道参数搜索方法的一种示意图;
图2为本申请实施例提供的人工智能主体框架的一种结构示意图;
图3为本申请实施例提供的应用系统架构的一种示意图;
图4为本申请实施例提供的一种应用场景图;
图5为本申请实施例提供的另一应用场景图;
图6为卷积神经网络的一种结构示意图;
图7为卷积神经网络的另一结构示意图;
图8为本申请实施例提供的神经网络通道参数的搜索方法的一种示意图;
图9为本申请实施例提供的神经网络通道参数的搜索系统的一种示意图;
图10为本申请实施例提供的神经网络通道参数搜索的一种总体流程图;
图11为本申请实施例提供的系统架构的另一示意图;
图12为本申请实施例提供的图像处理方法的一种示意图;
图13为本申请实施例提供的训练设备的一种示意图;
图14为本申请实施例提供的执行设备的一种示意图;
图15为本申请实施例提供的训练设备的另一示意图;
图16为本申请实施例提供的执行设备的另一示意图;
图17为本申请实施例提供的芯片的一种结构示意图。
本申请实施例提供了一种神经网络通道参数的搜索方法及相关设备,可用于人工智能领域中,该方法基于神经网络中任意一层对算力的使用效率来调整训练后的神经网络的神经网络通道参数,实现神经网络的神经网络通道参数的搜索,从而在不提升神经网络复杂度的前提下提高神经网络的性能,最终获得对算力的使用效率非常高效的神经网络。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
首先,本申请对利用剪枝的方法来搜索神经网络通道参数的技术进行简单介绍,请参阅图1,针对一个给定的神经网络的网络结构,首先通过一定方法将其训练为可以变换宽度的网络(即可变窄网络)。然后以相同的比例逐层地变换该网络的宽度,测试网络每一层的宽度对网络性能的影响(如图1中通过验证集内的数据来测试网络,从而决定变窄哪个层),并降低对性能影响小的层的通道数。该“测试影响-调节通道”的过程不断迭代,直到网络的复杂度达到设定的目标,如图1中表示的是“结构n”为最优的网络结构。此时的“结构n”的神经网络通道参数就是最终的搜索结果。
上述剪枝的方法在测试网络每一层宽度对性能的影响时,仅仅考虑网络性能变化的绝对值,而没有考虑性能变化相对于计算复杂度的相对值。该方法中,每一层变化宽度对网络计算复杂度的影响是不同的。有的层可能对性能影响很大,即性能变化的绝对值较大,但是其占用较多的计算复杂度,也就是说单位复杂度上性能变化较小。从计算高效的角度来说,搜索网络参数时应该考虑性能相对值,而上述方法只考虑了性能绝对值,因此只能搜索到次优的结果。此外,该方法需要首先将网络训练成可以变化宽度的网络。相对于传统的网络训练方法,该方法更加复杂且需要更多的训练时间。
基于此,为解决上述问题,本申请提出了一种新的神经网络通道参数搜索方法,该方法能够在准确地评估通道性价比的同时,高效地搜索神经网络通道参数。即本申请充分考虑了各层通道数相对于复杂度的相对性能,且本申请所提供的神经网络通道参数的搜索方法与传统的剪枝方法相比,更加简单、迅速。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
首先,对本申请提到的神经网络通道参数进行介绍,神经网络通道参数是用于表征通道数的,而通道数是网络结构的一种,通道数可以看作是特征图(feature map)的个数,而特征图又是数据在神经网络上的中间表示,以卷积神经网络(Convolutional Neural Networks,CNN)为例,特征图就是卷积的中间输出结果,在CNN中,每一层的通道数就等于该层的卷积核个数,因此有时也把通道数称为卷积核个数,一个卷积核就对应一个通道。例如,CNN各层输出的通道数一共有70个,那么神经网络通道参数就用于表征这70个通道数的相关信息(如,分别位于CNN哪一层、通道的属性信息等)。
接下来对人工智能系统总体工作流程进行描述,请参见图2,图2示出的为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能制造、智能交通、智能家居、智能医疗、智能安防、自动驾驶、平安城市等。
本申请可以应用在神经网络的网络结构自动化设计上,而通过本申请优化过神经网络通道参数的神经网络具体可以应用于人工智能领域的图像处理领域中,具体地,结合图2来讲,本申请实施例中基础设施获取的数据集中的数据可以是通过摄像头、雷达等传感器获取到的不同类型的多个数据,也可以是多个图像数据或多个视频数据,只要该数据集满足用于对神经网络进行迭代训练并能用于实现本申请的神经网络通道参数搜索功能即可,具体此处对数据集内的数据类型不限定。
本申请的应用系统架构如图3所示,以获取到的数据集为物体图片数据为例:首先神经网络通道参数搜索系统102会接收到多个物体图片数据,其中,这多个物体图片数据包括多个训练数据和多个验证数据,在搜索空间搜索到的神经网络101会被输入至该神经网络通道参数搜索系统102内,由该神经网络通道参数搜索系统102根据训练数据对神经网络101进行训练得到训练后的神经网络(图3中未示出),之后,根据验证数据,由该神经网络通道参数搜索系统102基于训练后的神经网络中任意一层对算力的使用效率来调整训练后的神经网络的神经网络通道参数,从而得到最终输出的神经网络103。基于上述图3所提供的应用系统架构,本申请提供的方法可在预设的搜索空间对任一种神经网络的神经网络通道参数进行搜索,对于给定的视觉任务、数据集和神经网络,本申请能够优化神经网络的神经网络通道参数,在不提升神经网络计算复杂度的前提下提升网络性能。
由于智能安防、平安城市、智能终端等领域中都可以用到本申请实施例中的根据神经网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络来进行图像处理,下面将对多个落地到产品的多个应用场景进行介绍。
作为一种示例,本申请上述所述的神经网络通道参数搜索系统102可以应用在智能物体识别中,如图4所示,利用所提供的神经网络通道参数搜索系统可以优化神经网络结构,提升识别速度和识别准确率。对于给定的数据集(可以是多个图片数据,也可以是多个视 频数据,此处不做限定,如图4中所示的是物体图片数据集)和神经网络结构,本申请可以根据数据集和任务目标(如,目标图片)来优化神经网络各层的通道数。这里数据集是各个物体和其对应的类别标签。任务目标就是对各个物体进行识别、分类。然后可以使用优化过的神经网络进行物体的识别。例如,当向优化后的神经网络输入如图4中所示的目标图片时,优化后的神经网络能够更快、更准确的识别出目标图像中的物体类别为“鲨鱼”,即优化后的神经网络识别速度更快、识别效果更好。
作为另一示例,本申请上述所述的神经网络通道参数搜索系统102还可以应用在自动驾驶车辆识别中,自动驾驶过程中需要通过传感器识别道路上的车辆、行人、交通标志等,这些任务都可以用神经网络来实现。如图5所示,利用所提供的神经网络通道参数搜索系统可以优化神经网络结构,从而达到优化神经网络识别效果的目的,具体如图5所示。本申请可以使用摄像头、红线感应等传感器获取到的数据作为数据集来搜索神经网络通道参数,从而提升神经网络的识别速度和能力,如在图5中,当获取到一张由车载摄像头拍摄到目标图片时,通过该优化后的神经网络,可以更快的识别出该目标图片中各个目标物体(如,其他车辆、行人等)的类别及所处位置。
此外,本申请上述所述的神经网络通道参数搜索系统102还可以应用于其他领域,如:智能终端、智能交通、智能医疗、智能安防、自动驾驶、平安城市等。只要能应用神经网络的领域就都可以通过本申请上述所述的神经网络通道参数搜索系统102得到优化后的神经网络,并将得到的该优化后的神经网络应用于上述各个领域,具体此处不再对其他应用场景进行一一列举。
需要说明的是,本申请所述的神经网络可以是任意形式的神经网络,可以是各种典型的深度神经网络,如CNN、循环神经网络(Recurrent Neural Networks,RNN)等,还可以是其他特殊的深度神经网络,如公路网络、残差网络等,只要该神经网络的网络参数包括有神经网络通道参数即可,具体此处对神经网络的类型不做限定。为便于阐述,在后续介绍本申请具体的实现方式时,涉及到数据的具体处理过程时则均以CNN为例进行示意。
为便于理解,这里首先对CNN做一些介绍,CNN是一种带有卷积结构的深度神经网络,是一种深度学习(deep learning)架构,深度学习架构是指通过机器学习的算法,在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元对输入其中的图像中的重叠区域做出响应。其中,卷积神经网络在逻辑上可以包括输入层、卷积层以及神经网络层,但由于输入层和输出层的作用主要是为了方便数据的导入和导出,随着卷积神经网络的不断发展,在实际应用中,输入层和输出层的概念逐渐被淡化,而是通过卷积层来实现输入层和输出层的功能,当然,卷积神经网络中还可以包括其他类型的层,具体此处不做限定。以图6为例,卷积神经网络100可以包括输入层110,卷积层/池化层120,其中池化层为可选的,以及神经网络层130。
卷积层/池化层120中的卷积层:
如图6所示卷积层/池化层120可以包括如示例121-126层,在一种实现中,121层为卷积层,122层为池化层,123层为卷积层,124层为池化层,125为卷积层,126为池化 层;在另一种实现方式中,121、122为卷积层,123为池化层,124、125为卷积层,126为池化层。即卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。
以卷积层121为例,卷积层121可以包括很多个卷积算子,卷积算子也称为核或卷积核,在CNN中,每一层的通道数就等于该层的卷积核个数,因此有时也把通道数称为卷积核个数,一个卷积核就对应一个通道。卷积核在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积核本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用维度相同的多个权重矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化……该多个权重矩阵维度相同,经过该多个维度相同的权重矩阵提取后的特征图维度也相同,再将提取到的多个维度相同的特征图合并形成卷积运算的输出。
这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以从输入图像中提取信息,从而帮助卷积神经网络100进行正确的预测。
当卷积神经网络100有多个卷积层的时候,初始的卷积层(例如121)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络100深度的加深,越往后的卷积层(例如126)提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。
卷积层/池化层120中的池化层:
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,即如图6中120所示例的121-126各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像大小相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。
神经网络层130:
在经过卷积层/池化层120的处理后,卷积神经网络100还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层120只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或别的相关信息),卷积神经网络100需要利用神经网络层130来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层130中可以包括多层隐含层(如图6所示的131、132至13n)以及输出层140,该多层隐含层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。
在神经网络层130中的多层隐含层之后,也就是整个卷积神经网络100的最后层为输出层140,该输出层140具有类似分类交叉熵的损失函数(loss),具体用于计算预测误差,一旦整个卷积神经网络100的前向传播(如图6由110至140的传播为前向传播)完成,反向传播(如图6由140至110的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络100的损失及卷积神经网络100通过输出层输出的结果和理想结果之间的误差。
需要说明的是,如图6所示的卷积神经网络100仅作为一种CNN的示例,在具体的应用中,CNN还可以以其他网络模型的形式存在,例如,如图7所示的多个卷积层/池化层并行,将分别提取的特征均输入给全神经网络层130进行处理。又例如,由于输入层和输出层的概念逐渐被淡化,而是通过卷积层来实现输入层和输出层的功能,则在一些CNN中,可以只有卷积层,当然,CNN中还可以包括其他类型的层,具体此处不做限定。
这里还需要说明的是,在本申请实施例中,若神经网络为CNN,则神经网络的任意一层表示的是CNN的卷积层(其他各层则可以看作是通道数为零的层),若神经网络为RNN等其他类型的深度神经网络,则神经网络的任意一层表示的就是全连接层(类似的,其他类型的各层也可以看作是通道数为零的层)。
结合上述说明,本申请实施例提供了一种神经网络通道参数的搜索方法,请参阅图8,图8为本申请实施例提供的神经网络通道参数搜索方法的一种流程示意图,具体可以包括:
801、获取数据集。
首先,训练设备会获取数据集,该数据集就包括多个训练数据及多个验证验证数据。例如,可以是由图2中的基础设施获取到的数据集,具体可以是通过摄像头、雷达等传感器获取到的不同类型的多个数据,也可以是多个图像数据或多个视频数据,只要该数据集满足用于对神经网络进行迭代训练并能用于实现本申请的神经网络通道参数搜索功能即可,具体此处对数据集内的数据类型不限定。
802、根据多个训练数据对初始神经网络进行训练,得到训练后的神经网络。
之后,训练设备会根据数据集中的多个训练数据对初始的神经网络进行训练,训练的任务可以是分类、检测、分割等。之后就可以得到训练后的神经网络。例如,若初始的神经网络为CNN,则可以按照如图6所述的CNN的训练过程对其进行迭代训练,得到训练后的CNN。
803、根据多个验证数据确定训练后的神经网络中任意一层对算力的使用效率。
训练设备得到训练好的神经网络之后,会进一步根据数据集中的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率,该算力(也可称为算力资源)的使用效率为单位算力引起的网络性能改变量。
具体地,在本申请的一些实施方式中,根据数据集中的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率可以是:首先,获取训练后的神经网络中任意一层的算力与所述任意一层的通道数的函数(即对应关系),之后,根据该函数计算所述任意一层中的通道被丢弃的比例,并进一步根据计算得到的比例随机丢弃所述任意一层的至少一个通道,从而得到丢弃部分通道的第二神经网络,最后,确定该第二神经网络通过该多个验证数据反应出的性能变化量为算力的使用效率。为便于理解,此处举例说明:假设输入的神经网络一共有4层(如,4个卷积层),第1层有40个通道,第2层有30个通道,第3层有70个通道,第4层有50个通道,根据函数计算得到的每层的通道被丢弃的比例分别为4%、8%、10%、20%,那么第1层中通道被随机丢弃的比例就为4%,第2层中通道被随机丢弃的比例就为8%,第3层中通道被随机丢弃的比例就为10%,第4层中通道被随机丢弃的比例就为20%,并且,每次丢弃只能随机丢弃一层的部分通道数,有四层的话,就需要根据多个验证数据确定训练后的神经网络中四层中的每一层对算力的使用效率。
需要说明的是,在本申请的一些实施方式中,该第二神经网络通过该多个验证数据反应出的性能变化量可以是第二神经网络通过多个验证数据反应出的第一损失函数与未丢弃通道之前的神经网络通过多个验证数据反应出的第二损失函数的差值,也可以是多个验证数据通过第二神经网络上进行识别得到的识别结果的准确率与未丢弃通道之前的神经网络通过所述多个验证数据得到的识别结果的准确率的差值,具体此处对性能变化量不做限定,只要能衡量未丢弃通道前后的神经网络的性能差别的量都可称为所述的性能变化量。
还需要说明的是,在本申请的一些实施方式中,根据函数计算神经网络任意一层中的通道被丢弃的比例具体可以是:首先,对上述获取到的函数求导,得到该函数的导数,之后,根据该导数确定神经网络的任意一层对算力降低预设值时需要丢弃的通道数,最后,确定需要丢弃的通道数与任意一层的通道数的比值为所述的比例。
804、根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络。
最后,训练设备根据算力的使用效率调整训练后的神经网络的神经网络通道参数,从而得到第一神经网络。这样得到的第一神经网络就是调整过一次神经网络通道参数的神经网络,其比未经过神经网络通道参数调整的神经网络的性能是更好的。
需要说明的是,在本申请的一些实施方式中,训练设备根据算力的使用效率调整训练后的神经网络的神经网络通道参数可以是:算力的使用效率大对应的层增加通道数、算力的使用效率小对应的层降低通道数。例如,可以是获取训练后的神经网络中每一层对算力的使用效率,之后增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数。具体地,可以是将较大的前m个算力的使用效率对应的层的通道数按第一预设比例(如,10%)增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例(如,5%)降低。其中,前m个为各层对应的算力的使用效率 由高到低排序时的排在第m+1个序号之前的m个,后n个为各层对应的算力的使用效率由高到低排序时倒数第n-1个序号之后的n个,m可以与n相同,也可以不同,此处不做限定;另外,第一预设比例可以与第二预设比例相同,也可以不同,此处也不做限定。
还需要说明的是,在本申请的一些实施方式中,为了得到性能更优的神经网络,还可以事先在训练设备中设置好迭代次数(如,20次),并将上述图8所述实施例得到的第一神经网络作为初始的神经网络进行迭代,从而得到每次迭代后的第一神经网络,并通过多个测试数据(多个测试数据也可以是数据集中的数据,也可以是任务目标的数据,具体此处不做限定)测试第一神经网络和每次迭代后的第一神经网络的性能,当迭代次数达到预设阈值(如,迭代次数达到预设的20次)时,则从第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络(如,具体操作可以是每次迭代获取到第一神经网络后就利用测试数据测试该第一神经网络的性能,并保存该性能以及该性能对应的神经网络通道参数),并输出该目标神经网络,该输出的目标神经网络就是上述所述的经过优化后的神经网络。
在本申请上述实施例中,首次提出一种基于算力的使用效率的神经网络通道参数搜索方法,该方法首先计算神经网络各层对算力的使用效率,然后增加算力的使用效率高的层的通道数,减少算力的使用效率低的层的通道数,该过程可迭代进行,最终会获得对算力的使用非常高效的神经网络,从而解决目前的神经网络通道参数搜索方法没有充分考虑到复杂度、使用效率低且搜索速度慢的问题。此外,本申请还提出一种计算神经网络每一层对算力的使用效率的方法,该方法以一定比例随机丢弃部分通道并测试其对网络性能的影响,丢弃的通道对不同的测试样例是随机的,以此计算神经网络每层对算力的使用效率。
在本申请的一些实施方式中,算力的使用效率可以有多种具体的表现形式,例如,算力可以是FLOPs,算力的使用效率相应地就是指FLOPs的使用效率,即FUR,FUR是指神经网络对浮点运算数的使用效率,用于衡量神经网络在浮点运算复杂度上是否高效。
为便于理解,下面以算力的使用效率为FUR为例,对本申请上述图3-5对应的实施例提到的神经网络通道参数搜索系统进行说明,请参阅图9,图9为本申请实施例提供的一种神经网络通道参数搜索系统的结构示意图,该神经网络通道参数搜索系统900是一种基于FUR的神经网络通道参数的搜索框架,具体可以包括但不限于:网络训练模块901、FUR计算模块902和通道更新模块903,其中,网络训练模块901用于使用获取到的数据集内的训练数据对初始神经网络进行迭代训练,以得到训练后的神经网络;FUR计算模块902用于计算训练后的神经网络各层的FUR,是本申请实施例的核心部分;通道更新模块903用于根据计算得到的FUR调整神经网络的神经网络通道参数,即更新神经网络各层的通道数。输入的神经网络会不断地经过这三个模块,直到达到了设定好的迭代次数,这些迭代次数中性能最好的神经网络会作为最终输出的神经网络(即上述实施例中的目标神经网络),其总体流程如图10所示,其中,预先给定的数据集(图10中未标示出)会被分为训练集、验证集和测试集(在一些实施例中,测试集也可以是其他数据集的数据,此处不做限定)。训练集中包括有多个训练数据,其被用于训练输入的神经网络的网络结构,验证集被用于计算训练后的神经网络各层的FUR,测试集则被用于测试每次迭代后输出的神经网 络的网络性能。在每一论迭代中,对于输入的任意一个神经网络,图9所示的网络训练模块901首先使用训练集对神经网络进行训练,训练的任务可以是分类、检测、分割等。然后,FUR计算模块902会评估神经网络各层的FUR,评估时使用的数据是验证集上的多个验证数据。然后,通道更新模块903根据得到的每层的FUR来更新通道数,具体的更新策略为FUR高的层会增加通道数,FUR低的层会降低通道数。经过更新后,就能得到新的神经网络的网络结构,该新的网络结构会被送回网络训练模块901重新开始训练(因为神经网络通道参数并不是独立存在的,与网络结构中的其他网络参数存在关联关系,因此丢掉部分通道数会改变网络结构,极端情况下会导致已经训练好的网络不可用,因此需要重新训练),再次进行FUR计算和通道数更新,这个过程会重复很多轮,直到搜索到的神经网络的网络结构足够好或者达到了预设的迭代次数。此时,整个过程中性能最好的神经网络的网络结构就是该方法的搜索结果。其中,挑选性能最好的神经网络的网络结构的方法是比较在搜索过程中验证集上的网络性能。
需要说明的是,在FUR计算模块902评估FUR时,本申请实施例首先会建模神经网络每层通道数对FLOPs的影响,即获取神经网络每层对FLOPs与该层通道数的函数。由于通道数是离散的,本申请使用该函数来模拟连续的通道数对FLOPs的影响。然后,对于训练好的神经网络,通过FLOPs函数计算每层FLOPs对应的通道数,接下来,计算神经网络的每层对FLOPs都降低预设值ΔF时需要丢弃的通道数,并确定需要丢弃的通道数与各层输出的通道数的比值为丢弃比例,最后神经网络的各层分别以对应的丢弃比例随机丢弃对应层的部分通道并观测通道数变化后网络在验证集上的性能变化,得到的性能变化量就是要求的FUR(每次丢弃都只能丢弃一层,下次丢弃再丢其他层或该层的其他通道数,即迭代丢弃)。需要注意的是,丢弃的通道对于不同的测试样例是随机的,以此计算神经网络每层对FLOPs的使用效率。
下面以一个具体的实施例对上述图9中各个模块的功能进行更具体的说明:
首先,网络训练模块901对输入的神经网络的网络模型进行训练,例如,通过数据集ImageNet(一个公开的图片识别数据集)进行训练,本申请可事先设置一些搜索参数,如,只训练10个轮次(epochs),即迭代次数的预设阈值为10,1个epoch表示过了1遍训练集中的所有样本,学习率为0.1,训练中每簇的图片数(batch size)为256,batch size表示1次迭代所使用的样本量,每次迭代更新1次网络结构的神经网络通道参数。学习率使用的是余弦(cosine)下降方式。
之后,FUR计算模块902首先计算网络各层通道数与FLOPs的关系,本例采用没有支路的神经网络(有支路的神经网络也是采用类似的方式,可类推,此处不予赘述)。对于神经网络中的某一层,FLOPs与对应层的通道数的函数关系为:
其中,c
l是神经网络第l层输出的通道数,M是与c
l无关的FLOPs,若初始神经网络为CNN,则k
l是卷积核大小;若初始神经网络为其他具有全连接层的神经网络,则k
l=1,h
l和w
l是特征图的宽度和高度。
得到FLOPs与对应层的通道数的函数关系后,就可以进一步计算FLOPs对c
l的导数:
该导数代表了神经网络各层通道数在FLOPs上的敏感性。即当从每个层降低ΔF个FLOPs时,需要扔掉的通道数为:
分别以该比例随机丢弃神经网络各层的通道数,并统计相应的FLOPs变化,从而可以估计各层的FUR为:
FUR
l=L
val(c,SpatialDropout(W
*,p
l,l))-L
val(c,W
*)
其中,L
val代表验证集上的损失函数(loss)。
最后,通道更新模块903可以根据神经网络每层的FUR更新对应层的通道数。具体为首先将各层的FUR进行排序,然后选取较大的前k个和最小的k个FUR,将最大的k个FUR对应层的通道数增加,较小的k个FUR对应层的通道数降低。增加或降低的幅度是可以调节的超参数。其中,k会随着搜索过程逐渐降低。
需要说明的是,在本申请的一些实施方式中,神经网络通道参数搜索系统900还可以包括更多或更少的模块,只要能用于实现上述各个实施例所述的网络通道搜索方法即可,具体此处对神经网络通道参数搜索系统900的功能模块的划分方式不做限定。
本申请实施例的目的是提供一种神经网络通道参数的搜索方法,以搜索到更高效的神经网络通道参数。为了对本申请带来的有益效果有进一步地理解,以下结合实验数据对本方案的有益效果做进一步展示,如表1所示,本申请在不提升网络FLOPs情况下,明显地提升了网络在CIFAR-100(一个公开的图片识别数据集)上的性能。
表1:本申请的搜索方法在公开数据集上搜索到的网络结构的性能与原网络对比
在本申请上述实施方式中,提出一种基于FLOPs的使用效率的神经网络通道参数的搜索系统,该系统的特点是搜索过程中根据神经网络各层对FLOPs的使用效率来搜索神经网络通道参数(即在搜索过程中通过计算神经网络每层对FLOPs的使用效率,迭代地调整神经网络的神经网络通道参数),同时本申请上述实施例还提出一种计算FLOPs的使用效率的方法,该方法在神经网络每一层以一定比例丢弃通道并测试其对性能的影响,以此计算神经网络各层对FLOPs的使用效率。
需要说明的是,上述实施例所述的神经网络通道参数的搜索方法可以是均在云侧实现,例如,可以由云侧的训练设备(该训练设备可由一个或多个服务器实现)获取数据集,并根据数据集内的多个训练数据对初始神经网络进行训练,得到训练后的神经网络,之后根据数据集内的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率,最后根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络,之后再将得到的第一神经网络作为新的初始神经网络进行迭代;上述实施例所述的神经网络通道参数的搜索方法也可以是均在终端侧实现,例如,可以由终端设备(如个人计算机、计算机工作站、智能手机、平板电脑、智能汽车、媒体消费设备、可穿戴设备等)获取数据集,并根据数据集内的多个训练数据对初始神经网络进行训练,得到训练后的神经网络,之后根据数据集内的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率,最后根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络,之后再将得到的第一神经网络作为新的初始神经网络进行迭代;上述实施例所述的神经网络通道参数的搜索方法还可以是一部分步骤在云侧实现、另一部分步骤在终端侧实现,例如,可以由云侧的训练设备(该训练设备可由一个或多个服务器实现)执行获取数据集,并根据数据集内的多个训练数据对初始神经网络进行训练,得到训练后的神经网络,而训练后的神经网络则输入终端设备,由终端设备根据数据集内的多个验证数据确定训练后的神经网络中任意一层对算力的使用效率,最后根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络,之后终端设备再将得到的第一神经网络发送给云侧的训练设备,云侧的训练设备再将收到的第一神经网络作为新的初始神经网络进行迭代。
为便于理解,以本申请实施例所述的神经网络通道参数的搜索方法均在云侧实现为例,对本申请的一个系统架构进行说明,请参阅图11,本申请实施例提供了一种系统架构1100。 训练设备210由一个或多个服务器实现,可选的,与其它计算设备配合,例如:数据存储、路由器、负载均衡器等设备;训练设备210可以布置在一个物理站点上,或者分布在多个物理站点上。训练设备210可以使用数据存储系统250中的数据集(如上述各实施例所述的物体图片数据集),或者调用数据存储系统250中的程序代码实现对初始神经网络进行训练的功能,从而得到训练后的神经网络,之后,还可以进一步使用数据存储系统250中的数据集或者调用数据存储系统250中的程序代码确定训练后的神经网络中任意一层对算力的使用效率(如,对FLOPs的使用效率),最后根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络。为了得到性能更优的神经网络,还可以事先在训练设备210中设置好迭代次数(如,30次),并将上述得到的第一神经网络作为新的初始神经网络进行迭代,从而得到每次迭代后的第一神经网络,并通过多个测试数据(多个测试数据也可以是数据集中的数据,也可以是任务目标的数据,具体此处不做限定)测试第一神经网络和每次迭代后的第一神经网络的性能,当迭代次数达到预设阈值(如,迭代次数达到预设的30次)时,则从第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络(如,具体操作可以是每次迭代获取到第一神经网络后就利用测试数据测试该第一神经网络的性能,并保存该性能以及该性能对应的神经网络通道参数),并输出该目标神经网络,该输出的目标神经网络就是优化后的神经网络。具体地,该训练设备210可以包括上述图3-5以及图9中的神经网络通道参数搜索系统及该系统中的各个功能模块所具备功能,具体请参阅上述图3-5以及图9对应的实施例,此处不予赘述。
用户可以操作各自的用户设备(例如本地设备301和本地设备302)与训练设备210进行交互。每个本地设备可以表示任何计算设备,例如个人计算机、计算机工作站、智能手机、平板电脑、智能摄像头、智能汽车或其他类型蜂窝电话、媒体消费设备、可穿戴设备、机顶盒、游戏机等。
每个用户的本地设备可以通过任何通信机制/通信标准的通信网络与训练设备210进行交互,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。
在另一种实现中,训练设备210的一个方面或多个方面可以由每个本地设备实现,例如,本地设备301可以获取训练设备训练好的神经网络,并根据验证数据确定训练后的神经网络中任意一层对算力的使用效率,最后根据算力的使用效率调整训练后的神经网络的神经网络通道参数,得到第一神经网络,之后本地设备301再将得到的第一神经网络发送给训练设备210,训练设备210再将收到的第一神经网络作为初始神经网络进行迭代。
需要注意的,训练设备210的所有功能也可以由本地设备实现。例如,本地设备301实现训练设备210的功能并为自己的用户提供服务,或者为本地设备302的用户提供服务。
由于智能安防、平安城市、智能终端等领域中都可以用到本申请上述各实施例中的根据神经网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络来进行图像处理,如,即可以应用在如图4所述的智能物体识别中,也可以应用在如图5所述的自动驾驶车辆识别中,还可以应用于其他如智能终端、智能交通、智能医疗、智能安防、平安城市等领域。只要能应用神经网络的领域就都可以应用本申请上述各实施例所提供的根据 神经网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络,基于此,本申请实施例还提供一种图像处理方法,如图12所示,该图像处理方法具体可以包括:
1201、获取目标图像。
首先,执行设备获取目标图像,该目标图像可以是即将要被识别或定位的图片/视频帧等。
1202、通过目标神经网络对目标图像进行操作,该目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。
之后,执行设备将通过目标神经网络对该目标图像进行操作,该目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。具体地,如何根据网络中任意一层对算力的使用效率调整神经网络通道参数可以参阅上述图3-5、图8-11对应的实施例所述的神经网络通道参数搜索方法或神经网络通道参数搜索系统所执行的步骤,此处不予赘述。此外,通过前述描述可知,本申请上述图3-5、图8-11对应的实施例中对神经网络仅是在训练阶段优化了神经网络通道参数,对优化后的神经网络的应用阶段并未做出改进,因此,以目标神经网络为CNN为例,执行设备通过CNN对该目标图像进行操作具体可以如图6所示,该目标图像作为输入,分别经由CNN的输入层110、卷积层/池化层120、神经网络层130的进行对应处理,具体的处理过程请参阅图6,此处不予赘述。
1203、输出对目标图像的识别结果。
经过神经网络的处理后,最后执行设备输出对该目标对象的识别结果,如,该识别结果可以是目标图像中目标物体的类别信息、位置信息等。
在图3至图11所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体参阅图13,图13为本申请实施例提供的训练设备的一种结构示意图,训练设备1300包括:获取模块1301、训练模块1302、确定模块1303、调整模块1304,其中,获取模块1301,用于获取数据集,所述数据集包括多个训练数据及多个验证数据;训练模块1302,用于根据所述多个训练数据对初始神经网络进行训练,得到训练后的神经网络;确定模块1303,用于根据所述多个验证数据确定所述训练后的神经网络中任意一层对算力的使用效率,所述算力的使用效率为单位算力引起的网络性能改变量;调整模块1304,用于根据所述算力的使用效率调整所述训练后的神经网络的神经网络通道参数,得到第一神经网络。
在一种可能的设计中,训练模块1302还用于:将所述第一神经网络作为所述初始神经网络进行迭代,得到每次迭代后的第一神经网络,并通过多个测试数据测试所述第一神经网络的性能以及每次迭代后的第一神经网络的性能,之后获取迭代次数,该迭代次数可以预先设置(如,迭代次数设置为20次),当所述迭代次数达到预设阈值时,从所述第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络(如,具体操作可以是每次迭代获取到第一神经网络后就利用测试数据测试该第一神经网络的性能,并保存该性能以及该性能对应的神经网络通道参数),并输出该目标神经网络,该输出的目标神经网络就是上述所述的经过优化后的神经网络。
在一种可能的设计中,确定模块1303具体用于:获取所述训练后的神经网络中任意一层对算力与该层通道数的函数,并根据所述函数计算所述任意一层中的通道被丢弃的比例,之后,根据该比例随机丢弃所述任意一层的至少一个通道,得到丢弃部分通道的第二神经网络,最后,确定所述第二神经网络通过所述多个验证数据反应出的性能变化量为所述算力的使用效率。
在一种可能的设计中,确定模块1303具体还用于:对所述函数求导,得到所述函数的导数,并根据所述导数确定所述任意一层对算力降低预设值时需要丢弃的通道数,之后确定所述需要丢弃的通道数与所述任意一层的通道数的比值为所述比例。
在一种可能的设计中,性能变化量具体可以包括所述第二神经网络通过所述多个验证数据反应出的第一损失函数与未丢弃通道之前的神经网络通过所述多个验证数据反应出的第二损失函数的差值,也可以是多个验证数据通过第二神经网络上进行识别得到的识别结果的准确率与未丢弃通道之前的神经网络通过所述多个验证数据得到的识别结果的准确率的差值,具体此处对性能变化量不做限定,只要能衡量未丢弃通道前后的神经网络的性能差别的量都可称为所述的性能变化量。
在一种可能的设计中,调整模块1304具体用于:获取所述训练后的神经网络中每一层对算力的使用效率,并增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数,其中,前m个为各层对应的算力的使用效率由高到低排序时的排在第m+1个序号之前的m个,后n个为各层对应的算力的使用效率由高到低排序时倒数第n-1个序号之后的n个,m可以与n相同,也可以不同,具体此处不做限定。
在一种可能的设计中,调整模块1304具体还用于:将较大的前m个算力的使用效率对应的层的通道数按第一预设比例(如,10%)增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例(如,5%)降低,第一预设比例可以与第二预设比例相同,也可以不同,具体此处也不做限定。
在一种可能的设计中,算力可以是FLOPs,对应地,算力的使用效率就可以是FUR。
在一种可能的设计中,数据集可以是通过传感器获取到的多个数据,如,可以是通过摄像头、红线感应等传感器获取到的数据。
在另一种可能的设计中,数据集还可以是多个图像数据或多个视频数据,此处不做限定。
需要说明的是,训练设备1300中各模块/单元之间的信息交互、执行过程等内容,与本申请中图8-图10对应的实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供一种执行设备,请参阅图14,图14为本申请实施例提供的执行设备的一种结构示意图,执行设备1400包括:获取模块1401以及操作模块1402,其中,获取模块1401,用于获取目标图像,该目标图像可以是即将要被识别或定位的图片/视频帧等,操作模块1402,用于通过目标神经网络对所述目标图像进行操作,输出对所述目标图像的识别结果,如,该识别结果可以是目标图像中目标物体的类别信息、位置信息等。所 述目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。具体地,如何根据网络中任意一层对算力的使用效率调整神经网络通道参数可以参阅上述图3-图5、图8-图11对应的实施例所述的神经网络通道参数搜索方法或神经网络通道参数搜索系统所执行的步骤,此处不予赘述。此外,通过前述描述可知,本申请上述图3-图5、图8-图11对应的实施例中对神经网络仅是在训练阶段优化了神经网络通道参数,对优化后的神经网络的应用阶段并未做出改进,因此,以目标神经网络为CNN为例,执行设备通过CNN对该目标图像进行操作具体可以如图6所示,该目标图像作为输入,分别经由CNN的输入层110、卷积层/池化层120、神经网络层130的进行对应处理,具体的处理过程请参阅图6,此处不予赘述。
需要说明的是,执行设备1400中各模块/单元之间的信息交互、执行过程等内容,与本申请中图12对应的实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
接下来介绍本申请实施例提供的一种训练设备,请参阅图15,图15为本申请实施例提供的训练设备的一种结构示意图,训练设备1500上可以部署有图13对应实施例中所描述的训练设备1300,用于实现图13对应实施例中训练设备1300的功能,具体的,训练设备1500由一个或多个服务器实现,训练设备1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)1522(例如,一个或一个以上处理器)和存储器1532,一个或一个以上存储应用程序1542或数据1544的存储介质1530(例如一个或一个以上海量存储设备)。其中,存储器1532和存储介质1530可以是短暂存储或持久存储。存储在存储介质1530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备1500中的一系列指令操作。更进一步地,中央处理器1522可以设置为与存储介质1530通信,在训练设备1500上执行存储介质1530中的一系列指令操作。
训练设备1500还可以包括一个或一个以上电源1526,一个或一个以上有线或无线网络接口1550,一个或一个以上输入输出接口1558,和/或,一个或一个以上操作系统1541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
本申请实施例中,中央处理器1522,用于执行图8对应实施例中的训练设备执行的神经网络通道参数的搜索方法。具体地,中央处理器1522用于获取数据集,所述数据集包括多个训练数据及多个验证数据,之后根据所述多个训练数据对初始神经网络进行训练,得到训练后的神经网络,并根据所述多个验证数据确定所述训练后的神经网络中任意一层对算力的使用效率,所述算力的使用效率为单位算力引起的网络性能改变量,最后根据所述算力的使用效率调整所述训练后的神经网络的神经网络通道参数,得到第一神经网络。需要说明的是,在本申请的一些实施方式中,算力可以是FLOPs,对应地,算力的使用效率就可以是FUR。还需要说明的是,在本申请的一些实施方式中,数据集可以是通过传感器获取到的多个数据,如,可以是通过摄像头、红线感应等传感器获取到的数据。在另一种可能的设计中,数据集还可以是多个图像数据或多个视频数据,此处不做限定。
在一种可能的设计种,中央处理器1522,还用于将所述第一神经网络作为所述初始神 经网络进行迭代,得到每次迭代后的第一神经网络,并通过多个测试数据测试所述第一神经网络的性能以及每次迭代后的第一神经网络的性能,之后获取迭代次数,该迭代次数可以预先设置(如,迭代次数设置为20次),当所述迭代次数达到预设阈值时,从所述第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络(如,具体操作可以是每次迭代获取到第一神经网络后就利用测试数据测试该第一神经网络的性能,并保存该性能以及该性能对应的神经网络通道参数),并输出该目标神经网络,该输出的目标神经网络就是上述所述的经过优化后的神经网络。
在一种可能的设计中,中央处理器1522,具体用于获取所述训练后的神经网络中任意一层的算力与该层通道数的函数,并根据所述函数计算所述任意一层中的通道被丢弃的比例,之后,根据所述比例随机丢弃所述任意一层的至少一个通道,得到丢弃部分通道的第二神经网络,最后,确定所述第二神经网络通过所述多个验证数据反应出的性能变化量为所述算力的使用效率。需要说明的是,性能变化量具体可以包括所述第二神经网络通过所述多个验证数据反应出的第一损失函数与未丢弃通道之前的神经网络通过所述多个验证数据反应出的第二损失函数的差值,也可以是多个验证数据通过第二神经网络上进行识别得到的识别结果的准确率与未丢弃通道之前的神经网络通过所述多个验证数据得到的识别结果的准确率的差值,具体此处对性能变化量不做限定,只要能衡量未丢弃通道前后的神经网络的性能差别的量都可称为所述的性能变化量。
在一种可能的设计中,中央处理器1522,具体还用于对所述函数求导,得到所述函数的导数,并根据所述导数确定所述任意一层对算力降低预设值时需要丢弃的通道数,之后确定所述需要丢弃的通道数与所述任意一层通道数的比值为所述比例。
在一种可能的设计中,中央处理器1522,具体还用于获取所述训练后的神经网络中每一层对算力的使用效率,并增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数,其中,m可以与n相同,也可以不同,具体此处不做限定。例如,可以是将较大的前m个算力的使用效率对应的层的通道数按第一预设比例(如,10%)增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例(如,5%)降低,第一预设比例可以与第二预设比例相同,也可以不同,具体此处也不做限定。
需要说明的是,中央处理器1522执行上述各个步骤的具体方式,与本申请中图8对应的方法实施例基于同一构思,其带来的技术效果与本申请中图8对应的实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
接下来介绍本申请实施例提供的一种执行设备,请参阅图16,图16为本申请实施例提供的执行设备的一种结构示意图,执行设备1600具体可以表现为各种终端设备,如虚拟现实VR设备、手机、平板、笔记本电脑、智能穿戴设备、监控数据处理设备或者雷达数据处理设备等,此处不做限定。其中,执行设备1600上可以部署有图14对应实施例中所描述的执行设备1400,用于实现图14对应实施例中执行设备1400的功能。具体的,执行设备1600包括:接收器1601、发射器1602、处理器1603和存储器1604(其中执行设备1600中的处理器1603的数量可以一个或多个,图16中以一个处理器为例),其中,处理器1603 可以包括应用处理器16031和通信处理器16032。在本申请的一些实施例中,接收器1601、发射器1602、处理器1603和存储器1604可通过总线或其它方式连接。
存储器1604可以包括只读存储器和随机存取存储器,并向处理器1603提供指令和数据。存储器1604的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1604存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器1603控制执行设备1600的操作。具体的应用中,执行设备1600的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
本申请上述图12对应实施例揭示的方法可以应用于处理器1603中,或者由处理器1603实现。处理器1603可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1603中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1603可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1603可以实现或者执行本申请图12对应的实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1604,处理器1603读取存储器1604中的信息,结合其硬件完成上述方法的步骤。
接收器1601可用于接收输入的数字或字符信息,以及产生与执行设备1600的相关设置以及功能控制有关的信号输入。发射器1602可用于通过第一接口输出数字或字符信息;发射器1602还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器1602还可以包括显示屏等显示设备。
本申请实施例中,在一种情况下,处理器1603,用于执行图12对应实施例中的执行设备执行的图像处理方法。具体的,应用处理器16031,用于获取目标图像,该目标图像可以是即将要被识别或定位的图片/视频帧等。之后,应用处理器16031将用于通过目标神经网络对该目标图像进行操作,该目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。具体地,如何根据网络中任意一层对算力的使用效率调整神经网络通道参数可以参阅上述图3-5、图8-11对应的实施例所述的神经网络通道参数搜索方法或神经网络通道参数搜索系统所执行的步骤,此处不予赘述。经过神经网络的处理后,最后应用处理器16031,还用于输出对该目标对象的识别结果,如,该识别结果可以是目标图像中目标物体的类别信息、位置信息等。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用 于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述图8所示实施例描述的方法中训练设备所执行的步骤,或者,使得计算机执行如前述图12所示实施例描述的方法中执行设备所执行的步骤。
本申请实施例提供的训练设备、执行设备等具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使训练设备内的芯片执行上述图8所示实施例描述的神经网络通道参数搜索方法,或者,以使执行设备内的芯片执行上述图12所示实施例描述的图像处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体的,请参阅图17,图17为本申请实施例提供的芯片的一种结构示意图,所述芯片可以表现为神经网络处理器NPU 200,NPU 200作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路200,通过控制器2004控制运算电路2003提取存储器中的矩阵数据并进行乘法运算。
在一些实现中,运算电路2003内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路2003是二维脉动阵列。运算电路2003还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路2003是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器2002中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器2001中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)2008中。
统一存储器2006用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)2005,DMAC被搬运到权重存储器2002中。输入数据也通过DMAC被搬运到统一存储器2006中。
BIU为Bus Interface Unit即,总线接口单元2010,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)2009的交互。
总线接口单元2010(Bus Interface Unit,简称BIU),用于取指存储器2009从外部存储器获取指令,还用于存储单元访问控制器2005从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器2006或将权重数据搬运到权重存储器2002中或将输入数据数据搬运到输入存储器2001中。
向量计算单元2007包括多个运算处理单元,在需要的情况下,对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对特征平面进行上采样等。
在一些实现中,向量计算单元2007能将经处理的输出的向量存储到统一存储器2006。例如,向量计算单元2007可以将线性函数和/或非线性函数应用到运算电路2003的输出,例如对卷积层提取的特征平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元2007生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路2003的激活输入,例如用于在神经网络中的后续层中的使用。
控制器2004连接的取指存储器(instruction fetch buffer)2009,用于存储控制器2004使用的指令;
统一存储器2006,输入存储器2001,权重存储器2002以及取指存储器2009均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,图6和图7所示的CNN中各层的运算可以由运算电路2003或向量计算单元2007执行。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述第一方面方法的程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线 (例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。
Claims (23)
- 一种神经网络通道参数的搜索方法,其特征在于,包括:获取数据集,所述数据集包括多个训练数据及多个验证数据;根据所述多个训练数据对初始神经网络进行训练,得到训练后的神经网络;根据所述多个验证数据确定所述训练后的神经网络中任意一层对算力的使用效率,所述算力的使用效率为单位算力引起的网络性能改变量;根据所述算力的使用效率调整所述训练后的神经网络的神经网络通道参数,得到第一神经网络。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:将所述第一神经网络作为所述初始神经网络进行迭代,得到每次迭代后的第一神经网络,并通过多个测试数据测试所述第一神经网络的性能以及每次迭代后的第一神经网络的性能;获取迭代次数;当所述迭代次数达到预设阈值时,从所述第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络,并输出所述目标神经网络。
- 根据权利要求1-2中任一项所述的方法,其特征在于,所述根据所述多个验证数据确定所述训练后的神经网络中任意一层对算力的使用效率包括:获取所述训练后的神经网络中任意一层的算力与该层通道数的函数;根据所述函数计算所述任意一层中的通道被丢弃的比例;根据所述比例随机丢弃所述任意一层的至少一个通道,得到丢弃部分通道的第二神经网络;确定所述第二神经网络通过所述多个验证数据反应出的性能变化量为所述算力的使用效率。
- 根据权利要求3所述的方法,其特征在于,所述根据所述函数计算所述任意一层中的通道被丢弃的比例包括:对所述函数求导,得到所述函数的导数;根据所述导数确定所述任意一层对算力降低预设值时需要丢弃的通道数;确定所述需要丢弃的通道数与任意一层的通道数的比值为所述比例。
- 根据权利要求3-4中任一项所述的方法,其特征在于,所述性能变化量包括:所述第二神经网络通过所述多个验证数据反应出的第一损失函数与未丢弃通道之前的神经网络通过所述多个验证数据反应出的第二损失函数的差值。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述根据所述算力的使用效率调整所述训练后的神经网络的神经网络通道参数包括:获取所述训练后的神经网络中每一层对算力的使用效率;增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数,其中,前m个为各层对应的算力的使用效率由高到低排序时的排在第m+1个序号之前的m个,后n个为各层对应的算力的使用效率由高到低排序时倒数第 n-1个序号之后的n个。
- 根据权利要求6所述的方法,其特征在于,所述增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数包括:将较大的前m个算力的使用效率对应的层的通道数按第一预设比例增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例降低。
- 根据权利要求1-7中任一项所述的方法,其特征在于,所述算力包括:浮点运算数FLOPs(floating point operations)。
- 一种图像处理方法,其特征在于,包括:获取目标图像;通过目标神经网络对所述目标图像进行操作,输出对所述目标图像的识别结果,所述目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。
- 一种训练设备,其特征在于,包括:获取模块,用于获取数据集,所述数据集包括多个训练数据及多个验证数据;训练模块,用于根据所述多个训练数据对初始神经网络进行训练,得到训练后的神经网络;确定模块,用于根据所述多个验证数据确定所述训练后的神经网络中任意一层对算力的使用效率,所述算力的使用效率为单位算力引起的网络性能改变量;调整模块,用于根据所述算力的使用效率调整所述训练后的神经网络的神经网络通道参数,得到第一神经网络。
- 根据权利要求10所述的设备,其特征在于,所述训练模块还用于:将所述第一神经网络作为所述初始神经网络进行迭代,得到每次迭代后的第一神经网络,并通过多个测试数据测试所述第一神经网络的性能以及每次迭代后的第一神经网络的性能;获取迭代次数;当所述迭代次数达到预设阈值时,从所述第一神经网络及每轮迭代后的各个第一神经网络中确定出性能最优的第一神经网络为目标神经网络,并输出所述目标神经网络。
- 根据权利要求10-11中任一项所述的设备,其特征在于,所述确定模块具体用于:获取所述训练后的神经网络中任意一层对算力与该层通道数的函数;根据所述函数计算所述任意一层中的通道被丢弃的比例;根据所述比例随机丢弃所述任意一层的至少一个通道,得到丢弃部分通道的第二神经网络;确定所述第二神经网络通过所述多个验证数据反应出的性能变化量为所述算力的使用效率。
- 根据权利要求12所述的设备,其特征在于,所述确定模块具体还用于:对所述函数求导,得到所述函数的导数;根据所述导数确定所述任意一层对算力降低预设值时需要丢弃的通道数;确定所述需要丢弃的通道数与任意一层的通道数的比值为所述比例。
- 根据权利要求12-13中任一项所述的设备,其特征在于,所述性能变化量包括:所述第二神经网络通过所述多个验证数反应出的第一损失函数与未丢弃通道之前的神经网络通过所述多个验证数据反应出的第二损失函数的差值。
- 根据权利要求10-14中任一项所述的设备,其特征在于,所述调整模块具体用于:获取所述训练后的神经网络中每一层对算力的使用效率;增加较大的前m个算力的使用效率对应的层的通道数且降低较小的后n个算力的使用效率对应的层的通道数,其中,前m个为各层对应的算力的使用效率由高到低排序时的排在第m+1个序号之前的m个,后n个为各层对应的算力的使用效率由高到低排序时倒数第n-1个序号之后的n个。
- 根据权利要求15所述的设备,其特征在于,所述调整模块具体还用于:将较大的前m个算力的使用效率对应的层的通道数按第一预设比例增加且较小的后n个算力的使用效率对应的层的通道数按第二预设比例降低。
- 根据权利要求10-16中任一项所述的设备,其特征在于,所述算力包括:浮点运算数FLOPs(floating point operations)。
- 一种执行设备其特征在于,包括:获取模块,用于获取目标图像;操作模块,用于通过目标神经网络对所述目标图像进行操作,输出对所述目标图像的识别结果,所述目标神经网络为根据网络中任意一层对算力的使用效率调整过神经网络通道参数的神经网络。
- 一种训练设备,包括处理器和存储器,所述处理器与所述存储器耦合,其特征在于,所述存储器,用于存储程序;所述处理器,用于执行所述存储器中的程序,使得所述训练设备执行如权利要求1-8中任一项所述的方法。
- 一种执行设备,包括处理器和存储器,所述处理器与所述存储器耦合,其特征在于,所述存储器,用于存储程序;所述处理器,用于执行所述存储器中的程序,使得所述训练设备执行如权利要求9中所述的方法。
- 一种芯片,其特征在于,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行计算机程序或指令,使得权利要求1-8中任一项所述的方法被执行,或者,使得权利要求9中所述的方法被执行。
- 一种计算机可读存储介质,包括程序,当其在计算机上运行时,使得计算机执行如权利要求1-8中任一项所述的方法,或者,使得计算机执行如权利要求9中所述的方法。
- 一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1-8中任一项所述的方法,或者,使得计算机执行如权利要求9中所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010109184.0A CN111401516B (zh) | 2020-02-21 | 2020-02-21 | 一种神经网络通道参数的搜索方法及相关设备 |
CN202010109184.0 | 2020-02-21 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021164752A1 true WO2021164752A1 (zh) | 2021-08-26 |
Family
ID=71430374
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/076986 WO2021164752A1 (zh) | 2020-02-21 | 2021-02-20 | 一种神经网络通道参数的搜索方法及相关设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111401516B (zh) |
WO (1) | WO2021164752A1 (zh) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113947185A (zh) * | 2021-09-30 | 2022-01-18 | 北京达佳互联信息技术有限公司 | 任务处理网络生成、任务处理方法、装置、电子设备及存储介质 |
CN114700957A (zh) * | 2022-05-26 | 2022-07-05 | 北京云迹科技股份有限公司 | 模型低算力需求的机器人控制方法及装置 |
CN114866430A (zh) * | 2022-03-29 | 2022-08-05 | 北京智芯微电子科技有限公司 | 边缘计算的算力预测方法、算力编排方法及系统 |
CN114936129A (zh) * | 2022-05-16 | 2022-08-23 | 普联技术有限公司 | 算力管理方法、算力管理装置、视频管理设备及存储介质 |
WO2023160060A1 (zh) * | 2022-02-24 | 2023-08-31 | 腾讯科技(深圳)有限公司 | 一种模型优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 |
CN116795066A (zh) * | 2023-08-16 | 2023-09-22 | 南京德克威尔自动化有限公司 | 远程io模块的通信数据处理方法、系统、服务器及介质 |
CN117131920A (zh) * | 2023-10-26 | 2023-11-28 | 北京市智慧水务发展研究院 | 一种基于网络结构搜索的模型剪枝方法 |
CN117237788A (zh) * | 2023-11-14 | 2023-12-15 | 浙江大华技术股份有限公司 | 图像处理方法、设备和存储介质 |
CN118014009A (zh) * | 2024-02-26 | 2024-05-10 | 广芯微电子(广州)股份有限公司 | 一种基于遗传算法的神经网络初值寻优方法 |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111401516B (zh) * | 2020-02-21 | 2024-04-26 | 华为云计算技术有限公司 | 一种神经网络通道参数的搜索方法及相关设备 |
CN111985644B (zh) * | 2020-08-28 | 2024-03-08 | 北京市商汤科技开发有限公司 | 神经网络生成方法及装置、电子设备及存储介质 |
CN112101525A (zh) * | 2020-09-08 | 2020-12-18 | 南方科技大学 | 一种通过nas设计神经网络的方法、装置和系统 |
WO2022056841A1 (en) * | 2020-09-18 | 2022-03-24 | Baidu.Com Times Technology (Beijing) Co., Ltd. | Neural architecture search via similarity-based operator ranking |
CN112269981A (zh) * | 2020-11-17 | 2021-01-26 | 深圳杰微芯片科技有限公司 | 基于区块链算力设备数据搭建方法、服务器和存储介质 |
CN112488563B (zh) * | 2020-12-11 | 2023-06-06 | 中国联合网络通信集团有限公司 | 一种算力参数的确定方法和装置 |
CN112650943B (zh) * | 2020-12-24 | 2022-07-26 | 厦门地铁创新科技有限公司 | 多云服务器的协同数据检索系统及方法 |
CN113052300B (zh) * | 2021-03-29 | 2024-05-28 | 商汤集团有限公司 | 神经网络训练方法、装置、电子设备及存储介质 |
CN115099393B (zh) * | 2022-08-22 | 2023-04-07 | 荣耀终端有限公司 | 神经网络结构搜索方法及相关装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108985386A (zh) * | 2018-08-07 | 2018-12-11 | 北京旷视科技有限公司 | 获得图像处理模型的方法、图像处理方法及对应装置 |
CN109460613A (zh) * | 2018-11-12 | 2019-03-12 | 北京迈格威科技有限公司 | 模型裁剪方法及装置 |
US20190251442A1 (en) * | 2018-02-14 | 2019-08-15 | Nvidia Corporation | Pruning convolutional neural networks |
CN110689113A (zh) * | 2019-09-19 | 2020-01-14 | 浙江大学 | 一种基于大脑共识主动性的深度神经网络压缩方法 |
CN111401516A (zh) * | 2020-02-21 | 2020-07-10 | 华为技术有限公司 | 一种神经网络通道参数的搜索方法及相关设备 |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11093826B2 (en) * | 2016-02-05 | 2021-08-17 | International Business Machines Corporation | Efficient determination of optimized learning settings of neural networks |
US10360494B2 (en) * | 2016-11-30 | 2019-07-23 | Altumview Systems Inc. | Convolutional neural network (CNN) system based on resolution-limited small-scale CNN modules |
US10713540B2 (en) * | 2017-03-07 | 2020-07-14 | Board Of Trustees Of Michigan State University | Deep learning system for recognizing pills in images |
CN107451658B (zh) * | 2017-07-24 | 2020-12-15 | 杭州菲数科技有限公司 | 浮点运算定点化方法及系统 |
US11586907B2 (en) * | 2018-02-27 | 2023-02-21 | Stmicroelectronics S.R.L. | Arithmetic unit for deep learning acceleration |
CN110555450B (zh) * | 2018-05-31 | 2022-06-28 | 赛灵思电子科技(北京)有限公司 | 人脸识别神经网络调整方法和装置 |
CN109284820A (zh) * | 2018-10-26 | 2019-01-29 | 北京图森未来科技有限公司 | 一种深度神经网络的结构搜索方法及装置 |
CN110175671B (zh) * | 2019-04-28 | 2022-12-27 | 华为技术有限公司 | 神经网络的构建方法、图像处理方法及装置 |
CN110598731B (zh) * | 2019-07-31 | 2021-08-20 | 浙江大学 | 一种基于结构化剪枝的高效图像分类方法 |
CN110619385B (zh) * | 2019-08-31 | 2022-07-29 | 电子科技大学 | 基于多级剪枝的结构化网络模型压缩加速方法 |
CN110647990A (zh) * | 2019-09-18 | 2020-01-03 | 无锡信捷电气股份有限公司 | 基于灰色关联分析的深度卷积神经网络模型的裁剪方法 |
-
2020
- 2020-02-21 CN CN202010109184.0A patent/CN111401516B/zh active Active
-
2021
- 2021-02-20 WO PCT/CN2021/076986 patent/WO2021164752A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190251442A1 (en) * | 2018-02-14 | 2019-08-15 | Nvidia Corporation | Pruning convolutional neural networks |
CN108985386A (zh) * | 2018-08-07 | 2018-12-11 | 北京旷视科技有限公司 | 获得图像处理模型的方法、图像处理方法及对应装置 |
CN109460613A (zh) * | 2018-11-12 | 2019-03-12 | 北京迈格威科技有限公司 | 模型裁剪方法及装置 |
CN110689113A (zh) * | 2019-09-19 | 2020-01-14 | 浙江大学 | 一种基于大脑共识主动性的深度神经网络压缩方法 |
CN111401516A (zh) * | 2020-02-21 | 2020-07-10 | 华为技术有限公司 | 一种神经网络通道参数的搜索方法及相关设备 |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113947185B (zh) * | 2021-09-30 | 2022-11-18 | 北京达佳互联信息技术有限公司 | 任务处理网络生成、任务处理方法、装置、电子设备及存储介质 |
CN113947185A (zh) * | 2021-09-30 | 2022-01-18 | 北京达佳互联信息技术有限公司 | 任务处理网络生成、任务处理方法、装置、电子设备及存储介质 |
WO2023160060A1 (zh) * | 2022-02-24 | 2023-08-31 | 腾讯科技(深圳)有限公司 | 一种模型优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 |
CN114866430A (zh) * | 2022-03-29 | 2022-08-05 | 北京智芯微电子科技有限公司 | 边缘计算的算力预测方法、算力编排方法及系统 |
CN114936129A (zh) * | 2022-05-16 | 2022-08-23 | 普联技术有限公司 | 算力管理方法、算力管理装置、视频管理设备及存储介质 |
CN114700957B (zh) * | 2022-05-26 | 2022-08-26 | 北京云迹科技股份有限公司 | 模型低算力需求的机器人控制方法及装置 |
CN114700957A (zh) * | 2022-05-26 | 2022-07-05 | 北京云迹科技股份有限公司 | 模型低算力需求的机器人控制方法及装置 |
CN116795066A (zh) * | 2023-08-16 | 2023-09-22 | 南京德克威尔自动化有限公司 | 远程io模块的通信数据处理方法、系统、服务器及介质 |
CN116795066B (zh) * | 2023-08-16 | 2023-10-27 | 南京德克威尔自动化有限公司 | 远程io模块的通信数据处理方法、系统、服务器及介质 |
CN117131920A (zh) * | 2023-10-26 | 2023-11-28 | 北京市智慧水务发展研究院 | 一种基于网络结构搜索的模型剪枝方法 |
CN117131920B (zh) * | 2023-10-26 | 2024-01-30 | 北京市智慧水务发展研究院 | 一种基于网络结构搜索的模型剪枝方法 |
CN117237788A (zh) * | 2023-11-14 | 2023-12-15 | 浙江大华技术股份有限公司 | 图像处理方法、设备和存储介质 |
CN117237788B (zh) * | 2023-11-14 | 2024-03-01 | 浙江大华技术股份有限公司 | 图像处理方法、设备和存储介质 |
CN118014009A (zh) * | 2024-02-26 | 2024-05-10 | 广芯微电子(广州)股份有限公司 | 一种基于遗传算法的神经网络初值寻优方法 |
Also Published As
Publication number | Publication date |
---|---|
CN111401516B (zh) | 2024-04-26 |
CN111401516A (zh) | 2020-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021164752A1 (zh) | 一种神经网络通道参数的搜索方法及相关设备 | |
WO2021238281A1 (zh) | 一种神经网络的训练方法、图像分类系统及相关设备 | |
US20210012198A1 (en) | Method for training deep neural network and apparatus | |
EP4145353A1 (en) | Neural network construction method and apparatus | |
WO2022042713A1 (zh) | 一种用于计算设备的深度学习训练方法和装置 | |
WO2021218517A1 (zh) | 获取神经网络模型的方法、图像处理方法及装置 | |
WO2021057056A1 (zh) | 神经网络架构搜索方法、图像处理方法、装置和存储介质 | |
WO2021147325A1 (zh) | 一种物体检测方法、装置以及存储介质 | |
WO2021164750A1 (zh) | 一种卷积层量化方法及其装置 | |
WO2022111617A1 (zh) | 一种模型训练方法及装置 | |
CN113159073B (zh) | 知识蒸馏方法及装置、存储介质、终端 | |
WO2021218471A1 (zh) | 一种用于图像处理的神经网络以及相关设备 | |
WO2022179587A1 (zh) | 一种特征提取的方法以及装置 | |
WO2021088365A1 (zh) | 确定神经网络的方法和装置 | |
WO2021218470A1 (zh) | 一种神经网络优化方法以及装置 | |
CN113095475A (zh) | 一种神经网络的训练方法、图像处理方法以及相关设备 | |
CN111382868A (zh) | 神经网络结构搜索方法和神经网络结构搜索装置 | |
WO2021129668A1 (zh) | 训练神经网络的方法和装置 | |
WO2021175278A1 (zh) | 一种模型更新方法以及相关装置 | |
WO2023274052A1 (zh) | 一种图像分类方法及其相关设备 | |
WO2023231954A1 (zh) | 一种数据的去噪方法以及相关设备 | |
WO2023179482A1 (zh) | 一种图像处理方法、神经网络的训练方法以及相关设备 | |
WO2023051369A1 (zh) | 一种神经网络的获取方法、数据处理方法以及相关设备 | |
CN115512251A (zh) | 基于双分支渐进式特征增强的无人机低照度目标跟踪方法 | |
WO2024001806A1 (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: 21757809 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21757809 Country of ref document: EP Kind code of ref document: A1 |