[Paper Review] CRoFT: Robust Fine-Tuning with Concurrent Optimization for OOD Generalization and Open-Set OOD Detection
This paper proposes CRoFT, a unified fine-tuning framework for vision-language pre-trained models that concurrently enhances out-of-distribution (OOD) generalization under covariate shifts and enables open-set OOD detection for unseen classes. By minimizing the gradient magnitude of energy scores via a novel Energy Distribution Reshaping (EDR) loss, CRoFT promotes domain-consistent Hessians, leading to improved robustness and state-of-the-art performance, with up to 20% relative improvement in open-set OOD detection and consistent gains in OOD generalization across multiple benchmarks.
Recent vision-language pre-trained models (VL-PTMs) have shown remarkable success in open-vocabulary tasks. However, downstream use cases often involve further fine-tuning of VL-PTMs, which may distort their general knowledge and impair their ability to handle distribution shifts. In real-world scenarios, machine learning systems inevitably encounter both covariate shifts (e.g., changes in image styles) and semantic shifts (e.g., test-time unseen classes). This highlights the importance of enhancing out-of-distribution (OOD) generalization on covariate shifts and simultaneously detecting semantic-shifted unseen classes. Thus a critical but underexplored question arises: How to improve VL-PTMs' generalization ability to closed-set OOD data, while effectively detecting open-set unseen classes during fine-tuning? In this paper, we propose a novel objective function of OOD detection that also serves to improve OOD generalization. We show that minimizing the gradient magnitude of energy scores on training data leads to domain-consistent Hessians of classification loss, a strong indicator for OOD generalization revealed by theoretical analysis. Based on this finding, we have developed a unified fine-tuning framework that allows for concurrent optimization of both tasks. Extensive experiments have demonstrated the superiority of our method. The code is available at https://github.com/LinLLLL/CRoFT.
Motivation & Objective
- To address the critical gap in simultaneously improving OOD generalization under covariate shifts and detecting open-set unseen classes during fine-tuning of vision-language pre-trained models (VL-PTMs).
- To develop a unified objective that enhances both OOD generalization and open-set OOD detection without task-specific specialization.
- To theoretically link improved OOD generalization to domain-consistent Hessians via Hessian-based generalization bounds.
- To design a robust fine-tuning framework that maintains in-distribution performance while enhancing robustness to distribution shifts.
- To empirically validate the method across multiple few-shot settings and benchmark datasets, demonstrating superiority in both OOD generalization and open-set detection.
Proposed method
- Proposes an Energy Distribution Reshaping (EDR) loss that minimizes the gradient magnitude of energy scores on in-distribution (ID) data to encourage smoother energy landscapes.
- Theoretical analysis shows that minimizing gradient magnitude leads to domain-consistent Hessians, which bounds generalization error on closed-set OOD data.
- Introduces a Hessian-based generalization bound that connects model robustness to the curvature of the classification loss across domains.
- Develops CRoFT, a unified fine-tuning framework that jointly optimizes for OOD generalization and open-set OOD detection using the EDR loss.
- Uses generated worst-case OOD features to improve model generalization, validated through energy score distributions and feature visualization.
- Employs t-SNE to visualize feature space, showing clear separation between ID, closed-set OOD, and open-set OOD data under CRoFT.
Experimental results
Research questions
- RQ1Can a single objective function improve both OOD generalization under covariate shifts and open-set OOD detection during VL-PTM fine-tuning?
- RQ2Does minimizing the gradient magnitude of energy scores lead to domain-consistent Hessians and improved generalization performance on closed-set OOD data?
- RQ3Can the proposed EDR loss effectively reshape energy distributions to distinguish between closed-set OOD and open-set OOD data?
- RQ4How does the unified CRoFT framework compare to existing methods in terms of robustness and detection performance across few-shot settings?
- RQ5To what extent does the Hessian-based generalization bound correlate with empirical performance on OOD and open-set OOD benchmarks?
Key findings
- CRoFT achieves state-of-the-art performance in both OOD generalization and open-set OOD detection, with up to 20% relative improvement in AUROC for open-set OOD detection.
- The 32-shot CRoFT model achieves an AUROC of 76.42 on open-set OOD detection, outperforming previous SOTA methods by a significant margin.
- Energy score percentiles show that CRoFT effectively separates open-set OOD data (median energy: -8.55) from closed-set OOD (median: -11.77) and ID (median: -12.08), indicating better discrimination.
- In few-shot settings (1–16 shots), CRoFT consistently improves accuracy over SOTA methods like Tip-Adapetr-F, with an average gain of 1.5% under 1-shot and 2-shot conditions.
- The generated worst-case OOD features under CRoFT closely match the energy distribution of real closed-set OOD data, validating the quality of the OOD data augmentation.
- Visualization via t-SNE confirms that CRoFT learns more separable feature representations, with clear clustering between ID, closed-set OOD, and open-set OOD data.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.