## 3 Proposed Deep-Learning-Based Defective Bean Inspection Scheme (DL-DBIS)
The GALDAM is the heart of the labor-efficient deep learning-based system shown in Figure 3. Assume a human-labeling training bean image contains each class of defective beans (14 classes in this work), placed sparsely for easily labeling. Thus, only limited data labeling effort is required. The idea of the GALDAM is to augment sufficient amount of training images by using the limited human-labeling bean images with the GAN methodology. To ensure effectiveness of defect inspection capacity, GALDAM also checks whether the generated model is qualified for defective bean inspection. The overall architecture is presented in this section, and related key mechanisms are described in the next sections. Figure 4 shows the architecture and workflow of the proposed GAN-based automated labeled data augmentation method (GALDAM) based on the above-mentioned design philosophy. Assume a user labels only a few amounts of sparse defective bean images, each of which includes one defective class shown in Figure 1. Thus, all defect classes can be collected (label 0 for normal beans, labels 1\(\sim\)13 for different kinds of defective beans). Implementing the proposed GALDAM has to include six main modules. The first is _labeled-bean image database (LBIDB)_, which stores the labeled bean images for training the optimal model of the defect-sensitive inspection deep network (DIDN). The DIDN is the key to the defect-sensitive model creation (DSMC) module and the detailed structure will be discussed in details in Section 4.1. The second is _DSMC module_, which is designed for creating a defect-sensitive model for the DIDN with inputs, including the human-labeling images (_IMG\({}^{HL}\)_ and _L\({}^{HL}\)_) and the augmented images. The third is _GAN-based image-augmentation model  
generation (GIMG) module_, which is designed for creating a generative network model for a neural network called the bean-shifting deep network (BSDN). The fourth is _low-detection-rate bean image generation (LBIG) module_, which is designed for generating the augmented labeled defective bean image set. The fifth is _augmented-image qualify check (AIQC) module_, which is designed for verifying whether the augmented labeled bean image set \(IMG^{LBIG}\) is qualified for being used in training the model \(M_{k}^{DS}\). _defect-sensitive model quality check (DMQC) module_, which is designed for verifying the quality of generated defect-sensitive model \(M_{k}^{DS}\) with the augmented image and label sets \(IMG^{AIQC}\) and \(L^{AIQC}\). The six modules collaboratively generate a qualified defective bean inspection model with these few amounts of human-labeling images. The operational flow of these modules is described as below. **Step 1:**: The user labels only a few amounts of sparse defective bean images and stores the labeled bean images in the LBIDB. **Step 2:**: The DSMC module creates a defect-sensitive model for the DIDN based the GAN technique. **Step 3:**: The GIMG module creates a generative network model \(M^{Sen*}\) for the BSDN and the DIDN. **Step 4:**: The LBIG module generates the augmented labeled defective bean image set (denoted by \(IMG^{LBIG}\) and \(L^{LBIG}\)). **Step 5:**: The AIQC module verifies whether the augmented labeled bean image set \(IMG^{LBIG}\) is qualified for being used in training the model \(M_{k}^{DS}\). **Step 6:**: The DMQC module verifies the quality of generated defect-sensitive model \(M_{k}^{DS}\) with the augmented image and label sets \(IMG^{AIQC}\) and \(L^{AIQC}\). **Step 7:**: Some above augmented bean images that pass the following two quality checks (AIQC and DMQC, presented later) will be used in the next iteration (\(k=k+1\)) of training the DSMC module for improving the DIDN model. **Step 8:**: The GALDAM outputs the optimal DIDN model, denoted as \(M^{DS*}\), which implements the general DBI model in the DL-DBIS (see Figure 3). Notice that \(k\) used in Step 7 is a global counter used for tracking the training iterations in the framework.