Abstract
Convolutional neural networks (CNNs) have shown great success in computer vision, approaching human-level performance when trained for specific tasks via application-specific loss functions. In this paper, we propose a method for augmenting and training CNNs so that their learned features are compositional. It encourages networks to form representations that disentangle objects from their surroundings and from each other, thereby promoting better generalization. Our method is agnostic to the specific details of the underlying CNN to which it is applied and can in principle be used with any CNN. As we show in our experiments, the learned representations lead to feature activations that are more localized and improve performance over non-compositional baselines in object recognition tasks.
Introduction
Standard Convolutional Neural Networks (CNNs) are powerful but often function as "black boxes," relying on any discriminative features they can find, including irrelevant background clutter or context. For instance, a network might learn to recognize a boat primarily due to the presence of water. This lack of an explicit inductive bias for compositionality—the principle that a scene's representation should be composed of independent representations of its parts—limits their generalization in novel settings.
This paper introduces a method to "teach" CNNs compositionality by forcing them to disentangle objects from their backgrounds. By ensuring that an internal representation of an object remains consistent whether seen in a complex scene or in isolation, the network becomes more robust and interpretable.
Methodology
The proposed approach utilizes an enhanced architecture that does not alter the underlying CNN layers but modifies the training objective. During training, the system maintains $K+1$ weight-sharing copies of the CNN, where $K$ is the number of objects in the image.
As shown in the architecture diagram, one branch (the unmasked CNN) processes the full image, while the other $K$ branches (the masked CNNs) process individual objects in isolation. The "secret sauce" is the Compositional Loss ($L_c$), which penalizes discrepancies between the activations of the unmasked CNN within an object's region and the activations of the masked CNN seeing that object alone. This soft constraint can be applied to nearly any existing architecture, such as VGG or ResNet.
Experimental Results
The researchers evaluated their approach across synthetic and real-world datasets, including rendered 3D objects, MNIST variants, and a subset of MS-COCO. The results demonstrate that the compositional objective significantly improves performance and feature localization.
Key quantitative findings include:
- Synthetic Data: On the 3D-Multi dataset, the compositional CNN outperformed the best baseline by 17.1%. In simpler single-object tasks, gains reached up to 35.2%.
- Real-World Data: On MS-COCO-sub, the "COMP-FULL" model achieved a massive 25.5% improvement in mean Average Precision (mAP) over the standard baseline.
- Localization Accuracy: As indicated in the MS-COCO-sub table, the compositional model achieved a localization accuracy of 0.368, notably higher than the baseline-augmented (0.256) and standard VGG (0.330) models.
Insights and Discussion
A major side effect of this training method is that feature activations become much more tightly localized around the actual objects. By forcing the network to ignore background noise, it effectively learns to segment features internally. This leads to higher robustness when objects appear in unusual contexts (e.g., a horse in a kitchen), where standard CNN performance typically plummets.
While the method currently requires object masks during training—which are more expensive to produce than bounding boxes—it represents a significant step toward more interpretable and generalizable computer vision models. Future work may explore applying these principles to tasks like image parsing or combining them with pre-trained networks.
Summary updated