Multi-View and Multi-Scale Alignment for Contrastive Language-Image Pre-training in Mammography

## Abstract

Abstract Contrastive Language-Image Pre-training (CLIP) shows promise in medical image analysis but requires substantial data and computational resources. Due to these restrictions, existing CLIP applications in medical imaging focus mainly on modalities like chest X-rays that have abundant image-report data available, leaving many other important modalities under-explored.
Here, we propose the first adaptation of the full CLIP model to mammography, which presents significant challenges due to labeled data scarcity, high-resolution images with small regions of interest, and data imbalance.
We first develop a specialized supervision framework for mammography that leverages its multi-view nature. Furthermore, we design a symmetric local alignment module to better focus on detailed features in high-resolution images. Lastly, we incorporate a parameter-efficient fine-tuning approach for large language models pre-trained with medical knowledge to address data limitations. Our multi-view and multi-scale alignment (MaMA) method outperforms state-of-the-art baselines for three different tasks on two large real-world mammography datasets, EMBED and RSNA-Mammo, with only 52% model size compared with the largest baseline. The code is available at https://github.com/XYPB/MaMA . 1 1 1 This work is also the basis of the overall best solution for the MICCAI 2024 CXR-LT Challenge.

## 1 Introduction

Contrastive learning [, , ] has become one of the most popular self-supervised representation learning paradigms due to its intuitive concept and robust performance. Contrastive learning removes the reliance on a supervised signal by optimizing the semantic distance for similar pairs in the representation space in a contrastive manner. More recently, the introduction of natural language signals to contrastive learning [] has given rise to modern visual-language models [, , ]. Contrastive Language-Image Pre-training (CLIP) [] has also been widely applied in the medical imaging domain [, , , , , , ] and shows promising improvement in medical image understanding when large-scale medical imaging datasets are available [, , , ].
However, the CLIP model in the natural image domain usually demands more than hundreds of millions of image-text pairs to be properly trained [, , , ], which is almost impossible in the medical domain due to privacy and security concerns. Existing medical CLIP methods either build general-purpose CLIP models with multiple anatomical sites and modalities from public online databases [, ] or focus on imaging modalities with large-scale (less than a million) datasets, *e*.*g*., chest X-ray or pathology images [, , , , , , , , ]. This means other imaging modalities, such as mammography, have yet to fully benefit from such visual-language pre-trained models.

Figure: Figure 1: Comparison of Three Visual-Language Contrastive Learning Frameworks. (a) CLIP [] style; (b) SLIP [] style; (c) Proposed MaMA that aligns image-image and image-text features, exploiting the multi-view nature of mammography and aligning images from the same study.
Refer to caption: x1.png

Mammography is a critical medical imaging modality for breast cancer screening and diagnosis, as breast cancer is one of the most commonly diagnosed cancers globally and a leading cause of cancer-related mortality in women []. While visual-language pre-training (VLP) has the potential to improve mammography interpretation, there are two major obstacles: 1) *Limited data and annotation*: Recent work has introduced a large-scale mammography image and tabular dataset of more than 110,000 patients, *i*.*e*., EMBED [], but no corresponding clinical reports are available.
2) *Nature of mammography*: Different from the single view natural image or chest X-ray, each mammography study usually contains four high-resolution ($\sim$2,000-by-2,000 pixels) views of the same patient: left and right side, each with craniocaudal (CC) and mediolateral oblique (MLO) views. Such multi-view mammography has the critical properties of *bilateral asymmetry* [] and *ipsilateral correspondence* []. Bilateral asymmetry means images from different sides of the same patient can contain different information, *e*.*g*., density, calcification, and mass findings. Ipsilateral correspondence means different views of the same side share similar information from different viewpoints. Clinicians consider both properties and all four images at once as a cross reference when reading a study. Meanwhile, lesions of interest are often relatively small compared with high-resolution mammograms, which further challenges a model’s ability to focus on local details. This pixel-level imbalance compounds the problem of image-level imbalance, in which the vast majority of mammograms will not contain cancer. While one recent work [] attempts to address these issues by leveraging VLP, they take a fine-tuning approach in which they simply adopt a pre-trained CLIP model and perform supervised fine-tuning to a zero-shot classification task for multi-view mammography, rather than capitalizing on the mammography domain information to perform contrastive language-image pre-training for mammography representation learning [].

To address these challenges, we propose a novel Multi-view and Multi-scale Alignment *i*.*e*., MaMA, contrastive language-image pre-training framework that exploits the multi-view property of mammography and aligns multi-scale features simultaneously.
We first propose an intuitive method for template-based report construction from tabular data to resolve the lack of clinical reports and enable VLP.
The proposed model then optimizes both multi-view image-image and symmetric text-image contrastive loss simultaneously (Fig. 1), learning the correspondence between the multi-view images and image-report relationship from the same mammography study. We then propose a novel symmetric local alignment module that actively learns sentence-patch relationships by computing similarity scores for each image-text pair.
We also incorporate parameter-efficient fine-tuned large-language models (LLMs) pre-trained with medical domain knowledge to improve the understanding of the report while addressing data scarcity.
We validate our method on two large-scale mammography datasets, EMBED [] and RNSA-Mammo [], with multiple settings compared with state-of-the-art medical CLIP methods. The proposed method surpasses all the baselines with a considerable gap with only 52% model size, showing promise on multiple mammography-related tasks.

## 2 Related Works

#### Medical Visual-Language Pre-training

Existing medical VLP methods can be divided into two types depending on the training data. The first type is the general-purpose medical CLIP model trained with a large-scale medical-image dataset with multiple anatomical sites and imaging modalities derived from PubMed [, ]. This approach mainly focuses on scaling dataset size while using a vanilla CLIP design []. These models show promising generalization ability on multiple sites but are often suboptimal compared with modality-specific models due to the lack of a specific design for the individual image modality. The other type of VLP models mainly focuses on chest X-ray [, , , , , , , ] due to the availability of large datasets, trained on either MIMIC-CXR [] or CheXpert [] datasets. While these methods show impressive performance on chest-specific tasks, they are specially designed for single-view images like regular CLIP []. Some of the methods further require full clinical reports paired with the image [, , ], which makes them harder to adopt.
Recently, Chen *et al*. [] proposed a first attempt to introduce CLIP to mammography. It fine-tunes a pre-trained CLIP model with an added multi-view image aggregation module to a zero-shot classification task.
However, the method does not perform contrastive pre-training, ignores pixel-level data imbalance, and cannot correlate the medical report with fine-grained ROIs.
Furthermore, they only fine-tuned a pre-trained CLIP model with a few thousand private cases.

#### Multi-view Contrastive Learning

To obtain a more robust self-supervised contrastive learning framework, methods like SLIP [] (Fig. 1 (b)) and DeCLIP[] exploit image-image contrastive learning along with image-text contrastive learning simultaneously.
Such ideas have been applied to 3D shape recognition [, ] by exploiting the nature of 3D shapes from different viewpoints and also to the action recognition task in the real world []. These methods all exploit the multi-view nature of the specific image modality, where images of the same object from different viewpoints share the same semantic meaning while having different appearances. Multi-view contrastive learning has also been utilized in mammography [, , ], where the multi-view consistency is leveraged to actively learn high-level shared information within the multi-view mammography. However, to the best of our knowledge, none of the existing works combine multi-view mammography contrastive learning with CLIP to fully utilize the supervising signal from the multimodal data.

#### Unsupervised Local Contrastive Learning

Correlating a dense visual representation with fine-grained semantic meaning is not only helpful for image understanding but vital to tasks like semantic segmentation. Recent work address this problem in the challenging unsupervised scenario [, , , , , , , ]. Some methods rely on a pre-trained object detector or segmentation model to extract the region of interest [].
Other methods either aggregate dense similarity scores and conduct image-level contrastive learning [, , ], which may ignore too much visual information during training, or exhaustively conduct token-level language-image matching and optimize patch-level contrastive loss [, , ], with the cost of additional computation.

## 3 Method

Figure: Figure 2: Proposed Multi-view and Multi-scale (MaMA) VLP Framework. (a) We utilize the multi-view information of mammography to conduct symmetric image-image and image-text contrastive learning. (b) We localize the most relevant sentence for each image patch and the most relevant patch for each sentence and align these matched local features via symmetric local alignment.
Refer to caption: x2.png

In this section, we introduce the proposed MaMA (Fig. 2). We begin with the construction of the structured mammography report from the tabular data. We then introduce the multi-view contrastive image-text pre-training framework, followed by the proposed symmetric local alignment (SLA).

### 3.1 Structured Report Construction

Different from chest X-ray datasets that provide paired images with corresponding clinical reports, *e*.*g*., MIMIC-CXR [], large-scale mammography datasets with the full report available are rare. Rather, existing datasets in this domain [, , ] mainly provide a tabular structure annotation including both the anonymized meta information as well as the clinical findings, *e*.*g*., breast density type, calcification findings, tumor description, and Breast Imaging Reporting and Data System (BI-RADS) assessment category [].
Clinical findings serve as cross-validation evidence for the final diagnosis. Using a CLIP-style [] caption with only the simple class label for cancer will result in a highly simplified caption and limit the model’s understanding of the image due to missing details.

