Abstract

This paper proposes a deep generative model-based framework for synthesizing four-bar linkage mechanisms that satisfy specified kinematic and quasi-static conditions. We define two objective functions for crank-rocker mechanisms using kinematic workspaces and geometric configurations. Our approach utilizes a conditional generative adversarial network (cGAN) modified for mechanism synthesis, which learns the relationship between mechanism requirements and linkage lengths. The results demonstrate that the proposed model successfully generates multiple distinct mechanisms meeting specific kinematic and quasi-static requirements. We compare our cGAN approach to traditional optimization methods and other deep learning-based generative models. Our method offers several advantages over traditional design approaches, enabling efficient generation of diverse yet feasible design candidates while exploring a large design space. By considering both kinematic and quasi-static requirements, the proposed model can produce more effective mechanisms for real-world applications. This makes it a promising tool for linkage mechanism design, offering designers a way to efficiently generate multiple viable design options that satisfy key performance criteria.

Highlights
  • This study proposes a framework that employs the deep learning-based generative model to effectively address the design of linkage mechanisms.

  • A deep learning-based generative model for accurate, diverse four-bar linkage mechanism synthesis is introduced.

  • The proposed model synthesizes mechanisms satisfying specific kinematic and quasi-static conditions.

  • Achieved good accuracy with high diversity compared to traditional NSGA-II and cVAEmodels.

  • Demonstrated model’s efficiency in generating diverse design candidates for real-world applications.

1. Introduction

1.1 Background

Mechanism design is a fundamental part of mechanical systems that perform a variety of tasks in a wide range of applications (Akbari et al., 2016; Simionescu, 2018; Lee et al., 2021, 2023; Ahmadi & Ahmadi, 2022; Liu et al., 2023; SAR et al., 2023). From the intricate workings of locking pliers to the sophisticated movements of robotic arms, mechanisms play a pivotal role in achieving desired functionalities. Among the various forms of mechanisms, those employing linkages hold particular significance, adept at translating simple circular motions into complex multi-joint movements that delineate unique path or workspace. Yet, the design of linkage mechanisms presents a formidable challenge, as even minor alterations in linkage lengths can induce significant changes in workspace and payload (Lee et al., 1999; Tsai & Lai, 2004; Sapietová et al., 2020; Shahid et al., 2021; Gu et al., 2023; Wang et al., 2024). Thus, the mechanism synthesis is a significantly complex problem and has not been well understood by the field. The synthesis has often been done simply by trial and error, especially in industries, which makes it extremely difficult to find an optimal mechanism that suits one’s requirements. Although it is possible to analytically calculate the lengths of a linkage mechanism that passes a few given points, e.g., Burmester Theory  (Burmester, 1888; Deshpande & Purwar, 2017; Shin et al., 2023b), real-world problems and requirements are often more complicated.

There has been significant effort in solving this issue in the field (Sandor, 1959; Erdman, 1981; Burmester, 1888; Barton et al., 2009). The numerical methods have been studied to find the lengths of linkages that follow a specific target path with feed-forward optimization processes   (Kim et al., 2006; Schröcker et al., 2009; Barton et al., 2010; Kang et al., 2016; Yim et al., 2019; Yu et al., 2020; Han & Kim, 2021; Shiwalkar et al., 2022; Gu et al., 2023; Wang et al., 2024). These methods are effective in providing a good solution if there is a linkage mechanism that can definitely satisfy these conditions. However, these iterative processes can be time-consuming, especially at high resolutions, and the problem is noticeable when synthesizing mechanisms with user-defined objective functions as the target rather than workspace paths. Furthermore, by providing a single solution to a problem where there may be many other viable coupling mechanisms with similar conditions, these methods have clear limitations in terms of diversity. Cabrera et al. (2002) and Gu et al. (2023) used genetic algorithm (GA), an optimization algorithm inspired by the process of natural selection and evolution, to improve the problem for a single solution. Wang et al. (2024) proposed a method to generate the trajectory of the workspace and synthesize the mechanism. This method aimed to improve the classification accuracy according to the characteristics of the workspace path and the geometric center arrangement using the GA algorithm. Acharyya & Mandal (2009) also performed a performance comparison of three different evolutionary algorithms: GA, particle swarm optimization, and differential evolution for four-bar mechanism synthesis. Further, Ullah & Kota (1997) used Fourier descriptors to form an effective objective function that is used for optimal mechanism synthesis with a stochastic global search method. Li et al. (2022) also used Fourier descriptors to represent planar motion of mechanisms. However, they did not consider the quasi-static or dynamic performance of linkages that track specific coupler paths, nor did they consider the generation of various linkages for the same conditions.

The data-driven methods are also an active research area  (Yim et al., 2021; Yüksel et al., 2023). Heyrani Nobari et al. (2022) created a big dataset of planar linkage mechanisms for data-driven kinematic design. Their data include the paths drawn by the mechanisms, which provides a unique opportunity to simply find mechanisms from the dataset that satisfy required kinematic conditions. Nevertheless, they mentioned that the generation of the dataset is very computationally expensive, and there still may not be a mechanism that perfectly satisfies the target path. The deep learning-based  (Deshpande & Purwar, 2019a) and also image-based  (Deshpande & Purwar, 2021) generative methods have been studied to synthesize paths of multiple linkage mechanisms. These methods are useful in that they are able to generate samples more quickly than traditional optimization methods discussed above. Also, they are able to generate a wide range of solutions, whereas most of the optimization-based methods can only generate a single sample. However, the quality of the generated samples may be inferior compared to the optimization-based methods as it relies on the limited amount of the dataset it was trained on.

1.2 Problem definition

While reviewing the past work, we realized that most of the studies in four-bar linkage mechanism synthesis focus on generating a mechanism that can follow a specific target path  (Deshpande & Purwar, 2019a,b; Han & Kim, 2021; Heyrani Nobari et al., 2022). Traditionally, mechanism synthesis has focused on designing linkages that precisely follow a specific end-effector path (Deshpande & Purwar, 2019a,b; Han & Kim, 2021; Heyrani Nobari et al., 2022; Shiwalkar et al., 2022; Wang et al., 2024). However, among the tasks that the mechanism must perform, path tracking is only one objective function. Therefore, it is not feasible to satisfy the global requirements used in various fields with only one performance optimization. This indicates that it is critical for the mechanism to identify the appropriate objective function in accordance with the specific task at hand. While this traditional approach is essential for certain applications, such as tracing a specific logo or pattern in a drawing machine or maintaining a heavy payload in a robotic arm for welding or laser cutting, it may not always be necessary or optimal (Raghavan, 2004; Wongratanaphisan & Cole, 2007; Wang & Lan, 2014).

In these cases, the exact end-effector path is not relatively critical as long as the mechanism satisfies key performance requirements. For scenarios such as pick-and-place or folding mechanisms, it is crucial to hold the static state of the point at which the task is performed. In these cases, factors beyond the end-effector path, such as stability and precision, take priority. For example, in a packaging machine that needs to pick up objects from one location and place them in another, the primary concern is reaching the desired positions accurately and efficiently, rather than following a specific path between those points. Similarly, in a toggle clamp mechanism used for holding workpieces, the focus is on transmitting sufficient clamping force and maintaining stability, rather than the precise path of the clamp arm. In a suspension system of a vehicle, the linkage mechanism should primarily ensure a smooth ride and maintain wheel contact with the ground within a specific workspace, rather than adhering to a strict path. Mechanism synthesis models that focus solely on kinematic conditions, such as paths, may unintentionally design mechanisms that require too much torque for real-world applications. Thus, it is essential to take a holistic approach that considers both kinematic and dynamic factors when developing practical and efficient mechanisms. In these cases, designing mechanisms based on key performance indicators such as maximum reach, force transmission, or workspace constraints can lead to more efficient and effective solutions compared to path-based synthesis.

Thus, it is important to design a mechanism that can take various paths while still considering quasi-static conditions.

More importantly, all the synthesis methods mentioned above do not consider any quasi-static or dynamic conditions in linkage mechanisms (e.g., torque transmission, maximum payload, etc.) that are essential to consider for a mechanism to perform tasks in the real application. Thus, implementing the application requires additional tweaks and compromises in design performance.

1.3 Framework

To effectively overcome these problems, we propose a methodology for condition-based linkage mechanism synthesis. The proposed methodology is based on a conditional generative adversarial network (cGAN), a deep learning-based generative model (DGM) capable of synthesizing multiple diverse linkage mechanism samples that satisfy the given kinematic and quasi-static requirements. A traditional approach for mechanism synthesis solely considers the whole path of a mechanism with an optimization-based algorithm. However, we argue that this approach hugely hinders the diversity of the optimized mechanisms, considering we often do not need to optimize the whole path of a mechanism. In some cases, link synthesis may not be possible due to assembly mode defects  (Schröcker et al., 2007), impeding the tracking of an arbitrary coupler curve. Thus, to increase the diversity of generated linkage mechanisms, we have formulated simplified kinematic and quasi-static conditions where there could be multiple viable linkages even when the same conditions are given. This allows for the generation of mechanisms with various designs and paths that satisfy the same or very close target conditions. Designers then can choose a mechanism that suits given conditions from multiple samples.

