The artificial intelligence tool could help states develop more specific COVID-19 disease prevention strategies and improve public health.
Note from the editors: Towards Data Science is a Medium publication primarily based on the study of data science and machine learning. We are not health professionals or epidemiologists, and the opinions of this article should not be interpreted as professional advice. To learn more about the coronavirus pandemic, you can click here.
Appeared in China at the end of 2019, this disease is caused by SARS-CoV-2, a virus that belongs to the coronavirus.
Among the tens of thousands of cases detected, several cases of COVID-19 are asymptomatic. These most common symptoms of the virus are fever and a dry cough. Some people may also experience aches, headache, tightness or shortness of breath. These symptoms suggest an acute respiratory infection or radiologically detectable lung abnormalities. We can use Artificial Intelligence algorithms to detect the disease using automatic X-ray analysis to support radiologists.
To test the performance of Artificial Intelligence on the detection of COVID-19, I used the database made available by the team of Dr Joseph Cohen. This data is available on GitHub.
The database — which contains 152 observations — was constructed from COVID-19 cases with chest x-ray or CT images.
Import of the packages we are going to use
We will import the necessary packages. The main module used will be keras for modeling.
We import our database and metadata which contains the labels for the images.
The database contains 127 observations with COVID-19 disease, 4 ARDS, 2 Pneumocystis, 6 Streptococcus and 2 No Finding.
We divide the database into two groups: patients infected with COVID-19 and other patients.
90% of our observations will be used for learning, and 10% will be used for validation. Due to the limited data we have, we will use the data augmentation.
Preprocessing is a step that maximizes the probability of successful
We will import the images and resize them in 224×224 format.
For the modeling, we will use 25 epochs and 8 for the batch size. The pre-trained ResNet model will be used to fill the little image we have.
With transfer learning, the idea is to use the last layer of a network trained on millions of images in order to fill the few images we have available.
For modeling, we will use transfer learning with ResNet.
For this first modeling, we get almost 80% accuracy in validation and nearly 75% accuracy in learning.
In loss, we have a low value. This result — obtained on a 50-frame basis — can be greatly improved with more images.
The results of the modeling are good compared to the quantity of images which we had. This method can be generalized and make it possible to carry out screening for COVID-19 on a large scale if enough databases are available to achieve good performance.