# MDPN: Multilevel Distribution Propagation Network for Few-Shot Image Classification
## 3 Proposed Method
### Graph-Based Multilevel Distribution Propagation
** The object-distribution aggregation integrates \(E_{l}^{object}\) and \(V_{l-1}^{dist_{1}}\) to get \(V_{l}^{dist_{1}}\). \(v_{0,\ i}^{dist_{1}}\) is initialized as follows:  
\[v_{0,\ i}^{dist_{1}}=\left\{\begin{array}{ll}\left|\begin{array}{ll}\left| \begin{array}{ll}\left|\begin{array}{ll}\left|\begin{array}{ll}\left| \begin{array  
where \(v_{0,\ i}^{dist_{1}}\in\mathbb{R}^{N_{sup}}\). \(\mid\mid\) is the concatenation operator. \(y_{i}\) and \(y_{j}\) are labels. \(\delta(\cdot)\) is the Kronecker delta function, which outputs 1 when \(y_{i}=y_{j}\), 0 otherwise.  
When the iteration number \(l>0\), \(v_{l,\ i}^{dist_{1}}\) is updated as follows:  
\[v_{l,\ i}^{dist_{1}}=O2D\Big{(}\Big{|}\ \Big{|}_{j=1}^{N_{sup}}\ e_{l,\ i}^{ object},\ v_{l-1,\ i}^{dist_{1}}\ \Big{)}, \tag{4}\]  
where \(O2D:\ \big{(}\mathbb{R}^{N_{sup}},\ \mathbb{R}^{N_{sup}}\big{)}\to\ \mathbb{R}^{N_{sup}}\) is the object-distribution aggregation network. \(O2D\) first connects two features together and then transforms it: \(\mathbb{R}^{2N_{sup}}\to\ \mathbb{R}^{N_{sup}}\), this transformation contains a fully connected (FC) layer and a ReLU. **Distribution Propagation. ** The first-level distribution \(e_{l,\ ij}^{dist_{1}}\) is updated as follows:  
\[e_{0,\ ij}^{dist_{1}}= \begin{cases}f_{e_{0}^{dist_{1}}}\bigg{(}\bigg{(}v_{0,\ i}^{ dist_{1}}-v_{0,\ i}^{dist_{1}}\big{)}^{2}\bigg{)},&l=0,\\ f_{e_{l}^{dist_{1}}}\bigg{(}\bigg{(}v_{l,\ i}^{dist_{1}}-v_{l,\ j}^{dist_{1}} \bigg{)}^{2}\bigg{)}.e_{l-1,\ i\ j}^{dist_{1}}&l>0.\end{cases}  \tag{5}\]  
where \(e_{0,\ ij}^{dist_{1}}\in\mathbb{R}\). The encoding network \(f_{e_{0}^{dist_{1}}}:\ \mathbb{R}^{NK}\to\ \mathbb{R}^{NK}\) is composed of two Conv-BN-ReLU blocks. Finally, a normalization operation is conducted on \(e_{l,\ ij}^{dist_{1}}\). The edge of the first-level distribution \(e_{0,\ ij}^{dist_{1}}\) is directly used as a node of the second-level distribution: \(e_{0,\ ij}^{dist_{1}}=v_{0,\ i}^{dist_{2}}\). Similarly in the third-level graph: \(e_{0,\ ij}^{dist_{2}}=v_{0,\ i}^{dist_{2}}\). The second-level distribution \(e_{l,\ ij}^{dist_{2}}\) and the third-level distribution \(e_{l,\ ij}^{dist_{1}}\) are updated as follows:  
\[e_{l,\ ij}^{dist_{2}}= \begin{cases}f_{e_{l}^{dist_{2}}}\bigg{(}\bigg{(}v_{l,\ i}^{ dist_{2}}-v_{l,\ j}^{dist_{2}}\big{)}^{2}\bigg{)},&l=0,\\ f_{e_{l}^{dist_{2}}}\bigg{(}\bigg{(}v_{l,\ i}^{dist_{2}}-v_{l,\ j}^{dist_{2}} \bigg{)}^{2}\bigg{)}.e_{l-1,\ i\ j}^{dist_{1}},&l>0.\end{cases}  \tag{6}\]  
\[e_{l,\ ij}^{dist_{3}}= \begin{cases}f_{e_{l}^{dist_{3}}}\bigg{(}\bigg{(}v_{l,\ i}^{ dist_{3}}-v_{l,\ j}^{dist_{3}}\big{)}^{2}\bigg{)},&l=0,\\ f_{e_{l}^{dist_{3}}}\bigg{(}\bigg{(}v_{l,\ i}^{dist_{3}}-v_{l,\ j}^{dist_{3}} \bigg{)}^{2}\bigg{)}.e_{l-1,\ i\ j}^{dist_{3}},&l>0.\end{cases}  \tag{7}\]  
**D2O Aggregation. ** In the D2O module, three levels of distributions: \(e_{l,\ ij}^{dist_{1}}\), \(e_{l,\ ij}^{dist_{2}}\), \(e_{l,\ ij}^{dist_{3}}\) are used to update the \(v_{l,\ i}^{object}\) into \(v_{l+1,\ i}^{object}\). \(v_{l+1,\ i}^{object}\) is updated as follows:  
\[v_{l}^{base_{\kappa}}=\sum_{j=1}^{T}\Big{(}e_{l,\ ij}^{dist_{3}}\cdot v_{l,\ j }^{object}\Big{)},\ \ \ \ x=\{1,\ 2,\ 3\}, \tag{8}\]  
\[v_{l}^{cat}=v_{l,\ i}^{object}  
\[P^{dist_{x}}\big{(}y_{j}|x\;_{i}\big{)}=Softmax\left(\sum_{j=1}^{N}c_{l,\;ij}^{ dist_{x}}\text{-}\text{one-}\text{hot}\big{(}y_{j}\big{)}\right),\;x=\{1,\;2,\;3\}, \tag{12}\]  
where \(x\;_{i}\) is the query sample and \(y_{j}\) is the label of \(j\)-th support sample. \(P\big{(}y_{j}|x\;_{i}\big{)}\) is the probability distribution over classes given sample \(x\;_{i}\). \(c_{l,\;ij}^{object}\) and \(c_{l,\;ij}^{dist_{x}}\) are the edges connecting node \(x\;_{i}\) and node \(x\;_{j}\) in the \(l\)-th iteration (where \(x_{i}\) is the query sample and \(x_{j}\) is the support sample). _one-hot_\(\big{(}y_{j}\big{)}\) is the one-hot encoding of the \(y_{j}\). **Object Loss.