An Invariant Representation of Coupler Curves using a Variational AutoEncoder - Application to Path Synthesis of Four-Bar Mechanisms

Representation and Synthesis of Coupler Curves of Planar Mechanisms using Deep Neural Networks

This paper focuses on the representation and synthesis of coupler curves of planar mechanisms using a deep neural network. The study compares four commonly used features or representations of four-bar coupler curves: Fourier descriptors, wavelets, point coordinates, and images. The results demonstrate that these diverse representations can be unified using a generative AI framework called Variational Autoencoder (VAE). This study shows that a VAE can provide a standalone representation of a coupler curve, regardless of the input representation, and that the compact latent dimensions of the VAE can be used to describe coupler curves of four-bar linkages. Additionally, a new approach that utilizes a VAE in conjunction with a fully connected neural network to generate dimensional parameters of four-bar linkage mechanisms is proposed. This research presents a novel opportunity for automated conceptual design of mechanisms for robots and machines.

Introduction

The challenge of path generation, which involves synthesis of linkage mechanisms, such as four-bar and higher-order ones, to follow a sequence of consecutive points (x_i, y_i) in R^2, has been the subject of numerous studies, yielding a multitude of proposed solutions. Often these solutions hinge on optimization approaches. These methods represent the coupler point path by precision points and utilize an objective function to minimize the error between them. Despite their prevalent use, they suffer from significant drawbacks, including slow optimization, dependence on initial conditions, and lack of guaranteed results, often failing to capture the true shape of a given path.

The complexity of these mechanisms is further emphasized by the nonlinear relationships between input and dimensional parameters. Even minor changes to the input can lead to a significantly different mechanism. In the context of coupler-curve generation for a four-bar linkage synthesis, the problem appears to be defined but is often considered over-determined, leaving the synthesis problem without an analytical solution. As the number of links in a mechanism grows beyond the simplicity of a four-bar linkage, it enables the production of more complex motions, which makes the design of such linkages considerably more challenging compared to four-bar linkages.

Due to these reasons, there has been a growing interest in using neural networks (NNs) for mechanism synthesis. NNs are widely recognized for their ability to approximate a class of mappings defined in Euclidean space. This further translates to their application in learning a mapping from design specifications of mechanism design problems to the dimensional parameters of mechanisms. The use of NNs in mechanism synthesis is motivated by a desire to address fundamental issues that lack analytical or theoretical foundations, such as synthesizing circuit-, branch-, and order-defect-free mechanisms, translating user intent into well-defined problems, and satisfying additional kinematic and geometric constraints.

Variational AutoEncoders (VAEs), a class of generative deep neural network models, offer the potential to approximate these non-linear relationships more effectively. Unlike conventional optimization methods, VAEs can provide a comprehensive representation of the entire path shape, offering numerous stable solutions. Once trained, VAEs eliminate the need for initial guesses, generate approximations from defect-free datasets, and provide a more robust response to minor input changes. Consequently, VAEs present a promising avenue for the synthesis of closed-loop linkage mechanisms, extending the potential for designing more complex systems with greater accuracy and efficiency.

A key challenge in the use of NNs for mechanism synthesis is the representation of mechanisms and their properties, which form a non-Euclidean space. In the case of planar four-bar mechanisms, a crucial property is the coupler curve generated by a floating link. To date, most researchers using NNs have utilized a Euclidean embedding of the input path, leading to various representations of the input coupler curves, including point coordinates, Fourier descriptors, wavelets, and 2D pixel representations in an image. Of these, Fourier and wavelet representations are derived from the point coordinates only, and therefore, they can be considered features instead. However, for simplicity, we will forego this distinction and call them representations only for the purpose of this paper. Despite these representations having produced effective outcomes, there have been no studies investigating the relative merits of different representations and their impact on linkage mechanism synthesis. This lack of knowledge has impeded the field’s progress in using modern machine learning algorithms for mechanism synthesis.

Approach and Methodology

