# Understanding Polymers Through Transfer Learning and Explainable AI
## 3 Results and Discussion  
### Direct Modelling of the System  
The models trained directly on the polyacrylates dataset (Direct) demonstrated excellent performance, even when tested with a substantial portion of the dataset (up to 50%) allocated as external test set. Given the relatively small total size of the dataset and the complexity of the features being learned, this result is particularly impressive.  
Figure 3 illustrates the \"predicted vs. experimental\" glass transition temperature plots for the best-performing model (a summary of all models' results is presented in Figures S1 and S2) at two different data split scenarios. The neural network effectively captures the relationship between the chemical structure and Tg across the studied temperature range, even when trained with only 50% of the data (only 67 samples left for training when accounting for a 30% validation set). Particularly noteworthy is the mean relative deviation in this external test set, which remains well below 10% (7.1%), closely aligning with the training and validation sets' performance (6.3% and 7.5%, respectively).  
Beyond these relatively low error metrics, our analysis has two main objectives: first, to identify the substructures most relevant to the network during training and prediction; second, to explore the limitations of transfer learning when utilizing a model that was pre-trained on single molecules. This requires a closer examination of outliers and chemical structures that are not well generalized by the direct model (whether due to underlying physical processes, such as nanophase separations, variations in sample preparation protocols, or simply underrepresented chemical features). To address this, we analysed the correlation of the observed deviations with basic chemical descriptors such as the number of atoms, hydrogen bond acceptors, and hydrogen bond donors in the monomer structure. This analysis provides insights into the model's precision under specific chemical conditions, and offer a qualitative, rather than quantitative, perspective on the model's limitations. Figure 4 illustrates the observed absolute (_Pred - Real_) differences in Tg as functions of these parameters for all samples from the 50% test case (we focus in it for greater statistical significance). In Figure 4a, the effect of the number of atoms is shown, while Figure 4b focuses on the number of H acceptors. The red lines represent the best linear fits, with the red shaded areas indicating the confidence intervals for these fits, and the black dashed lines marking the zero difference. The deviations appear to be evenly distributed across samples with different numbers of atoms, suggesting that the direct model's performance is not significantly affected by the monomer's raw length. However, slight deviations can be observed for monomers with less or more than four H acceptors, reflecting the model's difficulties at the time of learning intermolecular forces (dipolar or H bonds) from such a limited set of training samples.  
Figure 3: Predicted vs. experimental Tg plots for best performing direct model at each data scarcity scenario. (30%) train on 93 samples, validate on 41 samples and test on 58 samples, and (50%) train on 67 samples, validate on 29 samples and test on 93 samples. Dashed lines are just an arbitrary guide that indicate the 25 and 50K difference regions (grey and red, respectively). The black arrows indicate these samples where the model large deviations.  
The analysis of samples with no H donors is particularly interesting, as these cannot form hydrogen bonds and therefore exhibit weaker (only dipolar or Van der Waals are possible) intermolecular forces. As shown in Figure 4c, the observed deviations are approximately normally distributed around zero (\(\mu=-1.5\) K and \(\sigma=30.5\) K). These findings will be further discussed in the context of the transfer learning-based model.