Example-free class incremental learning method and system suitable for open world

By introducing extradistribution detection and adaptive threshold optimization into class incremental learning methods, the problem of dealing with extradistribution samples in the open world is solved, and incremental learning without paradigm is realized, which improves the robustness and generalization ability of the system.

CN119577574AActive Publication Date: 2025-03-07SUN YAT SEN UNIV

Patent Information

Application Number
CN202411611059.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-07
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

Existing class incremental learning methods cannot handle out-of-distributed samples in the open world and have storage and privacy issues.

Method used

A modelless incremental learning method suitable for the open world is proposed. Through incremental learning, out-of-distribution detection and adaptive threshold optimization, out-of-distribution samples are identified and processed to avoid storing old-class samples.

Benefits of technology

It realizes accurate identification of out-of-distributed samples in the open world, with good robustness and generalization capabilities, and solves storage and privacy issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577574A_ABST
    Figure CN119577574A_ABST
Patent Text Reader

Abstract

The invention discloses a non-paradigm class incremental learning method and system suitable for an open world, and the method comprises the steps: carrying out the incremental learning of a to-be-processed data set according to the obtained non-paradigm class to-be-processed data set of the open world, and obtaining a preliminary classification model; according to a result of incremental learning, performing out-of-distribution detection and adaptive threshold optimization on the preliminary classification model, and identifying out-of-distribution samples and in-distribution samples; and according to the out-of-distribution samples and the in-distribution samples, respectively performing corresponding out-of-distribution detection processing and in-distribution classification processing, and constructing a final target classification model. The embodiment of the invention can accurately identify out-of-distribution samples, has good robustness and generalization ability, and can be widely applied to the technical field of computers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for example-free incremental learning applicable to an open world. Background Art

[0002] In recent years, continual learning has gained increasing attention in the research community. Class-incremental learning enables intelligent agents (such as deep neural networks) to gradually learn new categories from streaming data while maintaining knowledge of old categories. To further model real-world constraints such as privacy protection and storage limitations, samples of old categories cannot be saved or reproduced during the learning process of new tasks, which is called example-free class-incremental learning.

[0003] Existing incremental learning and non-example incremental learning settings are based on the closed-world assumption 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, resulting in the accumulation of in-distribution and out-of-distribution classes.

[0004] Although existing incremental learning and non-example incremental learning methods can incrementally learn in-distribution categories, they are unable to handle out-of-distribution samples from the open world.

[0005] In the existing incremental learning system, there are mainly the following problems:

[0006] 1. Limitations of the closed world assumption:

[0007] Existing incremental learning methods are based on the closed world assumption, which assumes that only in-distribution samples are included in the training and test sets. However, in real-world scenarios, models need to face dynamically changing categories and environments, and may encounter out-of-distribution samples, causing these methods to produce unexpected outputs and pose security risks.

[0008] 2. Storage and privacy issues:

[0009] Traditional class-incremental learning systems usually rely on saving samples of old classes (called "examples" or "memory replay") to help the model maintain its memory of previously learned knowledge by replaying old class samples when training new tasks. However, as the number of categories to be learned increases, storage requirements increase rapidly, which places higher demands on devices with limited resources (such as embedded systems or mobile devices). In addition, in many sensitive fields (such as medical, financial, etc.), saving historical data of users or customers may raise privacy issues. Summary of the invention

[0010] The main purpose of the embodiments of the present invention is to propose an example-free incremental learning method and system suitable for an open world, which can accurately identify out-of-distribution samples and has good robustness and generalization capabilities.

[0011] To achieve the above object, an embodiment of the present invention provides an example-free incremental learning method applicable to an open world, comprising the following steps:

[0012] According to the unprocessed data set of the open world without example classes, incremental learning is performed on the unprocessed data set to obtain a preliminary classification model;

[0013] According to the result 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] According to 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 a final target classification model.

[0015] In some embodiments, the incremental learning of the to-be-processed data set comprises the following steps:

[0016] When each task arrives, new categories are learned from the samples in the distribution of the new task. Each incremental learning task does not contain samples outside the distribution, nor does it contain samples of the old categories. The incremental learning stage can be represented as a series of N training tasks and corresponding training sets {D1, D2, ..., D N}, there are no overlapping classes in the training set, where Is M n The nth training set of training instances, It's a picture. 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 feature extractor Φ(x) and classifier W T , extract the features of each sample through the feature extractor: F = Φ(x), F∈R d , by averaging the features of all samples of a class to obtain the class center of the category μ is the center of each old class storage, and the distance from the new class feature to the new class center is added to the old class center to generate a pseudo old class feature. The expression of this process is: F old ′=F new -μ new +μ old , where F old ′ is the pseudo old class data generated, Fnew is the feature of the new class training data, μ new is the mean of the features of the new class training data, μ old is the mean of the features of the stored old class training data from the previous task;

[0018] Determine that the ultimate goal of the nth training task is to fit a classification model for all seen classes Minimize expected risks: in, is the optimal parameter obtained after training the nth training task, refers to the network parameters, is the training set distribution, I(·) is the indicator function, and outputs 1 if the expression holds, otherwise 0.

