{'fraction_non_alphanumeric': 0.038054857621440535, 'fraction_numerical': 0.01643634840871022, 'mean_word_length': 4.858632321373812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 0, '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}}
Adaptable image quality assessment using meta-reinforcement learning of task amenability

The performance of many medical image analysis tasks are strongly associated with image data quality. When developing modern deep learning algorithms, rather than relying on subjective (human-based) image quality assessment (IQA), task amenability potentially provides an objective measure of task-specific image quality. To predict task amenability, an IQA agent is trained using reinforcement learning (RL) with a simultaneously optimised task predictor, such as a classification or segmentation neural network. In this work, we develop transfer learning or adaptation strategies to increase the adaptability of both the IQA agent and the task predictor so that they are less dependent on high-quality, expert-labelled training data. The proposed transfer learning strategy re-formulates the original RL problem for task amenability in a meta-reinforcement learning (meta-RL) framework. The resulting algorithm facilitates efficient adaptation of the agent to different definitions of image quality, each with its own Markov decision process environment including different images, labels and an adaptable task predictor. Our work demonstrates that the IQA agents pre-trained on non-expert task labels can be adapted to predict task amenability as defined by expert task labels, using only a small set of expert labels. Using 6644 clinical ultrasound images from 249 prostate cancer patients, our results for image classification and segmentation tasks show that the proposed IQA method can be adapted using data with as few as respective 19.7% and 29.6% expert-reviewed consensus labels and still achieve comparable IQA and task performance, which would otherwise require a training dataset with 100% expert labels.

Abstract. The performance of many medical image analysis tasks are strongly associated with image data quality. When developing modern deep learning algorithms, rather than relying on subjective (humanbased) image quality assessment (IQA), task amenability potentially provides an objective measure of task-specific image quality. To predict task amenability, an IQA agent is trained using reinforcement learning (RL) with a simultaneously optimised task predictor, such as a classification or segmentation neural network. In this work, we develop transfer learning or adaptation strategies to increase the adaptability of both the IQA agent and the task predictor so that they are less dependent on highquality, expert-labelled training data. The proposed transfer learning strategy re-formulates the original RL problem for task amenability in a meta-reinforcement learning (meta-RL) framework. The resulting algorithm facilitates efficient adaptation of the agent to different definitions of image quality, each with its own Markov decision process environment including different images, labels and an adaptable task predictor. Our work demonstrates that the IQA agents pre-trained on non-expert task labels can be adapted to predict task amenability as defined by expert task labels, using only a small set of expert labels. Using 6644 clinical ultrasound images from 249 prostate cancer patients, our results for image classification and segmentation tasks show that the proposed IQA method can be adapted using data with as few as respective 19.7% and 29.6% expert-reviewed consensus labels and still achieve comparable IQA and task performance, which would otherwise require a training dataset with 100% expert labels.

Introduction
Medical image quality can influence the downstream clinical tasks intended for medical images [1]. Automated algorithms have been proposed for image quality assessment (IQA), based on human scoring of image quality [2][3][4][5][6], prior clinical knowledge [7,8] or a set of hand-engineered criteria [9][10][11]. Task-specific image quality, which measures how well a clinical task can be completed using the image being assessed, may be preferred, but previous methods still rely on human interpretation [2,3]. When the downstream clinical tasks are completed by automated machine learning algorithms, task-specific IQA may become more relevant, however, human perceived task-specific IQA may not accurately reflect the performance of the machine optimised task predictors. Recent works introduce task amenability; defined as the task-specific image quality to directly measure target task performance [12,13], which also takes into account the dependency between training an automated IQA and the training of a task predictor.
For predicting task amenability for IQA, Saeed et al. [12] proposed to train a controller; here, a reinforcement learning (RL) agent, together with the task predictor. Classification and segmentation neural networks were tested as the task predictors. The trained controller predicts significantly different task amenability scores to those determined by humans, with or without requiring human labels of task amenability during training.
By definition, this IQA approach is inevitably dependent on the task predictor and the labelled data used to train such a task predictor, in the case of supervised learning. In clinical practice, the feasibility and cost associated with obtaining quality labelled data sets for various target tasks can not be overlooked. Therefore, we propose a transfer learning strategy to train the IQA agent based on meta-reinforcement learning (meta-RL) across multiple environments. These RL environments can then be designed to reflect different Markov decision processes (MDPs) with differently labelled data. At the same time, a shared task predictor 1 is trained between these MDPs, such that it may be adapted together with the meta-trained controller. Equipping adaptation ability to both the controller and the task predictor has several potential applications for the efficient use of labelled data. In this work, we demonstrate the resulting adaptation ability from relatively low-quality non-expert task labels annotated by individual observers to high-quality expert labels carefully curated by reviewed consensus.
The contributions of the work are summarised as follows: 1) we propose a transfer learning or adaptation strategy to train an adaptable IQA system; 2) we design a meta-RL algorithm for training the task-amenability-predicting controller together with a target task predictor, which is shared amongst multiple environments, such that training to convergence is not required on every time-step and where adaptability is equipped to both the inner and outer loops simultaneously; 3) we demonstrate the efficacy of the proposed transfer learning strategy with experiments using a large set of clinical ultrasound images from prostate cancer patients, labelled by four different observers with varying experience and expertise; 4) the experiments show that using 20-30% of the expert labels is sufficient to fine-tune both the RL controller and the task predictor to achieve comparable performances to when they are trained using the full set of expert labels.

