Breast density, a measure of the proportion of dense tissue to the total breast area, is a significant risk factor for breast cancer. Precise segmentation of dense tissues and the overall breast area is vital for calculating breast density. While semi-automatic and fully automatic computer-aided design tools have been developed to estimate breast density percentages in mammograms, these tools often fall short. They are typically limited to specific mammogram views and struggle with complete delineation of the pectoral muscle. Furthermore, these tools often perform poorly in cases of data variability and frequently require an experienced radiologist to adjust the segmentation threshold for dense tissue within the breast area. This challenge calls for the development of a new deep learning architecture that can automatically estimate the area-based breast percentage density from mammograms, overcoming the limitations of current approaches.

## How to solve the problem

The task of predicting breast density can be approached in two ways. One approach is to treat it as a regression problem, where the goal is to develop a model that, given an input mammogram, outputs a density value in the range of 0-100:

![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F17866327%2F44610acb81f4e92a3cf907681176e12c%2Fregression_model.png?generation=1701085628213273&alt=media)

The other, and often preferred, approach is to treat it as a segmentation task. In this case, two separate segmentation models need to be developed. The first model is used to segment the breast area, and the second is used to segment the dense tissues. The breast density is then calculated by dividing the sum of the dense-tissue segmentation binary mask by the sum of the predicted breast-area segmentation mask, and multiplying the result by 100. This gives the percentage of the breast area that is composed of the dense tissues:


![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F17866327%2Feb159ee1aae90a0b2ad39216060d75ad%2Flagrida_latex_editor.png?generation=1701084917247253&alt=media)

'N' refers to the total number of pixels present in each of the predicted segmentation masks for the breast area and dense tissues, individually, containing the white pixels only.

One way to implement the segmentation approach is to use a multi-task learning approach, where a model is trained to predict both the breast area and the dense tissues simultaneously, as proposed by [Gudhe et. al](https://www.nature.com/articles/s41598-022-16141-2), depicted below.  The architecture consists of an encoder, a bottleneck, and task-specific decoders. The encoder extracts low- and high-level imaging features from the input mammogram, which are then processed by the bottleneck unit to extract more complex and spatial information at different resolutions. The task-specific decoders simultaneously segment the breast area and dense tissues. The loss function, focal Tversky loss, is computed using the predicted and ground-truth segmentations of the breast area and dense tissues. A modified weight adaptive multi-task loss function is used for the segmentation task, computing the combined loss of the breast-area and dense-tissue segmentation tasks. The predicted segmentation outputs are overlaid on the original mammogram, with the predicted segmented breast area shown as a red contour line and the predicted fibroglandular tissues within the breast area represented by solid green pixels.

![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F17866327%2F466b94eb715fd115671c1c20dd1a4e46%2F41598_2022_16141_Fig4_HTML.webp?generation=1701083384940700&alt=media)

# Important Note

In this challenge, participants will encounter differences between ground truth density labels and the values computed using the dense tissue/breast area formula. If they choose a segmentation approach to predict density values, they should consider this discrepancy. To address it, participants can modify the loss function to include three terms:

1. **L_dense_tissue_segmentation**: Loss related to dense tissue segmentation.
2. **L_breast_area_segmentation**: Loss related to breast area segmentation.
3. **L_(Y-\hat Y)**: Loss corresponding to the difference between predicted and actual breast density value.

However, if participants opt for a regression-based method—where they predict density values directly from input mammograms—there is no need to account for segmentation losses.

# Github
The source code for the segmentation approach (only considering the segmentation losses) is available in the provided [Github repository](https://github.com/uefcancer/Deepdensity). Participants are encouraged to utilize and enhance this model for the challenge density estimation task.