We propose a template-based caption construction method following the standard clinical report structure [] (Fig. 2 (a)). We first create a report template with segments describing *study procedure*, *patient meta-information*, *image meta-information*, *breast composition*, *findings*, *clinical impression* and the final *overall assessment* in a natural language report style. Each segment contains keywords that can be replaced with the corresponding meta-information in the tabular data. By replacing these keywords and concatenating these segments, we can build a complete clinical report for each specific image, and provide more details for language-image contrastive learning. We provide the full template and a few image-caption examples in the appendix.

#### Meta-Info Masking

The increased information from patient and image-specific meta-data may be memorized by the model during the contrastive training and result in learning shortcuts for the model decision. To focus more on the diagnosis and disease-related information, we propose a data augmentation method that randomly masks each patient or image meta-information keyword with a probability of $m$ when constructing the caption.

### 3.2 Multi-view VLP

We introduce the multi-view contrastive VLP framework here. Let $\mathcal{D}=\{(x_{i},y_{i}),~{}i=0,1,\dots,N\}$ be a multimodal dataset, where there are $N$ individual images $x_{i}$ and corresponding text captions $y_{i}$. Our framework optimizes both image-to-image and symmetric image-to-text contrastive loss.

#### Multi-view Visual Contrastive Loss

We first optimize the contrastive loss within the multi-view images (Fig. 2 (a)). We define a study to include the data from the same imaging session for a patient, including one or more image-text pairs. For a random image-text pair $(x_{i},y_{i})$ from the dataset $\mathcal{D}$, we uniformly sample another image $\tilde{x}_{i}$ from the same study that $x_{i}$ belongs to as the positive sample of $x_{i}$. Note that $\tilde{x}_{i}$ could be $x_{i}$ as the augmented view of the same image is naturally a positive sample. We augment both images with random data augmentation and then feed into the vision encoder $f_{V}$ and $d$-dimensional global embedding projection head $g_{V}$ followed by average pooling to get corresponding visual embedding $v_{i},\tilde{v}_{i}\in\mathbb{R}^{d}$, *i*.*e*., $v_{i}=\mathrm{avg}(g_{V}(f_{V}(x_{i})))$.
We then compute the cosine similarity for each pair of visual embeddings and optimize the InfoNCE [] loss for $v_{i}$ in a mini-batch of size $B$:

$$ $\mathcal{L}_{VV}(v_{i},\tilde{v}_{i})=\log\frac{\exp(sim(v_{i},\tilde{v}_{i})/ \tau_{1})}{\sum^{B}_{j=1}\exp(sim(v_{i},v_{j})/\tau_{1})},~{}\text{where}~{} sim(v_{i},v_{j})=\frac{v_{i}^{T}v_{j}}{\|v_{i}\|\|v_{j}\|},$ (1) $$

where $\tau_{1}$ is the visual temperature constant and $v_{j}$ is the $j$-th visual embedding in the batch.
Since two views of the same side of a study have ipsilateral correspondence, it is natural to treat them as positive samples of each other, as the features, like tumors, present in one view, are often present in the other view as well. On the other hand, even if considering bilateral asymmetry for images from different sides, they still share much high-level information such as patient-level features (e.g., global breast shape similarity, age) and similar breast density.
Introducing multi-view mammography contrastive learning forces the model to learn semantically similar features from images within the same study. This also provides a stronger self-supervised signal than using random augmented images. Our image-to-image contrastive learning framework follows the design of SimCLR [] for simplicity.

#### Symmetric Visual-Text Contrastive Loss

While existing methods like SLIP [] also optimize both image-image and image-text contrastive loss, we note there is a potential contradiction between image-image and image-text objectives when computed for different examples (Fig. 1 (b)), *i*.*e*., $\mathcal{L}_{VV}$ and $\mathcal{L}_{VT}$ are independent and the extra image will introduce unnecessary memory cost. To address this, we propose re-using $v_{i}$ when optimizing $\mathcal{L}_{VT}$ and symmetrically optimizing this loss.

We feed caption $y_{i}$ to the tokenizer and text encoder $f_{T}$ and then the text global projection head $g_{T}$ with average pooling to get the text embedding $t_{i}\in\mathbb{R}^{d}$. We optimize the CLIP [] loss (Fig. 2 (a)):

$$ $\mathcal{L}_{VT}(v_{i},t_{i})=-\frac{1}{2}(\log\frac{\exp(sim(v_{i},t_{i})/ \tau_{2})}{\sum^{B}_{j=1}\exp(sim(v_{i},t_{j})/\tau_{2})}+\log\frac{\exp(sim(t _{i},v_{i})/\tau_{2})}{\sum^{B}_{j=1}\exp(sim(t_{i},v_{j})/\tau_{2})}),$ (2) $$

where $\tau_{2}$ is the learnable language temperature constant. We compute $\mathcal{L}_{VT}$ for both $v_{i}$ and $\tilde{v}_{i}$ for the same $t_{i}$ symmetrically. Namely, we minimize the semantic distance between two images from the same view and the corresponding report simultaneously. We note that even if the information in $y_{i}$ is not completely matched with $\tilde{x}_{i}$, *e*.*g*., different side and view caption, they still share a large overlap in patient-level information.
This encourages the model to mine the high-level shared patient-related features via minimizing $\mathcal{L}_{VT}(\tilde{v}_{i},t_{i})$ while focusing on diagnosis-related information by minimizing $\mathcal{L}_{VT}(v_{i},t_{i})$.

### 3.3 Symmetric Local Alignment (SLA)

Mammography usually contains high-frequency details and the region of interest is usually very small. These properties require a higher image resolution for the deep learning method to work properly. It also challenges the model’s ability to extract important local information and filter out less meaningful background and tissue unrelated to diagnosis. To address these challenges, we propose a symmetric local alignment (SLA) module. Specifically, the SLA module allows the model to determine the local correspondence relationship between each sentence and image patch (Fig. 2 (b)).

We start with extracting local features from input $(x_{i},y_{i})$. We feed the image and caption to the vision encoder $f_{V}$ and text encoder $f_{T}$ respectively, followed by corresponding local projection head $h_{V}$ and $h_{T}$ without pooling to produce output feature sequence $v^{local}_{i}\in\mathbb{R}^{N_{V}\times d}$ and $t^{local}_{i}\in\mathbb{R}^{N_{T}\times d}$, where $N_{V}$ and $N_{T}$ are the length of visual tokens and text tokens, respectively. We then extract sentence-level features by selecting the embedding corresponding to the [SEP] token, which results in a sequence of sentence embeddings $s_{i}\in\mathbb{R}^{S\times d}$, where $S$ is the number of sentences. We extract the image patch-level features by removing the extra functional tokens like [CLS] tokens, resulting in a sequence of patch embeddings $p_{i}\in\mathbb{R}^{P\times d}$, where $P$ is the number of patches.
We then compute the sentence-patch correspondence matrix $C_{i,i}\in\mathbb{R}^{S\times P}$ in the form of cosine similarity, which reveals the relationship between local patches and each sentence in the report. However, we cannot directly supervise the learning of this matrix since we have no access to the local correspondence between the image and the report.
Thus, we aggregate the patch-sentence level correspondence matrix $C_{i,i}$ to an image-report level similarity score.
We start by localizing the patch that has the highest correspondence for each sentence. Namely, we find the most relevant region in the image for each sentence. We call this process Visual Localization. We then average the similarity score for each sentence to obtain a correspondence score which describes the similarity of the most relevant patch for the whole report $c_{i,i}^{V}=\frac{1}{S}\sum_{j}\max_{k}C_{i,i}(j,k)$, where $C_{i,i}(j,k)$ is the similarity between the $j$-th sentence and the $k$-th patch.
Similarly, we conduct Text Localization by finding the most similar sentence feature for each patch and averaging it to get a score for the similarity of the most relevant sentence for the whole image $c_{i,i}^{T}=\frac{1}{P}\sum_{k}\max_{j}C_{i,i}(j,k)$.
We compute the aggregated visual and text localization scores for all $p$ and $s$ in the mini-batch and optimize the InfoNCE [] loss:

$$ $s\mathcal{L}^{V}_{local}(i)=-\frac{1}{2}(\frac{\exp(c^{V}_{i,i}/\tau_{local})} {\sum^{B}_{j=1}\exp(c^{V}_{i,j}/\tau_{local})}+\frac{\exp(c^{V}_{i,i}/\tau_{ local})}{\sum^{B}_{j=1}\exp(c^{V}_{j,i}/\tau_{local})}),$ (3) $$

and $\mathcal{L}^{T}_{local}$ is defined similarly, where $\tau_{local}$ is the local temperature constant. The final local loss will then be $\mathcal{L}_{local}=\frac{1}{2}(\mathcal{L}^{V}_{local}+\mathcal{L}^{T}_{local})$. We note that introducing this local loss from the beginning of the training can lead to unstable behavior as the initial visual and language embeddings are not aligned. Thus, we add this loss after $k$ steps of training.

The intuition behind this design is to mimic the process of radiologic interpretation of a medical image in the real world. On the one hand, in mammography, the clinician will look for the image regions and local features that appear most suspicious for cancer. On the other hand, the clinician will write the radiology report in a few sentences based on the findings across the whole image, while matching each description with a specific feature of the image. Our proposed SLA gives the model the ability to perceive fine-grain local image detail with sentence-level description. The derived local similarity map could also be used as a guide of the relevance between specific image details and each sentence in the provided report and therefore improve the interpretability of the model.

