GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - victor201202/camelyon16-thumbnail-tissue-segmentation: Thumbnail-level tissue segmentation on CAMELYON16 with ALBS, a preprocessing-based masker, and ALBSRefiner, a compact learned refiner.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
.cache
.cache
 
 
CAMELYON_16_samples/thumbnails
CAMELYON_16_samples/thumbnails
 
 
benchmarks
benchmarks
 
 
notebooks
notebooks
 
 
reports/main
reports/main
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

ALBS for CAMELYON16 Thumbnail Tissue Segmentation

This repository focuses on thumbnail-level tissue segmentation on CAMELYON16. The main objective was to design a tissue masking pipeline that is accurate enough to be useful in practice, while still being fast and interpretable. The benchmark and the report were built around that goal: they are there to evaluate the pipeline properly and to show what actually improves it.

The project centers on one hand-designed method and one learned extension. ALBS was built directly out of classical preprocessing techniques, especially background estimation, non-gray filtering, and morphology. The main question behind the work is simple: can a strong classical tissue masker go far enough on its own, and if not, where does a small learned refiner add real value?

  • ALBS (Adaptive Lab Background Subtraction): a hand-designed tissue masker created from classical preprocessing techniques such as Lab-space background estimation, non-gray filtering, and morphology.
  • ALBSRefiner: a compact neural second stage that takes the ALBS mask as a prior and learns local corrections for harder cases such as fragmented tissue and uncertain boundaries.

The main narrative entry point is notebooks/main_report.ipynb. If you want the script-oriented workflow first, see benchmarks/README.md.

Full benchmark summary

Project in one minute

  • Problem: separate tissue from background on histopathology thumbnails.
  • Main goal: build a tissue-segmentation pipeline that is both accurate and practical to use.
  • Core method: ALBS, a fast and interpretable masker built from classical preprocessing techniques.
  • Extension: ALBSRefiner, which keeps ALBS as the starting point and learns local corrections.
  • How it is validated: a reproducible benchmark and report that measure accuracy, runtime, and failure cases.
  • Best place to start: notebooks/main_report.ipynb.

Main takeaways

  • On the full 395-thumbnail benchmark, ALBS reaches 0.838 mean Dice, which is the strongest classical result among the baselines included here.
  • On the locked holdout split (300 train / 95 test), ALBSRefiner reaches 0.913 Dice and improves over ALBS, which reaches 0.844 Dice.
  • On that same holdout, ALBS averages 17.70 ms per thumbnail, while ALBSRefiner averages 56.36 ms.

Sources:

  • reports/main/tables/method_summary_full395.csv
  • reports/main/tables/method_summary_holdout_test95.csv

Why CAMELYON16

CAMELYON16 is a public computational pathology dataset built around whole-slide lymph node images, with tumor and normal cases and annotations that make it useful for downstream cancer-detection research. In this repository, the work is done at thumbnail level, but the dataset still gives the project a real and recognizable pathology setting instead of a private or toy example.

It was chosen because it is widely used, relevant to real digital pathology workflows, and strong enough to make the tissue-segmentation task meaningful. Using CAMELYON16 makes it easier to evaluate whether the proposed masking pipeline is actually useful on realistic data rather than only on hand-picked examples.

Why thumbnails

This project works on thumbnails rather than full whole-slide resolution on purpose. It keeps iteration manageable, makes side-by-side benchmarking much easier, and isolates the tissue-versus-background problem clearly before moving to heavier tile-level inference. In a real whole-slide pipeline, that still matters, because a thumbnail-level tissue mask is a practical first filter for removing obvious background and focusing later computation.

Why tissue masking matters

Whole-slide images are very large, and a lot of that area is often empty background. If a downstream model has to process everything, it wastes time and compute on regions that are not useful.

That is why tissue masking matters here. A good tissue mask acts as a first filter: it removes obvious background, reduces the number of tiles that need to be processed later, and keeps the pipeline focused on the regions that actually contain tissue.

In this project, that is the practical role of ALBS. Even before the learned refiner is introduced, the method is meant to be a fast and interpretable preprocessing step that makes later analysis more efficient.

What the main report covers

The report notebook follows a clear progression:

  1. Dataset inspection and thumbnail-level EDA.
  2. Design and intuition behind ALBS.
  3. Full benchmark across the 395-image sample.
  4. Error analysis to understand where ALBS struggles.
  5. Motivation for a learned refiner.
  6. Locked-holdout evaluation of ALBSRefiner.
  7. Holdout error analysis, grouped gains, and qualitative case studies.
  8. Final conclusions.

