LSP-DETR (Local Star Polygon DEtection TRansformer) is a lightweight, efficient, and end-to-end deep learning model for nuclei instance segmentation in histopathological images. It combines a DETR-based transformer decoder with star-convex polygon shape descriptors to enable accurate and fast segmentation without complex post-processing.
NOTE: This checkpoint was pretrained on the complete PanNuke dataset without class labels. This configuration prioritizes maximum recall, making it ideal for robust nucleus localization.
1from transformers import AutoModelForObjectDetection, AutoImageProcessor
2
3
4processor = AutoImageProcessor.from_pretrained(
5 "RationAI/LSP-DETR", trust_remote_code=True
6)
7model = AutoModelForObjectDetection.from_pretrained(
8 "RationAI/LSP-DETR", trust_remote_code=True
9)
10
11inputs = processor(img, device=device, return_tensors="pt")
12outputs = model(**inputs)
13results = processor.post_process(outputs)
14results = processor.post_process_instance(
15 results, height=img.size[1], width=img.size[0]
16)
1@misc{pekar2026lspdetr,
2 title={LSP-DETR: Efficient and Scalable Nuclei Segmentation in Whole Slide Images},
3 author={Matěj Pekár and Vít Musil and Rudolf Nenutil and Petr Holub and Tomáš Brázdil},
4 year={2026},
5 eprint={2601.03163},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2601.03163}
9}