Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross-Sample Relational Fusion: Unifying Domain Generalization and Class-Incremental Learning

State Key Laboratory for Novel Software Technology, Nanjing University

The code repository for "Cross-Sample Relational Fusion: Unifying Domain Generalization and Class-Incremental Learning" in PyTorch. If you use any content of this repo for your work, please cite the following bib entry:

@article{Xie26CORF,
  author       = {Zhen-Hao Xie and Yan Wang and Hao Sun and Han-Jia Ye and De-Chuan Zhan and Da-Wei Zhou},
  title        = {Cross-Sample Relational Fusion: Unifying Domain Generalization and Class-Incremental Learning},
  journal      = {{IEEE} Trans. Multim.},
  year         = {2026},
}

📢 Updates

[05/2026] Accepted to TMM 2026.

[05/2026] Code has been released.

[05/2026] arXiv paper has been released.

📝 Introduction

Class-Incremental Learning (CIL) requires a learning system to learn new classes while retaining previously learned knowledge. However, in real-world scenarios like autonomous driving, a system trained on urban roads in sunny weather may later need to operate in rural or highway environments under different traffic patterns and weather conditions. This requires the model not only to overcome catastrophic forgetting, but also to effectively handle domain shifts. In this paper, we propose CrOss-sample Relational Fusion (CORF), a unified framework to address domain shift and catastrophic forgetting simultaneously. To enhance generalizability, we perform selective refinement of training samples by leveraging spatial contribution maps to highlight semantically informative regions. Furthermore, we incorporate predictive confidence to adaptively weigh samples, thereby facilitating the learning of domain-agnostic representations. To alleviate forgetting, we propose a cascaded distillation framework that captures cross-sample relational dependencies across multiple feature hierarchies, enabling the multi-grained transfer of knowledge from previous tasks. CORF can be seamlessly integrated into existing CIL algorithms to enhance their generalizability, achieving competitive performance across various benchmark datasets.

🔧 Requirements

Environment

  1. torch 2.0.1

  2. torchvision 0.15.2

  3. tqdm

  4. numpy

  5. scipy

  6. quadprog

  7. timm 0.6.12

  8. easydict

🔎 Datasets

We have implemented the pre-processing datasets as follows:

  • OfficeHome: Official website: link or Hugging Face: link
  • PACS: Official benchmark website: link or Hugging Face: link
  • DomainNet: Official website: link or TensorFlow Datasets: link

💡 Running scripts

To prepare your JSON files, refer to the settings in the exps folder and run the following command. All main experiments from the paper are already provided in the exps folder, you can simply execute them to reproduce the results found in the logs folder.

python main.py --config ./exps/[config_name]/[dataset_name]/[increment]/[target_name].json

🎈 Acknowledgement

This repo is based on CIL_Survey and PyCIL.

💭 Correspondence

If you have any questions, please contact me via email.

About

Cross-Sample Relational Fusion: Unifying Domain Generalization and Class-Incremental Learning

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages