In the first part, we introduced the LG AI Research’s Data Intelligence (DI) Lab study, “Diffusion-Based Semantic-Discrepant Outlier Generation for Out-of-Distribution Detection” which was presented at the NeurIPS 2023 SyntheticData4ML Workshop. In this second part, we would like to share other notable papers on outlier generation that are worth reading. As OOD (Out-of-Distribution) data cannot actually be seen, it is very important to properly define OOD for outlier generation. The papers covered in this part show how to define OOD in the text domain and image latent domain, respectively. Let’s take a closer look at each paper.
|
▶ Out-of-Distribution Detection via Synthetic Outlier Generation |
1. On the Powerfulness of Textual Outlier Exposure for Visual OOD Detection[1]
This study is notable for being the first to try textual outlier exposure to improve the performance of visual OOD detection. Existing outlier exposure relied on visual outliers in the image domain due to the nature of neural networks that handle single-modal data. However, utilizing visual auxiliary datasets without explicit knowledge of OOD can lead to large performance deviations and is time-consuming. To overcome this, the authors utilize large-language models (LLM) to generate textual outliers with 3-verbosity levels (word, description, caption) and propose a multi-modal network-based textual outlier exposure framework like CLIP.

Figure 1. Schematic diagram of textual outlier exposure[1]
The overall detection framework is shown in Figure 1. The authors use CLIP[2], a large-scale vision-language model, as the backbone model. As CLIP jointly learned to reduce the gap between modalities, the embedding of textual outliers rather than visual ones allows the detector in the image domain to be regularized. In this methodology, a CLIP encoder is frozen and a linear classifier is stacked on top of it to train a classifier that discriminates between ID samples and textual outliers, and a real image domain OOD dataset is used for evaluation, just like existing OOD detection. The Energy Score is used as the score for the testing phase.
Generating Textual Outliers in Three Types

Figure 2. How to create textual outliers by level[1]
Unlike visual outliers, textual outliers can take many forms, from single-word to verbose descriptions. Figure 2 outlines the textual outlier generation according to the three levels. Let’s take a look at the designs of each level in detail.
The first method is the word-level textual outlier. This refers to designing a textual outlier in the most intuitive way you can think of, the form of “a photo of {word}.” The closer it is to the ID data, the more informative it is, so image-based text retrieval is performed to find the word. After generating the text retrieval set of the ID dataset, by filtering only Top k to k+ δ with cosine similarity, ID class labels are explicitly removed.
The second method is the description-level textual outlier. The authors utilize GPT-3[3] among the large language models (LLM) to generate descriptions. GPT-3 prompts for the class name to obtain the description, from which the class label is excluded and used as a textual outlier.
Finally, the third method is the caption-level textual outlier. By utilizing image captioning to get captions from ID visual cues, you can get a rich representation of complex visual semantics. Since being too close to the ID sample would interfere, the captioning set was obtained via BLIP-2[4], and samples close to the ID were filtered out using Mahalanobis Distance.
The authors demonstrated that it outperforms existing advanced visual outlier exposure methods on the ImageNet-1K Benchmark. It was also explained that the caption-level textual outlier, which performed the best among the three proposed methods, allows us to obtain more diverse and richer linguistic semantics by incorporating visual elements rather than obtaining descriptions for text.

Figure 3. Performance comparison of textual outlier and visual outlier exposure[1]
Conclusion
The big advantage of textual outliers over visual outliers is not only that they can perform better at less computational cost, but also that they can be explained. It is necessary to analyze various outliers created by taking advantage of the benefits they provide. Though this paper is the first attempt to introduce textual outliers to image OOD detection, given the good performance, it is expected that more effective textual outliers can be generated if advanced through prompt engineering. It seems that the multimodal network can be expected to expand to other modalities besides text, and research is needed to overcome the limitation that the filtering method is heuristic when samples close to the ID are generated.
2. Out-of-Distribution Detection Learning with Unreliable Out-of-distribution Sources[5]
This paper addresses an important problem that is often overlooked in outlier generation-based OOD detection research, “Mistaken OOD Generation.” If the generated outlier still has the same semantics as the ID, the predictor may confuse the ID with the OOD data, resulting in a decreased detection performance.

