Industrial object detection method based on dynamic prototype training

Through dynamic prototype training methods, generation and sharing of type prototypes are solved, the problems of traditional methods in data heterogeneity and privacy protection are achieved, and efficient industrial object detection and model generalization capabilities are implemented, which are suitable for modern industrial detection environments.

CN120259776APending Publication Date: 2025-07-04UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510416150.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

Traditional industrial object detection methods rely on rule setting or manual identification, have limitations, are difficult to adapt to the heterogeneity of data distribution, and are difficult to achieve secure collaborative modeling and protect data privacy in environments where there are large differences across factories or equipment.

Method used

By obtaining local industrial object detection data from different clients, extracting features to generate class prototypes, and aggregating them on the central server, combining dynamic weight allocation to optimize the global model, and realizing secure sharing of class prototypes and model consistency training.

Benefits of technology

It improves the recognition performance of the model in a heterogeneous environment, protects data privacy, and is suitable for industrial fields with high requirements for data sensitivity, achieving efficient collaborative modeling and detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259776A_ABST
    Figure CN120259776A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial object detection method based on dynamic prototype training, and belongs to the technical field of federated learning and distributed machine learning, and the method comprises the steps: obtaining local industrial object detection data of different clients; extracting features of local industrial object detection data and generating a class prototype; aggregating the class prototypes of the same class of all the clients to generate a global class prototype; the client performs local model training and consistency constraint by adopting a global class prototype and local industrial object detection data; and the central server performs dynamic weight distribution according to the classification accuracy of the local model of each client so as to optimize the global model. The method not only can adapt to the heterogeneity of data distribution, but also can effectively enhance the generalization ability of the global model on different clients while protecting the data privacy, thereby keeping higher recognition performance in different industrial detection environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of federated learning and distributed machine learning, and particularly relates to an industrial object detection method based on dynamic prototype training. Background Art

[0002] In the fields of industrial manufacturing and maintenance, industrial product detection plays a crucial role. With the development of Industry 4.0 and intelligent manufacturing, modern factories have increasingly higher requirements for detection accuracy and data processing efficiency. To accurately identify useful information from a vast amount of detection data, not only an efficient analysis model is needed, but also collaborative modeling of multi-party data needs to be achieved without leaking sensitive information.

[0003] Traditional methods often rely on rule setting or manual identification. However, in the face of the large scale of detection data and complex distribution characteristics, the limitations of these methods are gradually emerging. Especially in environments with large differences between factories or equipment, there are significant differences in the data distribution and quality generated by different devices, and traditional methods face challenges. In addition, the emphasis on data privacy by enterprises also promotes the realization of collaborative modeling and efficient information extraction without data leaving the factory. Summary of the Invention

[0004] The purpose of the present invention is to address the above deficiencies in the prior art and provide an industrial object detection method based on dynamic prototype training to solve the problems that traditional methods often rely on rule setting or manual identification with large limitations and the data privacy of enterprises cannot be guaranteed.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] An industrial object detection method based on dynamic prototype training, which includes the following steps:

[0007] S1. Obtain local industrial object detection data of different clients;

[0008] S2. Extract the features of the local industrial object detection data, calculate the feature mean of each category of industrial objects according to the features, and then generate a class prototype representing the category;

[0009] S3. Each client transmits the generated class prototype to the central server, and the central server aggregates the class prototypes of the same category of all clients to generate a global class prototype, and feeds back the generated global class prototype to each client;

[0010] S4. The client uses the global class prototype and the local industrial object detection data for local model training and consistency constraint;

[0011] S5. The central server performs dynamic weight allocation based on the classification accuracy of the local models of each client, and then optimizes the global model;

[0012] S6. Repeat steps S3 to S5 until the global model converges.

[0013] Furthermore, in S1, the obtained local industrial object detection data is preprocessed, including image enhancement, denoising, and size normalization.

[0014] Furthermore, in S2, the feature mean of each category of industrial objects is calculated, and then a class prototype representing the category is generated, including:

[0015]

[0016] Among them, is the feature mean of each category, representing the class prototype; |D i,j | is the number of samples in category j; x k is the k-th image, y k is the category label of the k-th image; D i,j ={(x k ,y k )∈D i :y k =j} represents the sample set of category j in client i; is the feature vector of the image.

[0017] Furthermore, in S3, the central server aggregates the class prototypes of the same category of all clients to generate a global class prototype, including:

[0018]

[0019] Among them, is the global class prototype of category j.

[0020] Furthermore, in S4, the total loss function L of the local model of the client is:

[0021] L = Ls + λLr

[0022] Among them, Ls is the classification loss function; λ is the balance parameter; Lr is the prototype consistency loss function.

[0023] Furthermore, the prototype consistency loss function Lr is:

[0024]

[0025] The classification loss function Ls is:

[0026]

[0027] Among them, l(·) is the cross-entropy loss function.

[0028] Furthermore, in S5, the central server performs dynamic weight allocation according to the classification accuracy of the local model of each client, including:

[0029] Taking the classification accuracy of the local model of client i on the validation set as the performance metric in the current round of training;

[0030] The classification accuracy is:

[0031]

