Federal learning local model credibility verification method based on Internet of Things, client, server, medium and product
By introducing a trusted verification method based on the Internet of Things local model in federated learning, the cosine distance proof documents are generated and verified, and the problem of low reliability of the model performance indicators submitted by the client is solved, and the training effect and performance of the global model are improved.
Patent Information
- Application Number
- CN202510101061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-30
AI Technical Summary
In federated learning, the client-sponsored model performance metrics have low reliability, resulting in global model performance degradation or even failure.
A trustworthy verification method for federated learning local model based on the Internet of Things is proposed. By generating and verifying the cosine distance proof file between the local model and the benchmark model, the client model parameters with reliable performance are filtered out and aggregated to train the global model.
Effectively identify and eliminate dishonest model performance indicators, improve the training effect and performance of the global model, and ensure that the local model parameters participating in the training come from clients with reliable performance.
Smart Images

Figure CN120069004A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed computing technology, and particularly to a method for trusted verification of local models in federated learning based on the Internet of Things, a client, a server, a storage medium, and a computer program product. Background Art
[0002] Federated learning is a distributed learning method that allows clients to train models locally and share model parameters instead of sharing raw data. However, in the process of model aggregation, traditional federated learning does not have a process of screening the local models obtained by client training, and there are model performance indicators of some clients submitting dishonest local models, thus interfering with the training effect of the global model and causing the performance of the global model to decline or even fail. Summary of the Invention
[0003] The main purpose of this application is to provide a method for trusted verification of local models in federated learning based on the Internet of Things, a client, a server, a storage medium, and a computer program product, aiming to solve the technical problem that the low reliability of the model performance indicators submitted by clients leads to poor performance of the global model.
[0004] To achieve the above object, this application proposes a method for trusted verification of local models in federated learning based on the Internet of Things, which is applied to a client. The method includes:
[0005] Generating a proof file of the cosine distance according to the local model, the benchmark model, the cosine distance between the local model and the benchmark model, and the private key, where the benchmark model is obtained by the server training the global model of the previous round through the second data set of the server, and the private key is used to encrypt the calculation process of the cosine distance;
[0006] Sending the public key, the cosine distance between the local model and the benchmark model, and the proof file of the cosine distance to the server, where the public key is used to verify the proof file of the cosine distance;
[0007] Receiving an upload request for local model parameters sent by the server, and sending the model parameters of the local model to the server according to the upload request.
[0008] In an embodiment, before the step of generating the proof file of the cosine distance according to the local model, the benchmark model, the cosine distance between the local model and the benchmark model, and the private key, it includes:
[0009] Receiving the benchmark model and the initialized global model distributed by the server;
[0010] Training the global model through the first data set to obtain a local model.
[0011] In addition, to achieve the above object, the present application also proposes a method for verifying the trustworthiness of local models in federated learning based on the Internet of Things, which is applied to a server. The method for verifying the trustworthiness of local models in federated learning based on the Internet of Things includes:
[0012] Receiving the public key, the cosine distance between the local model and the benchmark model, and the proof file of the cosine distance sent by the client;
[0013] Verifying the proof file according to the public key, and sorting the verified cosine distances to obtain a sorting result;
[0014] Selecting the target clients corresponding to the top preset number of cosine distances in the sorting result, and sending an upload request for the local model parameters to the target clients;
[0015] Receiving the model parameters of the local model sent by the target client, aggregating the model parameters, and training the global model with the aggregated model parameters to obtain a new global model.
[0016] In one embodiment, the step of aggregating the model parameters includes:
[0017] Determining the aggregation weights of the model parameters according to the size of the first dataset of the target client;
[0018] Aggregating the model parameters based on the aggregation weights.
[0019] In one embodiment, before the step of receiving the public key, the cosine distance between the local model and the benchmark model, and the proof file of the cosine distance sent by the client, it includes:
[0020] Training the global model of the previous round with the second dataset of the server to obtain a benchmark model;
[0021] Distributing the global model and the benchmark model to the client.
[0022] In one embodiment, after the step of training the global model with the aggregated model parameters to obtain a new global model, it includes:
[0023] Distributing the new global model to the client, and returning to execute the method for verifying the trustworthiness of local models in federated learning based on the Internet of Things as described above until the new global model converges.
[0024] In addition, to achieve the above object, the present application further provides a client, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the method for trusted verification of local models in federated learning based on the Internet of Things as described above.
[0025] In addition, to achieve the above object, the present application further provides a server, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the method for trusted verification of local models in federated learning based on the Internet of Things as described above.
[0026] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the method for trusted verification of local models in federated learning based on the Internet of Things as described above.
[0027] In addition, to achieve the above object, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method for trusted verification of local models in federated learning based on the Internet of Things as described above.
[0028] One or more technical solutions proposed by the present application have at least the following technical effects:
[0029] Due to the submission of dishonest model performance indicators by some clients during the model parameter aggregation process, the training effect of the global model is poor; the method for trusted verification of local models in federated learning based on the Internet of Things proposed by the present application is a federated learning method. In this method, in order to eliminate the local models of clients that do not meet the requirements, the model performance indicators of the local models obtained by client training are screened. On the client side, by introducing a proof file in the performance screening of the local model, that is, the calculation of the cosine distance between the benchmark model and the local model is proved. On the server side, according to the verification situation of the proof file and the preset screening quantity, the target clients are determined in the sorting result, and then the global model is trained according to the local model parameters sent by the target clients.
[0030] Applying the proof technology to the performance screening of local models on the client side can provide a verification mechanism for the authenticity of model performance metrics and can effectively identify dishonest model performance metrics submitted by some clients. Based on the verification situation and a pre-selected number of target clients, the server side finally trains the global model according to the local model parameters sent by the target clients, which can ensure that the local model parameters participating in the global model training come from clients with reliable performance, improve the quality of training data, and then optimize the training process of the global model, ultimately enhancing the training effect of the global model. Brief Description of the Drawings
[0031] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application.
[0032] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0033] Figure 1 It is a schematic flowchart provided for an embodiment of the method for verifying the trustworthiness of local models in federated learning based on the Internet of Things according to the present application;
[0034] Figure 2 It is a schematic flowchart provided for another embodiment of the method for verifying the trustworthiness of local models in federated learning based on the Internet of Things according to the present application;
[0035] Figure 3 It is a schematic flowchart provided for the method for verifying the trustworthiness of local models in federated learning based on the Internet of Things according to the present application;
[0036] Figure 4 It is a schematic diagram of the device structure of the hardware operating environment involved in the method for verifying the trustworthiness of local models in federated learning based on the Internet of Things according to the present application.
[0037] The implementation, functional features, and advantages of the present application will be further described with reference to the embodiments and the drawings. Detailed Embodiments
[0038] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0039] To better understand the technical solutions of the present application, the following will be described in detail with reference to the drawings in the specification and the specific embodiments.
[0040] Due to the existence of dishonest model parameters uploaded by some clients or malicious tampering with model parameters, the performance of the global model decreases or even fails, interfering with the training process. To enhance the trust between different entities, most existing technologies introduce zero-knowledge proof during the local model training process to ensure the authenticity of the local model training process. However, generating zero-knowledge proof files during the local model training process not only consumes the computing power resources of the client, but also all clients will transmit the model parameters of the trained local model to the server after training the local model, resulting in a large communication load.
[0041] This application provides a solution that introduces proof technologies such as zero-knowledge proof in the performance screening of local models, while the existing federated learning process does not propose screening local models according to model performance indicators. In addition, introducing zero-knowledge proof technology in the performance screening of local models and combining it with a screening mechanism can bring the following technical effects: For clients, since the zero-knowledge proof technology is applied in the performance screening of local models, the client does not need to consume additional computing power resources during the training phase to meet the calculations related to zero-knowledge proof. In addition, only the clients that pass the screening will send the local model parameters to the server, greatly reducing the number of clients transmitting data, thus effectively reducing the communication load. For the server, through the application of zero-knowledge proof technology in performance screening, it can more reliably determine which clients' local model performance meets the requirements, making the quality of the local model parameters used to train the global model higher, and thus improving the effectiveness of global model training and enhancing the performance of the global model.
[0042] It should be noted that the execution subject of this embodiment can be a client, or a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a processor, etc. that can implement the above functions. Hereinafter, the client is taken as an example to illustrate this embodiment and the following embodiments.
[0043] Based on this, the embodiment of this application provides a method for trusted verification of local models in federated learning based on the Internet of Things, referring to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the method for trusted verification of local models in federated learning based on the Internet of Things of this application.
[0044] In this embodiment, the method for trusted verification of local models in federated learning based on the Internet of Things includes steps S10 to S30:
[0045] Step S10: Generate a proof file of the cosine distance based on the local model, the reference model, the cosine distance between the local model and the reference model, and the private key. The reference model is obtained by the server training the global model of the previous round using the second dataset of the server, and the private key is used to encrypt the calculation process of the cosine distance.
[0046] It should be noted that, first, calculate the cosine distance between the local model and the reference model. The calculated cosine distance value can reflect the similarity degree between the local model and the reference model in the vector space. Then, encrypt the cosine distance using the private key. Finally, generate a file containing the information related to the cosine distance processed by the private key. This file is the proof file of the cosine distance. Since the proof file is usually very small, transmitting the proof file will not occupy much bandwidth.
[0047] Specifically: The technology for generating the proof file of the cosine distance is a zero - knowledge proof technology, which includes using the local model of the client as the private input W, the reference model and the calculated cosine distance as the public input x, encrypting the cosine distance using the private key PK, and generating the proof file of the cosine distance according to π←PROVE(PK,x,W). Among them, the proof generation algorithm (PROVE) generates a proof file π based on the private key PK for proof, the public input x, and the private input W. Exemplarily, the cosine distance is a performance metric. Besides using the cosine distance as a performance metric, entropy can also be used. The purpose of the proof file is to prove to the server that the cosine distance between the local model and the reference model is legally calculated and verifiable, while ensuring the security and immutability of the file content, because only entities with the corresponding public key can verify the private key signature.
[0048] In a feasible implementation manner, before step S10, the method for verifying the trustworthiness of the local model in the federated learning based on the Internet of Things includes steps A10 - A20:
[0049] Step A10: Receive the reference model and the initialized global model distributed by the server.
[0050] It should be noted that the initialized global model refers to a model randomly generated by the server or a pre - trained model loaded. The reference model is obtained by the server training the global model of the previous round using the local dataset (i.e., the second dataset) of the server. In the process of federated learning, to obtain a global model with better performance, multiple rounds of local model aggregation are required. Each time local model aggregation is performed, a global model will be obtained. Therefore, each time the reference model is obtained by the server training the global model of the previous round using the local dataset.
[0051] Step A20: Train the global model with the first data set to obtain a local model.
[0052] It should be noted that the first data set is the local data set of the client. Each client has its own local data set. Each client uses its own local data set to train and update the global model distributed by the server. There are several clients under one server. Therefore, after each client uses its local data set to train the global model distributed by the server, the obtained model is a local model.
[0053] Step S20: Send the public key, the cosine distance between the local model and the reference model, and the proof file of the cosine distance to the server. The public key is used to verify the proof file of the cosine distance.
[0054] It should be noted that the private key PK and the public key VK of the client are generated by the key generation algorithm KEYGEN. Specifically, the way to generate the private key for proof and the public key for verification is: (PK, VK) ← KEYGEN(1 λ , C), where λ is a predefined security parameter and C is the description of the arithmetic circuit. For the client, the private key is confidential and can only be accessed and used by the client itself. The public key exists in pairs corresponding to the private key. In the asymmetric encryption system, the public key can be made public.
[0055] Step S30: Receive the upload request for the local model parameters sent by the server, and send the model parameters of the local model to the server according to the upload request.
[0056] It should be noted that the local model is a model trained for a specific task and data set. The local model parameters are the key elements defining this local model. The local model parameters include the connection weights and biases between neurons, etc. The local model parameters determine the behavior and performance of the local model. The server needs to collect the model parameters of each local model after verification and screening for integration and further training. To obtain the model parameters of the local model, it sends an upload request to the relevant client. After receiving this request, the client uploads the local model parameters, and the specific upload method is not limited.
[0057] In this embodiment, the encryption generation of the proof file for the calculation process of the cosine distance between the local model and the reference model by the proof technology not only protects the privacy of the client but also prevents malicious clients from sending false proof files to interfere with the server's decision-making, with good reliability and fairness.
[0058] It should be noted that the execution subject of this embodiment can be a server, or a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a processor, etc. that can implement the above functions. Hereinafter, the server is taken as an example to illustrate this embodiment and the following embodiments.
[0059] Based on this, an embodiment of the present application provides a method for verifying the trustworthiness of a local model in federated learning based on the Internet of Things. Refer to Figure 2 , Figure 2 which is a schematic flowchart of another embodiment of the method for verifying the trustworthiness of a local model in federated learning based on the Internet of Things according to the present application.
[0060] In this embodiment, the method for verifying the trustworthiness of a local model in federated learning based on the Internet of Things includes steps D10 to D40:
[0061] Step D10: Receive the public key, local model, cosine distance between the local model and the reference model, and the proof file of the cosine distance sent by the client.
[0062] It should be noted that after the server receives the public key, cosine distance, and proof file sent by the client, it completes the verification of the proof file π according to 1 / 0←VERIFY(VK,π,x), where the verification algorithm (VERIFY): uses the public key VK for verification, the public input x, and the proof file π to output a verification result of passed or not passed. If the verification passes, the result is 1, and the corresponding cosine distance cos value is added to the sorted list; if the verification fails, the result is 0.
[0063] In a feasible implementation manner, before step D10, steps E10 to E20 are included:
[0064] Step E10: Train the global model of the previous round using the second data set of the server to obtain a reference model.
[0065] It should be noted that the global model is first initialized and then distributed to the client. The second data set is a local data set stored on the server side. The second data set is used to train the global model of the previous round to obtain a reference model for evaluating the performance of the local model of the client.
[0066] Step E20: Distribute the global model and the reference model to the client.
[0067] It should be noted that the global model and the reference model are distributed to the client through the network or other means, and the specific distribution method is not limited.
[0068] Step D20: Verify the proof file according to the public key, sort the verified cosine distances, and obtain a sorting result;
[0069] It should be noted that if the verification is successful, it indicates that the relevant information about the cosine distance is reliable. The server will then add the cosine distance of this client to the list. The range of the cosine distance value is [-1, 1]. The closer the cosine distance value is to 1, the better the result, and thus it will be ranked higher in the sorted list. If the verification fails, it means there are problems such as data tampering, calculation errors, or security risks. The server will reject the model parameters of the client's local model.
[0070] Step D30: Select the target clients corresponding to the top preset number of cosine distances in the sorting result, and send an upload request for the local model parameters to the target clients;
[0071] It should be noted that the server selects the top preset number of target clients according to the sorting result and notifies the target clients to upload the local model parameters. Exemplarily, the preset number can be 5. There are 20 clients with verified results in the sorted list, but the server only selects the top 5 clients and sends a request to these 5 clients to upload the model parameters of the local model.
[0072] The preset number set by the server is a screening mechanism. The preset number and the verification situation of the cosine distance jointly affect whether to receive the model parameters of the local model. Even if the proof file of the cosine distance is verified successfully, if the pre-set screening number of the server has been reached, the server will not receive the model parameters of the new local model.
[0073] In the prior art, all clients need to send the model parameters of the local model to the server, which will cause an excessive network load. In this application, after a first screening based on the proof file, and then a second screening by selecting the top preset number of clients in the sorting result to obtain the target clients, and then notifying the target clients to upload their local model parameters. In this way, the network load can be reduced to a certain extent.
[0074] Step D40: Receive the model parameters of the local model sent by the target clients, aggregate the model parameters, and train the global model with the aggregated model parameters to obtain a new global model.
[0075] It should be noted that the server receives the model parameters of the local models of the target clients and aggregates them according to pre-set rules to generate a new global model. Each of the target clients has a local model, which is a model initially trained locally based on its own data and contains the model parameters learned by the client according to the local data. After each target client sends out the model parameters of its local model, the server needs to aggregate these parameters. The purpose of aggregation is to synthesize the knowledge learned by each client to obtain more comprehensive and accurate model parameters. There are various aggregation operations, such as simple averaging (when the data distributions of each client are similar and of equal importance), or weighted averaging (assigning different weights to the parameters of different clients according to factors such as the data volume and data quality of the clients and then averaging).
[0076] The global model is a model that synthesizes the model parameters of all target clients. It is initially in an initial state (such as a randomly initialized model) and is gradually optimized by continuously receiving and training the aggregated model parameters. The model parameters are used to adjust each parameter in the global model so that the global model can better process data based on the new parameters, thereby obtaining a new and more optimized global model. In this way, the data of the clients does not need to be centralized to a central server, but only the model parameters are transmitted, which can protect data privacy while being able to utilize the data of multiple clients to improve the performance of the model.
[0077] In this embodiment, verifying the authenticity and integrity of the proof document can prevent malicious clients from sending false cosine distance information and ensure that subsequent operations are based on accurate data. Since the target clients are selected according to the cosine distance from the reference model, their model parameters are more in line with the expected model structure or features. Then, the model parameters obtained by aggregating the local model parameters uploaded by the target clients are used to train the global model, making the training effect of the new global model better and capable of improving the performance of the new global model.
[0078] In a feasible implementation manner, step D40 includes:
[0079] Determine the aggregation weights of each model parameter according to the size of the first data set of the target client;
[0080] Aggregate the model parameters based on the aggregation weights.
[0081] It should be noted that in the scenario of multiple clients, each client has its own data set. Here, the first data set refers to the data set owned by the target client. The size of the data set reflects the amount of data owned by the client. For example, one client may have 1000 pieces of data, and another client may have 500 pieces of data.
[0082] The weight is a value used to measure the relative importance of the model parameters of each client in the aggregation process. Since the dataset sizes of different clients are different, if a client has a larger dataset, the model parameters learned by the local model trained by this client are relatively more reliable and representative. Therefore, a larger weight should be given during aggregation. For example, the weight of a client with a dataset of 1000 data entries may be larger than that of a client with a dataset of 500 data entries.
[0083] After determining the aggregation weights of the model parameters of each client, the model parameters of each client are combined to obtain a comprehensive model parameter that can represent the knowledge of all clients. Exemplarily, the aggregation method can be weighted summation. According to the weights of the model parameters of different clients, the model parameters of the clients are aggregated to obtain more optimized model parameters.
[0084] In this embodiment, when aggregating according to the reasonable distribution of aggregation weights based on the dataset size, the model parameters of the client with a larger dataset have a greater impact on the aggregation result. During the aggregation process, the model performance of the client with a larger dataset will contribute relatively better model parameters, thereby improving the performance of the new global model.
[0085] In another feasible embodiment, after step D40, it includes: distributing the new global model to the clients, and returning to execute the above-mentioned method for verifying the trustworthiness of the local model in federated learning based on the Internet of Things until the new global model converges.
[0086] It should be noted that by aggregating the local model parameters sent by the target client and then training the global model with the aggregated parameters, a new global model is obtained. If the new global model has not converged or has not reached the predetermined number of iterations, the server distributes the new global model to each client, allowing each client to continue local training based on this new global model and generate proof files; the server verifies the proof files, filters the target clients, allows the target clients to send the model parameters of the new local model, determines the aggregation weights according to the dataset size and performs parameter aggregation, and trains the global model with the aggregated parameters, etc.
[0087] In each round of the model training process based on federated learning, the performance of the global model will be improved. This process (distributing the new global model to the clients, the clients performing local training and returning the local model parameters, and then aggregating the parameters to train the global model, etc.) is continuously repeated until the new global model converges. Once the new global model converges, the entire model training process of federated learning is completed.
[0088] In one embodiment, the present application can ensure that the model performance metrics uploaded by the client are true and reliable while protecting data privacy. Scenarios where it can be applied include: multiple medical institutions jointly training a disease diagnosis model, where it is necessary to verify the model performance submitted by each institution without exposing local data.
[0089] The present application can prevent malicious clients from uploading false performance metrics to interfere with the global model training. Scenarios where it can be applied include: in a cross-enterprise supply chain optimization model, different enterprises may upload untrue performance data based on self-interest, affecting the overall optimization effect.
[0090] The present application can also ensure the diversity of training data and the authenticity of model performance metrics in a distributed collaboration scenario. Scenarios where it can be applied include: in the optimization of a collaborative recommendation algorithm among multiple parties, verifying the performance of the models contributed by each party to ensure the optimization quality of the overall system.
[0091] Exemplarily, to facilitate understanding of the implementation process of the local model trustworthy verification method for federated learning based on the Internet of Things obtained by combining the above embodiments, please refer to Figure 3 , Figure 3 A brief process schematic diagram of the local model trustworthy verification method for federated learning based on the Internet of Things is provided. Specifically:
[0092] First, the server initializes the global model, trains the global model of the previous round using the local dataset (the second dataset) on the server side to obtain a benchmark model, and then distributes the benchmark model and the initialized global model to each client. Then, the client trains the global model using the local dataset (the first dataset) to obtain a local model, calculates the cosine distance between the local model and the benchmark model, and introduces a proof technique (such as zero-knowledge proof technique) to ensure the honesty of the calculation process and generates a proof file for the cosine distance. In order for the server to verify this proof file, the public key, the cosine distance, and the proof file of the cosine distance are all submitted to the server. After receiving them, the server uses the public key to verify the proof file. If the verification passes, the corresponding cosine distance is added to the sorted list for sorting. Among them, the sorting is from good to bad. The server pre-sets a screening quantity (assumed to be k), selects the k clients corresponding to the cosine distances ranked at the top as target clients, and sends a request to the target clients to upload the local model parameters. The target clients send the model parameters of the local model to the server according to the upload request. After the server weights and allocates the received model parameters of the local model according to the size of the local datasets of each client, it aggregates them and uses the aggregated model parameters to train the initialized global model to obtain a new global model. If the new global model does not converge or does not reach the predetermined number of iterations, continue to execute Figure 3 Steps 2 to 8 in until the global model converges or reaches the predetermined number of iterations.
[0093] Exemplarily, the algorithm flow of the local model trustworthy verification method for Internet of Things-based federated learning in this application is as follows:
[0094]
[0095]
[0096] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the local model trustworthy verification method for Internet of Things-based federated learning in this application. Based on this technical concept, more forms of simple transformations, such as the interaction and combination of various embodiments, are within the protection scope of this application.
[0097] This application provides a client, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the local model trustworthy verification method for Internet of Things-based federated learning in the above first embodiment.
[0098] This application provides a server, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the local model trustworthy verification method for Internet of Things-based federated learning in the above first embodiment.
[0099] Next, refer to Figure 4 , which shows a schematic structural diagram of a client suitable for implementing the embodiments of this application. The structure of the server in the embodiments of this application may be the same as or different from that of this client, and no specific limitation is made here. The client in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The client shown is only an example and should not bring any limitation to the functions and usage scopes of the embodiments of this application.
[0100] As Figure 4As shown in the figure, the client can include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for server operations are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the server to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a client with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be alternatively implemented or had.
[0101] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.
[0102] The client provided by the present application adopts the method for trusted verification of local models of federated learning based on the Internet of Things in the above embodiments, and can solve the technical problem that the low reliability of the model performance indicators submitted by the client leads to poor performance of the global model. Compared with the prior art, the beneficial effects of the client provided by the present application are the same as those of the method for trusted verification of local models of federated learning based on the Internet of Things provided in the above embodiments, and other technical features in this client are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.
[0103] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0104] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0105] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for trusted verification of local models of federated learning based on the Internet of Things in the above embodiments.
[0106] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0107] The above computer-readable storage medium can be included in the client; it can also exist separately without being assembled into the client.
[0108] The above computer-readable storage medium carries one or more programs, which, when executed by a client, cause the client to: generate a proof file of the cosine distance according to a local model, a reference model, the cosine distance between the local model and the reference model, and a private key, where the reference model is obtained by initializing a global model trained by a second data set of a server, and the private key is used to encrypt the calculation process of the cosine distance; send a public key, the cosine distance between the local model and the reference model, and the proof file of the cosine distance to the server, where the public key is used to verify the proof file of the cosine distance; receive an upload request for local model parameters sent by the server, and send the model parameters of the local model to the server according to the upload request.
[0109] Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0111] The modules involved in the embodiments of this application can be implemented in software or in hardware. In some cases, the name of the module does not constitute a limitation on the unit itself.
[0112] The readable storage medium provided in this application is a computer-readable storage medium, and the computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for trusted verification of local models in federated learning based on the Internet of Things, which can solve the technical problem that the low reliability of the model performance indicators submitted by the client leads to poor performance of the global model. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the method for trusted verification of local models in federated learning based on the Internet of Things provided in the above embodiments, and will not be elaborated here.
[0113] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for trusted verification of local models in federated learning based on the Internet of Things are implemented.
[0114] The computer program product provided in this application can solve the technical problem that the low reliability of the model performance indicators submitted by the client leads to poor performance of the global model. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the method for trusted verification of local models in federated learning based on the Internet of Things provided in the above embodiments, and will not be elaborated here.
[0115] The above are only some embodiments of this application, and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application by using the content of the specification and drawings of this application, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A trusted verification method for a local model of federated learning based on the Internet of Things, characterized in that: Applied to the client, the IoT-based federated learning local model trust verification method includes: Generate a certification document of the cosine distance according to a local model, a benchmark model, a cosine distance between the local model and the benchmark model, and a private key, wherein the benchmark model is obtained by the server training a global model of a previous round using a second data set of the server, and the private key is used to encrypt a calculation process of the cosine distance; Sending a public key, a cosine distance between the local model and the reference model, and a certification document of the cosine distance to a server, wherein the public key is used to verify the certification document of the cosine distance; A request for uploading the local model parameters sent by the server is received, and the model parameters of the local model are sent to the server according to the upload request.
2. The method for credible verification of a local model of federated learning based on the Internet of Things as claimed in claim 1, characterized in that: Before the step of generating a certification document of the cosine distance according to the local model, the reference model, the cosine distance between the local model and the reference model, and the private key, the step includes: Receive the baseline model and the initialized global model distributed by the server; The global model is trained using the first data set to obtain a local model.
3. A trusted verification method for a local model of federated learning based on the Internet of Things, characterized in that: Applied to the server, the IoT-based federated learning local model trustworthy verification method includes: Receive a public key, a cosine distance between a local model and a reference model, and a certification document of the cosine distance sent by a client; Verify the certification document according to the public key, and sort the cosine distances that pass the verification to obtain a sorting result; Selecting target clients corresponding to the first preset number of cosine distances from the sorting results, and sending a request to upload local model parameters to the target clients; The model parameters of the local model sent by the target client are received, and the model parameters are aggregated, and the global model is trained by using the aggregated model parameters to obtain a new global model.
4. The method for credible verification of a local model of federated learning based on the Internet of Things as claimed in claim 3 is characterized in that: The step of aggregating the model parameters comprises: Determining an aggregation weight of each model parameter according to the size of the first data set of the target client; The model parameters are aggregated based on the aggregation weights.
5. The method for credible verification of a local model of federated learning based on the Internet of Things as claimed in claim 3, characterized in that: The step of receiving the public key, the cosine distance between the local model and the reference model, and the certification document of the cosine distance sent by the client includes: The global model of the previous round is trained using the second data set of the server to obtain a benchmark model; The global model and the benchmark model are distributed to the client.
6. The method for credible verification of a local model of federated learning based on the Internet of Things as claimed in claim 3, characterized in that: After the step of training the global model by aggregating the model parameters to obtain a new global model, the method further comprises: The new global model is distributed to the client, and the method for credible verification of the local model of federated learning based on the Internet of Things is returned to be executed until the new global model converges.
7. A client, characterized in that: The client includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for trusted verification of a local model of federated learning based on the Internet of Things as described in any one of claims 1 to 2.
8. A server, characterized in that: The server includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the trusted verification method of a local model of federated learning based on the Internet of Things as described in any one of claims 3 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the trusted verification method of a local model of federated learning based on the Internet of Things as described in any one of claims 1 to 2 and / or claims 3 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method for trusted verification of a local model of federated learning based on the Internet of Things as described in any one of claims 1 to 2, and / or claims 3 to 6.
Citation Information
Cited By
Data processing method and device
CN120277547A
Data processing method and device
CN120277547B