Federated dynamic aggregation optimization method and system for unmanned inspection equipment

By calculating the model consistency coefficient and assigning weights on the inspection equipment, and combining it with the historical model integration optimization method of the cloud server, the problem of forgetting old data features in the global model on the inspection equipment was solved, resulting in faster convergence and higher accuracy.

CN119580213BActive Publication Date: 2025-10-28HOHAI UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411675418.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-10-28
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

On inspection equipment, due to limited storage and computing power, new data overwrites old data, causing dynamic changes in data distribution. This leads to the global model in federated learning forgetting the features of old data, resulting in slow convergence, low accuracy, and even loss of usability.

Method used

By dynamically allocating aggregation weights using the model consistency coefficient of the computing device and integrating multiple historical global model parameters on an average basis on the cloud server, the aggregation process of the global model is optimized, old data features are prevented from being forgotten, and convergence speed and accuracy are improved.

Benefits of technology

It effectively prevents the global model from deviating from the optimal direction, improves the convergence speed and accuracy of the global model, and enhances the usability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580213B_ABST
    Figure CN119580213B_ABST
Patent Text Reader

Abstract

This invention discloses a federated dynamic aggregation optimization method and system for unmanned inspection equipment, constructing a model training optimization method based on federated learning. Based on the Logits of the model's output on the inspection equipment, the consistency of the model on that equipment is dynamically calculated. A cloud server assigns different global aggregation weights to each inspection equipment according to the calculated model consistency. After completing global aggregation, the cloud server averages the latest historical global model parameters as the global integration parameters for the next round of federated training and distributes them to the participating inspection equipment. This invention calculates the model consistency of the inspection equipment and assigns different aggregation weights to them, which can effectively prevent the global model update from deviating from the optimal direction due to local model update bias, thereby accelerating the global model convergence speed while improving the global model accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a federated dynamic aggregation optimization method and system for unmanned inspection equipment, belonging to the field of federated learning technology for unmanned inspection equipment. Background Technology

[0002] In recent years, the rapid growth of dam area data has led to the widespread application of machine learning in the field of dam safety. Traditional machine learning requires the centralized training of large amounts of data (such as images, voice, and text) collected from devices like mobile phones, vehicles, and surveillance cameras. However, this large amount of data is scattered across devices in different geographical locations or on different entities. Centralizing the transmission of such large datasets to cloud servers for processing poses significant risks of privacy breaches and increases communication burdens. With the improvement of storage and computing capabilities of inspection equipment, it has become possible to train deep learning models locally on the devices using data collected by these equipment. Federated learning, as a distributed learning paradigm, allows devices to independently train local models using their local data and aggregate these local models through a global model. This enables a large number of devices to collaboratively train a deep learning model without sharing the privacy data of individual devices. The specific steps of federated learning are as follows: First, each device trains its local model using the received global model and its local data. Then, the device uploads its local model to a cloud server for full aggregation. Finally, the cloud server distributes the aggregated global model to each device participating in the federated training, repeating these steps until the global model converges and reaches the expected performance requirements.

[0003] Because inspection equipment has limited storage and computing power, new data collected by the equipment continuously overwrites old data, and the data distribution on the equipment changes dynamically over time. However, federated learning tends to use new data for training, which causes the update direction of the equipment's local model to differ significantly from the update direction of previous rounds. The global model, after aggregating the local models, may forget old data features, leading to slower global model convergence, a sharp drop in accuracy, and even rendering the global model unusable. Therefore, on inspection equipment with limited storage and computing power, effectively mitigating the global model forgetting caused by local model update bias during global aggregation and improving the convergence speed and accuracy of the global model has significant application value. Summary of the Invention

[0004] Purpose of the Invention: Due to the limited storage and computing power of inspection equipment, new data collected by the equipment continuously overwrites old data, and the data distribution on the equipment changes dynamically over time. In this situation, using federated learning to train deep learning models can lead to the aggregated global model forgetting old data features, resulting in slower global model convergence and a sharp decrease in accuracy. To alleviate the global model forgetting caused by local model update bias during global aggregation, this invention is based on a federated learning dynamic aggregation optimization method. It dynamically calculates the global aggregation weights of the equipment based on the consistency of the model on the equipment and integrates multiple up-to-date historical global models on an average basis on the cloud server. This effectively prevents the global model from forgetting old data features, accelerating global model convergence while improving the accuracy and availability of global model training.