[0019] In some embodiments, for the classification model, in addition to minimizing the loss of new class training data during training, the loss of pseudo old class features generated in Step 2 is also minimized. The expression of this process is:

[0020] The first half of the equation is the cross entropy loss of the new class training data, the second half 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 is the i-th sample, f(x) is the current model, M is the number of pseudo-old class samples generated, and W T is the classifier weight, is the jth 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 according to the result of incremental learning to identify out-of-distribution samples and in-distribution samples includes the following steps:

[0022] For the out-of-distribution score, a non-learning out-of-distribution detection method is added after the classifier, and the confidence of the classifier in classifying the sample is used to measure the probability that it is an out-of-distribution sample, where the out-of-distribution score of 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 of the nth task; the definition expression for the specific out-of-distribution score is: Among them, M 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 output as the i-th class label; C represents the number of categories that the system has learned;

[0023] The method of optimizing the threshold without using out-of-distribution samples is adopted, and difficult sample mining is used to obtain a more discriminative threshold;

[0024] Whether each 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 utilizes difficult sample mining to obtain a more discriminative threshold, specifically:

[0026] The misclassified in-distribution samples are regarded as pseudo out-of-distribution samples, and the detection error is minimized to obtain the optimal out-of-distribution detection threshold. The detection error is used to measure the misclassification probability of the out-of-distribution detector. The expression of the detection error DE is:

[0027] DE=0.5*P in (G(x)=0)+0.5*P out (G(x)=1),

[0028] Among them, P in is the probability within the distribution, P out is the probability of being out of distribution, G(x) is the out-of-distribution detector, G(x)=0 means that it is classified as an out-of-distribution sample, and G(x)=1 means that it is classified as an in-distribution sample.

[0029] In some embodiments, the step of determining whether each sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold is as follows:

[0030] The out-of-distribution detector determines whether the input x is an out-of-distribution sample. The expression of the out-of-distribution detector is:

[0031]

[0032] Among them, G n (x; τ n ,f n ) is the out-of-distribution detector, ψ(x; f n ) is the fraction outside the distribution, f n is the classification model, τ n is the out-of-distribution detection threshold, G n (x; τ n ,f n )=0 means out-of-distribution samples, G n (x; τ n ,f n )=1 indicates the sample is within the distribution.

[0033] In some embodiments, performing corresponding out-of-distribution detection processing and in-distribution classification processing according to the out-of-distribution samples and the in-distribution samples, respectively, to construct a final target classification model includes the following steps:

[0034] Construct a dataset, specifically: add dataset samples of completely different categories to the test set containing only in-distribution samples to simulate the test set in the open world example-free incremental learning setting;

[0035] Perform out-of-distribution detection on each test sample to obtain the final target classification model; specifically: for samples predicted to be in the distribution, use f(x) to classify them; for samples predicted to be out of the distribution, classify them as out-of-distribution classes;

[0036] Among them, the expression of the target classification model is:

[0037]

[0038] Among them, H n (x; τ n ,f n ) is the final classification model, f n,i (x) represents the model f n The i-th index of the output (x) is the classification result within the distribution, G n (x; τ n ,f n ) is the out-of-distribution detector, G n (x; τ n ,f n )=1 represents the classification as a sample within the distribution, G n (x; τ n ,f n )=0 means the sample is classified as out-of-distribution sample. Indicates the distribution out-class;

[0039] The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence levels lower than the threshold, the model marks them as out-of-distribution samples; for samples with high confidence levels, they are classified as in-distribution samples that have been learned.

[0040] Another aspect of the embodiment of the present invention further provides an example-free incremental learning system applicable to an open world, including:

[0041] The first module is used to perform incremental learning on the to-be-processed data set of the open world without example classes to obtain the to-be-processed data set, so as 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 according to the result of incremental learning, and 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 according to the out-of-distribution samples and the in-distribution samples, respectively, to construct a final target classification model.

[0044] To achieve the above objective, another aspect of an embodiment of the present invention provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0045] To achieve the above objective, another aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.

[0046] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0047] The embodiments of the present invention include at least the following beneficial effects: The present invention provides an example-free incremental learning method and system applicable to an open world. The scheme performs incremental learning on the to-be-processed data set of the example-free class in the open world to obtain a preliminary classification model; based on the result of the 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, corresponding out-of-distribution detection processing and in-distribution classification processing are performed respectively to construct the final target classification model. The embodiments of the present invention can accurately identify out-of-distribution samples and have good robustness and generalization capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present invention;

[0049] Figure 2 is a flow chart of the overall steps provided by an embodiment of the present invention;

[0050] Figure 3 It is a paradigm-free incremental learning system framework applicable to an open world provided by an embodiment of the present invention;

[0051] Figure 4 is a schematic diagram of the performance gap between different methods provided by the embodiments of the present invention;

[0052] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. When the following description refers to the 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 the present invention. They are only examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the attached claims.

