Table 4 Pseudocode of the self-calibrated convolution (SCConv).

From: Pulmonary diseases accurate recognition using adaptive multiscale feature fusion in chest radiography

Algorithm 1 Self-calibrated Convolution (SCConv)

Input: Feature map \({\text{X}} = [{\text{x}}_{1} ,{\text{x}}_{2} , \ldots ,{\text{x}}_{C} ] \in {\mathbb{R}}^{C \times H \times W}\)

Parameters:

           conventional 2D convolutional layers at \(\mathcal{F}\)

           average pooling with filter size r×r and stride r

           \(\sigma\) denote sigmoid functions

           “\(\cdot\)” denotes element-by-element multiplication

           Up is the bilinear interpolation operator

1

// based on \({\text{K}}_{1}\) performs the pooled feature transform

2

\(X^{\prime}_{1} = {\text{Up}} ({\mathcal{F}}_{1} ({\text{AvgPool}}_{r} ({\text{X}}_{1} )))\)

3

// based on \({\text{K}}_{2}\) performs the pooled feature transform

4

\(X^{\prime}_{2} = {\mathcal{F}}_{2} ({\text{X}}_{1} )\)

5

// based on \({\text{K}}_{3}\) performs the pooled feature transform

6

\({\text{Y}} = {\mathcal{F}}_{3} (X^{\prime}_{2} \cdot \sigma ({\text{X}}_{1} + X^{\prime}_{1} ))\)

Output: the outputs after the filters as \({\text{Y}} = [y_{1} ,y_{2} , \ldots ,y_{{\widehat{C}}} ] \in {\mathbb{R}}^{{\widehat{C} \times \widehat{H} \times \widehat{W}}}\)