The research framework proposed in this paper is designed to comprehensively address the limitations of existing linkage synthesis methods. It also establishes a foundation for more robust and adaptable design processes, by providing the following contributions:

  1. Definition of performance indicators to generate various mechanisms: The proposed methodology allows for the generation of various feasible linkages under the same set of conditions by formulating simplified kinematic and quasi-static conditions. This broadens the design space and introduces a novel consideration of quasi-static conditions derived from geometric structures.

  2. Development of a deep learning-based methodology and comparative analysis: This paper presents a new methodology for synthesizing condition-based linkage mechanisms using cGANs. The proposed approach is compared to existing methods such as conditional variational autoencoders (cVAE), non-dominated sorting genetic algorithm-II (NSGA-II) (Deb et al., 2002), and Performance Conditioned Diverse Generative Adversarial Network (PcDGAN) (Heyrani Nobari et al., 2021) showing the superiority of the proposed framework.

  3. Integrating deep learning techniques: The application of deep learning techniques, in particular cGANs, to the synthesis of coupling mechanisms provides an efficient and effective approach that are comparable to traditional optimization-based methods. This integration enhances the speed and diversity of generated solutions, offering a promising avenue for advancing mechanism design in complex real-world applications.

Figure 1 shows the overall flow for the training of the proposed generative model-based mechanism synthesis framework. This paper is structured as follows: Section 2 provides a brief overview of deep generative models. In Section 3, the mechanism samples are generated for the training of the deep generative model. In Sections 4.1 and  4.2, the generative model is trained with this dataset and its synthesis performance is evaluated. An ablation study on cGAN was performed in Section 5 to evaluate the effectiveness of the modifications made on the generative model to ensure good mechanism synthesis. The contents of this paper is summarized in Section 6.

Deep generative model-based mechanism synthesis framework considering both kinematic and quasi-static conditions.
Figure 1:

Deep generative model-based mechanism synthesis framework considering both kinematic and quasi-static conditions.

2. Related work: deep learning-based methods

Due to the recent rise in DGMs, many studies have attempted to use DGMs for mechanism synthesis. The authors refer to Regenwetter et al. (2022) for a detailed review of DGMs in engineering design. The following section covers the studies on DGMs for engineering design and the applications on mechanism synthesis.

Variational autoencoders: VAEs (Kingma & Welling, 2013) are a variant of autoencoders, which are neural network architectures commonly used for dimensionality reduction, feature learning, and data compression. VAEs can generate new samples that are similar to the ones they were trained on, using its encoder and decoder network. Deshpande & Purwar (2019a) used VAE to learn the probability distribution of possible linkage parameters to relate user inputs with corresponding linkage parameters, and use them for kinematic mechanism synthesis. Their work was further improved using a convolutional VAE that enables an image-based variational path synthesis (Deshpande & Purwar, 2020).

Generative adversarial networks: GANs (Goodfellow et al., 2020) consist of two neural networks, the generator and the discriminator, in an adversarial relationship while training. The generator takes random noise or a latent vector as input and generates samples that resemble the real data, whereas the discriminator acts as a binary classifier between real and generated samples. They are iteratively and adversarily trained until the discriminator is unable to tell the difference between the two. Once the GAN is trained, you can sample from the generator by feeding random noise or latent vectors, which produces samples that are similar to the real data. Both VAEs and GANs are very popular DGMs that are increasingly used for engineering design. However, they are different in that VAEs are probabilistic models that explicitly model the underlying probability distribution of data and focus on representation learning, while GANs are adversarial models with an implicit latent space that aim to generate highly realistic data.

Due to its powerful synthesis performance in the field of computer vision (Wang et al., 2021), many studies worked on using GANs for engineering design. Topology optimization, a method that used the best material distribution to achieve desired performance objectives while minimizing constraints, traditionally relied on iterative numerical optimization algorithms. Many studies have attempted to improve this limitation using machine and deep learning techniques (Shin et al., 2023a), especially using GAN for improved diversity, both for 2D (Oh et al., 2019; Yu et al., 2019) and 3D (Nie et al., 2021).

Further, numerous studies have focused on modifying GANs for engineering design. PaDGAN (Chen & Ahmed, 2021) introduced a modified loss function that motivates diversity, quality, and design domain coverage of generated designs with determinantal point processes (DPP) (Kulesza et al., 2012) and performance estimators. PcDGAN (Heyrani Nobari et al., 2021) is similar to PaDGAN in that DPP is used to improve sample diversity, and is also similar to continuous conditional GAN (Ding et al., 2023) for synthesis with continuous input variables given as conditions.

Despite these improvements and unique advantages of cGAN, as far as we are concerned, there have been no attempts to use cGAN for mechanism synthesis. Thus, this study also focuses on the viability of using a cGAN model for mechanism synthesis. Because the aim of this study is to assess the viability of a cGAN model for the synthesis of mechanisms considering multiple conditions, the baseline cGAN model was used with minor modifications, rather than testing and picking a specific state-of-the-art GAN variant.

3. Generation of linkage mechanisms

3.1 Crank-rocker mechanism

To synthesize the linkage mechanism, it is important to satisfy the geometric conditions for having degrees of freedom. While there are many types of four-bar linkage mechanisms (e.g., drag-link, crank-rocker, double-rocker, etc.), actuating systems use electronic or mechanical power sources to actuate. A motor is typically employed to generate rotational motion and transmit torque. However, structural design constraints may limit the motor’s full rotation, resulting in interference between links or design constraints. In such situations, it can be challenging to fully utilize rotational motion, which can increase structural complexity and costs. Therefore, when designing for limited space or specific constraints, a crank-rocker mechanism is often utilized due to its efficiency in actuating systems.

The conditions for complete rotation of the crank are effective in terms of structural simplicity and energy loss minimization, as the motor is used to operate the system’s mechanisms. This improves the stability and efficiency of the system while also overcoming structural constraints and enhancing performance. The proposed framework is to define the geometric relationship between the rotation of the crank and the end-effector to generate various linkage mechanisms that satisfy it. Thus, more diverse mechanisms (e.g., drag-link, double-rocker, parallelogram, etc.) can be considered in the same way, but we deal with the crack-rocker (as shown in Fig. 2) for the most common and concise implementation in this paper.

A labeled example of a crank-rocker four-bar linkage mechanism.
Figure 2:

A labeled example of a crank-rocker four-bar linkage mechanism.

This provides the data needed to calculate the kinematic and quasi-static conditions for the inverse design of mechanisms. According to Grashof’s Law, in order for a crank-rocker system to rotate continuously, the sum of the shortest and longest link lengths is less than or equal to the sum of the other two link lengths. Applying Reuleaux’s Law, it must satisfy all the conditions in equation (1). Since |$l_1$| is fixed to 1.0, the other linkage lengths can be considered as ratios with respect to |$l_1$|⁠.

(1)

The five design variables are |$\vec{X}$| = [ |$l_2$|⁠, |$l_3$|⁠, |$l_4$|⁠, |$EE_x$|⁠, |$EE_y$|], where all of the elements are the crank-rocker mechanism design variables. In theory, any fully-rotating crank-rocker mechanisms can be produced if they satisfy the conditions in equation (1). However, to avoid generating meaningless mechanisms, it is required to limit the range, since there are infinitely many sets of linkages that can satisfy equation (1). To determine the appropriate range for generating the mechanism, we explored ∼2 million sets of linkages without any length constraints. The link length range that satisfies 95|$\%$| of the proposed performance values is shown in Table 1. It is important to note that this range can be freely adjusted to suit different applications. For more information on the proposed performance values, please refer to Section 3.2.

Table 1:

The ranges of linkage lengths to generate mechanisms.

|$\vec{X}$||$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
max.0.952.003.002.501.50
min.0.050.050.05−0.50−1.50
|$\vec{X}$||$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
max.0.952.003.002.501.50
min.0.050.050.05−0.50−1.50
Table 1:

The ranges of linkage lengths to generate mechanisms.

|$\vec{X}$||$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
max.0.952.003.002.501.50
min.0.050.050.05−0.50−1.50
|$\vec{X}$||$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
max.0.952.003.002.501.50
min.0.050.050.05−0.50−1.50

3.2 Conditions

This section defines the kinematic and quasi-static conditions of the four-bar linkage mechanisms. Due to the difference in linkage lengths, mechanisms naturally have different mechanical properties that may be used to assess their performance. This study aims to create numerous and distinct linkage mechanisms that satisfy the given performance conditions. In other words, linkage mechanisms produced given similar conditions must be performance-compliant, yet still different to each other (diversity). Thus, a means to evaluate the performance and uniqueness of the link sets is required.