[0054] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0055] The terms "at least one", "multiple", "each", "any", etc. used in the present invention, at least one includes one, two or more, multiple includes two or more, 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 those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0057] Before describing the embodiments of the present invention in detail, some related technologies involved in the embodiments of the present invention are first described as follows:

[0058] Deep learning: Deep learning is a subfield of machine learning. Its core lies in using a deep model composed of multiple layers (usually a neural network composed of neurons) to learn and represent complex patterns in data. Low-dimensional (RGB images are 3-dimensional) image information can be converted into high-dimensional (generally dimension >= 128) feature information through a deep neural network, which effectively improves the effect of image classification. In the proposal of this invention, deep learning technology is mainly used to build an open-world incremental learning system, and feature extraction and classification of samples are achieved by introducing a deep neural network.

[0059] Open world: Generally, deep learning systems assume that their application scenarios are a closed world, that is, they assume that all data are known and fixed, while the real world is generally an open world, which does not conform to the closed world assumption. The data in the open world arrives in a streaming manner, and new in-distribution categories will continue to appear, requiring the model to continuously learn in-distribution categories; at the same time, out-of-distribution samples (categories) that have not been seen in the training set will appear during testing, requiring the system to be able to handle these unseen out-of-distribution samples. The open world assumption is more applicable to many scenarios in practical applications, such as autonomous driving, security monitoring, network security, and recommendation systems. In these scenarios, the system may be constantly exposed to new categories, new attack methods, or new user behaviors. The system not only needs to efficiently classify known categories, but also needs to detect and process newly emerging categories. For example, an autonomous driving system must work in an uncertain environment, not only to identify known objects (such as vehicles and pedestrians), but also to be able to detect and respond to unknown obstacles or special situations (such as unseen animals or objects).

[0060] Class incremental learning system (CIL): The class incremental learning system discussed in the present invention involves the use of a deep learning model to retain the knowledge of old classes (old in-distribution categories) while gradually learning new classes (new in-distribution categories). Traditional deep learning models usually need to be trained on a fixed data set, but in the class incremental learning setting, the model needs to face new categories that continue to appear. This requires the class incremental learning system to have continuous learning capabilities, that is, to be able to continuously learn new classes while avoiding forgetting the old classes that have been learned (i.e., the "catastrophic forgetting" problem).

[0061] Example-free incremental class learning system (EFCIL): adds the restriction that old class original images cannot be stored on the basis of incremental class learning.

[0062] Out-of-distribution detection: In an open world environment, the model not only needs to correctly classify the categories within the distribution, but also detect and process those unseen out-of-distribution samples. In deep learning models, in-distribution samples usually give high-confidence classification results, while out-of-distribution samples have low output confidence because they do not appear in the training set. In this system, a method for out-of-distribution detection based on maximum classification probability is proposed, which is a simple but effective application of deep learning technology. Through the confidence of the neural network for each class classification, out-of-distribution samples can be effectively distinguished.

[0063] Out-of-distribution detection threshold: The out-of-distribution detection threshold is a key parameter of each out-of-distribution detection method. The effect of the same out-of-distribution detection method working under different out-of-distribution detection thresholds varies greatly. How to optimize to obtain a good out-of-distribution detection threshold is very important.

[0064] Difficult sample mining: a commonly used technique in machine learning, especially in deep learning training. Its purpose is to focus on samples that are difficult to correctly classify or predict during model training to improve the generalization ability and performance of the model. Difficult sample mining will mine boundary samples, prompting the model to learn more accurate classification boundaries, thereby improving classification accuracy. In the proposal of the present invention, the embodiment of the present invention uses difficult sample mining to deal with the problem of out-of-distribution detection threshold optimization in the open world incremental learning scenario (without out-of-distribution samples). Specifically, by treating misclassified in-distribution samples as pseudo-out-of-distribution samples, the model can optimize the threshold of out-of-distribution detection without real out-of-distribution samples. This method is equivalent to a difficult sample mining strategy, because misclassified samples are usually located near the classification boundary and have higher uncertainty. It is a very reasonable approach to treat them as pseudo-out-of-distribution samples to optimize the out-of-distribution detection threshold. The example-free incremental learning method and system for the open world provided in the embodiment of the present invention relate to the field of computer technology. The example-free incremental learning method for the open world provided in the embodiment of the present invention can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers. It can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in the blockchain network; the software can be an application that implements an example-free incremental learning method suitable for an open world, etc., but is not limited to the above forms.

[0065] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0066] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. 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 to a network wirelessly or wired to complete data transmission and exchange.

[0067] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0068] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0069] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal 102 may also be a vehicle-mounted terminal of various device types described above, but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the present invention.

[0070] Based on the example Figure 1In the implementation environment shown, an embodiment of the present invention provides a paradigm-free incremental learning method applicable to an open world. The following is an example of applying the paradigm-free incremental learning method applicable to an open world to a server 101. It can be understood that the method can also be applied to a terminal 102.