Image quality assessment by task amenable data selection
In this work, we follow the IQA formulation proposed by Saeed et al. [12]. There are two parametric functions, a task predictor f (·; w) : X → Y and a controller h(·; θ) : X → [0, 1], with parameters w and θ, respectively. X and Y are the respective image and label domains with P XY being the joint image-label distribution, with a density function p(x, y).
The task predictor f is optimised to predict labels, by minimising the loss function L f : Y × Y → R ≥0 using sampled data: where P h XY is the controller-selected joint image-label distribution, with density function p h (x, y) ∝ p(x, y)h(x; θ).
The controller h is optimised to measure image quality (task amenability), by minimising the metric function L h : Y × Y → R ≥0 : where L h is in general a non-differentiable metric computed on the validation set, and different to L f . The optimisation is performed using reinforcement learning, where the environment consists of the training set from P XY and the task predictor f (·; w); the agent is the controller h(·; θ) whose action is sample selection ; and the reward is the task predictor performance on a validation set from the same distribution P XY , which is computed after training, for a fixed number of steps, using the selected samples. In this work we use the reward formulation, from [12], which does not require human task amenability labels, and weights the validation set using controller predictions. R t is thus the reward which is a weighted sum of validation set performance.

Meta-reinforcement learning with different labels
In this section, we consider multiple label distributions {P k Y |X } K k=1 , such that each sample x has multiple labels {y k } K k=1 . The joint distributions are thereby Fig. 1: An overview of the proposed meta-RL framework for training the task predictor and the RNN-embedded controller (the IQA agent).
Each distribution P k XY forms an RL environment with an MDP M k . These MDPs are assumed to be sampled from the same MDP distribution P M , i.e. M k ∼ P M . The task predictors f (·; w) and controller h(·; θ) are both shared across different environments.
We adopt the meta-RL formulation [14,15] for reinforcement learning across multiple environments. Given a set of MDPs {M k } K k=1 , a trial is defined as multiple episodes with a sampled MDP M k . The meta-RL agent learns across multiple trials by sampling M k ∼ P M . Different from the RL with one single fixed environment, at time t + 1, the meta-RL agent h takes the action a t , raw reward r t , and termination flag d t at the previous time step in addition to the observed current state s t+1 . Note that for per-sample operation r t = R t at the episode end, and zero otherwise, similar to sparse reward formulations in [14,15]. Denote the input tuple as τ t+1 = (s t+1 , a t , r t , d t ), thereby h(·; θ) is now defined with a space of X × [0, 1] × R × {0, 1}.
In this work, the meta-RL agent adopts a recurrent neural network (RNN) with internal memory shared across episodes in the same trial. Importantly, the internal memory is reset when a trial finishes, i.e. before another environment is sampled. This mechanism allows test-time adaptability, even with fixed weights [16][17][18][19][20], and thereby transfers knowledge between environments [14,15,21]. This is due to the RNN making the controller a function of the history leading up to a sample such that changing history can influence the action for that sample. The full algorithm is described in Algorithm 1, with details for configuring episodic mini-batches and meta-loop trials. An overview is also presented in Fig. 1. In our implementation, proximal policy optimisation (PPO) [22] was used to train the controller. The task predictor employs the Reptile scheme [23] to allow potential data efficiency benefit for adapting to different observer labels. The predictor is updated in two steps: 1) update starting weights w t+1 of predictor f (·; w t+1 ) to w t+1,new , using gradient descent based on B t,selected ; 2) update weights using w t+1 ← w t+1 + (w t+1,new − w t+1 ) where is 1.0 initially and is linearly annealed to 0.0 as trial iterates. It is worth noting that the IQA algorithm from [12] can be considered a special case of our proposed method with only one environment.
After training using the scheme described in Algorithm 1, the adaptation stage, for both the controller and task-predictor, can be performed on a single MDP of interest M a ∼ P M , where M a is the environment which we would like to adapt to. If multiple iterations of the outer loop are required, the internal state of the controller is only reset on the first iteration. The controller weights remain fixed; adaptability is a result of updating internal state.

