[Paper Review] End-to-End Object Detection with Adaptive Clustering Transformer
This paper introduces Adaptive Clustering Transformer (ACT) as a drop-in replacement for DETR's encoder attention to reduce computation with adaptive clustering via E2LSH, and further boosts performance with Multi-Task Knowledge Distillation (MTKD).
End-to-end Object Detection with Transformer (DETR)proposes to perform object detection with Transformer and achieve comparable performance with two-stage object detection like Faster-RCNN. However, DETR needs huge computational resources for training and inference due to the high-resolution spatial input. In this paper, a novel variant of transformer named Adaptive Clustering Transformer(ACT) has been proposed to reduce the computation cost for high-resolution input. ACT cluster the query features adaptively using Locality Sensitive Hashing (LSH) and ap-proximate the query-key interaction using the prototype-key interaction. ACT can reduce the quadratic O(N2) complexity inside self-attention into O(NK) where K is the number of prototypes in each layer. ACT can be a drop-in module replacing the original self-attention module without any training. ACT achieves a good balance between accuracy and computation cost (FLOPs). The code is available as supplementary for the ease of experiment replication and verification. Code is released at \url{https://github.com/gaopengcuhk/SMCA-DETR/}
Motivation & Objective
- Motivate reducing the high computational cost of DETR for high-resolution inputs while preserving end-to-end set prediction.
- Propose ACT to replace the encoder self-attention with adaptive clustering that lowers quadratic complexity to near-linear.
- Demonstrate that ACT is a drop-in module compatible with DETR without retraining, and explore MTKD for further accuracy gains.
- Quantify FLOPs reduction and AP trade-offs on COCO 2017 and provide ablations to guide practical usage.
Proposed method
- Use Locality Sensitive Hashing (LSH), specifically Exact Euclidean LSH (E2LSH), to cluster queries into prototypes adaptively per encoder layer.
- Compute attention only between prototypes and keys, then broadcast prototype updates to member queries, reducing complexity from O(NMDk+NMDv) to O(NLDK+CMDK+CMDV).
- Dynamically determine the number of prototypes per layer based on feature distribution through multi-round LSH (rounds L).
- Optionally apply Multi-Task Knowledge Distillation (MTKD) to align ACT and full DETR predictions, enabling seamless switching and improved accuracy.
- Provide a training objective L = L_pred + L_KD to distill box regression from ACT to DETR, enabling better convergence.
- Evaluate ACT as a drop-in for DETR with no retraining, and quantify improvements with MTKD.
Experimental results
Research questions
- RQ1Can ACT reduce the encoder's self-attention computation in DETR without retraining while preserving detection performance?
- RQ2How does adaptive clustering via LSH affect AP and FLOPs across different encoder layers and object sizes?
- RQ3Does Multi-Task Knowledge Distillation (MTKD) further close the performance gap between ACT and full DETR?
- RQ4What are the practical FLOPs, speed, and memory trade-offs of ACT vs. DETR and Faster R-CNN on COCO 2017?
Key findings
- ACT reduces DETR's FLOPs (excluding backbone) from 73.4 Gflops to 58.2 Gflops with only a 0.7% AP drop in the base setup.
- MTKD further reduces the AP gap, achieving about 0.2% AP loss relative to DETR when combined with ACT (L=32).
- ACT with L=32 attains similar AP to DETR-DC5 and outperforms Faster RCNN-DC5 in large/medium objects, while using less compute.
- ACT provides substantial inference-time and memory savings in real hardware (e.g., on GTX TITAN X, faster per-image time and lower peak memory).
- The adaptive clustering approach consistently reduces redundant attention by grouping semantically similar queries, with the prototype count decreasing in deeper encoder layers due to feature redundancy.
- Compared to K-means clustering, ACT better adapts to per-image feature distributions and encoder layers, offering better accuracy at similar FLOPs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.