CNN model that diagnoses using Chest X-ray medical images
DISCLAIMER: This model was designed and implemented for educational purposes. it MUST NOT be used for medical diagnosis as it was NOT tested by a field expert.
CoVID19 is a disease caused by the newly identified virus SARS-CoV-2 of the Corona Viruses family1. The disease's incubation period is 14 days, with most cases being between 4-5 days2. The clinical presentation starts with coughing, fever, dyspnea, and bilateral infiltrates on chest imaging. The presentation can be severe in a lot of cases, especially in old people3. Radiological features on chest x-ray of confirmed COVID-19 cases were parenchymal abnormalities, specifically peripheral consolidations (accumulation of fluids)4; although Chest X-rays weren't so inclusive.
- World Health Organization. Director-General's remarks at the media briefing on 2019-nCoV on 11 February 2020. Here
- Li Q, Guan X, Wu P, Wang X, Zhou L, Tong Y, et al. Early Transmission Dynamics in Wuhan, China, of Novel Coronavirus–Infected Pneumonia. New England Journal of Medicine. 2020Jan29;
- Wu Z, Mcgoogan JM. Characteristics of and Important Lessons From the Coronavirus Disease 2019 (COVID-19) Outbreak in China. Jama. 2020Jan24;
- Yoon SH, Lee KH, Kim JY, Lee YK, Ko H, Kim KH, et al. Chest Radiographic and CT Findings of the 2019 Novel Coronavirus Disease (COVID-19): Analysis of Nine Patients Treated in Korea. Korean Journal of Radiology. 2020Jan26;21(4):494.
I would like to thank Dr.Mohammed for helping me understand this disease and participating in this paragraph. Also pyimagesearch blog for inspired me.
- The posstive cases of COVID-19 X-ray images taken from Dr. Cohen in his repo
- The normal cases taken from dataset that's published in Kaggle's dataset Here.
I designed 2 different models of CNN, one of them contains 4 layers with padding and relu
as an activation function after every 2 layers there is a max-pooling
layer, then two fully connected layers with relu
and softmax
as an activation function. the second one contains 2 Convolution layers with relu
as an activation function follows by the max-pooling
layer. The optimizer for both models is Adam
and binary_crossentropy
as a loss function.
The accuracy for both models is above 95% on the validation set. 1st Model and 2ed Model:
- Testing the model.
- Calculate the confusion matrix.
- Try on CT scan imeages.
- Try ResNet model on this problem.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.