{'fraction_non_alphanumeric': 0.04698579385136296, 'fraction_numerical': 0.01872071055278848, 'mean_word_length': 4.782917139614075, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
ConCL: Concept Contrastive Learning for Dense Prediction Pre-training in Pathology Images

Detectingandsegmentingobjectswithinwholeslideimagesis essential in computational pathology workflow. Self-supervised learning (SSL) is appealing to such annotation-heavy tasks. Despite the extensive benchmarks in natural images for dense tasks, such studies are, unfortunately, absent in current works for pathology. Our paper intends to narrow this gap. We first benchmark representative SSL methods for dense prediction tasks in pathology images. Then, we propose concept contrastive learning (ConCL), an SSL framework for dense pre-training. We explore how ConCL performs with concepts provided by different sources and end up with proposing a simple dependency-free concept generating method that does not rely on external segmentation algorithms or saliency detection models. Extensive experiments demonstrate the superiority of ConCL over previous state-of-the-art SSL methods across different settings. Along our exploration, we distll several important and intriguing components contributing to the success of dense pre-training for pathology images. We hope this work could provide useful data points and encourage the community to conduct ConCL pre-training for problems of interest. Code is available.


Introduction
Computational pathology is an emerging area in modern healthcare. More whole slide images (WSIs) are now analyzed by deep learning (DL) models [32]. To alleviate the heavy annotation burden required by DL models, reusing weights from pre-trained models has become a common practice. Besides transferring from fully-supervised models, recent attention has been attracted to self-supervised   [31] and CRAG dataset [11]. All models are fine-tuned with the same detector, i.e., Mask-RCNN architecture [16], ResNet-18 backbone [17], and FPN head [23] under 1× finetuning schedule. Results are averaged over 5 independent runs.
learning (SSL) methods [14,4,12]. They are annotation-free but can achieve comparable or even better performance when transferring. The breakthrough of SSL methods starts with contrastive learning [13,38,4,14,5], where the most popular task is instance discrimination [38]. It requires a model to discriminate among individual instances, i.e., image-level representations.To achieve that, it first defines some positive pairs and negative pairs. It then optimizes a model to maximize the representation similarity between positive pairs and minimize it between negative pairs. Later, more SSL methods based on cross-view prediction are proposed, e.g., [3,12,4,42]. However, these methods are optimized for image-level representations and might be sub-optimal for dense prediction tasks such as object detection and instance segmentation. This motivates works for detection-friendly pre-training methods, e.g., DenseCL [36], InsLoc [41], Self -EMD [25], SCRL [30], and more [18,33,39,40]. Despite many interests raised in the natural image domain for dense prediction problems, such studies, which are of important clinical and practical values, are absent in the pathology image domain. Our research is intended to bridge the gap between SSL in natural images and pathology images for dense prediction tasks, as well as to distill the key components to the success of dense pre-training in the pathology data.
To that end, we start by presenting a general Concept Contrastive Learning (ConCL) framework. Rather than contrasting image-level representations [38,4,14], it contrasts "concepts" that mark different local (semantic) regions. ConCL is an abstraction of dense contrasting frameworks and thus, as we show later, resembles most concurrent related works. We first benchmark current leading imagelevel SSL methods and a grid-level dense SSL method (i.e., DenseCL [36]) in two public datasets. We observe a considerable performance gap between DenseCL [36] and the others. These gaps indicate the importance of contrasting densely (grid-level) than roughly (image-level). Then, directed by the performance dif-ferences and the characteristics of pathology images, we gradually develop and improve ConCL via a series of explorations. Specifically, we explore: 1) what makes the success of dense prediction pre-training? 2) what kind of concepts are good for pathology images? The nature of having rich low-level patterns in pathology images (see Fig. 1-(a)) gives some surprising and intriguing results, e.g., a randomly initialized model can group meaningful concepts and help dense pre-training. Along the exploration, we distill several key components contributing to the transferring performance for dense tasks. At the end of exploration, the presented ConCL can surpass various state-of-the-art SSL methods by solid and consistent margins across different downstream datasets, detector architectures, fine-tuning schedules, and pre-training epochs. For example, as shown in Figure 1-(b), the 200-epoch pre-trained ConCL wins all the other methods but with 4× to 8× fewer epochs. To summarize, this paper makes the following contributions: • It makes one of the earliest attempts to systematically study and benchmark self-supervised learning methods for dense prediction problems in pathology images, which are of high practical and clinical interest but, unfortunately, absent in existing works. We hope this work could narrow the gap between studies in natural images and pathology images. • It presents ConCL, an SSL framework for dense pre-training. We show how ConCL performs with concepts provided by different sources and find that a randomly initialized model could learn semantic concepts and improve itself without expert-annotation or external algorithms while achieving competitive, if not the best, results. • It shows how important the dense pre-training is in pathology images for dense tasks and provides some intriguing observations that could contribute to other applications such as few-shot and semi-supervised segmentation and detection, or more, in pathology image analysis or beyond.
We hope this work could provide useful data points and encourage the community to conduct ConCL pre-training for problems of interest.
2 Related work Contrastive learning. The success of deep learning is mainly attributed to mining a large amount of data. When limited data is provided for specific tasks, an alternative is to transfer knowledge by re-using pre-trained models [10,15]. SSL methods learn good pre-trained models from label-free pretext tasks, e.g., colorization [43,44], denoising [34], and thus attract much attention. Recently, contrastive learning [14,5,4,27,38,3], a typical branch of SSL, has made significant progress in many fields, where instance discrimination [13,38,14,5,4] serves as a pretext task. It requires a model to discriminate among individual instances, i.e., image-level representations [38]. MoCo [14,5] and SimCLR [4] are two representatives. Specifically, they generate two views of the same image via random data augmentations (e.g., color jittering, random cropping) and mark them as a positive pair. Then, views from other different images are marked as negative instances or pairs. After that, they learn embeddings by maximizing the similarity between the representations of positive pairs while minimizing it between the representations of negative pairs. Later methods combine contrasting with clustering, e.g., SwAV [3] proposes to contrast views' cluster assignments, and PCL [22] contrasts instances with cluster prototypes.
Dense prediction pre-training. Despite their success in transferring to classification tasks, good image-level representations do not necessarily result in better performance in dense prediction tasks. Therefore, recent efforts have been made for dense prediction pre-training. Related works are mostly concurrent [36,41,30,33,39,40,25,18]. Among them, DenseCL [36] learns the correspondence among pixels of a positive pair and optimizes a pairwise contrastive loss at a pixel level, yielding a dense contrasting behavior. Self -EMD [25] does dense predicting in a non-contrastive manner as in BYOL [12], i.e., predicting a grid-level feature vector from one view when given its counterpart from another (positive) view. SCRL [30] argues the importance of spatially consistent representations, so it maximizes the similarity of box region features in the intersected area. The most relevant works concurrent to ours are [18,33]. They also optimize contrastive loss over mask-averaged representations. Those masks are generated by external algorithms that are successful for natural images, e.g., Felzenszwalb-Huttenlocher algorithm [9], or models, e.g., MCG [1], BASNet [28], and DeepUSPS [26]. However, the success of such mask generators is unfortunately unverified in pathology images. In this paper, we provide some of their empirical results. Their different performances yield the disparity between natural and pathology images, from which we are motivated to propose a dependency-free concept mask generator. It directly bootstraps the structural concepts inherent in pathology images, learns from scratch, and has better potential.
SSL in pathology images. Studying SSL methods in pathology images is still at an early stage. In addition to studies on natural images, SimCLR [4] is also studied and benchmarked for classification, regression, and segmentation tasks in pathology images [7]. Some domain-specific self-supervised pretext tasks, e.g., magnification prediction, JigMag prediction, and hematoxylin channel prediction, are proposed and studied [20]. However, despite interest raised in natural images for dense problems, existing works have not studied, to our knowledge, detection/segmentation-friendly SSL methods in pathology images. Our work aims to bridge this gap and provide our exploration roadmap toward better dense prediction performance for pathology images.

Method
We start by briefly reviewing MoCo [14,5] and use it as a running example to describe instance contrastive learning [13,38]. Then we derive our motivation for ConCL and describe its details.

MAP Query Encoder
Key Encoder Query view x q

Concept Queue
Push apart  Figure 2: ConCL overview. ConCL has three steps: (1) Given a query view x q and a key view x k , their union region is cropped as a reference view x r . ConCL obtains concept proposals by processing x r with a "concept generator." (2) For the shared concepts, ConCL computes their representations via masked average pooling (MAP). (3) ConCL optimizes concept contrastive loss (Eq. (2)), and enqueues the concept prototypes from the key encoder to the concept queue.

Preliminary: Instance Contrastive Learning
MoCo [14] abstracts the instance discrimination task as a dictionary look-up problem. Specifically, for each encoded query q, there is a set of encoded keys {k 0 , k 1 , k 2 , ...} in a dictionary. The instance discrimination task is to pull closer q and its matched positive key k + in the dictionary while spreading q away from all other negative keys k − . When using the dot-product as similarity measurement, a form of contrastive loss function based on InfoNCE [27] becomes: where τ is a temperature hyper-parameter [38]. Queries q and keys k are computed by a query encoder and a key encoder, respectively [14,5]. Formally, q = h(GAP(f 5 (x q ))), where h is a MLP projection head as per [4]; GAP(·) denotes global-average-pooling, and f 5 (x) represents the outputs from the stage-5 of a ResNet [17]. Keys k are computed similarly using the key encoder. In MoCo [14], the negative keys are stored in a queue to avoid using large batches [4].