Experiments
In this work we use 6644 2D ultrasound images from 249 prostate cancer patients. During the early stages of ultrasound-guided biopsy procedures, images were acquired using a transperineal ultrasound probe (C41L47RP, HI-VISION Preirus, Hitachi Medical Systems Europe) as part of SmartTarget: THERAPY and SmartTarget: BIOPSY clinical trials (clinicaltrials.gov identifiers NCT02290561 and NCT02341677 respectively). Images from each subject initially consisted of 50-120 frames. For feasibility of manual labelling, frames were sampled at four-degree intervals where relative rotation angles were tracked using a digital transperineal stepper (D&K Technologies GmbH, Barum, Germany). The resulting 6644 2D ultrasound images were randomly split, at the patient level, into training, validation and holdout sets, with 4429, 1092 and 1123 images from 174, 37 and 38 subjects, respectively.
Three sets of task label {L i } 3 i=1 were collected from three trained biomedical engineering researchers. These individually-labelled are referred to as "nonexpert" label sets for brevity. In addition, the fourth set of "expert" labels L * was curated by a urologist, first carefully reviewing a reference set of consensus labels and then editing them as deemed necessary. For all label sets, each image has both a binary label indicating prostate presence for classification and a binary mask of the prostate gland for segmentation.
The task predictor algorithms used for the two tested applications are the same as [12]. For classification, AlexNet [24] was used with a cross-entropy loss and a reward based on classification accuracy. For segmentation, U-Net [25] was used with a pixel-wise cross-entropy loss and a reward based on mean binary Dice score. The controller had a three-layer convolutional encoder, before feeding the encoded features to an RNN with a stacked-LSTM architecture, as described in [15]. Experimental results are reported for empirically configured networks and default hyper-parameter values remain unchanged unless specified.
The following three different IQA models were trained and compared.
-Baseline: Trained with all training and validation data using only the highquality expert labels L * . That is, only one "expert-labelled" environment in training, establishing a reference for achievable IQA system performance. -Meta-RL: The proposed model that was first trained with training and validation data using the non-expert labels {L i } 3 i=1 as three different environments. Both the task predictor and the controller were subsequently adapted with k × 100% training and validation data using the expert labels L * .
-Meta-RL Variant: For comparison, a basic implementation of transfer learning. The model was first trained with all training and validation data using the shuffled non-expert labels {L i } 3 i=1 as one single environment, i.e. without considering different environment-specific trials, and the Reptile update for optimising the task predictor reduced to standard gradient descent. Adaptation was done with k × 100% training and validation data using the expert labels L * . The internal state of RNN was not reset before fine-tuning.
We evaluate the IQA models jointly with the task predictors using task performance, which serves as both a direct evaluation of the task-predictor and an indirect evaluation of the IQA agent by its task amenability definition. We report mean accuracy (Acc.) and mean binary Dice score (Dice) on the holdout set using expert labels for classification and segmentation, respectively. These measures are averaged over all 2D slices in the holdout set. Where controller selection is used, the metric is computed over the selected samples only. Samples are selected by rejecting the subset with the lowest controller predicted values, with the specified rejection ratios. Standard deviation (St.D) is reported to measure inter-patient variance, with which, paired t-test results with a significance level of 5% are reported when any comparison is made. We evaluate the models for varying k-values, where k is the ratio of expert-labelled samples used for adaptation (k × 100% samples used). The proposed meta-training took, on average, approximately 48 hours and the meta-testing (model fine-tuning) took 1-2 hours on a single Nvidia Quadro P5000 GPU. This result reflects the design of the proposed adaptation strategy for data efficiency and, arguably, also for computational efficiency.