We define below two conditions that reflect the geometric nonlinearity of mechanisms. They can be assumed to be surjective since the performance values can be very close or even identical despite the differences in the mechanism design variables. While surjective functions are useful in many contexts, they may show limitations when calculating design variables in inverse design problems. Although a surjective function ensures that every possible output is mapped from at least one input, it does not guarantee a unique input for each output. This lack of uniqueness can result in ambiguities when generating multiple solutions for a given design requirement, thereby complicating the inverse design process. To address this, we propose a refined approach that incorporates additional constraints and optimization techniques to ensure uniqueness and improve the reliability of the inverse design process.

Kinematic condition:  As shown in Fig. 2, the maximum distance available in the path a mechanism draws (⁠|$d_{max}$|⁠) can be derived by numerically calculating the Euclidean distances between the points along the path. To verify this more quantitatively, we mathematically derived the position of the workspace in terms of design variables as follows.

First, the position of the crank (⁠|$l_2$|⁠) is determined by |$\theta$| and the position of |$l_3$| is determined by the geometry condition of the mechanism (as shown in Fig. 2). Then, the distance |$\overline{AB}$| between A and B can be obtained using Cosine law as equation (2).

(2)

The angle |$\angle {OAC}$| between |$l_2$| and |$l_3$| can be computed by the sum of |$\zeta$| and |$\xi$|⁠, where |$\zeta$| and |$\xi$| are defined as follows:

(3)
(4)

Then, the above relation allows one to express the workspace position [|$WS_x, WS_y$|]:

(5)
(6)

The angle of rotation (⁠|$\theta$|⁠) was derived in matlab by dividing it into 400 uniform steps for calculations. The calculation process of the maximum distance (⁠|$d_{max}$|⁠) of the end-effector is as follows (Algorithm 1):

Performance calculation process
Algorithm 1

Performance calculation process

Quasi-static condition: To address tasks in real applications, dynamic conditions that can carry payloads in the workspace should be considered. Although the proposed framework does not deal with real applications, quasi-static conditions can be considered by interpreting the geometry of linkage mechanisms. This interpretation can be used as a significant indicator to evaluate the torque transmission capability of mechanisms. In order to determine the maximum payload of a mechanism for a task, we calculate the torque per force ratio between the input link (crank) and the end-effector along a path.

The forces acting in a workspace is determined by the transmission of input torque, and their relationships can be known using the work conservation law. Assuming the energy is conserved within the mechanism, the relationship between the input and the output work is defined as |$|W_{in}| = |W_{out}|$|⁠, where |$W_{in}$| is the input work at the crank and |$W_{out}$| is the output work at the end-effector. As |$W = F \cdot S$| where F is the force and S is the displacement, this equation can be converted to equation (7) via Algorithm 1.

(7)

As |$F\cdot S = \tau \cdot \theta$| where |$\tau$| is torque and |$\theta$| is angular displacement, it can further be derived as equation (8).

(8)

where |$\delta \theta _{in}$| is the incremental angular displacement at the crank and |$\delta S_{out}$| is the incremental displacement at the end-effector. Since we defined |$\eta$| as the torque per force ratio, |$\eta$| can be expressed as equation (9).

(9)

Equation (9) can now be used to calculate the |$\eta$| at the end-effector where a payload will be attached to. Figure 3(a) shows that |$\eta$| of a mechanism is determined by the incremental angular displacement of the crank (⁠|$\delta \theta$|⁠) and the incremental displacement of the end-effector (⁠|$\delta S_{out}$|⁠). As this study solely considers a fully-revolving crank-rocker mechanism, |$\eta$| along its full path can be calculated as shown in Fig. 3(b). The objective of this case study is to determine the maximum distance that can be traveled within the workspace of the crank-rocker mechanism. To achieve this, we split the closed curve in half with respect to the point of |$d_{max}$| obtained from the algorithm 1, and we obtain two paths that can go up to the maximum distance. Each of these two paths will have a different |$\eta _{min}$| for each path. If we divide the path by two at the maximum distance points (red points in Fig. 3b), two different |$\eta _{min}$| can be determined at each path (blue in Fig. 3b). Although a crank-rocker can fully revolve, it can also move only in one of these two paths. In other words, one of the two paths that gives the higher |$\eta _{min}$| can be selected to maximize the payload. Using this measure, we can determine the minimum torque requirement of a motor to lift desirable payload, and vice versa. Figure 4 (c-1 to 5) shows that there are many different samples that satisfy the same kinematic condition, despite their different linkage lengths and paths. It is important to note that there are many different mechanism samples, even if it has very similar conditions. Therefore, a variety of samples can be generated when the linkage is generated along the selected |$d_{max}$|⁠.

(a) The parameters needed for the calculation of $\eta _{min}$ and (b) the plot of $\eta$ along the path of a mechanism.
Figure 3:

(a) The parameters needed for the calculation of |$\eta _{min}$| and (b) the plot of |$\eta$| along the path of a mechanism.

(a), (b) Histograms and (c) a scatter plot and visualization of few mechanisms with similar conditions generated for the model training of $d_{max}$, $\eta _{min}$ of $X_{train}$.
Figure 4:

(a), (b) Histograms and (c) a scatter plot and visualization of few mechanisms with similar conditions generated for the model training of |$d_{max}$|⁠, |$\eta _{min}$| of |$X_{train}$|⁠.

In cases where two or more identical |$d_{max}$| values are identified during the computational process of Algorithm 1 (e.g., instances of more than two inflection points or errors resulting from insufficient resolution, etc.). In this instance, it is possible to interpret the implication as that there are two or more cases where paths can be divided in the end-effector path of one mechanism. This can be resolved by examining all potential scenarios where paths can be separated and selecting |$\eta _{min}$| with the largest value.

3.3 Data generation for model training

The dataset of the linkage mechanisms used for the training of a generative model and synthesis was produced using Latin hypercube sampling (LHS)  (McKay et al., 1979) within the arbitrary linkage length ranges defined in Table 1. The goal of using LHS is to ensure that the samples are representative of the distribution across all ranges of linkage lengths while minimizing any correlations between them. Any generated samples that do not satisfy the crank-rocker conditions given in equation (1) were removed. 100 000 valid samples were generated in total. We denote this dataset for the model training as |$X_{train}$|⁠. The generation of |$X_{train}$| was done in matlab. Figure 4 shows the distribution of |$d_{max}$| and |$\eta _{min}$| calculated from |$X_{train}$|⁠. As shown, |$d_{max}$| and |$\eta _{min}$| naturally have a nonlinear relationship that was not apparent before the generation. A few of the generated mechanisms with similar conditions are visualized in Fig. 4 (c-1 to 5) to show their diversity in linkage lengths.

4. Synthesis with deep generative model

cGAN  (Mirza & Osindero, 2014; Goodfellow et al., 2020), a popular DGM, was used to synthesize mechanism samples for given conditions. cGAN has a strength compared to other deep generative models in that it can generate multiple realistic samples that satisfy a given condition. This section explains the model training with |$X_{train}$|⁠, the mechanism synthesis, and the evaluation of the trained model.

4.1 Conditional generative adversarial network

Training: The training procedure of the cGAN model is shown in Fig. 5. The generator (G) generates synthetic design samples for given random conditions, where the conditions are |$d_{max}$| and |$\eta _{min}$|⁠. The random noise input is to ensure that random samples are generated. The discriminator (D) then classifies unlabeled real and synthesized (fake) samples on whether they are real or fake. This process is looped, and G and D are adversarially trained, which enables the generator to synthesize realistic samples. The samples consist of link lengths (⁠|$l_2$|⁠, |$l_3$|⁠, |$l_4$|⁠, |$\mathrm{EE}_x$|⁠, and |$\mathrm{EE}_y$|⁠) and the conditions. The difference between real and fake samples is that the real conditions are the calculated ground truths for the given link lengths, whereas link lengths are estimates that depend on randomly generated conditions for fake samples.

The training procedure (loop from left to right) of the modified cGAN model.
Figure 5:

The training procedure (loop from left to right) of the modified cGAN model.

Structure: G is a multi-layer perceptron (MLP) with five fully-connected layers with 100 neurons each. Note that the number of layers and neurons are hyperparameters, and the best ones that perform reasonable inverse design were found by trial-and-error. A rectifier linear unit (Glorot et al., 2011) activation function was used between the layers. D is identical to G, except that it has an additional sigmoid activation function at the end to enforce the output between 0 and 1 to calculate classification losses. A binary cross-entropy loss was used for D (⁠|$\mathcal {L}_D$|⁠). The batch size was set to 100.

Modifications on cGAN: The baseline cGAN was first tested to synthesize mechanism samples. However, the model could not generate good samples due to the infamous mode collapse, creating near identical samples for given conditions regardless of hyperparameters. Since the aim is to generate diverse yet accurate samples, additional methods were applied to the baseline cGAN model.

