2.1 Measuring Thermochromic Microcapsule Properties
We prepared 11 thermochromic microcapsules with different developers shown in Fig. 2. All microcapsules contain methyl stearate:ethyl stearate(weight ratio 4:1) as a solvent for core and 2'-anilino-6'-(dibutylamino)-3'-methyl-3H-spiro[2-benzofuran-1,9'-xanthen]-3-one (ODB-2 as a common name, CAS RN. 89331-94-2) as a dye. The shell of the microcapsules is made of melamine, urea, and formaldehyde. The detailed microcapsule preparation methods can be found elsewhere in references.[31–33] The prepared microcapsules are a concentrated slurry in which they are dispersed in an aqueous phase. The mean diameters of all prepared microcapsules are controlled in the range of 3.0 to 5.0 µm.
Each thermochromic microcapsule slurry was coated on paper having a gram per square meter (gsm) of 70 g with a thickness of 20 µm. For analyzing the colorimetric properties of specimens, the coated papers were cut into 25 mm \(\times\) 45 mm pieces and placed on sample panels. The temperature of the panel was increased from 15℃ to 50℃ for 18 minutes and decreased from 50℃ to 15℃ for 35 min. The temperatures of the most discolored and most colored states are assumed to be 50℃ and 15℃, respectively. Then, the videos of color changes caused by temperature changes were recorded by a camera.
A color space is a specific organization or model of colors. Color spaces provide a systematic way to describe the colors we see and capture with devices like cameras and scanners, and then display with screens and printers. In this context, the RGB color space of images obtained with a camera was converted to \({L}^{*}{a}^{*}{b}^{*}\) color space using OpenCV.[34] It is crucial to recognize that within the context of color perception, the Euclidean distance in color spaces does not always correlate with human visual experience. In simpler terms, the direct distance between two colors in the space might not genuinely represent the perceived difference between them. This gap in perception underscores the need for more sophisticated methods to quantify color discrepancies. The CIEDE2000[35] formula addresses this by providing an approximation more in line with how humans discern color variations, making it an optimal choice for our study.
The normalized color density is obtained by applying min-max normalization to the ΔE. The normalized color density versus temperature is parameterized using a seven-parameter (a-g) asymmetric sigmoid function. For a color change according to temperature (\(T\)), the function \(f\left(T\right)\) is formulated as:
$$f\left(T\right)=a+\frac{f-a}{{\left(1+{\left(\frac{c}{\text{e}\text{x}\text{p}\left(g\left(T-b\right)\right)}\right)}^{d}\right)}^{e}}$$
1
The discoloration start (DS) and discoloration end (DE) temperature are determined by the temperature at the point where the color is different by 3 (ΔE = 3) from the most colored state and the most discolored state in the discoloration (heating) curve, respectively. On the other hand, the coloration start (CS) and coloration end (CE) temperature were determined by the temperature at the point where the color is different by 3 (ΔE = 3) from the most discolored state and the most colored state in the coloration (cooling) curve, respectively. This is because it is widely accepted that humans begin to perceive in color at a ΔE value of 3. The definition of the four temperatures on the color density curve is described in Fig. 3.
2.2 Predicting Color-Changing Temperatures
We create four quantitative structure–property relationships (QSPR) that predict the color-changing temperatures such as DS, DE, CS, and CE, depending on the molecular structure of the color developer. In essence, QSPR models use molecular descriptors to quantitatively forecast certain properties or behaviors of the substance. These models are used to predict if the performance of a microcapsule containing a new color developer and the dye 2-phenyl amino-3-methyl-6-dibutyl amino fluoran (ODB-2) will be similar to its performance when using BPA.
After removing highly correlated descriptors, we get 856 descriptors from the PaDEL.[36] PaDEL-Descriptor, crafted by Chun Wei Yap, is a tool tailored for the calculation of molecular descriptors and fingerprints, primarily leveraging The Chemistry Development Kit. At its essence, a molecular descriptor translates the chemical specifics of a molecule into a numeric value, serving as an aid to predict its various properties or behaviors. Then, linear regression models with two descriptors are established to explain our experimental results by using the genetic function approximation method.[37] Linear regression models for predicting color-changing temperature are as follows:
$$\widehat{T}={a}_{0}+\sum _{k=1}^{2}{a}_{k}{x}_{k}$$
2
where, \(\widehat{T}\) is a predicted color-changing temperature, \({a}_{0}\) is a bias and \({a}_{k}\) and \({x}_{k}\) are coefficients and features corresponding to each other.
2.3 Preprocessing Data
To apply the data-driven methodology, SMILES[24] data of molecules were obtained from ChEMBL,[38, 39] ZINC,[40] and PubChem[41]. It is necessary to filter molecules that can show the role of a developer by selecting only molecules that satisfy several conditions. The conditions are as follows: (1) containing at least an oxygen element; (2) having an aromatic ring or more; (3) not an ionic compound; (4) not a salt; (5) having two or more hydroxyl groups bonded to aromatic rings; (6) having no hydroxyl groups attached to aliphatic carbon chains; (7) containing no carboxylic acid or aldehyde; (8) having no double bond or triple bond; (9) containing no isotopes; (10) non-bicyclic compound; (11) having logP calculated by RDKit[42] between 2.68 (logP of BPF) to 5.74 (logP of BPM).
Based on SMILES syntax, conditions (1), (2), (3), and (4) determine whether specific characters such as ‘O’, ‘c’ (small letter means aromaticity), '+', '-]' and '.' are included in the SMILES string. Here, It is important to note that ‘-]’ and ‘-‘ are different, with ‘-‘ representing a single covalent bond. When filtering data under the conditions of (1) and (2), it can be quickly checked whether it contains aromatic ring and oxygen, which are necessary conditions for color developers. This can significantly reduce the pool of searches before directly looking for the hydroxyl group, as it does not have to consider the graph of the molecule. When data are filtered with conditions (1) and (2), it can be quickly confirmed whether the color developer for leuco dye corresponds to an aromatic compound containing a hydroxyl group according to the rules of SMILES. Conditions (3) and (4) are easy criteria for selecting molecules that are not highly polar because the solvent molecule that controls the discoloration temperature has a long alkyl chain. A substance that can act as a developer empirically has hydroxyl groups with \(\text{p}{K}_{a}\) in the range of 9 to 11. Aliphatic alcohol is a too weak acid to develop dyes with \(\text{p}{K}_{a}\) of 15 or higher. Additionally, substances like carboxylic acid, which have small \(\text{p}{K}_{a}\) values, do not exhibit the discoloration. Therefore, a phenolic hydroxyl group is ideal. Molecules that survived at this range are further filtered with conditions (5), (6), and (7) and then substances that do not meet conditions (8), (9), and (10) are excluded in consideration of synthesis difficulty. Finally, the condition (11) is applied to predict the solubility.
2.4 Training Generative Models
Atom-wise tokenization. To train a VAE with SMILES data, the data must be transformed into numerical vectors. They are in the form of one-hot vectors that digitalize categorical data as 0 or 1. In the process of converting the SMILES string into a one-hot encoded vector, which is the input form of the neural network.
We use atom-wise tokenization[43, 44] to preprocess SMILES data for the sake of clarity in meaning and to reduce the length of the sequence to be trained. Unlike character-wise tokenization, which breaks down two-letter elements like chlorine (Cl) into individual characters (C and l), atom-wise tokenization keeps each element in its original form. Furthermore, the sequence of character tokens is longer, so that the training time of neural networks would increase. When a stereochemical expression is included, even if "[C@@H]" refers to a single chiral carbon atom, it is divided into six characters, such as "[", "C", "@", "@", "H", and "]". On the other hand, atom-wise tokenization, it makes just a single “[C@@H]” token, which treats all the characters enclosed in square brackets (‘[’ and ‘]’) as an atomic token. Thus, this superior atom-wise tokenization produces tokens with explicit meaning and can also reduce the length of sequences for training. In addition, according to SMILES rules, ‘[’ and ‘]’ must always appear as a pair, and when either one of the two is missing or the order is changed when generating SMILES, it becomes invalid, so this invalidity is prevented in advance by using atom-wise tokenization.
Variational autoencoder. The VAE introduced by Kingma et al. can be used as a generative model.[45] In chemistry, it is well known from the work of Gómez-Bombarelli et al. that new SMILES can be obtained by adding noise to the latent representation of an encoded compound.[25] We use this method applying the atom-wise tokenization method mentioned above.
To compare the difference depending on tokenization, we train the identical data on drug-like compounds like in reference.[25] After converting SMILES data into sequences of tokens, it is encoded as one-hot vectors. As the output of a variational layer sampling the mean and variance, we get continuous representation of compounds. Encoder produces a 180-dimensional continuous representation from variational layer sampling the mean and variance after operations of one-hot vectors by three 1D convolutional layers. Each convolution layer has 9, 9, and 10 convolution kernels and their sizes are 9, 9, and 10, respectively. Every convolution process is followed by batch normalization. The decoder is composed of three gated recurrent unit (GRU)[46] layers with hidden dimension of 450. The final layer of the decoder provides the probability distribution of all atomic tokens for the output. The decoder is trained using teacher forcing.[47] The output GRU layer contains an extra input that corresponds to the atomic tokens from the softmax output of the previous time step and the atomic tokens used in the original data.
We adjust the learning rate to 80% if the categorical cross-entropy loss of the validation set does not decrease at least every 3 epochs in the training of the neural network. In addition, an early stop is applied, so we plan to train for a total of 150 epochs, but if the decoding accuracy of the validation set does not improve within 10 epochs during training, we stop learning and obtain the final model.
Training is implemented using TensorFlow[48] 1.15.0, Keras[49] 2.0.6, NumPy[50] 1.19.2, Pandas[51] 0.19.2 version, RDKit[42] 2021.9.4 and the source code is written and executed in Python 3.6.13 environment.
2.5 Generating New Color Developers
We generate new SMILES by adding random noise to the latent vector of each color developer as follows:
$${z}^{{\prime }}=z+\left(X\times \frac{Z}{{‖Z‖}_{2}}\right)$$
3
where, z is a latent vector, \(\text{X}\) is a uniform distribution, \(\text{X}\sim\text{u}\text{n}\text{i}\text{f}\text{o}\text{r}\text{m}(0, \text{n}\text{o}\text{i}\text{s}\text{e})\), \(Z\) is a random normal distribution, \(Z∼N(0, 1)\), and \({‖Z‖}_{2}\) is a L2-norm of \(Z\). When \({z}^{{\prime }}\) is fed into the decoder network, the one-hot vector of the new SMILES is decoded. After removing the duplicates from data in training set, we get new SMILES that we have never seen before.