Estimating physical properties from liquid crystal textures via machine learning and complexity-entropy methods
H. Y. D. Sigaki, R. F. de Souza, R. T. de Souza, R. S. Zola, H. V. Ribeiro
EEstimating physical properties from liquid crystal textures via machine learning andcomplexity-entropy methods
H. Y. D. Sigaki, R. F. de Souza, R. T. de Souza,
1, 2
R. S. Zola,
1, 2, ∗ and H. V. Ribeiro † Departamento de F´ısica, Universidade Estadual de Maring´a, Maring´a, PR 87020-900, Brazil Departamento de F´ısica, Universidade Tecnol´ogica Federal do Paran´a, Apucarana, PR 86812-460, Brazil
Imaging techniques are essential tools for inquiring a number of properties from different mate-rials. Liquid crystals are often investigated via optical and image processing methods. In spite ofthat, considerably less attention has been paid to the problem of extracting physical properties ofliquid crystals directly from textures images of these materials. Here we present an approach thatcombines two physics-inspired image quantifiers (permutation entropy and statistical complexity)with machine learning techniques for extracting physical properties of nematic and cholesteric liq-uid crystals directly from their textures images. We demonstrate the usefulness and accuracy ofour approach in a series of applications involving simulated and experimental textures, in whichphysical properties of these materials (namely: average order parameter, sample temperature, andcholesteric pitch length) are predicted with significant precision. Finally, we believe our approachcan be useful in more complex liquid crystal experiments as well as for probing physical propertiesof other materials that are investigated via imaging techniques.
PACS numbers: 61.30.Cz, 61.30.Eb, 07.05.Pj, 89.70.Cf
I. INTRODUCTION
Optical imaging techniques are important tools exten-sively used for probing a number of materials proper-ties [1]. These imaging techniques are non-destructiveand particularly convenient for dealing with biologicaland other complex materials [2]. Liquid crystals areamong these materials widely studied via optical andimage processing methods [3]. This occurs because liq-uid crystals are birefringent materials, and as such, sim-ple polarized optical microscope imaging already accesssome of their important properties, including birefrin-gence and sample thickness [4]. Moreover, this techniqueestimates the local ordering properties (for instance, thedirector distribution) across a sample when coupled withvariable retarders and different algorithms for fast andsensitive measurements [5]. This approach is known asLC-PolScope [6] and has been used for fine imaging of de-fect cores in lyotropic liquid crystals [7] and can describethe orientational order of active nematics [8].Despite the extensive use of optical imaging approachesin the study of liquid crystals [9–12], much less attentionhas been paid to the problem of extracting physical pa-rameters directly from images of these materials. This isan important issue since several physical parameters ofliquid crystals are only obtained by adjusting theoreticalmodels to cumbersome and time demanding experimen-tal results. Examples include the microscopic order pa-rameter, from which several other parameters character-izing the nematic phase are dependent [3], and the pitchlength of cholesteric liquid crystals. The latter is easilyobtained under an optical microscope when the helical ∗ [email protected] † hvr@dfi.uem.br axis lies perpendicular to the viewing direction [13], butcannot be estimated from the most commonly used ex-perimental arrangements, where the helix orients parallelto the viewing direction (often called Grandjean texture,used in reflective displays) [14].In this context, image-based characterization of liquidcrystals can benefit hugely from state-of-the-art machinelearning techniques [15]. These approaches have beenavailable since the 1990s, but it was only during the lastdecade that such methods gained impressive popularityin several areas of science where unveiling meaningfulpatterns in data is fundamental. Naturally, physics isnot an exception, and indeed there are several recentworks employing machine learning algorithms for study-ing many physical systems [16–24]. Here we present anapproach that is capable of extracting physical proper-ties of nematic and cholesteric liquid crystals directlyfrom their textures images. Our approach is based onthe evaluation of two complexity measures related to thearrangement of pixels in the textures, combined with sim-ple machine learning algorithms employed for classifica-tion and regression tasks. We demonstrate the poten-tial of this approach in a series of applications based onnumerically-generated and experimental textures, fromwhich physical parameters of liquid crystals are predictedwith high accuracy.In what follows, we present our results on simulatedand experimental nematic liquid crystals, where we showthat our approach predicts the average order parame-ter from simulated textures with an accuracy of ≈ ≈ ≈ a r X i v : . [ phy s i c s . d a t a - a n ] J a n II. RESULTS
In all studies presented here, we have calculated twosimple complexity measures directly obtained from liquidcrystal textures: the permutation entropy H and the sta-tistical complexity C [25–28]. As detailed in Appendix A,these two quantities are estimated from an ordinal prob-ability distribution P = { p , p , . . . , p n } , whose compo-nents represent the probability of finding a given two-dimensional local ordering pattern of size d x × d y (theembedding dimensions) over the pixels of a texture. Theentropy H quantifies the degree of disorder regarding theoccurrence of these local patterns. A texture character-ized by H ≈ H ≈
0, these pixels appear practically at thesame order along the texture. The complexity C quan-tifies the degree of “structuredness” in the arrangementof pixels in a texture. A value of C ≈ C > H and C from a setof textures in which the physical property in questionis known, and next the trained algorithm is exposed tovalues of H and C from another set of textures in orderto predict the physical property. The nearest neighborsalgorithm is one of the simplest machine learning algo-rithms for classification and regression tasks [15], but italready provides excellent accuracy in our results. De-tails of the implementation of this algorithm are given inAppendix E. A. Monte Carlo simulated textures
We start by analyzing nematic textures generated byMonte Carlo simulations of the model described in Ap-pendix B. Examples of these textures are shown in Fig-ure 1 for different reduced temperatures T r . This systemundergoes a nematic to isotropic phase transition when T r exceeds the critical temperature T c = 1 . p thatdepends on the temperature T r (see Eq. B3 for details),and our goal is to predict the value of p directly fromthese images by using the values of H and C . We notethat the textures exhibit visually distinct patterns be-tween the nematic and isotropic phases; in particular,for T r > T c we observe the emergence of isotropic do-mains that predominate in the texture as the tempera-ture increases beyond T c . While nematic and isotropictextures are easily distinguished from each other, even awell-trained eye of an experimental physicist will be introuble for distinguishing among nematic textures withdifferent temperatures (for instance, between T r = 0 . T r = 0 .
6) as well as among isotropic textures at dif-ferent temperatures. T r = 0.100 T r = 0.200 T r = 0.300 T r = 0.400 T r = 0.500 T r = 0.600 T r = 0.700 T r = 0.800 T r = 0.900 T r = 1.000 T r = 1.085 T r = 1.110 T r = 1.135 T r = 1.160 T r = 1.260 T r = 1.360 Figure 1. Examples of a nematic liquid crystal texture at dif-ferent temperatures and phases. These textures are generatedby using the Monte Carlo method described in Appendix B.Each texture corresponds to a different reduced temperature T r (as indicated within the plots) and this system presents anematic to isotropic phase transition at the critical tempera-ture T c = 1 . T r < T c )from different reduced temperatures are very similar to eachother as well as the ones from the isotropic phase ( T r > T c ). Despite the visual similarity among the textures, weshow that the values of H and C are capable of dis-tinguishing among these images as well as identifyingthe nematic-isotropic transition. To do so, we createa dataset composed of several realizations of simulatednematic textures for different temperatures T r , and eval-uate the values of H and C for each one. Figures 2A and2B show the dependence of the average values of H and C on the reduced temperature T r . We observe that H has a trend to increase with the temperature but showsa sharp minimum at T r = T c . Similarly, the values of C tend to decrease with the temperature and present asharp maximum at T r = T c . Figure 2C depicts the de-pendence of the order parameter p on the reduced tem-perature T r , where the critical temperature T c = 1 . p with respect to T r .The well-defined dependence of the average values of H and C on the temperature T r , combined with the factthat the order parameter p is also a function of T r , in-dicates that we can predict the values of p directly fromthe images. It is worth noting that the values of H and C are not uniquely defined for a given temperature, display-ing some random fluctuations associated with the processthat generates these textures. Thus, to test the predictive Reduced temperature, T r O r de r pa r a m e t e r , p T r = T c Reduced temperature, T r E n t r op y , H (a) T r = T c (c) Reduced temperature, T r C o m p l e x i t y , C (b) T r = T c Figure 2. Dependence of the image quantifiers and the orderparameter on the temperature. (a) Values of the permutationentropy H and (b) the statistical complexity C as a functionof the reduced temperature T r . The solid curves representaverage values over 50 realizations, and the shaded areas arethe 95% bootstrap confidence intervals. (c) Dependence ofthe order parameter p versus the reduced temperature T r . Inall panels, the dashed line indicates the critical temperature( T c = 1 . power of these image quantifiers in a more practical sit-uation, we have trained a k -nearest neighbors algorithmfor the regression task of predicting the order parameter p based on the values of H and C and a dummy variablethat is zero for T c − . T c ≤ T r ≤ T c , 1 for T r > T c , and-1 for T r < T c − . T c . This dummy variable is neces-sary due to the non-biunivocal relations between the im-age quantifiers and the temperature. However, the valueof T c can be directly estimated from the image quanti-fiers. As detailed in Appendix E, the k -nearest neighborsalgorithm is among the most straightforward statisticallearning approaches that assigns to an unlabeled object(the value of p from a texture) the most frequent labelamong the k training nearest neighbors (the parameterof the method) in the features space (the extracted imagefeatures).Figure 3A shows the validation curves, that is, thetraining and cross-validation scores as a function of thenumber of neighbors k . We note that the algorithm over-fits the data for k <
10, that is, the algorithm is not com-plex enough to capture the underlying structure of thedata. On the other hand, the algorithm begins to underfitthe data for k >
20, meaning that the learning methodis getting too complex and modeling even the randomnoise in the training set. Figure 3B shows the learningcurves, which represents the scores as a function of thefraction of the data used for training the algorithm (with k = 15). We observe no significant improvement in thecross-validation score when more than 35% of the data is used as training set. Thus, the k -nearest neighbors algo-rithm achieves a remarkable accuracy of ≈ .
2% in theregression task of predicting the order parameter p solelybased on the values of H and C . We further observe thatpratically the same accuracy is obtained when using onlythe values of H or only the values of C . This happensbecause the values of H and C are strongly correlated toeach other for these textures. However, in general, thevalues of C are not a trivial function of H and usuallycare additional information related to the “structural”complexity of images [27–29]. The performance of thisalgorithm is much higher than those obtained from sim-ple baseline regressors that always predict the expectedvalues or the median (accuracy of ≈ p as a function of the reduced temperature T r in a particular simulation and the values predicted bythe k -nearest neighbors algorithm (with k = 15). Wenote that the predictions are very close to the actual val-ues of the order parameter, which confirms the efficiencyand usefulness of our approach. B. Nematic textures of experimental samples
In another application, we study nematic textures ob-tained from samples of the E7 liquid crystal, a multicom-ponent mixture composed by cyanobiphenyl and cyan-oterphenol that is commonly employed in the industryfor producing displays. This liquid crystal exhibits anematic-isotropic transition at T c ≈ ◦ C [4]. Detailsabout the experimental procedures are provided in Ap-pendix C, but it basically consists in using polarizedoptical microscope imaging for taking pictures of thesetextures at different temperatures T . Figure 4A showsexamples of textures obtained from a sample with tem-perature varying from 40 ◦ C to 60 ◦ C. We observe thatthere are no visually significant changes in the patternsof these textures when the temperature increases until55 ◦ C. As the sample temperature exceeds the criticaltemperature T c , we observe the growth of isotropic do-mains which makes easier the visual distinction amongthese textures.We collect data from six different E7 samples by follow-ing the same experimental protocol. Figures 4B and 4Cdepict the average behavior of the entropy H and com-plexity C on the temperature T . These results are similarto those obtained via Monte Carlo simulation (see Fig-ure 2A), that is, H tends to increase with T and showsa sharp minimum at the critical temperature, while C has a decreasing trend with T and displays a maximumat the critical temperature. Once again, we observe thatthe values of H and C are well-defined functions of thetemperature T and capable of precisely identifying thenematic-isotropic transition.Differently from our previous results on the simulatedtextures, we now propose to predict the sample temper-ature T (instead of the order parameter p ) directly from Reduced temperature, T r O r de r pa r a m e t e r , p TruePredicted (c)
Number of neighbors S c o r e s Training scoreCross-validation score (a)
Training size S c o r e s Training scoreCross-validation score (b)
Figure 3. Predicting the order parameter p with a machinelearning algorithm. (a) Training and cross-validation scores ofthe k -nearest neighbors algorithm as a function of the num-ber of neighbors k . The scores represent the coefficient ofdetermination ( R ) of the relationship between the predictedand true values, and can be interpreted as the percentage (orfraction) of data variation that is explained by the model.We note that the algorithm overfits the data when k < k >
20 it starts underfitting the data. (b) Learn-ing curves, that is, training and cross-validation scores as afunction of the training size (fraction of the whole data usedfor training the model) with k = 15. We observe no signif-icant improvement in the cross-validation score when morethan 35% of the data is used. The shaded areas in both plotsrepresent the 95% confidence intervals obtained in a 3-fold-cross-validation splitting strategy. We note the high accuracyachieved by the algorithm ( ≈ . p as a function of the reduced temperature T r . These predictions were generated by exposing the trainedregressor (with k = 15) to a set of textures never presentedbefore to the algorithm. the experimental textures. However, it is worth men-tioning that in this simple experimental setup the orderparameter can be estimated from the temperature [30],so that predicting the temperature is comparable to pre-dicting the order parameter. We also note that most ofthe models for liquid crystals fail to predict the orderparameter for temperatures much lower than T C [30],and that in general, measuring the order parameter re-quires complicated procedures, such as light scatteringexperiments [31]. In order to perform these predictions,we proceed as in the simulated case, that is, we traina k -nearest neighbors algorithm for the regression taskof predicting the values of T from the image quanti-fiers ( H and C ) and from a dummy variable that is zerofor T c − . T c ≤ T ≤ T c , 1 for T > T c , and -1 for T < T c − . T c . Figure 5A shows the validation curves,where we observe that the algorithm overfits the data for k = 1, while it starts to underfit the data for k greaterthan 3. Figure 5B depicts the learning curves for k = 2, T = 40 ° C T = 45.1 ° C T = 50.5 ° C T = 55 ° C T = 57.94 ° C T = 58.24 ° C T = 58.53 ° C T = 58.82 ° C T = 59.35 ° C
40 45 50 55 60
Temperature, T ( °C) E n t r op y , H (b) T = T c
40 45 50 55 60
Temperature, T (°C) C o m p l e x i t y , C (c) T = T c (a) Figure 4. Examples of E7 liquid crystal textures at differenttemperatures and phases, and the dependence of the complex-ity measures on the temperature. (a) Experimental texturesof an E7 liquid crystal sample at different temperatures. Weobserve that practically no visual change is observed until thecritical temperature T c ≈ ◦ C. (b) Dependence of the per-mutation entropy H and (c) the statistical complexity C onthe temperature T . The solid curves represent the average ofthe quantities calculated over the results of six samples. Theshaded areas are 95% bootstrap confidence intervals. Thevertical dashed lines indicate the critical temperature T c . Wenote that the phase transition is properly identified by theextreme values of the complexity measures. where we note no significant improvement in the cross-validation score when the training set exceeds 80% ofthe whole data. Thus, the k -nearest neighbors algorithmachieve an accuracy of ≈
93% with k = 2 and by using80% of data as training set. These scores are reducedin ≈
6% when using the values of H and C separately,which reinforce the fact these complexity measures arenot related to each other in a trivial manner. Further-more, these scores are much higher than those obtainedfrom regressors that always predict the expected valuesor the median (accuracy of ≈ k -nearest neighborspredictions and demonstrates the potential of our ap-proach with experimental data. Training Size S c o r e s (b) Training scoreCross-validation score
Number of neighbors S c o r e s (a) Training scoreCross-validation score (c)
40 45 50 55 60
Real temperature (°C) P r ed i c t ed t e m pe r a t u r e Figure 5. Predicting the temperature with a machine learn-ing algorithm. (a) Training and cross-validation scores of the k -nearest neighbors algorithm as a function of the numberof neighbors k . The scores represent the coefficient of deter-mination ( R ) of the relationship between the predicted andtrue values, and can be interpreted as the percentage (or frac-tion) of data variation that is explained by the model. Notethat for k = 1 the algorithm overfits the data, while for k > k = 2.The shaded areas in both plots represent the 95% confidenceintervals obtained in a 3-fold-cross-validation splitting strat-egy. We observe practically no significant improvement in thecross-validation score when more than 80% of the data is usedto train the model. (c) True versus predicted temperaturesobtained by exposing the trained regressor to a set of experi-mental textures never presented before to the algorithm. Thedashed line represents the 1:1 relationship. We observe anexcellent agreement between the true and predicted tempera-tures, reinforcing the great accuracy achieved by the method( ≈ C. Simulated cholesteric textures
As a last application, we investigate simulated texturesof cholesteric liquid crystals. These materials display ahelical structure composed of layers in between which thepreferential director axis varies periodically with a period(that is, the distance to complete a full rotation of thedirector axis) known as the pitch η . Among other prop-erties, the pitch of a cholesteric liquid crystal defines thewavelength of the reflected light as a consequence of theBragg reflection in short pitch materials [3]. The pitchlength modifies the textures of these materials, so that, acholesteric texture can mimic a nematic one for large val-ues of the pitch or be entirely different for short pitches.In a cell treated to impose homeotropic alignment, forexample, the pitch length determines if the texture ob-served is homeotropic, fingerprint or focal-conic [30]. Our goal in this case is to identify the pitch of acholesteric liquid crystal based on the values of H and C obtained from the textures. To do so, we create adataset of textures composed of one hundred replicas foreach pitch value η ∈ (15 , , , , , , , ,
40) nm,where η = 40 nm is large enough to mimic a nematictexture. The optical textures are numerically obtainedby solving the model described in Appendix D, whichis based on the Landau-de Gennes theory [32]. In oursimulations, we have used real values for the physicalparameters of this model but a small lattice size (seeAppendix D for further details). This choice leads to un-realistic cholesteric pitches but generates textures verysimilar to those obtained from experimental results. Inparticular, we use the process of quenching a cholestericsample from the isotropic state to generate the set of tex-tures. Figure 6 shows the values of H and C estimatedfrom five random selected textures for each value of thepitch as well as three typical textures for η = 17 nm, η = 27 nm and η = 40 nm (insets of that figure). Weobserve that although there exists some overlapping, tex-tures with different pitches tend to occupy different re-gions on the complexity-entropy plane, indicating that H and C are capable of distinguishing among differentcholesteric textures. We further note that the larger thevalues of η , the higher the complexity and the lower theentropy values. Thus, large values of pitch produce tex-tures more locally ordered, while small values generatetextures that are locally more irregular.We train a k -nearest neighbors algorithm for the clas-sification task of predicting the pitches solely based onthe values of H and C . Figure 7A shows the validationcurves. We observe that this algorithm overfits the datawhen the number of neighbors is smaller than 3, andfor larger number of neighbors, it slowly starts underfit-ting the data. We highlight that this simple algorithmachieves an accuracy of ≈ / ≈ k -nearest neighbors algorithm are reducedin ≈
5% when using the values of H and C separately,similarly to what happens with the E7 nematic textures.Also, the learning curves depicted in Figure 7B indicatethat ≈
60% of the data is enough for fitting this algo-rithm to the cholesteric data. We have further estimatedthe confusion matrix, as shown in Figure 7C. The ele-ments f ij of this matrix represent the fraction of textureswith pitch η i that the algorithm predicts to have pitch η j ; thus, a perfect classifier is represented by an identitymatrix ( f ij = δ ij ). In practical applications, the closer to1 are the diagonal elements of f ij , the better is the per-formance of the classifier. In our case, we observe thatnearly all nonzero elements of f ij are within a diagonalband of width 1 of this matrix, with the main diagonalconcentrating at least ≈
72% of the predictions. Thus,even when the algorithm incorrectly classifies the pitchof a texture (which occurs in about 15% of the predic-tions), it tends to predict a pitch value that is very close
Entropy, H C o m p l e x i t y , C Cholesteric pitch (nm)151719 212325 272940
Figure 6. Discriminating among cholesteric textures with dif-ferent pitches via the complexity-entropy plane. Each colorfulmarker represents the values of H and C for 5 realizations ofthe cholesteric textures with different pitches (as indicated bythe different markers). We note that the values of H and C for each cholesteric pitch are localized over a small region inthe complexity-entropy plane. We further observe that thetextures from small pitches are localized in a high entropyregion, while those from large pitches are in a low entropyregion. This result indicates that textures from large pitchesare more ordered than those obtained for small pitches (asillustrated by the insets). to the actual value, with a higher probability of under-estimate the value (notice that the elements precedingthe main diagonal are larger than those appearing after).These results thus corroborate to the usefulness of ourapproach for investigating more complex textures. III. CONCLUSIONS
We have proposed an approach for extracting physicalproperties of liquid crystals directly from textures imagesof these materials. Our method is based on estimatingtwo simple complexity measures (permutation entropyand statistical complexity) directly from the textures,which are used as features in supervised learning tasksof regression and classification of physical parameters ofthese materials. We have demonstrated the usefulnessand accuracy of this approach in a series of numericaland experimental applications. Our results have shownthat the average order parameter can be directly esti-mated from images of nematic textures obtained fromMonte Carlo simulations with accuracy of 98%. Similarprecision is obtained in the regression task of directly es-timating the temperature from E7 liquid crystal texturesat different temperatures and phases. We have furtherpresented results based on cholesteric textures, in whichwe have probed the cholesteric pitch length with signifi-cant accuracy.
15 17 19 21 23 25 27 29 40
Predicted cholesteric pitch (nm) T r ue c ho l e s t e r i c p i t c h ( n m ) F r a c t i on Number of neighbors S c o r e s (a) Training scoreCross-validation score (c)
Training Size S c o r e s Training scoreCross-validation score (b)
Figure 7. Predicting the cholesteric pitch with statisticallearning algorithms. Training and cross-validation scores(fraction of correct classifications) of the k -nearest neighborsalgorithm as a function of the number of neighbors in (a) andas a function of the training size in (b). The shaded areasin both plots are the 95% confidence intervals obtained in a5-fold-cross-validation splitting strategy with the number ofneighbors equal to 20. Note that for the number of neigh-bors smaller than 15 the algorithm overfits the data, but formore than 20 neighbors it starts underfitting the data. Wealso notice that when more than 60% of the data is used totrain the model (training size), there is no significant scoreimprovement. (c) True and predicted cholesteric pitch. Thisconfusion matrix shows the good performance achieved bythe algorithm represented by the high values of right predic-tions in the diagonal. In some cases, the algorithm underes-timates the pitch. This results from the overlap observed inthe complexity-entropy plane in Figure 6. In spite of the significantly achieved accuracies, ourapproach is indeed quite simple and based on intuitivefeatures very familiar to any physicist. Due to this un-derlying simplicity and also because our approach is veryfast and scalable from the computational point of view,we believe it can be easily implemented and adapted forother more complex experimental situations involving thestudy of liquid crystals and perhaps for probing physicalproperties of different materials.
ACKNOWLEDGMENTS
This research was supported by CNPq and CAPES.HVR thanks the financial support of the CNPq underGrants 440650/2014-3, 303642/2014-9, and 407690/2018-2. RSZ thanks the National Institute of Science andTechnology Complex Fluids (INCT-FCx), and the SaoPaulo Research Foundation (FAPESP – 2014/50983-3).
Appendix A: Complexity-entropy plane
The normalized permutation entropy H [25] and sta-tistical complexity C [33] are two complexity measuresoriginally proposed for characterizing time series [26],and that were more recently generalized for consideringhigher dimensional data such as images [27, 28]. Werefer the more detail-oriented reader to the previously-cited references, where a complete description of thesetechniques can be found. Here we shall present both ap-proaches through an illustrative example. For that, thematrix A = represents an hypothetical texture of size 3 ×
3. Theelements of this matrix indicate the light intensity trans-mitted through the sample around a particular site. Forthe experimental textures, these elements are obtainedby averaging the shades of red, green, and blue of theimage files in the RGB “color space” (see Appendix Cfor further details). We thus define sliding sub-matricesof size d x = 2 by d y = 2 (the embedding dimensions) inthe form A i = (cid:20) a a a a (cid:21) , which for this particular example are A = (cid:20) (cid:21) , A = (cid:20) (cid:21) , A = (cid:20) (cid:21) , and A = (cid:20) (cid:21) . Next, we associate a sequence of symbols to each sub-matrix for representing the ordinal patterns of occur-rence of their elements. In this case, A is associatedwith Π = (1 , , ,
3) since a < a < a < a , whereΠ is the permutation that sorts the elements of A inascending order (line by line). Similarly, A is repre-sented by Π = (0 , , , A is described by Π = (3 , , , a < a < a < a ; finally, A is associatedwith Π = (2 , , ,
1) because a < a < a < a .In case of draws, the occurrence order of the tied ele-ments is kept. By calculating the relative frequency ofoccurrence of each permutation, we estimate the prob-ability distribution P = { p i ; i = 1 , . . . , n } for eachone of the n = ( d x d y )! ordinal patterns. Among the( d x d y )! = 24 possible ordinal patterns, only four permu-tations have appeared once in our example, and therefore, P = { / , / , / , / , , . . . , } is the ordinal distribu-tion associated with the matrix A .The ordinal distribution P = { p i ; i = 1 , . . . , n } is thusused for estimating H and C . The permutation entropy H is the normalized Shannon entropy of P , that is, H ( P ) = 1ln( n ) n (cid:88) i =0 p i ln(1 /p i ) , (A1) where ln( n ) corresponds to the maximum value of theShannon entropy S ( P ) = (cid:80) ni =0 p i ln(1 /p i ), occurringwhen all permutations are equally likely to occur ( p i =1 /n ). While the statistical complexity is defined by C ( P ) = D ( P, U ) H ( P ) D ∗ , (A2)in which D ( P, U ) = S (cid:18) P + U (cid:19) − S ( P )2 − S ( U )2 (A3)is the Jensen-Shannon divergence between P and the uni-form distribution U = { u i = 1 /n ; i = 1 , . . . , n } and D ∗ is a normalization constant [obtained by calculating D ( P, U ) when P = { p i = δ ,i ; i = 1 , . . . , n } ].The entropy H is a measure of “disorder” in the occur-rence order of the elements of A . Values of H ≈ H ≈ C quantify the“structural” complexity present in the matrix A . For agiven value of H , the complexity C can assume valuesbetween a minimum and a maximum and provides im-portant additional information about the correlationalstructure of A that is not properly carried out by thevalues of H . Mainly for this reason, we have used thediagram of C versus H (the so-called complexity-entropyplane) as a discriminating tool for investigating the liq-uid crystal textures. This framework has been success-fully used in several applications with time series [34–38]and image analysis [29, 39–41]. In addition to their sim-plicity and intuitive meaning, these complexity measuresare very fast and scalable from the computational pointof view. This approach has also only the embedding di-mensions d x and d y as “tuning parameters”. However,this choice is not completely arbitrary, and the condition( d x d y )! (cid:28) n x n y must hold in order to obtain a reliableestimation of P . We have used d x = d y = 2 in the studyof simulated nematic textures and d x = 2 and d y = 3 inall other applications due to the dimensions of the matri-ces associated with the textures. However, very similarresults are obtained when considering d x = 3 and d y = 2, d x = 2 and d y = 3 or d x = d y = 2 in all applications. Appendix B: Monte Carlo simulations
In order to obtain the nematic textures analyzed inSection II A, we have simulated a system composed ofheadless spins located over the sites of a tridimensionalcubic lattice of dimensions N x × N y × N z (with N x = N y = 100 and N z = 20). These spins have direc-tions represented by unit vectors (cid:126)u i [ i = (1 , , . . . , N ),with N = N x N y N z = 200 , z -direction are fixed and point to the y -direction, while those in the last layer are fixed along the x -direction. These two layers of fixed spins mimic thesurface region (denoted by S ) and supply an anchoringdirection that twists the alignment of the spins across thesample. The other spins in the bulk region (denoted by B ) interact with their nearest neighbors via the Lebwohl-Lasher potential [42] with periodic boundary conditionsalong the x and y directions. The Hamiltonian of thissystem can be written as U N = 12 (cid:88) i,j ∈ B i (cid:54) = j Φ ij + J (cid:88) i ∈ B j ∈ S Φ ij , (B1)in which J is the strength of the anchoring energy andΦ ij = − (cid:15) ij (cid:18)
32 cos( (cid:126)u i · (cid:126)u j ) − (cid:19) , (B2)with (cid:15) ij = (cid:15) when i and j are nearest neighbors, and zerootherwise.All textures are obtained with J = 1, and the bulkspins are initially aligned making an angle with respectto the x -direction [ u i = (cos(0 . , sin(0 . , − ∆ Uk B T ), where ∆ U is the energy differ-ence between the old and new states, T the temperature,and k B the Boltzmann constant. A Monte Carlo step iscompleted when all spins are updated on average.The simulations start with a given reduced tempera-ture T r = k B T /(cid:15) , and the system is initially simulatedfor 10 Monte Carlo steps to avoid transient behaviors.Next, we consider another 10 Monte Carlo steps for esti-mating the average order parameter over each layer of thesystem. The local order parameter is the largest eigen-value of the order matrix Q ab = (cid:68) u ( a ) i u ( b ) i − δ ab (cid:69) , (B3)where u ( a ) i and u ( b ) i are the a -th and b -th components ofthe unitary vector (cid:126)u i associated with the i -th spin, and δ ab stands for the Kronecker delta. The order parameteracross the entire sample ( p ) is calculated by averagingthe mean value of each free layer of the system. Thismodel is well-known to present a bulk phase transition atthe critical temperature T c = 1 . T c = 1 . × Monte Car-los steps for avoiding transient behaviors related to thephase transition. The textures are obtained by averag-ing the latest 50 Monte Carlo steps via the Stokes-Mullermethodology [48]. This procedure consists in treating in-coming light (parallel to the z -direction) as a Stokes vec-tor, and describing each site as a Muller matrix. We haveconsidered n e = 1 .
66 for the extraordinary refraction in-dex, n = 1 .
50 for the ordinary refraction index, a sample thickness of 5.3 µ m, and wavelength of 545 nm for theincoming light. The resulting texture is represented by amatrix with dimensions 100 × Appendix C: Experimental proceedings and imagefiles processing
The experimental textures analyzed in Section II Bare obtained via polarized optical microscope imagingof liquid crystal samples at different temperatures. Thesamples consist of rectangular capillaries with no surfacetreatment (300 µ m × ◦ C to avoid flow alignment. Next, the samples arecooled up to room temperature and placed on a temper-ature controller under the polarized optical microscopesetup. We start taking pictures of textures from samplesat 40 ◦ C. The samples are slowly heated at a constantrate of 0 . ◦ C per minute, and pictures are taken ev-ery 90 s until the temperature reaches 55 ◦ C. For highertemperatures, the heating rate is reduced to 0 . ◦ C perminute, and pictures are taken every 60 s until the tem-perature of 61 ◦ C is achieved.All acquired image files are in PNG format with di-mensions of 2047 pixels width by 1532 pixels height, and24 bits per pixel (8 bits for each one of the three layersin the RGB “color space”). This means that each pixelhas 256 possible intensities of red, green, and blue col-ors, allowing more than 16 million color variations. Thesefiles can be represented by a three-layer matrix of dimen-sions n x (image width) by n y (image height), in whicheach layer corresponds to a color channel whose elementsare the color intensities (ranging from 0 to 255). Wehave calculated 0 . R + 0 . G + 0 . B , that is, aweighted-average over the three layers, where R , G and B stand for the shade intensities of red, green, and bluecolors of each pixel. This procedure corresponds to thegray-scale luminance (or reflectance) transformation [49],which is considered to mimic the color sensibility of thehuman eye. This procedure yields a single matrix foreach image file from which the values of H and C arecalculated. Appendix D: Simulations of the continuum elastictheory
The cholesteric textures investigated in Section II C areobtained via the continuum elastic theory. In particular,we have used the Landau-de Gennes approach [32] for de-scribing the energy density F associated with variationsin the tensorial order parameter Q around the equilib-rium state. By letting x , x , and x represent the spatialcoordinates, the energy density can be written as F = L ∂Q ij ∂x k ∂Q ij ∂x k + L ∂Q ij ∂x j ∂Q ik ∂x k + L Q ij ∂Q kl ∂x i ∂Q kl ∂x j + 4 πη L q (cid:15) ikl Q ij ∂Q lj ∂x k + A Q ij Q ji + B Q ij Q jk Q ki + C Q ij Q jk Q kl Q li , (D1)where L , L , L , and L q are elastic constants, A , B ,and C are thermodynamic parameters, and η is thecholesteric pitch length. Here, we have assumed implicitsummation in repeated indexes. The time evolution ofthe components of Q ij is given byΓ ∂Q ij ∂t = (cid:18) ∂F ( Q ) ∂Q ij − ddx k ∂F ( Q ) ∂Q ij,k (cid:19) , (D2)where Γ is the liquid crystal rotational viscosity, t is thetime and Q ij,k is the derivative of Q ij relative to x k .The system of equations D2 is numerically solvedvia finite differences method in a uniform grid with200 × ×
20 grid points. All distance units are nor-malized by the grid distance δx = 1 nm, δx = 1 nmand δx = 1 nm. The liquid crystal parameters usedare A = − .
348 MJ/(Km ), B = − .
133 MJ/m , C =1 .
733 MJ/m , Γ = 0 . L = 2 . L = 2 . L = 0 .
76 pN, and L q = 1 .
86 pN. These parametersare obtained from the literature and are well-known toroughly describe the 5CB liquid crystal [3]. Thus, in-stead of rescaling the elastic and thermodynamic con-stants to unrealistic values [32], we have used real val-ues for these parameters but a small lattice size ( δx i ).This choice implies in using small and unrealistic valuesfor the cholesteric pitches. However, the textures pro-duced with this approach are qualitatively very similarto those obtained when using unrealistic values for thephysical parameters. Also, these textures are well-knownto mimic well those obtained from experimental studies.We have considered different values for the pitch η andthe Dormand-Prince of fourth-order [50] for the time in-tegration. The initial condition is randomly chosen froma uniform distribution and periodic boundary conditionsare considered in all directions for avoiding surface ef-fects. Finally, the resulting optical textures are generatedby applying the Jones 2 × Appendix E: Implementation of the machinelearning algorithms
Machine learning tasks include classification and re-gression. Classification is the task of predicting a discrete class label by providing a correctly labeled training set ofdata, whereas in regression tasks the algorithm predictsa continuous quantity. Thus, the predictions of the orderparameter from the simulated nematic textures and thepredictions of the temperature from the experimental ne-matic textures represent a regression task. On the otherhand, the predictions of the discrete set of cholestericpitches represent a classification task. For both tasks,we have used the k -nearest neighbors algorithms as im-plemented in the Python module scikit-learn [52]. Thisis one of the simplest machine learning algorithms thatmake predictions based on the classes (or values) of k -closest neighbors [15]. The only parameter of this algo-rithm is the number of nearest neighbors k .The best value of k is chosen to simultaneously mini-mize the bias and variance errors of the predictions (theso-called bias-variance tradeoff [15]). Bias errors occurswhen the statistical learning algorithm is not complexenough to capture the underlying structure of the data(underfitting). On the other hand, variance errors ap-pear when the algorithm is too complex and starts tomodel even the noise in the training set, but fail in pre-dicting future observations in unseen data (overfitting).There is thus a trade-off between minimizing the bias andvariance errors concerning the algorithm complexity.To address this question, we employ a resampling strat-egy known as n -fold cross-validation [15]. This approachconsists in randomly splitting the data into n subsam-ples of approximately equal size. One of the subsamplesis separated for validating the algorithm, and the remain-ing n − n times. The accuracy obtained from thetraining set is the training score, and the one obtainedfrom the validation set is the cross-validation score. Atthe end of n repetitions, we have n estimates for the train-ing and cross-validation scores, from which we calculateaverage values and confidence intervals. The plot of thetraining and cross-validation scores as a function of modelparameters (in our case, the number of nearest neighbors k ) is known as validation curves. In our regression tasks,the scores represent the coefficient of determination ( R )of the relationship between the predicted and true values.When positive, the R is also interpreted as the percent-age (or fraction) of the response variable variation that isexplained by the model. Also, in our classification task,the score (or accuracy) represents the fraction of correctclassifications. An underfitting situation happens whenboth training and validation scores are low; whereas over-fitting is represented by good training scores and poorvalidation scores. The best bias-variance tradeoff occurswhen the highest values are obtained for both scores. Wehave also estimated the learning curves, which representthe dependence of the training and the cross-validationscores on the size of the training set. This is an im-portant matter for statistical learning methods becausesmall training sets may not be enough for correctly fit-ting the model, while unnecessary data may introducenoise to the model.0We have further compared the performance of the k -nearest neighbors algorithm with other more complexmachine learning methods (namely: random forest, sup-port vector machine, and neural network). However, thescores for these methods are very similar to those ob- tained for the k -nearest neighbors. For this reason andalso due to the simplicity of the k -nearest neighbors, wehave only reported the results for this machine learningmethod. [1] F. Chen, G. M. Brown, and M. Song, Optical engineering , 10 (2000).[2] Z. Wang, H. Li, Y. Zhu, and T. Xu, Archives of Com-putational Methods in Engineering , 637 (2017).[3] J. Prost and P. G. de Gennes, The physics of liquid crys-tals , Vol. 83 (Oxford University Press, 1995).[4] R. S. Zola, L. R. Evangelista, Y.-C. Yang, and D.-K.Yang, Physical Review Letters , 057801 (2013).[5] M. Shribak and R. Oldenbourg, Applied Optics , 3009(2003).[6] R. Oldenbourg, in Live Cell Imaging: A Laboratory Man-ual (Cold Spring Harbor Laboratory Press, 2005) pp.205–237.[7] S. Zhou, S. V. Shiyanovskii, H.-S. Park, and O. D.Lavrentovich, Nature Communications , 14974 (2017).[8] S. J. DeCamp, G. S. Redner, A. Baskaran, M. F. Hagan,and Z. Dogic, Nature Materials , 1110 (2015).[9] B. Montrucchio, A. Sparavigna, and A. Strigazzi, LiquidCrystals , 841 (1998).[10] S. S. Sastry, K. Mallika, B. G. S. Rao, H. S. Tiong, andS. Lakshminarayana, Liquid Crystals , 415 (2012).[11] S. S. Sastry, S. Kumar, T. V. Kumari, K. Mallika,B. G. S. Rao, and H. S. Tiong, Liquid Crystals , 1527(2012).[12] S. S. Sastry, B. G. S. Rao, K. B. Mahalakshmi,K. Mallika, C. N. Rao, and H. S. Tiong, ISRN Con-densed Matter Physics , 423650 (2012).[13] Z.-g. Zheng, R. S. Zola, H. K. Bisoyi, L. Wang, Y. Li,T. J. Bunning, and Q. Li, Advanced Materials (2017).[14] H. Nemati, D.-K. Yang, K.-L. Cheng, C.-C. Liang, J.-W. Shiu, C.-C. Tsai, and R. Zola, Journal of AppliedPhysics , 124513 (2012).[15] T. Hastie, R. Tibshirani, and J. Friedman, The elementsof statistical learning: Data mining, inference, and pre-diction , Springer Series in Statistics (Springer, New York,2013).[16] L.-F. Arsenault, A. Lopez-Bezanilla, O. A. von Lilienfeld,and A. J. Millis, Physical Review B , 155136 (2014).[17] A. G. Kusne, T. Gao, A. Mehta, L. Ke, M. C. Nguyen, K.-M. Ho, V. Antropov, C.-Z. Wang, M. J. Kramer, C. Long, et al. , Scientific Reports , 6367 (2014).[18] E. D. Cubuk, S. S. Schoenholz, J. M. Rieser, B. D. Mal-one, J. Rottler, D. J. Durian, E. Kaxiras, and A. J. Liu,Phys. Rev. Lett. , 108001 (2015).[19] S. V. Kalinin, B. G. Sumpter, and R. K. Archibald,Nature Materials , 973 (2015).[20] J. Carrasquilla and R. G. Melko, Nature Physics , 431(2017).[21] Q. Wei, R. G. Melko, and J. Z. Y. Chen, Phys. Rev. E , 032504 (2017).[22] W. Hu, R. R. P. Singh, and R. T. Scalettar, Phys. Rev.E , 062122 (2017).[23] C. Dietz, T. Kretz, and M. H. Thoma, Phys. Rev. E ,011301 (2017). [24] J. Venderley, V. Khemani, and E.-A. Kim, Phys. Rev.Lett. , 257204 (2018).[25] C. Bandt and B. Pompe, Physical Review Letters ,174102 (2002).[26] O. A. Rosso, H. A. Larrondo, M. T. Martin, A. Plastino,and M. A. Fuentes, Physical Review Letters , 154102(2007).[27] H. V. Ribeiro, L. Zunino, E. K. Lenzi, P. A. Santoro,and R. S. Mendes, PLoS ONE , e40689 (2012).[28] L. Zunino and H. V. Ribeiro, Chaos, Solitons & Fractals , 679 (2016).[29] H. Y. D. Sigaki, M. Perc, and H. V. Ribeiro, Proceedingsof the National Academy of Sciences Fundamentals of Liquid Crystal De-vices , Wiley Series in Display Technology (Wiley, 2006).[31] T. W. Stinson and J. D. Litster, Physical Review Letters , 503 (1970).[32] M. Ravnik and S. ˇZumer, Liquid Crystals , 1201(2009).[33] R. L´opez-Ruiz, H. L. Mancini, and X. Calbet, PhysicsLetters A , 321 (1995).[34] T. Jovanovic, S. Garc´ıa, H. Gall, and A. Mej´ıa, Stochas-tic Environmental Research and Risk Assessment , 1(2016).[35] Q. Li and F. Zuntao, Physical Review E , 012905(2014).[36] T. Stosic, L. Telesca, D. V. de Souza Ferreira, andB. Stosic, Journal of Hydrology , 1136 (2016).[37] H. V. Ribeiro, M. Jauregui, L. Zunino, and E. K. Lenzi,Physical Review E , 062106 (2017).[38] H. V. Ribeiro, L. Zunino, R. S. Mendes, and E. K. Lenzi,Physica A , 2421 (2012).[39] A. Schlemmer, S. Berg, T. Shajahan, S. Luther, andU. Parlitz, in Engineering in Medicine and Biology Soci-ety (EMBC), 2015 37th Annual International Conferenceof the IEEE (IEEE, 2015) pp. 4049–4052.[40] A. P. Antonelli, G. J. Meschino, and V. L. Ballarin, in
Information Processing and Control (RPIC), 2017 XVIIWorkshop on (IEEE, 2017) pp. 1–7.[41] A. Antonelli, G. Meschino, and V. Ballarin, in
WorldCongress on Medical Physics and Biomedical Engineering2018 (Springer, 2018) pp. 135–141.[42] P. A. Lebwohl and G. Lasher, Physical Review A , 426(1972).[43] C. Chiccoli, L. Evangelista, P. Pasini, R. Teixeira deSouza, and C. Zannoni, Molecular Crystals and LiquidCrystals , 137 (2015).[44] C. Chiccoli, L. Evangelista, E. Omori, P. Pasini,R. Teixeira-Souza, and C. Zannoni, Molecular Crystalsand Liquid Crystals , 86 (2017).[45] J. Barker and R. Watts, Chemical Physics Letters , 144(1969).[46] U. Fabbri and C. Zannoni, Molecular Physics , 763 (1986).[47] C. Chiccoli, P. Pasini, A. Sarlah, C. Zannoni, andS. ˇZumer, Physical Review E , 050703 (2003).[48] E. Berggren, C. Zannoni, C. Chiccoli, P. Pasini, andF. Semeria, Physical Review E , 2929 (1994).[49] S. van der Walt, J. L. Sch¨onberger, J. Nunez Iglesias,F. Boulogne, J. D. Warner, N. Yager, E. Gouillart,T. Yu, and the scikit-image contributors, PeerJ , e453(2014).[50] J. R. Dormand and P. J. Prince, Journal of Computa- tional and Applied Mathematics , 19 (1980).[51] D. Seˇc, T. Porenta, M. Ravnik, and S. ˇZumer, Soft Mat-ter , 11982 (2012).[52] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel,B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer,R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cour-napeau, M. Brucher, M. Perrot, and E. Duchesnay, Jour-nal of Machine Learning Research12