## 3 Proposed Deep-Learning-Based Defective Bean Inspection Scheme (DL-DBIS)  
Figure 3 shows an illustration of applying defective bean inspection (DBI) model to remove defective beans with a robotic arm [20]. A defective bean picking system (DBPS) implemented in a single-chip computer inspects defective beans in the coffee tray with the DBI deep network and maintains locations of the defective beans in the defective bean location maintainer. Then, the DBPS guides the robotic arm to the top of each defective bean and removes them in sequence, which are performed by the arm routing controller and the target bean removal controller. In this system, a defective bean inspection model generation scheme is needed to obtain a DBI model for the DBI deep network, as shown in Figure 3, so that the defective bean picking system can successfully remove defective beans. DL-DBIS includes two operations: one is the model creation and the other is defective bean removal. The model creation operation is to create a DBI model for further inspection, and its operational flow is presented as follows:  
**Step 1:**: Use a robotic arm equipped with a camera to capture bean images. **Step 2:**: These images, divided into training images and testing images, are transmitted to the computer through the single-chip computer. Notice that DL-DBIS requires computation resources to achieve the defective bean identification and to inform the robot controller with the communication function. Currently, many productions are  
Figure 3: Illustration of defective bean removal with a robotic arm. Figure 2: A standard model generation flowchart in solutions of the deep learning-based methodology. invented and can be adopted. Raspberry Pi, shown in Figure 3, is one of existing single-chip computer productions found in the today's markets and is used in our implementation. In DL-DBIS, the labor-efficient deep learning-based system is designed to train a proper DBI model to determine whether a bean is a defect or not with Human Labeling Assistant in the training stage. The process is as follows:  
**Step 3-A-1:**: On receiving training image data, a Labeled-Bean Image Database is used to store these bean images, including bean labels. **Step 3-A-2:**: Then, the Defect-sensitive Model Creation Module creates a defect-sensitive model based on the GAN technique. **Step 3-A-3:**: The Quality-enhancing Image Augmentation Subsystem is used to automatically generate new bean images for training better defective bean inspection models. **Step 3-A-4:**: The Defect-Sensitive Model Quality Check Module checks quality of the defect-sensitive model. If quality is good enough, output the DBI model. Once a DBI model is created, the Defective Bean Picking System is then used to remove defective beans. The process is described as follows:  
**Step 3-B-1:**: When receiving the test image data, DBPS uses the DBI deep network to check the beans in the tray. **Step 3-B-2:**: Once the defective beans in the tray are detected, the Defective Bean Location Maintainer gets the position of the coffee beans. **Step 3-B-3:**: The Arm Routing Controller establishes routing and control of the Robotic arm for removing the defective beans. **Step 3-B-4:**: Finally, the Target Bean Removal Controller is of the final step in the Defective Bean Picking System, which has the ability to remove defective beans. **Step 4:**: After implementation of the Defective Bean Picking System is complete, the Target Bean Removal Controller transmits commands to the Single-chip computer by network and controls the robotic arm to remove the defective beans. _GAN-Based Automated Labeled Data Augmentation Method (GALDAM)_  
The GAN (generative adversarial network)-based Automated Labeled Data Augmentation Method (GALDAM) is designed to train a proper model with only a few amounts of human-labeling images (e.g., 20 images in our case study).