Skip to main content
. 2023 Oct 16;23(20):8504. doi: 10.3390/s23208504
Algorithm 2: Adaptive AutoPro for Healthcare Prediction using the Fully Homomorphic Encryption (FHE) Algorithm
  1. Input: RemoteDataset[], Open dataset of remote users for the training of heart disease.

  2.     Labels[], Selected dataset labels to be processed by FHE algorithm.

  3.     TestSet[], A group of recent remote health patients’ data sent by

  •          An authorized hospital’s server.

  • 4.

    Output: candidateSet[], Prediction given by FHE algorithm for the

  •           patient’s health status.

  • 5.

        FHE_AlgorithmTime[], Time required for the execution of the FHE algorithm.

  • 6.

    Initialize (DTrain, DTest, DProcessedTrain, DProcessedTest, FHE Model, DQue, candidateSet1, candidateSet2, candidateSet3, candidateSet4) = ∅

  • 7.

    DTrain, DTest=TrainTestRatio(RemoteDataset[], Labels, 80:20)

  • 8.

    DProcessedTrain=DTrainMinDTrainMaxDTrainMinDTrain 

  • # Min–Max normalization by rescaling the data [0,1].

  • 9.

    DProcessedTest=DTestMinDTrainMaxDTrainMin(DTrain)

  • 10.

    FHE = FHE.Train(DProcessedTrain, DProcessedTest)

  • # TFHE library with GSW

  • 11.

    DQueue = Input (TestSet[10]) # Input encrypted Test Set of 10 patients.

  • 12.

    If (DQueue == Consistent)

  • 13.

      Print “The patient’s test set is consistent and ready to be processed”

  • 14.

    Else

  • 15.

      Print “The patient’s test set is corrupted”, exit()

  • 16.

    For EHR in range(sizeof(TestSet[]))

  • 17.

      candidateSet1 = FHE.Decision Tree(TestSet[x])

  • 18.

      candidateSet2 = FHE.Logistic Regression(TestSet[x])

  • 19.

      candidateSet3 = FHE.SVM(TestSet[x])

  • 20.

      candidateSet4 = FHE.XGBoost(TestSet[x])

  • 21.

    Print “Decision Tree:”,candidateSet 1,“Logistic Regression:”, candidateSet2, “SVM:”,candidateSet 3,“XGBoost:”,candidateSet 4

  • 22.

    Print “Execution Time required for Decision Tree:”, candidateSet1.time(),

    “Logistic Regression:”,candidateSet2.time(), “SVM:”,candidateSet3.time(), “XGBoost:”,candidateSet4.time()

  • 23.

    candidateSet[] = candidateSet1 ∪ candidateSet2 ∪ candidateSet3 ∪ candidateSet4

  • 24.

    Return candidateSet[]