Figure 4. (a) Mistaken OOD example, (b) performance decline depending on Mistaken OOD utilization ratio[5]
The authors note that creating reliable OOD data is difficult, and instead propose an auxiliary task of having a predictor learn to mitigate the negative effects of unreliable OOD. The authors do not view all generated data as OOD but rather divide it into auxiliary ID data and auxiliary OOD data. Based on this, they wanted to design the auxiliary task to satisfy the two conditions below.
. Distribution of the auxiliary ID part and the OOD part should be separated without overlap.
. The auxiliary OOD detection task must be transferable to the real OOD detection task.
The Auxiliary Task-Based OOD Learning (ATOL) proposed by the authors is a generation-based outlier exposure method based on GAN and has a two-stage learning scheme that satisfies and . We will explain the two stages separately in the sections found below.
Crafting the Auxiliary Task
In order to satisfy , the generated ID and OOD must be disjoint in complex data space, but this is difficult to realize, so the authors craft distribution manually in the low-dimensional latent space of the GAN generator . First, it is assumed that the latent noise distribution of latent ID data follows Mixture of Gaussian (MoG). Also, latent OOD Data is assumed to follow a uniform distribution except for the high MoG density region. However, even if it is disjoint on latent, there is no guarantee that it will be disjoint when turned to input space with the generator. So, the authors propose the following generator regularization loss for distance preservation.

This loss increases the correlation between the latent space and data space distances, thereby regularizing them, and ensuring that samples with close distances in latent space also have close distances in data space.
Applying the Auxiliary Task
is saying that the distribution of auxiliary and real ID data must be aligned for the OE of auxiliary ID and OOD to be effective in real OOD detection. The authors propose to align auxiliary and real ID data using supervised contrastive learning proposed in VHL[6]. Alignment loss for auxiliary ID data is as follows

This loss serves to map the semantics of auxiliary and real ID by pulling from the same class of auxiliary and real ID and pushing those with a different class The entire algorithm for learning ATOL’s predictor, including ID alignment loss, is summarized as follows.

Figure 5. Full learning algorithm of Auxiliary Task OOD Learning (ATOL)[5]
ATOL significantly outperformed other generation-based OOD detection methods on a variety of OOD benchmarks. Additionally, when looking at embedding distribution with t-SNE in CIFAR-10, we can see that there are significantly fewer samples mapped due to overlap between the real ID and auxiliary OOD compared to the previous mistaken OOD generation. This confirms that ATOL learned from OOD whose predictors are reliable, and therefore has strong flexibility and generality.

Figure 6. ATOL’s generation-based OOD detection methodology performance comparison and T-SNE visualization[5]
Conclusion
ATOL is limited in that it has many constraints and hyperparameters that arise from the assumption of disjoint distribution in latent space by dividing the generated data into ID and OOD. However, it was impressive that they wanted to solve the problem of generating ambiguous samples such as ID as it is difficult to define the boundary between ID and OOD, which is a common problem with existing outlier generations. In addition, the alignment between latent space and image space is likely to be applied to various studies on distance-based image generation in latent space.
Discussion
Through this two-part series, we looked at the “Diffusion-Based Semantic-Discrepant Outlier Generation for Out-of-Distribution Detection” study presented by LG AI Research’s DI Lab at the NeurIPS 2023 Workshop and various outlier generation-based OOD Detection papers introduced at NeurIPS 2023. Studies on OOD Detection using Outlier Generation are expected to lead to the expansion of various modalities and the discussion on the definition of auxiliary OOD. DI Lab at LG AI Research is conducting research to expand the scope of application of the proposed method by utilizing pre-trained generative AI models, and is focused on advancing technology in the field of applied research. Since the problem of distinguishing unseen data or abnormal data from existing in-distribution data is also encountered in the real world, LG AI Research will continue to think about real world situations and continue research to solve this problem.
▶ Diffusion-based Semantic-Discrepant Outlier Generation for Out-of-Distribution Detection (Link)
▶ Want to learn more about the NeurIPS 2023 Research Blog series? (Link)
[1] Park, Sangha, et al. On the Powerfulness of Textual Outlier Exposure for Visual OoD Detection (NeurIPS 2023)
[2] Radford, Alec, et al. Learning transferable visual models from natural language supervision (ICML 2021)
[3] Brown, Tom, et al. Language models are few-shot learners (NeurIPS 2020)
[4] Li, Junnan, et al. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models (Preprint 2023)
[5] Zheng, Haotian, et al. Out-of-distribution Detection Learning with Unreliable Out-of-distribution Sources (NeurIPS 2023)
[6] Tang, Zhenheng, et al. Virtual homogeneity learning: Defending against data heterogeneity in federated learning (ICML 2022)