Skip to main content
. 2026 Jul 25;26(15):4728. doi: 10.3390/s26154728
Algorithm 1 Data augmentation pipeline
  •   1:

    procedure Augment(I,p)

  •   2:

        Iaug←I

  •   3:

        if random() <p then

  •   4:

            Iaug←RandomRotation(Iaug,angles=[−90,90])

  •   5:

        end if

  •   6:

        if random() <p then

  •   7:

            Iaug←RandomHorizontalFlip(Iaug)

  •   8:

        end if

  •   9:

        if random() <p then

  • 10:

            Iaug←RandomVerticalFlip(Iaug)

  • 11:

        end if

  • 12:

        if random() <p then

  • 13:

            Iaug←ColorJitter(Iaug,brightness=0.4,contrast=0.4)

  • 14:

        end if

  • 15:

        if random() <0.4 then

  • 16:

            Iaug←GaussianBlur(Iaug,kernel=9)

  • 17:

        else if random() <0.4 then

  • 18:

            Iaug←MotionBlur(Iaug,kernel=9)

  • 19:

        end if

  • 20:

        if random() <0.3 then

  • 21:

            Iaug←RandomShadow(Iaug)

  • 22:

        end if

  • 23:

        return Iaug

  • 24:

    end procedure