Identifying Latent Concepts and Structures for Generalized Category Discovery

May 29, 2026 · View on GitHub

This repository provides the official implementation of the paper:

Identifying Latent Concepts and Structures for Generalized Category Discovery (ICML 2026)

This paper proposes Compositional Primitive Fields (CPF), a low-rank representation learning framework for Generalized Category Discovery. CPF acts as a plug-and-play token organizer between the visual backbone and the GCD head, rewriting noisy and entangled patch-token representations through a compact set of learnable primitives. By structuring visual features as primitive activation patterns and spatial arrangements, CPF makes known and novel categories easier to separate in open-world discovery. Below is the pipeline.

pipeline

This repository provides two versions: one integrated into the baseline (SimGCD) and a standalone CPF module.

.
├── CPF_SimGCD/   # Complete SimGCD project and CPF integration 
└── CPF/          # Standalone CPF module

Setup

# Clone the repository
git clone https://github.com/Michael-McQueen/CPF.git
cd CPF_SimGCD

# Install dependencies
conda create --name cpf
conda activate cpf
pip install -r requirements.txt

Datasets

Follow work on SimGCD to prepare the dataset.

Edit dataset paths in CPF_SimGCD/config.py before training.

Running CPF-SimGCD

Run commands from inside CPF_SimGCD/ so relative paths resolve correctly:

mkdir -p log dev_outputs

Run a provided CPF script:

bash scripts/run_cub_cpf.sh

CPF Integration Example

CPF can be used as an imported module.

For example, copy cpf_module/ into your project, then import the module:

from cpf_module import CompositionalPrimitiveField

Citation