Concept Contrastive Learning
Instance contrastive methods [4,14,38] do well in discriminating among imagelevel instances, but dense prediction tasks usually require discriminating among local details, e.g., object instances or object parts. We abstract such local details, or say, fine-grained semantics as "concepts." A concept does not necessarily represent an object. Instead, any sub-region in an image could be a concept since it contains certain different semantics. From the perspective of dense prediction, it is desirable to build concept-sensitive representations. For example, one WSI patch usually contains multiple small objects, e.g., nucleus, glands, and multiple texture-like tissues, e.g., mucus [32,19]. To successfully detect and segment objects in such images, models need to learn more information from local details. To this end, we propose a simple but effective framework -Concept Contrastive Learning (ConCL). Figure 2 shows its overview, which we elaborate on below.
Concept discrimination. We first define a pretext task named concept discrimination. Similar to instance discrimination [38,13], concept discrimination requires a model to discriminate among the representations of the same but augmented concepts and the representations of different concepts. We formulate concept discrimination by extending the instance-level queries and keys to concept-level. Specifically, given an encoded query concept q c and a set of encoded key concepts {k c 0 , k c 1 , k c 2 , ...}, we derive concept contrastive loss as: where τ is the same temperature parameter and k c − are keys in the concept queue -the queue to store concept representations. This objective brings representations of different views of the same concept closer and spreads representations of views from different concepts apart.
Concept mask proposal. We use masks to annotate fine-grained concepts explicitly. Assume a mask generator is given, as diagramed at the bottom of Figure 2; we first pass a reference view x r , defined as the circumscribed rectangle crop of the union of two views, into the mask generator to obtain a set of concept where K is the number of concepts. Since the reference view contains both the query view and the key view, their concept masks M q and M k are immediately obtained if we restore them in the reference view. Then, we derive concept representations in both views by masked average pooling (MAP) with resized concept masks. Specifically, we compute q c = h (MAP (f 5 (x q ), m c )) and k c similarly, where MAP (z, m) = ij m ij · z ij / ij m ij , and z ∈ R CHW denotes feature maps, m ∈ {0, 1} HW is a binary indicator for each concept. Here, only the shared concepts in both views are considered, i.e., m c ∈ M q ∩ M k .
Our analysis hereafter focuses on 1) What makes the success of dense prediction pre-training? 2) What kind of concepts are good for pathology images? Different answers to these two questions reveal the characteristics of pathology images and the disparity between natural and pathology images, as we explore in Section 4. Below, we first introduce the benchmark pipeline and setups.

