The goal of few-shot segmentation is to segment an object of unseen classes from a query image given only a few annotated examples [1]}. To mitigate the overfitting caused by insufficient training data, we follow the common protocol called episodic training [2]}.
Let us denote training and test sets as \(\mathcal {D}_\mathrm {train}\)  and \(\mathcal {D}_\mathrm {test}\) , respectively, where object classes of both sets do not overlap. Under \(K\) -shot setting, multiple episodes are formed from both sets, each consisting of a support set \(\mathcal {S} = \lbrace (x_{s}^{k}, m_{s}^{k})\rbrace _{k=1}^{\mathrm {K}}\) , where \((x_{s}^{k}, m_{s}^{k})\)  is \(k\) -th support image and its corresponding mask pair and a query sample \(\mathcal {Q} = (x_q, m_q)\) , where \(x_q\)  and \(m_q\)  are a query image and mask, respectively. During training, our model takes a sampled episode from \(\mathcal {D}_\mathrm {train}\) , and learn a mapping from \(\mathcal {S}\)  and \(x_q\)  to a prediction \(m_q\) . At inference, our model predicts \(\hat{m}_q\)  for randomly sampled \(\mathcal {S}\)  and \(x_q\)  from \(\mathcal {D}_\mathrm {test}\) .