A predictor (P) was used to predict the estimated actual |$d_{max}$| and |$\eta _{min}$| (⁠|$d_r$| and |$\eta _r$|⁠) for given samples. This was used to minimize the gap between the |$d_{max}$| and |$\eta _{min}$| given as target conditions (⁠|$d_t$| and |$\eta _t$|⁠) to G and |$d_r$| and |$\eta _r$| of the samples that G synthesized. The gap was measured with mean squared error (MSE) loss (⁠|$\mathcal {L}_P$|⁠) of a batch as shown in equation (10), which was used as a part of loss functions for G. P is also an MLP identical to G, except that its inputs are the linkage mechanism samples, and the outputs are the estimated conditions. It is worth noting that P can be simply replaced with the script that was used to calculate the conditions of |$X_{train}$| in Section 3.2. However, this will make the training of cGAN too slow as the script takes a long time to calculate. Therefore, P was trained using the existing data (⁠|$X_{train}$|⁠) and the corresponding conditions that have been already calculated. P was trained prior to the training of cGAN and was fixed with no updates while training the cGAN model.

(10)

Similarity loss (⁠|$\mathcal {L}_s$|⁠) was used to ensure that G generates distinct samples. It is the mean of the nearest Euclidean distances between synthesized samples shown in equation (11) to maximize the diversity of samples.

(11)

where D is the Euclidean distance, and |$(\mathrm{x}_i, \mathrm{x}_j)$| are a pair of synthesized samples.

Therefore, the loss function used to train G is as shown in equation (12), where |$w_P$| and |$w_s$| are the weights for |$\mathcal {L}_P$| and |$\mathcal {L}_s$|⁠, respectively, and were adjusted accordingly to stabilize the training.

(12)

After the training, the samples can be generated given the values of |$d_t$| and |$\eta _t$|⁠, and the respective |$d_r$| and |$\eta _r$| can be calculated.

It is important to sample realistic fake conditions for G, as D could simply discriminate fake samples based on their unrealistic fake conditions. A random sampling of fake conditions was initially conducted to sample fake conditions for the training of the generative model. However, as shown in Fig. 4(c), the real conditions have Pareto-like distribution and make random sampling unreasonable. This necessitated a more sophisticated sampling strategy.

Synthetic Minority Oversampling Technique (SMOTE)  (Chawla et al., 2002) is widely used to mitigate imbalanced classification problems by oversampling based on real samples. SMOTE works by creating synthetic examples of the minority class by interpolating between existing examples, known as the k-nearest neighbors algorithm (k-NN). We used a similar technique based on k-NN to sample fake conditions for the modified cGAN model. This allows for more realistic sampling which can be used effectively in the proposed framework. As shown in Fig. 6, the fake conditions generated by LHS much less realistic. Therefore, generating samples with LHS is likely to be a mechanically nonexistent solution.

A comparison of the sampling strategies for fake conditions: (a) random and (b) k-NN.
Figure 6:

A comparison of the sampling strategies for fake conditions: (a) random and (b) k-NN.

4.2 Evaluation

Figure 7 shows the evaluation procedure of the trained model. The procedure is as follows:

The evaluation procedure of generator (G).
Figure 7:

The evaluation procedure of generator (G).

(a) The number of i fake conditions are sampled. Equation (13) states a set of fake (target) conditions |$\left[ \mathcal {D}_{t}, \mathcal {H}_{t} \right]$|⁠.

(13)

(b) The linkage mechanism length samples are synthesized with G with |$\left[ \mathcal {D}_{t}, \mathcal {H}_{t} \right]$|⁠. We denote this dataset |$X_{syn}$|⁠.

(c) |$d_{r}$| and |$\eta _r$| values of |$X_{syn}$| are calculated. Equation (14) states a set of actual conditions |$\left[ \mathcal {D}_{r}, \mathcal {H}_{r} \right]$| calculated from |$X_{syn}$|⁠.

(14)

(d) Finally, the model is evaluated by calculating errors between |$\left[ \mathcal {D}_{t}, \mathcal {H}_{t} \right]$| and |$\left[ \mathcal {D}_{r}, \mathcal {H}_{r} \right]$|⁠.

The trained model was tested with two cases. Firstly, 100 000 fake conditions were sampled with k-NN to test the model performance in generating mechanism samples that satisfy the given target conditions. Secondly, 100 samples (⁠|$i=100$|⁠) with a single (same) condition were used to test the ability of the model to produce diverse mechanism samples.

Multiple conditions: Root mean squared error (RMSE), mean absolute error (MAE), and |$R^2$| scores were used to evaluate the performance of the trained cGAN model in Table 2. As shown, G was able to generate synthetic linkage mechanisms that satisfy both of the target conditions with marginal errors. The standard deviations of the generated samples were measured in Table 3.

Table 2:

The performance of the trained model for multiple conditions.

|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.1470.894
MAE0.1100.398
|$R^2$|0.9580.850
|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.1470.894
MAE0.1100.398
|$R^2$|0.9580.850
Table 2:

The performance of the trained model for multiple conditions.

|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.1470.894
MAE0.1100.398
|$R^2$|0.9580.850
|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.1470.894
MAE0.1100.398
|$R^2$|0.9580.850
Table 3:

The standard deviation of the synthesized sample lengths for multiple conditions.

|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.2500.1960.6100.1260.273
|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.2500.1960.6100.1260.273
Table 3:

The standard deviation of the synthesized sample lengths for multiple conditions.

|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.2500.1960.6100.1260.273
|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.2500.1960.6100.1260.273

Figure 8 shows the scatter plots between the target and the actual conditions. G was mostly able to produce the samples that satisfy the target conditions. However, it struggled to match |$\eta _t$| when |$\eta _t \gt 6$|⁠. We suspect this is due to the lack of data in this region; as shown in Fig. 4(b), |$X_{train}$| naturally has much more data where |$\eta _{min} \lt 6$|⁠, even though |$X_{train}$| was generated with random linkage lengths. This means that G would have been trained to synthesize better where |$d_{max}$| and |$\eta _{min}$| are mostly concentrated, as the fake conditions were generated based on the distribution of the conditions of |$X_{train}$|⁠. Moreover, |$d_{max}$| gets extremely low as |$\eta _{min}$| increases, and vice versa, which may not be useful for real-world use. Therefore, one may want a mechanism that reasonably satisfies both of the requirements, in which the proposed model provides.

The scatter plots of (a) $d_t$ vs $d_r$ and (b) $\eta _t$ vs $\eta _r$. The dashed line in red is $y=x$.
Figure 8:

The scatter plots of (a) |$d_t$| vs |$d_r$| and (b) |$\eta _t$| vs |$\eta _r$|⁠. The dashed line in red is |$y=x$|⁠.

Single condition: The condition set was fixed to |$d_t = 1.0, \eta _t = 2.0$| to evaluate the model performance in generating diverse samples. In other words, |$\left[ \mathcal {D}_{t}, \mathcal {H}_{t} \right]$| now have the same values regardless of i. Table 4 shows the error metrics of the model given the same condition. Note that the |$R^2$| metric is not used as the conditions are the same in this case. The standard deviation of the synthesized sample lengths is shown in Table 5. As expected, the diversity of the generated samples for the single condition is in general lower than that for the multiple conditions in Table 3 to achieve the accuracy. Interestingly, the standard deviations of |$\mathrm{EE}_x$| and |$\mathrm{EE}_y$| are a bit higher for the single condition, which improves the diversity even when a single condition is given.

Table 4:

The performance of the trained model for the single condition.

|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.2650.295
MAE0.1740.262
|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.2650.295
MAE0.1740.262
Table 4:

The performance of the trained model for the single condition.

|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.2650.295
MAE0.1740.262
|$\left[ \mathcal {D}_{t}, \mathcal {D}_{r} \right]$||$\left[ \mathcal {H}_{t}, \mathcal {H}_{r} \right]$|
RMSE0.2650.295
MAE0.1740.262
Table 5:

The standard deviation of the synthesized sample lengths for the single condition.

|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.0430.1390.2300.3360.282
|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.0430.1390.2300.3360.282
Table 5:

The standard deviation of the synthesized sample lengths for the single condition.

|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.0430.1390.2300.3360.282
|$l_2$||$l_3$||$l_4$||$\mathrm{EE}_x$||$\mathrm{EE}_y$|
0.0430.1390.2300.3360.282

From these metrics, it can be seen that the model is able to synthesize diverse mechanism samples while satisfying the target conditions with marginal errors.

5. Ablation studies

We have proposed few modifications on the baseline cGAN to facilitate the generation of linkage mechanisms. In Section 5.1, we evaluate the effectiveness of these modifications by performing a quantitative performance analysis of cGAN with and without these modifications. Moreover, in Section 5.2, we also compare our model with other well-established optimization and generative models to assess our contributions.

5.1 Modifications on cGAN

This study proposed few modifications on the baseline cGAN in Section 4.1 to improve the synthesis performance for four-bar mechanism synthesis. In this section, we compare the performance of the cGAN with and without these modifications and assess the effectiveness of the suggested modifications. Table 6 shows the four models built for the ablation study of the proposed cGAN. The predictor loss (⁠|$\mathcal {L}_P$|⁠), similarity loss (⁠|$\mathcal {L}_s$|⁠), and k-NN are the three key elements we introduced to improve the performance of cGAN for mechanism synthesis.

Table 6:

The four cGAN models built for the ablation study on the added elements of cGAN.

