Introduction
Traditional instance segmentation frameworks, such as Mask R-CNN, typically require extensive supervision, often involving thousands of labeled masks per category. While effective for common objects, these models fail to generalize to novel categories without significant retraining. In contrast, humans exhibit a robust "visual search" capability, identifying new objects after seeing just a single example. This paper introduces Siamese Mask R-CNN, a framework designed for one-shot instance segmentation: the task of detecting and segmenting all instances of a novel category in a query image given only a single reference example.
Methodology: The Siamese Architecture
The core of the proposed approach is the adaptation of the standard Mask R-CNN into a Siamese configuration. This architecture employs two identical ResNet-50 backbones with shared weights to extract features from both a small reference image and a larger query scene.
To guide the network toward the target object, a feature matching operation is performed. Specifically, the model computes the absolute difference between the reference embedding and every spatial location in the query feature map. These similarity features are then concatenated back into the query representation. This "targeted" feature map is passed to the standard Mask R-CNN heads—the Region Proposal Network (RPN), the classifier, and the mask branch. By training the model to distinguish between "matching" and "non-matching" pairs rather than specific class labels, the system learns a class-agnostic similarity metric that generalizes to unseen categories.
Experimental Setup and Datasets
The model was evaluated using the MS-COCO dataset, modified to test one-shot generalization. The 80 COCO categories were partitioned into 60 training classes and 20 novel test classes across four different splits ($S_1$ to $S_4$). To ensure the backbone did not have prior exposure to test categories, it was pre-trained on a subset of ImageNet that excluded all COCO test classes.
Results and Key Insights
Siamese Mask R-CNN demonstrates a significant leap over baseline performance. On novel categories, the model achieved a mean Average Precision (mAP50) of 16.3%, compared to a random baseline of approximately 1.2%. When the number of reference images was increased to five (five-shot), performance improved further to 18.5% mAP50.
Several key insights emerged from the study:
- Segmentation vs. Detection: The model is remarkably proficient at generating accurate masks once an object is detected. The primary bottleneck remains the detection phase—correctly identifying the target object amidst clutter.
- The Impact of Clutter: Performance is inversely correlated with scene complexity. As the number of objects in the query image increases, the likelihood of false positives rises significantly.
- Training Bias: The model often exhibits a bias toward common training categories (e.g., "person"), occasionally misidentifying them as the novel target object.
Conclusion and Future Work
Siamese Mask R-CNN provides a strong foundation for one-shot instance segmentation by leveraging metric learning within a proven detection framework. While it successfully generalizes to novel categories, challenges remain in handling highly cluttered environments and reducing false positives from known classes. Future research directions include developing more sophisticated metric learning techniques and implementing background suppression mechanisms to improve robustness in complex scenes.
Summary updated