[0071] Reference Figure 2 , Figure 2 The flowchart of the example-free incremental learning method for an open world provided by the embodiment of the present invention is applied to a server. The execution subject of the method can be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method may include the following steps:

[0072] According to the unprocessed data set of the open world without example classes, incremental learning is performed on the unprocessed data set to obtain a preliminary classification model;

[0073] According to the result 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] According to 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 a final target classification model.

[0075] In some embodiments, the incremental learning of the to-be-processed data set comprises the following steps:

[0076] When each task arrives, new categories are learned from the samples in the distribution of the new task. Each incremental learning task does not contain samples outside the distribution, nor does it contain samples of the old categories. The incremental learning stage can be represented as a series of N training tasks and corresponding training sets {D1, D2, ..., D N}, there are no overlapping classes in the training set, where Is M n The nth training set of training instances, It's a picture. 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 feature extractor Φ(x) and classifier W T , extract the features of each sample through the feature extractor: F = Φ(x), F∈R d , by averaging the features of all samples of a class to obtain the class center of the category μ is the center of each old class storage, and the distance from the new class feature to the new class center is added to the old class center to generate a pseudo old class feature. The expression of this process is: F old ′=F new -μ new +μ old , where F old ′ is the pseudo old class data generated, F new is the feature of the new class training data, μ new is the mean of the features of the new class training data, μ old is the mean of the features of the stored old class training data from the previous task;

[0078] Determine that the ultimate goal of the nth training task is to fit a classification model for all seen classes Minimize expected risks: in, is the optimal parameter obtained after training the nth training task, refers to the network parameters, is the training set distribution, I(·) is the indicator function, and outputs 1 if the expression holds, otherwise 0.

[0079] In some embodiments, for the classification model, in addition to minimizing the loss of new class training data during training, the loss of pseudo old class features generated in Step 2 is also minimized. The expression of this process is:

[0080] The first half of the equation is the cross entropy loss of the new class training data, the second half 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 is the i-th sample, f(x) is the current model, M is the number of pseudo-old class samples generated, and W T is the classifier weight, is the jth 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 according to the result of incremental learning to identify out-of-distribution samples and in-distribution samples includes the following steps:

[0082] For the out-of-distribution score, a non-learning out-of-distribution detection method is added after the classifier, and the confidence of the classifier in classifying the sample is used to measure the probability that it is an out-of-distribution sample, where the out-of-distribution score of 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 of the nth task; the definition expression for the specific out-of-distribution score is: Among them, M 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 output as the i-th class label; C represents the number of categories that the system has learned;

[0083] The method of optimizing the threshold without using out-of-distribution samples is adopted, and difficult sample mining is used to obtain a more discriminative threshold;

[0084] Whether each 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 utilizes difficult sample mining to obtain a more discriminative threshold, specifically:

[0086] The misclassified in-distribution samples are regarded as pseudo out-of-distribution samples, and the detection error is minimized to obtain the optimal out-of-distribution detection threshold. The detection error is used to measure the misclassification probability of the out-of-distribution detector. The expression of the detection error DE is:

[0087] DE=0.5*P in (G(x)=0)+0.5*P out (G(x)=1),

[0088] Among them, P in is the probability within the distribution, P out is the probability of being out of distribution, G(x) is the out-of-distribution detector, G(x)=0 means that it is classified as an out-of-distribution sample, and G(x)=1 means that it is classified as an in-distribution sample.

[0089] In some embodiments, the step of determining whether each sample is an out-of-distribution sample based on its out-of-distribution score and out-of-distribution detection threshold is as follows:

[0090] The out-of-distribution detector determines whether the input x is an out-of-distribution sample. The expression of the out-of-distribution detector is:

[0091]

[0092] Among them, G n (x; τ n ,f n ) is the out-of-distribution detector, ψ(x; f n ) is the fraction outside the distribution, f nis the classification model, τ n is the out-of-distribution detection threshold, G n (x; τ n ,f n )=0 means out-of-distribution samples, G n (x; τ n ,f n )=1 indicates the sample is within the distribution.

[0093] In some embodiments, performing corresponding out-of-distribution detection processing and in-distribution classification processing according to the out-of-distribution samples and the in-distribution samples, respectively, to construct a final target classification model includes the following steps:

[0094] Construct a dataset, specifically: add dataset samples of completely different categories to the test set containing only in-distribution samples to simulate the test set in the open world example-free incremental learning setting;

[0095] Perform out-of-distribution detection on each test sample to obtain the final target classification model; specifically: for samples predicted to be in the distribution, use f(x) to classify them; for samples predicted to be out of the distribution, classify them as out-of-distribution classes;

[0096] Among them, the expression of the target classification model is:

[0097]

[0098] Among them, H n (x; τ n ,f n ) is the final classification model, f n,i (x) represents the model f n The i-th index of the output (x) is the classification result within the distribution, G n (x; τ n ,f n ) is the out-of-distribution detector, G n (x; τ n ,f n )=1 represents the classification as a sample within the distribution, G n (x; τ n ,f n )=0 means the sample is classified as out-of-distribution sample. Indicates the distribution out-class;