ModelPredictor (⁠|$\mathcal {L}_P$|⁠)Similarity (⁠|$\mathcal {L}_s$|⁠)k-NN
AXXO
BOXO
CXOO
DOOX
EOOO
ModelPredictor (⁠|$\mathcal {L}_P$|⁠)Similarity (⁠|$\mathcal {L}_s$|⁠)k-NN
AXXO
BOXO
CXOO
DOOX
EOOO
Table 6:

The four cGAN models built for the ablation study on the added elements of cGAN.

ModelPredictor (⁠|$\mathcal {L}_P$|⁠)Similarity (⁠|$\mathcal {L}_s$|⁠)k-NN
AXXO
BOXO
CXOO
DOOX
EOOO
ModelPredictor (⁠|$\mathcal {L}_P$|⁠)Similarity (⁠|$\mathcal {L}_s$|⁠)k-NN
AXXO
BOXO
CXOO
DOOX
EOOO

To compare the effectiveness of k-NN, the model without k-NN (model D) was trained by simply sampling target conditions directly from the training dataset.

For the best results, we performed hyperparameter optimization for the model training. The hyperparameters to be optimized are the learning rates of G and D, and the weights for the predictor loss (⁠|$w_P$|⁠) and similarity loss (⁠|$w_s$|⁠). |$[0.1, 0.01, 0.001, 0.0001]$| were used as a grid for all the hyperparameters. The set of hyperparameters with the lowest |$\mathcal {L}_P$| was used for the evaluation of each model. It is not feasible to choose one with the lowest |$\mathcal {L}_s$| as it is always achieved by making the linkage lengths very long, showing very high |$\mathcal {L}_P$|⁠.

Figure 9 shows the comparison of |$\mathcal {L}_P$| and |$\mathcal {L}_s$| of the trained ablation models. Compared to the baseline cGAN model (Model A), it is shown that the addition of P (Model B) improves |$\mathcal {L}_P$|⁠, while the sole introduction of |$\mathcal {L}_s$| (Model C) slightly improves |$\mathcal {L}_s$| while sacrificing |$\mathcal {L}_P$|⁠. The improvements were more noticeable when both |$\mathcal {L}_P$| and |$\mathcal {L}_s$| were applied (Model E), showing much better results than Model A.

$\mathcal {L}_P$ and $\mathcal {L}_s$ of the ablation models. The lower the better.
Figure 9:

|$\mathcal {L}_P$| and |$\mathcal {L}_s$| of the ablation models. The lower the better.

When comparing the effectiveness of k-NN for the sampling of target conditions (Model D and E), it was empirically shown that the model with k-NN applied yields better results in terms of both accuracy and diversity. Moreover, k-NN offers advantages such as learning from diverse target conditions, improving generalization, enhancing robustness, and handling limited datasets or underrepresented regions of the target condition space. Nonetheless, when data are abundant, directly sampling target conditions from the training dataset may be more computationally efficient, while k-NN can be used when data are scarce or model performance is the primary concern.

5.2 Model performance comparison

The cGAN approach offers several advantages in the context of mechanism synthesis. It can learn complex relationships between mechanism parameters and performance metrics to generate novel and diverse designs that satisfy given target conditions.

Thus, to assess our contributions for the generation of target-compliant linkage mechanisms, we compare the performance of the proposed model for mechanism synthesis to other well-established models.

5.2.1 Selected models for comparison

NSGA-II (Deb et al., 2002), a widely used evolutionary algorithm for multi-objective optimization, is often applied to maximize the potential of the design space. It has been successfully employed in various mechanical engineering applications, including mechanism design and optimization (Al-Juboori & Datta, 2019; Shahid et al., 2021; Liu et al., 2023). Deshpande & Purwar (2019a, 2020) were chosen for comparison. It is important to note that the approach of Deshpande & Purwar (2019a) for mechanism synthesis using VAE is different to our approach, thus this should not be considered as a direct performance comparison of our method to theirs.

Further, to assess the performance of the proposed cGAN with state-of-the-art generative models for engineering design, we also considered PcDGAN (Heyrani Nobari et al., 2021) for comparison.

PcDGAN enhances the diversity and conditioning quality of generated samples by integrating the DPP kernel and the Lambert Log Exponential Transition Score (LLETS). The DPP kernel ensures maximal diversity by selecting subsets of samples based on the determinant of a kernel matrix, promoting comprehensive coverage of the design space. The LLETS function evaluates conditioning quality, guiding the generator to produce samples that accurately meet target conditions through a self-reinforcing gradient mechanism. Additionally, PcDGAN introduces a singular vicinal loss to address data imbalance and sparsity. This loss uniformly selects labels and applies the vicinal loss to a single label’s vicinity in each training step, encouraging diverse sample generation across all conditions. These components address two primary challenges in continuous conditioning GANs: poor performance on nonuniform performance distributions and limited design space coverage. The DPP kernel and singular vicinal loss ensure diverse sample generation across the design space, while the combination of DPP-based loss and LLETS ensures accurate conditioning and extensive design space exploration. Thus, PcDGAN effectively supports engineering design and other applications requiring diverse and condition-specific solutions.

In our study, we employed arguably more simple k-NN based fake condition sampling and similarity loss (⁠|$\mathcal {L}_s$|⁠) based on nearest Euclidean distances explained in Section 4.1 to tackle similar issues. It would be interesting to compare the effectiveness of this approach with PcDGAN’s methods, as both strategies aim to enhance performance in the face of nonuniform distributions and improve design space coverage.

5.2.2 Experiment settings

NSGA-II: The NSGA-II algorithm employed in this study aims to optimize nonuniform performance distributions and enhance design space coverage. The algorithm starts with an initial population of 100 individuals. Each generation produces 200 offspring through genetic operations, with a crossover probability of 0.7 and a mutation probability of 0.2. The fitness function minimizes the absolute differences between predicted (using the same predictor (P) as cGAN) and target performance metrics, ensuring solutions meet the desired criteria while exploring diverse design space regions. The algorithm runs for 50 generations, monitoring performance through statistical metrics and maintaining the best solutions in a Hall of Fame.

cVAE: The cVAE used in this study consists of an encoder and a decoder, similar to cGAN. The encoder takes as input the linkage data and the conditions, and the encoder outputs the mean (mu) and log variance of the latent space distribution. The decoder is a mirrored version of the encoder, taking the latent vector and the conditions as input and reconstructing the linkage data. Both the encoder and the decoder of the cVAE model shares the same architecture with G of the proposed cGAN model, which is an MLP with five fully-connected layers with 100 neurons each. The loss function used for training the cVAE shown in equation (15) is a combination of the MSE loss between the input linkage data and the reconstructed linkage data, and the Kullback–Leibler divergence loss, which regularizes the latent space distribution to follow a standard normal distribution. |$\beta$| was fixed to 1.0 for a well-structured latent space for synthesis.

The cVAE was trained on the same dataset as the cGAN. The batch size was set to 10 000, and the model was trained for 1000 epochs with early stopping applied on the validation loss with patience of 20. The train and the validation dataset were split into 9:1 ratio. The hyperparameter optimization was also performed on the cVAE model for a fairer comparison using the base configurations of Optuna (Akiba et al., 2019). The optimized hyperparameters were the learning rate of |$8.65 \times 10^{-3}$| and the latent dimension of 7.

(15)

PcDGAN: The PcDGAN model utilized in this study is configured with specific hyperparameters to ensure effective training. The soft vicinal loss was used. The vicinal loss kappa is set to −1.0 for automatic calculation and scaling, while the sigma parameter is similarly set to −1.0 for automatic determination. PcDGAN parameters include the parameter to control the trade-off between the conditioning score and diversity (⁠|$\lambda _0$|⁠) which was set to 3.0, the weight of DPP loss (⁠|$\lambda _1$|⁠) set to 0.5, and the Lambert cutoff parameter set to 4.7. The learning rates for both the generator and discriminator are set at 0.0001. The training process is configured to run for 50 000 steps with a batch size of 32. These are the default training hyperparameters in the code provided by the authors of PcDGAN (Heyrani Nobari et al., 2021) in their paper. We refer to their paper and code for the specific details of the training hyperparameters. As done with the cVAE model, we performed hyperparameter optimization to explore potential improvements; however, no better results were observed compared to the default parameters. Consequently, we adhered to the original settings provided by the authors.

Sample generation: Although NSGA-II is a potent algorithm capable of generating multiple optimized samples, typical optimization-based algorithms are not designed to generate 100 000 samples in short time. In other words, it was not possible to generate 100 000 samples with NSGA-II within a reasonable timeframe due to the complex nature of the algorithm and the computational constraints. Thus, the accuracy and diversity of the selected models for comparison were calculated with 100 samples each for four different target conditions. Predictor (P), the same surrogate model used to train the proposed cGAN, was also used for NSGA-II to evaluate the samples during generation.

5.2.3 Results