[0005] Technical Solution: A federated dynamic aggregation optimization method for unmanned inspection equipment. K unmanned inspection devices participating in federated training calculate and upload their respective model consistency coefficients and updated local model parameters locally. The cloud server calculates the aggregation weights of the uploaded local models and performs global aggregation based on these weights. The cloud server integrates multiple latest historical global model parameters as the new round of global integration parameters and distributes them to the K devices participating in federated training for the next round of training. The method includes the following steps:

[0006] Step 1) In the t-th round of federated training, the cloud server randomly selects K devices from all the inspected devices to participate in the current round of federated training. The cloud server will integrate the global parameters. The data is distributed to the K devices participating in the federated training. The K selected devices then receive the global integration parameters sent by the cloud server. Then, proceed with steps 2) through 4);

[0007] Step 2) Construct a consistency dynamic calculation method based on model output: The k-th device uses the local dataset D k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server;

[0008] Step 3) Construct a federated weighted aggregation method based on model consistency: The cloud server uses the model consistency coefficient uploaded by the k-th device. Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ;

[0009] Step 4) Construct a global model correction method based on historical model integration: The cloud server integrates M of the latest historical global model parameters w on average through a sliding window. t w t-1 w t-2 , ..., w t-M+1 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of federated training; steps 1) to 4) are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements.

[0010] In step 1), at the start of each round of federated training, the cloud server randomly selects K devices from all the inspected devices to participate in that round of training. The selected K devices receive the global integration parameters sent by the cloud server. Then, proceed with steps 2) through 4).

[0011] In step 2), the consistency dynamic calculation method based on model output is constructed. Assume there are a total of T rounds of federated training, K inspection devices participate in the training, and c is the number of devices. k With local dataset D k The dataset contains C classes of samples, where each sample is represented as... If the corresponding label of the sample is y, then in the t-th round of federated training, device c k The local model update target is as follows:

[0012]

[0013] in, It is a composite loss function. The local model parameters of device ck during the t-th round of federated training. In local dataset D k Perform mini-batch stochastic gradient descent (SGD) steps on device c. k The local model update is shown below:

[0014]

[0015] Where η represents the learning rate, Let f(·) represent the b-th mini-batch of data randomly selected from dataset Dk, where B represents the total number of mini-batch data, r represents the total number of local update iterations, and f(·) represents the stochastic gradient descent function. Let represent the local model parameters obtained by device ck after r local update iterations. Indicates the device ck in the local model parameters The vector output for sample x is then... The calculation is as follows:

[0016]

[0017] Among them, z i,k This represents the Logits output of device ck on the i-th type of sample. The classification probability vector p is obtained through the softmax function, as shown below:

[0018] p = [p 1,k ,p 2,k ,...,p i,k ,…,p C,k ]

[0019] Where, p i,k Indicates device c k The classification probability of the i-th class sample. Let F k If (w) is the device-local training loss function, then F k The calculation of (w) is as follows:

[0020]

[0021] Where w represents the global model parameters, h k This represents the knowledge learned by the local model. To prevent the local model updates from deviating from the optimal direction, the loss function F is trained locally. k Add a constraint term μ to (w) as follows:

[0022]

[0023] Output Logits vector from the local model on device ck variance As a consistency coefficient, the consistency of the local model is measured, as shown below:

[0024]

[0025] Where Var(·) represents the variance of the local model output Logits vector for sample x in the C classification task. Device c k Update the local model parameters And model consistency coefficient Uploaded to the cloud server for global aggregation.

[0026] In step 3) of constructing the federated weighted aggregation method based on model consistency, the k-th device will update the local model parameters. And model consistency coefficient After being uploaded to the cloud server, the cloud server will process the data according to the specified parameters. Calculate the aggregate weight of the local model parameters uploaded by the k-th device. Then the first t The aggregate weight of the k-th device in the round of federated training The calculation method is as follows:

[0027]

[0028] The cloud server calculates the aggregate weight. The local model parameters uploaded by the aggregation device are as follows:

[0029]

[0030] Among them, w t This represents the global model parameters obtained by the cloud server through global aggregation in the t-th round of federated training.

[0031] In step 4), a global model correction method based on historical model ensemble is constructed. In the t-th round of federated training, the cloud server integrates M of the latest historical global model parameters w through a sliding window on average. t w t-1 w t-2 , ..., w t-M+1 To guide the global model to update in the optimal direction, let... If it is the integrated global integration parameter, then The calculation is as follows:

[0032]

[0033] The cloud server will integrate the obtained The global ensemble parameters for the (t+1)th round of federated training are distributed to K randomly selected inspection devices for a new round of federated training. During the model training process, steps 1) to 4) are iterated until the global model converges and meets the expected performance requirements.

