IP Library › Granted Patent US 12,602,581
Granted Patent B2
US 12,602,581 · App. 17/098,007 · Granted Apr 14, 2026

Systems and methods for out-of-distribution detection

Inventors: Yihao Feng (Austin, TX); Caiming Xiong (Menlo Park, CA)
Assignee: Salesforce, Inc.
G06N3/08G06N3/063
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,602,581
App. No.
17/098,007
Granted
Apr 14, 2026
Kind
B2
Abstract

Some embodiments of the current disclosure disclose methods and systems for detecting out-of-distribution (ODD) data. For example, a method for detecting ODD data includes obtaining, at a neural network composed of a plurality of layers, a set of training data generated according to a distribution. Further, the method comprises generating, via a processor, a feature map by combining mapping functions corresponding to the plurality of layers into a vector of mapping function elements and mapping, by the feature map, the set of training data to a set of feature space training data in a feature space. Further, the method comprises identifying, via the processor, a hyper-ellipsoid in the feature space enclosing the feature space training data based on the generated feature map. In addition, the method comprises determining, via the processor, the first test data sample is OOD data when a mapped first test data sample in the feature space is outside the hyper-ellipsoid.

Claims (81)

1 . A method for out-of-distribution (OOD) anomaly detection of images for an autonomous driving system, the method comprising:

implementing a neural network composed of a plurality of layers on a processor as a traffic sign classification model for the autonomous driving system;

receiving, for the neural network, a set of training images containing traffic signs and other items generated according to a preset distribution of the set of training images, wherein each layer of the plurality of layers of the neural network transforms a respective input to a respective output via a respective mapping function of a plurality of mapping functions;

training the neural network using the set of training images, to classify an incoming image depicting a traffic scene as an anomaly by determining whether the incoming image is OOD, wherein the training includes:

applying one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to each training image of the set of the training images to create a set of transformed training images;

generating, by the plurality of layers of the neural network implemented on the processor, a feature map by combining mapping functions of the plurality of layers into a vector of mapping function elements that comprises: a first mapping function element of a first mapping function from the plurality of mapping functions, and a second mapping function element of a function composition of the first mapping function and a second mapping function from the plurality of mapping functions;

mapping, by the feature map generated by the plurality of layers of the neural network, the set of transformed training images to a set of feature space training data in a feature space; and

identifying, via the processor, a hyper-ellipsoid in the feature space enclosing the set of feature space training data based on the generated feature map as a mechanism for determining whether the incoming image is OOD;

receiving, at inference time of the neural network associated with the identified hyper-ellipsoid used as the traffic sign classification model in the autonomous driving system, a first test image depicting a real world scene outside the set of training images;

applying, via the processor, one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to the first test image to create one or more transformed test images;

using the trained neural network associated with the identified hyper-ellipsoid to determine whether the first test image is OOD, including:

mapping the one or more transformed test images into the feature space by the generated feature map;

generating, via the processor, a prediction indicating that the first test image is OOD based on whether the mapped one or more transformed test images in the feature space are outside the hyper-ellipsoid identified from the training of the neural network; and

responsive to determining that the first test image is OOD, generating, by the trained neural network associated with the identified hyper-ellipsoid implemented as the traffic sign classification model in the autonomous driving system, a traffic sign classification output indicating that the first test image depicting the real world scene is an anomaly.

2 . The method of claim 1 , wherein the vector of mapping function elements is generated at least in part by performing a function composition of two or more mapping functions of the plurality of mapping functions to form a mapping function element in the vector.

3 . The method of claim 1 , wherein:

the set of training images includes a single class training dataset; and

the neural network is a classifier neural model pre-trained with the single class training dataset.

4 . The method of claim 1 , wherein:

the set of training images includes a multi-class training dataset; and

the neural network is a classifier neural model pre-trained with the multi-class training dataset.

5 . The method of claim 1 , wherein:

the set of training images includes an intent classification training dataset; and