[0099] The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence levels lower than the threshold, the model marks them as out-of-distribution samples; for samples with high confidence levels, they are classified as in-distribution samples that have been learned.

[0100] The following describes the specific implementation process of the embodiment of the present invention in detail by taking a specific application scenario as an example:

[0101] refer to Figure 3 , Figure 3 The present invention demonstrates an example-free incremental learning system framework suitable for an open world.

[0102] The method of the embodiment of the present invention includes the following three stages:

[0103] Phase 1: Incremental learning phase:

[0104] Step 1: Dataset division. When each task arrives, the system learns new categories from the in-distribution samples of the new task. Each incremental learning task does not contain out-of-distribution samples, nor does it save samples of old categories. Formulaically speaking, the incremental learning phase can be represented as a series of N training tasks and corresponding training sets {D1, D2, …, D N}, there are no overlapping classes, where Is M n The nth training set of training instances. It's a picture. is the corresponding label. According to the CIL setting, the label spaces for different tasks n≠n′ are disjoint. The embodiment of the present invention can only access the data from D in the nth training task. n training data.

[0105] Step 2: Generate pseudo old class data. The embodiment of the present invention firstly transforms the classification model f(x)=W T Φ(x) is decoupled into feature extractor Φ(x) and classifier W T The embodiment of the present invention can extract the features of each sample through a feature extractor: F = Φ(x), F∈R d , by averaging the features of all samples of a class to obtain the class center of the category μ∈R d Next, the embodiment of the present invention describes a method for generating pseudo old class data. Specifically, the embodiment of the present invention stores a class center for each old class, and generates a pseudo old class feature by adding the distance from the new class feature to the new class center to the old class center.

[0106] F old ′=F new -μ new +μ old

[0107] Among them, F old ′ is the pseudo old class data generated, F new is the feature of the new class training data, μ newis the mean of the features of the new class training data, μ old is the mean of the features of the old class training data stored from the previous task. new -μ new That is, the distance from the new class feature to the new class center, which describes the shape of the new class sample and adds this shape to the old class center μ old The pseudo old class data F is generated. old ′.

[0108] Step 3: The ultimate goal of the nth training task is to fit the classification model of all seen classes Minimize expected risks:

[0109]

[0110] in, is the optimal parameter obtained after training the nth training task, refers to the network parameters, is the training set distribution, I(·) is the indicator function, and outputs 1 if the expression holds, otherwise 0.

[0111] Specifically, during training, in addition to minimizing the loss of new category training data, the loss of pseudo old category features generated in Step 2 is also minimized to maintain the memory of old categories and alleviate catastrophic forgetting.

[0112]

[0113] The first half of the equation is the cross entropy loss of the new class training data, and the second half 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 is the i-th sample, f(x) is the current model, M is the number of pseudo-old class samples generated, and W T is the classifier weight, is the jth pseudo old class sample.

[0114] Phase 2: Out-of-distribution detection and adaptive threshold optimization

[0115] Step 1: Definition of out-of-distribution score. After the incremental learning is completed, the embodiment of the present invention adds a non-learning out-of-distribution detection method after the classifier. Specifically, the embodiment of the present invention uses the confidence of the classifier in classifying the 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 score, ψ 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, M 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 in the open world example-free incremental learning setting, the out-of-distribution detection threshold cannot be optimized in a supervised manner. An embodiment of the present invention proposes a method for optimizing the threshold without using out-of-distribution samples. The method uses difficult sample mining to obtain a more discriminative threshold. Specifically, an embodiment of the present invention treats misclassified in-distribution samples as pseudo out-of-distribution samples, while minimizing 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 is the probability within the distribution, P out is the probability of being out of distribution, G(x) is the out-of-distribution detector, G(x)=0 means classification as an out-of-distribution sample, and G(x)=1 means classification as an in-distribution sample. In addition, the existing static out-of-distribution detection method directly fixes the out-of-distribution detection threshold, which will lead to suboptimal results under the setting of continuous learning. Therefore, an embodiment of the present invention proposes an adaptive threshold (AT) method, which uses the above method to optimize the out-of-distribution detection threshold once after incremental learning of each task, so that it can 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. Whether the input x is an out-of-distribution sample can then be determined by the out-of-distribution detector:

[0124]

[0125] Among them, G n (x; τ n ,f n ) is the out-of-distribution detector, ψ(x; fn ) is the fraction outside the distribution, f n is a classification model, is the out-of-distribution detection threshold, G n (x; τ n ,f n )=0 means out-of-distribution samples, G n (x; τ n ,f n )=1 indicates the sample is within the distribution.

[0126] Stage 3: Reasoning

[0127] Step 1: Dataset construction. The test set in the open-world example-free incremental learning setting is an open set, which contains both in-distribution samples and out-of-distribution samples. The embodiment of the present invention simulates this setting by adding samples of another dataset (of completely different categories) to the test set containing only in-distribution samples.

