Skip to main content
. 2023 Feb 20;23(4):2325. doi: 10.3390/s23042325
Algorithm 1 Labeling using Fuzzy C-means

     Input: FM1/FM2

     Output: Labels

  •  1:

    Initialize cluster centers c1, c2, ..., cj

  •  2:

    forj=1to2do

  •  3:

        Repeat until convergence: {

  •  4:

        Calculate the membership values wij

  •  5:

        wij1||X(i)cj||||X(i)ck||

  •  6:

        for i=1ton do

  •  7:

            a(i)argmincwijm||X(i)cj||2

  •  8:

        end for

  •  9:

    }

  • 10:

        K(j)(a,c)argminjK(a,c)

  • 11:

    end for

  • 12:

    fori=1tondo

  • 13:

        if a(i) close to origin then

  • 14:

            Labels(i)1

  • 15:

        else

  • 16:

            Labels(i)2

  • 17:

        end if

  • 18:

    end for