{"url":"/method/matrix-nms","slug":"matrix-nms","name":"Matrix NMS","full_name":"Matrix Non-Maximum Suppression","full_name_withheld":false,"description_markdown":"**Matrix NMS**, or **Matrix Non-Maximum Suppression**,  performs [non-maximum suppression](https://paperswithcode.com/method/non-maximum-suppression) with parallel matrix operations in one shot. It is motivated by [Soft-NMS](https://paperswithcode.com/method/soft-nms). Soft-NMS decays the other detection scores as a monotonic decreasing function $f(iou)$ of their overlaps. By decaying the scores according to IoUs recursively, higher IoU detections will be eliminated with a minimum score threshold. However, such process is sequential like traditional Greedy NMS and can not be implemented in parallel.\r\n\r\nMatrix NMS views this process from another perspective by considering how a predicted mask $m\\_{j}$ being suppressed. For $m\\_{j}$, its decay factor is affected by: (a) The penalty of each prediction $m\\_{i}$ on $m\\_{j}$ $\\left(s\\_{i}>s\\_{j}\\right)$, where $s\\_{i}$ and $s\\_{j}$ are the confidence scores; and (b) the probability of $m\\_{i}$ being suppressed. For (a), the penalty of each prediction $m\\_{i}$ on $m\\_{j}$ could be easily computed by $f\\left(\\right.$ iou $\\left.\\_{i, j}\\right)$. For (b), the probability of $m\\_{i}$ being suppressed is not so elegant to be computed. However, the probability usually has positive correlation with the IoUs. So here we directly approximate the probability by the most overlapped prediction on $m\\_{i}$ as\r\n\r\n$$\r\nf\\left(\\text { iou. }\\_{, i}\\right)=\\min\\_{\\forall s\\_{k}>s\\_{i}} f\\left(\\text { iou }\\_{k, i}\\right)\r\n$$\r\n\r\nTo this end, the final decay factor becomes\r\n\r\n$$\r\n\\operatorname{decay}\\_{j}=\\min\\_{\\forall s\\_{i}>s\\_{j}} \\frac{f\\left(\\text { iou }\\_{i, j}\\right)}{f\\left(\\text { iou }\\_{\\cdot, i}\\right)}\r\n$$\r\n\r\nand the updated score is computed by $s\\_{j}=s\\_{j} \\cdot$ decay $\\_{j} .$ The authors consider the two most simple decremented functions, denoted as linear $f\\left(\\right.$ iou $\\left.\\_{i, j}\\right)=1-$ iou $\\_{i, j}$, and Gaussian $f\\left(\\right.$ iou $\\left.\\_{i, j}\\right)=\\exp \\left(-\\frac{i o u\\_{i, j}^{2}}{\\sigma}\\right)$.","description_state":"present","introduced_year":null,"introduced_by":{"title":"SOLOv2: Dynamic and Fast Instance Segmentation","paper":"/paper/solov2-dynamic-faster-and-stronger","first_author":"Xinlong Wang","n_authors":5,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/solov2-dynamic-faster-and-stronger"},"source":{"url":"https://arxiv.org/abs/2003.10152v3","title":"SOLOv2: Dynamic and Fast Instance Segmentation","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"Computer Vision","area_id":"computer-vision","collection":"Proposal Filtering","url":"/methods/category/proposal-filtering","pwc_aliases":[]}],"n_papers_tagged":5,"archive_num_papers":5,"papers_newest_first":[{"paper":"/paper/pp-yoloe-an-evolved-version-of-yolo","title":"PP-YOLOE: An evolved version of YOLO","date":"2022-03-30","arxiv_id":"2203.16250","n_code_links":8,"syntology":{"ran":5,"of":27,"unverified":22,"pointer_only":0}},{"paper":null,"title":"In Defense of Kalman Filtering for Polyp Tracking from Colonoscopy Videos","date":"2022-01-27","arxiv_id":"2201.11450","n_code_links":0,"syntology":null},{"paper":"/paper/pp-yolov2-a-practical-object-detector","title":"PP-YOLOv2: A Practical Object Detector","date":"2021-04-21","arxiv_id":"2104.10419","n_code_links":1,"syntology":null},{"paper":"/paper/pp-yolo-an-effective-and-efficient","title":"PP-YOLO: An Effective and Efficient Implementation of Object Detector","date":"2020-07-23","arxiv_id":"2007.12099","n_code_links":5,"syntology":null},{"paper":"/paper/solov2-dynamic-faster-and-stronger","title":"SOLOv2: Dynamic and Fast Instance Segmentation","date":"2020-03-23","arxiv_id":"2003.10152","n_code_links":18,"syntology":{"ran":15,"of":38,"unverified":23,"pointer_only":24}}],"papers_shown":5,"tasks":[{"task":"/task/object-detection","name":"Object Detection","papers":3},{"task":"/task/object","name":"Object","papers":2},{"task":"/task/real-time-object-detection","name":"Real-Time Object Detection","papers":2},{"task":"/task/object-detection-1","name":"object-detection","papers":2},{"task":"/task/2d-object-detection","name":"2D Object Detection","papers":1},{"task":"/task/dense-object-detection","name":"Dense Object Detection","papers":1},{"task":"/task/instance-segmentation","name":"Instance Segmentation","papers":1},{"task":"/task/multi-object-tracking","name":"Multi-Object Tracking","papers":1},{"task":"/task/multiple-object-tracking","name":"Multiple Object Tracking","papers":1},{"task":"/task/online-multi-object-tracking","name":"Online Multi-Object Tracking","papers":1},{"task":"/task/panoptic-segmentation","name":"Panoptic Segmentation","papers":1},{"task":"/task/real-time-semantic-segmentation","name":"Real-Time Semantic Segmentation","papers":1},{"task":"/task/real-time-instance-segmentation","name":"Real-time Instance Segmentation","papers":1},{"task":"/task/segmentation","name":"Segmentation","papers":1},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":1}],"tasks_shown":15,"n_tasks":15,"usage_by_year":[{"year":"2020","papers":2},{"year":"2021","papers":1},{"year":"2022","papers":2}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/matrix-nms"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}