[0128] Step 2: Out-of-distribution detection. For each test sample, the embodiment of the present invention first performs an out-of-distribution detection. For samples predicted to be in the distribution, the embodiment of the present invention further uses f(x) to classify them. For samples predicted to be out of the distribution, the embodiment of the present invention directly classifies them as out-of-distribution classes. The formula of the final inference model 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 The i-th index of the output (x) is the classification result within the distribution, G n (x; τ n ,f n ) is the out-of-distribution detector, G n (x; τ n ,f n )=1 represents the classification as a sample within the distribution, G n (x; τ n ,f n )=0 means the sample is classified as out-of-distribution sample. Represents the distribution out-class.

[0131] After the above three stages, the final model H n (x; τ n ,f n) makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds. For samples with confidence levels below the threshold, the model marks them as out-of-distribution samples, thereby refusing to classify them. Through the adaptive threshold, the system can accurately detect out-of-distribution samples during the reasoning process, ensuring that out-of-distribution samples are not misclassified as known categories. At the same time, for samples with high confidence levels, the system can correctly classify them as in-distribution samples that have already been learned, thus completing the open-world example-free incremental learning task.

[0132] For the method proposed in the present 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, 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, the present 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, the present 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 of which are unrelated to the categories in the training and validation sets of the present embodiment. The present embodiment only uses its validation set, which contains 36,500 images of size 64×64 pixels, with 100 images per category. Specifically, the embodiment of the present invention takes out the part of the validation set with the same number of categories as the training set, and divides it according to different increment settings. The accuracy of the last task and the average accuracy of all tasks are used to measure the effect.

[0134] The present invention selects two classic out-of-distribution threshold optimizations as competitors for the proposed adaptive threshold optimization. TPR95 determines the threshold by setting the true positive rate (TPR) to 95%, which is widely used in out-of-distribution detection settings. Randomly selecting in-distribution categories as out-of-distribution categories (RID) is also used to optimize the out-of-distribution detection threshold. The proposed adaptive out-of-distribution detection threshold (AT) is compatible with TPR95 and RID, resulting in TPR95 w / AT and RIDw / 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 all experiments of the present invention, K=3 is set. In addition, since K-fold cross validation is used, K thresholds are obtained for each task, and the maximum value is used as the final threshold for inference: τ n =maxτ n,i , where τ n,i Indicates the threshold obtained by the i-th model for the n-th task. In the experiment, the present invention uses the PyCIL framework and the default parameters of each method in PyCIL. The network architecture of all methods is ResNet-18.

[0136] The experimental results are shown in Table 1 below:

[0137] Table 1

[0138]

[0139] The above table 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 (determine the threshold by setting the true positive rate (TPR) to 95%), RID (randomly select the in-distribution category as the out-of-distribution category); they are added with the adaptive threshold optimization method (AT) proposed in the embodiment of the present invention: TPR95+AT, RID+AT; and the out-of-distribution detection threshold optimization method MID without out-of-distribution samples proposed in the present invention, and it is added with the adaptive threshold optimization method MID+AT. The final out-of-distribution detection threshold optimization method MID+AT of the present invention performs significantly better than other threshold optimization methods. For example, the proposed MID+AT improves by 19.53% and 23.60% compared with TPR95 in the 10 incremental task settings of CIFAR100 and TinyImageNet, respectively. On the large dataset ImageNet100, MID+AT of the embodiment of the present invention is significantly more improved than the baseline TPR95, with the average accuracy increasing from 41.15% to 61.43%. Figure 4The different methods in the incremental learning process are compared in detail. The horizontal axes of the three figures are the task numbers, representing the performance of the model in the i-th task, and the vertical axes are the accuracy, which is calculated by Among them, T OOD is the number of out-of-distribution samples that are correctly classified. OOD is the number of out-of-distribution samples that are misclassified. ID,i The number of samples in the i-th distribution that are correctly classified. Id,i is the number of samples of the i-th in-distribution class that are misclassified. C represents the number of classes that the model has seen so far. In other words, the numerator of Accuracy is the correctly classified samples (including out-of-distribution samples), and the denominator is the total number of samples (including out-of-distribution samples). The higher the Accuracy, the better the model performs in an open world environment. The dotted lines in the three figures are the existing threshold determination method (directly setting an empirical value as the out-of-distribution detection threshold), and the solid lines in the three figures are the threshold optimization methods proposed in this embodiment (adaptive threshold and threshold optimization method without out-of-distribution samples). It can be observed that there is an obvious performance gap between the curve of the present invention (MID+AT) and the curve of the basic method (TPR95).

[0140] In summary, the present invention has the following characteristics:

[0141] 1. We propose an adaptive threshold algorithm that can dynamically adjust the out-of-distribution detection threshold at different incremental task stages to adapt 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 task incremental learning stage, 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 work normally in an open world environment and is highly adaptable to ever-changing new tasks, new categories, and unknown out-of-distribution samples. At the same time, the system is a paradigm-free system. When learning new tasks, it does not rely on saving samples of old categories (no paradigm setting), but instead maintains the memory of old categories by replaying the generated old category samples. An out-of-distribution detection method that does not require learning, that is, the confidence of the classifier in classifying the sample is used to measure the probability that it is an out-of-distribution sample. And a method for generating pseudo-old class data, that is, storing the class center for each old class, and adding the variance of the new class feature to the old class center to generate a pseudo-old class feature.

