SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Table C.2: Model finetuned with the new subtypes of Neutrophil cells.
AUC score	Accuracy	Precision	Recall
81.90	71.88	67.95	82.81
D Pseudocodes
Algorithm 1 Training the reward model
1: function REWARD_FUNCTION (Training from pathologist feedback)
2:  $img_{embedding} = NN.\text{encode}_i\text{message(preprocess}(Image))$
3: class  $_{embedding} = NN.\text{encode}_abel( \text{label} )$
4: return predfeedback(imge镶嵌, class embedding)
5: end function
6: for (Image, label, feedback) in Dataloger do
7: scores = Reward_function(Image, label)
8: loss = MSELoss(scores, feedback) optimizer.zero_grad()
loss.backup() optimizer step()
Algorithm 2 Pretraining the conditional diffusion model for generating synthetic images
$D$ , a dataset of real images  $N$ , the number of training iterations  $B$ , the batch size  $\alpha$ , learning rate A trained conditional diffusion model Initialize the conditional diffusion model  $M$ $i = 1$  to  $N$  Sample a mini-batch of images  $X \subset D$  with size  $B$  Compute the noise schedule  $\sigma(t)$  for the diffusion process Initialize the set of generated images  $Y$  with denoised images from  $X$ $t = T$  downto 1 Compute the conditional diffusion probabilities  $p(y_t | y_{t+1})$  for  $Y$  using model  $M$  Update  $Y$  by sampling  $y_t$  from  $p(y_t | y_{t+1})$  Compute the reconstruction loss  $L$  between the generated images  $Y$  and the real images  $X$  Update the model parameters  $\theta$  using gradient descent:  $\theta \gets \theta - \alpha \nabla_\theta L$
Algorithm 3 Finetuning the conditional diffusion model using pathologist feedback
$D_{r}$ , a dataset of real images  $D_{a}$ , a dataset of artificial images generated from diffusion models trained on the real images  $N$ , the number of training iterations  $B$ , the batch size  $\alpha$ , learning rate  $\gamma$ , penalty parameter Model_Reward, Reward Model trained with clinician feedback. Fine tuning Conditional Diffusion Model Load the trained conditional diffusion model  $M$ $i = 1$  to  $N$  Sample a mini-batch of images  $X \subset D$  with size  $B$  Compute the noise schedule  $\sigma (t)$  for the diffusion process Initialize the set of generated images  $Y$  with denoised images from  $X$ $t = T$  downto 1 Compute the conditional diffusion probabilities  $p(y_{t}|y_{t + 1},c)$  for  $Y$  and classC using model  $M$  Update  $Y$  by sampling  $y_{t}$  from  $p(y_{t}|y_{t + 1})$  Compute the reconstruction loss  $L$  between the generated images  $Y$  and the original images  $X$ $X \in D_rloss = loss*\gamma X \in D_a$  loss  $= loss*Model\_reward(X)$  RASIEERROR Update the model parameters  $\theta$  using gradient descent:  $\theta \gets \theta -\alpha \nabla_{\theta}L$
Algorithm 4 Incorporating new clinical concepts into the model
$D_{pre}$ , a collection of artificial images, a mixture of sub types
1: function NEW_CONCEPT_FUNCTION (Training from clinician feedback)
2:  $img_{embedding} = NN.\text{encode}_i\text{mage(preprocess(Image))}$
3: class  $_{embedding} = NN.\text{encode}_l$ $\text{abel}(\text{label})$
4: return pred摘要back(imgeEmbedding, class embedding)
5: end function
6: for (Image, label, feedback) in Dataloger do
7: scores = Reward_function(Image, label)
8: loss = MSELoss(scores, feedback) optimizer.zero_grad()
E Illustration of Synthetic Samples
In this Section, we present illustrative samples of synthetic bone marrow image patches generated by our model.
Figure E.1. Representative samples from the conditional diffusion model before (left) and after (right) incorporating pathologist feedback.
Figure E.2. Representative samples from the conditional diffusion model.
Figure E.3. Representative samples from the finetuned model with  $10\%$  of the pathologist feedback points.
Figure E.4. Representative samples from the finetuned model with  $50\%$  of the pathologist feedback points.
Figure E.5. Representative samples from the finetuned model with  $100\%$  of the pathologist feedback points.
Figure E.1: Representative samples from the conditional diffusion model before (left) and after (right) incorporating pathologist feedback.
Figure E.2: Representative samples from the conditional diffusion model.
Figure E.3: Representative samples from the finetuned model with  $10\%$  of the pathologist feedback points.
Figure E.4: Representative samples from the finetuned model with  $50\%$  of the pathologist feedback points.
Figure E.5: Representative samples from the finetuned model with  $100\%$  of the pathologist feedback points.