Skip to main content
. 2025 Oct 6;15(10):1081. doi: 10.3390/brainsci15101081
Algorithm 1 pFL -GMCO Algorithm
  • Require: 

    Private datasets {Di=(xiS,xiA,xiR),Yi}i=1N in multiple sites, pFL models {Mi=MiE,MiC,MiGM}i=1N, number of epochs L, local learning rate α, federated learning rate η, variance σ2 of Gaussian noise, local learning rate α, federated learning rate η.

  • Ensure: 

    Optimal weights of pFL model Mi in site Fi;

  •   1:

    for t=1:L do

  •   2:

        Local updating:

  •   3:

        for i=1:N do

  •   4:

            Compute local classification loss: Licls

  •   5:

            Update pFL models locally: θit←θit−1−α∇θit−1Licls

  •   6:

        end for

  •   7:

        Federated adaptive aggregation:

  •   8:

        for i=1:N do

  •   9:

            Compute gradient matching loss: LiGM

  • 10:

            Compute the adaptive aggregating weights: λi,j

  • 11:

            Federated aggregation: θit′←θit+ζ∑j=1(j≠i)Nλi,jG(θjt)

  • 12:

        end for

  • 13:

        Federated optimization:

  • 14:

        for i=1:N do

  • 15:

            Compute gradient matching loss: LiFed−GM

  • 16:

            Compute model contrastive loss: Licon

  • 17:

            Compute classification loss: Licon

  • 18:

            Compute federated optimization loss: LiFed=LiFed−cls+βLiFed−GM+γLicon

  • 19:

            Update personalized federated parameters: θit*←θit′−η∇θit′LiFed

  • 20:

        end for

  • 21:

        Update multimodal classifier: θiMLPt*←θiMLPt−α∇θiMLPtLCE(MiMLP(zMCB),Yi)

  • 22:

    end for

  • 23:

    Return the pFL model Mi for each federated site.