# Grading Algorithm for Orah Sorting Line Based on Improved ShuffleNet V2
## 2 Materials and Methods
### Data Collection and Processing  
This study collected 60 kg of Orah samples from Wuming County, Nanning, Guangqi, a major production area for Orah. Before entering the sorting line, the Orah fruits were cleaned and dried using specialized washing machinery to remove surface dust and impurities. To replicate the actual imaging conditions of the visual sorting line, fixed lighting and integrated cameras were used for image acquisition. This ensured that the captured images accurately reflected the operational environment. The Orah samples were repeatedly fed into the sorting line, and a self-developed program based on the Hikrobot camera SDK was used to automatically transmit and save the images to a PC. From each captured image, 10 smaller images containing individual Orahs were cropped, resulting in a total of 19,982 Orah images. In addition, 5632 images of empty fruit cups were obtained for the purpose of identifying empty fruit cups. Skilled sorting workers were invited to classify the individual images into Grade A, B, and C, following the standards shown in Table 1. Representative images of each grade are illustrated in Figure 5.  
To improve fitting accuracy, enhance the model's generalization ability, and reduce overfitting, this experiment employed data augmentation techniques to expand the training dataset. The dataset was initially split, with 80% allocated to the training set and the remaining 20% to the validation set. Data augmentation was applied to the training set using methods such as adjusting brightness and contrast, random rotation, vertical flipping, horizontal flipping, and random scaling transformations. In the training set, data augmentation was uniformly applied to the three grades. The \"empty fruit cup\" category, representing the black background image, already contained sufficient features and thus  
\begin{table}
\begin{tabular}{c c} \hline
**Grade** & **Appearance Features** \\ \hline Grade A & The fruit has a uniform shape and consistent color, smooth skin, and no signs of rot, sunburn, black spots, or mechanical damage. \\ \hline Grade B & The fruit has a relatively uniform shape; over 75\% of the fruit surface exhibits consistent coloring; the fruit skin is relatively smooth, with no mechanical damage. A single fruit is allowed to have sunburn covering no more than 10\% of its surface, scars within 1 mm in width, or black spots within 1 mm in diameter. \\ \hline Grade C & Deformed fruit; uneven coloring; mold or mechanical damage; and relatively severe defects such as sunburn, scars, and black spots. \\ \hline \end{tabular}
\end{table}
Table 1: Orah grading standards.  
Figure 4: Overview of the sorting line. (**a**) Single-line conveyor and image acquisition chamber; (**b**) grading execution device.  
was not augmented. The test set was not augmented to accurately reflect the model's generalization performance. Table 2 presents the distribution of the expanded dataset, and an example image processed using different data augmentation methods is shown in Figure 6.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Category** & **Original Image Count** & **Image Count After Data Augmentation** \\ \hline Grade A & 6322 & 31,607 \\ Grade B & 5100 & 25,500 \\ Grade C & 8560 & 42,800 \\ Empty fruit cup & 5632 & 5632 \\ \hline Total & 25614 & 105,539 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Distribution of Orah appearance grade dataset.  
Figure 5: Samples of three grades of Orah.