SINERGI Vol. No. June 2021: 141-152 http://publikasi. id/index. php/sinergi http://doi. org/10. 22441/sinergi. SELF-COLLISION AVOIDANCE OF ARM ROBOT USING GENERATIVE ADVERSARIAL NETWORK AND PARTICLES SWARM OPTIMIZATION (GAN-PSO) Zendi Iklima1*. Andi Adriansyah1. Sabin Hitimana2 Department of Electrical Engineering. Faculty of Engineering. Universitas Mercu Buana. Indonesia Department of Information Technology. Kigali Independent University. Rwanda Abstract Collision avoidance of Arm Robot is designed for the robot to collide objects, collide the environment, and collide its body. Self-collision avoidance was successfully trained using Generative Adversarial Networks (GAN. and Particle Swarm Optimization (PSO). The Inverse Kinematics (IK) with 96K motion data was extracted as the dataset to train data distribution of ya. 6K samples and 7. The proposed method GANs-PSO can solve the common GAN problem such as Mode Collapse or Helvetica Scenario that occurs when the generator yc always gets the same output point which mapped to different input yea values. The discriminator yc produces the random samples' data distribution, presenting the real data distribution . enerated by Inverse Kinematic analysi. The PSO was successfully reduced the number of training epochs of the generator yc only with 5000 iterations. The result of our proposed method (GANs-PSO) with 50 particles was 5000 training epochs executed in 0. 028ms per single prediction and 0. 027474% Generator Mean Square Error (GMSE). Keywords: Arm Robot. Collision Avoidance. Generative Adversarial Network. Inverse Kinematics. Particle Swarm Optimization. Article History: Received: June 14, 2020 Revised: July 7, 2020 Accepted: July 19, 2020 Published: Feb 5, 2021 Corresponding Author: Zendi Iklima Department of Electrical Engineering. Faculty of Engineering. Universitas Mercu Buana. Indonesia Email: iklima@mercubuana. This is an open access article under the CC BY-NC license INTRODUCTION Collision risk assessment and collision avoidance of manipulator robot has been an interesting topic in autonomous robotics . The manipulator robot is designed to simply human task, to reduce human error . , remote teleoperation robot NASA's Robonau. , to carry out tasks that humans cannot handle it, and to perform in dangerous tasks . Manipulator robots must work in a crowded or cluttered workspace, and have the ability to colliding the workspace, colliding its body, and colliding with each other . Several studies to solve collision used Oriented Bounding Boxes (OBB. Extended Oriented Bounding Boxes (EOBB. Artificial Potential Field (APF) . Virtual Link. Path Planning combine with Kinematic Analysis . Neural Network . , etc. Kinematic Analysis commonly used to analyze the motion of a manipulator robot. converts the robot manipulator's position and orientation from cartesian space to joint space defined as Inverse Kinematics (IK). A redundant robot has an infinite number of IK solutions. The evolutionary methods have been used to solve the IK problem. Some way of evolutionary are using a feed-forward Neural Network (NN) and its Back Propagation (BP). Genetic Algorithm (GA) . Particle Swarm Optimization (PSO) . Firefly Algorithm (FA) . Quantum PSO (QPSO) . Path Planning with PSO . , etc. Srisuk et al. explain the IK solution using Neural Network for a robotic arm in three The IK-NN is defined by the network's optimal weight with an error rate of 5% . Improves the network architecture utilizes a cycle of consistency to learn and solve the IK problem with a supervised or unsupervised The motion's quantitative evaluation has a Mean Square Error (MSE) of 7. 10% and 51% using a Cycle Consistency Objective Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A SINERGI Vol. 25 No. June 2021: 141-152 approach by adversarial. This MSE value prevents regressing to the end-effector positions of the input motion . IK-ANN . IK-ANNPSO . IK-RNN . was simulated for solving the IK problem. Still, this technique requires a lot of data to perform the training process and approximation, especially inverse kinematics and a robot manipulator's dynamics. mapping, this problem as a serious dimensional problem can be processed efficiently within the data distribution. Recent research used analytical models embedded inside a physics-based simulation, instead of using the real world's data set. The Reinforcement learning approach has been used to learn a closed-loop predictive controller for a real robot as IK solver . This approach requires a huge dataset as an important role in training neural networks to approximate the To collect real-world data, consume a lot of time . Generative Adversarial Networks (GAN. introduced by Ian Good Fellow in 2014 . , describes how to generate additional 'fake' data similar to real-world data, and thereby enlarge the total dataset available for training target neural network . , 22, . Closely. Hailin Ren and Pinhas Ben-Tzvi . implements IK solver for 4-DOF MICO Robotic Manipulator using four types of GANs, namely Conditional GAN (CGAN). Least Square GAN (LSGAN). Bidirectional GAN (BiGAN) and DualGAN . The Approaches proposed to solve IK and ID problems with the desired degree of accuracy and achieve a lower loss in the Performance and avoid overfitting. The training process of the proposed method takes 23 mins to train whole 000 datasets. The generator neural network's execution time takes 0. 17ms in a single prediction with the best of loss 0. 91 by GANs. The main contributions of this paper are as A Use of GANs toward learning as the IK solver's self-organized motion where the realworld data generated itself in which the data is high dimensional inputs and distributed. A Experiment to compare GANs performance with/without PSO to test the efficiency of the proposed GANs-PSO that evaluated using different sizes of the partial dataset and different deviations for the generator in the GANs. A Collision avoidance dataset created with an IK generator function. A The proposed method GANs and PSO capable to solve the common GAN problem such as Mode Collapse or Helvetica Scenario that occurs when the generator yc always get the same output point though mapped to different input yea values. The role of PSO optimizes the generator yc Cost and Loss to solve the Mode Collapse Problem. METHOD System Design The neural network structured of the common GANs contains two artificial neural networks of the generator yc and the discriminator yc . shown in Figure 1. The generator yc learns to create fake data by incorporating optimized feedback from the Discriminator . The training process of the generator requires tighter integration than the discriminator training process. In our method shows the portion of the GANs that trains the generator to include . A Random input . he end-effector position coordinated in ycu, yc, y. distributed to the generator networks. A Sample data collected from the generator by exponentially increased 10n . here chosen n = 1, 2, 3, and . A Generated data will be classified by the discriminator network . abelled real/fak. A Generator loss, which penalizes the generator for failing to fool the Discriminator. A Backpropagate through both the Discriminator and generator to obtain gradients and change only the generator weights. A PSO used to optimize the backpropagation The generator transforms the random input noise into a meaningful output to produce a wide variety of data, sampling from different places in the target distribution. The generator also a neural network needs to be trained. The neural network weights perform to reduce the error or loss of its The generator feeds into the discriminator network, and it produces the output to affect the next training process. Generator loss penalizes the generator for producing a sample that the discriminator network classifies as fake data So, this network must be included in a backpropagation process. Backpropagation adjusts each layer . ontains weight and biase. to impact the next cost function. In GANs, the impact of a generator weight depends on the impact of the discriminator weights it feeds into. So, backpropagation starts at the output and flows back through the Discriminator into the generator . The Discriminator yc is simply a classifier tries to distinguish real data from the data created by the generator . The discriminator training data contains. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A p-ISSN: 0-0 e-ISSN: 0-0 A Real data instances, in our system generated by inverse kinematic equation . o produce joint angular given by joint space/joint cartesia. , the Discriminator labelled as a positive sample during the training process. A Fake data instances created by the generator network labeled as a negative sample during the training process. As shown in Figure 1, the Discriminator obtains two loss functions . oss function of yc and loss function of y. During the Discriminator is training, the Discriminator ignores the loss of the generator and uses the discriminator loss. The procedure during discriminator training . A Classifies both real and fake data from the A The Discriminator updates its weights through backpropagation from the discriminator loss through the discriminator network. The objective of the Optimizer shown in Figure 1 to optimize both of GANs neural Adam Optimizer used as an optimizer architecture for advanced gradient algorithms . Figure 1. Network Structure of Generative Adversarial Networks Kinematics Analysis A manipulator robot's design is an important part of designing equations to assist in the feasibility of the manipulator robot. It is defined as transforming the geometrical equation to connect between joint spatial geometry concept and endeffector coordinates. The forward kinematics is described as transforming the joint space/joint angle to the cartesian space/joint variable . Vice versa, inverse kinematics transform cartesian space / joint variable to joint space / joint angle . as shown in Figure 2. Figure 2. The Schematic of a Forward Kinematics and Inverse Kinematics . Qinsheng explained Denavit-Hartenberg Convention is parameters related to a particular convention for enclosing the reference frames to the links of a kinematic chain/manipulator . The DH has four parameters contain: A Join offset . ccycn ): Offset distance among the common normal of the axis of ycycuycnycu ycn Oe 1 to ycycuycnycu ycn. Figure 3 shows that yccycn is the offset in a direction ycU0 ycycu ycU1 ycuycyceyc ycs1 on the other ways represented as ycUycnOe1 ycycu ycUycn ycuycyceyc ycsycn . A Join angle . uEycn ): An angle measured among the common normal of the axis of ycycuycnycu ycn Oe 1 to ycycuycnycu ycn. Figure 3 shown that yuEycn is an angle rotated over ycs1 on the other ways represented as an angle measured among the common normal of the axis ycUycnOe1 ycycu ycUycn over ycsycn . A Link length . cycn ): The length of the link is a common normal length between the axis of ycycuycnycu ycn Oe 1 and ycycuycnycu ycn. Figure 3 shows that ycycn is a link length measured from ycs1 to ycs2 over ycU2 or might be represented as the link length of ycsycnOe1 ycycu ycsycn over ycUycn . A Twist angle . uycn ): Twist of the link is an angle measured between the axis of ycycuycnycu ycn Oe 1 and ycycuycnycu ycn. Figure 3 shown that yuycn is an angle measured between ycs0 and ycs1 over ycU1 . csycnOe1 ycaycuycc ycsycn ycuycyceyc ycUycn ). After determining the coordinates shown in Figure 3, the DH parameters can be represented in Table 1 . Table 1. The Denavit-Hartenberg Parameters Link-yea yu . yuE1 yuE2 yuE3 yeI . ycc1 yu . yu1 Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A yee . yc1 yc2 SINERGI Vol. 25 No. June 2021: 141-152 Table 1 used to define the DH matrix convention such as yca. uEycn ) Oeyca. uycn ). uEycn ) yc. uycn ). uEycn ) ycycn . uEycn ) yca. uycn ). uEycn ) Oeyc. uycn ). uEycn ) ycycn . uEycn )] yc( yuycn ) yca( yuycn ) yccycn yc. uEycn ) ycnOe1 ycnycN = [ . The join offset measured yccycn = 30ycoyco, twist angle measured yuycn = 90ycu . The link length of joint1 equal to zero . , the link length of joint-2 is defined as yc1 measured yc1 = 60ycoyco, and the link length of joint-3 is defined as yc2 measured yc2 = 90ycoyco. uEycn ) denotes as ycaycuyc. uEycn ), yc. uEycn ) denotes as ycycnycu. uEycn ), yca. uycn ) denotes as ycaycuyc. uycn ), and yc. uycn ) denotes as ycycnycu. uycn ). Transformation of among the links from 0 to n mathematically defined: ya ya ya ya ycyc = yayc yayc ycyc Equation . shows the connection of joint and links from the base frame to frame ycn, so the translation for each join can be defined by replacing the variables from . and Table 1, then . Figure 3. Local Reference Coordinate of 3 DoF Manipulator in Arm Robot . yca( yuE1 ) yc( yuE1 ) 1ycN = [ yc( yuE1 ) Oeyca( yuE1 ) ycc1 yca( yuE2 ) Oeyc( yuE2 ) yca( yuE2 ) 0 yc1 yca( yuE2 ) 0 yc1 yc( yuE2 ) yca( yuE3 ) Oeyc( yuE3 ) yca( yuE3 ) 0 yc2 yca( yuE3 ) 0 yc2 yc( yuE3 ) yc( yuE2 ) 2ycN = [ yc( yuE3 ) 3ycN = [ yuON = ycyeeN The Forward Kinematic solution can be solved by multiplying . , . , and . A representation of learning IK is a system would be to generate samples of . c, yuO), where, yuO OO Euyco , is a vector containing the coordinates of the end-effector given by yuO = yce. where yce(. ) is a nonlinear direct kinematic function of the manipulator robot, and yc OO Euycu , is the vector containing the joint space configuration vector, and to learn the mapping yuO Ie yc. Refer to . , yce. denotes as a Forward Kinematic solution of the manipulator robot in which calculating the joint space parameters . cyycu , ycyyc , ycyyc ) based on its input yee. The end-effector linear velocity and angular velocity can be realized as formulized . Where yc is the geometric Jacobian Matrix of the manipulator robot. The Jacobian yc. of a forward kinematics is matrix 6x3 can be expressed as: uE1 , yuE2 , yuE3 ) A yuiyuE1 yc= A A yuiyuiycu0ya . uE1 , yuE2 , yuE3 ) A yuiyuE3 uE1 , yuE2 , yuE3 ) yuiyuE1 uE1 , yuE2 , yuE3 ) yuiyuE3 The yuON is the velocity of end-effector in the base frame defined as yc0 yuON = [ ycn0 ] yuiycn ycycn0 is a linear velocity from the base frame cuN 00 , ycN 00 , ycN00 ) to end-effector . cuN 20 , ycN 20 , ycN20 ) and can be derived as an angular velocity from the base uiycu0 , yuiyc0 , yuiyc0 ) to frame-ycn . uiycu2 , yuiyc2 , yuiyc2 ycuN ycn0 ycN ycn0 ycNycn0 yuON = 0 [ yuiycycn yeeN in the . is an angular parameter for each joint formulized as. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A p-ISSN: 0-0 e-ISSN: 0-0 yuEN1 yeeN = . uEN2 ] yuEN3 These yeeN in . the angular joint from the base frame to frame-n to formalized revolute joint of yuEN1 , meanwhile for prismatic joint defined as yccN . Equation . yuON can be replaced as ycuN 0ycn ycN 0ycn yuEN 1 ycN 0ycn = ya N . uEN 2 ] yui0ycuycn yuEN 3 ui0ycycn ] Thus yc has two parameters, as explained above, represented as: ya yaN = [ yc ] yayui . where yayui , denotes as the Jacobian matrices calculated by the partial derivative of the forward kinematic solution shown in . for the angular velocity of the manipulator robot that formulized yayui = . cI00 . yco ycI10 . yco ycI20 . yco ] . The rotational in the base frame noticed as ycI00 , the rotational the base frame to frame 1 noticed as ycI10 , and the rotational the base frame to frame 2 noticed as ycI20 . yco represents that the rotation always occurs in the z-axis then, yco = . By looking . , . , and . , the matrices ycI calculated as, ycI00 = . uE1 ) ycI10 = [Oeyca. uE1 )] . uE1 ) ycI20 = [Oeyca. uE1 )] Therefore yaO formulized as . yayui = . uE1 ) Oeyca. uE2 ) yc. uE1 ) Oeyca. uE2 )] yayc = . cI0. yco y . cC30 Oe ycC00 ) ycI1. 0 yco y . cC30 Oe ycC10 ) ycI2. yco y . cC30 Oe ycC20 ) . Furthermore, yayc denoted as the Jacobian matrices of the forward kinematic solution yce(. shown in . to the linear velocity of the manipulator robot that formulized as, can be formalized as . where ycC is the origin from the base frame until end-effector, by looking . , matrix ycC can be calculated as, yc1 yca. uE2 ) yc2 yca. uE3 ) ycC30 Oe ycC00 = . c1 yc. uE2 ) yc2 yc. uE3 )] ycc1 yc1 yca. uE2 ) yc2 yca. uE3 ) ycC30 Oe ycC10 = . c1 yc. uE2 ) yc2 yc. uE3 )] . yc2 yca. uE3 ) ycC30 Oe ycC20 = . c2 yc. uE3 )] . Equation . shows the initial value of yayc defined. Furthermore, . is the Jacobian Matrix of ya contains yayui and yayc . Corresponding to . , the linearity of the configuration Jacobian Matrix that allows solving the differential kinematics with an inversion of the following equations . yeeN = ycOeya yuON Equation . is valid only for the manipulators with the same dimension of the operational space and the join space . co = yc. When the manipulator is redundant . co > yc. , the Jacobian Matrix has more columns than rows, and infinite number solutions exist for . Generative Adversarial Network (GAN) GANs can be utilized to produce new data in a limited situation. These data, sometimes be difficult and expensive and time-consuming to The new data has to be realistic enough that whatever insights obtained from the generated data still applies to real data. GANs was introduced in 2014 by Goodfellow et al. , 31, . The original GANs can learn a generator to capture the distribution of real data by introducing an adversarial discriminator that evolves to discriminate between the actual data and the fake. GANs series widely proposed for a wide variety of problems. Figure 1 shows the original network structure of GANs. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A SINERGI Vol. 25 No. June 2021: 141-152 Figure 4. The Flowchart of Generative Adversarial Networks Modules In the original formulation. GANs includes a generator yc and a discriminator yc . Figure 4 shows the Self-Collision Avoidance System of Arm Robot's flowchart using GANs and PSO . The straightforward to implement when the models are both multilayers perceptron (MLP) but in this paper use the more than two layers of hidden layer called Artificial Neural Networks (ANN. The generator yc learn the data distribution ycyyci over real data yeo, the data distribution of yc defined as input noise variables ycyyea . eA), where yea OO yeA is independent and identically distributed samples from a known prior ycyyea , to points in the space of real data ye. In this system variable yea notice three parameters required as an input of the inverse kinematic equation . cyycu , ycyyc , ycyyc ). This yc represents a mapping data space as ya. yuEyci ), where yc is a differentiable function represented by an ANNs with parameters yuEyci . This ya. yuEyci ) is ANNs calculated consists of Feed-Forward step and Backpropagation step, formulized as . , 35, . ycyc = yce. then ycuyceyc = Ocycuycn=1 yuiycnyc ycuycn Oe yuEyc yco ya = Oc. cyco Oe ycycu )2 . yco=1 Equation . represents the first step of backpropagation step, which the weights of the network changed each iteration of the training process . The weights need to be updated each iteration by finding the values of the derivative of ya in . , which were given by n yuiycycn = Oeyu where ycyc does weight give the network values yuiycnyc and threshold unit yuEyc . This yce(. ) is the activation function used to transform the incoming values from the previous layer to the successive layer. ycyc represent the values from the input layer to the hidden layer ycycn , hidden layer to next hidden layer ycEa , and last hidden layer to output layer ycycu . The gradient descent required to calculated and minimize the error between observed data ycycu and the desired data ycyco . A measure of the error between both observed data ycycu and the desired data ycyco is yuiya = yuyuyc ycycn where the error yuyc is given as: yuyc = yce A . cIycu ). cyco Oe ycycu ) . yce A is the derivative of the activation function yce(. and yu is called learning rate. So, the weights updated when the input-hidden error calculated by . yuyc = yce . cI) ycn Oc yuiycycn yuyc ycn=1 Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A p-ISSN: 0-0 e-ISSN: 0-0 The second ANNs ya. yuEycc ) in which ya. represents the probability that ycu came from the data rather than ycyyci . By training the discriminator yc to maximize the probability of assigning the correct label to training examples and samples from the generator yc. That could be determined if a sample ycu OO ye is from the real dataset ycuycyyccycaycyca . or generated from the generator yc, ycuya. The training criterion of the discriminator yc, given any generator yc expressed as, ycO. a, y. = yaycuycEyccycaycyca . ] yayeaycEyea . Oe ya. ))] . Thus, the training process is to optimize the discriminator yc to assign correct labels to both the real dataset and the noise sample from the generator yc, and simultaneously train the generator yc to minimize, ycoycnycuycnycoycnycyce. Oe ya. ))) . When the generator yc was unable to assign a label data as data distribution of yeaycyyea , in this case, log . Oe ya. )) saturates. Rather than training the generator G to minimize shown in . , the generator G can be maximized to provides the stronger gradients early in learning, formulized as: ))) . Furthermore, minimax objective for both generator yc and the discriminator yc is formulated as follows . , 20, 21, 26, 30, . , ycoycnycu ycoycaycu ycO. a, y. = yaycuycEyccycaycyca. ] ya ya . yayeaycEyea . Oe ya. ))] where, ya(. ) denotes the discriminator yc network's output, ya(. ) denotes the generator yc network's output, and ya[. ] denotes the network expectation. The generator yc implicitly defines a probability distribution ycyyci as the distribution of the samples ya. obtained when yeaycyyea . A minibatch stochastic gradient descent training of GAN. hyperparameter of yco is the composer variables used to compute the generator loss and the discriminator loss yc . Algorithm 1 for number of training iterations do for yco step do A Sample minibatch of yco noise sample . A , yea . } from noise prior ycyyci . yea is noticed as the joint space in the end-effector provided by random values. So, yea defines as an input . cyycu , ycyyc , ycyyc ). A Sample minibatch of yco examples . A , ycu . } from data generating distribution ycyyccycaycyca . ycu is noticed as the joint space in end-effector provided by inverse kinematic equations. So, ycu defines as an input . cyycu , ycyyc , ycyyc ). A Update the Discriminator by ascending its stochastic gradient . end for A Sample minibatch of yco noise samples . A , yea . } from noise ycyyci . eA). yea denotes as an input . cyycu , ycyyc , ycyyc ). Update the generator D by descending its stochastic gradient . end for The gradient-based updates can use any standard gradient-based learning rule. Particle Swarm Optimization (PSO) The global optimum solution of the swarm particle defines as initial fitness value denotes by ycu. The swarm consists of ycu-particles travelling into ycu-dimensional search space with the epoch yc. During each epoch, ycy particle produces a unique position vector ycu. The const function also calculated by each particle ycy which consider as the local best fitness . cyycoycayceycyc ) to find the best fitness called global best fitness . ciycoycayceycyc ) of the swarm. The vectors and velocities both formulated: = vkt ycaycy . cyycoycayceycyc Oe ycuycoyc ) . ciycoycayceycyc Oe ycuycoyc ) ycuk 1 = ycukt vk 1 are the position vector and velocity vector of epoch yc. ycaycy and ycayci in . shows the coefficient factor that adjusts the particles' weights . vkt is velocity vector formulized the fitness of backpropagation process in Artificial Neural Networks (ANN. PSO was successfully integrated with ANNs training process to optimize the architecture of the network. This Algorithm . shows that PSO determines the optimized values of the ANNs learning rate yu and the number of nodes yc in ANNs hidden layer architecture . ycukt Algorithm 2 Initialize ycuycoyc swarms, velocity vector . , local . cyycoycayceycyc ) and global . ciycoycayceycyc ) best positions. for number of iterations yc do for number of swarms ycuycoyc do calculate ya. yuEyci ) . evaluate fitness in . update ycyycoycayceycyc end for update yciycoycayceycyc update vk 1 update ycuk 1 end for find best solution of yciycoycayceycyc validation ycycIycAycIya in . Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A SINERGI Vol. 25 No. June 2021: 141-152 Proposed Method Referring to . , ycO. ) denotes as an Objective Function that optimized by PSO . xplained in Algorithm . a, y. = yaycuycEyccycaycyca . ] yayeaycEyea . Oe ya. ))] . The training objective of the generator yc and the discriminator yc expressed as a loss function obtained: yaycoycuycyc = yayeaycEyea . og Oaycuycn=1 ya. )] . yaycoycuycyc = OeyaycuycEyccycaycyca . ] Oe yayeaycEyea . Oe ya. ))] . where ycu denotes the number of the trajectory points generated by the generator yc, ya. ycn denotes the probability occur of the ycn-th trajectory point, and Oaycuycn=1 ya. ycn denotes the probability occur of the generator output. Figure 5. Data Distribution of Real Data ya. Training The training process was performed using Intel(R) CoreA i5-6300HQ CPU@2. 30GHz, 12GB RAM and NVIDIA GeForce GTX 960M. The training process followed the hyperparameter . shown in Table 2. The training performance was captured in Figure 6, that means of our process Table 2. Hyperparameter for neural networks and PSO . Parameters Number of Layers Number of Neurons in Hidden Layers Activation Functions Activation Functions Rate Acceleration Coefficients . ycayci ) Choices Selected Parameters . ,4,5,6,7,. ycu ] where ycu = 2, 3. A , 10 ['ReLU', 'Sigmoid', 'TanH', 'Leaky ReLu'] 'Leaky ReLu' . 0, 1. A, . Table 2 shows the hyperparameter selected in this The number of layers denotes that the architecture of the generator yc and the discriminator yc both are ANNs. RESULTS AND DISCUSSION The proposed approach was applied to avoiding collision of Arm Robot three degree of freedom . DoF). The datasets generated by inverse kinematic equation explained in . It is generated 7200 motion points to produce the joint space . cyycu , ycyyc , ycyyc ) and joint angular . c1 , yc2 , yc3 ). Figure 5 shows that the data distribution of real data ya. were used 3600 samples and 7200 The batch noise of data distribution ya. generated using the same size with the data distribution of real data ya. Figure 6. Training Generator ya and Discriminator ya Performance GANs has 15. 26 minutes for 20000 GANs-PSO with 50 particles has 63. minutes for 20000 training epochs. And. GANsPSO with 100 particles has 149. 78 minutes for 20000 training epochs. This Testing represents that our approach takes a lot of time than common GANs, because of generates 50 particles of ya. and 100 particles of ya. per data sample. Figure 7 shows the data distribution of noise data ya. to match the data distribution of real data ya. A centroid distribution data shows the gap between real data distribution and noise data distribution in two cases before and after the generator ya(. ) performed. Follows by the time process in Figure 6, the approaches tested in 1000 until 20000 training epochs. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A p-ISSN: 0-0 e-ISSN: 0-0 Figure 7. Centroid of distribution data ya. and ya. , . Centroid of GANs in 5000 training epochs, . Centroid of GANs-PSO 50 particles in 5000 training epochs, and . Centroid of GANsPSO 100 particles in 5000 training epochs The centroid of data distribution ya. and ya. was successfully captured. GANs-PSO with 50 particles trained in 5000 training epochs was performed ya. to approximate the real data ya. The centroid generated real data ya. should be matched the centroid real data ya. shown in Figure 7. The training process of GANs-PSO with 50 particles trained in 5000 training epochs was estimated 19 minutes. Figure 6 was transformed in 2D, representing the motion path of the generator result in Figure 8. The motion path was obtained by inputting various random numbers to ya network as ya. The Arm Robot moved to a predefined position to caption the motion path, as shown in Figure 8. The PSO has optimized the generator loss yayaycuycyc by minimizing the cost function formulized in . and shown in Figure 9. The Initial G Loss is calculated 215757084 after the end of the process . he num of the epoch multiplying with the num of the particle. yayaycuycyc optimized is 1. Figure 9 also shows the minimax term GANs maximize generator yc and minimize discriminator yc . Figure 8. The Extraction of Figure 7. GANs-PSO 50 particles in 5000 training epochs Figure 9. The Optimization of yayaycuycyc Figure 10 represents the generation of the data distribution of the generator yc to reach the minimax expectation of ycuya. It represents the four motions of the robot, and it takes 5000 iterations and 50 particles. Figure 11 represents the generation of the data distribution of the generator yc to reach the minimax expectation of ycuya. Figure 11 also represents joint values in which contains the join value of theta 1, theta 2, and theta 3 and represents join velocities which contains yayc1 , yayc2 , and yayc3 . Testing Generator Network Figure 12 shows the testing performance of our approach. The prediction of the proposed path tested in 1000 until 20000 training epochs. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A SINERGI Vol. 25 No. June 2021: 141-152 processing load decreased if compared to the training load. Each training process includes 1000 until 20000 training epochs, and each training epoch covers all the training dataset. At the end of each training epoch, the validation dataset is used to evaluate the well-trained neural network's Performance on the unseen dataset selected for training, which is relatively smaller than the test To test the overall Performance and the generalization of the well-trained neural network using the limited dataset, the test dataset was used to estimate its overall Performance over the whole actuation space. Figure 13 show the Performance of GANsPSO in predicting the proposed position and the predictive position. To see the comparison between the proposed method (GANs-PSO) and the conventional method (GAN. shown in Table Our satisfied iterations selected in 5000 epochs comparing GANs and GANs-PSO the time estimation of the training process was counted in Table 3. Our proposed method GANs-PSO calculated the yaycIycAycIya was tested 0. Figure 10. Minimax Expectation of xG. Motion-1, . Motion-2, . Motion-3, and . Motion-4 The generator ya predict with the minimum value reached 0. 0270 milliseconds, and the maximum value reached 0. 0284 milliseconds. The Table 3. Performance of the proposed method Method GANs GANs-PSO Method GANs GANs-PSO Training Time Epoch 43 minutes 17 minutes Testing ycycycycyc Figure 11. Joint Values: . Joint-1, . Joint-2, and . Joint-3. Joint Velocity: . Joint-1, . Joint-2, and . Joint-3. Iklima et al. Self-Collision Avoidance of Arm Robot using Generative Adversarial A p-ISSN: 0-0 e-ISSN: 0-0 Figure 12. Testing Generator Performance Figure 13. The GMSE Tested CONCLUSION This paper presented a hybrid method of Generative Adversarial Networks (GAN. and Particle Swarm Optimization (PSO) for Arm Robot three degree of freedom . DoF). The real data distribution ya. was generated by Inverse Kinematic equation to produce the joint space . cyycu , ycyyc , ycyyc ) and joint angular . c1 , yc2 , yc3 ). The noise data distribution ya. was presented as the joint space ya. cyycu , ycyyc , ycyyc ). The PSO optimized the Performance of the generator ya, in the case to avoid the occurrence of the mode collapse. Mode collapse occurs when the generator is unable to generate output as data distribution ycuya. Therefore. PSO reduced the number of iterations differentially from conventional. The selected approach was GANs-PSO with 50 particles in 5000 training epochs, the training process of each proposed method takes around 19. 17 minutes to train the whole 7200 datasets. The neural generator network's execution time takes around 028ms to perform a single prediction with the GMSE revealed 0. REFERENCES