A model determination method and related apparatus

By integrating the grafting module into the backbone module in transfer learning and adjusting the grafting module parameters, the privacy leakage problem in transfer learning is solved, and efficient target domain model determination and data security are achieved.

CN115115060BActive Publication Date: 2026-05-22TENCENT TECH WUHAN
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECH WUHAN
Filing Date
2022-05-30
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

In transfer learning, the alignment loss function between the source and target domains leads to privacy risks, especially when there is insufficient data or labels in the target domain. The source domain model may leak information about the input data of the target domain.

Method used

The grafting module is integrated into the backbone module to form the migration backbone module. The parameters of the backbone module remain unchanged, and the parameters of the grafting module are adjusted until the initial target domain model converges, thereby determining the target domain model and avoiding the source domain fitting the input data based on the target domain output.

Benefits of technology

It reduces the difficulty of data acquisition during the training of target domain models, improves the performance and parameter efficiency of transfer learning, and achieves output isolation between the target domain and the source domain, preventing cross-domain data leakage and improving data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115115060B_ABST
    Figure CN115115060B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of model determination method and related device, it can be applied to cloud technology, artificial intelligence, wisdom transportation, various scenes such as auxiliary driving, according to the data of source domain, source domain model is trained to obtain, source domain model includes the main module of source domain and target domain general, according to main module determination grafting module, to fuse grafting module into main module, obtain the migration main module of initial target domain model, by the way of transfer learning to the source domain model that has been trained, obtain initial target domain model.In the process of training initial target domain model, keep the parameter of main module in migration main module unchanged, adjust the parameter of grafting module, until initial target domain model converges, obtain target domain model.Therefore, grafting module is target domain independent private, source domain model cannot be fitted according to the output result obtained from target domain Input data, so that cross-domain data is not leaked, improve the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for determining a model. Background Technology

[0002] With the development of internet technology, although there is more and more data on online information platforms, there are still insufficient data or tags in some fields.

[0003] In related technologies, transfer learning is employed, which is a learning process that utilizes the similarity between data, tasks, or models to apply a model learned in the source domain to the target domain. This solves the problem of insufficient data or labels in the target domain by using the model from the source domain.

[0004] During model training, the source and target domains each have their own models and outputs. However, in transfer learning, the source and target domains have an alignment loss function. The source domain can fit the input data based on the output obtained from the target domain and the alignment loss function, which can lead to the leakage of target domain information corresponding to the input data, resulting in privacy risks. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method and related apparatus for determining a model, which improves data security.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a method for determining a model, the method comprising:

[0008] Obtain the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source and target domains;

[0009] The grafting module is integrated into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a module determined based on the backbone module;

[0010] During the training of the initial target domain model, the parameters of the backbone module in the transfer backbone module are kept unchanged, while the parameters of the grafting module are adjusted until the initial target domain model meets the convergence condition, thus obtaining a target domain model applied to the target domain.

[0011] On the other hand, embodiments of this application provide a model determination device, the device comprising: an acquisition unit, a fusion unit, and a training unit;

[0012] The acquisition unit is used to acquire the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source domain and the target domain;

[0013] The fusion unit is used to fuse the grafting module into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a module determined according to the backbone module;

[0014] The training unit is used to keep the parameters of the backbone module in the transfer backbone module unchanged and adjust the parameters of the grafting module during the training of the initial target domain model, until the initial target domain model meets the convergence condition, thereby obtaining a target domain model applied to the target domain.

[0015] On the other hand, embodiments of this application provide a computer device, the device including a processor and a memory:

[0016] The memory is used to store program code and transmit the program code to the processor;

[0017] The processor is configured to execute the methods described above according to instructions in the program code.

[0018] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described above.

[0019] On the other hand, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods described above.

[0020] As can be seen from the above technical solution, a source domain model is trained based on data from the source domain. This source domain model includes a backbone module common to both the source and target domains. Therefore, the backbone module from the source domain model is transferred to the initial target domain model. A grafting module is determined based on the backbone module, and this grafting module is then integrated into the backbone module to obtain the transfer backbone module of the initial target domain model. The initial target domain model is then obtained through transfer learning on the already trained source domain model. This process eliminates the need for a large amount of training data, reducing the difficulty of data acquisition during target domain model training and improving the efficiency of target domain model determination. Furthermore, during the training of the initial target domain model, the parameters of the backbone module in the transfer backbone module remain unchanged, while the parameters of the grafting module are adjusted until the initial target domain model converges, thus obtaining the target domain model. Therefore, the target domain model not only includes the knowledge of task processing in the source domain model, but also the knowledge of the target domain model itself used to process tasks, which improves the performance and parameter efficiency of transfer learning. Moreover, the grafting module is independent and private to the target domain, and the source domain model cannot fit the input data based on the output results obtained from the target domain, thus achieving output isolation between the target domain and the source domain, preventing cross-domain data from being leaked and improving data security. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a type of federated transfer learning process.

[0023] Figure 2 This is a schematic diagram of the structure of a model determination system provided in an embodiment of this application;

[0024] Figure 3 A flowchart illustrating a method for determining a model provided in an embodiment of this application;

[0025] Figure 4 A schematic diagram of a source domain model and a target domain model provided in an embodiment of this application;

[0026] Figure 5 A schematic diagram of a forward training method provided in an embodiment of this application;

[0027] Figure 6 A schematic diagram illustrating a backward training method provided in an embodiment of this application;

[0028] Figure 7A schematic diagram of a model determining device provided in an embodiment of this application;

[0029] Figure 8 This is a schematic diagram of the server structure provided in an embodiment of this application;

[0030] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] While transfer learning can address the issue of insufficient data or labels in the target domain by using a model from the source domain, it carries the risk of privacy breaches. The following section will discuss this further. Figure 1 This will be illustrated using federated transfer learning as an example.

[0033] See Figure 1 This diagram illustrates a process of federated transfer learning. Source domain model Net src and target domain model Net dst Take the input separately and input The eigenvalues ​​are mapped to a general feature space, as shown in the following equation:

[0034]

[0035]

[0036] Through the source domain model Net src Get input Predicted value Predicted values And the corresponding actual results (i.e., labels). Encrypt the input using an encryption algorithm. Predicted value It is also encrypted using encryption algorithms, and transfer learning is performed through functions. True value The model required to obtain the target domain is trained using the prediction loss function. Federated transfer learning makes a crucial assumption: the function... It is linearly separable, that is... This assumption puts the function Separating the data into two separately computeable parts greatly simplifies the training and inference process. Although the output of the target domain model is encrypted using an encryption algorithm in transfer learning, the alignment loss function between the source and target domain models allows the source domain to fit the input data based on the output obtained from the target domain and the alignment loss function. This can lead to the leakage of target domain information corresponding to the input data, resulting in privacy risks.

