Research demo, not for clinical use. Public dataset images only. Results are saved unless you choose to run the model live, which happens on your device.

ColonoScan

Finding polyps in colonoscopy images, pixel by pixel

ColonoScan is a university project: a platform for analysing colonoscopy video and histopathology slides with deep learning. This page shows the trained polyp segmentation model's real output on public images, and lets you run that model on them in your own browser.

Model output on eight public images

Saved results appear first: the repo's weights ran on CPU over each image once, and this page replays what they produced. You can also run the model yourself, live on your own device. Choose an image, then compare the model with the expert annotation.

Run the model live in your browser

Your device runs the model on the image above, using WebAssembly. The first run downloads about 41 MB. No image or result is sent to a server, and it only runs on these eight public images, so there is no upload.

The live model has the same trained weights, stored as 16-bit floats to cut the file from 80 MB to 40 MB. Against the original PyTorch model on these eight images, its masks had an IoU of at least 0.999, with at most 8 of 65,536 pixels different, so a live score can differ from the saved one in the third decimal place.

Show on the image
IoU, saved
Dice, saved
Predicted polyp area, saved

IoU and Dice compare this one prediction with the dataset's annotation at 256 by 256 pixels.

These images were picked from the notebook's 20% validation split, reproduced from its random seed, and hand-picked to exclude any frame with text burned in. The eight-image scores are therefore not a fair estimate of accuracy. Use the table below for that.

How the model scored on whole datasets

Saved evaluation from Jupyter-Notebook/Colonoscopy/EfficientUnetPP Colonoscopy model.ipynb. The model trained on Kvasir-SEG and CVC-ClinicDB. The drop on the other two datasets shows how much harder images from unseen sources are.

DatasetRoleImagesIoUDice
Kvasir-SEG + CVC-ClinicDBValidation, also used for early stopping3230.84150.9000
CVC-ColonDBExternal test3800.66480.7469
PolypGenExternal test1,5370.49800.5900

Histopathology patch classifier

The second model, an EfficientNet-B3, labels colon tissue patches as normal or adenocarcinoma. It is not interactive here.

800 of 800

Test patches classified correctly in the saved run of monai-efficientnet-cnn.ipynb (390 normal, 410 adenocarcinoma), on the notebook's lung_colon_image_set data. A perfect score on one public patch dataset says little about real slides, and the model has not been tested on any other source.

How it works

  1. Prepare. Resize the frame to 256 by 256 and normalise it with ImageNet statistics.
  2. Segment. A UNet++ with an EfficientNet-b4 encoder outputs a probability for every pixel.
  3. Threshold. Pixels above 0.5 become the polyp mask, which is scaled back up over the frame.

The full system in the repo adds a Next.js frontend, a Django REST backend with Celery and PostgreSQL, and FastAPI inference services, run with Docker Compose. Only the model is shown here.

Saved results came from the PyTorch service in demo/api, in a local container limited to 2 CPU cores, where warm inference took about 1 to 4 seconds per image and used about 620 MB of memory. That service accepts no uploads and is not deployed.

Live runs use the same weights exported to ONNX, and onnxruntime-web 1.30.0 served from this site. The page repeats the same three steps in your browser, and no server does any inference. demo/export reproduces the model file and its comparison with PyTorch.