Benchmark Pipeline
Despite the extensive benchmarks in natural images for dense tasks, to our knowledge, such studies are unfortunately absent in current works for pathology. Note that studying SSL methods in pathology images is still at an early stage. Most current works focus on employing image-level SSL methods for classification tasks. Orthogonal to theirs, we investigate a wider range of SSL methods for object detection and instance segmentation tasks, which are of high clinical value. We hope our work could provide useful data points and baselines for future work.
Brief implementations and baseline settings. Unless specified, our explorations use the following settings (more details in Appendices B and C): • Pre-training codebase. We use OpenSelfSup 4 as our codebase since it incorporates various state-of-the-art self-supervised methods. All experiments are conducted within this codebase for integrity and fairness.
• Hyper-parameter. We change the queue length to 16384 in MoCo-v1/v2 [14,5] and set the batch sizes of SimCLR [4] and BYOL [12] to 1024. Other hyperparameters remain the same as provided by the codebase, including data augmentation parameters and optimizer settings. Such settings should match their original proposals.
• Pre-training dataset. We use NCT-CRC-HE-100K [19] dataset, referred to as NCT, for pre-training. It contains 100,000 non-overlapping patches extracted from hematoxylin and eosin (H&E) stained colorectal cancer and normal tissues. All images are of size 224 × 224 at 0.5 MPP (20× magnification). We randomly choose 80% of NCT to be the pre-training dataset.
• Transferring settings. We use Detectron2 [37] as the detection codebase and the default hyperparameters. Unless otherwise specified, we use Mask-R-CNN [16] detector with a feature pyramid network (FPN) head [23] as our base detector. For convenience and per common terminology [15], we define different 1× fine-tuning schedules for two transferring datasets. For evaluation, We report the COCO-style metrics, i.e., mAP family.
• Transferring dataset. We use two public datasets, the Gland segmentation in pathology images challenge (GlaS) dataset [31] and the Colorectal adenocarcinoma gland (CRAG) dataset [11], and follow their official train/test splits for evaluation. GlaS [31] collects images of 775×522 from H&E stained slides with object-instance-level annotation; the images include both malignant and benign glands. CRAG [11] collects 213 H&E stained images taken from 38 WSIs with a pixel resolution of 0.55µm/pixel at 20× magnification. Images are mostly of size 1512×1516 with object-instance-level annotation.
We study the performance of object detection and instance segmentation tasks.
Experimental setup. We pre-train all the methods on the NCT training set for 200 epochs. For ConCL pre-training, we warm up the model by optimizing instance contrastive loss (Eq. (1)) for the first 20 epochs and switch to concept contrastive loss (Eq. (2)). Then, we use the pre-trained backbones to initialize the detectors, fine-tune them on the training sets of transferring datasets, and test them in the corresponding test sets. Unless otherwise specified, we run all the transferring experiments 5 times and report the averaged performance.

Towards Better Concepts: a Roadmap
In this section, we first benchmark some popular state-of-the-art SSL methods for dense pathology tasks. Then, we start with DenseCL [36] and derive better concepts along the way, directed by the questions raised in the previous section.

Benchmarking SSL methods for Dense Pathology Tasks
Benchmark results. Table 1 (baselines and prior SSL arts) shows the transferring performance for GlaS dataset (left columns) and CRAG dataset (right columns), respectively. We report results using 200-epoch pre-trained models and a 1× fine-tuning schedule. On the GlaS dataset [31], we observe that the gap between training from randomly initialized models and training from supervised pre-trained models is relatively smaller compared to those in the natural image domain [6,5,12,4]. Nonetheless, state-of-the-art SSL methods all exceed supervised pre-training, meeting the same expectation as in natural images. Yet, on the CRAG dataset [11], most of the pre-trained models, including both the selfsupervised ones and the supervised one, fail to achieve competitive performance compared to training from randomly initialized weights. The only exception is DenseCL [36], a dense contrasting method. Overall, among the image-level SSL methods, MoCo-v2 [5] performs the best in GlaS and the second-best in CRAG. Built upon MoCo-v2 and enhanced by dense contrasting, DenseCL [36] achieves the best results in both datasets. It should be emphasized that DenseCL [36] gets + 1.6 AP bb for GlaS by using grid-level contrasting. This demonstrates the importance of designing dense pretraining frameworks when transferring to dense tasks since all the stragglers are only optimized for image-level representations.
Thus, we here conclude dense contrasting matters.

Correspondence matters
From the previous section, we find dense contrasting is favored in both natural and pathology images, where DenseCL [36] all achieves top performance.  The next question is: can we improve the dense contrasting framework? To answer it, we first summarize the overall pipeline of DenseCL [36]. DenseCL computes the dense representations of two views without global average pooling, i.e., f 5 (x q ), f 5 (x k ), and passes them to a dense projection head to obtain final grid features of size R 128×7×7 . Then it sets the most similar (measured by cosine similarity) grids in two views as positive pairs. As such, the correspondence of positive pairs is learned. However, the reliability of learned correspondence remains questionable and would affect the quality of learned representations.
To address that, we instantiate DenseCL [36] in ConCL by regarding the grid-prior as a form of concept, as shown in Figure 3-(b). We denote this ConCL instance as g-ConCL. Compared with DenseCL [36] (learned matching), ConCL naturally restores the positive correspondence from a reference view (precise matching, Fig. 2-x r ) which is more reliable. Table 1-(1-3) compares the original DenseCL [36] and ConCL-instantiated g-ConCL. The results indicate that g-ConCL with precise correspondence can boost DenseCL [36] by a large margin. Even with the simplest form of concepts, g-ConCL already has topped entries above it in Table 1. We believe other dense pre-training methods that learn the matching between grids, e.g., Self -EMD [25], should perform similarly to DenseCL [36], and g-ConCL could outperform them.
Thus, we here conclude that correspondence matters.

