Unsupervised Part Representation by Flow Capsules

Sara Sabour, Andrea Tagliasacchi, Soroosh Yazdani, Geoffrey E. Hinton, David J. Fleet

Capsule networks are designed to understand images as a hierarchy of parts and their spatial relationships, mirroring how human vision naturally parses the world. However, a major bottleneck in advancing capsule networks has been learning the "primary capsules"—the lowest-level atomic parts—in a purely unsupervised way.

Previous attempts, such as Stacked Capsule Autoencoders (SCAE), relied heavily on image reconstruction. By forcing the model to redraw the exact pixels of the input, these models became distracted by complex textures, lighting variations, and cluttered backgrounds, often missing the underlying geometry of the object's parts.

FlowCapsules introduces a self-supervised method that bypasses reconstruction entirely. Instead, it asks: Can we use motion to define what a "part" is? By leveraging the Gestalt principle of "common fate"—the idea that regions of an image moving together likely belong to the same object—FlowCapsules learns to decompose images into meaningful, reusable parts that are robust to background noise and occlusions.

Architecture and Methods

The FlowCapsules framework shifts the training signal from static pixel reconstruction to dynamic motion prediction (optical flow) between video frames.

Architecture of the FlowCapsules encoder and implicit mask decoder.

1. The Encoder and Implicit Mask Decoder

The process begins with an Encoder that takes a single image and outputs a set of $K$ capsules. Each capsule is defined by three components:

  • Shape Vector: A representation of what the part looks like.
  • Pose: The part's spatial location, rotation, and scale.
  • Depth Value: A scalar used to handle occlusions (which part is in front of another).

Instead of decoding these vectors into standard pixel grids, the model uses an Implicit Mask Decoder. A small multi-layer perceptron (MLP) acts as an implicit function: given a shape vector and a spatial coordinate, it predicts whether that point is "inside" or "outside" the part. This approach generates smooth, resolution-independent shapes and provides a strong inductive bias toward learning simple, closed geometric forms.

2. Flow as Supervision

The training pipeline uses two consecutive frames to predict optical flow and warp the first frame to match the second.

During training, the model observes two consecutive video frames ($I$ and $I'$). It encodes both frames independently. By comparing the change in the "pose" of each capsule between the two frames, the network calculates a predicted optical flow field.

The model is trained using a warping loss: it warps the first frame using its predicted flow field to see if it matches the second frame. If the network has correctly identified the parts and accurately tracked their movements, the warped image will closely match the target frame. This ensures the model focuses on how things move, naturally ignoring static backgrounds and textures that do not contribute to the object's structure.

Key Insights and Results

By explicitly separating shape (the canonical look of a part) from pose (its transformation in the scene), FlowCapsules can recognize the same part even under rotation or scaling. Furthermore, by assigning a depth value to each capsule and applying a softmax over these depths, the model successfully learns to "fill in" hidden portions of shapes, handling occlusion elegantly.

The model was evaluated across three datasets:

  • Geo: Synthetic geometric shapes moving on plain backgrounds.
  • Geo+: A challenging variant with natural ImageNet backgrounds and complex textures.
  • Exercise: Real-world videos of people exercising, testing articulated human motion.

Performance Highlights: * Part Segmentation: On the synthetic Geo datasets, FlowCapsules achieved an Intersection-over-Union (IoU) of 0.95 to 0.98, significantly outperforming previous methods like R-NEM and PSD. On the real-world Exercise dataset, it successfully segmented human bodies into semantically meaningful parts (head, torso, limbs) with an IoU of 0.58, nearly doubling the performance of baseline models. * Unsupervised Classification: When the learned capsule representations were used for a simple K-means clustering task on the Geo dataset, FlowCapsules achieved 99% accuracy, compared to only 59% for the reconstruction-based SCAE. This demonstrates that features learned via flow are vastly more representative of actual object categories.

Limitations and Future Work

While FlowCapsules represents a significant step forward for unsupervised part discovery, it has a few limitations. The current architecture uses conformal maps for poses, which only account for translation, rotation, and uniform scaling; it struggles with complex non-rigid deformations, such as clothing wrinkling. Additionally, while inference only requires a single image, training strictly requires video pairs.

Future work may explore extending this framework to 3D point clouds or voxels, where motion cues could help discover 3D part hierarchies, or incorporating attention-based encoders to better handle scenes with a high density of overlapping objects.

Summary updated

BibTeX
@inproceedings{sabour2021unsupervised,
  author = {Sara Sabour and Andrea Tagliasacchi and Soroosh Yazdani and Geoffrey E. Hinton and David J. Fleet},
  title = {{Unsupervised Part Representation by Flow Capsules}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
}
Figure