Rational High-Throughput Screening of Cocrystals: An Explainable Deep Learning Framework Based on Morgan Fingerprints and Cross-Attention Authors: Yukun Liu, Yanfei Liu, Ziang Du, Haochun Lan, Hao Zheng, Dongdong Yang, Yang Gao Published: 2026 ABSTRACT Aiming to address the problems of high blindness in traditional screening methods, insufficient granularity of feature representation, and poor interpretability of existing machine learning prediction models in the field of cocrystal research and development, we propose a cocrystal prediction method based on Morgan fingerprints and the cross-attention mechanism. First, a high-quality cocrystal data set is constructed, and Morgan fingerprints are employed to characterize molecular structures. Subsequently, a fingerprint-driven cross-attention model is developed to capture the feature interaction correlations between molecules, thereby realizing end-to-end prediction of cocrystal formation propensity. Finally, the comprehensive performance of the model and the rationality of its prediction logic are systematically validated through multidimensional performance evaluation, horizontal comparison with mainstream models, hyperparameter sensitivity analysis, ablation experiments, and SHAP-based interpretability analysis. Experimental results show that the model achieves an AUC of 0.9878 on the independent test set, and its BACC and specificity are significantly superior to those of traditional machine learning and basic deep learning models. It effectively mitigates the issue of high false positive rate induced by class-imbalanced data sets. The prediction outcomes of the model can be traced back to specific structural sites of molecules via the SHAP method, which provides clear chemical guidance. This work can provide reliable technical support for the high-throughput rational screening of cocrystals in pharmaceuticals, functional materials, and related fields. Introduction A cocrystal is a crystalline material formed by two or more neutral molecular components bound together via noncovalent interactions. − The primary driving forces governing cocrystal formation include hydrogen bonds, π–π stacking, van der Waals forces, and electrostatic interactions. A key merit of cocrystals is that they enable precise modulation of the physicochemical properties of materials without altering the covalent structure of the parent molecules. In the pharmaceutical industry, cocrystallization represents an effective strategy for improving the solubility, dissolution rate, and storage stability of poorly soluble drugs, thereby enhancing their drug-likeness and clinical performance. − In the fields of food science, − functional materials, − and fine chemicals, − cocrystal engineering has also been widely adopted to tailor the melting point, hygroscopicity, and mechanical properties of products, demonstrating high application value and development potential. Nevertheless, the current development and screening of cocrystals remain constrained by several bottlenecks. Traditional cocrystal screening approaches, mainly including solution evaporation, − melt crystallization, − and mechanical grinding, − predominantly rely on trial-and-error experimental investigations. These methods are time-consuming, labor-intensive, and costly, and cannot guarantee a high success rate of cocrystal formation. The formation of a cocrystal essentially depends on the strength of noncovalent interactions between the two molecular components and the compatibility of their crystal packing. Conventional experimental techniques cannot predict the cocrystal-forming ability of molecular pairs in advance and instead require extensive experimental validation, leading to considerable blindness in screening. Furthermore, the academic literature largely focuses on successful cases of cocrystal synthesis, while experimentally validated noncocrystal combinations are rarely reported systematically, further exacerbating the difficulty of cocrystal screening. In recent years, the rapid advancement of machine learning technologies − has provided a novel solution for high-throughput prediction and rational screening of cocrystals. Without relying on complex quantum chemical calculations, machine learning methods can learn the inherent rules governing cocrystal formation from existing experimental data and realize rapid prediction of the cocrystal-forming propensity of molecular pairs. To date, a variety of machine learning models have been applied to cocrystal prediction, ranging from traditional machine learning algorithms such as random forest and XGBoost , to deep learning models including artificial neural networks. − However, existing studies still suffer from several critical drawbacks. Most models employ global molecular descriptors as input features, which fail to finely capture structural information directly related to cocrystal formation, such as local functional groups and hydrogen-bonding sites. For the processing of bimolecular features, current models mostly integrate features through simple concatenation or element-wise operations, which cannot effectively model the intermolecular interaction relationships. This results in insufficient discrimination ability for noncocrystal negative samples and an excessively high false positive rate. Meanwhile, most deep learning models exhibit a black-box nature and cannot interpret the underlying chemical logic of prediction outcomes, making it difficult to provide effective guidance for subsequent experimental screening. Some studies use simulated noncocrystal data as negative samples, which further compromises the generalization ability and practical application value of the models. To address the core limitations of existing cocrystal prediction research, this work establishes a complete framework for cocrystal prediction based on Morgan fingerprints and the cross-attention mechanism, as illustrated in Figure . First, a high-quality cocrystal data set is constructed. All positive samples are retrieved from the Cambridge Structural Database (CSD) and subjected to rigorous multistage filtering, retaining only valid structures of binary organic cocrystals. All negative samples are derived from experimentally validated noncocrystal cases reported in published literature, with no unreliable simulated data employed, ensuring the authenticity and representativeness of the data set from the source. Morgan fingerprints are adopted as the core molecular representation to accurately capture the local chemical environment of molecules, matching the key interaction mechanisms underlying cocrystal formation. On this basis, a Fingerprint-based Cross-Attention Transformer (F-CAT) deep learning model is constructed. Through a bidirectional cross-attention mechanism, the model effectively captures the feature interaction relationships between bimolecular components and learns the intrinsic laws of cocrystal formation. This work comprehensively validates the overall performance of the model through a series of multidimensional experiments, including fixed data set evaluation, k-fold cross-validation, horizontal comparison with mainstream models, hyperparameter sensitivity analysis, and ablation experiments. Finally, a systematic interpretability analysis is performed using the SHapley Additive exPlanations (SHAP) method, which traces the model’s prediction results back to specific structural sites of molecules and reveals the core chemical structures driving cocrystal formation. Complete framework for cocrystal prediction based on Morgan fingerprints and the cross-attention mechanism. The main contributions of this work are 3-fold:1In terms of feature representation: Using Morgan fingerprints as model input features achieves fine-grained characterization of the local chemical environment of molecules, precisely covering the core structural information related to cocrystal formation. Meanwhile, the one-to-one correspondence between features and molecular sites lays a solid foundation for subsequent interpretability analysis, solving the problem of insufficient information granularity inherent in traditional global descriptors.2Regarding model construction: A fingerprint-based cross-attention cocrystal prediction model is proposed. The bidirectional cross-attention mechanism effectively models intermolecular interaction relationships, overcoming the limitations of simple feature fusion in conventional models. In addition, the model is specifically optimized for the class imbalance problem in cocrystal data sets. While maintaining a high recognition rate for positive samples, it substantially improves the discrimination ability for noncocrystal negative samples and reduces the false positive rate. Its overall performance is significantly superior to that of mainstream traditional machine learning and basic deep learning models.3Concerning interpretability: Based on the SHAP method, the black-box prediction results of the deep learning model are decomposed into the contribution scores of each molecular structural site, identifying the key functional groups and interaction sites that drive cocrystal formation. This verifies the chemical rationality of the model’s prediction logic and provides clear chemical guidance for the rational design, targeted screening, and experimental optimization of cocrystals in follow-up research. 1In terms of feature representation: Using Morgan fingerprints as model input features achieves fine-grained characterization of the local chemical environment of molecules, precisely covering the core structural information related to cocrystal formation. Meanwhile, the one-to-one correspondence between features and molecular sites lays a solid foundation for subsequent interpretability analysis, solving the problem of insufficient information granularity inherent in traditional global descriptors. In terms of feature representation: Using Morgan fingerprints as model input features achieves fine-grained characterization of the local chemical environment of molecules, precisely covering the core structural information related to cocrystal formation. Meanwhile, the one-to-one correspondence between features and molecular sites lays a solid foundation for subsequent interpretability analysis, solving the problem of insufficient information granularity inherent in traditional global descriptors. 2Regarding model construction: A fingerprint-based cross-attention cocrystal prediction model is proposed. The bidirectional cross-attention mechanism effectively models intermolecular interaction relationships, overcoming the limitations of simple feature fusion in conventional models. In addition, the model is specifically optimized for the class imbalance problem in cocrystal data sets. While maintaining a high recognition rate for positive samples, it substantially improves the discrimination ability for noncocrystal negative samples and reduces the false positive rate. Its overall performance is significantly superior to that of mainstream traditional machine learning and basic deep learning models. Regarding model construction: A fingerprint-based cross-attention cocrystal prediction model is proposed. The bidirectional cross-attention mechanism effectively models intermolecular interaction relationships, overcoming the limitations of simple feature fusion in conventional models. In addition, the model is specifically optimized for the class imbalance problem in cocrystal data sets. While maintaining a high recognition rate for positive samples, it substantially improves the discrimination ability for noncocrystal negative samples and reduces the false positive rate. Its overall performance is significantly superior to that of mainstream traditional machine learning and basic deep learning models. 3Concerning interpretability: Based on the SHAP method, the black-box prediction results of the deep learning model are decomposed into the contribution scores of each molecular structural site, identifying the key functional groups and interaction sites that drive cocrystal formation. This verifies the chemical rationality of the model’s prediction logic and provides clear chemical guidance for the rational design, targeted screening, and experimental optimization of cocrystals in follow-up research. Concerning interpretability: Based on the SHAP method, the black-box prediction results of the deep learning model are decomposed into the contribution scores of each molecular structural site, identifying the key functional groups and interaction sites that drive cocrystal formation. This verifies the chemical rationality of the model’s prediction logic and provides clear chemical guidance for the rational design, targeted screening, and experimental optimization of cocrystals in follow-up research. Methods Feature In this work, Morgan fingerprints are adopted as the molecular structure representation for feature input to the fingerprint-based cross-attention model. As a widely used topological molecular descriptor in chemoinformatics, Morgan fingerprints generate numerical features according to the local chemical environment of atoms, which is well suited to the requirements of the cocrystal prediction task. − The core principle of Morgan fingerprint generation is to traverse each atom in a molecule, extract the local environment information within a fixed radius of the target atom, and then convert the extracted information into a fixed-length feature vector through a mapping operation. The generation process is defined as shown in eq F=Hash(∪i=1MEnv(ai,r)) 1 where M is the total number of atoms in the target molecule, a i denotes the i-th atom in the molecule, and r represents the search radius for the local atomic environment, which is fixed at 2 in this work. This radius can fully cover most key structural motifs including hydrogen-bond donor/acceptor sites, substituent functional groups, and aromatic conjugated systems, without introducing excessive irrelevant redundant information. The rationality of this setting is further confirmed by the sensitivity analysis in Section . Env­(a i , r) stands for the local chemical environment centered at atom a i with radius r, covering topological and electronic structural features such as atom type, chemical bond property, hybridization state, and charge distribution. Hash denotes the hash mapping function, which maps discrete atomic environment features into a fixed-length integer index space. In this work, the length of the mapping space is set to 2048, yielding a numerical feature vector F with a fixed dimension of 2048. As a standard dimension commonly used for Morgan fingerprints in molecular simulation, this setting fully captures the local chemical environments of common functional groups, aromatic rings, and hydrogen-bonding sites in target molecules, while avoiding reduced computational efficiency and overfitting risks caused by dimensional redundancy, thus balancing feature integrity and model efficiency. Morgan fingerprints possess multiple advantages that match the requirements of this work. First, they output fixed-length numerical vectors regardless of the atomic number and structural complexity of the molecule, which perfectly satisfies the standardized input requirements of deep learning models. This property provides a unified dual-path input basis for the cross-attention model in this work, eliminating the need to design complex variable-length processing modules for different molecules, which greatly simplifies the model structure and reduces training difficulty. Second, the fine-grained characterization ability of Morgan fingerprints for local molecular structures is highly consistent with the core mechanism of cocrystal formation. Cocrystal formation is essentially driven by noncovalent interactions between two molecules. The occurrence of various interactions including hydrogen bonding, π–π stacking, and van der Waals forces depends entirely on specific local chemical environments in the molecule, such as functional groups, heteroatomic sites, and aromatic ring systems. Morgan fingerprints can accurately capture these local structural details and encode the key chemical features directly related to cocrystal formation into feature vectors, laying a high-quality information foundation for the model to learn the underlying rules of cocrystal formation. Most importantly, each feature position in a Morgan fingerprint can be traced back to the corresponding local atomic environment in the molecule. This one-to-one correspondence between features and molecular structures provides a necessary prerequisite for the subsequent interpretability analysis. By using the SHAP method to quantify the contribution of each fingerprint bit to the model prediction results, the decision logic of the model can be directly mapped to specific structural sites of the molecule, clearly revealing the key structural units that drive cocrystal formation. This breaks the black-box nature of deep learning models and endows the prediction results with clear chemical interpretability. In this work, the original structural information on all molecules is stored in the standardized Simplified Molecular-Input Line-Entry System (SMILES) string format. The full workflow of molecular structure processing and Morgan fingerprint calculation is implemented based on the RDKit chemoinformatics toolkit. First, SMILES strings are converted into standardized molecular objects, followed by structural validity verification and normalization to remove redundant structural information and ensure consistent molecular representation. Morgan fingerprints are then computed according to the above equation to generate 2048-dimensional feature vectors. For each bimolecular cocrystal system, the Morgan fingerprints of the two constituent molecules are calculated separately and used as the dual-path inputs for the subsequent fingerprint-based cross-attention model, to support feature interaction learning and the prediction of cocrystal formation probability. Fingerprint Cross Attention Model To address the requirement for interactive modeling of Morgan fingerprints from two molecular components in cocrystal formation prediction, this work develops the F-CAT model, whose overall framework is illustrated in Figure . Taking the Morgan fingerprints of two molecules as input, the model accomplishes end-to-end prediction of cocrystal formation probability through four sequential modules: feature encoding, cross-attention interaction, feature fusion, and classification decoding. Meanwhile, a structured training strategy is adopted to ensure the model’s generalization ability. The overall framework preserves the independent representation of molecular features while effectively capturing the interactive correlations between molecules. Overall architecture of the F-CAT model. The upper panel illustrates the complete workflow of end-to-end cocrystal prediction. The lower panel decomposes the computational logic of core components, including the basic structure of linear transformation layers and the core computation flow of scaled dot-product attention in the cross-attention module. The legend on the right defines all symbols and abbreviations used in the figure. Feature Encoder The feature encoder aims to map high-dimensional sparse Morgan fingerprints into a low-dimensional dense hidden feature space, which retains the core information on molecular structures while reducing the dimensional complexity for subsequent computations. Let the Morgan fingerprint vector of molecule 1 be x1∈RD and that of molecule 2 be x2∈RD , where D denotes the fingerprint dimension. Encoding is performed using linear transformation combined with nonlinear activation to introduce nonlinear feature expressiveness. For the fingerprint of molecule 1, the encoding is computed as eq h1=ReLU(W1x1+b1) 2 where W1∈Rd×D is the linear transformation weight matrix, b1∈RD is the bias vector, and d is the hidden layer dimension. The ReLU activation function is defined as ReLU­(z)=max­(0,z), which effectively alleviates the vanishing gradient problem and enhances the nonlinearity of feature representation. Fingerprint encoding for molecule 2 follows the same paradigm but uses an independent parameter set to adapt to the feature distribution of different molecules, as given in eq h2=ReLU(W2x2+b2) 3 where W2∈Rd×D and b2∈RD are the weight matrix and bias vector for encoding the fingerprint of molecule 2, respectively. Cross Attention The cross-attention module − is designed to capture interdependencies between encoded features of the two molecules and quantify the attention intensity from one molecular feature set to the other, thereby revealing intermolecular feature interaction patterns underlying cocrystal formation. To conform to the input format of the attention mechanism, the encoded feature vectors are first expanded with a sequence dimension, yielding h1a=h1∈R1×d and h2a=h2∈R1×d . Cross-attention computation is based on scaled dot-product attention. The attention weight from molecule 1 to molecule 2 is calculated as eq α12=softmax(h1a(h2a)Td) 4 where d serves as a scaling factor to avoid vanishing gradients of softmax caused by excessively large inner products in high-dimensional hidden spaces. The softmax function normalizes weights to the range [0,1], directly reflecting the attention intensity from molecule 1 to molecule 2. The interactive feature of molecule 1 fused with information from molecule 2 is obtained by weighted summation over the features of molecule 2, as shown in eq . h1att=α12h2a 5 Similarly, the attention weight from molecule 2 to molecule 1 and the corresponding interactive feature are computed by eqs and . α21=softmax(h2a(h1a)Td) 6 h2att=α21h1a 7 After computation, the expanded sequence dimension is removed, giving h1att∈Rd and h2att∈Rd as features after cross-attention interaction. Feature Fusion The feature fusion module integrates the two sets of molecular features after cross-attention interaction to generate a global feature embedding that encapsulates intermolecular interaction information. First, h1att and h2att are concatenated along the feature dimension to produce the prefusion feature vector, as shown in eq hcat=[h1att;h2att]∈R2d 8 where [·;·] denotes dimensional concatenation, which fully preserves interactive feature information from both molecules. To reduce the concatenated feature dimension, strengthen nonlinear interactions among features, and apply Dropout regularization to alleviate overfitting, linear transformation and activation are applied to the concatenated features, as shown in eq hint=Droput(ReLU(Winthcat+bint)) 9 where Wint∈Rd×2d is the fusion layer weight matrix and b int ∈ R d is the bias vector. Dropout randomly zeros a fraction of feature values with probability p = 0.1, breaking redundant feature correlations and improving model generalization. The fused feature h int ∈ R d integrates intermolecular interaction information and supports subsequent classification decoding. Classification Decoder The classification decoder maps the fused global feature to a cocrystal prediction score. A single linear layer realizes the mapping from feature space to prediction output, as shown in eq ŷ=Wouthint+bout 10 where Wout∈R1×d is the classification weight matrix, bout∈R1 is the bias vector, and ŷ∈R1 is the raw model output. In the prediction phase, the Sigmoid function maps the raw output to the interval [0,1] to yield the cocrystal formation probability, completing the transformation from feature space to probability space, as shown in eq p(y=1|x1,x2)=σ(ŷ)=11+e−ŷ 11 where y = 1 denotes cocrystal formation and y = 0 denotes no cocrystal formation. This design converts the binary classification task into a probabilistic regression problem, matching the optimization logic of weighted cross-entropy loss and better satisfying practical requirements for cocrystal prediction. Training Process The model is trained end-to-end, with the optimization objective set to minimize the discrepancy between predicted values and ground-truth labels. Stratified data splitting, class weight balancing, and early stopping are jointly used to ensure training stability and generalization performance. The weighted binary cross-entropy loss is adopted to address the class imbalance in the cocrystal data set. The loss is computed as eq L=−1N∑i=1N[w·yi·log(σ(ŷi))+(1−yi)·log(1−σ(ŷi))] 12 where N is the batch size, yi∈{0,1} is the ground-truth label of the i-th sample, and w is the positive sample weight defined as w = N neg/N pos (with N neg and N pos representing the numbers of negative and positive samples, respectively). This weighting balances the contributions of positive and negative samples to the loss and prevents the model from biasing toward the majority class. The Adam optimizer is used with a learning rate of 1 × 10–3 and a weight decay coefficient of 1 × 10–6. Adaptive learning rate adjustment accelerates convergence while mitigating parameter overfitting. For data partitioning, the data set is stratified into training, validation, and test sets at a ratio of 7:1:2 based on cocrystal labels, preserving the class distribution of the original data. The batch size is set to 32 and the maximum training epoch to 50. An early stopping strategy is applied with validation loss as the monitoring metric: training halts and the best-performing model parameters (with minimum validation loss) are restored if no validation loss improvement is observed for 5 consecutive epochs, thus avoiding overfitting. The above hyperparameters serve as the baseline settings in this work. The influence of individual hyperparameters on model performance will be systematically investigated via univariate sensitivity analysis in Section . SHAP The practical value of a cocrystal prediction model depends not only on its prediction accuracy but also on the interpretability and chemical rationality of its decision logic. The end-to-end training paradigm of deep learning models often yields an indecomposable black-box decision process. To reveal the intrinsic prediction logic of the proposed fingerprint cross-attention model and verify the chemical validity of its predictions, the SHAP method is adopted for interpretability analysis in this work. Rooted in cooperative game theory, this approach quantifies the contribution of each input feature to the final model output and is well suited to the Morgan fingerprint-based cocrystal prediction framework. − The mathematical foundation of SHAP is the Shapley value in cooperative game theory. The Shapley value is designed to fairly allocate the total payoff among all participants in a coalition game. In the context of model interpretability, each bit in the Morgan fingerprint acts as a game participant, while the difference between the model prediction and the baseline prediction represents the total payoff from the combined contribution of all features. Let f denote the model prediction function and x the input feature vector, where each element corresponds to one bit of the Morgan fingerprint. The total number of features is denoted as M, consistent with the dimension of the Morgan fingerprint in this work. The baseline prediction f(x0) is defined as the mean model output across all training samples, representing the model’s neutral judgment in the absence of informative feature inputs. For the i-th feature, its contribution to the prediction is computed as the weighted average of marginal contributions over all possible feature subsets. Let S be any feature subset that excludes the i-th feature. The marginal contribution of adding feature i to subset S is the change in model output before and after inclusion. Different subsets are assigned weights based on their permutation probabilities, ensuring fair and consistent allocation of feature contributions. The Shapley value (i.e., SHAP value) ϕ i for the i-th feature is thus calculated by eq ϕi=∑S⊆F\{i}|S|!·(M−|S|−1)!M!·[f(S∪{i})−f(S)] 13 where F is the full set of features, |S| is the cardinality of feature subset S, and M! is the total number of permutations of M features. SHAP values satisfy strict additivity. For any input sample, the deviation of the model prediction from the baseline value equals the sum of SHAP values across all features, as shown in eq . f(x)−f(x0)=∑i=1Mϕi 14 This property guarantees that the model prediction can be fully decomposed into independent contributions from individual features, with no unexplained residual terms, providing a solid mathematical basis for subsequent chemical interpretation. To compute SHAP values efficiently for deep neural networks, the GradientExplainer method is employed. Based on expected gradient theory and the backpropagation mechanism of deep networks, integrated with the SHAP framework, this method enables fast calculation of SHAP values for high-dimensional features. It avoids the exponential computational cost of enumerating all feature subsets and is therefore highly suitable for the high-dimensional Morgan fingerprint inputs used in this work. For each cocrystal sample, SHAP values are computed separately for every bit in the Morgan fingerprints of the two molecules. The magnitude of a SHAP value directly reflects the strength of the corresponding feature bit in influencing cocrystal prediction. A large positive SHAP value indicates that the feature bit drives the model to predict cocrystal formation. Each bit in the Morgan fingerprint can be traced to the local chemical environment of specific atoms in the molecule, including functional groups, heteroatomic sites, aromatic ring systems, hydrogen-bond donors and acceptors, and other structural motifs. These moieties are precisely the core factors that drive bimolecular cocrystal formation through noncovalent interactions. By ranking SHAP values, the most influential feature bits for cocrystal prediction can be identified. By further mapping these high-contribution bits back to their corresponding molecular structural sites, the key structural units responsible for bimolecular cocrystal formation can be located. This procedure converts the black-box decision-making of the deep learning model into a mechanistic structural analysis consistent with organic chemistry principles. It not only validates the chemical rationality of the model’s prediction logic but also provides clear structural guidance for the rational design of cocrystals in future studies. Results and Discussion Data Set A high-quality data set constitutes the fundamental basis for constructing and validating machine learning models for cocrystal prediction. Aiming at the prediction task of binary organic cocrystals, this work establishes a dedicated data set with reliable data sources and unambiguous labels, containing 6697 positive samples and 1039 negative samples. All positive samples are retrieved from the CSD. Multilevel filtering criteria are formulated in accordance with the strict definition of cocrystals, and only cocrystal structures composed of two organic molecules are retained. During the screening procedure, all entries involving non-neutral molecules or solvent molecules are excluded, and crystal records with atomic positional disorder are also eliminated, yielding the final set of valid positive samples. Negative samples are exclusively collected from experimentally validated noncocrystal cases explicitly documented in published academic literature. − In contrast to the common strategy of generating negative samples through computational simulation, this construction approach based on real experimental outcomes maximizes the reliability and scenario representativeness of negative samples and avoids labeling deviations caused by simulated data. The data set employed in this work exhibits an inherent class imbalance between positive and negative samples. This phenomenon stems from the fact that positive samples correspond to cocrystal structures verified by single-crystal X-ray diffraction, which can be acquired in large scale and standardized form from the CSD. By contrast, experimentally validated noncocrystal negative samples are rarely reported in open academic literature. To guarantee the authenticity of the data set and the credibility of annotations, all negative samples in this work are derived from published experimental failure cases, without introducing any unreliable simulated data, thus eliminating the interference of spurious negative samples on model training at the source. To alleviate the negative impacts of sample imbalance on model training, performance evaluation and generalization capability, targeted solutions are designed from three dimensions: data splitting, training adaptation and evaluation system. In the data splitting stage, a stratified sampling strategy is adopted to partition the data set into training, validation and test sets at a fixed ratio, strictly ensuring that the positive–negative sample ratio of each subset is consistent with that of the original data set, so as to avoid model prediction bias induced by subset distribution shift. In the model training stage, class weights are automatically calculated and configured according to the actual numbers of positive and negative samples in the training set, balancing the contributions of the two sample categories in loss calculation and preventing the model from overfitting the majority class while ignoring the feature patterns of the minority class. In the performance evaluation stage, the single accuracy metric is abandoned, and imbalance-adapted metrics such as balanced accuracy (BACC) and specificity are selected to comprehensively measure the model’s balanced recognition ability for cocrystal and noncocrystal samples, preventing distorted evaluation results caused by disproportionate sample sizes. To ensure the standardization of model training and the objectivity of evaluation results, the full data set is divided into training, validation and test sets at a ratio of 7:1:2 using stratified sampling. This stratified partitioning approach ensures that the positive–negative sample ratio within each subset is fully consistent with that of the full data set, avoiding model bias caused by data distribution shift. The training set is used for model parameter optimization and feature learning, while the validation set is applied to hyperparameter tuning and overfitting control during the training process. The test set is completely isolated throughout model training and tuning without participating in any training procedures, and is only used for the final evaluation of model generalization ability. The detailed partitioning results of the data set are shown in Figure . Detailed partitioning of the data set, comprising 6697 positive samples and 1039 negative samples. In addition, to validate the model’s generalization capability on entirely novel molecular systems, an independent external test set was constructed. The data were sourced from cocrystal and noncocrystal systems reported in the literature, and all samples containing molecules present in the main data set were strictly excluded to ensure molecular-level independence. The external test set comprises 672 samples, including 456 positive samples and 216 negative samples. The molecular structural information corresponding to all samples is stored in the standardized SMILES string format, facilitating subsequent programmatic invocation and Morgan fingerprint feature extraction. Experimental Details Experimental Environment All computational tasks, as well as model training and inference, were performed under a unified hardware environment. The operating system was Windows 10. The central processing unit (CPU) was an Intel Core i5–10200H with a base clock speed of 2.40 GHz and a 4-core 8-thread architecture. The graphics processing unit (GPU) was an NVIDIA GeForce RTX 2060 equipped with 6 GB of dedicated video memory, which was used to accelerate deep learning computations. Python 3.10 was employed as the programming language throughout the experiments, with specialized toolkits used for the entire workflow. For chemoinformatics processing, the RDKit library was adopted to parse SMILES strings, standardize molecular structures, and compute Morgan fingerprints as the core input features. The construction, training, and validation of the fingerprint cross-attention deep learning model were fully implemented based on the PyTorch framework. Interpretability analysis was carried out using the SHAP library. To ensure full reproducibility of all experimental results, a fixed random seed of 42 was set for all stochastic operations, including stratified data set splitting, model parameter initialization, and batch shuffling during training. Performance Evaluation Metrics Cocrystal prediction in this work represents a typical binary classification task. Considering the class imbalance between positive and negative samples in the data set, multidimensional evaluation metrics were selected to comprehensively assess the overall performance and generalization ability of the model. The receiver operating characteristic (ROC) curve is plotted with the false positive rate as the horizontal axis and the true positive rate as the vertical axis, which comprehensively displays the classification performance of the model under different decision thresholds. The area under the ROC curve (AUC) provides an integrated quantification of the model’s ability to distinguish between cocrystal and non-cocrystal samples; a value closer to 1 indicates stronger discriminative capability. Accuracy measures the proportion of correctly predicted samples among all samples, directly reflecting the global classification performance of the model. BACC is specifically designed for imbalanced data sets. By averaging the recognition accuracies of positive and negative samples separately, this metric objectively evaluates the model’s balanced classification performance for both classes and effectively avoids inflated metric values caused by the dominance of positive samples. Precision refers to the ratio of true cocrystals among samples predicted as cocrystals. It reflects the reliability of model predictions and is directly related to the trial-and-error cost of subsequent experimental verification; a higher precision indicates stronger reference value for the potential cocrystal combinations proposed by the model. Recall represents the proportion of actual cocrystals that are correctly identified by the model, measuring the model’s ability to discover valid cocrystal systems and avoid missing valuable candidates. The F1 score is the harmonic mean of precision and recall, providing a comprehensive evaluation of the model’s performance in positive sample identification and serving as a core metric for imbalanced data sets. Specificity denotes the proportion of true non-cocrystals that are correctly recognized by the model. This metric reflects the model’s ability to reject invalid molecular pairs and verifies whether the model possesses genuine classification capability rather than simply biasing predictions toward the majority class. The detailed formulas for these metrics are as shown in eqs -. Accuracy=TP+TNTP+TN+FP+FN 15 BACC=12(TPTP+FN+TNTN+FP) 16 Precision=TPTP+FP 17 Recall=TPTP+FN 18 Specificity=TNTN+FP 19 F1score=2×Precision×RecallPrecision+Recall 20 All metrics are calculated based on the counts of four classification outcomes. True positive (TP) denotes the number of actual cocrystals correctly predicted as cocrystals. True negative (TN) denotes the number of actual non-cocrystals correctly predicted as non-cocrystals. False positive (FP) denotes the number of actual non-cocrystals incorrectly predicted as cocrystals. False negative (FN) denotes the number of actual cocrystals incorrectly predicted as non-cocrystals. Model Performance Evaluation A systematic multidimensional performance evaluation was carried out for the fingerprint cross-attention cocrystal prediction model built on Morgan fingerprints. The assessment covered the model’s feature fitting ability, generalization behavior, classification details and robustness, so as to fully validate its practical performance and application value in cocrystal prediction. Fixed Split Data set End-to-end training and inference were implemented based on the stratified data set partitioned in Section . During training, the model converged smoothly with no obvious fluctuation in validation-set performance and no overfitting observed. Figure shows the loss curves of the training and validation sets. The model adopted an early stopping strategy monitored by validation loss; training was halted when the validation loss did not decrease for 5 consecutive epochs. The validation loss reached its minimum at epoch 7, subsequently entered a plateau, and training terminated at epoch 12, with the optimal model parameters loaded to effectively avoid overfitting risks. After training, full sets of performance metrics were computed separately on the training set, validation set and independent test set, as listed in Table . Loss curves of the training set and the validation set. 1Performance of the Model on the Partitioned Data Setsdata setAUCaccuracyBACCprecisionrecallspecificityF1 scoretraining0.99960.98930.99381.00000.98761.00000.9938validation0.99700.97800.98330.99850.97610.99040.9872test0.98780.97090.95070.98790.97840.92310.9831external0.98110.96790.94580.98480.97730.91430.9810 Performance of the Model on the Partitioned Data Sets As can be seen from the table, the model achieves nearly ideal performance on the training set, with an AUC of 0.9996 and both BACC and F1 score exceeding 0.99. This demonstrates that the model can adequately capture the molecular structural features encoded in Morgan fingerprints and the underlying rules of cocrystal formation. Performance on the validation set remains highly consistent with that on the training set, with only a slight drop across all metrics. This result confirms that the model does not suffer from overfitting during training, retains strong classification ability for validation data not used in parameter updates, and exhibits a stable and well-behaved convergence process. The independent test set is completely held out from the training pipeline and thus best reflects the model’s genuine generalization capability. On the test set, the model achieves an AUC of 0.9878, an overall accuracy of 0.9709, and a BACC of 0.9507. Given the inherent class imbalance in the data set, the high BACC is especially significant, as it shows the model does not favor the majority positive class and maintains balanced recognition for both cocrystal and noncocrystal samples, effectively alleviating prediction bias caused by imbalanced data. The model yields a precision of 0.9879 and a recall of 0.9784 on the test set. High precision implies that most molecular pairs predicted as cocrystals correspond to real, valid cocrystal systems, greatly reducing the trial-and-error cost of subsequent experimental verification. High recall indicates that the model identifies nearly all real cocrystal combinations and rarely misses valuable candidate systems. Meanwhile, the model achieves a specificity of 0.9231, showing strong discrimination for noncocrystal negative samples and further verifying the reliability of its classification performance. On the external test set, the model achieved an AUC of 0.9811, with an overall accuracy of 0.9679 and a BACC of 0.9458. The precision, recall, and F1 score remained above 0.98, while the specificity reached 0.9143. These results demonstrate that the model maintains robust discriminative capability on molecular systems completely independent of the training data, further confirming its generalization potential in practical applications. To visualize the classification behavior of the model more intuitively, the distribution of prediction outcomes across the three data sets was counted to generate corresponding confusion matrices, as shown in Figure . Confusion matrices of the F-CAT model on the (a) training set, (b) validation set, and (c) test set. The statistics from the confusion matrices align well with the quantitative performance metrics reported above. On the training set, the model produces zero false positives (no noncocrystals are misclassified as cocrystals) and only 58 false negatives, meaning nearly all true cocrystals are correctly identified. On the validation set, the model records just 1 false positive and 16 false negatives, maintaining exceptional classification precision and further confirming the stability of the training process. On the test set, the model yields 16 false positives and 29 false negatives. Out of 208 noncocrystal negative samples, 192 are correctly classified with only 16 misidentifications. Among 1340 cocrystal positive samples, 1311 are correctly recognized, representing a very low miss rate. This result demonstrates that the model retains high recognition accuracy for both positive and negative samples on completely unseen test data. It neither generates excessive false-positive cocrystal predictions nor overlooks effective cocrystal systems, fully satisfying the practical requirements of cocrystal screening. The ROC curve is a standard visualization for evaluating the discriminative power of binary classification models. Based on the model’s inference outputs on the independent test set, the corresponding ROC curve was plotted, as shown in Figure . ROC curve of the model on the test set. The curve is plotted with false positive rate on the horizontal axis and true positive rate on the vertical axis. The diagonal reference line for random guessing and the corresponding AUC value of the model are also marked. The model’s ROC curve lies consistently close to the upper-left corner of the coordinate system, far above the random-guessing diagonal. This indicates that the model maintains strong discrimination between cocrystal and noncocrystal samples across all classification thresholds. Even at very low false positive rates, the model sustains a high true positive rate, a property well matched to the needs of cocrystal screening. In practical cocrystal development, researchers typically aim to identify as many valid cocrystal combinations as possible while controlling false predictions, and the proposed model fully meets this operational requirement. Cross Validation Results from a single data set split may be affected by randomness. To comprehensively validate the model’s robustness and generalization ability while eliminating bias from data partitioning, stratified 3-fold, 5-fold, and 10-fold cross-validation experiments were conducted. Stratified sampling ensures that the positive–negative sample ratio in each fold matches that of the full data set, preventing performance distortion caused by distribution shift. Detailed results for cross-validation with different fold numbers are presented respectively in Tables , , and . The results are presented in the form of mean ± standard deviation. 2Model Performance in 3-Fold Cross-Validationdata setAUCaccuracyBACCprecisionrecallspecificityF1 scoretraining0.9999 ± 0.00010.9948 ± 0.00110.9963 ± 0.00060.9997 ± 0.00040.9943 ± 0.00160.9982 ± 0.00260.9970 ± 0.0006validation0.9899 ± 0.00060.9698 ± 0.00200.9485 ± 0.01380.9874 ± 0.00540.9776 ± 0.00780.9194 ± 0.03540.9825 ± 0.0013test0.9823 ± 0.00280.9662 ± 0.00220.9284 ± 0.00990.9809 ± 0.00380.9801 ± 0.00610.8766 ± 0.02550.9805 ± 0.0014 Model Performance in 3-Fold Cross-Validation 3Model Performance in 5-Fold Cross-Validationdata setAUCaccuracyBACCprecisionrecallspecificityF1 scoretraining0.9997 ± 0.00030.9933 ± 0.00210.9955 ± 0.00130.9998 ± 0.00030.9925 ± 0.00250.9985 ± 0.00160.9961 ± 0.0012validation0.9912 ± 0.00260.9706 ± 0.00430.9530 ± 0.00800.9889 ± 0.00340.9770 ± 0.00770.9290 ± 0.02230.9829 ± 0.0026test0.9826 ± 0.00200.9650 ± 0.00460.9323 ± 0.00780.9825 ± 0.00280.9770 ± 0.00670.8875 ± 0.01890.9797 ± 0.0028 Model Performance in 5-Fold Cross-Validation 4Model Performance in 10-Fold Cross-Validationdata setAUCaccuracyBACCprecisionrecallspecificityF1 scoretraining0.9997 ± 0.00010.9909 ± 0.00440.9941 ± 0.00250.9997 ± 0.00020.9897 ± 0.00520.9984 ± 0.00160.9947 ± 0.0026validation0.9913 ± 0.00280.9686 ± 0.01100.9565 ± 0.01240.9905 ± 0.00310.9731 ± 0.01170.9398 ± 0.01950.9817 ± 0.0065test0.9823 ± 0.00330.9614 ± 0.00620.9324 ± 0.00770.9832 ± 0.00310.9720 ± 0.00920.8928 ± 0.02100.9775 ± 0.0037 Model Performance in 10-Fold Cross-Validation Cross-validation results show that the model maintains consistently excellent performance across different fold setups. In all experiments, test-set AUC values remain above 0.98, accuracy above 0.96, and the standard deviations of all metrics are extremely low. This indicates that the model’s performance does not depend on a particular train–test split; it possesses strong robustness and stability, with no significant performance degradation caused by minor variations in training data. It is noteworthy that the specificity on the test set in cross-validation is slightly lower than that of the fixed main test set. This discrepancy primarily arises from the fact that each fold in cross-validation contains only approximately 200 negative samples; the limited number of minority-class samples makes the classification boundary more sensitive to the randomness of data partitioning, leading to fluctuations in negative-sample recognition performance. Nevertheless, the model retains effective discriminative ability for negative samples across all folds, and the overall generalization performance remains robust. The stable outcomes from multifold cross-validation further confirm the model’s generalization ability. Even across multiple randomly partitioned data sets, the model retains uniformly high classification accuracy, proving that it learns generalizable rules of cocrystal formation rather than memorizing specific training samples. This provides reliable performance support for applying the model to cocrystal prediction in novel molecular systems. Model Comparison To objectively verify the performance advantages of the fingerprint cross-attention model proposed in this work, a horizontal comparison was carried out with mainstream classical models, covering both traditional machine learning and basic deep learning methods, including decision tree, k-nearest neighbor, random forest, and multilayer perceptron. The experimental procedures and data basis for all comparative models were kept completely consistent with those of the proposed model. The same stratified partition was used for the training, validation, and test sets, with the test set isolated throughout and only employed for final performance evaluation. A grid search strategy was adopted to systematically optimize the hyperparameters of each comparative model, ensuring that all models reached their optimal performance and maximizing the fairness and objectivity of the comparison experiments. The comprehensive performance comparison results of all models on the independent test set are displayed in Figure . Comparison of core performance metrics of different models on the independent test set. The minimum value of the vertical axis is set to 0.50 for a clearer comparison of performance differences across models. Among traditional machine learning models, the decision tree delivers the weakest overall performance. Its core metrics rank the lowest among all models, reflecting limited generalization ability and failure to adequately capture the complex correlations between molecular structural features and cocrystal formation. The k-nearest neighbor model shows a noticeable performance improvement over the decision tree, maintaining relatively high overall accuracy and AUC, yet still presents obvious shortcomings in BACC and specificity, with insufficient capability to identify noncocrystal negative samples. The random forest model exhibits outstanding performance in AUC and recall, even slightly outperforming the proposed model, which benefits from the strong fitting ability of ensemble learning for the majority positive samples. However, its BACC and specificity are relatively poor among all comparative models, indicating obvious prediction bias toward positive samples on the class-imbalanced data set. To cover more real cocrystal samples, it misclassifies a large number of noncocrystal negative samples as cocrystals, which would result in numerous invalid experimental trials and substantially raise the trial-and-error cost in practical cocrystal screening. As a basic deep learning model, the multilayer perceptron outperforms most traditional machine learning models in overall performance. Its AUC and overall accuracy are close to those of the proposed model, and its BACC and specificity are significantly improved compared with the random forest. Nevertheless, the multilayer perceptron only learns bimolecular information through simple feature concatenation and fully connected layers, failing to specifically capture the interaction features between the two molecules and inadequately learning the key correlation information that governs cocrystal formation, leaving considerable room for improvement in its overall performance. The model proposed in this work ranks first among all comparative models in BACC, specificity, precision, and F1 score. In particular, its BACC far exceeds that of other models, demonstrating that the model effectively alleviates prediction bias caused by class imbalance in the data set and achieves balanced and excellent recognition for both cocrystal and noncocrystal samples. The highest specificity indicates the strongest ability to exclude invalid noncocrystal combinations, minimizing unnecessary experimental workload and perfectly meeting the practical requirements of cocrystal screening. Meanwhile, the model maintains top-tier AUC and recall, without sacrificing the detection performance of positive samples to enhance the recognition of negative samples, thus striking a desirable balance between accurately identifying valid cocrystals and efficiently eliminating invalid combinations. Compared with the random forest model, F-CAT achieves a better balance between precision and recall, with higher F1 score and specificity at the cost of only a marginal 0.5% decrease in recall. In resource-limited experimental screening, the cost savings brought by improved specificity (reducing false positives) are practically more valuable than the slight recall advantage of random forest, because avoiding dozens of invalid experimental syntheses is less costly than missing a small number of true-positive combinations. Such comprehensive performance advantages derive from two key design strategies. First, the use of Morgan fingerprints as input features provides comprehensive and stable molecular structural information, laying a solid foundation for feature learning. Second, the introduction of the cross-attention mechanism enables the model to precisely capture feature interaction relationships between two molecules and focus on the key structural features governing cocrystal formation, rather than simply fusing bimolecular information. This allows the model to not only learn the general rules of cocrystal formation but also effectively distinguish the core differences between cocrystal and noncocrystal systems, ultimately achieving an all-round improvement in comprehensive performance on real-world class-imbalanced data sets. Sensitivity Analysis To systematically evaluate the adaptability of the fingerprint cross-attention model to key hyperparameters and verify the rationality of the optimal hyperparameter settings adopted in this work, a univariate sensitivity analysis was performed. All other hyperparameters were kept identical to those of the baseline model throughout the experiments, with only the value of the target hyperparameter adjusted individually. The AUC, accuracy and BACC on the independent test set were used as evaluation metrics to quantify the influence of hyperparameter variations on the overall model performance. The performance trends corresponding to all hyperparameters are presented in Figure . Performance variation trends for all hyperparameters. For clear visualization of performance fluctuations under different parameter settings, the minimum value of the vertical axis is uniformly set to 0.90. The red line represents AUC, the light-colored bar on the left denotes accuracy, and the dark-colored bar on the right stands for BACC. The hyperparameters used in this study are indicated with underlines on the horizontal axis. The figure consists of seven subplots corresponding sequentially to (a) the environment radius of Morgan fingerprints, (b) the hidden layer dimension of the fingerprint encoding layer and cross-attention module, (c) dropout rate, (d) batch size, (e) learning rate, (f) weight decay coefficient, and (g) random seed. Overall, the core performance of the model remains stable when all hyperparameters are adjusted within reasonable ranges, with AUC consistently maintained at a high level. No abrupt performance degradation is observed upon minor hyperparameter adjustments, demonstrating the strong robustness and practical application adaptability of the model. A clear optimal value exists for the Morgan fingerprint environment radius, which reaches the performance peak under the baseline settings. An excessively small radius fails to fully cover key structural and functional group information on molecules, while an overly large radius introduces excessive redundant features and weakens feature discriminability. The hidden layer dimension, batch size and learning rate also exhibit distinct optimal value ranges, and the parameters adopted in the baseline model all lie at the performance peaks. When deviating from the optimal values, the BACC of the model decreases most significantly, indicating that these parameters directly affect the model’s balanced recognition ability on class-imbalanced data sets. The dropout rate and weight decay coefficient have a wider adaptive range, maintaining excellent overall performance within a broad interval and only showing obvious performance degradation when values exceed reasonable bounds. The baseline settings effectively balance the fitting capacity and generalization ability of the model, further validating the scientificity and rationality of the hyperparameter configurations in this work. Furthermore, to verify the stability of model performance against random initialization, the influence of different random seeds was supplemented in the sensitivity analysis. Changing the random seed, the AUC, accuracy, and BACC of the model remained stable. This demonstrates that the performance advantage of the model does not stem from accidental results of a specific random initialization, but from the intrinsic effectiveness of Morgan fingerprint features and the cross-attention structure, satisfying the core reproducibility requirements of deep learning research. The sensitivity analysis not only identifies the optimal value ranges of key hyperparameters but also comprehensively verifies the robustness and versatility of the model. The core performance of the model is highly tolerant to hyperparameter variations, retaining stable and superior prediction performance over a wide adjustment range. This indicates that the model’s performance advantages stem not from refined hyperparameter tuning, but from the strong representational capability of Morgan fingerprint features and effective feature interaction learning via the cross-attention mechanism. The most pronounced fluctuation in BACC when hyperparameters deviate from optimal values further confirms that the core value of hyperparameter optimization lies in mitigating prediction bias caused by class imbalance and improving the model’s balanced recognition for positive and negative samples. The parameter adaptation laws obtained from this analysis also provide clear guidance for transferring the model to data sets of different scales and diverse application scenarios, further lowering its practical application threshold. It also establishes a stable and reliable foundation for the targeted screening of cocrystals for specific pharmaceutical and functional material systems in future work. Ablation Experiment To clarify the actual contribution of each key module in the fingerprint cross-attention model to cocrystal prediction performance, ablation experiments were conducted. By making targeted modifications to the model architecture and comparing model performance under different structural settings, the necessity and effectiveness of critical designs including the cross-attention mechanism, feature fusion schemes, and regularization modules were verified. The training pipeline, hyperparameter settings, and data set partitioning for all experimental groups remained completely consistent with those of the baseline model. To ensure the reliability and reproducibility of experimental results, each experimental group was independently repeated three times with fixed random seeds of 42, 43, and 44, respectively. The final results were reported as the average of the three runs to eliminate interference from random factors. The specific group settings for the ablation experiments are listed in Table . Seven performance metrics including AUC were adopted to compare the overall performance of all experimental groups on the independent test set, with the results displayed in Figure . 5Groups in Ablation Experimentsgroupspecific modificationBaselineOriginal model without any modificationA1Directly use the encoded original features and skip the attention calculationA2Replace the cross-attention module with simple element-wise additionA3Replace the cross-attention module with simple element-wise multiplicationA4Concatenate bimolecular features, reduce dimension via a linear layer, and substitute self-attention for cross-attentionA5Substitute self-attention for cross-attention, focusing only on the fingerprint features of each molecule itselfA6Directly concatenate bimolecular features followed by Dropout, with the input dimension of the classification layer adjusted accordinglyA7Replace feature concatenation with element-wise addition and skip the LT_int linear transformation layerA8Replace feature concatenation with element-wise multiplication and skip the LT_int linear transformation layerA9Remove the Dropout regularization operation from the modelA10Apply Dropout in the feature encoderA11Apply Dropout in the cross-attention moduleA12Apply Dropout in both the feature encoder and the cross-attention module Groups in Ablation Experiments Performance comparison of each ablation group. The minimum value of the vertical axis is set to 0.86 for a clearer visualization of subtle performance differences among groups. All experimental groups maintain stable classification performance on the test set, with small gaps in overall performance across groups. This result further confirms the remarkable advantages of using Morgan fingerprints as model input features. Morgan fingerprints can stably and comprehensively extract structural and chemical property information on molecules, providing a solid and reliable feature foundation for the model. Even with modifications to the core architecture, the model still retains basic cocrystal recognition capability. Experimental groups A1–A5, in which the attention calculation is skipped, the attention mechanism is replaced by simple element-wise operations, or cross-attention is substituted with self-attention, all show varying degrees of performance degradation. This demonstrates that the cross-attention module can effectively capture intermolecular interaction features and serves as the core component for performance improvement. Experimental groups A6–A8 with modified feature fusion schemes and skipped linear transformation layers also exhibit slight performance declines, verifying the rationality of the feature fusion and linear transformation design in the original model, which integrates bimolecular feature information more efficiently. For experimental group A9 with Dropout removed, the most significant drops occur in BACC and specificity, indicating that Dropout regularization effectively improves model generalization, mitigates overfitting, and enhances the model’s ability to identify minority negative samples. Experimental groups A10–A12, which applied Dropout at different positions, showed that adding Dropout to the feature encoder or the cross-attention module led to insufficient learning of key molecular features, which instead reduced model generalization and negative-sample recognition accuracy. This verifies the rationality of the regularization setting adopted in this work. Overall, the baseline model achieves the best performance across all evaluation metrics, with the highest AUC and BACC among all groups. This indicates that the core architectural design of the baseline model effectively addresses the class imbalance of the data set, realizes balanced recognition of both cocrystal and noncocrystal samples, and successfully avoids prediction bias toward the majority class. The baseline model also yields the highest specificity among all groups, reflecting its strongest ability to exclude invalid noncocrystal combinations. This further validates that the model possesses genuine bidirectional classification capability, rather than achieving inflated overall classification performance simply by biasing predictions toward positive samples. Explainable Analysis The practical application value of a cocrystal prediction model depends not only on its prediction accuracy but also on the interpretability and chemical rationality of its decision logic. To break the black-box nature of deep learning models and clarify the core basis on which the F-CAT model generates cocrystal predictions from Morgan fingerprints, a systematic interpretability analysis was performed using the SHAP method. This approach quantifies the contribution of each Morgan fingerprint bit to the final model prediction, where a higher contribution indicates that the corresponding bit is more favorable for promoting cocrystal formation. Eight representative cocrystal samples were selected for analysis, covering various typical cocrystal systems including aromatic heterocycles, highly substituted functional groups, and hydrogen-bond donor/acceptor-enriched structures. The results are presented in Figure . Each sample corresponds to two sets of analytical content: the left panel shows the top eight Morgan fingerprint bits ranked by contribution to cocrystal prediction, and the right panel displays the top three contributing sites highlighted on the molecular structures of the two components. SHAP interpretability analysis results for eight representative cocrystal samples, four positive and four negative. For each sample, the left panel shows a bar chart of the top six contributing Morgan bits, and the right panel shows structure highlighting of the top three contributing sites in the two molecules, with yellow regions marking the key contributing sites. Overall, the interpretability analysis clearly reveals the intrinsic prediction logic of the F-CAT model. For positive samples, the high-contribution sites identified by the model are all well-recognized critical interaction sites in the field of organic cocrystals, covering core structural motifs such as hydrogen-bond donors/acceptors, aromatic conjugated systems, and polar substituted functional groups. For negative samples, the model assigns high contribution values to functional groups that are chemically similar to hydrogen-bond donors/acceptors, indicating that the model’s judgment is chemically interpretable rather than a random data set bias. The comparative SHAP analysis of positive and negative samples demonstrates that the model does not learn inherent biases of the data set, but genuinely captures the chemical structural rules that drive or hinder cocrystal formation. The model can simultaneously capture the key interaction sites of both molecular components and precisely match their intermolecular interaction complementarity, further verifying the effectiveness of the cross-attention mechanism in learning bimolecular feature interactions. These analytical results not only confirm the chemical rationality and reliability of the model’s predictions, but also provide clear guidance for the rational design and targeted screening of cocrystal molecules based on key interaction sites in future research. Discussion We conducted a full-chain investigation of the F-CAT cocrystal prediction model, spanning data foundation construction, performance validation, and mechanistic dissection, and fully elucidated the core advantages and application value of the model. For data set construction, we abandoned the widely adopted industry practice of using simulated negative samples and exclusively employed experimentally validated noncocrystal data. Combined with a stratified sampling strategy for data set partitioning, this approach mitigated the interference caused by data bias and class imbalance at the source, providing an authentic and reliable data foundation for model training. The model maintains stable and excellent generalization ability in both the fixed partitioned data set and multifold cross-validation. Horizontal comparison with mainstream classical models showed that the model comprehensively outperformed traditional machine learning and basic deep learning models in overall performance, with its core advantages originating from the accurate capture of bimolecular interaction features. Sensitivity analysis demonstrated that the model’s performance advantages do not stem from refined hyperparameter tuning, but from the rational design of its core architecture, endowing it with strong versatility and transfer potential. Ablation experiments clearly quantified the actual contribution of each core module in the model, verified the pivotal role of the cross-attention mechanism in bimolecular feature interaction learning, and further corroborated the strong representational capability of Morgan fingerprints as input features. The interpretability analysis breaks the black-box nature of the deep learning model and clarifies the intrinsic logic of its predictions. SHAP analysis results revealed that the high-contribution sites focused on by the model are all structural units associated with cocrystal formation, consistent with the fundamental chemical principles governing organic cocrystal formation. These results not only validate the chemical rationality of the model’s prediction outcomes, but also provide researchers with insights into the molecular mechanism of cocrystal formation, offering clear guidance for the rational design and targeted screening of cocrystal molecules in subsequent research. This study still has the following limitations that need to be clarified. First, the data set exhibits a natural class imbalance problem; the number of negative samples is far smaller than that of positive samples, and the chemical diversity of negative samples still needs improvement. This leads to an approximately 8% performance gap in specificity between the training set and the test set, and is also the main reason for the specificity fluctuation in cross-validation. Second, this study has not carried out prospective experimental validation, that is, synthesizing and experimentally characterizing novel cocrystal systems based on model predictions, which is the core focus of future work. Finally, the current model is only applicable to binary organic cocrystal systems and cannot be directly extended to complex cocrystal systems containing metal ions, solvent molecules, or multiple components. Conclusions Aiming at the critical challenges in the field of cocrystal prediction, this work establishes an end-to-end cocrystal prediction framework using Morgan fingerprints as the core molecular representation and based on a bidirectional cross-attention mechanism, and completes a full workflow investigation ranging from high-quality data set construction and model design to multidimensional performance validation and interpretability dissection. The framework developed in this work presents multidimensional advantages over existing cocrystal prediction methods. All noncocrystal negative samples are derived from experimentally validated results in published literature, which avoids labeling bias caused by simulated data at the source. The model maintains stable generalization ability in both the independent test set and cross-validation experiments. The SHAP-based interpretability analysis can trace the model’s prediction results back to specific structural sites of molecules, endowing the black-box decision-making with clear chemical rationality. This work provides a new paradigm that balances prediction accuracy and interpretability for the field of cocrystal prediction, and establishes a benchmark reference for research on related computational methods. Meanwhile, the model enables high-throughput rapid prediction of cocrystal combinations, which can effectively reduce the time and cost of traditional trial-and-error experiments, and serves as a reliable prescreening tool for cocrystal research and development in pharmaceuticals, functional materials and other related fields. Nevertheless, this work still has certain limitations. The current data set suffers from class imbalance; the number and chemical diversity of negative samples still need to be improved. Prospective experimental validation of the model’s actual predictive effect has not been carried out. The model is only applicable to binary organic cocrystal systems. Future research will expand the standardized, experimentally validated cocrystal data set and extend the model’s adaptability to complex cocrystal systems. Ultimately, a user-friendly visual prediction tool will be developed to promote the practical implementation and application of the proposed method.