Improving Self-training with Prototypical Learning for Source-Free Domain Adaptation on Clinical Text (2024)

Abstract: Domain adaptation is crucial in the clinical domain since the performance of a model trained on one domain (source) degrades seriously when applied to another domain (target). However, conventional domain adaptation methods often cannot be applied due to data sharing restrictions on source data. Source-Free Domain Adaptation (SFDA) addresses this issue by only utilizing a source model and unlabeled target data to adapt to the target domain. In SFDA, self-training is the most widely applied method involving retraining models with target data using predictions from the source model as pseudo-labels. Nevertheless, this approach is prone to contain substantial numbers of errors in pseudo-labeling and might limit model performance in the target domain. In this paper, we propose a Source-Free Prototype-based Self-training (SFPS) aiming to improve the performance of self-training. SFPS generates prototypes without accessing source data and utilizes them for prototypical learning, namely prototype-based pseudo-labeling and contrastive learning. Also, we compare entropy-based, centroid-based, and class-weights-based prototype generation methods to identify the most effective formulation of the proposed method. Experimental results across various datasets demonstrate the effectiveness of the proposed method, consistently outperforming vanilla self-training. The comparison of various prototype-generation methods identifies the most reliable generation method that improves the source model persistently. Additionally, our analysis illustrates SFPS can successfully alleviate errors in pseudo-labeling.

## introduction domain adaptation is crucial in clinical natural language processing (clinical nlp) since it is known that the performance of the model trained on one domain (source) degrades seriously on another domain (target) in the face of domain shifts such as different specialty or institution's formatting @xcite @xcite . despite the significant advancements in research on domain adaptation, most existing methods assume access to the labeled source data @xcite . this assumption is frequently violated in the clinical domain, where data sharing is restricted due to patients' privacy concerns @xcite . source-free domain adaptation (sfda) addresses this issue by only utilizing a source model and unlabeled target data to adapt to the target domain @xcite . self-training @xcite has been shown to be a versatile and effective method for sfda in computer vision @xcite . in clinical nlp, a shared task was newly introduced in @xcite , prompting the development of sfda methods on clinical text. active learning and self-training combined with data augmentation emerged as widely applied methods @xcite . the systematic comparison of the proposed methods indicates that active learning can reliably improve the source model's performance, while self-training is unreliable, failing to consistently outperform the source model @xcite . however, active learning requires additional annotation on the target data, which can be difficult due to the expertise required for the annotation @xcite . this necessitates improvement of the existing self-training method that does not rely on either additional annotation or source data for adapting the source model in clinical nlp. prototypical learning @xcite can potentially improve self-training, yet existing methods are not applicable in the sfda setting. in general, self-training involves retraining the source model with target data by assigning the predictions from the source model as pseudolabels. nevertheless, pseudo-labels assigned in this manner contain a substantial number of errors and might limit the model's performance. prototypical learning, such as prototype-based pseudolabeling @xcite , and contrastive learning @xcite are proven to be effective for improving self-training @xcite @xcite . however, existing methods assume access to labeled source data to generate reliable prototypes, making them inapplicable in source-free settings. how to generate reliable prototypes without accessing source data remains unanswered. in this paper, we aim to provide answers to the following questions: q1: can prototypical learning improve selftraining in sfda? q2: which method can generate reliable prototypes in the absence of labeled source data? q3: is prototypical learning effective for alleviating errors in pseudo-labeling? to answer q1, we introduce source-free prototypebased self-training (sfps). unlike existing methods, we generate prototypes without accessing source data (fig. 1a ) and leverage the generated prototypes for prototypical learning (fig. 1b ) consisting of prototype-based pseudo-labeling @xcite and contrastive learning @xcite to alleviate errors in pseudo-labeling. to answer q2, we explore three source-free prototype generation methods, namely entropy-based, centroid-based, and class-weights-based methods, inspired by the works in computer vision @xcite @xcite ). to answer q3, we compare the pseudo-label quality of sfps and vanilla self-training. we conduct experiments on negation detection and time expression recognition tasks from se-meval2021 task10 with the source models trained on clinical texts. our experimental results show the effectiveness of sfps, outperforming vanilla self-training methods in most datasets. a comparison of various prototype-generation methods reveals that the centroid-based generation method can reliably improve the source model performance among other generation methods. we evaluate the pseudo-label quality of the proposed method and demonstrate the proposed method could successfully alleviate the errors in pseudo-labeling. to summarize, we provide answers to the above questions as follows: a1: prototypical learning can improve selftraining in sfda and consistently outperform vanilla self-training. ## problem definition unlike conventional domain adaptation, we only have access to the source model and unlabeled target data in sfda. let @xmath0, m the source model, and @xmath1, ..., x n } the target data where n is the number of target samples. in general, source-free self-training aims to improve the performance of m using pseudo-labels ŷi ∈ c assigned to x i . how ŷi is assigned and leveraged for the improvement depends on an individual method. however, only m and x are available for the adaptation. for the generalizability of our study, the only assumption we make on the source model m is that it can be decomposed into an encoder (denoted by f ) and classifier (denoted by g), i.e., m := g(f (•)). strictly speaking, the definition of x i differs between sentence classification and token classification. for sentence classification, one sample is equivalent to one input, i.e., x @xmath2. for token classification, one sample contains a series of inputs, i.e., ## methodology this section presents the proposed source-free prototype-based self-training (sfps). the conceptual workflow is shown in figure 2 . first, we generate class prototypes from unlabeled target data with a source model (composed of f and g) using prototype generation (section 4.1). then, we utilize generated prototypes for prototypical learning, consisting of prototype-based pseudolabeling and contrastive learning. prototype-based pseudo-labeling assigns pseudo-labels based on the similarity between prototypes and text representations (section 4.2). contrastive learning improves the representation of target data by increasing/decreasing similarity between prototypes and target representations belonging to the same/a different class(section 4.3). we describe the overall algorithm (section 4.4) with the variants of sfps. ## discussion experimental results indicate that cen with single can reliably improve the source model compared with vanilla self-training. while no vanilla selftraining method could outperform the un-updated source models in all datasets, cen with single outperformed the un-updated source model in all datasets and the best-performing vanilla selftraining model in 3 out of 4 datasets. since labeled target data is not available (or difficult to obtain) in sfda, hyperparameter tuning is not realistic. hence, it is important for an sfda method to consistently outperform the source model regardless of task and dataset. in the following section, we show that sfps can properly alleviate the errors in pseudo-labeling (section 6.1). we also conducted an ablation study to show both contrastive learning and regularization are effective for improving model performance (section 6.2). ## conclusion in this paper, we proposed source-free prototypebased self-training (sfps) composed of prototype generation, prototype-based pseudo labeling, and contrastive learning. we compared entropy-based, centroid-based, and class-weights-based methods to identify the most reliable prototype generation method. we conducted experiments with two negation detection datasets and two time expression recognition datasets. experimental results show the effectiveness of sfps, consistently outperform-ing vanilla self-training. the comparison of various prototype generation methods reveals that the centroid-based generation method combined with a single iteration strategy is the most reliable formulation, outperforming the source model in all datasets and the best vanilla self-training model in 3 out of 4 datasets. also, our analysis demonstrates that the proposed method can successfully alleviate errors in pseudo-labeling.