A Paradigmless Incremental Learning Method and System Applicable to Open Worlds
By generating pseudo-old class features and adaptive threshold optimization through a non-paradigm-based incremental learning method, the problem of handling out-of-distribution samples under the closed-world assumption is solved, enabling efficient identification of out-of-distribution samples in the open world while reducing storage requirements and privacy risks.
Patent Information
- Application Number
- CN202411611059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Existing class incremental learning methods are based on the closed-world assumption and cannot handle out-of-distribution samples in open worlds, leading to increased security risks and storage resource requirements. At the same time, storing old class samples may cause privacy issues.
A paradigm-free incremental learning method is proposed, which generates pseudo-old class features through incremental learning, and uses out-of-distribution detection and adaptive threshold optimization to identify out-of-distribution samples, thus constructing a final classification model. This avoids storing old class samples and uses hard sample mining to optimize the out-of-distribution detection threshold.
It achieves accurate identification of out-of-distribution samples in open worlds, with good robustness and generalization ability, reduced storage requirements, and avoidance of privacy risks.
Smart Images

Figure CN119577574B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a paradigm-free incremental learning method and system applicable to open worlds. Background Technology
[0002] In recent years, continuous learning has gained increasing attention in the research community. Incremental learning enables intelligent agents (such as deep neural networks) to progressively learn new categories from streaming data while retaining knowledge of older categories. To further simulate real-world constraints, such as privacy and storage limitations, it is not possible to save or reproduce samples of older categories during the learning process for new tasks; this is known as paradoxical incremental learning.
[0003] Existing class-based incremental learning and non-paradigm-based incremental learning settings are based on the closed-world assumption, which states that the training and test sets contain only in-distribution samples. However, in real-world scenarios, intelligent agents often encounter out-of-distribution samples when learning new tasks, leading to an accumulation of both in-distribution and out-of-distribution classes.
[0004] While existing class-based incremental learning and non-paradigm-based incremental learning methods can incrementally learn in-distribution classes, they cannot handle out-of-distribution samples from the open world.
[0005] The existing incremental learning systems mainly have the following problems:
[0006] 1. Limitations of the closed-world hypothesis:
[0007] Existing incremental learning methods are based on the closed-world assumption, which assumes that the training and test sets contain only in-distribution samples. However, in real-world scenarios, models need to deal with dynamically changing categories and environments, and may encounter out-of-distribution samples, causing these methods to produce unexpected outputs and creating safety risks.
[0008] 2. Storage and privacy issues:
[0009] Traditional incremental learning systems typically rely on storing samples of older classes (called "examples" or "memory replays") to help the model maintain its memory of previously learned knowledge when training on new tasks. However, as the number of classes to be learned increases, storage requirements rise rapidly, placing greater demands on resource-constrained devices such as embedded systems or mobile devices. Furthermore, in many sensitive fields (such as healthcare and finance), storing historical user or customer data can raise privacy concerns. Summary of the Invention
[0010] The main objective of this invention is to propose a paradigm-free incremental learning method and system applicable to open worlds, which can accurately identify out-of-distribution samples and has good robustness and generalization ability.
[0011] To achieve the above objectives, one aspect of this invention proposes a paradigm-free incremental learning method suitable for open worlds, comprising the following steps:
[0012] Based on the unclassified dataset of the open world, incremental learning is performed on the dataset to obtain a preliminary classification model.
[0013] Based on the results of incremental learning, the preliminary classification model is subjected to out-of-distribution detection and adaptive threshold optimization to identify out-of-distribution samples and in-distribution samples;
[0014] Based on the out-of-distribution samples and the in-distribution samples, corresponding out-of-distribution detection processing and in-distribution classification processing are performed respectively to construct the final target classification model.
[0015] In some embodiments, the incremental learning of the dataset to be processed includes the following steps:
[0016] When each task arrives, a new class is learned from the in-distribution samples of the new task. Each incremental learning task does not include out-of-distribution samples or samples that retain the old class. The incremental learning phase can be represented as a series of N training tasks and the corresponding training set {D1, D2, ..., D...}. N}, the training set contains no overlapping classes, among which, It has M n The nth training set of training instances It's a picture. These are the corresponding labels, where the label spaces for different tasks n≠n′ are disjoint;
[0017] The classification model f(x) = W T Φ(x) is decoupled into the feature extractor Φ(x) and the classifier W. T The feature extractor extracts the features of each sample: F = Φ(x), F ∈ R. d The class center of a class is obtained by averaging the features of all samples in that class. μ is the storage center of each old class, and the distance from the new class feature to the new class center is added to the old class center to generate pseudo-old class features. The expression for this process is: F old ′=F new -μ new +μ old , of which F old ′ represents the generated pseudo-old class data, Fnew It is a feature of the new type of training data, μ new It is the mean of the features of the new class of training data, μ old It is the mean of the features stored from the old class training data from the previous task;
[0018] The ultimate goal of determining the nth training task is to fit a classification model to all the classes that have been seen. Minimize expected risk: in, These are the optimal parameters obtained after training on the nth training task. This refers to network parameters. I is the training set distribution, and I(·) is an indicator function that outputs 1 if the expression is true and 0 otherwise.
[0019] In some embodiments, for the classification model, during training, in addition to minimizing the loss of the new class training data, the loss of the pseudo-old class features generated in Step 2 is also minimized. The expression for this process is:
[0020] The first part of the equation It's the cross-entropy loss of the new class of training data, the latter half. It is the cross-entropy loss of the generated pseudo-old class data; N is the number of samples in the current training set, x i Let f(x) be the i-th sample, f(x) be the current model, M be the number of generated pseudo-old class samples, and W be the number of samples generated. T These are classifier weights. It is the j-th pseudo-old class sample.
[0021] In some embodiments, the step of performing out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning to identify out-of-distribution samples and in-distribution samples includes the following steps:
[0022] For out-of-distribution scores, a learning-free out-of-distribution detection method is added after the classifier. The probability that a sample is an out-of-distribution sample is measured by the confidence score of the classifier in classifying the sample. The out-of-distribution score for each sample on the nth task is: o = ψ(f n (x)), where o is the out-of-distribution fraction, ψ is the designed out-of-distribution detection method, and f n (x) is the model for the nth task; the definition expression for the out-of-distribution score is: Among them, o M It is the definition of the fraction outside the specific distribution, f n,i (x) represents the output f nThe i-th index of (x) is used as the output of the i-th class label; C represents the number of classes that the system has learned;
[0023] A method that does not use out-of-distribution samples to optimize the threshold is adopted, and a more discriminative threshold is obtained by mining hard samples.
[0024] Whether a sample is an out-of-distribution sample is determined based on its out-of-distribution score and out-of-distribution detection threshold.
[0025] In some embodiments, the method of optimizing the threshold without using out-of-distribution samples, and instead utilizing hard sample mining to obtain a more discriminative threshold, specifically involves:
[0026] Misclassified in-distribution samples are treated as pseudo-out-of-distribution samples. Simultaneously, the detection error is minimized to obtain the optimal out-of-distribution detection threshold. This detection error measures the misclassification probability of the out-of-distribution detector, and its expression is:
[0027] DE = 0.5 * P in (G(x)=0)+0.5*P out (G(x)=1),
[0028] Among them, P in It is the probability within the distribution, P out G(x) is the probability of being out of the distribution. G(x) is the out-of-distribution detector. G(x) = 0 means that the sample is classified as out of the distribution, and G(x) = 1 means that the sample is classified as in the distribution.
[0029] In some embodiments, determining whether a sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold specifically involves:
[0030] An out-of-distribution detector determines whether the input x is an out-of-distribution sample. The expression for the out-of-distribution detector is:
[0031]
[0032] Among them, G n (x;τ n ,f n ) is an out-of-distribution detector, ψ(x;f) n ) is the out-of-distribution fraction, f n It is a classification model, τ n G is the out-of-distribution detection threshold. n (x;τ n ,f n G = 0 indicates an out-of-distribution sample. n (x;τ n ,f n ) = 1 indicates a sample within the distribution.
[0033] In some embodiments, the step of performing corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples, respectively, to construct the final target classification model includes the following steps:
[0034] The dataset is constructed by adding samples from a completely different dataset to the test set, which contains only samples within the distribution, to simulate the test set in the open-world, non-paradigm-based incremental learning setting.
[0035] For each test sample, out-of-distribution detection is performed to obtain the final target classification model; specifically: for samples predicted to be in-distribution, f(x) is used to classify them; for samples predicted to be out-of-distribution, they are classified as out-of-distribution classes.
[0036] The expression for the target classification model is as follows:
[0037]
[0038] Among them, H n (x;τ n ,f n ) is the final classification model, f n,i (x) represents the model f n (x) The i-th index of the output is the classification result within the distribution, G n (x;τ n ,f n ) is an out-of-distribution detector, G n (x;τ n ,f n ) = 1 represents a sample classified as within the distribution, G n (x;τ n ,f n ) = 0 means the sample is classified as out of the distribution. Indicates the distribution of out-classes;
[0039] The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence scores below the threshold, the model labels them as out-of-distribution samples; for samples with high confidence scores, they are classified as in-distribution samples that have already been learned.
[0040] Another aspect of this invention provides a paradigm-free incremental learning system suitable for open worlds, comprising:
[0041] The first module is used to perform incremental learning on the dataset to be processed based on the acquired open-world dataset without generic classes, and to obtain a preliminary classification model.
[0042] The second module is used to perform out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning, and to identify out-of-distribution samples and in-distribution samples.
[0043] The third module is used to perform corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples, respectively, to construct the final target classification model.
[0044] To achieve the above objectives, another aspect of the present invention provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0045] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0046] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method.
[0047] The embodiments of this invention include at least the following beneficial effects: This invention provides a no-paradigm class incremental learning method and system applicable to open worlds. This scheme, based on an acquired no-paradigm class dataset from an open world, performs incremental learning on the dataset to obtain a preliminary classification model; based on the results of the incremental learning, it performs out-of-distribution detection and adaptive threshold optimization on the preliminary classification model to identify out-of-distribution samples and in-distribution samples; based on the out-of-distribution samples and the in-distribution samples, it performs corresponding out-of-distribution detection processing and in-distribution classification processing respectively to construct the final target classification model. The embodiments of this invention can accurately identify out-of-distribution samples and possess good robustness and generalization ability. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention;
[0049] Figure 2 This is a flowchart of the overall steps provided in the embodiments of the present invention;
[0050] Figure 3 This invention provides a paradigm-free incremental learning system framework suitable for open worlds.
[0051] Figure 4 This is a schematic diagram illustrating the performance differences between different methods provided in the embodiments of the present invention;
[0052] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.
[0054] It is understood that the terms “first,” “second,” etc., used in this invention may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to determination” as used herein may be interpreted as “when…” or “when…” or “in response to determination.”
[0055] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0057] Before providing a detailed description of the embodiments of the present invention, some related technologies involved in the embodiments of the present invention will be described first, as follows:
[0058] Deep learning: Deep learning is a subfield of machine learning. Its core lies in using deep models composed of multiple layers (usually neural networks composed of neurons) to learn and represent complex patterns in data. Low-dimensional (3D for RGB images) image information can be transformed into high-dimensional (generally >= 128 dimensions) feature information through deep neural networks, effectively improving image classification performance. In this invention proposal, deep learning technology is mainly used to construct open-world incremental learning systems, using deep neural networks to achieve feature extraction and classification of samples.
[0059] Open World: Deep learning systems typically assume their application scenario is a closed world, meaning all data is assumed to be known and fixed. However, the real world is generally open, contradicting this closed-world assumption. Data in an open world arrives in a streaming manner, constantly introducing new in-distribution categories, requiring the model to continuously learn these categories. Simultaneously, during testing, out-of-distribution samples (categories) not seen in the training set will appear, requiring the system to handle these unseen samples. The open world assumption is more applicable to many real-world scenarios, such as autonomous driving, security monitoring, cybersecurity, and recommendation systems. In these scenarios, the system may constantly encounter new categories, new attack methods, or new user behaviors. The system not only needs to efficiently classify known categories but also detect and process newly emerging categories. For example, autonomous driving systems must operate in uncertain environments, recognizing not only known objects (such as vehicles and pedestrians) but also detecting and responding to unknown obstacles or special situations (such as unseen animals or objects).
[0060] Incremental Class Learning (CIL) Systems: The incremental class learning system discussed in this invention involves using a deep learning model to progressively learn new classes (new in-distribution categories) while retaining knowledge of old classes (old in-distribution categories). Traditional deep learning models typically require training on a fixed dataset, but in the incremental class learning setting, the model needs to be exposed to continuously emerging new classes. This requires the incremental class learning system to have continuous learning capabilities, i.e., to continuously learn new classes while avoiding forgetting the old classes already learned (i.e., the "catastrophic forgetting" problem).
[0061] Non-Example Incremental Learning System (EFCIL): This adds the restriction that original images of old classes cannot be stored to the basic settings of incremental learning.
[0062] Out-of-distribution detection: In open-world environments, models not only need to correctly classify in-distribution categories but also need to detect and handle unseen out-of-distribution samples. In deep learning models, in-distribution samples typically yield high-confidence classification results, while out-of-distribution samples, not present in the training set, result in lower output confidence. This system proposes an out-of-distribution detection method based on maximum classification probability, a simple yet effective application of deep learning techniques. By leveraging the confidence score of each class classification within a neural network, out-of-distribution samples are effectively distinguished.
[0063] Out-of-distribution detection threshold: The out-of-distribution detection threshold is a key parameter for each out-of-distribution detection method. The same out-of-distribution detection method can perform very differently at different out-of-distribution detection thresholds. Therefore, it is very important to optimize and obtain a good out-of-distribution detection threshold.
[0064] Hard sample mining is a commonly used technique in machine learning, especially in deep learning training. Its purpose is to focus on samples that are difficult to classify or predict correctly during model training, thereby improving the model's generalization ability and performance. Hard sample mining uncovers boundary samples, prompting the model to learn more accurate classification boundaries, thus improving classification accuracy. In this invention, embodiments utilize hard sample mining to address the out-of-distribution detection threshold optimization problem in open-world incremental learning scenarios (without out-of-distribution samples). Specifically, by treating misclassified in-distribution samples as pseudo-out-of-distribution samples, the model can optimize the out-of-distribution detection threshold even without real out-of-distribution samples. This approach is equivalent to a hard sample mining strategy because misclassified samples are usually located near the classification boundary and have higher uncertainty; treating them as pseudo-out-of-distribution samples to optimize the out-of-distribution detection threshold is a very reasonable approach. The open-world no-paradigm incremental learning method and system provided by this invention relates to the field of computer technology. The open-world no-paradigm incremental learning method provided by this invention can be applied to terminals, servers, or software running on terminals or servers. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited thereto; the server may be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server may also be a node server in a blockchain network; the software may be an application that implements an exampleless incremental learning method suitable for the open world, but is not limited to the above forms.
[0065] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0066] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.
[0067] Server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0068] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.
[0069] Terminal 102 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc. It can also be a vehicle-mounted terminal of the various device types described above, but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.
[0070] Exemplary based on Figure 1The implementation environment shown in this embodiment of the invention provides a paradigm-free incremental learning method applicable to open worlds. The following description uses the application of this paradigm-free incremental learning method applicable to open worlds in server 101 as an example. It can be understood that this method can also be applied to terminal 102.
[0071] Reference Figure 2 , Figure 2 The flowchart illustrates a paradigm-free incremental learning method for open-world applications applied to a server, as provided in this embodiment of the invention. The method can be executed by any of the aforementioned computer devices (including servers or terminals). See also... Figure 2 The method may include the following steps:
[0072] Based on the unclassified dataset of the open world, incremental learning is performed on the dataset to obtain a preliminary classification model.
[0073] Based on the results of incremental learning, the preliminary classification model is subjected to out-of-distribution detection and adaptive threshold optimization to identify out-of-distribution samples and in-distribution samples;
[0074] Based on the out-of-distribution samples and the in-distribution samples, corresponding out-of-distribution detection processing and in-distribution classification processing are performed respectively to construct the final target classification model.
[0075] In some embodiments, the incremental learning of the dataset to be processed includes the following steps:
[0076] When each task arrives, a new class is learned from the in-distribution samples of the new task. Each incremental learning task does not include out-of-distribution samples or samples that retain the old class. The incremental learning phase can be represented as a series of N training tasks and the corresponding training set {D1, D2, ..., D...}. N}, the training set contains no overlapping classes, among which, It has M n The nth training set of training instances It's a picture. These are the corresponding labels, where the label spaces for different tasks n≠n′ are disjoint;
[0077] The classification model f(x) = W T Φ(x) is decoupled into the feature extractor Φ(x) and the classifier W. T The feature extractor extracts the features of each sample: F = Φ(x), F ∈ R. d The class center of a class is obtained by averaging the features of all samples in that class. μ is the storage center of each old class, and the distance from the new class feature to the new class center is added to the old class center to generate pseudo-old class features. The expression for this process is: F old ′=F new -μ new +μ old , of which F old ′ represents the generated pseudo-old class data, F new It is a feature of the new type of training data, μ new It is the mean of the features of the new class of training data, μ old It is the mean of the features stored from the old class training data from the previous task;
[0078] The ultimate goal of determining the nth training task is to fit a classification model to all the classes that have been seen. Minimize expected risk: in, These are the optimal parameters obtained after training on the nth training task. This refers to network parameters. I is the training set distribution, and I(·) is an indicator function that outputs 1 if the expression is true and 0 otherwise.
[0079] In some embodiments, for the classification model, during training, in addition to minimizing the loss of the new class training data, the loss of the pseudo-old class features generated in Step 2 is also minimized. The expression for this process is:
[0080] The first part of the equation It's the cross-entropy loss of the new class of training data, the latter half. It is the cross-entropy loss of the generated pseudo-old class data; N is the number of samples in the current training set, x i Let f(x) be the i-th sample, f(x) be the current model, M be the number of generated pseudo-old class samples, and W be the number of samples generated. T These are classifier weights. It is the j-th pseudo-old class sample.
[0081] In some embodiments, the step of performing out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning to identify out-of-distribution samples and in-distribution samples includes the following steps:
[0082] For out-of-distribution scores, a learning-free out-of-distribution detection method is added after the classifier. The probability that a sample is an out-of-distribution sample is measured by the confidence score of the classifier in classifying the sample. The out-of-distribution score for each sample on the nth task is: o = ψ(f n(x)), where o is the out-of-distribution fraction, ψ is the designed out-of-distribution detection method, and f n (x) is the model for the nth task; the definition expression for the out-of-distribution score is: Among them, o M It is the definition of the fraction outside the specific distribution, f n,i (x) represents the output f n The i-th index of (x) is used as the output of the i-th class label; C represents the number of classes that the system has learned;
[0083] A method that does not use out-of-distribution samples to optimize the threshold is adopted, and a more discriminative threshold is obtained by mining hard samples.
[0084] Whether a sample is an out-of-distribution sample is determined based on its out-of-distribution score and out-of-distribution detection threshold.
[0085] In some embodiments, the method of optimizing the threshold without using out-of-distribution samples, and instead utilizing hard sample mining to obtain a more discriminative threshold, specifically involves:
[0086] Misclassified in-distribution samples are treated as pseudo-out-of-distribution samples. Simultaneously, the detection error is minimized to obtain the optimal out-of-distribution detection threshold. This detection error measures the misclassification probability of the out-of-distribution detector, and its expression is:
[0087] DE = 0.5 * P in (G(x)=0)+0.5*P out (G(x)=1),
[0088] Among them, P in It is the probability within the distribution, P out G(x) is the probability of being out of the distribution. G(x) is the out-of-distribution detector. G(x) = 0 means that the sample is classified as out of the distribution, and G(x) = 1 means that the sample is classified as in the distribution.
[0089] In some embodiments, determining whether a sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold specifically involves:
[0090] An out-of-distribution detector determines whether the input x is an out-of-distribution sample. The expression for the out-of-distribution detector is:
[0091]
[0092] Among them, G n (x;τ n ,f n ) is an out-of-distribution detector, ψ(x;f) n ) is the out-of-distribution fraction, f nIt is a classification model, τ n G is the out-of-distribution detection threshold. n (x;τ n ,f n G = 0 indicates an out-of-distribution sample. n (x;τ n ,f n ) = 1 indicates a sample within the distribution.
[0093] In some embodiments, the step of performing corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples, respectively, to construct the final target classification model includes the following steps:
[0094] The dataset is constructed by adding samples from a completely different dataset to the test set, which contains only samples within the distribution, to simulate the test set in the open-world, non-paradigm-based incremental learning setting.
[0095] For each test sample, out-of-distribution detection is performed to obtain the final target classification model; specifically: for samples predicted to be in-distribution, f(x) is used to classify them; for samples predicted to be out-of-distribution, they are classified as out-of-distribution classes.
[0096] The expression for the target classification model is as follows:
[0097]
[0098] Among them, H n (x;τ n ,f n ) is the final classification model, f n,i (x) represents the model f n (x) The i-th index of the output is the classification result within the distribution, G n (x;τ n ,f n ) is an out-of-distribution detector, G n (x;τ n ,f n ) = 1 represents a sample classified as within the distribution, G n (x;τ n ,f n ) = 0 means the sample is classified as out of the distribution. Indicates the distribution of out-classes;
[0099] The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence scores below the threshold, the model labels them as out-of-distribution samples; for samples with high confidence scores, they are classified as in-distribution samples that have already been learned.
[0100] The specific implementation process of this invention will be described in detail below using a specific application scenario as an example:
[0101] refer to Figure 3 , Figure 3 This invention demonstrates a paradigm-free incremental learning system framework suitable for open worlds, based on an embodiment of the present invention.
[0102] The method of this invention includes the following three stages:
[0103] Phase 1: Incremental Learning Phase
[0104] Step 1: Dataset Partitioning. With each new task, the system learns a new class from the in-distribution samples of the new task. Each incremental learning task does not include out-of-distribution samples, nor does it retain samples from the old class. Formally, the incremental learning phase can be represented as a series of N training tasks and their corresponding training sets {D1, D2, ..., D...}. N}, classes without overlap, where, It has M n The nth training set of training instances. It's a picture. These are the corresponding labels. According to the CIL settings, the label spaces for different tasks n≠n′ are disjoint. In this embodiment of the invention, access to data from D is only possible in the nth training task. n The training data.
[0105] Step 2: Generate pseudo-old class data. In this embodiment of the invention, the classification model f(x) = W is first generated. T Φ(x) is decoupled into the feature extractor Φ(x) and the classifier W. T In this embodiment of the invention, features for each sample can be extracted using a feature extractor: F = Φ(x), F ∈ R. d The class center of a class is obtained by averaging the features of all samples in that class. μ∈R d Next, this embodiment of the invention describes a method for generating pseudo-old class data. Specifically, this embodiment of the invention stores a class center for each old class and generates pseudo-old class features by adding the distance from the new class features to the new class center to the old class center.
[0106] F old ′=F new -μ new +μ old
[0107] Among them, F old ′ represents the generated pseudo-old class data, F new It is a feature of the new type of training data, μ newIt is the mean of the features of the new class of training data, μ old It is the mean of the features stored from the old class training data from the previous task. F new -μ new This is the distance from the new class feature to the new class center, describing the shape of the new class sample. This shape is added to the old class center μ. old The above yields the generated pseudo-old class data F. old ′.
[0108] Step 3: The ultimate goal of the nth training task is to fit a classification model to all the classes that have been seen. Minimize expected risk:
[0109]
[0110] in, These are the optimal parameters obtained after training on the nth training task. This refers to network parameters. I is the training set distribution, and I(·) is an indicator function that outputs 1 if the expression is true and 0 otherwise.
[0111] Specifically, during training, in addition to minimizing the loss of new class training data, the loss of pseudo-old class features generated in Step 2 is also minimized to maintain the memory of old classes and mitigate catastrophic forgetting.
[0112]
[0113] The first part of the equation represents the cross-entropy loss of the new class training data, and the second part represents the cross-entropy loss of the generated pseudo-old class data. N is the number of samples in the current training set, and x... i Let f(x) be the i-th sample, f(x) be the current model, M be the number of generated pseudo-old class samples, and W be the number of samples generated. T These are classifier weights. It is the j-th pseudo-old class sample.
[0114] Phase Two: Out-of-Distribution Detection and Adaptive Threshold Optimization
[0115] Step 1: Definition of Out-of-Distribution Score. After incremental learning, this embodiment of the invention adds an out-of-distribution detection method that does not require learning after the classifier. Specifically, this embodiment of the invention uses the confidence score of the classifier in classifying a sample to measure the probability that it is an out-of-distribution sample. Specifically, the out-of-distribution score of each sample on the nth task is as follows:
[0116] o=ψ(f n (x))
[0117] Where o is the out-of-distribution fraction, ψ is the designed out-of-distribution detection method, and f n (x) is the model for the nth task. The out-of-distribution score is defined as:
[0118]
[0119] Among them, o M It is the definition of the fraction outside the specific distribution, f n,i (x) represents the output f n The i-th index of (x) corresponds to the output of the i-th class label. C represents the number of classes that the system has learned.
[0120] Step 2: Optimize the out-of-distribution detection threshold. Since out-of-distribution samples are not allowed in the training set of open-world, no-paradigm incremental learning, the out-of-distribution detection threshold cannot be optimized in a supervised manner. This invention proposes a method to optimize the threshold without using out-of-distribution samples. This method utilizes hard sample mining to obtain a more discriminative threshold. Specifically, this invention treats misclassified in-distribution samples as pseudo-out-of-distribution samples and minimizes the detection error (DE) to obtain the optimal out-of-distribution detection threshold. The detection error measures the misclassification probability of the out-of-distribution detector:
[0121] DE = 0.5 * P in (Gx)=0)+0.5*P out (G(x)=1)
[0122] Among them, P in It is the probability within the distribution, P out G(x) represents the out-of-distribution probability, and G(x) is the out-of-distribution detector. G(x) = 0 means the sample is classified as out of distribution, and G(x) = 1 means the sample is classified as within distribution. Furthermore, existing static out-of-distribution detection methods directly fix the out-of-distribution detection threshold, which leads to suboptimal results under continuous learning settings. Therefore, this invention proposes an adaptive thresholding (AT) method, which optimizes the out-of-distribution detection threshold once after incremental learning for each task, enabling it to adapt to dynamic environments.
[0123] Step 3: Determine whether each sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold. Input whether x is an out-of-distribution sample, which can then be determined by the out-of-distribution detector:
[0124]
[0125] Among them, G n (x;τ n ,f n ) is an out-of-distribution detector, ψ(x;f)n ) is the out-of-distribution fraction, f n It is a classification model. G is the out-of-distribution detection threshold. n (x;τ n ,f n G = 0 indicates an out-of-distribution sample. n (x;τ n ,f n ) = 1 indicates a sample within the distribution.
[0126] Phase Three: Reasoning Phase
[0127] Step 1: Dataset Construction. In the open-world, non-paradigm-based incremental learning setting, the test set is an open set, containing both in-distribution and out-of-distribution samples. This embodiment of the invention simulates this setting by adding samples from another dataset (with completely different classes) to the test set, which only contains in-distribution samples.
[0128] Step 2: Out-of-Distribution Detection. For each test sample, this embodiment of the invention first performs out-of-distribution detection. For samples predicted to be within the distribution, this embodiment further classifies them using f(x). For samples predicted to be out of the distribution, this embodiment directly classifies them as out-of-distribution samples. The final inference model formula is as follows:
[0129]
[0130] Among them, H n (x;τ n ,f n ) is the final classification model, f n,i (x) represents the model f n (x) The i-th index of the output is the classification result within the distribution, G n (x;τ n ,f n ) is an out-of-distribution detector, G n (x;τ n ,f n ) = 1 represents a sample classified as within the distribution, G n (x;τ n ,f n ) = 0 means the sample is classified as out of the distribution. Indicates the distribution of out-of-classes.
[0131] After the above three stages, the final model H n (x;τ n ,f nThe system makes classification decisions based on learned categories and dynamically adjusted adaptive thresholds. For samples with confidence levels below the threshold, the model labels them as out-of-distribution samples and refuses to classify them. Through adaptive thresholding, the system can accurately detect out-of-distribution samples during inference, ensuring that they are not misclassified into known categories. Simultaneously, for samples with high confidence levels, the system can correctly classify them as already learned in-distribution samples, effectively completing the open-world, non-paradigm-free incremental learning task.
[0132] For the method proposed in this invention, three popular continuous learning benchmark datasets are used: (1) CIFAR100. This dataset contains 100 classes and 32×32 pixel images, with 500 and 100 images per class for training and testing, respectively. (2) TinyImageNet. This dataset is a subset of ImageNet, containing 200 classes and 64×64 pixel images, with 500 and 50 images per class for training and testing, respectively. (3) ImageNet100. This dataset is a subset of the ImageNet LSVRC dataset, containing 100 classes, with 1300 and 50 images per class for training and testing, respectively.
[0133] All datasets are divided into incremental settings. CIFAR100 uses three different incremental settings: 1) 50 initial classes and 5 incremental learning (IL) tasks for 10 classes; 2) 50 initial classes and 10 IL tasks for 5 classes; 3) 40 initial classes and 20 IL tasks for 3 classes. For TinyImageNet, this embodiment uses 100 initial classes and divides the remaining classes into three incremental settings: 1) 5 IL tasks for 20 classes; 2) 10 IL tasks for 10 classes; 3) 20 IL tasks for 5 classes. For ImageNet100, this embodiment uses 50 initial classes and 5 IL tasks for 10 classes. During testing, the out-of-distribution detection dataset Places365 is used as a source of out-of-distribution samples. The dataset contains 365 scene categories, all independent of the categories in the training and validation sets of this embodiment. This embodiment only uses its validation set, which contains 36,500 images of size 64×64 pixels, 100 images per category. Specifically, in this embodiment of the invention, the portion of the validation set with the same number of categories as the training set is extracted and divided according to different increment settings. The performance is measured using the accuracy of the last task and the average accuracy of all tasks.
[0134] This invention employs two classic out-of-distribution threshold optimization methods as competitors to the proposed adaptive threshold optimization. TPR95 determines the threshold by setting the true positive rate (TPR) to 95%, a widely used approach in out-of-distribution detection settings. Randomly selecting the in-distribution class as the out-of-distribution class (RID) is also used to optimize the out-of-distribution detection threshold. The proposed adaptive out-of-distribution detection threshold (AT) is compatible with both TPR95 and RID, producing TPR95 w / AT and RID w / AT, respectively.
[0135] K-fold cross-validation is used to create a validation set to determine the out-of-distribution detection threshold in open-world incremental learning. In this embodiment of the invention, K=3 is set in all experiments. Furthermore, due to the use of K-fold cross-validation, K thresholds are obtained for each task, and the maximum value among them is used as the final threshold for inference: τ n =maxτ n,i , where τ n,i This represents the threshold obtained by the i-th model for the n-th task. In this embodiment of the invention, the PyCIL framework and the default parameters for each method within PyCIL are used in the experiments. The network architecture for all methods is ResNet-18.
[0136] The experimental results are shown in Table 1 below:
[0137] Table 1
[0138]
[0139] The table above shows the results of different out-of-distribution threshold optimization methods under various open-world dataset settings. The comparison methods include classic out-of-distribution detection threshold optimization methods: TPR95 (which determines the threshold by setting the true positive rate (TPR) to 95%) and RID (which randomly selects in-distribution classes as out-of-distribution classes); these combined with the adaptive threshold optimization method (AT) proposed in this invention: TPR95+AT and RID+AT; and the out-of-distribution detection threshold optimization method MID without out-of-distribution samples proposed in this invention, and MID+AT combined with the adaptive threshold optimization method. The final out-of-distribution detection threshold optimization method MID+AT of this invention significantly outperforms other threshold optimization methods. For example, the proposed MID+AT improves performance by 19.53% and 23.60% compared to TPR95 in 10 incremental task settings on CIFAR100 and TinyImageNet, respectively. On the large ImageNet100 dataset, the MID+AT of this invention significantly improves performance compared to the baseline TPR95, with the average accuracy increasing from 41.15% to 61.43%. Figure 4A detailed comparison of different methods in the incremental learning process is presented. In the three graphs, the horizontal axis represents the task number, indicating the model's performance on the i-th task, and the vertical axis represents accuracy, calculated using the following formula: Among them, T OOD F represents the number of out-of-distribution samples that were correctly classified. OOD T is the number of out-of-distribution samples that were misclassified. ID,i The number of samples correctly classified into the i-th in-distribution class. F Id,i The numerator is the number of samples that were misclassified into the i-th in-distribution class. C represents the number of classes the model has seen so far. In other words, the numerator of Accuracy consists of correctly classified samples (including out-of-distribution samples), and the denominator is the total number of samples (including out-of-distribution samples). A higher Accuracy indicates that the model performs better in open-world environments. The dashed lines in the three figures represent existing threshold determination methods (directly setting an empirical value as the out-of-distribution detection threshold), while the solid lines in the three figures represent the threshold optimization methods proposed in this embodiment (adaptive threshold and threshold optimization methods that do not use out-of-distribution samples). It can be observed that there is a significant performance gap between the curve of this invention (MID+AT) and the curve of the basic method (TPR95).
[0140] In summary, the present invention has the following characteristics:
[0141] 1. An adaptive thresholding algorithm is proposed, which can dynamically adjust the out-of-distribution detection threshold at different incremental task stages, thereby adapting to the problem of the continuous accumulation of out-of-distribution sample categories in the open world. The adaptive threshold optimization mechanism, that is, the model re-optimizes the out-of-distribution detection threshold after each incremental learning stage of the task, allows the model to use the dynamic open-world environment to accurately detect new and old out-of-distribution categories.
[0142] 2. This system can function normally in an open-world environment, exhibiting high adaptability to constantly changing new tasks, new categories, and unknown out-of-distribution samples. Furthermore, as a paradigm-free system, it does not rely on storing samples of old classes when learning new tasks (paradigm-free setting), but instead maintains its memory of old classes by replaying generated samples of old classes. The out-of-distribution detection method requires no learning; it uses the confidence score of the classifier's classification of a sample to measure the probability that it is an out-of-distribution sample. The method for generating pseudo-old class data involves storing class centers for each old class and adding the variance of the new class features to the old class centers to generate pseudo-old class features.
[0143] 3. Since there are no out-of-distribution samples during training in an open world, the system must optimize the out-of-distribution detection threshold under unsupervised conditions. The system pays special attention to samples that are difficult to classify, and further optimizes the model's classification and out-of-distribution detection performance by mining these misclassified samples located near the decision boundary. The out-of-distribution detection threshold is optimized by minimizing the detection error (DE) rather than simply the accuracy, avoiding a threshold that would cause the out-of-distribution detector to predict the majority class. An unsupervised out-of-distribution detection threshold optimization method based on hard sample mining is used, where misclassified in-distribution samples are treated as pseudo-out-of-distribution samples for out-of-distribution detection threshold optimization. The out-of-distribution detection threshold is optimized by minimizing the detection error (DE).
[0144] Compared with the prior art, the present invention has the following advantages:
[0145] 1. Excellent no-sample incremental learning capability: This system has excellent no-sample incremental learning capability, which can gradually learn new categories from streaming data and maintain the knowledge of old categories by generating pseudo old class data, without the need to directly store examples of old classes.
[0146] 2. Capable of out-of-distribution detection: This invention can effectively detect out-of-distribution samples (i.e., new categories that have not appeared in the training set) while incrementally learning. Through the proposed learning-free out-of-distribution detection method, adaptive threshold optimization method, and unsupervised out-of-distribution detection threshold optimization method based on hard sample mining, the system can accurately identify out-of-distribution samples even when there is no training set and no out-of-distribution samples.
[0147] 3. Good robustness and generalization ability: Since this system adopts an unsupervised approach based on hard sample mining to optimize the out-of-distribution detection threshold and does not rely on saving old class samples, the system can maintain strong robustness and generalization ability under different tasks and environmental changes.
[0148] Another aspect of this invention provides a paradigm-free incremental learning system suitable for open worlds, comprising:
[0149] The first module is used to perform incremental learning on the dataset to be processed based on the acquired open-world dataset without generic classes, and to obtain a preliminary classification model.
[0150] The second module is used to perform out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning, and to identify out-of-distribution samples and in-distribution samples.
[0151] The third module is used to perform corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples, respectively, to construct the final target classification model.
[0152] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0153] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described no-paradigm incremental learning method applicable to open worlds. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0154] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0155] Please see Figure 5 , Figure 5 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0156] The processor 501 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0157] The memory 502 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 502 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 502 and is called and executed by the processor 501 to implement the open-world, non-paradigm-based incremental learning method of this invention.
[0158] The input / output interface 503 is used to implement information input and output;
[0159] The communication interface 504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0160] Bus 505 transmits information between various components of the device (e.g., processor 501, memory 502, input / output interface 503, and communication interface 504);
[0161] The processor 501, memory 502, input / output interface 503, and communication interface 504 are connected to each other within the device via bus 505.
[0162] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described paradigm-free incremental learning method applicable to the open world.
[0163] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0164] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0165] It should be noted that in various specific embodiments of the present invention, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of the present invention require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to a confirmation page. Only after obtaining the user's separate permission or consent is the necessary user-related data for the normal operation of the embodiments of the present invention acquired.
[0166] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0167] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0168] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0169] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0170] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0171] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0172] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0173] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0174] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0175] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0176] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.
Claims
1. A paradigm-free incremental learning method applicable to open worlds, characterized in that, Includes the following steps: Based on the unclassified dataset of the open world, incremental learning is performed on the dataset to obtain a preliminary classification model. Based on the results of incremental learning, the preliminary classification model is subjected to out-of-distribution detection and adaptive threshold optimization to identify out-of-distribution samples and in-distribution samples; Based on the out-of-distribution samples and the in-distribution samples, perform corresponding out-of-distribution detection processing and in-distribution classification processing respectively to construct the final target classification model; The incremental learning of the dataset to be processed includes the following steps: When each task arrives, a new class is learned from the in-distribution samples of the new task. Each incremental learning task does not include out-of-distribution samples or samples that retain the old class. The incremental learning phase can be represented as a series of Each training task and its corresponding training set The training set contains classes that do not overlap. It has The training instance of the first One training set, It's a picture. These are the corresponding tags, among which, for different tasks The label spaces are disjoint; Classification model Decoupling for Feature Extractor and classifier The feature extractor extracts features from each sample: The class center of a class is obtained by averaging the features of all samples in that class. , For each old class, store the class center, and add the distance from the new class feature to the old class center to generate pseudo old class features. The expression for this process is: ,in, It is generated pseudo-old class data. These are features of the new type of training data. It is the mean of the features of the new class of training data. It is the mean of the features stored from the old class training data from the previous task; Determine the first The ultimate goal of each training task is to fit a classification model to all the classes that have been seen. , To minimize expected risks: ,in, It is the first The optimal parameters obtained after training on each training task This refers to network parameters. It is the distribution of the training set. (·) is an indicator function that outputs 1 if the expression is true, and 0 otherwise. For the classification model, during training, in addition to minimizing the loss of the new class training data, the loss of the pseudo-old class features is also minimized. The expression for this process is: , The first part of the equation It's the cross-entropy loss of the new class of training data, the latter half. It is the cross-entropy loss of the generated pseudo-old class data; This is the number of samples in the current training set. It is the first one One sample, This is the current model. This is the number of pseudo-old class samples generated. These are the classifier weights. It is the first A pseudo-old class sample.
2. The paradigm-free incremental learning method applicable to open worlds according to claim 1, characterized in that, The step of performing out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning to identify out-of-distribution samples and in-distribution samples includes the following steps: For out-of-distribution scores, a learning-free out-of-distribution detection method is added after the classifier. The probability that a sample is an out-of-distribution sample is measured by the confidence of the classifier in classifying the sample. The out-of-distribution score for each sample on the nth task is: ,in, These are out-of-distribution fractions. This is the designed out-of-distribution detection method. This is the model for the nth task; the definition expression for the out-of-distribution score is: ,in, It is the definition of fractions outside the specific distribution. Indicates output The i-th index is used as the output of the i-th class label; C This represents the number of categories that the system has already learned. A method that does not use out-of-distribution samples to optimize the threshold is adopted, and a more discriminative threshold is obtained by mining hard samples. Whether a sample is an out-of-distribution sample is determined based on its out-of-distribution score and out-of-distribution detection threshold.
3. The paradigm-free incremental learning method applicable to open worlds according to claim 2, characterized in that, The method that optimizes the threshold without using out-of-distribution samples utilizes hard sample mining to obtain a more discriminative threshold, specifically: Misclassified in-distribution samples are treated as pseudo-out-of-distribution samples. Simultaneously, the detection error is minimized to obtain the optimal out-of-distribution detection threshold. This detection error measures the misclassification probability of the out-of-distribution detector. The expression is: , in, It is the probability within the distribution. It is the probability outside the distribution. It is an off-distribution detector. This means that it is classified as an out-of-distribution sample. This means that it is classified as an in-distribution sample.
4. The paradigm-free incremental learning method applicable to open worlds according to claim 2, characterized in that, The determination of whether a sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold is as follows: Off-distribution detectors determine the input Whether a sample is out of distribution, the expression for the out-of-distribution detector is: in, It is an off-distribution detector. These are out-of-distribution fractions. It is a classification model. The out-of-distribution detection threshold, Indicates out-of-distribution samples, This represents a sample within the distribution.
5. The paradigm-free incremental learning method applicable to open worlds according to claim 1, characterized in that, The step of constructing the final target classification model by performing corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples respectively includes the following steps: The dataset is constructed by adding samples from a completely different dataset to the test set, which contains only samples within the distribution, to simulate the test set in the open-world, non-paradigm-based incremental learning setting. For each test sample, out-of-distribution detection is performed to obtain the final target classification model; specifically: for samples predicted to be in-distribution, f(x) is used to classify them; for samples predicted to be out-of-distribution, they are classified as out-of-distribution classes. The expression for the target classification model is as follows: in, It is the final classification model. Representation Model The output of the first Each index represents the classification result within the distribution. It is an off-distribution detector. The representative is classified as an in-distribution sample. , Indicates the distribution of out-classes; The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence scores below the threshold, the model labels them as out-of-distribution samples; for samples with high confidence scores, they are classified as in-distribution samples that have already been learned.
6. A system for implementing the paradigm-free incremental learning method applicable to open worlds as described in any one of claims 1-5, characterized in that, include: The first module is used to perform incremental learning on the dataset to be processed based on the acquired open-world dataset without generic classes, and to obtain a preliminary classification model. The second module is used to perform out-of-distribution detection and adaptive threshold optimization on the preliminary classification model based on the results of incremental learning, and to identify out-of-distribution samples and in-distribution samples. The third module is used to perform corresponding out-of-distribution detection processing and in-distribution classification processing based on the out-of-distribution samples and the in-distribution samples, respectively, to construct the final target classification model.
7. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the method as described in any one of claims 1 to 5.