Computer-aided design (CAD) is the use of computers in the creation, modification, analysis or optimization of the design of objects ranging from coffee mugs to airplanes. It has replaced pencils and drafting boards with digital sketches that can greatly improve design precision and quality. The various CAD techniques however are complex and can require years of experience and expert knowledge to execute, especially in the creation of the highly structured 2D sketches that inform every 3D construction.
In a bid to make CAD more user-friendly and efficient, a research team from UK’s DeepMind and US-based product development platform Onshape has proposed an intelligent machine learning approach that generates high-quality sketches automatically, enabling engineers to create better designs with much less effort.
Sketches are at the heart of mechanical CAD and the main building block of 3D construction. A typical sketch consists of basic geometric entities like lines and arcs along with constraints such as tangency, perpendicularity and symmetry. These constraints are used to convey the design intention and define the shape transformations of the entities, i.e. they express relationships that can indirectly affect every entity in a sketch to ensure that the overall object shape remains consistent with the designer’s intentions even as the size and location of the entities are changed.
The complex interplay between CAD sketch entities makes it easy to accidentally specify for example a set of constraints that the constraint solver can not satisfy, resulting in an invalid sketch. Finding a method that can automatically and accurately draw high-quality sketches without such pitfalls is the goal of this work. The researchers were inspired by the idea that sketch construction could be considered analogous to natural language processing (NLP) techniques by likening the selection of the next sketch constraint or entity to the generation of the next word in a sentence.
The team summarizes their contributions as:
- Devise a method for describing structured objects using Protocol Buffers and demonstrate its flexibility on the domain of natural CAD sketches.
- Propose several techniques for capturing distributions of objects represented as serialized Protocol Buffers. The proposed approach draws inspiration from recent advances in language modelling while focusing on eliminating data redundancy.
- Collect a dataset containing over 4.7M of carefully preprocessed parametric CAD sketches. Use this dataset to validate the proposed generative models. The experiments presented in this work significantly surpass the scale of those reported in the literature both in terms of the amount of training data and the model capacity.
The researchers first encode a sketch as a sequence of tokens in the form of byte and triplet representations of the sketch. They then decompose the joint distribution over this sequence of tokens as a product of conditional distributions. Following the standard approach for modelling sequential data, they employ an autoregressive neural network parameterized by theta to obtain the conditional distribution of the tokens, from which they can estimate the distribution of 2D sketches by the maximization of the log-likelihood of the dataset. More concretely, they employ a transformer decoder architecture to map token representations into another vector that can then be decoded into parameters of the conditional distribution of the tokens.
Along with their proposed sketches-from-scratch generation model, the team also introduces a conditional model that performs sketch generation based on visual renderings or drawings. This modified model relies on the same transformer-based architecture with additional input sequences obtained by embedding the conditioning image via a visual transformer. This schema enables the conditional model to be conveniently contained within the same transformer framework and the generator to attend to only the relevant parts of an image during processing.
The team’s experimental evaluations of the proposed models and entities and constraints sampled from the triple model demonstrate that the inferred constraints are reasonable most of the time. The team also measured the mean number of bits per object in a sketch for various models, with the results indicating that the proposed conditional model achieves a significantly better fit than the unconditional variants.
The study shows that a novel combination of a general-purpose language modelling technique and an off-the-shelf data serialization protocol can effectively generate sketches of complex structured objects. The team hopes this work can pave the way for further advances in automated CAD.
The paper Computer-Aided Design as Language is on arXiv.
Author: Hecate He | Editor: Michael Sarazen
We know you don’t want to miss any news or research breakthroughs. Subscribe to our popular newsletter Synced Global AI Weekly to get weekly AI updates.