WO2022242175A1 - Data processing method and apparatus, and terminal - Google Patents
Data processing method and apparatus, and terminal Download PDFInfo
- Publication number
- WO2022242175A1 WO2022242175A1 PCT/CN2021/141388 CN2021141388W WO2022242175A1 WO 2022242175 A1 WO2022242175 A1 WO 2022242175A1 CN 2021141388 W CN2021141388 W CN 2021141388W WO 2022242175 A1 WO2022242175 A1 WO 2022242175A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- neural network
- data
- network
- scene
- application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/285—Selection of pattern recognition techniques, e.g. of classifiers in a multi-classifier system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/084—Backpropagation, e.g. using gradient descent
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the field of artificial intelligence, and in particular to a data processing method, device and terminal.
- AI Artificial Intelligence
- ML Machine Learning
- the neural network is a method of machine learning.
- terminals such as smart phones, self-driving cars, etc.
- the configured neural network to process the acquired data (such as images, voice, etc.) to realize application functions such as face recognition and voice recognition.
- the terminal usually processes data obtained in different scenarios based on a neural network. Since the data in different scenarios has different characteristics, sampling a neural network to process data in different scenarios cannot ensure the speed and accuracy of data processing required by the scenario. Therefore, how to provide a data processing method that ensures the speed and accuracy of data processing required by the scene has become an urgent problem to be solved.
- the present application provides a data processing method, device, and terminal, thereby ensuring the speed and accuracy of data processing to meet the scenario requirements.
- the present application provides a data processing method, which can be executed by a terminal, and specifically includes the following steps: after the terminal obtains the application data and scene perception data to be processed, it determines the processing according to the scene perception data and preset conditions
- the first neural network of the application data is used to obtain the processing result of the application data by using the first neural network.
- the scene awareness data is used to indicate factors influencing the terminal to process the application data.
- the preset condition is used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network.
- the terminal since the terminal considers the scene perception data that affects the processing of application data when selecting the first neural network for processing application data, and selects the first neural network suitable for processing application data according to the scene perception data and preset conditions, thereby ensuring The speed and accuracy of data processing meet the scene requirements and improve user experience.
- the application data includes data in at least one form among image, voice and text.
- Terminals can obtain application data through sensors.
- the sensor includes at least one of a camera, an audio sensor, and a lidar.
- the scene awareness data is used to indicate factors affecting speed and precision when the terminal processes application data.
- the scene perception data includes at least one of external influencing factors and internal influencing factors; the external influencing factors are used to describe the characteristics of the application scenario in which the terminal obtains the application data, and the internal influencing factors are used to describe the characteristics of the operating scenario of the hardware resources for the terminal to run the application data .
- the external influencing factors include at least one of temperature data, humidity data, illumination data and time data.
- the internal influencing factors include at least one of computing capability of the processor, available storage capacity and available remaining power.
- the terminal selects the first neural network suitable for processing application data according to the scene perception data and preset conditions, under the premise of ensuring the speed requirement, the first neural network is a large-scale network that meets the accuracy requirement; or, in Under the premise of ensuring the accuracy requirement, the first neural network is a smaller-scale network that meets the speed requirement. In this way, the accuracy and speed of processing application data are balanced, and the user experience is improved.
- determining the first neural network for processing the application data according to the scene awareness data and the preset conditions includes: the terminal determining the parameters of the first neural network corresponding to the scene data including the scene awareness data in the preset conditions , determining the first neural network from the supernetwork according to the parameters of the first neural network.
- the parameters of the first neural network include the number of channels and the number of network layers.
- the super network is used to determine the first neural network corresponding to the scene data.
- the first neural network is a subnetwork in the supernetwork.
- the number of network layers included in the sub-network is smaller than the number of network layers included in the super-network, or the number of channels included in the sub-network is smaller than the number of channels included in the super-network, and each network layer includes at least one neuron.
- the terminal stores the parameters of the supernetwork and at least one subnetwork included in the supernetwork; determining the first neural network from the supernetwork according to the parameters of the first neural network includes: according to the first neural network The parameters of determine the weights of the first neural network from the weights of the supernetwork. Since the sub-networks share the parameters of the super-network, compared with storing multiple sub-networks in the terminal, the storage space of the terminal is effectively reduced.
- the method further includes: the terminal determines a second neural network from the super network, and uses the second neural network to obtain The result of processing the application data.
- the second neural network is a sub-network in the supernetwork, the number of network layers included in the second neural network is greater than or less than the number of network layers included in the first neural network, or the number of channels included in the second neural network is greater than or less than The number of channels included in the first neural network. If the processing result of the first neural network does not meet the speed and precision requirements of the user, the terminal may also adjust the neural network so that the processing result of the application data obtained by the terminal using the second neural network meets the speed and precision requirements of the user.
- the method further includes: if the speed and accuracy of the first neural network do not meet user requirements, adjusting the scene data corresponding to the first neural network, so that the terminal uses the first neural network to process the application data again to obtain The processing results meet the user's speed and accuracy requirements.
- the method further includes: the terminal also displays the correspondence between the scene data and the first neural network that affect the speed and accuracy of the first neural network, and the processing results.
- the terminal also displays the correspondence between the scene data and the first neural network that affect the speed and accuracy of the first neural network, and the processing results. The user can see the processing result intuitively, so that the user can judge whether the running time meets the user's speed requirement, and whether the accuracy of the processing result meets the user's precision requirement.
- the present application provides a data processing device, the device including various modules for executing the data processing method in the first aspect or any possible design of the first aspect.
- the present application provides a terminal, the terminal includes at least one processor and a memory, and the memory is used to store a set of computer instructions;
- the device executes the set of computer instructions, it executes the first aspect or the operation steps of the data processing method in any possible implementation manner of the first aspect.
- the present application provides a computer-readable storage medium, including: computer software instructions; when the computer software instructions are run in the terminal, the terminal is made to execute the first aspect or any one of the possible implementation manners of the first aspect. Operational steps of the method.
- the present application provides a computer program product.
- the terminal executes the operation steps of the method described in the first aspect or any possible implementation manner of the first aspect.
- Fig. 1 is the structural representation of a kind of neural network provided by the present application
- Fig. 2 is a schematic structural diagram of a convolutional neural network provided by the present application.
- FIG. 3 is a schematic diagram of the architecture of a data processing system provided by the present application.
- FIG. 4 is a flowchart of a method for generating preset conditions provided by the present application.
- FIG. 5 is a schematic structural diagram of a supernetwork and a subnetwork provided by the present application.
- FIG. 6 is a schematic diagram of a Pareto boundary provided by the present application.
- FIG. 7 is a flowchart of a data processing method provided by the present application.
- FIG. 8 is a flowchart of another data processing method provided by the present application.
- FIG. 9 is a flowchart of another data processing method provided by the present application.
- FIG. 10 is a schematic diagram of an interface for adjusting scene data provided by the present application.
- FIG. 11 is a schematic structural diagram of a system provided by the present application.
- FIG. 12 is a schematic structural diagram of a data processing device provided by the present application.
- FIG. 13 is a schematic structural diagram of a terminal provided by the present application.
- a neural network can be made up of neurons, which can refer to operational units that take x s and intercept 1 as input.
- the output of the arithmetic unit satisfies the following formula (1).
- W s is the weight of x s
- b is the bias of the neuron.
- f is the activation function of the neuron, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neuron into an output signal.
- the output signal of the activation function can be used as the input of the next layer, and the activation function can be a sigmoid function.
- a neural network is a network formed by connecting multiple above-mentioned single neurons, that is, the output of one neuron can be the input of another neuron.
- each neuron can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neurons.
- Weights characterize the strength of connections between different neurons. The weight determines the influence of the input on the output. A weight close to 0 means that changing the input does not change the output. Negative weights mean that increasing the input decreases the output.
- the neural network 100 includes N processing layers, where N is an integer greater than or equal to 3.
- the first layer of the neural network 100 is the input layer 110, which is responsible for receiving input signals
- the last layer of the neural network 100 is the output layer 130, which is responsible for outputting the processing results of the neural network.
- the other layers except the first layer and the last layer are intermediate layers 140, and these intermediate layers 140 together form a hidden layer 120, and each intermediate layer 140 in the hidden layer 120 can receive input signals and output signals.
- the hidden layer 120 is responsible for the processing of the input signal.
- Each layer represents a logical level of signal processing, and through multiple layers, data signals can be processed by multi-level logic.
- the input signals of the neural network may be signals in various forms such as video signals, voice signals, text signals, image signals, and temperature signals.
- the image signal can be various sensor signals such as the landscape signal captured by the camera (image sensor), the image signal of the community environment captured by the display monitoring equipment, and the face signal obtained by the access control system.
- the input signals of the neural network also include various other computer-processable engineering signals, which will not be listed here. If the neural network is used to carry out deep learning on the image signal, the image quality can be improved.
- Deep Neural Network also known as a multi-layer neural network
- DNN can be understood as a neural network with multiple hidden layers.
- the deep neural network is divided according to the position of different layers.
- the neural network inside the deep neural network can be divided into three categories: input layer, hidden layer and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the middle layers are all hidden layers.
- the layers are fully connected, that is, any neuron in the i-th layer is connected to any neuron in the i+1-th layer.
- the coefficient from the kth neuron of the L-1 layer to the jth neuron of the L layer is defined as
- the input layer has no W parameter.
- more hidden layers make the network more capable of describing complex situations in the real world. Theoretically speaking, a model with more parameters has a higher complexity and a greater "capacity", which means that it can complete more complex learning tasks.
- Training the deep neural network is also the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vector W of many layers).
- Convolutional Neuron Network is a deep neural network with a convolutional structure.
- a convolutional neural network consists of a feature extractor consisting of a convolutional layer and a subsampling layer.
- the feature extractor can be seen as a filter, and the convolution process can be seen as using a trainable filter to convolve with an input image or feature map.
- the convolutional layer refers to the neuron layer that performs convolution processing on the input signal in the convolutional neural network.
- a neuron can only be connected to some adjacent neurons.
- a convolutional layer can output several feature maps, and the feature map can refer to the intermediate results during the operation of the convolutional neural network.
- Neurons in the same feature map share weights, and the shared weights here are convolution kernels.
- Shared weights can be understood as a way to extract image information that is independent of position. That is, the statistics for one part of the image are the same as for other parts. That means that the image information learned in one part can also be used in another part. So for all positions on the image, the same learned image information can be used.
- multiple convolution kernels can be used to extract different image information. Generally, the more the number of convolution kernels, the richer the image information reflected by the convolution operation.
- the convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network.
- the direct benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
- the convolutional neural network 200 may include an input layer 210 , a convolutional/pooling layer 220 (where the pooling layer is optional) and a neural network layer 230 .
- the convolutional layer/pooling layer 220 may include layers 221 to 226, for example.
- layer 221 may be a convolutional layer
- layer 222 may be a pooling layer
- layer 223 may be a convolutional layer
- layer 224 may be a pooling layer
- layer 225 may be a convolutional layer
- the layer 226 may be, for example, a pooling layer.
- layers 221 and 222 may be, for example, convolutional layers
- layer 223 may be, for example, a pooling layer
- layers 224 and 225 may be, for example, convolutional layers
- layer 226 may be, for example, a pooling layer.
- the output of a convolutional layer can be used as input to a subsequent pooling layer, or as input to another convolutional layer to continue the convolution operation.
- the convolution layer 221 may include many convolution operators, and the convolution operators may also be called kernels.
- the role of the convolution operator in image processing is equivalent to a filter that extracts specific information from the input image matrix.
- the convolution operator can essentially be a weight matrix, which is usually predefined. During the convolution operation on the image, the weight matrix is usually one pixel by one pixel (or two pixels by two pixels, depending on the value of the stride) along the horizontal direction on the input image. processing to complete the work of extracting specific features from the image.
- the size of this weight matrix is related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image.
- the weight matrix is extended to the full depth of the input image. Therefore, convolution with a single weight matrix will produce a convolutional output with a single depth dimension, but in most cases instead of using a single weight matrix, multiple weight matrices of the same size (row ⁇ column) are applied, That is, multiple matrices of the same shape.
- the output of each weight matrix is stacked to form the depth dimension of the convolved image.
- Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to filter unwanted noise in the image. Do blurring etc.
- the multiple weight matrices have the same size (row ⁇ column), and the feature maps extracted by the multiple weight matrices of the same size are also of the same size, and then the extracted multiple feature maps of the same size are combined to form the convolution operation. output.
- 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 be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions .
- the initial convolutional layer (such as layer 221 ) often extracts more general features, which can also be called low-level features.
- the features extracted by the later convolutional layers (for example, layer 226) become more and more complex, such as high-level semantic features, and the higher the semantic features, the more suitable for unresolved issues.
- Each layer from layer 221 to layer 226 as shown in the convolutional layer/pooling layer 220 in Figure 2 can be a layer of convolutional layer followed by a layer of pooling layer, or a multi-layer convolutional layer followed by a layer or multiple pooling layers.
- the sole purpose of pooling layers is to reduce the spatial size of the image.
- the pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling an input image to obtain an image of a smaller size.
- the average pooling operator can calculate the pixel values in the image within a specific range to generate an average value as the result of average pooling.
- the maximum pooling operator can take the pixel with the largest value within a specific range as the result of maximum pooling. Also, just like the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image.
- the size of the image output after being processed by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
- the convolutional neural network 200 After being processed by the convolutional layer/pooling layer 220, the convolutional neural network 200 is not enough to output the required output information. Because as mentioned earlier, the convolutional layer/pooling layer 220 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 relevant information), the convolutional neural network 200 needs to use the neural network layer 230 to generate one or a group of outputs with the required number of classes. Therefore, the neural network layer 230 may include a multi-layer hidden layer (layer 231, layer 232 to layer 23n as shown in FIG. 2 ) and an output layer 240, and the parameters contained in the multi-layer hidden layer may be determined according to specific tasks. Types of related training data are pre-trained, for example, the task type can include image recognition, image classification, image super-resolution reconstruction, and so on.
- the task type can include image recognition, image classification, image super-resolution reconstruction, and so on.
- the output layer 240 After the multi-layer hidden layer in the neural network layer 230, that is, the last layer of the entire convolutional neural network 200 is the output layer 240, which has a loss function similar to the classification cross entropy, and is specifically used to calculate the prediction error.
- the forward propagation of the entire convolutional neural network 200 (as shown in Figure 2 is forward propagation from layer 210 to layer 240 direction) is completed, and the reverse propagation (as shown in Figure 2 is backward propagation from layer 240 to layer 210 direction) ) will begin to update the weight values and deviations of the above-mentioned layers, so as to reduce the loss of the convolutional neural network 200, and the error between the output result of the convolutional neural network 200 through the output layer and the ideal result.
- the convolutional neural network 200 shown in FIG. 2 is only an example of a convolutional neural network, and in specific applications, the convolutional neural network may also exist in the form of other network models.
- the convolutional neural network can use the error back propagation (back propagation, BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, passing the input signal forward until the output will generate an error loss, and updating the parameters in the initial super-resolution model by backpropagating the error loss information, so that the error loss converges.
- the backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
- FIG. 3 is a schematic structural diagram of a data processing system provided by an embodiment of the present application.
- the system 300 includes an execution device 310 , a training device 320 , a database 330 , a terminal device 340 , a data storage system 350 and a data collection device 360 .
- the execution device 310 may be a terminal, such as a mobile phone terminal, a tablet computer, a notebook computer, a virtual reality (virtual reality, VR)/augmented reality (augmented reality, AR) device, a vehicle terminal, etc., and may also be an edge device (for example, carrying a processing power chip box), etc.
- a terminal such as a mobile phone terminal, a tablet computer, a notebook computer, a virtual reality (virtual reality, VR)/augmented reality (augmented reality, AR) device, a vehicle terminal, etc.
- an edge device for example, carrying a processing power chip box
- the training device 320 may be a server or a cloud device or the like.
- the training device 320 has strong computing power, and can run neural networks, perform calculations such as training neural networks.
- the executing device 310 and the training device 320 are different processors deployed on different physical devices (such as servers or servers in a cluster).
- the execution device 310 may be a central processing unit (central processing unit, CPU), other general-purpose processors, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), on-site Programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general purpose processor may be a microprocessor or any conventional processor or the like.
- the training device 320 may be a graphics processing unit (graphics processing unit, GPU), a neural network processor (neural network processing unit, NPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or A plurality of integrated circuits used to control the program execution of the program of this application.
- graphics processing unit graphics processing unit, GPU
- NPU neural network processing unit
- ASIC application-specific integrated circuit
- the data collection device 360 is used to collect training data and test data, and store the training data and test data into the database 330 .
- Both the training data and the testing data may be data in at least one form among image, voice and text.
- training data includes training images and objects in the training images.
- the test data includes test images and objects in the test images.
- Both the features of the training image and the features of the test image are features similar to the features of the same application scene.
- Application scene characteristics include at least environmental characteristics (such as: temperature, humidity, light, etc.) and time characteristics (such as: day time, night time, traffic peak hours, traffic low peak hours, etc.), and so on.
- the training device 320 is used to realize the function of searching N subnetworks (subnetwork) from the supernetwork 301 (supernet) based on the training data and test data maintained in the database 330, and generating the preset condition 302.
- the preset condition 302 is used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network.
- the neural network refers to a sub-network searched from the super-network.
- N is an integer greater than or equal to 2.
- Step 410 the training device 320 trains the supernetwork and the M subnetworks sampled in the supernetwork based on the training data maintained in the database 330 .
- the training device 320 may sample M sub-networks from the super-network according to preset rules.
- the default rule is, for example, to select M sub-networks of different sizes from the first neuron of the first network layer of the supernetwork.
- the training device 320 randomly samples M sub-networks from the super-network.
- M is an integer greater than or equal to 2.
- the training device 320 uses the training data to train the super-network until the loss function in the super-network converges, and the super-network training is completed if the loss function value is less than a specific threshold, so that the super-network can reach a certain accuracy. Alternatively, all the training data in the training set is used for training, and the supernetwork training is completed.
- the training device 320 uses the training data to train the sub-network until the loss function in the sub-network converges, and the training of the sub-network is completed if the value of the loss function is less than a specific threshold, so that the sub-network can reach a certain accuracy. Alternatively, all the training data in the training set is used for training, and the sub-network training is completed.
- a hypernetwork is a very large neural network that includes a large number of network layers, and each network layer contains a large number of neurons.
- FIG. 5 illustrates a structure of a hypernetwork.
- a subnetwork is a partial network within a supernetwork.
- a subnet is a small neural network.
- the subnetwork includes three network layers, and the number of network layers included in the subnetwork is smaller than the number of network layers included in the supernetwork shown in (a) in FIG. 5 .
- Each network layer in the supernetwork and subnetwork includes at least one neuron.
- FIG. 5 illustrates a structure of a hypernetwork.
- a subnetwork is a partial network within a supernetwork.
- a subnet is a small neural network.
- the subnetwork includes three network layers, and the number of network layers included in the subnetwork is smaller than the number of network layers included in the supernetwork shown in (a) in FIG. 5 .
- the number of neurons included in the sub-network is smaller than the number of neurons included in the super-network shown in (a) in FIG. 5 .
- the number of channels included in the sub-network may also be smaller than the number of channels included in the super-network shown in (a) in FIG. 5 .
- the weights of the subnetworks share the weights of the supernetwork.
- the sub-network includes a first network layer and a second network layer in the supernetwork, and a first neuron in the first network layer is connected to a first neuron in the second network layer.
- the weight of the connection between the first neuron in the first network layer and the first neuron in the second network layer reuses the first neuron in the first network layer and the first neuron in the second network layer in the super network
- the weight of the connection may be a deep neural network.
- the neural network may be a convolutional neural network.
- the training device 320 can perform multiple rounds of training on the supernetwork and the subnetwork. For example, the training device 320 may re-sample a sub-network randomly from the super-network in each round, and train the super-network and the randomly-sampled sub-network. After executing all the rounds, the training device 320 randomly samples M sub-networks and completes the training on the M sub-networks. The training device 320 may randomly sample different numbers of sub-networks in each round; or, the training device 320 may randomly sample sub-networks of different network sizes in each round.
- the training device 320 After the training device 320 completes the training of the supernetwork and the subnetworks in the supernetwork, it can search the subnetworks from the supernetwork, for example, the training device 320 can also execute steps 420 to 460 to obtain multiple subnetworks.
- Step 420 the training device 320 searches for Q sub-networks from the super-network.
- Step 430 the training device 320 tests the accuracy of the Q sub-networks based on the test data maintained in the database 330 .
- the test data used to test the accuracy of the subnet includes a large number of images.
- the training device 320 inputs a large number of images into the sub-network to obtain prediction results. Comparing the predicted result with the original image, the accuracy of the sub-network is obtained.
- the training device 320 Since the training device 320 has strong computing power, it can run the neural network quickly, thereby effectively reducing the time for training and testing the neural network.
- Step 440 the execution device 310 tests the running durations of the Q sub-networks based on the test data maintained in the database 330 .
- the amount of test data used by the test execution device 310 for running the subnet is much smaller than the test data used by the training device 320 for the accuracy of the subnetwork.
- the data volume of the test data may be run the test data with a long running time of the subnetwork as an image.
- the executing device 310 For each of the Q sub-networks, the executing device 310 inputs test data into the sub-network to obtain a prediction result and a running time of the sub-network.
- the running time of the subnetwork may refer to the time period from when the executing device 310 runs the subnetwork to process test data to when the test result is obtained. Understandably, the longer the running time of the sub-network, the slower the data processing speed; the shorter the running time of the sub-network, the faster the data processing speed.
- Step 450 the executing device 310 transmits the running durations of the Q sub-networks to the training device 320 .
- the training device 320 since the training device 320 has trained the supernetwork and a large number of randomly sampled subnetworks according to the above step 410, the Q subnetworks searched by the training device 320 from the supernetwork are subnetworks with certain precision.
- the training device 320 performs step 460 .
- the Q sub-networks may be part of the M sub-networks trained by the training device 320 according to the above step 410 .
- the Q sub-networks may be sub-networks randomly sampled by the training device 320 .
- the training device 320 can randomly search for Q sub-networks from the supernetwork for the first time, update the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks, and perform steps 430 to 450 in a loop, after multiple rounds of iterations After updating the Q sub-networks to obtain Q sub-networks with high accuracy, the training device 320 executes step 460 .
- Step 460 the training device 320 searches for N sub-networks from the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks.
- the training device 320 may search for N sub-networks from the Q sub-networks according to evolutionary algorithm, reinforcement learning or greedy algorithm. Both Q and N are integers greater than or equal to 2, and Q is greater than N.
- the training device 320 may also perform statistics on the accuracies of the Q sub-networks and the running time of the Q sub-networks to generate a Pareto boundary as shown in FIG. 6 .
- the horizontal axis represents the error rate
- the vertical axis represents the network size.
- the network size can also be referred to as the scale of the neural network. The larger the size of the neural network, the higher the accuracy of the neural network, the lower the error rate, and the longer the running time; conversely, the smaller the size of the neural network, the lower the accuracy of the neural network, the higher the error rate, and the shorter the running time. Therefore, the accuracy and speed of neural networks are inversely proportional.
- each point on the Pareto frontier represents the fastest neural network at an accuracy. From the perspective of the speed of the neural network, each point on the Pareto frontier represents the most accurate neural network at a speed.
- the training device 320 can select N sub-networks from the Q sub-networks according to the accuracy and speed of the Pareto boundary trade-off neural network, and the training device 320 selects a neural network that meets the accuracy requirements and speed requirements for execution devices with different hardware resource configurations.
- the training device 320 can also search Q sub-networks from the super network according to the evolutionary algorithm, reinforcement learning or greedy algorithm, and the training device 320 generates the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks as shown in Figure 6. As shown in the Pareto boundary, the training device 320 may select N sub-networks from the Q sub-networks according to the Pareto boundary to balance the accuracy and speed of the neural network.
- the training device 320 may also search for N sub-networks from the super-network according to evolutionary algorithm, reinforcement learning or greedy algorithm.
- the training device 320 can also use the training data to train the N sub-networks, adjust the weights of the N sub-networks, and improve the accuracy of the N sub-networks.
- step 470 the training device 320 generates preset conditions according to the N sub-networks and scene data associated with each of the N sub-networks.
- the application data processed by a neural network may be obtained in different application scenarios, and different application scenarios have different characteristics of the application scenarios, the accuracy of processing the application data in different application scenarios by the neural network is different.
- an autonomous driving scenario when an autonomous vehicle passes through a barrier in a clear sky, the image of the license plate is clear enough, and the execution device uses a small-scale neural network to recognize the license plate with high accuracy, which can Meet the accuracy requirements of license plate recognition.
- Application scene characteristics include sufficient light and sunny weather.
- the license plate image may be blurred due to the unclear line of sight in the rainy day.
- Application scene characteristics include low light and rainy weather.
- the flow of people is relatively large during the rush hour, and the execution equipment uses a large-scale neural network to identify the flow of people at a slow speed, which cannot meet the speed requirements for flow recognition.
- Application scenario characteristics can include rush hour hours and human traffic.
- the training device 320 can generate preset conditions according to a large number of application scene features and N sub-networks.
- the preset conditions may include the association relationship between a large number of application scene features and the N sub-networks.
- the application scene features include sunny days, cloudy days, and rainy days.
- the preset conditions include an association relationship between sunny days and the first subnetwork, an association relationship between cloudy days and the second subnetwork, and an association relationship between rainy days and the third subnetwork.
- the size of the first sub-network is smaller than the size of the second sub-network.
- the size of the second sub-network is smaller than the size of the third sub-network.
- the application scene features may be obtained by the training device 320 by analyzing test data and training data.
- the database 330 maintains the characteristics of the application scenario under the application scenario where the test data is collected and the characteristics of the application scenario under the application scenario where the training data is collected.
- the execution time of the neural network may also be different under different hardware resources of the execution device.
- the available storage capacity and the available remaining power are different due to the different usage habits of different users.
- the applications, available storage capacity, and available remaining power of the mobile phone are different at different time periods.
- the mobile phone has a low battery, it may take a long time to run the neural network. Therefore, when the mobile phone has a low battery, a smaller neural network can be selected to process application data.
- the training device 320 may also receive the running scenario characteristics of the hardware resources when testing the N subnetworks sent by the execution device 310 .
- the training device 320 generates preset conditions according to a large number of application scene features, running scene features and N sub-networks.
- the running scenario feature may include at least one of computing capability of the processor, available storage capacity, and available remaining power.
- the computing capability of the processor can also be understood as the occupancy rate of computing resources of the processor.
- operating scene characteristics include low battery, medium battery, and high battery.
- the preset conditions include the association relationship between the low battery level and the fourth subnetwork, the association relationship between the medium battery level and the fifth subnetwork, and the association relationship between the high battery level and the sixth subnetwork.
- the size of the fourth sub-network is smaller than the size of the fifth sub-network.
- the size of the fifth sub-network is smaller than the size of the sixth sub-network.
- the training device 320 After the training device 320 generates the precondition 302 according to the above steps 410 to 470 , it can configure the hypernetwork 301 and the precondition 302 to the execution device 310 .
- the execution device 310 is configured to realize the function of determining the first neural network for processing application data from the hypernetwork 301 according to the scene awareness data and the preset condition 302 .
- the execution device 310 selects the first neural network suitable for processing application data from the super network 301 according to the scene perception data and the preset condition 302, the first neural network is of a scale that meets the accuracy requirement under the premise of ensuring the speed requirement A larger network; or, under the premise of ensuring the accuracy requirement, the first neural network is a smaller-scale network that meets the speed requirement. In this way, the accuracy and speed of processing application data are balanced, and the user experience is improved.
- the first neural network is a subnetwork in the supernetwork 301 .
- the training data and test data maintained in the database 330 do not necessarily all come from the data collection device 360, and may also be received from other devices.
- the training device 320 does not necessarily train the sub-network entirely based on the training data maintained by the database 330, and it is also possible to obtain training data from the cloud or other places to train the super-network.
- the execution device 310 does not necessarily test the sub-network entirely based on the test data maintained by the database 330, and may also obtain test data from the cloud or other places, so as to test the processing speed of the sub-network based on the test data.
- the above description should not be used as a limitation to the embodiments of the present application.
- the execution device 310 can be further subdivided into the architecture shown in FIG. Preprocessing module 313 .
- the I/O interface 312 is used for data interaction with external devices.
- a user can input data to the I/O interface 312 through the terminal device 340 .
- Input data can include images or video.
- the input data can also come from the database 330 .
- the preprocessing module 313 is configured to perform preprocessing according to the input data received by the I/O interface 312 .
- the preprocessing module 313 may be used to identify the application scenario characteristics of the application data received from the I/O interface 312 .
- the execution device 310 When the execution device 310 preprocesses the input data, or in the execution device 310 computing module 311 performs calculation and other related processing, the execution device 310 can call the data, codes, etc. in the data storage system 350 for corresponding processing , and the correspondingly processed data and instructions may also be stored in the data storage system 350 .
- the hypernetwork 301 and preset conditions 302 stored in the execution device 310 may be applied to the execution device 310 .
- the calculation module 311 searches the first neural network from the super network 301 according to the scene awareness data and the preset condition 302, and uses the first neural network to process the application data. Since the first neural network is determined by the execution device 310 based on the scene perception data, processing the application data by using the first neural network can meet the speed and precision requirements of the user for data processing.
- the I/O interface 312 returns the processing result to the terminal device 340, thereby providing it to the user, so that the user can view the processing result.
- the user can manually specify the input data, and the manual setting can be operated through the interface provided by the I/O interface 312.
- the terminal device 340 can automatically send input data to the I/O interface 312. If the terminal device 340 is required to automatically send the input data to obtain authorization from the user, the user can set corresponding permissions in the terminal device 340.
- the user can view the processing results output by the execution device 310 on the terminal device 340, and the specific presentation form may be specific ways such as display, sound, and action.
- the terminal device 340 can also be used as a data collection terminal, collecting input data input to the I/O interface 312 as shown in the figure and output processing results of the I/O interface 312 as new sample data, and storing them in the database 330 .
- the terminal device 340 may not be used for collection, but the I/O interface 312 will use the input data input to the I/O interface 312 as shown in the figure and the processing results of the output I/O interface 312 as new sample data Stored in database 330 .
- Fig. 3 is only a schematic diagram of a system architecture provided by the embodiment of the present application, and the positional relationship between devices, devices, modules, etc. shown in Fig. 3 does not constitute any limitation.
- the data storage system 350 is The execution device 310 is an external memory, and in other cases, the data storage system 350 may also be placed in the execution device 310 .
- FIG. 7 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
- the execution device 310 in FIG. 3 is taken as an example for illustration.
- the method includes the following steps.
- Step 710 the executing device 310 obtains application data to be processed.
- the application data includes data in at least one form among image, voice and text.
- the execution device 310 may acquire application data to be processed through a sensor.
- the sensor includes at least one of a camera, an audio sensor, and a lidar.
- the sensors for collecting the application data may be different.
- the application scenario is that the smart terminal uses a face recognition function to recognize a user's face to realize the function of unlocking the smart terminal.
- the smart terminal can use the camera to capture the face to obtain a face image, and the application data to be processed is the face image.
- the application scenario is that the smart terminal uses the voice assistant function to recognize the user's voice, and realize the function of unlocking the smart terminal.
- the smart terminal can use the audio sensor to obtain the user's voice to obtain audio data, and the application data to be processed is audio data.
- the execution device 310 is a barrier gate monitor.
- the application scenario is that when the self-driving car passes through the barrier gate, the barrier gate monitor performs license plate recognition.
- the barrier gate monitor can use the camera to take pictures of the license plate of the self-driving car to obtain the license plate image, and the application data to be processed is the license plate image.
- Step 720 the executing device 310 acquires scene perception data.
- the factors affecting the speed and accuracy of the neural network processing application data include the application scenario characteristics of the application scenario where the application data is acquired and the operating scenario characteristics of the hardware resources that run the application data. Therefore, after acquiring the application data to be processed, the execution device 310 acquires the scene awareness data.
- the scene perception data is used to indicate the influencing factors when the executing device 310 processes the application data.
- the scene awareness data is used to indicate the factors affecting the speed and accuracy when the execution device 310 uses the neural network to process the application data.
- the scene awareness data includes at least one of external influencing factors and internal influencing factors.
- the external influencing factors are used to describe the characteristics of the application scenario when the executing device 310 obtains the application data.
- the external influencing factors include at least one of temperature data, humidity data, illumination data and time data.
- the internal influencing factors are used to describe the characteristics of the running scenario of the hardware resources on which the execution device 310 runs the application data.
- the internal influencing factors include at least one of computing power of the processor, available storage capacity and available remaining power.
- the executing device 310 may acquire the scene awareness data from other devices. For example, if the scene perception data is temperature data, the executing device 310 may acquire the temperature data from a temperature sensor. For another example, if the scene perception data is humidity data, the executing device 310 may acquire temperature data from a humidity sensor. In another possible implementation manner, the executing device 310 may acquire scene awareness data according to application data to be processed. For example, the application data is an image, the scene perception data may be brightness or light intensity, and the execution device 310 may analyze the image to obtain the brightness or light intensity.
- the controller in the execution device 310 can monitor the processor, storage and power in the execution device 310 to obtain at least one of the processor's computing power, available storage capacity and available remaining power.
- the controller may be a central processing unit in the execution device 310 .
- Step 730 the execution device 310 determines the first neural network for processing application data according to the scene awareness data and preset conditions.
- the preset condition is used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network.
- the scenario data includes an application scenario identifier and an application scenario feature.
- the application scenario identifier is used to indicate the application scenario.
- An application scenario can have one or more application scenario characteristics. Understandably, one application scenario identifier can be associated with one application scenario feature, or one application scenario identifier can also be associated with multiple application scenario features.
- the application scenario is a turnstile scenario in a residential garage, and the characteristics of the application scenario include sunny days, cloudy days, and rainy days.
- the preset condition is used to indicate the corresponding relationship between the characteristics of the application scene that affect the operation of the neural network and the neural network.
- Each application scene feature is associated with a neural network.
- the preset conditions may include correspondences between multiple application scene features and neural networks.
- the corresponding relationship between the application scene features and the neural network may be presented in the form of a table, as shown in Table 1.
- the application scene features associated with the application scene indicated by the identifier 1 include sunny days, cloudy days, and rainy days. Sunny days have a binding relationship with neural network 1, cloudy days have a binding relationship with neural network 2, and rainy days have a binding relationship with neural network 3.
- the characteristics of the application scene associated with the application scene indicated by the mark 2 include strong light, medium light and weak light. The strong light has a binding relationship with the neural network 4, the medium light has a binding relationship with the neural network 5, and the weak light has a binding relationship with the neural network 6.
- the application scenario characteristics associated with the application scenario indicated by the identifier 3 include the usage interval of the application. The usage interval of the application has a binding relationship with the neural network 7 .
- the application scenario indicated by the identifier 1 is the turnstile scenario in the garage of the community.
- the scene perception data acquired by the executing device 310 includes the car passing through the barrier and sunny weather.
- the executing device 310 looks up Table 1 according to the scene sensing data, and determines that the application scene is the scene indicated by the identifier 1.
- the execution device 310 further determines that the application scene characteristic of the scene indicated by the identifier 1 is sunny, and determines the neural network 1 corresponding to the sunny day as the first neural network.
- the first neural network determined by the execution device 310 may be a smaller-scale neural network.
- the execution device 310 uses a small-scale neural network to recognize the license plate with a high accuracy rate, which can meet the accuracy requirement of license plate recognition.
- the running time of the execution device 310 using a small-scale neural network to recognize the license plate is relatively short, which can meet the speed requirement of license plate recognition.
- the scene perception data obtained by the executing device 310 includes the car passing through a barrier and rainy weather, and the executing device 310 looks up Table 1 according to the scene sensing data, and determines that the application scene is indicated by the sign 1 The execution device 310 then determines that the application scene feature of the scene indicated by the identifier 1 is rainy, and determines the neural network 3 corresponding to the rainy day as the first neural network.
- the size of neural network 3 is larger than that of neural network 1.
- the image of the license plate captured by the executing device 310 may be blurred. If the execution device 310 continues to use a small-scale neural network to recognize the license plate, the accuracy rate is low, which cannot meet the accuracy requirement of license plate recognition. Therefore, the first neural network determined by the execution device 310 according to the characteristics of the application scenario and preset conditions may be a relatively large-scale neural network. The execution device 310 uses a large-scale neural network to recognize the license plate with high accuracy, which can meet the accuracy requirement of license plate recognition under the premise of ensuring the speed requirement.
- the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the application scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or makes the precision as high as possible under the premise of meeting the speed requirement , balance the accuracy requirements and speed requirements when processing application data, and improve user experience.
- Table 1 only shows the storage form of the corresponding relationship in the storage device in the form of a table, and does not limit the storage form of the corresponding relationship in the storage device.
- the storage form of the corresponding relationship in the storage device The format may also be stored in other formats, which is not limited in this embodiment.
- the application scenario feature may be expressed in the form of a specific value or value range.
- the value range of light intensity may include three value ranges of strong light, medium light and weak light.
- the feature of the application scenario is the duration of the usage interval of the application, and the duration of the usage interval of the application may be 3 seconds. The more value ranges corresponding to an application scenario feature, the more accurate the execution device 310 determines the first neural network for processing application data.
- the scenario data includes the identifier of the running scenario and the characteristics of the running scenario.
- the running scenario identifier is used to indicate the running scenario.
- a running scenario can have one or more running scenario characteristics. Understandably, one running scenario identifier can be associated with one running scenario feature, or one running scenario identifier can also be associated with multiple running scenario features. For example, the running scenario is available remaining power, and the characteristics of the running scenario include high power, medium power and low power.
- the preset condition is used to indicate the corresponding relationship between the characteristics of the operating scene that affect the operation of the neural network and the neural network.
- Each running scene feature is associated with a neural network.
- the preset conditions may include correspondences between multiple running scene features and neural networks.
- the corresponding relationship between the running scene features and the neural network may be presented in the form of a table, as shown in Table 2.
- the running scenario indicated by the identifier 4 is the available remaining power scenario of the executing device 310 .
- the running scenario characteristics associated with the available remaining power scenarios include high available remaining power, medium available remaining power and low available remaining power.
- the high available remaining power has a binding relationship with the neural network 8
- the available remaining power has a binding relationship with the neural network 9
- the low available remaining power has a binding relationship with the neural network 10 .
- the characteristics of the running scenario can be expressed in the form of a specific value or value range. For example, if the running scene is characterized by available remaining power. The value range of available remaining power is 100% to 60%. The range of values in Available Remaining Battery is 60% to 30%. The value range for the low battery remaining is 30% to 5%. The more value ranges corresponding to an operating scenario feature, the more accurate the execution device 310 determines the first neural network for processing the operating data.
- the execution device 310 determines that the power is lower than 20%, then the execution device 310 determines that the scene perception data is that the power is lower than 20%.
- the execution device 310 determines that the running scenario is the scenario indicated by the identifier 4 according to the scene perception data lookup table 2, and then the execution device 310 determines that the running scenario characteristic of the scenario indicated by the identifier 4 is low available remaining power, and the neural network corresponding to the low available remaining power 10 is determined as the first neural network.
- the execution device 310 Since the available remaining power of the execution device 310 is low, if the execution device 310 continues to use a large-scale neural network for speech recognition, the speed requirement for license plate recognition cannot be met. At this time, the first neural network determined by the execution device 310 according to the characteristics of the running scenario and preset conditions may be a smaller-scale neural network. The execution device 310 can recognize the user's voice by using a small-scale neural network, which can meet the speed requirement of voice recognition under the premise of ensuring the accuracy requirement, and can save power.
- the execution device 310 determines that the power level is higher than 80%, then the execution device 310 determines that the scene awareness data indicates that the power level is higher than 80%.
- the execution device 310 determines that the running scenario is the scenario indicated by the identifier 4 according to the scene perception data query table 2, and the execution device 310 then determines that the running scenario characteristic of the scenario indicated by the identifier 4 is high available remaining power, and the neural network corresponding to the high available remaining power 8 is determined as the first neural network.
- the first neural network determined by the execution device 310 may be a large-scale neural network.
- the execution device 310 can recognize the user's voice by using a large-scale neural network, and can meet the accuracy requirement of voice recognition under the premise of ensuring the speed requirement.
- the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the running scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or makes the precision as high as possible under the premise of meeting the speed requirement , balance the accuracy requirements and speed requirements when processing application data, and improve user experience.
- Table 2 only shows the storage form of the corresponding relationship in the storage device in the form of a table, and does not limit the storage form of the corresponding relationship in the storage device.
- the storage form of the corresponding relationship in the storage device The format may also be stored in other formats, which is not limited in this embodiment.
- the scenario data includes application scenario features and running scenario features.
- An application scenario feature can correspond to one or more running scenario features.
- a running scenario feature can correspond to one or more application scenario features. The embodiment of the present application does not limit the association relationship between the application scenario feature and the running scenario feature, and the specific association relationship can be set according to the application scenario.
- the corresponding relationship between the scene data and the neural network may be presented in the form of a table, as shown in Table 3.
- the application scene characteristics associated with the application scene indicated by the identifier 7 include sunny weather.
- the running scenario characteristics associated with the application scenario indicated by the identifier 7 include high remaining available power and low remaining available power. Both the sunny day and the high remaining power available have a binding relationship with the neural network 17 . Sunny days and low available remaining power both have a binding relationship with the neural network 18 .
- the application scenario indicated by the mark 7 is the scenario where the self-driving car passes through the barrier gate.
- the scene perception data acquired by the execution device 310 includes the vehicle passing the barrier and the sunny day, and the scene perception data determined by the execution device 310 also includes the high remaining power available
- the execution device 310 according to Scene-aware data lookup table 3, determine that the application scene is the scene indicated by the mark 7, and the execution device 310 determines that the application scene characteristic of the scene indicated by the mark 7 is sunny, and the running scene is characterized by high available remaining power, and the sunny day and the high available remaining power
- the corresponding neural network 17 is defined as the first neural network.
- the execution device 310 can use a small-scale neural network to recognize the license plate to meet the speed requirement of license plate recognition while ensuring the accuracy requirement.
- the first neural network determined by the executing device 310 according to the characteristics of the application scenario, the characteristics of the operating scenario, and the preset conditions can further improve the license plate recognition on the premise that it meets the speed requirements of the license plate recognition.
- the execution device 310 may select the neural network 18 corresponding to the sunny day and the low available remaining power to be determined as the first neural network 18. a neural network.
- the license plate is recognized by using the neural network 18 which is smaller in scale than the neural network 17, so as to meet the speed requirement of the license plate recognition.
- the scene perception data obtained by the execution device 310 includes the car passing the barrier and rainy weather, and the scene perception data determined by the execution device 310 also includes the high available remaining power
- the execution device 310 determines that the application scene is the scene indicated by the mark 8
- the execution device 310 determines that the application scene feature of the scene indicated by the mark 8 is rainy
- the running scene feature is that the available remaining power is high
- the neural network 19 corresponding to the high battery level is determined as the first neural network.
- the image of the license plate captured by the execution device 310 may be blurred.
- the execution device 310 uses a large-scale neural network to recognize the license plate with a high accuracy rate, which can meet the requirements of license plate recognition under the premise of ensuring the speed requirement. Accuracy needs.
- the available remaining power of the execution device 310 is high, and the first neural network determined by the execution device 310 according to the characteristics of the application scene, the characteristics of the operating scene and the preset conditions can further improve the accuracy of the license plate recognition under the premise of meeting the speed requirements of the license plate recognition A neural network to meet the accuracy requirements of license plate recognition.
- the execution device 310 may select the neural network 20 corresponding to the rainy day and the low remaining available power to be determined as the first neural network.
- using the neural network 20 smaller in scale than the neural network 19 to recognize the license plate can meet the speed requirement of the license plate recognition under the premise that the accuracy requirement can be ensured.
- the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the application scene and the characteristics of the running scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or uses the first neural network to process the application data under the premise of meeting the speed requirement
- the precision is as high as possible, balancing the precision requirements and speed requirements when processing application data, and improving user experience.
- the method flow described in FIG. 8 is an illustration of the specific operation process included in step 730 in FIG. 7 .
- Step 7301 the execution device 310 determines the parameters of the first neural network corresponding to the scene data including the scene awareness data in the preset conditions.
- the scene data is predetermined data for generating preset conditions.
- the scene awareness data is the data acquired by the executing device 310 in real time according to the application data.
- the execution device 310 if the execution device 310 inquires the application scene characteristics identified by the scene awareness data in the preset conditions (as explained in the first possible situation above), or if the execution device 310 inquires in the preset conditions The running scene feature identified by the scene-aware data (as described in the second possible situation above), or, if the execution device 310 inquires the application scene feature and the running scene feature identified by the scene-aware data in the preset condition (as described above Explanation of the third possible situation), the execution device 310 processes the application data according to the first neural network associated with the scene data, which balances the accuracy and speed of processing application data, meets user needs, and improves user experience.
- Step 7302 the execution device 310 determines the first neural network from the supernetwork according to the parameters of the first neural network.
- the preset condition may also include an identifier of the first neural network and parameters of the first neural network.
- the parameters of the first neural network include the number of channels and the number of network layers.
- the first neural network may be a sub-network in the super network, and the super network is used to determine the first neural network corresponding to the scene data.
- a channel can refer to the input result of a convolutional layer in a convolutional neural network, that is, a channel can also be called a feature map.
- the network layer may be a convolutional layer in a convolutional neural network.
- the execution device 310 may determine the first neural network from the supernetwork according to the parameters of the first neural network. Specifically, the execution device 310 determines the weight of the first neural network from the weights of the supernet according to the parameters of the first neural network. Since the subnetworks share the parameters of the supernetwork, storing multiple subnetworks relative to the execution device 310 effectively reduces the storage space of the execution device 310.
- step 740 the execution device 310 obtains a processing result of the application data by using the first neural network.
- the execution device 310 inputs the application data into the first neural network, and uses the first neural network to obtain a processing result of the application data.
- an application scenario is that a smart terminal uses a face recognition function to recognize a user's face to realize the function of unlocking the smart terminal.
- the application data is a face image
- the executing device 310 inputs the face image into the first neural network to obtain a processing result. If the processing result is that the face is recognized successfully, the smart terminal is successfully unlocked; if the processing result is that the face recognition fails, the smart terminal fails to be unlocked.
- the execution device 310 may further adjust the first neural network.
- the method flow shown in FIG. 9 is a supplementary description of the method shown in FIG. 7 .
- step 750 the execution device 310 displays the corresponding relationship between the scene data and the first neural network that affect the running speed and accuracy of the first neural network, and the processing results.
- Processing results can include runtime and accuracy.
- the running time may refer to the time from when the executing device 310 runs the first neural network to process the application data to when the processing result is obtained.
- the execution device 310 starts timing after inputting the application data into the first neural network, and ends timing until the first neural network outputs the processing result to obtain the running time.
- the precision of the processing result is used to indicate whether the processing result of using the first neural network to process the application data satisfies the accuracy requirement of the user.
- the execution device 310 may obtain the accuracy of the processing result through user feedback information.
- the execution device 310 displays the corresponding relationship between the scene data and the first neural network that affect the speed and accuracy of the first neural network, as well as the processing results, so that the user can intuitively see the processing results, so that the user can judge whether the running time meets the user's requirements. Speed requirements, and judging whether the accuracy of the processing results meets the user's accuracy requirements.
- the execution device 310 may also execute step 760 and step 770, or the execution device 310 may also execute step 780.
- step 760 the executing device 310 determines the second neural network from the hypernetwork.
- the second neural network may be a user-specified neural network, for example, the second neural network may be a subnetwork in the supernetwork.
- the rules for specifying the neural network by the user are as follows: if the user needs to improve the accuracy of processing application data by the execution device 310, the number of network layers included in the second neural network is greater than the number of network layers included in the first neural network, or the second neural network includes The number of channels is greater than the number of channels included in the first neural network.
- the number of network layers included in the second neural network is smaller than the number of network layers included in the first neural network, or, the first neural network includes The number of channels included in the second neural network is smaller than the number of channels included in the first neural network.
- step 770 the execution device 310 obtains the processing result of the application data by using the second neural network.
- Step 780 the execution device 310 adjusts the scene data corresponding to the first neural network.
- the execution device 310 uses the first neural network to process the application data, the accuracy of the processing results cannot meet the user's precision requirements, or the running time for the execution device 310 to use the first neural network to process the application data to obtain the processing results cannot meet the user's speed requirements. If there are many application scenario features and running scenario features associated with the first neural network, the executing device 310 may modify at least one of the application scenario features and running scenario features associated with the first neural network.
- the application scenario is to identify the flow of people during rush hours. Since there are a lot of people during rush hours, if the execution device 310 continues to use a small-scale neural network to identify the flow of people, the accuracy rate is low, and it cannot Meet the accuracy requirements of people flow recognition. Therefore, the execution device 310 divides the rush hour period into multiple periods according to the flow of people, and each period is associated with a neural network, so that the execution device 310 uses a different neural network for each period to identify the flow of people. For example, during a time period when the flow of people is large, the execution device 310 uses a small-scale neural network to identify the flow of people, which can meet the speed requirement for the recognition of the flow of people while ensuring the accuracy requirements. For another example, during a time period when the flow of people is small, the execution device 310 uses a large-scale neural network to identify the flow of people, which can meet the accuracy requirements of the recognition of the flow of people under the premise of ensuring the speed requirement.
- the application scenario is that the smart terminal uses the face recognition function to recognize the user's face to realize the function of unlocking the smart terminal.
- the user performs face recognition twice in a short period of time to unlock the smart terminal.
- the smart terminal continuously uses a large-scale neural network to recognize faces, although the accuracy rate is high and meets the accuracy requirements of face recognition, the running time of face recognition is long, which cannot meet the speed of face recognition by users. need. Therefore, the smart terminal can adjust the correspondence between the preset interval of face recognition and the neural network. If the smart terminal detects that the time interval between two face recognitions is within the preset interval, the smart terminal determines that the first neural network associated with the preset interval may be a smaller-scale neural network. The smart terminal uses a small-scale neural network to recognize faces, which can meet the speed requirements of face recognition under the premise of ensuring the accuracy requirements.
- FIG. 10 is a schematic diagram of an interface for adjusting scene data provided in an embodiment of the present application.
- the execution device 310 is a smart terminal
- the smart terminal displays a schematic diagram of a face recognition result.
- the smart terminal shows that there are two face recognitions within ten minutes, and the duration of the two face recognitions is 4 minutes.
- the smart terminal may also display a button 1010 of "whether to update”. If the user clicks the button 1010 of "whether to update”.
- the smart terminal can display an interface as shown in (b) in FIG. 10 .
- the smart terminal displays two face recognitions within two minutes, the first face recognition lasts for 4 minutes, the second face recognition lasts for 2 minutes, Whether to execute.
- the interface may display a "Yes” button 1020 and a "No” button 1030 . The user may click on the “Yes” button 1020 . If the smart terminal performs face recognition twice within two minutes, the time for the first face recognition is 4 minutes, and the time for the second face recognition is 2 minutes.
- application scenarios described in the embodiments of the present application may include target detection scenarios, monitoring scenarios, speech recognition scenarios, commodity recommendation scenarios, and so on.
- Computer vision is an integral part of various intelligent/autonomous systems in various application fields, such as manufacturing, inspection, document analysis, and medical diagnosis.
- the subject's data and information knowledge To put it figuratively, it is to install eyes (cameras/video cameras) and brains (algorithms) on computers to replace human eyes to identify and measure targets, so that computers can perceive the environment.
- perception can be thought of as extracting information from sensory signals
- computer vision can also be thought of as the science of how to make artificial systems "perceive" from images or multidimensional data.
- computer vision is to use various imaging systems to replace the visual organs to obtain input information, and then use the computer to replace the brain to complete the processing and interpretation of these input information.
- the ultimate research goal of computer vision is to enable computers to observe and understand the world through vision like humans, and have the ability to adapt to the environment autonomously.
- Object detection methods can be applied in scenarios such as face detection, vehicle detection, pedestrian counting, automatic driving, security systems, and medical fields.
- an autonomous vehicle recognizes objects in the surrounding environment during driving to adjust the speed and direction of the autonomous vehicle so that the autonomous vehicle can drive safely and avoid traffic accidents.
- Objects may be other vehicles, traffic control devices, or other types of objects.
- the security system a large number of users are identified to assist the staff to determine the target person as soon as possible.
- the input data (such as image or video) is input to the neural network with target detection function, the neural network performs feature extraction on the input data, and the target detection is performed based on the extracted features, and the detection result is obtained.
- the execution device 310 may have stored the hypernetwork and the preset conditions before executing step 730, that is, the execution device 310 determines the first neural network for processing application data according to the scene awareness data and the preset conditions. Therefore, the execution device 310 may The hypernetwork and preset conditions are read from the memory, and the first neural network for processing application data is determined according to the scene perception data and preset conditions.
- the execution device 310 does not store the hypernetwork and preset conditions, and needs to download the hypernetwork and preset conditions from the server.
- the server may refer to a cloud server.
- FIG. 11 is a schematic structural diagram of a system 1100 provided in the present application.
- the system 1100 may be an entity that provides cloud services to users by using basic resources.
- System 1100 includes cloud data center 1110 .
- the cloud data center 1110 includes a device resource pool (including computing resources 1111 , storage resources 1112 and network resources 1113 ) and a cloud service platform 1120 .
- the computing resource 1111 included in the cloud data center 1110 may be a computing device (such as a server).
- the interaction device 1210 may be deployed on the execution device 1200 .
- the interaction means 1210 may be a browser or an application capable of message interaction with the cloud service platform 1120 .
- the user can access the cloud service platform 1120 through the interaction device 1210 , upload a request to the cloud data center 1110 , and request to obtain the supernetwork 301 and the preset condition 302 .
- the cloud data center 1110 feeds back the supernetwork 301 and the preset condition 302 to the execution device 1200 .
- the execution device 1200 may be a smart terminal or an edge station.
- the edge station can process the application data of the self-driving car and transmit the processing results to the self-driving car. The processing results are used to instruct the autonomous vehicle to operate.
- the terminal includes hardware structures and/or software modules corresponding to each function.
- the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
- FIG. 12 is a schematic structural diagram of a possible data processing device provided by this embodiment.
- These data processing apparatuses can be used to implement the functions of the execution devices in the above method embodiments, and thus can also achieve the beneficial effects of the above method embodiments.
- the data processing apparatus may be the execution device 310 shown in FIG. 3 , or may be a module (such as a chip) applied to a server.
- the data processing device 1200 includes a communication module 1210 , a selection module 1220 , a detection module 1230 and a storage module 1240 .
- the data processing apparatus 1200 is configured to implement the functions of the executing device 310 in the method embodiment shown in FIG. 7 , FIG. 8 , or FIG. 9 .
- the communication module 1210 is used to obtain application data and scene perception data to be processed.
- the scene awareness data is used to instruct the execution device 310 to process the application data influencing factors.
- the scene perception data is used to indicate factors affecting speed and precision when the executing device 310 processes the application data.
- the scene perception data includes at least one of external influencing factors and internal influencing factors.
- the external influencing factors are used to describe the characteristics of the application scenario in which the terminal obtains the application data.
- the internal influencing factors are used to describe the running scenario characteristics of the hardware resources of the terminal running the application data.
- the external influencing factors include at least one of temperature data, humidity data, illumination data and time data.
- the internal influencing factors include at least one of computing capability of the processor, available storage capacity and available remaining power.
- the communication module 1210 is used to execute step 710 and step 720 in FIG. 7 , FIG. 8 and FIG. 9 .
- the selection module 1220 is configured to determine a first neural network for processing the application data according to the scene perception data and a preset condition, the preset condition being used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network. For example, the selection module 1220 is used to execute step 730 in FIG. 7 , FIG. 8 and FIG. 9 .
- the detection module 1230 is configured to use the first neural network to obtain the processing result of the application data. For example, the detection module 1230 is used to execute step 740 in FIG. 7 , FIG. 8 and FIG. 9 .
- the selection module 1220 determines the first neural network for processing the application data according to the scene awareness data and preset conditions, it is specifically used to: determine the first neural network corresponding to the scene data including the scene awareness data in the preset conditions.
- the parameters of the neural network the first neural network is determined from the super network according to the parameters of the first neural network.
- the parameters of the first neural network include the number of channels and the number of network layers.
- the first neural network is a subnetwork in the supernetwork, and the supernetwork is used to determine the first neural network corresponding to the scene data.
- the number of network layers included in the sub-network is less than the number of network layers included in the super-network, or, the number of channels included in the sub-network is smaller than the number of channels included in the super-network, each network layer Include at least one neuron.
- the storage module 1240 is configured to store preset conditions, parameters of the supernetwork and at least one subnetwork included in the supernetwork.
- the selection module 1220 determines the first neural network from the supernet according to the parameters of the first neural network, it is specifically used to: determine the first neural network from the weight of the supernet according to the parameters of the first neural network The weight of the network.
- the selection module 1220 is also configured to determine a second neural network from the supernetwork, the second neural network is a subnetwork in the supernetwork, and the number of network layers included in the second neural network is greater than or is less than the number of network layers included in the first neural network, or, the number of channels included in the second neural network is greater than or smaller than the number of channels included in the first neural network.
- the detection module 1230 is further configured to use the second neural network to obtain a processing result of the application data.
- the detection module 1230 is configured to execute step 770 in FIG. 9 .
- the data processing device 1200 also includes an update module 1250 and a display module 1260 .
- the update module 1250 is used to adjust the scene data corresponding to the first neural network if the speed and accuracy of the first neural network do not meet the user's requirements, obtain the adjusted scene data, and store the adjusted scene data in the storage module 1240.
- the update module 1250 is used to execute step 760 and step 780 in FIG. 9 .
- the display module 1260 is used to display the corresponding relationship between the scene data and the first neural network that affect the speed and accuracy of the first neural network, and the processing results. For example, the display module 1260 is used to execute step 750 in FIG. 9 .
- the data processing device 1200 in the embodiment of the present application can be realized by an ASIC, or a programmable logic device (programmable logic device, PLD), and the above-mentioned PLD can be a complex programmable logic device (complex programmable logical device, CPLD), Field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
- PLD programmable logic device
- CPLD complex programmable logic device
- FPGA Field-programmable gate array
- GAL general array logic
- the data processing device 1200 may correspond to execute the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of the various units in the data processing device 1200 are respectively in order to realize Fig. 7, Fig. 8 and For the sake of brevity, the corresponding flow of each method in FIG. 9 will not be repeated here.
- FIG. 13 is a schematic structural diagram of a terminal 1300 provided in this embodiment. As shown in the figure, the terminal 1300 includes a processor 1310 , a bus 1320 , a memory 1330 and a communication interface 1340 .
- the processor 1310 may be a CPU, and the processor 1310 may also be other general-purpose processors, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components Wait.
- a general purpose processor may be a microprocessor or any conventional processor or the like.
- the processor can also be a GPU, NPU, microprocessor, ASIC, or one or more integrated circuits used to control the program execution of the solution of this application.
- the communication interface 1340 is used to implement communication between the terminal 1300 and external devices or devices.
- the communication interface 1340 is used to receive application data and scene perception data to be processed.
- Bus 1320 may include a path for communicating information between the components described above (eg, processor 1310 and memory 1330).
- the bus 1320 may also include a power bus, a control bus, a status signal bus, and the like. However, for clarity of illustration, the various buses are labeled as bus 1320 in the figure.
- the terminal 1300 may include multiple processors.
- the processor can be a multi-core
- a processor herein may refer to one or more devices, circuits, and/or computing units for processing data (eg, computer program instructions).
- the processor 1310 may call the hypernetwork and the preset conditions stored in the memory 1330 to determine a first neural network for processing application data according to the scene perception data and the preset conditions, and use the first neural network to obtain the information of the application data. process result.
- the terminal 1300 includes only one processor 1310 and one memory 1330 as an example.
- the processor 1310 and the memory 1330 are respectively used to indicate a type of device or device.
- the quantity of each type of device or equipment can be determined according to business needs.
- the memory 1330 may correspond to a storage medium used to store information such as a hypernetwork and preset conditions in the above method embodiments, for example, a magnetic disk, such as a mechanical hard disk or a solid state hard disk.
- the aforementioned terminal 1300 may be a general-purpose device or a dedicated device.
- the terminal 1300 may be a mobile phone terminal, a tablet computer, a notebook computer, a VR device, an AR device, a mixed reality (Mixed Reality, MR) device or an extended reality (Extended Reality, ER) device, a vehicle terminal, etc., and may also be an edge device (e.g., a box carrying a chip with processing power), etc.
- terminal 1330 may also be a server or other devices with computing capabilities.
- the terminal 1300 may correspond to the data processing device 1200 in this embodiment, and may correspond to a corresponding subject performing any method in FIG. 7 , FIG. 8 and FIG. 9 , and the data processing device
- the above-mentioned and other operations and/or functions of each module in 1200 are respectively for realizing the corresponding flow of each method in FIG. 7 , FIG. 8 and FIG. 9 , and for the sake of brevity, details are not repeated here.
- the method steps in this embodiment may be implemented by means of hardware, and may also be implemented by means of a processor executing software instructions.
- Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or known in the art any other form of storage medium.
- An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
- the storage medium may also be a component of the processor.
- the processor and storage medium can be located in the ASIC.
- the ASIC can be located in a network device or a terminal device.
- the processor and the storage medium may also exist in the network device or the terminal device as discrete components.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
- the computer program product comprises one or more computer programs or instructions. When the computer program or instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are executed in whole or in part.
- the computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment, or other programmable devices.
- the computer program or instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be downloaded from a website, computer, A server or data center transmits to another website site, computer, server or data center by wired or wireless means.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrating one or more available media. Described usable medium can be magnetic medium, for example, floppy disk, hard disk, magnetic tape; It can also be optical medium, for example, digital video disc (digital video disc, DVD); It can also be semiconductor medium, for example, solid state drive (solid state drive) , SSD).
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Image Analysis (AREA)
Abstract
Description
本申请要求于2021年05月21日提交国家知识产权局、申请号为202110558861.1、申请名称为“数据处理方法、装置和终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110558861.1 and the application name "data processing method, device and terminal" submitted to the State Intellectual Property Office on May 21, 2021, the entire content of which is incorporated by reference in this application middle.
本申请涉及人工智能领域,尤其涉及一种数据处理方法、装置和终端。The present application relates to the field of artificial intelligence, and in particular to a data processing method, device and terminal.
人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。人工智能领域的研究包括机器学习(Machine Learning,ML)自然语言处理,计算机视觉,决策与推理,人机交互,推荐与搜索,AI基础理论等。其中,神经网络为一种机器学习的方法。Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Research in the field of artificial intelligence includes machine learning (Machine Learning, ML) natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, AI basic theory, etc. Among them, the neural network is a method of machine learning.
目前,终端(如:智能手机、自动驾驶汽车等)可以利用配置的神经网络对获取到的数据(如:图像、语音等)进行处理实现人脸识别、语音识别等应用功能。但是,终端通常基于一种神经网络处理不同场景下获取的数据,由于不同场景下的数据具有不同的特征,采样一种神经网络处理不同场景数据,无法确保数据处理的速度和精度的场景需求。因此,如何提供一种确保数据处理的速度和精度的场景需求的数据处理方法成为亟待解决的问题。At present, terminals (such as smart phones, self-driving cars, etc.) can use the configured neural network to process the acquired data (such as images, voice, etc.) to realize application functions such as face recognition and voice recognition. However, the terminal usually processes data obtained in different scenarios based on a neural network. Since the data in different scenarios has different characteristics, sampling a neural network to process data in different scenarios cannot ensure the speed and accuracy of data processing required by the scenario. Therefore, how to provide a data processing method that ensures the speed and accuracy of data processing required by the scene has become an urgent problem to be solved.
发明内容Contents of the invention
本申请提供了数据处理方法、装置和终端,由此来确保数据处理的速度和精度的场景需求。The present application provides a data processing method, device, and terminal, thereby ensuring the speed and accuracy of data processing to meet the scenario requirements.
第一方面,本申请提供了一种数据处理方法,该方法可以由终端执行,具体包括如下步骤:终端获取到待处理的应用数据和场景感知数据后,根据场景感知数据和预设条件确定处理应用数据的第一神经网络,利用第一神经网络得到应用数据的处理结果。场景感知数据用于指示终端处理应用数据的影响因素。预设条件用于指示影响神经网络运行的场景数据与神经网络的对应关系。In the first aspect, the present application provides a data processing method, which can be executed by a terminal, and specifically includes the following steps: after the terminal obtains the application data and scene perception data to be processed, it determines the processing according to the scene perception data and preset conditions The first neural network of the application data is used to obtain the processing result of the application data by using the first neural network. The scene awareness data is used to indicate factors influencing the terminal to process the application data. The preset condition is used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network.
如此,由于终端在选取处理应用数据的第一神经网络时考虑了影响处理应用数据的场景感知数据,依据场景感知数据和预设条件选取适于处理应用数据的第一神经网络,由此来确保数据处理的速度和精度的场景需求,提升用户体验。In this way, since the terminal considers the scene perception data that affects the processing of application data when selecting the first neural network for processing application data, and selects the first neural network suitable for processing application data according to the scene perception data and preset conditions, thereby ensuring The speed and accuracy of data processing meet the scene requirements and improve user experience.
其中,应用数据包括图像、语音和文字中至少一种形式的数据。终端可以通过传感器获取应用数据。传感器包括摄像头、音频传感器和激光雷达中至少一种。Wherein, the application data includes data in at least one form among image, voice and text. Terminals can obtain application data through sensors. The sensor includes at least one of a camera, an audio sensor, and a lidar.
可理解的,场景感知数据用于指示终端处理应用数据时影响速度和精度的因素。其中,场景感知数据包括外部影响因素和内部影响因素中的至少一个;外部影响因素用于描述终端获取应用数据的应用场景特征,内部影响因素用于描述终端运行应用数据的硬件资源的运行场景特征。示例地,外部影响因素包含温度数据、湿度数据、光 照数据和时间数据中至少一种。示例地,内部影响因素包含处理器的计算能力、可用存储容量和可用剩余电量中至少一种。Understandably, the scene awareness data is used to indicate factors affecting speed and precision when the terminal processes application data. Wherein, the scene perception data includes at least one of external influencing factors and internal influencing factors; the external influencing factors are used to describe the characteristics of the application scenario in which the terminal obtains the application data, and the internal influencing factors are used to describe the characteristics of the operating scenario of the hardware resources for the terminal to run the application data . Exemplarily, the external influencing factors include at least one of temperature data, humidity data, illumination data and time data. Exemplarily, the internal influencing factors include at least one of computing capability of the processor, available storage capacity and available remaining power.
由于终端是根据场景感知数据和预设条件选取适于处理应用数据的第一神经网络,则在确保速度需求的前提下,第一神经网络是满足精度需求的规模较大的网络;或者,在确保精度需求的前提下,第一神经网络是满足速度需求的规模较小网络。从而平衡了处理应用数据时的精度和速度,提升用户体验。Since the terminal selects the first neural network suitable for processing application data according to the scene perception data and preset conditions, under the premise of ensuring the speed requirement, the first neural network is a large-scale network that meets the accuracy requirement; or, in Under the premise of ensuring the accuracy requirement, the first neural network is a smaller-scale network that meets the speed requirement. In this way, the accuracy and speed of processing application data are balanced, and the user experience is improved.
在一种可能的实现方式中,根据场景感知数据和预设条件确定处理应用数据的第一神经网络,包括:终端确定预设条件中包括场景感知数据的场景数据对应的第一神经网络的参数,根据第一神经网络的参数从超网络中确定第一神经网络。其中,第一神经网络的参数包括通道的数量和网络层的数量。超网络用于确定场景数据对应的第一神经网络。第一神经网络为超网络中的子网络。子网络包含的网络层的数量小于超网络包括的网络层的数量,或者,子网络包含的通道的数量小于超网络包括的通道的数量,每层网络层包括至少一个神经元。In a possible implementation manner, determining the first neural network for processing the application data according to the scene awareness data and the preset conditions includes: the terminal determining the parameters of the first neural network corresponding to the scene data including the scene awareness data in the preset conditions , determining the first neural network from the supernetwork according to the parameters of the first neural network. Wherein, the parameters of the first neural network include the number of channels and the number of network layers. The super network is used to determine the first neural network corresponding to the scene data. The first neural network is a subnetwork in the supernetwork. The number of network layers included in the sub-network is smaller than the number of network layers included in the super-network, or the number of channels included in the sub-network is smaller than the number of channels included in the super-network, and each network layer includes at least one neuron.
在另一种可能的实现方式中,终端存储超网络和超网络包含的至少一个子网络的参数;则根据第一神经网络的参数从超网络中确定第一神经网络包括:根据第一神经网络的参数从超网络的权重中确定第一神经网络的权重。由于子网络共享了超网络的参数,相对于终端存储多个子网络,有效地降低了终端的存储空间。In another possible implementation manner, the terminal stores the parameters of the supernetwork and at least one subnetwork included in the supernetwork; determining the first neural network from the supernetwork according to the parameters of the first neural network includes: according to the first neural network The parameters of determine the weights of the first neural network from the weights of the supernetwork. Since the sub-networks share the parameters of the super-network, compared with storing multiple sub-networks in the terminal, the storage space of the terminal is effectively reduced.
在另一种可能的实现方式中,根据场景感知数据和预设条件确定处理应用数据的第一神经网络之后,方法还包括:终端从超网络中确定第二神经网络,利用第二神经网络得到应用数据的处理结果。第二神经网络为超网络中的子网络,第二神经网络包含的网络层的数量大于或小于第一神经网络包括的网络层的数量,或者,第二神经网络包含的通道的数量大于或小于第一神经网络包括的通道的数量。如果第一神经网络的处理结果不满足用户的速度需求和精度需求,终端还可以调整神经网络,使得终端利用第二神经网络得到应用数据的处理结果满足用户的速度需求和精度需求。In another possible implementation manner, after the first neural network for processing application data is determined according to the scene perception data and preset conditions, the method further includes: the terminal determines a second neural network from the super network, and uses the second neural network to obtain The result of processing the application data. The second neural network is a sub-network in the supernetwork, the number of network layers included in the second neural network is greater than or less than the number of network layers included in the first neural network, or the number of channels included in the second neural network is greater than or less than The number of channels included in the first neural network. If the processing result of the first neural network does not meet the speed and precision requirements of the user, the terminal may also adjust the neural network so that the processing result of the application data obtained by the terminal using the second neural network meets the speed and precision requirements of the user.
在另一种可能的实现方式中,方法还包括:若第一神经网络的速度和精度不满足用户需求,调整第一神经网络对应的场景数据,使得终端利用第一神经网络再次处理应用数据得到的处理结果满足用户的速度需求和精度需求。In another possible implementation, the method further includes: if the speed and accuracy of the first neural network do not meet user requirements, adjusting the scene data corresponding to the first neural network, so that the terminal uses the first neural network to process the application data again to obtain The processing results meet the user's speed and accuracy requirements.
可选地,方法还包括:终端还显示影响第一神经网络的速度和精度的场景数据与第一神经网络的对应关系,以及处理结果。使用户可以直观地看到处理结果,以便于用户判断运行时长是否满足用户的速度需求,以及判断处理结果的精度是否满足用户的精度需求。Optionally, the method further includes: the terminal also displays the correspondence between the scene data and the first neural network that affect the speed and accuracy of the first neural network, and the processing results. The user can see the processing result intuitively, so that the user can judge whether the running time meets the user's speed requirement, and whether the accuracy of the processing result meets the user's precision requirement.
第二方面,本申请提供了一种数据处理装置,所述装置包括用于执行第一方面或第一方面任一种可能设计中的数据处理方法的各个模块。In a second aspect, the present application provides a data processing device, the device including various modules for executing the data processing method in the first aspect or any possible design of the first aspect.
第三方面,本申请提供一种终端,该终端包括至少一个处理器和存储器,存储器用于存储一组计算机指令;当处理器作为第一方面或第一方面任一种可能实现方式中的执行设备执行所述一组计算机指令时,执行第一方面或第一方面任一种可能实现方式中的数据处理方法的操作步骤。In a third aspect, the present application provides a terminal, the terminal includes at least one processor and a memory, and the memory is used to store a set of computer instructions; When the device executes the set of computer instructions, it executes the first aspect or the operation steps of the data processing method in any possible implementation manner of the first aspect.
第四方面,本申请提供一种计算机可读存储介质,包括:计算机软件指令;当计算机软件指令在终端中运行时,使得终端执行如第一方面或第一方面任意一种可能的 实现方式中所述方法的操作步骤。In a fourth aspect, the present application provides a computer-readable storage medium, including: computer software instructions; when the computer software instructions are run in the terminal, the terminal is made to execute the first aspect or any one of the possible implementation manners of the first aspect. Operational steps of the method.
第五方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得终端执行如第一方面或第一方面任意一种可能的实现方式中所述方法的操作步骤。In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a computer, the terminal executes the operation steps of the method described in the first aspect or any possible implementation manner of the first aspect.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the foregoing aspects, the present application may further be combined to provide more implementation manners.
图1为本申请提供的一种神经网络的结构示意图;Fig. 1 is the structural representation of a kind of neural network provided by the present application;
图2为本申请提供的一种卷积神经网络的结构示意图;Fig. 2 is a schematic structural diagram of a convolutional neural network provided by the present application;
图3为本申请提供的一种数据处理系统的架构示意图;FIG. 3 is a schematic diagram of the architecture of a data processing system provided by the present application;
图4为本申请提供的一种生成预设条件方法的流程图;FIG. 4 is a flowchart of a method for generating preset conditions provided by the present application;
图5为本申请提供的一种超网络和子网络的结构示意图;FIG. 5 is a schematic structural diagram of a supernetwork and a subnetwork provided by the present application;
图6为本申请提供的一种帕累托边界的示意图;FIG. 6 is a schematic diagram of a Pareto boundary provided by the present application;
图7为本申请提供的一种数据处理方法的流程图;FIG. 7 is a flowchart of a data processing method provided by the present application;
图8为本申请提供的另一种数据处理方法的流程图;FIG. 8 is a flowchart of another data processing method provided by the present application;
图9为本申请提供的另一种数据处理方法的流程图;FIG. 9 is a flowchart of another data processing method provided by the present application;
图10为本申请提供的一种调整场景数据的界面示意图;FIG. 10 is a schematic diagram of an interface for adjusting scene data provided by the present application;
图11为本申请提供的一种系统的结构示意图;FIG. 11 is a schematic structural diagram of a system provided by the present application;
图12为本申请提供的一种数据处理装置的结构示意图;FIG. 12 is a schematic structural diagram of a data processing device provided by the present application;
图13为本申请提供的一种终端的结构示意图。FIG. 13 is a schematic structural diagram of a terminal provided by the present application.
为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。For ease of understanding, the following first introduces related terms and neural network related concepts involved in the embodiments of the present application.
(1)神经网络(1) neural network
神经网络可以是由神经元组成的,神经元可以是指以x s和截距1为输入的运算单元。该运算单元的输出满足如下公式(1)。 A neural network can be made up of neurons, which can refer to operational units that take x s and intercept 1 as input. The output of the arithmetic unit satisfies the following formula (1).
其中,s=1、2、……n,n为大于1的自然数,W s为x s的权重,b为神经元的偏置。f为神经元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层的输入,激活函数可以是sigmoid函数。神经网络是将多个上述单一的神经元联结在一起形成的网络,即一个神经元的输出可以是另一个神经元的输入。每个神经元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经元组成的区域。权重表征不同神经元之间连接的强度。权重决定着输入对输出的影响力。权重近于0意味着改变输入不改变输出。负权重意味着增加输入降低输出。 Among them, s=1, 2, ... n, n is a natural number greater than 1, W s is the weight of x s , and b is the bias of the neuron. f is the activation function of the neuron, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neuron into an output signal. The output signal of the activation function can be used as the input of the next layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple above-mentioned single neurons, that is, the output of one neuron can be the input of another neuron. The input of each neuron can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neurons. Weights characterize the strength of connections between different neurons. The weight determines the influence of the input on the output. A weight close to 0 means that changing the input does not change the output. Negative weights mean that increasing the input decreases the output.
如图1所示,为本申请实施例提供的一种神经网络的结构示意图。神经网络100包括N个处理层,N为大于或等于3的整数。神经网络100的第一层为输入层110,负责接收输入信号,神经网络100的最后一层为输出层130,负责输出神经网络的处 理结果。除去第一层和最后一层的其他层为中间层140,这些中间层140共同组成隐藏层120,隐藏层120中的每一层中间层140既可以接收输入信号,也可以输出信号。隐藏层120负责输入信号的处理过程。每一层代表了信号处理的一个逻辑级别,通过多个层,数据信号可经过多级逻辑的处理。As shown in FIG. 1 , it is a schematic structural diagram of a neural network provided in the embodiment of the present application. The
在一些可行的实施例中该神经网络的输入信号可以是视频信号、语音信号、文本信号、图像信号、温度信号等各种形式的信号。图像信号可以是相机(图像传感器)拍摄的风景信号、显监控设备捕捉的社区环境的图像信号以及门禁系统获取的人脸的面部信号等各类传感器信号。该神经网络的输入信号还包括其他各种计算机可处理的工程信号,在此不再一一列举。若利用神经网络对图像信号进行深度学习,可提高图像质量。In some feasible embodiments, the input signals of the neural network may be signals in various forms such as video signals, voice signals, text signals, image signals, and temperature signals. The image signal can be various sensor signals such as the landscape signal captured by the camera (image sensor), the image signal of the community environment captured by the display monitoring equipment, and the face signal obtained by the access control system. The input signals of the neural network also include various other computer-processable engineering signals, which will not be listed here. If the neural network is used to carry out deep learning on the image signal, the image quality can be improved.
(2)深度神经网络(2) Deep Neural Network
深度神经网络(Deep Neural Network,DNN)也称多层神经网络,可以理解为具有多层隐藏层的神经网络。按照不同层的位置对深度神经网络进行划分,深度神经网络内部的神经网络可以分为三类:输入层,隐藏层和输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐藏层。层与层之间是全连接的,也就是说,第i层的任意一个神经元与第i+1层的任意一个神经元相连。Deep Neural Network (DNN), also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers. The deep neural network is divided according to the position of different layers. The neural network inside the deep neural network can be divided into three categories: input layer, hidden layer and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the middle layers are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer is connected to any neuron in the i+1-th layer.
虽然深度神经网络看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
其中
是输入向量,
是输出向量,
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
经过如此简单的操作得到输出向量
由于深度神经网络的层数多,系数W和偏移向量
的数量也比较多。这些参数在深度神经网络中的定义如下所述:以系数W为例:假设在一个三层的深度神经网络中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
其中,上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。
Although the deep neural network looks complicated, it is actually not complicated in terms of the work of each layer. Simply put, it is the following linear relationship expression: in is the input vector, is the output vector, Is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just the input vector After such a simple operation to get the output vector Due to the large number of layers in the deep neural network, the coefficient W and the offset vector The number is also higher. The definition of these parameters in the deep neural network is as follows: Take the coefficient W as an example: Assume that in a three-layer deep neural network, the 4th neuron of the second layer to the 2nd neuron of the third layer The linear coefficients are defined as Among them, the superscript 3 represents the number of layers where the coefficient W is located, and the subscript corresponds to the index 2 of the third layer output and the
综上,第L-1层的第k个神经元到第L层的第j个神经元的系数定义为 In summary, the coefficient from the kth neuron of the L-1 layer to the jth neuron of the L layer is defined as
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐藏层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。It should be noted that the input layer has no W parameter. In deep neural networks, more hidden layers make the network more capable of describing complex situations in the real world. Theoretically speaking, a model with more parameters has a higher complexity and a greater "capacity", which means that it can complete more complex learning tasks. Training the deep neural network is also the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vector W of many layers).
(3)卷积神经网络(3) Convolutional neural network
卷积神经网络(Convolutional Neuron Network,CNN)是一种带有卷积结构的深度神经网络。卷积神经网络包含了一个由卷积层和子采样层构成的特征抽取器。该特征抽取器可以看作是滤波器,卷积过程可以看作是使用一个可训练的滤波器与一个输入的图像或者特征图(feature map)做卷积。卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。在卷积神经网络的卷积层中,一个神经元可以只与部分邻层神经元连接。一个卷积层可以输出若干个特征图,特征图可以是指卷积神经网络运算过程中的中间结果。同一特征图的神经元共享权重,这里共享的权重就是卷积核。共享 权重可以理解为提取图像信息的方式与位置无关。也就是,图像的某一部分的统计信息与其他部分是一样的。即意味着在某一部分学习的图像信息也能用在另一部分上。所以对于图像上的所有位置,都能使用同样的学习得到的图像信息。在同一卷积层中,可以使用多个卷积核来提取不同的图像信息,一般地,卷积核数量越多,卷积操作反映的图像信息越丰富。Convolutional Neuron Network (CNN) is a deep neural network with a convolutional structure. A convolutional neural network consists of a feature extractor consisting of a convolutional layer and a subsampling layer. The feature extractor can be seen as a filter, and the convolution process can be seen as using a trainable filter to convolve with an input image or feature map. The convolutional layer refers to the neuron layer that performs convolution processing on the input signal in the convolutional neural network. In the convolutional layer of a convolutional neural network, a neuron can only be connected to some adjacent neurons. A convolutional layer can output several feature maps, and the feature map can refer to the intermediate results during the operation of the convolutional neural network. Neurons in the same feature map share weights, and the shared weights here are convolution kernels. Shared weights can be understood as a way to extract image information that is independent of position. That is, the statistics for one part of the image are the same as for other parts. That means that the image information learned in one part can also be used in another part. So for all positions on the image, the same learned image information can be used. In the same convolution layer, multiple convolution kernels can be used to extract different image information. Generally, the more the number of convolution kernels, the richer the image information reflected by the convolution operation.
卷积核可以以随机大小的矩阵的形式初始化,在卷积神经网络的训练过程中卷积核可以通过学习得到合理的权重。另外,共享权重带来的直接好处是减少卷积神经网络各层之间的连接,同时又降低了过拟合的风险。The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
示例地,如图2所示,为本申请实施例提供的一种卷积神经网络的结构示意图。卷积神经网络200可以包括输入层210、卷积层/池化层220(其中池化层为可选的)和神经网络层230。For example, as shown in FIG. 2 , it is a schematic structural diagram of a convolutional neural network provided by the embodiment of the present application. The convolutional neural network 200 may include an input layer 210 , a convolutional/pooling layer 220 (where the pooling layer is optional) and a neural network layer 230 .
卷积层/池化层220例如可以包括层221至层226。在一种示例中,层221例如可以为卷积层,层222例如可以为池化层,层223例如可以为卷积层,层224例如可以为池化层,层225例如可以为卷积层,层226例如可以为池化层。在另一种示例中,层221和层222例如可以为卷积层,层223例如可以为池化层,层224和层225例如可以为卷积层,层226例如可以为池化层。卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。The convolutional layer/pooling layer 220 may include layers 221 to 226, for example. In one example, layer 221 may be a convolutional layer, layer 222 may be a pooling layer, layer 223 may be a convolutional layer, layer 224 may be a pooling layer, and layer 225 may be a convolutional layer, for example. , the layer 226 may be, for example, a pooling layer. In another example, layers 221 and 222 may be, for example, convolutional layers, layer 223 may be, for example, a pooling layer, layers 224 and 225 may be, for example, convolutional layers, and layer 226 may be, for example, a pooling layer. The output of a convolutional layer can be used as input to a subsequent pooling layer, or as input to another convolutional layer to continue the convolution operation.
将以卷积层221为例,介绍一层卷积层的内部工作原理。Taking the convolutional layer 221 as an example, the inner working principle of one convolutional layer will be introduced.
卷积层221可以包括很多个卷积算子,卷积算子也可称为核。卷积算子在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器。卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义。在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素,这取决于步长(stride)的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小与图像的大小相关。需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的。在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用多个尺寸(行×列)相同的权重矩阵,即多个同型矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵尺寸(行×列)相同,经过该多个尺寸相同的权重矩阵提取后的特征图的尺寸也相同,再将提取到的多个尺寸相同的特征图合并形成卷积运算的输出。The convolution layer 221 may include many convolution operators, and the convolution operators may also be called kernels. The role of the convolution operator in image processing is equivalent to a filter that extracts specific information from the input image matrix. The convolution operator can essentially be a weight matrix, which is usually predefined. During the convolution operation on the image, the weight matrix is usually one pixel by one pixel (or two pixels by two pixels, depending on the value of the stride) along the horizontal direction on the input image. processing to complete the work of extracting specific features from the image. The size of this weight matrix is related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image. During the convolution operation, the weight matrix is extended to the full depth of the input image. Therefore, convolution with a single weight matrix will produce a convolutional output with a single depth dimension, but in most cases instead of using a single weight matrix, multiple weight matrices of the same size (row×column) are applied, That is, multiple matrices of the same shape. The output of each weight matrix is stacked to form the depth dimension of the convolved image. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to filter unwanted noise in the image. Do blurring etc. The multiple weight matrices have the same size (row×column), and the feature maps extracted by the multiple weight matrices of the same size are also of the same size, and then the extracted multiple feature maps of the same size are combined to form the convolution operation. output.
这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入图像中提取信息,从而使得卷积神经网络200进行正确的预测。The 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 be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions .
当卷积神经网络200有多个卷积层的时候,初始的卷积层(例如层221)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征。随着卷积神经网络200深度的加深,越往后的卷积层(例如层226)提取到的特征越来越复杂,比如高级别 的语义之类的特征,语义越高的特征越适用于待解决的问题。When the convolutional neural network 200 has multiple convolutional layers, the initial convolutional layer (such as layer 221 ) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 deepens, the features extracted by the later convolutional layers (for example, layer 226) become more and more complex, such as high-level semantic features, and the higher the semantic features, the more suitable for unresolved issues.
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层。在如图2中卷积层/池化层220所示例的层221至层226各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像尺寸相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce pooling layers after convolutional layers. Each layer from layer 221 to layer 226 as shown in the convolutional layer/pooling layer 220 in Figure 2 can be a layer of convolutional layer followed by a layer of pooling layer, or a multi-layer convolutional layer followed by a layer or multiple pooling layers. In image processing, the sole purpose of pooling layers is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling an input image to obtain an image of a smaller size. The average pooling operator can calculate the pixel values in the image within a specific range to generate an average value as the result of average pooling. The maximum pooling operator can take the pixel with the largest value within a specific range as the result of maximum pooling. Also, just like the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image. The size of the image output after being processed by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
在经过卷积层/池化层220的处理后,卷积神经网络200还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层220提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或其他相关信息),卷积神经网络200需要利用神经网络层230来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层230中可以包括多层隐藏层(如图2所示的层231、层232至层23n)以及输出层240,该多层隐藏层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。After being processed by the convolutional layer/pooling layer 220, the convolutional neural network 200 is not enough to output the required output information. Because as mentioned earlier, the convolutional layer/pooling layer 220 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 relevant information), the convolutional neural network 200 needs to use the neural network layer 230 to generate one or a group of outputs with the required number of classes. Therefore, the neural network layer 230 may include a multi-layer hidden layer (layer 231, layer 232 to layer 23n as shown in FIG. 2 ) and an output layer 240, and the parameters contained in the multi-layer hidden layer may be determined according to specific tasks. Types of related training data are pre-trained, for example, the task type can include image recognition, image classification, image super-resolution reconstruction, and so on.
在神经网络层230中的多层隐藏层之后,也就是整个卷积神经网络200的最后层为输出层240,该输出层240具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络200的前向传播(如图2由层210至层240方向的传播为前向传播)完成,反向传播(如图2由层240至层210方向的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络200的损失,及卷积神经网络200通过输出层输出的结果和理想结果之间的误差。After the multi-layer hidden layer in the neural network layer 230, that is, the last layer of the entire convolutional neural network 200 is the output layer 240, which has a loss function similar to the classification cross entropy, and is specifically used to calculate the prediction error. Once The forward propagation of the entire convolutional neural network 200 (as shown in Figure 2 is forward propagation from layer 210 to layer 240 direction) is completed, and the reverse propagation (as shown in Figure 2 is backward propagation from layer 240 to layer 210 direction) ) will begin to update the weight values and deviations of the above-mentioned layers, so as to reduce the loss of the convolutional neural network 200, and the error between the output result of the convolutional neural network 200 through the output layer and the ideal result.
需要说明的是,如图2所示的卷积神经网络200仅作为一种卷积神经网络的示例,在具体的应用中,卷积神经网络还可以以其他网络模型的形式存在。It should be noted that the convolutional neural network 200 shown in FIG. 2 is only an example of a convolutional neural network, and in specific applications, the convolutional neural network may also exist in the form of other network models.
(4)损失函数(4) Loss function
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。In the process of training the deep neural network, because it is hoped that the output of the deep neural network is as close as possible to the value that is really wanted to be predicted, it is possible to compare the predicted value of the network with the target value that is really wanted, and then based on the relationship between the two Different situations to update the weight vector of each layer of neural network (of course, there is usually an initialization process before the first update, which is to pre-configure parameters for each layer in the deep neural network), for example, if the network's prediction value is high , just adjust the weight vector to make it predict lower, and keep adjusting until the deep neural network can predict the real desired target value or a value very close to the real desired target value. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function (loss function) or objective function (objective function), which is used to measure the difference between the predicted value and the target value important equation. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference. Then the training of the deep neural network becomes a process of reducing the loss as much as possible.
(5)反向传播算法(5) Back propagation algorithm
卷积神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的超分辨率模型中参数的大小,使得超分辨率模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。The convolutional neural network can use the error back propagation (back propagation, BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, passing the input signal forward until the output will generate an error loss, and updating the parameters in the initial super-resolution model by backpropagating the error loss information, so that the error loss converges. The backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
下面将结合附图对本申请实施例的实施方式进行详细描述。The implementation of the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
图3为本申请实施例提供的一种数据处理系统的架构示意图。如图3所示,系统300包括执行设备310、训练设备320、数据库330、终端设备340、数据存储系统350和数据采集设备360。FIG. 3 is a schematic structural diagram of a data processing system provided by an embodiment of the present application. As shown in FIG. 3 , the
执行设备310可以是终端,如手机终端,平板电脑,笔记本电脑,虚拟现实(virtual reality,VR)/增强现实(augmented reality,AR)设备,车载终端等,还可以是边缘设备(例如,携带具有处理能力芯片的盒子)等。The execution device 310 may be a terminal, such as a mobile phone terminal, a tablet computer, a notebook computer, a virtual reality (virtual reality, VR)/augmented reality (augmented reality, AR) device, a vehicle terminal, etc., and may also be an edge device (for example, carrying a processing power chip box), etc.
训练设备320可以是服务器或者云端设备等。训练设备320具备较强的计算能力,能够运行神经网络,对神经网络进行训练等计算。The training device 320 may be a server or a cloud device or the like. The training device 320 has strong computing power, and can run neural networks, perform calculations such as training neural networks.
作为一种可能的实施例,执行设备310和训练设备320是部署在不同物理设备(如:服务器或集群中的服务器)上的不同处理器。例如,执行设备310可以是中央处理器(central processing unit,CPU)、其他通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。训练设备320可以是图形处理器(graphics processing unit,GPU)、神经网络处理器(neural network processing unit,NPU)、微处理器、特定应用集成电路(application-specific integrated circuit,ASIC)、或一个或多个用于控制本申请方案程序执行的集成电路。As a possible embodiment, the executing device 310 and the training device 320 are different processors deployed on different physical devices (such as servers or servers in a cluster). For example, the execution device 310 may be a central processing unit (central processing unit, CPU), other general-purpose processors, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), on-site Programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. The training device 320 may be a graphics processing unit (graphics processing unit, GPU), a neural network processor (neural network processing unit, NPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or A plurality of integrated circuits used to control the program execution of the program of this application.
数据采集设备360用于采集训练数据和测试数据,并将训练数据和测试数据存入数据库330。训练数据和测试数据均可以是图像、语音和文字中至少一种形式的数据。例如,训练数据包括训练图像和训练图像中的目标。测试数据包括测试图像和测试图像中的目标。训练图像的特征和测试图像的特征均是与同一应用场景特征相似的特征。应用场景特征至少包括环境特征(如:温度、湿度、光照等)和时间特征(如:白天时段、黑夜时段、交通高峰时段、交通低峰时段等),等等。The data collection device 360 is used to collect training data and test data, and store the training data and test data into the database 330 . Both the training data and the testing data may be data in at least one form among image, voice and text. For example, training data includes training images and objects in the training images. The test data includes test images and objects in the test images. Both the features of the training image and the features of the test image are features similar to the features of the same application scene. Application scene characteristics include at least environmental characteristics (such as: temperature, humidity, light, etc.) and time characteristics (such as: day time, night time, traffic peak hours, traffic low peak hours, etc.), and so on.
训练设备320用于实现基于数据库330中维护的训练数据和测试数据从超网络301(super net)中搜索N个子网络(sub network),以及,生成预设条件302的功能。预设条件302用于指示影响神经网络运行的场景数据与神经网络的对应关系。其中,所述神经网络是指从超网络中搜索到的子网络。N为大于或等于2的整数。The training device 320 is used to realize the function of searching N subnetworks (subnetwork) from the supernetwork 301 (supernet) based on the training data and test data maintained in the database 330, and generating the
示例地,如图4所示,关于生成预设条件的具体过程的阐述。Exemplarily, as shown in FIG. 4 , the specific process for generating preset conditions is explained.
步骤410、训练设备320基于数据库330中维护的训练数据训练超网络和超网络中采样的M个子网络。Step 410 , the training device 320 trains the supernetwork and the M subnetworks sampled in the supernetwork based on the training data maintained in the database 330 .
训练设备320可以根据预设规则从超网络中采样M个子网络。预设规则例如是从 超网络的第一个网络层的第一个神经元开始选取不同规模大小的M个子网络。可选地,训练设备320从超网络中随机采样M个子网络。M为大于等于2的整数。The training device 320 may sample M sub-networks from the super-network according to preset rules. The default rule is, for example, to select M sub-networks of different sizes from the first neuron of the first network layer of the supernetwork. Optionally, the training device 320 randomly samples M sub-networks from the super-network. M is an integer greater than or equal to 2.
训练设备320利用训练数据对超网络进行训练,直到超网络中的损失函数收敛,且损失函数值小于特定阈值则超网络训练完成,从而使得超网络达到一定精度。或者,训练集中所有的训练数据被用于训练,则超网络训练完成。The training device 320 uses the training data to train the super-network until the loss function in the super-network converges, and the super-network training is completed if the loss function value is less than a specific threshold, so that the super-network can reach a certain accuracy. Alternatively, all the training data in the training set is used for training, and the supernetwork training is completed.
训练设备320利用训练数据对子网络进行训练,直到子网络中的损失函数收敛,且损失函数值小于特定阈值则子网络训练完成,从而使得子网络达到一定精度。或者,训练集中所有的训练数据被用于训练,则子网络训练完成。The training device 320 uses the training data to train the sub-network until the loss function in the sub-network converges, and the training of the sub-network is completed if the value of the loss function is less than a specific threshold, so that the sub-network can reach a certain accuracy. Alternatively, all the training data in the training set is used for training, and the sub-network training is completed.
可理解的,超网络可以作为子网搜索的基础网络。超网络是一个包括超多网络层,每层网络层包含大量神经元的超大神经网络。示例地,图5中的(a)示例了一种超网络的结构。子网络是超网络中的部分网络。子网络是一个小型的神经网络。如图5中的(b)所示,子网络包含了三层网络层,子网络包含的网络层的数量小于图5中的(a)所示的超网络包括的网络层的数量。超网络和子网络中的每层网络层包括至少一个神经元。图5中的(c)所示,子网络包含的神经元的数量小于图5中的(a)所示的超网络包括的神经元的数量。子网络包含的通道的数量也可以小于图5中的(a)所示的超网络包括的通道的数量。子网络的权重共享超网络的权重。例如,子网络包括超网络中的第一网络层和第二网络层,且第一网络层中的第一神经元与第二网络层中的第一神经元连接。第一网络层中的第一神经元与第二网络层中的第一神经元连接的权重复用超网络中第一网络层中的第一神经元与第二网络层中的第一神经元连接的权重。本实施例中所述的神经网络可以是深度神经网络。具体地,神经网络可以是卷积神经网络。Understandably, the supernetwork can be used as the basic network for subnetwork search. A hypernetwork is a very large neural network that includes a large number of network layers, and each network layer contains a large number of neurons. Exemplarily, (a) in FIG. 5 illustrates a structure of a hypernetwork. A subnetwork is a partial network within a supernetwork. A subnet is a small neural network. As shown in (b) in FIG. 5 , the subnetwork includes three network layers, and the number of network layers included in the subnetwork is smaller than the number of network layers included in the supernetwork shown in (a) in FIG. 5 . Each network layer in the supernetwork and subnetwork includes at least one neuron. As shown in (c) in FIG. 5 , the number of neurons included in the sub-network is smaller than the number of neurons included in the super-network shown in (a) in FIG. 5 . The number of channels included in the sub-network may also be smaller than the number of channels included in the super-network shown in (a) in FIG. 5 . The weights of the subnetworks share the weights of the supernetwork. For example, the sub-network includes a first network layer and a second network layer in the supernetwork, and a first neuron in the first network layer is connected to a first neuron in the second network layer. The weight of the connection between the first neuron in the first network layer and the first neuron in the second network layer reuses the first neuron in the first network layer and the first neuron in the second network layer in the super network The weight of the connection. The neural network described in this embodiment may be a deep neural network. Specifically, the neural network may be a convolutional neural network.
需要说明的是,训练设备320可以对超网络和子网络进行多轮次的训练。例如,训练设备320在每个轮次可以重新从超网络中随机采样子网络,对超网络和随机采样的子网络进行训练。训练设备320执行完所有轮次后,即随机采样了M个子网络,并对M个子网络完成训练。训练设备320在每个轮次可以随机采样不同数量的子网络;或者,训练设备320在每个轮次可以随机采样不同网络大小的子网络。It should be noted that the training device 320 can perform multiple rounds of training on the supernetwork and the subnetwork. For example, the training device 320 may re-sample a sub-network randomly from the super-network in each round, and train the super-network and the randomly-sampled sub-network. After executing all the rounds, the training device 320 randomly samples M sub-networks and completes the training on the M sub-networks. The training device 320 may randomly sample different numbers of sub-networks in each round; or, the training device 320 may randomly sample sub-networks of different network sizes in each round.
在训练设备320完成对超网络和超网络中的子网络的训练后,可以从超网络中搜索子网络,例如,训练设备320还可以执行步骤420至步骤460获得多个子网。After the training device 320 completes the training of the supernetwork and the subnetworks in the supernetwork, it can search the subnetworks from the supernetwork, for example, the training device 320 can also execute steps 420 to 460 to obtain multiple subnetworks.
步骤420、训练设备320从超网络中搜索Q个子网络。Step 420, the training device 320 searches for Q sub-networks from the super-network.
步骤430、训练设备320基于数据库330中维护的测试数据测试Q个子网络的精度。Step 430 , the training device 320 tests the accuracy of the Q sub-networks based on the test data maintained in the database 330 .
用于测试子网络的精度的测试数据包括大量的图像。对于Q个子网络中的每个子网络,训练设备320将大量的图像输入子网络,以得到预测结果。将预测结果与原始图像进行对比,得到子网络的精度。The test data used to test the accuracy of the subnet includes a large number of images. For each of the Q sub-networks, the training device 320 inputs a large number of images into the sub-network to obtain prediction results. Comparing the predicted result with the original image, the accuracy of the sub-network is obtained.
由于训练设备320具备较强的计算能力,能够快速地运行神经网络,从而有效地降低了对神经网络进行训练和测试的时长。Since the training device 320 has strong computing power, it can run the neural network quickly, thereby effectively reducing the time for training and testing the neural network.
步骤440、执行设备310基于数据库330中维护的测试数据测试Q个子网络的运行时长。Step 440 , the execution device 310 tests the running durations of the Q sub-networks based on the test data maintained in the database 330 .
由于执行设备310的计算能力小于训练设备320的计算能力,测试执行设备310运行子网络时的运行时长所使用的测试数据的数据量远远小于测试训练设备320运行 子网络时的精度所使用的测试数据的数据量。例如,测试执行设备310运行子网络的运行时长的测试数据可以是一张图像。Since the computing power of the execution device 310 is less than that of the training device 320, the amount of test data used by the test execution device 310 for running the subnet is much smaller than the test data used by the training device 320 for the accuracy of the subnetwork. The data volume of the test data. For example, the test execution device 310 may run the test data with a long running time of the subnetwork as an image.
对于Q个子网络中的每个子网络,执行设备310将测试数据输入子网络,以得到预测结果和子网络的运行时长。子网络的运行时长可以是指从执行设备310运行子网络处理测试数据开始至得到测试结果的时长。可理解的,子网络的运行时长越长,表示数据处理的速度越慢;子网络的运行时长越短,表示数据处理的速度越快。For each of the Q sub-networks, the executing device 310 inputs test data into the sub-network to obtain a prediction result and a running time of the sub-network. The running time of the subnetwork may refer to the time period from when the executing device 310 runs the subnetwork to process test data to when the test result is obtained. Understandably, the longer the running time of the sub-network, the slower the data processing speed; the shorter the running time of the sub-network, the faster the data processing speed.
需要说明的是,由于不同型号的执行设备配置了不同的硬件资源(如:处理器、存储器和电池),则配置不同硬件资源的执行设备运行神经网络的速度也是不一样的。因此,在配置不同硬件资源的执行设备上分别测试Q个子网络的速度,以便于训练设备320为配置有不同硬件资源的执行设备选取运行尽可能快的神经网络。It should be noted that since different types of execution devices are configured with different hardware resources (such as processors, memories, and batteries), the speeds at which the execution devices are configured with different hardware resources to run the neural network are also different. Therefore, the speeds of the Q sub-networks are respectively tested on execution devices configured with different hardware resources, so that the training device 320 can select a neural network that runs as fast as possible for the execution devices configured with different hardware resources.
步骤450、执行设备310向训练设备320传输Q个子网络的运行时长。Step 450 , the executing device 310 transmits the running durations of the Q sub-networks to the training device 320 .
需要说明的是,由于训练设备320依据上述步骤410已经对超网络和随机采样的大量子网络进行了训练,因此,训练设备320从超网络中搜索的Q个子网络是具有一定精度的子网络,训练设备320执行步骤460。Q个子网络可以是训练设备320依据上述步骤410训练得到的M个子网络中的部分子网络。或者,Q个子网络可以是训练设备320随机采样的子网络。It should be noted that since the training device 320 has trained the supernetwork and a large number of randomly sampled subnetworks according to the above step 410, the Q subnetworks searched by the training device 320 from the supernetwork are subnetworks with certain precision. The training device 320 performs step 460 . The Q sub-networks may be part of the M sub-networks trained by the training device 320 according to the above step 410 . Alternatively, the Q sub-networks may be sub-networks randomly sampled by the training device 320 .
可选地,训练设备320可以首次从超网络中随机搜索Q个子网络,根据Q个子网络的精度和Q个子网络的运行时长更新Q个子网络,循环执行步骤430至步骤450,经过多轮次迭代更新Q个子网络后,得到精度较高的Q个子网络,训练设备320执行步骤460。Optionally, the training device 320 can randomly search for Q sub-networks from the supernetwork for the first time, update the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks, and perform steps 430 to 450 in a loop, after multiple rounds of iterations After updating the Q sub-networks to obtain Q sub-networks with high accuracy, the training device 320 executes step 460 .
步骤460、训练设备320根据Q个子网络的精度和Q个子网络的运行时长,从Q个子网络中搜索N个子网络。Step 460, the training device 320 searches for N sub-networks from the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks.
在一种示例中,训练设备320可以依据进化算法、强化学习或者贪心算法从Q个子网络中搜索N个子网络。Q和N均为大于或等于2的整数,Q大于N。In an example, the training device 320 may search for N sub-networks from the Q sub-networks according to evolutionary algorithm, reinforcement learning or greedy algorithm. Both Q and N are integers greater than or equal to 2, and Q is greater than N.
在另一种示例中,训练设备320还可以对Q个子网络的精度和Q个子网络的运行时长进行统计,生成如图6所示的帕累托边界。横轴表示错误率,纵轴表示网络大小。网络大小也可以称为神经网络的规模。神经网络的规模越大,神经网络的精度越高,错误率越低,运行时长越长;反之,神经网络的规模越小,神经网络的精度越低,错误率越高,运行时长越短。因此,神经网络的精度和速度是成反比的。In another example, the training device 320 may also perform statistics on the accuracies of the Q sub-networks and the running time of the Q sub-networks to generate a Pareto boundary as shown in FIG. 6 . The horizontal axis represents the error rate, and the vertical axis represents the network size. The network size can also be referred to as the scale of the neural network. The larger the size of the neural network, the higher the accuracy of the neural network, the lower the error rate, and the longer the running time; conversely, the smaller the size of the neural network, the lower the accuracy of the neural network, the higher the error rate, and the shorter the running time. Therefore, the accuracy and speed of neural networks are inversely proportional.
从神经网络的精度的角度而言,帕累托边界上的每个点表示一个精度下的速度最快的神经网络。从神经网络的速度的角度而言,帕累托边界上的每个点表示一个速度下的精度最高的神经网络。From the perspective of the accuracy of the neural network, each point on the Pareto frontier represents the fastest neural network at an accuracy. From the perspective of the speed of the neural network, each point on the Pareto frontier represents the most accurate neural network at a speed.
训练设备320可以依据帕累托边界权衡神经网络的精度和速度从Q个子网络中选取N个子网络,训练设备320为不同硬件资源配置的执行设备选取满足精度需求和速度需求的神经网络。The training device 320 can select N sub-networks from the Q sub-networks according to the accuracy and speed of the Pareto boundary trade-off neural network, and the training device 320 selects a neural network that meets the accuracy requirements and speed requirements for execution devices with different hardware resource configurations.
在另一种示例中,训练设备320还可以依据进化算法、强化学习或者贪心算法从超网络中搜索Q个子网络,训练设备320根据Q个子网络的精度和Q个子网络的运行时长生成如图6所示的帕累托边界,训练设备320可以依据帕累托边界权衡神经网络的精度和速度从Q个子网络中选取N个子网络。In another example, the training device 320 can also search Q sub-networks from the super network according to the evolutionary algorithm, reinforcement learning or greedy algorithm, and the training device 320 generates the Q sub-networks according to the accuracy of the Q sub-networks and the running time of the Q sub-networks as shown in Figure 6. As shown in the Pareto boundary, the training device 320 may select N sub-networks from the Q sub-networks according to the Pareto boundary to balance the accuracy and speed of the neural network.
在另一种示例中,训练设备320还可以依据进化算法、强化学习或者贪心算法从超网络中搜索N个子网络。In another example, the training device 320 may also search for N sub-networks from the super-network according to evolutionary algorithm, reinforcement learning or greedy algorithm.
可选地,训练设备320还可以利用训练数据对N个子网络进行训练,调整N个子网络权重,提高N个子网络的精度。Optionally, the training device 320 can also use the training data to train the N sub-networks, adjust the weights of the N sub-networks, and improve the accuracy of the N sub-networks.
步骤470、训练设备320根据N个子网络,以及与N个子网络中每个子网络关联的场景数据生成预设条件。In step 470, the training device 320 generates preset conditions according to the N sub-networks and scene data associated with each of the N sub-networks.
由于一个神经网络处理的应用数据可以是在不同应用场景下获取的,不同应用场景具有不同的应用场景特征,则导致神经网络处理不同应用场景下的应用数据的精度不同。Since the application data processed by a neural network may be obtained in different application scenarios, and different application scenarios have different characteristics of the application scenarios, the accuracy of processing the application data in different application scenarios by the neural network is different.
例如,对于自动驾驶场景,自动驾驶汽车在天空晴朗的环境下通过道闸时,由于天空晴朗,车牌图像足够清晰,执行设备利用规模较小的神经网络对车牌进行识别的准确率较高,可以满足车牌识别的精度需求。应用场景特征包括光线充足和晴天。又如,自动驾驶汽车在大雨天的环境下通过道闸时,由于雨天视线不清楚,车牌图像可能较模糊,执行设备利用规模较小的神经网络对车牌进行识别的准确率较低,无法满足车牌识别的精度需求。应用场景特征包括光线不足和雨天。For example, in an autonomous driving scenario, when an autonomous vehicle passes through a barrier in a clear sky, the image of the license plate is clear enough, and the execution device uses a small-scale neural network to recognize the license plate with high accuracy, which can Meet the accuracy requirements of license plate recognition. Application scene characteristics include sufficient light and sunny weather. As another example, when a self-driving car passes through a barrier gate in a heavy rainy day, the license plate image may be blurred due to the unclear line of sight in the rainy day. Accuracy requirements for license plate recognition. Application scene characteristics include low light and rainy weather.
又如,对于闸机口场景,上下班高峰期人流量比较大,执行设备利用规模较大的神经网络对人流进行识别的速度较慢,无法满足人流识别的速度需求。应用场景特征可以包括上下班高峰期时段和人流量。As another example, for the gate gate scene, the flow of people is relatively large during the rush hour, and the execution equipment uses a large-scale neural network to identify the flow of people at a slow speed, which cannot meet the speed requirements for flow recognition. Application scenario characteristics can include rush hour hours and human traffic.
因此,训练设备320可以根据大量的应用场景特征和N个子网络生成预设条件。预设条件可以包括大量的应用场景特征与N个子网络的关联关系。例如,应用场景特征包括晴天、阴天和雨天。预设条件包括晴天与第一子网络的关联关系,阴天与第二子网络的关联关系,雨天与第三子网络的关联关系。第一子网络的规模小于第二子网络的规模。第二子网络的规模小于第三子网络的规模。Therefore, the training device 320 can generate preset conditions according to a large number of application scene features and N sub-networks. The preset conditions may include the association relationship between a large number of application scene features and the N sub-networks. For example, the application scene features include sunny days, cloudy days, and rainy days. The preset conditions include an association relationship between sunny days and the first subnetwork, an association relationship between cloudy days and the second subnetwork, and an association relationship between rainy days and the third subnetwork. The size of the first sub-network is smaller than the size of the second sub-network. The size of the second sub-network is smaller than the size of the third sub-network.
应用场景特征可以是训练设备320分析测试数据和训练数据获得的。或者,数据库330中维护有采集测试数据的应用场景下的应用场景特征和采集训练数据的应用场景下的应用场景特征。The application scene features may be obtained by the training device 320 by analyzing test data and training data. Alternatively, the database 330 maintains the characteristics of the application scenario under the application scenario where the test data is collected and the characteristics of the application scenario under the application scenario where the training data is collected.
另外,由于执行设备的硬件资源是动态变化的,执行设备在不同硬件资源下,运行神经网络的时长也可能不同。例如,以手机为例,不同用户使用同一品牌手机,由于不同用户的使用习惯不同,则可用存储容量和可用剩余电量是不同的。即使是同一部手机,在不同的时段手机运行的应用、可用存储容量和可用剩余电量也是不一样的。手机在低电量的情况下,运行神经网络的时长可能较长,因此,手机在低电量的情况下,可以选取规模较小的神经网络来处理应用数据。In addition, since the hardware resources of the execution device change dynamically, the execution time of the neural network may also be different under different hardware resources of the execution device. For example, taking a mobile phone as an example, when different users use the same brand of mobile phone, the available storage capacity and the available remaining power are different due to the different usage habits of different users. Even for the same mobile phone, the applications, available storage capacity, and available remaining power of the mobile phone are different at different time periods. When the mobile phone has a low battery, it may take a long time to run the neural network. Therefore, when the mobile phone has a low battery, a smaller neural network can be selected to process application data.
因此,训练设备320还可以接收执行设备310发送的测试N个子网络时的硬件资源的运行场景特征。训练设备320根据大量的应用场景特征、运行场景特征和N个子网络生成预设条件。Therefore, the training device 320 may also receive the running scenario characteristics of the hardware resources when testing the N subnetworks sent by the execution device 310 . The training device 320 generates preset conditions according to a large number of application scene features, running scene features and N sub-networks.
运行场景特征可以包括处理器的计算能力、可用存储容量和可用剩余电量中至少一种。处理器的计算能力也可以理解为处理器的计算资源的占用率。例如,运行场景特征包括低电量、中电量和高电量。预设条件包括低电量与第四子网络的关联关系,中电量与第五子网络的关联关系,高电量与第六子网络的关联关系。第四子网络的规 模小于第五子网络的规模。第五子网络的规模小于第六子网络的规模。The running scenario feature may include at least one of computing capability of the processor, available storage capacity, and available remaining power. The computing capability of the processor can also be understood as the occupancy rate of computing resources of the processor. For example, operating scene characteristics include low battery, medium battery, and high battery. The preset conditions include the association relationship between the low battery level and the fourth subnetwork, the association relationship between the medium battery level and the fifth subnetwork, and the association relationship between the high battery level and the sixth subnetwork. The size of the fourth sub-network is smaller than the size of the fifth sub-network. The size of the fifth sub-network is smaller than the size of the sixth sub-network.
训练设备320根据上述步骤410至步骤470生成预先条件302后,可以将超网络301和预设条件302配置到执行设备310。After the training device 320 generates the
执行设备310用于实现根据场景感知数据和预设条件302从超网络301中确定处理应用数据的第一神经网络的功能。The execution device 310 is configured to realize the function of determining the first neural network for processing application data from the hypernetwork 301 according to the scene awareness data and the
由于执行设备310是根据场景感知数据和预设条件302从超网络301中选取适于处理应用数据的第一神经网络,则在确保速度需求的前提下,第一神经网络是满足精度需求的规模较大的网络;或者,在确保精度需求的前提下,第一神经网络是满足速度需求的规模较小网络。从而平衡了处理应用数据时的精度和速度,提升用户体验。第一神经网络是超网络301中的子网络。Since the execution device 310 selects the first neural network suitable for processing application data from the super network 301 according to the scene perception data and the
关于执行设备310确定处理应用数据的第一神经网络的具体方法可以参考下面图7的阐述。Regarding the specific method for the execution device 310 to determine the first neural network for processing application data, reference may be made to the illustration in FIG. 7 below.
需要说明的是,在实际的应用中,数据库330中维护的训练数据和测试数据不一定都来自于数据采集设备360,也有可能是从其他设备接收得到的。另外,训练设备320也不一定完全基于数据库330维护的训练数据训练子网络,也有可能从云端或其他地方获取训练数据训练超网络。执行设备310也不一定完全基于数据库330维护的测试数据测试子网络,也有可能从云端或其他地方获取测试数据,以便基于测试数据测试子网络处理数据的速度。上述描述不应该作为对本申请实施例的限定。It should be noted that, in practical applications, the training data and test data maintained in the database 330 do not necessarily all come from the data collection device 360, and may also be received from other devices. In addition, the training device 320 does not necessarily train the sub-network entirely based on the training data maintained by the database 330, and it is also possible to obtain training data from the cloud or other places to train the super-network. The execution device 310 does not necessarily test the sub-network entirely based on the test data maintained by the database 330, and may also obtain test data from the cloud or other places, so as to test the processing speed of the sub-network based on the test data. The above description should not be used as a limitation to the embodiments of the present application.
进一步地,根据执行设备310所执行的功能,还可以进一步将执行设备310细分为如图3所示的架构,如图所示,执行设备310配置有计算模块311、I/O接口312和预处理模块313。Further, according to the functions performed by the execution device 310, the execution device 310 can be further subdivided into the architecture shown in FIG. Preprocessing module 313 .
I/O接口312用于与外部设备进行数据交互。用户可以通过终端设备340向I/O接口312输入数据。输入数据可以包括图像或视频。另外,输入数据也可以来自数据库330。The I/
预处理模块313用于根据I/O接口312接收到的输入数据进行预处理。在本申请实施例中,预处理模块313可以用于识别从I/O接口312接收到的应用数据的应用场景特征。The preprocessing module 313 is configured to perform preprocessing according to the input data received by the I/
在执行设备310对输入数据进行预处理,或者在执行设备310的计算模块311执行计算等相关的处理过程中,执行设备310可以调用数据存储系统350中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统350中。When the execution device 310 preprocesses the input data, or in the execution device 310 computing module 311 performs calculation and other related processing, the execution device 310 can call the data, codes, etc. in the data storage system 350 for corresponding processing , and the correspondingly processed data and instructions may also be stored in the data storage system 350 .
例如,执行设备310存储的超网络301和预设条件302可以应用于执行设备310。执行设备310获取到应用数据后,计算模块311根据场景感知数据和预设条件302从超网络301中搜索第一神经网络,利用第一神经网络对应用数据进行处理。由于第一神经网络是由执行设备310基于场景感知数据确定的,因此,利用第一神经网络对应用数据进行处理,可以满足用户对数据处理的速度需求和精度需求。For example, the hypernetwork 301 and
最后,I/O接口312将处理结果返回给终端设备340,从而提供给用户,以便用户查看处理结果。Finally, the I/
在图3所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口 312提供的界面进行操作。另一种情况下,终端设备340可以自动地向I/O接口312发送输入数据,如果要求终端设备340自动发送输入数据需要获得用户的授权,则用户可以在终端设备340中设置相应权限。用户可以在终端设备340查看执行设备310输出的处理结果,具体的呈现形式可以是显示、声音、动作等具体方式。终端设备340也可以作为数据采集端,采集如图所示输入I/O接口312的输入数据及输出I/O接口312的处理结果作为新的样本数据,并存入数据库330。当然,也可以不经过终端设备340进行采集,而是由I/O接口312将如图所示输入I/O接口312的输入数据及输出I/O接口312的处理结果,作为新的样本数据存入数据库330。In the situation shown in FIG. 3 , the user can manually specify the input data, and the manual setting can be operated through the interface provided by the I/
图3仅是本申请实施例提供的一种系统架构的示意图,图3中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图3中,数据存储系统350相对执行设备310是外部存储器,在其它情况下,也可以将数据存储系统350置于执行设备310中。Fig. 3 is only a schematic diagram of a system architecture provided by the embodiment of the present application, and the positional relationship between devices, devices, modules, etc. shown in Fig. 3 does not constitute any limitation. For example, in Fig. 3, the data storage system 350 is The execution device 310 is an external memory, and in other cases, the data storage system 350 may also be placed in the execution device 310 .
接下来,结合图7至图11对本申请实施例提供的数据处理方法进行详细阐述。图7为本申请实施例提供的一种数据处理方法的流程示意图。在这里由图3中的执行设备310为例进行说明。如图7所示,该方法包括以下步骤。Next, the data processing method provided by the embodiment of the present application will be described in detail with reference to FIG. 7 to FIG. 11 . FIG. 7 is a schematic flowchart of a data processing method provided by an embodiment of the present application. Here, the execution device 310 in FIG. 3 is taken as an example for illustration. As shown in Fig. 7, the method includes the following steps.
步骤710、执行设备310获取待处理的应用数据。Step 710, the executing device 310 obtains application data to be processed.
应用数据包括图像、语音和文字中至少一种形式的数据。执行设备310可以通过传感器获取待处理的应用数据。传感器包括摄像头、音频传感器和激光雷达中至少一种。对于不同应用的应用数据,采集应用数据的传感器可以不同。The application data includes data in at least one form among image, voice and text. The execution device 310 may acquire application data to be processed through a sensor. The sensor includes at least one of a camera, an audio sensor, and a lidar. For the application data of different applications, the sensors for collecting the application data may be different.
例如,若执行设备310是智能终端,应用场景为智能终端利用人脸识别功能对用户的人脸进行识别,实现对智能终端进行解锁的功能。智能终端可以利用摄像头拍摄人脸,得到人脸图像,则待处理的应用数据为人脸图像。又如,应用场景为智能终端利用语音助手功能对用户的语音进行识别,实现对智能终端进行解锁的功能。智能终端可以利用音频传感器获取用户的语音,得到音频数据,则待处理的应用数据为音频数据。For example, if the executing device 310 is a smart terminal, the application scenario is that the smart terminal uses a face recognition function to recognize a user's face to realize the function of unlocking the smart terminal. The smart terminal can use the camera to capture the face to obtain a face image, and the application data to be processed is the face image. For another example, the application scenario is that the smart terminal uses the voice assistant function to recognize the user's voice, and realize the function of unlocking the smart terminal. The smart terminal can use the audio sensor to obtain the user's voice to obtain audio data, and the application data to be processed is audio data.
又如,若执行设备310是道闸监控器。应用场景为自动驾驶汽车通过道闸时,道闸监控器进行车牌识别。道闸监控器可以利用摄像头对自动驾驶汽车的车牌进行拍摄,得到车牌图像,则待处理的应用数据为车牌图像。As another example, if the execution device 310 is a barrier gate monitor. The application scenario is that when the self-driving car passes through the barrier gate, the barrier gate monitor performs license plate recognition. The barrier gate monitor can use the camera to take pictures of the license plate of the self-driving car to obtain the license plate image, and the application data to be processed is the license plate image.
步骤720、执行设备310获取场景感知数据。Step 720, the executing device 310 acquires scene perception data.
由上述步骤460的阐述可知,影响神经网络处理应用数据时的速度和精度的因素包括获取应用数据的应用场景的应用场景特征和运行应用数据的硬件资源的运行场景特征。因此,执行设备310在获取到待处理的应用数据后,获取场景感知数据。场景感知数据用于指示执行设备310处理应用数据时的影响因素。From the description of step 460 above, it can be seen that the factors affecting the speed and accuracy of the neural network processing application data include the application scenario characteristics of the application scenario where the application data is acquired and the operating scenario characteristics of the hardware resources that run the application data. Therefore, after acquiring the application data to be processed, the execution device 310 acquires the scene awareness data. The scene perception data is used to indicate the influencing factors when the executing device 310 processes the application data.
可理解的,场景感知数据用于指示执行设备310采用神经网络处理应用数据时影响速度和精度的因素。场景感知数据包括外部影响因素和内部影响因素中的至少一个。外部影响因素用于描述执行设备310获取应用数据时的应用场景特征。外部影响因素包含温度数据、湿度数据、光照数据和时间数据中至少一种。内部影响因素用于描述执行设备310运行应用数据的硬件资源的运行场景特征。内部影响因素包含处理器的计算能力、可用存储容量和可用剩余电量中至少一种。It can be understood that the scene awareness data is used to indicate the factors affecting the speed and accuracy when the execution device 310 uses the neural network to process the application data. The scene awareness data includes at least one of external influencing factors and internal influencing factors. The external influencing factors are used to describe the characteristics of the application scenario when the executing device 310 obtains the application data. The external influencing factors include at least one of temperature data, humidity data, illumination data and time data. The internal influencing factors are used to describe the characteristics of the running scenario of the hardware resources on which the execution device 310 runs the application data. The internal influencing factors include at least one of computing power of the processor, available storage capacity and available remaining power.
若场景感知数据包括外部影响因素,在一种可能的实现方式中,执行设备310可以从其他设备获取场景感知数据。例如,若场景感知数据是温度数据,执行设备310可以从温度传感器获取温度数据。又如,若场景感知数据是湿度数据,执行设备310可以从湿度传感器获取温度数据。在另一种可能的实现方式中,执行设备310可以根据待处理的应用数据获取场景感知数据。例如,应用数据是图像,场景感知数据可以是亮度或光照强度,执行设备310可以分析图像获取亮度或光照强度。If the scene awareness data includes external influencing factors, in a possible implementation manner, the executing device 310 may acquire the scene awareness data from other devices. For example, if the scene perception data is temperature data, the executing device 310 may acquire the temperature data from a temperature sensor. For another example, if the scene perception data is humidity data, the executing device 310 may acquire temperature data from a humidity sensor. In another possible implementation manner, the executing device 310 may acquire scene awareness data according to application data to be processed. For example, the application data is an image, the scene perception data may be brightness or light intensity, and the execution device 310 may analyze the image to obtain the brightness or light intensity.
若场景感知数据包括内部影响因素,执行设备310中的控制器可以监控执行设备310中处理器、存储器和电量,以获取处理器的计算能力、可用存储容量和可用剩余电量中至少一种。控制器可以是执行设备310中的中央处理器。If the scene perception data includes internal influencing factors, the controller in the execution device 310 can monitor the processor, storage and power in the execution device 310 to obtain at least one of the processor's computing power, available storage capacity and available remaining power. The controller may be a central processing unit in the execution device 310 .
步骤730、执行设备310根据场景感知数据和预设条件确定处理应用数据的第一神经网络。Step 730, the execution device 310 determines the first neural network for processing application data according to the scene awareness data and preset conditions.
预设条件用于指示影响神经网络运行的场景数据与神经网络的对应关系。The preset condition is used to indicate the corresponding relationship between the scene data that affects the operation of the neural network and the neural network.
在第一种可能的情形下,场景数据包括应用场景标识和应用场景特征。应用场景标识用于指示应用场景。一个应用场景可以具有一个或多个应用场景特征。可理解的,一个应用场景标识可以与一个应用场景特征关联,或者,一个应用场景标识也可以与多个应用场景特征关联。例如,应用场景为小区车库的闸机场景,应用场景特征包括晴天、阴天和雨天。In the first possible situation, the scenario data includes an application scenario identifier and an application scenario feature. The application scenario identifier is used to indicate the application scenario. An application scenario can have one or more application scenario characteristics. Understandably, one application scenario identifier can be associated with one application scenario feature, or one application scenario identifier can also be associated with multiple application scenario features. For example, the application scenario is a turnstile scenario in a residential garage, and the characteristics of the application scenario include sunny days, cloudy days, and rainy days.
预设条件用于指示影响神经网络运行的应用场景特征与神经网络的对应关系。每个应用场景特征关联一个神经网络。预设条件可以包括多项应用场景特征与神经网络的对应关系。在一种示例中,应用场景特征与神经网络的对应关系可以以表格的形式呈现,如表1所示。The preset condition is used to indicate the corresponding relationship between the characteristics of the application scene that affect the operation of the neural network and the neural network. Each application scene feature is associated with a neural network. The preset conditions may include correspondences between multiple application scene features and neural networks. In an example, the corresponding relationship between the application scene features and the neural network may be presented in the form of a table, as shown in Table 1.
表1Table 1
由表1可知,标识1指示的应用场景关联的应用场景特征包括晴天、阴天和雨天。晴天与神经网络1具有绑定关系,阴天与神经网络2具有绑定关系,雨天与神经网络3具有绑定关系。标识2指示的应用场景关联的应用场景特征包括强光照、中光照和弱光照。强光照与神经网络4具有绑定关系,中光照与神经网络5具有绑定关系,弱光照与神经网络6具有绑定关系。标识3指示的应用场景关联的应用场景特征包括应用的使用间隔时长。应用的使用间隔时长与神经网络7具有绑定关系。It can be seen from Table 1 that the application scene features associated with the application scene indicated by the identifier 1 include sunny days, cloudy days, and rainy days. Sunny days have a binding relationship with neural network 1, cloudy days have a binding relationship with neural network 2, and rainy days have a binding relationship with neural network 3. The characteristics of the application scene associated with the application scene indicated by the mark 2 include strong light, medium light and weak light. The strong light has a binding relationship with the
假设标识1指示的应用场景为小区车库的闸机场景。汽车在天空晴朗的环境下通过道闸时,执行设备310获取到的场景感知数据包括汽车通过道闸和晴天,执行设备 310根据场景感知数据查询表1,确定应用场景为标识1指示的场景,执行设备310再确定标识1指示的场景的应用场景特征为晴天,将晴天对应的神经网络1确定为第一神经网络。Assume that the application scenario indicated by the identifier 1 is the turnstile scenario in the garage of the community. When the car passes through the barrier in a sunny environment, the scene perception data acquired by the executing device 310 includes the car passing through the barrier and sunny weather. The executing device 310 looks up Table 1 according to the scene sensing data, and determines that the application scene is the scene indicated by the identifier 1. The execution device 310 further determines that the application scene characteristic of the scene indicated by the identifier 1 is sunny, and determines the neural network 1 corresponding to the sunny day as the first neural network.
由于天空晴朗,执行设备310拍摄到的车牌图像足够清晰。执行设备310根据应用场景特征和预设条件确定的第一神经网络可以是规模较小的神经网络。执行设备310利用规模较小的神经网络对车牌进行识别的准确率较高,可以满足车牌识别的精度需求。而且,执行设备310利用规模较小的神经网络对车牌进行识别的运行时长较短,可以满足车牌识别的速度需求。Since the sky is clear, the image of the license plate captured by the executing device 310 is clear enough. The first neural network determined by the execution device 310 according to the characteristics of the application scenario and preset conditions may be a smaller-scale neural network. The execution device 310 uses a small-scale neural network to recognize the license plate with a high accuracy rate, which can meet the accuracy requirement of license plate recognition. Moreover, the running time of the execution device 310 using a small-scale neural network to recognize the license plate is relatively short, which can meet the speed requirement of license plate recognition.
又如,汽车在大雨天的环境下通过道闸时,执行设备310获取到的场景感知数据包括汽车通过道闸和雨天,执行设备310根据场景感知数据查询表1,确定应用场景为标识1指示的场景,执行设备310再确定标识1指示的场景的应用场景特征为雨天,将雨天对应的神经网络3确定为第一神经网络。神经网络3的规模大于神经网络1的规模。As another example, when a car passes through a barrier in a heavy rain environment, the scene perception data obtained by the executing device 310 includes the car passing through a barrier and rainy weather, and the executing device 310 looks up Table 1 according to the scene sensing data, and determines that the application scene is indicated by the sign 1 The execution device 310 then determines that the application scene feature of the scene indicated by the identifier 1 is rainy, and determines the neural network 3 corresponding to the rainy day as the first neural network. The size of neural network 3 is larger than that of neural network 1.
由于雨天视线不清楚,执行设备310拍摄到的车牌图像可能较模糊。如果执行设备310继续利用规模较小的神经网络对车牌进行识别的准确率较低,无法满足车牌识别的精度需求。因此执行设备310根据应用场景特征和预设条件确定的第一神经网络可以是规模较大的神经网络。执行设备310利用规模较大的神经网络对车牌进行识别的准确率较高,可以确保速度需求的前提下,满足车牌识别的精度需求。Since the line of sight is unclear in rainy days, the image of the license plate captured by the executing device 310 may be blurred. If the execution device 310 continues to use a small-scale neural network to recognize the license plate, the accuracy rate is low, which cannot meet the accuracy requirement of license plate recognition. Therefore, the first neural network determined by the execution device 310 according to the characteristics of the application scenario and preset conditions may be a relatively large-scale neural network. The execution device 310 uses a large-scale neural network to recognize the license plate with high accuracy, which can meet the accuracy requirement of license plate recognition under the premise of ensuring the speed requirement.
从而,执行设备310根据应用场景特征动态地选取处理应用数据的第一神经网络,在满足精度需求的前提下,使速度尽可能快,或者,在满足速度需求的前提下,使精度尽可能高,平衡处理应用数据时的精度需求和速度需求,提升用户体验。Therefore, the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the application scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or makes the precision as high as possible under the premise of meeting the speed requirement , balance the accuracy requirements and speed requirements when processing application data, and improve user experience.
需要说明的是,表1只是以表格的形式示意对应关系在存储设备中的存储形式,并不是对该对应关系在存储设备中的存储形式的限定,当然,该对应关系在存储设备中的存储形式还可以以其他的形式存储,本实施例对此不做限定。It should be noted that Table 1 only shows the storage form of the corresponding relationship in the storage device in the form of a table, and does not limit the storage form of the corresponding relationship in the storage device. Of course, the storage form of the corresponding relationship in the storage device The format may also be stored in other formats, which is not limited in this embodiment.
另外,应用场景特征可以以一个具体的数值或取值范围的形式表示。例如,若应用场景特征为光照强度,光照强度的取值范围可以包括强光照、中光照和弱光照的三个取值范围。又如,应用场景特征为应用的使用间隔时长,应用的使用间隔时长可以为3秒。一个应用场景特征对应的取值范围越多,执行设备310确定处理应用数据的第一神经网络越准确。In addition, the application scenario feature may be expressed in the form of a specific value or value range. For example, if the feature of the application scene is light intensity, the value range of light intensity may include three value ranges of strong light, medium light and weak light. For another example, the feature of the application scenario is the duration of the usage interval of the application, and the duration of the usage interval of the application may be 3 seconds. The more value ranges corresponding to an application scenario feature, the more accurate the execution device 310 determines the first neural network for processing application data.
在第二种可能的情形下,场景数据包括运行场景标识和运行场景特征。运行场景标识用于指示运行场景。一个运行场景可以具有一个或多个运行场景特征。可理解的,一个运行场景标识可以与一个运行场景特征关联,或者,一个运行场景标识也可以与多个运行场景特征关联。例如,运行场景为可用剩余电量,运行场景特征包括高电量、中电量和低电量。In the second possible situation, the scenario data includes the identifier of the running scenario and the characteristics of the running scenario. The running scenario identifier is used to indicate the running scenario. A running scenario can have one or more running scenario characteristics. Understandably, one running scenario identifier can be associated with one running scenario feature, or one running scenario identifier can also be associated with multiple running scenario features. For example, the running scenario is available remaining power, and the characteristics of the running scenario include high power, medium power and low power.
预设条件用于指示影响神经网络运行的运行场景特征与神经网络的对应关系。每个运行场景特征关联一个神经网络。预设条件可以包括多项运行场景特征与神经网络的对应关系。在一种示例中,运行场景特征与神经网络的对应关系可以以表格的形式呈现,如表2所示。The preset condition is used to indicate the corresponding relationship between the characteristics of the operating scene that affect the operation of the neural network and the neural network. Each running scene feature is associated with a neural network. The preset conditions may include correspondences between multiple running scene features and neural networks. In an example, the corresponding relationship between the running scene features and the neural network may be presented in the form of a table, as shown in Table 2.
表2Table 2
由表2可知,标识4指示的运行场景为执行设备310的可用剩余电量场景。可用剩余电量场景关联的运行场景特征包括可用剩余电量高、可用剩余电量中和可用剩余电量低。可用剩余电量高与神经网络8具有绑定关系,可用剩余电量中神经网络9具有绑定关系,可用剩余电量低与神经网络10具有绑定关系。It can be known from Table 2 that the running scenario indicated by the
运行场景特征可以以一个具体的数值或取值范围的形式表示。例如,若运行场景特征为可用剩余电量。可用剩余电量强的取值范围为100%到60%。可用剩余电量中的取值范围为60%到30%。可用剩余电量低的取值范围为30%到5%。一个运行场景特征对应的取值范围越多,执行设备310确定处理运行数据的第一神经网络越准确。The characteristics of the running scenario can be expressed in the form of a specific value or value range. For example, if the running scene is characterized by available remaining power. The value range of available remaining power is 100% to 60%. The range of values in Available Remaining Battery is 60% to 30%. The value range for the low battery remaining is 30% to 5%. The more value ranges corresponding to an operating scenario feature, the more accurate the execution device 310 determines the first neural network for processing the operating data.
假设执行设备31需要启动语音助手功能时,执行设备310确定电量低于20%,则执行设备310确定场景感知数据为电量低于20%。执行设备310根据场景感知数据查询表2,确定运行场景为标识4指示的场景,执行设备310再确定标识4指示的场景的运行场景特征为可用剩余电量低,将可用剩余电量低对应的神经网络10确定为第一神经网络。Assume that when the execution device 31 needs to start the voice assistant function, the execution device 310 determines that the power is lower than 20%, then the execution device 310 determines that the scene perception data is that the power is lower than 20%. The execution device 310 determines that the running scenario is the scenario indicated by the
由于执行设备310的可用剩余电量低,如果执行设备310继续利用规模较大的神经网络进行语音识别,无法满足车牌识别的速度需求。此时,执行设备310根据运行场景特征和预设条件确定的第一神经网络可以是规模较小的神经网络。执行设备310利用规模较小的神经网络可以对用户语音进行识别,可以确保精度需求的前提下,满足语音识别的速度需求,且可以节省电量。Since the available remaining power of the execution device 310 is low, if the execution device 310 continues to use a large-scale neural network for speech recognition, the speed requirement for license plate recognition cannot be met. At this time, the first neural network determined by the execution device 310 according to the characteristics of the running scenario and preset conditions may be a smaller-scale neural network. The execution device 310 can recognize the user's voice by using a small-scale neural network, which can meet the speed requirement of voice recognition under the premise of ensuring the accuracy requirement, and can save power.
又如,执行设备310确定电量高于80%,则执行设备310确定场景感知数据为电量高于80%。执行设备310根据场景感知数据查询表2,确定运行场景为标识4指示的场景,执行设备310再确定标识4指示的场景的运行场景特征为可用剩余电量高,将可用剩余电量高对应的神经网络8确定为第一神经网络。For another example, if the execution device 310 determines that the power level is higher than 80%, then the execution device 310 determines that the scene awareness data indicates that the power level is higher than 80%. The execution device 310 determines that the running scenario is the scenario indicated by the
由于执行设备310的可用剩余电量高,执行设备310根据运行场景特征和预设条件确定的第一神经网络可以是规模较大的神经网络。执行设备310利用规模较大的神经网络可以对用户语音进行识别,可以确保速度需求的前提下,满足语音识别的精度需求。Since the available remaining power of the execution device 310 is high, the first neural network determined by the execution device 310 according to the characteristics of the running scenario and preset conditions may be a large-scale neural network. The execution device 310 can recognize the user's voice by using a large-scale neural network, and can meet the accuracy requirement of voice recognition under the premise of ensuring the speed requirement.
从而,执行设备310根据运行场景特征动态地选取处理应用数据的第一神经网络, 在满足精度需求的前提下,使速度尽可能快,或者,在满足速度需求的前提下,使精度尽可能高,平衡处理应用数据时的精度需求和速度需求,提升用户体验。Therefore, the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the running scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or makes the precision as high as possible under the premise of meeting the speed requirement , balance the accuracy requirements and speed requirements when processing application data, and improve user experience.
需要说明的是,表2只是以表格的形式示意对应关系在存储设备中的存储形式,并不是对该对应关系在存储设备中的存储形式的限定,当然,该对应关系在存储设备中的存储形式还可以以其他的形式存储,本实施例对此不做限定。It should be noted that Table 2 only shows the storage form of the corresponding relationship in the storage device in the form of a table, and does not limit the storage form of the corresponding relationship in the storage device. Of course, the storage form of the corresponding relationship in the storage device The format may also be stored in other formats, which is not limited in this embodiment.
在第三种可能的情形下,场景数据包括应用场景特征和运行场景特征。关于应用场景特征和运行场景特征的解释可以参考上述第一种可能的情形和第二种可能的情形的阐述。一个应用场景特征可以对应一个或多个运行场景特征。一个运行场景特征可以对应一个或多个应用场景特征。本申请实施例对应用场景特征和运行场景特征的关联关系不予限定,具体关联关系可以根据应用场景设置。In the third possible situation, the scenario data includes application scenario features and running scenario features. For the explanation of the features of the application scenario and the features of the running scenario, reference may be made to the explanations of the first possible scenario and the second possible scenario above. An application scenario feature can correspond to one or more running scenario features. A running scenario feature can correspond to one or more application scenario features. The embodiment of the present application does not limit the association relationship between the application scenario feature and the running scenario feature, and the specific association relationship can be set according to the application scenario.
在一种示例中,场景数据与神经网络的对应关系可以以表格的形式呈现,如表3所示。In an example, the corresponding relationship between the scene data and the neural network may be presented in the form of a table, as shown in Table 3.
表3table 3
由表3可知,标识7指示的应用场景关联的应用场景特征包括晴天。标识7指示的应用场景关联的运行场景特征包括可用剩余电量高和可用剩余电量低。晴天和可用剩余电量高均与神经网络17具有绑定关系。晴天和可用剩余电量低均与神经网络18具有绑定关系。It can be known from Table 3 that the application scene characteristics associated with the application scene indicated by the identifier 7 include sunny weather. The running scenario characteristics associated with the application scenario indicated by the identifier 7 include high remaining available power and low remaining available power. Both the sunny day and the high remaining power available have a binding relationship with the neural network 17 . Sunny days and low available remaining power both have a binding relationship with the neural network 18 .
假设标识7指示的应用场景为自动驾驶汽车通过道闸场景。自动驾驶汽车在天空晴朗的环境下通过道闸时,执行设备310获取到的场景感知数据包括汽车通过道闸和晴天,以及执行设备310确定场景感知数据还包括可用剩余电量高,执行设备310根据场景感知数据查询表3,确定应用场景为标识7指示的场景,执行设备310再确定标识7指示的场景的应用场景特征为晴天,运行场景特征为可用剩余电量高,将晴天和可用剩余电量高对应的神经网络17确定为第一神经网络。Assume that the application scenario indicated by the mark 7 is the scenario where the self-driving car passes through the barrier gate. When the self-driving car passes the barrier in a sunny environment, the scene perception data acquired by the execution device 310 includes the vehicle passing the barrier and the sunny day, and the scene perception data determined by the execution device 310 also includes the high remaining power available, the execution device 310 according to Scene-aware data lookup table 3, determine that the application scene is the scene indicated by the mark 7, and the execution device 310 determines that the application scene characteristic of the scene indicated by the mark 7 is sunny, and the running scene is characterized by high available remaining power, and the sunny day and the high available remaining power The corresponding neural network 17 is defined as the first neural network.
由于天空晴朗,执行设备310拍摄到的车牌图像足够清晰,执行设备310可以利用规模较小的神经网络对车牌进行识别,确保精度需求的前提下,满足车牌识别的速度需求。但是,执行设备310的可用剩余电量高,则执行设备310可以根据应用场景特征、运行场景特征和预设条件确定的第一神经网络可以是满足车牌识别的速度需求的前提下,进一步提升车牌识别的精度的神经网络,来满足车牌识别的精度需求。Since the sky is clear, the image of the license plate captured by the execution device 310 is clear enough, and the execution device 310 can use a small-scale neural network to recognize the license plate to meet the speed requirement of license plate recognition while ensuring the accuracy requirement. However, if the available remaining power of the executing device 310 is high, the first neural network determined by the executing device 310 according to the characteristics of the application scenario, the characteristics of the operating scenario, and the preset conditions can further improve the license plate recognition on the premise that it meets the speed requirements of the license plate recognition. The accuracy of the neural network to meet the accuracy requirements of license plate recognition.
如果执行设备310的可用剩余电量低,由于执行设备310在电量较低的情况下可能影响神经网络的运行时长,因此,执行设备310可以选择晴天和可用剩余电量低对应的神经网络18确定为第一神经网络。可以确保精度需求的前提下,利用比神经网络17的规模更小的神经网络18对车牌进行识别,满足车牌识别的速度需求。If the available remaining power of the execution device 310 is low, since the execution device 310 may affect the running time of the neural network when the power is low, the execution device 310 may select the neural network 18 corresponding to the sunny day and the low available remaining power to be determined as the first neural network 18. a neural network. On the premise that the accuracy requirement can be ensured, the license plate is recognized by using the neural network 18 which is smaller in scale than the neural network 17, so as to meet the speed requirement of the license plate recognition.
又如,自动驾驶汽车在雨天的环境下通过道闸时,执行设备310获取到的场景感 知数据包括汽车通过道闸和雨天,以及执行设备310确定场景感知数据还包括可用剩余电量高,执行设备310根据场景感知数据查询表3,确定应用场景为标识8指示的场景,执行设备310再确定标识8指示的场景的应用场景特征为雨天,运行场景特征为可用剩余电量高,将雨天和可用剩余电量高对应的神经网络19确定为第一神经网络。As another example, when the self-driving car passes the barrier in a rainy environment, the scene perception data obtained by the execution device 310 includes the car passing the barrier and rainy weather, and the scene perception data determined by the execution device 310 also includes the high available remaining power, the execution device 310 310, according to the scene perception data query table 3, determine that the application scene is the scene indicated by the mark 8, and the execution device 310 determines that the application scene feature of the scene indicated by the mark 8 is rainy, and the running scene feature is that the available remaining power is high, and the rainy day and the available remaining power The neural network 19 corresponding to the high battery level is determined as the first neural network.
由于雨天视线不清楚,执行设备310拍摄到的车牌图像可能较模糊,执行设备310利用规模较大的神经网络对车牌进行识别的准确率较高,可以确保速度需求的前提下,满足车牌识别的精度需求。但是,执行设备310的可用剩余电量高,执行设备310根据应用场景特征、运行场景特征和预设条件确定的第一神经网络可以是满足车牌识别的速度需求的前提下,进一步提升车牌识别的精度的神经网络,来满足车牌识别的精度需求。Due to the unclear line of sight in rainy days, the image of the license plate captured by the execution device 310 may be blurred. The execution device 310 uses a large-scale neural network to recognize the license plate with a high accuracy rate, which can meet the requirements of license plate recognition under the premise of ensuring the speed requirement. Accuracy needs. However, the available remaining power of the execution device 310 is high, and the first neural network determined by the execution device 310 according to the characteristics of the application scene, the characteristics of the operating scene and the preset conditions can further improve the accuracy of the license plate recognition under the premise of meeting the speed requirements of the license plate recognition A neural network to meet the accuracy requirements of license plate recognition.
如果执行设备310的可用剩余电量低,执行设备310利用规模较大的神经网络对车牌进行识别的运行时长较长,无法满足车牌识别的速度需求。因此,执行设备310可以选择雨天和可用剩余电量低对应的神经网络20确定为第一神经网络。可以确保精度需求的前提下,利用比神经网络19的规模更小的神经网络20对车牌进行识别,可以确保精度需求的前提下,满足车牌识别的速度需求。If the available remaining power of the execution device 310 is low, the running time of the execution device 310 using a large-scale neural network to recognize the license plate is relatively long, which cannot meet the speed requirement for license plate recognition. Therefore, the execution device 310 may select the neural network 20 corresponding to the rainy day and the low remaining available power to be determined as the first neural network. On the premise that the accuracy requirement can be ensured, using the neural network 20 smaller in scale than the neural network 19 to recognize the license plate can meet the speed requirement of the license plate recognition under the premise that the accuracy requirement can be ensured.
从而,执行设备310根据应用场景特征和运行场景特征动态地选取处理应用数据的第一神经网络,在满足精度需求的前提下,使速度尽可能快,或者,在满足速度需求的前提下,使精度尽可能高,平衡处理应用数据时的精度需求和速度需求,提升用户体验。Therefore, the execution device 310 dynamically selects the first neural network for processing application data according to the characteristics of the application scene and the characteristics of the running scene, and makes the speed as fast as possible under the premise of meeting the precision requirement, or uses the first neural network to process the application data under the premise of meeting the speed requirement The precision is as high as possible, balancing the precision requirements and speed requirements when processing application data, and improving user experience.
图8所述的方法流程是对图7中步骤730所包括的具体操作过程的阐述。The method flow described in FIG. 8 is an illustration of the specific operation process included in step 730 in FIG. 7 .
步骤7301、执行设备310确定预设条件中包括场景感知数据的场景数据对应的第一神经网络的参数。Step 7301, the execution device 310 determines the parameters of the first neural network corresponding to the scene data including the scene awareness data in the preset conditions.
可理解的,场景数据是用于生成预设条件所预先确定的数据。场景感知数据是执行设备310根据应用数据实时获取到的数据。It can be understood that the scene data is predetermined data for generating preset conditions. The scene awareness data is the data acquired by the executing device 310 in real time according to the application data.
在一些实施例中,如果执行设备310在预设条件中查询到了场景感知数据标识的应用场景特征(如上述第一种可能的情形的阐述),或者,如果执行设备310在预设条件中查询到了场景感知数据标识的运行场景特征(如上述第二种可能的情形的阐述),或者,如果执行设备310在预设条件中查询到了场景感知数据标识的应用场景特征和运行场景特征(如上述第三种可能的情形的阐述),则执行设备310根据与场景数据关联的第一神经网络处理应用数据,平衡了处理应用数据时的精度和速度,满足了用户需求,提升了用户体验。In some embodiments, if the execution device 310 inquires the application scene characteristics identified by the scene awareness data in the preset conditions (as explained in the first possible situation above), or if the execution device 310 inquires in the preset conditions The running scene feature identified by the scene-aware data (as described in the second possible situation above), or, if the execution device 310 inquires the application scene feature and the running scene feature identified by the scene-aware data in the preset condition (as described above Explanation of the third possible situation), the execution device 310 processes the application data according to the first neural network associated with the scene data, which balances the accuracy and speed of processing application data, meets user needs, and improves user experience.
步骤7302、执行设备310根据第一神经网络的参数从超网络中确定第一神经网络。Step 7302, the execution device 310 determines the first neural network from the supernetwork according to the parameters of the first neural network.
预设条件还可以包括第一神经网络的标识和第一神经网络的参数。第一神经网络的参数包括通道的数量和网络层的数量。第一神经网络可以为超网络中的子网络,超网络用于确定场景数据对应的第一神经网络。通道可以是指卷积神经网络中卷积层的输入结果,即通道也可以称为特征图。网络层可以是卷积神经网络中的卷积层。The preset condition may also include an identifier of the first neural network and parameters of the first neural network. The parameters of the first neural network include the number of channels and the number of network layers. The first neural network may be a sub-network in the super network, and the super network is used to determine the first neural network corresponding to the scene data. A channel can refer to the input result of a convolutional layer in a convolutional neural network, that is, a channel can also be called a feature map. The network layer may be a convolutional layer in a convolutional neural network.
执行设备310可以根据第一神经网络的参数从超网络中确定第一神经网络。具体地,执行设备310根据第一神经网络的参数从超网络的权重中确定第一神经网络的权重。由于子网络共享了超网络的参数,相对于执行设备310存储多个子网络,有效地 降低了执行设备310的存储空间。The execution device 310 may determine the first neural network from the supernetwork according to the parameters of the first neural network. Specifically, the execution device 310 determines the weight of the first neural network from the weights of the supernet according to the parameters of the first neural network. Since the subnetworks share the parameters of the supernetwork, storing multiple subnetworks relative to the execution device 310 effectively reduces the storage space of the execution device 310.
步骤740、执行设备310利用第一神经网络得到应用数据的处理结果。In step 740, the execution device 310 obtains a processing result of the application data by using the first neural network.
执行设备310将应用数据输入第一神经网络,利用第一神经网络得到应用数据的处理结果。例如,应用场景为智能终端利用人脸识别功能对用户的人脸进行识别,实现对智能终端进行解锁的功能。应用数据为人脸图像,执行设备310将人脸图像输入第一神经网络,得到处理结果。若处理结果为识别人脸成功,智能终端解锁成功;若处理结果为识别人脸失败,智能终端解锁失败。The execution device 310 inputs the application data into the first neural network, and uses the first neural network to obtain a processing result of the application data. For example, an application scenario is that a smart terminal uses a face recognition function to recognize a user's face to realize the function of unlocking the smart terminal. The application data is a face image, and the executing device 310 inputs the face image into the first neural network to obtain a processing result. If the processing result is that the face is recognized successfully, the smart terminal is successfully unlocked; if the processing result is that the face recognition fails, the smart terminal fails to be unlocked.
进一步地,执行设备310在确定第一神经网络后,还可以对第一神经网络进行调整。图9所述的方法流程是对图7中所述方法的补充阐述。Further, after the execution device 310 determines the first neural network, it may further adjust the first neural network. The method flow shown in FIG. 9 is a supplementary description of the method shown in FIG. 7 .
步骤750、执行设备310显示影响第一神经网络运行的速度和精度的场景数据与第一神经网络的对应关系,以及处理结果。In step 750, the execution device 310 displays the corresponding relationship between the scene data and the first neural network that affect the running speed and accuracy of the first neural network, and the processing results.
处理结果可以包括运行时长和精度。运行时长可以是指从执行设备310运行第一神经网络处理应用数据开始至得到处理结果的时长。执行设备310将应用数据输入第一神经网络后开始计时,直到第一神经网络输出处理结果结束计时,得到运行时长。处理结果的精度用于表示利用第一神经网络处理应用数据的处理结果是否满足用户的精度需求的程度。执行设备310可以通过用户反馈信息获取处理结果的精度。执行设备310显示影响第一神经网络运行的速度和精度的场景数据与第一神经网络的对应关系,以及处理结果,使用户可以直观地看到处理结果,以便于用户判断运行时长是否满足用户的速度需求,以及判断处理结果的精度是否满足用户的精度需求。Processing results can include runtime and accuracy. The running time may refer to the time from when the executing device 310 runs the first neural network to process the application data to when the processing result is obtained. The execution device 310 starts timing after inputting the application data into the first neural network, and ends timing until the first neural network outputs the processing result to obtain the running time. The precision of the processing result is used to indicate whether the processing result of using the first neural network to process the application data satisfies the accuracy requirement of the user. The execution device 310 may obtain the accuracy of the processing result through user feedback information. The execution device 310 displays the corresponding relationship between the scene data and the first neural network that affect the speed and accuracy of the first neural network, as well as the processing results, so that the user can intuitively see the processing results, so that the user can judge whether the running time meets the user's requirements. Speed requirements, and judging whether the accuracy of the processing results meets the user's accuracy requirements.
如果第一神经网络的处理结果不满足用户的速度需求和精度需求,执行设备310还可以执行步骤760和步骤770,或者执行设备310还可以执行步骤780。If the processing result of the first neural network does not meet the speed and accuracy requirements of the user, the execution device 310 may also execute step 760 and step 770, or the execution device 310 may also execute step 780.
步骤760、执行设备310从超网络中确定第二神经网络。In step 760, the executing device 310 determines the second neural network from the hypernetwork.
第二神经网络可以是用户指定的神经网络,例如,第二神经网络可以为超网络中的子网络。用户指定神经网络的规则如下:如果用户需要提升执行设备310处理应用数据的精度,第二神经网络包含的网络层的数量大于第一神经网络包括的网络层的数量,或者,第二神经网络包含的通道的数量大于第一神经网络包括的通道的数量。如果用户需要提升执行设备310处理应用数据的速度,即减少执行设备310处理应用数据的运行时长,第二神经网络包含的网络层的数量小于第一神经网络包括的网络层的数量,或者,第二神经网络包含的通道的数量小于第一神经网络包括的通道的数量。The second neural network may be a user-specified neural network, for example, the second neural network may be a subnetwork in the supernetwork. The rules for specifying the neural network by the user are as follows: if the user needs to improve the accuracy of processing application data by the execution device 310, the number of network layers included in the second neural network is greater than the number of network layers included in the first neural network, or the second neural network includes The number of channels is greater than the number of channels included in the first neural network. If the user needs to increase the processing speed of the execution device 310 to process application data, that is, to reduce the running time of the execution device 310 to process application data, the number of network layers included in the second neural network is smaller than the number of network layers included in the first neural network, or, the first neural network includes The number of channels included in the second neural network is smaller than the number of channels included in the first neural network.
步骤770、执行设备310利用第二神经网络得到应用数据的处理结果。In step 770, the execution device 310 obtains the processing result of the application data by using the second neural network.
步骤780、执行设备310调整第一神经网络对应的场景数据。Step 780, the execution device 310 adjusts the scene data corresponding to the first neural network.
如果执行设备310利用第一神经网络处理应用数据的处理结果的精度无法满足用户的精度需求,或执行设备310利用第一神经网络处理应用数据得到处理结果的运行时长无法满足用户的速度需求,可能是第一神经网络关联的应用场景特征和运行场景特征较多,执行设备310可以修改第一神经网络关联的应用场景特征和运行场景特征中至少一个。If the execution device 310 uses the first neural network to process the application data, the accuracy of the processing results cannot meet the user's precision requirements, or the running time for the execution device 310 to use the first neural network to process the application data to obtain the processing results cannot meet the user's speed requirements. If there are many application scenario features and running scenario features associated with the first neural network, the executing device 310 may modify at least one of the application scenario features and running scenario features associated with the first neural network.
例如,应用场景为在上下班高峰期时段识别人流量,由于上下班高峰期时段人流量非常多,如果执行设备310继续利用规模较小的神经网络对人流量进行识别的准确率较低,无法满足人流量识别的精度需求。因此执行设备310根据人流量将上下班高 峰期时段划分为多个时段,每个时段关联一个神经网络,使得执行设备310根据在每个时段利用不同的神经网络进行人流量识别。例如,人流量较大的时段,执行设备310利用规模较小的神经网络对人流量进行识别,可以确保精度需求的前提下,满足人流量识别的速度需求。又如,人流量较小的时段,执行设备310利用规模较大的神经网络对人流量进行识别,可以确保速度需求的前提下,满足人流量识别的精度需求。For example, the application scenario is to identify the flow of people during rush hours. Since there are a lot of people during rush hours, if the execution device 310 continues to use a small-scale neural network to identify the flow of people, the accuracy rate is low, and it cannot Meet the accuracy requirements of people flow recognition. Therefore, the execution device 310 divides the rush hour period into multiple periods according to the flow of people, and each period is associated with a neural network, so that the execution device 310 uses a different neural network for each period to identify the flow of people. For example, during a time period when the flow of people is large, the execution device 310 uses a small-scale neural network to identify the flow of people, which can meet the speed requirement for the recognition of the flow of people while ensuring the accuracy requirements. For another example, during a time period when the flow of people is small, the execution device 310 uses a large-scale neural network to identify the flow of people, which can meet the accuracy requirements of the recognition of the flow of people under the premise of ensuring the speed requirement.
又如,应用场景为智能终端利用人脸识别功能对用户的人脸进行识别,实现对智能终端进行解锁的功能。用户在短时间内进行了两次人脸识别来解锁智能终端。如果智能终端连续利用规模较大的神经网络对人脸进行识别,虽然准确率较高,满足人脸识别的精度需求,但是人脸识别的运行时长较长,无法满足用户对人脸识别的速度需求。因此智能终端可以调整人脸识别的预设间隔与神经网络的对应关系。若智能终端检测到两次人脸识别的时间间隔在预设间隔内,使得智能终端确定预设间隔关联的第一神经网络可以是规模较小的神经网络。智能终端利用规模较小的神经网络对人脸进行识别,可以确保精度需求的前提下,满足人脸识别的速度需求。For another example, the application scenario is that the smart terminal uses the face recognition function to recognize the user's face to realize the function of unlocking the smart terminal. The user performs face recognition twice in a short period of time to unlock the smart terminal. If the smart terminal continuously uses a large-scale neural network to recognize faces, although the accuracy rate is high and meets the accuracy requirements of face recognition, the running time of face recognition is long, which cannot meet the speed of face recognition by users. need. Therefore, the smart terminal can adjust the correspondence between the preset interval of face recognition and the neural network. If the smart terminal detects that the time interval between two face recognitions is within the preset interval, the smart terminal determines that the first neural network associated with the preset interval may be a smaller-scale neural network. The smart terminal uses a small-scale neural network to recognize faces, which can meet the speed requirements of face recognition under the premise of ensuring the accuracy requirements.
示例地,图10为本申请实施例提供的一种调整场景数据的界面示意图。假设执行设备310为智能终端,如图10中的(a)所示,智能终端显示人脸识别的结果示意图。智能终端显示有在十分钟内进行两次人脸识别,两次人脸识别的时长均为4分钟。可选地,智能终端还可以显示“是否更新”按钮1010。若用户点击“是否更新”按钮1010。智能终端可以显示如图10中的(b)所示的界面。如图10中的(b)所示,智能终端显示有在两分钟内进行两次人脸识别,第一次人脸识别的时长为4分钟,第二次人脸识别的时长为2分钟,是否执行。界面可以显示“是”按钮1020和“否”按钮1030。用户可以点击“是”按钮1020。若智能终端在两分钟内进行两次人脸识别,第一次人脸识别的时长为4分钟,第二次人脸识别的时长为2分钟。By way of example, FIG. 10 is a schematic diagram of an interface for adjusting scene data provided in an embodiment of the present application. Assuming that the execution device 310 is a smart terminal, as shown in (a) in FIG. 10 , the smart terminal displays a schematic diagram of a face recognition result. The smart terminal shows that there are two face recognitions within ten minutes, and the duration of the two face recognitions is 4 minutes. Optionally, the smart terminal may also display a
需要说明的是,本申请实施例所述的应用场景可以包括目标检测场景、监控场景和语音识别场景,商品推荐场景,等等。It should be noted that the application scenarios described in the embodiments of the present application may include target detection scenarios, monitoring scenarios, speech recognition scenarios, commodity recommendation scenarios, and so on.
目标检测是计算机视觉重要的组成部分。计算机视觉是各个应用领域,如制造业、检验、文档分析和医疗诊断等领域中各种智能/自主系统中不可分割的一部分,它是一门关于如何运用照相机/摄像机和计算机来获取用户所需的被拍摄对象的数据与信息的学问。形象地说,就是给计算机安装上眼睛(照相机/摄像机)和大脑(算法)用来代替人眼对目标进行识别和测量等,从而使计算机能够感知环境。因为感知可以看作是从感官信号中提取信息,所以计算机视觉也可以看作是研究如何使人工系统从图像或多维数据中“感知”的科学。总的来说,计算机视觉就是用各种成像系统代替视觉器官获取输入信息,再由计算机来代替大脑对这些输入信息完成处理和解释。计算机视觉的最终研究目标就是使计算机能像人那样通过视觉观察和理解世界,具有自主适应环境的能力。Object detection is an important part of computer vision. Computer vision is an integral part of various intelligent/autonomous systems in various application fields, such as manufacturing, inspection, document analysis, and medical diagnosis. The subject's data and information knowledge. To put it figuratively, it is to install eyes (cameras/video cameras) and brains (algorithms) on computers to replace human eyes to identify and measure targets, so that computers can perceive the environment. Because perception can be thought of as extracting information from sensory signals, computer vision can also be thought of as the science of how to make artificial systems "perceive" from images or multidimensional data. In general, computer vision is to use various imaging systems to replace the visual organs to obtain input information, and then use the computer to replace the brain to complete the processing and interpretation of these input information. The ultimate research goal of computer vision is to enable computers to observe and understand the world through vision like humans, and have the ability to adapt to the environment autonomously.
目标检测方法可以应用在人脸检测、车辆检测、行人计数、自动驾驶、安全系统和医疗领域等场景。例如,在自动驾驶场景中,自动驾驶汽车在行驶过程中,识别周围环境内的物体,以调整自动驾驶汽车的速度和方向,以便于自动驾驶汽车能够安全行驶,避免发生交通事故。物体可以是其它车辆、交通控制设备或者其它类型的物体。又如,在安全系统中,对大量的用户进行识别,辅助工作人员尽快地确定目标人物。 通常,将输入数据(如图像或视频)输入到具有目标检测功能的神经网络,神经网络对输入数据进行特征提取,基于提取的特征进行目标检测,得到检测结果。Object detection methods can be applied in scenarios such as face detection, vehicle detection, pedestrian counting, automatic driving, security systems, and medical fields. For example, in an autonomous driving scenario, an autonomous vehicle recognizes objects in the surrounding environment during driving to adjust the speed and direction of the autonomous vehicle so that the autonomous vehicle can drive safely and avoid traffic accidents. Objects may be other vehicles, traffic control devices, or other types of objects. As another example, in the security system, a large number of users are identified to assist the staff to determine the target person as soon as possible. Usually, the input data (such as image or video) is input to the neural network with target detection function, the neural network performs feature extraction on the input data, and the target detection is performed based on the extracted features, and the detection result is obtained.
另外,执行设备310可以在执行步骤730,即执行设备310根据场景感知数据和预设条件确定处理应用数据的第一神经网络之前,已经存储了超网络和预设条件,因此,执行设备310可以从存储器中读取超网络和预设条件,根据场景感知数据和预设条件确定处理应用数据的第一神经网络。In addition, the execution device 310 may have stored the hypernetwork and the preset conditions before executing step 730, that is, the execution device 310 determines the first neural network for processing application data according to the scene awareness data and the preset conditions. Therefore, the execution device 310 may The hypernetwork and preset conditions are read from the memory, and the first neural network for processing application data is determined according to the scene perception data and preset conditions.
可选地,执行设备310没有存储超网络和预设条件,需要从服务器下载超网络和预设条件。服务器可以是指云服务器。Optionally, the execution device 310 does not store the hypernetwork and preset conditions, and needs to download the hypernetwork and preset conditions from the server. The server may refer to a cloud server.
示例地,图11为本申请提供的一种系统1100的结构示意图,如图11所示,系统1100可以是利用基础资源向用户提供云服务的实体。系统1100包括云数据中心1110。所述云数据中心1110包括设备资源池(包括计算资源1111、存储资源1112和网络资源1113)和云服务平台1120。云数据中心1110包括的计算资源1111可以是计算设备(例如服务器)。As an example, FIG. 11 is a schematic structural diagram of a system 1100 provided in the present application. As shown in FIG. 11 , the system 1100 may be an entity that provides cloud services to users by using basic resources. System 1100 includes cloud data center 1110 . The cloud data center 1110 includes a device resource pool (including computing resources 1111 , storage resources 1112 and network resources 1113 ) and a cloud service platform 1120 . The computing resource 1111 included in the cloud data center 1110 may be a computing device (such as a server).
执行设备1200上可以部署交互装置1210。交互装置1210可以是浏览器或者能够实现与云服务平台1120进行消息交互的应用。用户可以通过交互装置1210访问云服务平台1120,向云数据中心1110上传请求,请求获取超网络301和预设条件302。云数据中心1110接收到执行设备1200上传的请求后,向执行设备1200反馈超网络301和预设条件302。执行设备1200可以是智能终端或边缘小站。边缘小站可以处理自动驾驶汽车的应用数据,将处理结果传输给自动驾驶汽车。处理结果用于指示自动驾驶汽车运行操作。The
可以理解的是,为了实现上述实施例中的功能,终端包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。It can be understood that, in order to implement the functions in the foregoing embodiments, the terminal includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
上文中结合图1至图11,详细描述了根据本实施例所提供的数据处理方法,下面将结合图12,描述根据本实施例所提供的数据处理装置。The data processing method provided according to this embodiment is described in detail above with reference to FIG. 1 to FIG. 11 , and the data processing device provided according to this embodiment will be described below in conjunction with FIG. 12 .
图12为本实施例提供的可能的数据处理装置的结构示意图。这些数据处理装置可以用于实现上述方法实施例中执行设备的功能,因此也能实现上述方法实施例所具备的有益效果。在本实施例中,该数据处理装置可以是如图3所示的执行设备310,还可以是应用于服务器的模块(如芯片)。FIG. 12 is a schematic structural diagram of a possible data processing device provided by this embodiment. These data processing apparatuses can be used to implement the functions of the execution devices in the above method embodiments, and thus can also achieve the beneficial effects of the above method embodiments. In this embodiment, the data processing apparatus may be the execution device 310 shown in FIG. 3 , or may be a module (such as a chip) applied to a server.
如图12所示,数据处理装置1200包括通信模块1210、选择模块1220、检测模块1230和存储模块1240。数据处理装置1200用于实现上述图7、图8、或图9中所示的方法实施例中执行设备310的功能。As shown in FIG. 12 , the data processing device 1200 includes a
通信模块1210用于获取待处理的应用数据和场景感知数据。所述场景感知数据用于指示执行设备310处理所述应用数据的影响因素。所述场景感知数据用于指示执行设备310处理所述应用数据时影响速度和精度的因素。其中,所述场景感知数据包括外部影响因素和内部影响因素中的至少一个。所述外部影响因素用于描述所述终端获取所述应用数据的应用场景特征。所述内部影响因素用于描述所述终端运行所述应用 数据的硬件资源的运行场景特征。示例地,所述外部影响因素包含温度数据、湿度数据、光照数据和时间数据中至少一种。所述内部影响因素包含处理器的计算能力、可用存储容量和可用剩余电量中至少一种。例如,通信模块1210用于执行图7、图8和图9中步骤710和步骤720。The
选择模块1220用于根据所述场景感知数据和预设条件确定处理所述应用数据的第一神经网络,所述预设条件用于指示影响神经网络运行的场景数据与神经网络的对应关系。例如,选择模块1220用于执行图7、图8和图9中步骤730。The
检测模块1230用于利用所述第一神经网络得到所述应用数据的处理结果。例如,检测模块1230用于执行图7、图8和图9中步骤740。The
选择模块1220根据所述场景感知数据和预设条件确定处理所述应用数据的第一神经网络时,具体用于:确定所述预设条件中包括所述场景感知数据的场景数据对应的第一神经网络的参数,根据所述第一神经网络的参数从超网络中确定所述第一神经网络。所述第一神经网络的参数包括通道的数量和网络层的数量。所述第一神经网络为所述超网络中的子网络,所述超网络用于确定所述场景数据对应的第一神经网络。其中,所述子网络包含的网络层的数量小于所述超网络包括的网络层的数量,或者,所述子网络包含的通道的数量小于所述超网络包括的通道的数量,每层网络层包括至少一个神经元。When the
存储模块1240用于存储预设条件、所述超网络和所述超网络包含的至少一个子网络的参数。选择模块1220根据所述第一神经网络的参数从超网络中确定所述第一神经网络时,具体用于:根据所述第一神经网络的参数从超网络的权重中确定所述第一神经网络的权重。The storage module 1240 is configured to store preset conditions, parameters of the supernetwork and at least one subnetwork included in the supernetwork. When the
可选地,选择模块1220还用于从超网络中确定第二神经网络,所述第二神经网络为所述超网络中的子网络,所述第二神经网络包含的网络层的数量大于或小于所述第一神经网络包括的网络层的数量,或者,所述第二神经网络包含的通道的数量大于或小于所述第一神经网络包括的通道的数量。Optionally, the
可选地,检测模块1230还用于利用所述第二神经网络得到所述应用数据的处理结果。例如,检测模块1230用于执行图9中步骤770。Optionally, the
数据处理装置1200还包括更新模块1250和显示模块1260。The data processing device 1200 also includes an update module 1250 and a
更新模块1250用于若所述第一神经网络的速度和精度不满足用户需求,调整所述第一神经网络对应的场景数据,得到调整后的场景数据,将调整后的场景数据存入存储模块1240。例如,更新模块1250用于执行图9中步骤760和步骤780。The update module 1250 is used to adjust the scene data corresponding to the first neural network if the speed and accuracy of the first neural network do not meet the user's requirements, obtain the adjusted scene data, and store the adjusted scene data in the storage module 1240. For example, the update module 1250 is used to execute step 760 and step 780 in FIG. 9 .
显示模块1260用于显示影响所述第一神经网络的速度和精度的场景数据与所述第一神经网络的对应关系,以及所述处理结果。例如,显示模块1260用于执行图9中步骤750。The
应理解的是,本申请实施例的数据处理装置1200可以通过ASIC实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图7、图8和图9所示的数据处理方法时,数据 处理装置1200及其各个模块也可以为软件模块。It should be understood that the data processing device 1200 in the embodiment of the present application can be realized by an ASIC, or a programmable logic device (programmable logic device, PLD), and the above-mentioned PLD can be a complex programmable logic device (complex programmable logical device, CPLD), Field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof. When the data processing methods shown in Fig. 7, Fig. 8 and Fig. 9 can also be implemented by software, the data processing device 1200 and its modules can also be software modules.
根据本申请实施例的数据处理装置1200可对应于执行本申请实施例中描述的方法,并且数据处理装置1200中的各个单元的上述和其它操作和/或功能分别为了实现图7、图8和图9中的各个方法的相应流程,为了简洁,在此不再赘述。The data processing device 1200 according to the embodiment of the present application may correspond to execute the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of the various units in the data processing device 1200 are respectively in order to realize Fig. 7, Fig. 8 and For the sake of brevity, the corresponding flow of each method in FIG. 9 will not be repeated here.
图13为本实施例提供的一种终端1300的结构示意图。如图所示,终端1300包括处理器1310、总线1320、存储器1330通信接口1340。FIG. 13 is a schematic structural diagram of a terminal 1300 provided in this embodiment. As shown in the figure, the terminal 1300 includes a
应理解,在本实施例中,处理器1310可以是CPU,该处理器1310还可以是其他通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。It should be understood that in this embodiment, the
处理器还可以是GPU、NPU、微处理器、ASIC、或一个或多个用于控制本申请方案程序执行的集成电路。The processor can also be a GPU, NPU, microprocessor, ASIC, or one or more integrated circuits used to control the program execution of the solution of this application.
通信接口1340用于实现终端1300与外部设备或器件的通信。在本实施例中,通信接口1340用于接收待处理的应用数据和场景感知数据。The
总线1320可以包括一通路,用于在上述组件(如处理器1310和存储器1330)之间传送信息。总线1320除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线1320。Bus 1320 may include a path for communicating information between the components described above (eg,
作为一个示例,终端1300可以包括多个处理器。处理器可以是一个多核As one example, the terminal 1300 may include multiple processors. The processor can be a multi-core
(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的计算单元。处理器1310可以调用存储器1330存储的超网络和预设条件根据所述场景感知数据和所述预设条件确定处理应用数据的第一神经网络,利用所述第一神经网络得到所述应用数据的处理结果。(multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or computing units for processing data (eg, computer program instructions). The
值得说明的是,图13中仅以终端1300包括1个处理器1310和1个存储器1330为例,此处,处理器1310和存储器1330分别用于指示一类器件或设备,具体实施例中,可以根据业务需求确定每种类型的器件或设备的数量。It is worth noting that in FIG. 13, the terminal 1300 includes only one
存储器1330可以对应上述方法实施例中用于存储超网络和预设条件等信息的存储介质,例如,磁盘,如机械硬盘或固态硬盘。The
上述终端1300可以是一个通用设备或者是一个专用设备。例如,终端1300可以是手机终端,平板电脑,笔记本电脑,VR设备、AR设备、混合现实(Mixed Reality,MR)设备或扩展现实(Extended Reality,ER)设备,车载终端等,还可以是边缘设备(例如,携带具有处理能力芯片的盒子)等。可选地,终端1330也可以是服务器或其他具有计算能力的设备。The aforementioned terminal 1300 may be a general-purpose device or a dedicated device. For example, the terminal 1300 may be a mobile phone terminal, a tablet computer, a notebook computer, a VR device, an AR device, a mixed reality (Mixed Reality, MR) device or an extended reality (Extended Reality, ER) device, a vehicle terminal, etc., and may also be an edge device (e.g., a box carrying a chip with processing power), etc. Optionally, terminal 1330 may also be a server or other devices with computing capabilities.
应理解,根据本实施例的终端1300可对应于本实施例中的数据处理装置1200,并可以对应于执行根据图7、图8和图9中任一方法中的相应主体,并且数据处理装置1200中的各个模块的上述和其它操作和/或功能分别为了实现图7、图8和图9中的各个方法的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal 1300 according to this embodiment may correspond to the data processing device 1200 in this embodiment, and may correspond to a corresponding subject performing any method in FIG. 7 , FIG. 8 and FIG. 9 , and the data processing device The above-mentioned and other operations and/or functions of each module in 1200 are respectively for realizing the corresponding flow of each method in FIG. 7 , FIG. 8 and FIG. 9 , and for the sake of brevity, details are not repeated here.
本实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储 器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于网络设备或终端设备中。当然,处理器和存储介质也可以作为分立组件存在于网络设备或终端设备中。The method steps in this embodiment may be implemented by means of hardware, and may also be implemented by means of a processor executing software instructions. Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or known in the art any other form of storage medium. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC. In addition, the ASIC can be located in a network device or a terminal device. Of course, the processor and the storage medium may also exist in the network device or the terminal device as discrete components.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行所述计算机程序或指令时,全部或部分地执行本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其它可编程装置。所述计算机程序或指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序或指令可以从一个网站站点、计算机、服务器或数据中心通过有线或无线方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,例如,软盘、硬盘、磁带;也可以是光介质,例如,数字视频光盘(digital video disc,DVD);还可以是半导体介质,例如,固态硬盘(solid state drive,SSD)。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer programs or instructions. When the computer program or instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are executed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment, or other programmable devices. The computer program or instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be downloaded from a website, computer, A server or data center transmits to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrating one or more available media. Described usable medium can be magnetic medium, for example, floppy disk, hard disk, magnetic tape; It can also be optical medium, for example, digital video disc (digital video disc, DVD); It can also be semiconductor medium, for example, solid state drive (solid state drive) , SSD).
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the application, but the scope of protection of the application is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the scope of the technology disclosed in the application. Modifications or replacements, these modifications or replacements shall be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (21)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110558861.1A CN114970654B (en) | 2021-05-21 | 2021-05-21 | Data processing method and device and terminal |
| CN202110558861.1 | 2021-05-21 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022242175A1 true WO2022242175A1 (en) | 2022-11-24 |
Family
ID=82972903
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/141388 Ceased WO2022242175A1 (en) | 2021-05-21 | 2021-12-24 | Data processing method and apparatus, and terminal |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114970654B (en) |
| WO (1) | WO2022242175A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115564022A (en) * | 2022-09-26 | 2023-01-03 | 支付宝(杭州)信息技术有限公司 | Method and device for predicting elastic adjustment calculation force |
| CN116543266A (en) * | 2023-06-15 | 2023-08-04 | 天津大学 | Automatic driving intelligent model training method and device guided by gazing behavior knowledge |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105488044A (en) * | 2014-09-16 | 2016-04-13 | 华为技术有限公司 | Data processing method and device |
| CN110569984A (en) * | 2019-09-10 | 2019-12-13 | Oppo广东移动通信有限公司 | Configuration information generation method, apparatus, device and storage medium |
| US20200027009A1 (en) * | 2018-07-23 | 2020-01-23 | Kabushiki Kaisha Toshiba | Device and method for optimising model performance |
| CN110956269A (en) * | 2019-10-12 | 2020-04-03 | 平安科技(深圳)有限公司 | Data model generation method, device, equipment and computer storage medium |
| CN111338669A (en) * | 2020-02-17 | 2020-06-26 | 深圳英飞拓科技股份有限公司 | Updating method and device for intelligent function in intelligent analysis box |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105678278A (en) * | 2016-02-01 | 2016-06-15 | 国家电网公司 | Scene recognition method based on single-hidden-layer neural network |
| US11314988B2 (en) * | 2017-12-15 | 2022-04-26 | Huawei Technologies Co., Ltd. | Image aesthetic processing method and electronic device |
| CN110956262A (en) * | 2019-11-12 | 2020-04-03 | 北京小米智能科技有限公司 | Hyper network training method and device, electronic equipment and storage medium |
| CN111459022B (en) * | 2020-04-21 | 2023-10-20 | 深圳市英维克信息技术有限公司 | Device parameter adjustment method, device control apparatus, and computer-readable storage medium |
-
2021
- 2021-05-21 CN CN202110558861.1A patent/CN114970654B/en active Active
- 2021-12-24 WO PCT/CN2021/141388 patent/WO2022242175A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105488044A (en) * | 2014-09-16 | 2016-04-13 | 华为技术有限公司 | Data processing method and device |
| US20200027009A1 (en) * | 2018-07-23 | 2020-01-23 | Kabushiki Kaisha Toshiba | Device and method for optimising model performance |
| CN110569984A (en) * | 2019-09-10 | 2019-12-13 | Oppo广东移动通信有限公司 | Configuration information generation method, apparatus, device and storage medium |
| CN110956269A (en) * | 2019-10-12 | 2020-04-03 | 平安科技(深圳)有限公司 | Data model generation method, device, equipment and computer storage medium |
| CN111338669A (en) * | 2020-02-17 | 2020-06-26 | 深圳英飞拓科技股份有限公司 | Updating method and device for intelligent function in intelligent analysis box |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114970654B (en) | 2023-04-18 |
| CN114970654A (en) | 2022-08-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112990211B (en) | A neural network training method, image processing method and device | |
| CN110070107B (en) | Object recognition method and device | |
| CN111401516B (en) | A method for searching neural network channel parameters and related equipment | |
| WO2021238366A1 (en) | Neural network construction method and apparatus | |
| WO2022083536A1 (en) | Neural network construction method and apparatus | |
| CN110222717B (en) | Image processing method and device | |
| CN111368972B (en) | A convolutional layer quantification method and its device | |
| WO2021043112A1 (en) | Image classification method and apparatus | |
| WO2021147325A1 (en) | Object detection method and apparatus, and storage medium | |
| WO2021043193A1 (en) | Neural network structure search method and image processing method and device | |
| WO2020253416A1 (en) | Object detection method and device, and computer storage medium | |
| WO2021155792A1 (en) | Processing apparatus, method and storage medium | |
| CN113570029A (en) | Method for obtaining neural network model, image processing method and device | |
| CN113807399A (en) | Neural network training method, neural network detection method and neural network detection device | |
| WO2022001805A1 (en) | Neural network distillation method and device | |
| WO2021057186A1 (en) | Neural network training method, data processing method, and related apparatuses | |
| WO2022007867A1 (en) | Method and device for constructing neural network | |
| CN113011562A (en) | Model training method and device | |
| WO2023125628A1 (en) | Neural network model optimization method and apparatus, and computing device | |
| CN117157679A (en) | Perception network, training method of perception network, object recognition method and device | |
| CN115018039A (en) | Neural network distillation method, target detection method and device | |
| CN111797970A (en) | Method and apparatus for training neural network | |
| CN110222718A (en) | The method and device of image procossing | |
| CN114970654B (en) | Data processing method and device and terminal | |
| WO2022179599A1 (en) | Perceptual network and data processing method |
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: 21940617 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: 21940617 Country of ref document: EP Kind code of ref document: A1 |