Federal learning optimization method based on industrial small sample defect detection

By employing distribution feature distillation and model knowledge reliability assessment methods in federated learning, the problems of insufficient model accuracy and slow convergence speed in industrial small-sample defect detection are solved, achieving more efficient cross-domain knowledge sharing and model optimization.

CN120706512BActive Publication Date: 2025-11-28HANGZHOU QOGORI TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511217380.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-28
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

In industrial manufacturing, traditional centralized machine learning models suffer from high communication costs, privacy risks, and insufficient generalization ability of detection models when sharing data across domains. In particular, in heterogeneous scenarios, the non-independent and identically distributed problem of federated learning leads to a decline in model performance.

Method used

A local training method based on distribution feature distillation is adopted. By analyzing the distribution characteristics of sample soft labels, the weak knowledge of the local model is supplemented, and the client contribution weight is reasonably allocated through model knowledge reliability assessment to optimize the aggregation process of the global model.

Benefits of technology

It improves the accuracy and convergence speed of industrial small-sample defect detection models, reduces communication overhead, and enhances the model's generalization ability and representativeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706512B_ABST
    Figure CN120706512B_ABST
Patent Text Reader

Abstract

The application discloses a federal learning optimization method based on industrial small sample defect detection. In local training, the distribution characteristics of sample soft labels are extracted, the knowledge reliability of a global industrial small sample defect detection model and a local industrial small sample defect detection model on different categories is measured, and then the distribution feature distillation method is used to supplement the weak knowledge of the local model on specific categories from the global model, so that the collaborative learning and fusion of local knowledge and non-local knowledge are realized. Meanwhile, according to the relative reliability of the knowledge of the client industrial small sample defect detection model, the contribution weight of each client model in the server aggregation stage is reasonably distributed, so that a global industrial small sample defect detection model with better representativeness and generalization ability is obtained, and the overall prediction performance of the global model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of cloud collaborative distributed machine learning, and is suitable for a collaborative computing scenario across production lines and enterprises in intelligent manufacturing, such as cloud collaborative modeling in industrial small sample defect detection, and in particular to a federated learning optimization method based on industrial small sample defect detection. BACKGROUND

[0002] In recent years, with the rapid development of mobile Internet, Internet of Things and various intelligent devices, a large amount of data has been generated in various industries, which has gradually become the core driving force for technological innovation and industrial upgrading. In the field of industrial manufacturing, product quality control and defect detection are key links to ensure production efficiency and product reliability. However, traditional industrial defect detection technology faces many challenges: on the one hand, the number of defect samples in industrial scenarios is small and the cost of labeling is high, which makes the detection model based on deep learning prone to limited generalization ability due to insufficient training data; on the other hand, the differences in equipment, process parameters and environmental changes between different production lines or factories make the defect features in the cross-domain cloud collaborative scenario show significant distribution shift, further increasing the difficulty of adapting the detection algorithm. In addition, industrial data usually involves sensitive production parameters and equipment information, and centralized data sharing mode may cause privacy leakage risk, which restricts the feasibility of cross-enterprise collaboration.

[0003] Traditional centralized machine learning mode usually uploads scattered data to the cloud server for unified storage, processing and model training. Although this method can alleviate the heterogeneity problem through centralized data cleaning, its limitations are particularly prominent in industrial scenarios: first, the data generated by industrial equipment is large in volume and requires real-time processing, centralized transmission will bring high communication cost and storage pressure; second, the data privacy barriers between production lines make it difficult to integrate cross-domain data, hindering the optimization of global models; finally, the value of small sample defect data cannot be fully tapped through a single data source, resulting in insufficient recognition ability of the detection model for rare defects. Therefore, how to realize cross-domain knowledge sharing while ensuring data privacy and improve the defect detection accuracy in small sample scenarios has become a bottleneck that needs to be broken through in the process of industrial intelligent transformation.

[0004] As a new distributed learning paradigm, federated learning provides a new way to solve the above problems. The core idea is to complete model training on the user's local device, avoid the centralized transmission of raw data, and only share model parameters or gradient information, thereby reducing communication overhead while ensuring data privacy. Under this framework, each factory or device can independently train the model using local data (including a small number of defect samples), upload encrypted model parameters to the central server for aggregation, generate a global detection model, and synchronize it to all participants. This "data does not leave the local" mode effectively avoids the risk of leakage of industrial sensitive information, and provides a technical basis for joint mining of cross-domain data value.

