Interpretable liquid crystal phase classification via two-by-two ordinal patterns
Authors: Leonardo G. J. M. Voltarelli, Natalia Osiecka-Drewniak, Marcin Piwowarczyk, Ewa Juszynska-Galazka, Rafael S. Zola, Matjaz Perc, Haroldo V. Ribeiro
Organizations: Departamento de Física, Universidade Estadual de Maringá, Maringá, PR 87020-900, Brazil · The Henryk Niewodniczański Institute of Nuclear Physics, Polish Academy of Sciences, E. Radzikowskiego 152, 31-342 Kraków, Poland · Departamento de Física, Universidade Tecnológica Federal do Paraná, Apucarana, PR 86812-460, Brazil · Faculty of Natural Sciences and Mathematics, University of Maribor, Koroška cesta 160, 2000 Maribor, Slovenia · Community Healthcare Center Dr. Adolf Drolc Maribor, Ulica talcev 9, 2000 Maribor, Slovenia · Department of Physics, Kyung Hee University, Dongdaemun-gu, Seoul 02447, Republic of Korea · University College, Korea University, Seongbuk-gu, Seoul 02841, Republic of Korea
Liquid crystal textures encode rich structural information, yet mapping these images to mesophase identity remains challenging because visually similar patterns can arise from distinct structures. Here we present a simple, interpretable representation that maps textures to a 75-dimensional frequency vector of two-by-two ordinal patterns, grouped into eleven symmetry-based types to characterize a large-scale dataset spanning seven mesophases. Combined with a simple machine learning classifier, this lightweight representation yields near-perfect phase recognition, including the difficult distinction between smectic A and smectic B mesophases. Our approach generalizes to unseen compounds and accurately distinguishes between phase identity and material origin. Unlike deep learning methods, each ordinal pattern is readily interpretable, and model explanations augmented with network visualizations of pattern interactions reveal the specific types and pairwise dependencies that drive each mesophase decision, providing compact, physically meaningful summaries of texture determinants. These results establish two-by-two ordinal patterns as an interpretable and scalable tool for liquid crystal image analysis, with potential applications to other complex patterned systems in materials science.
Figures & tables
Figure 1: Visualization of the 75 possible two-by-two ordinal patterns. Patterns are aggregated into 11 groups (labeled with capital letters from A to K) according to their number of unique symbols (distinct intensity levels) and smoothness degree [ 50 ] . Each two-by-two matrix represents one ordinal pattern, where the entries are ranks of pixel intensities within an image partition. For example, the single type A pattern, [0000] , corresponds to a uniform partition where all pixels have the same intensity, whereas the first type B pattern, [0123] , indicates that pixel intensities increase in rank from top-left to bottom-right within an image partition. Dashed outlines highlight the primary patterns whose rotations by quarter, half, and three-quarter turns yield all remaining patterns of the corresponding group.
Figure 2: Mapping the ordinal-pattern space of liquid crystal textures. The main panel depicts a UMAP projection of the ordinal-pattern space, where each dimension in the original space is the normalized probability of one of the 75 possible two-by-two ordinal patterns. Each data point represents a texture in our dataset, with mesophases encoded by distinct markers and colors. The surrounding inset panels show the ordinal distributions (circular bars on a logarithmic scale) and the corresponding texture for one randomly selected example per mesophase; their locations in the UMAP plane are indicated by numbers from 1 to 7. An interactive version is provided in Ref. [ 24 ] .
Figure 3: Overall prevalence of ordinal patterns across liquid crystal textures. Bars show the (a) average, (b) the standard deviation, and (c) the coefficient of variation (standard deviation divided by the mean) of the probability of each two-by-two ordinal pattern, calculated across all images. Patterns are arranged according to their 11 groups, indicated by colors and separated by vertical dashed lines labeled at the top. Numbers above bars denote the mean within each pattern group, and the insets in panels (a) and (b) magnify probabilities for groups D to K.
Figure 4: Ordinal-pattern fingerprints of each liquid crystal mesophase. (a) Matrix plot depicts the z -score probability of each two-by-two ordinal pattern (columns) across all mesophases (rows). Patterns are grouped by type and separated by vertical dashed lines. (b) Matrix plot of the z -score probability calculated for each pattern type (columns) and mesophase (rows). For both panels, z -scores are calculated by subtracting the average probability of a pattern or pattern type within a particular phase from the overall average probability and dividing the result by the overall standard deviation across all images. Positive values (green shades) indicate patterns or types that occur more frequently than the overall average, whereas negative values (purple shades) denote those that occur less frequently. Bar plots show (c) the distance to the average pattern, determined by the absolute sum of the z -score probabilities for each phase, and (d) the mean absolute coefficient of variation of the ordinal probabilities (in z -score units) calculated across all images within each mesophase.
Figure 5: Classifying mesophases with two-by-two ordinal patterns. (a, b) Training (circles) and cross-validation (triangles) accuracy as a function of the number of neighbors k in the nearest-neighbor classifier. (c, d) Training (circles) and cross-validation (triangles) accuracy as a function of the fraction of data used for training the nearest-neighbor algorithm with k=1 . Shaded regions in panels (a-d) represent one standard deviation band from a five-fold cross-validation procedure. (e, f) Confusion matrices showing the fraction of classifications on the test set for each true (rows) and predicted (columns) phase. Upper panels (a, c, and e) use the prevalences of the 75 two-by-two ordinal patterns as features; lower panels (b, d, and f) use the prevalences of the 11 pattern types. The inset in (d) compares the average accuracy obtained with the 75 patterns (red) and the 11 pattern types (blue) to a dummy classifier that predicts mesophases uniformly at random (green). Results in (e), (f), and the inset are averages over 50 independent train–test splits with 80% of the data used for training and k=1 ; error bars in the inset denote one standard deviation.
Figure 6: Classifying SmA and SmB mesophases from different compounds. (a, b) Confusion matrices showing the fraction of classifications on the set of textures of the 8BBAA Schiff-base compound, using (a) the 75 two-by-two ordinal patterns and (b) the 11 pattern types as features. In both cases, a nearest-neighbor algorithm (with k=1 ) is trained on all data except the SmA and SmB textures of 8BBAA. (c) Classification accuracy of the SmA and SmB textures of 8BBAA obtained with the 75 patterns (red) and the 11 pattern types (blue), compared with a dummy classifier that predicts mesophases uniformly at random (green). (d, e) Confusion matrices showing the fraction of classifications on the test set for each true (rows) and predicted (columns) phase (and by compound for SmA and SmB), using (d) the 75 two-by-two ordinal patterns and (e) the 11 pattern types as features. (f) Average accuracy obtained with the 75 patterns (red) and the 11 pattern types (blue), compared with the uniform-random baseline (dummy, green). Results in (d), (e), and (f) are averages over 50 independent train–test splits with 80% of the data used for training and k=1 ; error bars in panel (f) denote one standard deviation.
Figure 7: Interpreting the contribution of ordinal pattern types to mesophase classification. Panels (a)-(g) show density scatter plots of SHAP values for each ordinal pattern type across mesophases. SHAP values ( x -axis) quantify the impact of ordinal pattern type on the model output for individual observations. Points are color-coded by the prevalence of the pattern type in each observation, with green denoting high prevalence and purple denoting low. Panel (h) displays horizontally stacked bars of the mean absolute SHAP value for each pattern type across mesophases. Within each mesophase, pattern types are ordered by decreasing mean SHAP magnitude, with higher values indicating types with greater influence on the model’s predictions.
Figure 8: Interaction among ordinal-pattern types in mesophase classification. Each graph represents individual effects of ordinal-pattern types and their pairwise interactions on model predictions for a given mesophase. Nodes represent pattern types, with sizes proportional to the mean absolute SHAP value, and colors encoding the Spearman correlation between SHAP values and the prevalence of pattern type. Blue tones indicate a positive association with mesophase membership, and red tones indicate a negative association. Directed edges signify that the SHAP interaction for a pair of pattern types correlates with the prevalence of the source pattern type. Blue edges denote amplification, meaning higher prevalence of the source pattern type increases the impact of the target pattern type. Red edges denote attenuation, meaning higher prevalence of the source pattern type decreases the impact of the target pattern type. Only edges with an absolute Spearman correlation of at least 0.3 are shown. Black nodes and edges flag ambiguous directionality, where Spearman and Pearson correlations have opposite signs.
X-ray diffraction (XRD) is a experimental technique for determining the phase composition and structure of crystalline materials. However, interpreting XRD patterns is challenging, particularly in high-throughput materials discovery, where many novel materials may need to be characterized and no reference patterns are available. Consequently, machine learning is increasingly used to accelerate and automate the analysis while reducing errors associated with human interpretation. We propose a multi-decision framework for XRD phase analysis that integrates representation learning, similarity-based retrieval, and explainable decision support within a unified reference database. A convolutional autoencoder learns compact latent representations of XRD patterns that preserve structural similarity while remaining robust to variations arising from experimental noise and measurement conditions. By integrating multiple decision pathways within a shared latent space, the framework moves beyond single-label prediction toward ranked and interpretable phase analysis that mirrors expert practice. During inference, complementary decision mechanisms are applied, including latent-space classification and retrieval, explanation-guided similarity using Integrated Gradients, and composition-based similarity search. These mechanisms generate ranked candidate phase lists that are aggregated into a final prediction with an associated confidence score. Experiments on synthetic datasets demonstrate strong predictive performance, achieving 98.85,% accuracy for crystal system classification and 95.82,% accuracy for space group prediction on the test set, while maintaining robustness under realistic perturbations. The framework supports reliable, analyst-friendly identification of crystal phases and structures in high-throughput and exploratory materials discovery settings.
Doaa Mohamed, Markus Stricker
Materials Informatics and Data Science Interdisciplinary Centre for Advanced Materials Simulation (ICAMS) Ruhr University Bochum, Bochum, Germany
Materials phase diagrams are a core knowledge representation in materials science, encoding temperature,composition, phase stability, and phase transformation pathways, with their full understanding requiring thermodynamic mechanism analysis and scientific reasoning. Although VLMs have shown promise in scientific image understanding, their systematic evaluation on such logically complex images demanding deep mechanistic interpretation remains limited, and phase diagrams provide a challenging testbed for this purpose. We introduce MatPhaseBench, a high-quality, high-reliability benchmark for complex scientific image understanding, focused on materials phase diagrams. MatPhaseBench is constructed from 3681 papers in classical materials science journals, from which 200 high-quality diagram-text pairs were selected, covering 189 material systems and 70 elements. The benchmark has three key features: (1)targeting complex scientific image understanding-it moves beyond simple objective tests to open-ended tasks requiring deep comprehension; (2)comprehensive image-text alignment-semantic information associated with images is fully preserved during literature mining and matching; (3) high-quality human-supervised text acquisition-all descriptions undergo strict manual validation. Experimental results show that current VLMs remain substantially behind expert-level understanding: they are largely limited to surface visual perception, lack deep reasoning grounded in thermodynamic mechanisms, have limited domain awareness and expert analytical experience, and perform poorly in distinguishing fine-grained differences in composite or multi-diagram settings. Overall, MatPhaseBench constitutes a challenging research-grade benchmark, providing a foundational platform for complex scientific image understanding, phase diagram analysis, and trustworthy multi-modal AI in science.
Hanwen Wang, Sihan Liang, Zhiwei Liu +4
Computer Network Information Center, Chinese Academy of Sciences University of Chinese Academy of Sciences Beijing, China · University of Manchester Manchester, UK · Institute of Metal Research, Chinese Academy of Sciences Shenyang, China +1
Oppenheim and Lim (1981) showed that natural images stay recognizable when reconstructed from their Fourier phase alone, while the magnitude carries little of their identity. We ask whether trained image classifiers reproduce this asymmetry inside their hidden layers, and we test it causally: given two images, we transplant the phase of one onto the magnitude of the other at a chosen layer and record which image the prediction follows. In PRISM2D, GFNet, and ViT-B/16 the prediction follows the phase or sign donor, and deleting all image-specific magnitude barely moves accuracy, so identity rides on phase while image-specific magnitude is largely dispensable to the readout. ResNet-50 at first seems to break the pattern, because transplanting sign after its ReLUs does nothing; a fair intervention before the ReLU reveals a strong latent sign code in the late blocks, and a DC-only control shows the readout consumes a channel-wise spatial average. Controls rule out the trivial case in which magnitude simply stops depending on the image. The architectures therefore share a phase/sign identity code but expose it in different bases, set by rectification and readout geometry, which gives a mechanistic account of the texture--shape gap between CNNs and attention models.