Research Article

GCCA: Utilizing Gradient Matching for Open-set Domain Adaptation of Vision-language Models

Mingxi Jiang, Shengyong Xu*
College of Engineering, Huazhong Agricultural University, No. 1, Shizishan Street, Wuhan City, China

* Corresponding author: [email protected]

Abstract

Unsupervised Domain Adaptation (UDA) traditionally focuses on learning domain-invariant representations by aligning source and target domains, yet struggles in open-set scenarios where target domains contain unseen categories. Recent advances in vision-language models like CLIP, which leverage multimodal pre-training on large-scale image-text pairs, exhibit remarkable zero-shot generalization but still face performance degradation under significant domain shifts. In this work, we propose a gradient matching strategy to enhance CLIP's adaptability in open-set UDA. Unlike conventional prompt-based adaptation methods that independently optimize domain-specific parameters, our approach formulates domain alignment as a gradient consensus problem. Specifically, we enforce gradient direction consistency between source and target objectives to reconcile their optimization paths, while applying gradient norm penalization to prevent overfitting to domain-specific noise. This dual mechanism allows CLIP to preserve its inherent cross-modal discriminability while acquiring domain-robust features. Experiments across diverse open-set adaptation benchmarks demonstrate that our gradient matching framework substantially outperforms existing CLIP adaptation baselines, achieving state-of-the-art performance without compromising model stability.

Keywords: Unsupervised Domain Adaptation; Large multimodal models; Out-of-distribution detection
Published: July 4, 2025
DOI: 10.54254/2755-2721/2025.PO24674
Volume: ACE Vol.157
pp. 112-123
Download PDF