[0005] However, due to the differences in industrial equipment performance and the complexity of application scenarios, large-scale distributed data often exhibits obvious heterogeneous characteristics, including differences in data size, distribution, and class composition. This heterogeneity increases the complexity of data fusion and cross-domain modeling, thereby hindering the deep mining of data value to some extent. In the federated learning framework, this phenomenon is collectively referred to as the non-identically distributed problem. Specifically, the data held by each client (such as different production lines) often has significant differences due to differences in data sources, application backgrounds, and user behavior, leading to imbalanced sample distribution and other characteristics. The non-identically distributed problem has a significant negative impact on federated learning. Since local model training heavily depends on the client's own data, which has distribution bias, its training direction may deviate from the overall optimal goal, forming the so-called client drift phenomenon. This drift not only slows down the convergence speed of the global model, but also makes it difficult for the server to obtain an effective global representation when aggregating local models, ultimately affecting the overall model performance.

[0006] How to alleviate the adverse effects of data heterogeneity on model performance has become one of the key problems in the field of federated learning. To this end, researchers have proposed various improvement strategies to address this challenge. First, in terms of local algorithms on the client side, research has focused on improving training strategies. For example, methods based on loss function regularization introduce a regularization term to constrain the update direction of local model parameters, aiming to prevent model overfitting to local data and thus alleviate the client drift phenomenon caused by heterogeneity. Although this method can improve model stability to some extent, its learning efficiency is often limited by the regularization mechanism itself, and it relies heavily on the design quality of the algorithm, which may affect the full learning of local data knowledge. Another approach is the optimization strategy based on knowledge distillation. Compared to traditional regularization terms, this method introduces a distillation loss to use the knowledge of the global model to guide local model training, thereby preserving the overall knowledge structure during training and reducing the loss of global information. However, this method also has limitations: local models rely heavily on global models during learning, and when the global model performs poorly on certain categories, it may mislead local training; at the same time, the efficiency of local knowledge extraction also limits the overall training effect. In addition, since the training still relies on the data distribution of each client, the model still has difficulty learning generalization knowledge beyond local data in highly heterogeneous scenarios, resulting in reduced convergence speed of the overall model. Second, in terms of aggregation mechanisms on the server side, researchers have also worked to improve the update strategy of the global model. For example, by designing more reasonable aggregation algorithms, the fusion ability of models from different distribution clients is enhanced, thereby improving the performance of the final global model under heterogeneous data. This strategy attempts to build a more representative global model in the presence of significant client differences, reducing information loss during aggregation and improving precision and generalization ability. However, the performance of this method is highly dependent on the quality of the client model itself, and its ability to alleviate severe client drift is still limited. Finally, optimization methods from the data level have also been widely explored. By sharing a small amount of public data among clients or using generative models to synthesize virtual samples, the differences between data distributions are attempted to be bridged. These methods have alleviated the data heterogeneity problem to some extent, but have also brought challenges in privacy and performance. On the one hand, sharing data may leak sensitive user information; on the other hand, generating high-quality virtual data often requires high capabilities of the generator, requiring a large amount of computational resources and potentially causing a large communication burden, thus limiting the practicality of this method in resource-constrained scenarios. SUMMARY

[0007] In order to better cope with the cloud collaborative modeling of industrial small sample defect detection, in view of the problems of insufficient precision and slow convergence speed of global industrial small sample defect detection model in the heterogeneous environment faced by federated learning, the application proposes a federated learning optimization method based on industrial small sample defect detection from the two aspects of local training and model aggregation. The application mainly includes two parts:

[0008] The first part, the application proposes a local training method based on distribution feature distillation. The core idea of this part is to extract the distribution characteristics of the sample soft label, measure the knowledge reliability of the global industrial small sample defect detection model and the local industrial small sample defect detection model in different categories, and then use the distribution feature distillation method to supplement the weak knowledge of the local model in a specific category from the global model, realize the collaborative learning and fusion of local knowledge and non-local knowledge.

