Extended Data Fig. 3: Stats of the pain expression model.

(A) Coefficients of the pain expression (PE) model. Features are represented by max, min or tmax followed by name of action unit. Higher coefficients contribute to higher pain. (B) PE model out of sample permutation test. To test if our PE model was actually capturing meaningful signal, we evaluated the performance of our model compared to a distribution of models generated from within-subject shuffled pain ratings. We repeated this procedure 5,000 times, and found our original pain model test-set accuracy in a leave-one-subject-out cross-validation of r = .41, calculated as the average across within-subject correlations between the actual z-scored and predicted pain ratings, was at the 99.92 percentile rank (p = .003, two-tailed) suggesting that the pain model was significantly performing better than chance. (C) Permutation test for the prediction of patients’ pain ratings. We repeated a similar shuffling procedure 5,000 times in which we shuffle the pain ratings from the training set from the doctor conditioning phase then testing the model on the patients’ faces during the interaction phase to predict their pain ratings. The accuracy was determined as the average across within-subject correlations between the actual z-scored and predicted pain ratings. The PE model prediction test-set accuracy of r = .24 was at the 99.84 percentile rank (p = .003, two-tailed) suggesting that using the PE model to predict patients’ pain ratings was significantly performing better than chance.