### 3.4 LLM with PEFT as Text Encoder

Lastly, we incorporate parameter-efficient fine-tuning (PEFT) of a pre-trained large language model (LLM) as our text encoder (*e*.*g*., BioMedLM []) rather than use a small pre-trained BERT encoder []. Using a pre-trained LLM with strong domain knowledge can help improve the model’s understanding of the text caption and provide a more robust supervised signal for the visual-language pre-training. Moreover, PEFT (*e*.*g*., LoRA []) can greatly reduce the cost of adapting LLM to scenarios with a shortage of computing resources while maintaining a strong performance after fine-tuning. Adapting an LLM with PEFT thus has the potential to greatly improve performance while reducing trainable parameters and GPU memory costs compared to learning the commonly adopted BERT-style encoder.

**Table 1: Linear Classification Results on EMBED [] We evaluate linear classification results with different amounts of fine-tuning data for both BI-RADS and density prediction tasks. We report both balanced accuracy (bACC) and AUC metrics. The best and second-best results are highlighted in bold and underlined, respectively. Our method is shaded in gray.**
| Models | EMBED BI-RADS [] | EMBED Density [] |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |  |  |  |  |  |  |  |  |
| 1% | 10% | 100% | 1% | 10% | 100% | 1% | 10% | 100% | 1% | 10% | 100% |  |
| Vision only |  |  |  |  |  |  |  |  |  |  |  |  |
| Random-ViT [] | 20.84 | 20.68 | 22.10 | 57.15 | 61.54 | 61.76 | 45.81 | 45.11 | 47.01 | 72.83 | 72.62 | 72.92 |
| DiNOv2-ViT [] | 22.63 | 25.17 | 29.33 | 61.83 | 66.00 | 70.11 | 66.71 | 70.80 | 71.20 | 89.18 | 90.46 | 90.47 |
| DeiT-based [] |  |  |  |  |  |  |  |  |  |  |  |  |
| CLIP [] | 19.33 | 21.97 | 22.26 | 55.52 | 61.02 | 61.65 | 48.95 | 50.33 | 50.77 | 75.41 | 76.31 | 76.92 |
| ConVIRT [] | 25.08 | 27.63 | 29.56 | 65.43 | 70.49 | 71.54 | 72.66 | 73.46 | 73.53 | 91.69 | 92.11 | 92.10 |
| MGCA [] | 24.17 | 27.28 | 28.09 | 65.18 | 71.08 | 71.49 | 74.03 | 74.49 | 74.53 | 91.80 | 92.25 | 92.21 |
| DiNOv2-based [] |  |  |  |  |  |  |  |  |  |  |  |  |
| CLIP [] | \ul26.66 | 31.65 | 34.35 | \ul70.35 | \ul74.98 | 74.11 | \ul74.64 | 75.00 | \ul75.97 | 91.50 | 90.62 | 92.39 |
| SLIP [] | 22.94 | 27.86 | 30.93 | 64.43 | 69.48 | 71.95 | 73.24 | 74.79 | 75.23 | 91.56 | 92.37 | 92.46 |
| MM-MIL [] | 25.85 | \ul30.94 | \ul35.11 | 67.16 | 71.99 | \ul76.12 | 74.23 | \ul76.69 | 75.77 | 91.96 | \ul93.34 | 91.65 |
| ConVIRT [] | 24.62 | 30.38 | 31.27 | 65.09 | 73.33 | 74.03 | 74.34 | 74.95 | 74.74 | \ul92.21 | 92.56 | \ul92.58 |
| MGCA [] | 23.66 | 30.11 | 30.27 | 64.19 | 72.24 | 72.54 | 71.43 | 72.25 | 72.20 | 90.83 | 91.21 | 91.24 |
| \hdashline<br>MaMA | 28.46 | 35.12 | 39.75 | 70.63 | 75.98 | 77.50 | 76.26 | 78.11 | 78.09 | 93.11 | 93.62 | 93.65 |

## 4 Experiments

### 4.1 Pre-training Settings

#### Dataset

We pre-trained our model on the Emory EMBED [] dataset, which is a large-scale mammography dataset with public access and one of the largest open mammography datasets available. The current release contains 72,768 multi-view mammography studies for 23,356 patients collected from 4 hospitals. We focus on 2D mammography, which has 364,564 individual images in total. The dataset provides tabular annotation about the patient, imaging meta-information, and corresponding image-level findings including breast density, BI-RADS assessment, and calcification findings. We split the dataset by patient into train/validation/test partitions, each with 70%/10%/20% images. All the images are resized and padded to $518\times 518$ without changing the aspect ratio.

#### Implementation Details

We choose to use DiNOv2-ViT-B-14 [] and BioMedLM [] as our image and text encoder respectively. We adapt LoRA [] to the text encoder to fine-tune it efficiently. We choose DiNOv2 [] ViT as it is pre-trained with a larger image size which is suitable for mammography. Note that our method does not depend on a specific text encoder design. We also report the performance of our model with a more common BioClincialBERT [] encoder. The meta masking ratio $m$ is 0.8 during training. We train our model with the AdamW optimizer [] using a learning rate of 4E-5, weight-decay of 0.1, and cosine annealing scheduler for 40k steps. We also adapt warm-up from 1E-8 for 4k steps. The SLA loss is added after $k=8$k steps. We use a batch size of 144 and train the model on 4 RTX A5000 GPUs with BFloat-16 precision. We set $d=512$ and $\tau_{1}=\tau_{2}=\tau_{local}=0.07$. We provide more details for hyper-parameters in the appendix.

**Table 2: Zero-shot and Full Fine-tuning Results on EMBED [] We evaluate zero-shot and fully fine-tuned classification results for both BI-RADS and density prediction tasks. We report balanced accuracy (bACC) and AUC. The best and second-best results are highlighted in bold and underlined, respectively. Our method is shaded in gray.**
| Models | EMBED BI-RADS [] | EMBED Density [] |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Zero-shot | Full Fine-tune | Zero-shot | Full Fine-tune |  |  |  |  |  |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) | bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |
| DeiT-based [] |  |  |  |  |  |  |  |  |
| CLIP [] | 23.86 | 67.08 | 25.05 | 63.43 | 71.72 | 91.52 | 71.90 | 89.74 |
| ConVIRT [] | 23.72 | 62.85 | 31.80 | 72.82 | 64.61 | 86.62 | 77.07 | 93.34 |
| MGCA [] | 22.73 | 62.24 | 33.05 | \ul74.20 | 68.47 | 87.86 | 77.29 | 93.47 |
| DiNOv2-based |  |  |  |  |  |  |  |  |
| CLIP [] | 23.05 | 59.81 | 34.25 | 71.61 | 73.56 | \ul92.37 | 77.47 | 93.69 |
| SLIP [] | 24.14 | \ul67.47 | 21.75 | 61.96 | 75.45 | 92.17 | 64.72 | 86.37 |
| MM-MIL [] | 21.78 | 62.41 | 33.05 | 71.26 | 69.73 | 89.07 | 75.92 | 92.59 |
| ConVIRT [] | 25.27 | 65.13 | \ul34.54 | 74.05 | 64.85 | 87.66 | \ul77.93 | 93.60 |
| MGCA [] | \ul26.55 | 63.76 | 34.15 | 73.89 | 69.00 | 88.36 | 77.74 | 93.64 |
| \hdashline<br>MaMA | 31.04 | 74.83 | 40.31 | 77.36 | \ul75.40 | 93.46 | 78.02 | \ul93.65 |

### 4.2 Downstream Evaluation Settings

#### Tasks and Datasets

We primarily evaluate our method on the EMBED [] dataset for both BI-RADS assessment category (7 classes) and breast density (4 classes) prediction tasks. Note that the real-world distribution of labels for both tasks is extremely imbalanced. To demonstrate the behavior of each model in a more realistic scenario, we sample 7,666 images for BI-RADS prediction and 7,301 images for breast density prediction from the test split following the dataset distribution. To avoid insufficient test data and possible bias, we use all the images with BIRADS 5 and 6 in the BIRADS prediction test set. Detailed class distribution is provided in the appendix.
We also use the RSNA-Mammo [] dataset for out-of-domain evaluation for binary cancer detection, which only released a training set with 54k images. We split it into a training set of 85% data and used the remaining as the evaluation.
Given the extremely imbalanced distribution of both datasets, we choose to report balanced accuracy and AUC as our primary metrics. We also report the sensitivity and specificity of the RSNA-Mammo cancer detection task. We do not assess zero-shot classification on this dataset since only a binary cancer label is available for all samples.

#### Evaluation Settings

We evaluate all methods under zero-shot, linear classification, and full fine-tuning settings. For zero-shot classification, we provide patient and imaging meta-information along with the class-wise captions, as this meta-information is readily available without a clinician’s diagnosis. For linear classification, we attach a linear classifier and fine-tune it using 1%, 10%, or 100% of the training data. Following [, , , , , ], we perform this full data efficiency study with linear classification and present as our primary results since this experiment mainly focuses on the quality of the pre-trained embedding and it can best demonstrate the difference between each VLP method. For full fine-tuning, we again attach a linear classifier and fine-tune the whole model using 100% of the training data. Our learning rate is set to 5E-4 and weight decay to 1E-3 using the SGD optimizer with cosine annealing scheduler for 8k steps with batch size 36. A warm-up of 100 steps with a minimum learning rate of 1E-5 is applied. The fine-tuning uses 2 RTX A5000 GPUs.