[0009] The second part, the application proposes an aggregation method based on model knowledge reliability. The core idea of this part is to evaluate the relative reliability of the knowledge of each client industrial small sample defect detection model, reasonably allocate the contribution weight of each client model in the server aggregation stage, so as to obtain a global industrial small sample defect detection model with better representativeness and generalization ability, and improve the overall prediction performance of the global model.

[0010] Combined with the typical federated learning training process, the federated learning optimization method based on industrial small sample defect detection is implemented by the following steps, wherein the local training method based on distribution feature distillation mainly involves steps (2.1) to (2.4), and the aggregation method based on model knowledge reliability involves step (4):

[0011] Step (1). In each communication round, the server end selects clients from the set of all clients according to the sampling ratio to construct the client set , , where n represents the current communication round number. The server end sends the global industrial small sample defect detection model to the selected clients. For each client , the local industrial small sample defect detection model is initialized to based on the global model weight of the current communication round.

[0012] Step (2). Based on the local data of the client, the local training is carried out at the client. The local training program of the client includes times of loop training, and each loop training includes the following steps.

[0013] Step (2.1). The client computes the local dataset The class knowledge reliability of the global industrial small sample defect detection model is calculated and the class knowledge reliability of the local industrial small sample defect detection model , and determines the unreliable class set based on both . Wherein, represents the feature set of the data sample, represents the label set of the data sample.

[0014] Step (2.2). Based on the unreliable class set , the correction weight of the soft label distribution of the teacher model (i.e. the global model) is obtained ; for each training sample , represents the feature of the sample, is the real class to which the sample belongs, and the correction weight of the soft label distribution of the student model (i.e. the client model) is defined as .

[0015] Step (2.3). Constructing a distribution feature-based distillation loss term In the local training process, for any training sample , the teacher model prediction probability distribution is modified using the correction weight to obtain , and the student model prediction probability distribution is modified using the correction weight to obtain . Then, the distribution feature-based distillation loss term is composed of the KL divergence between the weighted and corrected prediction probability distribution and :

[0016]

[0017] Wherein, represents the probability of the teacher model predicting that the sample belongs to class , represents the probability of the student model predicting that the sample belongs to class , is the total number of classes.

[0018] Step (2.4). Constructing the total loss function for training the local industrial small sample defect detection model The total loss function of the local model training . The distribution feature-based distillation loss term proposed in step (2.3) and the traditional federated training cross-entropy loss term comprise. The client local model minimizes the total loss function on the local data set , thereby optimizing the local training process of the client in federated learning. The total loss function of the local model training is calculated as follows:

[0019]

[0020]

[0021] wherein, the label category is consistent with the sample true label category , and is 1, otherwise 0.

[0022] Step (3). After the client iteration training is completed, the client uploads the local industrial small sample defect detection model parameters to the server end.

[0023] Step (4). After the server end receives the industrial small sample defect detection model of each client, the relative reliability of the knowledge of each client model is calculated using a small amount of non-shared data set , and then the updated global industrial small sample defect detection model is generated based on the model knowledge reliability. The global model weight aggregation formula is as follows:

[0024]

[0025] wherein, denotes the global model obtained by aggregation in the th round, denotes the model parameters uploaded by the client after the local training in the first th round, is the total number of clients selected in the current round.

[0026] The present application has the following advantages:

[0027] The federated learning optimization method proposed in the present application consists of a local training method based on distribution feature distillation and an aggregation method based on model knowledge reliability.

[0028] (1) The local training method based on distribution feature distillation measures the knowledge reliability of the global industrial small sample defect detection model and the local industrial small sample defect detection model in each category by analyzing the distribution characteristics of the sample soft label, and then uses the distribution feature distillation method to supplement the weak knowledge of the local model in a specific category from the global model, thereby realizing the collaborative learning and fusion of local knowledge and non-local knowledge.

[0029] (2) The aggregation method based on model knowledge reliability assesses the relative reliability of the knowledge of each client industrial small sample defect detection model, reasonably allocates the contribution weight of each client model in the server aggregation stage, and thus obtains a global industrial small sample defect detection model with better representativeness and generalization ability, and improves the overall prediction performance of the global model. BRIEF DESCRIPTION OF DRAWINGS

