Skip to main content
. 2020 Aug 26;165:113909. doi: 10.1016/j.eswa.2020.113909
Algorithm 1. Majority voting algorithm using ensemble of benchmark classifiers.
Input/Initialize
Validation dataset D={x1,x2,xn}. // n=number of images in the dataset
Classification model M={m1,m2,mk} //k = number of classification models
Healthy = 0; Unhealthy = 0;
Output
Prediction results of each image as healthy or infected.
Algorithm
  • 1:

    forxi=1ton //where, n=number of images in the dataset

  • 2:

     Healthy = 0; Unhealthy = 0;

  • 3:

      formj=1tok // where, k=number of classification models

  • 4:

        xi.classmpredict(xi,mj) // extract the class label using model mj for input image xi

  • 5:

        ifxi.classm='Healthy' // jth model classify the data as ‘Healthy’

  • 6:

         Healthy = Healthy + 1; // increment the counter by one

  • 7:

        else ifxi.classm='Unhealthy' // jth model classifies the data as abnormal

  • 8:

         Unhealthy = Unhealthy + 1; // Increment the probability by one

  • 9:

        end

  • 10:

      end

  • 11:

      ifHealthy>Unhealthy

  • 12:

        xi.class='Healthy';

  • 13:

      else

  • 14:

        xi.class='Unhealthy';

  • 15:

      end

  • 16:

    end