#### Baselines

As the very first attempt at full contrastive language-image pre-training for mammography, we choose to compare with the following baselines: 1) ViT [, ]: we compare with vision-only baselines with both random initialization and DiNOv2 [] pre-training. 2) CLIP []: the vanilla CLIP model without other additional design; 3) SLIP []: a contrastive learning framework that optimizes both image-image and image-text loss; 4) MM-MIL []: a CLIP model that learns local image-language relationship via a multiple instance learning paradigm; 5) ConVIRT []: one of the first Chest X-ray specific CLIP models; 6) MGCA []: one of the SoTA CLIP models for Chest X-ray that applies multi-granularity feature alignment. We pre-train and fine-tune all these baselines with the same settings as our model. We also replaced the original DeiT [] ViT with DiNOv2 [] for a fair comparison since DeiT-ViT [] is only trained with a smaller image size. All the baseline methods use fully fine-tuned BioClinicalBERT [] as text encoder.
While we acknowledge that there are other recent medical VLP methods [, , , ], they either adapt domain-specific design and require annotations not presented in our dataset [, , ] or were shown to perform worse in other studies than the chosen baselines [, ]. We also do not compare to related work that has no official implementation released [, ].

**Table 3: Classification Results on RSNA-Mammo [] We evaluate linear classification and fully fine-tuned settings for the cancer prediction task. We report balanced accuracy (bACC), AUC, sensitivity (SEN), and specificity (SPE). The best and second-best results are highlighted in bold and underlined, respectively. Our method is shaded in gray.**
| Models | RSNA-Mammo [] |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Linear Classification | Full Fine-tune |  |  |  |  |  |  |  |
| bACC (%) | AUC (%) | SEN (%) | SPE (%) | bACC (%) | AUC (%) | SEN (%) | SPE (%) |  |
| Vision only |  |  |  |  |  |  |  |  |
| Random-ViT | 51.90 | 56.34 | \ul72.60 | 31.21 | 56.71 | 57.62 | 77.88 | 35.53 |
| DiNOv2-ViT | 63.23 | 68.59 | 59.62 | 66.84 | 55.12 | 58.18 | \ul70.19 | 40.06 |
| DeiT-based [] |  |  |  |  |  |  |  |  |
| CLIP [] | 53.97 | 58.20 | 85.58 | 22.37 | 56.83 | 61.00 | 64.42 | 49.24 |
| ConVIRT [] | 65.96 | 69.81 | 66.83 | 65.10 | 53.31 | 69.16 | 8.65 | 97.96 |
| MGCA [] | 63.01 | 69.16 | 62.50 | 63.52 | 53.88 | 73.04 | 12.02 | \ul95.74 |
| DiNOv2-based |  |  |  |  |  |  |  |  |
| CLIP [] | 63.89 | 70.28 | 58.17 | \ul69.61 | 56.86 | 61.20 | 69.23 | 44.49 |
| SLIP [] | 62.48 | 67.51 | 78.37 | 46.60 | 56.74 | 60.05 | 63.94 | 49.53 |
| MM-MIL [] | 64.02 | 70.67 | 58.17 | 69.86 | \ul59.97 | 65.04 | 57.21 | 62.73 |
| ConVIRT [] | \ul65.89 | \ul70.70 | 66.83 | 64.96 | 54.53 | 69.85 | 11.06 | 98.01 |
| MGCA [] | 60.79 | 67.45 | 71.15 | 50.43 | 55.99 | 68.67 | 14.90 | 97.07 |
| \hdashline<br>MaMA | 67.50 | 73.99 | \ul72.60 | 62.40 | 65.20 | \ul73.01 | 67.31 | 63.10 |

### 4.3 Results

#### Linear Classification

We report the performance of both EMBED BI-RADS and density classification tasks for each baseline in Tab. 1.
We note MaMA achieves the best performance overall under different amounts of training data. Our method shows a non-trivial improvement of more than 4% of balanced accuracy on the BI-RADS prediction task when fine-tuned with full training data. We note that reducing the amount of training data has a greater influence on the BI-RADS prediction task than the density prediction task, as the BI-RADS distribution is more imbalanced, *e*.*g*., there are only 6 training images for BI-RADS category 5 and 2 images for category 6 when using 1% training data. However, our method still maintains the best overall performance even when trained with only 1% data on the BI-RADS prediction task. This demonstrates the strong generalization ability and robustness of MaMA.
Even if comparing with baselines also with local awareness [, ], our method is still the best.
We also notice that the DiNOv2 []-based models tend to outperform the DeiT []-based models even if using the same VLP model design. This is not only because DiNOv2 ViT [] was trained on more data, but also due to the use of a larger image size, which is critical for high-resolution mammography.

#### Zero-shot Classification

We report the zero-shot classification performance for each of the methods on both EMBED [] tasks in Tab. 2. While our method still outperforms all the baselines, we highlight the zero-shot performance of the BI-RADS score prediction task, where our model outperforms the best baseline by $\sim$5% in terms of balanced accuracy and more than 7% in AUC score.
Compared with baselines using the fully fine-tuned small BioClinicalBERT [], our method with pre-trained LLM with PEFT shows much better zero-shot performance as the LLM can provide a text-supervised signal with higher quality. Meanwhile, the PEFT helps to prevent the LLM from collapsing during fine-tuning. As a result, our LLM text encoder with PEFT can provide better zero-shot text embedding and improve the zero-shot performance greatly.
Meanwhile, we note that the adopted LLM with PEFT encoder only has 2.6 M trainable parameters, which is only 3% of the BioClinicalBERT [] in terms of size.

#### Full Fine-tuning Classification

We also report the classification results after full-fine-tuning for EMBED [] tasks in Tab. 2. We note that while the gap between each method is somewhat reduced due to full fine-tuning, our model still beats all other baselines on both tasks.

#### Out-of-Domain Data Analysis

We report performance of each method on the out-of-domain RSNA-Mammo dataset in Tab. 3. Since RSNA-Mammo [] is an extremely imbalanced dataset (48:1 negative to positive ratio), we report the sensitivity and specificity as well. We note our model performs best in terms of balanced accuracy and AUC with a notable gap. While some of the baselines outperform our model on either the sensitivity or specificity metric, we note these models are not informative, *i*.*e*., they tend to collapse and predict the majority of images to one of the classes. This will lead to a high score in one of the sensitivity or specificity metrics while result in a low performance in the other.
In contrast, our approach shows reasonable results for both metrics and is the only method with both sensitivity and specificity greater than 60% under both the linear and full fine-tuning settings. Furthermore, the other few methods that demonstrated higher sensitivity than ours all resulted in a specificity of $\sim$45% or worse.

**Table 4: Ablation of Model Design We ablate different model designs on the EMBED [] BI-RADS prediction task and report balanced accuracy (bACC) and AUC score. The best and second best results are highlighted in bold and underlined, respectively. Our full method is shaded in gray.**
| Methods | EMBED BI-RADS [] |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SLA | Symm. $\mathcal{L}_{VT}$ | $\mathcal{L}_{VV}$ | PEFT-LLM | Zero-shot | Linear Classification | Full Fine-tune |  |  |  |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |  |  |  |
|  | ✓ | ✓ | ✓ | 29.28 | 71.16 | 38.71 | \ul77.50 | 30.55 | 70.69 |
| ✓ |  | ✓ | ✓ | \ul31.03 | \ul72.79 | \ul39.57 | 77.39 | \ul39.47 | \ul76.23 |
| ✓ | ✓ |  | ✓ | 27.32 | 70.18 | 37.21 | 77.95 | 23.78 | 63.97 |
| ✓ | ✓ | ✓ |  | 23.88 | 62.84 | 38.96 | 77.43 | 22.29 | 63.77 |
| \hdashline<br>✓ | ✓ | ✓ | ✓ | 31.04 | 74.83 | 39.75 | \ul77.50 | 40.31 | 77.36 |

**Table 5: Multi-view Ablation We ablate different multi-view contrastive learning strategies.**
| Methods | EMBED BI-RADS [] |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Zero-shot | Linear Classification | Full Fine-tune |  |  |  |  |
| bACC(%) | AUC(%) | bACC(%) | AUC(%) | bACC(%) | AUC(%) |  |
| Same Image | 30.48 | 73.95 | 39.70 | 77.73 | \ul39.35 | \ul76.44 |
| Intra-side | \ul30.71 | \ul74.21 | 39.93 | 77.41 | 35.17 | 76.09 |
| \hdashline<br>Intra-study | 31.04 | 74.83 | \ul39.75 | \ul77.50 | 40.31 | 77.36 |

### 4.4 Ablation Experiments

#### Model Design

We ablate the influence of each component in Tab. 4. Compared with these baselines, we note each component has an important contribution to the overall model performance, as removing any one resulted in inferior performance.
We note that the baseline without PEFT-LLM instead employs BioClinicalBERT [] and shows a clear drop in zero-shot performance, which validates the importance of using a PEFT-LLM. However, this model still performs well on the linear classification and full fine-tuning tasks, which demonstrates the effectiveness of our other design choices.