That structure is important for this repo. It is best read as a solution-oriented technical case study: the segmentation pipeline is the main subject, and the benchmark is the evidence used to test and refine it.

Start here

Open the main report:

jupyter lab notebooks\main_report.ipynb

If you mainly want to inspect generated outputs first, a good starting set is:

  • reports/main/figures/full_benchmark_quality_speed.png
  • reports/main/figures/albs_feature_correlations_full395.png
  • reports/main/figures/albs_dev_best_worst.png
  • reports/main/figures/holdout_delta_dice_hist_refiner_vs_albs.png
  • reports/main/figures/holdout_refiner_delta_breakdown_by_group.png

Quick setup

Create a virtual environment and install the benchmark dependencies:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r benchmarks\requirements.txt

If you want to train the refiner yourself, also install:

python -m pip install -r benchmarks\requirements_refiner.txt

Common runs

Quick smoke test:

python -m benchmarks.tissue_benchmark --limit 10 --output-csv .tmp\benchmark_results.csv

Full 395-image benchmark with the main classical baselines:

python -m benchmarks.tissue_benchmark --methods albs,qupath_simple_equivalent,histoqc_equivalent,clam_hsv_otsu,tiatoolbox_otsu,tiatoolbox_morphological,histomicstk,histolab_equivalent --output-csv reports\main\tables\benchmark_results_full395.csv

Locked-holdout comparison between ALBS and ALBSRefiner:

python -m benchmarks.tissue_benchmark --split-json .cache\splits\camelyon16_holdout_seed42.json --subset test --methods albs,albs_refiner --output-csv reports\main\tables\benchmark_results_holdout_test95.csv

If you want to include GrandQC in a run, add grandqc_tissue to --methods and either pass --download-grandqc or provide --grandqc-weights <path>.

Repo layout

  • notebooks/ contains the main report notebook and the supporting refiner notebook.
  • benchmarks/ contains the benchmark runner, baseline implementations, split generation, and refiner training code.
  • reports/main/ contains the saved figures and tables used by the report.
  • tests/ contains the current regression and model checks.
  • .cache/ stores the holdout split, refiner artifacts, and optional downloaded weights.

The main supported workflow is: run the benchmark code when needed, then read the results through notebooks/main_report.ipynb.

Tests

Run the current test suite with:

python -m unittest -v

References

ALBS and ALBSRefiner are the methods proposed in this repository. The list below covers the external baselines and tools used for comparison.

Some baselines are called through the original Python packages, while others are equivalent-style thumbnail reimplementations collected in benchmarks/baselines.py so everything can be compared in one reproducible workflow.

  • QuPath Simple Equivalent: based on QuPath's simple tissue detection command. This repo uses a thumbnail-level equivalent implementation rather than QuPath itself. Source: QuPath commands docs
  • HistoQC Equivalent: based on the foreground masking approach used in HistoQC. This repo uses an equivalent-style thumbnail implementation. Source: HistoQC repository
  • CLAM HSV Otsu: based on the public CLAM preprocessing / tissue segmentation workflow. This repo uses a lightweight baseline in that style. Source: CLAM repository
  • TIAToolbox Otsu and TIAToolbox Morphological: official TIAToolbox tissue maskers used through the Python package. Source: TIAToolbox tissue masking docs
  • HistomicsTK: wraps saliency.tissue_detection.get_tissue_mask from HistomicsTK. Source: HistomicsTK simple tissue detection docs
  • Histolab Equivalent: based on Histolab tissue masks and default filtering steps. This repo uses an equivalent implementation for compatibility and easier benchmarking on Python 3.11. Source: Histolab tissue mask docs
  • GrandQC Tissue: based on the public GrandQC tissue model. Source: GrandQC repository

Additional background references that fit the broader whole-slide preprocessing and tissue-masking context:

  • Whole-Slide Image Preprocessing in Python: practical walkthrough of whole-slide preprocessing steps in Python. Source: python-wsi-preprocessing documentation
  • A novel method for tissue segmentation in high-resolution H&E-stained histopathological whole-slide images: background paper on tissue segmentation in histopathology WSIs. Source: ScienceDirect article

Notes

  • The bundled sample data lives under CAMELYON_16_samples/thumbnails/.
  • The current report expects the cached split file and refiner artifacts in .cache/.
  • The refiner notebook is notebooks/train_eval_albs_refiner.ipynb.

About

Thumbnail-level tissue segmentation on CAMELYON16 with ALBS, a preprocessing-based masker, and ALBSRefiner, a compact learned refiner.

Topics

camelyon16computational-pathologycomputer-visiondigital-pathologyhistopathologyimage-segmentationpythonpytorchtissue-segmentationwhole-slide-imaging

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.