Devil is in the Queries: Advancing Mask Transformers for Real-world Medical Image Segmentation and Out-of-Distribution Localization
Mingze Yuan, Yingda Xia, Hexin Dong, Zifan Chen, Jiawen Yao, Mingyan Qiu, Ke Yan, Xiaoli Yin, Yu Shi, Xin Chen, Zaiyi Liu, Bin Dong
Abstract
Real-world medical image segmentation has tremendous long-tailed complexity of objects, among which tail conditions correlate with relatively rare diseases and are clinically significant. A trustworthy medical AI algorithm should demonstrate its effectiveness on tail conditions to avoid clinically dangerous damage in these out-ofdistribution (OOD) cases. In this paper, we adopt the concept of object queries in Mask Transformers to formulate semantic segmentation as a soft cluster assignment. The queries fit the feature-level cluster centers of inliers during training. Therefore, when performing inference on a medical image in real-world scenarios, the similarity between pixels and the queries detects and localizes OOD regions. We term this OOD localization as MaxQuery. Furthermore, the foregrounds of real-world medical images, whether OOD objects or inliers, are lesions. The difference between them is less than that between the foreground and background, possibly misleading the object queries to focus redundantly on the background. Thus, we propose a query-distribution (QD) loss to enforce clear boundaries between segmentation targets and other regions at the query level, improving the inlier segmentation and OOD indication. Our proposed framework is tested on two realworld segmentation tasks, i.e., segmentation of pancreatic and liver tumors, outperforming previous state-of-the-art algorithms by an average of 7.39% on AUROC, 14.69% on AUPR, and 13.79% on FPR95 for OOD localization. On the other hand, our framework improves the performance of inlier segmentation by an average of 5.27% DSC when compared with the leading baseline nnUNet.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers5
- ZePT: Zero-Shot Pan-Tumor Segmentation via Query-Disentangling and Self-PromptingYankai Jiang, Zhongzhen Huang, Rongzhao Zhang, Xiaofan Zhang et al.CVPR 2024
- Unleashing the Potential of Vision-Language Pre-Training for 3D Zero-Shot Lesion Segmentation via Mask-Attribute AlignmentYankai Jiang, Wenhui Lei, Xiaofan Zhang, Shaoting ZhangICLR 2025
- Interactive Medical Image Segmentation: A Benchmark Dataset and BaselineJunlong Cheng, Bin Fu, Jin Ye, Guoan Wang et al.CVPR 2025
- The Invisible Gorilla Effect in Out-of-distribution DetectionHarry Anthony, Ziyun Liang, Hermione Warr, Konstantinos KamnitsasCVPR 2026
- MaskAD: Parallel Masked Autoencoder for Multi-class Unsupervised Anomaly DetectionRuiying Lu, Gang Liu, Kang Li, Long Tian et al.AAAI 2026
Builds on16
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- SegFormer: Simple and Efficient Design for Semantic Segmentation with TransformersEnze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar et al.NeurIPS 2021 · 9,661 citations
- On the Variance of the Adaptive Learning Rate and BeyondLiyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen et al.ICLR 2020 · 2,210 citations
- Per-Pixel Classification is Not All You Need for Semantic SegmentationBowen Cheng, Alexander G. Schwing, Alexander KirillovNeurIPS 2021 · 2,196 citations
Related papers
- Semi-Supervised Convolutional Vision Transformer with Bi-Level Uncertainty Estimation for Medical Image SegmentationHuimin Huang, Yawen Huang, Shiao Xie, Lanfen Lin et al.ACM MM 2023 · 5 citations
- CMT-DeepLab: Clustering Mask Transformers for Panoptic SegmentationQihang Yu, Huiyu Wang, Dahun Kim, Siyuan Qiao et al.CVPR 2022 · 76 citations
- Prior2former - Evidential Modeling of Mask Transformers for Assumption-Free Open-World Panoptic SegmentationSebastian Schmidt, Julius Körner, Dominik Fuchsgruber, Stefano Gasperini et al.ICCV 2025 · 3 citations
- Combinatorial CNN-Transformer Learning with Manifold Constraints for Semi-supervised Medical Image SegmentationHuimin Huang, Yawen Huang, Shiao Xie, Lanfen Lin et al.AAAI 2024 · 17 citations
- CCQ: Cross-Class Query Network for Partially Labeled Organ SegmentationXuyang Liu, Bingbing Wen, Sibei YangAAAI 2023 · 10 citations
