## 1 Introduction
In this task scenario, common direct classifier models map simulated patterns to discrete crystal system/space group labels, which is essentially a lossy compression. While it is easy to train, it loses the complex physical correlations between patterns and structures, such as atomic arrangement symmetry and Bragg condition response patterns [28; 29]. Contrastive learning, on the other hand, builds a joint embedding space for structure and patterns, directly modeling the potential correspondence between the two, thereby preserving multidimensional physical features. In fact, patterns and structures inherently have a one-to-many ambiguity (such as the XRD patterns of four different structural models being highly similar, as mentioned in [30]). The same spectrum may come from different samples, and since the spectrum itself is a statistical representation after dimensionality reduction and averaging, solving this ambiguity from the perspective of the spectrum alone is very challenging [30]. However, the training of contrastive learning is bidirectional: on one hand, the model needs to learn the deterministic generation pattern of the spectrum corresponding to the current structure; on the other hand, it also needs to learn the probabilistic inverse mapping constraint of the structure corresponding to the spectrum. This physically consistent learning method of crystal-pair diffraction patterns is more intrinsic compared to just classifying patterns. Contrastive learning only requires weak supervision signals such as \"spectrum A\({}^{\prime}\) of structure A should be similar to other augmented versions of structure A (such as rotations and noise perturbations) but different from the spectrum of structure B\" [29; 31]. This characteristic allows for the use of unlabeled experimental data to enhance training. Therefore, when facing the challenge of \"long-tail distribution\" (displaying a figure of a category with fewer space groups), simple direct classification of patterns will fail due to the lack of samples for rare space groups, whereas contrastive learning is more effective than the traditional one. learning, by emphasizing relationships between samples rather than absolute categories, can utilize a small number of samples to establish boundaries of difference with common categories. This paradigm shift essentially redefines the mathematical formulation of the \"structure-spectrum\" mapping problem from a closed category space discrimination to an open relationship manifold learning, resulting in a continuous diffraction spectrum-crystal fingerprint. In the continuous embedding space, crystal symmetry breaking is represented as a gradual change in the curvature of the manifold rather than a discrete category jump [29; 31]. In our work, inspired by the Contrastive Language-Image Pre-training (CLIP) model [32], we integrated SE(3)-equivariant [33] network architecture and atomic cluster expansion (ACE) [34; 35] technology to construct a dual-tower contrastive learning model: E3 NN-based Atomic Cluster Expansion Neural Network (EACNN). As illustrated in Figure 1, crystal structures are processed through a structure encoding tower based on graph neural networks, which interacts with pattern information processed through a 1D ResNet structure for information aggregation in the hidden layer. In our tests, the TOP-1, TOP-3, and TOP-5 accuracies for retrieving structures from XRD patterns were 95.96%, 99.95%, and 99.98%, respectively. Moreover, even in samples with very few space group instances, our model maintained robust performance. The remainder of this paper is organized as follows: Section 2 introduces the EACNN framework, detailing its SE(3)-equivariant graph neural network architecture combined with atomic cluster expansion for crystal structure and XRD pattern encoding [33]. Section 3 demonstrates the model's effectiveness in structure retrieval, particularly in handling symmetry variations and rare space groups.