Deep neural network detection & clinical staging of COVID-19 chest X-rays​
​by Peter Riley, Deakin University

AIM

Using Mathematica & modest computational resources, 1-10 TFlops FP32 : 1. Differentiate COVID-19 from other viral pneumonia & normal chest x-rays 2. Stage the infection into clinically early & late phases
​​COVID-19VIRALNORMAL

Introduction

Deakin University’s Faculty of Health mandates: 1. Cross curriculum Medical Informatics (MI) 2. Now includes Artificial Intelligence/Machine Learning (AI/ML) -Follows FDA approval for AI deployment
1
(≈135 in Radiology) For current listing of algorithms see also https://models.acrdsi.org​ Data Science Institute, American College of Radiology
Medical Imaging Dept has extensive MI coverage, but not AI/ML: 1. Proposal to implement 4th Year research project option -Based upon previous R&D experience
2
. 2. Requiring common GPU/CUDA speeds- -Limits to Transfer Learning adaptation of advanced DNN (ResNet etc) -Limits to small image size e.g. CT & MRI
2
256
,
2
512
3. Requiring easy Interface- -Students do not have the background for Python based platforms -Mathematica provides an easy syntax & instruction -Wolfram provides easy access to DNN libraries

COVID-19 Chest X-rays

Didn’t we say CT & MRI?: 1. Yes, chest x-rays are typically 2kpx x 2.5kpx x 14 bit -Requires PetaFlops+ processing power. 2. But, scaled chest images have been successfully processed -Differentiation of disease on
2
256
to
2
512
chest x-rays
3
. 3. And, there is a large public database of COVID-19 images
4
. -One of the main stumbling blocks to short (1 semester) research projects is compiling the raw images required. -Specific disease studies require collaboration with local clinical stakeholders which entails a lengthy Ethics approval process.

COVID-19 Detection

1. Data selection & preparation from over 5k images: -Images filtered for PA (posterior-anterior); AP & Lateral not selected -Images with intubation & other artefacts were rejected -1200 images chosen for each of the Covid, Normal and Other-Viral datasets -100 images chosen randomly from each set for the Test images
Import the images into the COVID, NORMAL, VIRAL datasets & label them accordingly:
trainCOV=Map[#->"Covid"&,COVID];​​trainNORM=Map[#->"Normal"&,NORMAL];​​trainVIR=Map[#->"Viral"&,VIRAL];
2. Transfer Training -ResNet: net=NetModel[“ResNet-50 Trained on ImageNet Competition Data”]​ -WIIN: net=NetModel[“Wolfram ImageIdentify Net V1”]
Repurpose the DNN by replacing the last 2 layers and specify the 3 required classes:
changedNet=NetDrop[net,-2]
​​
NetChain
Inputport:
image
Outputport:
vector(size: 2048)

​Join with a chain of two new layers:​
newNet=NetJoin[changedNet,NetChain[Association["classifier"LinearLayer[],"probabilities"SoftmaxLayer[]],"Output"NetDecoder[{"Class",{"Covid","Normal","Viral"}}]]]
​​
NetChain
uniniti
aliz
ed
Inputport:
image
Outputport:
class

Only the Classifier layer undergoes further training all other layers are frozen, LearningRateMultipliers  1 or 0 resp:
In[]:=
trainedNet=NetTrain[newNet,training,LearningRateMultipliers{"classifier"1,_0},TargetDevice"GPU"]
Out[]=
NetChain
Inputport:
image
Outputport:
class

GPU: 1920 CUDA, 240 Tensor cores, 6GB GDDR6 @ 14 Gbps, 960/1200 MHz, 90W; 4.6 TFlops FP32
3. Training Results​ - ResNet: net=NetModel[“ResNet-50 Trained on ImageNet Competition Data”] - COVID-19: SENSITIVITY = 100%, SPECIFICITY = 99%​ - WIIN: net=NetModel[“Wolfram ImageIdentify Net V1”] gave 97% & 97% resp.
Showing the ResNet Confusion Matrix & WIIN Receiver Operating Characteristic curve:
"actual class"
​
"predicted class"
;
"recall"
​
"false positive rate"

COVID-19 Detection Assessment

1. Time Constraints -Processing time was remarkably fast: -Seeing x10 improvement with current laptop GPUs over previous Python based Nano accelerators -Possible to demo tweaking within the limits of a lecture session
2. Student Outcomes -The hands-on experience will make students more aware of the possibilities & potential hazards of AI -Should make them more tolerant of advanced training which is likely to entail with the proliferation of AI
3. Clinical Outcomes -The demo process shows what may be possible -But requires a Clinical Visualisation platform able to embed developed DNN into the daily workflow -May be implemented in a research capacity but cannot be used routinely without Federal compliance testing

COVID-19 Staging (WIP)

1. Data validation - Surprisingly sparse data with unbiased images available - Late stage problem: - most late stage images are acquired in ICU - AP orientation - intubation & other interventional artefacts
2. Final Dataset - Only 50 images for each category of Early & Late - 40 x2 training images - 10 x2 test images - Classification stages
5
: - Early: Clinical Stage II/1-3 days since COVID-19 onset - Late: Clinical Stage III/7-10 days since COVID-19 onset - PA without artefacts​
Output Classes defined as Early or Late:

COVID-19 Staging (WIP) Results

QUALITY ASSURANCE

References

More references

◼
  • Wolfram Mathematica v.12.3.1.0, Wolfram Research, Inc., Champaign, IL, (1988-2021).