Skip to content
advancedscience

BRACS Breast Lesion Regions on a Gigapixel Whole-Slide Image

Outline and label breast lesion regions with seven BRACS categories in the deep-zoom viewer, then train a tiled Mask R-CNN. The sample slide is illustrative.

Get This Design

View on GitHub(opens in a new tab)

Clone or download from the repository

Quick start:

bash
git clone https://github.com/davidjurgens/potato-showcase.git
cd potato-showcase/science/pathology/bracs-breast-roi-subtyping
potato start config.yaml

About this dataset

BRACS (BReAst Carcinoma Subtyping) is a dataset of hematoxylin and eosin stained breast histology from Brancati et al. (2022). The dataset holds 547 whole-slide images from 189 patients and 4539 regions of interest extracted from 387 of the slides (151 patients), scanned at 40x on an Aperio AT2 scanner. The labels cover seven categories, which include two atypical lesion types between benign and malignant tissue.

Three pathologists annotated both levels. Each pathologist labeled a slide with the most aggressive subtype found, the three checked every label together, and a label without consensus was discarded. Each pathologist then extracted regions in QuPath, and each region carries one category. The design reproduces the region labels as polygons or boxes on the slide in Potato's deep-zoom viewer, adds a slide-level radio scheme, and asks for three annotators per item. The license is stated inconsistently. The dataset website says Creative Commons Attribution-NonCommercial 4.0, and the paper's data-access section refers to terms of use described as a CC0 license. The design follows the website, and no BRACS image is bundled either way. All ten sample items use CMU-1-Small-Region.svs, a CC0 slide region from the OpenSlide test data that is not from BRACS. The slide region is a 2220 by 2967 pixel single-level file, much smaller than a real gigapixel scan, and the items are illustrative.

The model_training block shows the training loop. On the admin training page, the torchvision-segment trainer fine-tunes a Mask R-CNN on the annotators' outlines and labels. The tiling settings cut each slide into 1024-pixel tiles with 128 pixels of overlap and train a 40x scan at 20x, so the model sees tissue detail instead of a thumbnail. Predictions come back as editable polygon pre-labels in whole-slide coordinates. The loop does not serve or deploy a model and makes no diagnosis.

Whole-slide images
547
Regions of interest
4539
Patients (all slides)
189
Lesion categories
7
Pathologist annotators
3
Scan resolution
40x (0.25 µm/pixel)

Configuration File

This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.

yaml
# BRACS - BReAst Carcinoma Subtyping: lesion regions on a whole-slide image
#
# Paper: Brancati, N., Anniciello, A. M., Pati, P., Riccio, D., Scognamiglio, G.,
#   Jaume, G., De Pietro, G., Di Bonito, M., Foncubierta, A., Botti, G.,
#   Gabrani, M., Feroce, F., and Frucci, M. (2022). BRACS: A Dataset for BReAst
#   Carcinoma Subtyping in H&E Histology Images. Database, 2022.
#   @article{Brancati_2022,
#     title={BRACS: A Dataset for BReAst Carcinoma Subtyping in H&E Histology Images},
#     volume={2022}, journal={Database}, publisher={Oxford University Press (OUP)},
#     author={Brancati, Nadia and Anniciello, Anna Maria and Pati, Pushpak and Riccio, Daniel and Scognamiglio, Giosue and Jaume, Guillaume and De Pietro, Giuseppe and Di Bonito, Maurizio and Foncubierta, Antonio and Botti, Gerardo and Gabrani, Maria and Feroce, Florinda and Frucci, Maria},
#     year={2022}, DOI={10.1093/database/baac093} }
# DOI: 10.1093/database/baac093
# Dataset: https://www.bracs.icar.cnr.it/ (registration required to download;
#   Creative Commons Attribution-NonCommercial 4.0, per the dataset's Background
#   page. The paper's data-access section instead calls the terms of use a CC0
#   license; the sources disagree, and this design follows the website.)
#
# The dataset holds 547 whole-slide images (WSIs) from 189 patients and 4539
# regions of interest (ROIs) extracted from 387 WSIs collected on 151 patients,
# scanned at 40x (0.25 um/pixel). Three pathologists
# annotated both levels. Per the paper, each pathologist labeled a WSI with the
# most aggressive subtype found, the three then checked every label together, and
# a label without consensus was discarded. Each pathologist then extracted ROIs
# in QuPath, and "each extracted ROI corresponds to a unique category".
#
# Label glossary (the seven categories, from the paper's introduction):
#   Normal (N), Pathological Benign (PB), Usual Ductal Hyperplasia (UDH),
#   Flat Epithelial Atypia (FEA), Atypical Ductal Hyperplasia (ADH),
#   Ductal Carcinoma in Situ (DCIS), Invasive Carcinoma (IC).
# The paper groups them as benign (N, PB, UDH), atypical (FEA, ADH), and
# malignant (DCIS, IC).
#
# THE SAMPLE DATA IS ILLUSTRATIVE. BRACS images cannot be redistributed, so the
# ten items all point at CMU-1-Small-Region.svs, a CC0 Aperio slide region from
# the OpenSlide test data. It is not from BRACS, its tissue type is not stated in
# the listing, and it is a single-level 2220 x 2967 pixel file, far smaller than a
# real gigapixel slide. The deepzoom viewer, the tile pyramid and the training
# loop are the same ones a 100,000-pixel scan uses.
# See media/LICENSE-media.txt.
#
# Adaptations:
#   - One image per item, drawn on with polygons and boxes. BRACS ROIs are
#     exported as PNG crops with a label in the filename; here an ROI is a
#     labeled shape on the slide, as the pathologists marked them in QuPath.
#   - A slide-level label (the most aggressive subtype) is a separate radio scheme.
#   - Three annotators per item stand in for the three pathologists. Potato keeps
#     each annotator's answer; the consensus discussion in the paper is not modeled.
#   - Labels use the paper's full names; abbreviations appear only in comments.
#
# Install and run (openslide is needed to read .svs files):
#   pip install "potato-annotation[wsi]"
#   potato start config.yaml -p 8000
#
# Training (what it does and does not do): open /admin/training with the admin
# key below, pick torchvision-segment (pip install "potato-annotation[train-vision]")
# and the lesion_regions scheme, and click Train now. The trainer fine-tunes a
# torchvision Mask R-CNN on the annotators' outlines and labels, cutting the slide
# into tiles (model_training.tiling) so a whole slide is never resized to a thumbnail.
# Its predictions come back as editable polygon prelabels in whole-slide
# coordinates. It does not serve or deploy the model and it makes no diagnosis.
# A diagnostic claim needs a clinical study, not this demo.

