Skip to main content
. 2021 Jun 2;21(11):3848. doi: 10.3390/s21113848
Algorithm 1. For recognizing the spatial correlation.
Input: maski of superpixel block i, maskj of superpixel block j.
Output: spatial correlation between maski and maskj
  1.  Begin

  2.  // use mask to extract feature of maski

  3. fifc1(maski); // fc1 is a fully connected layer1

  4.  // use mask to extract feature of maskj

  5. fjfc1(maskj); // fc1 is a fully connected layer1

  6.  // obtain union mask of maski and maskj

  7. maskijunion(maski,maskj); // union is the operation of directly add by pixels

  8.  // use union mask to extract feature of mask pair

  9. fijfc1(maskij); // fc1 is a fully connected layer1

  10.  // obtain feature embedding of correlation (i, p1, j)

  11. Vfc2(concat(fi,  fij,  fj)); //fc2 is a fully connected layer2

  12. ffc3(concat(fi,  V,  fj));// fc3 is a fully connected layer3

  13.  // obtain feature embedding of correlation (j, p2, i)

  14. Vfc2(concat(fj,  fij,  fi));// fc2 is a fully connected layer2

  15. ffc3(concat(fj,  V,  fi));// fc3 is a fully connected layer3

  16.  // recognize spatial correlation between i and j

  17. yargmax(fc4(f));  // fc4 is a fully connected layer4

  18.  // recognize spatial correlation between j and i

  19. yargmax(fc4(f)); // fc4 is a fully connected layer4

  20.  Return y, y;

  21.  End