Skip to main content
. 2026 Jul 20;12(7):328. doi: 10.3390/jimaging12070328
Algorithm 1 End-to-End Training Procedure for the FAA Framework
  • Require: 

    Training dataset D={(Xsmri(i),Xfc(i),y(i))}i=1N, batch size B, temperature τ, loss weight λ, learning rate η

  • Ensure: 

    Trained model parameters θ

  • 1:

    Initialise the ResNet-18 backbone with ImageNet-pretrained weights

  • 2:

    Initialise the FFN parameters randomly

  • 3:

    Initialise the classifier parameters randomly

  • 4:

    while the training process has not converged do

  • 5:

         Sample a mini-batch {(Xsmri(i),Xfc(i),y(i))}i=1B from D

    Feature Extraction

  • 6:
         Extract sMRI features:
    Zsmri=Backbone(Xsmri)
  • 7:
         Extract FC features:
    Zfc=FFN(Xfc)

    Contrastive Alignment

  • 8:
         Apply L2 normalisation:
    Z^smri=L2Norm(Zsmri),Z^fc=L2Norm(Zfc)
  • 9:
         Compute the cross-modal similarity matrix:
    S=Z^fcZ^smri⊤
  • 10:
         Compute the bidirectional contrastive loss:
    LCL=−12B∑i=1Blogexp(Sii/τ)∑j=1Bexp(Sij/τ)+logexp(Sii/τ)∑j=1Bexp(Sji/τ)

    Fusion and Classification

  • 11:
         Fuse the aligned modality representations:
    Z=Z^fc+Z^smri
  • 12:
         Generate class predictions:
    Y^=SoftmaxZWcls+bcls
  • 13:
         Compute the classification loss:
    LCE=−1B∑i=1B∑kyiklog(y^ik)

    Optimisation

  • 14:
         Compute the total training objective:
    Ltotal=LCE+λLCL
  • 15:
         Update all trainable parameters:
    θ←θ−η∇θLtotal
  • 16:

    end while

  • 17:

    return trained model parameters θ