Natural Image Priors in Pathology Images
ConCL is a general framework for using masks as supervision to discriminate concepts. Some previous works in natural image [46,18,45,33,35] also combines masks with contrastive learning, where the masks are provided by ground truth annotation [46,35,18], or supervised/unsupervised pseudo-mask generation [18,45,33]. The mask generators can be graph-based (e.g., Felzenszwalb-Huttenlocher algorithm [9]), MCG [1], or other saliency detection models [28,26] trained on designated natural image datasets. However, those methods werer originally proposed for nature images, and their success for pathology images remains unknown. Here we instantiate ConCL by using Felzenszwalb-Huttenlocher (FH) algorithm [9] and BASNet [28] as concept generators, dubbed as fh-ConCL and bas-ConCL, respectively. FH [9] is a conventional graph-based segmentation algorithm that relies on local neighborhoods, while BASNet [28] is a deep neural network pre-trained on a curated saliency detection dataset, which only contains daily natural objects. We use these two as representatives to study if these natural image priors win twice in both natural and pathology images.
For implementations, we use the FH algorithm in the scikit-image package and set both "scale" and "size" hyper-parameters to s. We use the pre-trained BASNet provided by [28].  Table 1 reports the results.
It is not surprising that the BASNet [28] cannot generate decent concept masks ( Fig. 3-(e)) for pathology images since it is pre-trained on curated saliency detection datasets. What is surprising is that bas-ConCL does yield satisfactory results (Tab. 1- (6)). Similar observations are also found in fh-ConCLs (Tab. 1-(4,5)) that though the generated concept masks are coarse-grained, the resulted transferring performances are unexpectedly good. After inspecting more examples, we find that the generated masks maintain high coherence and integrity despite their coarse-grained nature. That said, each concept contains semanticconsistent objects or textures. For example, Figure 3-(d,e) can be seen as special cases of Figure 3-(a) that merge fine-grained semantics with coarse-grained ones. This property makes the major difference between fh-/bas-ConCLs and g-ConCLs, where the grid-concepts are less likely to have coherent semantics.
Thus, we here conclude that coherence matters and natural image priors also work in pathology images, though they mostly provide coarse-grained concepts.

Pathology Image Priors in Pathology Images
Can we obtain concept masks away with natural image priors? External dependency is not always wanted and sometimes may fail to provide the desired masks (e.g., Fig. 3-(e)). We thus task ourselves to find a dependency-free concept proposal method. One of the key characteristics inherent in pathology images is that they have rich low-level patterns and tissue structures. Can we use that prior instead? Figure 3-(f-h) shows the clustering visualization from intermediate feature maps generated by a 10-epoch warmed-up MoCo-v2 [5]. Thanks to the rich structural patterns in pathology images, we find that simply clustering over the feature maps provided by a barely trained model can already generate meaningful structural concept proposals. We thus build upon this "free lunch" and use a "bootstrap your own perception" mechanism that is similar to the "bootstrap your own latent" mechanism in BYOL [12]. ConCL generates concept proposals from the momentum key encoder's perception while simultaneously improving and refining it via the online query encoder, leading to a "bootstrapping" behavior. Thus, we denote such ConCL as bootstrapped-ConCL (b-ConCL). We provide an additional introduction to BYOL and "bootstrapping" in Appendix A.
b-ConCL. The concept generator is now instantiated as a KMeans grouper. We first pass the reference view x r to the key encoder to obtain a reference feature map from ResNet stage-i: f i (x r ) ∈ R CHW . Then, we apply K-Means to group K underlying concepts. b-ConCL relies on neither external segmentation algorithms nor designated saliency detection models for natural images.
Our default setting is K = 8, and clustering from f 4 or f 5 . We postpone the study of hyper-parameters, i.e., the number of clusters in KMeans, and the clustering stage f i to Section 5.2 and report the main results in Table 1 -(7,8). We find b-ConCL tops other entries. Compared to MoCo-v2 [5], our direct baseline, b-ConCL outperforms it by +4.5 AP bb and +3.1 AP mk . Moreover, b-ConCL obtains more gains in terms of AP 75 (+6.2 AP bb 75 , +3.7 AP mk 75 ) compared to MoCo-v2 [5], which means it improves MoCo-v2 [5] by more accurate bounding box regression and instance mask prediction. This aligns with our motivation for ConCL since discriminating local concepts helps shape object borders.
Closing remarks. So far, we have included: i) dense contrasting matters; ii) correspondence matters; iii) coherence matters; iv) natural image priors, though they might only provide coarse-grained concepts, work in pathology images as well; and find v) a randomly initialized or barely trained convolutional neural  network, thanks to the rich low-level patterns in pathology images and good network initialization, can generate good proposals that are dense, fine-grained and coherent, as shown in Figure 3. Though the coarse-grained concepts generated from natural image priors could also help tasks in our studied benchmarks, they might underperform when a fine-grained dense prediction task is given, which we leave for future work.
We hope our closing remarks could be intriguing and guide future works in designing dense pre-training methods for pathology images and beyond.