[0037] Based on this, embodiments of this application provide a method and related apparatus for determining a model. During the transfer learning process, a grafting module is fused into the backbone module to obtain a transfer backbone module, thereby obtaining the target domain model. The grafting module is independent and private to the target domain, and the source domain model cannot fit the input data based on the output results obtained from the target domain. This achieves output isolation between the target domain and the source domain, preventing cross-domain data leakage and improving data security.

[0038] The model determination method provided in this application is based on artificial intelligence. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, artificial intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. Artificial intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0039] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.

[0040] In the embodiments of this application, the main artificial intelligence technologies involved include the aforementioned machine learning / deep learning directions. Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0041] In the model determination method provided in the embodiments of this application, the artificial intelligence model used mainly involves the application of machine learning, and uses transfer learning to determine the target domain model through the source domain model.

[0042] Figure 2 This illustration shows a schematic diagram of a model determination system provided in an exemplary embodiment of this application. The system includes a server and at least one terminal, with the terminal and server transmitting data via a network. The terminal refers to a user-facing terminal, specifically a terminal used by a user to perform machine learning model acquisition operations and process tasks using the machine learning model. The terminal device can be a mobile phone, computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these. The server can be a standalone server, a server cluster consisting of several servers, or a cloud computing center. The server can be used to provide users with various machine learning models; that is, the server can refer to the device used by a machine learning model provider to build models. Here, the machine learning model provider can refer to a user providing machine learning models, such as a cloud service provider. This invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0043] Figure 2The model determination scheme of the system shown includes: 1. Obtaining the backbone module of the source domain model; this source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source and target domains; 2. Integrating the grafting module into the backbone module to obtain the transfer backbone module of the initial target domain model; this grafting module is a module determined based on the backbone module; 3. During the training of the initial target domain model, keeping the parameters of the backbone module in the transfer backbone module unchanged, adjusting the parameters of the grafting module until the initial target domain model converges, thus obtaining the target domain model applied to the target domain. Therefore, a source domain model is obtained by training based on source domain data. The source domain model includes a backbone module common to both the source and target domains, so the backbone module in the source domain model is transferred to the initial target domain model. The grafting module is determined based on the backbone module, and then integrated into the backbone module to obtain the transfer backbone module of the initial target domain model. The initial target domain model is obtained by performing transfer learning on the already trained source domain model. This process eliminates the need for large amounts of training data, reducing the difficulty of data acquisition during target domain model training and improving the efficiency of target domain model determination. Furthermore, during the initial target domain model training, the parameters of the backbone module in the transfer learning module remain unchanged, while the parameters of the grafting module are adjusted until the initial target domain model converges, resulting in the target domain model. Therefore, the target domain model includes not only the task-processing knowledge from the source domain model but also the target domain model's own knowledge used for task processing, improving the performance and parameter efficiency of transfer learning. Moreover, the grafting module is independent and private to the target domain, preventing the source domain model from fitting input data based on the output obtained from the target domain, thus achieving output isolation between the target and source domains, preventing cross-domain data leakage, and improving data security.

[0044] It should be noted that the model determination method provided in this application embodiment can be executed by the server alone. However, in other embodiments of this application, the terminal device may also have similar functions to the server, thereby executing the model determination method provided in this application embodiment alone, or the terminal device and the server may jointly execute the model determination method provided in this application embodiment. This embodiment does not limit this.

[0045] The following description, with reference to the accompanying drawings and taking the aforementioned device as a server, illustrates a method for determining a model provided in this application.

[0046] See Figure 3 This figure is a flowchart illustrating a method for determining a model according to an embodiment of this application. Figure 3 As shown, the method for determining this model includes S301-S303.

[0047] S301: Obtain the backbone module of the source domain model.

[0048] A model is typically composed of multiple interconnected modules, each with a different function. For example, a model for recognizing cats might include a feature extraction module and a recognition module. Taking a neural network as an example, the feature extraction module might include an input layer and at least one intermediate layer, while the recognition module might include an output layer. The feature extraction module extracts feature information from the input data (such as an image containing a cat) to be recognized (e.g., identifying features of the object in the image, such as eyes or legs). The recognition module outputs the recognition result based on the feature information (e.g., determining whether these features belong to a cat and providing the recognition result). Once an initial model is built, the function of each module is relatively fixed, but the performance of each module in handling the task is optimizable. That is, the parameters of each module in the initial model are optimizable, thus obtaining the model. In other words, compared to the initial model, the model's parameters have already been trained (optimized), whereas the parameters of the initial target domain model are not yet fully trained.

[0049] Because the processing logic for different tasks is completely different or partially different, the functionalities of the modules in the model for different tasks may be completely different or partially different. Therefore, different models are suitable for handling different tasks. Here, "task" refers to the task to be processed, such as data analysis and processing, or recognizing text, images, or sounds.

[0050] This application includes a source domain and a target domain, which are different but related domains. Although the source domain model (the model corresponding to the task in the source domain) and the target domain model (the model corresponding to the task in the target domain) have different task processing logics—for example, if the source domain data is images of cats, the corresponding source domain model can identify cats; if the target domain data is images of dogs, the corresponding target domain model can identify dogs—the source and target domain models share common modules due to their correlation (or similarity in tasks). Continuing with the previous example, since cat eyes and dog eyes are similar, the intermediate layer in the source domain model used to identify cat features (such as eyes and legs) is similar to the intermediate layer in the target domain model used to identify dog ​​features (such as eyes and legs). In other words, the feature extraction model in the source domain model is similar to the feature extraction module in the target domain model.

[0051] In this embodiment, the modules common to both the source domain model and the target domain model are referred to as backbone modules, such as the aforementioned feature extraction module. Through transfer learning, backbone modules in the source domain model can be transferred to the target domain model. The source domain model is a model trained based on source domain data, which is an optimized model. That is, the performance of the source domain model in processing tasks has been optimized to a convergent state, meaning that the performance of the source domain model in processing tasks is good. Transferring backbone modules to the target domain model can not only reduce the amount of training data for the target domain model, but also improve the training efficiency of the model.

[0052] In one possible implementation, the server's model library stores models for multiple domains. When a user has a transfer learning requirement for a target domain, they can filter from the model library a list of models from other domains that can be used to determine the target domain model based on the task requirements of the target domain. The user then selects a source domain model associated with the target domain model from the list.

[0053] S302: Integrate the grafting module into the backbone module to obtain the migration backbone module of the initial target domain model.

[0054] In related technologies, the existence of an alignment loss function between the source domain model and the target domain model allows the source domain to fit the input data based on the output obtained from the target domain and the alignment loss function. For example, in object profiling model transfer learning, after transfer learning, the object profiling feature vector output by the source domain model implicitly contains the user's behavior, consumption, and tag attributes in the target domain. This means the source domain can deduce the user's target domain information from the object feature vector, potentially leading to the leakage of the target domain information corresponding to the input data and posing a privacy risk.

