Appearance invariance in convolutional networks with neighborhood similarity

Tolga Tasdizen, Mehdi Sajjadi, Mehran Javanmardi, Nisha RamesharXiv 2017

Abstract

Standard Convolutional Neural Networks (CNNs) often struggle with "novel appearances"—data that differs significantly in style or noise from the training set. We present the Neighborhood Similarity Layer (NSL), a parameter-free, differentiable layer that computes relative similarity between local features rather than absolute values. By focusing on these relationships, NSL-equipped networks achieve significant zero-shot domain generalization, outperforming standard models and even some domain adaptation techniques on tasks ranging from digit recognition to medical image segmentation.

Introduction: The Challenge of Novel Appearances

While CNNs excel at generalizing to data within their training distribution, they are notoriously brittle when faced with drastic appearance changes. A human can recognize a digit "4" regardless of whether it is rendered in solid ink, a dotted pattern, or hidden against a noisy background. In contrast, a standard CNN trained on clean MNIST digits typically fails on such variations.

Common remedies like data augmentation and domain adaptation have significant drawbacks. Data augmentation cannot account for every possible future transformation, and domain adaptation requires access to unlabeled target data beforehand. This research introduces "appearance invariance" directly into the network architecture, inspired by the Gestalt principle of grouping by similarity.

Visualizing the challenge: MNIST digits under various noise and appearance transformations.

The Neighborhood Similarity Layer (NSL)

The core innovation is the Neighborhood Similarity Layer (NSL). Unlike standard convolutional layers with learned weights, the NSL is parameter-free and operates based on local spatial relationships.

Mechanism

  1. Local Frame of Reference: For each pixel in a feature map, the NSL identifies a surrounding neighborhood (e.g., 11x11).
  2. Similarity Mapping: It calculates the normalized inner product between the central pixel's feature vector and those of its neighbors.
  3. Invariance: The resulting similarity map highlights regions belonging to the same object (foreground) because their features are mutually similar, regardless of the absolute intensity or texture of that foreground.
  4. Integration: The operation is fully differentiable, allowing it to be seamlessly integrated into standard deep learning architectures and trained via backpropagation.
Architecture of a CNN incorporating the Neighborhood Similarity Layer (NSL).

Experimental Evaluation

The authors evaluated the NSL across diverse computer vision tasks to test its robustness and versatility.

Digit and Object Recognition

The model was trained on standard MNIST and tested on several challenging target domains including SVHN (Street View House Numbers) and MNIST-m (digits blended with random natural image backgrounds). For natural image classification (CIFAR-10), the authors utilized a parallel stream architecture, combining an NSL branch with a standard branch to preserve both shape and texture information.

Biomedical Imaging

The NSL was also tested on specialized tasks where appearance variation is high and labeled data is scarce, such as vasculature segmentation in eye fundus images (DRIVE and STARE datasets) and cell detection in low-contrast microscopy.

Key Insights and Results

  • Zero-Shot Generalization: A network trained only on MNIST saw its accuracy drop to 32.38% on SVHN. With the addition of NSL, accuracy jumped to 63.88% without any prior exposure to SVHN data.
  • Robustness to Statistical Noise: On the "MNIST-v" variant, where foreground and background share the same mean intensity but differ in variance, standard CNNs performed at chance (~12%). The NSL-equipped network achieved 51.02%.
  • Medical Precision: In vasculature segmentation, moving from DRIVE to STARE, NSL improved the F-score from 65.20 to 74.00. In cell detection, it significantly improved the separation of individual cells in low-contrast images.

Conclusion

The Neighborhood Similarity Layer offers a powerful method for building appearance invariance into neural networks by prioritizing relative local similarities over absolute pixel values. While it can discard some useful texture information, parallel architectural designs effectively address this limitation. Future work will explore applying NSL at deeper network layers and combining it with advanced domain adaptation techniques to further enhance robustness in data-constrained environments.

Summary updated

BibTeX
@misc{tasdizen2017appearance,
  author = {Tolga Tasdizen and Mehdi Sajjadi and Mehran Javanmardi and Nisha Ramesh},
  title = {{Appearance invariance in convolutional networks with neighborhood similarity}},
  year = {2017},
  eprint = {1707.00755},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.00755},
}
Figure