Open Access Article
Susana Marín-Aguilar
*a and
Emanuela Zaccarelli
ab
aDepartment of Physics, Sapienza University of Rome, Piazzale Aldo Moro 2, 00185 Roma, Italy. E-mail: susana.marinaguilar@uniroma1.it; emanuela.zaccarelli@cnr.it
bCNR Institute of Complex Systems, Uos Sapienza, Piazzale Aldo Moro 2, Roma, 00185, Italy
First published on 21st October 2025
Microgels made of poly(N-isopropylacrylamide) are the prototype of soft, thermoresponsive particles widely used to study fundamental problems in condensed matter physics. However, their internal structure is far from homogeneous, and existing mean-field approaches, such as Flory–Rehner theory, provide only qualitative descriptions of their thermoresponsive behavior. Here, we combine machine learning and numerical simulations to accurately predict the concentration and spatial distribution of crosslinkers, the latter hitherto unknown experimentally, as well as the full swelling behavior of microgels, using only polymer density profiles. Our approach provides unprecedented insight into the structural and thermodynamic properties of any standard microgel.
In this article, we take advantage of a recently put forward monomer-resolved microgel model, which has been shown to accurately describe the internal structure of the experimental systems, both in bulk suspensions10 and at liquid–liquid interfaces,11 to fill this gap. To this aim, we perform extensive computer simulations of individual microgels with different crosslinker concentrations to create a comprehensive numerical database of microgel structures at many different temperatures across the VPT. Using a subset of these structures as the training set, we apply machine learning (ML) techniques to predict crosslinker properties. Building on the concept that density profiles can encode thermal observables12,13 and all relevant structural information, we demonstrate that the total polymer density profiles of microgels in the swollen state are enough to accurately predict the crosslinker concentration, c, via unsupervised ML. This approach is subsequently validated against simulations of microgels with different sizes and c outside the training set, as well as for available experimental data. Following a similar approach, we then train a supervised neural network (NN) to predict the distribution of the crosslinkers, which is found to follow the fuzzy sphere model,14,15 in analogy to the overall microgel. Our approach thus enables, for the first time, the prediction of the crosslinker distribution in experimental systems. Finally, we use our database to build a phenomenological framework to predict the complete swelling behavior of the microgels for a given c, similar in spirit to the Flory–Rehner theory. Therefore, from the sole knowledge of the microgel total density profile at low temperature, which can be extracted from the fit of the form factor, routinely measured nowadays by small-angle scattering techniques14 or directly obtained by super-resolution microscopy,15 our ML approach is able to reliably predict the concentration of crosslinkers and their radial distribution, as well as the full swelling behavior of any standard pNIPAM microgel.
We simulate the assembled polymer networks with different crosslinker molar fractions c ∈ [0.5, 1.25, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 10.0, 12.5, 15.0], covering the full range of experimentally synthesized pNIPAM microgels. The total number of particles in the microgel is set to either N ∼ 42
000 or N ∼ 336
000. The number of crosslinkers is given by Nc = cN/100, with the rest being monomers. All particles interact with the Weeks–Chandler–Andersen (WCA) potential,
![]() | (1) |
![]() | (2) |
![]() | (3) |
We perform NVT MD simulations of individual microgels using the LAMMPS package21 with a time step of δt = 0.002τ, where
corresponds to the time unit. The temperature is fixed to kBT/ε = 1.0, where kB is the Boltzmann constant, while we vary the solvophobic parameter α to mimic the effect of the real temperature, as described above. The center of mass of the microgel is fixed to the center of the simulation box. We equilibrate the system for at least 3 × 106 timesteps, followed by a production simulation of 1 × 107 timesteps. To account for the role of disorder in the assembled polymer networks, the results are averaged over at least three independent topologies.
![]() | (4) |
〉 represents a time average over the window of time Δt. In order to generate a large pool of density profiles, we generate such profiles every 1 × 104 timesteps, averaging every Δt = 1 × 105 timesteps inside the previous time window. This choice ensures that each sampled configuration represents an independent snapshot of the system's structure. In addition, we calculate the radial density profiles of the crosslinker monomers only, ρc(r), by substituting N in eqn (4) with Nc.
We fit ρ(r) using the well-established fuzzy sphere model,14 which combines the profile of a solid sphere of radius Rc with a Gaussian function representing the corona of the particle.14 In an approximated version22 that holds for standard core–corona microgels, this reduces to
![]() | (5) |
We also compute the hydrodynamic radius, RH, of the microgel, following the method established in ref. 4. First, we construct the convex-hull that encloses all of the microgel monomers. This convex hull is tessellated into triangular facets by construction, and their vertex coordinates are used to build the gyration tensor. The RH is finally computed as
![]() | (6) |
. This definition approximates the microgel to an effective ellipsoid with the same gyration tensor, providing a meaningful measure of its overall size in solution. Further details and validations of this approximation can be found in ref. 4 and 23. The swelling behavior is characterized by the α-dependent swelling ratio Sα, defined as| Sα = RH(α)/RH(α* = 0.86), | (7) |
As input, we use a collection of discretized radial density profiles from MD simulations of microgels with different c values, represented by a set of vectors
where P(i) = ρi denotes the discretized density profile of sample i and d denotes the dimensionality of the vector. The choice of d allows us to control the resolution of the density profile. Here, we choose d = 115. In addition, the entries Pj(i) of the input vector correspond to the value of the density profile evaluated at rj, and thus, we ensure that for all considered data sets, regardless of the crosslinker concentration, the entry j always corresponds to the same distance rj. In order to guarantee this condition and to be able to compare microgels of different sizes, we preprocess the data obtained from the radial density profiles as follows. First, we use a scaled radial coordinate r* that preserves the characteristic decay of each state point. This is done using the value of the integral of the density profile, which in simulations corresponds to the total number of particles in the microgel
and by rescaling r* = r/N1/3. The latter normalizes the integral of ρ(r*) to one. Second, to ensure that entry j corresponds to the same r* across the dataset, we interpolate ρ(r*) using splines and construct P(i) by evaluating the splines in intervals of r* = 0.025 starting from r* = 0.125. In the output layer, the density profiles, represented by a vector
are recovered.
Inside the encoder, we perform a nonlinear projection onto a low-dimensional space
, where d′ < d. We choose d′ in such a way that more than 99% of the variance of the input data set is recovered, in this case, corresponding to d′ = 1, as shown later. We use a hyperbolic tangent activation function,28 varying the number of neurons in the hidden layer from 32 up to 160 and adjusting the batch size to optimize the parameters that better minimize the error function. In particular, we fix the number of neurons in the hidden layer to 80, as we do not find relevant changes in the results obtained with different architectures.
To train the AE, we minimize a loss function using the mini-batch stochastic gradient descent with momentum.29–31 In particular, we use the mean squared error function with the addition of a weight decay regularization term29 defined as
![]() | (8) |
![]() | (9) |
with d = 115 from the AE are used as input to the NN. In this case, the feature to learn corresponds to the crosslinker distribution ρc represented by the vector P′. As for the AE, the radial coordinate is normalized with the total number of particles 1/N1/3. Due to the small values of ρc, the y-axis is also normalized by the corresponding value of c. The number of neurons in the hidden layer is varied from 32 to 736. We minimize the error function defined in eqn (8) between the predicted crosslinker density profiles P′ and the original ones from the training set, using mini-batch stochastic gradient descent with momentum29–31 and a learning rate of 0.1. The NN is trained until the number of epochs reaches 5 × 106 or the MSE difference between the last 500 epochs is less than 1 × 10−7. We finally fix the number of neurons to 96 reaching a RMSE of 1.3 × 10−6.
000 or N ∼ 336
000 beads, with the molar crosslinker concentration c ranging from c = 0.5% to c = 15%. This parameter plays a key role in determining the microgel topology, resulting in significant structural and elastic differences.2,17 We start by reporting the dependence of the microgel structure on the crosslinker concentration in the swollen state, i.e. α = 0.0. Fig. 1(a) shows the radial density profiles ρ(r) of the microgels with N ∼ 336
000 beads. The change in c has a direct effect on the shape of the microgel, as reflected in the profiles, which become progressively sharper with increasing c. In particular, the behavior of ρ(r) displays an almost constant regime, representing the core, followed by a decay at large r in the corona region. The latter becomes progressively more extended and less distinct from the core with decreasing c. Microgels with N ∼ 42
000 beads exhibit similar behavior, as shown in the SI (Fig. S1). Typical snapshots of the microgels are shown in Fig. 1(b), changing from a rather compact structure for c = 10% to a much more heterogeneous one for c = 0.5%, denoting the presence of so-called dangling ends in the exterior of the microgel. All density profiles are well-described by the fuzzy sphere model,14 as shown in Fig. 1(a), with the corresponding fit parameters reported in Table S1 of the SI.
In Fig. 1(c), we show the corresponding crosslinker radial density profiles, ρc, of the microgels with N ∼ 336
000 beads. Similar to the total density profiles, the crosslinkers alone exhibit a similar profile. In the core region, they are roughly constant, although with larger statistical noise due to the small amount of crosslinkers. However, they decay to zero at much shorter distances in r with respect to ρ(r), signaling the accumulation of the crosslinkers within the core. In addition, this decay distance does not strongly depend on c in contrast to what is observed for ρ(r). It is worth noting that crosslinker profiles are also found to be quite well-described by the fuzzy sphere model. This description smoothens out local fluctuations, particularly at small r, where structural inhomogeneities are more pronounced. In this sense, the fuzzy-sphere model provides a useful representation that captures the overall shape of the distribution, while averaging out microscopic details. The corresponding fuzzy-sphere fits are also shown in Fig. 1(c), with continuous lines with the fit parameters reported in Table S1 of the SI.
Finally, variations in c also affect the microgel size. For instance, the hydrodynamic radius RH displays a power-law dependence RH ∼ c−0.21±0.01, in good agreement with the predictions of the Flory–Rehner theory for polymer networks.8,32 This behavior, also shared by the calculated gyration radius, was also previously reported in experimental works.17,33 This is shown in Fig. 1(d), where the results from simulations of microgels with both N ∼ 42
000 and N ∼ 336
000 beads as a function of c are shown. Instead, at the local scale, for individual polymer chains belonging to the network, the average end-to-end distance varies as Ree ∼c−0.54±0.01, as shown in Fig. 1(e). This behavior is relatively close to the Flory scaling for polymer chains in good solvent,17 with a minor deviation likely attributed to the effect of the crosslinkers. Both scaling behaviors and related exponents are essentially independent of the microgel size, as expected.
To train the AE, we employ discretized density profiles obtained from simulations of microgels with varying c values. The input of the AE is a vector P of dimension d = 115, where each entry corresponds to the density profile value at a given radial distance. To make the method scalable and transferable to microgels of different sizes, we preprocess the input data by rescaling the radial coordinate as described in the Model and methods section. This allows the method to be applied to any microgel, whose density profile is known, including experimental ones. Furthermore, to provide sufficient data and variability to the AE, we employ averaged radial density profiles in small windows of time. We use c = 1.25, 2.5, 5.0, and 12.5% as a training set, while the simulations for additional c values are later used as test data sets. The encoder consists of 80 neurons, followed by the bottleneck that projects the data onto a d′-dimensional space.
We first determine the minimum number of dimensions to be used in the bottleneck d′. To this aim, we train the AE for at least 3 × 103 epochs, with varying d′ and then we compute the final mean squared error (MSE) and the fraction of variance explained (FVE) as defined in the Methods section. The resulting FVE is reported in Fig. 2(a) as a function of d′, showing that, even for d′ = 1, the AE is already able to capture more than 99% of the variance of the input data by projecting it onto a single number. At higher dimensions, d′ ≥ 2, this improves, reaching a plateau of FVE ≈ 0.993. However, since the crosslinker concentration c is a scalar quantity, we choose to work with a bottleneck dimension of d′ = 1 for its prediction. This choice simplifies the model and already yields very accurate results.
![]() | ||
Fig. 2 Crosslinker concentration prediction. (a) Fraction of variance explained (FVE) for the autoencoder with varying dimensions d′ of the latent space L. The horizontal line indicates FVE = 99%; (b) probability distributions of L for microgels with N ∼ 336 000 beads with different c values for the training data; (c) as a function of c for all simulated microgels, including training (circles) and test (triangles) data sets and experiments from ref. 17, corresponding to microgels with c = 1.25, 2.5, and 5.0% (stars). The dashed line is a power-law fit. Inset: P(L) for two different microgel sizes with c = 10.0%. | ||
After training the entire AE, we discard the decoder and use the encoder to project the data into the latent space. We report in Fig. 2(b) the probability distributions P(L) of the latent space values L for different c values of the training data set with microgels consisting of N ∼ 336
000 beads. These results confirm that d′ = 1 is already able to distinguish between microgels with different c values, since the distributions in the latent space are well separated, each following a normal distribution with a maximum standard deviation of 0.01. We also observe that the mean values of the distributions,
, shown in Fig. 2(c), as a function of c, are unevenly distributed in the latent space, following a power law relation with c, given by
(c) ∼ A0cν, where A0 ∼ 0.514 and ν ∼ 0.59 are fit parameters. The latter is remarkably close to the Flory exponent for polymer chains in good solvent. A similar value of ν is recovered when varying the number of neurons in the AE hidden layer. Although
does not correspond to any physical observable, this scaling behavior suggests that the encoder does not simply differentiate the samples, but rather captures the key structural changes associated with variations in c, consistent with theoretical expectations for polymer networks.
Overall, these results demonstrate that the AE effectively captures the underlying physics of the system, with information taken solely from the density profile. Finally, the crosslinker concentration c can be easily predicted for any microgel by inverting
(c) ∼ A0cν and using the projection on the latent space of a given density profile.
We report in Fig. 2(c) the latent values as a function of the predicted c of all simulated microgels, including the ones outside the training. The AE predictions show remarkable agreement with the expected c-values of training and test data sets, with a confidence value ranging from ±1% to ±10%. We further validate the method by applying it to microgels of different sizes. Apart from a small shift, the latent space values for the two microgel sizes are found to be very similar, as shown in the inset of Fig. 2(c). In addition, the AE can also be directly applied to experimental data to estimate c. We show in Fig. 2(c) the predicted c values for the experimental data from ref. 17. Despite using a single density profile obtained from the fit of the form factor fuzzy sphere,17 the predictions fall within an error margin of ±0.3. Finally, when applying the AE trained with α = 0 to larger values of α (see the SI, Fig. S4), the latent-space values follow trends similar to those of the swelling behavior, discussed in following sections. All these results further demonstrate the robustness and transferability of the approach.
The parity plot between the ground truth and the predicted ρc(r) is shown in Fig. 3(a), where we observe remarkably good predictions for the training and also test data sets. This is confirmed by directly comparing the ML-predicted ρc(r) for a c = 7.0% microgel outside the training set with the one obtained from the simulations in Fig. 3(b).
![]() | ||
| Fig. 3 Crosslinker distribution prediction: (a) parity plot of target and predicted ρc(r) values for the training set corresponding to c = 1.25, 2.5, 5.0, and 10.0% (circles) and the test set (triangles); (b) predicted ρc(r) values outside the training set for simulations with c = 7.0% (circles) and experimental data with c = 5.0% (triangles) from ref. 17; lines are fuzzy sphere fits. | ||
We further test our method by applying it to the c = 5.0% experimental data taken from ref. 17, whose ML-predicted ρc(r) is also reported in Fig. 3(b). In both cases, the predicted profiles are in excellent agreement with those obtained by simulations, confirming the predictive capability of our approach.
000 beads. We then fit the dependence of S on c with a generalized power law as
![]() | (10) |
| F(α) ∼ AX0 + AX1ζ((α + AX2)/AX3), | (11) |
![]() | ||
| Fig. 4 Swelling behavior: (a) swelling ratio S as a function of crosslinker molar concentration c for various α values, ranging from α = 0, the swollen state, to α = 0.724. Dashed lines are power-law fits with eqn (10), determining h(α) and f(α), reported in (b) and (c) as a function of α. (d) S as a function for α for various values of c from simulations (circles), experimental data from ref. 17 (triangles) and predictions from eqn (10) and (11) (dashed lines). | ||
Once we know the dependence of h and f on temperature and c, we can finally reconstruct the full swelling behavior of any standard pNIPAM microgel. To test this hypothesis, we show the predictions of eqn (10) and (11) in Fig. 4(d) for different c values in comparison to simulation results and to the experimental data of ref. 17. In particular, to enable a proper comparison, the relationship between temperature and α reported in ref. 10 and 17 is used, as shown in Section S4 of the SI. Overall, we find very good agreement at all temperatures, with minor deviations close to the VPT, where experimental error bars are largest. Interestingly, once S(α) is known, for example, from dynamic light scattering (DLS) measurements, it can be used backwards to estimate c using eqn (10) and then obtain an approximate density profile, if not available experimentally, by using our database, following the mapping described in the SI (Section S6).
While the monomer density profile of a microgel can be directly or indirectly obtained from experiments, crosslinker profiles remain experimentally challenging. Techniques such as contrast-variation SANS with deuterated monomers34,35 could, in principle, allow their determination. However, to our knowledge, such measurements have not yet been reported, and careful experimental design is required to be able to detect the weak crosslinker signal arising from their low concentration. Alternative super-resolution microscopy measurements, where crosslinkers are attached to fluorophores, could be employed, though they would present comparable experimental challenges. The present study exploits neural networks to predict them for the first time also for experimental systems. While we have validated the approach against the corresponding numerical profiles, it remains a challenge to detect them also experimentally to verify whether they also satisfy a fuzzy sphere decay, as shown in the present simulations.
Our work further highlights the power of machine learning techniques, trained on carefully selected data obtained from simulations, to uncover hidden relations. Specifically, by using autoencoders (AEs), we extract the information regarding the crosslinker concentration encoded in the density profiles. The associated latent space is found to follow a power-law dependence on c with an exponent of ∼0.59, remarkably close to the Flory prediction for polymers in a good solvent, thereby demonstrating the ability of the AE to correctly recover the underlying physics of the system. Since the overall structure of the microgels was shown to be conserved across different length scales,10 the proposed methodology is robust against size variations. This structural invariance, combined with the use of radially normalized profiles, ensures that the predicted features remain robust and transferable, allowing the method to be applied to experimental microgels of different sizes, including smaller ones with a size of ≲100 nm.
In addition, our approach can be readily extended to different microgels, either of different topologies, e.g., hollow ones,36 or obtained through a different synthetic protocol, amounting to networks with a different internal structure. We will pursue such generalization of the method in the future.
Finally, we can also foresee to use the method to calculate other microgel properties, such as elasticity or charge distribution, providing sufficient training data. Similarly, it could be applied to assess microgel deformation at interfaces as a function of crosslinker concentration.11
Overall, our results show that machine learning models trained on monomer-resolved simulations can successfully predict key structural features of microgels across a wide range of synthesis conditions. The quality of the approach will be established by its employment against different sets of experimental systems, in order to establish the accuracy of the predictions. We hope that experimental groups will take advantage of our model and assess its predictive capability. In parallel, future work will be devoted to leveraging similar ML approaches for the inverse design of microgel architectures with tailored swelling ratios and density profiles, optimized for specific applications.
Supplementary information is available. See DOI: https://doi.org/10.1039/d5sm00852b.
| This journal is © The Royal Society of Chemistry 2025 |