Open world new class discovery federal learning method based on prototype comparison
Through a federated learning method based on prototype comparison, the problem of identifying new categories in open-world environments is solved, and new category detection and model generalization across institutions are achieved. It is suitable for privacy-sensitive and data-heterogeneous environments, especially medical and life science scenarios.
Patent Information
- Application Number
- CN202510649612.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-09-19
AI Technical Summary
Existing federated learning methods have difficulty identifying or adapting to the emergence of new categories in open-world environments, and cannot achieve automatic discovery and identification of new categories under privacy protection and data distribution heterogeneity.
A prototype comparison-based federated learning method is adopted to collaboratively train the model to identify new categories by maintaining data locality, semi-supervised contrastive representation learning, and open-world recognition and alignment mechanisms. Pseudo-labels and prototype alignment regularization terms are used to reduce inter-client offsets and achieve cross-institutional new category detection.
Under the premise of decentralized data aggregation, it effectively identifies new categories, improves the ability to identify new categories and the generalization ability of models, is suitable for privacy-sensitive and bandwidth-constrained edge computing environments, and improves data utilization and communication efficiency.
Smart Images

Figure CN120671774A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a federated learning method for discovering new classes in an open world based on prototype comparison. Background Art
[0002] Currently, artificial intelligence systems are widely used in scenarios such as image recognition, anomaly detection, and intelligent monitoring, but they still face three key challenges: (1) Categories in real-world environments often change dynamically, and standard models cannot recognize new categories that do not appear in the training set, which is the "open world" problem; (2) Data sources are scattered and privacy-sensitive, making centralized training difficult; (3) The cost of obtaining data labels is high, and annotations are generally scarce.
[0003] Federated learning, as a distributed training technology, allows multiple clients to collaboratively train models without sharing raw data, effectively addressing privacy concerns. However, existing federated learning methods are generally based on closed-class settings, making them difficult to identify or adapt to the emergence of new classes. While semi-supervised federated methods can alleviate the problem of insufficient annotation, they also assume a fixed set of classes and lack the ability to discover new ones.
[0004] Open-world learning methods attempt to address the problem of incomplete categories, but most have been proposed in centralized environments and cannot be directly applied to federated learning environments, particularly due to challenges such as heterogeneous data distribution, inconsistent model synchronization, and limited communication. Furthermore, existing methods generally ignore the consistency and scalability of the model's ability to recognize new categories across clients. Summary of the Invention
[0005] This paper proposes a federated learning method for open-world new category discovery based on prototype comparison, which aims to solve the problem of automatic discovery and identification of new categories. It can be applied to various data-sensitive tasks in real open environments, such as emerging disease monitoring, financial fraud detection, and industrial fault identification.
[0006] The present invention is implemented through the following technical solutions. The present invention proposes a prototype-based open-world novel class discovery federated learning method, which synergistically integrates three technical components: (1) a federated learning architecture that maintains data locality; (2) semi-supervised contrastive representation learning for label-efficient model training; and (3) a prototype-based open-world recognition and alignment mechanism for detecting unseen disease classes. The method comprises the following steps: Step 1: The central server constructs the initial global model parameters and global category prototype set, and sends them to multiple client nodes participating in the training; Step 2: Each client uses the current model to obtain the feature embedding set of local samples, determines the partitioning threshold based on the similarity score between the labeled data and the category prototype, and divides the unlabeled data into known class data and potential unknown class data accordingly; Step 3: Assign pseudo labels to the unknown class unlabeled data based on their distance from the class prototype. Contrastive learning losses are constructed on the divided labeled data, known class unlabeled data, and unknown class unlabeled data. A prototype alignment regularization term is introduced to reduce prototype drift between clients. The model is trained using the above loss constraints to update the local model and class prototype set. Step 4: The server collects the models and prototype sets uploaded by each client, aggregates the model parameters and prototypes, updates the global model parameters and global category prototype set, and sends them to each client; Step 5: Repeat steps 2-4 until the preset T rounds of global communication are completed; finally, a trained global model and global prototype are obtained, which can be used to classify known categories and detect emerging unknown categories for new data from unknown sources.
[0007] Furthermore, for each sample in the unlabeled dataset, the client calculates the maximum similarity score between its feature embedding and the global prototypes of all known categories. If the maximum similarity score is less than a threshold, the sample is classified as a potential set of unknown category samples; otherwise, the sample is classified as a set of unlabeled samples of known categories.
[0008] Furthermore, step 3 performs pseudo-label assignment for unknown category samples: the pseudo-label is assigned to the category corresponding to the unknown class prototype with the highest similarity by comparing its feature embedding with the category prototype.
[0009] Furthermore, when constructing the local learning training loss, the following components are included: a. Labeled data loss: On the labeled data, the standard cross-entropy loss and the supervised contrast loss are applied. The goal is to bring the features of samples of the same class closer and push the features of samples of different classes apart; b. Unlabeled data loss: On all unlabeled data, the contrast loss is applied, and two randomly enhanced views are generated for each sample. The views from the same original sample are regarded as positive examples, and the views from different original samples are regarded as negative examples; c. Unknown category data loss: On the unknown category sample set, the supervised contrast loss is applied using the assigned pseudo-labels; positive samples are unknown category samples with the same pseudo-label, and negative samples are unknown category samples with different pseudo-labels; d. Feature embedding alignment loss: In order to alleviate the problem of divergence of the model and prototype set caused by the heterogeneity of client data, a regularization loss term is introduced to encourage the category feature centers learned locally by the client to be aligned to the corresponding global category prototypes.
[0010] The present invention has the following beneficial effects: (1) This invention aims to provide a privacy-preserving federated AI framework that enables collaborative knowledge discovery across decentralized institutions. It proposes a unified AI framework that combines federated learning, open-world recognition, and semi-supervised contrastive learning, enabling distributed detection and modeling of unknown categories without centralized data aggregation. This framework effectively addresses the problem of traditional federated learning being unable to identify new categories through prototype-driven new category discovery and a global category alignment mechanism, providing a new solution for new category discovery in heterogeneous multi-center data environments.
[0011] (2) This invention uses a prototype distance metric to screen new class data. By measuring the distance between samples and class centers in the embedding space instead of the traditional confidence judgment method, it can efficiently discover potential unknown categories without labels, significantly improving the new class recognition and misjudgment control capabilities in open-world tasks. After using self-supervised contrastive learning to enhance model recognition capabilities and combining it with a prototype alignment strategy to introduce a global collaborative learning mechanism, it effectively alleviates the model offset problem caused by data distribution differences between different clients, ultimately achieving stable cross-institutional aggregation and enhanced generalization modeling capabilities. It is particularly suitable for distributed heterogeneous data scenarios such as medical and life sciences.
[0012] (3) The present invention has high data utilization and communication efficiency. With only a small amount of labeled data, it uses the "semi-supervised contrastive learning mechanism" to fully mine the information of unlabeled samples, and only needs to exchange embedded representations or category prototypes, without the need to transmit original images or model gradients. Compared with traditional solutions, it is more suitable for privacy-sensitive and bandwidth-constrained edge computing environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a flow chart of the open-world new class discovery federated learning method based on prototype comparison described in the present invention. DETAILED DESCRIPTION
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0015] See Figure 1The present invention proposes a prototype-based open-world novel class discovery federated learning method, which synergistically integrates three technical components: (1) a federated learning architecture that maintains data locality; (2) semi-supervised contrastive representation learning for label-efficient model training; and (3) a prototype-based open-world recognition and alignment mechanism for detecting unseen disease classes. The method comprises the following steps: Step 1: The central server constructs the initial global model parameters and global category prototype set, and sends them to multiple client nodes participating in the training; Step 2: Each client uses the current model to obtain the feature embedding set of local samples, determines the partitioning threshold based on the similarity score between the labeled data and the category prototype, and divides the unlabeled data into known class data and potential unknown class data accordingly; Step 3: Assign pseudo labels to the unknown class unlabeled data based on their distance from the class prototype. Contrastive learning losses are constructed on the divided labeled data, known class unlabeled data, and unknown class unlabeled data. A prototype alignment regularization term is introduced to reduce prototype drift between clients. The model is trained using the above loss constraints to update the local model and class prototype set. Step 4: The server collects the models and prototype sets uploaded by each client, aggregates the model parameters and prototypes, updates the global model parameters and global category prototype set, and sends them to each client; Step 5: Repeat steps 2-4 until the preset T rounds of global communication are completed; finally, a trained global model and global prototype are obtained, which can be used to classify known categories and detect emerging unknown categories for new data from unknown sources.
[0016] For each sample in the unlabeled dataset, the client calculates the maximum similarity score between its feature embedding and the global prototypes of all known categories. If the maximum similarity score is less than a threshold, the sample is classified as a potential set of unknown category samples; otherwise, the sample is classified as a set of unlabeled samples of known categories.
[0017] Step 3 assigns pseudo labels to samples of unknown categories: Pseudo labels are assigned to the category corresponding to the unknown class prototype with the highest similarity by comparing its feature embedding with the category prototype.
[0018] When constructing the local learning training loss, the following components are included: a. Labeled data loss: On the labeled data, the standard cross-entropy loss and the supervised contrast loss are applied. The goal is to bring the features of samples of the same class closer and push the features of samples of different classes apart; b. Unlabeled data loss: On all unlabeled data, the contrast loss is applied, and two randomly enhanced views are generated for each sample. The views from the same original sample are regarded as positive examples, and the views from different original samples are regarded as negative examples; c. Unknown category data loss: On the unknown category sample set, the supervised contrast loss is applied using the assigned pseudo-labels; positive samples are unknown category samples with the same pseudo-label, and negative samples are unknown category samples with different pseudo-labels; d. Feature embedding alignment loss: In order to alleviate the problem of divergence of the model and prototype set caused by the heterogeneity of client data, a regularization loss term is introduced to encourage the category feature centers learned locally by the client to be aligned to the corresponding global category prototypes.
[0019] Prototype-based new class discovery Prototype learning is effective in learning scenarios with a limited number of training samples, which is consistent with the assumption of open-world semi-supervised federated learning, that is, each client has limited labeled samples. , which is fed into the feature extractor And obtain the corresponding features If it is far away from the known class prototype, it is likely to belong to the new class. Based on this intuition, the cosine similarity between the features and prototypes of the known classes is calculated to separate the new class data from the rest of the unlabeled data: ,
[0020] in Indicates the A threshold mechanism is used to distinguish known samples from new samples. Select the use of The distance between the labeled data and the prototype is used as the benchmark and determined according to a certain percentage.
[0021] Partial Contrastive Learning Through the discovery of new classes based on prototypes, the client data is divided into three parts. Once the divided data sets are obtained, the self-supervised strategy is used to perform partial comparative learning on the unlabeled data. , unlabeled samples and new class samples Conducting targeted contrastive representation learning.
[0022] Cross-entropy loss can be directly applied to labeled data. To enhance feature discrimination and generalization, supervised contrastive learning is further employed. This is a strategy that uses label information to enhance contrastive learning, bringing similar samples closer together in feature space while separating different samples. Supervised contrastive learning introduces supervisory information by treating samples of the same class as positive samples and samples of different classes as negative samples. The loss function can be expressed as:
[0023] in represents the positive sample feature set, represents the negative sample feature set, is the temperature coefficient.
[0024] A self-supervised contrastive loss is used for representation learning. Two random augmentations are applied to all unlabeled samples. The augmented views from the same sample are considered positive samples, while the other samples are considered negative samples. After obtaining the positive and negative sample sets, the loss can be defined as:
[0025] Dependence only and This will lead to poor model performance, especially for new classes. This is because the new class data lacks supervision information and the maintained prototype library is not fully utilized. Therefore, the present invention constructs a specific loss function for new class samples. .because Without explicit label information, pseudo labels are used to construct positive and negative sample sets. Since the prototype is a measure of similarity in new class discovery, the sample feature vector can be calculated between Distance to predict the label of the sample prototype The loss for the new class is as follows:
[0026] Prototype-based client alignment In order to constrain the optimization direction of each client model and reduce the impact of heterogeneity, this paper uses a shared prototype library to align clients. Regularization terms are added during local training:
[0027] in Indicates the The proposed joint training mechanism can help mitigate the negative impact of heterogeneous and non-IID data distribution across clients.
[0028] Using an updated feature extractor A new representation of each sample can be obtained. In order to maintain an effective and stable prototype library, the prototype is updated in a moving average manner:
[0029] The final global model and global prototype can be obtained through aggregation:
[0030] .
[0031] The above description only expresses the preferred embodiments of the present invention and does not limit the present invention in any other form. Any technician familiar with the present invention may use the above disclosure to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A federated learning method for open-world novel class discovery based on prototype comparison, characterized by: The described approach synergistically integrates three technical components: (1) a federated learning architecture that maintains data locality; (2) Semi-supervised contrastive representation learning for label-efficient model training; and (3) a prototype-based open-world recognition and alignment mechanism for detecting unseen disease categories; The method comprises the following steps: Step 1: The central server constructs the initial global model parameters and global category prototype set, and sends them to multiple client nodes participating in the training; Step 2: Each client uses the current model to obtain the feature embedding set of local samples, determines the partitioning threshold based on the similarity score between the labeled data and the category prototype, and divides the unlabeled data into known class data and potential unknown class data accordingly; Step 3: Assign pseudo labels to the unknown class unlabeled data based on their distance from the class prototype. Contrastive learning losses are constructed on the divided labeled data, known class unlabeled data, and unknown class unlabeled data. A prototype alignment regularization term is introduced to reduce prototype drift between clients. The model is trained using the above loss constraints to update the local model and class prototype set. Step 4: The server collects the models and prototype sets uploaded by each client, aggregates the model parameters and prototypes, updates the global model parameters and global category prototype set, and sends them to each client; Step 5: Repeat steps 2-4 until the preset T rounds of global communication are completed; finally, a trained global model and global prototype are obtained, which can be used to classify known categories and detect emerging unknown categories for new data from unknown sources.
2. The method according to claim 1, characterized in that For each sample in the unlabeled dataset, the client calculates the maximum similarity score between its feature embedding and the global prototypes of all known categories. If the maximum similarity score is less than a threshold, the sample is classified as a potential set of unknown category samples; otherwise, the sample is classified as a set of unlabeled samples of known categories.
3. The method according to claim 1, characterized in that Step 3 assigns pseudo labels to samples of unknown categories: Pseudo labels are assigned to the category corresponding to the unknown class prototype with the highest similarity by comparing its feature embedding with the category prototype.
4. The method according to claim 1, wherein When constructing the local learning training loss, the following components are included: a. Labeled data loss: On the labeled data, the standard cross-entropy loss and supervised contrast loss are applied. Its goal is to bring the characteristics of samples of the same class closer and push the characteristics of samples of different classes apart; b. Unlabeled data loss: On all unlabeled data, a contrastive loss is applied to generate two randomly enhanced views for each sample, where views from the same original sample are considered positive examples, and views from different original samples are considered negative examples; c. Unknown category data loss: On the unknown category sample set, a supervised contrastive loss is applied using the assigned pseudo labels; positive samples are unknown category samples with the same pseudo labels, and negative samples are unknown category samples with different pseudo labels; d. Feature embedding alignment loss: To alleviate the problem of model and prototype set divergence caused by client data heterogeneity, a regularization loss term is introduced to encourage the center of the category features learned locally on the client to align with the corresponding global category prototype.