Object Detection for Emergency Devices

The Problem

An augmented reality startup was developing an emergency navigation application for high-rise office buildings. They needed a proof of concept demonstrating that object detection could automatically locate emergency equipment in building interior images to support AR-guided evacuation assistance. The client owned the building imagery but could not share it for model development.

Data Collection and Annotation

Since the client couldn't provide training data, I scraped approximately 1,400 training images and 287 test images from the web, pulling from office building interiors, public safety documentation, and building equipment catalogs. Manually annotated all images using RectLabel with bounding boxes for three object classes: AEDs (automated external defibrillators), fire extinguishers, and exit signs. Annotations were exported to CSV format with image filenames, class labels, and bounding box coordinates.

TFRecord Generation and Data Pipeline

Wrote a script to convert the CSV annotations into TensorFlow's TFRecord format required by the Object Detection API. The script read each annotated image, normalized bounding box coordinates to [0,1] range by dividing by image dimensions, and serialized the data into Example protos containing the encoded image, dimensions, normalized coordinates, and class labels.


def class_text_to_int(row_label):
    if row_label == 'aed':
        return 1
    elif row_label == 'fire_extinguisher':
        return 2
    elif row_label == 'exit_sign':
        return 3
    else:
        return None
							

Model Training

Used transfer learning with EfficientDet D3 pre-trained on COCO. Trained for 300,000 steps with batch size 16, momentum optimizer with cosine decay learning rate schedule starting at 0.08 with warmup from 0.001 over 2,500 steps. Data augmentation included random horizontal flips and random scale crop and pad. Input resolution was 896x896 pixels. The model used weighted smooth L1 loss for bounding box regression and weighted sigmoid focal loss for classification to handle class imbalance.

Evaluation and Results

Evaluated the model on the 287-image test set using mAP (mean Average Precision) and IoU (Intersection over Union). Since this was a proof of concept rather than a production system, evaluation focused on visual inspection of predicted bounding boxes and class labels to verify detection quality. The model successfully detected emergency devices in office building interior scenes, demonstrating technical feasibility. The client chose not to proceed with production development.

Development Environment

  • TensorFlow Object Detection API
  • EfficientDet D3
  • Python
  • Jupyter Lab
  • RectLabel
  • Pandas
  • Pillow