## 3 Results and Discussion  
We trained EACNN on a dataset based on the MP database and tested its performance in reconstructing structures from patterns on an independent test set. For contrastive learning, Top-N is commonly used to characterize performance. The specific Top-N values are presented in Table 1, with the accuracy rates for Top-1, Top-3, and Top-5 being 95.96%, 99.95%, and 99.98%, respectively, even though these matches are entirely based on the model's automatic learning rather than special annotations. From Table 1, it is evident that the model's performance nearly converges at Top-3. From the perspective of feature learning, high Top-N accuracy indicates that the model has successfully established a robust mapping in the latent space. Through adversarial training of positive and negative samples in contrastive learning, the model can effectively capture the nonlinear correspondence between atomic arrangements in crystal structures and X-ray diffraction patterns. Further analysis involves the ranking of crystals corresponding to similar patterns in the test set, primarily to observe the similarities and differences between the paired crystals of the detected patterns. As shown in Figure 3, the detected patterns are labeled as True XRD, and the first structure inferred in reverse is the true structure. The model is then required to infer the second structure (most similar structure) and simultaneously extract its corresponding XRD. The model is further instructed to output the third inference structure, and the same method is used to extract the second similar structure and its corresponding XRD. From the model's inference results shown in Figure 3, the space group of the crystal structure corresponding to the detected XRD is \(P2_{1}/c\) (monoclinic, Bravais lattice type P). The space group of the Top-2 inferred structure is Pbam (orthorhombic, Bravais lattice type P), and the space group of the Top-3 inferred structure has extended to \(C2/m\) (monoclinic, Bravais lattice type C). Analyzing from the perspective of symmetry evolution, the model's prediction ranking of \(P2_{1}/c\), \(Pbam\), and \(C2/m\) reveals a deep connection between the hierarchy of symmetry breaking and diffraction characteristics, despite the significant overlap of XRD patterns in specific angular ranges, as shown by the strong peak clusters. This symmetry-sensitive prediction mechanism may originate from E(3) invariance and strong local learning constraints in cluster expansion: (1) During data augmentation, by applying symmetry transformations allowed by specific space groups (such as glide plane reflections and screw axis translations) to atomic positions, the invariance constraint under symmetry operations forces the model to learn intrinsic symmetry features rather than being limited to specific atomic coordinate arrangements. For example, the screw axis operation of \(P2_{1}/c\) generates a periodic phase shift in the diffraction intensity distribu \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Model** & **Top-1 (\%)** & **Top-3 (\%)** & **Top-5 (\%)** \\ \hline EACNN & 95.96 & 99.95 & 99.98 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance comparison of structure retrieval from XRD patterns. tion, and the model filters out such nonessential differences through an invariance Loss function. (2) Lattice symmetry components (related to Bravais types) and atomic primitive components (related to Wyckoff positions) are automatically learned and undergo distance relaxation during the aggregation of local representations (the essence of contrastive learning is to readjust the distances between samples), such as the significant separation of \(P2_{1}/c\) and \(C2/m\) in the lattice symmetry subspace (Bravais types are explicitly separated), but they are similar in the atomic primitive subspace.