Building and deploying deep learning models in medicine
Leon Chen co-founder, MD.ai
Building and deploying deep learning models in medicine Leon Chen - - PowerPoint PPT Presentation
Building and deploying deep learning models in medicine Leon Chen co-founder, MD.ai Source: https://xkcd.com Leon Chen, MD George Shih, MD Ingredients Massive Data Massive GPU compute Sprinkle on some deep learning magic ??? Data
Leon Chen co-founder, MD.ai
Source: https://xkcd.com
Leon Chen, MD George Shih, MD
Ingredients
Data considerations
○ doctor’s notes, radiology/pathology reports, ICD9/10 codes, billing records, etc.
○ Impossible to crowdsource ○ Quality control (multiple annotators, inter-reader agreement statistics) ○ Expensive (e.g., 100s of $ per hour per doctor) ○ Coordination, logistics
Model summary
1) 3D convolutional ResNet for sex (M/F) prediction 2) 2D convolutional ResNet for nodule ROI generation 3) 3D convolutional ResNet for nodule ROI false positive reduction 4) 2D convolutional ResNet for generating bounding boxes from the nodule ROIs 5) 2D convolutional ResNet for predicting cancer probability on the bounding boxes 6) Xgboost meta-classifier for final cancer prediction using probability predictions from step 5 together with additional features generated during steps 1-5.
No external data used. We annotated the given data ourselves.
Clinical factors, including nodule characteristics on CT
ROC AUC: 0.90 - 0.96
Raw CT volume
ROC AUC: 0.89
Our model 1397 training 198 test (stage 1)
Deployment
Caffe2go style transfer (via facebook)
Deployment
model.save_weights('model.hdf5') with open('model.json', 'w') as f: f.write(model.to_json()) const model = new KerasJS.Model({ filepaths: { model: 'url/path/to/model.json', weights: 'url/path/to/model_weights.buf', metadata: 'url/path/to/model_metadata.json' }, gpu: true })
In Keras: In Keras.js:
try { await model.ready() const inputData = { 'input_1': new Float32Array(data) } const outputData = await model.predict(inputData) } catch (err) { // handle error }
Available Layers
Convolution3D, UpSampling1D, UpSampling2D, UpSampling3D, ZeroPadding1D, ZeroPadding2D, ZeroPadding3D, Cropping1D, Cropping2D, Cropping3D
Merge, Highway
GlobalMaxPooling1D, GlobalAveragePooling1D, GlobalMaxPooling2D, GlobalAveragePooling2D
Deep learning in
GPU
Bind input tensors as textures Bind layer weights as textures (W, b) Bind uniforms (filter size, stride, etc.) Bind output textures Run WebGL fragment shader program Read texel values from output textures and map back to tensor
CPU
OffscreenCanvas, WebGL2, WebAssembly
○ Direct texel lookup ○ Lots more texture formats, including integer textures ○ 3D textures ○ Non-power-of-2 texture support ○ No more loop restrictions in shaders ○ Uniform buffer objects - much faster binding and access
○ Binary, web-native compilation target from other languages, such as C/C++
How do models make it to widespread use?
Ease of use Clinically validated
distill.pub
GPUs
Preprocessing Annotation Modeling Training Deployment Validation
Cloud (e.g. docker, kubernetes) Edge (e.g. Keras.js) Data Ingestion Anonymization Preprocessing Continuous Create labels Architecture engineering (automated?)
Source: http://theconversation.com/how-the-internet-was-born-from-the-arpanet-to-the-internet-68072 Source: https://en.wikipedia.org/wiki/Scale-free_network