Skip to main content
. 2021 Nov 9;72:103326. doi: 10.1016/j.bspc.2021.103326
Algorithm 1: Pseudo Code of Proposed Method
Require: number of covid-19 images n; number of healthy images m; number of GAN epochs p; transfer model T= {AlexNet, GoogleNet, VGG-19, Shufflenet V2, DenseNet-121, DenseNet-201}; number of transfer epochs q.
Input: Chest X-ray ImagesI
Output: Binary Classifier
1 First Step // Preparing Data
2 Split I into two subfolders (Xi,Yi), where Xi(i=1,,n) and Yj(j=1,,m) represent covid-19 and non-covid-19 folders, respectively.
3 Split data directory into training, validation, and test sets
4 Second Step // Data Augmentation
5 fori<ndo // Traditional Augmentation
6 RiRotate (Xi)
7 CiCrop (Xi)
8 FiFlip (Xi)
9 SiScale (Xi)
10 TiTranslate (Xi)
11 end for
12 Trk=(Ri,Ci,Fi,Si,Ti)
13 fori<pdo // Generative adversarial networks
14 Update discriminator network
15 Train with real batch
16 Calculate loss on real batch
17 Calculate gradients for discriminator
18 Train with fake batch
19 Generate fake image batch with generator
20 Classify all fake batch with discriminator
21 Calculate discriminator’s loss on the fake batch
22 Update and Calculate gradients for generator
23 end for
24 Third Step // Applying Block Filter
25 fori<ndo
26 Convert Xifrom RGB to Gray scale
27 imfilter (Xi , fspecial ('LoG')) // apply Laplacian of Gaussian filter
28 imfilter (Xi , fspecial ('Sobel')) // apply Sobel filter
29 globalgaborfeatures (Xi, gaborfilters, Output); // apply Gabor filter
30 end for
31 Fourth Step // Training Model
32 Loading all X-ray training data
33 Resize Images
34 for epochs = 1 to qdo
35 Train the AlexNet model
36 Train the GoogleNet model
37 Train the VGG-19 model
38 Train the ShuffleNet V2 model
39 Train the DenseNet-121 model
40 Train the DenseNet-201 model
41 end for
42 Test and evaluate model
43 Compare results