Detecting Reflections by Combining Semantic and Instance Segmentation

David Owen, David Owen 0001, Ping-Lin ChangarXiv 2019

Abstract

Automated surveillance systems often struggle with "ghost" detections caused by reflections on mirrors and glass surfaces. Standard two-stage object detectors, such as Mask R-CNN, frequently fail in these scenarios because the region-of-interest cropping process discards vital global context, such as mirror frames. This paper presents a fusion approach that combines instance segmentation with semantic segmentation. By leveraging the broader receptive field of semantic models, we can effectively filter out reflection-based false positives. Our results on a gym surveillance dataset show a significant increase in precision (from 71% to 83%) with minimal impact on recall.

Introduction: The Reflection Problem in Computer Vision

In real-world environments like gyms, retail stores, or offices, mirrors and glass surfaces are ubiquitous. For automated surveillance and robotics, these surfaces create significant challenges by generating "ghost" detections—where a single person is counted twice due to their reflection. This leads to inaccuracies in occupancy counting, behavior analysis, and navigation.

The root of this problem often lies in the architecture of popular "two-stage" detectors like Mask R-CNN. These models operate in two distinct phases: first, a Region Proposal Network (RPN) identifies potential bounding boxes; second, the model "crops" these regions to classify the objects within them. The RPN is designed to be "trigger-happy" to ensure no real objects are missed. However, by the time the second stage classifies the pixels, the localized view has stripped away the "big picture" context—such as mirror frames or wall angles—that would allow the system to distinguish a real person from a reflection.

A localized crop of a person, illustrating the loss of context that leads two-stage detectors to misidentify reflections.

Methods: Fusing Instance and Semantic Segmentation

To address the loss of context, we propose a fusion approach inspired by panoptic segmentation. This method combines the object-level precision of instance segmentation with the scene-level awareness of semantic segmentation.

The Two-Branch Architecture

  1. Instance Branch: We utilize a standard Mask R-CNN to detect and segment individual people ("things"). This branch provides high-quality masks for distinct individuals but is prone to reflection-based errors due to its localized processing.
  2. Semantic Branch: We employ UPerNet with a ResNet50 backbone to perform semantic segmentation. Unlike the instance branch, this model processes the entire image at once. This preserves a larger "effective receptive field," maintaining the connection between the pixels of a person and the pixels of the surrounding environment, such as a mirror frame or a wall.

The Fusion Heuristic

Instead of a complex joint architecture, we implement a straightforward filtering heuristic. For every person detected by the instance branch, we calculate the average semantic segmentation score within that person's mask.

  • If the average semantic score is above a tunable threshold ($c$), the detection is kept as a true positive.
  • If it falls below the threshold, it is rejected as a reflection or false positive.

Crucially, this method allows the semantic results to take priority, a departure from traditional panoptic methods that typically favor instance detections.

Experimental Results and Discussion

The study utilized a real-world surveillance dataset consisting of over 22,000 images taken from gym environments. A specific subset of 527 images was manually identified as containing significant reflections where false positives could reach 100%.

Comparison of segmentation results across different stages of the proposed fusion method, showing the successful removal of reflection-based false positives.

Performance Metrics

The fusion approach demonstrated a marked improvement in precision across both pretrained and fine-tuned models:

  • Pretrained Models: When using models pretrained on COCO and ADE20K without further gym-specific training, precision jumped from 71% to 83%. The number of false positives was effectively halved, dropping from 502 to 251.
  • Fine-tuned Models: Even after fine-tuning Mask R-CNN on mirror-heavy gym data, the model still struggled with reflections, achieving 80% precision. Adding the semantic fusion step pushed this performance to 84%.
  • Recall Stability: Importantly, this filtering process did not significantly hurt the model's ability to find real people; recall remained virtually unchanged, dropping by only about 1%.

The Importance of Context

Through "ablation-style" image editing—where people were digitally cloned into different parts of a room—the researchers proved that neither texture nor geometry (size) is the deciding factor for the model. The mirror frame was identified as the vital contextual cue. When the frame was digitally removed from the images, the semantic model failed to recognize the reflection, confirming that global context is the key to solving the reflection problem.

Conclusion and Future Work

By integrating semantic global context with instance-level detection, we can significantly reduce false positives caused by reflections. This method proves more robust than simple fine-tuning of two-stage detectors, which cannot "un-see" a reflection once the evidence (the mirror frame) lies outside the initial crop.

While effective, the current method has limitations, particularly when the mirror frame is obstructed. Future work will explore moving toward a more rigorous, end-to-end unified panoptic architecture and extending the method to other glossy surfaces, such as windows in urban navigation and robotics.

Summary updated

BibTeX
@misc{owen2019detecting,
  author = {David Owen and David Owen and Ping-Lin Chang},
  title = {{Detecting Reflections by Combining Semantic and Instance Segmentation}},
  year = {2019},
  eprint = {1904.13273},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.13273},
}
Figure