The quantitative comparison of their performance is shown in Table 7. The proposed cGAN model shows lower diversity loss (⁠|$\mathcal {L}_s$|⁠) than NSGA-II and cVAE, meaning that it can generate more diverse samples, giving more choices to select a suitable mechanism design for one’s needs. Although NSGA-II has shown higher accuracy on average, it is important to note that the model generated many invalid samples, even with much lower diversity of the samples.

Table 7:

The synthesis performance comparison of the proposed cGAN, traditional cVAE, NSGA-II, and PcDGAN for the target conditions.

Target conditions(a)(b)(c)(d)
|$d_t$|0.41.02.02.5
|$\eta _t$|5.02.01.51.0Average
cGANRMSE0.3400.2950.3610.3370.333
|$\mathcal {L}_s$|−0.114−0.127−0.132−0.125−0.125
cVAERMSE0.6640.2750.3120.3420.398
|$\mathcal {L}_s$|−0.007−0.007−0.011−0.008−0.010
NSGA-IIRMSE0.0590.0590.4800.0300.278
|$\mathcal {L}_s$|0.000−0.0010.000−0.093−0.003
invalid (%)4208723.25
PcDGANRMSE0.9930.4120.2920.3000.499
|$\mathcal {L}_s$|−0.218−0.215−0.232−0.198−0.216
invalid (%)015175.75
Target conditions(a)(b)(c)(d)
|$d_t$|0.41.02.02.5
|$\eta _t$|5.02.01.51.0Average
cGANRMSE0.3400.2950.3610.3370.333
|$\mathcal {L}_s$|−0.114−0.127−0.132−0.125−0.125
cVAERMSE0.6640.2750.3120.3420.398
|$\mathcal {L}_s$|−0.007−0.007−0.011−0.008−0.010
NSGA-IIRMSE0.0590.0590.4800.0300.278
|$\mathcal {L}_s$|0.000−0.0010.000−0.093−0.003
invalid (%)4208723.25
PcDGANRMSE0.9930.4120.2920.3000.499
|$\mathcal {L}_s$|−0.218−0.215−0.232−0.198−0.216
invalid (%)015175.75
Table 7:

The synthesis performance comparison of the proposed cGAN, traditional cVAE, NSGA-II, and PcDGAN for the target conditions.

Target conditions(a)(b)(c)(d)
|$d_t$|0.41.02.02.5
|$\eta _t$|5.02.01.51.0Average
cGANRMSE0.3400.2950.3610.3370.333
|$\mathcal {L}_s$|−0.114−0.127−0.132−0.125−0.125
cVAERMSE0.6640.2750.3120.3420.398
|$\mathcal {L}_s$|−0.007−0.007−0.011−0.008−0.010
NSGA-IIRMSE0.0590.0590.4800.0300.278
|$\mathcal {L}_s$|0.000−0.0010.000−0.093−0.003
invalid (%)4208723.25
PcDGANRMSE0.9930.4120.2920.3000.499
|$\mathcal {L}_s$|−0.218−0.215−0.232−0.198−0.216
invalid (%)015175.75
Target conditions(a)(b)(c)(d)
|$d_t$|0.41.02.02.5
|$\eta _t$|5.02.01.51.0Average
cGANRMSE0.3400.2950.3610.3370.333
|$\mathcal {L}_s$|−0.114−0.127−0.132−0.125−0.125
cVAERMSE0.6640.2750.3120.3420.398
|$\mathcal {L}_s$|−0.007−0.007−0.011−0.008−0.010
NSGA-IIRMSE0.0590.0590.4800.0300.278
|$\mathcal {L}_s$|0.000−0.0010.000−0.093−0.003
invalid (%)4208723.25
PcDGANRMSE0.9930.4120.2920.3000.499
|$\mathcal {L}_s$|−0.218−0.215−0.232−0.198−0.216
invalid (%)015175.75

PcDGAN showed the best diversity while not sacrificing too much accuracy, although it generated some invalid samples. No invalid samples were produced with cGAN or cVAE. cVAE was not able to produce more accurate or diverse samples than cGAN or NSGA-II.

Figure 10 shows the distribution of the resulting |$d_r$| and |$\eta _r$| of the generated samples. The generated samples (population) of NSGA-II had a lot of duplicate samples, where <10% of the generated samples were not duplicates, reducing the design choices further. As shown in the figure, NSGA-II tries to optimize samples to the target as much as possible, whereas cGAN has more diverse distribution that covers larger design space at the cost of slightly lower accuracy. The samples generated PcDGAN model also covers the area around the target conditions, showing its strength in terms of diversity. Figure 11 is the visualization of few mechanisms generated by the models for qualitative comparison.

The distribution of $d_r, \eta _r$ of the generated mechanism samples for cGAN, VAE, NSGA-II, and PcDGAN for the given target conditions. In NSGA-II, the duplicate samples among the generated samples were merged into one for visualization due to the model generating too many duplicates (same till three decimal places).
Figure 10:

The distribution of |$d_r, \eta _r$| of the generated mechanism samples for cGAN, VAE, NSGA-II, and PcDGAN for the given target conditions. In NSGA-II, the duplicate samples among the generated samples were merged into one for visualization due to the model generating too many duplicates (same till three decimal places).

A comparison of the generated samples from the proposed cGAN, cVAE, NSGA-II, and PcDGAN for the given target conditions.
Figure 11:

A comparison of the generated samples from the proposed cGAN, cVAE, NSGA-II, and PcDGAN for the given target conditions.

The cGAN architecture, consisting of a generator and a discriminator, encourages the generator to produce accurate and realistic samples that can fool the discriminator. By incorporating the desired target conditions into the generator’s input, the model learns to create samples that are both diverse and accurate in meeting the specified criteria. The introduction of a diversity loss term in the objective function promotes the generation of diverse samples by penalizing the model for producing overly similar designs. The cGAN model leverages the underlying patterns and relationships learned from the large training dataset to generate accurate and diverse samples without being limited to specific designs. Our experiments demonstrate that the cGAN model shows good performance compared to the cVAE and NSGA-II in terms of both accuracy and diversity, as the cVAE struggles to capture complex relationships and NSGA-II tends to converge to a narrow set of solutions.

Initially, we expected PcDGAN, with its sophisticated techniques such as DPP and LLETS, to outperform other models in terms of both accuracy and diversity. However, that was not the case in this comparative study. We believe these results can be somewhat explained by No Free Lunch Theorem proposed by Wolpert & Macready (1997) which is a concept in optimization and machine learning that states there is no single optimization algorithm that is universally better than all others when averaged across all possible problems. Although the DPP and LLETS approach performed well for the problems they stated for testing in the paper of Heyrani Nobari et al. (2021), they did not perform well in this specific domain.

These findings emphasize the value of thoroughly benchmarking different approaches, including both sophisticated and simpler methods, when tackling specific engineering design problems. While advanced techniques often bring novel capabilities, their complexity may not always translate to superior performance in every scenario. Our study underscores the importance of carefully considering the specific requirements and characteristics of the problem at hand when selecting or developing synthesis methods.

5.3 Model behavior on infeasible target conditions

An important consideration when using generative models for mechanism synthesis is how the model behaves when given target conditions that may be mechanically infeasible or extremely difficult to achieve. For example, as shown in Fig. 4(c) and Fig. 6, there is an area in the upper right of the condition space (both high |$d_{max}$| and |$\eta _{min}$|⁠) where no actual mechanism designs exist in the training data. It is valuable to examine how the proposed cGAN model handles these types of extreme or impossible target conditions. To test this, we conducted an experiment where we input an infeasible target condition of |$d_{t}=1.25$| and |$\eta _{t} = 8$| into the trained models. Figure 12 shows the results. Interestingly, even though no mechanism exists in the training data that exactly matches this target condition, the cGAN model still generates designs that come as close as possible to the specified targets while remaining mechanically valid. In other words, it finds the nearest feasible designs in the learned design space and generates mechanisms accordingly. This is an important capability for an intuitive mechanism synthesis tool. Designers may not always know in advance whether a given set of performance requirements are physically achievable. The proposed model still returns the closest possible functioning designs even if the specified targets are not perfectly feasible. Overall, this experiment demonstrates the robustness of the proposed cGAN synthesis framework.

Visualization of mechanism designs generated by the proposed cGAN model for the infeasible target condition of $d_{t}=1.25$ and $\eta _{t}=8$.
Figure 12:

Visualization of mechanism designs generated by the proposed cGAN model for the infeasible target condition of |$d_{t}=1.25$| and |$\eta _{t}=8$|⁠.

6. Conclusions

6.1 Summary

