|
|
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 Images
|
|
|
Output: Binary Classifier |
1 |
First Step // Preparing Data |
2 |
Split I into two subfolders (), where and 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 |
fordo // Traditional Augmentation |
6 |
|
Rotate () |
7 |
|
Crop () |
8 |
|
Flip () |
9 |
|
Scale () |
10 |
|
Translate () |
11 |
end for |
12 |
|
|
|
13 |
fordo // 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 |
fordo
|
26 |
|
Convert from RGB to Gray scale |
27 |
|
imfilter ( , fspecial ('LoG')) // apply Laplacian of Gaussian filter |
28 |
|
imfilter ( , fspecial ('Sobel')) // apply Sobel filter |
29 |
|
globalgaborfeatures (, 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 |