## 3 The Proposed Model
### Loss Function
The same trend was observed in both SSD and Faster-RCNN detection models, demonstrating that our model-generated images can be practically applied to industrial defect detection models and show good generalization. ### Detection Model Test Validation

To further verify the generalization improvement of the generated images to the detection model, test sets are constructed to show the application performance of the detection model in multiple dimensions and to demonstrate the practicality of our model to generate defective samples. In the validation set, we also set three types of test sets De-Test A, De-Test B, and De-Test C, for different datasets, where De-Test A is composed of 120 defect-free samples and 60 real defect samples, De-Test B is composed of 120 defect

\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]** \\ \hline Tree-CycleGAN [42]\({}_{\text{Class1}}\) & 0.712 & 0.586 & 0.679 \\ CycleGAN-TSS [43]\({}_{\text{Class1}}\) & 0.763 & 0.603 & 0.684 \\ PreCaCycleGAN\({}_{\text{Class1}}\) & **0.796** & **0.634** & **0.735** \\ Tree-CycleGAN [42]\({}_{\text{Class2}}\) & 0.856 & 0.826 & 0.868 \\ CycleGAN-TSS [43]\({}_{\text{Class2}}\) & 0.889 & 0.817 & 0.862 \\ PreCayCeleGAN\({}_{\text{Class2}}\) & **0.881** & **0.832** & **0.887** \\ Tree-CycleGAN [42]\({}_{\text{Class3}}\) & 0.777 & 0.756 & 0.840 \\ CycleGAN-TSS [43]\({}_{\text{Class3}}\) & 0.796 & **0.774** & 0.851 \\ PreCayCeleGAN\({}_{\text{Class3}}\) & **0.808** & 0.771 & **0.856** \\ Tree-CycleGAN [43]\({}_{\text{Class4}}\) & 0.605 & 0.667 & 0.623 \\ CycleGAN-TSS [43]\({}_{\text{Class4}}\) & **0.629** & 0.687 & 0.641 \\ PreCayCeleGAN\({}_{\text{Class4}}\) & 0.621 & **0.690** & **0.647** \\ Tree-CycleGAN [42]\({}_{\text{Class5}}\) & **0.724** & 0.684 & **0.699** \\ CycleGAN-TSS [43]\({}_{\text{Class5}}\) & 0.709 & 0.663 & 0.678 \\ PreCaCycleGAN\({}_{\text{Class5}}\) & 0.719 & **0.688** & 0.694 \\ Tree-CycleGAN[42]\({}_{\text{Class6}}\) & 0.791 & 0.732 & 0.740 \\ CycleGAN-TSS [43]\({}_{\text{Class6}}\) & 0.808 & 0.757 & 0.772 \\ PreCaCycleGAN\({}_{\text{Class6}}\) & **0.835** & **0.776** & **0.790** \\ Tree-CycleGAN [42]\({}_{\text{Class7}}\) & 0.776 & 0.667 & 0.784 \\ CycleGAN-TSS [43]\({}_{\text{Class7}}\) & 0.774 & 0.670 & 0.781 \\ PreCayCeleGAN\({}_{\text{Class7}}\) & **0.805** & **0.712** & **0.809** \\ Tree-CycleGAN [42]\({}_{\text{Class8}}\) & 0.653 & 0.584 & 0.638 \\ CycleGAN-TSS [43]\({}_{\text{Class8}}\) & 0.637 & 0.578 & 0.641 \\ PreCayCeleGAN\({}_{\text{Class8}}\) & **0.659** & **0.592** & **0.646** \\ Tree-CycleGAN [43]\({}_{\text{Class9}}\) & 0.774 & 0.781 & 0.799 \\ CycleGAN-TSS [43]\({}_{\text{Class9}}\) & 0.776 & 0.779 & 0.796 \\ PreCayCeleGAN\({}_{\text{Class9}}\) & **0.783** & **0.788** & **0.807** \\ Tree-CycleGAN [42]\({}_{\text{Class1}}\) & 0.772 & 0.790 & 0.763 \\ CycleGAN-TSS [43]\({}_{\text{Class1}}\) & 0.756 & 0.792 & 0.776 \\ PreCaCycleGAN\({}_{\text{Class1}}\)\(free real samples and 60 fake defect samples generated by different models. De-Test C is composed of 120 defect-free samples, 30 real defective samples, and 30 fake defective samples generated by different training sets and training models correspondingly. During the experiments, we used the three most important metrics in real industrial manufacturing, data detection accuracy (DDA), defect detection rate (DDR), and false detection rate (FDR), to measure the detection accuracy [51]. Among them, the data detection accuracy is the percentage of the sum of correctly detected defect data and defect-free data in the total data volume, the defect detection rate is the percentage of correctly detected defects in the total defect data, and the false detection rate is the percentage of incorrectly detected defect-free samples as defective samples among all samples detected as defective, as shown in Equations (15)-(17).