Capsule Endoscopy

(Warning for the squeamish - contains pictures)

Bowel Cancer is Significant

In the UK Bowel Cancer accounts for 26 deaths per 100,000 people 
~16k/year UK, 51k/year US

Highly treatable and survivable if detected early

Current diagnosis: Colonoscopy

Problems with Colonoscopy

Patient aversion

Requires skilled operators (operation & diagnostics in real time)

Requires hospital facilities

Risk of perforation 0.57%

Capsule Endoscopy

Patient friendly

No operator

Use at home

No risk

But - still requires diagnostic skill and now generates very large number of images.

Towards automated diagnostics

Machine Learning promises automated diagnostics

Reduce cost of diagnosis

Scale to review many more images than manual colonoscopy

Scale to many more patients to enable large-scale screening programs

A work in progress

Stage 1: Create a review interface that generates tagged training data

Stage 2: Create interface that supports assisted diagnosis using trained ML
(and creates feedback loop of new tagged training examples)

Aspirational Goal: Fully automated diagnosis

Stage 1 Application

Key Wolfram Language Elements

Process control

StartProcess, ProcessStatus etc

Uses FFPEG for video to image processing

Plan to migrate to native video tools in 12.1

Image processing

Opening, GradientFilter, Filling Transform, Erosion, Closing etc

Detect and remove obstructions

Detect and remove bubbles

bubbleDetect[]

deBubble[]

Parallel tools

LaunchKernels, ParallelTable etc

Multi-core processing of large numbers of video frames

Preparation for scaled server deployment

Dynamic Interfaces

Dynamic, EventHandler, Tooltip, Button, InputField etc

Data processing

Import, Export, XMLElement etc, Database integration

Import patient record data

Return AI detections (positions and probabilities and frame and detection type etc)

Return audit data (which AI, which human, when etc)

The Team

Wolfram Technical Services Europe - Lead: Dr Sjoerd Smit

Corporate Health International

Highland Health Board

NHS Arden & GEM

Barcelona University

Satellite Applications Catapult

Highlands & Islands Enterprise

code

AppendTo[$Path,"/Users/jonm/git/nhs-colonoscopy-project/Code/"];
Needs["NHSColonoscopy`"];

bubbleDetect[img_]:=bubbleMask[{img},Binarize[img,0]];
deBubble[img_]:=With[{res=bubbleDetect[img]},ImageMultiply[First@Keys[res],ColorNegate@First@Values[res]]]