#### Multi-view Ablation

We ablate the multi-view sampling strategy here by using: 1) the same image, 2) an intra-side image, and 3) the complete intra-study image (Tab. 6). We can see that the model trained with only one image loses the multi-view understanding. The model using only intra-side images only considers ipsilateral correspondence and also results in a worse performance.

#### Caption Ablation

We evaluate the influence of using different caption construction strategies in Tab. 6. We note that a CLIP style caption that only focuses on class labels shows a better zero-shot performance, but degenerates greatly in the linear classification and full fine-tuning tasks. Meanwhile, if simply using the full meta-information during training, the model will fail with zero-shot classification since it may mainly rely on the meta-information during the training and ignore more important clinical information. Our full design of using a structural caption with meta-information masking shows the best performance.

## 5 Discussion and Conclusion

In this work, we presented a complete and novel multi-view and multi-scale alignment contrastive language-image pre-training method for mammography. We proposed utilizing the multi-view nature of mammography and providing local image-sentence correspondence to help address the challenges of small ROIs and high image resolution and provide fine-grained visual clues for decisions.
The proposed method greatly outperforms multiple existing medical CLIP baselines.

#### Limitation and Future Work

As we mainly focus on image representation learning, we have yet to evaluate other downstream tasks like image-text retrieval, object detection, and segmentation. While also limited by accessible data in this domain, our method will be evaluated on more downstream tasks in future work. We plan to extend this current framework to more mammography imaging modalities including C-view and digital breast tomosynthesis to further enhance its understanding of mammography. Meanwhile, we also plan to integrate this pre-trained component into a multi-modal question-answering and grounding model, to further explore the potential of medical VLP.

## 6 Acknowledgement

This work was supported by NIH grant R21EB032950.

## Appendix A Appendix

In the appendix, we provide more detailed training settings, evaluation settings, model configurations, and additional analysis.

### A.1 Further Limitations

The EMBED data comes from the Atlanta, GA region. While the dataset is highly ethnically diverse, the geographic focus could limit generalizability to other populations, e.g., the breast density distribution may differ from data gathered in other regions of the world. Additionally, The caption is created from the templated-based method, which may potentially harm the model due to limited caption diversity. Future works may consider augment the template-based prompt with LLM.

### A.2 Broader Impacts

This paper proposed a promising visual language pre-training scheme for mammography that can be used for various downstream tasks. It can also potentially speed up the real-world mammography screening or diagnostic process by filtering out low-risk studies and highlighting high-risk images for the clinician. While the EMBED dataset is one of the largest and most diverse public mammography datasets available, it is notable that the data were collected from four specific hospitals and thus the trained model may have a specific bias towards a specific group of people due to training data composition. Any user who wants to use this model in their own research may need to carefully analyze such bias and their own application and tasks and avoid using the model in real-world clinical trials without further approval.

Figure: Algorithm 1 SLA Loss Pseudocode

### A.3 Pseudo-Code of SLA Module

We provide the pytorch pseudo-code of the SLA module in the Algorithm 1 to better illustrate the design of the SLA module.

### A.4 Pre-training Implementation Details

Figure: Figure 3: Data Distribution of EMBED [] Dataset. We visualize the data distribution of the EMBED [] dataset for both BI-RADS and Density labels.
Refer to caption: x3.png

#### Dataset and Pre-processing

As mentioned in Sec. 4.1, we use the EMBED [] dataset for pre-training. We only use the 2D mammography and split the dataset into 70%/10%/20% for training, validation, and testing at the patient level. We filter out the studies for males or those that have missing BI-RADS or density labels. We provide the detailed distribution of BI-RADS score and Breast density in Fig. 3, displaying the extremely imbalanced labels. Each of the sampled splits shares roughly the same distribution. More details about the dataset can be found in []. For the data pre-processing, we first convert each original DICOM image file to JPEG format and resize the image based on its long side to 1,024 pixels without changing its aspect ratio. These images are then used directly for training.

#### Pre-training Data Augmentation

Different from CLIP [], we use a strong data augmentation during the pre-training stage for both images. We first apply the OTSU threshold masking to cut the unnecessary background regions and only keep the breast tissue. This image is then resized to 518 pixels on its long side and padded with zeros on the short side to have a square shape of $518,\times 518$. We then apply SimCLR [] style augmentation including random horizontal and vertical flips, color jitter, grayscale, and Gaussian blur. During test time, we only keep the resize operation and drop all random augmentations.

**Table 7: Model Trainable Parameters We provide the number of trainable parameters for each model here below. Our method as described in the main paper is shaded in gray.**
| Models | #Trainable Parameters (M) |  |  |
| --- | --- | --- | --- |
| Visual Encoder | Language Encoder | Total |  |
| Vision only |  |  |  |
| Random-ViT [] | 89.6 | - | 86.6 |
| DiNOv2-ViT [] | 89.6 | - | 86.6 |
| DeiT-based [] |  |  |  |
| CLIP [] | 86.6 | 84.6 | 172.5 |
| ConVIRT [] | 86.6 | 84.6 | 173.2 |
| MGCA [] | 86.6 | 84.6 | 174.4 |
| DiNOv2-based [] |  |  |  |
| CLIP [] | 89.6 | 84.6 | 174.5 |
| SLIP [] | 89.6 | 84.6 | 174.8 |
| MM-MIL [] | 89.6 | 84.6 | 174.9 |
| ConVIRT [] | 89.6 | 84.6 | 176.2 |
| MGCA [] | 89.6 | 84.6 | 177.4 |
| \hdashline  MaMA-BioClinicalBERT [] | 89.6 | 84.6 | 177.5 |
| MaMA-LoRA-BioMedLM [, ] | 89.6 | 2.6 | 92.8 |
| MaMA-LoRA-Meditron [, ] | 89.6 | 4.2 | 94.3 |
| MaMA-LoRA-Llama3 [, ] | 89.6 | 3.4 | 93.4 |

#### Model Details

