Out-of-distribution detection method and system for feature reconstruction based on classifier

By orthogonally decomposing the classifier weights, extracting known subspaces and calculating feature reconstruction errors, the problems of overconfidence and data sensitivity in off-distribution detection are solved, and efficient and robust off-distribution detection is achieved, suitable for security-critical areas and data privacy protection.

CN120198731APending Publication Date: 2025-06-24INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510306019.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The prior art has problems with overconfidence in out-of-distribution detection, especially in safety-critical areas such as autonomous driving and medical image analysis. The existing methods are sensitive to data, require a large amount of source data access and calculation, and are not suitable for data privacy protection and model updates.

Method used

A classifier-based feature reconstruction method is proposed. By orthogonally decomposing the classifier weights, a known subspace is extracted, the original data features are mapped to the subspace, and the feature reconstruction error of the data in the subspace is calculated to determine the confidence score.

Benefits of technology

This method does not require access to training data, realizes leading off-distribution detection performance, improves the robustness and detection effect of the model, and is suitable for data privacy protection and rapid model updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198731A_ABST
    Figure CN120198731A_ABST
Patent Text Reader

Abstract

The invention provides an out-of-distribution detection method and system for feature reconstruction based on a classifier. The method comprises the following steps: inputting an image sample subjected to data enhancement into a discrimination model; obtaining the features of the image on the model, and storing the feature output of the last but one layer in the model propagation process; obtaining a weight matrix of the last classification layer of the model, performing weight decomposition on the weight of the layer through singular value decomposition of the weight matrix, and obtaining a decomposed left singular vector U; selecting left singular column vectors corresponding to larger m singular values according to the proportion of the singular values to form a projection subspace # imgabs0 #; projecting the features of the sample on the projection subspace, and calculating the spectral norm size of the projection vector of the sample, namely the confidence score of the sample; classification tasks are performed by measuring in-distribution and out-of-distribution sample confidence scores. The method provided by the invention does not need to access training data, and meanwhile, the leading performance is realized on a plurality of distributed external detection references.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Traditional machine learning methods are based on the closed-world assumption, that is, the test data comes from the same distribution as the training set. However, when deploying deep neural networks in the open world, the differences between the training data distribution and the test data distribution usually lead to overconfidence in the model, resulting in significant defects when deploying deep neural networks. This problem is particularly important in safety-critical fields such as autonomous driving and medical image analysis. This overconfidence problem mainly stems from the fact that when the model encounters out-of-distribution data that does not belong to any training class, it still makes unbelievable predictions. Models with excellent out-of-distribution detection capabilities are crucial in many safety-critical scenarios. For example, in medical diagnosis, the failure to detect out-of-distribution samples may lead to misjudgment of unknown diseases; similarly, autonomous driving algorithms should detect unknown scenarios and rely on human control to avoid accidents caused by arbitrary judgments. Therefore, enhancing the out-of-distribution detection ability of the model not only improves its reliability but also provides safety guarantees in multiple fields.

[0003] The current focus of out-of-distribution detection research is to enable the model to recognize its limitations and reject predictions for low-confidence samples, thus solving the problem of the model being overconfident about unfamiliar samples. The out-of-distribution detection task mainly involves creating a scoring function to assign a confidence score to each sample, indicating the likelihood that it is an in-distribution sample, and using a threshold to help the model distinguish out-of-distribution data.

[0004] In the prior art, in order to constrain the overconfidence problem of the model, there are generally two types of methods to improve the out-of-distribution detection ability of the model. Namely, training-driven methods and training-independent methods. Training-driven methods aim at a trained model and fine-tune the model by designing new loss functions and other constraint strategies to improve the out-of-distribution detection ability of the model, which usually involves retraining and sacrificing the classification ability of the model itself. On the contrary, training-independent methods do not need to modify the overall model parameters and identify abnormal data by finding the differences between out-of-distribution samples and training samples during the forward propagation process of the model. Since this type of method does not need to fine-tune the source model, it will not affect the accuracy of the model. Nevertheless, these methods are very sensitive to data and usually require a large amount of source data access and data calculation to improve their performance, which is unrealistic in many data privacy protection scenarios. In addition, with the subsequent update of the model and the change of the data sample space, this means that they still need to repeat the cumbersome redesign and sensitive data access. Summary of the Invention