[0055] Based on this, embodiments of this application set up grafting modules according to the backbone modules, so as to integrate the grafting modules into the backbone modules, thereby obtaining the transferred backbone model of the initial target domain model. Thus, the target domain model contains grafting modules that cannot be derived from the source domain, thereby avoiding the derivation of target domain input data from the source domain.

[0056] In one possible implementation, the grafting module can be determined based on the structural characteristics of the source domain model and the task of the target domain. For example, the grafting module may include several intermediate layers and several residual connection layers. This application does not specifically limit the fusion method between the grafting module and the backbone module; for example, the grafting module may be inserted into the middle of the backbone module or connected to the tail of the backbone module.

[0057] By integrating the grafting module into the backbone module, a transfer backbone module is obtained, which serves as part of the initial target domain model. It should be noted that, compared to the initial target domain model, the target domain model is a model whose parameters have already been optimized. The backbone module is a general module that carries the parameters of the already trained source domain model; that is, the functionality implemented by the backbone module can also be implemented in the target domain. Compared to retraining to obtain these parameters using target domain data, this embodiment of the application uses transfer learning, which eliminates the need for a large amount of training data, reducing the difficulty of data acquisition during the target domain model training process and improving the efficiency of determining the target domain model.

[0058] S303: During the training of the initial target domain model, keep the parameters of the backbone module in the transfer backbone module unchanged, and adjust the parameters of the grafting module until the initial target domain model meets the convergence condition, thus obtaining the target domain model applied to the target domain.

[0059] During the training of the initial target domain model, the parameters of the backbone module in the transfer learning module remain unchanged, maintaining the functionality that the backbone module can achieve after training. The parameters of the grafting module are adjusted to make the transfer backbone module more suitable for the target domain task. The parameters of the grafting module are continuously adjusted during training until the initial target domain model meets the convergence condition, i.e., the target domain model converges, and the training of the initial target domain model ends, yielding the target domain model. Therefore, the target domain model not only includes the knowledge of task processing from the source domain model because it includes the backbone module (to achieve the functionality required by both the source and target domains), but also includes the parameter-tuned grafting module, allowing the transfer backbone module to include the target domain model's own knowledge used for task processing, thus improving the performance and parameter efficiency of transfer learning. Furthermore, the grafting module is independent and private to the target domain; the source domain model cannot fit the input data based on the output obtained from the target domain, ensuring the isolation of feature outputs between the target and source domains, preventing cross-domain data leakage, and improving data security.

[0060] In one possible implementation, the convergence condition corresponding to the initial target domain model can be that the gradient value of the grafting module is less than the convergence threshold of the target domain model, or it can be that the number of iterations exceeds the number threshold of the target domain model, etc. This application embodiment does not specifically limit this.

[0061] As described in the above technical solution, a source domain model is trained based on data from the source domain. This source domain model includes core modules common to both the source and target domains. Therefore, these core modules are transferred to the initial target domain model. Grafting modules are determined based on these core modules and then integrated into the core modules to obtain the transfer core modules of the initial target domain model. The initial target domain model is then obtained through transfer learning on the already trained source domain model. This process eliminates the need for large amounts of training data, reducing the difficulty of data acquisition during target domain model training and improving the efficiency of target domain model determination. Furthermore, during the training of the initial target domain model, the parameters of the core modules in the transfer core modules remain unchanged, while the parameters of the grafting modules are adjusted until the initial target domain model converges, thus obtaining the target domain model. Therefore, the target domain model not only includes the knowledge of task processing in the source domain model, but also the knowledge of the target domain model itself used to process tasks, which improves the performance and parameter efficiency of transfer learning. Moreover, the grafting module is independent and private to the target domain, and the source domain model cannot fit the input data based on the output results obtained from the target domain, thus achieving output isolation between the target domain and the source domain, preventing cross-domain data from being leaked and improving data security.

[0062] In one embodiment, to make the target domain model more applicable to the target domain, the initial target domain model also includes a target domain task module. That is, the initial target domain model includes a migration backbone module and a target domain task module. The following section will discuss this in conjunction with... Figure 4 Please provide a detailed explanation.

[0063] See Figure 4 The figure is a schematic diagram of a source domain model and a target domain model provided in an embodiment of this application. The source domain model and the target domain model will be described below.

[0064] (1) Source domain model.

[0065] exist Figure 4 In this model, the source domain model consists of a backbone module and a source domain task module. The backbone module implements functions required by both the source and target domains, while the source domain task module is strongly correlated with the tasks in the source domain. For example, in the aforementioned source domain model for cat identification, the backbone module is used for feature extraction, and the source domain task module is used for cat identification.

[0066] Training method for the source domain model: The source domain data X... A The input is fed into the initial source domain model, and the prediction results are obtained through the backbone module and the source domain task module. Based on the actual results y A Compared with the prediction results Adjusting the parameters W of the main module to account for differences A The parameters of the source domain task module are adjusted, i.e., the parameters of the initial source domain model are adjusted until the initial source domain model converges, thus obtaining the source domain model.

[0067] (2) Target domain model.

[0068] exist Figure 4 In this model, the target domain model includes a transfer backbone module and a target domain task module. The transfer backbone module comprises a backbone module and a grafting module. The backbone module is transferred from the source domain model, while the grafting module is designed based on the backbone module. The transfer backbone module is obtained by merging the grafting module into the backbone module. The grafting module further adapts the transfer backbone module to the target domain. The target domain task module is strongly correlated with the target domain task. As mentioned earlier in the target domain model for dog recognition, the transfer backbone module is used to extract features from the dog, and the target domain task module is used to recognize the dog.

[0069] The training of the target domain model is explained below, see S11-S14:

[0070] S11: Determine the intersection data between the source domain data and the target domain data.

[0071] The source and target domains are related, thus their data intersects. This intersection is the set of data corresponding to the objects involved in both domains. For example, the source domain might be supermarkets in region A, and the target domain might be banks in region A. Both reach residents of region A (same sample), but their businesses (different tasks) differ. The intersection of the source and target domain data consists of the data corresponding to the users involved in both the supermarket and bank data in region A.

[0072] S12: Based on the source domain data included in the intersection data, the migration feature vector is obtained through the migration backbone module.

[0073] Continuing with the example above, the users involved in both the supermarket data and the bank data in region A are the intersection users involved in both the source domain data and the target domain data. The supermarket data corresponding to the intersection users is the source domain data included in the intersection data, and the bank data corresponding to the intersection users is the target domain data.

