Skip to main content
. 2023 Sep 7;23(18):7724. doi: 10.3390/s23187724
Algorithm 1: Proposed computational TTA approach on the test sample images.
Input: The Pre-trained Model is defined as ‘M’ on in-distribution data.
The augmented terminology is denoted as ‘A’.
The test samples set of images data X1, X2 ,X3,  ,Xn;
which contains in-distribution data and out-distribution data combinedly.

Output: Predicted samples with distributed mean score as
             S(X1), S(X2), S(X3), …, S(Xn);

1: Begin
2: For loop is executed: i = 1 to n do
3:    Data augmentation for each input sample set, Xi= {X1, X2 ,X3,  ,Xn};
4:    Converted to horizontal flip (HF) with M to obtain A(Xi), respectively.
Similarly, vertical flip (VF) is generated for each sample to A(Xi);
5:    Feed Xi to A(Xi) into model M,
continuously calculate M(Xi),  M(A(Xi)) through forward passes;
6:    Mean result, S(Xi)=i=1nM(A(Xi)) n;
7: end for
8: End