[0005] To solve the above problems in the prior art, that is, for a more lightweight and robust out-of-distribution detection of the model, to avoid data privacy leakage during the algorithm design process and the cumbersome calculation process after subsequent model updates. The present invention proposes an out-of-distribution detection method and system based on classifier-based feature reconstruction, called classifier-based feature reconstruction. It first orthogonally decomposes the weights of the classifier to extract the known-in-class subspace, and then maps the original data features to this subspace to obtain a new data representation. Subsequently, the confidence score is determined by calculating the feature reconstruction error of the data within the subspace. Compared with the existing out-of-distribution detection algorithms, the proposed method does not require access to the training data and at the same time achieves leading performance on multiple out-of-distribution detection benchmarks. The specific technical solution is as follows:

[0006] In the first aspect of this method, an out-of-distribution detection method based on classifier-based feature reconstruction is provided, including the following steps:

[0007] Step S1, obtain a deep discriminative model to be designed, which can achieve excellent recognition ability for in-distribution samples after training.

[0008] Step S2, obtain the image samples to be discriminated, and input them into the discriminative model after conventional data augmentation. Through the feature extraction process of the model, obtain the features of the image on the model, and save the feature output of the penultimate layer during the model propagation process.

[0009] Step S3, obtain the weight matrix of the last classification layer of the model, perform weight decomposition on the weights of this layer through the singular value decomposition module of the weight matrix, and obtain the left singular vector U after decomposition.

[0010] Step S4, select the projection subspace composed of the left singular column vectors corresponding to the larger m singular values according to the proportion of the singular values .

[0011] Step S5, through the confidence score module of the projection vector, project the features of the sample onto the projection subspace, and calculate the spectral norm size of the projection vector of the sample, which is the confidence score of the sample.

[0012] Step S6, perform the classification task of out-of-distribution samples by measuring the confidence scores of in-distribution and out-of-distribution samples.

[0013] In the second aspect of the present invention, an out-of-distribution detection system based on classifier-based feature reconstruction is proposed, including:

[0014] A deep discriminative model, which can achieve excellent recognition ability for in-distribution samples after training;

[0015] The feature extraction module obtains the image samples to be discriminated, enhances the data and then inputs them into the discrimination model; through the feature extraction process of the model, it obtains the features of the images on the model and saves the feature output of the penultimate layer during the model propagation process.

[0016] The singular value decomposition module obtains the weight matrix of the last classification layer of the model, performs weight decomposition on the weights of this layer through the singular value decomposition of the weight matrix, and obtains the left singular vector U after decomposition.

[0017] The projection subspace acquisition module selects the projection subspace composed of the left singular column vectors corresponding to the larger m singular values according to the proportion of the singular values. ;

[0018] The confidence score calculation module projects the features of the sample onto the projection subspace and calculates the spectral norm of the projection vector of the sample, which is the confidence score of the sample.

[0019] The out-of-distribution sample classification module performs the out-of-distribution sample classification task by measuring the size of the sample confidence score. The out-of-distribution detection performance of the present invention is measured by calculating the area under the receiver operating characteristic curve and the proportion of the false positive rate of the model when the true positive rate is fixed at 95%.

[0020] In the third aspect of the present invention, an electronic device is proposed for implementing an out-of-distribution detection method based on classifier feature reconstruction proposed in the present invention, including at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the processor, and these instructions are used to implement the out-of-distribution detection method based on classifier feature reconstruction proposed in the present invention. This device can be used for real-time out-of-distribution detection processing of images in an industrial production environment.

[0021] In the fourth aspect of the present invention, a computer-readable storage medium is proposed for storing instructions executable by a computer. These instructions are used to implement the out-of-distribution detection method based on classifier feature reconstruction proposed in the present invention. In the process of implementing the present invention, the computer-readable storage medium can be used to store the algorithms and programs in the present invention for quick loading and execution when needed. These computer-readable storage media can be any medium capable of storing data, such as a disk, CD, DVD or other types of storage media.

[0022] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes and related descriptions of the above-described storage device and processing device can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here.

[0023] The beneficial effects of the present invention:

[0024] 1. The proposed method does not rely on accessing training data to achieve competitive performance, making the algorithm highly suitable for out-of-distribution detection scenarios that require data privacy protection.

[0025] 2. Compared with methods that require a large amount of training data to learn an out-of-distribution detector, the subspace learned by this algorithm avoids expensive computational costs and has a faster convergence rate, effectively enhancing the robustness and detection effect of out-of-distribution detection.

[0026] 3. This method only requires lightweight access to the linear classification layer of the model, allowing for rapid updates of the out-of-distribution detector without the need to re-access the training database when subsequently updating the model or adding new classes. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Other features, objects, and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings.

[0028] Figure 1 is a flowchart of an out-of-distribution detection method based on classifier-based feature reconstruction in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] In order to make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above objectives, the present invention adopts the following technical solutions.

[0030] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments.

[0031] The present invention follows the concept of feature decomposition, aiming to construct a feature subspace to enhance the out-of-distribution detection performance. The present invention turns its perspective to the weights of the model classifier. By applying singular value decomposition to the weight matrix of the final classification layer, a discriminant subspace formed by the singular vectors corresponding to the larger singular values is obtained. The latent representation of the penultimate layer is projected into the discriminant subspace obtained from the weight matrix to create a new data representation. In this subspace, the feature reconstruction error of in-distribution data is smaller, demonstrating stronger robustness. This is mainly because the feature distribution of out-of-distribution data is unknown to the model and is significantly different from the feature distribution of in-distribution data, resulting in the loss of key information during the feature reconstruction process of out-of-distribution data.

[0032] The present invention provides an out-of-distribution detection method based on classifier-based feature reconstruction, comprising the following steps:

[0033] Step S1, obtain a deep discriminative model to be designed, which can achieve excellent recognition ability for in-distribution samples after training;

[0034] Step S2, obtain the image samples to be discriminated, input them into the discriminative model after data augmentation; through the feature extraction process of the model, obtain the features of the images on the model, and save the feature output of the penultimate layer during the model propagation;

[0035] Step S3, obtain the weight matrix of the last classification layer of the model, perform weight decomposition on the weights of this layer through singular value decomposition, and obtain the left singular vector U after decomposition;

[0036] Step S4, select the projection subspace composed of the left singular column vectors corresponding to the larger m singular values according to the proportion of the singular values ;

[0037] Step S5, project the features of the sample onto the projection subspace to obtain the sample projection vector, and calculate the spectral norm size of the sample projection vector, which is the confidence score of the sample;

[0038] Step S6, perform the classification task of out-of-distribution samples by measuring the confidence scores corresponding to in-distribution and out-of-distribution samples.

[0039] In step S1, the depth discrimination model mainly consists of convolutional layers, activation layers, pooling layers, and fully connected layers, etc. Through multi-level feature extraction and non-linear mapping, during the implementation of the step, it is necessary to extract high-level semantic features of the samples to construct a feature space. Therefore, the output of the penultimate layer is selected as the sample feature, that is, the output of the model without the fully connected layer. The main role of the depth discrimination model is to perform feature extraction and classification on images or other types of input data through its multi-layer structure. It can gradually learn high-level abstract features of the data at multiple levels and can achieve efficient and accurate classification in the data feature space. This depth discrimination model can be a traditional deep learning model based on the convolutional neural network (CNN) architecture, such as a residual network. Due to their multi-level feature extraction capabilities, these models, such as deep neural networks like ResNet, can perform efficient and accurate classification on in-distribution data. Since these deep learning models fit on in-distribution data, the features of the same-class samples gradually fit into the class center, while the features of out-of-distribution samples are essentially different from those of in-distribution samples in the feature space. Based on the feature reconstruction technology of this depth discrimination model, it can not only ensure the accurate classification of in-distribution samples but also provide effective support for the detection of out-of-distribution data. Such models can extract high-dimensional feature information from large-scale datasets and, by continuously optimizing their weight parameters, can still exhibit strong robustness even when the input data changes or in the face of relatively complex scenarios.