[0074] Compared to the backbone module trained on source domain data, the transfer backbone module also includes a grafting module. To adjust the parameters of the grafting module and make the adjusted transfer backbone module more suitable for the target domain, a transfer feature vector is obtained based on the source domain data included in the intersection data and the transfer backbone model. For example, the source domain data included in the intersection data can be used as input data and fed into the transfer backbone module. Through the calculation of the transfer backbone module, the transfer feature vector is output.

[0075] S13: Input the target domain data, including the transfer feature vector and the intersection data, into the target domain task module to obtain the prediction result.

[0076] Continuing with the example above, Zhang San is the intersection user. In the i-th training iteration, Zhang San's source domain data in the source domain will be... The input is fed into the transfer backbone model to obtain the transfer feature vector. Zhang San's target domain data in the target domain The target domain data, which is included in the intersection data, will transfer the feature vector. The intersection data includes the target domain data. The input is fed into the target domain task module to obtain the prediction result.

[0077] S14: Adjust the parameters of the grafting module based on the difference between the predicted results and the actual results.

[0078] Continuing with the example above, the label corresponding to Zhang San is: That is, the actual result, based on the prediction result. and the actual results Adjusting the parameters P of the grafting module to address differences B Through continuous training and adjustment of the grafting module parameters, the initial target domain model converges, completing the training process.

[0079] It should be noted that, during the adjustment of the grafting module's parameters, if the target domain model includes a target domain task module, the parameters of the target domain task module also need to be adjusted before determining the parameter gradient vector of the grafting module based on the propagation error of the transfer feature vector. See S21-S24 for details:

[0080] S21: Based on the difference between the predicted results and the actual results, determine the propagation error of the parameter gradient vector and the transfer feature vector of the target domain task module.

[0081] It should be noted that the following examples all use the i-th training iteration. For ease of explanation, the formula symbols will be simplified in the following sections, such as the transfer feature vector. Simplified to This is represented. Continuing with the previous example, in the i-th training iteration, based on the prediction results... and the actual results The difference calculation yields the parameter T of the target domain task module. B The corresponding parameter gradient vector Transfer feature vector η AB propagation error e AB .

[0082] S22: Determine the parameter gradient vector of the grafting module based on the propagation error of the migration feature vector.

[0083] Based on the propagation error e of the migration feature vector ABDetermine the gradient vector of the grafting module parameters

[0084] S23: If the initial target domain model does not meet the convergence condition, adjust the parameters of the grafting module according to the gradient vector of the grafting module.

[0085] If the initial target domain model does not converge, for example, The parameters of the grafting module are then adjusted based on the gradient vector of the grafting module's parameters, as shown in the following formula:

[0086]

[0087] Where ∈ represents the model convergence threshold, which can be set by those skilled in the art according to actual needs, and t represents the gradient update step size. For the parameter P of the grafting module B The corresponding parameter gradient vector.

[0088] S24: Adjust the parameters of the target domain task module according to the parameter gradient vector of the target domain task module.

[0089] The parameters of the target domain task module are adjusted based on the gradient vector of the target domain task module, as shown in the following formula:

[0090]

[0091] Where t is the gradient update step size, which can be the same as or different from the gradient update step size of the parameters of the aforementioned target domain task module, and can be set according to the needs of those skilled in the art. For the target domain task module parameter T B The corresponding parameter gradient vector.

[0092] S25: If the initial target domain model satisfies the convergence condition, the training ends and the target domain model is obtained.

[0093] To further enhance data security, the parameters of each model in the source and target domains can be encrypted before joint training. Specifically, the parameters of the backbone module belong to the source domain, while the parameters of the grafting module belong to the target domain. If both the source and target domains encrypt their respective model parameters, only when both the source and target domains jointly participate in the training of the initial target domain model can the correct transfer feature vector η be output. AB This ensures that the data in the target domain cannot be compromised by the source domain. Furthermore, to further enhance data security, the parameters of both the source and target domain models must not be leaked during the joint training process, nor should the input data and intermediate layer results be disclosed. This will be explained in detail below.

[0094] In this embodiment, the parameters of the backbone module and the source domain task module are trained by the source domain within its domain using a conventional gradient backpropagation method. Given a transfer feature vector η... AB Subsequently, the forward and backward propagation training of the target domain task module can also be completed independently by the target domain within its domain, as detailed in the aforementioned training method. The training process of the grafting module within the migration backbone module is primarily involved in cross-domain secure computation; its forward and backward training will be explained below.

[0095] It should be noted that the target domain model can be trained on the server where the target domain is located, or it can be trained on a third-party server. A third-party server is a server that is not the source domain or the target domain, such as a cloud server.

[0096] (1) Forward training, see S31-S32 for details:

[0097] S31: Input the encrypted source domain data into the migration backbone module, and obtain the encrypted migration feature vector through the migration backbone module.

[0098] To prevent the target domain from accessing the source domain's data, before training the migration backbone module using the source domain data included in the intersection data, the source domain can encrypt the source domain data included in the intersection data to obtain encrypted source domain data, which is then sent to the server where the target domain is located. This encrypted source domain data is then input into the migration backbone module, thereby obtaining the encrypted migration feature vector through the migration backbone module.

[0099] It should be noted that since the structure of the backbone model and the grafting module contains information shared by both the source and target domains (e.g., both the source and target domains know the number of intermediate layers in the backbone module), to prevent the source domain from deriving the target domain's data from the backbone module's parameters, the backbone module's parameters are kept private to the source domain, and the grafting module's parameters are kept private to the target domain. Therefore, to prevent the leakage of module parameters during joint training, the source domain can encrypt the backbone module's parameters and send them to the target domain's server for joint training. Similarly, the target domain can encrypt the grafting module's parameters and send them to the source domain's server for computation.

[0100] S32: Decrypt the encrypted migration feature using the decryption key based on the migration feature vector to obtain the migration feature vector.

[0101] The decryption key for the migration feature vector is generated by the source domain based on the intersection data, including the source domain data, the parameters of the backbone module, and the decryption parameters of the grafting module. The decryption parameters of the grafting module are generated by the target domain. The target domain encrypts the parameters of the grafting module and obtains the encrypted parameters of the grafting module, and at the same time, it also obtains the decryption parameters of the grafting module, so as to decrypt according to the decryption parameters of the grafting module.

[0102] One possible implementation is to encrypt the parameters of the grafting module using a first quantization method, that is, by converting the floating-point type parameters of the grafting module into integer type. This can improve the calculation speed in subsequent calculations.

[0103] As one possible implementation, the first quantization method is to encrypt the grafting module's parameter to 1 if the parameter is greater than zero; encrypt the grafting module's parameter to 0 if the parameter is equal to zero; and encrypt the grafting module's parameter to -1 if the parameter is less than zero, as shown in the following formula:

[0104]

