Enhancing Few-Shot Out-of-Distribution Detection with Gradient Aligned Context Optimization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Tong, Baoshun, Song, Kaiyu, Lai, Hanjiang
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913584595861504
author Tong, Baoshun
Song, Kaiyu
Lai, Hanjiang
author_facet Tong, Baoshun
Song, Kaiyu
Lai, Hanjiang
contents Few-shot out-of-distribution (OOD) detection aims to detect OOD images from unseen classes with only a few labeled in-distribution (ID) images. To detect OOD images and classify ID samples, prior methods have been proposed by regarding the background regions of ID samples as the OOD knowledge and performing OOD regularization and ID classification optimization. However, the gradient conflict still exists between ID classification optimization and OOD regularization caused by biased recognition. To address this issue, we present Gradient Aligned Context Optimization (GaCoOp) to mitigate this gradient conflict. Specifically, we decompose the optimization gradient to identify the scenario when the conflict occurs. Then we alleviate the conflict in inner ID samples and optimize the prompts via leveraging gradient projection. Extensive experiments over the large-scale ImageNet OOD detection benchmark demonstrate that our GaCoOp can effectively mitigate the conflict and achieve great performance. Code will be available at https://github.com/BaoshunWq/ood-GaCoOp.
format Preprint
id arxiv_https___arxiv_org_abs_2411_15736
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Enhancing Few-Shot Out-of-Distribution Detection with Gradient Aligned Context Optimization
Tong, Baoshun
Song, Kaiyu
Lai, Hanjiang
Computer Vision and Pattern Recognition
Few-shot out-of-distribution (OOD) detection aims to detect OOD images from unseen classes with only a few labeled in-distribution (ID) images. To detect OOD images and classify ID samples, prior methods have been proposed by regarding the background regions of ID samples as the OOD knowledge and performing OOD regularization and ID classification optimization. However, the gradient conflict still exists between ID classification optimization and OOD regularization caused by biased recognition. To address this issue, we present Gradient Aligned Context Optimization (GaCoOp) to mitigate this gradient conflict. Specifically, we decompose the optimization gradient to identify the scenario when the conflict occurs. Then we alleviate the conflict in inner ID samples and optimize the prompts via leveraging gradient projection. Extensive experiments over the large-scale ImageNet OOD detection benchmark demonstrate that our GaCoOp can effectively mitigate the conflict and achieve great performance. Code will be available at https://github.com/BaoshunWq/ood-GaCoOp.
title Enhancing Few-Shot Out-of-Distribution Detection with Gradient Aligned Context Optimization
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2411.15736