ChatPaper.aiChatPaper

Optimisation de l'entraînement de ViViT : Réduction du temps et de la mémoire pour la reconnaissance d'actions

Optimizing ViViT Training: Time and Memory Reduction for Action Recognition

June 7, 2023
Auteurs: Shreyank N Gowda, Anurag Arnab, Jonathan Huang
cs.AI

Résumé

Dans cet article, nous abordons les défis posés par le temps d'entraînement substantiel et la consommation de mémoire associés aux transformeurs pour la vidéo, en nous concentrant sur le modèle ViViT (Video Vision Transformer), et plus particulièrement sur la version à encodeur factorisé, que nous utilisons comme référence pour les tâches de reconnaissance d'actions. La variante à encodeur factorisé suit l'approche de fusion tardive adoptée par de nombreuses méthodes de pointe. Bien qu'elle se distingue par ses compromis favorables entre vitesse et précision parmi les différentes variantes de ViViT, son temps d'entraînement et ses besoins en mémoire considérables constituent toujours un obstacle majeur. Notre méthode vise à réduire cet obstacle et repose sur l'idée de figer le transformeur spatial pendant l'entraînement. Cela conduit à un modèle peu précis si cette opération est réalisée de manière naïve. Cependant, nous montrons qu'en (1) initialisant de manière appropriée le transformeur temporel (un module responsable du traitement des informations temporelles) et en (2) introduisant un modèle adaptateur compact reliant les représentations spatiales figées (un module qui se concentre sélectivement sur des régions de l'image d'entrée) au transformeur temporel, nous pouvons bénéficier des avantages du figement du transformeur spatial sans sacrifier la précision. À travers des expérimentations approfondies sur 6 benchmarks, nous démontrons que notre stratégie d'entraînement proposée réduit significativement les coûts d'entraînement (de ∼50 %) et la consommation de mémoire tout en maintenant ou en améliorant légèrement les performances jusqu'à 1,79 % par rapport au modèle de référence. Notre approche permet en outre d'utiliser des modèles de transformeurs d'images plus grands comme transformeur spatial et d'accéder à plus de trames avec la même consommation de mémoire.
English
In this paper, we address the challenges posed by the substantial training time and memory consumption associated with video transformers, focusing on the ViViT (Video Vision Transformer) model, in particular the Factorised Encoder version, as our baseline for action recognition tasks. The factorised encoder variant follows the late-fusion approach that is adopted by many state of the art approaches. Despite standing out for its favorable speed/accuracy tradeoffs among the different variants of ViViT, its considerable training time and memory requirements still pose a significant barrier to entry. Our method is designed to lower this barrier and is based on the idea of freezing the spatial transformer during training. This leads to a low accuracy model if naively done. But we show that by (1) appropriately initializing the temporal transformer (a module responsible for processing temporal information) (2) introducing a compact adapter model connecting frozen spatial representations ((a module that selectively focuses on regions of the input image) to the temporal transformer, we can enjoy the benefits of freezing the spatial transformer without sacrificing accuracy. Through extensive experimentation over 6 benchmarks, we demonstrate that our proposed training strategy significantly reduces training costs (by sim 50%) and memory consumption while maintaining or slightly improving performance by up to 1.79\% compared to the baseline model. Our approach additionally unlocks the capability to utilize larger image transformer models as our spatial transformer and access more frames with the same memory consumption.
PDF20December 15, 2024