More Experiments
In the previous section, we have explored how we can obtain concepts, what concepts are good, and find b-ConCL to be the best. We here conduct more experiments to study b-ConCL further. Some qualitative visual comparisons are in Appendix D.

Robustness to Transferring Settings
Transferring with different detectors. Here we investigate the transferring performance with other detectors, i.e., Mask-RCNN-C4 (C4) [29] and RetinaNet [24]. RetinaNet is a single-stage detector. It uses ResNet-FPN backbone features as Mask-RCNN-FPN but directly generates predictions without region proposal [29]. C4 detector adopts a similar two-stage fashion as Mask-RCNN but uses the outputs of the 4-th residual block as backbone features and re-targets the 5-th block to be the detection head instead of building a new one. These three representative detectors evaluate pre-trained models under different detector architectures. All detectors are fine-tuned from 200-epoch pre-trained models with 1× schedule for 5 independent trials. Results together with Mask-RCNN-FPN's are shown in Table 2. b-ConCL performs the best with all three detectors in both datasets. Notably, training from scratch (Rand. Init.) is one of the top competitors when the C4 detector is used. We conjecture that the pre-trained models are possibly overfitted to their pretext tasks in their 5-th blocks and thus are harder to be tuned than a randomly initialized 5-th block. In CRAG detection, only b-ConCL pre-trained models consistently outperform randomly initialized models. In addition, the most significant gap between MoCo-v2 [5] and b-ConCL is found in the RetinaNet detector [24]. As also noted by [25], Reti-naNet [24] is a single-stage detector, where the local representations from the backbone become more important than other two-stage detectors since results are directly predicted from them. b-ConCL is tasked to discriminate local concepts, and subsequently, the learned representations could be better than other pre-training methods here.
Transferring with different schedules. Fine-tuning with longer schedules may improve downstream task performance. To investigate if b-ConCL's lead could persist with longer fine-tuning, we fine-tune Mask-RCNN-FPN with 0.5×, 1×, 2×, 3×, and 5× schedules. Table 3 shows the results. b-ConCL maintains its noticeable gains in longer schedules in both datasets, e.g., b-ConCL achieves 56.2 mAP with a 0.5× schedule, which is better than MoCo-v2 [5] with a 5× schedule but costs 10 × less fine-tuning time. Similar observations are also found in CRAG, where the gap between b-ConCL and MoCo-v2 [5] becomes larger (see ∆ row). Together, these results confirm b-ConCL's superiority across different fine-tuning schedules.