[0034] In a federated dynamic aggregation optimization method for unmanned inspection equipment, K inspection devices participating in federated training calculate and upload their respective model consistency coefficients and updated local model parameters locally. The cloud server calculates the aggregation weight of each local model and performs global aggregation based on the weight. The cloud server integrates an average of M latest historical global model parameters as the new round of global integration parameters and distributes them to the K devices participating in federated training for the next round of training, until the global model converges and meets the expected performance requirements.

[0035] A federated dynamic aggregation optimization system for unmanned inspection equipment includes the following modules:

[0036] The first module, in the... t During the federal training round, the cloud server randomly selects from all the inspection equipment. K Each device participates in the current round of federated training, and the server will globally integrate the parameters. Distributed to the equipment used in the training;

[0037] The second module constructs a consistency dynamic calculation method based on model output: the k-th device uses the local dataset D. k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server;

[0038] The third module constructs a federated weighted aggregation method based on model consistency: the cloud server uses the data uploaded by the k-th device... Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ;

[0039] The fourth module constructs a global model correction method based on historical model integration: the cloud server integrates M of the latest historical global model parameters w using a sliding window. t w t-1 w t-2 , ..., w t-M+1 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of federated training; the first to fourth modules are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements.

[0040] The specific implementation process and methods of the system are the same, and will not be repeated here.

[0041] An unmanned inspection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the federated dynamic aggregation optimization method for unmanned inspection devices as described above.

[0042] An unmanned inspection device readable storage medium stores a computer program that executes the federated dynamic aggregation optimization method for unmanned inspection devices as described above.

[0043] Beneficial effects: Compared with the prior art, the federated dynamic aggregation optimization method and system for unmanned inspection equipment provided by the present invention accelerates the convergence speed of the global model by dynamically calculating the consistency coefficient of the model on the inspection equipment and assigning different global aggregation weights to each equipment; the cloud server integrates M of the latest historical global model parameters on average through a sliding window as global model parameters for the next round of federated training, guiding the global model to update in the optimal direction and improving the accuracy of the global model.

[0044] Because most inspection devices have small storage capacity, limited energy, and highly heterogeneous collected data, new data received by the devices constantly overwrites old data. The local data distribution of the devices changes dynamically over time, causing the update direction of the local model to differ significantly from the update direction of previous rounds. The global model, after aggregating the local models, forgets the characteristics of the old data, resulting in a significant decrease in the convergence speed and accuracy of the global model, and even rendering the global model unusable. Therefore, calculating the model consistency of the inspection devices and assigning them different aggregation weights can effectively prevent local model update deviations from the optimal direction of the global model, accelerating the convergence speed of the global model while improving its accuracy. In each round of federated training, the model consistency coefficient is first calculated locally on the inspection device, and the local model is updated. Then, the cloud server calculates the aggregation weight of the device based on the consistency coefficient uploaded by the device and aggregates all uploaded local models according to the weight. Finally, the cloud server integrates an average of M of the latest historical global model parameters as the global integration parameters for the next round of federated training and distributes them to K randomly selected devices. Attached Figure Description

[0045] Figure 1 This is a schematic diagram of the method in an example of the present invention. Detailed Implementation

[0046] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0047] A federated dynamic aggregation optimization method for unmanned inspection equipment first calculates the model consistency coefficient locally on the inspection equipment and updates the local model in each round of federated training. Then, the cloud server calculates the aggregation weight of the equipment based on the consistency coefficient uploaded by the equipment and aggregates all uploaded local models according to the weight. Finally, the cloud server integrates an average of M=5 of the latest historical global model parameters as the global integration parameters for the next round of federated training. This effectively prevents the global model update from deviating from the optimal direction due to local model update bias, thereby accelerating the convergence speed of the global model and improving the accuracy and usability of global model training. Experiments show that integrating 5 historical global models can achieve the best global model accuracy; therefore, this embodiment integrates 5 models.

[0048] like Figure 1 As shown, in the federated dynamic aggregation optimization method for unmanned inspection equipment, the K inspection devices participating in federated training calculate and upload their respective model consistency coefficients and updated local model parameters locally. The cloud server calculates the aggregation weight of each local model and performs global aggregation based on this weight. The cloud server integrates an average of M = 5 of the latest historical global model parameters as the new round of global integration parameters and distributes them to the K devices participating in federated training for the next round of training, until the global model converges and reaches the expected performance requirements. The process includes the following steps:

[0049] Step 1) In the t-th round of federated training, the cloud server randomly selects K devices from all the inspected devices to participate in the current round of federated training. The cloud server will integrate the global parameters. The data is distributed to the K devices participating in the federated training. The K selected devices then receive the global integration parameters sent by the cloud server. Then, proceed with steps 2) through 4);

[0050] Step 2) Construct a consistency dynamic calculation method based on model output: The k-th device uses the local dataset D k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server;

[0051] Step 3) Construct a federated weighted aggregation method based on model consistency: The cloud server is based on the data uploaded by the k-th device. Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ;

[0052] Step 4) Construct a global model correction method based on historical model integration: The cloud server integrates M=5 of the latest historical global model parameters w using a sliding window. t w t-1 w t-2 , ..., w t-4 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of federated training; steps 1) to 4) are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements.

[0053] In step 1), at the start of each round of federated training, the cloud server randomly selects K devices from all the inspected devices to participate in that round of training. The selected K devices receive the global integration parameters sent by the cloud server. Then, proceed with steps 2) through 4).

[0054] In step 2), the consistency dynamic calculation method based on model output is constructed. Assume there are a total of T rounds of federated training, K inspection devices participate in the training, and c is the number of devices. k With local dataset D k The dataset contains C classes of samples, where each sample is represented as... If the corresponding label of the sample is y, then in the t-th round of federated training, device c k The local model update target is as follows:

[0055]

[0056] in, It is a composite loss function. In the t-th round of federated training, device c... k Local model parameters In local dataset D k Perform mini-batch stochastic gradient descent (SGD) steps on device c. k The local model update is shown below:

[0057]

[0058] Where η represents the learning rate, Let f(·) represent the b-th mini-batch of data randomly selected from dataset Dk, where B represents the total number of mini-batch data, r represents the total number of local update iterations, and f(·) represents the stochastic gradient descent function. Let represent the local model parameters obtained by device ck after r local update iterations. Indicates device ck Local model parameters The vector output for sample x is then... The calculation is as follows:

[0059]

[0060] Among them, z i,k Indicates device c k The output of Logits on the i-th class of samples. The classification probability vector p obtained through the softmax function is shown below:

[0061] p = [p 1,k ,p 2,k ,...,p i,k ,...,p C,k ]

[0062] Where, p i,k Let F represent the classification probability of device ck in the i-th class of samples. k If (w) is the device-local training loss function, then F k The calculation of (w) is as follows:

[0063]

[0064] Where w represents the global model parameters, h k This represents the knowledge learned by the local model. To prevent the local model updates from deviating from the optimal direction, the loss function F is trained locally. k Add a constraint term μ to (w) as follows:

[0065]

[0066] Output Logits vector from the local model on device ck variance As a consistency coefficient, the consistency of the local model is measured, as shown below:

[0067]

[0068] Where Var(·) represents the variance of the local model output Logits vector for sample x in the C classification task. Device c k Update the local model parameters And model consistency coefficient Uploaded to the cloud server for global aggregation.

[0069] In step 3) of constructing the federated weighted aggregation method based on model consistency, the k-th device will update the local model parameters. And model consistency coefficient After being uploaded to the cloud server, the cloud server will process the data according to the specified parameters. Calculate the aggregate weight of the local model parameters uploaded by the k-th device. Then the aggregate weight of the k-th device in the t-th round of federated training The calculation method is as follows:

[0070]

[0071] The cloud server calculates the aggregate weight. The local model parameters uploaded by the aggregation device are as follows:

[0072]

[0073] Among them, w t This represents the global model parameters obtained by the cloud server through global aggregation in the t-th round of federated training.

[0074] In step 4), a global model correction method based on historical model ensemble is constructed. In the t-th round of federated training, the cloud server integrates M = 5 of the latest historical global model parameters w through a sliding window on average. t w t-1 w t-2 , ..., w t-4 To guide the global model to update in the optimal direction, let... If it is the integrated global integration parameter, then The calculation is as follows:

[0075]

[0076] The cloud server will integrate the obtained The global ensemble parameters for the (t+1)th round of federated training are distributed to K randomly selected inspection devices for a new round of federated training. During the model training process, steps 1) to 4) are iterated until the global model converges and meets the expected performance requirements.

