Federal learning system and global evaluation index acquisition method of regression model of federal learning system
By allowing participants to calculate locally and weighted average in federated learning, the problem of the inability to obtain global evaluation indicators in federated learning is solved, data privacy and security protection is achieved, and the accuracy and efficiency of model evaluation are improved.
Patent Information
- Application Number
- CN202411794672.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In federated learning, global evaluation indicators of regression models cannot be obtained while ensuring data privacy and security, resulting in inconsistent model evaluation and the risk of data leakage.
Data leakage is avoided by allowing each participant to calculate the mean square error and sample size locally and weighted average them on the central server, and calculate the global mean square error and other evaluation indicators, such as R2 determination coefficient and average absolute error.
It realizes the acquisition of accurate global evaluation indicators without leaking data, improves the consistency and efficiency of model evaluation, and protects data privacy and security.
Smart Images

Figure CN119272312A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of privacy computing technology, and more specifically, to a method for obtaining global evaluation indicators of a federated learning system and its regression model. Background Art
[0002] Federated learning is a paradigm of distributed machine learning that allows multiple data owners to collaboratively train a shared global model while keeping the data local. The purpose of federated learning is to utilize massive data distributed across different locations and devices to improve the performance and generalization capabilities of machine learning models while protecting the privacy and security of the data. In federated learning, model evaluation is an important link, which can help understand the performance of the model on different data sets, select the optimal model parameters and algorithms, and compare the pros and cons of different models or algorithms. Model evaluation usually requires the use of some evaluation indicators to measure the accuracy, stability, efficiency and other characteristics of the model. The evaluation indicators for regression models mainly include mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), R2 coefficient of determination (R 2 )etc.
[0003] Usually in the theoretical research of federated learning, in order to evaluate the quality of the federated learning algorithm, there will be a global test set to evaluate the final results. All model evaluation indicators are calculated through the global test set, so that there will be no disagreement between multiple test sets and multiple results. However, in the actual federated learning platform, the data is distributed among various participants and there is no ideal global test set. In the testing phase, the model indicator results will only be obtained on the test set divided by each participant. Of course, the test data sets of each participant can also be concentrated on the central server to obtain a global data set, but doing so will cause serious privacy issues.
[0004] In a federated learning platform, since the data of each participant will not leave the local area, it is impossible to directly use a global test set to evaluate the global model. This leads to the following problems: First, local models can only be evaluated based on the local test sets that each participant has divided. This will result in n participants getting n results, and these results may be very different and inconsistent because the data distribution and scale of each participant may be different. This brings difficulties and challenges to the evaluation and comparison of global models.
[0005] Secondly, it is impossible to effectively select different global models generated in different iterations during the training process. Because it is impossible to directly compare the performance of global models in different rounds on the global test set, we can only speculate and estimate based on the local test results of each participant after each iteration. This makes it impossible to determine which round is the best.
[0006] Finally, the privacy and security of data cannot be guaranteed. Although the test data sets of each participant can be centralized to a central server to obtain a global test set, thus solving the above two problems, doing so would violate the original intention and principle of federated learning, which is to keep data local. Because once the data leaves the local area, it may be stolen, tampered with, or leaked to a third party, thereby endangering the privacy and interests of the data owner. Summary of the invention
[0007] The purpose of the embodiments of the present application is to provide a method for obtaining global evaluation indicators of a federated learning system and its regression model, so as to solve the problem in the prior art that it is impossible to obtain global evaluation indicators of the regression model while ensuring the privacy and security of the data of each participant in the federated learning.
[0008] The embodiment of the present application provides a method for obtaining a global evaluation index of a regression model of a federated learning system. The federated learning system includes a central server and m Participants, each participant includes its own test set data, and the global evaluation index includes the global MSE; among them, m is a positive integer greater than 1; The method comprises: At each participant Cj, perform the following steps: According to the local test set of the participant, the mean square error MSEj and sample size Dj of the participant are obtained; where MSEj= ; is the label value of the sample, is the predicted value of the sample; the mean square error and sample size are sent to the central server; On the central server, perform the following steps: According to the sample size of each participant, the mean square error of each participant is weighted averaged to obtain the global MSE: Global MSE= ×MSEj; Among them, N is the total sample size, and the total sample size is the sum of the sample sizes of all participants.
[0009] In the above technical solution, in the federated learning system, each participant calculates the mean square error and sample size of its local test set respectively, and then sends the mean square error and sample size to the central server. Then, the central server receives the mean square error and sample size of each participant and calculates the global mean square error. In this embodiment, since each participant only sends its own mean square error and sample size, it does not need to send local data, which can protect the data privacy of each participant. In addition, each participant can calculate the mean square error of its local test set in parallel, which can significantly reduce the calculation time and improve efficiency.
[0010] In some optional embodiments, the global evaluation index includes a global R2 coefficient of determination; At each participant Cj, the following steps are also performed: According to the local test set of the participant, the local test set label and the square sum of the local test set label of the participant are obtained; among which, the local test set label and ; Local test set label sum of squares ; Send the local test set label sum and the local test set label square sum to the central server; The central server also performs the following steps: According to the total sample size and the local test set labels of each participant, the global label mean is obtained :
[0011] The global label square mean is obtained based on the total sample size and the sum of squares of the local test set labels of each participant. :
[0012] According to the global label mean and the global label square mean, the global VAR is obtained: Global
[0013] According to the global VAR and global MSE, the global R2 coefficient of determination is obtained: .
[0014] In the above technical solution, in the federated learning system, each participant calculates the local test set label and the local test set label square sum of its local test set, and then sends the local test set label and the local test set label square sum to the central server. Then, the central server receives the local test set label and the local test set label square sum of each participant, and calculates the global R2 determination coefficient. In this embodiment, since each participant only sends its own local test set label and the local test set label square sum, it does not need to send local data, which can protect the data privacy of each participant.
[0015] In some optional implementations, the global evaluation index further includes a global MAE; At each participant Cj, the following steps are also performed: According to the local test set of the participant, the mean absolute error MAEj of the participant is obtained; where MAEj= ; Send the mean absolute error MAEj to the central server; On the central server, also perform the following steps: According to the sample size of each participant, the average absolute error of each participant is weighted averaged to obtain the global MAE: Global MAE= ×MAEj.
[0016] In the above technical solution, in the federated learning system, each participant calculates the mean absolute error of its local test set, and then sends the mean absolute error to the central server. Then, the central server receives the mean absolute error of each participant and calculates the global mean absolute error. In this embodiment, since each participant only sends its own mean absolute error, it does not need to send local data, which can protect the data privacy of each participant.
[0017] In some optional implementations, the global evaluation index further includes a global RMSE; On the central server, also perform the following steps: After obtaining the global MSE, the global RMSE is obtained by taking the square root of the global MSE.
[0018] In the above technical solution, in the federated learning system, each participant calculates the mean square error and sample size of its local test set respectively, and then sends the mean square error and sample size to the central server. Then, the central server receives the mean square error and sample size of each participant and calculates the global mean square error. The central server calculates the global root mean square error based on the global mean square error. In this embodiment, since each participant only sends its own mean square error and sample size, it does not need to send local data, which can protect the data privacy of each participant.
[0019] The present application provides a federated learning system, the federated learning system includes a central server and m Participants, each participant includes its own test set data, where m is a positive integer greater than 1; Participants are used to: According to the local test set of the participant, the mean square error MSEj and sample size Dj of the participant are obtained; where MSEj= ; is the label value of the sample, is the predicted value of the sample; the mean square error and sample size are sent to the central server; The central server is used to: According to the sample size of each participant, the mean square error of each participant is weighted averaged to obtain the global MSE: Global MSE= ×MSEj; Among them, N is the total sample size, and the total sample size is the sum of the sample sizes of all participants.
[0020] In some optional implementations, the participants are further configured to: According to the local test set of the participant, the local test set label and the square sum of the local test set label of the participant are obtained; among which, the local test set label and ; Local test set label sum of squares ; Send the local test set label sum and the local test set label square sum to the central server; The central server is also used to: According to the total sample size and the local test set labels of each participant, the global label mean is obtained :
[0021] The global label square mean is obtained based on the total sample size and the sum of squares of the local test set labels of each participant. :
[0022] According to the global label mean and the global label square mean, the global VAR is obtained: Global
[0023] According to the global VAR and global MSE, the global R2 coefficient of determination is obtained: .
[0024] In some optional implementations, the participants are further configured to: According to the local test set of the participant, the mean absolute error MAEj of the participant is obtained; where MAEj= ; Send the mean absolute error MAEj to the central server; The central server is also used to: According to the sample size of each participant, the average absolute error of each participant is weighted averaged to obtain the global MAE: Global MAE= ×MAEj.
[0025] In some optional implementations, the central server is further used to: After obtaining the global MSE, the global RMSE is obtained by taking the square root of the global MSE.
[0026] An electronic device provided in an embodiment of the present application includes: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, any of the above methods is performed.
[0027] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any of the above methods is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A flowchart of a method for obtaining a global mean square error of a regression model of a federated learning system provided in an embodiment of the present application; Figure 2 A flowchart of the steps of a method for obtaining the global R2 coefficient of determination of a regression model of a federated learning system provided in an embodiment of the present application; Figure 3 A possible structural diagram of an electronic device provided in an embodiment of the present application.
[0030] Icons: 110 - communication unit, 120 - memory, 130 - input unit, 131 - touch-sensitive surface, 132 - other input devices, 140 - display unit, 141 - display panel, 150 - sensor, 160 - audio circuit, 170 - wireless communication unit, 180 - processor, 190 - power supply. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0032] Please refer to Figure 1 , Figure 1 A flowchart of a method for obtaining a global mean square error of a regression model of a federated learning system provided in an embodiment of the present application, wherein the federated learning system includes a central server and mParticipants, each participant includes its own test set data, and the global evaluation index includes the global MSE; among them, m is a positive integer greater than 1; The method comprises: At each participant Cj, perform the following steps: Step 110: According to the local test set of the participant, the mean square error MSEj and the sample size Dj of the participant are obtained; wherein, MSEj= ; is the label value of the sample, is the predicted value of the sample; the mean square error and sample size are sent to the central server; On the central server, perform the following steps: Step 210: According to the sample size of each participant, the mean square error of each participant is weighted averaged to obtain the global MSE: Global MSE= ×MSEj; Among them, N is the total sample size, and the total sample size is the sum of the sample sizes of all participants.
[0033] In the embodiment of the present application, in the federated learning system, each participant calculates the mean square error and sample size of its local test set respectively, and then sends the mean square error and sample size to the central server. Then, the central server receives the mean square error and sample size of each participant and calculates the global mean square error. In this embodiment, since each participant only sends its own mean square error and sample size, there is no need to send local data, which can protect the data privacy of each participant. In addition, each participant can calculate the mean square error of its local test set in parallel, which can significantly reduce the calculation time and improve efficiency.
[0034] The global MSE calculated by the above method is unbiased, as shown below: The following uses MSE as an example to prove that the global index value obtained in this way is unbiased.
[0035] Features m Clients jointly train the federated learning model, then there is a test set The total number of test set samples is The global MSE is calculated by the weighted average method described above as follows: Global MSE= =
[0036] in is the label value of the sample, is the predicted value of the sample. It can be seen that the global MSE value after weighted averaging is unbiased, that is, the result is the same as the result of calculating the MSE by combining the test set samples of each participant together. This calculation method is also applicable to MAE, and the derivation process is basically the same, so it will not be proved here.
[0037] However, the global RMSE cannot be calculated directly in this way, because theoretically the result is biased. However, RMSE is the arithmetic square root of MSE, so the value of the global RMSE can be calculated by first taking the weighted sum to obtain the global MSE, and then taking the square root to obtain the global RMSE.
[0038] In some optional implementations, the global evaluation index includes a global R2 coefficient of determination, see Figure 2 , Figure 2 A flowchart of the steps of a method for obtaining the global R2 coefficient of determination of a regression model of a federated learning system provided in an embodiment of the present application specifically includes: At each participant Cj, the following steps are also performed: Step 120: According to the local test set of the participant, obtain the local test set label and the square sum of the local test set label of the participant; wherein the local test set label and ; Local test set label sum of squares ; Send the local test set label sum and the local test set label square sum to the central server; The central server also performs the following steps: Step 220: Get the global label mean based on the total sample size and the local test set labels of each participant. :
[0039] The global label square mean is obtained based on the total sample size and the sum of squares of the local test set labels of each participant. :
[0040] Step 230: Obtain the global VAR based on the global label mean and the global label square mean: Global
[0041] Step 240: According to the global VAR and the global MSE, the global R2 coefficient of determination is obtained: .
[0042] In an embodiment of the present application, in a federated learning system, each participant calculates the local test set label and the local test set label square sum of its local test set, and then sends the local test set label and the local test set label square sum to the central server. Then, the central server receives the local test set label and the local test set label square sum of each participant, and calculates the global R2 determination coefficient. In this embodiment, since each participant only sends its own local test set label and the local test set label square sum, it is not necessary to send local data, which can protect the data privacy of each participant.
[0043] The global R2 coefficient of determination calculated by the above method is unbiased, as shown below: Before introducing the calculation of the R2 coefficient of determination, some basic concepts need to be introduced.
[0044] The sum of squares of regression (SSR) is calculated as follows:
[0045] in is the mean of the label. The residual sum of squares (SSE) is calculated as follows:
[0046] The total sum of squared deviations (SST) is calculated as follows:
[0047] The R2 coefficient of determination is calculated by SSE and SST:
[0048] Right now:
[0049] Divide the data amount in both the numerator and the denominator n can be converted into:
[0050] Therefore, to calculate the global R2 determination coefficient, the global MSE and global VAR are required, where the global MSE can be obtained by the method of weighted summation of the MSE uploaded by each participant in the above embodiment. Solving the global VAR is equivalent to calculating the distributed variance in a distributed scenario. First, the calculation formula of the variance is derived as follows: VAR= = =
[0051] in, n is the sample size, xThe feature data for which variance needs to be calculated, for x From the above formula, we can see that the variance can be calculated based on the mean of the calculated data and the mean after square. Therefore, the global VAR in the federated learning system can be calculated in this way. After obtaining the global VAR and global MSE, the global R2 coefficient of determination can be obtained.
[0052] In some optional implementations, the global evaluation index further includes a global MAE; At each participant Cj, the following steps are also performed: Step 130: According to the local test set of the participant, the mean absolute error MAEj of the participant is obtained; wherein MAEj= ; Send the mean absolute error MAEj to the central server; On the central server, also perform the following steps: Step 250: According to the sample size of each participant, the average absolute error of each participant is weighted averaged to obtain the global MAE: Global MAE= ×MAEj.
[0053] In the embodiment of the present application, in the federated learning system, each participant calculates the mean absolute error of its local test set, and then sends the mean absolute error to the central server. Then, the central server receives the mean absolute error of each participant and calculates the global mean absolute error. In this embodiment, since each participant only sends its own mean absolute error, it does not need to send local data, which can protect the data privacy of each participant.
[0054] In some optional implementations, the global evaluation index further includes a global RMSE; On the central server, also perform the following steps: Step 260: After obtaining the global MSE, square root the global MSE to obtain the global RMSE.
[0055] In the embodiment of the present application, in the federated learning system, each participant calculates the mean square error and sample size of its local test set respectively, and then sends the mean square error and sample size to the central server. Then, the central server receives the mean square error and sample size of each participant and calculates the global mean square error. The central server calculates the global root mean square error based on the global mean square error. In this embodiment, since each participant only sends its own mean square error and sample size, it does not need to send local data, which can protect the data privacy of each participant.
[0056] Specifically, the above methods for obtaining the global MSE, global RMSE, global MAE, and global R-squared coefficient can be applied in the following scenarios: predicting the disease risk of a certain disease based on the local medical data of multiple hospital participants. For example, based on data such as the patient's age, gender, blood pressure, and blood sugar, predicting the risk of cardiovascular disease in patients. The disease prediction model outputs a disease risk coefficient, and the value of this disease risk coefficient is between 0 and 1. When the value of the disease risk coefficient is less than a1, the disease risk is low; when the disease risk coefficient is greater than a2, the disease risk is high; when the disease risk coefficient is greater than or equal to a1 and less than or equal to a2, the disease risk is medium, where 0 < a1 < a2 < 1. This embodiment uses the local medical data of multiple hospital participants for federated learning of the disease prediction model, which can train the disease prediction model without revealing the privacy of patients at the hospital end. Moreover, by obtaining the global MSE, global RMSE, global MAE, and global R-squared coefficient, the prediction ability and performance of the model can be evaluated, so as to select a suitable model or adjust the model parameters to improve the performance. The following embodiments also provide the method steps for obtaining the global evaluation index of the disease prediction model in the federated learning system participated by multiple hospital participants, which specifically include: At each hospital participant, perform the following steps: According to the local test set of the hospital participant, obtain the mean squared error and the sample size of the hospital participant; send the mean squared error and the sample size to the central server; where the local test set includes: biomarker information and the corresponding disease risk coefficient; where the biomarker information is used as the input of the model, and the disease risk coefficient is used as the output of the model, and the biomarker information is, for example, data such as the patient's age, gender, blood pressure, and blood sugar.
[0057] At the central server, perform the following steps: According to the sample sizes of each hospital participant, perform a weighted average of the mean squared errors of each hospital participant to obtain the global MSE of the disease prediction model.
[0058] At each hospital participant, also perform the following steps: According to the local test set of the hospital participant, obtain the sum of the local test set labels of the hospital participant, and the sum of the squares of the local test set labels of the hospital participant; At the central server, also perform the following steps: According to the total sample size and the sum of the local test set labels of each hospital participant, obtain the global label mean of the disease prediction model.
[0059] According to the total sample size and the sum of the squares of the local test set labels of each participant, obtain the global mean of the squares of the labels of the disease prediction model.
[0060] According to the global label mean and the global mean of the squares of the labels, obtain the global VAR of the disease prediction model: According to the global VAR and global MSE, the global R2 determination coefficient of the disease prediction model was obtained.
[0061] The federated learning system of this embodiment also uses participants and a central server to implement a method for obtaining global evaluation indicators of a regression model (including a disease prediction model), which is the same as the implementation mechanism of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned embodiments, which will not be repeated here.
[0062] The participants (including hospital participants) or the central server of this embodiment can be set on the browser client side and used as an engine device of the browser, and can also be set in an electronic device to perform its functions independently.
[0063] Figure 3 Schematic diagram of an electronic device structure provided by an embodiment of the present invention. Figure 3 The electronic device can be used to implement the global evaluation index acquisition method of the regression model provided in the above embodiment, and the global evaluation index acquisition method of the disease prediction model. Specifically: The electronic device may include a communication unit 110, a memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that Figure 3 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. The communication unit 110 can be used for receiving and sending signals during information transmission or calls. The communication unit 110 can be a network communication device such as an RF (Radio Frequency) circuit, a router, a modem, etc. In particular, when the communication unit 110 is an RF circuit, after receiving the downlink information of the base station, it is handed over to one or more processors 180 for processing; in addition, the data related to the uplink is sent to the base station. Usually, the RF circuit as a communication unit includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the communication unit 110 can also communicate with the network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc. The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120 .
[0064] The input unit 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or a touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 131 may include a touch detection device and a touch controller. The touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch-sensitive surface 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the input unit 130 may further include other input devices 132. Specifically, other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0065] The display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 131 may cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 3 In the embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to implement input and output functions, but in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to implement input and output functions.
[0066] The electronic device may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the electronic device is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; As for other sensors that can be configured in electronic devices, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0067] The audio circuit 160, the speaker, and the microphone can provide an audio interface between the user and the electronic device. The audio circuit 160 can transmit the received audio data to the speaker after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another electronic device through the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earplug jack to provide communication between an external headset and the electronic device.
[0068] In order to achieve wireless communication, the electronic device may be equipped with a wireless communication unit 170, which may be a WiFi module. WiFi is a short-range wireless transmission technology. The electronic device can help users send and receive emails, browse web pages, and access streaming media through the wireless communication unit 170, which provides users with wireless broadband Internet access. Figure 3 A wireless communication unit 170 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as required without changing the essence of the invention.
[0069] The processor 180 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it performs various functions of the electronic device and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.
[0070] The electronic device also includes a power supply 190 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 190 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0071] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the electronic device also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: according to the local test set of the participant, obtain the mean square error MSEj and the sample size Dj of the participant; send the mean square error and the sample size to the central server; according to the sample size of each participant, perform weighted averaging on the mean square error of each participant to obtain the global MSE.
[0072] Optionally, the memory is also used to store the following instructions: according to the local test set of the participant, obtain the local test set label sum of the participant and the local test set label square sum of the participant; send the local test set label sum and the local test set label square sum to the central server; according to the total sample size and the local test set label sum of each participant, obtain the global label mean : According to the total sample size and the sum of squared labels of the local test set of each participant, the global label square mean is obtained ; According to the global label mean and the global label square mean, the global VAR is obtained; according to the global VAR and the global MSE, the global R2 determination coefficient is obtained.
[0073] Optionally, the memory is also used to store the following instructions: obtain the mean absolute error MAEj of the participant based on the local test set of the participant; send the mean absolute error MAEj to the central server; and perform weighted averaging of the mean absolute errors of each participant based on the sample size of each participant to obtain a global MAE.
[0074] Optionally, the memory is further used to store the following instruction: after obtaining the global MSE, square root the global MSE to obtain the global RMSE.
[0075] Optionally, the memory is also used to store the following instructions: at each hospital participant, perform the following steps: obtain the mean square error and sample size of the hospital participant based on the local test set of the hospital participant; send the mean square error and sample size to the central server; wherein the local test set includes: biomarker information and the corresponding disease risk coefficient; wherein the biomarker information is used as the input of the model, the disease risk coefficient is used as the output of the model, and the biomarker information includes data such as the patient's age, gender, blood pressure and blood sugar.
[0076] Optionally, the memory is also used to store the following instructions: On the central server, the following steps are executed: Based on the sample size of each hospital participant, weighted average is performed on the mean square error of each hospital participant to obtain the global MSE of the disease prediction model.
[0077] Optionally, the memory is also used to store the following instructions: at each hospital participant, further performing the following steps: according to the local test set of the hospital participant, obtaining the local test set label sum of the hospital participant and the local test set label square sum of the hospital participant; Optionally, the memory is also used to store the following instructions: The central server also performs the following steps: According to the total sample size and the local test set label sum of each hospital participant, the global label mean of the disease prediction model is obtained. According to the total sample size and the local test set label square sum of each participant, the global label square mean of the disease prediction model is obtained. According to the global label mean and the global label square mean, the global VAR of the disease prediction model is obtained: According to the global VAR and the global MSE, the global R2 determination coefficient of the disease prediction model is obtained.
[0078] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0079] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0081] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0082] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for obtaining a global evaluation index of a regression model of a federated learning system, characterized in that: The federated learning system includes a central server and m participants, each participant includes its own test set data, and the global evaluation index includes the global MSE; wherein, m is a positive integer greater than 1; The method comprises: At each participant Cj, perform the following steps: According to the local test set of the participant, the mean square error MSEj and sample size Dj of the participant are obtained; wherein MSEj= ; is the label value of the sample, is the predicted value of the sample; sending the mean square error and sample size to the central server; On the central server, perform the following steps: According to the sample size of each participant, the mean square error of each participant is weighted averaged to obtain the global MSE: Global MSE= ×MSEj; Among them, N is the total sample size, and the total sample size is the sum of the sample sizes of all participants.
2. The method according to claim 1, characterized in that The global evaluation index includes the global R2 determination coefficient; At each participant Cj, the following steps are also performed: According to the local test set of the participant, the local test set label and the square sum of the local test set label of the participant are obtained; wherein the local test set label and ; Local test set label sum of squares ; Sending the local test set label sum and the local test set label square sum to the central server; The central server also performs the following steps: According to the total sample size and the local test set labels of each participant, the global label mean is obtained : The global label square mean is obtained based on the total sample size and the sum of squares of the local test set labels of each participant. : According to the global label mean and the global label square mean, the global VAR is obtained: Global According to the global VAR and global MSE, the global R2 coefficient of determination is obtained: 。 3. The method according to claim 1, characterized in that The global evaluation index also includes global MAE; At each participant Cj, the following steps are also performed: According to the local test set of the participant, the mean absolute error MAEj of the participant is obtained; wherein MAEj= ; Sending the mean absolute error MAEj to the central server; The central server also performs the following steps: According to the sample size of each participant, the average absolute error of each participant is weighted averaged to obtain the global MAE: Global MAE= ×MAEj.
4. The method according to claim 1, characterized in that The global evaluation index also includes global RMSE; The central server also performs the following steps: After obtaining the global MSE, the global RMSE is obtained by taking the square root of the global MSE.
5. A federated learning system, characterized in that: The federated learning system includes a central server and m Participants, each participant includes its own test set data, where m is a positive integer greater than 1; The parties are used to: According to the local test set of the participant, the mean square error MSEj and sample size Dj of the participant are obtained; wherein MSEj= ; is the label value of the sample, is the predicted value of the sample; sending the mean square error and sample size to the central server; The central server is used for: According to the sample size of each participant, the mean square error of each participant is weighted averaged to obtain the global MSE: Global MSE= ×MSEj; Among them, N is the total sample size, and the total sample size is the sum of the sample sizes of all participants.
6. The system according to claim 5, characterized in that The parties are also used to: According to the local test set of the participant, the local test set label and the square sum of the local test set label of the participant are obtained; wherein the local test set label and ; Local test set label sum of squares ; Sending the local test set label sum and the local test set label square sum to the central server; The central server is also used for: According to the total sample size and the local test set labels of each participant, the global label mean is obtained : The global label square mean is obtained based on the total sample size and the sum of squares of the local test set labels of each participant. : According to the global label mean and the global label square mean, the global VAR is obtained: Global According to the global VAR and global MSE, the global R2 coefficient of determination is obtained: 。 7. The system according to claim 5, characterized in that The parties are also used to: According to the local test set of the participant, the mean absolute error MAEj of the participant is obtained; wherein MAEj= ; Sending the mean absolute error MAEj to the central server; The central server is also used for: According to the sample size of each participant, the average absolute error of each participant is weighted averaged to obtain the global MAE: Global MAE= ×MAEj.
8. The system according to claim 5, characterized in that The central server is also used for: After obtaining the global MSE, the global RMSE is obtained by taking the square root of the global MSE.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 4 is performed.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is executed.
Citation Information
Patent Citations
Characteristic variable analysis method and device, computer equipment and storage medium
CN113934983A
Federal learning-based power distribution station fault prediction method
CN114219147A
Global evaluation index acquisition method of federated learning system and federated learning system
CN117792641A
Multi-collinearity analysis method for federal learning and electronic equipment
CN118246524A
Federal learning method and device based on edge device, server and medium
CN118551864A