[0030] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this specification, illustrate the preferred embodiments of the application and together with the description serve to explain the principles of the application. In the drawings, like reference numerals refer to like parts throughout the several views.

[0031] In the drawings:

[0032] Figure 1 is a framework flowchart of the federated learning optimization method based on industrial small sample defect detection of the application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the embodiments of the specification will be clearly and completely described below in conjunction with the drawings. Obviously, the described embodiments are only some of the embodiments of the specification, not all.

[0034] The application proposes a federated learning optimization method based on industrial small sample defect detection, Figure 1 is a framework flowchart of the federated learning optimization method based on industrial small sample defect detection of the application, as Figure 1 shown, the overall framework of the application is composed of a local training method based on distribution feature distillation and an aggregation method based on model knowledge reliability. First, in the federated learning client training stage, the application extracts the distribution characteristics of sample soft labels, measures the knowledge reliability of the global industrial small sample defect detection model and the local industrial small sample defect detection model in different categories, and then uses the distribution feature distillation method to supplement the weak knowledge of the local model in a specific category from the global model, realizing the collaborative learning and fusion of local knowledge and non-local knowledge. Secondly, in the server aggregation stage, the application assesses the relative reliability of the knowledge of each client industrial small sample defect detection model, reasonably allocates the contribution weight of each client model in the server aggregation stage, and thus obtains a global industrial small sample defect detection model with better representativeness and generalization ability, and improves the overall prediction performance of the global model.

[0035] Next, the implementation steps will be described in detail.

[0036] Step (1). At each communication round, the server side randomly samples a subset of clients from the whole set of clients according to a sampling ratio to form a client set . denotes the current communication round number. The server side distributes the global industrial few-shot defect detection model to the selected clients. For each client , the local industrial few-shot defect detection model is initialized as based on the global model weights of the current communication round.

[0037] Step (2). Based on the local data of the clients, the local training is performed at the clients. The local training procedure of the clients contains a number of loop training, and each loop training contains the following steps.

[0038] Step (2.1). The client calculates the class knowledge reliability of the global industrial few-shot defect detection model and the class knowledge reliability of the local industrial few-shot defect detection model on the local data set , and determines the unreliable class set based on the two. Wherein, denotes the feature set of the data sample, denotes the label set of the data sample.

[0039] First, for any training sample , the soft label output of the model is denoted as , where is the total number of classes. The sum of all components in the soft label is 1. It is assumed that the soft label distribution of the non-real class item is denoted as , that is:

[0040]

[0041] The prediction reliability of the sample is defined as , which is the inverse of the sum of the mean and standard deviation of , that is:

[0042]

[0043] wherein, denotes the mean of the soft label distribution excluding the real class item, denotes the standard deviation of the soft label distribution excluding the real class item.

[0044] Secondly, the class knowledge reliability of the model is further defined. Before each local iteration, the prediction reliability of each class sample in the local dataset is counted, and the average value is obtained as the class knowledge reliability of the model. Specifically, the class knowledge reliability of the model is represented as , the knowledge reliability of any class is defined as follows:

[0045]

[0046] , wherein represents the total number of samples with the real class . Based on this, the class knowledge reliability of the global industrial small sample defect detection model and the class knowledge reliability of the local industrial small sample defect detection model can be calculated respectively.

[0047] Thirdly, the unreliable class set is defined based on the class knowledge reliability of the model. For any class, if the knowledge reliability of the local model on the class is lower than the knowledge reliability of the global model on the class, the class is added to the unreliable class set. In addition, for the classes not contained in the local dataset, they are also included in the unreliable class set. The construction rule of the unreliable class set can be represented as:

[0048]

[0049] , wherein represents the class set contained in the local dataset of the client , and represents the set of all classes.

[0050] Step (2.2). Based on the unreliable class set , the correction weight of the soft label distribution of the teacher model (i.e. the global model) is obtained ; for each training sample , represents the feature of the sample, is the real class to which the sample belongs, and the correction weight of the soft label distribution of the student model (i.e. the client model) is defined as .