[0077] The inspection equipment includes terminal devices such as cameras and sensors. Each inspection device has its own local dataset (not limited to one type) and collaboratively trains the global model using a federated learning algorithm. In each round of federated training, the cloud server randomly selects K devices from the inspection device group to participate in the training. The selected K devices calculate their consistency coefficient locally, and then the cloud server calculates the corresponding aggregation weights and aggregates the uploaded local models according to these weights. Finally, the cloud server integrates an average of M = 5 of the latest historical global model parameters as the global integration parameters for the next round of federated training and distributes them to the randomly selected K devices.

[0078] The federated dynamic aggregation optimization system for unmanned inspection equipment includes the following modules:

[0079] In the first module, during the t-th round of federated training, the cloud server randomly selects K devices from all inspected devices to participate in the current round of federated training. The server will then integrate the global parameters. Distributed to the equipment used in the training;

[0080] The second module constructs a consistency dynamic calculation method based on model output: the k-th device uses the local dataset D. k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server;

[0081] The third module constructs a federated weighted aggregation method based on model consistency: the cloud server uses the data uploaded by the k-th device... Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ;

[0082] The fourth module constructs a global model correction method based on historical model integration: the cloud server integrates M=5 of the latest historical global model parameters w using a sliding window. t w t-1 w t-2 , ..., w t-4 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of joint training; the first to fourth modules are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements.

[0083] It is evident that those skilled in the art will understand that the steps of the federated dynamic aggregation optimization method for unmanned inspection equipment or the modules of the federated dynamic aggregation optimization system for unmanned inspection equipment described in the above embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by the computing device. Furthermore, in some cases, the steps shown or described can be performed in a different order than presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the embodiments of the present invention are not limited to any particular hardware and software combination.

Claims

1. A federated dynamic aggregation optimization method for unmanned inspection equipment, characterized in that, Includes the following steps: Step 1) In the t-th round of federated training, the cloud server randomly selects K devices from all the inspected devices to participate in the current round of federated training. The cloud server will integrate the global parameters. The data is distributed to the K devices participating in the federated training. The K selected devices then receive the global integration parameters sent by the cloud server. Then, proceed with steps 2) through 4); Step 2) Construct a consistency dynamic calculation method based on model output: The k-th device uses the local dataset D k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server; Step 3) Construct a federated weighted aggregation method based on model consistency: The cloud server uses the model consistency coefficient uploaded by the k-th device. Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ; Step 4) Construct a global model correction method based on historical model integration: The cloud server integrates M of the latest historical global model parameters w on average through a sliding window. t w t-1 w t-2 , ..., w t-M+1 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of federated training; steps 1) to 4) are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements. In step 2), the consistency dynamic calculation method based on model output is constructed. Assume there are a total of T rounds of federated training, K inspection devices participate in the training, and c is the number of devices. k With local dataset D k The dataset contains C classes of samples, where each sample is represented as... If the corresponding label of the sample is y, then in the t-th round of federated training, device c k The local model update target is as follows: in, It is a composite loss function, where device c is in the t-th round of federated training. k Local model parameters In local dataset D k Perform mini-batch stochastic gradient descent steps on device c. k The local model update is shown below: Where η represents the learning rate, Indicates from dataset D k Let b be the b-th randomly selected mini-batch data, B represent the total number of mini-batch data, r represent the total number of local update iterations, and f(·) represent the stochastic gradient descent function. Indicates device c k The local model parameters obtained after r local update iterations; let... Indicates device c k Local model parameters The vector output for sample x is then... The calculation is as follows: Among them, z i,k Indicates device c k The Logits output for the i-th class of samples; The classification probability vector p is obtained through the softmax function, as shown below: p=[p 1,k ,p 2,k ,…,p i,k ,…,p C,k ] Where, p i,k Indicates device c k The classification probability on the i-th class sample; let F k If (w) is the device-local training loss function, then F k The calculation of (w) is as follows: Where w represents the global model parameters, h k This represents the knowledge learned by the local model; to prevent the device's local model updates from deviating from the optimal direction, the loss function F is trained locally. k Add a constraint term μ to (w) as follows: Device C k The local model outputs Logits vectors. variance As a consistency coefficient, the consistency of the local model is measured, as shown below: Where Var(·) represents the variance of the local model output Logits vector for sample x in the C classification task, and device c k Update the local model parameters And model consistency coefficient Uploaded to the cloud server for global aggregation.