In this paper, we presented a novel approach utilizing a modified cGAN model framework equipped with a predictor and diversity loss, aimed at synthesizing mechanisms accurately and diversely. Specifically, our model was designed to generate crank-rocker mechanisms fulfilling specified target conditions, particularly focusing on kinematic (⁠|$d_{max}$|⁠) and quasi-static (⁠|$\eta _{min}$|⁠) conditions. By integrating these conditions, we aimed to produce mechanisms with various workspaces while ensuring the efficient transfer of payloads. Initially, we trained the model using a dataset comprising 100 000 mechanism samples. While the theoretical range for sampling linkage lengths is vast, for model testing purposes, we set the frame length (⁠|$l_1$|⁠) to 1.0, allowing the other link lengths to be considered as ratios relative to the frame. The rationale for considering the link length as a scale without units is that it can be employed in a wide range of real applications with varying scale sizes. These link lengths were then sampled using LHS within predefined ranges based on empirical knowledge. Upon training the cGAN model and conducting tests across various target conditions, we observed that the model efficiently generated diverse mechanism samples, accurately meeting the specified conditions. Furthermore, we conducted a comparative analysis involving our proposed cGAN model, a traditional cVAE, NSGA-II, and PcDGAN. By generating 100 samples for four distinct target conditions, we demonstrated the capability of our cGAN model in producing diverse samples while maintaining comparable levels of accuracy.

6.2 Limitations and future work

The proposed mechanism synthesis method has several limitations that need further exploration and refinement:

Engineering considerations: The linkage system used in this study simplifies many factors, such as mass and inertia. To apply quasi-static conditions for real-world applications, additional engineering aspects need to be considered through 3D CAD model simulations. Future research should integrate dynamic considerations for applications like manipulators and suspensions.

Various types of mechanisms: This study focused solely on crank-rocker mechanisms. However, other mechanisms, such as double-rocker mechanisms, were not considered. For instance, double-rocker mechanisms have limited and discontinuous crank rotation angles, leading to multiple workspace paths. Future work should explore and classify these mechanisms to develop more comprehensive design methods.

Replication of results

The code is available at https://github.com/jihoonkim888/LinkGAN.

Conflict of interest statement

The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Author contributions

Sumin Lee (Conceptualization, Investigation, Methodology, Formal analysis, Visualization, Writing—original draft, Writing—review & editing), Jihoon Kim (Conceptualization, Data curation, Formal analysis, Writing—original draft, Writing—review & editing), Namwoo Kang (Supervision, Writing—review & editing).

Acknowledgement

This work was supported by the National Research Foundation of Korea grant (2018R1A5A7025409), the Ministry of Science and ICT of Korea grant (nos. 2022-0-00969 and 2022-0-00986), and the Ministry of Trade, Industry & Energy grant (RS-2024-00410810).

References

Acharyya
 
S.
,
Mandal
 
M.
(
2009
).
Performance of eas for four-bar linkage synthesis
.
Mechanism and Machine Theory
,
44
,
1784
1794
.

Ahmadi
 
B.
,
Ahmadi
 
B.
(
2022
).
Optimal synthesis of crank-rocker mechanisms with optimum transmission angle for desired stroke and time-ratio using genetic programming
.
Advances in Mechanical Engineering
,
14
,
16878132221131291
.

Akbari
 
S.
,
Fallahi
 
F.
,
Pirbodaghi
 
T.
(
2016
).
Dynamic analysis and controller design for a slider–crank mechanism with piezoelectric actuators
.
Journal of Computational Design and Engineering
,
3
,
312
321
.

Akiba
 
T.
,
Sano
 
S.
,
Yanase
 
T.
,
Ohta
 
T.
,
Koyama
 
M.
(
2019
).
Optuna: A next-generation hyperparameter optimization framework
. In
Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining
(pp.
2623
2631
.).
Association for Computing Machinery

Al-Juboori
 
M.
,
Datta
 
B.
(
2019
).
Optimum design of hydraulic water retaining structures incorporating uncertainty in estimating heterogeneous hydraulic conductivity utilizing stochastic ensemble surrogate models within a multi-objective multi-realisation optimisation model
.
Journal of Computational Design and Engineering
,
6
,
296
315
.

Barton
 
M.
,
Elber
 
G.
,
Hanniel
 
I.
(
2010
).
Topologically guaranteed univariate solutions of underconstrained polynomial systems via no-loop and single-component tests
. In
Proceedings of the 14th ACM Symposium on Solid and Physical Modeling
(pp.
207
212
.).
Association for Computing Machinery
.

Barton
 
M.
,
Shragai
 
N.
,
Elber
 
G.
(
2009
).
Kinematic simulation of planar and spatial mechanisms using a polynomial constraints solver
.
Computer-Aided Design and Applications
,
6
,
115
123
.

Burmester
 
L.
(
1888
).
Lehrbuch der Kinematik
.
Leipzig
.

Cabrera
 
J.
,
Simon
 
A.
,
Prado
 
M.
(
2002
).
Optimal synthesis of mechanisms with genetic algorithms
.
Mechanism and Machine Theory
,
37
,
1165
1177
.

Chawla
 
N. V.
,
Bowyer
 
K. W.
,
Hall
 
L. O.
,
Kegelmeyer
 
W. P.
(
2002
).
Smote: synthetic minority over-sampling technique
.
Journal of Artificial Intelligence Research
,
16
,
321
357
.

Chen
 
W.
,
Ahmed
 
F.
(
2021
).
Padgan: Learning to generate high-quality novel designs
.
Journal of Mechanical Design
,
143
,
031703
.

Deb
 
K.
,
Pratap
 
A.
,
Agarwal
 
S.
,
Meyarivan
 
T.
(
2002
).
A fast and elitist multiobjective genetic algorithm: Nsga-ii
.
IEEE Transactions on Evolutionary Computation
,
6
,
182
197
.. .

Deshpande
 
S.
,
Purwar
 
A.
(
2017
).
A task-driven approach to optimal synthesis of planar four-bar linkages for extended burmester problem
.
Journal of Mechanisms and Robotics
,
9
,
061005
.

Deshpande
 
S.
,
Purwar
 
A.
(
2019a
).
Computational creativity via assisted variational synthesis of mechanisms using deep generative models
.
Journal of Mechanical Design
,
141
,
121402
.

Deshpande
 
S.
,
Purwar
 
A.
(
2019b
).
A machine learning approach to kinematic synthesis of defect-free planar four-bar linkages
.
Journal of Computing and Information Science in Engineering
,
19
,
021004
.

Deshpande
 
S.
,
Purwar
 
A.
(
2020
).
An image-based approach to variational path synthesis of linkages
. In
International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, Volume 10: 44th Mechanisms and Robotics Conference (MR)
.

Deshpande
 
S.
,
Purwar
 
A.
(
2021
).
An image-based approach to variational path synthesis of linkages
.
Journal of Computing and Information Science in Engineering
,
21
,
021005
.

Ding
 
X.
,
Wang
 
Y.
,
Xu
 
Z.
,
Welch
 
W. J.
,
Wang
 
Z. J.
(
2023
).
Continuous conditional generative adversarial networks: Novel empirical losses and label input mechanisms
.
IEEE Transactions on Pattern Analysis and Machine Intelligence
,
45
,
8143
8158
.. .

Erdman
 
A. G.
(
1981
).
Three and four precision point kinematic synthesis of planar linkages
.
Mechanism and Machine Theory
,
16
,
227
245
.

Glorot
 
X.
,
Bordes
 
A.
,
Bengio
 
Y.
(
2011
).
Deep sparse rectifier neural networks
. In
Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics
(pp.
315
323
.).
JMLR Workshop and Conference Proceedings
.

Goodfellow
 
I.
,
Pouget-Abadie
 
J.
,
Mirza
 
M.
,
Xu
 
B.
,
Warde-Farley
 
D.
,
Ozair
 
S.
,
Courville
 
A.
,
Bengio
 
Y.
(
2020
).
Generative adversarial networks
.
Communications of the ACM
,
63
,
139
144
.

Gu
 
Y.
,
Wang
 
Z.
,
Feng
 
S.
,
Sun
 
H.
,
Lu
 
H.
,
Pan
 
J.
,
Wan
 
F.
,
Song
 
C.
(
2023
).
Computational design towards energy efficient optimization in overconstrained robotic limbs
.
Journal of Computational Design and Engineering
,
10
,
1941
1956
.

Han
 
S. M.
,
Kim
 
Y. Y.
(
2021
).
Topology optimization of linkage mechanisms simultaneously considering both kinematic and compliance characteristics
.
Journal of Mechanical Design
,
143
,
061704
.

Heyrani Nobari
 
A.
,
Chen
 
W.
,
Ahmed
 
F.
(
2021
).
Pcdgan: A continuous conditional diverse generative adversarial network for inverse design
. In
Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining
(pp.
606
616
.).
Association for Computing Machinery
.

Heyrani Nobari
 
A.
,
Srivastava
 
A.
,
Gutfreund
 
D.
,
Ahmed
 
F.
(
2022
).
Links: A dataset of a hundred million planar linkage mechanisms for data-driven kinematic design
. In
International Design Engineering Technical Conferences and Computers and Information in Engineering Conference
(vol.
86229
, pp.
V03AT03A013
).
American Society of Mechanical Engineers
.

Kang
 
S. W.
,
Kim
 
S. I.
,
Kim
 
Y. Y.
(
2016
).
Topology optimization of planar linkage systems involving general joint types
.
Mechanism and Machine Theory
,
104
,
130
160
.

Kim
 
Y. Y.
,
Jang
 
G.-W.
,
Park
 
J. H.
,
Hyun
 
