Un'Immagine Vale 32 Token per la Ricostruzione e la Generazione
An Image is Worth 32 Tokens for Reconstruction and Generation
June 11, 2024
Autori: Qihang Yu, Mark Weber, Xueqing Deng, Xiaohui Shen, Daniel Cremers, Liang-Chieh Chen
cs.AI
Abstract
I recenti progressi nei modelli generativi hanno evidenziato il ruolo cruciale della tokenizzazione delle immagini nella sintesi efficiente di immagini ad alta risoluzione. La tokenizzazione, che trasforma le immagini in rappresentazioni latenti, riduce le esigenze computazionali rispetto all'elaborazione diretta dei pixel e migliora l'efficacia e l'efficienza del processo di generazione. I metodi precedenti, come il VQGAN, utilizzano tipicamente griglie latenti 2D con fattori di downsampling fissi. Tuttavia, queste tokenizzazioni 2D incontrano difficoltà nel gestire le ridondanze intrinseche presenti nelle immagini, dove regioni adiacenti mostrano frequentemente somiglianze. Per superare questo problema, introduciamo il Transformer-based 1-Dimensional Tokenizer (TiTok), un approccio innovativo che tokenizza le immagini in sequenze latenti 1D. TiTok fornisce una rappresentazione latente più compatta, ottenendo rappresentazioni sostanzialmente più efficienti ed efficaci rispetto alle tecniche convenzionali. Ad esempio, un'immagine 256 x 256 x 3 può essere ridotta a soli 32 token discreti, una riduzione significativa rispetto ai 256 o 1024 token ottenuti con i metodi precedenti. Nonostante la sua natura compatta, TiTok raggiunge prestazioni competitive rispetto agli approcci all'avanguardia. Nello specifico, utilizzando lo stesso framework generativo, TiTok raggiunge un gFID di 1.97, superando significativamente il baseline di MaskGIT di 4.21 nel benchmark ImageNet 256 x 256. I vantaggi di TiTok diventano ancora più significativi quando si tratta di risoluzioni più elevate. Nel benchmark ImageNet 512 x 512, TiTok non solo supera il modello di diffusione all'avanguardia DiT-XL/2 (gFID 2.74 vs. 3.04), ma riduce anche i token delle immagini di 64 volte, portando a un processo di generazione 410 volte più veloce. La nostra variante con le migliori prestazioni supera significativamente DiT-XL/2 (gFID 2.13 vs. 3.04) generando comunque campioni di alta qualità 74 volte più velocemente.
English
Recent advancements in generative models have highlighted the crucial role of
image tokenization in the efficient synthesis of high-resolution images.
Tokenization, which transforms images into latent representations, reduces
computational demands compared to directly processing pixels and enhances the
effectiveness and efficiency of the generation process. Prior methods, such as
VQGAN, typically utilize 2D latent grids with fixed downsampling factors.
However, these 2D tokenizations face challenges in managing the inherent
redundancies present in images, where adjacent regions frequently display
similarities. To overcome this issue, we introduce Transformer-based
1-Dimensional Tokenizer (TiTok), an innovative approach that tokenizes images
into 1D latent sequences. TiTok provides a more compact latent representation,
yielding substantially more efficient and effective representations than
conventional techniques. For example, a 256 x 256 x 3 image can be reduced to
just 32 discrete tokens, a significant reduction from the 256 or 1024 tokens
obtained by prior methods. Despite its compact nature, TiTok achieves
competitive performance to state-of-the-art approaches. Specifically, using the
same generator framework, TiTok attains 1.97 gFID, outperforming MaskGIT
baseline significantly by 4.21 at ImageNet 256 x 256 benchmark. The advantages
of TiTok become even more significant when it comes to higher resolution. At
ImageNet 512 x 512 benchmark, TiTok not only outperforms state-of-the-art
diffusion model DiT-XL/2 (gFID 2.74 vs. 3.04), but also reduces the image
tokens by 64x, leading to 410x faster generation process. Our best-performing
variant can significantly surpasses DiT-XL/2 (gFID 2.13 vs. 3.04) while still
generating high-quality samples 74x faster.