


ICML 2024| Large language model helps CLIP-based out-of-distribution detection tasks
When the distributions of the training data set and the test data set are the same, machine learning models can show superior performance. However, in an open world environment, models often encounter out-of-distribution (OOD) samples. OOD samples may cause the model to behave unpredictable, and the consequences of errors may be fatal, especially in high-risk scenarios such as autonomous driving [1, 2]. Therefore, OOD detection is crucial to ensure the reliability of machine learning models in actual deployment.
Most OOD detection methods [1, 3] can effectively detect OOD samples based on well-trained In-Distribution (ID) classifiers. However, for different ID datasets, they need to retrain the classifier for OOD detection. Furthermore, these methods only rely on visual patterns and ignore the connection between visual images and text labels. With the emergence of large-scale visual language models (Vision-Manguage Models, VLMs, such as CLIP [4]), zero-shot OOD detection becomes possible [5]. By building a text classifier with only ID category labels, it is possible to detect OOD samples across different ID datasets without retraining the classifier.
Although existing CLIP-based out-of-distribution detection methods exhibit impressive performance, they often fail when encountering out-of-distribution samples that are difficult to detect. We believe that existing methods only rely on ID category labels The approach to building text classifiers largely limits CLIP's inherent ability to identify samples from the open label space. As shown in Figure 1 (a), the method of constructing a text classifier that relies only on ID category labels is difficult to distinguish OOD samples that are difficult to detect (ID dataset: CUB-200-2011, OOD dataset: Places).
Figure 1. Schematic diagram of research motivation: (a) build text classifier relying only on ID category labels, (b) use real OOD labels, (c) use LLM to imagine potential outlier exposure
In this work , we propose an out-of-distribution detection method called Envisioning Outlier Exposure (EOE), which leverages the expert knowledge and reasoning capabilities of large language models (LLMs) to imagine potential outlier exposures, thereby improving VLMs. OOD detection performance (shown in Figure 1 (c)) without accessing any actual OOD data. We design (1) LLM cues based on visual similarity to generate potential outlier class labels specifically for OOD detection, and (2) a new scoring function based on potential outlier penalties to effectively distinguish difficult-to-identify OOD samples. . Experiments show that EOE achieves superior performance in different OOD tasks and can effectively scale to the ImageNet-1K dataset.
ØPaper link: https://arxiv.org/pdf/2406.00806
ØCode link: https://github.com/tmlr-group/EOE
Next we will briefly share with you Research results on the direction of out-of-distribution detection were recently published at ICML 2024.
Preliminary knowledge
Method introduction
EOE aims to improve zero-shot OOD detection performance by leveraging LLM to generate potential outlier category labels. However, since the OOD categories encountered when the model is deployed are unknown, then, how should we guide LLM to generate the required outlier category labels? After obtaining the outlier class labels, how can we better distinguish between ID and OOD samples? To address these issues, we propose an LLM hint specifically for OOD detection designed based on the visual similarity principle, and introduce a novel scoring function to better distinguish ID/OOD samples. The overall framework of our approach is shown in Figure 2.
Figure 2. EOE overall framework diagram
Fine-grained OOD detection is also called open set identification. In Fine-grained OOD detection, both ID and OOD samples belong to the same main category (such as "bird" ” class), and there are inherent visual similarities between subclasses (e.g., “sparrow” and “swallow”). Therefore, it is more appropriate to instruct the LLM to directly provide different subcategories within the same main category.
The above three types of LLM prompts for OOD detection are shown in Figure 3
Figure 3. Three types of LLM prompts designed based on the principle of visual similarity
Figure 4. EOE pseudocode
The advantages of our method are summarized as follows:
EOE does not rely on prior knowledge of unknown OOD data, so it is particularly suitable for open world scenarios.
Zero-sample: The same pre-trained model can be effectively applied to a variety of task-specific ID datasets without the need to train each specific ID dataset separately. EOE achieves superior OOD detection performance by knowing only the ID class tags.
Scalability and versatility: Compared with existing zero-shot OOD detection methods [6] that also generate latent OOD class labels, EOE can be easily applied to large-scale datasets such as ImageNet-1K. Furthermore, EOE shows versatility in different tasks, including Far, Near and Fine-grainedOOD detection.
Experimental results
We conducted experiments on multiple data sets of different OOD tasks. Table 1 shows the experimental results of Far OOD detection on ImageNet-1K, where Ground Truth represents the performance when using real OOD labels, which is not available in actual deployment. Results show that EOE is comparable to fine-tuning methods and surpasses MCM [5].
Table 1. Far OOD experimental results
We also report experimental results on Near OOD and Fine-grained OOD tasks. As shown in Table 2 and Table 3, our methods both achieve the best detection performance.
Table 2. Near OOD experimental results
Table 3. Fine-grained OOD experimental results
We conducted ablation experiments on each model of EOE, including different scoring functions, LLM tips: different The number of LLM and potential OOD class labels of different lengths. Experiments show that the scoring function we designed and the LLM prompt designed based on the visual similarity principle achieve optimal performance, and our method achieves excellent performance on different LLMs and the number of potential OOD class labels of different lengths. At the same time, we also conducted ablation experiments on the structure of the visual language model. Please refer to the original article for detailed experimental results.
Figure 5. Ablation experiment – different scoring functions, LLM hints and different LLMs
Figure 5. Ablation experiment – the number of potential OOD class labels generated
We analyzed the effectiveness of EOE ,In fact, the generated anomaly class labels are unlikely to have a ,high probability of hitting the true OOD class. This is because the OOD data encountered in actual deployment of the model is diverse and unpredictable. However, guided by visual similarity rules, even if the real OOD class is not hit, the potential abnormal class labels generated by EOE can still improve the model's performance in OOD detection.
To illustrate the above argument, we show visualizations derived from the softmax output of label matching scores via T-SNE. The visualization results between our EOE and the comparison method MCM are shown in Figure 6. Based on the ID class labels of ImageNet-10, LLM generates potential anomaly label "submarines" based on visual similarity rules. When encountering the OOD class "steam locomotive" (a class in ImageNet-20), "steam locomotive" has the highest similarity to "submarine" in and . Therefore, EOE will cluster it as a "submarine" and thus detect it as an OOD class. However, if there are no potential outlier class labels, we can find that MCM tends to cluster all OOD class labels together. This may result in identifying difficult-to-identify OOD samples as ID classes. In summary, in our EOE framework, 1) OOD samples belonging to the same class tend to be clustered together, 2) samples from the same group are classified into the assumed outlier class ("Steam") with which they are visually similar. "Locomotive" vs "Submarine"). These observations suggest that our EOE can enhance OOD detection without touching the actual OOD category and is also semantically easier to interpret. We hope that this work can provide a new idea for future research in the field of OOD detection.
Figure 6. Visualization results
References
[1] Hendrycks, D. and Gimpel, K. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR, 2017.
[2] Yang, J., Zhou, K., Li, Y., and Liu, Z. Generalized out-of-distribution detection: A survey. arXiv preprint arXiv:2110.11334, 2021.
[3] Liu, W., Wang, X., Owens, J., and Li, Y. Energy-based out-of-distribution detection. In NeurIPS, 2020.
[4] Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
[5] Ming, Y., Cai, Z., Gu, J., Sun, Y., Li, W., and Li, Y. Delving into out-of-distribution detection with vision-language representations. In NeurIPS, 2022.
[6] Esmaeilpour, S., Liu, B., Robertson, E., and Shu, L. Zeroshot out-of-distribution detection based on the pre- trained model clip. In AAAI, 2022.
Introduction to the research group
The Trustworthy Machine Learning and Reasoning Research Group (TMLR Group) of Hong Kong Baptist University consists of a number of young professors, postdoctoral researchers, doctoral students, visiting doctoral students and It is composed of research assistants, and the research team is affiliated with the Department of Computer Science, School of Science. The research group specializes in trustworthy representation learning, trustworthy learning based on causal reasoning, trustworthy basic models and other related algorithms, theory and system design, as well as applications in natural sciences. The specific research directions and related results can be found on the group's Github (https ://github.com/tmlr-group). The research team is funded by government research funds and industrial research funds, such as the Hong Kong Research Grants Council Outstanding Young Scholars Program, National Natural Science Foundation of China general projects and youth projects, as well as scientific research funds from Microsoft, NVIDIA, Baidu, Alibaba, Tencent and other companies. Young professors and senior researchers work hand in hand, and GPU computing resources are sufficient. It has long-term recruitment of many postdoctoral researchers, doctoral students, research assistants and research interns. In addition, the group also welcomes applications from self-funded visiting postdoctoral fellows, doctoral students and research assistants for at least 3-6 months, and remote access is supported. Interested students please send your resume and preliminary research plan to the email address (bhanml@comp.hkbu.edu.hk).
The above is the detailed content of ICML 2024| Large language model helps CLIP-based out-of-distribution detection tasks. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In modern manufacturing, accurate defect detection is not only the key to ensuring product quality, but also the core of improving production efficiency. However, existing defect detection datasets often lack the accuracy and semantic richness required for practical applications, resulting in models unable to identify specific defect categories or locations. In order to solve this problem, a top research team composed of Hong Kong University of Science and Technology Guangzhou and Simou Technology innovatively developed the "DefectSpectrum" data set, which provides detailed and semantically rich large-scale annotation of industrial defects. As shown in Table 1, compared with other industrial data sets, the "DefectSpectrum" data set provides the most defect annotations (5438 defect samples) and the most detailed defect classification (125 defect categories

The open LLM community is an era when a hundred flowers bloom and compete. You can see Llama-3-70B-Instruct, QWen2-72B-Instruct, Nemotron-4-340B-Instruct, Mixtral-8x22BInstruct-v0.1 and many other excellent performers. Model. However, compared with proprietary large models represented by GPT-4-Turbo, open models still have significant gaps in many fields. In addition to general models, some open models that specialize in key areas have been developed, such as DeepSeek-Coder-V2 for programming and mathematics, and InternVL for visual-language tasks.

Editor | ScienceAI Based on limited clinical data, hundreds of medical algorithms have been approved. Scientists are debating who should test the tools and how best to do so. Devin Singh witnessed a pediatric patient in the emergency room suffer cardiac arrest while waiting for treatment for a long time, which prompted him to explore the application of AI to shorten wait times. Using triage data from SickKids emergency rooms, Singh and colleagues built a series of AI models that provide potential diagnoses and recommend tests. One study showed that these models can speed up doctor visits by 22.3%, speeding up the processing of results by nearly 3 hours per patient requiring a medical test. However, the success of artificial intelligence algorithms in research only verifies this

For AI, Mathematical Olympiad is no longer a problem. On Thursday, Google DeepMind's artificial intelligence completed a feat: using AI to solve the real question of this year's International Mathematical Olympiad IMO, and it was just one step away from winning the gold medal. The IMO competition that just ended last week had six questions involving algebra, combinatorics, geometry and number theory. The hybrid AI system proposed by Google got four questions right and scored 28 points, reaching the silver medal level. Earlier this month, UCLA tenured professor Terence Tao had just promoted the AI Mathematical Olympiad (AIMO Progress Award) with a million-dollar prize. Unexpectedly, the level of AI problem solving had improved to this level before July. Do the questions simultaneously on IMO. The most difficult thing to do correctly is IMO, which has the longest history, the largest scale, and the most negative

Editor |KX To this day, the structural detail and precision determined by crystallography, from simple metals to large membrane proteins, are unmatched by any other method. However, the biggest challenge, the so-called phase problem, remains retrieving phase information from experimentally determined amplitudes. Researchers at the University of Copenhagen in Denmark have developed a deep learning method called PhAI to solve crystal phase problems. A deep learning neural network trained using millions of artificial crystal structures and their corresponding synthetic diffraction data can generate accurate electron density maps. The study shows that this deep learning-based ab initio structural solution method can solve the phase problem at a resolution of only 2 Angstroms, which is equivalent to only 10% to 20% of the data available at atomic resolution, while traditional ab initio Calculation

Editor |ScienceAI Question Answering (QA) data set plays a vital role in promoting natural language processing (NLP) research. High-quality QA data sets can not only be used to fine-tune models, but also effectively evaluate the capabilities of large language models (LLM), especially the ability to understand and reason about scientific knowledge. Although there are currently many scientific QA data sets covering medicine, chemistry, biology and other fields, these data sets still have some shortcomings. First, the data form is relatively simple, most of which are multiple-choice questions. They are easy to evaluate, but limit the model's answer selection range and cannot fully test the model's ability to answer scientific questions. In contrast, open-ended Q&A

In 2023, almost every field of AI is evolving at an unprecedented speed. At the same time, AI is constantly pushing the technological boundaries of key tracks such as embodied intelligence and autonomous driving. Under the multi-modal trend, will the situation of Transformer as the mainstream architecture of AI large models be shaken? Why has exploring large models based on MoE (Mixed of Experts) architecture become a new trend in the industry? Can Large Vision Models (LVM) become a new breakthrough in general vision? ...From the 2023 PRO member newsletter of this site released in the past six months, we have selected 10 special interpretations that provide in-depth analysis of technological trends and industrial changes in the above fields to help you achieve your goals in the new year. be prepared. This interpretation comes from Week50 2023

Editor | Ziluo AI’s use in streamlining drug discovery is exploding. Screen billions of candidate molecules for those that may have properties needed to develop new drugs. There are so many variables to consider, from material prices to the risk of error, that weighing the costs of synthesizing the best candidate molecules is no easy task, even if scientists use AI. Here, MIT researchers developed SPARROW, a quantitative decision-making algorithm framework, to automatically identify the best molecular candidates, thereby minimizing synthesis costs while maximizing the likelihood that the candidates have the desired properties. The algorithm also determined the materials and experimental steps needed to synthesize these molecules. SPARROW takes into account the cost of synthesizing a batch of molecules at once, since multiple candidate molecules are often available
