Меньше — значит больше: фокусировка внимания для эффективного DETR
Less is More: Focus Attention for Efficient DETR
July 24, 2023
Авторы: Dehua Zheng, Wenhui Dong, Hailin Hu, Xinghao Chen, Yunhe Wang
cs.AI
Аннотация
Модели, подобные DETR, значительно повысили производительность детекторов и даже превзошли классические сверточные модели. Однако в традиционной структуре энкодера все токены обрабатываются одинаково, без различия, что приводит к избыточной вычислительной нагрузке. Недавние стратегии разрежения используют подмножество информативных токенов для снижения сложности механизма внимания, сохраняя при этом производительность через разреженный энкодер. Но эти методы часто полагаются на ненадежные статистические данные модели. Более того, простое сокращение количества токенов в значительной степени ухудшает производительность детектирования, ограничивая применение таких разреженных моделей. Мы предлагаем Focus-DETR, который концентрирует внимание на более информативных токенах для достижения лучшего баланса между вычислительной эффективностью и точностью модели. В частности, мы реконструируем энкодер с двойным вниманием, включающим механизм оценки токенов, который учитывает как локализацию, так и семантическую информацию категорий объектов на основе многомасштабных карт признаков. Мы эффективно отбрасываем фоновые запросы и усиливаем семантическое взаимодействие детализированных запросов объектов на основе оценок. По сравнению с современными разреженными детекторами, подобными DETR, в тех же условиях наш Focus-DETR демонстрирует сопоставимую сложность, достигая 50.4 AP (+2.2) на COCO. Код доступен по адресам: https://github.com/huawei-noah/noah-research/tree/master/Focus-DETR и https://gitee.com/mindspore/models/tree/master/research/cv/Focus-DETR.
English
DETR-like models have significantly boosted the performance of detectors and
even outperformed classical convolutional models. However, all tokens are
treated equally without discrimination brings a redundant computational burden
in the traditional encoder structure. The recent sparsification strategies
exploit a subset of informative tokens to reduce attention complexity
maintaining performance through the sparse encoder. But these methods tend to
rely on unreliable model statistics. Moreover, simply reducing the token
population hinders the detection performance to a large extent, limiting the
application of these sparse models. We propose Focus-DETR, which focuses
attention on more informative tokens for a better trade-off between computation
efficiency and model accuracy. Specifically, we reconstruct the encoder with
dual attention, which includes a token scoring mechanism that considers both
localization and category semantic information of the objects from multi-scale
feature maps. We efficiently abandon the background queries and enhance the
semantic interaction of the fine-grained object queries based on the scores.
Compared with the state-of-the-art sparse DETR-like detectors under the same
setting, our Focus-DETR gets comparable complexity while achieving 50.4AP
(+2.2) on COCO. The code is available at
https://github.com/huawei-noah/noah-research/tree/master/Focus-DETR and
https://gitee.com/mindspore/models/tree/master/research/cv/Focus-DETR.