2. The federated dynamic aggregation optimization method for unmanned inspection equipment according to claim 1, characterized in that, In step 3) of constructing the federated weighted aggregation method based on model consistency, the k-th device will update the local model parameters. And model consistency coefficient After being uploaded to the cloud server, the cloud server will process the data according to the specified parameters. Calculate the aggregate weight of the local model parameters uploaded by the k-th device. Then the aggregate weight of the k-th device in the t-th round of federated training The calculation method is as follows: The cloud server calculates the aggregate weight. The local model parameters uploaded by the aggregation device are as follows: Among them, w t This represents the global model parameters obtained by the cloud server through global aggregation in the t-th round of federated training.

3. The federated dynamic aggregation optimization method for unmanned inspection equipment according to claim 1, characterized in that, In step 4), a global model correction method based on historical model ensemble is constructed. In the t-th round of federated training, the cloud server integrates M of the latest historical global model parameters w through a sliding window on average. t w t-1 w t-2 , ..., w t-M+1 To guide the global model to update in the optimal direction, let... If it is the integrated global integration parameter, then The calculation is as follows: The cloud server will integrate the obtained The global ensemble parameters for the (t+1)th round of federated training are distributed to K randomly selected inspection devices for a new round of federated training. During the model training process, steps 1) to 4) are iterated until the global model converges and meets the expected performance requirements.

4. A federated dynamic aggregation optimization system for unmanned inspection equipment, characterized in that, Includes the following modules: In the first module, during the t-th round of federated training, the cloud server randomly selects K devices from all inspected devices to participate in the current round of federated training. The server will then integrate the global parameters. Distributed to the equipment used in the training; The second module constructs a consistency dynamic calculation method based on model output: the k-th device uses the local dataset D. k Iterate e times to update the local model parameters Then, based on the Logits output by the model on the k-th device, the model consistency coefficient is dynamically calculated. The k-th device will calculate the model consistency coefficient. and updated local model parameters Uploaded to the cloud server; The third module constructs a federated weighted aggregation method based on model consistency: the cloud server uses the data uploaded by the k-th device... Calculate the aggregate weight of the k-th device Then, based on this weight, the local model parameters uploaded by all devices are aggregated to obtain the global model parameters w for the t-th round of federated training. t ; The fourth module constructs a global model correction method based on historical model integration: the cloud server integrates M of the latest historical global model parameters w using a sliding window. t w t-1 w t-2 , ..., w t-M+1 Obtain the integrated global integration parameters cloud servers will The global ensemble parameters are distributed to K randomly selected devices in the (t+1)th round of federated training; the first to fourth modules are executed sequentially in each round of model training until the global model converges and meets the expected performance requirements. In the second module, which constructs a consistency dynamic calculation method based on model output, there are a total of T rounds of federated training, with K inspection devices participating in the training, and c per device. k With local dataset D k The dataset contains C classes of samples, where each sample is represented as... If the corresponding label of the sample is y, then in the t-th round of federated training, device c k The local model update target is as follows: in, It is a composite loss function, where device c is in the t-th round of federated training. k Local model parameters In local dataset D k Perform mini-batch stochastic gradient descent steps on device c. k The local model update is shown below: Where η represents the learning rate, Indicates from dataset D k Let b be the b-th randomly selected mini-batch data, B represent the total number of mini-batch data, r represent the total number of local update iterations, and f(·) represent the stochastic gradient descent function. Indicates device c k The local model parameters obtained after r local update iterations; let... Indicates device c k Local model parameters The vector output for sample x is then... The calculation is as follows: Among them, z i,k Indicates device c k The Logits output for the i-th class of samples; The classification probability vector p is obtained through the softmax function, as shown below: p=[p 1,k ,p 2,k ,…,p i,k ,…,p C,k ] Where, p i,k Indicates device c k The classification probability on the i-th class sample; let F k If (w) is the device-local training loss function, then F k The calculation of (w) is as follows: Where w represents the global model parameters, h k This represents the knowledge learned by the local model; to prevent the device's local model updates from deviating from the optimal direction, the loss function F is trained locally. k Add a constraint term μ to (w) as follows: Device C k The local model outputs Logits vectors. variance As a consistency coefficient, the consistency of the local model is measured, as shown below: Where Var(·) represents the variance of the local model output Logits vector for sample x in the C classification task, and device c k Update the local model parameters And model consistency coefficient Uploaded to the cloud server for global aggregation.

5. An unmanned inspection device, characterized in that: The unmanned inspection device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the federated dynamic aggregation optimization method for unmanned inspection devices as described in any one of claims 1-3.

6. A readable storage medium for unmanned inspection equipment, characterized in that: The unmanned inspection device has a readable storage medium storing a computer program that executes the federated dynamic aggregation optimization method for unmanned inspection devices as described in any one of claims 1-3.