Intelligent factory lean manufacturing fault detection method based on federal incremental learning
By employing federated incremental learning and utilizing contrastive learning and knowledge distillation techniques, the problem of rapid extraction and aggregation of fault detection in lean manufacturing of smart factories was solved, achieving high-precision and personalized fault detection, mitigating model drift, and improving detection accuracy and adaptability.
Patent Information
- Application Number
- CN202411699542.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In lean manufacturing in smart factories, how to quickly extract and learn the changing characteristics of fault data, and effectively aggregate them in federated learning while preventing the malicious collection of information from stakeholders, has become a major challenge for fault detection in the Industrial Internet of Things.
We employ a federated incremental learning approach, which accelerates model convergence through contrastive learning pre-training of the local encoder model. We also extract knowledge features from the encoder model using knowledge distillation, combine them with the local decoder model for local training, and upload the encoder model weights for aggregate training. Finally, we form a personalized and complete model locally.
It accelerates the high-precision convergence of the local complete model, alleviates the model drift problem caused by non-independent and identically distributed data, realizes personalized training and detection capabilities, and improves the accuracy and adaptability of fault detection.
Smart Images

Figure CN119723157B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lean manufacturing fault detection technology, specifically relating to a smart factory lean manufacturing fault detection method based on federated incremental learning. Background Technology
[0002] In the field of lean manufacturing, federated learning has seen a significant increase in practical applications such as real-time detection and intelligent decision-making in industrial production due to its outstanding performance in data privacy protection and improved model generality. Fault detection is one of the important research topics in lean manufacturing. Meanwhile, in the application requirements of smart factories and lean manufacturing, the amount, characteristics, and categories of fault data to be detected are growing rapidly, and the correlations between faults are also generating increasingly diverse new characteristics. How to quickly extract and learn the changing fault data features, and effectively achieve federated aggregation while minimizing the malicious collection of information from participating parties, has become a major challenge in fault detection for the Industrial Internet of Things (IIoT). Summary of the Invention
[0003] In view of the above-mentioned problems, this invention provides a fault detection method for lean manufacturing in smart factories based on federated incremental learning. It focuses on solving the convergence problem of federated training algorithms on local datasets and the problems in the local pre-training process, which are related to the fault detection task in lean manufacturing.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0005] A fault detection method for lean manufacturing in smart factories based on federated incremental learning includes the following steps:
[0006] S10, the local encoder model of the local participant is pre-trained using a contrastive learning approach to accelerate model convergence;
[0007] S20: Perform knowledge distillation on the training weights of the global encoder model and the training weights of the local encoder model of the local participant to extract the knowledge learning features of the encoder model. Combine the distilled training weights of the local encoder model of the local participant with the local decoder model of the local participant to obtain the complete local model and perform local training.
[0008] S30: The local complete model after local training is split into the local encoder model and the local decoder model of the local participants. The training weights of the local decoder model of the local participants are kept locally. The training weights of the local encoder model of the local participants are uploaded to the central server to calculate the aggregate weights for this round. The aggregate training is completed to obtain the training weights of the global encoder for this round.
[0009] S40: Download the global encoder training weights to the local participant's local encoder model and combine them with the local participant's local decoder model to form a complete local model.
[0010] S50 uses a local complete model to perform fault detection on lean manufacturing tasks and determine whether a fault has occurred.
[0011] In one possible implementation, S10 specifically includes: pre-training the local encoder model of the local participant using N pairs of contrastive loss functions, wherein the N pairs of samples include positive sample pairs and negative sample pairs, maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs through contrastive learning, and the local decoder model of the local participant is pre-trained using the N pairs of contrastive loss functions as shown in formula (1):
[0012]
[0013] Among them l N-paris This represents N pairs of contrastive loss functions. i y represents the fault feature vector obtained by the local encoder model of the local participant for the i-th sample, where sample i is a two-dimensional image sample in lean manufacturing, including RGB image, grayscale image, coded image and infrared image; i Indicates sample f i The label represents the specific fault type, sim(f i ,f j )=f i T f j It is to calculate the fault feature vector f i and f j The phase velocity between them, τ is a temperature coefficient used to scale the similarity.
[0014] In one possible implementation, the knowledge distillation of the global encoder model training weights and the local encoder model training weights of the local participants in S20 specifically includes:
[0015] S201, Input data x i The output y of the global encoder model is obtained by forward propagation through the global encoder model. g Input data x i By performing forward propagation using the local participant's local encoder model, the output y of the local participant's local encoder model is obtained. k ;
[0016] S202, the global encoder model is used as the teacher model, and the local encoder model of the local participant is used as the student model. The learning features of the encoder model are extracted using the knowledge distillation method. The calculation formulas are shown in formulas (2) and (3):
[0017]
[0018] Where L kl The KL divergence loss function is used to calculate the output distribution; T is used as a temperature parameter to smooth the output distribution; σ represents the softmax function; y g (i) represents the output probability of the teacher model in class i; y k (i) represents the output probability of the student model in the i-th class; Represents the loss function L KL Regarding the student model weights w k The gradient.
[0019] S203, update the local encoder model training weights of the local participants, and the calculation formula is shown in formula (4):
[0020]
[0021] Where w′ k η represents the training weights of the local encoder model for the updated local participants; η represents the learning rate, which controls the step size of each update.
[0022] S204, for distillation calculations.
[0023] In one possible implementation, the distillation calculation in S204 specifically includes: initializing the student model weights w k And define the knowledge distillation loss function L. kl To measure the difference between the outputs of the teacher model and the student model; in each round of training, the algorithm processes each sample by traversing every class of samples in the dataset; for each sample x i First, the teacher model is used to calculate sample x. i Corresponding output y k Using the student model to calculate sample x i Corresponding output y′ k Next, for each output dimension D, the distillation loss L is calculated by accumulating the KL divergence between the teacher model and the student model. kl After each training round, the algorithm updates the weights w′ of the student model using backpropagation and gradient descent based on the calculated KL divergence loss. k This process allows the student model's output to gradually approximate the teacher model's output. This update process relies on the learning rate η and the gradient of the KL loss function with respect to the student model's weights. After multiple training rounds, the student model continuously optimizes, gradually absorbing the knowledge from the teacher model, and ultimately achieving a more accurate prediction capability. After training is complete, the updated student model weights w′ are returned. kThat is, the student model obtained by training and optimization through knowledge distillation.
[0024] In one possible implementation, in step S20, the training weights of the local encoder model of the distilled local participant are combined with the local decoder model of the local participant to obtain the local complete model, and local training is performed as follows: The calculation formula of the local complete model M is shown in formula (5):
[0025] M(x;w′ k ,w d )=f d (f k (x i ;w′ k );w d (5)
[0026] Where w d The local decoder model training weights representing the local participants; f k A local encoder model representing local participants; f d A local decoder model representing local participants.
[0027] In one possible implementation, S30 specifically includes: splitting the trained local complete model M into a local encoder model of the local participant and a local decoder model of the local participant, wherein the training weights w of the local decoder model of the local participant are... d Keep the local encoder model weights w′ of the local participants locally and upload them. k The training is performed at the central server to calculate the aggregate weights for this round, thus obtaining the training weights of the global encoder for this round. The calculation formula is shown in formula (6).
[0028]
[0029] Where N represents the number of clients participating in the aggregation; The local encoder model training weights represent the local participants uploaded by different clients.
[0030] In one possible implementation, S40 includes: downloading the global encoder training weights to the local encoder model of the local participant, and combining them with the local decoder model of the local participant to form a local complete model, the calculation formula being as shown in formula (7):
[0031] M′(x;w g ,w d )=f d (f k (x i ;w g );w d (7)
[0032] Where w g The training weights of the global encoder model downloaded from the central server are compared with the local decoder model weights w of the local participants. d Combined with the final local complete model M′, the resulting local complete model M′ has the ability to accurately identify and classify defects in the production line. Each factory first downloads the global encoder weights w, which have been trained through multiple rounds, from the central server. g This weight incorporates common fault characteristics from different production environments. By integrating these diverse fault characteristics, the model can adapt to various production environments, ensuring its ability to detect and identify multiple types of defects. After downloading to the local machine, the global encoder model weight w... g It will be related to the local decoder model weights w d Combined, w d Strengthen the specific testing requirements of the factory and generate a personalized testing model that suits the needs of the factory.
[0033] The present invention offers the following advantages: it accelerates the effective and high-precision convergence of local complete models in incremental learning, enables personalized training of local complete models, and effectively alleviates model drift issues caused by non-independent and identically distributed data among local complete models through knowledge distillation. Based on the synergistic approach of local personalized learning and global aggregation, it provides technical support for improving the safety and performance of lean manufacturing AI models. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating the framework of a smart factory lean manufacturing fault detection method based on federated incremental learning, according to an embodiment of the present invention. Detailed Implementation
[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] Reference Figure 1 An embodiment of the present invention provides a method for fault detection in lean manufacturing of a smart factory based on federated incremental learning, comprising the following steps:
[0037] S10, the local encoder model of the local participant is pre-trained using a contrastive learning approach to accelerate model convergence;
[0038] S20: Perform knowledge distillation on the training weights of the global encoder model and the training weights of the local encoder model of the local participant to extract the knowledge learning features of the encoder model. Combine the distilled training weights of the local encoder model of the local participant with the local decoder model of the local participant to obtain the complete local model and perform local training.
[0039] S30: The local complete model after local training is split into the local encoder model and the local decoder model of the local participants. The training weights of the local decoder model of the local participants are kept locally. The training weights of the local encoder model of the local participants are uploaded to the central server to calculate the aggregate weights for this round. The aggregate training is completed to obtain the training weights of the global encoder for this round.
[0040] S40: Download the global encoder training weights to the local participant's local encoder model and combine them with the local participant's local decoder model to form a complete local model.
[0041] S50 uses a local complete model to perform fault detection on lean manufacturing tasks and determine whether a fault has occurred.
[0042] The above methods are used to accelerate the effective and high-precision convergence of local complete models in incremental learning, realize personalized training of local complete models, and effectively alleviate the model drift problem caused by non-independent and identically distributed data between local complete models through knowledge distillation.
[0043] In a specific application example, S10 specifically includes: pre-training the local encoder model of the local participant using N pairs of contrastive loss functions, where N pairs of samples include positive sample pairs and negative sample pairs. Through contrastive learning, the similarity of positive sample pairs is maximized while the similarity of negative sample pairs is minimized. The calculation formula for the local decoder model of the local participant using N pairs of contrastive loss functions is shown in (1):
[0044]
[0045] Among them l N-paris This represents N pairs of contrastive loss functions. i y represents the fault feature vector obtained by the local encoder model of the local participant for the i-th sample, where sample i is a two-dimensional image sample in lean manufacturing, including RGB image, grayscale image, coded image and infrared image; i Indicates sample f i The label represents the specific fault type, sim(f i ,f)2=f i T f j It is to calculate the fault feature vector f i and fj The phase velocity between them, τ is a temperature coefficient used to scale the similarity.
[0046] Specifically, for two-dimensional image samples, such as wafer fault detection in lean manufacturing, the image sample is a wafer-coded image, where a code of 0 represents the background area, a code of 1 represents the normal area, and a code of 2 represents the fault area; in the field of stainless steel surface fault detection in lean manufacturing, the image sample is a grayscale image, where areas with high grayscale values represent fault areas and areas with low grayscale values represent normal areas; in the field of ceramic surface fault detection in lean manufacturing, the image sample is an RGB image; and in the field of battery electrode inspection in lean manufacturing, the image sample is an infrared image.
[0047] In a specific application example, the knowledge distillation of the global encoder model training weights and the local encoder model training weights of the local participants in S20 specifically includes:
[0048] S201, Input data x i The output y of the global encoder model is obtained by forward propagation through the global encoder model. g Input data x i By performing forward propagation using the local participant's local encoder model, the output y of the local participant's local encoder model is obtained. k ;
[0049] S202, the global encoder model is used as the teacher model, and the local encoder model of the local participant is used as the student model. The learning features of the encoder model are extracted using the knowledge distillation method. The calculation formulas are shown in formulas (2) and (3):
[0050]
[0051] Where L kl The KL divergence loss function is used to calculate the output distribution; T is used as a temperature parameter to smooth the output distribution; σ represents the softmax function; y g (i) represents the output probability of the teacher model in class i; y k (i) represents the output probability of the student model in the i-th class; Represents the loss function L KL Regarding the student model weights w k The gradient.
[0052] S203, update the local encoder model training weights of the local participants, and the calculation formula is shown in formula (4):
[0053]
[0054] Where w′ kη represents the updated training weights of the local encoder model for the local participants; η represents the learning rate, which controls the step size of each update.
[0055] S204, for distillation calculations.
[0056] Furthermore, the distillation calculation in S204 specifically includes: initializing the student model weights w k And define the knowledge distillation loss function L. kl To measure the difference between the outputs of the teacher model and the student model; in each round of training, the algorithm processes each sample by traversing every class of samples in the dataset; for each sample x i First, the teacher model is used to calculate sample x. i Corresponding output y k Using the student model to calculate sample x i Corresponding output y′ k Next, for each output dimension D, the distillation loss L is calculated by accumulating the KL divergence between the teacher model and the student model. kl After each training round, the algorithm updates the weights w′ of the student model using backpropagation and gradient descent based on the calculated KL divergence loss. k This process allows the student model's output to gradually approximate the teacher model's output. This update process relies on the learning rate η and the gradient of the KL loss function with respect to the student model's weights. After multiple training rounds, the student model continuously optimizes, gradually absorbing the knowledge from the teacher model, and ultimately achieving a more accurate prediction capability. After training is complete, the updated student model weights w′ are returned. k That is, the student model obtained by training and optimization through knowledge distillation.
[0057] In a specific application example, in S20, the training weights of the local encoder model of the distilled local participant are combined with the local decoder model of the local participant to obtain the local complete model. Local training includes: The calculation formula of the local complete model M is shown in formula (5):
[0058] M(x;w′ k ,w d )=f d (f k (x i ;w′ k );w d (5)
[0059] Where w d The local decoder model training weights representing the local participants; f k A local encoder model representing local participants; f d A local decoder model representing local participants.
[0060] In a specific application example, S30 specifically includes: the trained local complete model M is split into a local encoder model of the local participants and a local decoder model of the local participants, wherein the training weights w of the local decoder model of the local participants are... d Keep the local encoder model weights w′ of the local participants locally and upload them. k The training is performed at the central server to calculate the aggregate weights for this round, thus obtaining the training weights of the global encoder for this round. The calculation formula is shown in formula (6).
[0061]
[0062] Where N represents the number of clients participating in the aggregation; The local encoder model training weights represent the local participants uploaded by different clients.
[0063] In a specific application example, S40 includes: downloading the global encoder training weights to the local encoder model of the local participant, and combining them with the local decoder model of the local participant to form a complete local model. The calculation formula is shown in formula (7):
[0064] M′(x;w g ,w d )=f d (f k (x i ;w g );w d (7)
[0065] Where w g The training weights of the global encoder model downloaded from the central server are compared with the local decoder model weights w of the local participants. d Combined with the final local complete model M′, the resulting local complete model M′ has the ability to accurately identify and classify defects in the production line. Each factory first downloads the global encoder weights w, which have been trained through multiple rounds, from the central server. g This weight incorporates common fault characteristics from different production environments, such as wafer faults, stainless steel surface defects, ceramic surface flaws, and battery electrode anomalies. By integrating these diverse fault characteristics, the model can adapt to various production environments, ensuring its ability to detect and identify multiple types of defects. After downloading locally, the global encoder model weight w... g It will be related to the local decoder model weights w d Combined, w dBy strengthening the specific testing requirements of each factory, a customized testing model is generated to meet the needs of that factory. This model can draw on the general testing capabilities of multiple factories while also satisfying the localized, refined testing requirements. In production line applications, this combined model can effectively identify and classify defects, thereby improving testing accuracy.
[0066] The above methods are used to accelerate the effective and high-precision convergence of local complete models in incremental learning, realize personalized training of local complete models, and effectively alleviate the model drift problem caused by non-independent and identically distributed data between local complete models through knowledge distillation.
[0067] It should be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art will understand that various changes in form and detail may be made without departing from the spirit and scope of the invention as defined by the appended claims.
Claims
1. A fault detection method for lean manufacturing in smart factories based on federated incremental learning, characterized in that, Includes the following steps: S10, the local encoder model of the local participant is pre-trained using a contrastive learning approach to accelerate model convergence; S20: Perform knowledge distillation on the training weights of the global encoder model and the training weights of the local encoder model of the local participant to extract the knowledge learning features of the encoder model. Combine the distilled training weights of the local encoder model of the local participant with the local decoder model of the local participant to obtain the complete local model and perform local training. S30: The local complete model after local training is split into the local encoder model and the local decoder model of the local participants. The training weights of the local decoder model of the local participants are kept locally. The training weights of the local encoder model of the local participants are uploaded to the central server to calculate the aggregate weights for this round. The aggregate training is completed to obtain the training weights of the global encoder for this round. S40: Download the global encoder training weights to the local participant's local encoder model and combine them with the local participant's local decoder model to form a complete local model. S50 uses a local complete model to perform fault detection on lean manufacturing tasks and determine whether a fault has occurred. S10 specifically includes: pre-training the local encoder model of the local participant using N pairs of contrastive loss functions, where N pairs of samples include positive sample pairs and negative sample pairs. Through contrastive learning, the similarity of positive sample pairs is maximized while the similarity of negative sample pairs is minimized. The calculation formula for the local decoder model of the local participant using N pairs of contrastive loss functions is shown in (1): (1) in Represents N pairs of contrastive loss functions. This represents the fault feature vector obtained by the local encoder model of the local participant for the i-th sample, where sample i is a two-dimensional image sample in lean manufacturing, including RGB image, grayscale image, coded image and infrared image; Indicates sample The labels represent specific fault types. It is to calculate the fault feature vector. and phase velocity between It is a temperature coefficient used to scale similarity; The knowledge distillation of the global encoder model training weights and the local encoder model training weights of the local participants in S20 specifically includes: S201, Input Data The output of the global encoder model is obtained by forward propagation through the global encoder model. Input data The output of the local encoder model of the local participant is obtained by forward propagation through the local participant's local encoder model. ; S202, the global encoder model is used as the teacher model, and the local encoder model of the local participant is used as the student model. The learning features of the encoder model are extracted using the knowledge distillation method. The calculation formulas are shown in formulas (2) and (3): (2) (3) in This represents the KL divergence loss function; Used as a temperature parameter to smooth the output distribution; Represents the softmax function; The representative teacher model in the Output probability on class; This represents the output probability of the student model in the i-th class; Represents the loss function Regarding student model weights The gradient; S203, update the local encoder model training weights of the local participants, and the calculation formula is shown in formula (4): (4) in The local encoder model training weights represent the updated local participants; It represents the learning rate, which controls the step size of each update; S204, for distillation calculations; The distillation calculation in S204 specifically includes: initializing the student model weights. And define the knowledge distillation loss function. To measure the difference between the outputs of the teacher model and the student model; in each round of training, the algorithm processes each sample by traversing every class of samples in the dataset; for each sample First, the teacher model is used to calculate the sample. Corresponding output Using the student model to calculate samples Corresponding output Next, for each output dimension The distillation loss is calculated by accumulating the KL divergence between the teacher and student models. After each training round, the algorithm updates the weights of the student model using backpropagation and gradient descent based on the calculated KL divergence loss. This process allows the student model's output to gradually approximate the teacher model's output; this update process relies on the learning rate η and the gradient of the KL loss function with respect to the student model's weights. After multiple training rounds, the student model continuously optimizes, gradually absorbing the knowledge from the teacher model, and ultimately achieving a more accurate predictive ability. After training is complete, the updated student model weights are returned. That is, the student model obtained by training and optimization through knowledge distillation; In step S20, the training weights of the local encoder model of the distilled local participant are combined with the local decoder model of the local participant to obtain the local complete model, and local training includes: the local complete model The calculation formula is shown in formula (5): (5) in The local decoder model training weights represent the local participants; A local encoder model representing local participants; A local decoder model representing local participants; Specifically, S30 includes: a fully trained local model. It is split into a local encoder model and a local decoder model for local participants, where the training weights of the local decoder model for local participants are... Keep the local encoder model weights of the local participants and upload them. The training is performed at the central server to calculate the aggregate weights for this round, thus obtaining the training weights of the global encoder for this round. The calculation formula is shown in formula (6): (6) in This represents the number of clients participating in the aggregation. The local encoder model training weights represent the upload weights of different clients' local participants; S40 includes: downloading the global encoder training weights to the local encoder model of the local participant, and combining them with the local decoder model of the local participant to form a complete local model, the calculation formula of which is shown in formula (7): (7) in The training weights for the global encoder model downloaded from the central server are compared with the local decoder model weights of the local participants. Combined with the final local complete model The final local complete model With the ability to accurately identify and classify defects in the production line, each factory first downloads the global encoder weights, which have undergone multiple rounds of training, from the central server. This weight incorporates common fault characteristics from different production environments. By integrating these diverse fault characteristics, the model can adapt to various production environments, ensuring its ability to detect and identify multiple types of defects. After downloading locally, the global encoder model weights... Will be related to the local decoder model weights Combine, Strengthen the factory's testing requirements and generate customized testing models to meet the factory's specific needs.
Citation Information
Patent Citations
Federal learning model aggregation method based on dynamic adaptive knowledge distillation
CN116681144A
Industrial Internet of Things fault detection method based on federal incremental learning
CN117579468A
Federal model training method and system supporting data heterogeneity and based on supervised comparative learning
CN117744761A
