Relation Network is a few-shot learning method that uses a neural network to score whether an example and the image in question (the query) belong to the same class. It was presented by Sung et al. at CVPR in 2018. The paper's title is "Learning to Compare," and its distinguishing feature is that it learns from data not only how to extract features but also how to compare them (the distance function).
The earlier Matching Networks uses cosine similarity and Prototypical Networks uses the squared Euclidean distance, both comparisons fixed by hand. Since only the embedding network is learned, accuracy depends on "whether an embedding can be built that is separable under that fixed distance." Relation Network makes the comparison part a deep network as well (the relation module) and trains it together with the embedding.
As an analogy, in handwriting analysis, instead of measuring with a fixed ruler such as "the difference in stroke thickness," it trains, from many cases, the very eye that judges "whether two samples were written by the same person." For new classes it needs no gradient computation for adaptation as MAML does; it classifies simply by passing the examples and the query through the network.
In the paper's experiments, it reached 99.6% on Omniglot 5-way 1-shot and 50.44% on miniImageNet 5-way 1-shot, outperforming or matching methods of the time. If class descriptions (attribute vectors) are used instead of example images, it can be applied directly to zero-shot learning as well.
There is a different module with the same name "Relation Network," proposed in 2017 by Santoro et al. at DeepMind for reasoning about relations between objects (A simple neural network module for relational reasoning). This article covers the few-shot learning method by Sung et al.

