All Projects
Medical AIComputer Vision

Cancer Detection — YOLOv8 (n/s/m)

3-variant YOLOv8 benchmark for cancer localization. YOLOv8m: test mAP50=0.6782, Precision=0.7633, F1=0.6941. 1,968 training images. Exported ONNX (49.8 MB) + TorchScript (99.1 MB).

0.6782
YOLOv8m mAP50 (test)
0.7633
YOLOv8m Precision
0.6941
YOLOv8m F1
49.8 MB
ONNX export size
Dataset

1,968 cancer images, 1 class, ~1.1 bbox/image

Approach

3-variant YOLOv8 benchmark with ONNX + TorchScript export for deployment

Tech Stack
PythonYOLOv8 (Ultralytics)ONNXTorchScriptCUDA Tesla T4
Keywords
YOLOv8Object DetectionMedical ImagingONNXCancerUltralytics
Visualizations7 Charts
Deep Dive

YOLOv8 benchmark for cancer detection in histopathology/medical images.

Dataset

  • 1,968 train / 185 val / 94 test images — single class: cancer
  • Average 1.10 bounding boxes per image
  • Lesion size distribution: left-skewed (many small, few large)

3-Model Comparison (Test Set)

ModelmAP50mAP50-95PrecisionRecallF1
YOLOv8n (3.2M)0.6191
YOLOv8s (11.2M)0.5879
YOLOv8m (25.9M)0.67820.23050.76330.63640.6941

Validation Set (for reference) YOLOv8n val mAP50=0.6849 (slightly higher than m on val — may have overfit val distribution)

Training Config 50 epochs, auto-batch, FP16 mixed precision, mosaic augmentation, AdamW, patience=10

Deployment Exports

FormatSize
ONNX (FP16)49.8 MB
TorchScript99.1 MB

Key Finding On the test set, the larger YOLOv8m outperforms nano and small despite the small dataset. The COCO pretrained weights transfer relevant object detection priors even for medical images, and the larger capacity better captures subtle cancer features.