the neural network is a classifier neural model pre-trained with the intent classification training dataset.

6 . The method of claim 1 , wherein:

the set of training images includes a question answering training dataset; and

the neural network is a non-classifier neural model pre-trained with the question answering training dataset.

7 . The method of claim 1 , wherein the neural network is a non-classifier neural model pre-trained with data lacking an OOD sample.

8 . The method of claim 1 , further comprising:

determining one hyper-ellipsoid that has a smallest volume among a set of candidate hyper-ellipsoids that enclose the set of feature space training data in the feature space as the hyper-ellipsoid.

9 . A system for out-of-distribution (OOD) anomaly detection of images for an autonomous driving system, the system comprising:

a memory storing instructions for OOD anomaly detection of test data; and

a processor configured to read and execute the instructions from the memory to:

implement a neural network composed of a plurality of layers on the processor as a traffic sign classification model for the autonomous driving system;

receive, for the neural network, a set of training images containing traffic signs and other items generated according to a preset distribution of the set of training images, wherein each layer of the plurality of layers of the neural network transforms a respective input to a respective output via a respective mapping function of a plurality of mapping functions;

train the neural network using the set of training images, to classify an incoming image depicting a traffic scene as an anomaly by determining whether the incoming image is OOD, wherein the training includes:

applying one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to each training image of the set of the training images to create a set of transformed training images;

generating, by the plurality of layers of the neural network implemented on the processor, a feature map by combining mapping functions of the plurality of layers into a vector of mapping function elements that comprises: a first mapping function element of a first mapping function from the plurality of mapping functions, and a second mapping function element of a function composition of the first mapping function and a second mapping function from the plurality of mapping functions;

mapping, by the feature map generated by the plurality of layers of the neural network, the set of transformed training images to a set of feature space training data in a feature space; and

identifying, via the processor, a hyper-ellipsoid in the feature space enclosing the set of feature space training data based on the generated feature map as a mechanism for determining whether the incoming image is OOD;

receive, at inference time of the neural network associated with the identified hyper-ellipsoid used as the traffic sign classification model in the autonomous driving system, a first test image depicting a real world scene outside the set of training images;

apply, via the processor, one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to the first test image to create one or more transformed test images;

use the trained neural network associated with the identified hyper-ellipsoid to determine whether the first test image is OOD, including:

mapping the one or more transformed test images into the feature space by the generated feature map;

generating, via the processor, a prediction indicating that the first test image is OOD based on whether the mapped one or more transformed test images in the feature space are outside the hyper-ellipsoid identified from the training of the neural network; and

responsive to determining that the first test image is OOD, generate, by the trained neural network associated with the identified hyper-ellipsoid implemented as the traffic sign classification model in the autonomous driving system, a traffic sign classification output indicating that the first test image depicting the real world scene is an anomaly.

10 . The system of claim 9 , wherein:

the vector of mapping function elements is generated at least in part by performing a function composition of two or more mapping functions of the plurality of mapping functions to form a mapping function element in the vector.

11 . The system of claim 9 , wherein:

the set of training images includes a single class training dataset, a multi-class training dataset or an intent classification training dataset; and

the neural network is a classifier neural model pre-trained with the single class training dataset, the multi-class training dataset or the intent classification training dataset.

12 . The system of claim 9 , wherein:

the set of training images includes a question answering training dataset; and

the neural network is a non-classifier neural model pre-trained with the question answering training dataset.

13 . The system of claim 9 , wherein the neural network is a non-classifier neural model pre-trained with data lacking an OOD sample.

14 . The system of claim 9 , further the processor is further configured to:

determine one hyper-ellipsoid that has a smallest volume among a set of candidate hyper-ellipsoids that enclose the set of feature space training data in the feature space as the hyper-ellipsoid.

15 . A non-transitory computer-readable medium (CRM) having stored thereon machine-readable instructions for out-of-distribution (OOD) anomaly detection of images for an autonomous driving system, the machine-readable instructions executable to cause a processor to perform operations comprising:

implementing a neural network composed of a plurality of layers on the processor as a traffic sign classification model for the autonomous driving system;

receiving, for the neural network, a set of training images containing traffic signs and other items generated according to a preset distribution of the set of training images, wherein each layer of the plurality of layers of the neural network transforms a respective input to a respective output via a respective mapping function of a plurality of mapping functions;

training the neural network using the set of training images, to classify an incoming image depicting a traffic scene as an anomaly by determining whether the incoming image is OOD, wherein the training includes:

applying one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to each training image of the set of the training images to create a set of transformed training images;

generating, by the plurality of layers of the neural network implemented on the processor, a feature map by combining mapping functions of the plurality of layers into a vector of mapping function elements that comprises: a first mapping function element of a first mapping function from the plurality of mapping functions, and a second mapping function element of a function composition of the first mapping function and a second mapping function from the plurality of mapping functions;

mapping, by the feature map generated by the plurality of layers of the neural network, the set of transformed training images to a set of feature space training data in a feature space; and

identifying, via the processor, a hyper-ellipsoid in the feature space enclosing the set of feature space training data based on the generated feature map as a mechanism for determining whether the incoming image is OOD;

receiving, at inference time of the neural network associated with the identified hyper-ellipsoid used as the traffic sign classification model in the autonomous driving system, a first test image depicting a real world scene outside the set of training images;

applying, via the processor, one or more geometric transformations including vertical and/or horizontal translation of a specific number of pixels to the first test image to create one or more transformed test images;

using the trained neural network associated with the identified hyper-ellipsoid to determine whether the first test image is OOD, including:

mapping the one or more transformed test images into the feature space by the generated feature map;

generating, via the processor, a prediction indicating that the first test image is OOD based on whether the mapped one or more transformed test images in the feature space are outside the hyper-ellipsoid identified from the training of the neural network; and

responsive to determining that the first test image is OOD, generating, by the trained neural network associated with the identified hyper-ellipsoid implemented as the traffic sign classification model in the autonomous driving system, a traffic sign classification output indicating that the first test image depicting the real world scene is an anomaly.

16 . The non-transitory CRM of claim 15 , wherein:

the vector of mapping function elements is generated at least in part by performing a function composition of two or more mapping functions of the plurality of mapping functions to form a mapping function element in the vector.

17 . The non-transitory CRM of claim 15 , wherein:

the set of training images includes a single class training dataset, a multi-class training dataset or an intent classification training dataset; and

the neural network is a classifier neural model pre-trained with the single class training dataset, the multi-class training dataset or the intent classification training dataset.

18 . The non-transitory CRM of claim 15 , wherein:

the set of training images includes a question answering training dataset; and

the neural network is a non-classifier neural model pre-trained with the question answering training dataset.

19 . The non-transitory CRM of claim 15 , wherein the neural network is a non-classifier neural model pre-trained with data lacking an OOD sample.

20 . The non-transitory CRM of claim 15 , wherein the operations further comprise determining one hyper-ellipsoid that has a smallest volume among a set of candidate hyper-ellipsoids that enclose the set of feature space training data in the feature space as the hyper-ellipsoid.

