Machine learning model training method and apparatus, device, and storage medium

By selecting machine learning models that meet approximate conditions in federated learning and performing weighted averaging, the problem of low training efficiency caused by server-side devices fusing all models is solved, achieving a more efficient training process.

CN114091689BActive Publication Date: 2026-06-02WEBANK (CHINA)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WEBANK (CHINA)
Filing Date
2021-11-30
Publication Date
2026-06-02

Smart Images

  • Figure CN114091689B_ABST
    Figure CN114091689B_ABST
Patent Text Reader

Abstract

The application provides a training method and device of a machine learning model, equipment, a computer readable storage medium and a computer program product; the method comprises the following steps: receiving a plurality of training end devices respectively sending trained machine learning models; wherein the training end device is trained on the basis of the machine learning model sent by the server device; determining the test result of each trained machine learning model, and determining at least two trained machine learning models meeting the approximate condition from the plurality of trained machine learning models according to the test result; and performing fusion processing on the at least two trained machine learning models to obtain a fused machine learning model. Through the application, the training efficiency of the machine learning model can be effectively improved.
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, apparatus, device, computer-readable storage medium, and computer program product for training a machine learning model. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0003] In existing federated learning solutions, the server-side device often needs to fuse the trained machine learning models sent by all the training devices. When the number of trained machine learning models sent by the training devices is large, the fusion process becomes extremely time-consuming, severely impacting training efficiency. Currently, there is no effective solution to improve the training efficiency of machine learning models. Summary of the Invention

[0004] This application provides a method, apparatus, computer-readable storage medium, and computer program product for training a machine learning model, which can effectively improve the training efficiency of machine learning models.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a method for training a machine learning model, including:

[0007] The system receives trained machine learning models sent by multiple training devices, wherein the training devices train the models based on the machine learning models sent by the server device.

[0008] Determine the test result for each of the trained machine learning models, and based on the test result, determine at least two trained machine learning models from the plurality of trained machine learning models that satisfy the approximation condition;

[0009] The at least two trained machine learning models are fused to obtain a fused machine learning model.

[0010] This application provides a training apparatus for a machine learning model, comprising:

[0011] A receiving module is used to receive trained machine learning models sent by multiple training terminal devices respectively; wherein the training terminal devices are trained based on the machine learning models sent by the server device;

[0012] A determining module is used to determine the test result of each of the trained machine learning models, and to determine at least two trained machine learning models that satisfy the approximation conditions from the plurality of trained machine learning models based on the test results.

[0013] The fusion module is used to fuse the at least two trained machine learning models to obtain a fused machine learning model.

[0014] In the above scheme, the training device for the machine learning model further includes: a sending module, used to send the fused machine learning model to the plurality of training terminal devices; wherein the fused machine learning model is used as the basis for the plurality of training terminal devices to perform the next training.

[0015] In the above scheme, the determining module is used to call the multiple trained machine learning models based on the test samples to obtain the test results of each trained machine learning model.

[0016] In the above scheme, the determining module is further configured to determine at least two test results that satisfy the approximation condition from the test results of each of the trained machine learning models; and to determine the trained machine learning models corresponding to the at least two test results as at least two trained machine learning models that satisfy the approximation condition.

[0017] In the above scheme, the determining module is further configured to perform the following processing on any one of the trained machine learning models sent by the training terminal device: determine the approximate distance between the test result of the trained machine learning model and the test result of each trained machine learning model; determine at least two trained machine learning models corresponding to approximate distances less than the approximate distance threshold, and determine at least two test results that satisfy the approximate conditions.

[0018] In the above scheme, the determining module is further configured to sort the approximate distances between the trained machine learning model and the test results of each trained machine learning model in ascending order to obtain an approximate distance sequence; compare the approximate distances in the approximate distance sequence with the approximate distance threshold in turn; when the approximate distances in the sorted approximate distance sequence are greater than the approximate distance threshold, determine at least two approximate distances in the approximate distance sequence that have been compared with the approximate distance threshold, and determine the test results of the trained machine learning models corresponding to the at least two approximate distances as at least two test results that satisfy the approximation condition.

[0019] In the above scheme, the fusion module is further configured to determine the weights of the at least two trained machine learning models based on the approximate distance between the test results of the at least two trained machine learning models; wherein the weight of each trained machine learning model is negatively correlated with the corresponding approximate distance; and based on the weights of the at least two trained machine learning models, a weighted average is performed on the at least two trained machine learning models to obtain the fused machine learning model.

[0020] In the above scheme, the training device for the machine learning model further includes: a comparison module, used to compare the training end corresponding to the at least two trained machine learning models that satisfy the approximation conditions with the training end corresponding to the at least two trained machine learning models that satisfy the approximation conditions, determined based on the test results after the previous training on the multiple training end devices; when the comparison processing results are consistent, the fused machine learning model determined after the previous training on the multiple training end devices is determined as the fused machine learning model determined after the current training on the multiple training end devices; when the comparison processing results are inconsistent, the step of performing fusion processing on the at least two trained machine learning models is initiated.

[0021] In the above scheme, the training device for the machine learning model further includes: a convergence module, used to send a convergence message to the plurality of training end devices when the comparison processing results are consistent; wherein, the convergence message is used to characterize the convergence of the fused machine learning model; when the comparison processing results are inconsistent, the step of sending the fused machine learning model to the plurality of training end devices is executed.

[0022] In the above scheme, the training device for the machine learning model further includes: a request receiving module, used to receive machine learning model acquisition requests sent by the plurality of training terminal devices respectively; and to send the machine learning model to the plurality of training terminal devices respectively.

[0023] This application provides a training apparatus for a machine learning model, comprising:

[0024] The training module is used to receive the machine learning model sent by the server device, train the machine learning model, and obtain the trained machine learning model.

[0025] The sending module is used to send the trained machine learning model to the server device; wherein, the trained machine learning model is used for the server device to determine at least two trained machine learning models that meet the approximate conditions based on the corresponding test results, and to perform fusion processing on the at least two trained machine learning models to obtain a fused machine learning model.

[0026] A receiving module is used to receive the fused machine learning model sent by the server device; wherein the fused machine learning model is used as the basis for the next training by the training device.

[0027] This application provides a training apparatus for a machine learning model, comprising:

[0028] Memory, used to store executable instructions;

[0029] The processor, when executing executable instructions stored in the memory, implements the training method of the machine learning model provided in the embodiments of this application.

[0030] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the training method of the machine learning model provided in this application.

[0031] This application 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 machine learning model training method described above in this application.

[0032] The embodiments of this application have the following beneficial effects:

[0033] Compared to existing federated learning solutions that require fusing all trained machine learning models sent by all training devices, this application effectively filters trained machine learning models through approximation conditions, thus eliminating the need to fuse all trained machine learning models sent by all training devices simultaneously. This effectively reduces the number of trained machine learning models sent by training devices that need to be fused, thereby saving time in the fusion process and improving the training efficiency of machine learning models. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the structure of the training system architecture for the machine learning model provided in the embodiments of this application;

[0035] Figures 2A to 2B This is a schematic diagram of the structure of the training device for the machine learning model provided in the embodiments of this application;

[0036] Figures 3A to 3E This is a flowchart illustrating the training method for the machine learning model provided in the embodiments of this application;

[0037] Figures 4A to 4B This is a schematic diagram illustrating the principle of the training method for the machine learning model provided in the embodiments of this application;

[0038] Figure 5 This is a schematic diagram of the interactive process of the training method for the machine learning model provided in the embodiments of this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0040] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0042] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0043] 1) Machine Learning Models: Artificial intelligence models used for machine learning. Machine learning models involve related theories such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. They are artificial intelligence models used to simulate or implement human learning behavior through computers to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.

[0044] 2) Training device: The device used to train machine learning models. The training device can be a server or a terminal.

[0045] 3) Server-side equipment: Equipment used to provide services to training equipment, wherein the server-side equipment can be a server or a terminal.

[0046] 4) Federated Learning: This refers to a method of machine learning that combines different participants (or parties, also known as data owners or clients) for collaborative learning. In federated learning, participants do not need to expose their data to other participants or the coordinator (also known as a parameter server or aggregation server), thus effectively protecting user privacy and ensuring data security. Horizontal federated learning, in particular, involves extracting the data from participants with similar characteristics but less overlap in user data features, and then performing joint machine learning on this portion of the data. For example, consider two banks in different regions, each with a user base from their respective areas and minimal overlap. However, their businesses are similar, and their recorded user data features are largely the same. Horizontal federated learning can be used to help the two banks build a joint model to predict their customer behavior.

[0047] Federated learning is a distributed training paradigm based on data privacy protection. It ensures the collaborative training of a machine learning model without requiring the data to leave the local machine. However, each client in a federated learning model may have significant differences in data distribution and quantity. This can lead to suboptimal results after model aggregation.

[0048] In related technical solutions, clustering is mainly used to group clients into clusters, and only clients in the same group (training end) are aggregated. However, this approach requires pre-clustering of clients (training end), which is a relatively long process and thus reduces the training efficiency of federated learning.

[0049] This application provides a method, apparatus, device, computer-readable storage medium, and computer program product for training machine learning models, which can effectively improve the training efficiency of machine learning models. The exemplary application of the machine learning model training device provided in this application is described below. The device provided in this application can be implemented as various types of user terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or as a server. Exemplary applications when the device is implemented as a terminal or server will be described below.

[0050] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the machine learning model training system 100 provided in the embodiments of this application. In order to support the training application of a machine learning model, the training end devices (exemplarily shown are training end devices 200-1, training end devices 200-2... training end devices 200-n) (for example, different training end devices belong to different training parties, such as different individuals / enterprises / organizations, that is, training end devices 200-1, training end devices 200-2... training end devices 200-n belong to different individuals / enterprises / organizations) are connected to the server end device 400 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of both.

[0051] In some embodiments, training devices 200-1, 200-2, ..., 200-n train machine learning models and send the trained machine learning models to server device 400. Server device 400 performs fusion processing on the received partial trained machine learning models to obtain a fused machine learning model, and sends the fused machine learning model to training devices 200-1, 200-2, ..., 200-n.

[0052] In some embodiments, the server device 400 (e.g., different server devices belong to different service providers, such as different organizations) can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. It can also be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.

[0053] See Figure 2A , Figure 2AThis is a schematic diagram of the structure of the server device 400 for the machine learning model training method provided in this application embodiment. Figure 2A The server device 400 shown includes at least one processor 410, a memory 450, and at least one network interface 420. The various components in the server device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2A The general labeled all buses as Bus System 440.

[0054] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0055] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.

[0056] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.

[0057] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0058] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0059] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0060] In some embodiments, the training apparatus for the machine learning model provided in this application can be implemented in software. Figure 2A A training apparatus 455 for a machine learning model stored in memory 450 is shown. This apparatus can be software in the form of programs and plug-ins, and includes the following software modules: a receiving module 4551, a determining module 4552, a fusing module 4553, and a transmitting module 4554. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0061] See Figure 2B , Figure 2B This is a schematic diagram of the structure of the training terminal device 200 for the machine learning model training method provided in this application embodiment. Figure 2B The training device 200 shown includes at least one processor 210, a memory 250, and at least one network interface 220. The various components in the training device 200 are coupled together via a bus system 220. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2B The general labeled all buses as Bus System 240.

[0062] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0063] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.

[0064] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.

[0065] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0066] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0067] The network communication module 252 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).

[0068] In some embodiments, the training apparatus for the machine learning model provided in this application can be implemented in software. Figure 2B A training apparatus 255 for a machine learning model stored in memory 250 is shown. This apparatus can be software in the form of programs and plug-ins, and includes the following software modules: a training module 2551, a transmitting module 2552, and a receiving module 2553. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0069] In other embodiments, the training device for the machine learning model provided in this application can be implemented in hardware. As an example, the training device for the machine learning model provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the training method of the machine learning model provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0070] The training method of the machine learning model provided in this application will be described by referring to the exemplary application and implementation of the server device provided in the embodiments of this application, wherein the execution subject of the server device can be a terminal or a server.

[0071] In some embodiments, see Figure 4A , Figure 4A This is a schematic diagram illustrating the principle of a machine learning model training method provided in an embodiment of this application. The machine learning model training method provided in this embodiment can be achieved through, for example... Figure 4A The training network implementation of the machine learning model is shown. The training network includes training devices C1, C2, C3, C4, and C5, and a server device S. Training devices C1, C2, C3, C4, and C5 are used to train the machine learning model, while server device S is used to fuse the trained machine learning model. The machine learning model is trained on the training devices, and then the trained machine learning model is fused on the server device, thus completing one training cycle. The fused machine learning model on the server device is then sent back to the training devices for further training. The server does not need to fuse all models uploaded from the training devices simultaneously, thus significantly improving the training efficiency of the machine learning model.

[0072] In some embodiments, see Figure 3A , Figure 3A This is a flowchart illustrating the training method of the machine learning model provided in this application embodiment, which uses the server-side device provided in this application embodiment as the execution entity. Figure 3A Steps 101 to 103 are illustrated below. The execution entity of the server device can be a terminal or a server.

