Likelihood ratio for out-of-distribution detection
By training semantic and background models and using likelihood ratios to detect OOD inputs, the misclassification problem of OOD detection in existing technologies is solved, the detection accuracy and system security are improved, and the application of machine learning systems is expanded.
Patent Information
- Application Number
- CN202080047730.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-05
- Filing Date
- 2020-05-26
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2040-05-26
AI Technical Summary
Existing machine learning systems suffer from misclassification problems when detecting out-of-distribution inputs. In particular, deep generative models have difficulty distinguishing between background statistics and semantic content, resulting in OOD inputs being incorrectly classified as in-distribution classes.
By training the semantic model and background model, the likelihood ratio method is used to correct the background statistics and generate a likelihood ratio value to detect OOD input. The semantic model is trained on in-distribution training data, and the background model is generated by perturbing the in-distribution training examples. The likelihood ratio value is used to predict whether the input is OOD.
It significantly improves the accuracy of OOD detection, reduces inaccurate diagnoses, reduces the waste of computing resources, enhances the security and reliability of AI systems, and expands the application scenarios of machine learning systems.
Smart Images

Figure CN114127747B_ABST
Abstract
Description
[0001] Related applications
[0002] This application claims priority to and the benefit of U.S. Provisional Patent Application No. 62 / 857,774, filed on June 5, 2019. U.S. Provisional Patent Application No. 62 / 857,774 is hereby incorporated by reference in its entirety. Technical Field
[0003] The present disclosure generally relates to machine learning. More specifically, the present disclosure relates to systems and methods for improved detection of out-of-distribution inputs. The term "in-distribution" is used to describe a data set that is a sample from a certain data distribution. The distribution can be associated with multiple "in-distribution classes" that describe corresponding parts of the space of possible in-distribution data sets. In contrast, the term "out-of-distribution" (ODD) refers to a data set that is not a sample from a distribution. The distribution can be, for example, a distribution of training examples that have been used to train a machine learning system. The data set can be a data set obtained by observing and / or measuring physical, biological, medical or chemical objects or events in the real world, especially the real world. For example, they can be a data set that encodes nucleic acid sequences observed in the real world and / or a data set that encodes sensor data (e.g., images or sounds) captured by one or more sensors (e.g., a camera including a video camera and / or a microphone). Background Art
[0004] For many machine learning systems, being able to detect data that is anomalous or significantly different from the data used in training can be critical to maintaining safe and reliable predictions. This is particularly important for deep neural network classifiers that have been shown to incorrectly classify OOD inputs as in-distribution classes with high confidence. This behavior can have serious consequences when predictions inform real-world decisions such as medical diagnoses, for example, incorrectly classifying a healthy sample as a pathogenic sample or vice versa can be extremely costly. Therefore, the importance of handling OOD inputs (also known as distribution shift) has been recognized as a major issue in AI safety.
[0005] An example of an important subproblem of OOD detection is bacterial identification and many other types of medical diagnostics. For example, the diagnosis and treatment of infectious diseases such as sepsis rely on the accurate detection of bacterial infections in the blood. Several machine learning methods have been developed to perform bacterial identification by classifying known genomic sequences, including the latest deep learning methods.
[0006] However, even if neural network classifiers achieve high accuracy as measured by cross-validation, deploying them is challenging because real data is highly likely to contain genomes from unseen classes that were not present in the training data. In particular, different bacterial classes have continued to be discovered over the years, and it is estimated that 60%-80% of genome sequences belong to bacteria that are not yet known to the public. Therefore, training a classifier on existing bacterial classes and deploying it may result in OOD inputs being incorrectly classified as one of the classes from the training data with high confidence. In addition, OOD inputs can also be contamination from the genome of the bacterial host, such as humans, plants, fungi, etc., which also need to be detected and excluded from the prediction. Therefore, having methods for accurately detecting OOD inputs is crucial to enabling the practical application of machine learning methods to this important problem. Beyond this example sub-problem, the dynamics and challenges described above can be generalized to many different scenarios / problems, including any scenario where OOD inputs can be present and misclassification of such OOD inputs can be problematic.
[0007] At the current state of the art, a popular strategy for detecting OOD inputs is to train a generative model on the training data and use the generative model to detect OOD inputs at test time. However, recent studies have shown that deep generative models trained on image datasets are able to assign higher likelihoods to OOD inputs (that is, deep generative models can incorrectly classify OOD inputs as being in one of the in-distribution classes using a higher likelihood than that assigned to in-distribution inputs by the deep generative model). Therefore, these existing methods may provide significantly erroneous and unreliable results in some scenarios. Summary of the Invention
[0008] Various aspects and advantages of the embodiments of the present disclosure will be set forth in part in the following description, or can be learned from the description, or can be learned through practice of the embodiments.
[0009] One exemplary aspect of the present disclosure relates to a computing system for performing out-of-distribution detection. The computing system includes one or more processors and one or more non-transitory computer-readable media. The one or more non-transitory computer-readable media collectively store a machine-learned semantic model trained on an in-distribution training dataset (i.e., the training data is a sample from a distribution) comprising a plurality of in-distribution training examples. The machine-learned semantic model is configured to receive and process data input to generate a first likelihood value for the data input. The first likelihood value, as data input, is a first indication of the likelihood of the sample from the distribution. The one or more non-transitory computer-readable media collectively store a machine-learned background model trained on background training data comprising a plurality of background training examples. One or more background training examples from the plurality of in-distribution training examples have been generated by perturbation of one or more in-distribution training examples from the plurality of in-distribution training examples. The machine-learned background model is configured to receive and process data input to generate a second likelihood value for the data input. The second likelihood value, as data input, is a second indication of the likelihood of the sample from the background distribution. One or more non-transitory computer-readable media collectively store instructions that, when executed by one or more processors, cause a computing system to perform operations comprising: determining a likelihood ratio value for a data input based at least in part on a first likelihood value generated by a machine-learned generated semantic model and a second likelihood value generated by a machine-learned generated background model; and predicting whether the data input is an out-of-distribution input based at least in part on the likelihood ratio value.
[0010] Another example aspect of the present disclosure relates to a computer-implemented method for performing out-of-distribution detection. The method includes obtaining, by one or more computing devices, an in-distribution training dataset comprising a plurality of in-distribution training examples. The method includes training, by the one or more computing devices, a machine-learned semantic model using the in-distribution training dataset. The method includes perturbing, by the one or more computing devices, one or more of the plurality of in-distribution training examples to generate one or more background training examples. The method includes training, by the one or more computing devices, a machine-learned background model using the background training dataset comprising the one or more background training examples. The method includes inputting, by the one or more computing devices, a data input into the machine-learned semantic model trained on the in-distribution training dataset. The method includes receiving, by the one or more computing devices, a first likelihood value for the data input as an output of the machine-learned semantic model. The method includes inputting, by the one or more computing devices, the data input into the machine-learned background model trained on the background training dataset. The method includes receiving, by the one or more computing devices, a second likelihood value for the data input as an output of the machine-learned background model. The method includes determining, by the one or more computing devices, a likelihood ratio value for the data input based at least in part on the first likelihood value generated by the machine-learned semantic model and the second likelihood value generated by the machine-learned background model. The method includes predicting whether the data input is an out-of-distribution input based at least in part on a likelihood ratio value.
[0011] Other aspects of the disclosure relate to various systems, apparatuses, non-transitory computer-readable media, user interfaces, and electronic devices.
[0012] These and other features, aspects and advantages of various embodiments of the present disclosure will become better understood with reference to the following description.The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate example embodiments of the present disclosure and, together with the description, serve to explain the relevant principles. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] A detailed discussion of embodiments for those of ordinary skill in the art is set forth in the specification with reference to the accompanying drawings, in which:
[0014] Figure 1A Depicted is a block diagram of an example computing system according to an example embodiment of the present disclosure.
[0015] Figure 1B A block diagram of an example computing device is depicted, according to example embodiments of the present disclosure.
[0016] Figure 1C A block diagram of an example computing device is depicted, according to example embodiments of the present disclosure.
[0017] Figure 2 Depicted is a block diagram of an example OOD detection and classification system according to an example embodiment of the present disclosure.
[0018] Figure 3 Depicted is a flow chart of an example method for generating an OOD detection system according to an example embodiment of the present disclosure.
[0019] Reference numerals that are repeated across multiple figures are intended to identify like features in the various embodiments. DETAILED DESCRIPTION
[0020] Overview
[0021] In general, the present disclosure relates to systems and methods for performing improved detection of out-of-distribution (OOD) inputs. In particular, current deep generative model-based approaches for OOD detection are significantly negatively impacted by the semantic content associated with in-distribution examples, and have difficulty distinguishing population-level background statistics from the semantic content associated with in-distribution examples (i.e., distinguishing between the part of the in-distribution input that is relevant or specific to classifying the input into a corresponding one of multiple classes ("semantic content"), and the part of the in-distribution input that is irrelevant or less specific to the classification into such a class and that may have something in common with the OOD input ("background statistics"). In fact, this approach has even been observed in experiments to assign higher likelihoods to OOD inputs, which is contrary to the desired behavior. To address this issue, the present disclosure proposes a likelihood ratio approach for deep generative models that effectively corrects for these confounding background statistics.
[0022] Specifically, the proposed likelihood ratio method can utilize both a semantic model that learns semantic features of in-distribution training examples and a background model that learns background statistics that correct the training examples. In particular, the semantic model can be trained on a set of in-distribution training examples, while the background model can be trained on a set of background training examples, where at least some of the background training examples are generated by corrupting the semantic content of the in-distribution training examples (e.g., by perturbation of the in-distribution training examples).
[0023] After training, OOD detection for a given data input can be performed based on a likelihood ratio value generated from the corresponding likelihood values output by the semantic model and the background model for the data input. Using the background model in this way can enhance the in-distribution specific features of OOD detection, resulting in state-of-the-art performance for OOD detection.
[0024] The proposed method has been experimentally shown to significantly outperform the original likelihood in OOD detection by deep generative models on image datasets. As examples, U.S. Provisional Patent Application No. 62 / 857,774 and Jie Ren et al., “Likelihood Ratios for Out-of-distribution Detection,” arXiv:1906.02845, which are incorporated by reference in their entirety into the present disclosure and form a part of the present disclosure, contain example experimental results demonstrating the efficacy of the proposed method in improving OOD detection.
[0025] The systems and methods of the present disclosure provide numerous technical effects and benefits. As an example, the proposed techniques effectively correct for background components, thereby significantly improving the accuracy of OOD detection for multiple input data modalities. By improving OOD detection, the underlying accuracy of the system can be improved, for example, by preventing OOD inputs from being misclassified by downstream classifiers. Thus, the proposed techniques can improve the accuracy of systems that perform input classification, resulting in more refined system performance.
[0026] As an example, in a system that performs bacterial identification or other types of medical diagnostics, the number of inaccurate diagnoses (e.g., false positives) can be reduced, thereby improving the efficacy of medical care provided based on the provided diagnoses and reducing the costs associated with unnecessary and / or incorrect medical treatments. Thus, improved health care outcomes can be achieved at a reduced cost.
[0027] As another example technical effect and benefit, by improving OOD detection, the deployment of machine learning systems can be expanded to new uses and scenarios where classification accuracy is critical. Therefore, by reducing the misclassification of OOD inputs, AI security can be improved, allowing the benefits of machine learning systems to withstand new problem domains or existing challenges. In addition, public confidence in machine learning applications can be increased.
[0028] As another example technical effect and benefit, by using the improved OOD detection system of the present disclosure to screen inputs before being processed by downstream system components (e.g., classifiers), unnecessary and undesirable processing of OOD inputs by such downstream components can be reduced. Therefore, computing resources such as processor usage, memory usage, network bandwidth, etc. can be saved. In other words, by identifying and screening OOD inputs in the early stages of the processing pipeline, wasteful application of downstream resources to such OOD inputs can be reduced.
[0029] Example implementations of the techniques described herein will now be discussed in greater detail.
[0030] Example Notation and Problem Statement
[0031] Assume there is an in-distribution dataset of (x, y) pairs sampled according to distribution p*(x, y) Where x is the extracted feature vector or the original input and : = {1, ..., k, ..., K} is a label that assigns membership to one of the K distribution classes. For simplicity, this discussion assumes the input is discrete, e.g., for a genome sequence x d ∈{A, C, G, T} and for image x d ∈{0,...,255}, where d is an integer and x d represents the d-th component of x.
[0032] Generally speaking, OOD input is based on the p * As used in this paper, if That is, if class y does not belong to one of the K in-distribution classes, then the input (x, y) is considered to be OOD. One goal of an OOD detection system is to accurately detect whether an input x is OOD.
[0033] Failures of existing generative modeling approaches
[0034] Some existing approaches involve using the predictions of (an ensemble of) discriminative classifiers trained on in-distribution data to compute statistics, for example, taking the confidence or entropy of the predicted distribution p(y|x).
[0035] An alternative is to use methods based on generative models, which are attractive because they do not require labeled data and directly model the input distribution. These methods fit a generative model p(x) to the input data and then evaluate the likelihood of new inputs under the model (i.e., extract the likelihood of new inputs from p(x)). However, recent work has highlighted significant problems with this approach for OOD detection on images, showing that deep generative models such as Glow and PixelCNN sometimes assign a higher likelihood to OOD than in-distribution inputs.
[0036] Similarly, example experiments included in U.S. Provisional Patent Application No. 62 / 857,774 and Jie Ren et al., “Likelihood Ratios for Out-of-distribution Detection,” arXiv:1906.02845, demonstrate that density estimation-based methods exhibit similar failures for OOD detection in genomics. In particular, these example experiments show that the log-likelihood under the model is severely affected by the GC content of the sequence. GC content is defined as the percentage of bases that are G or C and is widely used in genomic studies as a basic statistic for describing overall genome composition, and studies have shown that bacteria have a striking diversity in genomic GC content, ranging from 16.5% to 75%.
[0037] Bacteria from similar groups tend to have similar GC contents at the population level, but they also have characteristic biological patterns that can well distinguish them from each other. The confounding effect of GC content makes likelihood less reliable as a score for OOD detection, because an OOD input can produce a higher likelihood than an in-distribution input simply because it has a high GC content, not necessarily because it contains characteristic patterns specific to the in-distribution bacterial class.
[0038] Therefore, more generally, one can argue that the failure of existing generative model approaches is due to the inability of generative models to learn to distinguish between background content in new inputs to be analyzed and semantic content included in in-distribution examples.
[0039] Example likelihood ratio for OOD detection
[0040] This section first provides a high-level conceptual overview and then describes an example of how to adapt it to deep generative models.
[0041] Example High-Level Concepts Overview
[0042] Assume that the input x consists of two components: (1) a background component characterized by population-level background statistics, and (2) a semantic component characterized by patterns specific to the data within the distribution. For example, images can be modeled as background plus objects; text can be considered as a combination of high-frequency nonsense words plus semantic words; genomes can be modeled as background sequences plus motifs; and / or data from other modalities can be bifurcated into semantic content and background content.
[0043] More formally, for a D-dimensional input x=x1,...,x D , aspects of the present disclosure assume the existence of unobserved variables z=z1,...,z D , where z d ∈{B, S} indicates the input x dThe dth dimension of is generated from the background component or the semantic component. Grouping the semantic part and the background part can factorize the input into x = {x B , x S}, where x B ={x d |z d =B, d=1, ..., D}. For simplicity, we assume that the background and semantic components are generated independently. The likelihood can then be decomposed as follows,
[0044] p(x)=p(x B )p(x S ). (1)
[0045] Existing methods for training and evaluating deep generative models do not distinguish between these two terms in terms of likelihood. However, the present disclosure recognizes that it may be preferable to use only the semantic likelihood p(x S ) to avoid the likelihood term being dominated by the background term (e.g., so that the likelihood is similar if the input is an OOD input with the same background component but different semantic components). In practice, only x is observed, and the input is split into background and semantic parts {x B , x S}It's not always easy.
[0046] Therefore, as a practical alternative, this disclosure proposes to train a background model by perturbing the input. Adding a moderate amount of perturbation to the input can destroy the semantic structure in the data, so the model trained on the perturbed input only captures the population-level background statistics.
[0047] More specifically, assuming that p θ (·) is a model trained using in-distribution data, and is a background model that captures general background statistics. The present disclosure provides a likelihood ratio statistic defined as follows:
[0048]
[0049] Here, the factorization from Equation 1 is used.
[0050] Assume that the two models in (i) capture the background information equally well, i.e. and (ii) p θ (x S )Compare More peaks (e.g., larger and more frequent likelihoods) are predicted because the former is trained on data containing semantic information, whereas the latter model θ0 is trained using data with noise perturbations. The likelihood ratio can then be approximated as
[0051]
[0052] Therefore, by taking this ratio, the background component x B The likelihood of is canceled out, and only the semantic component x remains S Therefore, the proposed method produces a background contrast score that captures the importance of semantics compared to the background model.
[0053] Example Application of Likelihood Ratios to Autoregressive Models
[0054] Autoregressive models are a popular choice for generating image and sequence data such as genomics, drug molecules, audio, and text. In an autoregressive model, the log-likelihood of the input can be expressed as where x <d =x1...x d-1 Decomposing the log-likelihood into background and semantic parts, we have
[0055]
[0056] A similar autoregressive decomposition can also be used for background models Assuming that both models capture the background information equally well,
[0057]
[0058] The likelihood ratio is approximated as
[0059]
[0060] Any number of different techniques can be performed to perturb the in-distribution training examples to corrupt their semantic data, thereby generating background training examples.
[0061] As an example technique, noise can be added to the training examples to perturb them. As a specific example, if the training examples are discrete (e.g., ) (e.g., for genomic sequences For images For text content = a dictionary of words, graphemes, phonemes, and / or n-grams for audio content = set of possible amplitudes and / or frequencies, etc.), noise can be added by doing the following:
[0062]
[0063] Thus, as an example technique, in an embodiment where the training examples include sequences of DNA characters, the computing system can randomly select x1...x by following independent and identical Bernoulli distributions with rate μ. DThe procedure adds perturbations to the input data by replacing the original character with one of the other characters with equal probability. The inspiration for this procedure comes from genetic mutation.
[0064] The rate μ is a hyperparameter and can be easily tuned using a small amount of validation OOD dataset (e.g., different from the actual OOD dataset of interest). In cases where a validation OOD dataset is not available, μ can also be tuned using simulated OOD data. In practice, μ∈[0.1, 0.2] has been shown to achieve good performance empirically.
[0065] As another example technique, semantic content contained in an input (e.g., an input image) can be explicitly identified (e.g., using a semantic segmentation model) and corrupted (e.g., removed from the image and replaced with noise or simply cropped out).
[0066] In addition to or in lieu of perturbations to the input data, other techniques can also improve model generalization and prevent model memorization. As an example, adding L2 regularization with a coefficient of λ to the model weights can help train a good background model. In fact, adding noise to the input is equivalent to adding L2 regularization to the model weights under some conditions. As another example, performing early stopping of the training of the background model (e.g., in the absence of perturbations and / or additional regularization terms) can produce a background model that effectively cancels out background statistics. In addition to the above methods, adding other types of noise or regularization methods can also show similar effects.
[0067] Example devices and systems
[0068] Figure 1A A block diagram of an example computing system 100 that performs OOD detection according to an example embodiment of the present disclosure is depicted. The system 100 includes a user computing device 102, a server computing system 130, and a training computing system 150 communicatively coupled via a network 180.
[0069] The user computing device 102 can be any type of computing device, such as, for example, a personal computing device (e.g., a laptop or desktop computer), a mobile computing device (e.g., a smartphone or tablet), a gaming console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.
[0070] The user computing device 102 includes one or more processors 112 and memory 114. The one or more processors 112 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be a single processor or a plurality of processors operatively connected. The memory 114 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 114 can store data 116 and instructions 118 that are executed by the processor 112 to cause the user computing device 102 to perform operations.
[0071] In some implementations, the user computing device 102 can store or include one or more machine learning models 120. For example, the machine learning model 120 can be or otherwise include various machine learning models such as neural networks (e.g., deep neural networks) or other types of machine learning models, including nonlinear models and / or linear models. The neural network can include a feedforward neural network, a recurrent neural network (e.g., a long short-term memory recurrent neural network), a convolutional neural network, or other forms of neural networks.
[0072] In some embodiments, one or more machine learning models 120 can be received from the server computing system 130 via the network 180, stored in the user computing device memory 114, and then used or otherwise implemented by the one or more processors 112. In some embodiments, the user computing device 102 can implement multiple parallel instances of a single machine learning model 120 (e.g., to perform OOD detection in parallel across multiple instances of a data input). In some embodiments, the processor 112 can implement instructions 118 to determine a likelihood ratio value for the data input based on the output from the model(s) 120 and detect whether the data input is OOD based on the likelihood ratio value.
[0073] Additionally or alternatively, one or more machine learning models 140 can be included in or otherwise stored and implemented by a server computing system 130 that communicates with the user computing device 102 according to a client-server relationship. For example, the machine learning models 140 can be implemented by the server computing system 140 as part of a web service (e.g., an OOD detection service). Thus, one or more models 120 can be stored and implemented at the user computing device 102 and / or one or more models 140 can be stored and implemented at the server computing system 130.
[0074] The user computing device 102 can also include one or more user input components 122 for receiving user input. For example, the user input component 122 can be a touch-sensitive component (e.g., a touch-sensitive display or touchpad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component can be used to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user can provide user input.
[0075] The server computing system 130 includes one or more processors 132 and memory 134. The one or more processors 132 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be a single processor or a plurality of processors operatively connected. The memory 134 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 134 can store data 136 and instructions 138 that are executed by the processor 132 to cause the server computing system 130 to perform operations.
[0076] In some embodiments, server computing system 130 includes or is otherwise implemented by one or more server computing devices. In instances where server computing system 130 includes multiple server computing devices, such server computing devices can operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.
[0077] As described above, the server computing system 130 can store or otherwise include one or more machine learning models 140. For example, the model 140 can be or otherwise include various machine learning models. Example machine learning models include neural networks or other multi-layer nonlinear models. Example neural networks include feedforward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks.
[0078] In some implementations, processor 132 can implement instructions 138 to determine a likelihood ratio value for the data input based on outputs from model(s) 140 and detect whether the data input is OOD based on the likelihood ratio value.
[0079] User computing device 102 and / or server computing system 130 can train models 120 and / or 140 via interaction with training computing system 150 communicatively coupled via network 180. Training computing system 150 can be separate from server computing system 130 or can be part of server computing system 130.
[0080] The training computing system 150 includes one or more processors 152 and memory 154. The one or more processors 152 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be a single processor or a plurality of processors operatively connected. The memory 154 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 154 can store data 156 and instructions 158 that are executed by the processor 152 to cause the training computing system 150 to perform operations. In some embodiments, the training computing system 150 includes one or more server computing devices or is otherwise implemented by one or more server computing devices.
[0081] The training computing system 150 can include a model trainer 160 that trains the machine learning models 120 and / or 140 stored at the user computing device 102 and / or the server computing system 130 using various training or learning techniques, such as, for example, backpropagation of errors. In some embodiments, performing backpropagation of errors can include performing truncated backpropagation over time. The model trainer 160 can perform a number of generalization techniques (e.g., weight decay, dropout, etc.) to improve the generalization ability of the trained model.
[0082] In particular, model trainer 160 can train machine learning models 120 and / or 140 based on a set of training data 162. Training data 162 can include, for example, image data, text data, audio data, genomic data, sensor data, etc.
[0083] In some implementations, model trainer 160 can perform some or all of the data perturbation techniques described herein.
[0084] In some implementations, if the user has provided consent, training examples can be provided by the user computing device 102. Thus, in such implementations, the model 120 provided to the user computing device 102 can be trained by the training computing system 150 on user-specific data received from the user computing device 102. In some instances, this process can be referred to as personalizing the model.
[0085] The model trainer 160 includes computer logic that is utilized to provide the desired functionality. The model trainer 160 can be implemented in hardware, firmware, and / or software that controls a general-purpose processor. For example, in some embodiments, the model trainer 160 includes a program file stored on a storage device, loaded into memory, and executed by one or more processors. In other embodiments, the model trainer 160 includes one or more sets of computer-executable instructions stored in a tangible computer-readable storage medium such as a RAM hard disk or optical or magnetic media.
[0086] The network 180 can be any type of communication network, such as a local area network (e.g., an intranet), a wide area network (e.g., the Internet), or some combination thereof and can include any number of wired or wireless links. In general, communications on the network 180 can be carried via any type of wired and / or wireless connection using a wide variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and / or protection schemes (e.g., VPN, secure HTTP, SSL).
[0087] Figure 1A The diagram illustrates an example computing system that can be used to implement the present disclosure. Other computing systems can also be used. For example, in some embodiments, the user computing device 102 can include a model trainer 160 and a training data set 162. In such embodiments, the model 120 can be both trained and used locally at the user computing device 102. In some of such embodiments, the user computing device 102 can implement the model trainer 160 to personalize the model 120 based on user-specific data.
[0088] Figure 1B Depicted is a block diagram of an example computing device 10 performing in accordance with an example embodiment of the present disclosure. Computing device 10 may be a user computing device or a server computing device.
[0089] Computing device 10 includes a number of applications (e.g., applications 1 through N). Each application contains its own machine learning library and (multiple) machine learning models. For example, each application can contain a machine learning model. Example applications include text messaging applications, email applications, dictation applications, virtual keyboard applications, browser applications, and the like.
[0090] like Figure 1B As illustrated, each application can communicate with many other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and / or additional components. In some embodiments, each application can use an API (e.g., a public API) to communicate with each device component. In some embodiments, the API used by each application is specific to that application.
[0091] Figure 1C 1 is a block diagram depicting an example computing device 50 performing in accordance with an example embodiment of the present disclosure. The computing device 50 may be a user computing device or a server computing device.
[0092] The computing device 50 includes a number of applications (e.g., applications 1 through N). Each application communicates with a central intelligence layer. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, and the like. In some embodiments, each application is capable of communicating with the central intelligence layer (and the model(s) stored therein) using an API (e.g., a common API across all applications).
[0093] The central intelligence layer includes many machine learning models. For example, Figure 1C As illustrated, each application can be provided with a corresponding machine learning model (e.g., a model) and managed by a central intelligence layer. In other embodiments, two or more applications can share a single machine learning model. For example, in some embodiments, the central intelligence layer can provide a single model (e.g., a single model) for all applications. In some embodiments, the central intelligence layer is included in the operating system of the computing device 50 or is otherwise implemented by the operating system of the computing device 50.
[0094] The central intelligence layer can communicate with the central device data layer. The central device data layer can be a centralized repository for data of the computing devices 50. Figure 1C As illustrated, the central device data layer can communicate with many other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and / or additional components. In some embodiments, the central device data layer can communicate with each device component using an API (e.g., a dedicated API).
[0095] Example model layout
[0096] Figure 2 A block diagram of an OOD detection system 200 is depicted according to an example embodiment of the present disclosure. The detection system can include a semantic model 202 and a context model 203.
[0097] The semantic model 202 may have been trained on an in-distribution training dataset comprising a plurality of in-distribution training examples. The semantic model 202 can be configured to receive and process a data input 204 to generate a first likelihood value 206 for the data input 204.
[0098] Background model 203 may have been trained on a background training dataset comprising a plurality of background training examples. In some embodiments, one or more of the plurality of background training examples may have been generated by perturbation of one or more of the plurality of in-distribution training examples. Background model 203 can be configured to receive and process data input 204 to generate a second likelihood value 208 for data input 204.
[0099] In some embodiments, one or both of the semantic model 202 and the background model 203 may be generative models. In some embodiments, one or both of the semantic model 202 and the background model 203 may be autoregressive models. In some embodiments, one or both of the semantic model 202 and the background model 203 may be neural networks such as recurrent neural networks and / or convolutional neural networks.
[0100] OOD detection system 200 (e.g., as implemented by one or more computing devices) can determine a likelihood ratio value 210 for data input 204 based at least in part on first likelihood value 206 generated by semantic model 202 and second likelihood value 208 generated by context model 203. System 200 can generate an OOD prediction 212 indicating whether data input 204 is an out-of-distribution input based at least in part on likelihood ratio value 210.
[0101] In some implementations, determining a likelihood ratio value 210 for data input 204 can include determining the logarithm of first likelihood value 206 divided by second likelihood value 208. In some implementations, generating a prediction 212 based at least in part on likelihood ratio value 210 can include comparing the likelihood ratio value to a threshold and predicting that data input 204 is OOD when likelihood ratio value 210 is less than the threshold. The threshold can be a hyperparameter specified by the user or learned by the system.
[0102] In some implementations, when the data input 204 is predicted to be not OOD, the system 200 can provide the data input 204 to one or more additional analysis components 214, such as, for example, a machine learning classifier model for classification with respect to multiple in-distribution classes.
[0103] Example Method
[0104] Figure 3 Depicted is a flowchart of an example method performed in accordance with an example embodiment of the present disclosure. Figure 3 The steps of method 300 are described as being performed in a particular order for purposes of illustration and discussion, but the method of the present disclosure is not limited to the particular illustrated order or arrangement. Various steps of method 300 may be omitted, rearranged, combined, and / or adapted in various ways without departing from the scope of the present disclosure.
[0105] At 302, a computing system can obtain an in-distribution training dataset comprising a plurality of in-distribution training examples. As examples, the in-distribution training examples can be images, genomic data, audio data, text data, sensor data, and / or the like.
[0106] At 304 , the computing system can train a machine learning generated semantic model using the in-distribution training dataset.
[0107] At 306 , the computing system can perturb one or more in-distribution training examples of the plurality of in-distribution training examples to generate one or more background training examples.
[0108] In some implementations, perturbation of one or more in-distribution training examples used to generate one or more background training examples can include adding noise to the one or more in-distribution training examples.
[0109] In some embodiments, each of the plurality of in-distribution training examples can include semantic content related to at least one in-distribution class among a plurality of in-distribution classes associated with the in-distribution training dataset; and perturbing the one or more in-distribution training examples to generate one or more background training examples can include destroying the semantic content included in the one or more in-distribution training examples.
[0110] In some embodiments, each of the one or more in-distribution training examples can include a corresponding genomic sequence of a DNA character, and perturbing the one or more in-distribution training examples to generate one or more background training examples can include randomly mutating one or more characters of each corresponding genomic sequence of DNA characters to one or more alternative DNA characters.
[0111] In some embodiments, each of the one or more in-distribution training examples includes a corresponding image comprising a plurality of pixels, and perturbing the one or more in-distribution training examples to generate one or more background training examples can include, for each corresponding image, randomly changing a corresponding pixel value of one or more pixels in the plurality of pixels.
[0112] At 308 , the computing system can train a machine learning generated context model using a context training dataset comprising one or more context training examples.
[0113] In some implementations, the machine-learned semantic model can be trained at 304 using a first loss function, and the machine-learned context model can be trained at 308 using a second loss function that is equal to the first loss function plus an additional L2 regularization term.
[0114] In some implementations, the machine-learned semantic model can be trained for a first number of training iterations at 304, and the machine-learned context model can be trained for a second number of iterations less than the first number of iterations at 308. For example, the second number of iterations can be less than 50%, 60%, 70%, 80%, or 90% of the first number of training iterations.
[0115] Additional Disclosure
[0116] The technology discussed herein refers to servers, databases, software applications, and other computer-based systems, as well as the actions taken and the information sent to and from such systems. The inherent flexibility of computer-based systems allows for various possible configurations, combinations, and divisions of tasks and functionality to be implemented between and among components. For example, the processes discussed herein can be implemented using a single device or component or multiple devices or components that work in combination. Databases and applications can be implemented on a single system or distributed across multiple systems. Distributed components can operate sequentially or in parallel.
[0117] Although the present subject matter has been described in detail with respect to various specific example embodiments of the present subject matter, each example is provided by way of illustration and not limitation of the present disclosure. Those skilled in the art, after obtaining an understanding of the foregoing, can easily produce variations, changes, and equivalents of such embodiments. Therefore, the present subject matter disclosure does not exclude such modifications, changes, and / or additions to the present subject matter as would be readily apparent to those of ordinary skill in the art. For example, a feature illustrated or described as part of one embodiment can be used together with another embodiment to produce yet another embodiment. Therefore, the present disclosure is intended to encompass such variations, changes, and equivalents.
Claims
1. A computing system for performing out-of-distribution detection, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media collectively storing: a machine-learned generative semantic model trained on an in-distribution training dataset comprising a plurality of in-distribution training examples that are samples of a distribution, the machine-learned generative semantic model configured to receive and process a data input to generate a first likelihood value for the data input, the first likelihood value being a first indication of a likelihood that the data input is a sample from the distribution; a machine-learned generated background model trained on a background training dataset comprising a plurality of background training examples, one or more of the plurality of background training examples being generated by perturbations of one or more of the plurality of in-distribution training examples, the machine-learned generated background model being configured to receive and process the data input to generate a second likelihood value for the data input, the second likelihood value being a second indication of a likelihood that the data input is a sample from a background distribution, wherein perturbing the one or more in-distribution training examples to generate the one or more background training examples comprises adding noise to the one or more in-distribution training examples; and instructions that, when executed by the one or more processors, cause the computing system to perform operations comprising: determining a likelihood ratio value for the data input based at least in part on the first likelihood value generated by the machine-learned semantic model and the second likelihood value generated by the machine-learned context model; and A prediction is made as to whether the data input is an out-of-distribution input based at least in part on the likelihood ratio value.
2. The computing system of claim 1, wherein: Determining the likelihood ratio value for the data input includes determining a logarithm of the first likelihood value divided by the second likelihood value.
3. The computing system of claim 1 , wherein: Predicting whether the data input is an out-of-distribution input based at least in part on the likelihood ratio value includes: comparing the likelihood ratio value to a threshold; and When the likelihood ratio value is less than the threshold, it is predicted that the data input is an out-of-distribution input.
4. The computing system of claim 1, wherein: The operations further include: When the data input is predicted to be not an out-of-distribution input, the data input is provided to a machine learning classifier model for classification relative to a plurality of in-distribution classes.
5. The computing system of claim 1 , wherein: The data input comprises a genomic sequence. The computing system according to claim 1 , wherein: Each of the one or more in-distribution training examples includes a corresponding genomic sequence of a DNA character, and perturbing the one or more in-distribution training examples to generate the one or more background training examples includes randomly mutating one or more characters of each corresponding genomic sequence of DNA characters to one or more alternative DNA characters.
7. The computing system of claim 1, wherein: One or both of the machine learning generated semantic model and the machine learning generated background model include a recurrent neural network.
8. The computing system of claim 1, wherein: The data input includes an image.
9. The computing system of claim 1, wherein: Each of the one or more in-distribution training examples includes a corresponding image comprising a plurality of pixels, and perturbing the one or more in-distribution training examples to generate the one or more background training examples includes, for each corresponding image, randomly changing a corresponding pixel value of one or more pixels of the plurality of pixels.
10. The computing system of claim 1 , wherein: each of the plurality of in-distribution training examples comprises semantic content related to at least one in-distribution class among a plurality of in-distribution classes associated with the in-distribution training dataset; as well as Perturbing the one or more in-distribution training examples to generate the one or more background training examples destroys the semantic content included in the one or more in-distribution training examples.
11. The computing system of claim 1 , wherein: One or both of the machine learning generated semantic model and the machine learning generated background model include convolutional neural networks.
12. The computing system of claim 1, wherein: The machine learning generated semantic model has been trained using a first loss function and the machine learning generated background model has been trained using a second loss function, which includes the first loss function with an additional L2 regularization term added.
13. The computing system according to any one of claims 1 to 12, wherein: The machine learning generated semantic model has been trained for a first number of iterations and the machine learning generated context model has been trained using a second number of iterations that is less than the first number of iterations.
14. A computer-implemented method for performing out-of-distribution detection, the method comprising: obtaining, by one or more computing devices, an in-distribution training dataset comprising a plurality of in-distribution training examples; The one or more computing devices use the distributed training dataset to train a machine learning semantic model; perturbing, by the one or more computing devices, one or more of the plurality of in-distribution training examples to generate one or more background training examples, comprising adding, by the one or more computing devices, noise to each of the one or more in-distribution training examples; training, by the one or more computing devices, a machine learning generated background model using a background training dataset comprising the one or more background training examples; Inputting data input into the machine learning generated semantic model trained on the in-distribution training dataset by the one or more computing devices; Receiving, by the one or more computing devices, a first likelihood value of the data input as an output of the machine learning generated semantic model; inputting, by the one or more computing devices, the data input into the machine-learned generated background model that has been trained on the background training dataset; receiving, by the one or more computing devices, a second likelihood value for the data input as an output of the machine-learned generated background model; determining, by the one or more computing devices, a likelihood ratio value for the data input based at least in part on the first likelihood value generated by the machine-learned semantic model and the second likelihood value generated by the machine-learned context model; as well as A prediction is made as to whether the data input is an out-of-distribution input based at least in part on the likelihood ratio value.
15. The computer-implemented method of claim 14, wherein: Determining, by the one or more computing devices, the likelihood ratio value for the data input includes determining, by the one or more computing devices, a logarithm of the first likelihood value divided by the second likelihood value.
16. The computer-implemented method of claim 14, wherein: Predicting, by the one or more computing devices, whether the data input is an out-of-distribution input based at least in part on the likelihood ratio value includes: comparing, by the one or more computing devices, the likelihood ratio value to a threshold; and When the likelihood ratio value is less than the threshold, the one or more computing devices predict that the data input is an out-of-distribution input.
17. The computer-implemented method of claim 14, further comprising: When the data input is predicted to be not an out-of-distribution input, the one or more computing devices provide the data input to a machine learning classifier model for classification relative to a plurality of in-distribution classes.
18. The computer-implemented method of claim 14, wherein: The data input comprises a genomic sequence.
19. The computer-implemented method of claim 14, wherein: Each of the one or more in-distribution training examples includes a corresponding genomic sequence of a DNA character, and perturbing the one or more in-distribution training examples of the multiple in-distribution training examples by the one or more computing devices to generate the one or more background training examples includes randomly mutating, by the computing device, one or more characters of the corresponding genomic sequence of the DNA character into a replacement DNA character for each of the one or more in-distribution training examples.
20. The computer-implemented method of claim 14, wherein: One or both of the machine learning generated semantic model and the machine learning generated background model include a recurrent neural network.
21. The computer-implemented method of claim 14, wherein: The data input includes an image.
22. The computer-implemented method of claim 14, wherein: Each of the one or more in-distribution training examples includes a corresponding image comprising a plurality of pixels, and perturbing the one or more in-distribution training examples of the plurality of in-distribution training examples to generate the one or more background training examples by the one or more computing devices includes randomly changing, by the computing device, one or more pixel values of the corresponding image to alternative values for each of the one or more in-distribution training examples.
23. The computer-implemented method of claim 14, wherein: each of the plurality of in-distribution training examples comprises respective semantic content related to at least one in-distribution class among a plurality of in-distribution classes associated with the in-distribution training dataset; as well as Perturbing, by the one or more computing devices, the one or more in-distribution training examples of the plurality of in-distribution training examples to generate the one or more background training examples includes corrupting, by the one or more computing devices, the corresponding semantic content included in each of the one or more in-distribution training examples.
24. The computer-implemented method of claim 14, wherein: One or both of the machine learning generated semantic model and the machine learning generated background model include convolutional neural networks.
25. The computer-implemented method of any one of claims 14-24, wherein: Training the machine-learned semantic model by the one or more computing devices includes training the machine-learned semantic model by the one or more computing devices using a first loss function; and Training the machine-learned generated background model by the one or more computing devices includes training the machine-learned generated background model using a second loss function by the one or more computing devices, the second loss function including the first loss function with an additional L2 regularization term added.
26. The computer-implemented method of any one of claims 14-24, wherein: Training the machine-learned semantic model by the one or more computing devices includes training the machine-learned semantic model by the one or more computing devices for a first number of training iterations; as well as Training, by the one or more computing devices, the machine-learned generated background model includes training, by the one or more computing devices, the machine-learned generated background model for a second number of training iterations that is less than the first number of training iterations.
27. The computer-implemented method of any one of claims 14-24, wherein: One or both of the machine learning generated semantic model and the machine learning generated background model include an autoregressive model.
28. One or more non-transitory computer-readable media collectively storing instructions that, when executed by one or more computing devices, cause the one or more computing devices to perform the method of any one of claims 14-27.
Citation Information
Patent Citations
Comparison method and device for secondary ion mass spectrometry analysis curves
CN109060860A
Distributed data transformation system
US10025813B1