[0143] 3. Since there are no out-of-distribution samples when training in the open world, the system must optimize the out-of-distribution detection threshold in an unsupervised manner. The system pays special attention to samples that are difficult to classify, and further optimizes the classification performance and out-of-distribution detection performance of the model by mining these misclassified samples near the decision boundary. Minimize the detection error (DE) instead of simple accuracy to optimize the out-of-distribution detection threshold to avoid the threshold that makes the out-of-distribution detector biased to predict the majority class. An unsupervised out-of-distribution detection threshold optimization method based on difficult sample mining, that is, optimizes the out-of-distribution detection threshold by treating misclassified in-distribution samples as pseudo-out-of-distribution samples. Use minimization of detection error (DE) to optimize the out-of-distribution detection threshold.

[0144] Compared with the prior art, the present invention has the following advantages:

[0145] 1. Excellent incremental learning capability for sample-free classes: This system has good incremental learning capability for sample-free classes. It can gradually learn new categories from streaming data and maintain the knowledge of old categories by generating pseudo old category data without directly storing examples of old categories.

[0146] 2. Capability of out-of-distribution detection: The present 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 out-of-distribution detection method without learning, the adaptive threshold optimization method, and the unsupervised out-of-distribution detection threshold optimization method based on difficult sample mining, the system can accurately identify out-of-distribution samples without training sets and out-of-distribution samples.

[0147] 3. Good robustness and generalization ability: Since this system uses an unsupervised method based on difficult sample mining to optimize the out-of-distribution detection threshold and does not rely on preserving old class samples, the system can maintain strong robustness and generalization ability in different tasks and environmental changes.

[0148] Another aspect of the embodiment of the present invention further provides an example-free incremental learning system applicable to an open world, including:

[0149] The first module is used to perform incremental learning on the to-be-processed data set of the open world without example classes to obtain the to-be-processed data set, so as 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 according to the result of incremental learning, and 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 according to the out-of-distribution samples and the in-distribution samples, respectively, to construct a final target classification model.

[0152] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments 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.

[0153] The embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned example-free incremental learning method applicable to an open world when executing the computer program. The electronic device may be any intelligent terminal including a tablet computer, a car computer, etc.

[0154] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments 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] See also Figure 5 , Figure 5 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0156] The processor 501 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an 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 in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 502, and the processor 501 calls and executes the example-free incremental learning method applicable to the open world in the embodiment of the present invention;

[0158] Input / output interface 503, used to implement information input and output;

[0159] Communication interface 504, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0160] A bus 505 that transmits information between the various components of the device (e.g., the processor 501, the memory 502, the input / output interface 503, and the communication interface 504);

[0161] The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via the bus 505 .

[0162] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned example-free incremental learning method applicable to an open world.

[0163] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments 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.

[0164] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0165] It should be noted that in various specific embodiments of the present invention, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present invention needs to obtain the user's sensitive personal information, it will obtain the user's separate permission or consent through a pop-up window or jump to a confirmation page, and after clearly obtaining the user's separate permission or consent, it will obtain the necessary user-related data for the normal operation of the embodiment of the present invention.

[0166] The embodiments described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art can appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.

[0167] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present invention and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0168] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0170] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0171] It should be understood that in the present invention, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can represent: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one 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, c can be single or multiple.

[0172] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0173] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0174] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0175] If the integrated unit is implemented in the form of 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. The computer software product is stored in a storage medium, including multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store programs.

[0176] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the embodiments of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present invention shall be within the scope of the rights of the embodiments of the present invention.

Claims

1. A paradigm-free incremental learning method for open worlds, characterized in that: The following steps are involved: According to the unprocessed data set of the open world without example classes, incremental learning is performed on the unprocessed data set to obtain a preliminary classification model; According to the result 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; According to 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 a final target classification model.

2. The example-free incremental learning method for an open world according to claim 1, characterized in that: The incremental learning of the data set to be processed comprises the following steps: When each task arrives, new categories are learned from the in-distribution samples of the new task. Each incremental learning task does not contain out-of-distribution samples or samples of old categories. The incremental learning stage can be represented as a series of N training tasks and corresponding training sets {D1, D2, ..., D N }, there are no overlapping classes in the training set, where Is M n The nth training set of training instances, It's a picture. are the corresponding labels, where the label spaces for different tasks n≠n′ are disjoint: The classification model f(x) = W T φ(x) is decoupled into feature extractor φ(x) and classifier W T , extract the features of each sample through the feature extractor: F = φ(x), F∈R d , by averaging the features of all samples of a class to obtain the class center of the category μ∈R d , μ is the storage class 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 a pseudo old class feature. The expression of this process is: F old ′=F new -μ new +μ old , where F old ′ is the pseudo old class data generated, F new is the feature of the new class training data, μ new is the mean of the features of the new class training data, μ old is the mean of the features of the stored old class training data from the previous task; Determine that the ultimate goal of the nth training task is to fit a classification model for all seen classes Minimize expected risks: in, is the optimal parameter obtained after training the nth training task, refers to the network parameters, is the training set distribution, I(·) is the indicator function, and outputs 1 if the expression holds, otherwise 0.

