Model training method and apparatus, computing device
By jointly training the business sites with the central server and other sites, and using gradient adjustment values to compensate for the lack of sample data, more effective model training was achieved.
Patent Information
- Application Number
- CN202210687395.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-06-17
AI Technical Summary
The number of samples at business sites is insufficient, making it difficult to effectively train the model.
Through joint training between business sites, the central server, and other business sites, the training process of the local model is adjusted by integrating the gradient information of each site through the central server, and the model is trained using sample data from other sites.
Even business sites with insufficient sample data can train more effective models, as gradient information comes from real-life sample data that matches actual business conditions.
Smart Images

Figure CN115169442B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to network communication technology, and particularly relate to a model training method and device and a computing device. BACKGROUND
[0002] With the continuous development of network applications, various different business applications are generated based on the network, such as payment type business, clearing type business, video playing type business, etc. In order to complete a certain function, a business site needs to train a machine model, such as a risk identification model, so as to be able to identify risk business from a large amount of business data.
[0003] However, at present, the sample quantity of some business sites is insufficient, and it is difficult to effectively train the model. SUMMARY
[0004] One or more embodiments of the present specification describe a model training method and device, which can train a more accurate model for a business site with a small sample quantity.
[0005] According to a first aspect, a model training method is provided, applied to a business site, the business site being trained jointly with other business sites, each business site supporting a first business type, and the business applications used by each business site belonging to the first business type being different; and the method comprises:
[0006] For the first business type, at least one type of feature corresponding to the first business type is determined;
[0007] Sample data of each type of feature is obtained from a first business application used by the business site and belonging to the first business type;
[0008] In each round of training, the obtained sample data is used to train a local model, and the gradient of the local model is obtained;
[0009] The gradient obtained in the current round of training is sent to a center server;
[0010] A gradient adjustment value sent by the center server is received; wherein the gradient adjustment value is obtained by the center server according to the gradients of at least two business sites supporting the first business type;
[0011] The received gradient adjustment value is used for the next round of training until the local model converges.
[0012] The first business type is a payment type business type; and the at least one type of feature includes at least one of a basic feature representing personal basic information, a transaction feature representing transaction information, and a risk feature representing a risk category.
[0013] The adjusting the gradient for the next round of training comprises:
[0014] The gradient used in the next round of training is calculated by using the following calculation formula:
[0015] W t+1 = W t - Δt
[0016] W t+1 is the gradient used in the next round of training, W t is the gradient used in the current round of training, and Δt is the gradient adjustment value.
[0017] According to a second aspect, a model training method is provided, applied to a center server connected to at least two business sites, each of which supports a first business type and uses different business applications belonging to the first business type; the method comprises:
[0018] In each round of training, gradients obtained in the current round of training are received from the at least two business sites respectively;
[0019] According to the received gradients, a gradient adjustment value corresponding to each business site in the next round is determined;
[0020] Each gradient adjustment value is sent to the corresponding business site.
[0021] The determining of the gradient adjustment value corresponding to each business site in the next round according to the received gradients comprises:
[0022] The gradient adjustment value is calculated by using the following calculation formula:
[0023]
[0024] ρ i is a predetermined learning rate corresponding to the i th business site, 0≤ ρ i ≤ 1, K is the number of business sites participating in the current round of model training; n i is the number of sample data used in the i th business site participating in the model training, n is the total number of sample data used in the business sites participating in the current round of model training; g i is the gradient sent by the i th business site participating in the current round of model training; Δt i is the gradient adjustment value of the i th business site.
[0025] The first business type is a payment type business type, and the at least one type of feature comprises at least one of a basic feature representing user basic information, a transaction feature representing transaction information, and a risk feature representing a risk category.
[0026] The payment type of the business type is cross-border payment, and the at least two business sites are located in different countries.
[0027] According to a third aspect, a model training apparatus is provided, applied to a business site, the business site being trained jointly with other business sites, each business site supporting a first business type, and each business site using a first business application belonging to the first business type; the apparatus comprising:
[0028] a feature determination module configured to determine at least one type of feature corresponding to the first business type supported by the business site;
[0029] a sample acquisition module configured to acquire sample data of each type of feature from a first business application belonging to the first business type and used by the business site;
[0030] a gradient acquisition module configured to train a local model using the acquired sample data in each round of training to obtain a gradient of the local model;
[0031] an interaction module configured to send the gradient obtained in each round of training to a center server, and receive a gradient adjustment value sent by the center server, wherein the gradient adjustment value is obtained by the center server according to the gradients of at least two business sites supporting the first business type;
[0032] a training control module configured to control the next round of training using the received gradient adjustment value until the local model converges.
[0033] According to a fourth aspect, a model training apparatus is provided, applied to a center server, the center server being connected to at least two business sites, each of the at least two business sites supporting a first business type, and each of the at least two business sites using a first business application belonging to the first business type; the apparatus comprising:
[0034] a gradient receiving module configured to receive, in each round of training, gradients obtained in the current round of training sent by the at least two business sites respectively;
[0035] a gradient adjustment module configured to determine, according to the received gradients, a gradient adjustment value corresponding to each business site in the next round;
[0036] a gradient sending module configured to send each gradient adjustment value to the corresponding business site.
[0037] According to a fifth aspect, a computing device is provided, comprising a memory and a processor, the memory having stored therein executable code which, when executed by the processor, implements the method of any embodiment of the present specification.
[0038] The model training method and device provided by the embodiments of the present specification use the gradient adjustment value to determine the gradient used in the next round of training when training the local model in a business site. Because the gradient adjustment value is obtained by the central server according to the gradients of at least two business sites supporting the first business type, when the business site trains, it is equivalent to using the gradient information of other business sites, and further equivalent to using the information of the sample data of other business sites to train the local model. In this way, even if the number of sample data of a business application in a business site is insufficient, the sample data of other business applications of the same business type used in other business sites can be used to make up for the problem of insufficient sample data. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0040] Figure 1 is a schematic diagram of the system architecture to which an embodiment of the present specification is applied.
[0041] Figure 2 is a flowchart of the model training method executed in a business site in an embodiment of the present specification.
[0042] Figure 3 is a flowchart of the model training method executed in a central server in an embodiment of the present specification.
[0043] Figure 4 is a structural schematic diagram of the model training device in an embodiment of the present specification.
[0044] Figure 5 is a structural schematic diagram of the model training device in another embodiment of the present specification. DETAILED DESCRIPTION
[0045] As described above, a business site needs to train a machine model in order to complete a certain function, such as training a risk identification model to identify a risk business. In order to make the trained machine model more effective, a large number of samples are often needed to participate in the training of the model, and the more samples, the better the training effect. However, in actual business, the number of samples of the business site is often insufficient, so it is difficult to effectively train the model.
[0046] In the prior art, in order to increase the number of samples, various deformations can be performed on the samples, such as stretching or flipping image samples, and the deformed samples are used as new samples to make up for the problem of insufficient number of samples. However, the deformed samples do not come from real life and cannot better match the actual business situation, so an effective model cannot be trained.
[0047] The scheme provided in the present specification will be described below in conjunction with the accompanying drawings.
[0048] In order to facilitate the understanding of the method provided in the present specification, the system architecture involved and applicable to the present specification will be described first. As shown in Figure 1 The system architecture mainly includes two types of network nodes: one is a business site, Figure 1 Business site 1 and business site 2 are shown in FIG. 1, and the other is a center server. Each business site is connected to the center server.
[0049] Each business site can support the same type of business, but implement the same type of business using different business applications / systems, such as business site 1 and business site 2 can both implement payment business, but use different payment systems, such as business site 1 is located in China and uses payment system 1 to complete payment, and business site 2 is located in another country and uses foreign version of payment system 2 to complete payment.
[0050] The center server can be a single server or a server group composed of multiple servers, and is responsible for joint model training of the business sites.
[0051] It should be understood that Figure 1 The number of business sites and center servers in the system architecture is only illustrative. According to the needs of implementation, any number can be selected and arranged.
[0052] In the model training of the business site, the processing of the business site and the processing of the center server are involved, and the processing of the business site and the processing of the center server will be described below respectively.
[0053] The processing of the business site in the model training of the business site will be described below.
[0054] Figure 2is a flowchart of a model training method performed in a business site in an embodiment of the present specification. The execution subject of the method is a model training device, which is applied in a business site, the business site jointly trains with other business sites, and all support a first business type. It can be understood that the method can also be executed by any device, equipment, platform, device cluster with computing and processing capabilities. Referring to Figure 2 , the method comprises:
[0055] Step 201: For the first business type supported by each business site, determine at least one type of feature corresponding to the first business type.
[0056] Step 203: Obtain sample data of each feature from the first business application used by the business site, which belongs to the first business type.
[0057] Step 205: Train the local model using the obtained sample data to obtain the gradient of the local model in this round of training.
[0058] Step 207: Send the obtained gradient to the center server.
[0059] Step 209: Receive the gradient adjustment value sent by the center server; wherein the gradient adjustment value is obtained by the center server according to the gradients of at least two business sites supporting the first business type; the business applications used by the at least two business sites belong to the first business type.
[0060] Step 211: Use the received gradient adjustment value to perform the next round of training until the local model converges.
[0061] As can be seen in the above Figure 2 , in the process shown in the flowchart, when a business site trains a local model, the gradient adjustment value is used to determine the gradient used in the next round of training. Because the gradient adjustment value is obtained by the center server according to the gradients of at least two business sites supporting the first business type, when the business site performs training, it is equivalent to using the gradient information of other business sites, and further equivalent to using the sample data information of other business sites to train the local model. In this way, even if the number of sample data of a business application in a business site is insufficient, it can also use the sample data of other business applications of the same business type used in other business sites to make up for the problem of insufficient sample data.
[0062] At the same time, because the sample data used by the business site corresponds to different business applications, but belongs to the same business type supported by each business site, the gradient information used, i.e. the sample data information indirectly used, can be used for model training of the business site.
[0063] At the same time, because the sample data from other business sites that are used are actually generated in the business applications of those other business sites and come from real life, they can better match the actual business situation and train a more effective model.
[0064] The model training methods described in this specification can be applied to various business scenarios, including:
[0065] Scene 1
[0066] Each business site supports payment-related business types, meaning they can all complete payment-related transactions, but they use different business applications to implement these transactions.
[0067] For example, both business site 1 and business site 2 can perform payment-related business types (i.e., the first business type mentioned above), but they use different payment systems and are applied to international payment business. For instance, business site 1 is located in China and uses payment system 1 (which can be called the first business application) to complete payments, while business site 2 is located in another country and uses the foreign version of payment system 2 (which can be called the second business application) to complete payments.
[0068] Payment system 1 (which can be called the first business application) and payment system 2 (which can be called the second business application) both belong to the payment business type (i.e. the first business type mentioned above), but their implementation processes are different.
[0069] For example, if business site 2 is located in a country with a small population and underdeveloped internet applications, the number of users using payment system 2 is small, resulting in low transaction volume. Consequently, business site 2 has very limited local sample data, which is detrimental to training the model in business site 2. Therefore, the above-mentioned approach can be adopted. Figure 2 The method shown involves joint training between business site 1 and business site 2 via a central server. This means that business site 2 utilizes the gradients from business site 1, essentially using the sample data from business site 1 to jointly train its local model. In a preferred implementation, business site 1 is located in a country with a large population and highly developed internet infrastructure, with a large number of users of payment system 1, resulting in a massive transaction volume. Consequently, business site 1 can obtain a vast amount of local sample data. Figure 2 The method shown ensures that business site 2 can also train an effective local model.
[0070] Scene 2
[0071] Each business site supports clearing-type business types, meaning they can all complete clearing-type business, such as monthly settlement and daily settlement, but they use different business applications to implement these clearing-type business.
[0072] For example, both business site 1 and business site 2 can perform clearing business types (i.e., the first business type mentioned above), but they use different clearing systems. For instance, business site 1 is located in China and uses clearing system 1 (which can be called the first business application) to complete clearing, while business site 2 is located in another country and uses the foreign version of clearing system 2 (which can be called the second business application) to complete clearing.
[0073] Clearing System 1 (which can be called the first business application) and Clearing System 2 (which can be called the second business application) both belong to the clearing business type (i.e. the first business type mentioned above), but their implementation processes are different.
[0074] For example, if business site 2 is located in a country with a small population and underdeveloped internet applications, the number of users using clearing system 2 is small, resulting in low transaction volume. This leads to a very limited amount of local sample data available to business site 2, which is detrimental to training the model in business site 2. Therefore, the above-mentioned approach can be adopted. Figure 2 The method shown leverages the gradient of business site 1, which is equivalent to using the sample data from business site 1 to jointly train the local model of business site 2. In a preferred implementation, business site 1 is located in a country with a large population and highly developed internet applications, and has a large number of users using clearing system 1, resulting in a huge transaction volume. Therefore, business site 1 can obtain a large amount of local sample data. Figure 2 The method shown ensures that business site 2 can also train an effective local model.
[0075] The following describes specific embodiments. Figure 2 Each step shown will be explained separately. The explanation will take business site 1 as an example.
[0076] First, for step 201: For the first business type supported by each business site, determine at least one type of feature corresponding to the first business type.
[0077] As mentioned above, the plurality of business sites jointly support the same service type, denoted as the first service type, but the business applications used by the business sites belong to the first service type are different. Because the business applications are different, the data and feature types of each business application are different, and these different data and feature types cannot be directly used for joint training. In this case, in order to enable the business site with a small number of samples to perform joint training with the business site with a large number of samples, it is necessary to determine at least one feature corresponding to the first service type supported by each business site participating in joint training, that is, although the business applications are different, these different business applications belong to the same first service type, therefore, in step 201, the features corresponding to the first service type are summarized instead of the features corresponding to the business applications, and the subsequent use of sample data conforming to the features corresponding to the first service type can directly perform joint training.
[0078] For example, the first service type is a payment service, regardless of the business application used to implement it, such as the implementation of Alipay or WeChat or other business applications, the features corresponding to the payment service can include at least one of the following:
[0079] Basic features representing personal basic information: such as gender / identity / account number, etc.
[0080] Transaction features representing transaction information: such as payment / stored value transaction features, such as the number of customers transferred in / out, total inflow / outflow amount, or early morning transaction, etc.
[0081] Risk features representing risk categories: such as review experience risk features, such as fast in and fast out, same transaction address, or gambling risk features, etc.
[0082] For international payment services, business sites located in different countries are very suitable for the above-mentioned review experience risk features.
[0083] Next, for step 203: obtaining sample data of each feature from the first business application used by the business site 1 and belonging to the first service type.
[0084] In order to ensure that the plurality of business sites can perform joint training, the plurality of business applications used by the plurality of business sites should be uniform in the type of sample data, that is, all use sample data corresponding to the features of the first service type.
[0085] For example, for a payment service, the business site 1 obtains basic features representing personal basic information in the operation of the payment system 1, such as the number of accounts, transaction features representing transaction information, such as transactions in the early morning, and risk features representing risk categories, such as fast in and fast out. Similarly, other sites participating in the joint training, such as the business site 2, obtain sample data of the same features in the operation of the payment system 2, that is, basic features representing personal basic information, such as the number of accounts, transaction features representing transaction information, such as transactions in the early morning, and risk features representing risk categories, such as fast in and fast out.
[0086] Next, for step 205: In each round of training, the business site 1 trains the local model using the obtained sample data to obtain the gradient of the local model.
[0087] Next, for step 207: The business site 1 sends the gradient obtained in the current round of training to the central server.
[0088] The gradient is an irreversible vector and can reflect the features of the local model trained by the business site 1. In the embodiments of the present specification, the business site will not send the local sample data to other business sites or the central server, but will train locally, and only send the parameters obtained in the model training, that is, the gradient, to the central server, thereby avoiding the leakage of data in the business site 1 and improving security. At the same time, since the gradient is shared with the central server, the central server can also obtain the features of the local model trained by the business site 1 in order to facilitate joint training.
[0089] After receiving the gradients sent by the business site 1 and other business sites, the central server obtains the features of the local model of each business site participating in the joint training in the current round of training. The central server then aggregates the gradients of each business site participating in the joint training, and uses the aggregation result to control the next round of training of each business site participating in the joint training.
[0090] Specifically, the processing of the central server mainly includes:
[0091] First, the central server determines the gradient adjustment value corresponding to each business site in the next round according to the received gradients, including:
[0092] The following calculation formula is used to calculate,
[0093]
[0094] ρ i is a predetermined learning rate corresponding to the i-th business site, 0≤ρ i ≤1, K is the number of business sites participating in the joint training in the current round; n iThe number of sample data used in the i-th business site participating in the current round of joint training, n is the total number of sample data used in each business site participating in the current round of joint training; g i The gradient sent by the i-th business site participating in the current round of joint training; Δt i The gradient adjustment value of the i-th business site.
[0095] In an embodiment of the present specification, the learning rate ρ i of different business sites can be the same or different. For example, the sample quantity of business site 1 is very small, and more help is needed from joint training, so the value of ρ1 corresponding to business site 1 can be relatively larger, and the sample quantity of business site 2 is relatively larger, and less help is needed from joint training, so the value of ρ2 corresponding to business site 2 can be relatively smaller.
[0096] Secondly, the center server sends the gradient adjustment value calculated for each business site to the corresponding business site.
[0097] Next, for step 209: business site 1 receives the gradient adjustment value sent by the center server; wherein the gradient adjustment value is obtained by the center server according to the gradient of at least two business sites supporting the first business type.
[0098] It can be understood that each business site participating in joint training needs to receive the gradient adjustment value corresponding to itself sent by the center server.
[0099] Next, for step 211: business site 1 uses the received gradient adjustment value to perform the next round of training until the local model converges.
[0100] In this step 211, first, in an embodiment of the present specification, business site 1 calculates the gradient used in the next round of training using the following calculation formula,
[0101] W t+1 = W t - Δt
[0102] W t+1 is the gradient to be used in the next round of training, W t is the gradient that has been used in the current round of training, and Δt is the gradient adjustment value sent by the center server to business site 1.
[0103] Secondly, in the next round of training, business site 1 uses W t+1 as the gradient to be used in training to continue training the local model, judges whether the local model converges, if yes, ends the model training process, otherwise, returns to step 207.
[0104] In the above description, the processing of the service site 1 is taken as an example, and the processing methods of the various service sites participating in the joint training are the same as those described above Figure 2 The processing method of the service site 1 described in each step is the same.
[0105] The processing of the center server in the joint training is described below.
[0106] Figure 3 This is a flowchart of a model training method performed in the center server in an embodiment of the present specification. The execution subject of the method is a model training device, which is applied in a center server connected to at least two service sites, and the at least two service sites all support a first service type, and the service applications used by the at least two service sites belong to the first service type and are different. It can be understood that the method can also be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 3 , the method comprises:
[0107] Step 301: In each round of training, receiving the gradients obtained in the current round of training sent by the at least two service sites respectively.
[0108] Step 303: According to the received gradients, determining the gradient adjustment value corresponding to each service site in the next round.
[0109] Step 305: Sending each gradient adjustment value to the corresponding service site.
[0110] In step 303 described above, the center server determines the gradient adjustment value corresponding to each service site in the next round according to the received gradients, comprising:
[0111] using the following calculation formula,
[0112]
[0113] ρ i is a predetermined learning rate corresponding to the i-th service site, 0≤ρ i ≤1, K is the number of service sites participating in the current round of joint training; n i is the number of sample data used in the i-th service site participating in the current round of joint training, n is the total number of sample data used in the service sites participating in the current round of joint training; g i is the gradient sent by the i-th service site participating in the current round of joint training; Δt i is the gradient adjustment value of the i-th service site.
[0114] As described above, in the embodiments of the present specification, the learning rates ρ iThey can be the same or different. For example, the number of samples of the business site 1 is very small, and more help is needed from joint training, so the value of p1 corresponding to the business site 1 can be relatively larger, and the number of samples of the other business site 2 is relatively larger, and less help is needed from joint training, so the value of p2 corresponding to the business site 2 can be relatively smaller.
[0115] It can be understood that for a business site i,
[0116] The calculation formula for calculating the gradient used in the next round is essentially:
[0117] In an embodiment of the present specification, a model training apparatus is provided, applied to a business site, the business site performing joint training with other business sites, each business site supporting a first business type, and each business site using a business application belonging to the first business type being different; see Figure 4 The apparatus comprises:
[0118] The feature determination module 401 is configured to determine at least one type of feature corresponding to the first business type for each business site supporting the first business type;
[0119] The sample acquisition module 402 is configured to acquire sample data of each type of feature from the first business application belonging to the first business type used by the business site;
[0120] The gradient acquisition module 403 acquires sample data of each type of feature from the first business application belonging to the first business type used by the business site;
[0121] The interaction module 404 is configured to send the gradient obtained in each round of training to the center server, and receive the gradient adjustment value sent by the center server; wherein the gradient adjustment value is obtained by the center server according to the gradient of at least two business sites supporting the first business type;
[0122] The training control module 405 is configured to control the next round of training by using the received gradient adjustment value until the local model converges.
[0123] In an embodiment of the apparatus of the present specification shown in Figure 4 The first business type is a payment type, and the at least one type of feature includes at least one of a basic feature representing personal basic information, a transaction feature representing transaction information, and a risk feature representing a risk category.
[0124] In an embodiment of the apparatus of the present specification shown in Figure 4 The training control module 405 is configured to perform:
[0125] The gradient used in the next round of training is calculated using the following calculation formula,
[0126] W t+1 = W t - Δt
[0127] W t+1 is the gradient used in the next round of training, W t is the gradient used in the current round of training, and Δt is the gradient adjustment value.
[0128] In another embodiment of the present specification, another model training apparatus is provided, applied to a central server connected to at least two business sites, wherein each of the at least two business sites supports a first business type, and the at least two business sites use different business applications belonging to the first business type; see Figure 5 The apparatus comprises:
[0129] A gradient receiving module 501 is configured to receive, in each round of training, gradients obtained in the current round of training from each of the at least two business sites;
[0130] A gradient adjustment module 502 is configured to determine, according to each received gradient, a gradient adjustment value corresponding to each business site in the next round;
[0131] A gradient sending module 503 is configured to send each gradient adjustment value to the corresponding business site.
[0132] In an embodiment of the apparatus of the present specification shown in Figure 5 , the gradient adjustment module 502 is configured to perform:
[0133] using the following calculation formula,
[0134]
[0135] ρ i is a predetermined learning rate corresponding to the i-th business site, 0≤ρ i ≤1, and K is the number of business sites participating in the current round of model training; n i is the number of sample data used in the i-th business site participating in the model training, and n is the total number of sample data used in each business site participating in the current round of model training; g i is the gradient sent by the i-th business site participating in the current round of model training; and Δt i is the gradient adjustment value.
[0136] In an embodiment of the apparatus of the present specification shown in Figure 5 , the learning rates corresponding to different business sites are different.
[0137] In Figure 5 In one embodiment of the apparatus of the present specification, the first service type is a payment type service type; the at least one type of feature comprises at least one of a basic feature representing basic information of a user, a transaction feature representing transaction information, and a risk feature representing a risk category.
[0138] In Figure 5 In one embodiment of the apparatus of the present specification, the payment type service type is a cross-border payment; the at least two service sites are service sites located in different countries.
[0139] One embodiment of the present specification provides a computer readable storage medium, having stored thereon a computer program, which, when executed in a computer, causes the computer to perform the method in any one of the embodiments of the present specification.
[0140] One embodiment of the present specification provides a computing device, comprising a memory and a processor, the memory having stored thereon executable code that, when executed by the processor, performs the method in any one of the embodiments of the present specification.
[0141] It can be understood that the structure shown in the embodiments of the present specification does not constitute a specific limitation on the apparatus of the embodiments of the present specification. In other embodiments of the present specification, the above apparatus can include more or fewer components than those shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0142] The information interaction, execution process, and the like, between the modules in the above apparatus and system, since based on the same idea as the method embodiments of the present specification, the specific content can be referred to the description in the method embodiments of the present specification, which will not be described here.
[0143] Each of the embodiments of the present specification adopts a progressive description manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the difference from other embodiments. Especially, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the description of the method embodiments.
[0144] Those skilled in the art should realize that, in one or more examples described above, the functions described in the present specification can be implemented by hardware, software, a plug-in, or any combination thereof. When implemented by software, these functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium.
[0145] The above detailed description of the specific embodiments of the present application has been given to illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application shall be included in the protection scope of the present application.
Claims
1. A model training method applied to a business site, the business site performing joint training with other business sites, each business site supporting a first business type, and each business site using a business application belonging to the first business type and being different from business applications used by other business sites. The method comprises the following steps: For the first service type, at least one type of feature corresponding to the first service type is determined; Sample data of each type of feature is obtained from a first service application used by the service site and belonging to the first service type; In each round of training, the local model is trained using the obtained sample data to obtain the gradient of the local model; The gradient obtained in the current round of training is sent to the central server; The gradient adjustment value sent by the central server is received; wherein the central server calculates the gradient adjustment value corresponding to each service site in the next round of training according to the received gradients of at least two service sites supporting the first service type, and uses the following calculation formula: ρ i is a predetermined learning rate corresponding to the i-th service site, 0≤ρ i ≤1, K is the number of service sites participating in joint training in this round; n i is the number of sample data used in the i-th service site participating in model training, n is the total number of sample data used by each service site participating in joint training in this round; g i is the gradient sent by the i-th service site participating in joint training in this round; Δt i is the gradient adjustment value of the i-th service site; The next round of training is performed using the received gradient adjustment value until the local model converges.
2. The method of claim 1, wherein, The first service type is a payment type service type; and the at least one type of feature includes at least one of a basic feature representing personal basic information, a transaction feature representing transaction information, and a risk feature representing a risk category.
3. The method of claim 1, wherein, The next round of training is performed using the received gradient adjustment value, which comprises: The gradient used in the next round of training is calculated using the following calculation formula: W t+1 = W t -Δt W t+1 is the gradient used in the next round of training, W t is the gradient used in the current round of training, and Δt is the gradient adjustment value.
4. A model training method applied to a central server, the central server being connected to at least two business sites, the at least two business sites each supporting a first business type, the at least two business sites using different business applications belonging to the first business type. The method comprises the following steps: In each round of training, the gradient obtained in the current round of training is received from at least two service sites; According to the received gradients, the gradient adjustment value corresponding to each service site in the next round of training is determined; Each gradient adjustment value is sent to the corresponding service site; The gradient adjustment value corresponding to each service site in the next round of training is determined according to the received gradients, which comprises: The gradient adjustment value corresponding to each service site in the next round of training is determined according to the received gradients, which comprises: ρ i is a predetermined learning rate corresponding to the i-th service site, 0≤ρ i ≤1, K is the number of service sites participating in joint training in this round; n i is the number of sample data used in the i-th service site participating in model training, n is the total number of sample data used by each service site participating in joint training in this round; g i is the gradient sent by the i-th service site participating in joint training in this round; Δt i is the gradient adjustment value of the i-th service site.
5. The method of claim 4, wherein, The first service type is a payment type service type; and the at least one type of feature corresponding to the first service type includes at least one of a basic feature representing user basic information, a transaction feature representing transaction information, and a risk feature representing a risk category.
6. The method of claim 5, wherein, The payment type service type is a cross-border payment type; and the at least two service sites are located in different countries.
7. A model training device applied to a service site, wherein the service site is trained jointly with other service sites, each service site supports a first service type, and the service applications used by each service site and belonging to the first service type are different; the device comprises: A feature determination module configured to determine at least one type of feature corresponding to the first service type for the first service type; A sample acquisition module configured to obtain sample data of each type of feature from a first service application used by the service site and belonging to the first service type; A gradient acquisition module configured to train a local model using the obtained sample data in each round of training to obtain the gradient of the local model; An interaction module configured to send the gradient obtained in each round of training to a central server, and receive the gradient adjustment value sent by the central server; wherein the central server calculates the gradient adjustment value corresponding to each service site in the next round of training according to the received gradients of at least two service sites supporting the first service type, and uses the following calculation formula: The next round of training is performed using the received gradient adjustment value until the local model converges. ρ i is a predetermined learning rate corresponding to the ith business site, 0≤ρ i ≤1, K is the number of business sites participating in joint training in this round; n i is the number of sample data used in the ith business site participating in model training, n is the total number of sample data used by each business site participating in joint training in this round; g i is the gradient sent by the ith business site participating in joint training in this round; Δt i is the gradient adjustment value of the ith business site; The training control module is configured to control the next round of training by using the received gradient adjustment value until the local model converges.
8. A model training apparatus applied to a central server, the central server being connected with at least two business sites, the at least two business sites each supporting a first business type, and the at least two business sites using different business applications belonging to the first business type. The device comprises: The gradient receiving module is configured to receive, in each round of training, gradients obtained in the current round of training from at least two business sites respectively; The gradient adjustment module is configured to determine, according to the received gradients, a gradient adjustment value corresponding to each business site in the next round of training; The gradient sending module is configured to send each gradient adjustment value to the corresponding business site; The gradient adjustment module is configured to perform: The gradient adjustment value is calculated by using the following calculation formula, ρ i is a predetermined learning rate corresponding to the i-th business site, 0≤ρ i ≤1, K is the number of business sites participating in the current round of model training; n i is the number of sample data used in the i-th business site participating in the model training, n is the total number of sample data used in each business site participating in the current round of model training; g i is the gradient sent by the i-th business site participating in the current round of model training; Δt i is the gradient adjustment value.
9. A computing device comprising a memory and a processor, the memory having stored therein executable code, the processor implementing the method of any one of claims 1-6 when executing the executable code.
Citation Information
Patent Citations
Multi-task model training method and system based on distributed data
CN111813869A
Multi-site three-dimensional image-oriented federated deep learning method and system
CN112686385A