Neural network model training method and device, equipment and storage medium
By obtaining the training data and strategies provided by the user, training the initial neural network model is solved, and the problem of insufficient tunability of neural network models in the prior art is achieved, achieving higher personalized adaptability and flexibility.
Patent Information
- Application Number
- CN202311169079.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-03-11
AI Technical Summary
The published neural network model in the prior art is insufficiently adjustable for users and is difficult to meet users' personalized needs.
By obtaining the training data and/or training strategies provided by the first user, the initial neural network model is trained to obtain the target neural network model. This method allows the first user to further train the neural network model according to their own needs to improve the tunability of the model.
The tunability of the neural network model is improved, so that the model can better meet the personalized needs of users, and the flexibility and adaptability of the model are increased.
Smart Images

Figure CN119599063A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a neural network model training method, device, equipment and storage medium. Background Art
[0002] A neural network model is a mathematical model that mimics the structure and function of a biological neural network and can be used in computer vision, speech recognition, image processing, etc. A neural network model is a computational model that consists of a large number of nodes and connections between them. After building a neural network model, you can use training data to train the neural network model to determine the weights and other parameters of the neural network model.
[0003] After the neural network model is released, users may have different requirements for the data processing effect of the neural network model. For example, for a neural network model used for image processing, users may have different requirements for the style of the processed image. At this time, developers can fine-tune the neural network model to meet user needs by adjusting the training data and training strategy.
[0004] In order to facilitate users to adjust the neural network model according to their own needs, in some technologies, developers can pre-set some user-adjustable control parameters, and users can adjust the neural network model by adjusting these control parameters. However, this method cannot preset all the control parameters that users want to control. In addition, the scale of the network model will constrain the input of the control parameters.
[0005] In some technologies, developers can provide multiple neural network models with different processing effects, and users can select the required neural network model from these neural network models. However, this method cannot define all the style types that customers want, and it will increase the workload of neural network model development and maintenance, which is costly.
[0006] In some technologies, the neural network model can be combined with the traditional algorithm. For example, the result processed by the neural network model is further processed by the traditional algorithm. The user can adjust the style of the final processed result by adjusting the control parameters of the traditional algorithm. However, this method only adjusts the processing effect of the traditional algorithm, and does not change the processing effect of the neural network model. That is, the user's adjustment of the style of the processing result is limited.
[0007] Therefore, in the prior art, the neural network model after release is not sufficiently adjustable for users and is difficult to meet the personalized needs of users. Summary of the invention
[0008] In view of this, the present application provides a neural network model training method, device, equipment and storage medium to help solve the problem in the prior art that the neural network model after release is not adjustable enough for users and is difficult to meet the personalized needs of users.
[0009] In a first aspect, an embodiment of the present application provides a neural network model training method, which is applied to a training platform, and the method includes: obtaining training data provided by a first user and / or obtaining a training strategy provided by the first user;
[0010] Based on target training data and a target training strategy, the initial neural network model is trained to obtain a target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user;
[0011] The initial neural network model is trained based on initial training data and an initial training strategy, and the initial training data and the initial training strategy are provided by a second user.
[0012] In a possible implementation manner of the first aspect, the target training data is training data provided by the first user.
[0013] In a possible implementation manner of the first aspect, the target training data includes training data provided by the first user and training data provided by the second user.
[0014] In a possible implementation manner of the first aspect, the target training strategy is a training strategy provided by the first user.
[0015] In a possible implementation manner of the first aspect, the target training strategy includes the training strategy provided by the first user and the training strategy provided by the second user.
[0016] In a possible implementation manner of the first aspect, when the initial neural network model is trained based on the target training data and the target training strategy, at least some model fragments of the initial neural network model are invisible to the first user.
[0017] In a possible implementation of the first aspect, the training platform includes a cloud server or a web server, and the cloud server or the web server is used to store the initial neural network model, and all model fragments of the initial neural network model are not visible to the first user.
[0018] In a possible implementation manner of the first aspect, when the target training data includes training data provided by the second user, the cloud server or the web server is further used to store the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data is not visible to the first user; and / or,
[0019] When the target training strategy includes the training strategy provided by the second user, the cloud server or the web server is also used to store the training strategy provided by the second user included in the target training strategy, and the training strategy provided by the second user included in the target training strategy is not visible to the first user.
[0020] In a possible implementation of the first aspect, the training platform includes a trusted execution environment of a processor, at least some model fragments of the initial neural network model are trained in the trusted execution environment of the processor, and the model fragments in the initial neural network model trained in the trusted execution environment of the processor are not visible to the first user.
[0021] In a possible implementation manner of the first aspect, when the target training data includes training data provided by the second user, the trusted execution environment of the processor is further used to obtain the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data is not visible to the first user; and / or,
[0022] When the target training policy includes the training policy provided by the second user, the trusted execution environment of the processor is also used to obtain the training policy provided by the second user included in the target training policy, and the training policy provided by the second user included in the target training policy is not visible to the first user.
[0023] In a possible implementation manner of the first aspect, the trusted execution environment of the processor includes a trusted execution environment of a GPU and / or a trusted execution environment of a CPU.
[0024] In a possible implementation of the first aspect, the training platform also includes a GPU, and some model fragments of the initial neural network model are trained in the trusted execution environment of the CPU and / or in the trusted execution environment of the GPU, and some model fragments of the initial neural network model are trained in the GPU.
[0025] In a second aspect, an embodiment of the present application provides a neural network model training device, comprising:
[0026] An acquisition unit, configured to acquire training data provided by the first user and / or acquire a training strategy provided by the first user;
[0027] A training unit, configured to train the initial neural network model based on target training data and a target training strategy to obtain a target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user;
[0028] The initial neural network model is trained based on initial training data and an initial training strategy, and the initial training data and the initial training strategy are provided by a second user.
[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute any one of the methods described in the first aspect above.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any method described in the first aspect.
[0031] Adopt the scheme provided in the embodiment of the present application, obtain the training data provided by the first user and / or obtain the training strategy provided by the first user; based on the target training data and the target training strategy, train the initial neural network model to obtain the target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user; wherein the initial neural network model is obtained by training based on the initial training data and the initial training strategy, and the initial training data and the initial training strategy are provided by the second user. In the embodiment of the present application, the initial neural network obtained after training the initial training data and the initial training strategy provided by the second user can be further trained based on the training data provided by the first user and / or the training strategy provided by the first user to obtain the target neural network. In this way, the initial neural network model can be further trained based on the actual needs of the first user, which improves the adjustability of the initial neural network model and makes it easy to obtain a neural network model that meets the needs of the first user. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0033] Figure 1 A schematic diagram of a scenario of an optimization method of a traditional algorithm model in the related art;
[0034] Figure 2 A schematic diagram of a scenario of a neural network model training method in the related art;
[0035] Figure 3 A schematic diagram of a scenario of an optimization method for a neural network model in the related art;
[0036] Figure 4 A schematic diagram of another optimization method of a neural network model in the related art;
[0037] Figure 5 A schematic diagram of another optimization method of a neural network model in the related art;
[0038] Figure 6 A flowchart of a neural network model training method provided in an embodiment of the present application;
[0039] Figure 7a-Figure 7b A schematic diagram of a scenario of a neural network model training method provided in an embodiment of the present application;
[0040] Figure 8a-8b A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0041] Fig. 9 A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0042] Fig.10 A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0043] Fig.11 A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0044] Fig.12 A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0045] Fig.13 A schematic diagram of another neural network model training method provided in an embodiment of the present application;
[0046] Fig.14 A schematic diagram of the structure of a neural network model training device provided in an embodiment of the present application;
[0047] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0049] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0050] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0051] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0052] After the algorithm model is released, users may have different requirements for data processing effects. For example, for an algorithm model used for image processing, users may have different requirements for the style of the processed image. For traditional algorithm models, the algorithm interface parameters, such as the parameters of traditional filters, can be adjusted to meet the actual needs of users. Figure 1 As shown in the figure, for traditional algorithm models, developers design algorithm prototypes, develop fixed-point algorithms, and harden algorithms before delivering the algorithm models to users. After testing the delivered models, users can adjust and optimize the algorithm interface parameters based on feedback.
[0053] A neural network model is a mathematical model that mimics the structure and function of a biological neural network and can be used in computer vision, speech recognition, image processing, etc. A neural network model is a computational model that consists of a large number of nodes and their connections. After building a neural network model, you can use training data to train the neural network model to determine the weights and other parameters of the neural network model.
[0054] For the released neural network model, developers can fine-tune the neural network model to meet user needs by adjusting the training data and training strategy. Figure 2 As shown in the figure, after developers design the basic database, basic loss function, and network model, they train the network model to obtain floating-point model parameters. After designing the delivery database, delivery loss function, and quantization library, they obtain the quantization model parameters. After the offline simulation test, feedback is provided. Based on the feedback, the delivery database and delivery loss function are adjusted to iteratively improve the model parameters.
[0055] In order to facilitate users to adjust the neural network model according to their own needs, in some technologies, developers can pre-set some user-adjustable control parameters, and users can adjust the neural network model by adjusting these control parameters. Figure 3 As shown, the developer can set the first control parameter 0, the first control parameter 1, ... the first control parameter n. The user can adjust the neural network model by adjusting these control parameters, thereby adjusting the processing effect of the neural network model. However, this method cannot preset all the control parameters that the user wants to control. In addition, the scale of the network model will constrain the input of the control parameters. In some technologies, the developer can provide multiple neural network models with different processing effects, and the user can select the required neural network model from these neural network models. For example, Figure 4 As shown in the figure, the developer provides neural network model 0, neural network model 1, and neural network model N with different processing effects. However, this method cannot define all the style types that customers want, and it will increase the workload of neural network model development and maintenance, which is costly. In some technologies, neural network models can be combined with traditional algorithms. For example, the results processed by the neural network model are further processed by traditional algorithms. Users can adjust the final processed style by adjusting the control parameters of the traditional algorithm, such as Figure 5 As shown, the processing effect of the traditional algorithm can be adjusted by adjusting the second control parameter 0, the second control parameter 1, ... the second control parameter n. However, this method only adjusts the processing effect of the traditional algorithm, and does not change the processing effect of the neural network model. That is, the user's adjustment range of the style of the processing result is constrained within the space of the fusion of the neural network model and the traditional algorithm, and the adjustment degree is limited.
[0056] Therefore, in the prior art, the neural network model after release is not sufficiently adjustable for users and is difficult to meet the personalized needs of users.
[0057] In response to the above problems, the embodiments of the present application provide a neural network model training method, apparatus, device and storage medium, which obtains the training data provided by the first user and / or obtains the training strategy provided by the first user; based on the target training data and the target training strategy, the initial neural network model is trained to obtain the target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user; wherein the initial neural network model is trained based on the initial training data and the initial training strategy, and the initial training data and the initial training strategy are provided by the second user. In the embodiments of the present application, the initial neural network obtained after training the initial training data and the initial training strategy provided by the second user can be further trained based on the training data provided by the first user and / or the training strategy provided by the first user to obtain the target neural network. In this way, the initial neural network model can be further trained based on the actual needs of the first user, which improves the adjustability of the initial neural network model and makes it easy to obtain a neural network model that meets the needs of the first user.
[0058] The details are described below.
[0059] See also Figure 6 , is a flow chart of a neural network model training method provided in an embodiment of the present application. Figure 6 As shown, the method is applied to a training platform, and the method comprises:
[0060] Step S601: obtaining training data provided by a first user and / or obtaining a training strategy provided by the first user;
[0061] In the embodiment of the present application, the first user can provide training data and training strategies according to actual needs. For example, for a neural network model for image processing, the first user can provide training data and training strategies according to the needs of its own application scenario, application sensor, processed image style, etc.
[0062] In some embodiments, the training data provided by the first user may be training data of an application scenario of the first user.
[0063] In some embodiments, the training strategy provided by the first user may be a loss function provided by the first user.
[0064] In some embodiments, the training strategy provided by the first user may be a learning rate provided by the first user.
[0065] In some embodiments, the training strategy provided by the first user may be a strategy for adjusting the true value of the training data.
[0066] Step S602: Based on the target training data and the target training strategy, the initial neural network model is trained to obtain the target neural network model. The target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user.
[0067] The initial neural network model is obtained by training based on initial training data and initial training strategies, and the initial training data and initial training strategies are provided by the second user. In an embodiment of the present application, the initial neural network model is obtained by training based on the initial training data and initial training strategies provided by the second user. The second user may be the developer of the initial neural network model.
[0068] When the initial neural network model is trained to obtain the target neural network model, at least part of the target training data used may be the training data provided by the first user, and / or at least part of the training strategy used may be the training strategy provided by the first user. That is, the initial neural network model may be further trained based on the training data provided by the first user and / or the training strategy provided by the first user to obtain the target neural network. The first user may be a user of the initial neural network model other than the second user. During the training process, the network architecture and interface of the initial neural network model remain unchanged, and the initial neural network model is optimized to meet the needs of the first user by adjusting parameters such as the weights of the initial neural network model. In this way, the initial neural network model may be further trained based on the actual needs of the first user, thereby improving the adjustability of the initial neural network model and easily obtaining a neural network model that meets the needs of the first user.
[0069] As a possible implementation manner, the target training data is training data provided by the first user.
[0070] In the embodiment of the present application, the target training data used in the process of training the initial neural network model to obtain the target neural network model can all be the training data provided by the first user. In this way, the trained target neural network model can be more in line with the needs of the first user.
[0071] As a possible implementation manner, the target training data includes training data provided by the first user and training data provided by the second user.
[0072] In an embodiment of the present application, the target training data includes both the training data provided by the first user and the training data provided by the second user. The training data provided by the second user may be the initial training data or the training data provided by the second user other than the initial training data. In this way, the convergence of the target neural network model can be ensured while meeting the needs of the first user.
[0073] In some embodiments, in order to ensure the convergence of the target neural network model, the proportion of the training data provided by the second user in the target training data is not less than a threshold.
[0074] Exemplarily, for an initial neural network model for image processing, the image processed by the initial neural network model is as follows: Figure 7a When the target training data includes training data in an application scenario provided by the first user, a target neural network model is obtained based on the target training data and the target training strategy. The image processed by the target neural network model is shown in FIG. Figure 7b As shown, compared with the image quality after being processed by the initial neural network model, the image quality after being processed by the target neural network model better meets the needs of the first user.
[0075] As a possible implementation manner, the target training strategy is a training strategy provided by the first user.
[0076] In an embodiment of the present application, all target training strategies used in the process of training the initial neural network model to obtain the target neural network model may be training strategies provided by the first user.
[0077] As a possible implementation manner, the target training strategy includes the training strategy provided by the first user and the training strategy provided by the second user.
[0078] In the embodiment of the present application, in order to meet the needs of the first user while ensuring the convergence of the target neural network model, the target training strategy includes both the training strategy provided by the first user and the training strategy provided by the second user. The training strategy provided by the second user may be the initial training strategy or a training strategy provided by the second user other than the initial training strategy.
[0079] Exemplarily, for an initial neural network model for image processing, the image processed by the initial neural network model is as follows: Figure 8a The training strategy provided by the first user in the target training strategy is to enhance the true value of the training data and train the initial neural network model based on the training data after the true value enhancement. The target neural network model is obtained based on the target training data and the target training strategy. The image processed by the target neural network model is shown in Figure 8b Compared with the image quality processed by the initial neural network model, the image quality processed by the target neural network model better meets the needs of the first user.
[0080] For example, Fig. 9As shown, the target training data includes training data provided by the first user and training data provided by the second user. The training strategy provided by the first user is a loss function provided by the first user. The loss function used in the process of further training the initial neural network model is a weighted sum of the loss function provided by the first user and the loss function provided by the second user.
[0081] As a possible implementation manner, when the initial neural network model is trained based on the target training data and the target training strategy, at least some model fragments of the initial neural network model are invisible to the first user.
[0082] In the embodiment of the present application, in order to meet the second user's confidentiality requirements for the initial neural network model, when the initial neural network model is trained based on the target training data and the target training strategy, some or all model fragments of the initial neural network model are invisible to the first user. In the process of training the initial neural network model to obtain the target neural network model, the first user cannot know the complete information of the initial neural network model, thereby meeting the second user's confidentiality requirements for the initial neural network model.
[0083] As a possible implementation, the training platform includes a cloud server or a web server, and the cloud server or the web server is used to store the initial neural network model. The initial neural network model on the cloud server or the web server can then be further trained, and by setting the first user's operation authority for the cloud server or the web server, the purpose of preventing the first user from knowing the complete information of the initial neural network model can be achieved.
[0084] In an embodiment of the present application, the training platform may be a cloud server or a web server, and the initial neural network model is stored on the cloud server or the web server.
[0085] In an embodiment of the present application, when the platform for storing the initial neural network model and for the first user to further train the initial neural network model is a cloud server or a web server, all model fragments of the initial neural network model are not visible to the first user.
[0086] If the training platform is a cloud server, all model fragments of the initial neural network model are only used for training for the first user and are not accessible to the first user. The initial neural network model stored in the cloud server is trained by the second user and uploaded to the cloud server.
[0087] If the training platform is a web server, the web server only provides web services to the first user, and disables root and shell for the first user, so that all model fragments of the initial neural network model are invisible to the first user. The initial neural network model stored in the web server is the initial network model trained by the second user and configured to the web server by the first user.
[0088] As a possible implementation, when the target training data includes training data provided by the second user, the cloud server or web server is further used to store the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data may not be visible to the first user. And / or, when the target training strategy includes the training strategy provided by the second user, the cloud server or web server is further used to store the training strategy provided by the second user included in the target training strategy, and the training strategy provided by the second user included in the target training strategy may not be visible to the first user.
[0089] In the embodiment of the present application, the training data and the training strategy provided by the second user can be stored in the cloud server or web server for the first user to use when further training the initial neural network model. In order to meet the confidentiality requirements of the training data and the training strategy provided by the second user, the training data and the training strategy provided by the second user are invisible to the first user.
[0090] For example, Fig.10 As shown, in order to facilitate implementation and shorten the development cycle, the training platform is a cloud server, and the initial neural network model, the training data provided by the second user, and the training strategy provided by the second user are all stored in the cloud server. The cloud server can obtain the training data and training strategy provided by the first user through the client. The cloud server trains the initial neural network model based on the target training data and the target training strategy to obtain the target neural network model. All model fragments of the initial neural network model, the training data provided by the second user, and the training strategy provided by the second user are not visible to the first user. In some embodiments, in order to meet the confidentiality requirements of the second user, the cloud server can be a cloud server trusted by the second user.
[0091] For example, Fig.11As shown, the training platform is a web server, and the initial neural network model, the training data provided by the second user, and the training strategy provided by the second user are stored on the web server. The web server can obtain the training data and training strategy provided by the first user through the client. The web server trains the initial neural network model based on the target training data and the target training strategy to obtain the target neural network model. All model fragments of the initial neural network model, the training data provided by the second user, and the training strategy provided by the second user are not visible to the first user. In order to simultaneously meet the confidentiality requirements of the training data provided by the first user and the training strategy provided by the first user, the web server as a training platform can be deployed only on the first user side.
[0092] As a possible implementation, the training platform includes a trusted execution environment of a processor, and at least part of the model fragments of the initial neural network model are trained in the trusted execution environment of the processor. In addition, the model fragments in the initial neural network model trained in the trusted execution environment of the processor may not be visible to the first user.
[0093] In an embodiment of the present application, in order to ensure the confidentiality requirements of the training data provided by the first user and the training strategy provided by the first user, the training platform can be deployed only on the first user side. In order to simultaneously ensure the confidentiality requirements of the second user for some model fragments of the initial neural network model, during the training of the initial neural network model, the model fragments that need to be kept confidential can only be run in the trusted execution environment of the processor. In some embodiments, the model fragments in the initial neural network model that need to be kept confidential can be encrypted to achieve the goal that the model fragments in the initial neural network model that are trained in the trusted execution environment of the processor are invisible to the first user.
[0094] As a possible implementation, when the target training data includes training data provided by the second user, the trusted execution environment of the processor is further used to obtain the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data may not be visible to the first user. And / or, when the target training policy includes a training policy provided by the second user, the trusted execution environment of the processor is further used to obtain the training policy provided by the second user included in the target training policy, and the training policy provided by the second user included in the target training policy may not be visible to the first user.
[0095] In an embodiment of the present application, the trusted execution environment of the processor can also be used to obtain training data and training strategies provided by the second user. In order to meet the confidentiality requirements of the training data and training strategies provided by the second user, the training data and training strategies provided by the second user are invisible to the first user.
[0096] As a possible implementation manner, the trusted execution environment of the processor includes a trusted execution environment of a GPU and / or a trusted execution environment of a CPU.
[0097] In an embodiment of the present application, the trusted execution environment of the processor may include only one of the trusted execution environment of the CPU and the trusted execution environment of the GPU, or may include both the trusted execution environment of the CPU and the trusted execution environment of the GPU.
[0098] For example, Fig.12 As shown, the trusted execution environment of the processor includes both the trusted execution environment of the CPU and the trusted execution environment of the GPU. The training speed of the neural network model in the GPU is higher than that in the CPU. In order to improve the training speed, all model fragments of the initial neural network model are trained in the trusted execution environment of the GPU. During the training process of the initial neural network model, scheduling and other actions are also required, and the scheduling and other actions in the training process are performed in the trusted execution environment of the CPU.
[0099] As a possible implementation, the training platform also includes a GPU, some model fragments of the initial neural network model are trained in the trusted execution environment of the CPU and / or in the trusted execution environment of the GPU, and some model fragments of the initial neural network model are trained in the GPU.
[0100] In an embodiment of the present application, the training platform includes a trusted execution environment of a processor and may also include a GPU, which may not include a trusted execution environment. Some model fragments in the initial neural network model that do not require high confidentiality can be trained in the GPU.
[0101] For example, Fig.13 As shown, in order to reduce the requirements for the training platform, the trusted execution environment of the processor in the training platform may only include the trusted execution environment of the CPU. The training speed of the neural network model in the GPU is higher than the training speed in the CPU. In order to increase the training speed, the training platform also includes a GPU, which does not include a trusted execution environment. The first and last fragments in the initial neural network model have high confidentiality requirements, so further training of the first and last fragments in the initial neural network model can be in the trusted execution environment of the CPU. For example, the first and last fragments in the initial neural network model can be the first and last layers of the hidden layer. The middle fragments in the initial neural network model do not have high confidentiality requirements, so further training of the first and last fragments in the initial neural network model can be performed in the GPU. Among them, the middle fragments of the initial neural network model are model fragments other than the first and last fragments in the initial neural network model.
[0102] refer to Fig.14 , is a schematic diagram of the structure of a neural network model training device provided in an embodiment of the present application. Fig.14 As shown, the device comprises:
[0103] The acquisition unit 1401 is configured to acquire training data provided by the first user and / or acquire a training strategy provided by the first user.
[0104] The training unit 1402 is used to train the initial neural network model based on target training data and a target training strategy to obtain a target neural network model; the target training data includes training data provided by the first user, and / or the target training strategy includes a training strategy provided by the first user;
[0105] The initial neural network model is trained based on initial training data and initial training strategy, and the initial training data and initial training strategy are provided by the second user.
[0106] As a possible implementation manner, the target training data is training data provided by the first user.
[0107] As a possible implementation manner, the target training data includes training data provided by the first user and training data provided by the second user.
[0108] As a possible implementation manner, the target training strategy is a training strategy provided by the first user.
[0109] As a possible implementation manner, the target training strategy includes the training strategy provided by the first user and the training strategy provided by the second user.
[0110] As a possible implementation manner, when the initial neural network model is trained based on the target training data and the target training strategy, at least some model fragments of the initial neural network model are invisible to the first user.
[0111] As a possible implementation, the training platform includes a cloud server or a web server, and the cloud server or the web server is used to store the initial neural network model.
[0112] As a possible implementation, when the platform for storing the initial neural network model and for the first user to further train the initial neural network model is a cloud server or a web server, all model fragments of the initial neural network model are not visible to the first user.
[0113] As a possible implementation, when the target training data includes training data provided by the second user, the cloud server or web server is further used to store the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data may not be visible to the first user. And / or, when the target training strategy includes the training strategy provided by the second user, the cloud server or web server is further used to store the training strategy provided by the second user included in the target training strategy, and the training strategy provided by the second user included in the target training strategy may not be visible to the first user.
[0114] As a possible implementation, the training platform includes a trusted execution environment of a processor, and at least part of the model fragments of the initial neural network model are trained in the trusted execution environment of the processor. In addition, the model fragments in the initial neural network model trained in the trusted execution environment of the processor may not be visible to the first user.
[0115] As a possible implementation, when the target training data includes training data provided by the second user, the trusted execution environment of the processor is further used to obtain the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data may not be visible to the first user. And / or, when the target training policy includes a training policy provided by the second user, the trusted execution environment of the processor is further used to obtain the training policy provided by the second user included in the target training policy, and the training policy provided by the second user included in the target training policy may not be visible to the first user.
[0116] As a possible implementation manner, the trusted execution environment of the processor includes a trusted execution environment of a GPU and / or a trusted execution environment of a CPU.
[0117] As a possible implementation method, the training platform also includes a GPU, and some model fragments of the initial neural network model are trained in the trusted execution environment of the CPU and / or in the trusted execution environment of the GPU, and some model fragments of the initial neural network model are trained in the GPU.
[0118] Corresponding to the above embodiments, the present application also provides an electronic device. Fig.15A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, the electronic device 1500 may include: a processor 1501, a memory 1502 and a communication unit 1503. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention, it can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0119] The communication unit 1503 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0120] The processor 1501 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 1502, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 1501 can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0121] The memory 1502 is used to store the execution instructions of the processor 1501. The memory 1502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0122] When the execution instructions in the memory 1502 are executed by the processor 1501, the electronic device 1500 can execute Figure 6 Some or all of the steps in the illustrated embodiments.
[0123] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the neural network model training method provided by the present invention. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0124] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0125] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A neural network model training method, characterized in that: Applied to a training platform, the method comprises: Acquiring training data provided by the first user and / or acquiring a training strategy provided by the first user; Based on target training data and a target training strategy, the initial neural network model is trained to obtain a target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user; The initial neural network model is trained based on initial training data and an initial training strategy, and the initial training data and the initial training strategy are provided by a second user.
2. The training method according to claim 1, characterized in that: The target training data is training data provided by the first user.
3. The training method according to claim 1, characterized in that: The target training data includes the training data provided by the first user and includes the training data provided by the second user.
4. The training method according to claim 1, characterized in that: The target training strategy is a training strategy provided by the first user.
5. The training method according to claim 1, characterized in that: The target training strategy includes the training strategy provided by the first user and includes the training strategy provided by the second user.
6. The training method according to claim 1, characterized in that: When the initial neural network model is trained based on the target training data and the target training strategy, at least some model fragments of the initial neural network model are invisible to the first user.
7. The training method according to claim 6, characterized in that: The training platform includes a cloud server or a web server, and the cloud server or the web server is used to store the initial neural network model, and all model fragments of the initial neural network model are invisible to the first user.
8. The training method according to claim 7, characterized in that: When the target training data includes training data provided by the second user, the cloud server or the web server is further used to store the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data is not visible to the first user; and / or, When the target training strategy includes the training strategy provided by the second user, the cloud server or the web server is also used to store the training strategy provided by the second user included in the target training strategy, and the training strategy provided by the second user included in the target training strategy is not visible to the first user.
9. The training method according to claim 6, characterized in that: The training platform includes a trusted execution environment of a processor, at least part of the model fragments of the initial neural network model are trained in the trusted execution environment of the processor, and the model fragments in the initial neural network model trained in the trusted execution environment of the processor are not visible to the first user.
10. The training method according to claim 9, characterized in that: When the target training data includes training data provided by the second user, the trusted execution environment of the processor is further used to obtain the training data provided by the second user included in the target training data, and the training data provided by the second user included in the target training data is not visible to the first user; and / or, When the target training policy includes the training policy provided by the second user, the trusted execution environment of the processor is also used to obtain the training policy provided by the second user included in the target training policy, and the training policy provided by the second user included in the target training policy is not visible to the first user.
11. The training method according to claim 9, characterized in that: The trusted execution environment of the processor includes a trusted execution environment of a GPU and / or a trusted execution environment of a CPU.
12. The training method according to claim 11, characterized in that: The training platform also includes a GPU, and some model fragments of the initial neural network model are trained in the trusted execution environment of the CPU and / or in the trusted execution environment of the GPU, and some model fragments of the initial neural network model are trained in the GPU.
13. A neural network model training device, characterized in that: include: An acquisition unit, configured to acquire training data provided by the first user and / or acquire a training strategy provided by the first user; A training unit, configured to train the initial neural network model based on target training data and a target training strategy to obtain a target neural network model; the target training data includes the training data provided by the first user, and / or the target training strategy includes the training strategy provided by the first user; The initial neural network model is trained based on initial training data and an initial training strategy, and the initial training data and the initial training strategy are provided by a second user.
14. An electronic device, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 12.