As mentioned in Sec. 4.1, we use DiNOv2 pre-trained ViT-B-reg [, ] model with image size 518 and patch size 14 as our visual encoder. We use BioMedLM [], a 3M level GPT-2 decoder-only transformer of 32 layers as our language encoder. We adapt LoRA [] to fine-tune this encoder. As for the baselines, we choose to experiment with both a DeiT []-based and a DiNOv2-based visual encoder. The DeiT-based transformer was pre-trained with a patch size of 16 and image size of 384 on ImageNet []. The input for the corresponding baselines is resized to 384 as well. For the DiNOv2 [] visual encoder for the baselines, the setting is the same as our model. All the baselines use BioClinicalBERT [], a BERT-style encoder-only transformer without PEFT. We use the online implementation for ConVIRT [] and MGCA [](^2^22[https://github.com/HKU-MedAI/MGCA](https://github.com/HKU-MedAI/MGCA)) and adjust the vision encoder part, and we re-implement the CLIP [], SLIP [], and MM-MIL [] following the corresponding papers under our environment. We provide the model size comparison in Tab. 7. We can easily see that our model has the smallest number of trainable parameters, only $\sim$52% compared with other baselines. We choose to use the last checkpoint for all models in downstream evaluations.

#### PEFT Settings

As for the parameter-efficient fine-tuning (PEFT) module, we use the LoRA implemented by HuggingFace with default hyperparameters: $r=8$, $\alpha=32$, $dropout=0.1$. We choose to use LoRA as it is one of the most popular PEFT methods and has been proven to be effective in prior research.

Figure: Figure 4: Confusion Matrix of Our Full Fine-tuned Model. We visualize the class-wise confusion matrix of our model fully fine-tuned with BI-RADS and density classification tasks, respectively.
Refer to caption: x4.png

#### Overall Pre-training Target

As a supplement to the method section, we here provide the overall pre-training optimization target in Eq. 4.

$$ $\mathcal{L}(x_{i},\tilde{v}_{i},t_{i})=\mathcal{L}_{VV}(v_{i},\tilde{v}_{i})+ \mathcal{L}_{VT}(v_{i},t_{i})+\mathcal{L}_{VT}(\tilde{v}_{i},t_{i})+w\mathcal{ L}_{local}.$ (4) $$

We set $w=0.0$ in the first 8,000 steps of training and $w=1.0$ in the latter process.

### A.5 Downstream Evaluation Details

#### Zero-shot Caption

During zero-shot evaluation, we prepend the meta-information to the class-wise description sentence, since this meta-information can be readily obtained with the images without needing the clinician’s diagnosis. More specifically, we prepend the information including: *Procedure reported*, *Reason for procedure*, *Patient info*, and *Image info* before the class description sentence of each BI-RADS or density class. This improves the zero-shot balanced accuracy of the BI-RADS classification from 29.65% to 31.04% and improves the corresponding AUC from 68.05% to 74.83%.

#### Linear Classifier

We attach a linear classifier to each of the baseline models for linear classification and full fine-tuned tasks. The linear classifier uses the average of all patch tokens as input rather than using [CLS] token since the [CLS] token is not used during training as well. We use the full training set and balanced weighted sampling during training for all the linear classification and fine-tuning experiments.

#### BI-RADS Prediction

For EMBED [] BI-RADS score prediction task, we sample 10% data randomly from the test set. However, we added more images for BI-RADS scores 5 and 6 to ensure these 2 classes at least have 200 images. This is to avoid bias due to limited evaluation samples. The final distribution of this dataset is: [901, 4472, 1166, 517, 210, 200, 200] for BI-RADS scores from 0 to 6 respectively. The pre-processing is the same as described in Sec. A.4.

#### Density Prediction

Similar to BI-RADS prediction, we randomly sample another 10% data from the test set stratified by density label to create the density prediction set. The distribution of this test set is: [738, 3103, 3043, 417] for density from 1 to 4. We use the full training set and balanced weighted sampling during training.

#### RSNA-Mammo [ 4 ] Cancer Detection

Similar to EMBED pre-processing, we convert the DICOM mammography to a JPEG image and resize its long side to 1,024 without changing the aspect ratio. Since this dataset does not provide the corresponding meta-information, we only evaluate the linear classification and full fine-tuning tasks. We use the full 15% test set for the RSNA-Mammo [] evaluation, where the distribution of this test set is [7979, 208] for normal and cancerous samples, respectively. We use the full training set and balanced weighted sampling during training.

### A.6 Classification Results Analysis

We visualize the confusion matrix for classification results of the fully fine-tuned model on both EMBED [] prediction tasks in Fig. 4. While the overall accuracy for the BI-RADS prediction task still needs improvement, we note that the misclassification mainly happens for BI-RADS categories 2, 3, and 4, which is reasonable since these classes are semantically close to each other (“Benign”, “Probably Benign”, and “Suspicious Abnormality”). Meanwhile, we note our model shows a high recall for BI-RADS category 6, *i*.*e*., “Known biopsy-proven malignancy”, which indicates the potential application of the model to filter out high-risk abnormal mammography quickly.

Misclassifications for the density predictions are also reasonable, as mammographic density increases with the higher density class label. Notably, most errors for the middle two density classes are for the more extreme version of that class (e.g., 3 corresponding to "heterogeneously dense" is more often mistaken for 4 "extremely dense" compared to 2 "scattered density"); thus the binary dense (labels 3/4) and non-dense (labels 1/2) prediction does well. This is important as women with dense breasts are required to be notified by US regulations, and this has ramifications for potential follow-up screening recommendations.

**Table 8: Ablation with Different Meta Masking Ratio on EMBED BI-RADS [] We evaluate the influence of using different meta-masking ratios on the input text during pre-training and test the model on zero-shot settings. Our method as described in the main paper is shaded in gray.**
| Model Settings | bACC(%) | AUC(%) |
| --- | --- | --- |
| $m=0.0$ | 27.19 | 68.20 |
| $m=0.2$ | 29.52 | 71.23 |
| $m=0.5$ | 30.37 | 72.44 |
| $m=0.2$ | 31.04 | 74.83 |

**Table 9: Ablation with Different Visual Contrastive Learning Style on EMBED [] We evaluate the influence of using different visual contrastive pre-training schemes. We evaluate the zero-shot and linear classification performance for each method. Our method as described in the main paper is shaded in gray.**
| Model Settings | EMBED [] BI-RADS | EMBED [] Density |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Zero-shot | Linear classification | Zero-shot | Linear Probing |  |  |  |  |  |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) | bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |
| SimCLR [] style | 31.04 | 74.83 | 39.75 | 77.50 | 75.40 | 93.46 | 78.09 | 93.65 |
| MoCo [] style | 29.04 | 74.67 | 36.74 | 78.16 | 76.18 | 92.58 | 78.03 | 93.49 |

### A.7 Additional Ablation Experiments

#### Meta Masking Ratio

To better understand the influence of masking the meta-information, we here provide an extra zero-shot evaluation on different mask ratios $m$ during the pre-training stage in Tab. 8.
As shown above, the zero-shot performance increases as the meta-information masking ratio increases, which means the model tends to rely more on clinical-related information, and therefore, does better in the zero-shot classification task.

#### Different Visual Contrastive Learning Scheme

We here provide additional analysis of the influence of using different visual contrastive learning schemes by comparing a variation of the proposed model, i.e., MoCo-style image-to-image contrastive loss [], where a memory queue of size 4096 is used to store the negative samples during pre-training. This can properly address the sensitivity of the image-to-image contrastive loss to the batch size, as there will always be a large number of negative examples during pre-training (see Tab. 2 in  [], where a batch size of 256 was sufficient). Here, we provide a comparison between the proposed method (SimCLR style image-to-image loss) and MoCo-style variation in Tab. 9.

We note that there is no clear difference between the two models. The chosen SimCLR method is slightly better from a general perspective. This result potentially suggests that the batch size may not be that important in our task, or that the used batch size was large enough. We provide two possible explanations for this result: 1) Different from natural images, where the difference between each sample is fairly large, the inter-sample difference for mammograms is much smaller. Mammography generally has very similar global content. Thus, fewer negative samples are sufficient to provide a robust contrastive signal during image-to-image contrastive pre-training. 2) Apart from the image-to-image loss, the symmetric image-to-text loss between the caption and two images also indirectly minimizes the distance between the two images, which helps alleviate the necessity of a large batch size.

**Table 10: Ablation with Different Multi-view Contrastive Learning Probability on EMBED [] We evaluate the influence of using different multi-view contrastive learning probabilities $p$ on EMBED BI-RADS prediction. We evaluate the zero-shot and linear classification performance for each pre-trained model. Our method as described in the main paper is shaded in gray.**
| Model Settings | EMBED [] BI-RADS |  |  |  |
| --- | --- | --- | --- | --- |
| Zero-shot | Linear Probing |  |  |  |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |
| $p=0.0$ | 30.48 | 73.95 | 39.70 | 77.23 |
| $p=0.2$ | 30.26 | 73.35 | 39.37 | 77.50 |
| $p=0.5$ | 31.04 | 74.83 | 39.75 | 77.50 |
| $p=0.8$ | 30.76 | 74.26 | 39.41 | 77.45 |
| $p=1.0$ | 29.33 | 73.21 | 38.20 | 77.49 |

**Table 11: Comparison with Medical Pre-trained Visual Encoder on EMBED [] We compare our method with SimCLR [] pre-trained visual encoder on the EMEBD [] dataset under linear classification settings. Our method as described in the main paper is shaded in gray.**
| Model Settings | EMBED [] BIRADS | EMBED Density |  |  |
| --- | --- | --- | --- | --- |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |
| SimCLR Pre-trained | 26.19 | 65.06 | 77.06 | 92.64 |
| MaMA | 39.75 | 77.50 | 78.09 | 93.65 |

#### Different Multi-view Probability

Additionally, we here provide more analysis on the multi-view sampling strategy. We adjust the probability of using intra-study sampling and the augmented view of the same image as the extra image $\tilde{x}_{i}$, which is $p=0.5$ in the proposed method. When $p=0.0$, the model always samples the same augmented image as the other view during pre-training (equivalent to the "Single Image" baseline in Tab. 5). In contrast, when $p=1.0$, the model always samples one of the other images from the same study as the other view. We here provide the results of the Zero-shot and Linear classification BI-RADS prediction evaluation in Tab. 10.
It is clear that either using no inter-study sampling ($p=0.0$) or using only the multi-view sampling ($p=1.0$) will harm the performance. An equal-weight mix of both sampling methods shows the best performance, as it provides a more diverse contrastive image and reduces the potential contradictory image pairs (by using the augmented view of the same image).

#### Visual Constrastive Only Baseline

We here include the linear classification results in comparison to the ViT baseline pre-trained with the SimCLR [] method on the EMBED dataset in Tab. 11. The vision-only pre-trained model performs worse compared with our method according to the results.

### A.8 Benchmark Different Text Encoders

We evaluate all methods with the same DiNOv2 [] vision encoders but compare the influence of using different text encoders in Tab. 12.

#### Text Encoders

1) BioClinicalBERT []: The standard text encoder used for previous medical CLIP models [, , , , ] and also our baseline methods, which is a BERT []-style transformer pre-trained with MIMIC-III [] clinical report. 2) BioMedLM []: A 2.7B level GPT-2 [] transformer pre-trained with PubMed data, which is also one of the best 3B LLM according to multiple benchmarks []. 3) Meditron-7B []: A newly released Llama2 [] model fine-tuned with PubMed papers. 4) Llama3-8B []: Recently released, the most robust open-souced LLM, with roughly the same architecture as Llama2 [] but pre-trained with much more data. All the latter three LLMs are fine-tuned with LoRA []

