Self-Supervised Siamese Autoencoders

Friederike Baier, Sebastian Mair, Samuel G. FadelarXiv 2023 · DOI

TL;DR

The paper introduces SidAE (Siamese Denoising Autoencoder), a novel self-supervised learning framework that combines the complementary strengths of Siamese networks and denoising autoencoders. By balancing view-invariance with data reconstruction, SidAE learns more robust image representations and consistently outperforms standard self-supervised baselines on downstream classification tasks, particularly when labeled data is extremely scarce.

What Problem Does This Paper Address?

Fully-supervised machine learning models are notoriously data-hungry, making them expensive and difficult to deploy in domains where labeled data is scarce. Self-supervised learning (SSL) mitigates this by pre-training models on unlabeled data using a "pretext task" before fine-tuning them on a target downstream task (like image classification).

Currently, two popular families of SSL architectures dominate:

  1. Siamese Networks (e.g., SimSiam): These networks learn by ensuring that two differently augmented views of the same image yield similar latent representations. While excellent at learning global semantic invariance, they risk "representation collapse" (where the model outputs a constant vector) and can discard useful local structural details.
  2. Denoising Autoencoders (DAEs): These networks learn by taking a corrupted version of an input and trying to reconstruct the original clean version. While great at capturing detailed local structures, they often retain too much task-irrelevant noise and nuisance factors (like lighting or orientation).

The authors address this gap by asking: Can we combine these two paradigms to create a feature extractor that captures both global semantic meaning and essential structural details?

Methods

The authors propose SidAE (Siamese Denoising Autoencoder), which integrates a Siamese architecture with a reconstruction branch.

Fig. 1: Siamese networks (left) and (denoising) autoencoders (middle), compared to our proposed model SidAE (right). The left and right illustrations should be symmetric, but we show only one side of the symmetry for brevity. The middle illustration shows two views due to our experimental setting (for a fair comparison), although a vanilla denoising autoencoder usually has only one.

The pipeline operates as follows:

  • Data Augmentation: An input image $x$ is transformed into two distinct, noisy views ($x_1$ and $x_2$) using standard augmentations like color jittering, random cropping, and grayscaling.
  • Encoding: A shared encoder network (a ResNet-18 backbone paired with a 3-layer projection MLP) maps both views into a latent space, producing representations $z_1$ and $z_2$.
  • Siamese Prediction: A 2-layer predictor MLP maps the latent representations to another space to compute a similarity loss. Crucially, a stop-gradient operation is applied to one branch at a time to prevent representation collapse, following the SimSiam design.
  • Autoencoder Reconstruction: A shared decoder network (a fully-connected layer followed by five transposed convolution layers) attempts to reconstruct the original uncorrupted image $x$ from the latent codes $z_1$ and $z_2$.

The total loss function is a weighted combination of both objectives: $$L_{sidae} = wL_{dae} + (1 - w)L_{si}$$

Where $L_{si}$ is the negative cosine similarity (Siamese loss), $L_{dae}$ is the mean squared error of the reconstruction, and $w \in [0, 1]$ is a hyperparameter controlling the relative importance of each mechanism.

Datasets

The authors evaluated their approach on four standard image recognition datasets:

  • CIFAR-10: 10 classes of natural images.
  • MNIST: Handwritten digits.
  • Fashion-MNIST: Zalando's article images.
  • STL-10: Designed specifically for unsupervised learning, featuring a large set of unlabeled images alongside smaller training/testing sets.

To ensure architectural consistency, all images across these datasets were resized to a uniform resolution of $32 \times 32$ pixels. Downstream performance was evaluated under two primary scenarios: using 100% of the available labeled training data, and a much harsher setup using only 1% of the labeled data.

Key Insights and Ideas

  • A Symbiotic Relationship: The combination creates a powerful regularizer. The Siamese loss forces the encoder to discard irrelevant details (nuisance factors), while the DAE loss explicitly prevents the encoder from discarding too much information, ensuring it retains enough structural data to reconstruct the original image.
  • The Siamese Component Does the Heavy Lifting: Empirically, the model performs best when $w$ is small (e.g., $w = 0.125$ or $w = 0.25$). This indicates that while the similarity loss drives the bulk of the representation learning, the reconstruction loss acts as a vital fine-tuning mechanism.
  • Improved Training Stability: Standard Siamese networks like SimSiam can exhibit performance degradation or instability during extended pre-training (particularly visible on simpler datasets like MNIST). The inclusion of the autoencoder objective stabilizes training, making SidAE robust against varying initialization seeds and longer pre-training durations.

Key Results

SidAE consistently outperformed both the standalone SimSiam and DAE baselines across all datasets.

Downstream classification accuracy on CIFAR-10 using 1% (left) and 100% (right) of training data.
  • Extreme Data Scarcity (1% Labeled Data): On CIFAR-10, when only 1% of the labeled data was available for the downstream task, SidAE achieved a classification accuracy of 51.67%, significantly beating SimSiam (44.06%) and the DAE (40.67%).
  • Full Data Availability (100% Labeled Data): On CIFAR-10 with a frozen backbone, SidAE reached 64.75% accuracy, compared to SimSiam's 57.08% and DAE's 57.44%.
  • Transfer Learning (STL-10 to CIFAR-10): When pre-trained on the unlabeled portion of STL-10 and evaluated on CIFAR-10, SidAE achieved 66.20% accuracy, outperforming SimSiam by nearly 10 percentage points.

Limitations and Future Work

While the results are promising, the paper leaves a few avenues open for future exploration:

  • Dataset Scale: The experiments were restricted to relatively low-resolution ($32 \times 32$) images and smaller datasets. Evaluating SidAE on large-scale, high-resolution benchmarks like ImageNet remains an open step.
  • Hyperparameter Tuning: The weight parameter $w$ currently requires manual tuning. Implementing a dynamic or adaptive weighting scheme during training could optimize performance without manual intervention.
  • Alternative Backbones: The study exclusively utilized a ResNet-18 backbone; testing the framework with modern architectures like Vision Transformers (ViTs) would be a natural next step.

Summary updated

BibTeX
@misc{baier2023self,
  author = {Friederike Baier and Sebastian Mair and Samuel G. Fadel},
  title = {{Self-Supervised Siamese Autoencoders}},
  year = {2023},
  eprint = {2304.02549},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.02549},
}
Figure