# Robust Learning from Demonstration Based on GANs and Affine Transformation
## 4 Experiment
### Method Deployment  
#### 4.2.1 Comparison with Other LfD Methods  
After 300 epochs of training, our model achieved numerical stability and can generate the target trajectory with fairly high accuracy with a single numeric character, still taking the digit 7\" as an example. Figure 6 shows the generated result of the model on the \(x\)-axis and \(y\)-axis. Respectively; we can see that the error is quite small and retains a large number of features in the demonstrations, without excessive smoothing. Figure 5: The framework of the proposed preprocessing method. After recording data from the UR5 robot, depicted in different colors in the figure, we employ a MAD filter and SVD method to project the trajectory into two dimensions. Additionally, we introduce a Bézier representation to illustrate the collected data for further utilization. Figure 6: Fitting performance of the proposed network on each dimension. For a comprehensive comparison, we conducted controlled experiments on the Lasa handwriting dataset by introducing noise and assessing the outcomes against the original data. In these experiments, we employed the parameter \(sigma\) to regulate the variance of the Gaussian noise added to the trajectory. We utilized mean squared error (MSE) and generation time as quantitative metrics for comparison purposes. The final outcomes are illustrated in Figure 7 and summarized in Table 1. Our proposed method exhibited learning and generation capabilities comparable to existing algorithms while requiring relatively less generation time. Furthermore, the algorithm's learning efficacy under noise was akin to probability-based methods and notably surpassed the performance of the DMP algorithm. In order to conduct a more comprehensive comparison, we conducted controlled experiments on the Lasa handwriting dataset by introducing noise and comparing the results with the original data. Both mean squared error (MSE) and generation time were used as quantitative metrics for comparison. The final results are presented in the figures and tables. Our proposed method demonstrated learning and generation capabilities comparable to those of existing algorithms while taking relatively less generation time. Moreover, the algorithm's learning ability under noise is similar to that of probability-based methods and significantly outperforms the DMP algorithm. Probabilistic-based methods such as ProMP, GMR, and KMP are noted for their limited generalization performance [22]. Hence, this section of the experiment primarily aims to compare the performance of DMP with the proposed method. In contrast to Section 4.2.1, the starting and ending points of the generalized trajectory in this section deviate significantly from the demonstration area. To assess the similarity between the trajectories before and after generalization, we introduced the distance correlation analysis (DCA) index [32]. A higher DCA index value indicates a greater similarity in shape. As illustrated in Figure 8 and Table 2, the proposed method exhibited generalization capability superior to DMP, all while incurring a relatively low time cost. Furthermore, due to DMP's reliance on dynamic \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multicolumn{2}{c}{**MSE**} & \multicolumn{1}{c}{**Time of**} \\ \cline{2-4}  & **Common** & **Noise** & **Generation (ms)** \\ \hline DMP & 25.26 & 53.00 & 130.38 \\ GMR & 27.06 & 26.75 & 218.10 \\ ProMP & 25.01 & **25.16** & 116.98 \\ Proposed & **24.71** & 25.78 & **23.12** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison with other LfD methods in terms of MSE and generation time. Figure 7: Performance and Learning Reproduction Capability. The green lines in the figure represent the demonstrations. systems modeling, the coupling between force terms and endpoint error makes it challenging to control system outputs as the trajectory approaches the endpoint.