**Table 12: Linear Classification Results on EMBED [] for Different Text Encoder We evaluate linear classification results with different amounts of fine-tuning data for both BI-RADS and density prediction tasks of our model with different text encoder. All methods are based on DiNOv2 [] vision encoder for a fair comparison. We report both balanced accuracy (bACC) and AUC metrics. The best and second-best results are highlighted in bold and underlined respectively. Our method as described in the main paper is shaded in gray.**
| Models | EMBED BI-RADS [] | EMBED Density [] |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| bACC (%) | AUC (%) | bACC (%) | AUC (%) |  |  |  |  |  |  |  |  |  |
| 1% | 10% | 100% | 1% | 10% | 100% | 1% | 10% | 100% | 1% | 10% | 100% |  |
| BioClinicalBERT-based [] |  |  |  |  |  |  |  |  |  |  |  |  |
| CLIP [] | 26.66 | 31.65 | 34.35 | 70.35 | 74.98 | 74.11 | 74.64 | 75.00 | 75.97 | 91.50 | 90.62 | 92.39 |
| SLIP [] | 22.94 | 27.86 | 30.93 | 64.43 | 69.48 | 71.95 | 73.24 | 74.79 | 75.23 | 91.56 | 92.37 | 92.46 |
| MM-MIL [] | 25.85 | 30.94 | 35.11 | 67.16 | 71.99 | 76.12 | 74.23 | 76.69 | 75.77 | 91.96 | 93.34 | 91.65 |
| ConVIRT [] | 24.62 | 30.38 | 31.27 | 65.09 | 73.33 | 74.03 | 74.34 | 74.95 | 74.74 | 92.21 | 92.56 | 92.58 |
| MGCA [] | 23.66 | 30.11 | 30.27 | 64.19 | 72.24 | 72.54 | 71.43 | 72.25 | 72.20 | 90.83 | 91.21 | 91.24 |
| MaMA-BERT | 27.81 | 34.25 | 38.96 | 68.99 | 74.61 | 77.43 | \ul74.77 | \ul77.50 | \ul78.15 | 92.90 | 93.50 | \ul93.68 |
| \hdashlineLoRA-LLM-based [] |  |  |  |  |  |  |  |  |  |  |  |  |
| MaMA-BioMedLM | 28.46 | 35.12 | \ul39.75 | \ul70.63 | 75.98 | \ul77.50 | 76.26 | 78.11 | 78.09 | 93.11 | \ul93.62 | 93.65 |
| MaMA-Meditron | 26.94 | 33.28 | 38.68 | 68.93 | 74.45 | 77.51 | 74.48 | 77.77 | 78.30 | 92.65 | 93.54 | 93.66 |
| MaMA-Llama3 | \ul28.00 | \ul34.30 | 39.99 | 70.83 | \ul75.47 | \ul77.50 | 74.70 | \ul77.93 | 78.13 | \ul93.02 | 93.70 | 93.72 |

#### Results

We report the results on linear classification in Tab. 12. We note that even our model with BioClinicalBERT [] text encoder outperforms all the baselines in this evaluation; this demonstrates the effectiveness of the proposed multi-view mammography pre-training and symmetric local alignment module. Comparing three different LLMs with LoRA [], we note that BioMedLM [] and Llama3-8B [] roughly have a similar level of performance, while the BioMedLM-based model has a smaller GPU memory cost and faster training speed due to its relative size. Meanwhile, we notice that the Meditron []-based model is not as good as the other two LLMs, but all these LLM-based methods outperform the model with smaller BERT-style [] encoder in general. Overall, our choice of BioMedLM []-based model has the best balance between performance and model size.

### A.9 Local Similarity Map Analysis

We visualize the learned local patch-sentence similarity map in Fig. 5. As described in Sec. 3.3, the local patch-sentence similarity map indicates the relationship between each region of the image and the corresponding input sentence. We visualize the similarity map for the “Impression” sentence in the report (see examples in Fig. 6 to Fig. 8), which includes the most important diagnosis information. We also visualize the same similarity map for MM-MIL [] and a variation of our method that optimizes local similarity with only visual localization (similar to including the MM-MIL local branch).

Figure: Figure 5: Visualization of Local Similarity Maps over Input Mammograms. We visualize the learned local similarity map for the “Impressions” sentence on a few test mammograms from the EMBED dataset [] for MM-MIL [], our method with only visual localization, and our full method here. All the heat maps are normalized to [0,1]. The third column shows mammograms from the same side but a different view and the fourth column shows mammograms from the same view but from a different side. The white box in the image represents the ROI annotated from the dataset [].
Refer to caption: x5.png

We note that our methods generally have a better localization quality with more fine-grained details. The model can accurately locate the high-density and tumor-related regions in the given maps. We also see from the examples for patients 3 and 4 that our method has a better correspondence between mammograms from different views or sides. Especially for column 3, our method accurately identified the same region in both views, while the baseline method failed to locate the tissue in the RMLO view (left image). The MM-MIL [] model even failed to detect the tumor for patient 4. On the other hand, the variation of our model that optimizes only visual localization loss can only provide a vague and inaccurate similarity map. We believe this is because the asymmetric max and average pooling operation drops too much information during training, resulting in only one of the patches being optimized.

**Table 13: Zero-shot Visual Grounding Analysis We report the mean intersection-over-union (mIoU), mean DICE score, and ROI recall with 50% coverage for methods with local sentence-region similarity map on the EMBED [] dataset. Our method is shaded in gray.**
| Models | EMBED [] Visual Grounding |  |  |
| --- | --- | --- | --- |
| mIoU (%) | mDICE (%) | Recall (%) |  |
| MM-MIL [] | 5.25 | 9.72 | 39.23 |
| \hdashline<br>MaMA | 6.22 | 11.88 | 47.67 |

#### Quantitative Visual Grounding Analysis

Similar to the analysis in MM-MIL [], we further conduct a zero-shot visual grounding analysis with the pre-trained model. We compare the similarity map extracted for the image and the “Impressions” description with the provided ROIs from a subset of the EMBED [] dataset, which contains 841 images from the test split, each with one or more ROI annotations. We report the mean intersection-over-union (mIoU), mean DICE (mDICE) score, and ROI recall for both the MM-MIL [] method and ours. Different from Wang *et al*.   [], we use a set of thresholds of $[0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85]$ since the ROI is generally smaller in the mammogram and needs a higher threshold to have better detection results. We compute IoU and DICE scores for each threshold and then average them to get mIoU and mDICE. For ROI recall, an ROI is considered successfully predicted when the overlap between the binarized similarity map (with a fixed threshold of 50%) and the ROI is greater than 50%.
Our method generally shows a better performance over the MM-MIL [] model and achieves a recall near 50% without training. We note that the number reported here may look low since this is a parameter-free zero-shot evaluation, and the ROI in the mammography is generally small compared with the whole image, which makes the task more challenging.

### A.10 Performance Statistical Analysis

We further evaluate the stability of the proposed method by bootstrap sampling test set results from linear classification and report the 95% confidence interval in Tab. 14 and Tab. 15. Notably, our method generally shows a small confidence interval, especially for AUC scores. Comparing our results with confidence interval with the baselines in Tab. 1, we see that there is still a marked improvement in performance.

**Table 14: Linear Classification Bootstrap Results for Balanced Accuracy on EMBED [] We conduct the bootstrap evaluation for the linear classification predicted result of our method on both BI-RADS and density prediction tasks. We sample $N=10,000$ bootstrapped samples and compute the average balanced Accuracy (bACC) with the corresponding 95% confidence interval for each setting. This illustrates the statistical stability of our method.**
| Task | bACC (%) |  |  |
| --- | --- | --- | --- |
| 1% | 10% | 100% |  |
| EMBED BI-RADS [] | 28.46 [$27.12,~{}29.84$] | 35.11 [$33.36,~{}36.86$] | 39.75 [$37.81,~{}41.64$] |
| EMBED Density [] | 76.25 [$74.88,~{}77.60$] | 78.11 [$73.65,~{}75.66$] | 78.10 [$76.82,~{}79.34$] |

**Table 15: Linear Classification Bootstrap Results for AUC on EMBED [] We conduct the bootstrap evaluation for the linear classification predicted result of our method on both BI-RADS and density prediction tasks. We sample $N=10,000$ bootstrapped samples and compute the average AUC with the corresponding 95% confidence interval for each setting. This illustrates the statistical stability of our method.**
| Task | AUC (%) |  |  |
| --- | --- | --- | --- |
| 1% | 10% | 100% |  |
| EMBED BI-RADS [] | 70.64 [$69.56,~{}71.69$] | 75.98 [$75.09,~{}76.87$] | 77.50 [$76.61,~{}78.35$] |
| EMBED Density [] | 93.11 [$92.70,~{}93.52$] | 93.62 [$93.23,~{}94.00$] | 93.65 [$93.26,~{}94.02$] |

### A.11 Report Construction Template

We provide here the template used to construct our structured image caption during training. We describe each segment below, and the keywords wrapped with “{{” and “}}” will be replaced with corresponding information from the tabular data.

- 1.
Procedure reported: {{PROCEDURE}}.
- 2.
Reason for procedure: {{SCREENING/DIAGNOSTIC}}.
- 3.
Patient info: This patient is {{RACE}}, {{ETHNIC}}, and {{AGE}} years old.
- 4.
Image info: This is a {{IMAGE_TYPE}} full-field digital mammogram of the {{SIDE}} breast with {{VIEW}} view.
- 5.
Breast composition: The breast is {{DENSITY_DESC}}.
- 6.
Findings: The mammogram shows that {{MASS_DESC}}. The mass is {{SHAPE}} and {{DENSITY}}. A {{DISTRI}} {{SHAPE}} calcification is present.
- 7.
Impressions: BI-RADS Category {{BIRADS}}: {{BIRADS_DESC}}.
- 8.
Overall Assessment: {{BIRADS_DESC}}

We provide more details and corresponding description strings in our implementation file.

### A.12 Example Mammography Images with Captions

We provide 7 randomly sampled mammography images with corresponding captions for each of the BI-RADS categories in Fig. 6 to Fig. 8.

