Skip to main content
letter
. 2020 Oct 13;20(20):5786. doi: 10.3390/s20205786
Algorithm 1. The Parameter Updating Algorithm
Input: Training images X and the corresponding labels Y, parameters θ0 of embedding model, parameters W0 of the classification model, balance parameter λ, learning rate lr, training epochs L.
1: i = 0
2: While i < L do:
3: i = i + 1, XBatch,YBatch=Sampling(X,Y),
4: ZBatch=F(XBatch),Y^Batch=C(ZBatch) //Perform feature extraction and classification.
5: Zp, Zn=Select(ZBatch,YBatch) //Select positive and negative samples.
6: μp=Average(Zp),Zp,Zn=Hard sample mining(ZBatch,Zp,Zn),
7: LCEi=LCE(Y^Batch,YBatch), LCovDi=LCovD(Zp,Zn,μp), LTotali=LCEi+λLCovDi,
8: θi+1=θilrLTotaliθi, Wi+1=WilrLCEiWi.//Update the model parameters.
9: end while
Output: θL, WL.