[0051] represents the correction value for any class , and is calculated as follows:

[0052]

[0053] represents the correction value for any class The modified value of the correction value is calculated as follows:

[0054]

[0055] Step (2.3). Constructing the distribution feature-based distillation loss term During the local training process, for any training sample , the teacher model prediction probability distribution is modified using the correction weight to obtain , and the student model prediction probability distribution is modified using the correction weight to obtain .

[0056] The probability that the teacher model predicts that the sample belongs to class is represented as , and is calculated as follows:

[0057]

[0058] The probability that the student model predicts that the sample belongs to class is represented as , and is calculated as follows:

[0059]

[0060] where represents the logits output of the teacher model for class , represents the logits output of the student model for class , is the temperature coefficient.

[0061] Then, the distribution feature-based distillation loss term is composed of the KL divergence between the weighted and modified prediction probability distribution and :

[0062]

[0063] where is the total number of classes.

[0064] Step (2.4). Constructing the total loss function for training the local industrial small sample defect detection model The total loss function for local model training is composed of the distribution feature-based distillation loss term proposed in step (2.3) and the traditional federated training cross-entropy loss term . The client local model is trained according to the total loss function on the local data set The upper minimizes the training loss, thereby optimizing the local training process of the clients in federated learning. The total loss function of local model training The calculation formula is:

[0065]

[0066]

[0067] wherein, The value is 1 when the label category is consistent with the real label category of the sample, otherwise it is 0.

[0068] Step (3). After the client iteration training is completed, the client uploads the local industrial small sample defect detection model parameters to the server end.

[0069] Step (4). After receiving the industrial small sample defect detection model of each client, the server end calculates the relative reliability of the knowledge of each client model using a small amount of non-shared data set

[0070] First, for any training sample , the prediction unreliability is defined as:

[0071]

[0072] Second, by counting the prediction unreliability of each category sample in the data set, and calculating the mean value, the knowledge unreliability of the model on this category can be obtained, thereby measuring the mastery degree of the model on this category. On this basis, the knowledge unreliability of the model on all categories is summed up as the knowledge unreliability of the model as a whole, reflecting the overall unreliability. Therefore, the knowledge unreliability of the model is defined as:

[0073]

[0074] wherein, represents a small amount of non-shared data held by the server end, represents the total number of samples in the data set. In order to measure the importance of the knowledge of each category fairly, it is required that the number of samples of each category in the data set be roughly equal. Based on this, the knowledge unreliability of the global model and the knowledge unreliability of each client model can be calculated respectively.

[0075] Thirdly, based on the knowledge unreliability of the model, for any client ​​This method defines the relative reliability of knowledge in its client-side model. for:

[0076]

[0077] Subsequently, weighted aggregation is performed based on the reliability of model knowledge to generate an updated global industrial small-sample defect detection model. Global model weights. The aggregation formula is:

[0078]

[0079] in, Indicates in The global model obtained by the aggregation of wheels, Indicates client In the The model parameters uploaded after round of local training. This represents the total number of clients selected in the current round.

[0080] The experimental results of this invention are shown in Tables 1, 2, and 3. The methods compared in this invention mainly include the traditional FedAvg algorithm and algorithms improved for data heterogeneity problems (FedProx, MOON, FedNTD, FedLMD, FedSOL). All methods were reproduced based on the PyTorch framework (1.9.0+cu111) and experiments were conducted on an RTX 3080 and an Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz.

[0081] In the experiments, this invention employs several datasets widely used in federated learning research, including MNIST, CIFAR-10, and CINIC-10. To simulate the heterogeneous data environment of real-world scenarios, this invention uses a non-independent and identically distributed partitioning strategy based on a latent Dirichlet distribution to partition the dataset. The dataset is sampled using a Dirichlet distribution, and imbalanced data samples are assigned to each client according to different label distributions. The degree of data heterogeneity among different clients is determined by controlling α. In the experiments, this invention sets α to MNIST (α=0.1), CIFAR-10 (α=0.05, 0.1, 0.3, 0.5), and CINIC-10 (α=0.05, 0.1).