[0032] where α i is the classification accuracy;

[0033] Allocating the dynamic weight w for client i according to the classification accuracy i :

[0034]

[0035] where ε is the smoothing parameter.

[0036] Furthermore, in S5, when the central server optimizes the global model, it performs weighted averaging on the local model parameters of each client according to the dynamic weight w i to update the global model parameters:

[0037]

[0038] where θ i is the local model parameter of the client; is the updated global model parameter.

[0039] The industrial object detection method based on dynamic prototype training provided by the present invention has the following beneficial effects:

[0040] Through the dynamic weighted class prototype aggregation mechanism, the present invention makes full use of the classification accuracy of each client to optimize the global model update, so that the clients with higher classification accuracy contribute more to the model. Compared with the traditional federated learning method, the present invention can not only adapt to the heterogeneity of data distribution, but also effectively enhance the generalization ability of the global model on different clients, thus maintaining a high recognition performance in different industrial detection environments.

[0041] The present invention realizes secure collaborative modeling between different devices and factory areas by transmitting class prototypes instead of raw data. This method improves the detection accuracy while protecting the local data privacy of each client, and is particularly suitable for industrial fields with high requirements for data sensitivity, meeting the strict requirements of enterprises for the security of core technologies and production data. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of an industrial object detection method based on dynamic prototype training according to the present invention.

[0043] Figure 2 It is a schematic diagram of feature extraction and class prototype generation of local industrial object detection data according to the present invention.

[0044] Figure 3 It is a schematic diagram of class prototype transmission and global aggregation according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] The following describes the specific embodiments of the present invention to facilitate those skilled in the art of the present technology to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art of the present technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions made using the concept of the present invention are within the scope of protection.

[0046] Embodiment 1

[0047] This embodiment provides an industrial object detection method based on dynamic prototype training. This embodiment is based on the federated learning method of dynamic prototype training, and realizes efficient collaborative modeling in a heterogeneous environment by sharing class prototypes instead of actual data among each factory area or device. It can not only solve the model training problems brought by data heterogeneity, but also improve the generalization ability of the model in industrial detection tasks while protecting data privacy, providing an intelligent and distributed learning method for modern industrial detection. Refer to Figure 1 , and it specifically includes the following contents:

[0048] Step S1: Obtain local industrial object detection data of different clients;

[0049] To ensure the consistency of the quality of local industrial object detection data for subsequent feature extraction, this embodiment preprocesses the obtained local industrial object detection data, including image enhancement, denoising, and size normalization processing. The preprocessing methods in this embodiment are all conventional means of image processing, so the detailed process will not be elaborated here.

[0050] Step S2: Refer to Figure 2 , for feature extraction and class prototype generation of local industrial object detection data;

[0051] Extract the features of the local industrial object detection data, calculate the feature mean of each category of industrial objects according to the features, and then generate a class prototype representing the category. Specifically, it includes the following contents:

[0052] Feature extraction: In each client of this embodiment, a deep neural network (such as a convolutional neural network CNN) is used to extract the features of the preprocessed local industrial object detection data (image data), and the image is converted into a feature vector of a fixed size. The feature vector of each image in this embodiment Among them, is the local model parameter of client i; the data set of client i is where x k represents the k-th image, and y k is its category label.

[0053] Class prototype generation: The client calculates a class prototype for each category of industrial objects, which represents the typical features of the category in the local industrial object detection data. Specifically:

[0054]

[0055] Among them, is the feature mean of each category. In this embodiment, this feature mean is represented as a class prototype, which specifically represents the feature center of category j on client i; |D i,j | is the number of samples of category j; D i,j ={(x k , y k ) ∈ D i : y k =j} represents the sample set of category j in client i.

[0056] Step S3, refer to Figure 3 , class prototype transmission and global aggregation;

[0057] Class prototype transmission: Each client transmits the generated class prototype to the central server through an encryption protocol. The transmission process in this embodiment only involves the transmission of class prototypes, which can avoid the leakage of the original local industrial object detection data and ensure data privacy;

[0058] Global aggregation: The central server aggregates the class prototypes of the same category from all clients to generate a global class prototype, including:

[0059]

[0060] Among them, is the global class prototype of category j.

[0061] This embodiment feeds back the generated global class prototypes to each client as the alignment targets in subsequent local model training to improve global consistency.

[0062] Step S4, Local model training and consistency constraint;

[0063] The client uses the global class prototypes and local industrial object detection data for local model training and consistency constraint, which specifically includes the following:

[0064] The loss function of the local model of the client in this embodiment includes two parts:

[0065] Classification loss function Ls and prototype consistency loss function Lr;

[0066] Among them, the classification loss function Ls represents the prediction error of the local model on the local industrial object detection data and is defined by the cross-entropy loss as:

[0067]

[0068] Among them, e(·) is the cross-entropy loss function.

[0069] The prototype consistency loss function Lr is used to ensure the consistency between the local class prototypes and the global class prototypes This loss is calculated by the L2 distance and is defined as:

[0070]

[0071] Based on this, the total loss function L of the local model of the client in this embodiment is:

[0072] L = Ls + λLr