[0073] In step 101, the trained machine learning models sent by multiple training devices are received respectively; wherein the training devices are trained based on the machine learning models sent by the server devices.

[0074] As an example, see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a machine learning model training system provided in this application embodiment. The server device 400 receives trained machine learning models sent by multiple training devices 200 respectively; wherein, the training devices 200 train based on the machine learning models sent by the server device 400. That is, the server device 400 sends a machine learning model to the training devices 200, and the training devices 200 train the received machine learning model to obtain a trained machine learning model. The training devices 200 then send the trained machine learning model to the server device 400, and the server device 400 receives the trained machine learning models sent by the multiple training devices 200 respectively.

[0075] The execution entity of the server-side device 400 can be a server or a terminal, and the execution entity of the training-side device 200 can be a server or a terminal.

[0076] For example, the number of training devices can be n. Figure 1 The diagram schematically represents three training devices, i.e., n≥3, meaning that multiple training devices can be more than three training devices.

[0077] In some embodiments, prior to step 101 above, the machine learning model can also be sent to the training devices in the following manner: the server device receives machine learning model acquisition requests sent by multiple training devices respectively, and then sends the machine learning model to the multiple training devices respectively.

[0078] As an example, see Figure 1 The server device 400 receives machine learning model acquisition requests sent by multiple training devices (200-1, 200-2, ..., 200-n), and sends machine learning models to the multiple training devices (200-1, 200-2, ..., 200-n).

[0079] In step 102, the test result of each trained machine learning model is determined, and at least two trained machine learning models that meet the approximation conditions are determined from multiple trained machine learning models based on the test results.

[0080] As an example, see Figure 1The server device 400 determines the test result of each trained machine learning model. This determination can be achieved by retrieving the test result from the training device 200, or by calling each trained machine learning model based on test samples to obtain the test result for each model. Based on the test results, the server device 400 determines at least two trained machine learning models from among the multiple trained models that satisfy the approximate conditions.

[0081] In some embodiments, see Figure 3B , Figure 3B This is a flowchart illustrating the training method for the machine learning model provided in this application embodiment. Figure 3B Step 102 shown can be implemented through steps 1021 to 1023.

[0082] In step 1021, multiple trained machine learning models are invoked based on the test samples to obtain the test results of each trained machine learning model.

[0083] The test samples can be pre-stored on the server-side device. The format of the test samples is the same as that of the training samples used to train the machine learning model, which are stored on the training-side device.

[0084] As an example, see Figure 4B , Figure 4B This is a schematic diagram illustrating the principle of the training method for the machine learning model provided in this application embodiment. Based on the test samples, multiple trained machine learning models are called respectively to obtain the test results p1, p2, p3, p4, p5, p6, p7, p8, and p9 for each trained machine learning model.

[0085] In step 1022, at least two test results that satisfy the approximation conditions are determined from the test results of each trained machine learning model.

[0086] The number of at least two test results that satisfy the approximation conditions is no more than the number of all training ends.

[0087] The method for determining whether the approximation condition is met can include comparing the approximate distance between the test result of any trained machine learning model and the test results of every other trained machine learning model with an approximate distance threshold. Here, the test result of any trained machine learning model refers to the test result of the training initiator's training end, and the calculated approximate distance is the approximate distance between the test results of the training initiator's training end and all training ends. In practical applications, after receiving the training request from the training initiator, the server will send the model to the training end, or after determining the training ends participating in the training, it will distribute the model according to the request of the training end.

[0088] The method for determining the approximate distance threshold may include: determining the approximate distance between the test result of any trained machine learning model and the test result of each trained machine learning model, and then taking the average of the approximate distances, or setting the approximate distance before training, etc.

[0089] As an example, see Figure 4B From the test results of each trained machine learning model, at least two test results that satisfy the approximation conditions are determined. For example, the at least two test results that satisfy the approximation conditions are p1, p2, and p3 (three are selected in this embodiment), while the test results that do not satisfy the approximation conditions are p4, p5, p6, p7, p8, and p9.

[0090] In some embodiments, step 1022 above can be implemented in the following way: for any training end device, perform the following processing: determine the approximate distance between the test result of any training end device and the test result of each training end device; determine at least two training end devices corresponding to approximate distances less than the approximate distance threshold, and determine at least two test results that satisfy the approximate conditions.

[0091] For example, approximate distance can be the Euclidean distance, Manhattan distance, Chebyshev distance, angle cosine distance, Hamming distance, etc., between the test results of two trained machine learning models.

[0092] As an example, see Figure 4BTaking a trained machine learning model with test result p2 (i.e., training endpoint C2 is the training initiator) as an example, the approximate distances between the test result p2 of the trained machine learning model and the test results p1, p2, p3, p4, p5, p6, p7, and p8 of each trained machine learning model are determined. The approximate distance between test result p1 and test result p2 is 0. The approximate distance between test result p1 and test result p2 is less than the approximate distance between test result p3 and test result p2, the approximate distance between test result p3 and test result p2 is less than the approximate distance between test result p4 and test result p2, the approximate distance between test result p5 and test result p2 is less than the approximate distance between test result p1 and test result p6, and the approximate distance between test result p7 and test result p2 is less than the approximate distance between test result p6 and test result p2.

[0093] As an example, taking a trained machine learning model with a test result of p2 as an example, determine the approximate distance between the test result p2 of the trained machine learning model and the test results p1, p2, p3, p4, p5, p6, p7, and p8 of each trained machine learning model. The approximate distance between the test result p2 of the trained machine learning model and the test result p2 of the trained machine learning model is the smallest approximate distance, which is less than the approximate distance threshold.

[0094] As an example, see Figure 4B When the approximate distance between test results p2 and p5 of the trained machine learning model is less than the approximate distance threshold, the approximate distance between test result p2 and all other test results, except for the approximate distances between test results p2 and p6, and between test results p2 and p8, is less than the approximate distance threshold. Therefore, at least two test results satisfying the approximation condition are identified as p1, p2, p3, p4, p5, p7, and p9. The at least two trained machine learning models corresponding to these approximate distances less than the approximate distance threshold can be the trained machine learning models corresponding to test results p1, p2, p3, p4, p5, p7, and p9.

[0095] In this way, based on the approximation condition, some trained machine learning models are selected from multiple trained machine learning models, and then the selected trained machine learning models are fused together, thereby significantly reducing the time spent training machine learning models and effectively improving the training efficiency of machine learning models.