Ablation Study
In this section, we ablate the key factors in b-ConCL. Our default setting clusters K = 8 concepts from ResNet stage-4 (f 4 (·)). Since b-ConCL is built on MoCo-v2 [5], we use it as our direct baseline for comparisons.
Concept loss weight λ. We here study the generalized concept contrastive loss: L = (1 − λ)L q + λL c , where λ ∈ [0, 1] is a concept loss weight parameter. It shows a natural way to combine concept contrastive loss with instance   Table 4: Ablation Study. We study the effect of different hyper-parameters to b-ConCL. Default settings are marked in gray and MoCo-v2 baselines are marked by gray. In (a), "\w." means no warm-up.
contrastive loss. We start by asking whether instance contrastive loss is indispensable during the training process of b-ConCL. We alter the concept loss weight λ, and Table 4a reports the results. We see a monotonically increasing performance as λ increases in both datasets, which emphasizes the importance of concept loss. When no warm-up is used (last row in Tab. 4a), only a slight performance drop is observed, meaning that warm-up is not the key component of b-ConCL. Warming-up with instance loss (Eq. (2)) is a special case of b-ConCL, where at the early training stage, each instance is regarded as a concept, and we then gradually increase the number of concepts as training goes on. Thus, the overall findings in this ablation support b-ConCL's advance over MoCo-v2 [5].
Number of concepts K. Here, we investigate how the number of concepts clustered during pre-training affects performance in downstream tasks. We report the results of different K in Table 4b. b-ConCL performs reasonably well when K >= 4, with most of performance peaking at K = 8. This demonstrates the robustness of b-ConCL to the choice of K. Note that the best performance for the GlaS dataset is higher than our default setting and outperforms all entries in Table 1, showing the potential room for b-ConCL.
Where to group f i (·). b-ConCL groups concepts from a model's intermediate feature maps. Our default setting uses feature maps from stage-4 of a ResNet [17], denoted as f 4 (·). We now ablate this choice in Table 4c. Clustering concepts from f 4 (·) and f 5 (·) works similarly well across two datasets. We choose f 4 (·) as the default since it achieves top two performance in both datasets under both metrics. Besides, b-ConCL exceeds MoCo-v2 [5], whichever stage it groups concepts from. This again confirms the effectiveness and robustness of b-ConCL. See Figure 3 as a reference for the cluster results from parts of these stages.
Longer pre-training. We compare the pre-training efficiency of different SSL methods w.r.t. training epochs in Figure 1-(b,c) with the numerical results in Appendix D. Interestingly, we find SimCLR [4] and BYOL [12] fail to benefit from longer pre-training. This shows the disparity between pathology image data and natural image data. In the latter field, a monotonically increasing performance in downstream tasks is usually observed [18,14,12,3,4]. For MoCo-v1/v2 [14,5], DenseCL [36] and our b-ConCL, we observe the performance consistently improves as the pre-training epoch increases in GlaS dataset [31]. Note that, the 200-epoch pre-trained b-ConCL surpasses the 800-epoch pre-trained MoCo-v2 [5], and DenseCL [36] by a large margin ( Fig. 1-(b)). In the CRAG dataset, we observe all pre-training methods saturate and achieve the best performance in around 200-epoch and 400-epoch. Among them, b-ConCL is still the best (Fig. 1-(c)). Especially, the 100-epoch ConCL has already outperformed all the other competitors regardless pre-training epochs ( Fig. 1-(b)).
Larger model capacity. Table 4d shows the results of using a larger backbone, ResNet-50. b-ConCL maintains its leading position. For consistency to the previous ablation, a 1× schedule is also used here, which could put ResNet-50 at a disadvantage since it has more parameters to tune in a relatively short schedule.

Conclusion and Broader Impact
In this work, we have benchmarked some of the current SSL methods for dense tasks in pathology images and presented the ConCL framework. Along our exploration, we have distilled several key components to the success of transferring to dense tasks: i) dense contrasting matters, ii) correspondence matters, iii) coherence matters, and more. Finally, we ended up with a dependency-free concept generator that directly bootstraps the underlying concepts inherent in the data and learns from scratch. It was shown to be robust and competitive.
While our initial results are presented only for pre-training and fine-tuning, many applications could embrace ConCL. One example is to combine it with few-shot detection or segmentation, where clustering from feature arrays can be an approach for mining latent objects. Another example can be semi-supervised learning, where ConCL can be used as an additional branch for unlabeled data.
Beyond pathology image analysis, we also hope ConCL would help in speech or tabular data, where little priors can be used. Unsupervised clustering in representation space is likely to be modality-agnostic. Learned by using contrastive learning and clustering, fine-grained "concepts" could also be mined from those data modalities. Practical Complement. In practice, the training process of MoCo [14,5] is distributed across multiple GPUs. Therefore, features need to be gathered from all GPUs before updating the queue. The gathering operation requires tensors from different GPUs to have the same shape. However, this usually does not hold for ConCL, where the number of the shared concepts (i.e., concepts in both views) varies per pair. We resolve this problem by padding concept keys with randomly re-sampled concepts from the current batch to match the requirement. Specifically, we pad the number of features in each GPU to K * batch size/num GPUs, where K is the number of clusters. When such padding is infeasible (e.g., K > 8), we only randomly sample 4 * batch size/num GPUs concepts. This ensures the validity of the "gather" operation.