J. S.
,
Nam
 
S. J.
(
2006
).
Automatic synthesis of a planar linkage mechanism with revolute joints by using spring-connected rigid block models
.
Journal of Mechanical Design
,
129
,
930
940
.. .

Kingma
 
D. P.
,
Welling
 
M.
(
2013
).
Auto-encoding variational bayes
.
preprint (arXiv:1312.6114)
.

Kulesza
 
A.
,
Taskar
 
B.
(
2012
).
Determinantal point processes for machine learning
.
Foundations and Trends® in Machine Learning
,
5
,
123
286
.

Lee
 
T.-H.
,
Choi
 
D.
,
Lee
 
W.
(
2021
).
Computational design and workspace analysis of a passive motion-scaling mechanism based on pantograph for microsurgery
.
Journal of Computational Design and Engineering
,
8
,
1446
1467
.

Lee
 
T.-H.
,
Choi
 
D.
,
Kim
 
C.
(
2023
).
Fully mechanical motion-scaling instrument for microsurgery assistance: design improvement for enhancing the dynamic performance
.
Journal of Computational Design and Engineering
,
10
,
1010
1025
.

Lee
 
M.-Y.
,
Erdman
 
A.
,
Faik
 
S.
(
1999
).
A generalized performance sensitivity synthesis methodology for four-bar mechanisms
.
Mechanism and Machine Theory
,
34
,
1127
1139
.

Li
 
X.
,
Lv
 
H.
,
Zhao
 
P.
,
Lu
 
Q.
(
2022
).
A fourier approach to kinematic acquisition of geometric constraints of planar motion for practical mechanism design
.
Journal of Mechanical Design
,
144
,
123302
.

Liu
 
G.
,
Wei
 
P.
,
Liu
 
H.
,
Du
 
X.
,
Hu
 
R.
,
He
 
H.
,
Zhou
 
P.
,
Tan
 
X.
(
2023
).
Transmission accuracy–axial backlash–fatigue life-driven tolerance optimization of planetary roller screw mechanism
.
Journal of Computational Design and Engineering
,
10
,
2401
2421
.

McKay
 
M.
,
Beckman
 
R.
,
Conover
 
W.
(
1979
).
Comparison of three methods for selecting values of input variables in the analysis of output from a computer code
.
Technometrics
,
21
,
239
245
.

Mirza
 
M.
,
Osindero
 
S.
(
2014
).
Conditional generative adversarial nets
.
preprint (arXiv:1411.1784)
.

Nie
 
Z.
,
Lin
 
T.
,
Jiang
 
H.
,
Kara
 
L. B.
(
2021
).
Topologygan: Topology optimization using generative adversarial networks based on physical fields over the initial domain
.
Journal of Mechanical Design
,
143
,
031715
.

Oh
 
S.
,
Jung
 
Y.
,
Kim
 
S.
,
Lee
 
I.
,
Kang
 
N.
(
2019
).
Deep generative design: Integration of topology optimization and generative models
.
Journal of Mechanical Design
,
141
,
111405
.

Raghavan
 
M.
(
2004
).
Suspension design for linear toe curves: a case study in mechanism synthesis
.
Journal of Mechanical Design
,
126
,
278
282
.. .

Regenwetter
 
L.
,
Nobari
 
A. H.
,
Ahmed
 
F.
(
2022
).
Deep generative models in engineering design: A review
.
Journal of Mechanical Design
,
144
,
071704
.

Sandor
 
G. N.
(
1959
).
A General Complex-Number Method for Plane Kinematic Synthesis with Applications
.
Columbia University
.

Sapietová
 
A.
,
Štalmach
 
O.
,
Sapieta
 
M.
(
2020
).
Synthesis and sensitivity analysis of the crank-rocker mechanism
. In
IOP Conference Series: Materials Science and Engineering
(vol.
776
, pp.
012060
).
IOP Publishing
.

SAR
 
S. M.
,
Kanagaraj
 
G.
,
Yu
 
V. F.
(
2023
).
Gravitation search-based hybrid algorithm for solving inverse kinematics of an n-link redundant manipulator
.
Journal of Computational Design and Engineering
,
10
,
2019
2035
.

Schröcker
 
H.-P.
,
Husty
 
M. L.
,
McCarthy
 
J. M.
(
2007
).
Kinematic mapping based assembly mode evaluation of planar four-bar mechanisms
.
Journal of Mechanical Design
,
129
,
924
929
.

Schröcker
 
H.-P.
,
Jüttler
 
B.
,
Aigner
 
M.
(
2009
).
Evolving four-bars for optimal synthesis
. In
Proceedings of EUCOMES 08: The Second European Conference on Mechanism Science
(pp.
109
116
.).
Springer
.

Shahid
 
H.
,
Jamwal
 
P.
,
Paulette
 
V.
(
2021
).
Design synthesis and optimization of a 4-sps intrinsically compliant parallel wrist rehabilitation robotic orthosis [j]
.
Journal of Computational Design and Engineering
,
6
,
6
.

Shin
 
S.
,
Shin
 
D.
,
Kang
 
N.
(
2023a
).
Topology optimization via machine learning and deep learning: A review
.
Journal of Computational Design and Engineering
,
10
,
1736
1766
.

Shin
 
Y. J.
,
Kim
 
G. T.
,
Kim
 
Y.
(
2023b
).
Optimal design of multi-linked knee joint for lower limb wearable robot
.
International Journal of Precision Engineering and Manufacturing
,
24
,
967
976
.

Shiwalkar
 
P.
,
Moghe
 
S.
,
Modak
 
J.
(
2022
).
Novel methodology for inflection circle-based synthesis of straight line crank rocker mechanism
.
Journal of Mechanisms and Robotics
,
14
,
055001
.

Simionescu
 
P.-A.
(
2018
).
Optimum synthesis of oscillating slide actuators for mechatronic applications
.
Journal of Computational Design and Engineering
,
5
,
215
231
.

Tsai
 
M.-J.
,
Lai
 
T.-H.
(
2004
).
Kinematic sensitivity analysis of linkage with joint clearance based on transmission quality
.
Mechanism and Machine Theory
,
39
,
1189
1206
.

Ullah
 
I.
,
Kota
 
S.
(
1997
).
Optimal synthesis of mechanisms for path generation using fourier descriptors and global search methods
.
Journal of Mechanical Design
,
119
,
504
510
.

Wang
 
J.-Y.
,
Lan
 
C.-C.
(
2014
).
A Constant-Force Compliant Gripper for Handling Objects of Various Sizes
.
Journal of Mechanical Design
,
136
,
071008
. .

Wang
 
J.
,
Chen
 
B.
,
Wang
 
Y.
,
Pu
 
D.
,
Jia
 
X.
(
2024
).
Research on four-bar linkage trajectory synthesis using xgboost and genetic algorithm
.
Journal of Computational Design and Engineering
,
11
,
1
21
.

Wang
 
Z.
,
She
 
Q.
,
Ward
 
T. E.
(
2021
).
Generative adversarial networks in computer vision: A survey and taxonomy
.
ACM Computing Surveys (CSUR)
,
54
,
1
38
.

Wolpert
 
D. H.
,
Macready
 
W. G.
(
1997
).
No free lunch theorems for optimization
.
IEEE Transactions on Evolutionary Computation
,
1
,
67
82
.

Wongratanaphisan
 
T.
,
Cole
 
M. O. T.
(
2007
).
Analysis of a gravity compensated four-bar linkage mechanism with linear spring suspension
.
Journal of Mechanical Design
,
130
,
011006
. .

Yim
 
N. H.
,
Kang
 
S. W.
,
Kim
 
Y. Y.
(
2019
).
Topology optimization of planar gear-linkage mechanisms
.
Journal of Mechanical Design
,
141
,
032301
.

Yim
 
N. H.
,
Lee
 
J.
,
Kim
 
J.
,
Kim
 
Y. Y.
(
2021
).
Big data approach for the simultaneous determination of the topology and end-effector location of a planar linkage mechanism
.
Mechanism and Machine Theory
,
163
,
104375
.

Yu
 
J.
,
Han
 
S. M.
,
Kim
 
Y. Y.
(
2020
).
Simultaneous shape and topology optimization of planar linkage mechanisms based on the spring-connected rigid block model
.
Journal of Mechanical Design
,
142
,
011401
.

Yu
 
Y.
,
Hur
 
T.
,
Jung
 
J.
,
Jang
 
I. G.
(
2019
).
Deep learning for determining a near-optimal topological design without any iteration
.
Structural and Multidisciplinary Optimization
,
59
,
787
799
.

Yüksel
 
N.
,
Börklü
 
H. R.
,
Sezer
 
H. K.
,
Canyurt
 
O. E.
(
2023
).
Review of artificial intelligence applications in engineering design perspective
.
Engineering Applications of Artificial Intelligence
,
118
,
105697
.

Author notes

Sumin Lee and Jihoon Kim equal contribution.

This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (https://creativecommons.org/licenses/by-nc/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original work is properly cited. For commercial re-use, please contact [email protected]