[0096] In some embodiments, the determination of at least two trained machine learning models corresponding to approximate distances less than the approximate distance threshold can be achieved by: sorting the approximate distances between the trained machine learning models and the test results of each trained machine learning model in ascending order to obtain an approximate distance sequence; comparing the approximate distances in the approximate distance sequence with the approximate distance threshold in turn; when the approximate distances in the sorted approximate distance sequence are greater than the approximate distance threshold, determining at least two approximate distances in the approximate distance sequence that have been compared with the approximate distance threshold, and determining the test results of the trained machine learning models corresponding to the at least two approximate distances as at least two test results that satisfy the approximate condition.

[0097] As an example, see Figure 4B Taking the trained machine learning model with a test result of p2 as an example, the approximate distances between the trained machine learning model with a test result of p2 and the test results of each trained machine learning model are sorted in ascending order to obtain the approximate distance sequence D. p2p2 D p2p3 D p2p1 D p2p9 D p2p4 D p2p7 D p2p5 D p2p8 D p2p6 The approximate distances in the approximate distance sequence are compared sequentially with an approximate distance threshold; the comparison process stops when any approximate distance in the sorted approximate distance sequence begins to exceed the approximate distance threshold (e.g., D). p2p2 D p2p3 D p2p1 The approximate distance is less than the approximate distance threshold when D p2p9 If the approximate distance is greater than the approximate distance threshold, the comparison process stops; that is, the approximate distance D... p2p4 D p2p7 D p2p5 D p2p8 D p2p6 (No further comparison processing is needed). When the approximate distance D in the sorted approximate distance sequence... p2p9 When the distance is greater than the approximate distance threshold, determine at least two approximate distances D in the approximate distance sequence that have been compared with the approximate distance threshold. p2p2 D p2p3 D p2p1 (In this embodiment, three are selected; in other embodiments, the two closest ones can be selected.) At least two approximate distances D p2p2 D p2p3 D p2p1 The test results of the corresponding trained machine learning model are determined to be at least two test results that satisfy the approximation conditions.

[0098] Thus, by sorting the approximate distances in ascending order to obtain the approximate distance sequence, when selecting some trained machine learning models from multiple trained machine learning models, it is only necessary to judge the first few approximate distances in the approximate distance sequence that meet the approximate conditions, instead of judging every approximate distance in the entire approximate distance sequence. This effectively saves the training time of the machine learning model and effectively improves the training efficiency of the machine learning model.

[0099] In other embodiments, the approximate distances between the test results may not need to be sorted; it is sufficient to select at least two test results with the smallest approximate distance.

[0100] In step 1023, the trained machine learning models corresponding to at least two test results that satisfy the approximation condition are determined as at least two trained machine learning models that satisfy the approximation condition.

[0101] As an example, see Figure 4A and Figure 4B The trained machine learning models corresponding to test results p1, p2, and p3 are trained by training devices C1, C2, and C3, respectively. When the test results that satisfy the approximation conditions are determined to be p1, p2, and p3, the trained machine learning models corresponding to test results p1, p2, and p3 (i.e., the corresponding trained machine learning models trained by training devices C1, C2, and C3) are determined to be trained machine learning models that satisfy the approximation conditions.

[0102] In step 103, at least two trained machine learning models are fused to obtain a fused machine learning model.

[0103] As an example, see Figure 1 The server-side device 400 performs a fusion process on at least two trained machine learning models to obtain a fused machine learning model. The server-side device 400 may perform a fusion process on the corresponding model parameters of at least two trained machine learning models to obtain the parameters of the fused machine learning model, and then construct a corresponding fused machine learning model based on the parameters of the fused machine learning model.

[0104] In some embodiments, see Figure 3C , Figure 3C This is a flowchart illustrating the training method for the machine learning model provided in this application embodiment. Figure 3C Step 103 shown can be implemented through steps 1031 to 1032.

[0105] In step 1031, the weights of at least two trained machine learning models are determined based on the approximate distance between the test results of at least two trained machine learning models; wherein the weight of each trained machine learning model is negatively correlated with the corresponding approximate distance.