[0105] Therefore, the parameters of the grafting module are quantized into ternary values ​​of one of {-1, 0, 1} to perform matrix multiplication calculations based on the secret sharing protocol, thereby improving the computation speed.

[0106] For ease of explanation, the following will be combined with... Figure 5 This will be illustrated using the example of federated transfer learning using the QUOTIENT protocol (a secure communication protocol) for forward training.

[0107] In related technologies, the alignment loss function and target domain output used in cross-domain computation of federated transfer learning Both are linearly separable, and the backbone module and the target domain task module can be computed independently. Therefore, the prediction and training process of the target domain model can be easily decomposed into intermediate results computed separately in the source domain and the target domain. This allows data from the other domain to be derived through independent computation of one domain, resulting in poor data security.

[0108] In this embodiment, the migration backbone module includes a backbone module and a grafting module. The parameters of the backbone module are private to the source domain, while the parameters of the grafting module are private to the target domain. Model training can only be performed by combining the source and target domains, thus ensuring the security of the data from both sides. Joint training of the source and target domains is implemented using the QUOTIENT protocol. The QUOTIENT protocol is a two-party secure computation protocol that provides a secure training and prediction protocol for discretized deep neural networks under two server participants. Compared with other secure learning methods for deep neural networks, QUOTIENT has the following advantages:

[0109] It provides an automatically adaptable and feasible fixed-point neural network training method. Due to the limitations of existing encryption methods, secure computation protocols, including homomorphic encryption (HE) and multi-party computation (MPC), can only perform integer calculations. Therefore, secure training protocols for neural network models can only be performed under fixed-point conditions. Replacing floating-point calculations with fixed-point calculations negatively impacts both training convergence speed and prediction accuracy. Most secure training protocols lack clear guidelines on how to discretize floating-point numbers, which can create insurmountable performance barriers in practical applications (excessive discretization precision leads to excessively long training times, while insufficient precision may result in non-convergence). The QUOTIENT protocol not only solves these problems but also caters to application scenarios designed for two server participants, consistent with federated transfer learning.

[0110] See Figure 5 This figure is a schematic diagram of forward training provided in an embodiment of this application. The transfer backbone module uses the QUOTIENT-Forward protocol during the forward training process, which will be described in detail below.

[0111] The source domain-private parameter is the source domain data x included in the intersection data. A And the parameter W of the main module A The target domain's private parameter is the grafting module's parameter P. B The source domain quantizes x using the aforementioned first quantization method. A and W A Encryption is performed to obtain encrypted source domain data quantized as {-1,0,1} and encrypted backbone module parameters corresponding to the backbone module.

[0112] Without passing private data and parameters to the source and target domains, calculate the migration feature vector η of the migration backbone module. AB Specifically, the target domain generates random vectors locally. <P B >1(and P) B (Same dimensions), and calculate <P B >2=P B - <P B >1, that is, to put P B Split into two secret components <P B >1 and <P B >2. These two secret components are meaningless random numbers when observed individually, but when they are summed, they can be restored to the parameter P of the grafting module. B Similarly, the source domain locally stores x A and W ADivided into secret components <x A >1. <x A >2 and <W A >1. <W A >2. Then, the source domain will use one of the secret components. <x A >2. <W A >2 is sent to the target domain, and the target domain will... <P B >2 is sent to the source domain. At this point, the source domain is known. <x A >1. <W A >1 and <P B >2, Target domain is known <x A >2. <W A >2 and <P B >1. Target domain generates transfer feature vector η AB The secret component <η AB >1, through the QUOTIENT-Forward protocol, η is calculated from the source domain. AB Another secret component <η AB 2. Finally, the source domain accurately represents <η AB >2. The source domain sends the decryption key for the transfer feature vector to the target domain, allowing the target domain to recover the true transfer feature vector η. AB =<η AB >1+<η AB >2.

[0113] (2) Backward training, see S41-S45 for details:

[0114] S41: Encrypt the migration feature vector, the propagation error of the migration feature, and the parameters of the grafting module respectively to obtain the encrypted migration feature vector, the encrypted propagation error, and the encrypted grafting module parameters.

[0115] During backpropagation gradient training, the source and target domains need to encrypt their respective private parameters for joint training. For the target domain, the transfer feature vector is encrypted to obtain the encrypted transfer feature vector, the propagation error of the transfer feature vector is encrypted to obtain the encrypted propagation error, and the parameters of the grafting module are encrypted to obtain the encrypted grafting module parameters. For the source domain, the intersection data (including source domain data) is encrypted to obtain the encrypted source domain data, and the parameters of the backbone module are encrypted to obtain the encrypted backbone module parameters.

[0116] S42: Obtain encrypted source domain data and encrypted backbone module parameters of the backbone module.

[0117] Since the encrypted source domain data and encrypted backbone module parameters are private to the source domain, the target domain needs to obtain the encrypted source domain data and encrypted backbone module parameters during the training of the initial target domain model.

[0118] S43: Generate the second parameter gradient vector of the grafting module based on the encrypted migration feature vector, encrypted propagation error, encrypted grafting module parameters, encrypted source domain data, and encrypted backbone module parameters.

[0119] S44: Obtain the gradient vector of the first parameter.

[0120] The first parameter gradient vector is generated from the source domain based on the encryption migration feature vector, encryption propagation error, encryption grafting module parameters, encryption source domain data, and encryption backbone module parameters.

[0121] S45: Determine the parameter gradient vector of the grafting module based on the first parameter gradient vector and the second parameter gradient vector.

[0122] As one possible implementation, the parameters of the grafting module are encrypted using a first quantization method, and the transfer feature vector and its propagation error are encrypted using a second quantization method. The second quantization method can be the same as or different from the first quantization method. The first quantization method can be as described above and will not be repeated here.

[0123] As one possible implementation, the second quantization method differs from the first quantization method, and the quantization range of the second quantization method is larger than that of the first quantization method, as shown in the following formula:

[0124] Assuming the original precision of the floating-point value is p, the quantization precision is q, and the quantization function of the hidden layer output value v is...

[0125] Q(v (p) ,q)=S(N(v (p) ,q))

[0126] Where N(·) is the quantization function, which converts the numerical value to 2. q Scope of expression:

[0127]

[0128] S(·) is a saturation function, ensuring that the value does not exceed the valid range:

[0129] S(v) = max(min(v, 1-2) -q ),-1+2 -q )

[0130] Therefore, by using a second quantization method with a larger quantization range than the first quantization method, the propagation error of the encrypted source domain data, the transfer feature vector, and the transfer feature vector is no longer just a ternary number, but an integer with more digits. This allows for more refined input values ​​and activation layer output values ​​of the encryption model, resulting in higher model accuracy.

[0131] For ease of explanation, the following will be combined with... Figure 6 We will continue to use the example of backward training of federated transfer learning through the QUOTIENT protocol to illustrate this further.

