# Intelligent Classification of Japonica Rice Growth Duration (GD) Based on CapsNets
## 3 Results and Discussion
### Discussion of the Description Results  
The GD of rice is related to the amylum content in grains [52; 53]. Referring to the results of Raman spectral correlation analysis, it can be seen that the effective band range of rice mainly concentrates in the region of 200-1800 cm\({}^{-1}\) and 2800-3200 cm\({}^{-1}\)[54; 55]. In this experiment, wave crests were extracted from Raman spectral data of samples at GD stage by signal.flitfilt-difference method. In combination with the Raman spectral correlation analysis of rice, seven wave crests were extracted, and the attributed substances were amylum and sugar [48; 56], with amylum being the aggregation of sugar molecules [57; 58]. The spectral characteristic frequency of the same species with different attributes had different offsets, i.e., the spectral crest image had different offsets [59]. In this experiment, 1/2 of each wave crest was selected for segmentation, in order to extract the characteristic information of the wave crest offset of each sample. The same species owned a wave crest at the same Raman shift, but the wave crest starts, ends, and peaks of samples with different attributes were different [48; 59]. In this experiment, 1/4 and 3/4 of each wave crest were selected for segmentation processing, in order to extract the characteristic information of the start, end, and peak intensity of each sample. In view of this, the seven wave crests extracted from each sample and the characteristic information selected by the segmentation method for each wave crest in this experiment provided a basis for the classification of biological characteristics of rice GD. The capsule network suitable for small datasets is improved by modifying the dynamic routing protocol. Agreement routing imitates hierarchical communication of information across neurons in human brains that are responsible for perception and understanding [43]. For each potential parent, the capsule network can increase or decrease the connection strength by dynamic routing, which is more effective than primitive routing strategies, such as max pooling in CNNs [60]. Considering the number of samples (233) in this experiment, we used a full-link routing protocol. In other words, the output was routed to all possible parents. Table 3 shows that in the small sample set, when the training cycles were 110-160 and the loss function was 0.1014-0.1239, the training set and test set had the highest performance: 89% and 93%, respectively. In the few-shot task (Figure 10), the samples are regarded as parts, the classes are regarded as the whole, and the class representation encoded by the dynamic routing algorithm is more representative [61]. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Serial** & **Training Epochs** & **Value of Loss Function** & **Accuracy of Training Datasets** & **Accuracy of Test Datasets** \\ \hline
1 & 110 & 0.1148 & 84 & 91 \\
2 & 112 & 0.1239 & 84 & 91 \\
3 & 126 & 0.1111 & 86 & 91 \\
4 & 133 & 0.1181 & 86 & 93 \\
5 & 137 & 0.1194 & 85 & 91 \\
6 & 139 & 0.1157 & 86 & 91 \\
7 & 149 & 0.1076 & 88 & 91 \\
8 & 150 & 0.1074 & 88 & 93 \\
9 & 155 & 0.1101 & 88 & 91 \\
10 & 160 & 0.1014 & 89 & 91 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The training cycles and loss function values with high accuracy were obtained by the CapsNets model. Overfitting is already an unavoidable problem in machine deep learning on small sample datasets, which can be solved from three aspects: training data, training process, and model structure [62]. Dataset enhancement based on image transformation can effectively improve the overfitting problem of image classification models [63], but the two-dimensional data in this experiment were generated through data transformation, so this method was not applicable. The generation of the overfitting problem is closely related to the training process. As shown in Figure 11, during the training process, the model experienced underfitting (epoch less than 120) to overfitting (epoch greater than 170).