[0106] As an example, see Figure 4B Based on the approximate distance between the test results of at least two trained machine learning models (e.g., D... p2p2 D p2p3 D p2p1 This determines the weights of at least two trained machine learning models. See also Figure 4B It can be known that D p2p2 <D p2p3 <D p2p1 Since the weights of each trained machine learning model are negatively correlated with the corresponding approximate distance, it can be seen that the weights of the trained machine learning model corresponding to test result p1 are less than the weights of the trained machine learning model corresponding to test result p3.

[0107] In step 1032, a weighted average is performed on at least two trained machine learning models based on their weights to obtain a fused machine learning model.

[0108] In some embodiments, the weighted average of at least two trained machine learning models to obtain a fused machine learning model can be achieved by: performing a weighted average of the model parameters of at least two trained machine learning models to obtain fused model parameters, and constructing a fused machine learning model based on the fused model parameters.

[0109] As an example, see Figure 4B The weight of the trained machine learning model corresponding to test result p1 is less than the weight of the trained machine learning model corresponding to test result p3. A weighted average is then performed on the trained machine learning models corresponding to test results p1, p2, and p3, where the weights for these models are different. For example, an exemplary mathematical expression for the weighted average is as follows:

[0110]

[0111] Among them, f t Indicates the fused machine learning model, This indicates the trained machine learning model corresponding to test result p1. This indicates the trained machine learning model corresponding to test result p2. This represents the trained machine learning model corresponding to test result p3.

[0112] Thus, by determining the approximate distance between the test results of at least two trained machine learning models, the weights of at least two trained machine learning models are determined, with larger weights for closer approximate distances. A weighted average is then performed based on these determined weights, resulting in a higher weight for the superior machine learning model in the fused model, effectively improving the performance of the fused machine learning model.

[0113] In some embodiments, see Figure 3D Before step 103, steps 105 to 107 can be executed to determine whether the performance of the trained machine learning model tends to be stable, that is, whether the training results converge. Examples are given below.

[0114] In step 105, the training endpoints corresponding to at least two trained machine learning models that satisfy the approximation conditions are compared with the training endpoints corresponding to at least two trained machine learning models that satisfy the approximation conditions, determined based on the test results after the last training on multiple training endpoint devices.

[0115] As an example, see Figure 4B If the training endpoints corresponding to at least two trained machine learning models that meet the approximation conditions are C1, C2, and C3, then the training endpoints determined this time can be compared with the training endpoints corresponding to at least two historical trained machine learning models that meet the approximation conditions, which were determined based on the test results of the previous training on multiple training endpoint devices. This comparison process can then determine whether the training endpoints corresponding to at least two historical trained machine learning models that meet the approximation conditions are consistent between the two training sessions.

[0116] In step 106, when the comparison results are consistent, the fused machine learning model determined after one training session on multiple training devices is determined as the fused machine learning model determined after the current training session on multiple training devices.

[0117] As an example, see Figure 4BAssuming that the at least two trained machine learning models satisfying the approximation conditions are the trained machine learning models corresponding to test result p1, p3, and p2, when the comparison results are consistent, it indicates that the at least two trained machine learning models satisfying the approximation conditions in the past were the trained machine learning models corresponding to test result p1, p3, and p2. That is, the training endpoints corresponding to the current at least two trained machine learning models are consistent with the training endpoints corresponding to the at least two trained machine learning models satisfying the approximation conditions determined based on the test results of the previous training on multiple training endpoints. This indicates that the performance of the models in the two training sessions has stabilized, meaning the training results have converged. Therefore, the fused machine learning model determined after the previous training is identified as the fused machine learning model determined after the current training on multiple training endpoints.

[0118] It is understood that in other embodiments, the number of training iterations can also be used as the convergence condition for ending training. That is, when the number of training iterations reaches a preset number, training ends and the latest fusion model is used as the final training model.

[0119] In step 107, if the comparison results are inconsistent, the process proceeds to the step of fusing at least two trained machine learning models.

[0120] As an example, see Figure 4B Assuming that the at least two trained machine learning models are the machine learning models corresponding to test result p1, p3, and p2, respectively, if the comparison results are inconsistent, it indicates that the training endpoints corresponding to the two test results that satisfy the approximation conditions are inconsistent. That is, the current at least two trained machine learning models and the historical at least two trained machine learning models determined based on the test results of the previous training on multiple training endpoints have significantly different model performance. In this case, since the comparison processing results are inconsistent, it indicates that no machine learning models with similar performance have been fused, and there is no fused machine learning model with similar performance among the currently determined at least two trained machine learning models. Therefore, the current at least two trained machine learning models need to be further processed, that is, the step of fusing the at least two trained machine learning models needs to be performed, i.e., step 103 is to perform the fusion processing.

[0121] Thus, by comparing the training endpoints corresponding to at least two trained machine learning models that meet the approximation conditions with the training endpoints corresponding to at least two trained machine learning models determined based on the test results of the previous training on multiple training endpoint devices, it is possible to determine whether the training endpoints corresponding to the test results that meet the approximation conditions in the two consecutive tests are consistent, and whether the performance of the trained machine learning model tends to stabilize. If the comparison results are consistent, it indicates that the performance of the trained machine learning model tends to stabilize; if the comparison results are inconsistent, it indicates that the performance of the trained machine learning model is not yet good enough and needs to be trained again. This effectively determines the timing of terminating the training of the machine learning model and effectively improves the training efficiency of the machine learning model.

[0122] In some embodiments, see Figures 3B to 3D After step 103, the fused machine learning model can be sent by executing step 104, which will be explained below.

[0123] In step 104, the fused machine learning model is sent to multiple training devices.

[0124] The fused machine learning model can be used as the basis for the next training run on multiple training devices.

[0125] As an example, see Figure 1 The server device 400 sends the fused machine learning model to multiple training devices 200. The fused machine learning model is used as the basis for the next training by the multiple training devices 200. That is, when other training devices initiate training requests, the server device 400 sends the fused machine learning model to the multiple training devices 200. After receiving the fused machine learning model, the training devices 200 continue to train the fused machine learning model.

[0126] In some embodiments, see Figure 3D Before step 104, convergence messages are sent to multiple training devices by executing steps 108 to 109, which will be explained below.

[0127] In step 108, when the comparison results are consistent, a convergence message is sent to multiple training devices;

[0128] The convergence message indicates that the fused machine learning model has converged and will no longer be sent to the training device for further training.

[0129] As an example, if the training device is also an electronic device (such as a server) used by the training party to support its own business, the server device can send the fused machine learning model to the training device for the training device to apply to the corresponding business scenario.

[0130] As an example, see Figure 4B Suppose that the at least two trained machine learning models that satisfy the approximation conditions are the trained machine learning model corresponding to test result p1, the trained machine learning model corresponding to test result p3, and the trained machine learning model corresponding to test result p2. When the comparison results are consistent, it means that the at least two historical trained machine learning models that satisfy the approximation conditions are the trained machine learning models corresponding to test result p1, the trained machine learning models corresponding to test result p3, and the trained machine learning models corresponding to test result p2. That is, the current at least two trained machine learning models are trained machine learning models with similar performance to the at least two historical trained machine learning models determined based on the test results of the last training on multiple training devices. At this point, since the comparison results are consistent, it indicates that there are already fusion processes performed on trained machine learning models with similar performance, and at least two trained machine learning models currently identified already have fused machine learning models with similar performance. Therefore, it is not necessary to perform further processing on the at least two trained machine learning models currently identified. That is, it is not necessary to send the fused machine learning model after the last training to multiple training devices (because the latest fused machine learning model has already been stored in multiple training devices). Multiple training devices can directly use the fused machine learning model previously distributed by the server, thereby significantly reducing communication costs.

[0131] As an example, see Figure 1 When the comparison results are consistent, the server device 400 sends convergence messages to multiple training devices (200-1, 200-2, ..., 200-n). These convergence messages represent the convergence of the fused machine learning model, and the server device 400 will no longer send the fused machine learning model to the training devices (200-1, 200-2, ..., 200-n) for continued training. If the training devices (200-1, 200-2, ..., 200-n) are also electronic devices (e.g., servers) used by the training side to support their own business, the server device 400 can send the fused machine learning model to the training devices (200-1, 200-2, ..., 200-n) for application in their respective business scenarios.

[0132] In step 109, if the comparison results are inconsistent, the process proceeds to sending the fused machine learning model to multiple training devices.

[0133] As an example, see Figure 4B Assuming that the determined at least two trained machine learning models are the trained machine learning model corresponding to test result p1, the trained machine learning model corresponding to test result p3, and the trained machine learning model corresponding to test result p2, if the comparison results are inconsistent, it means that the training end corresponding to the at least two test results that meet the approximation conditions after the two training sessions are inconsistent. That is, the current at least two trained machine learning models and the historical at least two trained machine learning models that meet the approximation conditions determined based on the test results of the previous training on multiple training end devices are trained machine learning models with large performance differences. In other words, there is no fused machine learning model with similar performance in the training end devices. Therefore, it is necessary to send the fused machine learning model to multiple training end devices.

[0134] Thus, when the comparison results are consistent, a convergence message is sent to multiple training devices to notify them that the machine learning model has been trained, thereby significantly improving the training efficiency of collaborative training between the training devices and the server devices.

[0135] In some embodiments, see Figure 3E , Figure 3E This is a flowchart illustrating the training method for the machine learning model provided in this application embodiment, which uses the training terminal device provided in this application embodiment as the execution entity. Figure 3E Steps 201 to 203 are illustrated below. The execution entity of the training device can be a terminal or a server.

[0136] In step 201, the machine learning model sent by the server device is received, and the machine learning model is trained to obtain the trained machine learning model.

[0137] As an example, see Figure 1 The training device 200 receives the machine learning model sent by the server device 400, and trains the machine learning model to obtain the trained machine learning model.

[0138] In step 202, the trained machine learning model is sent to the server device; wherein the trained machine learning model is used by the server device to determine at least two trained machine learning models that meet the approximate conditions based on the corresponding test results, and to perform fusion processing on the at least two trained machine learning models to obtain a fused machine learning model.

[0139] As an example, see Figure 1The training device 200 sends the trained machine learning model to the server device 400; wherein, the trained machine learning model and the machine learning model sent by the other training device 200 are used by the server device 400 to determine at least two trained machine learning models that meet the approximate conditions based on the corresponding test results, and to perform fusion processing on the at least two trained machine learning models to obtain the fused machine learning model.

[0140] In step 203, the fused machine learning model sent by the server device is received;

[0141] The fused machine learning model can be used as the basis for the next training iteration on the training device.

[0142] As an example, see Figure 1 The training device 200 receives the fused machine learning model sent by the server device 400; the fused machine learning model is used as the basis for the next training by the training device 200.

[0143] Thus, by training machine learning models on multiple training devices, the server device identifies at least two trained machine learning models that meet the approximation conditions from these models. These two models are then fused to obtain the fused machine learning model. Because the server device continuously fuses the fused models during multiple iterations, the performance of the fused model is continuously improved, effectively saving training time on the training devices and significantly increasing the training efficiency of the machine learning model.

[0144] In some embodiments, see Figure 5 , Figure 5 This is a schematic diagram illustrating the interaction flow of the machine learning model training method provided in this application embodiment. The interaction process between the server-side device and the training-side device provided in this application embodiment will be used to illustrate... Figure 5 Steps 301 to 307 are described below.

[0145] In step 301, the machine learning model is sent.

[0146] As an example, server device 400 sends a machine learning model to training device 200.

[0147] In step 302, the machine learning model is trained to obtain the trained machine learning model.

[0148] As an example, training device 200 trains a machine learning model to obtain the trained machine learning model.

[0149] In step 303, the trained machine learning model is sent.

[0150] As an example, the training device 200 sends the trained machine learning model to the server device 400.

[0151] In step 304, each trained machine learning model is called based on the test sample to obtain the test result for each trained machine learning model, and at least two trained machine learning models that meet the approximation conditions are determined from multiple trained machine learning models.

[0152] As an example, the server device 400 calls each trained machine learning model based on the test sample, obtains the test result for each trained machine learning model, and determines at least two trained machine learning models that meet the approximation conditions from multiple trained machine learning models.

[0153] In step 305, at least two trained machine learning models are fused to obtain a fused machine learning model.

[0154] As an example, server device 400 performs fusion processing on at least two trained machine learning models to obtain a fused machine learning model.

[0155] In step 306, the fused machine learning model is sent.

[0156] As an example, server device 400 sends the fused machine learning model to training device 200.

[0157] In step 307, the fused machine learning model is trained.

[0158] As an example, the training device trains 200 fusion machine learning models. It is understandable that... Figure 5 This is one round of iterative training of the machine learning model training method provided in the embodiments of this application. In practical applications, it involves multiple rounds of iterative training.

[0159] After explaining the training method of the machine learning model provided in the embodiments of this application, the application of the trained machine learning model will be explained next. Here, the trained machine learning model can be used for urban traffic prediction, that is, to predict the number of congested vehicles on a target road segment in a target area within a target time period in the future. Specifically, the actual parameter values ​​of predictable parameters are obtained, such as population travel trajectories, office area distribution, and holiday times in the target area. Here, the target area can be different central areas of the city. In actual implementation, the obtained population travel trajectories, office area distribution, and holiday times of the target area are input into the trained machine learning model, which can predict the number of congested vehicles on the target road segment in the target area within the target time period. Thus, after obtaining the specific predictable parameter values, compared with an untrained machine learning model, the trained machine learning model can accurately predict the congestion situation of the target road segment in the target area within the target time period, thereby enabling timely traffic control.

[0160] The machine learning model training method provided in the above embodiments of this application, compared with the related technology where the machine learning model can only be trained by the training end device alone, integrates the parameters of the trained machine learning models sent by multiple training end devices by the server device to obtain a fused machine learning model, and then performs multiple rounds of training on the fused machine learning model by the training end device, thereby obtaining a machine learning model that better matches the simulation results with the real data, and effectively improving the training efficiency of the machine learning model.

[0161] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0162] In a horizontal federated learning scenario, the datasets of each participant share the same feature space but have different sample spaces. For example, the customer groups of two banks in different regions may have very little overlap, meaning that the datasets of these two banks have different sample spaces. In a horizontal federated learning scenario, there is typically one collaborator and at least two participants. That is, the training of the model is jointly implemented by one collaborator device (i.e., the server-side device mentioned above) and at least two participant devices (i.e., the training-side devices mentioned above). Both the participant devices (i.e., the training-side devices mentioned above) and the collaborator devices (i.e., the server-side devices mentioned above) can be servers or terminals.

