Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Online Clustered Codebook

About

Vector Quantisation (VQ) is experiencing a comeback in machine learning, where it is increasingly used in representation learning. However, optimizing the codevectors in existing VQ-VAE is not entirely trivial. A problem is codebook collapse, where only a small subset of codevectors receive gradients useful for their optimisation, whereas a majority of them simply ``dies off'' and is never updated or used. This limits the effectiveness of VQ for learning larger codebooks in complex computer vision tasks that require high-capacity representations. In this paper, we present a simple alternative method for online codebook learning, Clustering VQ-VAE (CVQ-VAE). Our approach selects encoded features as anchors to update the ``dead'' codevectors, while optimising the codebooks which are alive via the original loss. This strategy brings unused codevectors closer in distribution to the encoded features, increasing the likelihood of being chosen and optimized. We extensively validate the generalization capability of our quantiser on various datasets, tasks (e.g. reconstruction and generation), and architectures (e.g. VQ-VAE, VQGAN, LDM). Our CVQ-VAE can be easily integrated into the existing models with just a few lines of code.

Chuanxia Zheng, Andrea Vedaldi• 2023

Related benchmarks

TaskDatasetResultRank
Image ReconstructionFFHQ (val)
PSNR26.87
66
Image ReconstructionImageNet (val)
rFID1.57
54
Image ReconstructionCIFAR-10
LPIPS0.1883
25
Image ReconstructionMNIST--
24
Image ReconstructionCUB-200
FID3.61
13
Text-to-Image SynthesisCelebA-HQ
FID13.23
13
Semantic SynthesisCelebA-HQ
FID11.04
10
Image ReconstructionCelebA-HQ
FID5.19
9
Image ReconstructionMS-COCO
FID9.94
7
Image ReconstructionTextCaps (test)
FID16.35
6
Showing 10 of 13 rows

Other info

Follow for update