Assignments (2)
CHANGE OF NAME Recorded Aug 4, 2026
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 076118/0548 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2020
From: FENG, YIHAO; XIONG, CAIMING
To: SALESFORCE.COM, INC.
Reel/Frame 054589/0746 →
Continuity (2)
Provisional Application 63032696 · May 31, 2020
Related Publication 20210374524A1 · Dec 2, 2021
References Cited (46)
US 20140279777A1 · Cornebise · 2014 [cited by examiner]
US 20210150385A1 · Mallette · 2021 [cited by examiner]
US 20220155926A1 · Bhatt · 2022 [cited by examiner]
Rajasegarar, Sutharshan, et al. “Centered hyperspherical and hyperellipsoidal one-class support vector machines for anomaly detection in sensor networks.” IEEE Transactions on Information Forensics and Security 5.3 (201… [cited by examiner]
Montufar, Guido F., et al. “On the No. of linear regions of deep neural networks.” Advances in neural information processing systems 27 (2014). (Year: 2014). [cited by examiner]
Liang, Peifeng, et al. “One-class classification using quasi-linear support vector machine.” 2018 IEEE International Conference on Systems, Man, and Cybernetics (SMC). IEEE, 2018. (Year: 2018). [cited by examiner]
Qi, Di, et al. “Imagebert: Cross-modal pre-training with large-scale weak-supervised image-text data.” arXiv preprint arXiv:2001.07966 (2020). (Year: 2020). [cited by examiner]
Dolia, Alexander N., et al. “D-optimality for minimum vol. ellipsoid with outliers.” Proc. 7th Int. Conf. Signal/Image Processing Pattern Recognition. 2004. (Year: 2004). [cited by examiner]
Cai, Feiyang, and Xenofon Koutsoukos. “Real-time out-of-distribution detection in learning-enabled cyber-physical systems.” 2020 ACM/IEEE 11th International Conference on Cyber-Physical Systems (ICCPS). IEEE, 2020. (Yea… [cited by examiner]
Kingma, Diederik P., and Max Welling. “Auto-encoding variational bayes.” arXiv preprint arXiv:1312.6114 (2014). (Year: 2014). [cited by examiner]
Wadlinger, E. Alan. General least-squares fitting procedures to minimize the vol. of a hyperellipsoid. No. LA-8096-MS. Los Alamos National Lab.(LANL), Los Alamos, NM (United States), 1979. (Year: 1979). [cited by examiner]
Ryu, Seonghan, et al. “Neural sentence embedding using only in-domain sentences for out-of-domain sentence detection in dialog systems.” Pattern Recognition Letters 88 (2017): 26-32. (Year: 2017). [cited by examiner]
Zhu, Yukun, et al. “Aligning books and movies: Towards story-like visual explanations by watching movies and reading books.” Proceedings of the IEEE international conference on computer vision. 2015. (Year: 2015). [cited by examiner]
Golan, Izhak, and Ran El-Yaniv. “Deep anomaly detection using geometric transformations.” Advances in neural information processing systems 31 (2018). (Year: 2018). [cited by examiner]
Chen, Xiaoqing, Chunjie Cao, and Jianbin Mai. “Network anomaly detection based on deep support vector data description.” 2020 5th IEEE International Conference on Big Data Analytics (ICBDA). IEEE, 2020. (Year: 2020). [cited by examiner]
Chen et al., “A Simple Framework for Contrastive Learning of Visual Representations,” arXiv preprint arXiv: 2002.05709, Jul. 2020, 20 pages. [cited by applicant]
Devlin et al., “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Ma… [cited by applicant]
Dua et al., “DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs,” arXiv preprint arXiv:1903.00161, Apr. 16, 2019, 12 pages. [cited by applicant]
Emanuel Parzen, “On Estimation of a Probability Density Function and Mode,” The annals of mathematical statistics, vol. 33, No. 3, 1962, pp. 1065-1076. [cited by applicant]
Golan et al., “Deep anomaly detection using geometric transformations,” In Advances in Neural Information Processing Systems, Nov. 9, 2018, 17 pages. [cited by applicant]
Grathwohl et al., “Your classifier is secretly an energy based model and you should treat it like one,” In International Conference on Learning Representations, 2020, 23 pages. [cited by applicant]
Guo et al., “On calibration of modern neural networks,” In Proceedings of the 34th International Conference on Machine Learning, vol. 70, 2017, 14 pages. [cited by applicant]
He et al., “Momentum contrast for unsupervised visual representation learning,” arXiv preprint arXiv:1911.05722, 2019, 11 pages. [cited by applicant]
He et al., “Rethinking imagenet pre-training,” In Proceedings of the IEEE International Conference on Computer Vision, 2018, 10 pages. [cited by applicant]
Hendrycks et al., “A baseline for detecting misclassified and out-of-distribution examples in neural networks,” In International Conference on Learning Representations, 2017, 12 pages. [cited by applicant]
Hendrycks et al., “Deep anomaly detection with outlier exposure,” In International Conference on Learning Representations, URL https: //openreview. net/forum?id=HyxCxhRcY7, 2019, 18 pages. [cited by applicant]
Hendrycks et al., “Pretrained transformers improve out-of-distribution robustness,” arXiv preprint arXiv:2004.06100, 2020, 11 pages. [cited by applicant]
Hendrycks et al., “Using pre-training can improve model robustness and uncertainty,” In International Conference on Machine Learning, 2019, 12 pages. [cited by applicant]
Larson et al., “An evaluation dataset for intent classification and out-of-scope prediction,” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Con… [cited by applicant]
Lee et al., “A simple unified framework for detecting out-of-distribution samples and adversarial attacks,” In Advances in Neural Information Processing Systems, 2018, 20 pages. [cited by applicant]
Liang et al., “Enhancing the reliability of out-of-distribution image detection in neural networks,” In International Conference on Learning Representations, 2018, 15 pages. [cited by applicant]
Mahajan et al., “Exploring the limits of weakly supervised pretraining,” In Proceedings of the Eu ropean Conference on Computer Vision (ECCV ), 2018, 13 pages. [cited by applicant]
Nalisnick et al., “Do deep generative models know what they don't know?” In International Conference on Learning Representations, 2019, 19 pages. [cited by applicant]
Rajpurkar et al., “Squad: 100,000+ questions for machine comprehension of text,” arXiv preprint arXiv: 1606.05250, 2016, 10 pages. [cited by applicant]
Ren et al., “Likelihood ratios for out-of-distribution detection,” In 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada, 2019, 21 pages. [cited by applicant]
Ruff et al., “Deep one-class classification. In International conference on machine learning,” IProceedings of the 35 th International Conference on Machine Learning, Stockholm, Sweden, PMLR 80, 2018, 10 pages. [cited by applicant]
Saha et al., “DuoRC: Towards Complex Language Understanding with Paraphrased Reading Comprehension,” In Meeting of the Association for Computational Linguistics (ACL), 2018 16 pages. [cited by applicant]
Scholkopf et al., “Estimating the support of a high-dimensional distribution,” Neural computation, vol. 13, No. 7, 2001, 30 pages. [cited by applicant]
Serra et al., “Input complexity and out-of-distribution detection with likelihood-based generative models,” In International Conference on Learning Representations, 2020 15 pages. [cited by applicant]
Sun et al., “Revisiting unreasonable effectiveness of data in deep learning era,” In Proceedings of the IEEE international conference on computer vision, 2017, 13 pages. [cited by applicant]
Tax et al., “Support vector data description,” Machine learning, vol. 54, No. 1, 2004, pp. 45-66. [cited by applicant]
Trischler et al., “Newsqa: A machine comprehension dataset,” arXiv preprint arXiv:1611.09830, 2016, 12 pages. [cited by applicant]
Yang et al., “Hotpotqa: A dataset for diverse, explainable multi-hop question answering,” arXiv preprint arXiv:1809.09600, 2018, pp. 2369-2380. [cited by applicant]
Yang et al., “Xlnet: Generalized autoregressive pretraining for language understanding,” In 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada, 2019, 18 pages. [cited by applicant]
Zhai et al., “Deep structured energy based models for anomaly detection,” In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, vol. 48 of Proceed… [cited by applicant]
Zong et al., “Deep autoencoding gaussian mixture model for unsupervised anomaly detection,” In International Conference on Learning Representations, URL https://openreview.net/forum?id=BJJLHbbO-, 2018, 19 pages. [cited by applicant]