[0163] Federated learning is a distributed training paradigm based on data privacy protection. It ensures the collaborative training of a machine learning model without requiring the data to leave the local machine. However, each client in a federated learning model may have significant differences in data distribution and quantity. This can lead to suboptimal results after model aggregation.

[0164] In related technical solutions, clustering is mainly used to group clients into clusters, and only clients in the same group (i.e., the training devices mentioned above) are aggregated (i.e., fused as mentioned above). However, this approach requires pre-clustering of clients (i.e., the training devices mentioned above), which is a relatively long process and thus reduces the training efficiency of federated learning.

[0165] The machine learning model training method provided in this application embodiment can adaptively determine which training ends to aggregate during federated learning training.

[0166] The training method for the machine learning model provided in this application embodiment is applicable to scenarios in which federated training is initiated by a training terminal device in horizontal federated learning.

[0167] See Figure 4A , Figure 4A This is a schematic diagram illustrating the principle of the training method for the machine learning model provided in this application embodiment. Figure 4A In this process, the training device C2 is the initiator and has a copy of the test data T stored in the server device S in advance.

[0168] Step 1: The training device C2 sends a federated learning training request (i.e., the machine learning model acquisition request mentioned above) to the server device S.

[0169] Step 2: The server device S sends the initial machine learning model f0 to the training devices C1, C2, C3, C4, and C5.

