Skip to main content
. 2022 Sep 10;24(9):1276. doi: 10.3390/e24091276
Algorithm 2: Pixel class level adaptation
Input: iris data X, pixel label Y, segmentation network G, training epochs φ, ratio coefficient γ
Initialize: extended discriminator Dpixel
For t = 1,…, φ do
  Unfreeze the Dpixel and freeze the G
   Compute the logit maps: P=softmax(G(X))
  Extract class constraint knowledge: μi=eai/Tj=1Keaj/T
  Compute the Dpixel’s loss: LDpixel(Xeasy,Xhard)=i=1Kμi(easy)logPDpixel(i)(Eeasy)+j=1Kμj(hard)logPDpixel(j+K)(Ehard)
  minDpixelLDpixel to train Dpixel
  Unfreeze the G and freeze the Dpixel
   Compute the crossentropy: Lcrossseg(X)=hHwWcKY(h,w,c)log(P(h,w,c))
  Compute the class level adversarial loss: Lclassadv(Xeasy,Xhard)=j=1Kμj(hard)logPDpixel(j+K)(Ehard)
  minGLcrossseg+Lclassadv to train G