[0132] See Figure 6 This figure is a schematic diagram of backward training provided in an embodiment of this application. The transfer backbone module uses the QUOTIENT backward gradient update protocol during backward training, which will be described in detail below.

[0133] The backward gradient update protocol of the migration backbone module uses stochastic gradient descent to update the grafting module parameters P in the target domain. B The source domain-private parameter is the source domain data x included in the intersection data. A And the parameter W of the main module A The target domain's private parameter is the grafting module's parameter P. B , transfer feature vector η AB and its corresponding backpropagation error e AB (Backpropagation algorithm is used here). The source domain is quantized by the aforementioned first quantization method for W. A Encryption is performed to obtain the encrypted backbone module parameters, which are quantized to {-1, 0, 1} and corresponding to the backbone module. Then, x is quantized using a second quantization method. A Encryption is performed to obtain encrypted source domain data. The target domain is then quantized using the first quantization method to obtain P. B Encryption is performed using a second quantization method for η. AB and e AB Encrypt it.

[0134] First, the source domain and the target domain each generate secret components of the relevant input parameters, and then share and send one of these secret components to each other. At this point, the source domain is known. <x A >1. <W A >1. <P B >2、<η AB >2 and <e AB 2. The target domain is known. <x A >2. <W A >2. <P B >1、<η AB >1 and <e AB >1. Through the QUOTIENT-Backward protocol, the source domain and the target domain respectively obtain P B gradient components and The source domain truthfully Send to the target domain, the target domain passes Recover the true parameter gradient vector.

[0135] Therefore, the model provided in this application can provide a technical foundation for applications such as cold start recommendations and cross-application (APP) object profiling. All operations involving the migration backbone module are performed through the QUOTIENT protocol to ensure that neither the source domain nor the target domain can discover any confidential information of the other while completing the computation. Federated transfer learning helps the target domain obtain the data capabilities of the source domain in an encrypted manner, making up for the deficiencies of the target domain's own internal data and improving the universality and accuracy of the target domain model.

[0136] As one possible implementation, based on the forward inference protocol and backward gradient update protocol of the aforementioned transfer backbone model, the training process of the target domain model is as follows:

[0137] S51: The source domain reads the parameters W of the backbone model included in the source domain model. A The target domain randomly initializes the parameters P of the grafting module. B And the parameter T of the target domain task module B .

[0138] S52: The source domain and the target domain respectively quantize the source domain input x using the first quantization method and the second quantization method. A The backbone model parameter W A And the target domain grafting module parameter P B Encrypt it.

[0139] S53: Both the source and target domains follow a forward inference protocol, enabling the target domain to obtain x. A The transfer feature vector η AB .

[0140] S54: Target domain based on η AB x B and the parameter T of the target domain task module B Calculate the target domain task inference value

[0141] S55: Target domain according to and label value y B Error calculation T between B The parameter gradient vector η AB propagation error e AB .

[0142] S56: The target domain is quantized using a second quantization method for e. AB and η AB Encrypt it.

[0143] S57: According to the backward gradient update protocol, the target domain obtains the parameter gradient vector of the grafting module.

[0144] S58: If the initial target domain model has not yet converged, i.e. target domain according to Update the parameters of the grafting module. Otherwise, the target domain sends a training termination signal to the source domain, saves the current model parameters, and exits the training process.

[0145] Therefore, by adding a grafting module to the backbone module, the performance and parameter efficiency of transfer learning can be improved. Furthermore, when the grafting module is independent and private to the target domain, the feature outputs of the target and source domains are isolated, thus ensuring that information between users across domains is not leaked.

[0146] In addition to providing a method for determining a model, this application also provides a device for determining a model. See [link to relevant documentation]. Figure 7 The model determination device 700 includes: an acquisition unit 701, a fusion unit 702, and a training unit 703;

[0147] The acquisition unit 701 is used to acquire the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source domain and the target domain;

[0148] The fusion unit 702 is used to fuse the grafting module into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a module determined according to the backbone module;

[0149] The training unit 703 is used to keep the parameters of the backbone module in the transfer backbone module unchanged and adjust the parameters of the grafting module during the training of the initial target domain model until the initial target domain model meets the convergence condition, thereby obtaining a target domain model applied to the target domain.

[0150] As one possible implementation, the initial target domain model further includes a target domain task module, and the device further includes: a determination unit, a calculation unit, and a prediction unit;

[0151] The determining unit is used to determine the intersection data between the source domain data and the target domain data.

[0152] The computing unit is used to obtain a migration feature vector through the migration backbone module based on the source domain data included in the intersection data.

[0153] The prediction unit is used to input the migration feature vector and the target domain data included in the intersection data into the target domain task module to obtain the prediction result.

[0154] As one possible implementation, the training unit 703 is specifically used for:

[0155] The parameters of the grafting module are adjusted based on the difference between the predicted and actual results.

[0156] As one possible implementation, the training unit 703 is specifically used for:

[0157] Based on the difference between the predicted results and the actual results, the propagation error of the parameter gradient vector of the target domain task module and the transfer feature vector is determined.

[0158] The parameter gradient vector of the grafting module is determined based on the propagation error of the migration feature vector;

[0159] If the initial target domain model does not meet the convergence condition, the parameters of the grafting module are adjusted according to the parameter gradient vector of the grafting module.

[0160] Before determining the parameter gradient vector of the grafting module based on the propagation error of the migration feature vector, the device further includes an adjustment unit for:

[0161] The parameters of the target domain task module are adjusted based on the parameter gradient vector of the target domain task module.

[0162] As one possible implementation, the computing unit is specifically used for:

[0163] The encrypted source domain data is input into the migration backbone module, and the encrypted migration feature vector is obtained through the migration backbone module; wherein, the encrypted source domain data is obtained by encrypting the source domain data included in the intersection data by the source domain;

[0164] The encrypted migration feature is decrypted using the migration feature vector decryption key to obtain the migration feature vector; wherein, the migration feature vector decryption key is generated by the source domain based on the source domain data included in the intersection data, the parameters of the backbone module, and the decryption parameters of the grafting module, and the decryption parameters of the grafting module are generated by the target domain. As one possible implementation, the device further includes an encryption unit for:

[0165] The parameters of the grafting module are encrypted using a first quantization method.

[0166] As one possible implementation, the encryption unit is specifically used for:

[0167] If the parameter of the grafting module is greater than zero, the parameter of the grafting module is encrypted to 1;

[0168] If the parameter of the grafting module is equal to zero, the parameter of the grafting module is encrypted to 0;

[0169] If the parameter of the grafting module is less than zero, the parameter of the grafting module is encrypted to -1.

[0170] As one possible implementation, the training unit 703 is specifically used for:

