## 2 Materials and Methods  
### Datasets  
Protein sequence data with GO annotations for japonica, indica, maize, and wheat were obtained from the UniProtKB-SwissProt database. All protein data in the UniProtKB-SwissProt database were carefully verified through a literature review and computer tools [20], providing high-quality grain protein data for this experiment. The corresponding grain protein structure data predicted by AlphaFold2 were obtained from the AlphaFold Protein Structure Database [21]. Simultaneously, the gene ontology's OBO format data were obtained from [[https://geneontology.org/docs/download-ontology/](https://geneontology.org/docs/download-ontology/)]([https://geneontology.org/docs/download-ontology/](https://geneontology.org/docs/download-ontology/)) (accessed on 2 October 2023), and the gene ontology hierarchy was parsed.  
Gene ontology annotation is widely used as a classification scheme for protein function prediction [22]. To describe the biological concepts of protein function, protein function categories were organized into three sub-ontologies: molecular function, biological process, and cellular component. Several GO terms can be used to annotate proteins. For each grain protein dataset, separate datasets were constructed for MF, BP, and CC sub-ontologies in the initial data preprocessing stage based on previous studies. Some proteins only possess functions that belong to a specific ontology. Real-path rules are used to propagate annotations in the GO hierarchy; i.e., if a protein is annotated with a specific GO term, then the ancestor terms of that term are also used for protein annotation. If a protein contains GO term annotations from three sub-ontologies, it is simultaneously included in the MF, BP, and CC sub-ontology datasets. To reduce GO term sparsity, we filtered out GO categories annotated with fewer than a certain threshold number of proteins from each dataset. Protein sequences with a length greater than 1002 or ambiguous amino acid codes (B, O, J, U, X, and Z) were discarded.  
The processed dataset was randomly divided into a training set (80%) and a test set (20%). Then, 80% of the training data were used to train the model, whereas 20% were used to evaluate the trained models and select the best one. The test set was used to evaluate the performance of the final model and assess the generalized ability of the model on unseen data. The number of proteins in the four-grain protein datasets is listed in Table 1.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{2}{c}{**Sub-**} & \multirow{2}{*}{**Training Samples**} & \multirow{2}{*}{**Validation Samples**} & \multirow{2}{*}{**Test Samples**} & \multirow{2}{*}{**Total**} & \multirow{2}{*}{**Number of Classes**} & \multirow{2}{*}{**GO Filtering Threshold**} \\  & & & & & & & \\ \hline \multirow{3}{*}{Japonica} & MF 1  & 2157 & 540 & 675 & 3372 & 121 & \\  & BP 2  & 2067 & 517 & 646 & 3230 & 254 & 50 \\  & CC 3  & 2085 & 522 & 652 & 3259 & 59 & \\ \hline \multirow{3}{*}{Indica} & MF & 260 & 65 & 82 & 407 & 52 & \\  & BP & 68 & 17 & 22 & 107 & 28 & 10 \\ \cline{1-1}  & CC & 192 & 48 & 61 & 301 & 28 & \\ \hline \multirow{3}{*}{Maize} & MF & 254 & 64 & 80 & 398 & 48 & \\ \cline{1-1}  & BP & 76 & 20 & 25 & 121 & 31 & 10 \\ \cline{1-1}  & CC & 152 & 38 & 48 & 238 & 27 & \\ \hline \multirow{3}{*}{Wheat} & MF & 131 & 33 & 42 & 206 & 56 & \\ \cline{1-1}  & BP & 37 & 10 & 12 & 59 & 29 & 5 \\ \cline{1-1}  & CC & 61 & 16 & 20 & 97 & 27 & \\ \hline \hline \end{tabular}
\end{table}
Table 1: The number of samples in each of the four-grain protein sub-ontology datasets.