Skip to main content
. Author manuscript; available in PMC: 2023 Dec 1.
Published in final edited form as: Med Image Anal. 2023 Sep 14;90:102960. doi: 10.1016/j.media.2023.102960
Algorithm 1: Minibatch training of the proposed framework
Input:Training datasetXwith a total ofNimages,of whichNfimages have both class and location labels andNsimages only haveclass labels(N=Nf+Ns).A data subset withNffully-labeled samples is denoted asXf,and the other data subset withNspartly-labeled samples is denoted asXs;Networkswithparameters:FEX withΘF;AC withΘC;LA-Net withΘD;Traininghyper-parameters:Minibatch size(m);the number of stage1training epochs(t1);the number of stage 2 training epochs(t2);Stage 1:Pre-train the LA-Net with fully-labeled subsetXfStarttrainingInitialize training iteration:i=1whileit1doInitialize the count of trained images in the current epoch:n;Setn=0whilenNfdo1.Sampleabatchofmimages{Xl(1),,Xl(m)}frominputdataandtheircorrespondinglesionlocationlabels{Y¯pixel(1),,Y¯pixel(m)}2.Forward the batched data through the FEX and LA-Net and output mask prediction{Ppixel(1),,Ppixel(m)}3.Calculate the lossLflocusing Eq.(6)4.Update the parametes of FEXand LA-Net by ascending their stochastic gradients:(ΘF,ΘD)Lfloc5.Increment the count:n=n+mIncrement iterationi=i+1EndtrainingOutput:Trained LA-Net with parametersΘ¯DStage 2:Train all three networks with the entire datasetXStarttrainingLoad the LA-Net parametersΘ¯Dtrained in Stage1Initialize training iterator:i=1whileit2doInitialize the count of trained images in the current epoch:n;Setn=0whilenNdo1.Sample a batch ofmimages{X(1),,X(m)}from input data.Among these,mfimages are from the subsetXf,and theremainingmsimages are from the subsetXs.Thus,mfimages have GT class labels{Y¯cls(1),,Y¯cls(mf)}and GT locationlabels{Y¯pixel(1),,Y¯pixel(mf)},while themsimages only have GT class labels{Y¯cls(mf+1),,Y¯cls(mf+ms)}2.Forward the batched data through the FEX,AC,and LA-Net.Predict lesion-types{Pcls(1),,Pcls(m)}on allmimages.Predict lesion locations{Ppixel(1),,Ppixel(mf)}for fully-labeledmfimages,which have annotated GT locations.Predictlesion locations{Ppixel(mf+1),,Ppixel(mf+ms)}for partly-labeledmsimages,which have unknown GT locations.Generatepseudo location labels{Y¯pixel(mf+1),,Y¯pixel(mf+ms)}using the binarize function applied to{Ppixel(mf+1),,Ppixel(mf+ms)}describedin Eq.(7)3.Calculate the hybrid lossLhybusing Eq.(7)4.Update the parameters of FEX,AC,and LA-Net by ascending their stochastic gradients:(ΘF,ΘC,ΘD)Lhyb5.Increment the count:n=n+mIncrement iterationi=i+1EndtrainingOutput:Trained model weights of the FEX,AC,and LA-Net