WO2020103606A1 - 模型处理方法、装置、终端及存储介质 - Google Patents

模型处理方法、装置、终端及存储介质

Info

Publication number
WO2020103606A1
WO2020103606A1 PCT/CN2019/111086 CN2019111086W WO2020103606A1 WO 2020103606 A1 WO2020103606 A1 WO 2020103606A1 CN 2019111086 W CN2019111086 W CN 2019111086W WO 2020103606 A1 WO2020103606 A1 WO 2020103606A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
target
parameters
data
application
Prior art date
Application number
PCT/CN2019/111086
Other languages
English (en)
French (fr)
Inventor
陈岩
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020103606A1 publication Critical patent/WO2020103606A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Definitions

  • the present application relates to the field of terminal technology, and in particular, to a model processing method, device, terminal, and storage medium.
  • a model includes multiple model parameters
  • the model processing method is a method for processing multiple model parameters in the model.
  • the terminal after installing the target application program, stores a pre-trained target model corresponding to the target application program and a binary executable program generated in advance by a compiled script.
  • the binary executable program is used to indicate how many The calculation and processing unit of each model parameter. If the calculation processing unit corresponding to a certain model parameter needs to be modified, the server needs to modify the compilation script and recompile to generate a binary executable program. Correspondingly, the terminal needs to uninstall and reinstall the application program in order to use the model according to the binary executable program generated by the recompilation.
  • Embodiments of the present application provide a model processing method, device, terminal, and storage medium, which can be used to solve the problem of low configuration efficiency due to the complicated configuration process when the calculation processing unit corresponding to a certain model parameter needs to be modified.
  • the technical solution is as follows:
  • a model processing method for use in a terminal. The method includes:
  • the target models are models obtained by training multiple model parameters using sample input parameters
  • the calculation processing unit includes a central processor (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a digital signal processor (Digital Signal Processor, DSP), and an embedded neural network processor (Neural -At least one of network Processing Unit (NPU).
  • CPU Central Processing Unit
  • image processor Graphics Processing Unit, GPU
  • DSP Digital Signal Processor
  • NPU embedded neural network processor
  • a model processing device for use in a terminal, and the device includes:
  • An obtaining module configured to obtain input parameters and a target model corresponding to a target application program, the target model being a model obtained by training a plurality of model parameters using sample input parameters;
  • a reading module configured to read the corresponding state values of the plurality of model parameters, and the state values are used to indicate a calculation processing unit configured to run the model parameters after the target model is updated;
  • An output module configured to run the multiple model parameters in the calculation processing unit indicated by the corresponding state value according to the input parameters, and output the target parameters corresponding to the target application program;
  • the calculation processing unit includes at least one of CPU, GPU, DSP, and NPU.
  • the terminal includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the first aspect of the present application and The model processing method described in any one of the optional embodiments.
  • a computer-readable storage medium in which at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement any one of the first aspect and optional embodiments of the present application The model processing method.
  • FIG. 1 is a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application.
  • FIG. 2 is a flowchart of a model processing method provided by an exemplary embodiment of the present application.
  • FIG. 3 is a flowchart of a model processing method provided by another exemplary embodiment of the present application.
  • FIG. 4 is a flowchart of a model processing method provided by another exemplary embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a model processing apparatus provided by an embodiment of the present application.
  • Target model It is a mathematical model for obtaining the target parameters corresponding to the target application according to the input data output.
  • the target model includes: a convolutional neural network (Convolutional Neural Network, CNN) model, a deep neural network (Deep Neural Network, DNN) model, a recurrent neural network (Recurrent Neural Networks, RNN) model, and an embedding model At least one of Gradient Boosting Decision Tree (GBDT) model and Logistic Regression (LR) model.
  • CNN convolutional Neural Network
  • DNN deep neural network
  • RNN recurrent neural network
  • GBDT Gradient Boosting Decision Tree
  • LR Logistic Regression
  • the CNN model is a network model used to identify the types of objects in the image.
  • the CNN model can also extract data features of labeled image data or unlabeled image data.
  • CNN models are divided into neural network models that can be trained with unlabeled image data and neural network models that cannot be trained with unlabeled image data.
  • the DNN model is a deep learning framework.
  • the DNN model includes an input layer, at least one hidden layer (or middle layer), and an output layer.
  • the input layer, at least one hidden layer (or middle layer) and the output layer all include at least one neuron, and the neuron is used to process the received data.
  • the number of neurons between different layers may be the same; or, they may be different.
  • the RNN model is a neural network model with a feedback structure.
  • the output of the neuron can directly affect itself at the next time stamp, that is, the input of the i-th neuron at time m, in addition to the output of the (i-1) -layer neuron at that time, it also includes Its own output at time (m-1).
  • the embedding model is based on a distributed vector representation of entities and relationships, and treats the relationship in each triple instance as a translation from the head of the entity to the end of the entity.
  • the triple instance includes subject, relationship, and object.
  • the triple instance can be expressed as (subject, relationship, object); the subject is the entity head, and the object is the entity tail.
  • Zhang Zhang's father is Zhang Zhang, then expressed by the triple instance (Xiao Zhang, Dad, Zhang Zhang).
  • the GBDT model is an iterative decision tree algorithm.
  • the algorithm is composed of multiple decision trees, and the results of all trees are added up as the final result.
  • Each node of the decision tree will get a predicted value. Taking age as an example, the predicted value is the average age of all the people belonging to the node corresponding to the age.
  • the LR model refers to a model established by applying a logic function on the basis of linear regression.
  • FIG. 1 shows a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application.
  • the terminal 100 is an electronic device in which a target application program is installed.
  • the target application program is a system program or a third-party application program.
  • the third-party application is an application made by a third party other than the user and the operating system.
  • the terminal 100 is an electronic device with a communication function.
  • the terminal is a mobile phone.
  • the terminal 100 includes a processor 120 and a memory 140.
  • the processor 120 may include one or more processing cores.
  • the processor 120 connects various parts of the entire terminal 100 by using various interfaces and lines, and executes the terminal by running or executing instructions, programs, code sets or instruction sets stored in the memory 140, and calling data stored in the memory 140 100 various functions and processing data.
  • the processor 120 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA)
  • DSP Digital Signal Processing
  • FPGA field programmable gate array
  • PROM programmable logic array
  • PLA programmable logic array
  • the processor 120 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem.
  • the CPU mainly handles the operating system, user interface and application programs, etc .
  • the GPU is used to render and draw the content that the display screen needs to display
  • the modem is used to handle wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 120, and may be implemented by a chip alone.
  • the memory 140 may include a random access memory (Random Access Memory, RAM) or a read-only memory (Read-Only Memory).
  • the memory 140 includes a non-transitory computer-readable storage medium.
  • the memory 140 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 140 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for implementing the following method embodiments; the storage data area may store data and the like involved in the following method embodiments.
  • the terminal can The model and the executable program are stored.
  • the terminal can call the executable program and run the model in a calculation processing unit.
  • the terminal needs to modify the calculation processing unit corresponding to the model parameters of a certain model (for example, convert a certain model running on the CPU to run on the GPU)
  • the server needs to modify the compilation script again and recompile to generate a binary executable program.
  • the terminal needs to uninstall and reinstall the application program in order to use the model according to the binary executable program generated by the recompilation, resulting in problems such as low efficiency in reconfiguring the model by the terminal.
  • Embodiments of the present application provide a model processing method, device, terminal, and storage medium, which can be used to solve the problems in the related technologies described above.
  • the technical solution provided by the present application by configuring the corresponding state values of multiple model parameters in the target model, when the terminal needs to use the target model to identify the input parameters corresponding to the target application, the updated target model After reading in, you can obtain the corresponding state values of the modified multiple model parameters, and run the multiple model parameters in the calculation processing unit indicated by the corresponding state values according to the corresponding state values of the multiple model parameters.
  • the calculation processing unit includes at least one of CPU, GPU, DSP, and NPU, which avoids the need to uninstall and reinstall the target application program in the related technology to determine how much of the model is based on the binary executable program generated by the recompilation.
  • the situation of the processing units run by each model parameter simplifies the process of reconfiguring the processing units run by the model parameters, and improves the configuration efficiency.
  • FIG. 2 shows a flowchart of a model processing method provided by an exemplary embodiment of the present application.
  • the model processing method is applied to the terminal shown in FIG. 1 for illustration.
  • the model processing methods include:
  • Step 201 Obtain an input parameter and a target model corresponding to the target application program.
  • the target model is a model obtained by training a plurality of model parameters using sample input parameters.
  • the input parameters and target model corresponding to the target application are obtained.
  • the target application is running in the foreground, if the terminal detects that the recognition function in the target application is activated, the input parameters and target model corresponding to the target application are obtained.
  • the target model is a neural network model for identifying target features in the data to be identified corresponding to the target application, the input parameters are target features in the data to be identified, and the target parameters are identification results corresponding to the data to be identified.
  • the target model is a network model obtained by training the original parameter model according to the training sample set.
  • the original parameter model includes: at least one of CNN model, DNN model, RNN model, embedded model, GBDT model and LR model.
  • the training sample set includes multiple sets of sample data sets.
  • the sample data sets include sample input parameters and pre-labeled correct target parameters.
  • Step 202 Read the corresponding state values of the multiple model parameters.
  • the state values are used to indicate the calculation processing unit configured to run the model parameters after the target model is updated.
  • the terminal reads the state values corresponding to each of the multiple model parameters, including: acquiring the target configuration file corresponding to the target model.
  • the target configuration file is used to store the correspondence between the model parameters of the target model and the state values; from the target Read the corresponding state values of multiple model parameters in the configuration file.
  • the target configuration file is stored in the target model, that is, the terminal reads the state values corresponding to the multiple model parameters, that is, the terminal reads the state values corresponding to the multiple model parameters from the target model.
  • the corresponding relationship between model parameters and state values is stored in the target model.
  • the target model includes a state value corresponding to each of the multiple model parameters, and the state value is used to indicate a calculation processing unit configured to run the model parameter after the target model is updated.
  • the calculation processing unit includes at least one of CPU, GPU, DSP, and NPU.
  • the corresponding state values of the multiple model parameters are configured in the binary executable program, and the present application configures the corresponding state values of the multiple model parameters in the target model, so that after the target application program is installed on the terminal
  • the server updates the target model when the calculation processing unit corresponding to a certain model parameter needs to be modified, the terminal only needs to re-read from the updated target model, avoiding the need to uninstall the target application and reinstall the terminal in the related technology
  • the binary executable program recompiled and use the model according to the binary executable program.
  • Step 203 Run multiple model parameters in the calculation processing unit indicated by the corresponding state value according to the input parameters, and output the target parameters corresponding to the target application program.
  • the terminal inputs the input parameters into the target model and outputs the target parameters corresponding to the target application program.
  • multiple model parameters run in the calculation processing unit indicated by the corresponding state value.
  • the correspondence between the target model, input parameters, and target parameters includes but is not limited to the following possible correspondences:
  • the input parameters include the layer characteristics in the current application layer of the target application, and the target parameters include the scene type identifier of the application scene corresponding to the application layer.
  • the target model is a game scene classification model
  • the input parameters include layer features in the current application layer of the game application
  • the target parameters include scene type identification of the game scene corresponding to the application layer.
  • the game scene includes at least one of a resource update scene, an account login scene, a game main interface scene, a mall interface scene, an in-game loading scene, and a battle scene.
  • the input parameters include the file characteristics in the current multimedia file of the target application
  • the target parameters include the file score of the multimedia file
  • the multimedia file includes text, At least one of image, audio and video.
  • the multimedia file rating model is one of a text rating model, an image rating model, an audio rating model, and a video rating model.
  • the target model is an image scoring model
  • the terminal acquires the target image of the image processing application, extracts image features from the target image, inputs the image features into the image scoring model as input parameters, and outputs the image score of the target image,
  • the image score is used to indicate the image quality of the target image.
  • the input parameters include data characteristics in system parameter data corresponding to the target application, and the target parameters include target image quality parameters of the target application.
  • System parameter data includes temperature data of the operating system or battery power data.
  • the target model is an image quality adjustment model.
  • the terminal obtains the current temperature data of the operating system.
  • the temperature data is greater than a preset temperature threshold
  • the current temperature data is input to the image quality adjustment model as an input parameter, and the output is obtained by the target application
  • the target picture quality parameter which is used to indicate the picture quality of the target application displayed on the terminal screen.
  • the correspondence between the target model, the input parameters, and the target parameters may also include other possible correspondences that are easy to think about according to the foregoing several possible correspondences, and this embodiment will not be described one by one.
  • this embodiment determines the multiple model parameters by configuring the corresponding state values of the multiple model parameters in the target model, and determining the multiple model parameters according to the corresponding state values of the multiple model parameters configured in the updated target model
  • the computational processing unit that each runs, the computational processing unit includes at least one of CPU, GPU, DSP, NPU, to avoid the need to uninstall and reinstall the target application program in the related art to be able to generate the binary executable program according to the recompile,
  • the situation of the processing units that each of the multiple model parameters in the model runs is determined, which further simplifies the process of reconfiguring the processing units that are run by the model parameters and improves the configuration efficiency.
  • the above acquiring input parameters and target models corresponding to the target application program includes:
  • the recognition instruction corresponding to the target application When the recognition instruction corresponding to the target application is received, the data to be recognized corresponding to the target application is obtained, and the target feature in the data to be recognized is determined as the input parameter;
  • the target model is read in a designated storage location of the terminal, and the target model is a model for identifying target features that is updated in real time or updated at predetermined time intervals.
  • the method before reading the target model in the specified storage location of the terminal, the method further includes:
  • the model update data is used to instruct to modify the calculation processing unit corresponding to at least one model parameter in the target model;
  • the above reading the corresponding state values of multiple model parameters includes:
  • the target configuration file is used to store the correspondence between the model parameters and state values of the target model;
  • the method before obtaining the input parameters and the target model corresponding to the target application, the method further includes:
  • the intermediate network model includes multiple model parameters
  • the intermediate network model is transformed into a target model, and the target model includes the correspondence between model parameters and state values.
  • the intermediate network model obtained by the above training includes:
  • the training sample set includes multiple sets of sample data sets.
  • the sample data sets include sample input parameters and pre-labeled correct target parameters;
  • the initial network model is trained using the error back propagation algorithm to obtain the intermediate network model.
  • the method further includes:
  • the above target model is a neural network model for identifying target features in the data to be identified corresponding to the target application, the input parameters are target features in the data to be identified, and the target parameters are the identification corresponding to the data to be identified result.
  • the input parameters include the layer characteristics in the current application layer of the target application, and the target parameters include the scene type identification of the application scene corresponding to the application layer;
  • the input parameters include the file characteristics of the current multimedia file containing the target application
  • the target parameters include the file score of the multimedia file
  • the multimedia file includes at least one of text, image, audio and video ;or
  • the input parameters include data characteristics in system parameter data corresponding to the target application, and the target parameters include target image quality parameters of the target application.
  • FIG. 3 shows a flowchart of a model processing method provided by an exemplary embodiment of the present application.
  • the model processing method is applied to the terminal shown in FIG. 1 for illustration.
  • the model processing methods include:
  • Step 301 Obtain an intermediate network model obtained by training.
  • the intermediate network model includes multiple model parameters.
  • the terminal acquiring the trained intermediate network model includes: acquiring a training sample set, the training sample set includes multiple sets of sample data sets, and the sample data sets include sample input parameters and pre-marked correct target parameters. According to multiple sample data sets, the initial network model is trained using the error back propagation algorithm to obtain the intermediate network model.
  • the terminal uses the error back propagation algorithm to train the initial network model based on multiple sets of sample data sets, to obtain an intermediate network model, including but not limited to the following steps, as shown in Figure 4:
  • Step 401 For each set of sample data in at least one set of sample data, extract sample parameter features from the sample input parameters.
  • the terminal uses the feature extraction algorithm to calculate the feature vector according to the sample input parameters, and determines the calculated feature vector as the sample parameter feature.
  • the terminal uses the feature extraction algorithm to calculate the feature vector according to the sample input parameters, including: extracting the feature of the collected sample input parameters, and determining the feature-extracted data as the feature vector.
  • feature extraction is the process of extracting features from sample input parameters and converting the features into structured data.
  • Step 402 Input the sample parameter features into the original parameter model to obtain the training result.
  • the original parameter model is established based on the neural network model.
  • the original parameter model is established based on the DNN model or the RNN model.
  • the terminal creates the input and output pairs corresponding to the sample data set, the input parameters of the input and output pairs are the characteristics of the sample parameters in the sample data set, and the target parameter is the sample data set
  • the terminal inputs the input parameters into the prediction model to obtain the training results.
  • the input and output pairs are represented by feature vectors.
  • step 403 the training result is compared with the correct target parameter to obtain a calculated loss, and the calculated loss is used to indicate an error between the training result and the correct target parameter.
  • the calculated loss is expressed by cross-entropy
  • the terminal calculates the calculation loss H (p, q) through the following formula:
  • p (x) and q (x) are discrete distribution vectors of equal length
  • p (x) represents the training result
  • q (x) represents the target parameter
  • x is a vector in the training result or the target parameter.
  • step 404 the target model is obtained by training with an error back propagation algorithm according to the respective calculated losses of at least one sample data set.
  • the terminal determines the gradient direction of the target model according to the calculated loss through the back propagation algorithm, and updates the model parameters in the target model layer by layer from the output layer of the target model.
  • Step 302 the intermediate network model is converted into a target model, and the target model includes a correspondence between model parameters and state values.
  • the terminal converting the intermediate network model to the target model includes: the terminal configuring a state value corresponding to each of a plurality of model parameters in the trained intermediate network model to obtain the target model.
  • the first correspondence between the state value and the calculation processing unit is pre-stored in the terminal. Subsequently, when the terminal reads the state value corresponding to a model parameter, the calculation processing unit indicated by the state value is obtained according to the first correspondence stored in advance.
  • the terminal converts the intermediate network model into a target model, and the target model includes a correspondence between the model parameters, state values, and calculation processing units.
  • the correspondence between the model parameters, state values, and calculation processing units is shown in Table 1.
  • Table 1 there are five model parameters, the state value corresponding to the model parameter "parameter S1” is “1”, the corresponding calculation processing unit is “CPU”; the state value corresponding to the model parameter “parameter S2” is “1” , The corresponding calculation processing unit is “CPU”; the state value corresponding to the model parameter “parameter S3” is “2”, the corresponding calculation processing unit is "GPU”; the state value corresponding to the model parameter "parameter S4" is "3” , The corresponding calculation processing unit is "DSP”; the state value corresponding to the model parameter "parameter S5" is “4", and the corresponding calculation processing unit is "NPU”.
  • Model parameters State value Calculation processing unit Parameter S1 1 CPU Parameter S2 1 CPU Parameter S3 2 GPU Parameter S4 3 DSP Parameter S5 4 NPU
  • Step 303 When receiving the identification instruction corresponding to the target application, acquire the data to be identified corresponding to the target application, and determine the target feature in the data to be identified as an input parameter.
  • the terminal when the terminal detects that the target application is running in the foreground, if the terminal receives the identification instruction corresponding to the target application, it obtains the input parameter and target model corresponding to the target application.
  • the terminal obtains the application identification of the application running in the foreground from the predetermined stack of the operating system, and determines that the target application is running in the foreground when the application identification is the application identification of the target application.
  • the predetermined stack is a predetermined active stack.
  • the application ID of the target application is used to uniquely indicate the target application, for example, the application ID is the package name of the target application.
  • the terminal monitors the application program running in the foreground by actively polling, and determines the application program running in the foreground according to the foreground movement activity (English: Activity).
  • an activity is a component that contains a user interface, which is used to achieve interaction with the user.
  • Each application program includes multiple activities, and each activity corresponds to a user interface.
  • the foreground running activity is the component corresponding to the user interface located at the top level.
  • the uppermost user interface is the user interface that the user sees on the screen when using the terminal.
  • the activity stack is used to store the started activities.
  • the activity stack is a last-in-first-out data structure. By default, every time an activity is started, the activity is pushed into the activity stack and is at the top position of the stack.
  • the activities at the location are the running activities at the front desk. When the front desk operating activity changes, the activity at the top of the stack in the activity stack will also change.
  • the terminal monitors the foreground operating activities through active polling through the program manager.
  • the terminal when the terminal receives the operation signal corresponding to the identification entry in the target application, it is determined that the identification instruction corresponding to the target application is received, the identification function of the target application is turned on, and the input parameter and target corresponding to the target application are obtained model.
  • the identification portal is an operable control for starting the identification function of the target application.
  • the type of identifying the entrance includes at least one of a button, a manipulable item, and a slider.
  • the operation signal is used to trigger a user operation to open the identification function of the target application.
  • the operation signal includes any one or a combination of a click operation signal, a slide operation signal, a press operation signal, and a long press operation signal.
  • the operation signal can also be implemented in the form of voice.
  • Step 304 Read the target model in the designated storage location of the terminal.
  • the target model is a model for identifying target features that is updated in real time or updated at predetermined time intervals.
  • the terminal stores the updated target model in the designated storage location.
  • the method before reading the target model in the specified position of the terminal, the method further includes: the terminal receives model update data sent by the server, and the model update data is used to instruct to modify the calculation processing unit corresponding to at least one model parameter in the target model ; Update the target model according to the model update data.
  • the terminal receives the model update data sent by the server, including but not limited to the following possible implementation methods:
  • the terminal when the terminal receives the recognition instruction corresponding to the target application and starts the recognition function of the target application, it sends a query instruction to the server, and the server sends the model update data to the terminal after receiving the query instruction. Correspondingly, the terminal receives the model update data sent by the server.
  • the server modifies the calculation processing unit corresponding to at least one model parameter in the target model
  • the model update data is sent to the terminal; correspondingly, the terminal receives the model update data sent by the server.
  • the terminal obtains model update data from the server every predetermined time interval.
  • this embodiment does not limit the timing for the terminal to receive the model update data sent by the server.
  • Step 305 Run multiple model parameters in the calculation processing unit indicated by their corresponding state values according to the input parameters, and output the target parameters corresponding to the target application program.
  • the terminal inputs the input parameters into the target model and outputs the target parameters corresponding to the target application.
  • multiple model parameters run in the calculation processing unit indicated by the corresponding state value.
  • the target application is a game application
  • the terminal obtains the input parameters and target models corresponding to the game application
  • the input parameters include layer features in the current application layer of the game application
  • the target model is a scene Classification model
  • the scene classification model includes three model parameters "parameter S1, parameter S2 and parameter S5"
  • the terminal reads from the scene classification model and obtains the state value corresponding to the model parameter "parameter S1" as "1”
  • the model parameter "parameter The state value corresponding to "S2" is "1”
  • the state value corresponding to the model parameter "Parameter S5" is "4".
  • the terminal In the process of inputting layer features into the scene classification model and outputting the scene type identification, the parameters S1 and S2 are both run in the CPU, and the parameter S5 is run in the NPU.
  • the terminal after outputting the target parameters corresponding to the target application, the terminal adds the input parameters and the target parameters to the training sample set to obtain an updated training sample set; the intermediate network model is trained according to the updated training sample set To get the updated intermediate network model.
  • the process of training the intermediate network model according to the updated training sample set to obtain the updated intermediate network model can be analogized to the training process of the intermediate network model described above, which will not be repeated here.
  • the terminal when the terminal receives the recognition instruction corresponding to the target application program, the data to be recognized corresponding to the target application program is obtained, and the target feature in the data to be recognized is determined as an input parameter;
  • the target model is read from the designated storage location. Because the target model is stored in the designated storage location of the terminal, and the target model is a model for identifying target features that is updated in real time or every predetermined time interval, the terminal
  • the target model obtained when the data to be identified corresponding to the target application is identified is the updated target model, thereby enabling the terminal to use the target model in time according to the state values corresponding to the modified multiple model parameters.
  • the embodiment of the present application also adds the input parameters and the target parameters to the training sample set through the terminal to obtain the updated training sample set; training the intermediate network model according to the updated training sample set to obtain the updated intermediate network model, so that The terminal can continuously improve the accuracy of the intermediate network model according to the new training samples, and improve the accuracy of the terminal in determining the target parameter corresponding to the target application.
  • FIG. 5 shows a schematic structural diagram of a model processing apparatus provided by an embodiment of the present application.
  • the model processing device can be implemented as a whole or a part of the terminal in FIG. 1 through a dedicated hardware circuit or a combination of software and hardware.
  • the model processing device includes an acquisition module 510, a reading module 520, and an output module 530.
  • the obtaining module 510 is used to obtain the input parameters and the target model corresponding to the target application program.
  • the target model is a model obtained by training a plurality of model parameters using sample input parameters;
  • the reading module 520 is used to read the corresponding state values of the multiple model parameters, and the state values are used to indicate the calculation processing unit configured to run the model parameters after the target model is updated;
  • the output module 530 is configured to run multiple model parameters in the calculation processing unit indicated by the corresponding state value according to the input parameters, and output the target parameters corresponding to the target application program;
  • the calculation processing unit includes at least one of CPU, GPU, DSP, and NPU.
  • this embodiment determines the multiple model parameters by configuring the corresponding state values of the multiple model parameters in the target model, and determining the multiple model parameters according to the corresponding state values of the multiple model parameters configured in the updated target model
  • the computational processing unit that each runs, the computational processing unit includes at least one of CPU, GPU, DSP, NPU, to avoid the need to uninstall and reinstall the target application program in the related art to be able to generate the binary executable program according to the recompile,
  • the situation of the processing units that each of the multiple model parameters in the model runs is determined, which further simplifies the process of reconfiguring the processing units that are run by the model parameters and improves the configuration efficiency.
  • the acquisition module 510 includes: a parameter determination unit and a model reading unit;
  • the parameter determination unit is configured to, when receiving the identification instruction corresponding to the target application, acquire the data to be identified corresponding to the target application, and determine the target feature in the data to be identified as the input parameter ;
  • the model reading unit is configured to read the target model in a designated storage location of the terminal, and the target model is updated in real time or updated every predetermined time interval to identify the target feature model.
  • the device further includes: a data receiving module and a first model updating module;
  • the data receiving module is used for the model reading unit to receive the model update data sent by the server before reading the target model in the designated storage location of the terminal, the model update data is used to indicate Modifying the calculation processing unit corresponding to at least one of the model parameters in the target model;
  • the first model update module is configured to update the target model according to the model update data.
  • the reading module 520 includes: a file obtaining unit and a state value reading unit;
  • the file obtaining unit is configured to obtain a target configuration file corresponding to the target model, and the target configuration file is used to store a correspondence between the model parameter of the target model and the state value;
  • the state value reading unit is configured to read the state value corresponding to each of the plurality of model parameters from the target configuration file.
  • the device further includes: a model acquisition module and a model conversion module;
  • the model obtaining module is configured to obtain an intermediate network model obtained by training before the obtaining module obtains the input parameters and target models corresponding to the target application program, and the intermediate network model includes the multiple model parameters;
  • the model conversion module is configured to convert the intermediate network model to the target model, and the target model includes a correspondence between the model parameters and the state value.
  • the model acquisition module includes: a sample set acquisition unit and a training unit;
  • the sample set obtaining unit is configured to obtain a training sample set, the training sample set includes multiple sets of sample data sets, and the sample data sets include the sample input parameters and pre-marked correct target parameters;
  • the training unit is configured to train an initial network model based on the multiple sample data sets using an error back propagation algorithm to obtain the intermediate network model.
  • the device further includes: a sample set update module and a second model update module;
  • the sample set update module is configured to run the multiple model parameters in the calculation processing unit indicated by the corresponding state value according to the input parameters in the output module, and output the obtained After the target parameters corresponding to the target application, add the input parameters and the target parameters to the training sample set to obtain an updated training sample set;
  • the second model update module is configured to train the intermediate network model according to the updated training sample set to obtain an updated intermediate network model.
  • the target model is a neural network model for identifying target features in the data to be identified corresponding to the target application
  • the input parameters are target features in the data to be identified
  • the target parameters are the identification results corresponding to the data to be identified .
  • the input parameters include the layer characteristics in the current application layer of the target application, and the target parameters include the scene type identification of the application scene corresponding to the application layer;
  • the input parameters include the file characteristics of the current multimedia file containing the target application
  • the target parameters include the file score of the multimedia file
  • the multimedia file includes at least one of text, image, audio, and video.
  • the input parameters include data characteristics in system parameter data corresponding to the target application, and the target parameters include target image quality parameters of the target application.
  • the obtaining module 510 is also used to implement any other implicit or disclosed functions related to the obtaining step in the above method embodiments;
  • the reading module 520 is also used to implement any other implicit or open related and reading functions in the above method embodiments
  • the function related to the step is taken;
  • the output module 530 is also used to implement any other implicit or disclosed function related to the output step in the above method embodiment.
  • the device provided in the above embodiments when implementing its functions, is only exemplified by the division of the above functional modules. In practical applications, the above functions can be allocated by different functional modules according to needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the device and method embodiments provided in the above embodiments belong to the same concept. For the specific implementation process, see the method embodiments, and details are not described here.
  • the present application also provides a computer-readable medium on which program instructions are stored.
  • program instructions are executed by a processor, the model processing method provided by the foregoing method embodiments is implemented.
  • the present application also provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the model processing method described in the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Image Analysis (AREA)

Abstract

一种模型处理方法、装置、终端及存储介质,属于终端技术领域。所述方法包括:获取目标应用程序对应的输入参数和目标模型,目标模型为采用样本输入参数对多个模型参数进行训练得到的模型(201);读取多个模型参数各自对应的状态值,状态值用于指示目标模型更新后所配置的用于运行所述模型参数的计算处理单元(202);根据输入参数,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,输出得到目标应用程序对应的目标参数(203)。通过将多个模型参数各自对应的状态值配置在目标模型中,当终端需要采用目标模型对目标应用程序识别输入参数时,通过对更新后的目标模型进行读入,即可获得修改后的多个模型参数各自对应的状态值,从而将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,提高了配置效率。

Description

模型处理方法、装置、终端及存储介质
本申请实施例要求于2018年11月19日提交的申请号为201811376526.4、发明名称为“模型处理方法、装置、终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中。
技术领域
本申请涉及终端技术领域,特别涉及一种模型处理方法、装置、终端及存储介质。
背景技术
通常一个模型包括多个模型参数,模型处理方法是对模型中的多个模型参数进行处理的方法。
相关技术中,终端安装该目标应用程序后,存储有该目标应用程序对应的预先训练的目标模型和通过编译脚本预先生成的二进制可执行程序,该二进制可执行程序用于指示该模型中的多个模型参数各自所运行的计算处理单元。若需要修改某个模型参数对应的计算处理单元,则服务器需要修改编译脚本,重新编译生成二进制可执行程序。对应的,终端需要卸载并重新安装应用程序,才能根据重新编译生成的二进制可执行程序使用该模型。
发明内容
本申请实施例提供了一种模型处理方法、装置、终端及存储介质,可以用于解决当需要修改某个模型参数对应的计算处理单元时配置过程复杂导致配置效率较低的问题。技术方案如下:
一个方面,提供了一种模型处理方法,用于终端中,所述方法包括:
获取目标应用程序对应的输入参数和目标模型,所述目标模型为采用样本输入参数对多个模型参数进行训练得到的模型;
读取所述多个模型参数各自对应的状态值,所述状态值用于指示所述目标模型更新后所配置的用于运行所述模型参数的计算处理单元;
根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数;
其中,所述计算处理单元包括中央处理器(Central Processing Unit,CPU)、图像处理器 (Graphics Processing Unit,GPU)、数字信号处理器(Digital Signal Processor,DSP)、嵌入式神经网络处理器(Neural-network Processing Unit,NPU)中的至少一种。
另一方面,提供了一种模型处理装置,用于终端中,所述装置包括:
获取模块,用于获取目标应用程序对应的输入参数和目标模型,所述目标模型为采用样本输入参数对多个模型参数进行训练得到的模型;
读取模块,用于读取所述多个模型参数各自对应的状态值,所述状态值用于指示所述目标模型更新后所配置的用于运行所述模型参数的计算处理单元;
输出模块,用于根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数;
其中,所述计算处理单元包括CPU、GPU、DSP、NPU中的至少一种。
另一方面,提供了一种终端,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如本申请第一方面及其可选实施例任一所述的模型处理方法。
另一方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如本申请第一方面及其可选实施例任一所述的模型处理方法。
附图说明
图1是本申请一个示例性实施例所提供的终端的结构示意图;
图2是本申请一个示例性实施例提供的模型处理方法的流程图;
图3是本申请另一个示例性实施例提供的模型处理方法的流程图;
图4是本申请另一个示例性实施例提供的模型处理方法的流程图;
图5是本申请一个实施例提供的模型处理装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,术语“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
首先,对本申请涉及到的名词进行介绍。
目标模型:是一种用于根据输入的数据输出得到目标应用程序对应的目标参数的数学模型。
可选地,目标模型包括:卷积神经网络(Convolutional Neural Network,CNN)模型、深度神经网络(Deep Neural Network,DNN)模型、循环神经网络(Recurrent Neural Networks,RNN)模型、嵌入(embedding)模型、梯度提升决策树(Gradient Boosting Decision Tree,GBDT)模型和逻辑回归(Logistic Regression,LR)模型中的至少一种。
CNN模型是用于对图像中物体类别进行识别的网络模型。CNN模型还可以对有标签图像数据或无标签图像数据的数据特征进行提取。CNN模型分为可通过无标签图像数据进行训练的神经网络模型以及不可以通过无标签图像数据进行训练的神经网络模型。
DNN模型是一种深度学习框架。DNN模型包括输入层、至少一层隐层(或称,中间层)和输出层。可选地,输入层、至少一层隐层(或称,中间层)和输出层均包括至少一个神经元,神经元用于对接收到的数据进行处理。可选地,不同层之间的神经元的数量可以相同;或者,也可以不同。
RNN模型是一种具有反馈结构的神经网络模型。在RNN模型中,神经元的输出可以在下一个时间戳直接作用到自身,即,第i层神经元在m时刻的输入,除了(i-1)层神经元在该时刻的输出外,还包括其自身在(m-1)时刻的输出。
embedding模型是基于实体和关系分布式向量表示,将每个三元组实例中的关系看作从实体头到实体尾的翻译。其中,三元组实例包括主体、关系、客体,三元组实例可以表示成(主体,关系,客体);主体为实体头,客体为实体尾。比如:小张的爸爸是大张,则通过三元组实例表示为(小张,爸爸,大张)。
GBDT模型是一种迭代的决策树算法,该算法由多棵决策树组成,所有树的结果累加起来作为最终结果。决策树的每个节点都会得到一个预测值,以年龄为例,预测值为属于年龄对应的节点的所有人年龄的平均值。
LR模型是指在线性回归的基础上,套用一个逻辑函数建立的模型。
在对本申请实施例进行解释说明之前,先对本申请实施例的应用场景进行说明。图1示出了本申请一个示例性实施例所提供的终端的结构示意图。
该终端100是安装有目标应用程序的电子设备。
可选的,该目标应用程序是系统程序或者第三方应用程序。其中,第三方应用程序是除了用户和操作系统之外的第三方制作的应用程序。
该终端100是具有通讯功能的电子设备。比如,该终端为手机。
可选的,该终端100中包括:处理器120和存储器140。
处理器120可以包括一个或者多个处理核心。处理器120利用各种接口和线路连接整个终端100内的各个部分,通过运行或执行存储在存储器140内的指令、程序、代码集或指令集,以及调用存储在存储器140内的数据,执行终端100的各种功能和处理数据。可选的,处理器120可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器120可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器120中,单独通过一块芯片进行实现。
存储器140可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选的,该存储器140包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器140可用于存储指令、程序、代码、代码集或指令集。存储器140可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储下面各个方法实施例中涉及到的数据等。
相关技术中,上述终端在安装了系统程序或者第三方应用程序后,如果系统程序或者第 三方应用程序中有预先训练的目标模型或者通过编译脚本预先生成的二进制可执行程序,终端就可以将该模型以及可执行程序进行存储,当终端需要运行该模型时,可以调用该可执行程序,并在某个计算处理单元中运行该模型。若终端需要修改某个模型的模型参数对应的计算处理单元(比如,将在CPU上运行的某个模型转换至GPU上运行),则需要服务器重新修改编译脚本,重新编译生成二进制可执行程序。对应的,终端需要卸载并重新安装应用程序,才能根据重新编译生成的二进制可执行程序使用该模型,导致终端重新配置该模型的效率较低等问题。
本申请实施例提供了一种模型处理方法、装置、终端及存储介质,可以用于解决上述相关技术中存在的问题。本申请提供的技术方案中,通过将多个模型参数各自对应的状态值配置在目标模型中,当终端需要采用目标模型对目标应用程序对应的输入参数进行识别时,通过对更新后的目标模型进行读入,即可获得修改后的多个模型参数各自对应的状态值,根据多个模型参数各自对应的状态值,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,计算处理单元包括CPU、GPU、DSP、NPU中的至少一种,避免了相关技术中需要将目标应用程序卸载并重新安装才能根据重新编译生成的二进制可执行程序,确定出该模型中的多个模型参数各自所运行的处理单元的情况,进而简化了对模型参数所运行的处理单元进行重新配置的过程,提高了配置效率。
请参考图2,其示出了本申请一个示例性实施例提供的模型处理方法的流程图。本实施例以该模型处理方法应用于图1所示出的终端中来举例说明。该模型处理方法包括:
步骤201,获取目标应用程序对应的输入参数和目标模型,目标模型为采用样本输入参数对多个模型参数进行训练得到的模型。
可选的,当目标应用程序处于前台运行时,获取目标应用程序对应的输入参数和目标模型。示意性的,当目标应用程序处于前台运行时,若终端检测到目标应用程序中的识别功能被启动则获取目标应用程序对应的输入参数和目标模型。
其中,目标模型为用于对目标应用程序对应的待识别数据中的目标特征进行识别的神经网络模型,输入参数为待识别数据中的目标特征,目标参数为待识别数据对应的识别结果。
可选的,目标模型是根据训练样本集对原始参数模型进行训练得到的经网络模型。其中,原始参数模型包括:CNN模型、DNN模型、RNN模型、嵌入模型、GBDT模型和LR模型中的至少一种。训练样本集包括多组样本数据组,样本数据组包括样本输入参数和预先标注的正确目标参数。
需要说明的是,目标模型的训练过程可参考下面实施例中的相关描述,在此先不介绍。
步骤202,读取多个模型参数各自对应的状态值,状态值用于指示目标模型更新后所配置的用于运行模型参数的计算处理单元。
可选的,终端读取多个模型参数各自对应的状态值,包括:获取目标模型对应的目标配置文件,目标配置文件用于存储目标模型的模型参数与状态值之间的对应关系;从目标配置文件中读取多个模型参数各自对应的状态值。
可选的,该目标配置文件存储在目标模型中,即终端读取多个模型参数各自对应的状态值,也就是终端从目标模型中读取多个模型参数各自对应的状态值。其中,目标模型中存储有模型参数与状态值之间的对应关系。
可选的,目标模型中包括多个模型参数各自对应的状态值,状态值用于指示目标模型更新后所配置的用于运行模型参数的计算处理单元。
其中,计算处理单元包括CPU、GPU、DSP、NPU中的至少一种。
相关技术中多个模型参数各自对应的状态值是配置在二进制可执行程序中的,而本申请将多个模型参数各自对应的状态值配置在目标模型中,使得在终端安装好目标应用程序之后,当需要修改某个模型参数对应的计算处理单元时服务器更新目标模型,终端只需从更新后的目标模型中重新读取即可,避免了相关技术中终端需要卸载目标应用程序并重新安装后才能获取重新编译生成的二进制可执行程序,并根据该二进制可执行程序使用该模型的情况。
步骤203,根据输入参数,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,输出得到目标应用程序对应的目标参数。
可选的,终端将输入参数输入至目标模型中输出得到目标应用程序对应的目标参数。其中,目标模型在使用的过程中多个模型参数运行在各自对应的状态值所指示的计算处理单元中。
可选的,目标模型、输入参数和目标参数之间的对应关系包括但不限于以下几种可能的对应关系:
在一种可能的对应关系中,当目标模型为场景分类模型时,输入参数包括目标应用程序当前的应用图层中的图层特征,目标参数包括应用图层对应的应用场景的场景类型标识。
比如,目标模型为游戏场景分类模型,输入参数包括游戏应用程序当前的应用图层中的图层特征,目标参数包括应用图层对应的游戏场景的场景类型标识。游戏场景包括资源更新场景、账号登录场景、游戏主界面场景、商城界面场景、游戏内加载场景和对战场景中的至少一种。
在另一种可能的对应关系中,当目标模型为多媒体文件评分模型时,输入参数包括包含目标应用程序当前的多媒体文件中的文件特征,目标参数包括多媒体文件的文件评分,多媒体文件包括文本、图像、音频和视频中的至少一种。
可选的,多媒体文件评分模型为文本评分模型、图像评分模型、音频评分模型和视频评分模型中的一种。
比如,目标模型为图像评分模型,终端获取图像处理应用程序的目标图像,从目标图像中提取图像特征,将该图像特征作为输入参数输入至图像评分模型中,输出得到该目标图像的图像评分,图像评分用于指示该目标图像的图像质量。
在另一种可能的对应关系中,当目标模型为画质调节模型时,输入参数包括目标应用程序对应的系统参数数据中的数据特征,目标参数包括目标应用程序的目标画质参数。
系统参数数据包括操作系统的温度数据或者电池电量数据。
比如,目标模型为画质调节模型,终端获取操作系统当前的温度数据,当温度数据大于预设温度阈值时将当前的温度数据作为输入参数输入至画质调节模型中,输出得到目标应用程序的目标画质参数,画质参数用于指示在终端屏幕中所显示的目标应用程序的画面质量。
需要说明的是,目标模型、输入参数和目标参数之间的对应关系还可以包括根据上述几种可能的对应关系易于思及的其它可能的对应关系,本实施例不再一一举例说明。
综上所述,本实施例通过将多个模型参数各自对应的状态值配置在目标模型中,根据更新后的目标模型中所配置的多个模型参数各自对应的状态值,确定多个模型参数各自所运行的计算处理单元,计算处理单元包括CPU、GPU、DSP、NPU中的至少一种,避免了相关技术中需要将目标应用程序卸载并重新安装才能根据重新编译生成的二进制可执行程序,确定出该模型中的多个模型参数各自所运行的处理单元的情况,进而简化了对模型参数所运行的处理单元进行重新配置的过程,提高了配置效率。
可选的,上述获取目标应用程序对应的输入参数和目标模型,包括:
当接收到目标应用程序对应的识别指令时,获取目标应用程序对应的待识别数据,将待识别数据中的目标特征确定为输入参数;
在终端的指定存储位置中读取目标模型,目标模型为实时更新或者每隔预定时间间隔更新的用于对目标特征进行识别的模型。
可选的,上述在终端的指定存储位置中读取目标模型之前,还包括:
接收服务器发送的模型更新数据,模型更新数据用于指示对目标模型中的至少一个模型参数对应的计算处理单元进行修改;
根据模型更新数据对目标模型进行更新。
可选的,上述读取多个模型参数各自对应的状态值,包括:
获取目标模型对应的目标配置文件,目标配置文件用于存储目标模型的模型参数与状态值之间的对应关系;
从目标配置文件中读取多个模型参数各自对应的状态值。
可选的,上述获取目标应用程序对应的输入参数和目标模型之前,还包括:
获取训练得到的中间网络模型,中间网络模型包括多个模型参数;
将中间网络模型转化为目标模型,目标模型包括模型参数和状态值之间的对应关系。
可选的,上述获取训练得到的中间网络模型,包括:
获取训练样本集,训练样本集包括多组样本数据组,样本数据组包括样本输入参数和预先标注的正确目标参数;
根据多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到中间网络模型。
可选的,上述根据输入参数,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,输出得到目标应用程序对应的目标参数之后,还包括:
将输入参数和目标参数添加至训练样本集,得到更新后的训练样本集;
根据更新后的训练样本集对中间网络模型进行训练,得到更新后的中间网络模型。
可选的,上述目标模型为用于对目标应用程序对应的待识别数据中的目标特征进行识别的神经网络模型,输入参数为待识别数据中的目标特征,目标参数为待识别数据对应的识别结果。
可选的,当目标模型为场景分类模型时,输入参数包括目标应用程序当前的应用图层中的图层特征,目标参数包括应用图层对应的应用场景的场景类型标识;或者,
当目标模型为多媒体文件评分模型时,输入参数包括包含目标应用程序当前的多媒体文件中的文件特征,目标参数包括多媒体文件的文件评分,多媒体文件包括文本、图像、音频和视频中的至少一种;或者,
当目标模型为画质调节模型时,输入参数包括目标应用程序对应的系统参数数据中的数据特征,目标参数包括目标应用程序的目标画质参数。
请参考图3,其示出了本申请一个示例性实施例提供的模型处理方法的流程图。本实施例以该模型处理方法应用于图1所示出的终端中来举例说明。该模型处理方法包括:
步骤301,获取训练得到的中间网络模型,中间网络模型包括多个模型参数。
可选的,终端获取训练得到的中间网络模型,包括:获取训练样本集,训练样本集包括多组样本数据组,样本数据组包括样本输入参数和预先标注的正确目标参数。根据多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到中间网络模型。
在一种可能的实现方式中,终端根据多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到中间网络模型,包括但不限于以下几个步骤,如图4所示:
步骤401,对于至少一组样本数据组中的每组样本数据组,从样本输入参数中提取样本参数特征。
终端根据样本输入参数,采用特征提取算法计算得到特征向量,将计算得到的特征向量确定为样本参数特征。
可选的,终端根据样本输入参数,采用特征提取算法计算得到特征向量,包括:对采集到的样本输入参数进行特征提取,将经过特征提取后的数据确定为特征向量。
示意性的,特征提取是从样本输入参数中提取特征,并将特征转换为结构化数据的过程。
步骤402,将样本参数特征输入原始参数模型,得到训练结果。
可选的,原始参数模型是根据神经网络模型建立的,比如:原始参数模型是根据DNN模型或者RNN模型建立的。
示意性的,对于每组样本数据组,终端创建该组样本数据组对应的输入输出对,输入输出对的输入参数为该组样本数据组中的样本参数特征,目标参数为该组样本数据组中的正确目标参数;终端将输入参数输入预测模型,得到训练结果。
可选的,输入输出对通过特征向量表示。
步骤403,将训练结果与正确目标参数进行比较,得到计算损失,计算损失用于指示训练结果与正确目标参数之间的误差。
可选地,计算损失通过交叉熵(cross-entropy)来表示,
可选地,终端通过下述公式计算得到计算损失H(p,q):
Figure PCTCN2019111086-appb-000001
其中,p(x)和q(x)是长度相等的离散分布向量,p(x)表示表示训练结果;q(x)表示目标参数;x为训练结果或目标参数中的一个向量。
步骤404,根据至少一组样本数据组各自对应的计算损失,采用误差反向传播算法训练得到目标模型。
可选地,终端通过反向传播算法根据计算损失确定目标模型的梯度方向,从目标模型的输出层逐层向前更新目标模型中的模型参数。
步骤302,将中间网络模型转化为目标模型,目标模型包括模型参数和状态值之间的对应关系。
可选的,终端将中间网络模型转化为目标模型,包括:终端在训练得到的中间网络模型中配置多个模型参数各自对应的状态值得到目标模型。
在一种可能的实现方式中,终端中预先存储有状态值与计算处理单元之间的第一对应关系。后续在终端读取一个模型参数对应的状态值时,根据预先存储的第一对应关系获取状态值所指示的计算处理单元。
在另一种可能的实现方式中,终端将中间网络模型转化为目标模型,目标模型包括模型参数、状态值和计算处理单元这三者之间的对应关系。
在一个示意性的例子中,模型参数、状态值和计算处理单元这三者之间的对应关系如表一所示。在表一中,包括五个模型参数,模型参数“参数S1”对应的状态值为“1”,对应的计算处理单元为“CPU”;模型参数“参数S2”对应的状态值为“1”,对应的计算处理单元为“CPU”;模型参数“参数S3”对应的状态值为“2”,对应的计算处理单元为“GPU”;模型参数“参数S4”对应的状态值为“3”,对应的计算处理单元为“DSP”;模型参数“参数S5”对应的状态值为“4”,对应的计算处理单元为“NPU”。
表一
模型参数 状态值 计算处理单元
参数S1 1 CPU
参数S2 1 CPU
参数S3 2 GPU
参数S4 3 DSP
参数S5 4 NPU
步骤303,当接收到目标应用程序对应的识别指令时,获取目标应用程序对应的待识别数据,将待识别数据中的目标特征确定为输入参数。
可选的,当终端检测到目标应用程序处于前台运行时,若终端接收到目标应用程序对应的识别指令,则获取目标应用程序对应的输入参数和目标模型。
可选地,终端从操作系统的预定栈中,获取处于前台运行的应用程序的应用标识,当应用标识为目标应用程序的应用标识时确定目标应用程序处于前台运行。示意性的,该预定栈 为预定的活动栈。
目标应用程序的应用标识用于唯一指示目标应用程序,比如,应用标识为目标应用程序的包名。
可选地,终端采用主动轮询的方式监控处于前台运行的应用程序,根据前台运动活动(英文:Activity)来确定处于前台运行的应用程序。其中,活动是一种包含用户界面的组件,用于实现与用户之间的交互,每个应用程序包括多个活动,每个活动对应一种用户界面。前台运行活动是位于最上层的用户界面相对应的组件。最上层的用户界面是用户在使用终端时在屏幕上看见的用户界面。
以操作系统为安卓操作系统为例,活动是可以层叠的,每当启动一个新的活动,新的活动就会覆盖在原活动之上。使用活动栈存放启动的活动,活动栈是一种后进先出的数据结构,在默认情况下,每启动一个活动,该活动就会在活动栈中入栈,并处于栈顶位置,处于栈顶位置的活动是前台运行活动。当前台运行活动发生变化时,活动栈中处于栈顶位置的活动也会发生变化,终端通过程序管理器采用主动轮询的方式监控前台运行活动。
需要说明的是,除了新的活动会位于栈顶,将一个旧的活动切换到前台运行时,该旧的活动也会重新移动到栈顶。
可选的,当终端接收到目标应用程序中识别入口对应的操作信号时,确定接收到目标应用程序对应的识别指令,开启目标应用程序的识别功能,并获取目标应用程序对应的输入参数和目标模型。
识别入口是用于开启目标应用程序的识别功能的可操作控件。示意性的,识别入口的类型包括按钮、可操控的条目、滑块中的至少一种。
可选的,操作信号是用于触发开启目标应用程序的识别功能的用户操作。示意性的,操作信号包括点击操作信号、滑动操作信号、按压操作信号、长按操作信号中的任意一种或多种的组合。在其它可能的实现方式中,操作信号也可以语音形式实现。
步骤304,在终端的指定存储位置中读取目标模型,目标模型为实时更新或者每隔预定时间间隔更新的用于对目标特征进行识别的模型。
可选地,终端在指定存储位置中存储有更新后的目标模型。
可选的,在终端的指定位置中读取目标模型之前,还包括:终端接收服务器发送的模型更新数据,模型更新数据用于指示对目标模型中的至少一个模型参数对应的计算处理单元进行修改;根据模型更新数据对目标模型进行更新。
终端接收服务器发送的模型更新数据,包括但不限于以下几种可能的实现方式:
在一种可能的实现方式中,当终端接收到目标应用程序对应的识别指令,开启目标应用程序的识别功能时,向服务器发送查询指令,服务器接收到查询指令后将模型更新数据发送至终端,对应的,终端接收服务器发送的模型更新数据。
在另一种可能的实现方式中,当服务器对目标模型中的至少一个模型参数对应的计算处理单元进行修改时,向终端发送模型更新数据;对应的,终端接收服务器发送的模型更新数据。
在另一种可能的实现方式中,终端每隔预定时间间隔从服务器中获取模型更新数据。
需要说明的是,本实施例对终端接收服务器发送的模型更新数据的时机不加以限定。
步骤305,根据输入参数,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,输出得到目标应用程序对应的目标参数。
终端将输入参数输入至目标模型中输出得到目标应用程序对应的目标参数。其中,目标模型在使用的过程中多个模型参数运行在各自对应的状态值所指示的计算处理单元中。
在一个示意性的例子中,目标应用程序为游戏应用程序,终端获取游戏应用程序对应的输入参数和目标模型,输入参数包括游戏应用程序当前的应用图层中的图层特征,目标模型为场景分类模型,场景分类模型包括三个模型参数“参数S1、参数S2和参数S5”,终端从场景分类模型中读取得到模型参数“参数S1”对应的状态值为“1”,模型参数“参数S2”对应的状态值为“1”,模型参数“参数S5”对应的状态值为“4”,基于表一提供的模型参数、状态值和计算处理单元这三者之间的对应关系,终端在将图层特征输入至场景分类模型中输出得到场景类型标识的过程中,参数S1和参数S2均运行在CPU中,参数S5运行在NPU中。
可选的,终端在输出得到目标应用程序对应的目标参数之后,将输入参数和目标参数添加至训练样本集,得到更新后的训练样本集;根据更新后的训练样本集对中间网络模型进行训练,得到更新后的中间网络模型。
其中,根据更新后的训练样本集对中间网络模型进行训练,得到更新后的中间网络模型的过程可类比参考上述的中间网络模型的训练过程,在此不再赘述。
综上所述,本申请实施例还通过当终端接收到目标应用程序对应的识别指令时,获取目标应用程序对应的待识别数据,将待识别数据中的目标特征确定为输入参数;在终端的指定存储位置中读取目标模型,由于目标模型存储于终端的指定存储位置中,且该目标模型为实时更新或者每隔预定时间间隔更新的用于对目标特征进行识别的模型,使得终端在对目标应用程序对应的待识别数据进行识别时获取到的目标模型为更新后的目标模型,进而使得终端能够及时根据修改后的多个模型参数各自对应的状态值使用该目标模型。
本申请实施例还通过终端将输入参数和目标参数添加至训练样本集,得到更新后的训练样本集;根据更新后的训练样本集对中间网络模型进行训练,得到更新后的中间网络模型,使得终端可以根据新的训练样本不断提高中间网络模型的精度,提高了终端确定目标应用程序对应的目标参数的准确性。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图5,其示出了本申请一个实施例提供的模型处理装置的结构示意图。该模型处理装置可以通过专用硬件电路,或者,软硬件的结合实现成为图1中的终端的全部或一部分,该模型处理装置包括:获取模块510、读取模块520和输出模块530。
获取模块510,用于获取目标应用程序对应的输入参数和目标模型,目标模型为采用样本输入参数对多个模型参数进行训练得到的模型;
读取模块520,用于读取多个模型参数各自对应的状态值,状态值用于指示目标模型更新后所配置的用于运行模型参数的计算处理单元;
输出模块530,用于根据输入参数,将多个模型参数运行在各自对应的状态值所指示的计算处理单元中,输出得到目标应用程序对应的目标参数;
其中,计算处理单元包括CPU、GPU、DSP、NPU中的至少一种。
综上所述,本实施例通过将多个模型参数各自对应的状态值配置在目标模型中,根据更新后的目标模型中所配置的多个模型参数各自对应的状态值,确定多个模型参数各自所运行的计算处理单元,计算处理单元包括CPU、GPU、DSP、NPU中的至少一种,避免了相关技术中需要将目标应用程序卸载并重新安装才能根据重新编译生成的二进制可执行程序,确定出该模型中的多个模型参数各自所运行的处理单元的情况,进而简化了对模型参数所运行的处理单元进行重新配置的过程,提高了配置效率。
可选的,所述获取模块510,包括:参数确定单元和模型读取单元;
所述参数确定单元,用于当接收到所述目标应用程序对应的识别指令时,获取所述目标应用程序对应的待识别数据,将所述待识别数据中的目标特征确定为所述输入参数;
所述模型读取单元,用于在所述终端的指定存储位置中读取所述目标模型,所述目标模型为实时更新或者每隔预定时间间隔更新的用于对所述目标特征进行识别的模型。
可选的,所述装置还包括:数据接收模块和第一模型更新模块;
所述数据接收模块,用于所述模型读取单元在所述终端的指定存储位置中读取所述目标 模型之前,接收服务器发送的模型更新数据,所述模型更新数据用于指示对所述目标模型中的至少一个所述模型参数对应的所述计算处理单元进行修改;
所述第一模型更新模块,用于根据所述模型更新数据对所述目标模型进行更新。
可选的,所述读取模块520,包括:文件获取单元和状态值读取单元;
所述文件获取单元,用于获取所述目标模型对应的目标配置文件,所述目标配置文件用于存储所述目标模型的所述模型参数与所述状态值之间的对应关系;
所述状态值读取单元,用于从所述目标配置文件中读取所述多个模型参数各自对应的状态值。
可选的,所述装置还包括:模型获取模块和模型转化模块;
所述模型获取模块,用于在所述获取模块获取目标应用程序对应的输入参数和目标模型之前,获取训练得到的中间网络模型,所述中间网络模型包括所述多个模型参数;
所述模型转化模块,用于将所述中间网络模型转化为所述目标模型,所述目标模型包括所述模型参数和所述状态值之间的对应关系。
可选的,所述模型获取模块,包括:样本集获取单元和训练单元;
所述样本集获取单元,用于获取训练样本集,所述训练样本集包括多组样本数据组,所述样本数据组包括所述样本输入参数和预先标注的正确目标参数;
所述训练单元,用于根据所述多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到所述中间网络模型。
可选的,所述装置还包括:样本集更新模块和第二模型更新模块;
所述样本集更新模块,用于在所述输出模块根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数之后,将所述输入参数和所述目标参数添加至所述训练样本集,得到更新后的训练样本集;
所述第二模型更新模块,用于根据所述更新后的训练样本集对所述中间网络模型进行训练,得到更新后的中间网络模型。
可选的,目标模型为用于对目标应用程序对应的待识别数据中的目标特征进行识别的神经网络模型,输入参数为待识别数据中的目标特征,目标参数为待识别数据对应的识别结果。
可选的,当目标模型为场景分类模型时,输入参数包括目标应用程序当前的应用图层中的图层特征,目标参数包括应用图层对应的应用场景的场景类型标识;
或者,当目标模型为多媒体文件评分模型时,输入参数包括包含目标应用程序当前的多 媒体文件中的文件特征,目标参数包括多媒体文件的文件评分,多媒体文件包括文本、图像、音频和视频中的至少一种;或者,
当目标模型为画质调节模型时,输入参数包括目标应用程序对应的系统参数数据中的数据特征,目标参数包括目标应用程序的目标画质参数。
相关细节可结合参考图2至图4所示的方法实施例。其中,获取模块510还用于实现上述方法实施例中其他任意隐含或公开的与获取步骤相关的功能;读取模块520还用于实现上述方法实施例中其他任意隐含或公开的与读取步骤相关的功能;输出模块530还用于实现上述方法实施例中其他任意隐含或公开的与输出步骤相关的功能。
需要说明的是,上述实施例提供的装置,在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
本申请还提供一种计算机可读介质,其上存储有程序指令,程序指令被处理器执行时实现上述各个方法实施例提供的模型处理方法。
本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个实施例所述的模型处理方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的模型处理方法中全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种模型处理方法,其特征在于,用于终端中,所述方法包括:
    获取目标应用程序对应的输入参数和目标模型,所述目标模型为采用样本输入参数对多个模型参数进行训练得到的模型;
    读取所述多个模型参数各自对应的状态值,所述状态值用于指示所述目标模型更新后所配置的用于运行所述模型参数的计算处理单元;
    根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数;
    其中,所述计算处理单元包括中央处理器CPU、图形处理器GPU、数字信号处理器DSP、嵌入式神经网络处理器NPU中的至少一种。
  2. 根据权利要求1所述的方法,其特征在于,所述获取目标应用程序对应的输入参数和目标模型,包括:
    当接收到所述目标应用程序对应的识别指令时,获取所述目标应用程序对应的待识别数据,将所述待识别数据中的目标特征确定为所述输入参数;
    在所述终端的指定存储位置中读取所述目标模型,所述目标模型为实时更新或者每隔预定时间间隔更新的用于对所述目标特征进行识别的模型。
  3. 根据权利要求2所述的方法,其特征在于,所述在所述终端的指定存储位置中读取所述目标模型之前,还包括:
    接收服务器发送的模型更新数据,所述模型更新数据用于指示对所述目标模型中的至少一个所述模型参数对应的所述计算处理单元进行修改;
    根据所述模型更新数据对所述目标模型进行更新。
  4. 根据权利要求1所述的方法,其特征在于,所述读取所述多个模型参数各自对应的状态值,包括:
    获取所述目标模型对应的目标配置文件,所述目标配置文件用于存储所述目标模型的所述模型参数与所述状态值之间的对应关系;
    从所述目标配置文件中读取所述多个模型参数各自对应的状态值。
  5. 根据权利要求1所述的方法,其特征在于,所述获取目标应用程序对应的输入参数和目标模型之前,还包括:
    获取训练得到的中间网络模型,所述中间网络模型包括所述多个模型参数;
    将所述中间网络模型转化为所述目标模型,所述目标模型包括所述模型参数和所述状态值之间的对应关系。
  6. 根据权利要求5的方法,其特征在于,所述获取训练得到的中间网络模型,包括:
    获取训练样本集,所述训练样本集包括多组样本数据组,所述样本数据组包括所述样本输入参数和预先标注的正确目标参数;
    根据所述多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到所述中间网络模型。
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数之后,还包括:
    将所述输入参数和所述目标参数添加至所述训练样本集,得到更新后的训练样本集;
    根据所述更新后的训练样本集对所述中间网络模型进行训练,得到更新后的中间网络模型。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述目标模型为用于对所述目标应用程序对应的待识别数据中的目标特征进行识别的神经网络模型,所述输入参数为所述待识别数据中的所述目标特征,所述目标参数为所述待识别数据对应的识别结果。
  9. 根据权利要求8所述的方法,其特征在于,
    当所述目标模型为场景分类模型时,所述输入参数包括所述目标应用程序当前的应用图层中的图层特征,所述目标参数包括所述应用图层对应的应用场景的场景类型标识;或者,
    当所述目标模型为多媒体文件评分模型时,所述输入参数包括包含所述目标应用程序当前的多媒体文件中的文件特征,所述目标参数包括所述多媒体文件的文件评分,所述多媒体 文件包括文本、图像、音频和视频中的至少一种;或者,
    当所述目标模型为画质调节模型时,所述输入参数包括所述目标应用程序对应的系统参数数据中的数据特征,所述目标参数包括所述目标应用程序的目标画质参数。
  10. 一种模型处理装置,其特征在于,用于终端中,所述装置包括:
    获取模块,用于获取目标应用程序对应的输入参数和目标模型,所述目标模型为采用样本输入参数对多个模型参数进行训练得到的模型;
    读取模块,用于读取所述多个模型参数各自对应的状态值,所述状态值用于指示所述目标模型更新后所配置的用于运行所述模型参数的计算处理单元;
    输出模块,用于根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数;
    其中,所述计算处理单元包括中央处理器CPU、图形处理器GPU、数字信号处理器DSP、嵌入式神经网络处理器NPU中的至少一种。
  11. 根据权利要求10所述的装置,其特征在于,所述获取模块,包括:参数确定单元和模型读取单元;
    所述参数确定单元,用于当接收到所述目标应用程序对应的识别指令时,获取所述目标应用程序对应的待识别数据,将所述待识别数据中的目标特征确定为所述输入参数;
    所述模型读取单元,用于在所述终端的指定存储位置中读取所述目标模型,所述目标模型为实时更新或者每隔预定时间间隔更新的用于对所述目标特征进行识别的模型。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:数据接收模块和第一模型更新模块;
    所述数据接收模块,用于所述模型读取单元在所述终端的指定存储位置中读取所述目标模型之前,接收服务器发送的模型更新数据,所述模型更新数据用于指示对所述目标模型中的至少一个所述模型参数对应的所述计算处理单元进行修改;
    所述第一模型更新模块,用于根据所述模型更新数据对所述目标模型进行更新。
  13. 根据权利要求10所述的装置,其特征在于,所述读取模块,包括:文件获取单元和状态值读取单元;
    所述文件获取单元,用于获取所述目标模型对应的目标配置文件,所述目标配置文件用于存储所述目标模型的所述模型参数与所述状态值之间的对应关系;
    所述状态值读取单元,用于从所述目标配置文件中读取所述多个模型参数各自对应的状态值。
  14. 根据权利要求10所述的装置,其特征在于,所述装置还包括:模型获取模块和模型转化模块;
    所述模型获取模块,用于在所述获取模块获取目标应用程序对应的输入参数和目标模型之前,获取训练得到的中间网络模型,所述中间网络模型包括所述多个模型参数;
    所述模型转化模块,用于将所述中间网络模型转化为所述目标模型,所述目标模型包括所述模型参数和所述状态值之间的对应关系。
  15. 根据权利要求14的装置,其特征在于,所述模型获取模块,包括:样本集获取单元和训练单元;
    所述样本集获取单元,用于获取训练样本集,所述训练样本集包括多组样本数据组,所述样本数据组包括所述样本输入参数和预先标注的正确目标参数;
    所述训练单元,用于根据所述多组样本数据组,采用误差反向传播算法对初始网络模型进行训练,得到所述中间网络模型。
  16. 根据权利要求15所述的装置,其特征在于,所述装置还包括:样本集更新模块和第二模型更新模块;
    所述样本集更新模块,用于在所述输出模块根据所述输入参数,将所述多个模型参数运行在各自对应的所述状态值所指示的所述计算处理单元中,输出得到所述目标应用程序对应的目标参数之后,将所述输入参数和所述目标参数添加至所述训练样本集,得到更新后的训练样本集;
    所述第二模型更新模块,用于根据所述更新后的训练样本集对所述中间网络模型进行训练,得到更新后的中间网络模型。
  17. 根据权利要求10至16任一所述的装置,其特征在于,所述目标模型为用于对所述目标应用程序对应的待识别数据中的目标特征进行识别的神经网络模型,所述输入参数为所 述待识别数据中的所述目标特征,所述目标参数为所述待识别数据对应的识别结果。
  18. 根据权利要求17所述的装置,其特征在于,
    当所述目标模型为场景分类模型时,所述输入参数包括所述目标应用程序当前的应用图层中的图层特征,所述目标参数包括所述应用图层对应的应用场景的场景类型标识;或者,
    当所述目标模型为多媒体文件评分模型时,所述输入参数包括包含所述目标应用程序当前的多媒体文件中的文件特征,所述目标参数包括所述多媒体文件的文件评分,所述多媒体文件包括文本、图像、音频和视频中的至少一种;或者,
    当所述目标模型为画质调节模型时,所述输入参数包括所述目标应用程序对应的系统参数数据中的数据特征,所述目标参数包括所述目标应用程序的目标画质参数。
  19. 一种终端,其特征在于,所述终端包括处理器、与所述处理器相连的存储器,以及存储在所述存储器上的程序指令,所述处理器执行所述程序指令时实现如权利要求1至9任一所述的模型处理方法。
  20. 一种计算机可读存储介质,其特征在于,其上存储有程序指令,所述程序指令被处理器执行时实现如权利要求1至9任一所述的模型处理方法。
PCT/CN2019/111086 2018-11-19 2019-10-14 模型处理方法、装置、终端及存储介质 WO2020103606A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811376526.4 2018-11-19
CN201811376526.4A CN111273953B (zh) 2018-11-19 2018-11-19 模型处理方法、装置、终端及存储介质

Publications (1)

Publication Number Publication Date
WO2020103606A1 true WO2020103606A1 (zh) 2020-05-28

Family

ID=70773025

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/111086 WO2020103606A1 (zh) 2018-11-19 2019-10-14 模型处理方法、装置、终端及存储介质

Country Status (2)

Country Link
CN (1) CN111273953B (zh)
WO (1) WO2020103606A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783506B (zh) * 2021-01-29 2022-09-30 展讯通信(上海)有限公司 一种模型运行方法及相关装置
CN113177471A (zh) * 2021-04-28 2021-07-27 Oppo广东移动通信有限公司 动作检测方法、装置、电子设备及存储介质
CN113821321A (zh) * 2021-08-31 2021-12-21 上海商汤阡誓科技有限公司 任务处理芯片、方法、装置、计算机设备及存储介质
CN114327671A (zh) * 2021-12-03 2022-04-12 北京达佳互联信息技术有限公司 参数配置方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144730A1 (en) * 2007-11-30 2009-06-04 Huawei Technologies Co., Ltd. Software deployment method and system, software deployment server and user server
CN103677835A (zh) * 2013-12-16 2014-03-26 北京经纬恒润科技有限公司 软件集成方法及系统
CN104063239A (zh) * 2013-03-22 2014-09-24 腾讯科技(深圳)有限公司 移动终端的应用程序更新方法及服务器、客户端
CN107168726A (zh) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 一种动态配置应用程序的方法和装置
CN108037961A (zh) * 2017-12-07 2018-05-15 北京锐安科技有限公司 一种应用程序配置方法、装置、服务器和存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8009912B2 (en) * 2007-09-24 2011-08-30 Kabushiki Kaisha Toshiba Image-processing apparatus which has an image region distinction processing capability, and an image region distinction processing method
US20160034814A1 (en) * 2014-08-01 2016-02-04 University Of Southern California Noise-boosted back propagation and deep learning neural networks
CN104346629B (zh) * 2014-10-24 2018-01-12 开源物联网(广州)有限公司 一种模型参数训练方法、装置及系统
CN110442417A (zh) * 2016-01-08 2019-11-12 第四范式(北京)技术有限公司 特征抽取方法、机器学习方法及其装置
CN106295678B (zh) * 2016-07-27 2020-03-06 北京旷视科技有限公司 神经网络训练与构建方法和装置以及目标检测方法和装置
JP6635265B2 (ja) * 2016-07-29 2020-01-22 株式会社デンソーアイティーラボラトリ 予測装置、予測方法および予測プログラム
CN108108821B (zh) * 2017-12-29 2022-04-22 Oppo广东移动通信有限公司 模型训练方法及装置
CN108733639B (zh) * 2018-04-09 2023-08-01 中国平安人寿保险股份有限公司 一种配置参数调整方法、装置、终端设备及存储介质
CN108805048B (zh) * 2018-05-25 2020-01-31 腾讯科技(深圳)有限公司 一种人脸识别模型的调整方法、装置和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144730A1 (en) * 2007-11-30 2009-06-04 Huawei Technologies Co., Ltd. Software deployment method and system, software deployment server and user server
CN104063239A (zh) * 2013-03-22 2014-09-24 腾讯科技(深圳)有限公司 移动终端的应用程序更新方法及服务器、客户端
CN103677835A (zh) * 2013-12-16 2014-03-26 北京经纬恒润科技有限公司 软件集成方法及系统
CN107168726A (zh) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 一种动态配置应用程序的方法和装置
CN108037961A (zh) * 2017-12-07 2018-05-15 北京锐安科技有限公司 一种应用程序配置方法、装置、服务器和存储介质

Also Published As

Publication number Publication date
CN111273953A (zh) 2020-06-12
CN111273953B (zh) 2021-07-16

Similar Documents

Publication Publication Date Title
WO2020103606A1 (zh) 模型处理方法、装置、终端及存储介质
US10922866B2 (en) Multi-dimensional puppet with photorealistic movement
RU2666631C2 (ru) Обучение dnn-студента посредством распределения вывода
WO2020082560A1 (zh) 文本关键词提取方法、装置、设备及计算机可读存储介质
US11158090B2 (en) Enhanced video shot matching using generative adversarial networks
US20190005399A1 (en) Learning device, generation device, learning method, generation method, and non-transitory computer readable storage medium
CN109299458A (zh) 实体识别方法、装置、设备及存储介质
US20200101383A1 (en) Method and apparatus for recognizing game command
CN107947951A (zh) 用户群组推荐方法、装置及存储介质和服务器
CN112990390B (zh) 一种图像识别模型的训练方法、图像识别的方法及装置
WO2018000281A1 (zh) 一种基于深度神经网络的用户画像表示学习系统及方法
US11380131B2 (en) Method and device for face recognition, storage medium, and electronic device
CN111292262B (zh) 图像处理方法、装置、电子设备以及存储介质
CN109086276B (zh) 数据翻译方法、装置、终端及存储介质
US20220138489A1 (en) Method of live video event detection based on natural language queries, and an apparatus for the same
KR20190140801A (ko) 영상, 음성, 텍스트 정보를 기반으로 사용자의 감정, 나이, 성별을 인식하는 방법
CN111553838A (zh) 模型参数的更新方法、装置、设备及存储介质
CN113516961A (zh) 一种音符生成方法、相关设备、存储介质及程序产品
CN109961152B (zh) 虚拟偶像的个性化互动方法、系统、终端设备及存储介质
US20220148295A1 (en) Model training method, content generation method, and related apparatuses
CN110059224B (zh) 投影仪设备的视频检索方法、装置、设备及存储介质
CN109948426A (zh) 应用程序调整方法、装置、电子设备及存储介质
CN112749364B (zh) 基于人工智能的网页生成方法、装置、设备及存储介质
CN111784787B (zh) 图像生成方法和装置
KR20210063171A (ko) 이미지 변환 장치 및 이미지 변환 방법

Legal Events

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

Ref document number: 19886124

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19886124

Country of ref document: EP

Kind code of ref document: A1