This paper presents a machine learning approach for the generation of four-bar linkages that approximate a desired coupler curve. The approach uses a VAE and a Fully Connected Neural Network (FCNN) to generate a multitude of possible linkages. Four widely-utilized representations, namely Fourier descriptors, wavelets, point coordinates, and image-based representations, were investigated.

The input (desired) coupler curve is normalized to make it invariant with respect to translation, rotation, and scale. Each of the four representations is then fed to their respective pre-trained VAEs, which map the input curve to a latent space. The k-Nearest Neighbor (k-NN) search in the latent space yields k similar coupler curves represented as latent points. These k latent representations are input to a fully connected neural network to generate k mechanisms. This is a major difference between the previous approaches which would only yield a single mechanism for a desired coupler curve. The use of the VAE allows us to cluster similar looking coupler curves together, thus, providing us with several mechanisms approximating the input curve. This process is illustrated in the figure above.

The generated coupler curves were compared to the desired coupler curves by computing the mean square error (MSE). The representation with the lowest MSE was determined to be the most optimal representation. It is important to point out the initial starting points of the mechanisms compared are the same, thus, there is a one-to-one mapping between the points of two curves compared. In case the initial starting points of the two curves would be different, the MSE for two exactly similar curves would be high. In those cases, it would be necessary to consider other methods of curve comparison, such as Frechet Distance, Dynamic Time Warping, etc.

Results

The results demonstrate that all of the representations yield comparable outcomes, with the MSE values obtained from the wavelet- and point coordinates-based approaches being the lowest and similar to each other. Although the Fourier- and image-based approaches yielded higher MSE values, the generated linkages still provided a reasonable approximation of the input coupler curves. The MSE served as a useful and meaningful metric because the compared curves were closed and subsequently sampled and parameterized identically.

The results also indicate that the VAE can serve as a standalone representation of a coupler curve and that a 5D latent space of the VAE is sufficient to describe a coupler curve of a four-bar linkage. It is crucial to emphasize that there is no inherent relationship between the latent space and the actual characteristics of the coupler curves. This gives rise to the possibility of using latent space as the invariant description of coupler curves, which normalizes several different representations used in the literature.

The results of this study suggest that all of the representations generate several mechanisms that approximate the input coupler curve well and produce comparable outcomes. The similarities among the mechanisms generated using different representations indicate that the latent space of a Variational Autoencoder (VAE) can be used as an invariant representation of a coupler curve. The kNN search in the latent space, which led to similar curves and their mechanisms, provides evidence that this mapping is locally Euclidean.

This paper also explores the effects of linear interpolation between two random curve latent representations. Previous research has shown that reconstructing the interpolated latent representations directly from a VAE can result in unrealistic artifacts. In contrast, this study demonstrates that utilizing a Fully Connected Neural Network (FCNN) in conjunction with a VAE can overcome this problem by ignoring the decoder and producing coupler curves that smoothly morph from one input coupler curve to another, resulting in mechanisms that transform from one to another without singularity.

Contributions

This work makes two key contributions to the field. First, it investigates and compares effective representations of four-bar coupler curves and demonstrates that a normalized representation using a VAE can simplify storage and computation. Second, it proposes a combined VAE-FCNN architecture that learns an effective mapping from the task space (path) to the mechanism (dimensional parameters) and produces four-bar mechanisms by sampling and interpolating in the latent space of the VAE. Although this paper primarily focuses on the most widely-used planar four-bar mechanisms, the approach presented can be extended to high-order single-degree-of-freedom mechanisms.

An input curve consisting out of 360 (x, y) points is normalized, i.e., translated, scaled and rotated. Once normalized, one of the representations, for example wavelet descriptors, is computed and fed into the trained VAE which maps it to its latent space. Performing k-NN search in the latent space yields k latent vectors of coupler curves similar to the desired coupler curve. Taking these latent representations through a fully-connected neural network yields k mechanisms that approximate the desired input coupler curves. The output of the NN is a vector of unknown joint coordinates of mechanisms.