References

  1. P. W. Koh et al., “WILDS: a benchmark of in-the-wild distribution shifts, ” in Proceedings of the 38th International Conference on Machine Learning, PMLR, Jul. 2021, pp. 5637–5664. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.mlr.press/v139/koh21a.html
  2. “Do we really have to filter out random noise in pre-training data for language models?, ” presented at the ACL Rolling Review - February 2025, May 2025. Accessed: May 30, 2025. [Online]. Available: https: //openreview.net/forum?id=mpnPR8YQ3d
  3. T. Fang, N. Lu, G. Niu, and M. Sugiyama, “Rethinking importance weighting for deep learning under distribution shift, ” in Advances in Neural Information Processing Systems, Curran Associates, Inc., 2020, pp. 11996–12007. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.neurips.cc/paper_files/paper/2020/hash/8b9e7ab295e87570551db122a04c6f7c-Abstract.html
  4. J. Li, Z. Yu, Z. Du, L. Zhu, and H. T. Shen, “A comprehensive survey on source-free domain adaptation, ” IEEE Trans. Pattern Anal. Mach. Intell., vol. 46, no. 8, pp. 5743–5762, Aug. 2024, doi: 10.1109/TPAMI.2024.3370978.
  5. S. Ben-David, J. Blitzer, K. Crammer, and F. Pereira, “Analysis of representations for domain adaptation, ” in Advances in Neural Information Processing Systems, MIT Press, 2006. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.neurips.cc/paper/2006/hash/b1b0432ceafb0ce714426e9114852ac7-Abstract.html
  6. J. Ru, J. Tian, C. Xiao, J. Li, and H. T. Shen, “Imbalanced open set domain adaptation via moving-threshold estimation and gradual alignment, ” IEEE Trans. Multimedia, vol. 26, pp. 2504–2514, 2024, doi: 10.1109/TMM.2023.3297768.
  7. K. Wu, J. Li, L. Meng, F. Li, and K. Lu, “Online adaptive fault diagnosis with test-time domain adaptation, ” IEEE Trans. Ind. Informat., vol. 21, no. 1, pp. 107–117, Jan. 2025, doi: 10.1109/TII.2024.3438240.
  8. “Cross-domain mutual information adversarial maximization, ” Eng. Appl. Artif. Intell., vol. 110, p. 104665, Apr. 2022, doi: 10.1016/j.engappai.2022.104665.
  9. Z. Lai et al., “PADCLIP: pseudo-labeling with adaptive debiasing in CLIP for unsupervised domain adaptation, ” presented at the Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 16155–16165. Accessed: May 30, 2025. [Online]. Available: https: //openaccess.thecvf.com/content/ICCV2023/html/Lai_PADCLIP_Pseudo-labeling_with_Adaptive_Debiasing_in_CLIP_for_Unsupervised_Domain_ICCV_2023_paper.html
  10. R. Gal, O. Patashnik, H. Maron, A. H. Bermano, G. Chechik, and D. Cohen-Or, “StyleGAN-NADA: CLIP-guided domain adaptation of image generators, ” ACM Trans, Graph, vol. 41, no. 4, p. 141: 1-141: 13, Jul. 2022, doi: 10.1145/3528223.3530164.
  11. Y. Yin et al., “ATRI: mitigating multilingual audio text retrieval inconsistencies by reducing data distribution errors, ” Feb. 22, 2025, arXiv: arXiv: 2502.14627. doi: 10.48550/arXiv.2502.14627.
  12. S. Fort, J. Ren, and B. Lakshminarayanan, “Exploring the limits of out-of-distribution detection, ” in Advances in Neural Information Processing Systems, Curran Associates, Inc., 2021, pp. 7068–7081. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.neurips.cc/paper_files/paper/2021/hash/3941c4358616274ac2436eacf67fae05-Abstract.html
  13. K. Zhou, J. Yang, C. C. Loy, and Z. Liu, “Learning to prompt for vision-language models, ” Int. J. Comput. Vision, vol. 130, no. 9, pp. 2337–2348, Sep. 2022, doi: 10.1007/s11263-022-01653-1.
  14. X. Zhuang et al., “VARGPT-v1.1: Improve visual autoregressive large unified model via iterative instruction tuning and reinforcement learning, ” Apr. 03, 2025, arXiv: arXiv: 2504.02949. doi: 10.48550/arXiv.2504.02949.
  15. J. Li, D. Li, S. Savarese, and S. Hoi, “BLIP-2: bootstrapping language-image pre-training with frozen image encoders and large language models, ” in Proceedings of the 40th International Conference on Machine Learning, PMLR, Jul. 2023, pp. 19730–19742. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.mlr.press/v202/li23q.html
  16. X. Zhuang et al., “VARGPT: unified understanding and generation in a visual autoregressive multimodal large language model, ” Jan. 21, 2025, arXiv: arXiv: 2501.12327. doi: 10.48550/arXiv.2501.12327.
  17. A. Radford et al., “Learning transferable visual models from natural language supervision, ” in Proceedings of the 38th International Conference on Machine Learning, PMLR, Jul. 2021, pp. 8748–8763. Accessed: May 30, 2025. [Online]. Available: https: //proceedings.mlr.press/v139/radford21a.html
  18. “Domain adaptation via prompt learning | IEEE journals & magazine | IEEE xplore.” Accessed: May 30, 2025. [Online]. Available: https: //ieeexplore.ieee.org/abstract/document/10313995
  19. X. Zhuang, X. Cheng, and Y. Zou, “Towards explainable joint models via information theory for multiple intent detection and slot filling, ” Proc. AAAI Conf. Artif. Intell., vol. 38, no. 17, Art. no. 17, Mar. 2024, doi: 10.1609/aaai.v38i17.29953.
  20. G. Zara, S. Roy, P. Rota, and E. Ricci, “AutoLabel: CLIP-based framework for open-set video domain adaptation, ” presented at the Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023, pp. 11504–11513. Accessed: May 30, 2025. [Online]. Available: https: //openaccess.thecvf.com/content/CVPR2023/html/Zara_AutoLabel_CLIP-Based_Framework_for_Open-Set_Video_Domain_Adaptation_CVPR_2023_paper.html
  21. M. Fahes, T.-H. Vu, A. Bursuc, P. Pérez, and R. de Charette, “PODA: prompt-driven zero-shot domain adaptation, ” presented at the Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 18623–18633. Accessed: May 30, 2025. [Online]. Available: https: //openaccess.thecvf.com/content/ICCV2023/html/Fahes_PODA_Prompt-driven_Zero-shot_Domain_Adaptation_ICCV_2023_paper.html
  22. A. Miyai, Q. Yu, G. Irie, and K. Aizawa, “LoCoOp: few-shot out-of-distribution detection via prompt learning, ” Adv. Neural Inf. Process. Syst., vol. 36, pp. 76298–76310, Dec. 2023.
  23. D. Hendrycks and K. Gimpel, “A baseline for detecting misclassified and out-of-distribution examples in neural networks, ” presented at the International Conference on Learning Representations, Feb. 2017. Accessed: May 14, 2025. [Online]. Available: https: //openreview.net/forum?id=Hkg4TI9xl
  24. S. Liang, Y. Li, and R. Srikant, “Enhancing the reliability of out-of-distribution image detection in neural networks, ” Aug. 30, 2020, arXiv: arXiv: 1706.02690. doi: 10.48550/arXiv.1706.02690.
  25. D. Hendrycks, M. Mazeika, and T. Dietterich, “Deep anomaly detection with outlier exposure, ” presented at the International Conference on Learning Representations, Sep. 2018. Accessed: May 14, 2025. [Online]. Available: https: //openreview.net/forum?id=HyxCxhRcY7
  26. K. Lee, K. Lee, H. Lee, and J. Shin, “A simple unified framework for detecting out-of-distribution samples and adversarial attacks, ” in Advances in Neural Information Processing Systems, Curran Associates, Inc., 2018. Accessed: May 14, 2025. [Online]. Available: https: //proceedings.neurips.cc/paper/2018/hash/abdeb6f575ac5c6676b747bca8d09cc2-Abstract.html
  27. W. Liu, X. Wang, J. D. Owens, and Y. Li, “Energy-based out-of-distribution detection, ” Apr. 26, 2021, arXiv: arXiv: 2010.03759. doi: 10.48550/arXiv.2010.03759.
  28. Z. Lin, S. D. Roy, and Y. Li, “MOOD: multi-level out-of-distribution detection”, doi: 10.1109/CVPR46437.2021.01506.
  29. Y. Sun and Y. Li, “DICE: leveraging sparsification for out-of-distribution detection, ” in Computer Vision – ECCV 2022, vol. 13684, S. Avidan, G. Brostow, M. Cissé, G. M. Farinella, and T. Hassner, Eds., in Lecture Notes in Computer Science, vol. 13684. , Cham: Springer Nature Switzerland, 2022, pp. 691–708. doi: 10.1007/978-3-031-20053-3_40.
  30. A. Radford et al., “Learning transferable visual models from natural language supervision, ” in Proceedings of the 38th International Conference on Machine Learning, PMLR, Jul. 2021, pp. 8748–8763. Accessed: May 14, 2025. [Online]. Available: https: //proceedings.mlr.press/v139/radford21a.html
  31. J. Yang et al., “OpenOOD: Benchmarking generalized out-of-distribution detection, ” presented at the Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, Jun. 2022. Accessed: May 14, 2025. [Online]. Available: https: //openreview.net/forum?id=gT6j4_tskUt
  32. Q. Zhou, G. Pang, Y. Tian, S. He, and J. Chen, “AnomalyCLIP: object-agnostic prompt learning for zero-shot anomaly detection, ” presented at the The Twelfth International Conference on Learning Representations, Oct. 2023. Accessed: May 14, 2025. [Online]. Available: https: //openreview.net/forum?id=buC4E91xZE
  33. P. Panareda Busto and J. Gall, “Open set domain adaptation, ” presented at the Proceedings of the IEEE International Conference on Computer Vision, 2017, pp. 754–763. Accessed: May 14, 2025. [Online]. Available: https: //openaccess.thecvf.com/content_iccv_2017/html/Busto_Open_Set_Domain_ICCV_2017_paper.html
  34. K. Saito, S. Yamamoto, Y. Ushiku, and T. Harada, “Open set domain adaptation by backpropagation, ” presented at the Proceedings of the European Conference on Computer Vision (ECCV), 2018, pp. 153–168. Accessed: May 14, 2025. [Online]. Available: https: //openaccess.thecvf.com/content_ECCV_2018/html/Kuniaki_Saito_Adversarial_Open_Set_ECCV_2018_paper.html
  35. “Open set domain adaptation: theoretical bound and algorithm | IEEE journals & magazine | IEEE xplore.” Accessed: May 14, 2025. [Online]. Available: https: //ieeexplore.ieee.org/abstract/document/9186366
  36. P. Panareda Busto, A. Iqbal, and J. Gall, “Open set domain adaptation for image and action recognition, ” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 42, no. 2, pp. 413–429, Feb. 2020, doi: 10.1109/TPAMI.2018.2880750.
  37. Y. Xu and D. Klabjan, “Open set domain adaptation by extreme value theory, ” Dec. 22, 2020, arXiv: arXiv: 2101.02561. doi: 10.48550/arXiv.2101.02561.
  38. “Discovering implicit classes achieves open set domain adaptation | IEEE conference publication | IEEE xplore.” Accessed: May 14, 2025. [Online]. Available: https: //ieeexplore.ieee.org/abstract/document/9859594
  39. S.-A. Choe, A.-H. Shin, K.-H. Park, J. Choi, and G.-M. Park, “Open-set domain adaptation for semantic segmentation, ” presented at the Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024, pp. 23943–23953. Accessed: May 14, 2025. [Online]. Available: https: //openaccess.thecvf.com/content/CVPR2024/html/Choe_Open-Set_Domain_Adaptation_for_Semantic_Segmentation_CVPR_2024_paper.html
  40. A. Vaswani et al., “Attention is all you need, ” Aug. 02, 2023, arXiv: arXiv: 1706.03762. doi: 10.48550/arXiv.1706.03762.
  41. J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: pre-training of deep bidirectional transformers for language understanding, ” May 24, 2019, arXiv: arXiv: 1810.04805. doi: 10.48550/arXiv.1810.04805.
  42. F. Yu et al., “ERNIE-ViL: knowledge enhanced vision-language representations through scene graph, ” Mar. 19, 2021, arXiv: arXiv: 2006.16934. doi: 10.48550/arXiv.2006.16934.
  43. H. Luo et al., “UniVL: a unified video and language pre-training model for multimodal understanding and generation, ” Sep. 15, 2020, arXiv: arXiv: 2002.06353. doi: 10.48550/arXiv.2002.06353.
  44. A. Radford et al., “Learning transferable visual models from natural language supervision, ” Feb. 26, 2021, arXiv: arXiv: 2103.00020. doi: 10.48550/arXiv.2103.00020.
  45. A. Ramesh et al., “Zero-shot text-to-image generation, ” in Proceedings of the 38th International Conference on Machine Learning, PMLR, Jul. 2021, pp. 8821–8831. Accessed: May 14, 2025. [Online]. Available: https: //proceedings.mlr.press/v139/ramesh21a.html
  46. J. Li, D. Li, C. Xiong, and S. Hoi, “BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation, ” Feb. 15, 2022, arXiv: arXiv: 2201.12086. doi: 10.48550/arXiv.2201.12086.
  47. P. Wang et al., “OFA: unifying architectures, tasks, and modalities through a simple sequence-to-sequence learning framework, ” Jun. 01, 2022, arXiv: arXiv: 2202.03052. doi: 10.48550/arXiv.2202.03052.
  48. J. Li, D. Li, S. Savarese, and S. Hoi, “BLIP-2: bootstrapping language-image pre-training with frozen image encoders and large language models, ” Jun. 15, 2023, arXiv: arXiv: 2301.12597. doi: 10.48550/arXiv.2301.12597.