port: 8000
annotation_task_name: "BRACS breast lesion regions on a whole slide"
task_dir: "."

data_files:
  - sample-data.json

item_properties:
  id_key: id
  text_key: note

media_directory: media

output_annotation_dir: "annotation_output/"
export_annotation_format: jsonl

require_password: false
admin_api_key: "demo-admin-key"

user_config:
  allow_all_users: true
  users: []

# Three pathologists read every case in the BRACS protocol.
num_annotators_per_item: 3

annotation_instructions: |
  Open the slide and zoom in. Outline each lesion region with the polygon tool,
  or box it, and give it one of the seven BRACS categories. Each region gets a
  single category. Then choose the slide-level label, which is the most
  aggressive subtype you found anywhere on the slide.
  The slide here is a CC0 sample that is not from BRACS, so regions are for practice.

annotation_schemes:
  - annotation_type: image_annotation
    name: lesion_regions
    description: "Outline or box each lesion region on the slide and assign one BRACS category."
    source_field: image
    # Required for slides: the default viewer sends the image as one file.
    viewer: deepzoom
    tiles:
      tile_size: 254
      overlap: 1
      navigator: true
    tools: [polygon, bbox]
    labels:
      - name: Normal
        color: "#2e9e5b"
      - name: Pathological Benign
        color: "#6cc4a1"
      - name: Usual Ductal Hyperplasia
        color: "#e3c341"
      - name: Flat Epithelial Atypia
        color: "#f19a3e"
      - name: Atypical Ductal Hyperplasia
        color: "#e0602f"
      - name: Ductal Carcinoma in Situ
        color: "#b8307a"
      - name: Invasive Carcinoma
        color: "#6a2c91"

  - annotation_type: radio
    name: slide_label
    description: "Slide-level label: the most aggressive subtype present on the slide."
    labels:
      - Normal
      - Pathological Benign
      - Usual Ductal Hyperplasia
      - Flat Epithelial Atypia
      - Atypical Ductal Hyperplasia
      - Ductal Carcinoma in Situ
      - Invasive Carcinoma

model_training:
  enabled: true
  writeback:
    schemas: ["lesion_regions"]
    include_unlabeled: true
    min_confidence: 0.5
  # Keys verified in potato/training/tiling.py. Train a 40x scan at 20x. Regions
  # are drawn on part of each slide, so no empty background tiles are sampled.
  tiling:
    enabled: auto
    tile_size: 1024
    overlap: 128
    downsample: 2
    background: 0

Sample Data

json
[
  {
    "id": "bracs_001",
    "image": "CMU-1-Small-Region.svs",
    "note": "Illustrative case. Outline the densest region and give it a BRACS category."
  },
  {
    "id": "bracs_002",
    "image": "CMU-1-Small-Region.svs",
    "note": "Illustrative case. Mark a region you would call benign and one you would not."
  }
]

// ... and 8 more items

Dataset & paper

Brancati et al., Database 2022

Paper DOI
10.1093/database/baac093

Citation (BibTeX)

bibtex
@article{Brancati_2022,
  title = {BRACS: A Dataset for BReAst Carcinoma Subtyping in H&E Histology Images},
  volume = {2022},
  ISSN = {1758-0463},
  url = {http://dx.doi.org/10.1093/database/baac093},
  DOI = {10.1093/database/baac093},
  journal = {Database},
  publisher = {Oxford University Press (OUP)},
  author = {Brancati, Nadia and Anniciello, Anna Maria and Pati, Pushpak and Riccio, Daniel and Scognamiglio, Giosuè and Jaume, Guillaume and De Pietro, Giuseppe and Di Bonito, Maurizio and Foncubierta, Antonio and Botti, Gerardo and Gabrani, Maria and Feroce, Florinda and Frucci, Maria},
  year = {2022},
  month = jan
}

Details

Annotation Types

image_annotationradio

Domain

PathologyMedical ImagingOncology

Use Cases

Gigapixel Image AnnotationWhole-Slide Region LabelingHistopathology Annotation

Tags

bracsbreast cancerhistopathologywhole-slide imagegigapixeldeepzoomopenslidetilingmask r-cnnpathology

Found an issue or want to improve this design?

Open an Issue(opens in a new tab)