Figure: Figure 6: Example Multi-view Mammography BI-RADS 0-2 with Constructed Caption. We provide random sampled multi-view mammography with the corresponding caption constructed by us. We highlight the image match exactly with the caption in a green bounding box.
Refer to caption: x6.png

Figure: Figure 7: Example Multi-view Mammography BI-RADS 3-5 with Constructed Caption. We provide random sampled multi-view mammography with the corresponding caption constructed by us. We highlight the image match exactly with the caption in a green bounding box.
Refer to caption: x7.png

Figure: Figure 8: Example Multi-view Mammography BI-RADS 6 with Constructed Caption. We provide random sampled multi-view mammography with the corresponding caption constructed by us. We highlight the image match exactly with the caption in a green bounding box.
Refer to caption: x8.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: As above, The paper adapts multimodel visual-textual representation pretraining framework in mammography dataset and results in leading performance in multiple downstream classification datasets. However, the entire method design of the paper is mostly based on the existing methods and has very limited novelty, thus I do not think the paper would bring enough new insights to the multimodel visual-textual representation learning area or medical domain. In addition, some potential issues, such as sentence empty matching and similar cases matching, are not well solved or discussed in this image-report pretraining framework in mammography. Considering both the strengths and weaknesses of the paper, I believe the paper is slightly below the borderline and rate as "borderline reject".
soundness: 2
strengths: - The code and public datasets are provided for reproducibility. 
- The datasets covers large data size and diverse tasks. 
- The proposed framework is compared with many other leading methods. The results show leading downstream linear classification performance and zero-shot and full finetuning classification performance.
summary: The paper provides a multimodality textual-visual contrastive learning framework in mammography, leveraging multi-view image in global level image-report matching and local level multi-scale patch-sentence matching. The proposed method is evaluated on two public datasets and get leading results in downstream tasks.
weaknesses: - Main weakness: there are very limited novelty in methodology design. 
	1. The multi-view matching module is basically common multimodality visual-textual representation/contrastive learning design. The pretraining tasks include global level image-to-image task due to mammography dataset provides multiple views of the same case, and global level image-to-text task where report is matched to each image view. These global matching tasks are widely used as pretraining auxiliary tasks in multimodality representation learning models. The only difference, multi-view matching, is not a novel method or task design, but simply because mammography provides multiple image views of each case. 
	2. Meta-info masking is the same as language masking task commonly used as a basic pretraining task in all kinds of NLP/LLM models, which has no novelty. 
	3. The symmetric local alignment (SLA) module is very similar to an attention-based unsupervised text-image matching method called *DAMSM* in paper Attn-Gan [1], which are also already used in other medical tasks such as chest X-ray report representation learning [2]. The authors use the similar local level patch-sentence matching module without citing these papers, and have very limited novelty in method design. 
	4. LLM has been used as text embedding encoder and replaced BERT since 2023, and using PEFT to efficiently finetune LLM is not a new technique anymore. 
- Self-supervised multimodality matching has some problems in medical domain, especially for the chest x-ray image-report and mammography images. Since images and reports of different cases can be very similar to each other in mamography, e.g. multiple cases with tumor showing up at similar image regions, in which case the contrastive loss would not work very well due to the consine similarity may get high similarity scores of multiple image pairs or image-report pairs in the same batch. I would like to know if the authors have solved this issue by any specific batch sampling strategy or have any discussion about this potential limitation. 
- In 3.1, the authors build template-based report using all kinds of meta information and clinical findings, which might have some redundent textual information not shown up in the corresponding images. However, since the paper is pretraining the model using local matching tasks between image patches and report sentenses, there could be some issues in SLA when matching a report sentense that has no semantic visual marker or clue in any image patch. I think using only the clinical findings as report may reduce such *empty matching* issue and let the pretraining converge better. 


[1] Xu, T., et al. "Attngan: Fine-grained text to image generation with attentional generative adversarial networks." CVPR. 2018. 
[2] Ji, Z., et al. "Improving joint learning of chest x-ray and radiology report by word region alignment." MICCAI-MLMI 2021.

---

confidence: 5
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. I'm confused about how did you do zero-shot for vision-only models (e.g. ViT initialized with DINOv2 model weights)? in Baselines, line 406 "We pre-train and fine-tune all these baselines with the same settings as our model.", and in line 409, "All the baseline methods use fully fine-tuned BioClinicalBERT (Alsentzer et al., 2019) as text encoder." - did you just use the vision encoder in these respective baselines as the vision encoder in your framework and train with you setting? E.g. use ViT, DINOv2 initialized ViT, vision encoder in the original CLIP, vision encoder in SLIP, etc. as the vision encoder, and then finetune?
2. Did you try to use encoder for tabular data to encode mammography metadata instead of phrasing them to text?
soundness: 3
strengths: 1. The proposed SLA module is interesting and shown to be effective.
2. MaMA is shown to be effective in utilizing the multi-view images in mamography.
summary: This paper presents a contrastive language-image pre-training framework that utilizes the multi-view images in mammography. MaMA  performs contrastive learning between the two views of the same study, and alignment between each view to the corresponding metadata formulated as text, in the same time. Additioanlly, symmetric local alignment module is proposed to enhance model focus on small regions of interest. This approach is validated on large datasets, EMBED and RSNA-Mammo, and demonstrates promising results.
weaknesses: Although the proposed method outperforms other baselines, none of the baseline is mammography-specific. There is lack of comparison with domain-specific models (uni-modal trained on images or multi-modal trained in CLIP-style). How does the model compare to a dinov2 model trained on images only in linear probe and finetuning, on both internal and external classification tasks?

---

confidence: 5
contribution: 1
initial_rating: 3
presentation: 2
questions: 1. The EMBED dataset is very large and provides a rich set of assessment categories. Can we use the model trained on EMBED to directly evaluate it on RSNA-Mammo? I wonder if it is feasible to assess only cancer vs. non-cancer. 

2. Could you explain how to use the BioMedLM, a decoder-based transformer, as a text encoder?
soundness: 2
strengths: This paper explores contrastive language-image pre-training in the field of mammography, highlighting the potential of vision-language pre-training in this area.
summary: This paper proposes a multi-view and multi-scale alignment method for contrastive language-image pre-training in mammography. Based on the characteristic that a single patient has multiple images in mammography data, the framework performs alignment for both image-image and image-text for the same patient simultaneously. This method has been evaluated on the two public datasets EMBED and RSNA-Mammo, surpassing some classic vision-language methods, such as CLIP and SLIP.
weaknesses: 1. The multi-view and multi-scale alignment method proposed in the article offers only incremental contributions compared to existing contrastive language-image pre-training frameworks, providing limited insights for future developments in this field. 

2. The literature review on related work is lacking, and the experimental comparisons are insufficient. The comparison results mainly focus on categories based on ViT variants, specifically comparing with DeiT and DiNOv2-based ViT. Clearly, this paper is focused on the vision-language domain rather than the vision transformer architecture, and it should compare with the latest methods in vision-language. A shortcoming is that the paper only compares against methods like CLIP, ConVIRT, and MGCA, all of which are from before 2022. It is well-known that this field is evolving rapidly, and the paper fails to include more recent vision-language methods from the past one or two years.

3. The similarity score includes a lot of additional information beyond the diagnosis in the images and reports, such as patient information and image information. Although a meta-info random masking training strategy is employed, it cannot guarantee that the model will not be biased towards irrelevant information during the local alignment process.

4. The paper states, “incorporate parameter-efficient fine-tuning (PEFT) of a pre-trained large language model (LLM) as our text encoder.” However, to my knowledge, BioMedLM is a decoder-based transformer, and the article does not explain how it is utilized as a text encoder.

5. Mammography images are generally of high resolution, such as 4096x4096. Resizing the images directly to 518x518 will result in a significant loss of detailed information, which seems inconsistent with clinical requirements.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 3
questions: see above
soundness: 2
strengths: - The authors attempt to build a pre-training model for mammography using multi-view and multi-scale information in images. 
- The manuscript is easy to follow overall.
summary: The authors proposed a pre-training scheme for mammography images using cross-view (images) and cross-modality (image and text in detailed scale) contrastive learning. Two public datasets (EMBED and RSNA-Mammo) are adopted for the comparison study. Superior results of the proposed method are reported in comparison to previous VLMs for nature images and texts. The manuscript is overall easy to follow. However, it also suffers from critical flaws as listed below.
weaknesses: - The presented work is limited in technical innovation. The idea of aligning detailed textual descriptions with the image regions has been commonly investigated in training the model for medical image analysis tasks, e.g., in attributes/image alignment for chest X-rays. Additionally, enforcing the contrastive learning between images (multi-views) and between images and texts are also pretty standard proxy tasks. 

- The motivation for performing the structured report construction is unclear. If all the words except the key information are the same for all reports, what's the point of including them, which is meaningless to learn during the training? Instead, why not input the key information directly, e.g., as a list of keywords for each case?

- linear classification -> linear probing? The results of linear probing are missing in Tables 1 and 2? and missing zero-shot results in Table 3. The selectively reported results make the conclusion less convincing.

- The linear probing actually achieve the best results as shown in Table 3 and 4, which is suprisingly higher than the full fine-tuning. It will be helpful if the author could provide some insight on this.