Neural network model updating method, image processing method and device
By jointly evaluating the parameters and structure of the neural network model, the update process of the neural network model is optimized, solving the problems of low update efficiency and performance conflicts in the existing technology, and realizing efficient neural network model update and optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2019-12-19
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, the update process of neural network models is inefficient, and performance conflicts may occur when modules are combined, making it difficult to achieve optimal performance.
By jointly evaluating the relevant parameters and structure of the neural network model, including hyperparameters, loss functions, and evaluation methods, the update process of the neural network model is optimized, conflicts during individual updates are avoided, and update options are selected using probability distributions to improve update efficiency.
It achieves high efficiency and performance optimization in neural network model updates, avoids performance degradation when combining modules, and quickly reaches the required performance indicators.
Smart Images

Figure CN113011575B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more specifically, to a neural network model update method, an image processing method, and an apparatus. Background Technology
[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. Research in the field of AI includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and fundamental AI theories.
[0003] With the rapid development of artificial intelligence technology, the performance of neural networks (such as convolutional neural networks) has been continuously improved, and neural networks have also achieved great success in the processing and analysis of various media signals such as images, videos, and audio. A high-performance neural network often has an ingenious network structure, but in practical applications, due to differences in training sets, performance requirements, and application goals, existing network structures often cannot be used directly.
[0004] For the entire business process, traditional solutions typically involve feeding raw data into a preprocessing module, then feeding the processed data into a neural network for feature learning, and finally updating the neural network using a loss function. Currently, a common practice in traditional solutions is to design an automated machine learning (AutoML) task for each module in the business process, automatically searching for the optimal module for each module, such as preprocessing methods, network model structures, and loss functions. However, the combination of modules obtained from this approach may not achieve optimal performance. Furthermore, conflicts between certain modules can even lead to performance degradation.
[0005] Therefore, how to efficiently update neural network models has become a pressing technical problem that needs to be solved. Summary of the Invention
[0006] This application provides a neural network model update method, an image processing method, and an apparatus, which can improve the efficiency of neural network model updates.
[0007] Firstly, a method for updating a neural network model is provided. This method includes: acquiring the structure and relevant parameters of the neural network model; inputting training data into the neural network model for processing to obtain predicted labels; determining the value of a loss function based on the predicted labels and the labels of the training data, and training the neural network model based on the value of the loss function and the hyperparameters of the neural network model to obtain a trained neural network model; evaluating the trained neural network model using an evaluation method; and if the evaluation result of the trained neural network model does not meet preset conditions, updating at least two of the relevant parameters and the structure of the neural network model until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches a preset number. The relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model.
[0008] Specifically, at least two of the parameters and structure of the neural network model are updated, including updating the structure of the neural network model and / or updating the parameters of the neural network model.
[0009] For example, updating at least two of the relevant parameters and the structure of a neural network model can update the structure and loss function of the neural network model.
[0010] For example, updating at least two of the parameters and structures of a neural network model can update its hyperparameters and loss function. In other words, the structure and evaluation method of the neural network model can remain unchanged during the update process. In this case, the optimal combination of the loss function and the hyperparameters of the neural network model can be obtained. This combination can be applied to other neural network models to improve the efficiency of neural network model updates.
[0011] For example, the evaluation method is related to the evaluation metrics. Evaluation metrics may include at least one of the following: the target size of the neural network model, the target inference accuracy of the neural network model, and the target inference latency of the neural network model. The target size of the neural network model can be understood as the target memory occupied by the neural network model.
[0012] For example, evaluation methods could include assessing the size of the neural network model and its inference accuracy. Another example is evaluating the inference accuracy of the neural network model.
[0013] It should be understood that the above evaluation method can be set according to the user's needs, and the specific content of the evaluation indicators is not limited in the embodiments of this application.
[0014] In this embodiment, any two of the relevant parameters and the structure of the neural network model are updated, and the updated relevant parameters and structure of the neural network model are evaluated. This achieves joint evaluation of multiple parameters, avoids conflicts that may occur when updating each parameter individually, and ensures that the combination of the relevant parameters and the structure of the final neural network model can reach the required performance indicators as soon as possible, thereby improving the efficiency of neural network model updates.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the relevant parameters of the neural network model also include a preprocessing method, and inputting the training data into the neural network model for processing to obtain the predicted label, including: preprocessing the training data using a preprocessing method; and inputting the preprocessed training data into the neural network model for processing to obtain the predicted label.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, the relevant parameters of the neural network model also include the neural network model compression method, and the input of training data into the neural network model for processing to obtain predicted labels, including: processing the neural network model using the neural network model compression method to obtain the processed neural network model; and inputting the training data into the processed neural network model to obtain predicted labels.
[0017] Specifically, processing the neural network model using the above-mentioned neural network model compression method includes compressing the neural network model and / or quantizing the neural network model.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, updating at least two of the relevant parameters of the neural network model and the structure of the neural network model includes: determining the probability distribution of multiple candidate options corresponding to each of the relevant parameters of the neural network model and the structure of the neural network model based on first information corresponding to each of the at least two of the relevant parameters of the neural network model and the structure of the neural network model, wherein the first information corresponding to each of the at least two of the relevant parameters of the neural network model includes the evaluation result; and determining one of the multiple candidate options corresponding to each of the at least two ...
[0019] For example, updating the structure and loss function of a neural network model includes: determining the probability distribution of the structures of multiple candidate neural network models based on first information corresponding to the structure of the neural network model; determining one of the structures of the multiple candidate neural network models as the updated neural network model structure based on the probability distribution of the structures of the multiple candidate neural network models; determining the probability distribution of multiple candidate loss functions based on first information corresponding to the loss function; determining one of the multiple candidate loss functions as the updated loss function based on the probability distribution of the multiple candidate loss functions. Here, the first information corresponding to the structure of the neural network model includes the evaluation result of the previously updated neural network model. The first information corresponding to the loss function includes the evaluation result of the previously updated neural network model.
[0020] In this embodiment, one of the multiple candidate options corresponding to each item is determined as the updated option for each item based on the probability distribution of the multiple candidate options corresponding to each item. This can improve the efficiency of the update process and avoid the update process from getting stuck in local optima.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, the first information corresponding to each item also includes the relevant parameters of the neural network model and the relevant information of other items in at least two items of the structure of the neural network model. The relevant information of other items includes the probability distribution of multiple candidate options corresponding to other items and / or other items.
[0022] In the embodiments of this application, obtaining relevant information of other items during the update process enables joint update optimization. During the update process, potential conflicts between various parameters can be avoided, so that the combination of relevant parameters and the structure of the final neural network model can reach the required performance indicators as soon as possible, thereby improving the efficiency of neural network model update.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: obtaining relevant information about other items based on a first frequency, wherein the first frequency is related to the business scale processed by the trained neural network model.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the first information corresponding to each item also includes historical information related to each item, which includes the updated options of each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0025] In conjunction with the first aspect, in some implementations of the first aspect, the first information corresponding to each item also includes training resource status information, which includes the number of training machines.
[0026] Training resource status information may also include the number of training machines currently available.
[0027] In conjunction with the first aspect, in some implementations of the first aspect, the hyperparameters of the neural network model include parameters that remain unchanged during the training of the neural network model.
[0028] In conjunction with the first aspect, in some implementations of the first aspect, the hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
[0029] Secondly, an image processing method is provided, comprising: acquiring an image to be processed; processing the image to be processed using a target neural network model to obtain a processing result of the image to be processed; wherein, the target neural network model is obtained by updating at least two of the relevant parameters and the structure of the neural network model until the evaluation result of the updated neural network model meets preset conditions and / or the number of updates reaches a preset number, wherein the relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model, the neural network model is obtained by determining the function value of the loss function based on the predicted label and the label of the training data, and training based on the function value of the loss function and the hyperparameters of the neural network model; the predicted label is obtained by inputting the training data into the neural network model for processing.
[0030] It should be understood that the target neural network model used in the image processing method in the second aspect can be trained again based on the training images before performing image classification. The trained target neural network model can then classify the images to be processed.
[0031] In other words, the target neural network model can be obtained by using the neural network model update method in the first aspect. Then, the target neural network model can be trained based on the training images. After training, the target neural network model can be used to classify the images to be processed.
[0032] Alternatively, the target neural network model can be obtained using the neural network model update method in the first aspect. This target neural network model can be a pre-trained neural network model, which can be used to classify the image to be processed.
[0033] In this application, since the target neural network model is obtained using the method described in the first aspect, it closely matches or closely aligns with the application requirements of neural network models. Using such a neural network model for image classification yields better image classification results (e.g., more accurate classification results, etc.). Updating any two parameters of the neural network model and its related parameters, and then evaluating the updated neural network model and its related parameters, achieves joint evaluation of multiple parameters. This avoids potential conflicts that may arise when updating individual parameters, ensuring that the final neural network model and its related parameter combination can quickly reach the required performance indicators, improving the efficiency of neural network model updates, and obtaining the target neural network model more quickly.
[0034] In conjunction with the second aspect, in some implementations of the second aspect, the relevant parameters of the neural network model also include preprocessing methods. The predicted label is obtained by preprocessing the training data using the preprocessing method and then inputting the preprocessed training data into the neural network model for processing.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the relevant parameters of the neural network model also include the neural network model compression method. The predicted label is obtained by processing the neural network model using the neural network model compression method and then inputting the training data into the processed neural network model.
[0036] In conjunction with the second aspect, in some implementations of the second aspect, updating at least two items of the relevant parameters of the neural network model and the structure of the neural network model includes: determining the probability distribution of multiple candidate options corresponding to each item based on first information corresponding to each item of the relevant parameters of the neural network model and the structure of the neural network model, wherein the first information corresponding to each item includes the evaluation result; and determining one of the multiple candidate options corresponding to each item as the updated option for each item based on the probability distribution of the multiple candidate options corresponding to each item.
[0037] In conjunction with the second aspect, in some implementations of the second aspect, the first information corresponding to each item also includes the relevant parameters of the neural network model and the relevant information of other items in at least two items of the structure of the neural network model. The relevant information of other items includes the probability distribution of multiple candidate options corresponding to other items and / or other items.
[0038] In conjunction with the second aspect, in some implementations of the second aspect, the first information corresponding to each item also includes historical information related to each item, which includes the updated options of each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0039] In conjunction with the second aspect, in some implementations of the second aspect, the first information corresponding to each item also includes training resource status information, which includes the number of training machines.
[0040] In conjunction with the second aspect, in some implementations of the second aspect, the hyperparameters of the neural network model include parameters that remain unchanged during the training of the neural network model.
[0041] In conjunction with the second aspect, in some implementations of the second aspect, the hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
[0042] Thirdly, an apparatus for updating a neural network model is provided, the apparatus comprising a module or unit for performing the methods described in the first aspect and any implementation thereof.
[0043] Fourthly, an image processing apparatus is provided, the apparatus comprising a module or unit for performing the methods of the second aspect and any implementation thereof.
[0044] It should be understood that the extensions, limitations, interpretations and descriptions of the relevant content in the first aspect above also apply to the same content in the second, third and fourth aspects.
[0045] Fifthly, an apparatus for updating a neural network model is provided, the apparatus comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method of the first aspect and any implementation thereof.
[0046] The processor mentioned in the fifth aspect above can be a central processing unit (CPU) or a combination of a CPU and a neural network processing processor. The neural network processing processor can include a graphics processing unit (GPU), a neural network processing unit (NPU), and a tensor processing unit (TPU), etc. The TPU is a dedicated integrated circuit developed by Google for a fully customized artificial intelligence accelerator for machine learning.
[0047] In a sixth aspect, an image processing apparatus is provided, comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method of the second aspect and any implementation thereof.
[0048] The processor mentioned in the sixth aspect above can be a central processing unit (CPU) or a combination of a CPU and a neural network processing processor. The neural network processing processor can include a graphics processing unit (GPU), a neural network processor, and a tensor processor, among others. The TPU is a Google application-specific integrated circuit (ASIC) for a fully custom-designed AI accelerator for machine learning.
[0049] A seventh aspect provides a computer-readable medium storing program code for execution by a device, the program code including methods for performing any implementation of the first or second aspect.
[0050] Eighthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the method in any one of the implementations of the first or second aspect described above.
[0051] Ninth aspect, a chip is provided, the chip including a processor and a data interface, the processor reading instructions stored in a memory through the data interface and executing the method in any one of the implementations of the first or second aspect described above.
[0052] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in either the first aspect or the second aspect.
[0053] The aforementioned chip can be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). Attached Figure Description
[0054] Figure 1 This is a schematic diagram of an artificial intelligence main framework provided in an embodiment of this application;
[0055] Figure 2 A schematic diagram of a system architecture provided in an embodiment of this application;
[0056] Figure 3This is a schematic diagram of the structure of a convolutional neural network provided in an embodiment of this application;
[0057] Figure 4 This is a schematic diagram of another convolutional neural network structure provided in an embodiment of this application;
[0058] Figure 5 A schematic diagram of the hardware structure of a chip provided in an embodiment of this application;
[0059] Figure 6 A schematic diagram of a system architecture provided for an embodiment of this application;
[0060] Figure 7 This is a schematic flowchart illustrating automatic neural network model updates;
[0061] Figure 8 This is a schematic flowchart illustrating the application of automated machine learning to neural network models;
[0062] Figure 9 This is a schematic flowchart of the neural network model update method provided in the embodiments of this application;
[0063] Figure 10 This is a schematic block diagram of the neural network model updating device provided in the embodiments of this application;
[0064] Figure 11 This is a schematic block diagram of another neural network model updating device provided in the embodiments of this application;
[0065] Figure 12 This is a schematic flowchart of another neural network model update method provided in an embodiment of this application;
[0066] Figure 13 This is a schematic flowchart of the image processing method provided in the embodiments of this application;
[0067] Figure 14 This is a schematic block diagram of the neural network model updating device provided in the embodiments of this application;
[0068] Figure 15 This is a schematic block diagram of the image processing apparatus provided in the embodiments of this application;
[0069] Figure 16 This is a schematic block diagram of the neural network model training device provided in the embodiments of this application. Detailed Implementation
[0070] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0071] Figure 1 A schematic diagram of an artificial intelligence framework is shown, which describes the overall workflow of an artificial intelligence system and is applicable to general artificial intelligence domain needs.
[0072] The above-mentioned artificial intelligence framework will be elaborated in detail from two dimensions: the "intelligent information chain" (horizontal axis) and the "information technology (IT) value chain" (vertical axis).
[0073] The "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it could be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom."
[0074] The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence, information (provided and processed by technology) to the industrial ecosystem of systems.
[0075] (1) Infrastructure:
[0076] Infrastructure provides computing power to support artificial intelligence systems, enables them to communicate with the outside world, and provides support through basic platforms.
[0077] Infrastructure can communicate with the outside world through sensors, and its computing power can be provided by smart chips.
[0078] The intelligent chips here can be hardware acceleration chips such as central processing units (CPUs), neural network processing units (NPUs), graphics processing units (GPUs), application-specific integrated circuits (ASICs), and field-programmable gate arrays (FPGAs).
[0079] The basic platform of the infrastructure can include distributed computing frameworks and related platform guarantees and support, such as cloud storage and computing, and interconnected networks.
[0080] For example, for infrastructure, data can be acquired through sensors and external communication, and then this data can be provided to intelligent chips in the distributed computing system provided by the basic platform for computation.
[0081] (2) Data:
[0082] The data at the next layer of infrastructure is used to represent data sources in the field of artificial intelligence. This data includes graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0083] (3) Data processing:
[0084] The aforementioned data processing typically includes data training, machine learning, deep learning, search, reasoning, and decision-making.
[0085] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data by symbolizing and formalizing it.
[0086] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.
[0087] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.
[0088] (4) General abilities:
[0089] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0090] (5) Smart products and industry applications:
[0091] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent manufacturing, intelligent transportation, smart home, intelligent healthcare, intelligent security, autonomous driving, safe city, and intelligent terminals.
[0092] The embodiments of this application can be applied to many fields of artificial intelligence, such as intelligent manufacturing, intelligent transportation, smart home, intelligent healthcare, intelligent security, autonomous driving, and safe city.
[0093] Specifically, the embodiments of this application can be applied to fields that require the use of (deep) neural networks, such as autonomous driving, image classification, image retrieval, image semantic segmentation, image quality enhancement, image super-resolution, and natural language processing.
[0094] The following is a brief introduction to three application scenarios: photo album categorization, safe city initiatives, and cloud services for automatic machine learning (AutoML).
[0095] Photo album categories:
[0096] When users store a large number of pictures on their terminal devices (such as mobile phones) or cloud storage, recognizing the images in the album can make it easier for users or the system to classify and manage the album, thus improving the user experience.
[0097] The neural network model update method of this application embodiment can obtain or optimize a neural network suitable for album classification. This neural network can then be used to classify images, thereby tagging images of different categories for easy viewing and searching by users. Furthermore, these image classification tags can be provided to the album management system for categorized management, saving users' management time, improving album management efficiency, and enhancing user experience.
[0098] Attribute recognition in the context of safe city:
[0099] In the context of safe city initiatives, various attribute recognition methods are required, such as pedestrian and cyclist attribute recognition. Deep neural networks, with their powerful capabilities, play a crucial role in these recognition processes. By employing the neural network model update method described in this application, a neural network suitable for attribute recognition in safe city scenarios can be obtained or optimized. This neural network can then be used to process the input road images, thereby identifying different attribute information within the road images.
[0100] Automated Machine Learning Cloud Service:
[0101] In automated machine learning cloud service platforms, users can customize neural network models and / or obtain relevant parameters of neural network models according to their own needs and tasks. Utilizing the neural network model update method provided in this application embodiment, it is possible to obtain neural network models and / or relevant parameters of neural network models according to user needs, thereby improving the performance of the cloud service platform.
[0102] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts of neural networks that may be involved in the embodiments of this application will be introduced below.
[0103] (1) Neural Network
[0104] Neural networks can be composed of neural units, which can refer to units represented by x. s The arithmetic unit that takes an intercept of 1 as input can output the following:
[0105]
[0106] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x s The weights are denoted by b, where b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer; the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together; that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.
[0107] (2) Deep Neural Networks
[0108] A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with multiple hidden layers. Based on the position of the layers, the internal neural network of a DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer.
[0109] Although DNNs seem complex, the operation of each layer is actually not complicated. Simply put, it involves the following linear relationship expression: in, It is the input vector. It is the output vector. α is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply an adjustment of the input vector. The output vector is obtained through such a simple operation. Because DNNs have many layers, the coefficients W and the offset vector... The number of these parameters is also relatively large. The definitions of these parameters in DNNs are as follows: Taking the coefficient W as an example: Assuming a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W is located, while the subscript corresponds to the third layer index 2 of the output and the second layer index 4 of the input.
[0110] In summary, the coefficient from the k-th neuron in layer L-1 to the j-th neuron in layer L is defined as...
[0111] It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).
[0112] (3) Convolutional Neural Network
[0113] A convolutional neural network (CNN) is a deep neural network with a convolutional structure. A CNN contains a feature extractor consisting of convolutional layers and subsampling layers, which can be viewed as a filter. A convolutional layer is a layer of neurons in a CNN that performs convolutional processing on the input signal. In a convolutional layer of a CNN, a neuron may only be connected to some of its neighboring neurons. A convolutional layer typically contains several feature planes, each composed of rectangularly arranged neural units. Neural units on the same feature plane share weights, which are called the convolutional kernel. Shared weights can be understood as the way image information is extracted regardless of location. The convolutional kernel can be formalized as a matrix of random size, and during the training process of the CNN, the kernel can learn appropriate weights. Furthermore, the direct benefit of shared weights is reducing the connections between layers in the CNN, while also reducing the risk of overfitting.
[0114] (4) Recurrent neural networks (RNNs) are used to process sequential data. In traditional neural network models, the layers are fully connected from the input layer to the hidden layer and then to the output layer, but the nodes within each layer are unconnected. While this type of ordinary neural network has solved many difficult problems, it is still powerless against many others. For example, to predict the next word in a sentence, you generally need to use the preceding words because the words in a sentence are not independent. RNNs are called recurrent neural networks because the current output of a sequence is related to the previous output. Specifically, the network memorizes previous information and applies it to the calculation of the current output. That is, the nodes within the hidden layer are no longer unconnected but connected, and the input of the hidden layer includes not only the output of the input layer but also the output of the hidden layer at the previous time step. Theoretically, RNNs can process sequential data of any length. Training an RNN is the same as training a traditional CNN or DNN.
[0115] Since we already have convolutional neural networks (CNNs), why do we need recurrent neural networks (RNNs)? The reason is simple. CNNs rely on the fundamental assumption that elements are independent of each other, and that input and output are also independent—like a cat and a dog. However, in the real world, many elements are interconnected. For example, stock prices fluctuate over time. Or, imagine someone saying, "I love traveling, and my favorite place is Yunnan. I definitely want to go there someday." Humans know the answer to this question is "Yunnan." Humans can infer from context, but how can machines do the same? This is where RNNs come in. RNNs aim to give machines the ability to remember, just like humans. Therefore, the output of an RNN depends on both the current input information and historical memory information.
[0116] (5) Loss Function
[0117] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.
[0118] (6) Backpropagation algorithm
[0119] Neural networks can employ backpropagation (BP) to correct the parameters of the neural network model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.
[0120] like Figure 2 As shown, this application embodiment provides a system architecture 100. In Figure 2 In this embodiment, the data acquisition device 160 is used to acquire training data. For the image processing method of this application, the training data may include training images and corresponding classification results, wherein the results of the training images may be manually pre-annotated results.
[0121] After collecting the training data, the data acquisition device 160 stores the training data in the database 130, and the training device 120 trains the target model / rule 101 based on the training data maintained in the database 130.
[0122] The following describes how the training device 120 obtains the target model / rule 101 based on the training data. The training device 120 processes the input original image and compares the output image with the original image until the difference between the output image of the training device 120 and the original image is less than a certain threshold, thereby completing the training of the target model / rule 101.
[0123] The aforementioned target model / rule 101 can be used to implement the image processing method of this application embodiment. Specifically, the target model / rule 101 in this application embodiment can be a neural network. It should be noted that in practical applications, the training data maintained in the database 130 may not all come from the data acquisition device 160; it may also be received from other devices. Furthermore, it should be noted that the training device 120 may not necessarily train the target model / rule 101 entirely based on the training data maintained in the database 130; it may also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.
[0124] The target model / rule 101 trained using training device 120 can be applied to different systems or devices, such as... Figure 2 The execution device 110 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server or cloud service. Figure 2 In this embodiment, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with external devices. Users can input data to the I / O interface 112 through the client device 140. The input data may include the image to be processed input by the client device.
[0125] Preprocessing module 113 and preprocessing module 114 are used to preprocess the input data (such as the image to be processed) received by I / O interface 112. In this embodiment, preprocessing module 113 and preprocessing module 114 may be omitted (or only one of them may be used), and the calculation module 111 may be used directly to process the input data.
[0126] During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processes, the execution device 110 can call data, code, etc. in the data storage system 150 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.
[0127] Finally, I / O interface 112 returns the processing results, such as the image classification results obtained above, to client device 140, thereby providing them to the user.
[0128] It is worth noting that the training device 120 can generate corresponding target models / rules 101 based on different training data for different objectives or tasks. The corresponding target models / rules 101 can be used to achieve the above objectives or complete the above tasks, thereby providing the user with the required results.
[0129] exist Figure 2 In the scenario shown, the user can manually provide input data, which can be done through the interface provided by I / O interface 112. Alternatively, the client device 140 can automatically send input data to I / O interface 112. If user authorization is required for the client device 140 to automatically send input data, the user can set the corresponding permissions in the client device 140. The user can view the output results of the execution device 110 on the client device 140, which can be presented in various forms such as display, sound, or animation. The client device 140 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130. Alternatively, data can be collected directly from the I / O interface 112 without going through the client device 140, using the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130.
[0130] It is worth noting that, Figure 2 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 2 In this context, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed within the execution device 110.
[0131] like Figure 2 As shown, the target model / rule 101 is obtained by training according to the training device 120. The target model / rule 101 can be the neural network in this application embodiment. Specifically, the neural network constructed in this application embodiment can be CNN, deep convolutional neural network (DCNN), recurrent neural network (RNNS), etc.
[0132] Since CNN is a very common type of neural network, the following will combine... Figure 3 This section focuses on a detailed explanation of the structure of CNNs. As mentioned in the basic concept introduction above, a Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. It is a deep learning architecture, which refers to an algorithm that updates a neural network model by performing multi-level learning at different abstraction levels. As a deep learning architecture, CNN is a feed-forward artificial neural network, in which each neuron can respond to the input image.
[0133] The image processing method in this application embodiment specifically employs a neural network structure as follows: Figure 3 As shown. In Figure 3 In this example, the Convolutional Neural Network (CNN) 200 may include an input layer 210, convolutional / pooling layers 220 (where pooling layers are optional), and a neural network layer 230. The input layer 210 acquires the image to be processed and then passes the acquired image to the convolutional / pooling layers 220 and the subsequent neural network layer 230 for processing to obtain the image processing result. The following section... Figure 3 This section provides a detailed introduction to the internal layer structure of CNN 200.
[0134] Convolutional / pooling layers 220:
[0135] Convolutional layers:
[0136] like Figure 3 The convolutional / pooling layer 220 shown may include layers as in Examples 221-226. For instance, in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, layer 223 is a convolutional layer, layer 224 is a pooling layer, layer 225 is a convolutional layer, and layer 226 is a pooling layer; in another implementation, layers 221 and 222 are convolutional layers, layer 223 is a pooling layer, layers 224 and 225 are convolutional layers, and layer 226 is a pooling layer. That is, the output of the convolutional layer can be used as the input to a subsequent pooling layer, or as the input to another convolutional layer to continue the convolution operation.
[0137] The following section will use convolutional layer 221 as an example to introduce the internal working principle of a convolutional layer.
[0138] Convolutional layer 221 can include multiple convolution operators, also known as kernels. In image processing, a convolution operator acts as a filter to extract specific information from the input image matrix. Essentially, a convolution operator can be a weight matrix, which is usually predefined. During the convolution operation, the weight matrix typically processes the input image pixel by pixel (or two pixels by two pixels, depending on the stride) along the horizontal direction, thus extracting specific features from the image. The size of the weight matrix should be related to the image size. It's important to note that the depth dimension of the weight matrix is the same as the depth dimension of the input image; during convolution, the weight matrix extends to the entire depth of the input image. Therefore, convolution with a single weight matrix produces a single-depth convolutional output. However, in most cases, a single weight matrix is not used; instead, multiple weight matrices of the same size (rows × columns) are applied—multiple identical matrices. The outputs of each weight matrix are stacked to form the depth dimension of the convolutional image; this dimension can be understood as being determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features from an image. For example, one weight matrix can be used to extract edge information, another to extract specific colors, and yet another to blur unwanted noise. These multiple weight matrices have the same size (rows × columns), and the resulting convolutional feature maps are also of the same size. These extracted convolutional feature maps are then merged to form the output of the convolution operation.
[0139] The weight values in these weight matrices need to be obtained through extensive training in practical applications. The weight matrices formed by the weight values obtained through training can be used to extract information from the input image, thereby enabling the convolutional neural network 200 to make correct predictions.
[0140] When a convolutional neural network 200 has multiple convolutional layers, the first convolutional layer (e.g., 221) tends to extract more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 increases, the features extracted by the later convolutional layers (e.g., 226) become more and more complex, such as high-level semantic features. Features with higher semantic levels are more suitable for the problem to be solved.
[0141] Pooling layer:
[0142] Because it is often necessary to reduce the number of training parameters, pooling layers are often introduced periodically after convolutional layers, such as... Figure 3Layers 221-226 in example 220 can be a convolutional layer followed by a pooling layer, or multiple convolutional layers followed by one or more pooling layers. In image processing, the sole purpose of pooling layers is to reduce the spatial size of the image. Pooling layers can include average pooling and / or max pooling operators to sample the input image to obtain a smaller image size. The average pooling operator calculates the average value of pixel values within a specific range as the result of average pooling. The max pooling operator takes the pixel with the largest value within a specific range as the result of max pooling. Furthermore, just as the size of the weight matrix in a convolutional layer should be related to the image size, the operators in a pooling layer should also be related to the image size. The size of the output image after processing by the pooling layer can be smaller than the size of the input image of the pooling layer. Each pixel in the output image of the pooling layer represents the average or maximum value of the corresponding sub-region of the input image of the pooling layer.
[0143] Neural network layer 230:
[0144] After processing by the convolutional / pooling layers 220, the convolutional neural network 200 is still insufficient to output the required information. As mentioned earlier, the convolutional / pooling layers 220 only extract features and reduce the parameters introduced by the input image. However, to generate the final output information (the required class information or other relevant information), the convolutional neural network 200 needs to utilize neural network layers 230 to generate one or more outputs representing the required number of classes. Therefore, neural network layers 230 can include multiple hidden layers (such as...). Figure 3 As shown in layers 231, 232 to 23n) and output layer 240, the parameters contained in these multi-layer hidden layers can be pre-trained based on relevant training data for specific task types, such as image recognition, image classification, image super-resolution reconstruction, etc.
[0145] After the multiple hidden layers in neural network layer 230, the final layer of the entire convolutional neural network 200 is the output layer 240. This output layer 240 has a loss function similar to classification cross-entropy, specifically used to calculate the prediction error. Once the entire convolutional neural network 200 has undergone forward propagation (e.g., ...), the loss function is applied. Figure 3 Propagation from 210 to 240 degrees is considered forward propagation, while backward propagation (e.g.) is completed. Figure 3 The propagation from 240 to 210 (backpropagation) will begin to update the weight values and biases of the layers mentioned above, in order to reduce the loss of the convolutional neural network 200 and the error between the output of the convolutional neural network 200 through the output layer and the ideal result.
[0146] The image processing method in this application embodiment specifically employs a neural network structure as follows: Figure 4As shown. In Figure 4 In this example, the convolutional neural network (CNN) 200 may include an input layer 210, convolutional / pooling layers 220 (where pooling layers are optional), and neural network layers 230. Figure 3 compared to, Figure 4 Multiple convolutional / pooling layers in the convolutional / pooling layer 220 are executed in parallel, and the extracted features are input into the neural network layer 230 for processing.
[0147] It should be noted that, Figure 3 and Figure 4 The convolutional neural networks shown are merely examples of two possible convolutional neural networks for the image processing method of this application embodiment. In specific applications, the convolutional neural networks used in the image processing method of this application embodiment may also exist in the form of other network models.
[0148] Furthermore, the structure of the convolutional neural network obtained using the neural network structure search method of the embodiments of this application can be as follows: Figure 3 and Figure 4 The convolutional neural network structure is shown in the figure.
[0149] Figure 5 The present application provides a hardware structure for a chip, which includes a neural network processor 50. This chip can be configured as follows: Figure 1 The execution device 110 shown is used to perform the calculations of the calculation module 111. This chip can also be located in, for example... Figure 1 The training device 120 shown is used to complete the training work of the training device 120 and output the target model / rule 101. For example... Figure 3 and Figure 4 The algorithms for each layer in the convolutional neural network shown can all be implemented in, for example... Figure 5 This is achieved in the chip shown.
[0150] The Neural Processing Unit (NPU) 50 is mounted as a coprocessor on the main central processing unit (CPU) (host CPU), and tasks are assigned by the host CPU. The core of the NPU is the arithmetic circuit 503, and the controller 504 controls the arithmetic circuit 503 to retrieve data from the memory (weight memory or input memory) and perform calculations.
[0151] In some implementations, the arithmetic circuit 503 internally includes multiple process engines (PEs). In some implementations, the arithmetic circuit 503 is a two-dimensional pulsating array. The arithmetic circuit 503 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 503 is a general-purpose matrix processor.
[0152] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is stored in the accumulator 508.
[0153] The vector computation unit 507 can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponentiation, logarithmic operations, size comparisons, etc. For example, the vector computation unit 507 can be used for network computation in non-convolutional / non-FC layers of neural networks, such as pooling, batch normalization, and local response normalization.
[0154] In some implementations, the vector computation unit 507 can store the processed output vector into a unified buffer 506. For example, the vector computation unit 507 can apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit 507 generates normalized values, merged values, or both. In some implementations, the processed output vector can be used as activation input to the arithmetic circuit 503, for example, for use in subsequent layers of a neural network.
[0155] The unified memory 506 is used to store input data and output data.
[0156] The weight data is directly transferred from the external memory to the input memory 501 and / or the unified memory 506 through the direct memory access controller 505 (DMAC), the weight data in the external memory is stored in the weight memory 502, and the data in the unified memory 506 is stored in the external memory.
[0157] The bus interface unit (BIU) 510 is used to enable interaction between the main CPU, DMAC and instruction fetch memory 509 via a bus.
[0158] The instruction fetch buffer 509, which is connected to the controller 504, is used to store the instructions used by the controller 504.
[0159] The controller 504 is used to call the instructions cached in the instruction memory 509 to control the operation of the computing accelerator.
[0160] Generally, the unified memory 506, input memory 501, weight memory 502, and instruction fetch memory 509 are all on-chip memories, while the external memory is memory outside the NPU. This external memory can be double data rate synchronous dynamic random access memory (DDR SDRAM), high bandwidth memory (HBM), or other readable and writable memory.
[0161] in, Figure 3 and Figure 4 The operations of each layer in the convolutional neural network shown can be performed by the operation circuit 503 or the vector calculation unit 507.
[0162] The above-mentioned Figure 2 The execution device 110 in the embodiment is capable of executing each step of the image processing method of this application. Figure 3 and Figure 4 The CNN model shown and Figure 5 The chip shown can also be used to perform various steps of the image processing method of the embodiments of this application.
[0163] The method for constructing a neural network and the image processing method of this application embodiment are described in detail below with reference to the accompanying drawings.
[0164] like Figure 6 As shown, this application embodiment provides a system architecture 300. The system architecture includes a local device 301, a local device 302, an execution device 310, and a data storage system 350, wherein the local devices 301 and 302 are connected to the execution device 310 through a communication network.
[0165] The execution device 310 can be implemented by one or more servers. Optionally, the execution device 310 can be used in conjunction with other computing devices, such as data storage devices, routers, load balancers, etc. The execution device 310 can be deployed on a single physical site or distributed across multiple physical sites. The execution device 310 can use data in the data storage system 350 or call program code in the data storage system 350 to implement the neural network model update method of this application embodiment.
[0166] Specifically, in one implementation, the execution device 110 can perform the following process:
[0167] Obtain the neural network model and its related parameters, including the hyperparameters, loss function, and evaluation method of the neural network model;
[0168] The training data is input into the neural network model to obtain the predicted labels;
[0169] The function value of the loss function is determined based on the predicted label and the label of the training data, and the neural network model is trained based on the function value of the loss function and the hyperparameters of the neural network model to obtain the trained neural network model.
[0170] The trained neural network model is evaluated using the evaluation method described above. If the evaluation result of the trained neural network model does not meet the preset conditions, at least two of the neural network model and its related parameters are updated until the update result meets the termination condition.
[0171] The device 110 can acquire a target neural network and / or related parameters of the neural network through the above process. The target neural network can be used for image classification or image processing, etc.
[0172] Users can interact with execution device 310 by operating their respective user devices (e.g., local device 301 and local device 302). Each local device can represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, game console, etc.
[0173] Each user's local device can interact with the execution device 310 through a communication network of any communication mechanism / standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.
[0174] In one implementation, local devices 301 and 302 obtain relevant parameters of the target neural network from execution device 310, deploy the target neural network on local devices 301 and 302, and use the target neural network for image classification or image processing, etc.
[0175] In another implementation, the target neural network can be directly deployed on the execution device 310. The execution device 310 obtains the image to be processed from the local devices 301 and 302, and uses the target neural network model to classify or perform other types of image processing on the image to be processed.
[0176] The aforementioned execution device 310 can also be a cloud device, in which case the execution device 310 can be deployed in the cloud; or, the aforementioned execution device 310 can also be a terminal device, in which case the execution device 310 can be deployed on the user terminal side. This application embodiment does not limit this.
[0177] AutoML-based cloud platforms can design and search for networks based on user-defined constraints, and then provide the trained network models to the user. These constraints can include the type of network model, its accuracy, latency, and the platform on which it runs.
[0178] Figure 7 A schematic structural diagram of the AutoML framework is shown. (For example...) Figure 7 As shown, AutoML includes a search space, an optimizer, and an evaluator.
[0179] The search space is determined based on the specific AutoML task, which is... Figure 7 The learning process in neural networks can be understood as the task / process that needs to be learned. Specific tasks may include preprocessing methods, neural network models, and loss functions. For example, when the specific task is a neural network model, the search space may include multiple neural network structural units, and the final neural network model is formed by combining these neural network units in the search space.
[0180] The optimizer selects different configurations within the search space and assigns them to the evaluator for evaluation. Then, it updates the policy, or configuration, based on the evaluation results from the evaluator. For example, when the specific task is a neural network model, the optimizer can select neural network structural units within the search space, or search for neural network structural units, and combine them to obtain one or more candidate models. From these candidate models, it selects a network model, which can be understood as a configuration, and assigns this configuration to the evaluator for evaluation.
[0181] The evaluator is used to assess the performance metrics of different configurations on the learning platform and feeds the evaluation results back to the optimizer. For example, when the specific task is a neural network model, the evaluator can train the network model selected by the optimizer, evaluate the performance metrics of the trained network model, which may include the accuracy and latency of the neural network model. The evaluation results are then fed back to the optimizer to update its configuration.
[0182] In this embodiment, the optimizer and evaluator in the AutoML framework described above can be an agent or an intelligent module. The agent learns by interacting with the environment to complete the specific AutoML tasks. The agent is the subject that interacts with the environment through actions. The environment is the object of the agent's interaction or the target of its exploration, corresponding to the learning platform described above. Actions are all the operations performed by the agent on the environment, corresponding to the configurations selected by the optimizer. The optimizer selecting different configurations in the search space is equivalent to the agent selecting different actions in the search space. The state is the environmental information acquired by the agent, which may include rewards. The rewards are the effects of the actions fed back to the agent by the environment, corresponding to the evaluation results of different configurations obtained by the evaluator. The optimizer updating the configuration based on the evaluation results is equivalent to the agent adjusting the direction of action generation based on the rewards.
[0183] In one business process, data is preprocessed according to a preprocessing method. The preprocessed data is then input into a neural network model for feature learning and mapping. The parameters of the neural network model are then iteratively updated using a loss function, or in other words, the neural network model is trained. The trained neural network model is then provided to the user, who can use it to predict results.
[0184] Figure 8 This diagram illustrates the application of AutoML to a business process. Typically, AutoML tasks are designed individually for each module / parameter in the business process that needs optimization. For example, the parameters / modules to be optimized in the above business process may include: preprocessing method, neural network model, and loss function, corresponding to three independent AutoML tasks. These three AutoML tasks are completed by three agents, and each agent obtains three optimal configurations: the optimal preprocessing method, the optimal neural network model, and the optimal loss function.
[0185] Applying these three optimal configurations to the aforementioned business process involves: preprocessing the data using the optimal preprocessing method; inputting the preprocessed data into the optimal neural network model for feature learning and mapping; then iteratively updating the parameters of the optimal neural network model using the optimal loss function, or in other words, training the optimal neural network model. The trained optimal neural network model is then judged to meet the user's constraints. If it does, the neural network model is provided to the user, who can then use it for result prediction. If the user's constraints are not met, the three agents need to be re-utilized to obtain the three optimal configurations, and the above process is repeated until the user's constraints are satisfied.
[0186] The three AutoML tasks described above are completely independent, with no connection between the three agents, making end-to-end design impossible. Simply combining the optimal preprocessing methods, optimal neural network models, and optimal loss functions obtained from the three agents may not yield optimal performance in the trained neural network model. Furthermore, conflicts between some of the optimal configurations can even degrade the performance of the final neural network model, such as reducing its accuracy. When the performance of the final neural network model fails to meet the user's constraints, the process must be repeated, impacting productivity.
[0187] The following is combined with Figure 9 A neural network model update method 900 according to an embodiment of this application will be described in detail. Figure 9 The method shown can be executed by a device for updating a neural network model, which can be a cloud service device or a mobile terminal, such as a computer or server with sufficient computing power for updating the neural network model. The method includes steps 910 to 940. Steps 910 to 940 are described in detail below.
[0188] 910. Obtain the structure of the neural network model and its relevant parameters, including the hyperparameters, loss function, and evaluation method.
[0189] The parameters in a neural network model are obtained through training or learning from data. For example, the parameters in a neural network model can be the weights and biases. Hyperparameters of a neural network model include parameters that remain unchanged during the model's training process. Hyperparameters are not obtained through training or learning from data; they are typically determined before training or learning from data.
[0190] For example, the hyperparameters of a neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model, etc.
[0191] The evaluation method for the aforementioned neural network model is related to the specific evaluation metrics of the neural network model. For example, the evaluation metrics of a neural network model may include at least one of the following: the target size of the neural network model, the target inference accuracy of the neural network model, and the target inference latency of the neural network model. The target size of the neural network model can be understood as the target memory occupied by the neural network model. In this embodiment, "inference" can also be referred to as "prediction". Accordingly, the evaluation result of the trained neural network model may include at least one of the following: the size of the trained neural network model, the inference accuracy of the trained neural network model, and the inference latency of the trained neural network model.
[0192] For example, evaluation methods could include assessing the size of the neural network model and its inference accuracy. Another example is evaluating the inference accuracy of the neural network model.
[0193] It should be understood that the above evaluation indicators and evaluation methods can be set according to the user's needs, and the specific content of the evaluation indicators and evaluation methods in this application embodiment is not limited.
[0194] The parameters and structure of a neural network model can be either pre-defined or randomly obtained.
[0195] 920. The training data is input into the neural network model for processing to obtain the predicted labels.
[0196] Optionally, the parameters of the neural network model may also include a preprocessing method for preprocessing the training data. In this case, step 920 includes:
[0197] 921a, the training data is preprocessed using the above preprocessing method.
[0198] For example, the neural network model can be applied to image processing, the training data includes training images, and the preprocessing methods may include flipping or translating the training images.
[0199] 922a, the preprocessed training data is input into the neural network model for processing to obtain the predicted label.
[0200] Optionally, the relevant parameters of the neural network model also include the neural network model compression method. In this case, step 920 includes:
[0201] 921b, the neural network model is processed using the above-mentioned neural network model compression method to obtain the processed neural network model.
[0202] Specifically, processing the neural network model using the above-mentioned neural network model compression method includes compressing the neural network model and / or quantizing the neural network model.
[0203] For example, compressing a neural network model may include discarding redundant weight parameters, reducing the number of convolutional kernel channels, or reducing the number of layers in the neural network model.
[0204] For example, quantizing a neural network model can include compressing the neural network model by reducing the number of bits required to represent each weight. For instance, the weights could be changed from 32 bits to 8 bits.
[0205] It should be understood that the above-described method of processing the neural network model using the aforementioned neural network model compression method is merely an example, and the specific content of the neural network model compression method in this application embodiment is not limited.
[0206] 922b inputs the training data into the processed neural network model to obtain the predicted labels.
[0207] In step 921b, the processing of the neural network model can be performed on either an untrained neural network model or a trained neural network model.
[0208] Specifically, step 921b can involve directly processing the neural network model obtained in step 910, for example, by compression and / or quantization. Then, the training data is input into the processed neural network model to obtain the predicted labels. In other words, the neural network model is first processed, and then the processed neural network model is trained, for example, by executing step 930.
[0209] Alternatively, step 921b can be: training the neural network model obtained in step 910 based on the relevant parameters of the neural network model; then processing the trained neural network model, for example, by compression and / or quantization; and then inputting the training data into the processed neural network model to obtain the predicted label. That is, the neural network model is first trained, for example, by performing step 930. Then the trained neural network model is processed, and the processed neural network model is trained again, for example, by performing step 930 again. The training data used in the two training sessions can be the same or different.
[0210] 930. Determine the value of the loss function based on the predicted label and the label of the training data, and train the neural network model based on the value of the loss function and the hyperparameters of the neural network model to obtain the trained neural network model.
[0211] The loss function measures the difference between the predicted labels of the neural network model and the labels of the training data. The weight vector of each layer of the neural network is updated based on this difference until the predicted labels of the neural network model and the labels of the training data are very close. For example, a higher loss function value indicates a greater difference, and training the neural network then becomes a process of minimizing this loss function value. In some cases, the loss function can also be the objective function.
[0212] Training a neural network model essentially involves adjusting the parameters within that model. Specifically, training a neural network model means refining the parameters within its structure. The backpropagation algorithm can be used during training to correct these parameters, minimizing the error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the neural network model, leading to convergence of the error loss. The backpropagation algorithm is a backpropagation process primarily driven by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.
[0213] 940. The trained neural network model is evaluated using the above evaluation method. If the evaluation result of the trained neural network model does not meet the preset conditions, at least two of the relevant parameters and the structure of the neural network model are updated until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number.
[0214] In other words, after updating at least two of the relevant parameters and the structure of the neural network model, steps 920 to 940 are repeated to evaluate the neural network model. If the evaluation result of the updated neural network model does not meet the preset conditions and / or the number of updates does not reach the preset number, the relevant parameters and the structure of the neural network model are updated again until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number.
[0215] The preset conditions are related to the evaluation metrics. Meeting the preset conditions can include the performance of the trained neural network model reaching the evaluation metrics, or the performance of the trained neural network model reaching the range related to the evaluation metrics.
[0216] For example, if the evaluation metrics include the target inference accuracy and / or the target inference latency of the neural network model, then the evaluation result of the trained neural network model that meets the preset conditions can be that the inference accuracy and / or the inference latency of the trained neural network model reach the target inference accuracy and / or the target inference latency of the neural network model.
[0217] Specifically, at least two of the relevant parameters and the structure of the neural network model are updated, including updating the structure of the neural network model and / or updating the relevant parameters of the neural network model.
[0218] For example, updating at least two of the relevant parameters and the structure of the neural network model can be done by updating the structure and loss function of the neural network model. That is, during the update process, the hyperparameters and evaluation method of the neural network model remain unchanged, while the structure and loss function of the neural network model are updated to obtain the structure and first loss function of the first neural network model. Step 920 is executed, specifically, the training data is input into the first neural network model to obtain predicted labels. Step 930 is executed, specifically, the function value of the first loss function is determined based on the predicted labels and the labels of the training data, and the first neural network model is trained based on the function value of the first loss function and the hyperparameters of the neural network model to obtain the trained neural network model.
[0219] Step 940 involves evaluating the trained neural network model using the aforementioned evaluation method. If the evaluation result of the updated neural network model does not meet the preset conditions and / or the number of updates has not reached the preset number, the structure of the first neural network model and the first loss function are updated. Steps 920 to 940 are repeated in the aforementioned manner until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number. In this case, the structure and loss function of the updated neural network model can be obtained.
[0220] For example, updating at least two of the parameters and structure of the neural network model can also include updating the loss function and evaluation method. In other words, the structure and hyperparameters of the neural network model remain unchanged during the update process. In this case, the optimal combination of the loss function and evaluation method can be obtained. This combination can be applied to the structure of other neural network models to improve the efficiency of neural network model updates and enhance the performance of the neural network model.
[0221] Optionally, in step 940, at least two items in the relevant parameters of the neural network model and the structure of the neural network model are updated, specifically including:
[0222] 940a, based on the relevant parameters of the neural network model and the first information corresponding to each of at least two items in the structure of the neural network model, determine the probability distribution of multiple candidate options corresponding to each of the at least two items. The first information corresponding to each item includes the evaluation result of the trained neural network model, or the evaluation result of the neural network model obtained from the last update.
[0223] The evaluation result of the last updated neural network model refers to the evaluation result obtained by training the neural network model based on the structure and / or relevant parameters of the last updated neural network model and then evaluating the trained neural network model. For ease of description, in the embodiments of this application, the evaluation result obtained by training the neural network model based on the structure and / or relevant parameters of the last updated neural network model and then evaluating the trained neural network model can also be referred to as evaluating the updated neural network model. It should be understood that in the embodiments of this application, only the relevant parameters of the neural network model are updated, and the structure of the neural network model is not updated. The evaluation result obtained by training the neural network model based on the updated relevant parameters and then evaluating the trained neural network model can also be referred to as evaluating the updated neural network model.
[0224] Specifically, for each item, the initial information corresponding to each item can be processed to obtain a feature map. For example, a recurrent neural network can be used to process the initial information corresponding to each item to obtain a feature map. The probability distribution of multiple candidate options corresponding to each item is then determined based on the feature map. For example, a fully connected network can be used to determine the probability distribution of multiple candidate options corresponding to each item.
[0225] It should be understood that the above method for determining the probability distribution of multiple candidate options corresponding to each item is only an example. Other methods that can determine the probability distribution of multiple candidate options corresponding to each item are applicable to step 940a. The embodiments of this application do not limit the calculation method of the probability distribution.
[0226] 940b, based on the probability distribution of the multiple candidate options corresponding to each item, determines one of the multiple candidate options corresponding to each item as the updated option.
[0227] For example, the option with the highest probability among the multiple candidate options can be determined as the updated option based on the probability distribution of the multiple candidate options corresponding to each item.
[0228] For example, sampling can be performed based on the probability distribution of the multiple candidate options corresponding to each item. The sampled candidate options are then the updated options. This improves the efficiency of the update process and avoids getting trapped in local optima.
[0229] For example, updating at least two items in the relevant parameters and structure of the neural network model in step 940 can be achieved by updating two items in the relevant parameters and structure of the neural network model. These two items are the structure of the neural network model and the loss function. Step 940 specifically includes:
[0230] 940c. Based on the first information corresponding to the structure of the neural network model, determine the probability distribution of multiple candidate options corresponding to the structure of the neural network model. The probability distribution of multiple candidate options corresponding to the structure of the neural network model can also be understood as the probability distribution of the structures of multiple candidate neural network models. The first information corresponding to the structure of the neural network model includes the evaluation result of the neural network model after the last update. Based on the first information corresponding to the loss function, determine the probability distribution of multiple candidate options corresponding to the loss function. The probability distribution of multiple candidate options corresponding to the loss function can also be understood as the probability distribution of multiple candidate loss functions. The first information corresponding to the loss function includes the evaluation result of the neural network model after the last update.
[0231] In 940d, based on the probability distribution of multiple candidate options corresponding to the structure of the neural network model, one of the candidate options corresponding to the structure of the neural network model is determined as the updated structure of the neural network model. Similarly, based on the probability distribution of multiple candidate options corresponding to the loss function, one of the candidate options corresponding to the loss function is determined as the updated loss function.
[0232] Optionally, the first information corresponding to each item also includes relevant parameters of the neural network model and relevant information of other items in at least two items of the structure of the neural network model. The relevant information of other items includes at least one of the probability distributions of other items before this update and multiple candidate options corresponding to other items before this update.
[0233] For example, updating at least two items in the relevant parameters and structure of the neural network model in step 940 can be achieved by updating two items in the relevant parameters and structure of the neural network model, namely the structure of the neural network model and the loss function.
[0234] The first piece of information corresponding to the structure of the neural network model also includes information related to the loss function. This information includes the loss function before the current update and / or the probability distribution of multiple candidate options corresponding to the loss function before the current update. For example, the information related to the loss function includes the loss function after the last update and / or the probability distribution of multiple candidate options corresponding to the loss function after the last update. As another example, the information related to the loss function includes the loss function after several previous updates and / or the probability distribution of multiple candidate options corresponding to the loss function after several previous updates.
[0235] The first piece of information corresponding to the loss function also includes information related to the structure of the neural network model. This information includes the structure of the neural network model before the current update and / or the probability distribution of multiple candidate options corresponding to that structure. For example, the information related to the structure of the neural network model includes the structure of the neural network model after the last update and / or the probability distribution of multiple candidate options corresponding to that structure. As another example, the information related to the structure of the neural network model includes the structure of the neural network model after several previous updates and / or the probability distribution of multiple candidate options corresponding to that structure.
[0236] Optionally, step 940 further includes: obtaining relevant information about other items in at least two of the first two items according to the first frequency.
[0237] In other words, information can be exchanged during at least two update processes based on the first frequency.
[0238] For example, updating at least two of the relevant parameters and the structure of the neural network model in step 940 can be done by updating the relevant parameters and the structure of the neural network model, which are the structure of the neural network model and the loss function, respectively.
[0239] Obtaining information about at least two parameters of the neural network model and other items in the structure of the neural network model based on a first frequency may include: obtaining information about the loss function based on the first frequency; and obtaining information about the structure of the neural network model based on the first frequency. In other words, information exchange occurs during the updating of the neural network model's structure and loss function based on the first frequency.
[0240] For example, the first frequency may be a pre-set fixed value.
[0241] Alternatively, the first frequency can be related to the type and scale of business processed by the neural network model.
[0242] When the business scale is small, for example, when a neural network model is used for classifying mobile phone photos, the training data is on the order of millions. This information exchange can be instantaneous, that is, obtaining relevant information about other items at the current time, or obtaining relevant information about other items since the last update. When the business scale is large, for example, when a neural network model is used for facial recognition, the training data can reach the order of hundreds of millions. This information exchange can be to obtain relevant information about other items over a period of time.
[0243] Optionally, the relevant information of at least two of the other items may be related to the type and scale of the business being processed by the neural network model.
[0244] For example, when the business scale is small, the information related to "other items" may only include "other items". When the business scale is large, the information related to "other items" may include "other items" and the probability distribution of multiple candidate options corresponding to "other items".
[0245] In this embodiment of the application, obtaining relevant information of other items during the update process enables joint update optimization. During the update process, potential conflicts between various parameters can be avoided, so that the final neural network model and the combination of relevant parameters of the neural network model can reach the required performance indicators as soon as possible, thereby improving the efficiency of neural network model update.
[0246] Optionally, the first information for each item also includes historical information for each item. The historical information for each item includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0247] For example, the historical information for each item may include the updated options for each item in the previous few updates and / or the probability distribution of multiple candidate options corresponding to each item in the previous few updates. In the embodiments of this application, for ease of description, each updated option may also be referred to as each updated item.
[0248] Furthermore, the historical information for each item can also include environmental status information from the previous few updates.
[0249] Optionally, the first piece of information corresponding to each item also includes training resource status information. The training resource status information includes the number of training machines.
[0250] For example, training resource status information can also include the number of training machines currently available.
[0251] Based on the training resource status information, the training resources corresponding to each parameter during the update process can be adjusted, or the training scale can be adjusted, thereby further improving the efficiency of neural network model updates.
[0252] For example, the number of features in the machine learning process can be adjusted based on the training resources. As another example, training resources can be allocated based on the number of candidate options.
[0253] In this embodiment, any two of the relevant parameters and the structure of the neural network model are updated, and the updated relevant parameters and structure of the neural network model are evaluated. This achieves joint evaluation of multiple parameters, avoids conflicts that may occur when updating each parameter individually, and enables the final neural network model and the combination of its relevant parameters to reach the required performance indicators as quickly as possible, thereby improving the efficiency of neural network model updates.
[0254] Figure 10 This is a schematic diagram of a neural network model updating device according to an embodiment of this application. The neural network model updating device mainly includes: an environment state observation module, a training inference module, and an output module.
[0255] To better understand the execution process of neural network model updates in the embodiments of this application, the following is a description of... Figure 10 The functions of each module in the document will be briefly described.
[0256] The environmental observation module collects environmental state information and inputs it into the training and inference module. This environmental state information includes the evaluation results of the trained neural network model.
[0257] Optionally, the environment status information may also include training resource status information. For example, the training resource status information may include the total number of training machines and the number of currently available training machines.
[0258] The apparatus for updating the neural network model may include one or more environmental observation modules. For example, each of the at least two items being updated may correspond to a separate environmental observation module.
[0259] The training inference module is used to update each of at least two items based on the received information, so as to obtain the updated item.
[0260] The apparatus for updating a neural network model may include one training inference module or multiple training inference modules. For example, each of the at least two items to be updated may correspond to a separate training inference module.
[0261] The output module evaluates the neural network model based on each updated term obtained from the training inference module.
[0262] The device for updating the neural network model may also include: a historical information storage module and a module for collecting relevant information on other items.
[0263] Historical information storage module: This module stores historical information related to each item and inputs this information into the training and inference module. Historical information includes at least one of the following: environmental state information after the previous few updates, each item after the previous few updates, and the network state corresponding to each item after the previous few updates. For example, the network state corresponding to each item can be the probability distribution of multiple candidate options for that item.
[0264] The "Other Items Related Information Collection Module" is used to acquire relevant information about other items and input it into the training inference module. This information includes at least one of the other items prior to the current update and their corresponding network states. For example, the network state corresponding to another item could be the probability distribution of multiple candidate options.
[0265] For ease of description and understanding, the above-described updating of at least two items can be understood as at least two agents respectively completing the update tasks for at least two items, with each agent corresponding to one update task. Multiple agents can form a multi-agent system (MAS) to jointly implement the above-described update tasks. For example, updating at least two items may include updating the neural network model and the preprocessing method, with one agent updating the neural network model and another agent updating the preprocessing method. It should be understood that in the embodiments of this application, the term "agent" is only a concept introduced for ease of description and does not constitute a limitation on the embodiments of this application.
[0266] When updating N items, Figure 10 The device shown may include N intelligent agents, each of which may include an environmental state observation module, a training inference module, and an output module.
[0267] Optionally, each agent may also include a historical information storage module and other relevant information collection modules.
[0268] Figure 11 A system block diagram of a neural network model update according to an embodiment of this application is shown. Figure 11 The algorithm includes three agents: Agent 1, Agent 2, and Agent 3. The three updates performed are the preprocessing method, the structure of the neural network model, and the loss function. Agent 1 updates the preprocessing method, Agent 2 updates the structure of the neural network model, and Agent 3 updates the loss function. The following section uses... Figure 11 Let's take method 900 as an example to illustrate it.
[0269] (A-1) Agent 1, Agent 2, and Agent 3 output the preprocessing method, the structure of the neural network model, and the loss function, respectively. The first execution of this step can be understood as the initialization process of the three agents, corresponding to step 910 mentioned above. From the second execution onwards, this can be understood as the update process of the three agents, corresponding to the update process in step 940 mentioned above.
[0270] Figure 11 Taking the updating of only three parameters as an example, other parameters in the neural network model can remain fixed. For instance, parameters such as hyperparameters and evaluation methods can be preset during the neural network model update process. If the neural network model's parameters include its compression method, that compression method can also be preset.
[0271] exist Figure 11 In this system, the update process for the three agents can be completed by their respective training and inference modules.
[0272] Specifically, for agent 1, the environment state observation module collects the evaluation results of the trained neural network and inputs them into the training inference module. The training inference module performs training inference based on the information input from the environment state observation module to obtain the updated preprocessing method. The other two agents can perform the same operation to obtain the updated neural network model structure and the updated loss function, respectively.
[0273] Optionally, the environmental state observation module can also collect training resource state information and input it into the training inference module.
[0274] Optionally, the three intelligent agents may also include an information collection module for other intelligent agents and a historical information storage module. The information collection module for other intelligent agents is... Figure 10 The module for collecting relevant information for other items in the module.
[0275] Specifically, for agent 1, the training and inference module can perform training and inference based on information input from the environment state observation module, the other agent information collection module, and the historical information storage module to obtain the updated preprocessing method. The other two agents can perform the same operation to obtain the updated neural network model structure and the updated loss function, respectively.
[0276] (A-2) If the relevant parameters of the neural network model do not include the compression method of the neural network model, proceed to step (A-2a). If the relevant parameters of the neural network model include the compression method of the neural network model, proceed to step (A-2a) or step (A-2b) as appropriate.
[0277] (A-2a) includes:
[0278] The training data is preprocessed using the preprocessing method in step (A-1), and the preprocessed training data is input into the neural network model in step (A-1) to obtain the predicted labels.
[0279] (A-2b) includes:
[0280] The training data is preprocessed using the preprocessing method described in step (A-1);
[0281] The neural network model in step (A-1) is processed using the compression method described above. Processing the neural network model can involve quantizing and / or compressing the neural network model.
[0282] The preprocessed training data is input into the processed neural network model to obtain the predicted labels.
[0283] (A-3) If the relevant parameters of the neural network model do not include the compression method of the neural network model, proceed to step (A-3a). If the relevant parameters of the neural network model include the compression method of the neural network model, proceed to either step (A-3a) or step (A-3b) depending on the situation. Step (A-2a) corresponds to step (A-3b), and step (A-2b) corresponds to step (A-3a). Steps (A-2) and (A-3) correspond to steps 920 to 930 in method 900.
[0284] (A-3a) includes:
[0285] The loss function value is determined based on the predicted label and the label of the training data. The neural network model is then trained based on the loss function value and the hyperparameters of the neural network model to obtain the trained neural network model.
[0286] (A-3b) includes:
[0287] The loss function value is determined based on the predicted label and the label of the training data. The neural network model is then trained based on the loss function value and the hyperparameters of the neural network model to obtain the trained neural network model.
[0288] The neural network model trained in step (A-2a) is processed using the compression method described above to obtain a processed neural network model. Processing the trained neural network model can be done by quantizing and / or compressing it.
[0289] Then, the processed neural network model is trained to obtain the trained neural network model.
[0290] (A-4) The trained neural network model is evaluated using the evaluation method in step (A-1) to obtain the evaluation result of the trained neural network model.
[0291] For ease of description, steps (A-2) to (A-4) above can be understood as three agents outputting actions to the environment to obtain evaluation results.
[0292] (A-5) If the evaluation result of the updated neural network model does not meet the preset conditions and / or the number of updates does not reach the preset number, repeat steps (A-1) to (A-4).
[0293] The convergence of the update process can be achieved when the above evaluation results meet the preset conditions. These preset conditions can be set by the user. For example, the preset conditions can be at least one of the following: target inference accuracy, target inference latency, and target memory usage. This is for illustrative purposes only; the preset conditions can be any target set by the user.
[0294] When the termination condition is met, the three agents output the final preprocessing method, the final neural network model structure, and the final loss function, respectively, corresponding to the final actions output by the three agents. These three final actions can be considered as a configuration, that is, as the final output result.
[0295] Figure 12 A schematic diagram of a neural network model update method according to another embodiment of this application is shown. Figure 12 The method shown can be derived from Figure 11 The device in the middle performs the operation. Figure 12 The method shown includes steps 1210 to 1280. Steps 1210 to 1280 are described in detail below.
[0296] 1210. The actions of each agent are obtained based on the collected environmental state information, historical information, and information from other agents.
[0297] Figure 12 The environment status information can include the status of training resources in the current training environment and the evaluation results. The status of training resources in the current training environment can include the total number of training machines and the number of currently available training machines. Environment status information can be obtained from... Figure 11 The environmental status observation module collects data.
[0298] Figure 12 The other agent information refers to the information related to the aforementioned other items. Specifically, the other agent information can include the actions of other agents and the network states of other agents. The actions of other agents are the other items, and the network states of other agents can include the probability distributions corresponding to the actions output by other agents. The other agent information can be obtained from... Figure 11 The information is collected by the other agent information collection module. The frequency and content of information exchange between agents can be determined based on the task type and scale. Information exchange can be instantaneous or at a preset frequency or time interval. For example, agent 1 can cache its actions and network status, waiting for the next information exchange. As another example, agent 1's other agent information collection module receives and saves information from other agents, transmitting it to the training and inference module after a preset time interval.
[0299] Figure 12 Historical information in the middle can be obtained from Figure 11 The historical information is collected by the module in the system. Historical information can include environmental state information, the agent's historical actions, and the agent's historical network state.
[0300] Specifically, step 1210 includes steps 1211 to 1215.
[0301] 1211. The collected environmental state information, historical information, and information from other agents are input into the multi-layer perceptron (MLP) network.
[0302] Specifically, environmental state information, historical information, and information from other agents can be concatenated into a vector and input into the MLP network.
[0303] 1212. The MLP network processes environmental state information, historical information, and information from other agents to obtain a mapped vector, which is then input into the long short-term memory (LSTM) network.
[0304] Specifically, the dimension of the mapped vector can be determined based on the input dimension of the LSTM network.
[0305] 1213. The LSTM network processes the mapped vector to obtain the feature map.
[0306] Specifically, feature maps can be obtained based on the dimension of the action space, which is the output dimension, or the input dimension of the fully connected layer.
[0307] 1214. The fully connected layer obtains the probability distribution of the agent's output action based on the feature map.
[0308] Specifically, the fully connected layers in the three agents obtain the probability distribution of their respective actions based on their feature maps. For example, if agents 1, 2, and 3 correspond to the preprocessing method, the structure of the neural network model, and the loss function, respectively, step 1214 can obtain the probability distribution of the preprocessing method, the probability distribution of the structure of the neural network model, and the probability distribution of the loss function, respectively.
[0309] 1215. Based on the probability distribution of the actions of the three agents, the actions are sampled to obtain the output actions.
[0310] For example, if agent 1, agent 2, and agent 3 correspond to the preprocessing method, the structure of the neural network model, and the loss function, respectively, in step 1215, agent 1 obtains the output preprocessing method π1; agent 2 obtains the output neural network model structure π2; and agent 3 obtains the output loss function π3.
[0311] The neural network model π2 can be an untrained neural network model.
[0312] For example, the actions output by agent 1 can be represented by discrete numerical values. The set of actions output by agent 1 is A = {1, 2, 3, ..., N}, and the corresponding set of probability distributions is P = {p1, p2, p3, ..., p...}. N}, where N is a positive integer, representing the number of actions to be selected by agent 1. Step 1215 involves sampling the action to be output by the agent from the set of actions based on the probability distribution set of actions.
[0313] 1220. Evaluate the actions output by the three agents mentioned above in the environment.
[0314] The actions, or policies, output by the three agents mentioned above can be understood as a policy set π = {π1, π2, π3}.
[0315] Specifically, the preprocessing method π1, the neural network model structure π2, and the loss function π3 are applied to the business process. Training the neural network model structure π2 involves correcting the parameters within it, resulting in a trained neural network model. Evaluating the actions output by the three agents is equivalent to evaluating the performance of the trained neural network model. For example, this could involve evaluating the inference accuracy or inference latency of the trained neural network model. The specific process is as described in steps (A-2) to (A-4) above and will not be repeated here.
[0316] 1230. Determine if the update result meets the termination condition. If the termination condition is not met, repeat steps 1210 to 1220. If the termination condition is met, output the current actions of the three agents.
[0317] For example, the termination condition can be met if the evaluation result of the updated neural network model meets a preset condition or the number of updates reaches a preset number. That is, after updating at least two of the relevant parameters and structures of the neural network model, the neural network model is re-evaluated. If the update result does not meet the termination condition, the update continues to update at least two of the relevant parameters and structures of the neural network model until the update result meets the termination condition. The termination condition can be met if the evaluation result of the updated neural network model does not meet the preset condition and the number of updates has not reached the preset number.
[0318] Steps 1210 to 1220 can be understood as one iteration process.
[0319] It should be understood that any parameter in a neural network model, or any element in the model's structure, can correspond to an agent. Figure 12 This example only uses updating three items, and the three agents are merely for illustration. In specific application scenarios, the number of agents can be set as needed, that is, the number of items to be updated can be set according to requirements.
[0320] Figure 13 A schematic flowchart of an image processing method 1300 provided in an embodiment of this application is shown. The method can be executed by a device or equipment capable of image processing, such as a terminal device, computer, server, etc.
[0321] Figure 13 The target neural network used in the image processing method 1300 can be obtained through the above-mentioned Figure 9 The method or Figure 12 The method described in the previous section is used to construct the method. Method 1300 includes steps 1310 to 1320. The specific implementation of method 1300 can be referred to the aforementioned method 900. To avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing method 1300 below.
[0322] 1310, Obtain the image to be processed.
[0323] The image to be processed may be an image captured by a camera of a terminal device (or a computer, server, or other device or equipment), or it may be an image obtained from within the terminal device (or a computer, server, or other device or equipment) (e.g., an image stored in the terminal device's photo album, or an image obtained by the terminal device from the cloud). This application embodiment does not limit this.
[0324] 1320. The target neural network model is used to process the image to be processed, and the processing result of the image to be processed is obtained.
[0325] The target neural network model is obtained by updating at least two of the relevant parameters and structure of the neural network model until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number. The relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model. The neural network model is obtained by determining the function value of the loss function based on the predicted label and the label of the training data, and training based on the function value of the loss function and the hyperparameters of the neural network model. The predicted label is obtained by inputting the training data into the neural network model for processing.
[0326] Optionally, the parameters of the neural network model also include the preprocessing method. The predicted label is obtained by preprocessing the training data using the preprocessing method and then inputting the preprocessed training data into the neural network model for processing.
[0327] Optionally, the relevant parameters of the neural network model also include the neural network model compression method. The predicted label is obtained by processing the neural network model using the neural network model compression method and then inputting the training data into the processed neural network model.
[0328] Optionally, at least two of the relevant parameters and the structure of the neural network model are updated, including: determining the probability distribution of multiple candidate options corresponding to each of the at least two of the relevant parameters and the structure of the neural network model based on first information, wherein the first information corresponding to each of the at least two of the parameters and the structure of the neural network model includes the evaluation result; and determining one of the multiple candidate options corresponding to each of the multiple candidate options as the updated option for each item based on the probability distribution of the multiple candidate options corresponding to each item.
[0329] Optionally, the first information corresponding to each item also includes relevant parameters of the neural network model and relevant information of other items in at least two items of the structure of the neural network model. The relevant information of other items includes the probability distribution of multiple candidate options corresponding to other items and / or other items.
[0330] Optionally, the first information corresponding to each item also includes historical information related to each item, which includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0331] Optionally, the first piece of information corresponding to each item also includes training resource status information. The training resource status information includes the number of training machines.
[0332] Figure 14 This is a schematic diagram of the hardware structure of the neural network model updating device provided in the embodiments of this application. Figure 14 The neural network model updating device 3000 shown (specifically, this device 3000 can be a computer device) includes a memory 3001, a processor 3002, a communication interface 3003, and a bus 3004. The memory 3001, processor 3002, and communication interface 3003 are interconnected via the bus 3004.
[0333] The memory 3001 can be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 3001 can store programs. When the program stored in the memory 3001 is executed by the processor 3002, the processor 3002 performs the various steps of the neural network model update method of this application embodiment. Specifically, the processor 3002 can execute the steps described above... Figure 9 Steps 910 to 940 in the method shown.
[0334] The processor 3002 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute related programs to implement the neural network model update method of the method embodiment of this application.
[0335] The processor 3002 can also be an integrated circuit chip with signal processing capabilities; for example, it could be... Figure 5 The chip shown. In the implementation process, each step of the neural network model update method of this application can be completed by the integrated logic circuit of the hardware in the processor 3002 or by instructions in the form of software.
[0336] Processor 3002 is used to: acquire the structure of the neural network model and its relevant parameters, including hyperparameters, loss function, and evaluation method. Processor 3002 is also used to: input training data into the neural network model for processing to obtain predicted labels; determine the value of the loss function based on the predicted labels and the labels of the training data, and train the neural network model based on the loss function value and the hyperparameters to obtain the trained neural network model; evaluate the trained neural network model using the evaluation method; and if the evaluation result of the trained neural network model does not meet preset conditions, update at least two of the relevant parameters and the structure of the neural network model until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches a preset number.
[0337] Optionally, the relevant parameters of the neural network model also include a preprocessing method, and the processor 3002 is used to: preprocess the training data using the preprocessing method; input the preprocessed training data into the neural network model for processing to obtain the predicted label.
[0338] Optionally, the relevant parameters of the neural network model also include the neural network model compression method, and the processor 3002 is used to: process the neural network model using the neural network model compression method to obtain the processed neural network model; input the training data into the processed neural network model to obtain the predicted label.
[0339] Optionally, the processor 3002 is configured to: determine the probability distribution of multiple candidate options corresponding to each item based on the relevant parameters of the neural network model and the first information corresponding to each of at least two items in the structure of the neural network model, wherein the first information corresponding to each item includes the evaluation result; and determine one of the multiple candidate options corresponding to each item as the updated option for each item based on the probability distribution of the multiple candidate options corresponding to each item.
[0340] Optionally, the first information corresponding to each item also includes relevant information about at least two other items, including the probability distribution of multiple candidate options corresponding to the other items and / or other items.
[0341] Optionally, the first information corresponding to each item also includes historical information related to each item, which includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0342] Optionally, the first information corresponding to each item may also include training resource status information, which includes the number of training machines.
[0343] Optionally, the hyperparameters of the neural network model include parameters that remain unchanged during the training of the neural network model.
[0344] Optionally, the hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
[0345] The processor 3002 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 3001. The processor 3002 reads the information in memory 3001 and, in conjunction with its hardware, completes the functions required by the units included in the neural network model update apparatus of the embodiments of this application, or executes the neural network model update method of the embodiments of this application.
[0346] The communication interface 3003 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 3000 and other devices or communication networks. For example, the communication interface 3003 can be used to obtain performance metrics for neural network model updates and training data required during machine learning.
[0347] Bus 3004 may include a pathway for transmitting information between various components of device 3000 (e.g., memory 3001, processor 3002, communication interface 3003).
[0348] Figure 15 This is a schematic diagram of the hardware structure of the image processing apparatus according to an embodiment of this application. Figure 15 The image processing device 4000 shown includes a memory 4001, a processor 4002, a communication interface 4003, and a bus 4004. The memory 4001, processor 4002, and communication interface 4003 are interconnected via the bus 4004.
[0349] The memory 4001 can be a ROM, static storage device, or RAM. The memory 4001 can store programs, and when the program stored in the memory 4001 is executed by the processor 4002, the processor 4002 and the communication interface 4003 are used to execute various steps of the image processing method of this application embodiment. Specifically, the processor 4002 can execute the steps described above... Figure 13 Steps 1310 to 1320 in the method shown
[0350] The processor 4002 may be a general-purpose CPU, microprocessor, ASIC, GPU, or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the image processing apparatus of this application embodiment, or to execute the image processing method of this application method embodiment.
[0351] The processor 4002 can also be an integrated circuit chip with signal processing capabilities; for example, it could be... Figure 5 The chip shown. In implementation, each step of the image processing method of this application embodiment can be completed by the integrated logic circuit of the hardware in the processor 4002 or by instructions in the form of software.
[0352] The processor 4002 is used to: acquire an image to be processed; process the image to be processed using a target neural network model to obtain the processing result of the image to be processed. The target neural network model is obtained by updating at least two of the relevant parameters and structure of the neural network model until the evaluation result of the updated neural network model meets preset conditions and / or the number of updates reaches a preset number. The relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model. The neural network model is obtained by determining the function value of the loss function based on the predicted label and the label of the training data, and by training based on the function value of the loss function and the hyperparameters of the neural network model. The predicted label is obtained by inputting the training data into the neural network model for processing.
[0353] Optionally, the parameters of the neural network model also include the preprocessing method. The predicted label is obtained by preprocessing the training data using the preprocessing method and then inputting the preprocessed training data into the neural network model for processing.
[0354] Optionally, the relevant parameters of the neural network model also include the neural network model compression method. The predicted label is obtained by processing the neural network model using the neural network model compression method and then inputting the training data into the processed neural network model.
[0355] Optionally, at least two of the relevant parameters and the structure of the neural network model are updated, including: determining the probability distribution of multiple candidate options corresponding to each of the relevant parameters and the structure of the neural network model based on first information corresponding to each of the at least two of the relevant parameters and the structure of the neural network model, wherein the first information corresponding to each of the items includes the evaluation result; and determining one of the multiple candidate options corresponding to each of the items as the updated option for each item based on the probability distribution of the multiple candidate options corresponding to each item.
[0356] Optionally, the first information corresponding to each item also includes relevant parameters of the neural network model and relevant information of other items in at least two items of the structure of the neural network model. The relevant information of other items includes the probability distribution of multiple candidate options corresponding to other items and / or other items.
[0357] Optionally, the first information corresponding to each item also includes historical information related to each item, which includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
[0358] Optionally, the first information corresponding to each item may also include training resource status information, which includes the number of training machines.
[0359] Optionally, the hyperparameters of the neural network model include parameters that remain unchanged during the training of the neural network model.
[0360] Optionally, the hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
[0361] The processor 4002 described above can also be a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 4001. The processor 4002 reads the information in memory 4001 and, in conjunction with its hardware, completes the functions required by the units included in the image processing apparatus of this application embodiment, or executes the image processing method of the method embodiment of this application.
[0362] The communication interface 4003 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 4000 and other devices or communication networks. For example, an image to be processed can be acquired through the communication interface 4003.
[0363] Bus 4004 may include a pathway for transmitting information between various components of device 4000 (e.g., memory 4001, processor 4002, communication interface 4003).
[0364] Figure 16 This is a schematic diagram of the hardware structure of a neural network model training device according to an embodiment of this application. Similar to devices 3000 and 4000 described above, Figure 16 The neural network model training device 5000 shown includes a memory 5001, a processor 5002, a communication interface 5003, and a bus 5004. The memory 5001, processor 5002, and communication interface 5003 are interconnected via the bus 5004.
[0365] pass Figure 14 The apparatus shown for updating the neural network model can obtain the neural network model and / or its parameters, and then... Figure 16 The neural network model training device 5000 shown trains the neural network model, and the trained neural network model can then be used to execute the image processing method of the embodiments of this application.
[0366] Specifically, Figure 16 The device shown can acquire training data and the neural network model to be trained from the outside through the communication interface 5003, and then the processor trains the neural network model to be trained based on the training data.
[0367] It should be noted that although the above-described devices 3000, 4000, and 5000 only show a memory, processor, and communication interface, those skilled in the art should understand that in specific implementations, devices 3000, 4000, and 5000 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that devices 3000, 4000, and 5000 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that devices 3000, 4000, and 5000 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 14 , Figure 15 and Figure 16 All the devices shown.
[0368] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0369] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0370] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0371] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0372] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0373] It should be understood that, in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0374] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0375] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0376] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0377] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0378] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0379] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0380] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image processing method, characterized in that, include: Obtain the image to be processed; The image to be processed is processed using a target neural network model to obtain the processing result of the image to be processed; The target neural network model is obtained according to the following method: The probability distribution of multiple candidate options corresponding to each item is determined based on at least one of the relevant parameters of the neural network model and the first information corresponding to each item in the structure of the neural network model. Based on the probability distribution of multiple candidate options corresponding to each item, one of the multiple candidate options corresponding to each item is determined as the updated option for each item, until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number. The first information corresponding to each item includes the evaluation result, and also includes at least one of the relevant parameters of the neural network model and relevant information about other items in the structure of the neural network model. The relevant information about the other items includes the probability distribution of the other items and / or the multiple candidate options corresponding to the other items. The relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model. The neural network model is obtained by determining the function value of the loss function based on the predicted label and the label of the training data, and by training based on the function value of the loss function and the hyperparameters of the neural network model. The predicted label is obtained by inputting the training data into the neural network model for processing.
2. The method according to claim 1, characterized in that, The parameters of the neural network model also include a preprocessing method. The predicted label is obtained by preprocessing the training data using the preprocessing method and then inputting the preprocessed training data into the neural network model for processing.
3. The method according to claim 1 or 2, characterized in that, The parameters of the neural network model also include the neural network model compression method. The predicted label is obtained by processing the neural network model using the neural network model compression method and then inputting the training data into the processed neural network model.
4. The method according to claim 1 or 2, characterized in that, The first information corresponding to each item also includes historical related information for each item, which includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
5. The method according to claim 1 or 2, characterized in that, The first information corresponding to each item also includes training resource status information, which includes the number of training machines.
6. The method according to claim 1 or 2, characterized in that, The hyperparameters of the neural network model include parameters that remain unchanged during the training process of the neural network model.
7. The method according to claim 1 or 2, characterized in that, The hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
8. An image processing apparatus, characterized in that, include: The acquisition unit is used to acquire the image to be processed; An image processing unit is used to process the image to be processed using a target neural network model to obtain the processing result of the image to be processed. The target neural network model is obtained according to the following method: The probability distribution of multiple candidate options corresponding to each item is determined based on at least one of the relevant parameters of the neural network model and the first information corresponding to each item in the structure of the neural network model. Based on the probability distribution of multiple candidate options corresponding to each item, one of the multiple candidate options corresponding to each item is determined as the updated option for each item, until the evaluation result of the updated neural network model meets the preset conditions and / or the number of updates reaches the preset number. The first information corresponding to each item includes the evaluation result, and also includes at least one of the relevant parameters of the neural network model and relevant information about other items in the structure of the neural network model. The relevant information about the other items includes the probability distribution of the other items and / or the multiple candidate options corresponding to the other items. The relevant parameters of the neural network model include the hyperparameters, loss function, and evaluation method of the neural network model. The neural network model is obtained by determining the function value of the loss function based on the predicted label and the label of the training data, and by training based on the function value of the loss function and the hyperparameters of the neural network model. The predicted label is obtained by inputting the training data into the neural network model for processing.
9. The apparatus according to claim 8, characterized in that, The parameters of the neural network model also include a preprocessing method. The predicted label is obtained by preprocessing the training data using the preprocessing method and then inputting the preprocessed training data into the neural network model for processing.
10. The apparatus according to claim 8 or 9, characterized in that, The parameters of the neural network model also include the neural network model compression method. The predicted label is obtained by processing the neural network model using the neural network model compression method and then inputting the training data into the processed neural network model.
11. The apparatus according to claim 8 or 9, characterized in that, The first information corresponding to each item also includes historical related information for each item, which includes the updated options for each item in previous updates and / or the probability distribution of multiple candidate options corresponding to each item in previous updates.
12. The apparatus according to claim 8 or 9, characterized in that, The first information corresponding to each item also includes training resource status information, which includes the number of training machines.
13. The apparatus according to claim 8 or 9, characterized in that, The hyperparameters of the neural network model include parameters that remain unchanged during the training process of the neural network model.
14. The apparatus according to claim 8 or 9, characterized in that, The hyperparameters of the neural network model include one or more of the following: the learning rate of the neural network model, the weight decay coefficient of the neural network model, the label smoothing coefficient of the neural network model, or the dropout parameter of the neural network model.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for execution by the device, the program code including methods for performing any one of claims 1 to 7.
16. A chip, characterized in that, The chip includes a processor and a data interface, wherein the processor reads instructions stored in the memory through the data interface to execute the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for learning incremental update-supported big data features
CN104598552A
Stochastic gradient boosting for deep neural networks
US10510003B1