B.2 Other Self-supervised Methods
All self-supervised methods use ResNet-18 [17] as the backbone. We subsequently modify the numbers of input and hidden channels of the projection head and the prediction head to match the outputs' dimension from ResNet-18. For data augmentation and other hyper-parameters (e.g., temperature, optimizer), we use the default settings specified in each config file in OpenSelfSup, 2 which should be the same as the original methods.
SimCLR [4] & BYOL [12]. Since both SimCLR and BYOL require a large batch size, we use 1024 for them, which is the maximum number we can afford. For SimCLR, the numbers of channels in each layer of the projection head are set to 512-512-128 (input, hidden, output layers). For BYOL, we set them to 512-512-256 (input, hidden, output layers); the numbers of channels in each layer of the prediction head are then set to 256-512-256 (input, hidden, output layers).
MoCo-v1 [14], MoCo-v2 [5] and DenseCL [36]. These three methods require an instance queue. We change the length of the instance queue to 16394 since our pre-training dataset only has 100k samples, far less than 1.28M samples in ImageNet [21]. For MoCo-v1, the numbers of channels in each layer of the projection head are set to 512-128 (input, output layers). For the remaining two methods, we set them to 512-512-128 (input, hidden, output layers).
PCL-v2 [22]. We use the officially released code 3 for PCL's experiments. We change the numbers of channels in each layer of the projection head to 512-512-128 (input, hidden, output layers) and the number of clusters in PCL to (20000, 35000, 50000).

C Detection Configuration Details
C.1 GlaS.
Introduction. Glands are important tissue structures for diagnosing adenocarcinomas, a prevalent type of malignant tumor in the prostate, breast, lung, colon, and more. Gland segmentation in pathology images challenge (GlaS) dataset [31] collects images from H&E stained slides with object-instance-level annotation. It consists of a variety of malignant grades. We follow the official train/test split for evaluation, where the training split contains 37 benign and 48 malignant images, and the test split consists of 37 benign and 43 malignant images.
Transferring setup. The batch size is 16, and the base learning rate is 0.02. For learning schedules, we refer the 1× fine-tuning schedule to as training for 5k iterations, with the learning rate decayed by ten times smaller at 4k iteration. Similarly, the 0.5× schedule has a total of 2.5k training iterations with decay at 2k iteration; the 2× schedule has a total of 10k iterations, with decay at 8k iteration, and so forth for other schedules.
Introduction. The colorectal adenocarcinoma gland (CRAG) dataset [11] collects 213 H&E stained images taken from 38 WSIs with a pixel resolution of 0.55µm/pixel at 20× magnification. Images are mostly of size 1512×1516 with object-instance-level annotation. We follow the official split for evaluation, where the training set has 173 images, and the test set has 40 images with different cancer grades.
Transferring setup. The batch size is 16, and the base learning rate is 0.02. For learning schedules, we refer the 1× fine-tuning schedule to as training for 15k iterations, with the learning rate decayed by ten times smaller at 10k and 13k iterations, respectively. Similarly, the 0.5× schedule has a total of 7.5k training iterations with decay at 5k and 6.5k iterations; the 2× schedule has a total of 30k iterations, with decay at 20k and 26k iterations, and so forth for other schedules. The intuition behind the different fine-tuning schedules for GlaS and CRAG is the difference in dataset sizes, i.e., CRAG has around 2.5 times more training samples than GlaS.

D More Results
Training speed. Currently, b-ConCL relies on a third reference view for concept matching between different views, which does slow down the training speed. For K-Means, we implement it using matrix multiplication so that the clustering process is parallel to a batch of images.   [11], respectively. We non-exhaustively annotate different detection errors by arrows in different colors. Overall, ConCL outperforms other pre-training methods in terms of less false negative (the black arrows), less false positive (the blue arrows), and more complete detection and segmentation (the red arrows).
Numerical results of longer pre-training. In complement to Figure 1-(b,c), we further report the numerical results of the transferring performance of 800epoch pre-trained models in Table D  Qualitative comparison on CRAG dataset [11]. We show the results with Mask-RCNN R18-FPN under 1× schedule.