The model outputs a distribution on 3 classes (Normal vs Bacterial Pneumonia vs Viral Pneumonia )
The intended use is only academic, as the limitations of this model are severe.
First of all, it was trained on a very limited dataset
(Kermany et al., 2018),
which includes only around 5k chest x-ray images (2306 bacterial, 1224 viral, and 1116 normal).
The dataset consisted of only PA chest x-rays, and as such, it was only used for these types of x-rays.
Additionally, most of the images have been marked with the letter R, indicating the right side of the body;
however, not all chest-x-rays used in the world have such a marking (some have the letter L).
There is also a problem that sometimes a direct diagnosis
of a chest x-ray pneumonia type cannot be made simply because one patient can be infected with both viral and bacterial pneumonia.
Moreover, some patients have been diagnosed with pneumonia, but the underlying cause of it is non-infectious.
Please consult this
paper for a deeper understanding of the causes of pneumonia.
The model followed a standard
procudure of finetuning a ViT model.
The only difference is that the first 11 layers of the encoder have been frozen consult the
code, to get a better idea.
Additionnaly data augmentation applied is very much subtle that is rotation by around (-10,10) degrees and very small light change, this was concious choice
as the chest x-ray data is very homogenous in structure and a more extreme data augmentation scheme could introduce too much noise, see this
paper to
understand the challanges of data augmentation for these type of data.
The max epochs was set to 50, early stopping on epoch 5 based on the eval_loss was chosen to prevent overfitting.