[0040] In step S2, the image samples to be discriminated are first processed through a series of data augmentation techniques to improve the generalization ability and robustness of the model. Data augmentation methods include scaling and cropping. These methods can effectively increase the diversity of training data and thus improve the performance of the model under different input transformations. Data augmentation can simulate different image changes, help the model learn more diverse features, improve its classification ability on in-distribution data, reduce overfitting, and enhance the model's robustness to image feature changes. The image samples after data augmentation are input into the discriminant model to be designed. During the forward propagation process of the model, the features of the image are extracted layer by layer and transmitted to each level of the network, and finally, a high-dimensional feature representation for classification is obtained. To further capture the deep features of the image, especially the network's ability to express complex patterns during the learning process, this algorithm selects to save the feature output of the penultimate layer during the model propagation process. The features of this layer usually contain high-level semantic information of the image and can effectively distinguish samples of different classes.

[0041] In step S3, the singular value decomposition algorithm is applied to the classifier weight matrix. By choosing to perform eigen decomposition on the classifier weight matrix, access to the source data can be avoided, thus preventing the problem of data privacy leakage and facilitating the capture of the main features of the samples with the classifier weights. Reorganization is carried out using singular value decomposition to reveal the latent structure and features in the matrix. The subspace formed by the left singular vectors is used to represent the main feature patterns of the data. The main columns of the left singular vectors in the singular value decomposition are selected for data dimensionality reduction and feature extraction. By choosing those orthogonal basis dimensions that contribute the most to form a subspace, the most information energy in the data is captured in this subspace. By ignoring the small singular values and their corresponding vectors, the noise in the data can be eliminated, and only the structured and important information is retained.

[0042] In step S5, the confidence score algorithm for the projection vector. The features obtained by the sample passing through the feature extractor of the model are reshaped by projection on the discriminant subspace, which can effectively ensure the strategy of maximizing the retention of information while effectively reducing the data scale. Then, the spectral norm of the projection vector is calculated to measure the degree of uncertainty of the model with respect to the sample. These features behave differently from in-distribution samples when the model encounters out-of-distribution samples. Since the out-of-distribution samples have not been fitted by the model, the important information of their feature distribution is not concentrated in the subspace formed by the left singular vectors, resulting in a difference in the features after projection reshaping compared to in-distribution samples.

[0043] In step S6, the classification task of out-of-distribution samples is carried out by measuring the size of the sample confidence score. Calculate the confidence score of the model on the validation set, then draw the Receiver Operating Characteristic (ROC) curve, and then set a threshold to show the performance of the model on the data. Find the corresponding False Positive Rate (FPR@95) when the True Positive Rate (TPR) is 95%, and use the confidence corresponding to this threshold to distinguish out-of-distribution samples.

[0044] To more clearly explain the present invention, the following will describe in more detail the entire out-of-distribution detection algorithm based on classifier feature reconstruction with reference to the accompanying drawings from the singular value decomposition technology based on the weight matrix and the confidence score design based on the spectral norm of the projection vector.

[0045] The singular value decomposition of the weight matrix is specifically as follows:

[0046] Step S1, given the weight matrix of the final classification layer of a model , where represents the number of classes, represents the feature dimension, represents the real number field. Given , perform the following singular value decomposition:

[0047] ,

[0048] Among them, has a dimension of , has a dimension of , and is a diagonal matrix , where the singular values are arranged in descending order.

[0049] Step S2. After the decomposition is completed, the left singular vector matrix provides an orthogonal basis for the output space. Extract the first m columns of the matrix to form a subspace consisting of dimensionality reduction matrices, and this matrix is composed of the first m columns of the matrix after decomposition. The specific formula is as follows:

[0050] ,

[0051] Among them, represents the th column vector in the left singular vector .

[0052] Step S3. The determination of m is calculated according to the cumulative explained variance of machine learning theory. Specifically:

[0053] ,

[0054] Among them, represents the th singular value, is usually set to 90%, which can be understood as a filtering mechanism and is required to retain 90% of the main feature information in the original data features.

[0055] Step S4. By projecting the original data features onto the subspace , a new data representation is obtained. For in-distribution data, this projection operation retains more important components of the subspace, while for out-of-distribution data, it results in more information loss.

[0056] The confidence score based on the spectral norm of the projection vector is specifically:

[0057] The confidence score in this embodiment based on the feature reshaping process of sample data features in the subspace specifically includes the following steps:

[0058] Step S5.1, Select a certain test image as a sample for enhancement and input it into the model for the feature extraction process to obtain the model output of the penultimate layer as the sample feature;

[0059] Step S5.2, project the obtained sample features in the subspace U M to obtain a new feature representation. This feature representation filters out some irrelevant information or noise through the subspace, usually manifested as some noise such as background information in the image that confuses the model's judgment, while retaining the key features of the recognition object itself;

[0060] Step S5.3, calculate the spectral norm of the new represented feature as the final confidence score S(·), and the specific formula is as follows:

[0061] ,

[0062] wherein, represents the sample, represents the new feature representation after feature extraction by the model. Since the feature distribution of out-of-distribution data cannot maintain a strong component in the subspace, generally speaking, the confidence of out-of-distribution samples is relatively low, while the confidence of in-distribution samples is higher due to the retention of information;

[0063] Step S5.4, obtain the confidence scores of all samples, calculate the area under the receiver operating characteristic curve (AUROC) and the false positive rate of the model (FPR@95) when the true positive rate (TPR) threshold is fixed at 95% to measure the out-of-distribution detection performance of the present invention;

[0064] The third embodiment of the present invention proposes an electronic device, which is used to implement the proposed out-of-distribution detection processing method, and includes at least one processor and a memory communicatively connected thereto. The memory stores instructions executable by the processor for implementing the out-of-distribution detection method based on feature reconstruction of the classifier. Such a device can be used for real-time image out-of-distribution detection processing in an industrial production environment.

[0065] The fourth embodiment of the present invention proposes a computer-readable storage medium, which stores instructions executable by a computer for implementing the out-of-distribution detection method based on feature reconstruction of the classifier. During implementation, this storage medium can be used to save the algorithms and programs of the present invention for quick loading and execution when needed.

[0066] Those skilled in the art need to understand that for the sake of convenience and conciseness of description, the specific working processes and related descriptions of the above storage device and processing device can refer to the corresponding processes in the previous method embodiments, and will not be repeated here.

[0067] According to an embodiment of the present disclosure, the process Figure 1The process described can be implemented by a computer software program and can also be implemented with the aid of hardware. Embodiments of the present disclosure include a computer program product that includes program code on a computer-readable medium for performing the process Figure 1 shown in the method. When the program is executed, the central processing unit (CPU) will implement the functions defined in the present application. In practical applications, the above functions can be allocated to different modules according to requirements, which means that the modules or steps in the embodiments of the present invention can be combined or subdivided. For example, a module can be integrated into a single module or further divided into multiple sub-modules to implement all or part of the above functions.

[0068] The computer program code for performing the operations of the present application can be written in one or more programming languages or combinations thereof. These programming languages include object-oriented languages such as Java and C++, traditional procedural programming languages such as C, and other languages such as Python. The program code can be executed entirely on the user's computer, partially on the user's computer, or executed as a stand-alone software package.

[0069] In summary, the preferred embodiments of the present invention have been described in conjunction with the accompanying drawings. However, those skilled in the art should understand that the protection scope of the present invention is not limited to these specific embodiments. Without departing from the principles of the present invention, any equivalent changes or substitutions of related technical features fall within the protection scope of the present invention.

Claims

1. An out-of-distribution detection method based on feature reconstruction of a classifier, characterized in that: The following steps are involved: Step S1, obtaining a depth discrimination model to be designed, which can achieve excellent recognition ability of samples within the distribution after training; Step S2, obtaining an image sample to be discriminated, and inputting it into the discriminant model after data enhancement; obtaining the features of the image on the model encoder through the feature extraction process of the model, and saving the feature output of the second-to-last layer in the model propagation process; Step S3, obtaining the weight matrix of the last classification layer of the model, performing weight decomposition of the weight of the layer by singular value decomposition of the weight matrix, and obtaining the decomposed left singular vector U; Step S4, selecting the left singular column vectors corresponding to the larger m singular values ​​to form a projection subspace according to the proportion of the singular values ; Step S5, projecting the features of the sample on the projection subspace, and calculating the spectral norm of the sample projection vector, which is the confidence score of the sample; Step S6, performing the classification task of out-of-distribution samples by measuring the confidence scores corresponding to the in-distribution and out-of-distribution samples.