Results
Performance of the IQA models, in terms of Acc. and Dice, are summarised in Table 1 and plotted in Fig. 2 against varying k values. In the prostate presence classification task, no statistical significance was found between the baseline and meta-RL for k values from 0.5 to 0.2 (p-values ranged from 0.10 to 0.23). However, meta-RL performance for low k values, k = 0.1 or 0.0, was significantly lower than that of the baseline (p < 0.01 for both). In the prostate segmentation task, no statistical significance was found between the two, for k-values from 0.5 to 0.3 (p-values ranged from 0.07 to 0.17), but a significantly lower performance was found for meta-RL for low k values from 0.2 to 0.0 (p<0.01 for all).
For the ablation study comparing meta-RL to the meta-RL variant, the proposed meta-RL framework generally outperformed the meta-RL variant for the same k values, for both tested target tasks, as detailed in Table 1. For classification, we report a statistically significant difference between the two, for the same k values from 0.0 to 0.4 (p<0.01 for all), while no significance was found when the k increased to 0.5 (p=0.06). For segmentation, superior performance from the proposed meta-RL was statistically significant for all k values (p<0.03 for all). From an ablation study, with and without the Reptile scheme for updating task predictors, the Reptile-omitted meta-RL classification and segmentation tasks achieved Acc.=0.901 ± 0.013 and Dice=0.851 ± 0.013, respectively, when k = 0. The improvement, when using the Reptile scheme, was statistically significant with p<0.01 for both, but no significant difference was found for other k values.

Discussion and Conclusion
Based on results reported in Sect. 4, for the tested ultrasound guidance application, the proposed adaptation strategy allows for the IQA agent and task predictor to be adapted using as few as 1087 and 1634 expert-labelled images from 42 and 63 subjects (training and validation sets), for classification and segmentation, respectively. Compared with a total of 5521 expert-labelled images from 211 subjects that were required to train the baseline, this is a substantial reduction, to 20-30%, in the required quantity of high-quality and often expensive expert-labelled data. The proposed model also used non-expert labels for training but these may be used for different IQA definitions, further economic analysis is beyond the scope of this work. An adaptable IQA algorithm has been presented, which can be efficiently adapted with new labelled data. The proposed algorithm may have general applicability to alleviate demand for large quantities of training data, for example, for other imaging protocols or target tasks.