[0171] The migration feature vector, the propagation error of the migration feature, and the parameters of the grafting module are encrypted respectively to obtain the encrypted migration feature vector, the encrypted propagation error, and the encrypted grafting module parameters.

[0172] Obtain encrypted source domain data and encrypted backbone module parameters of the backbone module; wherein, the encrypted source domain data is obtained by encrypting the source domain data included in the intersection data by the source domain;

[0173] The second parameter gradient vector of the grafting module is generated based on the encrypted migration feature vector, the encrypted propagation error, the encrypted grafting module parameters, the encrypted source domain data, and the encrypted backbone module parameters.

[0174] Obtain the first parameter gradient vector, wherein the first parameter gradient vector is generated by the source domain based on the encryption migration feature vector, the encryption propagation error, the encryption grafting module parameters, the encryption source domain data, and the encryption backbone module parameters;

[0175] The parameter gradient vector of the grafting module is determined based on the first parameter gradient vector and the second parameter gradient vector.

[0176] As one possible implementation, the device further includes an encryption unit for:

[0177] The parameters of the grafting module are encrypted using the first quantization method, and the migration feature vector and its propagation error are encrypted using the second quantization method.

[0178] As one possible implementation, the quantization range of the second quantization method is larger than that of the first quantization method.

[0179] As one possible implementation, the device further includes an application unit for:

[0180] Obtain the target domain data;

[0181] The target domain data is input into the target domain model, and the predicted value corresponding to the target domain data is obtained through the target domain model.

[0182] As can be seen from the above technical solution, a source domain model is trained based on data from the source domain. This source domain model includes a backbone module common to both the source and target domains. Therefore, the backbone module from the source domain model is transferred to the initial target domain model. A grafting module is determined based on the backbone module, and this grafting module is then integrated into the backbone module to obtain the transfer backbone module of the initial target domain model. The initial target domain model is then obtained through transfer learning on the already trained source domain model. This process eliminates the need for a large amount of training data, reducing the difficulty of data acquisition during target domain model training and improving the efficiency of target domain model determination. Furthermore, during the training of the initial target domain model, the parameters of the backbone module in the transfer backbone module remain unchanged, while the parameters of the grafting module are adjusted until the initial target domain model converges, thus obtaining the target domain model. Therefore, the target domain model not only includes the knowledge of task processing in the source domain model, but also the knowledge of the target domain model itself used to process tasks, which improves the performance and parameter efficiency of transfer learning. Moreover, the grafting module is independent and private to the target domain, and the source domain model cannot fit the input data based on the output results obtained from the target domain, thus achieving output isolation between the target domain and the source domain, preventing cross-domain data from being leaked and improving data security.

[0183] This application also provides a computer device, which is the computer device described above. This computer device can be a server or a terminal device, and the aforementioned model determination device can be built into the server or terminal device. The computer device provided in this application will be described below from the perspective of hardware implementation. Among them, Figure 8 The diagram shown is a schematic of the server's structure. Figure 9 The diagram shown is a structural schematic of the terminal device.

[0184] See Figure 8 This figure is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary considerably due to different configurations or performance, and may include one or more Central Processing Units (CPUs) 1422 and memory 1432, and one or more application programs 1442 or data storage media 1430 (e.g., one or more mass storage devices). The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 1422 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the server 1400.

[0185] Server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.

[0186] The steps performed by the server in the above embodiments can be based on this Figure 8 The server structure shown.

[0187] CPU 1422 is used to perform the following steps:

[0188] Obtain the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source and target domains;

[0189] The grafting module is integrated into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a module determined based on the backbone module;

[0190] During the training of the initial target domain model, the parameters of the backbone module in the transfer backbone module are kept unchanged, while the parameters of the grafting module are adjusted until the initial target domain model meets the convergence condition, thus obtaining a target domain model applied to the target domain.

[0191] Optionally, CPU 1422 may also execute method steps of any specific implementation of the model determination method in the embodiments of this application.

[0192] See Figure 9 The figure is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 9 This diagram illustrates a partial structure of a smartphone related to the terminal device provided in this embodiment. The smartphone includes components such as a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a Wi-Fi module 1570, a processor 1580, and a power supply 1590. Those skilled in the art will understand that... Figure 9 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0193] The following is combined Figure 9 A detailed introduction to the various components of a smartphone:

[0194] The RF circuit 1510 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1580; in addition, it transmits uplink data to the base station.

[0195] The memory 1520 can be used to store software programs and modules, and the processor 1580 runs the software programs and modules stored in the memory 1520 to realize various functions and data processing of the smartphone.

[0196] Input unit 1530 can be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the smartphone. Specifically, input unit 1530 may include touch panel 1531 and other input devices 1532. Touch panel 1531, also known as a touch screen, can collect touch operations on or near the user and drive corresponding connected devices according to a pre-set program. In addition to touch panel 1531, input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0197] The display unit 1540 can be used to display information input by the user or information provided to the user, as well as various menus of the smartphone. The display unit 1540 may include a display panel 1541, which may optionally be configured as a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0198] Smartphones may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Other sensors that smartphones may also be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be detailed here.

[0199] Audio circuit 1560, speaker 1561, and microphone 1562 provide an audio interface between the user and the smartphone. Audio circuit 1560 converts received audio data into electrical signals and transmits them to speaker 1561, where speaker 1561 converts them into sound signals for output. On the other hand, microphone 1562 converts collected sound signals into electrical signals, which are received by audio circuit 1560, converted into audio data, and then processed by processor 1580 before being transmitted via RF circuit 1510 to, for example, another smartphone, or the audio data can be output to memory 1520 for further processing.

[0200] The processor 1580 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1520, and by calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0201] The smartphone also includes a power supply 1590 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0202] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0203] In this embodiment of the application, the memory 1520 included in the smartphone can store program code and transmit the program code to the processor.

[0204] The processor 1580 included in the smartphone can execute the model determination method provided in the above embodiments according to the instructions in the program code.

[0205] This application also provides a computer-readable storage medium for storing a computer program for executing the model determination method provided in the above embodiments.

[0206] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method for determining the model provided in the various optional implementations of the above aspects.