[0170] Step 3: After receiving the initial machine learning model f0, the training devices C1, C2, C3, C4, and C5 train the initial machine learning model f0 respectively to obtain the trained machine learning model. and the trained machine learning model Uploaded to server device S.

[0171] Step four: The server device S receives the trained machine learning models uploaded by the training devices C1, C2, C3, C4, and C5. Then, using a set of test data T previously stored in the server device S, each trained machine learning model is tested. Conduct testing. Specifically, determine the model uploaded by the initiator (i.e., the training device C2). The performance on the test data T is denoted as p2. Then, the performance of the model uploaded by the other training devices C1, C3, C4, and C5 is recorded.

[0172] As an example, see Figure 4B , Figure 4BThis is a schematic diagram illustrating the principle of the training method for the machine learning model provided in the embodiments of this application. For example, from... Figure 4B In the image, you can see the model trained by the C3 training device. The performance p3 of training device C2 is closest to the performance p2 of training device C2 after training, while the performance p6 of training device C6 is furthest from the performance p2 of training device C2. Following the order from closest to furthest, training devices C3 and C1 are selected.

[0173] Step 5: Upload the trained machine learning model from training devices C3 and C1 to server device S. The trained machine learning model is uploaded from the training device C2 to the server device S. Aggregation (i.e., the fusion process described above) yields a new global model, which can be aggregated (i.e., the fusion process described above) according to the following expression:

[0174]

[0175] Among them, f t This represents the new global model. This represents the trained machine learning model uploaded from the training device C1 to the server device S. This represents the trained machine learning model uploaded from the training device C2 to the server device S. This represents the trained machine learning model uploaded from the training device C3 to the server device S.

[0176] Step 6, apply the new global model f t The data is then redeployed to training devices C1, C2, C3, C4, and C5 for the next iteration.

[0177] Repeat steps one through six above until the global model converges.

[0178] The following description continues to illustrate the exemplary structure of the training device 455 for the machine learning model provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2AAs shown, the software modules in the training device 455 storing the machine learning model in the memory 450 may include: a receiving module 4551, used to receive trained machine learning models sent by multiple training end devices respectively; wherein, the training end devices are trained based on the machine learning models sent by the server device; a determining module 4552, used to determine the test results of each trained machine learning model, and determine at least two trained machine learning models that meet the approximation conditions from the multiple trained machine learning models based on the test results; and a fusion module 4553, used to perform fusion processing on the at least two trained machine learning models to obtain a fused machine learning model.

[0179] In some embodiments, the training apparatus 455 for the machine learning model further includes a sending module 4554 for sending the fused machine learning model to multiple training end devices; wherein the fused machine learning model is used as the basis for the next training by the multiple training end devices.

[0180] In some embodiments, the determining module 4552 is used to call multiple trained machine learning models based on the test samples to obtain the test results of each trained machine learning model.

[0181] In some embodiments, the determining module 4552 is further configured to determine at least two test results that satisfy the approximation condition from the test results of each trained machine learning model; and to determine the trained machine learning models corresponding to the at least two test results as at least two trained machine learning models that satisfy the approximation condition.

[0182] In some embodiments, the determining module 4552 is further configured to perform the following processing on the trained machine learning model sent by any training terminal device: determine the approximate distance between the test result of the trained machine learning model and the test result of each trained machine learning model; determine at least two trained machine learning models corresponding to approximate distances less than an approximate distance threshold, and determine at least two test results that satisfy the approximate conditions.

[0183] In some embodiments, the determining module 4552 is further configured to sort the approximate distances between the trained machine learning models and the test results of each trained machine learning model in ascending order to obtain an approximate distance sequence; compare the approximate distances in the approximate distance sequence with an approximate distance threshold in turn; when the approximate distances in the sorted approximate distance sequence are greater than the approximate distance threshold, determine at least two approximate distances in the approximate distance sequence that have been compared with the approximate distance threshold, and determine the test results of the trained machine learning models corresponding to the at least two approximate distances as at least two test results that satisfy the approximation condition.

[0184] In some embodiments, the fusion module 4553 is further configured to determine the weights of at least two trained machine learning models based on the approximate distance between the test results of at least two trained machine learning models; wherein the weight of each trained machine learning model is negatively correlated with the corresponding approximate distance; and to perform a weighted average on the at least two trained machine learning models based on their weights to obtain a fused machine learning model.

[0185] In some embodiments, the training apparatus 455 for the machine learning model further includes: a comparison module, configured to compare the training endpoints corresponding to at least two trained machine learning models that satisfy the approximation conditions with the training endpoints corresponding to at least two trained machine learning models that satisfy the approximation conditions, determined based on the test results after the previous training on multiple training endpoint devices; when the comparison results are consistent, the fused machine learning model determined after the previous training on multiple training endpoint devices is determined as the fused machine learning model determined after the current training on multiple training endpoint devices; when the comparison results are inconsistent, the process proceeds to the step of performing fusion processing on at least two trained machine learning models.

[0186] In some embodiments, the training apparatus 455 for the machine learning model further includes: a convergence module, configured to send a convergence message to multiple training devices when the comparison processing results are consistent; wherein the convergence message is used to characterize the convergence of the fused machine learning model; and when the comparison processing results are inconsistent, the step of sending the fused machine learning model to multiple training devices is initiated.

[0187] In some embodiments, the training apparatus 455 for the machine learning model further includes: a request receiving module, configured to receive machine learning model acquisition requests sent by multiple training end devices respectively; and send machine learning models to the multiple training end devices respectively.

[0188] In some embodiments, such as Figure 2B As shown in the embodiment of this application, a training device 255 for a machine learning model is provided, including: a training module 2551, used to receive a machine learning model sent by a server device, train the machine learning model, and obtain a trained machine learning model; a sending module 2552, used to send the trained machine learning model to the server device; wherein, the trained machine learning model is used by the server device to determine at least two trained machine learning models that meet the approximate conditions based on the corresponding test results, and to perform a fusion process on the at least two trained machine learning models to obtain a fused machine learning model; a receiving module 2553, used to receive the fused machine learning model sent by the server device; wherein, the fused machine learning model is used as the basis for the training device to perform the next training.

[0189] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the training method of the machine learning model provided in this application.

[0190] This application 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 machine learning model training method described above in this application.

[0191] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute a training method for a machine learning model provided in this application. For example, ... Figure 3A The training method for the machine learning model is shown.

[0192] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEP ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0193] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0194] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborative files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0195] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0196] In summary, the embodiments of this application have the following beneficial effects:

