RetinaNet is a single-stage object detector that predicts object classes and bounding boxes in one step. Its Feature Pyramid Network combines semantically rich deep features with high-resolution early features, helping detect both small and large objects. section 12.3 section 12.4
Run a pretrained detector
Use a COCO-trained Keras Hub preset, then inspect and draw its detections: `detector <- keras_hub$models$ObjectDetector$from_preset("retinanet_resnet50_fpn_v2_coco", bounding_box_format = "rel_xywh")` `predictions <- predict(detector, list(image))` The result contains `boxes`, `confidence`, `labels`, and `num_detections`; each box can be rendered with its COCO label. section 12.3
The architecture addresses a central limitation of using only final convolutional features:
- Combines upsampled deep features with same-sized features from earlier convolutional layers through lateral connections. section 12.3
- Builds feature maps at multiple scales, improving detection across different object pixel sizes. section 12.4
- Runs classification and localization as a single-stage detector, favoring speed and efficiency over two-stage region-proposal workflows. section 12.4 section 12.1
Figure 12.8 An FPN creates semantically interesting feature maps at different scales.
Use the FPN diagram to see how feature maps at different scales retain semantic information while representing differently sized image regions. section 12.3