[0207] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0208] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0209] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for determining a model, characterized in that, The method includes: Obtain the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source and target domains; The grafting module is integrated into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a target domain-independent private module determined according to the backbone module, and the grafting module is used to isolate the output of the source domain and the target domain; the initial target domain model also includes a target domain task module; Determine the intersection data between the source domain data and the target domain data; The encrypted source domain data is input into the migration backbone module, and the encrypted migration feature vector is obtained through the migration backbone module; wherein, the encrypted source domain data is obtained by encrypting the source domain data included in the intersection data by the source domain; The encrypted migration feature is decrypted using the migration feature vector decryption key to obtain the migration feature vector; wherein, the migration feature vector decryption key is generated by the source domain based on the source domain data included in the intersection data, the parameters of the backbone module, and the decryption parameters of the grafting module, and the decryption parameters of the grafting module are generated by the target domain; The target domain data, including the transfer feature vector and the intersection data, is input into the target domain task module to obtain the prediction result; During the training of the initial target domain model, the parameters of the backbone module in the transfer backbone module are kept unchanged. The propagation error of the parameter gradient vector of the target domain task module and the transfer feature vector are determined based on the difference between the predicted and actual results. The transfer feature vector, the propagation error of the transfer feature vector, and the parameters of the grafting module are encrypted respectively, resulting in encrypted transfer feature vector, encrypted propagation error, and encrypted grafting module parameters. Encrypted source domain data and encrypted backbone module parameters of the backbone module are obtained. Based on the encrypted transfer feature vector, the encrypted propagation error, the encrypted grafting module parameters, the encrypted source domain data, and the encrypted... The parameters of the encryption backbone module are used to generate the second parameter gradient vector of the grafting module; the first parameter gradient vector is obtained; the parameter gradient vector of the grafting module is determined based on the first parameter gradient vector and the second parameter gradient vector; the first parameter gradient vector is generated by the source domain based on the encryption migration feature vector, the encryption propagation error, the encryption grafting module parameters, the encryption source domain data, and the encryption backbone module parameters. If the initial target domain model does not meet the convergence condition, the parameters of the grafting module are adjusted according to the parameter gradient vector of the grafting module until the initial target domain model meets the convergence condition, thereby obtaining a target domain model applied to the target domain.

2. The method according to claim 1, characterized in that, Before determining the parameter gradient vector of the grafting module based on the propagation error of the migration feature vector, the method further includes: The parameters of the target domain task module are adjusted based on the parameter gradient vector of the target domain task module.

3. The method according to claim 1, characterized in that, The method further includes: The parameters of the grafting module are encrypted using a first quantization method.

4. The method according to claim 3, characterized in that, The encryption of the parameters of the grafting module through the first quantization method includes: If the parameter of the grafting module is greater than zero, the parameter of the grafting module is encrypted to 1; If the parameter of the grafting module is equal to zero, the parameter of the grafting module is encrypted to 0; If the parameter of the grafting module is less than zero, the parameter of the grafting module is encrypted to -1.

5. The method according to claim 1, characterized in that, The method further includes: The parameters of the grafting module are encrypted using a first quantization method, and the migration feature vector and its propagation error are encrypted using a second quantization method.

6. The method according to claim 5, characterized in that, The quantization range of the second quantization method is greater than that of the first quantization method.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Obtain the target domain data; The target domain data is input into the target domain model, and the predicted value corresponding to the target domain data is obtained through the target domain model.

8. A model determining device, characterized in that, The device includes: an acquisition unit, a fusion unit, a determination unit, a calculation unit, a prediction unit, an encryption unit, and a training unit; The acquisition unit is used to acquire the backbone module of the source domain model; wherein, the source domain model is a model trained based on source domain data, and the backbone module is a module common to both the source domain and the target domain; The fusion unit is used to fuse the grafting module into the backbone module to obtain the migration backbone module of the initial target domain model; wherein, the grafting module is a target domain-independent private module determined according to the backbone module, and the grafting module is used to isolate the output of the source domain and the target domain; the initial target domain model also includes a target domain task module; The determining unit is used to determine the intersection data between the source domain data and the target domain data. The computing unit is used to input encrypted source domain data into the migration backbone module, and obtain an encrypted migration feature vector through the migration backbone module; wherein, the encrypted source domain data is obtained by encrypting the source domain data included in the intersection data by the source domain; the encrypted migration feature vector is decrypted according to the migration feature vector decryption key to obtain the migration feature vector; wherein, the migration feature vector decryption key is generated by the source domain based on the source domain data included in the intersection data, the parameters of the backbone module and the decryption parameters of the grafting module, and the decryption parameters of the grafting module are generated by the target domain; The prediction unit is used to input the target domain data, which includes the migration feature vector and the intersection data, into the target domain task module to obtain the prediction result; The training unit is used to maintain the parameters of the backbone module in the transfer backbone module unchanged during the training of the initial target domain model; determine the parameter gradient vector of the target domain task module and the propagation error of the transfer feature vector based on the difference between the prediction result and the actual result; encrypt the transfer feature vector, the propagation error of the transfer feature vector, and the parameters of the grafting module respectively to obtain encrypted transfer feature vector, encrypted propagation error, and encrypted grafting module parameters; acquire encrypted source domain data and encrypted backbone module parameters of the backbone module; and based on the encrypted transfer feature vector, the encrypted propagation error, the encrypted grafting module parameters, and the encrypted source domain data... The second parameter gradient vector of the grafting module is generated based on the parameters of the encryption backbone module; the first parameter gradient vector is obtained; the parameter gradient vector of the grafting module is determined based on the first parameter gradient vector and the second parameter gradient vector; the first parameter gradient vector is generated by the source domain based on the encryption migration feature vector, the encryption propagation error, the encryption grafting module parameters, the encryption source domain data, and the encryption backbone module parameters. If the initial target domain model does not meet the convergence condition, the parameters of the grafting module are adjusted according to the parameter gradient vector of the grafting module until the initial target domain model meets the convergence condition, thereby obtaining a target domain model applied to the target domain.

9. The apparatus according to claim 8, characterized in that, The device further includes: An adjustment unit is used to adjust the parameters of the target domain task module according to the parameter gradient vector of the target domain task module before determining the parameter gradient vector of the grafting module based on the propagation error of the migration feature vector.

10. The apparatus according to claim 8, characterized in that, The encryption unit is specifically used to encrypt the parameters of the grafting module through a first quantization method.

11. The apparatus according to claim 10, characterized in that, The encryption unit is specifically used for: If the parameter of the grafting module is greater than zero, the parameter of the grafting module is encrypted to 1; If the parameter of the grafting module is equal to zero, the parameter of the grafting module is encrypted to 0; If the parameter of the grafting module is less than zero, the parameter of the grafting module is encrypted to -1.

12. The apparatus according to claim 8, characterized in that, The encryption unit is also used for: The parameters of the grafting module are encrypted using a first quantization method, and the migration feature vector and its propagation error are encrypted using a second quantization method.

13. The apparatus according to claim 12, characterized in that, The quantization range of the second quantization method is greater than that of the first quantization method.

14. The apparatus according to any one of claims 8-13, characterized in that, The device further includes: An application unit is used to acquire the target domain data; input the target domain data into the target domain model; and obtain the predicted value corresponding to the target domain data through the target domain model.

15. A computer device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1-7 according to the instructions in the program code.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-7.

17. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-7.