[0197] (1) By training machine learning models on multiple training devices, the server device determines at least two trained machine learning models that meet the approximation conditions from the multiple trained machine learning models, and then performs a fusion process on the at least two trained machine learning models to obtain a fused machine learning model. As the server device continuously fuses the trained machine learning models that meet the approximation conditions during multiple iterations, the performance of the fused machine learning model is continuously improved. At the same time, since the trained machine learning models are effectively screened through the approximation conditions, it is not necessary to fuse all trained machine learning models sent by the training devices, thereby effectively saving the number of trained machine learning models sent by the training devices that need to be fused, thus effectively saving the time consumed in the fusion process and effectively improving the training efficiency of the machine learning model.

[0198] (2) Based on the approximation conditions, some trained machine learning models are selected from multiple trained machine learning models. This is used to further fuse the selected trained machine learning models, thereby significantly reducing the time required to train the machine learning models and effectively improving the training efficiency of the machine learning models.

[0199] (3) By sorting the approximate distances in ascending order to obtain the approximate distance sequence, when selecting some of the trained machine learning models from multiple trained machine learning models, it is only necessary to judge the first few approximate distances in the approximate distance sequence that meet the approximate conditions, instead of judging every approximate distance in the entire approximate distance sequence, thereby effectively saving the training time of the machine learning model and effectively improving the training efficiency of the machine learning model.

[0200] (4) The weights of at least two trained machine learning models are determined based on the approximate distance between their test results. The closer the approximate distance, the larger the weight value. A weighted average is then performed according to the determined weights of the at least two trained machine learning models, so that the machine learning model with better performance has a larger weight in the fused machine learning model, thereby effectively improving the performance of the fused machine learning model.

[0201] (5) By comparing at least two trained machine learning models with at least two historical trained machine learning models determined based on the test results of the previous training on multiple training devices, it is possible to determine whether the performance of the trained machine learning models has stabilized. If the comparison results are consistent, it indicates that the performance of the trained machine learning models has stabilized; if the comparison results are inconsistent, it indicates that the performance of the trained machine learning models is not yet good enough and requires another round of training. This effectively determines the timing for terminating the training of machine learning models and effectively improves the training efficiency of machine learning models.

[0202] (6) When the comparison results are consistent, the training end devices are notified that the machine learning model has been trained by sending a convergence message to multiple training end devices, thereby significantly improving the training efficiency of collaborative training between the training end devices and the server end devices.

[0203] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for training a machine learning model, characterized in that, Applied to server-side devices, the method includes: The system receives trained machine learning models sent by multiple training devices, wherein the training devices train the models based on the machine learning models sent by the server device. Based on the test samples, the multiple trained machine learning models are invoked respectively to obtain the test results of each trained machine learning model. For any trained machine learning model sent by the training terminal device, the following processing is performed: Determine the approximate distance between the test results of the trained machine learning model and the test results of each trained machine learning model; The approximate distances between the trained machine learning models and the test results of each trained machine learning model are sorted in ascending order to obtain an approximate distance sequence. The approximate distances in the approximate distance sequence are compared with the approximate distance thresholds in turn. When the approximate distance in the sorted approximate distance sequence is greater than the approximate distance threshold, at least two approximate distances in the approximate distance sequence that have been compared with the approximate distance threshold are determined, and the test results of the trained machine learning model corresponding to the at least two approximate distances are determined as at least two test results that satisfy the approximation condition. The trained machine learning models corresponding to the at least two test results are determined as at least two trained machine learning models that satisfy the approximation conditions. The at least two trained machine learning models are fused to obtain a fused machine learning model.

2. The method according to claim 1, characterized in that, The step of fusing the at least two trained machine learning models to obtain a fused machine learning model includes: The weights of the at least two trained machine learning models are determined based on the approximate distance between the test results of the at least two trained machine learning models; wherein the weight of each trained machine learning model is negatively correlated with the corresponding approximate distance. Based on the weights of the at least two trained machine learning models, a weighted average is performed on the at least two trained machine learning models to obtain a fused machine learning model.

3. The method according to claim 1, characterized in that, Before fusing the at least two trained machine learning models to obtain a fused machine learning model, the method further includes: The training endpoints corresponding to the at least two trained machine learning models that satisfy the approximation conditions are compared with the training endpoints corresponding to the at least two trained machine learning models that satisfy the approximation conditions, determined based on the test results after the last training on the multiple training endpoint devices. When the comparison results are consistent, the fused machine learning model determined after the previous training on the multiple training devices is determined as the fused machine learning model determined after the current training on the multiple training devices. When the comparison results are inconsistent, the process proceeds to the step of fusing the at least two trained machine learning models.

4. The method according to claim 3, characterized in that, Before sending the fused machine learning model to the plurality of training devices, the method further includes: When the comparison results are consistent, a convergence message is sent to the plurality of training devices; wherein, the convergence message is used to characterize the convergence of the fused machine learning model; When the comparison results are inconsistent, the process proceeds to the step of sending the fused machine learning model to the multiple training devices.

5. The method according to claim 1, characterized in that, Before receiving the trained machine learning models sent by multiple training devices, the method further includes: Receive machine learning model acquisition requests sent by the multiple training terminal devices respectively; The machine learning model is sent to each of the multiple training devices.

6. A training device based on a machine learning model, characterized in that, The device includes: A receiving module is used to receive trained machine learning models sent by multiple training end devices respectively; wherein, the training end devices are trained based on the machine learning models sent by the server device; The determination module is used to call the plurality of trained machine learning models based on test samples to obtain the test results of each trained machine learning model. For any trained machine learning model sent by the training terminal device, the following processing is performed: determining the approximate distance between the test results of the trained machine learning model and the test results of each trained machine learning model; sorting the approximate distances between the trained machine learning model and the test results of each trained machine learning model in ascending order to obtain an approximate distance sequence; comparing the approximate distances in the approximate distance sequence with an approximate distance threshold in turn; when the approximate distance in the sorted approximate distance sequence is greater than the approximate distance threshold, determining at least two approximate distances in the approximate distance sequence that have been compared with the approximate distance threshold, determining the test results of the trained machine learning models corresponding to the at least two approximate distances as at least two test results that satisfy the approximate condition; and determining the trained machine learning models corresponding to the at least two test results as at least two trained machine learning models that satisfy the approximate condition. The fusion module is used to fuse the at least two trained machine learning models to obtain a fused machine learning model.

7. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the training method of the machine learning model according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the training method of the machine learning model according to any one of claims 1 to 5 when executed by a processor.

9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the training method of the machine learning model according to any one of claims 1 to 5.