← Projects Machine learning Personal project · 2026

Two polyp detectors and a statistical tie

Should a colonoscopy polyp detector start from a one-stage YOLO or a two-stage Faster R-CNN? I fine-tuned both on Kvasir-SEG under the same conditions. On accuracy they are statistically tied; the real differences are speed and how much each needs augmentation.

  • Python
  • PyTorch
  • Ultralytics YOLO11
  • torchvision
  • pycocotools
  • MLflow
0.866 vs 0.886
AP50, YOLO11n vs Faster R-CNN
8.1 vs 11.1 ms
GPU latency, batch 1
107 vs 110 of 127
Polyps found at operating point
0.071
YOLO11n mAP lost without augmentation

Architecture

  1. 01 Kvasir-SEG 1,000 frames, official split
  2. 02 Box checks boxes vs masks, pinned SHA-256
  3. 03 Resize longer side 416 px
  4. 04 Fine-tune YOLO11n + Faster R-CNN from COCO
  5. 05 COCO eval pycocotools, bootstrap CIs
  6. 06 Operating point threshold fixed on validation

The problem

A computer-aided detection system for colonoscopy draws a box around every polyp in the video so that fewer are overlooked. The dataset authors cite miss rates of 14-30% without one. The first design question for a prototype is which detector family to start from: a one-stage YOLO or a two-stage Faster R-CNN.

The constraint

Detector comparisons are easy to rig by accident: different input sizes, different training budgets, different evaluation code. So both models here get the same 780 training frames, the same input size (longer side 416 px), a similar budget of about 1.5-2 minutes on a laptop RTX 4050, and one pycocotools evaluation. The 120 official test images are never used for any training or tuning decision.

The detectors are Ultralytics YOLO11n (2.6M parameters) and torchvision’s Faster R-CNN with a MobileNetV3-Large FPN backbone (19.0M), both starting from COCO weights. Hyperparameters are each library’s standard fine-tuning settings, fixed in advance.

Before training I checked the labels. 99.0% of the 1,064 boxes match the bounding box of their segmentation mask at IoU 0.9 or better. Seven sliver boxes, 1-3 pixels wide, are annotation artefacts and were dropped by a rule fixed before training.

What I measured

  • COCO average precision with paired bootstrap confidence intervals, Holm-corrected over 11 comparisons.
  • A fixed operating point: the score threshold that maximises F1 on validation, applied unchanged to test, to count polyps found and false alarms.
  • Results by polyp size, with and without augmentation, and batch-1 latency on GPU and CPU.
  • A comparison against Jha et al. (2021), who benchmarked larger detectors on the same split.

Results

On accuracy, it’s a tie. Faster R-CNN was ahead by 0.020 AP50 and YOLO11n by 0.025 mAP@[.5:.95]. Neither difference survives correction. Their misses overlap heavily: 14 polyps were missed by both, 6 only by YOLO11n and 3 only by Faster R-CNN.

Both match larger published detectors. Jha et al. report AP50 0.82-0.91 for Faster R-CNN ResNet-50, RetinaNet, YOLOv3 and YOLOv4 at 512 x 512. The two small models here reached 0.866 and 0.886 at 416 px. The paper used a different AP interpolation, so this checks plausibility rather than ranking.

YOLO11n needs augmentation, Faster R-CNN much less. Turning augmentation off cost YOLO11n 0.071 mAP and 11 found polyps. That was the only significant comparison in the study. Faster R-CNN lost 0.021, which wasn’t significant.

YOLO11n is faster. It ran 1.4x faster on the GPU and 1.7x faster on two CPU threads, with 7x fewer parameters. Half precision didn’t speed up either model at batch 1.

What surprised me

Large polyps, not small ones, scored lowest: mAP 0.62 for polyps covering more than a quarter of the frame, against 0.64-0.70 for smaller ones, though the intervals overlap.

The error gallery explains a lot of it. All 12 of Faster R-CNN’s false positives and 16 of YOLO11n’s 18 lie on a real polyp: a box on one lobe of a large polyp, a second box on a found polyp, or one box around polyps the reference splits. A box-overlap metric counts each of these extent disagreements as both a false positive and a miss.

Limits

  • Small test set. 120 frames give intervals about 0.1 wide for mAP. Differences of a few points can’t be resolved.
  • Short training, one seed. Both augmented models kept their last epoch, so they were still improving. Run-to-run variation wasn’t measured and could be as large as the gap between detectors.
  • Two specific small models. The results describe these architectures under these recipes, not one-stage vs two-stage detection in general.
  • No polyp-free frames. Every Kvasir-SEG frame has a polyp, so the false-alarm rate on normal tissue can’t be measured.
  • Still frames from one data set. No video and no external test set, so generalisation to other centres is untested.
  • Not a medical device. This is a methodological comparison on public research data.

Contact

Want the longer version?

Happy to walk through any of this in detail — the parts that broke are usually the interesting bit.