Jordan Micah Bennett, software engineer/creator of "RobotizeJa".
_Note: The animation above represents a Drag&Drop version, separate from the instance discussed on this page. The Drag&Drop version version does the same thing as the non-Drag&Drop version, with the exception of the Drag&Drop feature. The Drag&Drop version is available here._
The aim was to develop a quick way to detect the nCov 2019 (Coronavirus 2019/2020, also called disease: "Covid-19" stemming from virus: "SARS-CoV-2") strain, and as such artificial neural networks were used to develop systems in line with the initial aim.
This project began on January 29, 2020, here: SMART-CORONA_VIRUS_DETECTOR. This Xray-scan version (also the first known global attempt/publication of image analysis/Artificial Intelligence based nCov/Covid19 diagnosis code) began on Feb 9, 2020.
As this is the first known attempt, commencing on January 29 2020 aimed at collaborating to construct this type of program, please point to open source packages with similar goals. Please email jordanmicahbennett@gmail.com.
This can also reasonably allow for less experienced medical personnel to make preliminary diagnoses, expanding the diagnosis efforts overall. This effort may contribute towards virus-control progress, together with other ai based endeavours being developed across the globe, such as use of ai for vaccine development.
This convolutional neural network architecture can reasonably also be trained on CT-Scan image data (that many Covid19 papers seem to concern), separate from the Xray data (from the non-Covid19 Pneumonia Kaggle Process) upon which training occurred, initially, apart from the latest Covid19 training sequence on Covid19 data.
Countries with aggressive/thorough testing, seem to face lower mortality rates (eg South Korea, <1% mortality rate) versus countries with terrible/barely existent testing/screening, (eg USA >3.5% mortality rate, close to the global mortality rate of ~3.4%). This project serves to contribute to extensive testing efforts, to help minimize potentially exponential spread in newly affected regions, and otherwise aid in control even after wide-spread.
On March 19, 2020, Epidemiologist Larry Brilliant, (helped to stop smallpox), says we can beat the novel coronavirus—but first, we need lots more testing.
Update: April 7, 2020: Only 6% of actual covid19 infections have been detected by countries worldwide, according to study cited in a new April 7, 2020 Medical Xpress article.
Update: April 17, 2020: A US county recorded 1,000 COVID-19 cases earlier this month, but blood tests suggest that more than 50,000 people there have been infected. This is yet another quite reasonable indication that far more testing is required.
An optimal path is reasonably that the (~70% accurate) CDC standard polymerase method, and the (~75% to ~90% accurate) Artificial Intelligence based Xray method are used in concert.
Above is a snippet of my (March 30, 2020) paper submission to the 65th Annual Health Research Conference, organized by the Government of Jamaica and Caribbean Public Health Agency, based on my February 9, 2020 Covid19 Artificial Intelligence diagnostic model.
65th Annual Health Research Conference: http://conference.carpha.org/
See also my more detailed manuscript on research gate.
Based on suggestions by Andrei Marinescu, Jordan has updated this system such that it does both non-covid19 pneumonia detection and covid19 pneumonia detection, using separate convolutional neural network models, via two different droplist options seen below:
This seeks to increase the robustness of the predictions made by the system.
On the task of Covid19 detection, so far, with the very limited data available, Sensitivity/Specificity/Accuracy are ~85%/~70%/~77% respectively, as seen in this screenshot, (where the model has been trained on a covid19 dataset I organized).
For the task of non-Covid19 pneumonia detection, the new code base has: Sensitivity/Specificity/Accuracy of ~89%/~88%/~89% respectively, as seen in this screenshot.
Feb 9, 2020: I discover similarities between Covid19 and known forms of pneumonia, after which I find a few Xray-Images representing positive cases of Covid19 by Chinese authorities, where I decided to perform artificial intelligence based Xray Image Scan diagnostics, by using the images as inputs to an artificial intelligence based pneumonia diagnosis method originally published on kaggle. This reasoning is seen in my research/discovery process in the Deep Learning Code section below.
Feb 19, 2020: Scientists reveal a ~98% accuracy in human/radiology based CT Scan image based diagnostics, compared to the popular Dna polymerase chain reaction method by CDC: "In a series of 51 patients with chest CT and RT-PCR assay performed within 3 days, the sensitivity of CT for COVID-19 infection was ~98% compared to RT-PCR sensitivity of ~71% (p<.001)."
Feb 20, 2020: Great news - Feb 20 news report published, that Chinese are using Ai to help identify the virus with reported ~99% accuracy, via their own Ai based CT-scan method.
Feb 26, 2020: Chinese researchers reveal free access to an artificial intelligence based online Covid19 Detection tool, although still, no code nor patient data revealed. As a result detection may be slow for users without good internet connection.
March 13, 2020: Kaggle launches large global effort to combat Covid19, with a call to action including data collections of oveer 29,000 Covid19 associated papers.
March 16, 2020: Adrian Rosebrock produced a Covid19 detector with ~90% accuracy, and ~80% sensitivity, using keras machine learning library, from a recent covid19 xray dataset released 4 days ago.
March 22, 2020: Alexander et. al. release the 3rd known Open-Source Ai based Covid19 detector, after Jordan on Feb 9th, then Adrian on March 16. Multi-class virus/bacterial/normal detection is performed, with 100%/80% in Sensitivity/Accuracy respectively in Covid19 detection task.
April 6, 2020: Jeremy Kohn, a machine learning engineer who joined my project on March 18, 2020, posts a curated list of resources for diagnosing COVID-19 based on X-rays and CT scans: RID-COVID (Radiological Image Data for Clinical Open-source Viral Infection Diagnosis).
Coronavirus: Whole world 'must take action', warns WHO
Update Jan 31, 2020/WHO declares the new coronavirus outbreak a Public Health Emergency of International Concern
Code
Covid-19/Coronavirus2019/nCov share many similarities with pneumonia. In fact, the time course evolution of a specific strain of covid-19 pneumonia is studied here.
There are already existent pneumonia deep learning platforms, including kaggle contents rife with deep learning kernels/solutions, pertaining to pneumonia detection.
A pretrained neural network is chosen from google, pertaining to (2). Pretrained model usage is a way to avoid training on the 2 gigabytes of pneumonia/non-pneumonia training set.
Covid-19 positive xray scans are taken from various covid19 papers, such as this scan of this recent covid-19 paper.
Preliminary Conclusion
Update: February 18, 2020
Except for item (5), follow all instructions from "Code setup (basic user interface)" section above.
Run my user interface, which works with my version of the original code from this repository. One can either double click the covid19_ai_diagnoser_ui.py file, or open the file with IDLE, and run there.
After running, ui looks like this on first run:
Select/Files > Load an image:
Select an image that pertains to a suspected case:
Notice the log with the results of the neural network's prediction in the text area below the image:
CT Scan Manual Diagnosis and Explosion in infection reports
Images from recent covid-19 study: "Emerging Coronavirus 2019-nCoV Pneumonia"
Images from recent covid-19 study: "Imaging Profile of the COVID-19 Infection: Radiologic Findings and Literature Review"
+21 axial lung images, +11 lateral view lung images, and about +118 coronal view lung images, re Covid19 positive cases, collated by Dr. Joseph Cohen.
By extension, the tool by researchers at John Hopkins University below, is useful for real time tracking of nCov:
https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
Note that despite the ~900+ infection-case number reported via China on January 24, by stark contrast, a medical scientific paper estimated that ~105,000+ infections actually occurred at that time.
The "renderConfusionMetrics" instance in Section D (bottom of "covid19_ai_diagnoser_optimal_model_architecture.py" file) can facilitate training of new covid19 images placed in _xray_datasetcovid19/train... and or _xray_datasetcovid19/test....
This is done by simply placing your images in the directories above, then changing the "False" parameter to "True", and running the "covid19_ai_diagnoser_optimal_model_architecture.py" file.
renderConfusionMetrics ( model_covid19PneumoniaDetector, test_data_d, test_labels_d, False, train_gen_d, test_gen_d, batch_size, 25, 'covid19_neural_network_weights_jordan.hdf5' )
I call on the Ministry of Health of Jamaica (as well as other countries) to utilize their administrative status to try to acquire more covid19 positive CT scan images (in federated format that excludes patient identity), from China etc, for improving pneumonia based ai systems, like the one that I had prepared since February 9, 2020, which I found to successfully detect covid19 presence in a small covid-19 positive Xray scan sample set found online so far, in a paper by Yuen et al etc.
My advice to Ministry of Health (February 17, 2020): https://drive.google.com/file/d/1BNXkKJPZuMx64XzwqFmQEpC5s9-C3tJH/view?usp=sharing
Jordan added fix to original author's repository, to enable correct validation. John Chang had inadvertently misdefined some "test_dataGen.flow_from_director" function parameter as a training dataset input, instead of a test dataset input.
Jordan updated his version of the original code, such that a compile issue is repaired, in order to facilitate accuracy evaluation of the saved/loaded (in 2 minutes on gtx 1060/i7 cpu) model without invocation of model-training function model.fit, which would take hours on the same machine.
Based on Andrei's suggestions, Jordan replaced erroneously labelled CT labels, with X-Ray, that Jordan had initially mis-labelled. This correction is very important, and could influence model architecture later on.
Code no longer runs on John Chang's base code. Jordan has written new diagnoser code, to accomodate a new code base.