3. The example-free incremental learning method for an open world according to claim 2, characterized in that: For the classification model, in addition to minimizing the loss of new class training data during training, the loss of pseudo old class features is also minimized. The expression of this process is: The first half of the equation is the cross entropy loss of the new class training data, the second half 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 is the i-th sample, f(x) is the current model, M is the number of pseudo-old class samples generated, and W T is the classifier weight, is the jth pseudo old class sample.

4. The method of example-free incremental learning for an open world according to claim 1, characterized in that: According to the result 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, including the following steps: For the out-of-distribution score, a non-learning out-of-distribution detection method is added after the classifier, and the confidence of the classifier in classifying the sample is used to measure the probability that it is an out-of-distribution sample, where the out-of-distribution score of 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 of the nth task; the definition expression for the specific out-of-distribution score is: Among them, M 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 output as the i-th class label; C represents the number of categories that the system has learned; Instead of using out-of-distribution samples to optimize the threshold, we use difficult sample mining to obtain a more discriminative threshold: Whether each sample is an out-of-distribution sample is determined based on its out-of-distribution score and out-of-distribution detection threshold.

5. The method of example-free incremental learning for an open world according to claim 4, characterized in that: The method of optimizing the threshold without using out-of-distribution samples uses difficult sample mining to obtain a more discriminative threshold, specifically: The misclassified in-distribution samples are regarded as pseudo out-of-distribution samples, and the detection error is minimized to obtain the optimal out-of-distribution detection threshold. The detection error is used to measure the misclassification probability of the out-of-distribution detector. The expression of the detection error DE is: DE=0.5*P in (G(x)=0)+0.5*P out (G(x)=1), Among them, P in is the probability within the distribution, P out is the probability of being out of distribution, G(x) is the out-of-distribution detector, G(x)=0 means that it is classified as an out-of-distribution sample, and G(x)=1 means that it is classified as an in-distribution sample.

6. The example-free incremental learning method for an open world according to claim 4, characterized in that: The method of determining whether each sample is an out-of-distribution sample based on the out-of-distribution score and the out-of-distribution detection threshold is as follows: The out-of-distribution detector determines whether the input x is an out-of-distribution sample. The expression of the out-of-distribution detector is: Among them, G n (x; τ n , f n ) is the out-of-distribution detector, ψ(x; f n ) is the fraction outside the distribution, f n is the classification model, τ n is the out-of-distribution detection threshold, G n (x; τ n , f n )=0 means out-of-distribution samples, G n (x; τ n , f n )=1 indicates the sample is within the distribution.

7. The method of example-free incremental learning for an open world according to claim 1, characterized in that: The method of performing corresponding out-of-distribution detection processing and in-distribution classification processing according to the out-of-distribution samples and the in-distribution samples, respectively, and constructing a final target classification model comprises the following steps: Construct a dataset, specifically: add dataset samples of completely different categories to the test set containing only in-distribution samples to simulate the test set in the open world example-free incremental learning setting; Perform out-of-distribution detection on each test sample to obtain the final target classification model; specifically: for samples predicted to be in the distribution, use f(x) to classify them; for samples predicted to be out of the distribution, classify them as out-of-distribution classes; Among them, the expression of the target classification model is: Among them, H n (x; τ n , f n ) is the final classification model, f n,i (x) represents the model f n The i-th index of the output (x) is the classification result within the distribution, G n (x; τ n , f n ) is the out-of-distribution detector, G n (x; τ n , f n )=1 represents the classification as a sample within the distribution, G n (x; τ n , f n )=0 means the sample is classified as out-of-distribution sample. Indicates the distribution out-class; The target classification model makes classification decisions based on the learned categories and dynamically adjusted adaptive thresholds: for samples with confidence levels lower than the threshold, the model marks them as out-of-distribution samples; for samples with high confidence levels, they are classified as in-distribution samples that have been learned.

8. A paradigm-free incremental learning system for an open world, characterized in that: include: The first module is used to perform incremental learning on the to-be-processed data set of the open world without example classes to obtain the to-be-processed data set, so as 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 according to the result of incremental learning, and 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 according to the out-of-distribution samples and the in-distribution samples, respectively, to construct a final target classification model.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Signal modulation classification model based on sample recall incremental learning and learning method

    CN115883301A

  • Target detection method for open world unknown class recognition

    CN116665018A

  • Image class incremental learning method and system based on out-of-distribution detection

    CN117079011A

  • Model training method and device based on class incremental learning, equipment and storage medium

    CN117272999A

  • System and method for incremental learning

    US20200175384A1

Cited By

  • Open world semi-supervised image classification method and device based on incremental learning

    CN120894605A