[0073] Among them, λ is a balance parameter used to adjust the relative importance of the classification loss and the consistency loss.

[0074] Step S5, Dynamic weighted aggregation;

[0075] After the client completes the training, it updates the class prototypes and uploads them to the server for a new round of global aggregation. This process is continuously iterated until the global model converges. During the training process of each round of federated learning, dynamic prototype training dynamically weights the global model update based on the local model accuracy of each client to further improve the generalization and performance of the model.

[0076] Specifically, after each round of training of the local model on the client side, the central server assigns dynamic weights to each client according to its classification accuracy. Through dynamic weighted aggregation, the central server takes the classification accuracy as the weight and performs weighted averaging on the local model parameters of each client to optimize the global model. The smoothing parameter is used to control the stability of weight assignment and ensure the balanced contribution of different clients during the aggregation process;

[0077] After the local model training is completed, each client i calculates the classification accuracy α of its local model on the validation dataset corresponding to the local industrial object detection data i as the performance metric of the client in the current round;

[0078] The classification accuracy is:

[0079]

[0080] where α i is the classification accuracy;

[0081] According to the classification accuracy α of the client i , a dynamic weight w i is assigned to each client to balance the contributions of each client. The dynamic weight w i is:

[0082]

[0083] where ε is the smoothing parameter to prevent the weight from being zero. The role of the smoothing parameter is to ensure that even if the accuracy of the client is low, it still makes a contribution during the aggregation process, avoiding extreme distributions caused by individual clients with low accuracy.

[0084] When the central server optimizes the global model, it performs weighted averaging on the local model parameters of each client according to the dynamic weight w i and then updates the global model parameters:

[0085]

[0086] where θ i is the local model parameter of the client; is the updated global model parameter, and the weight w i determines the contribution degree of client i in the update of the global model. Through dynamic weighting, the local model can rely more on the model parameters of high-accuracy clients in the update of the global model, further improving the generalization ability of the global model.

[0087] After each round of training, the central server uses the above dynamic weighted aggregation method to calculate the updated global model parameters And distribute it to each client. The client uses this new model parameter for the next round of training.

[0088] Step S6: Repeat steps S3 to S5 until the global model converges.

[0089] Although the specific implementation manners of the invention have been described in detail with reference to the accompanying drawings, it should not be construed as a limitation on the protection scope of this patent. Within the scope described in the claims, various modifications and deformations that can be made by those skilled in the art without creative efforts still fall within the protection scope of this patent.

Claims

1. An industrial object detection method based on dynamic prototype training, characterized in that, Including the following steps: S1. Obtain the local industrial object detection data of different clients; S2. Extract the features of the local industrial object detection data, calculate the feature mean of each category of industrial objects according to the features, and then generate a class prototype representing the category; S3. Each client transmits the generated class prototype to the central server, and the central server aggregates the class prototypes of the same category of all clients to generate a global class prototype, and feeds back the generated global class prototype to each client; S4. The client uses the global class prototype and the local industrial object detection data for local model training and consistency constraint; S5. The central server performs dynamic weight allocation according to the classification accuracy of the local model of each client, and then optimizes the global model; S6. Repeat steps S3 to S5 until the global model converges.

2. The industrial object detection method based on dynamic prototype training according to claim 1, wherein: In S1, the obtained local industrial object detection data is preprocessed, including image enhancement, denoising, and size normalization processing.

3. The industrial object detection method based on dynamic prototype training according to claim 1, wherein In S2, calculating the feature mean of each category of industrial objects and then generating a class prototype representing the category includes: Among them, is the feature mean of each category, representing the class prototype; |D i,j | is the number of samples in class j; x k is the k-th image, y k is the class label of the k-th image; D i,j ={(x k ,y k )∈D i :y k =j} represents the sample set of class j in client i; is the feature vector of the image.

4. The industrial object detection method based on dynamic prototype training according to claim 3, characterized in that In S3, the central server aggregates the class prototypes of the same category of all clients to generate a global class prototype, including: Among them, is the global class prototype of category j.

5. The industrial object detection method based on dynamic prototype training according to claim 4, wherein, In S4, the total loss function L of the local model of the client is: L = Ls + λLr Where, Ls is the classification loss function; λ is the balance parameter; Lr is the prototype consistency loss function.

6. The industrial object detection method based on dynamic prototype training according to claim 5, wherein The prototype consistency loss function Lr is: The classification loss function Ls is: Among them, (·) is the cross-entropy loss function.

7. The industrial object detection method based on dynamic prototype training according to claim 1, wherein In S5, the central server performs dynamic weight allocation according to the classification accuracy of the local model of each client, including: Taking the classification accuracy of the local model of client i on the validation set as the performance metric in the current round of training; The classification accuracy is: Among them, α i is the classification accuracy rate; Assign a dynamic weight w to client i based on the classification accuracy i : Where, ε is the smoothing parameter.

8. The industrial object detection method based on dynamic prototype training according to claim 7, characterized in that In S5, when the central server optimizes the global model, according to the dynamic weight w i performs weighted averaging on the local model parameters of each client, and then updates the global model parameters: Among them, θ i is the local model parameter of the client; is the updated global model parameter.