MLCrack

    COMPUTER VISION · INTERVIEW QUESTION

    Compare YOLO, SSD, and Faster R-CNN for object detection.

    🟡 intermediate · Object Detection

    Hint: One-stage vs two-stage detectors. Think speed vs accuracy tradeoff.

    Answer

    Two-stage (Faster R-CNN):

    Interview reasoning

    1. Region Proposal Network generates candidate boxes
    2. Classify and refine each proposal. High accuracy, slower (~5 FPS). Best for accuracy-critical applications. One-stage (YOLO): divides image into grid, predicts bounding boxes and classes simultaneously. Real-time (~30-60 FPS), slightly lower accuracy. YOLOv8 closes the gap significantly. SSD: multi-scale feature maps for detecting objects at different sizes, real-time.

    Modern landscape: YOLOv8/YOLO-NAS for real-time, DETR (transformer-based) for end-to-end detection without NMS, SAM for segmentation.

    Choice depends on latency requirements, accuracy needs, and deployment constraints (edge vs cloud).

    One-stage and two-stage detection families trade architectural choices, assignment and deployment cost, but generation-specific implementations vary substantially. Compare accuracy at matched input resolution and full latency budgets, including preprocessing and NMS. Data geometry and hardware matter more than assuming a model family's name guarantees speed or quality.

    Worked example. For a 30 FPS service, the total frame budget is about 33 ms; a model spending 30 ms in inference leaves little room for decoding and postprocessing. Test a budget such as 3 ms decode, 22 ms inference and 8 ms postprocessing/networking under realistic load rather than treating model time as the whole service.

    Validation

    Benchmark the specific versions on small/crowded objects, memory, p95/p99 and the actual device; tune reasonable comparable recipes.

    Common pitfalls

    A desktop GPU benchmark may not transfer to an edge device. Stronger AP with a missed real-time deadline may be unusable for the application.