2. The out-of-distribution detection method based on feature reconstruction of a classifier according to claim 1, characterized in that: The deep discriminant model consists of convolutional layers, activation layers, pooling layers, and fully connected layers. Through multi-level feature extraction and nonlinear mapping, it extracts high-level semantic features of samples to construct a feature space. The output of the penultimate layer is selected as the sample feature, that is, the output of the model without the fully connected layer. The deep discriminant model extracts and classifies features of images or other types of input data through its multi-layer structure.

3. The out-of-distribution detection method based on feature reconstruction of a classifier according to claim 1, characterized in that: Data augmentation methods include scaling and cropping.

4. The out-of-distribution detection method based on feature reconstruction of a classifier according to claim 1, characterized in that: In step S3, the singular value decomposition of the weight matrix specifically includes the following steps: Step S3.1, given a model’s final classification layer weight matrix ,in represents the number of categories, represents the feature dimension, represents the real number space, given , perform the following singular value decomposition: , in, The dimension is , The dimension is ,and is a diagonal matrix , where the singular values ​​are arranged in descending order; Step S3.2, after decomposition is completed, the left singular vector matrix Provides an orthogonal basis for the output space, extracting the matrix The first m columns of form a subspace consisting of a dimensionality reduction matrix , the matrix is ​​decomposed by The first m columns of the matrix are composed; the specific formula is as follows: , in, represents the left singular vector The column vector; Step S3.3, m is determined by calculating the cumulative explained variance according to machine learning theory, specifically: , in, Representative singular values, Set to 90%; Step S3.4, by projecting the original data features into the subspace A new data representation was obtained.

5. The out-of-distribution detection method based on feature reconstruction of a classifier according to claim 1, characterized in that: In step S5, the confidence score based on the spectral norm of the projection vector is specifically: Step S5.1, select an image as a sample to be enhanced and input into the model for feature extraction process, and obtain the model output of the second-to-last layer as the sample feature; Step S5.2: The acquired sample features are placed in the subspace Projection is performed to obtain a new feature representation; Step S5.3, calculate the spectral norm of the new representation feature as the final confidence score S(·), the specific formula is as follows: , in, Representative samples, Represents the new feature representation after model feature extraction.

6. The out-of-distribution detection method based on feature reconstruction of a classifier according to claim 1, characterized in that: In step S6, after obtaining the confidence scores of all samples, the area under the receiver operating characteristic curve AUROC and the false positive rate FPR of the model when the true positive rate TPR is fixed at 95% are calculated to measure the out-of-distribution detection performance of the present invention.

7. An out-of-distribution detection system based on feature reconstruction of a classifier, characterized in that: include: A deep discriminant model, which can be trained to achieve excellent recognition of in-distribution samples; The feature extraction module obtains the image samples to be judged and inputs them into the discrimination model after data enhancement. Through the feature extraction process of the model, the features of the image on the model are obtained, and the feature output of the second-to-last layer in the model propagation process is saved. The singular value decomposition module obtains the weight matrix of the last classification layer of the model, decomposes the weight of this layer through the singular value decomposition of the weight matrix, and obtains the decomposed left singular vector ; The projection subspace acquisition module selects the left singular column vectors corresponding to the larger m singular values ​​to form the projection subspace according to the proportion of singular values. ; The confidence score calculation module projects the sample features onto the projection subspace and calculates the spectral norm of the sample projection vector, which is the confidence score of the sample. The out-of-distribution sample classification module performs the out-of-distribution sample classification task by measuring the sample confidence scores corresponding to the in-distribution and out-of-distribution samples.

8. An electronic device, characterized in that: It comprises at least one processor and a memory in communication with the processor, wherein the memory stores instructions executable by the processor, and the instructions are used to implement the out-of-distribution detection method based on feature reconstruction of a classifier as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: Instructions executable by a computer are stored, and these instructions are used to implement the out-of-distribution detection method based on feature reconstruction of a classifier as described in any one of claims 1-6.

10. An intelligent terminal, characterized in that: The invention comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the out-of-distribution detection method based on feature reconstruction of a classifier as described in any one of claims 1 to 6.