[0082] For a fair comparison, a network model containing two convolutional layers, two max-pooling layers, and two fully connected layers was used in all methods. The model was trained using the SGD optimizer. The learning rate was set to 0.01, the SGD momentum was set to 0.9, and the weight decay was set to 1e-5. The batch size was set to 50.

[0083] For the federated learning task, some additional hyperparameters were set. Referring to the settings of previous studies, for the MNIST dataset experiment, the total number of clients was set to 100, the client sampling ratio was 0.1, the number of communication rounds was 70, and the number of local iterations was 3; for the CIFAR-10 dataset experiment, the total number of clients was set to 50, the client sampling ratio was 0.2, the number of communication rounds was 150, and the number of local iterations was 10; for the CIFAR-100 dataset experiment, the total number of clients was set to 100, the client sampling ratio was 0.1, the number of communication rounds was 150, and the number of local iterations was 5; for the CINIC-10 dataset experiment, the total number of clients was set to 100, the client sampling ratio was 0.1, the number of communication rounds was 200, and the number of local iterations was 5.

[0084] After each communication round, the global model was evaluated on the test dataset, and the average value of the test accuracy was displayed as the result (“-” indicates that the algorithm did not converge). Among them, FedDRA is a federated learning optimization method based on distribution feature distillation and reliable aggregation, and FedDRA_simple is a method that removes the reliable aggregation module based on it (i.e., only contains the distribution feature distillation optimization), so as to verify the effectiveness of the two modules.

[0085] Table 1 Accuracy (%) on MNIST, CIFAR-10, CINIC-10

[0086]

[0087] The experimental results of the test accuracy of each algorithm are shown in Table 1. The accuracy of the FedDRA algorithm is better than that of the baseline method in different data sets and label heterogeneity. In particular, in the case of CINIC-10 (a = 0.1), the FedDRA algorithm improves the accuracy by 2.71% compared to the optimal baseline method (FedLMD, FedSOL), and the result of FedDRA-simple is also close to the optimal baseline FedSOL. These results emphasize the stable performance of the present application in the non-independent and identically distributed data scenario. At the same time, on the CIFAR-10 dataset, as the value of a gradually decreases, the effect of reliable aggregation gradually increases, and the effect of FedDRA becomes more and more obvious, which also proves the effectiveness of the targeted optimization of FedDRA for heterogeneous data.

[0088] Table 2 Total communication overhead of each algorithm on CIFAR-10 dataset

[0089]

[0090] The overhead of each algorithm on the CIFAR-10 dataset is shown in Table 2. When the specified accuracy is 60%, the total communication overhead of the algorithms FedAvg, FedProx, MOON, FedNTD, FedLMD, and FedSOL is 707.44MB, 773.24MB, 707.44MB, 723.89MB, 526.46MB, and 707.44MB, respectively. The FedDRA method does not increase additional communication content compared to the baseline method in a single communication round, and the total communication overhead decreases as the convergence accelerates, with a total communication overhead of 394.85MB, which is 25.0% less than that of FedLMD and 44.2% less than that of FedAvg. When the specified accuracy is 65%, the total communication overhead of FedDRA is 690.98MB, which is still less than that of the above baseline methods.

[0091] Table 3 Convergence communication rounds on CINIC-10 and CIFAR-10 datasets

[0092] Table 3 shows the number of communication rounds required for each algorithm to reach the target accuracy for 3 consecutive rounds on the CIFAR-10 and CINIC-10 datasets (where "-" indicates that the requirement is not met within the total communication rounds). As can be seen, in the two different heterogeneous scenarios of CIFAR-10, the convergence rounds required by FedDRA are lower than those of other methods. For example, when α = 0.1, compared with FedProx, FedNTD, FedLMD, and FedSOL algorithms, FedDRA reduces the communication rounds by 68.5%, 55.3%, 50.0%, and 46.5% respectively to reach 65% accuracy. When α = 0.3, compared with FedNTD and FedLMD, FedDRA reduces the communication rounds by 22.4% and 15.1% respectively to reach 75% accuracy. On the CINIC-10 dataset, when α = 0.1, compared with FedLMD and FedSOL, FedDRA reduces the communication rounds by 35.2% and 35.2% respectively to reach 50% accuracy, and by 34.2% and 43.9% respectively to reach 55% accuracy. It can be seen that the convergence speed of FedDRA on the CINIC-10 dataset is improved.

[0093] In summary, the experimental results show that the method of the present application has certain improvement and optimization in accuracy and overhead compared with previous methods.

[0094] The preferred embodiments of the present application have been described above with the aid of numerous drawings and are apparent from the foregoing description. Since the above description is merely exemplary, many changes and modifications can be suggested to one skilled in the art and it is intended to encompass them within the scope of the application, which is defined by the claims.

Claims

1. A federated learning optimization method based on industrial small sample defect detection, characterized in that, Comprising the following steps: Step 1. The server side will issue the global industrial small sample defect detection model to the selected client, and the client will initialize the local industrial small sample defect detection model based on the global model weight of the current communication round ​ Step 2. Local training at the client based on local data of the client; Step 3. After the client iteratively training ends, the client uploads the local industrial small sample defect detection model parameters to the server end ; Step 4. The server side calculates the knowledge relative reliability of each client model by using a small amount of unshared data set after receiving the defect detection model of each client industry small sample , and then generates an updated global defect detection model of industry small sample based on the weighted aggregation of model knowledge reliability; The local training at the client in the step 2 comprises E times of loop training, and each time of loop training comprises the following steps: Step 2.

1. Client at local dataset The class knowledge reliability of the global industrial small sample defect detection model is calculated And the class knowledge reliability of the local industrial small sample defect detection model And determine the unreliable class set based on both Wherein, Indicates a feature set of a data sample, Indicates a label set of the data sample; Step 2.

2. On the basis of the unreliable class set , the correction weight of the teacher model soft label distribution is obtained ; for each training sample , , represents the feature of the sample, is the real class to which the sample belongs, and the correction weight of the student model soft label distribution is defined as ; Step 2.

3. Constructing a distribution feature based distillation loss term ; In the local training process, for any training sample , the teacher model prediction probability distribution is corrected by using the correction weight to obtain , the student model prediction probability distribution is corrected by using the correction weight to obtain ; then, the distribution feature-based distillation loss term is composed of the KL divergence of the weighted corrected prediction probability distribution and . ; wherein, represents the probability that the teacher model predicts that the sample belongs to class , represents the probability that the student model predicts that the sample belongs to class , is the total number of classes; Step 2.

4. Constructing the total loss function for training the local industrial small sample defect detection model ; Total loss function of local model training Distillation loss term based on distribution features proposed by step 2.3 And the traditional federated training cross-entropy loss term Together constitute; the client local model minimizes the training loss on the basis of the total loss function In the local data set Optimize the local training process of the client in federated learning; the total loss function of local model training The calculation formula is: ; ; wherein, In the label class is 1 if the sample true label class is 1, otherwise 0.

2. The federated learning optimization method based on industrial small sample defect detection according to claim 1, wherein, The specific process of the step 1 is as follows: in each communication round, the server side samples a plurality of clients from all the clients according to a sampling ratio to construct a client set , , , wherein i represents a current communication round number; the server side sends a global industrial small sample defect detection model to the selected clients; for each client, a local industrial small sample defect detection model is initialized as based on a global model weight of the current communication round . The specific process of the step 1 is as follows: in each communication round, the server side samples a plurality of clients from all the clients according to a sampling ratio to construct a client set , , , wherein i represents a current communication round number; the server side sends a global industrial small sample defect detection model to the selected clients; for each client, a local industrial small sample defect detection model is initialized as based on a global model weight of the current communication round . The specific process of the step 1 is as follows: in each communication round, the server side 3. The federated learning optimization method based on industrial small sample defect detection according to claim 1, wherein, The server generates an updated global industrial small sample defect detection model, and global model weights The aggregation formula is: ; in, Indicates in The global model obtained by the aggregation of wheels, Indicates the client In the The model parameters uploaded after round of local training. This represents the total number of clients selected in the current round.

Citation Information

Patent Citations

  • Federal learning optimization method based on confidence coefficient and variational autoencoder distillation

    CN118551830A